mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 11:06:32 +01:00
Clean/strengthen up constructor/type stuff in new port system.
git-svn-id: svn://localhost/ardour2/trunk@2572 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0cb6567836
commit
f53f2e8e33
11 changed files with 19 additions and 28 deletions
|
|
@ -33,8 +33,6 @@ class AudioEngine;
|
|||
|
||||
class AudioPort : public virtual Port {
|
||||
public:
|
||||
DataType type() const { return DataType::AUDIO; }
|
||||
|
||||
virtual Buffer& get_buffer () {
|
||||
return _buffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ class MidiPort : public virtual Port {
|
|||
public:
|
||||
virtual ~MidiPort();
|
||||
|
||||
DataType type() const { return DataType::MIDI; }
|
||||
|
||||
Buffer& get_buffer() {
|
||||
return _buffer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@ class Port : public virtual sigc::trackable {
|
|||
if (_metering) { _metering--; }
|
||||
}
|
||||
|
||||
virtual DataType type() const = 0;
|
||||
DataType type() const { return _type; }
|
||||
|
||||
virtual void cycle_start(nframes_t nframes) {}
|
||||
virtual void cycle_end() {}
|
||||
virtual Buffer& get_buffer() = 0;
|
||||
|
|
@ -97,7 +98,7 @@ class Port : public virtual sigc::trackable {
|
|||
protected:
|
||||
friend class AudioEngine;
|
||||
|
||||
Port (Flags);
|
||||
Port (DataType, Flags);
|
||||
|
||||
virtual int disconnect () = 0;
|
||||
virtual void recompute_total_latency() const = 0;
|
||||
|
|
@ -105,8 +106,8 @@ class Port : public virtual sigc::trackable {
|
|||
|
||||
/* engine isn't supposed to access below here */
|
||||
|
||||
Flags _flags;
|
||||
std::string _type;
|
||||
Flags _flags;
|
||||
const DataType _type;
|
||||
std::string _name;
|
||||
unsigned short _metering;
|
||||
bool _last_monitor;
|
||||
|
|
|
|||
|
|
@ -27,16 +27,14 @@ nframes_t AudioPort::_short_over_length = 2;
|
|||
nframes_t AudioPort::_long_over_length = 10;
|
||||
|
||||
AudioPort::AudioPort(Flags flags)
|
||||
: Port (flags), _buffer (0)
|
||||
: Port (DataType::AUDIO, flags), _buffer (0)
|
||||
{
|
||||
_type = DataType::AUDIO;
|
||||
reset();
|
||||
}
|
||||
|
||||
AudioPort::AudioPort(Flags flags, nframes_t nframes)
|
||||
: Port (flags), _buffer (nframes)
|
||||
: Port (DataType::AUDIO, flags), _buffer (nframes)
|
||||
{
|
||||
_type = DataType::AUDIO;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@ InternalAudioPort::default_mixdown (const list<InternalPort*>& ports, AudioBuffe
|
|||
}
|
||||
}
|
||||
|
||||
InternalAudioPort::InternalAudioPort(const string& name, Flags flgs)
|
||||
: Port (flgs)
|
||||
, AudioPort (flgs, engine->frames_per_cycle())
|
||||
, InternalPort (name, DataType::AUDIO, flgs)
|
||||
InternalAudioPort::InternalAudioPort(const string& name, Flags flags)
|
||||
: Port (DataType::AUDIO, flags)
|
||||
, AudioPort (flags, engine->frames_per_cycle())
|
||||
, InternalPort (name, DataType::AUDIO, flags)
|
||||
{
|
||||
_mixdown = default_mixdown;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,10 +35,9 @@ InternalPort::set_engine (AudioEngine* e)
|
|||
}
|
||||
|
||||
InternalPort::InternalPort (const string& str, DataType type, Flags flags)
|
||||
: Port (flags)
|
||||
: Port (type, flags)
|
||||
{
|
||||
set_name (str);
|
||||
_type = type;
|
||||
}
|
||||
|
||||
InternalPort::~InternalPort ()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
using namespace ARDOUR;
|
||||
|
||||
JackAudioPort::JackAudioPort(const std::string& name, Flags flgs)
|
||||
: Port (flgs), AudioPort (flgs), JackPort (name, DataType::AUDIO, flgs)
|
||||
: Port (DataType::AUDIO, flgs), AudioPort (flgs), JackPort (name, DataType::AUDIO, flgs)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
using namespace ARDOUR;
|
||||
JackMidiPort::JackMidiPort (const std::string& name, Flags flgs)
|
||||
: Port (flgs)
|
||||
: Port (DataType::MIDI, flgs)
|
||||
, JackPort (name, DataType::MIDI, flgs)
|
||||
, MidiPort (flgs, 4096) // FIXME FIXME FIXME Jack needs to tell us this
|
||||
, _nframes_this_cycle(0)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ using namespace std;
|
|||
AudioEngine* JackPort::engine = 0;
|
||||
|
||||
JackPort::JackPort (const std::string& name, DataType type, Flags flgs)
|
||||
: Port (flgs), _port (0)
|
||||
: Port (type, flgs), _port (0)
|
||||
{
|
||||
_port = jack_port_register (engine->jack(), name.c_str(), type.to_jack_type(), flgs, 0);
|
||||
|
||||
|
|
@ -39,8 +39,6 @@ JackPort::JackPort (const std::string& name, DataType type, Flags flgs)
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
_flags = flgs;
|
||||
_type = type;
|
||||
_name = jack_port_name (_port);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,10 @@ using namespace ARDOUR;
|
|||
using namespace std;
|
||||
|
||||
MidiPort::MidiPort (Flags flags, nframes_t bufsize)
|
||||
: Port (flags), _buffer (bufsize)
|
||||
: Port (DataType::MIDI, flags)
|
||||
, _buffer (bufsize)
|
||||
{
|
||||
_type = DataType::MIDI;
|
||||
reset();
|
||||
|
||||
|
||||
}
|
||||
|
||||
MidiPort::~MidiPort()
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@
|
|||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
||||
Port::Port (Flags flags)
|
||||
Port::Port (DataType type, Flags flags)
|
||||
: _flags (flags)
|
||||
, _type (type)
|
||||
, _metering (0)
|
||||
, _last_monitor (false)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue