Re-work Port construction slightly so that _flags is always initialised before reset...
authorCarl Hetherington <carl@carlh.net>
Tue, 23 Oct 2007 14:02:15 +0000 (14:02 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 23 Oct 2007 14:02:15 +0000 (14:02 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2568 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/audio_port.h
libs/ardour/ardour/midi_port.h
libs/ardour/ardour/port.h
libs/ardour/audio_port.cc
libs/ardour/internal_audio_port.cc
libs/ardour/internal_port.cc
libs/ardour/jack_audio_port.cc
libs/ardour/jack_midi_port.cc
libs/ardour/jack_port.cc
libs/ardour/midi_port.cc
libs/ardour/port.cc

index 035ac9ed5fa216cf35ee251ab52d5b173d276d7a..e412e09bc4652a0cac0a1b3ad02b57748a971eef 100644 (file)
@@ -70,8 +70,8 @@ class AudioPort : public virtual Port {
   protected:
        friend class AudioEngine;
 
-       AudioPort ();          // data buffer comes from elsewhere (e.g. JACK)
-       AudioPort (nframes_t); // data buffer owned by ardour
+       AudioPort (Flags);            // data buffer comes from elsewhere (e.g. JACK)
+       AudioPort (Flags, nframes_t); // data buffer owned by ardour
        void reset ();
        
        /* engine isn't supposed to access below here */
index 48ebf31eef0fa2983c51c2bc1f3be670584f13c3..3711373c317c8c39b732a46afbe2e45a5d79bd5d 100644 (file)
@@ -51,7 +51,7 @@ class MidiPort : public virtual Port {
   protected:
        friend class AudioEngine;
 
-       MidiPort (nframes_t bufsize);
+       MidiPort (Flags, nframes_t bufsize);
        
        /* engine isn't supposed to access below here */
 
index 860dec994fad4b099807f08843ff26d010a0cd03..5c8192b6e86172c08fa9ab6636a05edaf0be956a 100644 (file)
@@ -97,7 +97,7 @@ class Port : public virtual sigc::trackable {
   protected:
        friend class AudioEngine;
 
-       Port ();
+       Port (Flags);
 
        virtual int disconnect () = 0;
        virtual void recompute_total_latency() const = 0;
index aa8b363134627123d028b8deea7aa152357a0bba..2e3682fe3b43b8d4d6187f82676a4a1e7a871797 100644 (file)
@@ -26,15 +26,15 @@ using namespace std;
 nframes_t AudioPort::_short_over_length = 2;
 nframes_t AudioPort::_long_over_length = 10;
 
-AudioPort::AudioPort()
-       : _buffer (0)
+AudioPort::AudioPort(Flags flags)
+       : Port (flags), _buffer (0)
 {
        _type = DataType::AUDIO;
        reset();
 }
 
-AudioPort::AudioPort(nframes_t nframes)
-       : _buffer (nframes)
+AudioPort::AudioPort(Flags flags, nframes_t nframes)
+       : Port (flags), _buffer (nframes)
 {
        _type = DataType::AUDIO;
        reset();
index f5c5c5dee993a33799fd7543f813252cba84aae8..b6356cb6fb27db1b275619381bd921f0b3a3f5f2 100644 (file)
@@ -36,7 +36,8 @@ InternalAudioPort::default_mixdown (const list<InternalPort*>& ports, AudioBuffe
 }
 
 InternalAudioPort::InternalAudioPort(const string& name, Flags flgs)
-       : AudioPort (engine->frames_per_cycle())
+       : Port (flgs)
+       , AudioPort (flgs, engine->frames_per_cycle())
        , InternalPort (name, DataType::AUDIO, flgs)
 {
        _mixdown = default_mixdown;
index 3854931819de9c7f27cf3f80d5582a3b96432305..620fd69caa5072f8d37a4d1cf5e2d28355f737a0 100644 (file)
@@ -35,10 +35,10 @@ InternalPort::set_engine (AudioEngine* e)
 }
 
 InternalPort::InternalPort (const string& str, DataType type, Flags flags)
+       : Port (flags)
 {
        set_name (str);
        _type = type;
-       _flags = flags;
 }
 
 InternalPort::~InternalPort ()
index 83a6875f7d9b82102697c17cd56a5ac1c10b5258..acba8a787c01e6f473c54902a53a13c4029a2215 100644 (file)
@@ -23,7 +23,7 @@
 using namespace ARDOUR;
 
 JackAudioPort::JackAudioPort(const std::string& name, Flags flgs)
-       : JackPort (name, DataType::AUDIO, flgs)
+       : Port (flgs), AudioPort (flgs), JackPort (name, DataType::AUDIO, flgs)
 {
 
 }
index 90ee93371df47891deba8debbb0ebb71ee1992f1..109d7ca9e6f03b6648441b8b803b3455162d9379 100644 (file)
@@ -21,8 +21,9 @@
 
 using namespace ARDOUR;
 JackMidiPort::JackMidiPort (const std::string& name, Flags flgs)
-       : JackPort (name, DataType::MIDI, flgs)
-       , MidiPort (4096) // FIXME FIXME FIXME Jack needs to tell us this
+       : Port (flgs)
+       , JackPort (name, DataType::MIDI, flgs)
+       , MidiPort (flgs, 4096) // FIXME FIXME FIXME Jack needs to tell us this
        , _nframes_this_cycle(0)
 {
 }
index 221e46b076ad1d9551565ea447bf4eabedabeec1..02582d833e9dd6c8ebfcdc00baba9c926455e9f7 100644 (file)
@@ -31,7 +31,7 @@ using namespace std;
 AudioEngine* JackPort::engine = 0;
 
 JackPort::JackPort (const std::string& name, DataType type, Flags flgs) 
-       : _port (0)
+       : Port (flgs), _port (0)
 {
        _port = jack_port_register (engine->jack(), name.c_str(), type.to_jack_type(), flgs, 0);
 
index df4ab190083d370ade906b8f74721e51a5efed1a..bd7252879465c456066ce0454dae727704ba28b7 100644 (file)
@@ -25,8 +25,8 @@
 using namespace ARDOUR;
 using namespace std;
 
-MidiPort::MidiPort (nframes_t bufsize)
-       : _buffer (bufsize) 
+MidiPort::MidiPort (Flags flags, nframes_t bufsize)
+       : Port (flags), _buffer (bufsize) 
 {
        _type = DataType::MIDI;
        reset();
index bfc1eaf279d1efdadf7288c9a562a7deffd90658..f65ce9906bda96eaa5b7c7319a183e6b721b85c7 100644 (file)
@@ -22,8 +22,9 @@
 using namespace ARDOUR;
 using namespace std;
 
-Port::Port ()
-       : _metering (0)
+Port::Port (Flags flags)
+       : _flags (flags)
+       , _metering (0)
        , _last_monitor (false)
 {
 }