diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-06 15:54:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-06 15:54:48 +0000 |
commit | 1a680ddc13517e32c0c658488279a95730dd3348 (patch) | |
tree | 5f748b9f6e5e983eed5c06506fab13f3cc26a9b9 /gtk2_ardour | |
parent | 70f4274c0116314e49fe8fa687171595e8a05431 (diff) |
more industrial-strength-ifying of io connection name cleanup
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5742 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index d0687485cf..4861efd07c 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -829,7 +829,7 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt Port *port; const char **connections; - uint32_t connection_index; + uint32_t connection_index = 0; uint32_t total_connection_count = 0; uint32_t io_connection_count = 0; uint32_t ardour_connection_count = 0; @@ -883,7 +883,10 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt if (connection_name.find("ardour:") == 0) { if (ardour_track_name.empty()) { // "ardour:Master/in 1" -> "ardour:Master/" - ardour_track_name = connection_name.substr(0, connection_name.find("/") + 1); + string::size_type slash = connection_name.find("/"); + if (slash != string::npos) { + ardour_track_name = connection_name.substr(0, slash + 1); + } } if (connection_name.find(ardour_track_name) == 0) { @@ -943,8 +946,11 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt if ((total_connection_count == ardour_connection_count)) { // all connections are to the same track in ardour // "ardour:Master/" -> "Master" - label << ardour_track_name.substr(7, ardour_track_name.find("/") - 7); - have_label = true; + string::size_type slash = ardour_track_name.find("/"); + if (slash != string::npos) { + label << ardour_track_name.substr(7, slash - 7); + have_label = true; + } } else if (total_connection_count == system_connection_count) { // all connections are to system ports |