pre-sort port-names
This commit is contained in:
parent
bda5a4a4e6
commit
f84a7605d8
@ -409,8 +409,16 @@ class AlsaAudioBackend : public AudioBackend {
|
|||||||
std::vector<AlsaPort *> _system_midi_in;
|
std::vector<AlsaPort *> _system_midi_in;
|
||||||
std::vector<AlsaPort *> _system_midi_out;
|
std::vector<AlsaPort *> _system_midi_out;
|
||||||
|
|
||||||
|
struct SortByPortName
|
||||||
|
{
|
||||||
|
bool operator ()(const AlsaPort* lhs, const AlsaPort* rhs) const
|
||||||
|
{
|
||||||
|
return lhs->name () < rhs->name ();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
typedef std::map<std::string, AlsaPort *> PortMap; // fast lookup in _ports
|
typedef std::map<std::string, AlsaPort *> PortMap; // fast lookup in _ports
|
||||||
typedef std::set<AlsaPort *> PortIndex; // fast lookup in _ports
|
typedef std::set<AlsaPort *, SortByPortName> PortIndex; // fast lookup in _ports
|
||||||
PortMap _portmap;
|
PortMap _portmap;
|
||||||
PortIndex _ports;
|
PortIndex _ports;
|
||||||
|
|
||||||
|
@ -466,8 +466,16 @@ class CoreAudioBackend : public AudioBackend {
|
|||||||
std::vector<CoreBackendPort *> _system_midi_in;
|
std::vector<CoreBackendPort *> _system_midi_in;
|
||||||
std::vector<CoreBackendPort *> _system_midi_out;
|
std::vector<CoreBackendPort *> _system_midi_out;
|
||||||
|
|
||||||
|
struct SortByPortName
|
||||||
|
{
|
||||||
|
bool operator ()(const CoreBackendPort* lhs, const CoreBackendPort* rhs) const
|
||||||
|
{
|
||||||
|
return lhs->name () < rhs->name ();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
typedef std::map<std::string, CoreBackendPort *> PortMap; // fast lookup in _ports
|
typedef std::map<std::string, CoreBackendPort *> PortMap; // fast lookup in _ports
|
||||||
typedef std::set<CoreBackendPort *> PortIndex; // fast lookup in _ports
|
typedef std::set<CoreBackendPort *, SortByPortName> PortIndex; // fast lookup in _ports
|
||||||
PortMap _portmap;
|
PortMap _portmap;
|
||||||
PortIndex _ports;
|
PortIndex _ports;
|
||||||
|
|
||||||
|
@ -451,8 +451,16 @@ class DummyAudioBackend : public AudioBackend {
|
|||||||
std::vector<DummyMidiPort *> _system_midi_in;
|
std::vector<DummyMidiPort *> _system_midi_in;
|
||||||
std::vector<DummyMidiPort *> _system_midi_out;
|
std::vector<DummyMidiPort *> _system_midi_out;
|
||||||
|
|
||||||
|
struct SortByPortName
|
||||||
|
{
|
||||||
|
bool operator ()(const DummyPort* lhs, const DummyPort* rhs) const
|
||||||
|
{
|
||||||
|
return lhs->name () < rhs->name ();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
typedef std::map<std::string, DummyPort *> PortMap; // fast lookup in _ports
|
typedef std::map<std::string, DummyPort *> PortMap; // fast lookup in _ports
|
||||||
typedef std::set<DummyPort *> PortIndex; // fast lookup in _ports
|
typedef std::set<DummyPort *, SortByPortName> PortIndex; // fast lookup in _ports
|
||||||
PortMap _portmap;
|
PortMap _portmap;
|
||||||
PortIndex _ports;
|
PortIndex _ports;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user