Remove unused header include
[ardour.git] / gtk2_ardour / ardour_ui2.cc
index a7007eedf76e92a4ae29a57a3e5f0310259ab931..c8b0f673bef2e3abf803f267d5ccca1e36338f4a 100644 (file)
 #include <gtkmm2ext/click_box.h>
 #include <gtkmm2ext/tearoff.h>
 
-#include "ardour/session.h"
-#include "ardour/audioengine.h"
-#include "ardour/ardour.h"
 #include "ardour/profile.h"
-#include "ardour/route.h"
+#include "ardour/session.h"
+#include "ardour/types.h"
 
 #include "ardour_ui.h"
 #include "keyboard.h"
 #include "public_editor.h"
 #include "audio_clock.h"
 #include "actions.h"
+#include "button_joiner.h"
+#include "main_clock.h"
 #include "utils.h"
 #include "theme_manager.h"
 #include "midi_tracer.h"
@@ -133,9 +133,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"));
@@ -262,7 +260,7 @@ ARDOUR_UI::setup_transport ()
        click_button.set_name ("transport active option button");
        sync_button.set_name ("transport active option button");
 
-       stop_button.set_active_state (Active);
+       stop_button.set_active (true);
 
        goto_start_button.set_image (get_icon (X_("transport_start")));
        goto_end_button.set_image (get_icon (X_("transport_end")));
@@ -295,8 +293,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. */
 
@@ -340,6 +340,7 @@ ARDOUR_UI::setup_transport ()
        transport_button_size_group->add_widget (rec_button);
        transport_button_size_group->add_widget (play_selection_button);
        transport_button_size_group->add_widget (roll_button);
+       transport_button_size_group->add_widget (stop_button);
 
        HBox* tbox1 = manage (new HBox);
        HBox* tbox2 = manage (new HBox);
@@ -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);
@@ -604,6 +605,14 @@ ARDOUR_UI::editor_realized ()
        reset_dpi ();
 }
 
+void
+ARDOUR_UI::update_tearoff_visibility ()
+{
+       if (editor) {
+               editor->update_tearoff_visibility ();
+       }
+}
+
 void
 ARDOUR_UI::maximise_editing_space ()
 {