diff options
author | Carl Hetherington <carl@carlh.net> | 2012-06-11 23:15:17 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-06-11 23:15:17 +0000 |
commit | cf0753a4bd4ed23d40fd06e8d1dec4f0b46da6fc (patch) | |
tree | 329caa9d5c0ab68d57566b424722016bbcff4ac8 /gtk2_ardour/route_time_axis.cc | |
parent | d97312d438a813985916dd35f613510e9448441f (diff) |
Patch from colinf to put the playlist / take name in the playlist button tooltip (#4833).
git-svn-id: svn://localhost/ardour2/branches/3.0@12666 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index d231442797..6841b5a35f 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -185,6 +185,11 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt) } rec_enable_button->set_sensitive (_session->writable()); + + /* set playlist button tip to the current playlist, and make it update when it changes */ + update_playlist_tip (); + track()->PlaylistChanged.connect (*this, invalidator (*this), ui_bind(&RouteTimeAxisView::update_playlist_tip, this), gui_context()); + } controls_hbox.pack_start(gm.get_level_meter(), false, false); @@ -204,7 +209,6 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt) ARDOUR_UI::instance()->set_tip(*solo_button,_("Solo")); ARDOUR_UI::instance()->set_tip(*mute_button,_("Mute")); ARDOUR_UI::instance()->set_tip(route_group_button, _("Route Group")); - ARDOUR_UI::instance()->set_tip(playlist_button,_("Playlist")); if (is_midi_track()) { ARDOUR_UI::instance()->set_tip(automation_button, _("MIDI Controllers and Automation")); @@ -1573,6 +1577,31 @@ RouteTimeAxisView::use_playlist (RadioMenuItem *item, boost::weak_ptr<Playlist> } void +RouteTimeAxisView::update_playlist_tip () +{ + RouteGroup* rg = route_group (); + if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::edit.property_id)) { + string group_string = "." + rg->name() + "."; + + string take_name = track()->playlist()->name(); + string::size_type idx = take_name.find(group_string); + + if (idx != string::npos) { + /* find the bit containing the take number / name */ + take_name = take_name.substr (idx + group_string.length()); + + /* set the playlist button tooltip to the take name */ + ARDOUR_UI::instance()->set_tip (playlist_button,string_compose(_("Take: %1.%2"), rg->name(), take_name)); + return; + } + } + + /* set the playlist button tooltip to the playlist name */ + ARDOUR_UI::instance()->set_tip (playlist_button, _("Playlist") + std::string(": ") + track()->playlist()->name()); +} + + +void RouteTimeAxisView::show_playlist_selector () { _editor.playlist_selector().show_for (this); |