More style-only changes.
authorDavid Robillard <d@drobilla.net>
Mon, 21 Jan 2013 02:35:53 +0000 (02:35 +0000)
committerDavid Robillard <d@drobilla.net>
Mon, 21 Jan 2013 02:35:53 +0000 (02:35 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13939 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/midi_diskstream.h
libs/ardour/ardour/midi_source.h
libs/ardour/midi_source.cc
libs/ardour/smf_source.cc

index 26a27a87e4bd02df3daf62bd3ddf8e949ba4aef7..45ea975ea9ad52be9f2660b32856142f493d5509 100644 (file)
@@ -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 */
index 1a7f3b07c570abada94f9fa1a80869df548b34d2..ed2950e9e5c9d35a4d95d3a206d89b2389eee3ee 100644 (file)
@@ -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;
 
index ff3ff55ced038108305faa219225778b27cf31c4..7ec82ed4e65436e9722fe9c167ead01f2daf1f8e 100644 (file)
@@ -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;
index 626676ea83286a479738628e8813e8b727f0c0fe..2b4c7ef7c9afb91d4f4120a274bad7ea5d5ed602 100644 (file)
@@ -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();