From d0b8f2a3a5dc1bde35e72f6dffd65b6da861fc6e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 21 Feb 2015 23:32:51 +0000 Subject: Order ports deterministically. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5593 a436a847-0d15-0410-975c-d299462d15a1 --- NEWS | 3 ++- src/Patchage.cpp | 12 ++++++++++++ wscript | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index da619ad..cf707c3 100644 --- a/NEWS +++ b/NEWS @@ -3,12 +3,13 @@ patchage (1.0.1) unstable; * Support Jack CV and OSC via metadata. * Add support for exporting canvas as PDF. * Save window size and position when closed via window manager. + * Order ports deterministically. * Style messages pane to match canvas. * Restore messages pane visibility and height. * Configure based on compiler target OS for cross-compilation. * Fix compilation with Jack DBus. - -- David Robillard Sun, 08 Feb 2015 11:03:20 -0500 + -- David Robillard Sat, 21 Feb 2015 17:10:27 -0500 patchage (1.0.0) stable; 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(Glib::wrap(a)); + const PatchagePort* pb = dynamic_cast(Glib::wrap(b)); + if (pa && pb) { + return pa->name().compare(pb->name()); + } + return 0; +} + struct ProjectList_column_record : public Gtk::TreeModel::ColumnRecord { Gtk::TreeModelColumn 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(_conf->get_window_size().x), diff --git a/wscript b/wscript index bec3370..223d94b 100644 --- a/wscript +++ b/wscript @@ -58,7 +58,7 @@ def configure(conf): autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM', atleast_version='2.12.0', mandatory=True) autowaf.check_pkg(conf, 'ganv-1', uselib_store='GANV', - atleast_version='1.5.1', mandatory=True) + atleast_version='1.5.2', mandatory=True) if conf.env.DEST_OS == 'darwin': autowaf.check_pkg(conf, 'gtk-mac-integration', uselib_store='GTK_OSX', -- cgit v1.2.1