diff options
author | David Robillard <d@drobilla.net> | 2015-02-21 23:32:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-02-21 23:32:51 +0000 |
commit | d0b8f2a3a5dc1bde35e72f6dffd65b6da861fc6e (patch) | |
tree | a67f17c0ab854e06884bc85832af57f6438161e5 /src | |
parent | 845868bb4ec34e1bf2b0bbde937777725e167018 (diff) | |
download | patchage-d0b8f2a3a5dc1bde35e72f6dffd65b6da861fc6e.tar.gz patchage-d0b8f2a3a5dc1bde35e72f6dffd65b6da861fc6e.tar.bz2 patchage-d0b8f2a3a5dc1bde35e72f6dffd65b6da861fc6e.zip |
Order ports deterministically.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5593 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index ec7fd5e..e24cf04 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -85,6 +85,17 @@ configure_cb(GtkWindow* parentWindow, GdkEvent* event, gpointer data) return FALSE; } +static int +port_order(const GanvPort* a, const GanvPort* b, void* data) +{ + const PatchagePort* pa = dynamic_cast<const PatchagePort*>(Glib::wrap(a)); + const PatchagePort* pb = dynamic_cast<const PatchagePort*>(Glib::wrap(b)); + if (pa && pb) { + return pa->name().compare(pb->name()); + } + return 0; +} + struct ProjectList_column_record : public Gtk::TreeModel::ColumnRecord { Gtk::TreeModelColumn<Glib::ustring> label; }; @@ -277,6 +288,7 @@ Patchage::Patchage(int argc, char** argv) _conf->load(); _canvas->set_zoom(_conf->get_zoom()); _canvas->set_font_size(_conf->get_font_size()); + _canvas->set_port_order(port_order, NULL); _main_win->resize( static_cast<int>(_conf->get_window_size().x), |