#include <iostream>
#include <cmath>
-#include <gtk--.h>
+#include <sigc++/bind.h>
#include <pbd/error.h>
#include <pbd/basename.h>
#include <pbd/fastlog.h>
-#include <gtkmmext/pix.h>
-#include <gtkmmext/utils.h>
-#include <gtkmmext/click_box.h>
-#include <gtkmmext/tearoff.h>
+#include <gtkmm2ext/pix.h>
+#include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/click_box.h>
+#include <gtkmm2ext/tearoff.h>
#include <ardour/audioengine.h>
#include <ardour/ardour.h>
#include "ardour_ui.h"
#include "public_editor.h"
#include "audio_clock.h"
-#include "extra_bind.h"
+#include "utils.h"
#include "i18n.h"
using namespace std;
using namespace ARDOUR;
-using namespace Gtkmmext;
+using namespace Gtkmm2ext;
using namespace Gtk;
-using namespace SigC;
+using namespace sigc;
int
ARDOUR_UI::setup_windows ()
online_control_button = new GlobalClickBox ("CONTROL",
online_control_strings);
- online_control_button->adjustment.value_changed.connect(slot (*this,&ARDOUR_UI::control_methods_adjusted));
+ 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_button = new GlobalClickBox (_("MMC ID"), mmc_id_strings);
- mmc_id_button->adjustment.value_changed.connect (slot (*this,&ARDOUR_UI::mmc_device_id_adjusted));
+ 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, GTK_FILL|GTK_EXPAND, 0, 5, 5);
- adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, 0, 0, 5, 5);
+ 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);
}
#include "transport_xpms"
transport_base.set_name ("TransportBase");
transport_base.add (transport_hbox);
- transport_frame.set_shadow_type (GTK_SHADOW_OUT);
+ transport_frame.set_shadow_type (Gtk::SHADOW_OUT);
transport_frame.set_name ("BaseFrame");
transport_frame.add (transport_base);
- transport_tearoff->Detach.connect (bind (slot (*this, &ARDOUR_UI::detach_tearoff), static_cast<Gtk::Box*>(&top_packer),
+ transport_tearoff->Detach.connect (bind (mem_fun(*this, &ARDOUR_UI::detach_tearoff), static_cast<Gtk::Box*>(&top_packer),
static_cast<Gtk::Widget*>(&transport_frame)));
- transport_tearoff->Attach.connect (bind (slot (*this, &ARDOUR_UI::reattach_tearoff), static_cast<Gtk::Box*> (&top_packer),
+ transport_tearoff->Attach.connect (bind (mem_fun(*this, &ARDOUR_UI::reattach_tearoff), static_cast<Gtk::Box*> (&top_packer),
static_cast<Gtk::Widget*> (&transport_frame), 1));
- goto_start_button.add (*(manage (new Gtk::Pixmap (start_xpm))));
- goto_end_button.add (*(manage (new Gtk::Pixmap (end_xpm))));
- roll_button.add (*(manage (new Gtk::Pixmap (arrow_xpm))));
- stop_button.add (*(manage (new Gtk::Pixmap (stop_xpm))));
- play_selection_button.add (*(manage (new Gtk::Pixmap (play_selection_xpm))));
- rec_button.add (*(manage (new Gtk::Pixmap (rec_xpm))));
- auto_loop_button.add (*(manage (new Gtk::Pixmap (loop_xpm))));
+ goto_start_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(start_xpm)))));
+ goto_end_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(end_xpm)))));
+ roll_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(arrow_xpm)))));
+
+ stop_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(stop_xpm)))));
+ play_selection_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(play_selection_xpm)))));
+ rec_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(rec_xpm)))));
+ auto_loop_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(loop_xpm)))));
ARDOUR_UI::instance()->tooltips().set_tip (roll_button, _("Play from playhead"));
ARDOUR_UI::instance()->tooltips().set_tip (stop_button, _("Stop playback"));
ARDOUR_UI::instance()->tooltips().set_tip (shuttle_style_button, _("Select sprung or wheel behaviour"));
ARDOUR_UI::instance()->tooltips().set_tip (speed_display_box, _("Current transport speed"));
- shuttle_box.set_flags (GTK_CAN_FOCUS);
- shuttle_box.set_events (shuttle_box.get_events() | GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK|GDK_BUTTON_RELEASE_MASK|GDK_BUTTON_PRESS_MASK|GDK_POINTER_MOTION_MASK);
- shuttle_box.set_usize (100, 15);
+ shuttle_box.set_flags (CAN_FOCUS);
+ shuttle_box.set_events (shuttle_box.get_events() | Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::POINTER_MOTION_MASK);
+ shuttle_box.set_size_request (100, 15);
shuttle_box.set_name ("TransportButton");
goto_start_button.set_name ("TransportButton");
click_button.set_name ("TransportButton");
follow_button.set_name ("TransportButton");
- goto_start_button.unset_flags (GTK_CAN_FOCUS);
- goto_end_button.unset_flags (GTK_CAN_FOCUS);
- roll_button.unset_flags (GTK_CAN_FOCUS);
- stop_button.unset_flags (GTK_CAN_FOCUS);
- play_selection_button.unset_flags (GTK_CAN_FOCUS);
- rec_button.unset_flags (GTK_CAN_FOCUS);
- auto_loop_button.unset_flags (GTK_CAN_FOCUS);
- auto_return_button.unset_flags (GTK_CAN_FOCUS);
- auto_play_button.unset_flags (GTK_CAN_FOCUS);
- auto_input_button.unset_flags (GTK_CAN_FOCUS);
- punch_out_button.unset_flags (GTK_CAN_FOCUS);
- punch_in_button.unset_flags (GTK_CAN_FOCUS);
- click_button.unset_flags (GTK_CAN_FOCUS);
- follow_button.unset_flags (GTK_CAN_FOCUS);
+ goto_start_button.unset_flags (Gtk::CAN_FOCUS);
+ goto_end_button.unset_flags (Gtk::CAN_FOCUS);
+ roll_button.unset_flags (Gtk::CAN_FOCUS);
+ stop_button.unset_flags (Gtk::CAN_FOCUS);
+ play_selection_button.unset_flags (Gtk::CAN_FOCUS);
+ rec_button.unset_flags (Gtk::CAN_FOCUS);
+ auto_loop_button.unset_flags (Gtk::CAN_FOCUS);
+ auto_return_button.unset_flags (Gtk::CAN_FOCUS);
+ auto_play_button.unset_flags (Gtk::CAN_FOCUS);
+ auto_input_button.unset_flags (Gtk::CAN_FOCUS);
+ punch_out_button.unset_flags (Gtk::CAN_FOCUS);
+ punch_in_button.unset_flags (Gtk::CAN_FOCUS);
+ click_button.unset_flags (Gtk::CAN_FOCUS);
+ follow_button.unset_flags (Gtk::CAN_FOCUS);
- goto_start_button.set_events (goto_start_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- goto_end_button.set_events (goto_end_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- roll_button.set_events (roll_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- stop_button.set_events (stop_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- play_selection_button.set_events (play_selection_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- rec_button.set_events (rec_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- auto_loop_button.set_events (auto_loop_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- auto_return_button.set_events (auto_return_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- auto_play_button.set_events (auto_play_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- auto_input_button.set_events (auto_input_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- click_button.set_events (click_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- follow_button.set_events (click_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- punch_in_button.set_events (punch_in_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
- punch_out_button.set_events (punch_out_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
-
- goto_start_button.clicked.connect (slot (*this,&ARDOUR_UI::transport_goto_start));
- goto_end_button.clicked.connect (slot (*this,&ARDOUR_UI::transport_goto_end));
-
- roll_button.button_release_event.connect (slot (*this,&ARDOUR_UI::mouse_transport_roll));
- play_selection_button.button_release_event.connect (slot (*this,&ARDOUR_UI::mouse_transport_play_selection));
- auto_loop_button.button_release_event.connect (slot (*this,&ARDOUR_UI::mouse_transport_loop));
-
- stop_button.button_release_event.connect (slot (*this,&ARDOUR_UI::mouse_transport_stop));
- rec_button.button_release_event.connect (slot (*this,&ARDOUR_UI::mouse_transport_record));
-
- shuttle_box.button_press_event.connect (slot (*this, &ARDOUR_UI::shuttle_box_button_press));
- shuttle_box.button_release_event.connect (slot (*this, &ARDOUR_UI::shuttle_box_button_release));
- shuttle_box.motion_notify_event.connect (slot (*this, &ARDOUR_UI::shuttle_box_motion));
- shuttle_box.expose_event.connect (slot (*this, &ARDOUR_UI::shuttle_box_expose));
+ goto_start_button.set_events (goto_start_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ goto_end_button.set_events (goto_end_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ roll_button.set_events (roll_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ stop_button.set_events (stop_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ play_selection_button.set_events (play_selection_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ rec_button.set_events (rec_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ auto_loop_button.set_events (auto_loop_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ auto_return_button.set_events (auto_return_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ auto_play_button.set_events (auto_play_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ auto_input_button.set_events (auto_input_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ click_button.set_events (click_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ follow_button.set_events (click_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ punch_in_button.set_events (punch_in_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+ punch_out_button.set_events (punch_out_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
+
+ goto_start_button.signal_clicked().connect (mem_fun(*this,&ARDOUR_UI::transport_goto_start));
+ goto_end_button.signal_clicked().connect (mem_fun(*this,&ARDOUR_UI::transport_goto_end));
+
+ roll_button.signal_button_release_event().connect (mem_fun(*this,&ARDOUR_UI::mouse_transport_roll));
+ play_selection_button.signal_button_release_event().connect (mem_fun(*this,&ARDOUR_UI::mouse_transport_play_selection));
+ auto_loop_button.signal_button_release_event().connect (mem_fun(*this,&ARDOUR_UI::mouse_transport_loop));
+
+ stop_button.signal_button_release_event().connect (mem_fun(*this,&ARDOUR_UI::mouse_transport_stop));
+ rec_button.signal_button_release_event().connect (mem_fun(*this,&ARDOUR_UI::mouse_transport_record));
+
+ shuttle_box.signal_button_press_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_button_press));
+ shuttle_box.signal_button_release_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_button_release));
+ shuttle_box.signal_motion_notify_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_motion));
+ shuttle_box.signal_expose_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_expose));
/* clocks, etc. */
- ARDOUR_UI::Clock.connect (bind (slot (primary_clock, &AudioClock::set), false));
- ARDOUR_UI::Clock.connect (bind (slot (secondary_clock, &AudioClock::set), false));
+ ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), false));
+ ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), false));
primary_clock.set_mode (AudioClock::SMPTE);
primary_clock.set_name ("TransportClockDisplay");
secondary_clock.set_name ("TransportClockDisplay");
- primary_clock.ValueChanged.connect (slot (*this, &ARDOUR_UI::primary_clock_value_changed));
- secondary_clock.ValueChanged.connect (slot (*this, &ARDOUR_UI::secondary_clock_value_changed));
+ primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
+ secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
ARDOUR_UI::instance()->tooltips().set_tip (primary_clock, _("Primary clock"));
ARDOUR_UI::instance()->tooltips().set_tip (secondary_clock, _("secondary clock"));
/* options */
- auto_return_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_auto_return));
- auto_play_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_auto_play));
- auto_input_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_auto_input));
- click_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_click));
- follow_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_follow));
- punch_in_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_punch_in));
- punch_out_button.toggled.connect (slot (*this,&ARDOUR_UI::toggle_punch_out));
+ auto_return_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_auto_return));
+ auto_play_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_auto_play));
+ auto_input_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_auto_input));
+ click_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_click));
+ follow_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_follow));
+ punch_in_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_punch_in));
+ punch_out_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_punch_out));
- preroll_button.unset_flags (GTK_CAN_FOCUS);
- preroll_button.set_events (preroll_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
+ preroll_button.unset_flags (Gtk::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 (GTK_CAN_FOCUS);
- postroll_button.set_events (postroll_button.get_events() & ~(GDK_ENTER_NOTIFY_MASK|GDK_LEAVE_NOTIFY_MASK));
+ postroll_button.unset_flags (Gtk::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);
/* CANNOT bind these to clicked or toggled, must use pressed or released */
solo_alert_button.set_name ("TransportSoloAlert");
- solo_alert_button.pressed.connect (slot (*this,&ARDOUR_UI::solo_alert_toggle));
+ solo_alert_button.signal_pressed().connect (mem_fun(*this,&ARDOUR_UI::solo_alert_toggle));
auditioning_alert_button.set_name ("TransportAuditioningAlert");
- auditioning_alert_button.pressed.connect (slot (*this,&ARDOUR_UI::audition_alert_toggle));
+ auditioning_alert_button.signal_pressed().connect (mem_fun(*this,&ARDOUR_UI::audition_alert_toggle));
alert_box.pack_start (solo_alert_button);
alert_box.pack_start (auditioning_alert_button);
Gtk::VBox* svbox = manage (new VBox);
Gtk::HBox* shbox = manage (new HBox);
- sframe->set_shadow_type (GTK_SHADOW_IN);
+ sframe->set_shadow_type (Gtk::SHADOW_IN);
sframe->add (shuttle_box);
shuttle_box.set_name (X_("ShuttleControl"));
speed_display_box.add (speed_display_label);
- set_usize_to_display_given_text (speed_display_box, _("stopped"), 2, 2);
+ set_size_request_to_display_given_text (speed_display_box, _("stopped"), 2, 2);
speed_display_box.set_name (X_("ShuttleDisplay"));
shuttle_units_button.set_name (X_("ShuttleButton"));
- shuttle_units_button.clicked.connect (slot (*this, &ARDOUR_UI::shuttle_unit_clicked));
+ shuttle_units_button.signal_clicked().connect (mem_fun(*this, &ARDOUR_UI::shuttle_unit_clicked));
shuttle_style_button.set_name (X_("ShuttleButton"));
- shuttle_style_button.clicked.connect (slot (*this, &ARDOUR_UI::shuttle_style_clicked));
+ shuttle_style_button.signal_clicked().connect (mem_fun(*this, &ARDOUR_UI::shuttle_style_clicked));
Gtk::Frame* sdframe = manage (new Frame);
- sdframe->set_shadow_type (GTK_SHADOW_IN);
+ sdframe->set_shadow_type (Gtk::SHADOW_IN);
sdframe->add (speed_display_box);
shbox->pack_start (*sdframe, false, false);
void
ARDOUR_UI::setup_clock ()
{
- ARDOUR_UI::Clock.connect (bind (slot (big_clock, &AudioClock::set), false));
+ ARDOUR_UI::Clock.connect (bind (mem_fun (big_clock, &AudioClock::set), false));
- big_clock_window = new BigClockWindow;
+ big_clock_window = new ArdourDialog ("big clock window");
big_clock_window->set_border_width (0);
big_clock_window->add (big_clock);
big_clock_window->set_title (_("ardour: clock"));
-
- big_clock_window->delete_event.connect (bind (slot (just_hide_it), static_cast<Gtk::Window*>(big_clock_window)));
- big_clock_window->realize.connect (slot (*this, &ARDOUR_UI::big_clock_realize));
- big_clock_window->size_allocate.connect (slot (*this, &ARDOUR_UI::big_clock_size_event));
+ big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
- big_clock_window->Hiding.connect (slot (*this, &ARDOUR_UI::big_clock_hiding));
-}
+ big_clock_window->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Gtk::Window*>(big_clock_window)));
-void
-ARDOUR_UI::big_clock_size_event (GtkAllocation *alloc)
-{
- return;
-}
-
-void
-ARDOUR_UI::big_clock_realize ()
-{
- big_clock_window->get_window().set_decorations (GdkWMDecoration (GDK_DECOR_BORDER|GDK_DECOR_RESIZEH|GDK_DECOR_MAXIMIZE|GDK_DECOR_MINIMIZE));
+ big_clock_window->Hiding.connect (mem_fun(*this, &ARDOUR_UI::big_clock_hiding));
}
void
void
ARDOUR_UI::auditioning_changed (bool onoff)
{
- Gtkmmext::UI::instance()->call_slot(bind (slot (*this, &ARDOUR_UI::_auditioning_changed), onoff));
+ Gtkmm2ext::UI::instance()->call_slot(bind (mem_fun(*this, &ARDOUR_UI::_auditioning_changed), onoff));
}
void
if (session->soloing()) {
if (onoff) {
- solo_alert_button.set_state (GTK_STATE_ACTIVE);
+ solo_alert_button.set_state (Gtk::STATE_ACTIVE);
} else {
- solo_alert_button.set_state (GTK_STATE_NORMAL);
+ solo_alert_button.set_state (Gtk::STATE_NORMAL);
}
} else {
solo_alert_button.set_active (false);
- solo_alert_button.set_state (GTK_STATE_NORMAL);
+ solo_alert_button.set_state (Gtk::STATE_NORMAL);
}
}
if (session->is_auditioning()) {
if (onoff) {
- auditioning_alert_button.set_state (GTK_STATE_ACTIVE);
+ auditioning_alert_button.set_state (Gtk::STATE_ACTIVE);
} else {
- auditioning_alert_button.set_state (GTK_STATE_NORMAL);
+ auditioning_alert_button.set_state (Gtk::STATE_NORMAL);
}
} else {
auditioning_alert_button.set_active (false);
- auditioning_alert_button.set_state (GTK_STATE_NORMAL);
+ auditioning_alert_button.set_state (Gtk::STATE_NORMAL);
}
}
switch (ev->button) {
case 1:
- Gtk::Main::grab_add (shuttle_box);
+ shuttle_box.add_modal_grab ();
shuttle_grabbed = true;
mouse_shuttle (ev->x, true);
break;
case 1:
mouse_shuttle (ev->x, true);
shuttle_grabbed = false;
- Gtk::Main::grab_remove (shuttle_box);
+ shuttle_box.remove_modal_grab ();
if (shuttle_behaviour == Sprung) {
shuttle_fract = SHUTTLE_FRACT_SPEED1;
session->request_transport_speed (1.0);
gint
ARDOUR_UI::mouse_shuttle (double x, bool force)
{
- double half_width = shuttle_box.width() / 2.0;
+ double half_width = shuttle_box.get_width() / 2.0;
double distance = x - half_width;
if (distance > 0) {
ARDOUR_UI::shuttle_box_expose (GdkEventExpose* event)
{
gint x;
- Gdk_Window win (shuttle_box.get_window());
+ Glib::RefPtr<Gdk::Window> win (shuttle_box.get_window());
/* redraw the background */
- win.draw_rectangle (shuttle_box.get_style()->get_bg_gc (shuttle_box.get_state()),
- true,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
+ win->draw_rectangle (shuttle_box.get_style()->get_bg_gc (shuttle_box.get_state()),
+ true,
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
- x = (gint) floor ((shuttle_box.width() / 2.0) + (0.5 * (shuttle_box.width() * shuttle_fract)));
+ x = (gint) floor ((shuttle_box.get_width() / 2.0) + (0.5 * (shuttle_box.get_width() * shuttle_fract)));
/* draw line */
- win.draw_line (shuttle_box.get_style()->get_fg_gc (shuttle_box.get_state()),
- x,
- 0,
- x,
- shuttle_box.height());
+ win->draw_line (shuttle_box.get_style()->get_fg_gc (shuttle_box.get_state()),
+ x,
+ 0,
+ x,
+ shuttle_box.get_height());
return TRUE;
}
void
ARDOUR_UI::shuttle_style_clicked ()
{
- shuttle_style_menu.popup (1, 0);
+ shuttle_style_menu->popup (1, 0);
}
void
ARDOUR_UI::shuttle_unit_clicked ()
{
- shuttle_unit_menu.popup (1, 0);
+ shuttle_unit_menu->popup (1, 0);
}
void