mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
convert transport buttons to ArdourButton
git-svn-id: svn://localhost/ardour2/branches/3.0@10473 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a5788defff
commit
f690d687d3
5 changed files with 76 additions and 123 deletions
|
|
@ -138,13 +138,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
, gui_object_state (new GUIObjectState)
|
||||
, primary_clock (new AudioClock (X_("primary"), false, X_("TransportClockDisplay"), true, true, false, true))
|
||||
, secondary_clock (new AudioClock (X_("secondary"), false, X_("SecondaryClockDisplay"), true, true, false, true))
|
||||
, preroll_clock (new AudioClock (X_("preroll"), false, X_("PreRollClock"), true, false, true))
|
||||
, postroll_clock (new AudioClock (X_("postroll"), false, X_("PostRollClock"), true, false, true))
|
||||
|
||||
/* preroll stuff */
|
||||
|
||||
, preroll_button (_("pre\nroll"))
|
||||
, postroll_button (_("post\nroll"))
|
||||
|
||||
/* big clock */
|
||||
|
||||
|
|
@ -160,14 +153,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))
|
||||
|
||||
, roll_button (roll_controllable)
|
||||
, stop_button (stop_controllable)
|
||||
, goto_start_button (goto_start_controllable)
|
||||
, goto_end_button (goto_end_controllable)
|
||||
, auto_loop_button (auto_loop_controllable)
|
||||
, play_selection_button (play_selection_controllable)
|
||||
, rec_button (rec_controllable)
|
||||
|
||||
, auto_return_button (_("Auto Return"))
|
||||
, auto_play_button (_("Auto Play"))
|
||||
, auto_input_button (_("Auto Input"))
|
||||
|
|
@ -235,14 +220,22 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
original_big_clock_height = -1;
|
||||
original_big_clock_font_size = 0;
|
||||
|
||||
roll_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
stop_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
goto_start_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
goto_end_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
auto_loop_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
play_selection_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
rec_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
join_play_range_button.unset_flags (Gtk::CAN_FOCUS);
|
||||
roll_button.set_controllable (roll_controllable);
|
||||
stop_button.set_controllable (stop_controllable);
|
||||
goto_start_button.set_controllable (goto_start_controllable);
|
||||
goto_end_button.set_controllable (goto_end_controllable);
|
||||
auto_loop_button.set_controllable (auto_loop_controllable);
|
||||
play_selection_button.set_controllable (play_selection_controllable);
|
||||
rec_button.set_controllable (rec_controllable);
|
||||
|
||||
roll_button.set_name ("transport button");
|
||||
stop_button.set_name ("transport button");
|
||||
goto_start_button.set_name ("transport button");
|
||||
goto_end_button.set_name ("transport button");
|
||||
auto_loop_button.set_name ("transport button");
|
||||
play_selection_button.set_name ("transport button");
|
||||
rec_button.set_name ("transport recenable button");
|
||||
|
||||
last_configure_time= 0;
|
||||
last_peak_grab = 0;
|
||||
|
||||
|
|
@ -1714,12 +1707,12 @@ ARDOUR_UI::transport_roll ()
|
|||
if (!Config->get_seamless_loop()) {
|
||||
_session->request_play_loop (false, true);
|
||||
}
|
||||
} else if (_session->get_play_range () && !join_play_range_button.get_active()) {
|
||||
} else if (_session->get_play_range () && !join_play_range_button.active_state()) {
|
||||
/* stop playing a range if we currently are */
|
||||
_session->request_play_range (0, true);
|
||||
}
|
||||
|
||||
if (join_play_range_button.get_active()) {
|
||||
if (join_play_range_button.active_state()) {
|
||||
_session->request_play_range (&editor->get_selection().time, true);
|
||||
}
|
||||
|
||||
|
|
@ -1778,7 +1771,7 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
|
|||
if (rolling) {
|
||||
_session->request_stop (with_abort, true);
|
||||
} else {
|
||||
if (join_play_range_button.get_active()) {
|
||||
if (join_play_range_button.active_state()) {
|
||||
_session->request_play_range (&editor->get_selection().time, true);
|
||||
}
|
||||
|
||||
|
|
@ -1909,10 +1902,10 @@ void
|
|||
ARDOUR_UI::map_transport_state ()
|
||||
{
|
||||
if (!_session) {
|
||||
auto_loop_button.set_visual_state (0);
|
||||
play_selection_button.set_visual_state (0);
|
||||
roll_button.set_visual_state (0);
|
||||
stop_button.set_visual_state (1);
|
||||
auto_loop_button.unset_active_state ();
|
||||
play_selection_button.unset_active_state ();
|
||||
roll_button.unset_active_state ();
|
||||
stop_button.set_active_state (Gtkmm2ext::Active);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1926,37 +1919,37 @@ ARDOUR_UI::map_transport_state ()
|
|||
|
||||
if (_session->get_play_range()) {
|
||||
|
||||
play_selection_button.set_visual_state (1);
|
||||
roll_button.set_visual_state (0);
|
||||
auto_loop_button.set_visual_state (0);
|
||||
play_selection_button.set_active_state (Gtkmm2ext::Active);
|
||||
roll_button.unset_active_state ();
|
||||
auto_loop_button.unset_active_state ();
|
||||
|
||||
} else if (_session->get_play_loop ()) {
|
||||
|
||||
auto_loop_button.set_visual_state (1);
|
||||
play_selection_button.set_visual_state (0);
|
||||
roll_button.set_visual_state (0);
|
||||
auto_loop_button.set_active_state (Gtkmm2ext::Active);
|
||||
play_selection_button.unset_active_state ();
|
||||
roll_button.unset_active_state ();
|
||||
|
||||
} else {
|
||||
|
||||
roll_button.set_visual_state (1);
|
||||
play_selection_button.set_visual_state (0);
|
||||
auto_loop_button.set_visual_state (0);
|
||||
roll_button.set_active_state (Gtkmm2ext::Active);
|
||||
play_selection_button.unset_active_state ();
|
||||
auto_loop_button.unset_active_state ();
|
||||
}
|
||||
|
||||
if (join_play_range_button.get_active()) {
|
||||
if (join_play_range_button.active_state()) {
|
||||
/* light up both roll and play-selection if they are joined */
|
||||
roll_button.set_visual_state (1);
|
||||
play_selection_button.set_visual_state (1);
|
||||
roll_button.set_active_state (Gtkmm2ext::Active);
|
||||
play_selection_button.set_active_state (Gtkmm2ext::Active);
|
||||
}
|
||||
|
||||
stop_button.set_visual_state (0);
|
||||
stop_button.unset_active_state ();
|
||||
|
||||
} else {
|
||||
|
||||
stop_button.set_visual_state (1);
|
||||
roll_button.set_visual_state (0);
|
||||
play_selection_button.set_visual_state (0);
|
||||
auto_loop_button.set_visual_state (0);
|
||||
stop_button.set_active_state (Gtkmm2ext::Active);
|
||||
roll_button.unset_active_state ();
|
||||
play_selection_button.unset_active_state ();
|
||||
auto_loop_button.unset_active_state ();
|
||||
update_disk_space ();
|
||||
}
|
||||
}
|
||||
|
|
@ -2382,14 +2375,14 @@ ARDOUR_UI::transport_rec_enable_blink (bool onoff)
|
|||
|
||||
if (r == Session::Enabled || (r == Session::Recording && !h)) {
|
||||
if (onoff) {
|
||||
rec_button.set_visual_state (2);
|
||||
rec_button.set_active_state (Active);
|
||||
} else {
|
||||
rec_button.set_visual_state (0);
|
||||
rec_button.set_active_state (Mid);
|
||||
}
|
||||
} else if (r == Session::Recording && h) {
|
||||
rec_button.set_visual_state (1);
|
||||
rec_button.set_active_state (Mid);
|
||||
} else {
|
||||
rec_button.set_visual_state (0);
|
||||
rec_button.unset_active_state ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3607,10 +3600,10 @@ ARDOUR_UI::step_edit_status_change (bool yn)
|
|||
// we make insensitive
|
||||
|
||||
if (yn) {
|
||||
rec_button.set_visual_state (3);
|
||||
rec_button.set_active_state (Mid);
|
||||
rec_button.set_sensitive (false);
|
||||
} else {
|
||||
rec_button.set_visual_state (0);
|
||||
rec_button.unset_active_state ();;
|
||||
rec_button.set_sensitive (true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
#include "ardour/session_handle.h"
|
||||
|
||||
#include "ardour_dialog.h"
|
||||
#include "ardour_button.h"
|
||||
#include "editing.h"
|
||||
#include "ui_config.h"
|
||||
#include "window_proxy.h"
|
||||
|
|
@ -201,8 +202,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
|
||||
AudioClock* primary_clock;
|
||||
AudioClock* secondary_clock;
|
||||
AudioClock* preroll_clock;
|
||||
AudioClock* postroll_clock;
|
||||
|
||||
TimeInfoBox* time_info_box;
|
||||
|
||||
|
|
@ -301,9 +300,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void toggle_mixer_window ();
|
||||
void toggle_mixer_on_top ();
|
||||
|
||||
Gtk::ToggleButton preroll_button;
|
||||
Gtk::ToggleButton postroll_button;
|
||||
|
||||
int setup_windows ();
|
||||
void setup_transport ();
|
||||
void setup_clock ();
|
||||
|
|
@ -424,14 +420,14 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void set_transport_controllable_state (const XMLNode&);
|
||||
XMLNode& get_transport_controllable_state ();
|
||||
|
||||
BindableButton roll_button;
|
||||
BindableButton stop_button;
|
||||
BindableButton goto_start_button;
|
||||
BindableButton goto_end_button;
|
||||
BindableButton auto_loop_button;
|
||||
BindableButton play_selection_button;
|
||||
BindableButton rec_button;
|
||||
BindableToggleButton join_play_range_button;
|
||||
ArdourButton roll_button;
|
||||
ArdourButton stop_button;
|
||||
ArdourButton goto_start_button;
|
||||
ArdourButton goto_end_button;
|
||||
ArdourButton auto_loop_button;
|
||||
ArdourButton play_selection_button;
|
||||
ArdourButton rec_button;
|
||||
ArdourButton join_play_range_button;
|
||||
|
||||
void toggle_external_sync ();
|
||||
void toggle_time_master ();
|
||||
|
|
|
|||
|
|
@ -236,15 +236,6 @@ ARDOUR_UI::setup_transport ()
|
|||
transport_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Box*> (&top_packer),
|
||||
static_cast<Widget*> (&transport_frame), 1));
|
||||
|
||||
goto_start_button.set_name ("TransportButton");
|
||||
goto_end_button.set_name ("TransportButton");
|
||||
roll_button.set_name ("TransportButton");
|
||||
stop_button.set_name ("TransportButton");
|
||||
play_selection_button.set_name ("TransportButton");
|
||||
rec_button.set_name ("TransportRecButton");
|
||||
auto_loop_button.set_name ("TransportButton");
|
||||
join_play_range_button.set_name ("TransportButton");
|
||||
|
||||
auto_return_button.set_name ("TransportButton");
|
||||
auto_play_button.set_name ("TransportButton");
|
||||
auto_input_button.set_name ("TransportButton");
|
||||
|
|
@ -262,49 +253,36 @@ ARDOUR_UI::setup_transport ()
|
|||
|
||||
Widget* w;
|
||||
|
||||
stop_button.set_visual_state (1);
|
||||
stop_button.set_active_state (Active);
|
||||
|
||||
w = manage (new Image (get_icon (X_("transport_start"))));
|
||||
w->show();
|
||||
goto_start_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_end"))));
|
||||
w->show();
|
||||
goto_end_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_play"))));
|
||||
w->show();
|
||||
roll_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_stop"))));
|
||||
w->show();
|
||||
stop_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_range"))));
|
||||
w->show();
|
||||
play_selection_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_record"))));
|
||||
w->show();
|
||||
rec_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("transport_loop"))));
|
||||
w->show();
|
||||
auto_loop_button.add (*w);
|
||||
w = manage (new Image (get_icon (X_("tool_object_range"))));
|
||||
w->show ();
|
||||
join_play_range_button.add (*w);
|
||||
|
||||
goto_start_button.set_image (get_icon (X_("transport_start")));
|
||||
goto_end_button.set_image (get_icon (X_("transport_end")));
|
||||
roll_button.set_image (get_icon (X_("transport_play")));
|
||||
stop_button.set_image (get_icon (X_("transport_stop")));
|
||||
play_selection_button.set_image (get_icon (X_("transport_range")));
|
||||
rec_button.set_image (get_icon (X_("transport_record")));
|
||||
auto_loop_button.set_image (get_icon (X_("transport_loop")));
|
||||
join_play_range_button.set_image (get_icon (X_("tool_object_range")));
|
||||
|
||||
RefPtr<Action> act;
|
||||
|
||||
act = ActionManager::get_action (X_("Transport"), X_("Stop"));
|
||||
act->connect_proxy (stop_button);
|
||||
stop_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("Roll"));
|
||||
act->connect_proxy (roll_button);
|
||||
roll_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("Record"));
|
||||
act->connect_proxy (rec_button);
|
||||
rec_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("GotoStart"));
|
||||
act->connect_proxy (goto_start_button);
|
||||
goto_start_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("GotoEnd"));
|
||||
act->connect_proxy (goto_end_button);
|
||||
goto_end_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("Loop"));
|
||||
act->connect_proxy (auto_loop_button);
|
||||
auto_loop_button.set_related_action (act);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("PlaySelection"));
|
||||
act->connect_proxy (play_selection_button);
|
||||
play_selection_button.set_related_action (act);
|
||||
|
||||
|
||||
act = ActionManager::get_action (X_("Transport"), X_("ToggleTimeMaster"));
|
||||
act->connect_proxy (time_master_button);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
|
||||
|
|
@ -324,14 +302,6 @@ ARDOUR_UI::setup_transport ()
|
|||
ActionManager::get_action ("Transport", "ToggleAutoPlay")->connect_proxy (auto_play_button);
|
||||
ActionManager::get_action ("Transport", "ToggleAutoInput")->connect_proxy (auto_input_button);
|
||||
|
||||
preroll_button.set_name ("TransportButton");
|
||||
postroll_button.set_name ("TransportButton");
|
||||
|
||||
preroll_clock->set_mode (AudioClock::MinSec);
|
||||
preroll_clock->set_name ("TransportClockDisplay");
|
||||
postroll_clock->set_mode (AudioClock::MinSec);
|
||||
postroll_clock->set_name ("TransportClockDisplay");
|
||||
|
||||
/* alerts */
|
||||
|
||||
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
|
||||
|
|
@ -440,12 +410,6 @@ ARDOUR_UI::setup_transport ()
|
|||
|
||||
set_transport_sensitivity (false);
|
||||
|
||||
// toggle_box->pack_start (preroll_button, false, false);
|
||||
// toggle_box->pack_start (preroll_clock, false, false);
|
||||
|
||||
// toggle_box->pack_start (postroll_button, false, false);
|
||||
// toggle_box->pack_start (postroll_clock, false, false);
|
||||
|
||||
transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
|
||||
if (Profile->get_small_screen()) {
|
||||
transport_tearoff_hbox.pack_start (_editor_transport_box, false, false, 4);
|
||||
|
|
|
|||
|
|
@ -109,8 +109,6 @@ ARDOUR_UI::set_session (Session *s)
|
|||
primary_clock->set_session (s);
|
||||
secondary_clock->set_session (s);
|
||||
big_clock->set_session (s);
|
||||
preroll_clock->set_session (s);
|
||||
postroll_clock->set_session (s);
|
||||
time_info_box->set_session (s);
|
||||
|
||||
/* sensitize menu bar options that are now valid */
|
||||
|
|
|
|||
|
|
@ -177,4 +177,6 @@ BUTTON_VARS(MuteButton, "mute button")
|
|||
BUTTON_VARS(SoloButton, "solo button")
|
||||
BUTTON_VARS(RecEnableButton, "record enable button")
|
||||
BUTTON_VARS(SendButton, "send alert button")
|
||||
BUTTON_VARS(TransportButton, "transport button")
|
||||
BUTTON_VARS(TransportRecenableButton, "transport recenable button")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue