mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
NO-OP: Consolidate PortConnect code into shared parent class
This commit is contained in:
parent
17ab174277
commit
a80064981e
12 changed files with 33 additions and 170 deletions
|
|
@ -77,11 +77,9 @@ DummyAudioBackend::DummyAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
|||
, _systemic_input_latency (0)
|
||||
, _systemic_output_latency (0)
|
||||
, _processed_samples (0)
|
||||
, _port_change_flag (false)
|
||||
{
|
||||
_instance_name = s_instance_name;
|
||||
_device = _("Silence");
|
||||
pthread_mutex_init (&_port_callback_mutex, 0);
|
||||
|
||||
if (_driver_speed.empty()) {
|
||||
_driver_speed.push_back (DriverSpeed (_("Half Speed"), 2.0f));
|
||||
|
|
@ -99,7 +97,6 @@ DummyAudioBackend::DummyAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
|||
DummyAudioBackend::~DummyAudioBackend ()
|
||||
{
|
||||
clear_ports ();
|
||||
pthread_mutex_destroy (&_port_callback_mutex);
|
||||
}
|
||||
|
||||
/* AUDIOBACKEND API */
|
||||
|
|
@ -1113,12 +1110,10 @@ DummyPort::DummyPort (DummyAudioBackend &b, const std::string& name, PortFlags f
|
|||
, _gen_cycle (false)
|
||||
, _engine (b)
|
||||
{
|
||||
_backend.port_connect_add_remove_callback();
|
||||
}
|
||||
|
||||
DummyPort::~DummyPort ()
|
||||
{
|
||||
_backend.port_connect_add_remove_callback();
|
||||
}
|
||||
|
||||
void DummyPort::setup_random_number_generator ()
|
||||
|
|
|
|||
|
|
@ -187,7 +187,6 @@ class DummyMidiPort : public DummyPort {
|
|||
}; // class DummyMidiPort
|
||||
|
||||
class DummyAudioBackend : public AudioBackend, public PortEngineSharedImpl {
|
||||
friend class DummyPort;
|
||||
public:
|
||||
DummyAudioBackend (AudioEngine& e, AudioBackendInfo& info);
|
||||
~DummyAudioBackend ();
|
||||
|
|
@ -405,31 +404,6 @@ class DummyAudioBackend : public AudioBackend, public PortEngineSharedImpl {
|
|||
/* port engine */
|
||||
int register_system_ports ();
|
||||
|
||||
struct PortConnectData {
|
||||
std::string a;
|
||||
std::string b;
|
||||
bool c;
|
||||
|
||||
PortConnectData (const std::string& a, const std::string& b, bool c)
|
||||
: a (a) , b (b) , c (c) {}
|
||||
};
|
||||
|
||||
std::vector<PortConnectData *> _port_connection_queue;
|
||||
pthread_mutex_t _port_callback_mutex;
|
||||
bool _port_change_flag;
|
||||
|
||||
void port_connect_callback (const std::string& a, const std::string& b, bool conn) {
|
||||
pthread_mutex_lock (&_port_callback_mutex);
|
||||
_port_connection_queue.push_back(new PortConnectData(a, b, conn));
|
||||
pthread_mutex_unlock (&_port_callback_mutex);
|
||||
}
|
||||
|
||||
void port_connect_add_remove_callback () {
|
||||
pthread_mutex_lock (&_port_callback_mutex);
|
||||
_port_change_flag = true;
|
||||
pthread_mutex_unlock (&_port_callback_mutex);
|
||||
}
|
||||
|
||||
BackendPort* port_factory (std::string const & name, ARDOUR::DataType type, ARDOUR::PortFlags);
|
||||
|
||||
}; // class DummyAudioBackend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue