mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
add "centrally-parsed" property to MIDI::Port so that we can avoid the MidiUI loop from handling input for *all* MIDI ports created
git-svn-id: svn://localhost/ardour2/branches/3.0@11871 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a8094bb49c
commit
893b468858
3 changed files with 30 additions and 21 deletions
|
|
@ -133,6 +133,11 @@ MidiControlUI::reset_ports ()
|
||||||
boost::shared_ptr<const MIDI::Manager::PortList> plist = MIDI::Manager::instance()->get_midi_ports ();
|
boost::shared_ptr<const MIDI::Manager::PortList> plist = MIDI::Manager::instance()->get_midi_ports ();
|
||||||
|
|
||||||
for (MIDI::Manager::PortList::const_iterator i = plist->begin(); i != plist->end(); ++i) {
|
for (MIDI::Manager::PortList::const_iterator i = plist->begin(); i != plist->end(); ++i) {
|
||||||
|
|
||||||
|
if (!(*i)->centrally_parsed()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = (*i)->selectable ()) >= 0) {
|
if ((fd = (*i)->selectable ()) >= 0) {
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,9 @@ class Port {
|
||||||
const char *name () const { return _tagname.c_str(); }
|
const char *name () const { return _tagname.c_str(); }
|
||||||
bool ok () const { return _ok; }
|
bool ok () const { return _ok; }
|
||||||
|
|
||||||
|
bool centrally_parsed() const { return _centrally_parsed; }
|
||||||
|
void set_centrally_parsed(bool yn) { _centrally_parsed = yn; }
|
||||||
|
|
||||||
bool receives_input () const {
|
bool receives_input () const {
|
||||||
return _flags == IsInput;
|
return _flags == IsInput;
|
||||||
}
|
}
|
||||||
|
|
@ -144,18 +147,23 @@ private:
|
||||||
pframes_t _nframes_this_cycle;
|
pframes_t _nframes_this_cycle;
|
||||||
std::string _tagname;
|
std::string _tagname;
|
||||||
size_t _number;
|
size_t _number;
|
||||||
Channel *_channel[16];
|
Channel* _channel[16];
|
||||||
Parser *_parser;
|
Parser* _parser;
|
||||||
|
|
||||||
int create_port ();
|
|
||||||
|
|
||||||
jack_client_t* _jack_client;
|
jack_client_t* _jack_client;
|
||||||
jack_port_t* _jack_port;
|
jack_port_t* _jack_port;
|
||||||
framecnt_t _last_read_index;
|
framecnt_t _last_read_index;
|
||||||
timestamp_t _last_write_timestamp;
|
timestamp_t _last_write_timestamp;
|
||||||
|
RingBuffer< Evoral::Event<double> > output_fifo;
|
||||||
|
Evoral::EventRingBuffer<timestamp_t> input_fifo;
|
||||||
|
Glib::Mutex output_fifo_lock;
|
||||||
|
CrossThreadChannel xthread;
|
||||||
|
Flags _flags;
|
||||||
|
bool _centrally_parsed;
|
||||||
|
|
||||||
|
|
||||||
|
int create_port ();
|
||||||
|
|
||||||
/** Channel used to signal to the MidiControlUI that input has arrived */
|
/** Channel used to signal to the MidiControlUI that input has arrived */
|
||||||
CrossThreadChannel xthread;
|
|
||||||
|
|
||||||
std::string _connections;
|
std::string _connections;
|
||||||
PBD::ScopedConnection connect_connection;
|
PBD::ScopedConnection connect_connection;
|
||||||
|
|
@ -167,12 +175,6 @@ private:
|
||||||
|
|
||||||
static pthread_t _process_thread;
|
static pthread_t _process_thread;
|
||||||
|
|
||||||
RingBuffer< Evoral::Event<double> > output_fifo;
|
|
||||||
Evoral::EventRingBuffer<timestamp_t> input_fifo;
|
|
||||||
|
|
||||||
Glib::Mutex output_fifo_lock;
|
|
||||||
|
|
||||||
Flags _flags;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PortSet {
|
struct PortSet {
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,11 @@ Port::Port (string const & name, Flags flags, jack_client_t* jack_client)
|
||||||
, _jack_client (jack_client)
|
, _jack_client (jack_client)
|
||||||
, _jack_port (0)
|
, _jack_port (0)
|
||||||
, _last_read_index (0)
|
, _last_read_index (0)
|
||||||
, xthread (true)
|
|
||||||
, output_fifo (512)
|
, output_fifo (512)
|
||||||
, input_fifo (1024)
|
, input_fifo (1024)
|
||||||
|
, xthread (true)
|
||||||
, _flags (flags)
|
, _flags (flags)
|
||||||
|
, _centrally_parsed (true)
|
||||||
{
|
{
|
||||||
assert (jack_client);
|
assert (jack_client);
|
||||||
init (name, flags);
|
init (name, flags);
|
||||||
|
|
@ -66,9 +67,10 @@ Port::Port (const XMLNode& node, jack_client_t* jack_client)
|
||||||
, _jack_client (jack_client)
|
, _jack_client (jack_client)
|
||||||
, _jack_port (0)
|
, _jack_port (0)
|
||||||
, _last_read_index (0)
|
, _last_read_index (0)
|
||||||
, xthread (true)
|
|
||||||
, output_fifo (512)
|
, output_fifo (512)
|
||||||
, input_fifo (1024)
|
, input_fifo (1024)
|
||||||
|
, xthread (true)
|
||||||
|
, _centrally_parsed (true)
|
||||||
{
|
{
|
||||||
assert (jack_client);
|
assert (jack_client);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue