diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index a1694bb2c4..af2e8d1da2 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -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::const_iterator s = ports.begin(); s != ports.end(); ++s) { std::string const p = *s;