summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-21 02:35:53 +0000
committerDavid Robillard <d@drobilla.net>2013-01-21 02:35:53 +0000
commit76547b5c4b7fb2d4fbb7db9f12427b439da34a43 (patch)
tree9037a407c4fbe5079a42e43e71d22791042369c2 /libs/ardour
parentb40464e67c431f073e6f755a62e92b930b07c18e (diff)
More style-only changes.
git-svn-id: svn://localhost/ardour2/branches/3.0@13939 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/midi_diskstream.h2
-rw-r--r--libs/ardour/ardour/midi_source.h37
-rw-r--r--libs/ardour/midi_source.cc14
-rw-r--r--libs/ardour/smf_source.cc56
4 files changed, 60 insertions, 49 deletions
diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h
index 26a27a87e4..45ea975ea9 100644
--- a/libs/ardour/ardour/midi_diskstream.h
+++ b/libs/ardour/ardour/midi_diskstream.h
@@ -200,7 +200,7 @@ class MidiDiskstream : public Diskstream
the GUI to read (so that it can update itself).
*/
MidiBuffer _gui_feed_buffer;
- mutable Glib::Threads::Mutex _gui_feed_buffer_mutex;
+ mutable Glib::Threads::Mutex _gui_feed_buffer_mutex;
};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 1a7f3b07c5..ed2950e9e5 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -61,19 +61,25 @@ class MidiSource : virtual public Source, public boost::enable_shared_from_this<
* \param tracker an optional pointer to MidiStateTracker object, for note on/off tracking
*/
virtual framecnt_t midi_read (Evoral::EventSink<framepos_t>& dst,
- framepos_t source_start,
- framepos_t start, framecnt_t cnt,
- MidiStateTracker*,
- std::set<Evoral::Parameter> const &) const;
-
+ framepos_t source_start,
+ framepos_t start,
+ framecnt_t cnt,
+ MidiStateTracker* tracker,
+ std::set<Evoral::Parameter> const &) const;
+
+ /** Write data from a MidiRingBuffer to this source.
+ * @param source Source to read from.
+ * @param source_start This source's start position in session frames.
+ * @param cnt The length of time to write.
+ */
virtual framecnt_t midi_write (MidiRingBuffer<framepos_t>& src,
- framepos_t source_start,
- framecnt_t cnt);
+ framepos_t source_start,
+ framecnt_t cnt);
virtual void append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& ev) = 0;
virtual void append_event_unlocked_frames(const Evoral::Event<framepos_t>& ev,
- framepos_t source_start) = 0;
+ framepos_t source_start) = 0;
virtual bool empty () const;
virtual framecnt_t length (framepos_t pos) const;
@@ -89,7 +95,9 @@ class MidiSource : virtual public Source, public boost::enable_shared_from_this<
* when recording actual MIDI input, rather then when importing files
* etc.
*/
- virtual void mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption, Evoral::MusicalTime when = 0);
+ virtual void mark_midi_streaming_write_completed (
+ Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption stuck_option,
+ Evoral::MusicalTime when = 0);
virtual void session_saved();
@@ -144,13 +152,14 @@ class MidiSource : virtual public Source, public boost::enable_shared_from_this<
virtual void flush_midi() = 0;
virtual framecnt_t read_unlocked (Evoral::EventSink<framepos_t>& dst,
- framepos_t position,
- framepos_t start, framecnt_t cnt,
- MidiStateTracker* tracker) const = 0;
+ framepos_t position,
+ framepos_t start,
+ framecnt_t cnt,
+ MidiStateTracker* tracker) const = 0;
virtual framecnt_t write_unlocked (MidiRingBuffer<framepos_t>& dst,
- framepos_t position,
- framecnt_t cnt) = 0;
+ framepos_t position,
+ framecnt_t cnt) = 0;
std::string _captured_for;
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index ff3ff55ced..7ec82ed4e6 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -254,21 +254,19 @@ MidiSource::midi_read (Evoral::EventSink<framepos_t>& dst, framepos_t source_sta
}
}
-/** Write data from a MidiRingBuffer to this source.
- * @param source Source to read from.
- * @param source_start This source's start position in session frames.
- */
framecnt_t
-MidiSource::midi_write (MidiRingBuffer<framepos_t>& source, framepos_t source_start, framecnt_t duration)
+MidiSource::midi_write (MidiRingBuffer<framepos_t>& source,
+ framepos_t source_start,
+ framecnt_t cnt)
{
Glib::Threads::Mutex::Lock lm (_lock);
- const framecnt_t ret = write_unlocked (source, source_start, duration);
+ const framecnt_t ret = write_unlocked (source, source_start, cnt);
- if (duration == max_framecnt) {
+ if (cnt == max_framecnt) {
_last_read_end = 0;
} else {
- _last_write_end += duration;
+ _last_write_end += cnt;
}
return ret;
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 626676ea83..2b4c7ef7c9 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -65,7 +65,7 @@ SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags)
throw failed_constructor ();
}
- /* file is not opened until write */
+ /* file is not opened until write */
}
/** Constructor used for existing internal-to-session files. */
@@ -90,7 +90,7 @@ SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist)
throw failed_constructor ();
}
- _open = true;
+ _open = true;
}
SMFSource::~SMFSource ()
@@ -104,25 +104,27 @@ int
SMFSource::open_for_write ()
{
if (create (_path)) {
- return -1;
- }
- _open = true;
- return 0;
+ return -1;
+ }
+ _open = true;
+ return 0;
}
/** All stamps in audio frames */
framecnt_t
-SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, framepos_t const source_start,
- framepos_t start, framecnt_t duration,
- MidiStateTracker* tracker) const
+SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination,
+ framepos_t const source_start,
+ framepos_t start,
+ framecnt_t duration,
+ MidiStateTracker* tracker) const
{
int ret = 0;
uint64_t time = 0; // in SMF ticks, 1 tick per _ppqn
- if (writable() && !_open) {
- /* nothing to read since nothing has ben written */
- return duration;
- }
+ if (writable() && !_open) {
+ /* nothing to read since nothing has ben written */
+ return duration;
+ }
DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: start %1 duration %2\n", start, duration));
@@ -214,11 +216,13 @@ SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, framepos_t
* @param position This source's start position in session frames.
*/
framecnt_t
-SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, framepos_t position, framecnt_t duration)
+SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source,
+ framepos_t position,
+ framecnt_t duration)
{
- if (!_writing) {
- mark_streaming_write_started ();
- }
+ if (!_writing) {
+ mark_streaming_write_started ();
+ }
framepos_t time;
Evoral::EventType type;
@@ -405,13 +409,13 @@ SMFSource::set_state (const XMLNode& node, int version)
void
SMFSource::mark_streaming_midi_write_started (NoteMode mode)
{
- /* CALLER MUST HOLD LOCK */
+ /* CALLER MUST HOLD LOCK */
- if (!_open && open_for_write()) {
- error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg;
- /* XXX should probably throw or return something */
- return;
- }
+ if (!_open && open_for_write()) {
+ error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg;
+ /* XXX should probably throw or return something */
+ return;
+ }
MidiSource::mark_streaming_midi_write_started (mode);
Evoral::SMF::begin_write ();
@@ -489,9 +493,9 @@ SMFSource::load_model (bool lock, bool force_reload)
_model->clear();
}
- if (writable() && !_open) {
- return;
- }
+ if (writable() && !_open) {
+ return;
+ }
_model->start_write();
Evoral::SMF::seek_to_start();