add port connect/add/remove callbacks to the ALSA backend

This fixes issues with new ports not (always) appearing in port matrices (and presumably
elsewhere too)
This commit is contained in:
Paul Davis 2020-04-10 09:53:44 -06:00
parent b943cec756
commit 2a80832243
1 changed files with 11 additions and 2 deletions

View File

@ -2210,9 +2210,13 @@ AlsaAudioPort::AlsaAudioPort (AlsaAudioBackend &b, const std::string& name, Port
{
memset (_buffer, 0, sizeof (_buffer));
mlock (_buffer, sizeof (_buffer));
_backend.port_connect_add_remove_callback (); // XXX -> RT
}
AlsaAudioPort::~AlsaAudioPort () { }
AlsaAudioPort::~AlsaAudioPort ()
{
_backend.port_connect_add_remove_callback (); // XXX -> RT
}
void*
AlsaAudioPort::get_buffer (pframes_t n_samples)
@ -2253,9 +2257,14 @@ AlsaMidiPort::AlsaMidiPort (AlsaAudioBackend &b, const std::string& name, PortFl
_buffer[0].reserve(256);
_buffer[1].reserve(256);
_buffer[2].reserve(256);
_backend.port_connect_add_remove_callback (); // XXX -> RT
}
AlsaMidiPort::~AlsaMidiPort () { }
AlsaMidiPort::~AlsaMidiPort ()
{
_backend.port_connect_add_remove_callback (); // XXX -> RT
}
struct MidiEventSorter {
bool operator() (AlsaMidiEvent const& a, AlsaMidiEvent const& b) {