diff options
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui2.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/button_joiner.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/button_joiner.h | 10 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 3 |
6 files changed, 23 insertions, 20 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 1a61b6f013..fb29f14c31 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -154,8 +154,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) , play_selection_controllable (new TransportControllable ("transport play selection", *this, TransportControllable::PlaySelection)) , rec_controllable (new TransportControllable ("transport rec-enable", *this, TransportControllable::RecordEnable)) - , transport_joiner (play_selection_button, roll_button) - , auto_return_button (ArdourButton::led_default_elements) , auto_play_button (ArdourButton::led_default_elements) , auto_input_button (ArdourButton::led_default_elements) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index ff6b7b301a..22898db372 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -67,7 +67,6 @@ #include "ardour_dialog.h" #include "ardour_button.h" -#include "button_joiner.h" #include "editing.h" #include "ui_config.h" #include "window_proxy.h" @@ -80,6 +79,7 @@ class ArdourStartup; class ArdourKeyboard; class AudioClock; class BundleManager; +class ButtonJoiner; class ConnectionEditor; class KeyEditor; class LocationUIWindow; @@ -424,7 +424,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr ArdourButton play_selection_button; ArdourButton rec_button; - ButtonJoiner transport_joiner; + ButtonJoiner* transport_joiner; void toggle_external_sync (); void toggle_time_master (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index a7007eedf7..6013dca222 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -48,6 +48,7 @@ #include "public_editor.h" #include "audio_clock.h" #include "actions.h" +#include "button_joiner.h" #include "utils.h" #include "theme_manager.h" #include "midi_tracer.h" @@ -133,9 +134,7 @@ ARDOUR_UI::setup_tooltips () set_tip (goto_end_button, _("Go to end of session")); set_tip (auto_loop_button, _("Play loop range")); set_tip (midi_panic_button, _("MIDI Panic\nSend note off and reset controller messages on all MIDI channels")); - - set_tip (transport_joiner, _("Always Play Range Selection (if any)")); - + set_tip (*transport_joiner, _("Always Play Range Selection (if any)")); set_tip (auto_return_button, _("Return to last playback start when stopped")); set_tip (auto_play_button, _("Start playback after any locate")); set_tip (auto_input_button, _("Be sensible about input monitoring")); @@ -295,8 +294,10 @@ ARDOUR_UI::setup_transport () act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync")); sync_button.set_related_action (act); + transport_joiner = manage (new ButtonJoiner ("transport button", play_selection_button, roll_button)); + act = ActionManager::get_action (X_("Transport"), X_("AlwaysPlayRange")); - transport_joiner.set_related_action (act); + transport_joiner->set_related_action (act); /* clocks, etc. */ @@ -367,7 +368,7 @@ ARDOUR_UI::setup_transport () play_selection_button.set_rounded_corner_mask (0x1); /* upper left only */ roll_button.set_rounded_corner_mask (0x2); /* upper right only */ - tbox2->pack_start (transport_joiner, false, false); + tbox2->pack_start (*transport_joiner, false, false); tbox3->pack_start (stop_button, false, false); tbox3->pack_start (rec_button, false, false, 6); diff --git a/gtk2_ardour/button_joiner.cc b/gtk2_ardour/button_joiner.cc index 06078ea309..506b208f22 100644 --- a/gtk2_ardour/button_joiner.cc +++ b/gtk2_ardour/button_joiner.cc @@ -1,8 +1,10 @@ #include <iostream> #include <algorithm> + #include <gtkmm/toggleaction.h> +#include "pbd/compose.h" #include "gtkmm2ext/utils.h" #include "gtkmm2ext/rgb_macros.h" @@ -11,9 +13,10 @@ using namespace Gtk; -ButtonJoiner::ButtonJoiner (Gtk::Widget& l, Gtk::Widget& r) +ButtonJoiner::ButtonJoiner (const std::string& str, Gtk::Widget& l, Gtk::Widget& r) : left (l) , right (r) + , name (str) , active_fill_pattern (0) , inactive_fill_pattern (0) { @@ -189,15 +192,15 @@ ButtonJoiner::set_colors () active_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()); inactive_fill_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, get_height()); - start_color = ARDOUR_UI::config()->color_by_name ("transport button: fill start"); - end_color = ARDOUR_UI::config()->color_by_name ("transport button: fill end"); + start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start", name)); + end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end", name)); UINT_TO_RGBA (start_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0); UINT_TO_RGBA (end_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (inactive_fill_pattern, 1, r/255.0,g/255.0,b/255.0, a/255.0); - start_color = ARDOUR_UI::config()->color_by_name ("transport button: fill start active"); - end_color = ARDOUR_UI::config()->color_by_name ("transport button: fill end active"); + start_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill start active", name)); + end_color = ARDOUR_UI::config()->color_by_name (string_compose ("%1: fill end active", name)); UINT_TO_RGBA (start_color, &r, &g, &b, &a); cairo_pattern_add_color_stop_rgba (active_fill_pattern, 0, r/255.0,g/255.0,b/255.0, a/255.0); UINT_TO_RGBA (end_color, &r, &g, &b, &a); diff --git a/gtk2_ardour/button_joiner.h b/gtk2_ardour/button_joiner.h index b3913ef20d..1f0fc573ca 100644 --- a/gtk2_ardour/button_joiner.h +++ b/gtk2_ardour/button_joiner.h @@ -10,7 +10,7 @@ class ButtonJoiner : public CairoWidget, public Gtkmm2ext::Activatable { public: - ButtonJoiner (Gtk::Widget&, Gtk::Widget&); + ButtonJoiner (const std::string&, Gtk::Widget&, Gtk::Widget&); ~ButtonJoiner (); void set_related_action (Glib::RefPtr<Gtk::Action>); @@ -28,11 +28,11 @@ class ButtonJoiner : public CairoWidget, public Gtkmm2ext::Activatable { void action_toggled (); private: - Gtk::Widget& left; - Gtk::Widget& right; - Gtk::HBox packer; + Gtk::Widget& left; + Gtk::Widget& right; + Gtk::HBox packer; Gtk::Alignment align; - + std::string name; cairo_pattern_t* active_fill_pattern; cairo_pattern_t* inactive_fill_pattern; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index cd3748517c..e23b439fc3 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -86,6 +86,7 @@ #include "audio_time_axis.h" #include "automation_time_axis.h" #include "bundle_manager.h" +#include "button_joiner.h" #include "canvas-noevent-text.h" #include "canvas_impl.h" #include "crossfade_edit.h" @@ -2787,7 +2788,7 @@ Editor::setup_toolbar () /* make them just a bit bigger */ mouse_move_button.set_size_request (-1, 25); - smart_mode_joiner = manage (new ButtonJoiner (mouse_move_button, mouse_select_button)); + smart_mode_joiner = manage (new ButtonJoiner ("mouse mode button", mouse_move_button, mouse_select_button)); smart_mode_joiner->set_related_action (smart_mode_action); mouse_move_button.set_rounded_corner_mask (0x1); // upper left only |