summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/ardour_ui2.cc')
-rw-r--r--gtk2_ardour/ardour_ui2.cc134
1 files changed, 44 insertions, 90 deletions
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index a39bcb124d..eec94b525f 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <fcntl.h>
@@ -38,10 +37,12 @@
#include <ardour/route.h>
#include "ardour_ui.h"
+#include "keyboard.h"
#include "public_editor.h"
#include "audio_clock.h"
#include "actions.h"
#include "utils.h"
+#include "color_manager.h"
#include "i18n.h"
@@ -72,9 +73,10 @@ ARDOUR_UI::setup_windows ()
setup_clock ();
setup_transport();
- setup_adjustables ();
build_menu_bar ();
+ color_manager->signal_unmap().connect (bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleColorManager")));
+
top_packer.pack_start (menu_bar_base, false, false);
top_packer.pack_start (transport_frame, false, false);
@@ -84,45 +86,13 @@ ARDOUR_UI::setup_windows ()
}
void
-ARDOUR_UI::setup_adjustables ()
-{
- adjuster_table.set_homogeneous (true);
-
- online_control_strings.push_back (_("MMC + Local"));
- online_control_strings.push_back (_("MMC"));
- online_control_strings.push_back (_("Local"));
-
- online_control_button = new GlobalClickBox ("CONTROL",
- online_control_strings);
-
- online_control_button->adjustment.signal_value_changed().connect(mem_fun(*this,&ARDOUR_UI::control_methods_adjusted));
-
- mmc_id_strings.push_back ("1");
- mmc_id_strings.push_back ("2");
- mmc_id_strings.push_back ("3");
- mmc_id_strings.push_back ("4");
- mmc_id_strings.push_back ("5");
- mmc_id_strings.push_back ("6");
- mmc_id_strings.push_back ("7");
- mmc_id_strings.push_back ("8");
- mmc_id_strings.push_back ("9");
-
- mmc_id_button = new GlobalClickBox (_("MMC ID"), mmc_id_strings);
-
- mmc_id_button->adjustment.signal_value_changed().connect (mem_fun(*this,&ARDOUR_UI::mmc_device_id_adjusted));
-
- adjuster_table.attach (*online_control_button, 0, 2, 1, 2, FILL|EXPAND, FILL, 5, 5);
- adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5);
-}
-
-void
ARDOUR_UI::transport_stopped ()
{
- stop_button.set_active (true);
+ stop_button.set_visual_state (1);
- roll_button.set_active (false);
- play_selection_button.set_active (false);
- auto_loop_button.set_active (false);
+ roll_button.set_visual_state (0);
+ play_selection_button.set_visual_state (0);
+ auto_loop_button.set_visual_state (0);
shuttle_fract = 0;
shuttle_box.queue_draw ();
@@ -133,22 +103,22 @@ ARDOUR_UI::transport_stopped ()
void
ARDOUR_UI::transport_rolling ()
{
- stop_button.set_active (false);
+ stop_button.set_visual_state (0);
if (session->get_play_range()) {
- play_selection_button.set_active (true);
- roll_button.set_active (false);
- auto_loop_button.set_active (false);
+ play_selection_button.set_visual_state (1);
+ roll_button.set_visual_state (0);
+ auto_loop_button.set_visual_state (0);
} else if (session->get_play_loop ()) {
- auto_loop_button.set_active (true);
- play_selection_button.set_active (false);
- roll_button.set_active (false);
+ auto_loop_button.set_visual_state (1);
+ play_selection_button.set_visual_state (0);
+ roll_button.set_visual_state (0);
} else {
- roll_button.set_active (true);
- play_selection_button.set_active (false);
- auto_loop_button.set_active (false);
+ roll_button.set_visual_state (1);
+ play_selection_button.set_visual_state (0);
+ auto_loop_button.set_visual_state (0);
}
/* reset shuttle controller */
@@ -160,19 +130,19 @@ ARDOUR_UI::transport_rolling ()
void
ARDOUR_UI::transport_rewinding ()
{
- stop_button.set_active(false);
- roll_button.set_active (true);
- play_selection_button.set_active (false);
- auto_loop_button.set_active (false);
+ stop_button.set_visual_state (0);
+ roll_button.set_visual_state (1);
+ play_selection_button.set_visual_state (0);
+ auto_loop_button.set_visual_state (0);
}
void
ARDOUR_UI::transport_forwarding ()
{
- stop_button.set_active (false);
- roll_button.set_active (true);
- play_selection_button.set_active (false);
- auto_loop_button.set_active (false);
+ stop_button.set_visual_state (0);
+ roll_button.set_visual_state (1);
+ play_selection_button.set_visual_state (0);
+ auto_loop_button.set_visual_state (0);
}
void
@@ -207,6 +177,7 @@ ARDOUR_UI::setup_transport ()
play_selection_button.set_name ("TransportButton");
rec_button.set_name ("TransportRecButton");
auto_loop_button.set_name ("TransportButton");
+
auto_return_button.set_name ("TransportButton");
auto_play_button.set_name ("TransportButton");
auto_input_button.set_name ("TransportButton");
@@ -215,30 +186,6 @@ ARDOUR_UI::setup_transport ()
click_button.set_name ("TransportButton");
time_master_button.set_name ("TransportButton");
- vector<Gdk::Color> colors;
- Gdk::Color c;
-
- /* record button has 3 color states, so we set 2 extra here */
- set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_PRELIGHT, false ));
- colors.push_back (c);
-
- set_color(c, rgba_from_style ("TransportRecButton", 0xff, 0, 0, 0, "bg", Gtk::STATE_ACTIVE, false ));
- colors.push_back (c);
-
- rec_button.set_colors (colors);
- colors.clear ();
-
- /* other buttons get 2 color states, so add one here */
- set_color(c, rgba_from_style ("TransportButton", 0x7f, 0xff, 0x7f, 0, "bg", Gtk::STATE_ACTIVE, false ));
- colors.push_back (c);
-
- stop_button.set_colors (colors);
- roll_button.set_colors (colors);
- auto_loop_button.set_colors (colors);
- play_selection_button.set_colors (colors);
- goto_start_button.set_colors (colors);
- goto_end_button.set_colors (colors);
-
stop_button.set_size_request(29, -1);
roll_button.set_size_request(29, -1);
auto_loop_button.set_size_request(29, -1);
@@ -249,7 +196,7 @@ ARDOUR_UI::setup_transport ()
Widget* w;
- stop_button.set_active (true);
+ stop_button.set_visual_state (1);
w = manage (new Image (get_icon (X_("transport_start"))));
w->show();
@@ -298,6 +245,7 @@ ARDOUR_UI::setup_transport ()
ARDOUR_UI::instance()->tooltips().set_tip (goto_start_button, _("Go to start of session"));
ARDOUR_UI::instance()->tooltips().set_tip (goto_end_button, _("Go to end of session"));
ARDOUR_UI::instance()->tooltips().set_tip (auto_loop_button, _("Play loop range"));
+
ARDOUR_UI::instance()->tooltips().set_tip (auto_return_button, _("Return to last playback start when stopped"));
ARDOUR_UI::instance()->tooltips().set_tip (auto_play_button, _("Start playback after any locate"));
ARDOUR_UI::instance()->tooltips().set_tip (auto_input_button, _("Be sensible about input monitoring"));
@@ -338,12 +286,7 @@ ARDOUR_UI::setup_transport ()
ActionManager::get_action ("Transport", "TogglePunchIn")->connect_proxy (punch_in_button);
ActionManager::get_action ("Transport", "TogglePunchOut")->connect_proxy (punch_out_button);
- preroll_button.unset_flags (CAN_FOCUS);
- preroll_button.set_events (preroll_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
preroll_button.set_name ("TransportButton");
-
- postroll_button.unset_flags (CAN_FOCUS);
- postroll_button.set_events (postroll_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
postroll_button.set_name ("TransportButton");
preroll_clock.set_mode (AudioClock::MinSec);
@@ -622,6 +565,10 @@ ARDOUR_UI::shuttle_box_button_press (GdkEventButton* ev)
return true;
}
+ if (shuttle_controller_binding_proxy.button_press_handler (ev)) {
+ return true;
+ }
+
if (Keyboard::is_context_menu_event (ev)) {
show_shuttle_context_menu ();
return true;
@@ -659,8 +606,8 @@ ARDOUR_UI::shuttle_box_button_release (GdkEventButton* ev)
if (Config->get_auto_play() || roll_button.get_state()) {
shuttle_fract = SHUTTLE_FRACT_SPEED1;
session->request_transport_speed (1.0);
- stop_button.set_active (false);
- roll_button.set_active (true);
+ stop_button.set_visual_state (0);
+ roll_button.set_visual_state (1);
} else {
shuttle_fract = 0;
session->request_transport_speed (0.0);
@@ -673,8 +620,8 @@ ARDOUR_UI::shuttle_box_button_release (GdkEventButton* ev)
if (session->transport_rolling()) {
shuttle_fract = SHUTTLE_FRACT_SPEED1;
session->request_transport_speed (1.0);
- stop_button.set_active (false);
- roll_button.set_active (true);
+ stop_button.set_visual_state (0);
+ roll_button.set_visual_state (1);
} else {
shuttle_fract = 0;
}
@@ -750,6 +697,13 @@ ARDOUR_UI::mouse_shuttle (double x, bool force)
}
void
+ARDOUR_UI::set_shuttle_fract (double f)
+{
+ shuttle_fract = f;
+ use_shuttle_fract (false);
+}
+
+void
ARDOUR_UI::use_shuttle_fract (bool force)
{
struct timeval now;