#include "editor_regions.h"
#include "editor_locations.h"
#include "editor_snapshots.h"
+#include "editor_summary.h"
#include "i18n.h"
N_("Seconds"),
N_("Minutes"),
N_("Beats/32"),
+ N_("Beats/28"),
+ N_("Beats/24"),
N_("Beats/16"),
+ N_("Beats/14"),
+ N_("Beats/12"),
+ N_("Beats/10"),
N_("Beats/8"),
+ N_("Beats/7"),
+ N_("Beats/6"),
+ N_("Beats/5"),
N_("Beats/4"),
N_("Beats/3"),
+ N_("Beats/2"),
N_("Beats"),
N_("Bars"),
N_("Marks"),
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::fade_in_cursor = 0;
+Gdk::Cursor* Editor::fade_out_cursor = 0;
Gdk::Cursor* Editor::grabber_cursor = 0;
+Gdk::Cursor* Editor::grabber_note_cursor = 0;
Gdk::Cursor* Editor::grabber_edit_point_cursor = 0;
Gdk::Cursor* Editor::zoom_cursor = 0;
Gdk::Cursor* Editor::time_fx_cursor = 0;
for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
_global_port_matrix[*i] = 0;
}
- allow_vertical_scroll = false;
no_save_visual = false;
resize_idle_id = -1;
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));
edit_packer.set_border_width (0);
edit_packer.set_name ("EditorWindow");
- edit_packer.attach (zoom_vbox, 0, 1, 0, 2, SHRINK, FILL, 0, 0);
/* labels for the rulers */
edit_packer.attach (ruler_label_event_box, 1, 2, 0, 1, FILL, SHRINK, 0, 0);
/* labels for the marker "tracks" */
the_notebook.show_all ();
post_maximal_editor_width = 0;
- post_maximal_pane_position = 0;
+ post_maximal_horizontal_pane_position = 0;
+ post_maximal_editor_height = 0;
+ post_maximal_vertical_pane_position = 0;
- VPaned *editor_summary_pane = manage(new VPaned());
- editor_summary_pane->pack1(edit_packer);
+ editor_summary_pane.pack1(edit_packer);
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);
_summary_hbox.pack_start (*summary_frame, true, true);
_summary_hbox.pack_start (*summary_arrows_right, false, false);
- editor_summary_pane->pack2 (_summary_hbox);
+ editor_summary_pane.pack2 (_summary_hbox);
- edit_pane.pack1 (*editor_summary_pane, true, true);
+ edit_pane.pack1 (editor_summary_pane, true, true);
edit_pane.pack2 (the_notebook, false, true);
+ editor_summary_pane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun (*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&editor_summary_pane)));
+
+ /* XXX: editor_summary_pane might need similar special OS X treatment to the edit_pane */
+
edit_pane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
#ifdef GTKOSX
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
}
if ((entered_regionview = rv) != 0) {
- entered_regionview->entered ();
+ entered_regionview->entered (internal_editing ());
}
}
{
ENSURE_GUI_THREAD (*this, &Editor::map_position_change, frame)
- if (_session == 0 || !_follow_playhead) {
+ if (_session == 0) {
return;
}
- center_screen (frame);
+ if (_follow_playhead) {
+ center_screen (frame);
+ }
+
playhead_cursor->set_position (frame);
}
grabber_cursor = new Gdk::Cursor (HAND2);
+ {
+ Glib::RefPtr<Gdk::Pixbuf> grabber_note_pixbuf (::get_icon ("grabber_note"));
+ grabber_note_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_note_pixbuf, 5, 10);
+ }
+
{
Glib::RefPtr<Gdk::Pixbuf> grabber_edit_point_pixbuf (::get_icon ("grabber_edit_point"));
grabber_edit_point_cursor = new Gdk::Cursor (Gdk::Display::get_default(), grabber_edit_point_pixbuf, 5, 17);
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);
+ }
+
+ {
+ Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("fade_in_cursor"));
+ fade_in_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 0, 40);
+ }
+
+ {
+ Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("fade_out_cursor"));
+ fade_out_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 27, 40);
+ }
+
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())) {
boost::shared_ptr<Track> tr;
boost::shared_ptr<Playlist> pl;
- if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
+ /* Don't offer a region submenu if we are in internal edit mode, as we don't select regions in this
+ mode and so offering region context is somewhat confusing.
+ */
+ if ((tr = rtv->track()) && ((pl = tr->playlist())) && !internal_editing()) {
Playlist::RegionList* regions = pl->regions_at ((nframes64_t) floor ( (double)frame * tr->speed()));
if (selection->regions.size() > 1) {
}
items.push_back (MenuElem (str, sigc::bind (sigc::mem_fun(*this, &Editor::toggle_xfade_active), boost::weak_ptr<Crossfade> (xfade))));
- items.push_back (MenuElem (_("Edit"), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr<Crossfade> (xfade))));
+ items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr<Crossfade> (xfade))));
if (xfade->can_follow_overlap()) {
sigc::bind (sigc::mem_fun(*this, &Editor::set_selected_regionview_from_map_event), sv, boost::weak_ptr<Region>(region)));
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &Editor::rename_region)));
- if (mr && internal_editing()) {
- items.push_back (MenuElem (_("List editor..."), sigc::mem_fun(*this, &Editor::show_midi_list_editor)));
- } else {
- items.push_back (MenuElem (_("Region Properties..."), sigc::mem_fun(*this, &Editor::edit_region)));
+ if (mr) {
+ items.push_back (MenuElem (_("List Editor..."), sigc::mem_fun(*this, &Editor::show_midi_list_editor)));
}
+ items.push_back (MenuElem (_("Region Properties..."), sigc::mem_fun(*this, &Editor::edit_region)));
}
items.push_back (MenuElem (_("Raise to Top Layer"), sigc::mem_fun(*this, &Editor::raise_region_to_top)));
items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
CheckMenuItem* bbt_glue_item = static_cast<CheckMenuItem*>(&items.back());
- switch (region_to_check->positional_lock_style()) {
- case Region::MusicTime:
+ switch (region_to_check->position_lock_style()) {
+ case MusicTime:
bbt_glue_item->set_active (true);
break;
default:
} else if (mr) {
items.push_back (MenuElem (_("Quantize"), sigc::mem_fun(*this, &Editor::quantize_region)));
+ items.push_back (MenuElem (_("Fork"), sigc::mem_fun(*this, &Editor::fork_region)));
items.push_back (SeparatorElem());
}
}
edit_items.push_back (SeparatorElem());
- edit_items.push_back (MenuElem (_("Silence Range"), sigc::mem_fun(*this, &Editor::separate_region_from_selection)));
+ edit_items.push_back (MenuElem (_("Convert to region in-place"), mem_fun(*this, &Editor::separate_region_from_selection)));
edit_items.push_back (MenuElem (_("Convert to Region in Region List"), sigc::mem_fun(*this, &Editor::new_region_from_selection)));
edit_items.push_back (SeparatorElem());
edit_items.push_back (MenuElem (_("Consolidate Range With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), true, true)));
edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
- edit_items.push_back (MenuElem (_("Export Range"), sigc::mem_fun(*this, &Editor::export_range)));
+ edit_items.push_back (MenuElem (_("Export Range"), sigc::mem_fun(*this, &Editor::export_selection)));
}
instant_save ();
switch (_snap_type) {
- case SnapToAThirtysecondBeat:
- case SnapToASixteenthBeat:
- case SnapToAEighthBeat:
- case SnapToAQuarterBeat:
- case SnapToAThirdBeat:
+ case SnapToBeatDiv32:
+ case SnapToBeatDiv28:
+ case SnapToBeatDiv24:
+ case SnapToBeatDiv16:
+ case SnapToBeatDiv14:
+ case SnapToBeatDiv12:
+ case SnapToBeatDiv10:
+ case SnapToBeatDiv8:
+ case SnapToBeatDiv7:
+ case SnapToBeatDiv6:
+ case SnapToBeatDiv5:
+ case SnapToBeatDiv4:
+ case SnapToBeatDiv3:
+ case SnapToBeatDiv2:
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + current_page_frames());
update_tempo_based_rulers ();
break;
default:
/* relax */
break;
- }
+ }
+
+ SnapChanged (); /* EMIT SIGNAL */
}
void
the_notebook.set_current_page (atoi (prop->value ()));
}
- if ((prop = node.property (X_("editor-pane-position")))) {
- edit_pane.set_position (atoi (prop->value ()));
- }
-
return 0;
}
snprintf(buf, sizeof(buf), "%d", yoff);
geometry->add_property("y-off", string(buf));
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&edit_pane)->gobj()));
- geometry->add_property("edit_pane_pos", string(buf));
+ geometry->add_property("edit-horizontal-pane-pos", string(buf));
+ snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&editor_summary_pane)->gobj()));
+ geometry->add_property("edit-vertical-pane-pos", string(buf));
node->add_child_nocopy (*geometry);
}
snprintf (buf, sizeof (buf), "%d", the_notebook.get_current_page ());
node->add_property (X_("editor-list-page"), buf);
- snprintf (buf, sizeof (buf), "%d", edit_pane.get_position ());
- node->add_property (X_("editor-pane-position"), buf);
-
return *node;
}
start = _session->tempo_map().round_to_beat (start, direction);
break;
- case SnapToAThirtysecondBeat:
+ case SnapToBeatDiv32:
start = _session->tempo_map().round_to_beat_subdivision (start, 32, direction);
break;
-
- case SnapToASixteenthBeat:
+ case SnapToBeatDiv28:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 28, direction);
+ break;
+ case SnapToBeatDiv24:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 24, direction);
+ break;
+ case SnapToBeatDiv16:
start = _session->tempo_map().round_to_beat_subdivision (start, 16, direction);
break;
-
- case SnapToAEighthBeat:
+ case SnapToBeatDiv14:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 14, direction);
+ break;
+ case SnapToBeatDiv12:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 12, direction);
+ break;
+ case SnapToBeatDiv10:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 10, direction);
+ break;
+ case SnapToBeatDiv8:
start = _session->tempo_map().round_to_beat_subdivision (start, 8, direction);
break;
-
- case SnapToAQuarterBeat:
+ case SnapToBeatDiv7:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 7, direction);
+ break;
+ case SnapToBeatDiv6:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 6, direction);
+ break;
+ case SnapToBeatDiv5:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 5, direction);
+ break;
+ case SnapToBeatDiv4:
start = _session->tempo_map().round_to_beat_subdivision (start, 4, direction);
break;
-
- case SnapToAThirdBeat:
+ case SnapToBeatDiv3:
start = _session->tempo_map().round_to_beat_subdivision (start, 3, direction);
break;
+ case SnapToBeatDiv2:
+ start = _session->tempo_map().round_to_beat_subdivision (start, 2, direction);
+ break;
case SnapToMark:
if (for_mark) {
/* Zoom */
- zoom_box.set_spacing (1);
- zoom_box.set_border_width (0);
+ _zoom_box.set_spacing (1);
+ _zoom_box.set_border_width (0);
zoom_in_button.set_name ("EditorTimeButton");
zoom_in_button.set_image (*(manage (new Image (Stock::ZOOM_IN, Gtk::ICON_SIZE_MENU))));
set_popdown_strings (zoom_focus_selector, zoom_focus_strings, true);
zoom_focus_selector.signal_changed().connect (sigc::mem_fun(*this, &Editor::zoom_focus_selection_done));
- zoom_box.pack_start (zoom_out_button, false, false);
- zoom_box.pack_start (zoom_in_button, false, false);
- zoom_box.pack_start (zoom_out_full_button, false, false);
+ _zoom_box.pack_start (zoom_out_button, false, false);
+ _zoom_box.pack_start (zoom_in_button, false, false);
+ _zoom_box.pack_start (zoom_out_full_button, false, false);
/* Track zoom buttons */
tav_expand_button.set_name ("TrackHeightButton");
tav_shrink_button.add (*(manage (new Image (::get_icon("tav_shrink")))));
tav_shrink_button.signal_clicked().connect (sigc::bind (sigc::mem_fun(*this, &Editor::tav_zoom_step), false));
- track_zoom_box.set_spacing (1);
- track_zoom_box.set_border_width (0);
-
- track_zoom_box.pack_start (tav_shrink_button, false, false);
- track_zoom_box.pack_start (tav_expand_button, false, false);
-
- HBox* zbc = manage (new HBox);
- zbc->pack_start (zoom_focus_selector, PACK_SHRINK);
- zoom_vbox.pack_start (*zbc, PACK_SHRINK);
- zoom_vbox.pack_start (zoom_box, PACK_SHRINK);
- zoom_vbox.pack_start (track_zoom_box, PACK_SHRINK);
+ _zoom_box.pack_start (tav_expand_button);
+ _zoom_box.pack_start (tav_shrink_button);
+ _zoom_box.pack_start (zoom_focus_selector);
+
+ _zoom_tearoff = manage (new TearOff (_zoom_box));
+
+ _zoom_tearoff->Detach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
+ &_zoom_tearoff->tearoff_window()));
+ _zoom_tearoff->Attach.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
+ &_zoom_tearoff->tearoff_window(), 0));
+ _zoom_tearoff->Hidden.connect (sigc::bind (sigc::mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
+ &_zoom_tearoff->tearoff_window()));
+ _zoom_tearoff->Visible.connect (sigc::bind (sigc::mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
+ &_zoom_tearoff->tearoff_window(), 0));
+
snap_box.set_spacing (1);
snap_box.set_border_width (2);
toolbar_hbox.set_border_width (1);
toolbar_hbox.pack_start (*_mouse_mode_tearoff, false, false);
+ toolbar_hbox.pack_start (*_zoom_tearoff, false, false);
toolbar_hbox.pack_start (*_tools_tearoff, false, false);
hbox->pack_start (snap_box, false, false);
Editor::setup_tooltips ()
{
ARDOUR_UI::instance()->set_tip (mouse_move_button, _("Select/Move Objects"));
- ARDOUR_UI::instance()->set_tip (mouse_select_button, _("Select/Move Ranges"));
ARDOUR_UI::instance()->set_tip (mouse_gain_button, _("Draw Gain Automation"));
ARDOUR_UI::instance()->set_tip (mouse_zoom_button, _("Select Zoom Range"));
ARDOUR_UI::instance()->set_tip (mouse_timefx_button, _("Stretch/Shrink Regions"));
string choice = snap_type_selector.get_active_text();
SnapType snaptype = SnapToBeat;
- if (choice == _("Beats/3")) {
- snaptype = SnapToAThirdBeat;
+ if (choice == _("Beats/2")) {
+ snaptype = SnapToBeatDiv2;
+ } else if (choice == _("Beats/3")) {
+ snaptype = SnapToBeatDiv3;
} else if (choice == _("Beats/4")) {
- snaptype = SnapToAQuarterBeat;
+ snaptype = SnapToBeatDiv4;
+ } else if (choice == _("Beats/5")) {
+ snaptype = SnapToBeatDiv5;
+ } else if (choice == _("Beats/6")) {
+ snaptype = SnapToBeatDiv6;
+ } else if (choice == _("Beats/7")) {
+ snaptype = SnapToBeatDiv7;
} else if (choice == _("Beats/8")) {
- snaptype = SnapToAEighthBeat;
+ snaptype = SnapToBeatDiv8;
+ } else if (choice == _("Beats/10")) {
+ snaptype = SnapToBeatDiv10;
+ } else if (choice == _("Beats/12")) {
+ snaptype = SnapToBeatDiv12;
+ } else if (choice == _("Beats/14")) {
+ snaptype = SnapToBeatDiv14;
} else if (choice == _("Beats/16")) {
- snaptype = SnapToASixteenthBeat;
+ snaptype = SnapToBeatDiv16;
+ } else if (choice == _("Beats/24")) {
+ snaptype = SnapToBeatDiv24;
+ } else if (choice == _("Beats/28")) {
+ snaptype = SnapToBeatDiv28;
} else if (choice == _("Beats/32")) {
- snaptype = SnapToAThirtysecondBeat;
+ snaptype = SnapToBeatDiv32;
} else if (choice == _("Beats")) {
snaptype = SnapToBeat;
} else if (choice == _("Bars")) {
char buf[32];
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
int width, height;
- static int32_t done;
+
+ enum Pane {
+ Horizontal = 0x1,
+ Vertical = 0x2
+ };
+
+ static Pane done;
+
XMLNode* geometry;
width = default_width;
if ((geometry = find_named_node (*node, "geometry")) != 0) {
- if ((prop = geometry->property ("x_size")) == 0) {
- prop = geometry->property ("x-size");
- }
+ prop = geometry->property ("x-size");
if (prop) {
width = atoi (prop->value());
}
- if ((prop = geometry->property ("y_size")) == 0) {
- prop = geometry->property ("y-size");
- }
+ prop = geometry->property ("y-size");
if (prop) {
height = atoi (prop->value());
}
if (which == static_cast<Paned*> (&edit_pane)) {
- if (done) {
+ if (done & Horizontal) {
return;
}
- if (!geometry || (prop = geometry->property ("edit-pane-pos")) == 0) {
+ if (!geometry || (prop = geometry->property ("edit-horizontal-pane-pos")) == 0) {
/* initial allocation is 90% to canvas, 10% to notebook */
pos = (int) floor (alloc.get_width() * 0.90f);
snprintf (buf, sizeof(buf), "%d", pos);
pos = atoi (prop->value());
}
- if ((done = GTK_WIDGET(edit_pane.gobj())->allocation.width > pos)) {
+ if (GTK_WIDGET(edit_pane.gobj())->allocation.width > pos) {
edit_pane.set_position (pos);
- pre_maximal_pane_position = pos;
+ pre_maximal_horizontal_pane_position = pos;
+ }
+
+ done = (Pane) (done | Horizontal);
+
+ } else if (which == static_cast<Paned*> (&editor_summary_pane)) {
+
+ if (done & Vertical) {
+ return;
}
+
+ if (!geometry || (prop = geometry->property ("edit-vertical-pane-pos")) == 0) {
+ /* initial allocation is 90% to canvas, 10% to summary */
+ pos = (int) floor (alloc.get_height() * 0.90f);
+ snprintf (buf, sizeof(buf), "%d", pos);
+ } else {
+ pos = atoi (prop->value());
+ }
+
+ if (GTK_WIDGET(editor_summary_pane.gobj())->allocation.height > pos) {
+ editor_summary_pane.set_position (pos);
+ pre_maximal_vertical_pane_position = pos;
+ }
+
+ done = (Pane) (done | Vertical);
}
}
return 1.0;
break;
- case SnapToAThirtysecondBeat:
+ case SnapToBeatDiv32:
return 1.0/32.0;
break;
-
- case SnapToASixteenthBeat:
+ case SnapToBeatDiv28:
+ return 1.0/28.0;
+ break;
+ case SnapToBeatDiv24:
+ return 1.0/24.0;
+ break;
+ case SnapToBeatDiv16:
return 1.0/16.0;
break;
-
- case SnapToAEighthBeat:
+ case SnapToBeatDiv14:
+ return 1.0/14.0;
+ break;
+ case SnapToBeatDiv12:
+ return 1.0/12.0;
+ break;
+ case SnapToBeatDiv10:
+ return 1.0/10.0;
+ break;
+ case SnapToBeatDiv8:
return 1.0/8.0;
break;
-
- case SnapToAQuarterBeat:
+ case SnapToBeatDiv7:
+ return 1.0/7.0;
+ break;
+ case SnapToBeatDiv6:
+ return 1.0/6.0;
+ break;
+ case SnapToBeatDiv5:
+ return 1.0/5.0;
+ break;
+ case SnapToBeatDiv4:
return 1.0/4.0;
break;
-
- case SnapToAThirdBeat:
+ case SnapToBeatDiv3:
return 1.0/3.0;
break;
+ case SnapToBeatDiv2:
+ return 1.0/2.0;
+ break;
case SnapToBar:
if (_session) {
{
_mouse_mode_tearoff->set_visible (false);
_tools_tearoff->set_visible (false);
+ _zoom_tearoff->set_visible (false);
- pre_maximal_pane_position = edit_pane.get_position();
- pre_maximal_editor_width = this->get_width();
+ pre_maximal_horizontal_pane_position = edit_pane.get_position ();
+ pre_maximal_vertical_pane_position = editor_summary_pane.get_position ();
+ pre_maximal_editor_width = this->get_width ();
+ pre_maximal_editor_height = this->get_height ();
- if(post_maximal_pane_position == 0) {
- post_maximal_pane_position = edit_pane.get_width();
+ if (post_maximal_horizontal_pane_position == 0) {
+ post_maximal_horizontal_pane_position = edit_pane.get_width();
}
- fullscreen();
+ if (post_maximal_vertical_pane_position == 0) {
+ post_maximal_vertical_pane_position = editor_summary_pane.get_height();
+ }
+
+ fullscreen ();
- if(post_maximal_editor_width) {
- edit_pane.set_position (post_maximal_pane_position -
+ if (post_maximal_editor_width) {
+ edit_pane.set_position (post_maximal_horizontal_pane_position -
abs(post_maximal_editor_width - pre_maximal_editor_width));
} else {
- edit_pane.set_position (post_maximal_pane_position);
+ edit_pane.set_position (post_maximal_horizontal_pane_position);
+ }
+
+ if (post_maximal_editor_height) {
+ editor_summary_pane.set_position (post_maximal_vertical_pane_position -
+ abs(post_maximal_editor_height - pre_maximal_editor_height));
+ } else {
+ editor_summary_pane.set_position (post_maximal_vertical_pane_position);
}
}
void
Editor::restore_editing_space ()
{
- // user changed width of pane during fullscreen
+ // user changed width/height of panes during fullscreen
- if(post_maximal_pane_position != edit_pane.get_position()) {
- post_maximal_pane_position = edit_pane.get_position();
+ if (post_maximal_horizontal_pane_position != edit_pane.get_position()) {
+ post_maximal_horizontal_pane_position = edit_pane.get_position();
}
+ if (post_maximal_vertical_pane_position != editor_summary_pane.get_position()) {
+ post_maximal_vertical_pane_position = editor_summary_pane.get_position();
+ }
+
unfullscreen();
_mouse_mode_tearoff->set_visible (true);
_tools_tearoff->set_visible (true);
+ _zoom_tearoff->set_visible (true);
post_maximal_editor_width = this->get_width();
+ post_maximal_editor_height = this->get_height();
- edit_pane.set_position (pre_maximal_pane_position + abs(this->get_width() - pre_maximal_editor_width));
+ edit_pane.set_position (pre_maximal_horizontal_pane_position + abs(this->get_width() - pre_maximal_editor_width));
+ editor_summary_pane.set_position (pre_maximal_vertical_pane_position + abs(this->get_height() - pre_maximal_editor_height));
}
/**
_summary->set_dirty ();
}
-void
-Editor::streamview_height_changed ()
-{
- _summary->set_dirty ();
-}
-
TimeAxisView*
Editor::axis_view_from_route (boost::shared_ptr<Route> r) const
{
rtv->effective_gain_display ();
rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added));
- rtv->view()->HeightChanged.connect (sigc::mem_fun (*this, &Editor::streamview_height_changed));
}
_routes->routes_added (new_views);
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 */