Gdk::Cursor* Editor::cross_hair_cursor = 0;
Gdk::Cursor* Editor::selector_cursor = 0;
Gdk::Cursor* Editor::trimmer_cursor = 0;
+Gdk::Cursor* Editor::left_side_trim_cursor = 0;
+Gdk::Cursor* Editor::right_side_trim_cursor = 0;
Gdk::Cursor* Editor::grabber_cursor = 0;
Gdk::Cursor* Editor::grabber_edit_point_cursor = 0;
Gdk::Cursor* Editor::zoom_cursor = 0;
frames_per_unit = 2048; /* too early to use reset_zoom () */
+ _scroll_callbacks = 0;
+
zoom_focus = ZoomFocusLeft;
set_zoom_focus (ZoomFocusLeft);
zoom_range_clock.ValueChanged.connect (sigc::mem_fun(*this, &Editor::zoom_adjustment_changed));
Button* summary_arrows_left_left = manage (new Button);
summary_arrows_left_left->add (*manage (new Arrow (ARROW_LEFT, SHADOW_NONE)));
- summary_arrows_left_left->signal_clicked().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_left));
+ summary_arrows_left_left->signal_pressed().connect (sigc::hide_return (sigc::mem_fun (*this, &Editor::horizontal_scroll_left_press)));
+ summary_arrows_left_left->signal_released().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_left_release));
Button* summary_arrows_left_right = manage (new Button);
summary_arrows_left_right->add (*manage (new Arrow (ARROW_RIGHT, SHADOW_NONE)));
- summary_arrows_left_right->signal_clicked().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_right));
+ summary_arrows_left_right->signal_pressed().connect (sigc::hide_return (sigc::mem_fun (*this, &Editor::horizontal_scroll_right_press)));
+ summary_arrows_left_right->signal_released().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_right_release));
VBox* summary_arrows_left = manage (new VBox);
summary_arrows_left->pack_start (*summary_arrows_left_left);
summary_arrows_left->pack_start (*summary_arrows_left_right);
Button* summary_arrows_right_left = manage (new Button);
summary_arrows_right_left->add (*manage (new Arrow (ARROW_LEFT, SHADOW_NONE)));
- summary_arrows_right_left->signal_clicked().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_left));
+ summary_arrows_right_left->signal_pressed().connect (sigc::hide_return (sigc::mem_fun (*this, &Editor::horizontal_scroll_left_press)));
+ summary_arrows_right_left->signal_released().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_left_release));
Button* summary_arrows_right_right = manage (new Button);
summary_arrows_right_right->add (*manage (new Arrow (ARROW_RIGHT, SHADOW_NONE)));
- summary_arrows_right_right->signal_clicked().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_right));
+ summary_arrows_right_right->signal_pressed().connect (sigc::hide_return (sigc::mem_fun (*this, &Editor::horizontal_scroll_right_press)));
+ summary_arrows_right_right->signal_released().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_right_release));
VBox* summary_arrows_right = manage (new VBox);
summary_arrows_right->pack_start (*summary_arrows_right_left);
summary_arrows_right->pack_start (*summary_arrows_right_right);
cross_hair_cursor = new Gdk::Cursor (CROSSHAIR);
trimmer_cursor = new Gdk::Cursor (SB_H_DOUBLE_ARROW);
+
+ {
+ Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_left_cursor"));
+ left_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 5, 11);
+ }
+
+ {
+ Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_right_cursor"));
+ right_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 23, 11);
+ }
+
selector_cursor = new Gdk::Cursor (XTERM);
time_fx_cursor = new Gdk::Cursor (SIZING);
wait_cursor = new Gdk::Cursor (WATCH);
case RegionItem:
case RegionViewName:
case RegionViewNameHighlight:
+ case LeftFrameHandle:
+ case RightFrameHandle:
if (with_selection) {
build_menu_function = &Editor::build_track_selection_context_menu;
} else {
case RegionItem:
case RegionViewName:
case RegionViewNameHighlight:
+ case LeftFrameHandle:
+ case RightFrameHandle:
if (!with_selection) {
if (region_edit_menu_split_item) {
if (clicked_regionview && clicked_regionview->region()->covers (get_preferred_edit_position())) {
return true; // do it again, till we stop
}
-void
-Editor::horizontal_scroll_left ()
+bool
+Editor::horizontal_scroll_left_press ()
{
+ ++_scroll_callbacks;
+
+ if (_scroll_connection.connected() && _scroll_callbacks < 5) {
+ /* delay the first auto-repeat */
+ return true;
+ }
+
double x = leftmost_position() - current_page_frames() / 5;
if (x < 0) {
x = 0;
}
reset_x_origin (x);
+
+ /* do hacky auto-repeat */
+ if (!_scroll_connection.connected ()) {
+ _scroll_connection = Glib::signal_timeout().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_left_press), 100);
+ _scroll_callbacks = 0;
+ }
+
+ return true;
}
void
-Editor::horizontal_scroll_right ()
+Editor::horizontal_scroll_left_release ()
+{
+ _scroll_connection.disconnect ();
+}
+
+bool
+Editor::horizontal_scroll_right_press ()
{
+ ++_scroll_callbacks;
+
+ if (_scroll_connection.connected() && _scroll_callbacks < 5) {
+ /* delay the first auto-repeat */
+ return true;
+ }
+
reset_x_origin (leftmost_position() + current_page_frames() / 5);
+
+ /* do hacky auto-repeat */
+ if (!_scroll_connection.connected ()) {
+ _scroll_connection = Glib::signal_timeout().connect (sigc::mem_fun (*this, &Editor::horizontal_scroll_right_press), 100);
+ _scroll_callbacks = 0;
+ }
+
+ return true;
+}
+
+void
+Editor::horizontal_scroll_right_release ()
+{
+ _scroll_connection.disconnect ();
}
/** Queue a change for the Editor viewport x origin to follow the playhead */