Sort ports by name in the connnection-matrix
This should fix a long-standing issue with interleaved display of clients since jack_get_ports() does not return a well defined order. (Internal backends based on Ardour::PortEngine keep ports sorted)
This commit is contained in:
parent
191dbf7c34
commit
faa1e984ab
@ -26,6 +26,8 @@
|
||||
|
||||
#include "midi++/mmc.h"
|
||||
|
||||
#include "pbd/natsort.h"
|
||||
|
||||
#include "ardour/audio_port.h"
|
||||
#include "ardour/async_midi_port.h"
|
||||
#include "ardour/audioengine.h"
|
||||
@ -583,6 +585,14 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
||||
|
||||
if (ports.size () > 0) {
|
||||
|
||||
struct SortByPortName {
|
||||
bool operator() (std::string const& lhs, std::string const& rhs) const {
|
||||
return PBD::naturally_less (lhs.c_str (), rhs.c_str ());
|
||||
}
|
||||
} port_sorter;
|
||||
|
||||
std::sort (ports.begin (), ports.end (), port_sorter);
|
||||
|
||||
for (vector<string>::const_iterator s = ports.begin(); s != ports.end(); ++s) {
|
||||
|
||||
std::string const p = *s;
|
||||
|
Loading…
Reference in New Issue
Block a user