lots of small fixes for various irritations, return of snapshots, region list hiding stuff, etc etc etc

git-svn-id: svn://localhost/trunk/ardour2@241 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-01-05 03:18:44 +00:00
parent f020b4e1e6
commit 2fcdf14e2b
14 changed files with 248 additions and 398 deletions

View file

@ -1,25 +1,26 @@
; this file is an automated accelerator map dump ; this file is NOT an automated accelerator map dump
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
(gtk_accel_path "<Actions>/Common/Quit" "<Control>q")
(gtk_accel_path "<Actions>/Common/Save" "<Control>s")
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space") (gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<Control>space") (gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<Control>space")
(gtk_accel_path "<Actions>/Transport/Forward" "Right") (gtk_accel_path "<Actions>/Transport/Forward" "<control>Right")
(gtk_accel_path "<Actions>/Transport/Rewind" "Left") (gtk_accel_path "<Actions>/Transport/Rewind" "<control>Left")
(gtk_accel_path "<Actions>/Transport/Record" "R")
(gtk_accel_path "<Actions>/Transport/loop" "l")
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home") (gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
(gtk_accel_path "<Actions>/Transport/GotoEnd" "End") (gtk_accel_path "<Actions>/Transport/GotoEnd" "End")
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "a")
(gtk_accel_path "<Actions>/Editor/set-edit-cursor" "e") (gtk_accel_path "<Actions>/Editor/set-edit-cursor" "e")
(gtk_accel_path "<Actions>/Editor/cut" "<Control>x") (gtk_accel_path "<Actions>/Transport/loop" "l")
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
(gtk_accel_path "<Actions>/Transport/Record" "R")
(gtk_accel_path "<Actions>/Editor/copy" "<Control>c") (gtk_accel_path "<Actions>/Editor/copy" "<Control>c")
(gtk_accel_path "<Actions>/Editor/paste" "<Control>v") (gtk_accel_path "<Actions>/Common/Quit" "<Control>q")
(gtk_accel_path "<Actions>/Editor/undo" "<Control>z")
(gtk_accel_path "<Actions>/Editor/redo" "<Control>r") (gtk_accel_path "<Actions>/Editor/redo" "<Control>r")
(gtk_accel_path "<Actions>/Common/Save" "<Control>s")
(gtk_accel_path "<Actions>/Editor/paste" "<Control>v")
(gtk_accel_path "<Actions>/Editor/cut" "<Control>x")
(gtk_accel_path "<Actions>/Editor/undo" "<Control>z")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down") (gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up") (gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
(gtk_accel_path "<Actions>/Editor/step-tracks-down" "Down") (gtk_accel_path "<Actions>/Editor/step-tracks-down" "Down")
@ -30,7 +31,6 @@
(gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "minus") (gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "minus")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "equal") (gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "equal")
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "a")
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "<meta>a") (gtk_accel_path "<Actions>/Editor/align-regions-sync" "<meta>a")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<meta><control>a") (gtk_accel_path "<Actions>/Editor/align-regions-end" "<meta><control>a")
(gtk_accel_path "<Actions>/Editor/align-regions-start-relative" "<control>a") (gtk_accel_path "<Actions>/Editor/align-regions-start-relative" "<control>a")
@ -56,8 +56,8 @@
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "F1") (gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-start" "F1")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "F2") (gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "F2")
(gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "KP_Right") (gtk_accel_path "<Actions>/Editor/jump-forward-to-mark" "<control>KP_Right")
(gtk_accel_path "<Actions>/Editor/jump-backward-to-mark" "KP_Left") (gtk_accel_path "<Actions>/Editor/jump-backward-to-mark" "<control>KP_Left")
(gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "KP_Enter") (gtk_accel_path "<Actions>/Editor/add-location-from-playhead" "KP_Enter")

View file

@ -501,7 +501,7 @@ ARDOUR_UI::every_point_one_seconds ()
timersub (&now, &last_peak_grab, &diff); timersub (&now, &last_peak_grab, &diff);
if ((diff.tv_usec + (diff.tv_sec * 1000000)) >= engine->usecs_per_cycle()) { if ((diff.tv_usec + (diff.tv_sec * 1000000)) >= engine->usecs_per_cycle()) {
IO::GrabPeakPower(); /* EMIT_SIGNAL */ // IO::GrabPeakPower(); /* EMIT_SIGNAL */
last_peak_grab = now; last_peak_grab = now;
} }

View file

@ -319,6 +319,7 @@ Editor::Editor (AudioEngine& eng)
show_gain_after_trim = false; show_gain_after_trim = false;
no_zoom_repos_update = false; no_zoom_repos_update = false;
ignore_route_list_reorder = false; ignore_route_list_reorder = false;
no_route_list_redisplay = false;
verbose_cursor_on = true; verbose_cursor_on = true;
route_removal = false; route_removal = false;
track_spacing = 0; track_spacing = 0;
@ -496,9 +497,9 @@ Editor::Editor (AudioEngine& eng)
zoom_out_full_button.set_name ("EditorTimeButton"); zoom_out_full_button.set_name ("EditorTimeButton");
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to session")); ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to session"));
zoom_in_button.add (*(manage (new Gtk::Image (Stock::ZOOM_IN, ICON_SIZE_BUTTON)))); zoom_in_button.add (*(manage (new Image (Stock::ZOOM_IN, ICON_SIZE_BUTTON))));
zoom_out_button.add (*(manage (new Gtk::Image (Stock::ZOOM_OUT, ICON_SIZE_BUTTON)))); zoom_out_button.add (*(manage (new Image (Stock::ZOOM_OUT, ICON_SIZE_BUTTON))));
zoom_out_full_button.add (*(manage (new Gtk::Image (Stock::ZOOM_FIT, ICON_SIZE_BUTTON)))); zoom_out_full_button.add (*(manage (new Image (Stock::ZOOM_FIT, ICON_SIZE_BUTTON))));
zoom_in_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), false)); zoom_in_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
zoom_out_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), true)); zoom_out_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
@ -525,24 +526,18 @@ Editor::Editor (AudioEngine& eng)
route_list_display.append_column (_("Tracks"), route_display_columns.text); route_list_display.append_column (_("Tracks"), route_display_columns.text);
route_list_display.set_headers_visible (false); route_list_display.set_headers_visible (false);
route_list_display.set_name ("TrackListDisplay"); route_list_display.set_name ("TrackListDisplay");
route_list_display.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE); route_list_display.get_selection()->set_mode (SELECTION_MULTIPLE);
route_list_display.set_reorderable (true); route_list_display.set_reorderable (true);
route_list_display.set_size_request (75,-1); route_list_display.set_size_request (75,-1);
route_list_display.set_headers_visible (true);
route_list_display.set_headers_clickable (true);
// GTK2FIX
// route_list_display.signal_rows_reordered().connect (mem_fun (*this, &Editor::queue_route_list_reordered));
route_display_model->signal_rows_reordered().connect (mem_fun (*this, &Editor::route_list_reordered));
route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func)); route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func));
route_display_model->set_sort_column (0, SORT_ASCENDING); route_display_model->set_sort_column (0, SORT_ASCENDING);
route_list_scroller.add (route_list_display); route_list_scroller.add (route_list_display);
route_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); route_list_scroller.set_policy (POLICY_NEVER, POLICY_AUTOMATIC);
route_list_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::route_display_selection_changed)); route_list_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::route_display_selection_changed));
route_list_display.signal_columns_changed().connect (mem_fun(*this, &Editor::route_list_column_click));
edit_group_list_button_label.set_text (_("Edit Groups")); edit_group_list_button_label.set_text (_("Edit Groups"));
edit_group_list_button_label.set_name ("EditGroupTitleButton"); edit_group_list_button_label.set_name ("EditGroupTitleButton");
@ -564,17 +559,14 @@ Editor::Editor (AudioEngine& eng)
active_cell->property_radio() = false; active_cell->property_radio() = false;
edit_group_display.set_name ("MixerGroupList"); edit_group_display.set_name ("MixerGroupList");
//edit_group_display.set_shadow_type (Gtk::SHADOW_IN);
edit_group_display.columns_autosize (); edit_group_display.columns_autosize ();
edit_group_display.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE); edit_group_display.get_selection()->set_mode (SELECTION_MULTIPLE);
edit_group_display.set_reorderable (false); edit_group_display.set_reorderable (false);
edit_group_display.set_size_request (75, -1); edit_group_display.set_size_request (75, -1);
edit_group_display.set_headers_visible (true);
edit_group_list_scroller.add (edit_group_display); edit_group_list_scroller.add (edit_group_display);
edit_group_list_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); edit_group_list_scroller.set_policy (POLICY_AUTOMATIC, POLICY_AUTOMATIC);
edit_group_list_button.signal_clicked().connect (mem_fun(*this, &Editor::edit_group_list_button_clicked)); edit_group_list_button.signal_clicked().connect (mem_fun(*this, &Editor::edit_group_list_button_clicked));
edit_group_display.signal_button_press_event().connect (mem_fun(*this, &Editor::edit_group_list_button_press_event)); edit_group_display.signal_button_press_event().connect (mem_fun(*this, &Editor::edit_group_list_button_press_event));
@ -597,8 +589,11 @@ Editor::Editor (AudioEngine& eng)
region_list_model->set_sort_column (0, SORT_ASCENDING); region_list_model->set_sort_column (0, SORT_ASCENDING);
region_list_display.set_model (region_list_model); region_list_display.set_model (region_list_model);
CellRendererText* renderer = Gtk::manage( new Gtk::CellRendererText() ); CellRendererText* renderer = manage( new CellRendererText() );
region_list_display.append_column (_("Regions"), *renderer); region_list_display.append_column (_("Regions"), *renderer);
region_list_display.set_headers_visible (false);
region_list_display.get_selection()->set_select_function (mem_fun (*this, &Editor::region_list_selection_filter));
TreeViewColumn* tv_col = region_list_display.get_column(0); TreeViewColumn* tv_col = region_list_display.get_column(0);
tv_col->add_attribute(renderer->property_text(), region_list_columns.name); tv_col->add_attribute(renderer->property_text(), region_list_columns.name);
@ -606,12 +601,12 @@ Editor::Editor (AudioEngine& eng)
region_list_display.set_reorderable (true); region_list_display.set_reorderable (true);
region_list_display.get_selection()->set_mode (SELECTION_SINGLE); region_list_display.get_selection()->set_mode (SELECTION_MULTIPLE);
region_list_display.add_object_drag (region_list_columns.region.index(), "regions"); region_list_display.add_object_drag (region_list_columns.region.index(), "regions");
/* setup DnD handling */ /* setup DnD handling */
list<Gtk::TargetEntry> region_list_target_table; list<TargetEntry> region_list_target_table;
region_list_target_table.push_back (TargetEntry ("text/plain")); region_list_target_table.push_back (TargetEntry ("text/plain"));
region_list_target_table.push_back (TargetEntry ("text/uri-list")); region_list_target_table.push_back (TargetEntry ("text/uri-list"));
@ -640,15 +635,29 @@ Editor::Editor (AudioEngine& eng)
named_selection_display.set_size_request (100, -1); named_selection_display.set_size_request (100, -1);
named_selection_display.set_name ("RegionListDisplay"); named_selection_display.set_name ("RegionListDisplay");
named_selection_display.get_selection()->set_mode (Gtk::SELECTION_SINGLE); named_selection_display.get_selection()->set_mode (SELECTION_SINGLE);
named_selection_display.set_size_request (100, -1); named_selection_display.set_size_request (100, -1);
named_selection_display.set_headers_visible (true); named_selection_display.signal_button_press_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
named_selection_display.set_headers_clickable (true);
named_selection_display.signal_button_press_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press));
named_selection_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::named_selection_display_selection_changed)); named_selection_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::named_selection_display_selection_changed));
/* SNAPSHOTS */
snapshot_display_model = ListStore::create (snapshot_display_columns);
snapshot_display.set_model (snapshot_display_model);
snapshot_display.append_column (X_("snapshot"), snapshot_display_columns.visible_name);
snapshot_display.set_name ("SnapshotDisplayList");
snapshot_display.set_size_request (75, -1);
snapshot_display.set_headers_visible (false);
snapshot_display.set_reorderable (false);
snapshot_display_scroller.add (snapshot_display);
snapshot_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
snapshot_display.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::snapshot_display_selection_changed));
snapshot_display.signal_button_press_event().connect (mem_fun (*this, &Editor::snapshot_display_button_press), false);
the_notebook.append_page (region_list_scroller, _("Regions")); the_notebook.append_page (region_list_scroller, _("Regions"));
the_notebook.append_page (route_list_scroller, _("Tracks/Busses")); the_notebook.append_page (route_list_scroller, _("Tracks/Busses"));
the_notebook.append_page (snapshot_display_scroller, _("Snapshots"));
the_notebook.append_page (edit_group_vbox, _("Edit Groups")); the_notebook.append_page (edit_group_vbox, _("Edit Groups"));
the_notebook.append_page (named_selection_scroller, _("Chunks")); the_notebook.append_page (named_selection_scroller, _("Chunks"));
the_notebook.set_show_tabs (true); the_notebook.set_show_tabs (true);
@ -661,7 +670,7 @@ Editor::Editor (AudioEngine& eng)
edit_pane.pack1 (edit_frame, true, true); edit_pane.pack1 (edit_frame, true, true);
edit_pane.pack2 (*notebook_tearoff, true, true); edit_pane.pack2 (*notebook_tearoff, true, true);
edit_pane.signal_size_allocate().connect_notify (bind (mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Gtk::Paned*> (&edit_pane))); edit_pane.signal_size_allocate().connect_notify (bind (mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
top_hbox.pack_start (toolbar_frame, true, true); top_hbox.pack_start (toolbar_frame, true, true);
@ -692,8 +701,8 @@ Editor::Editor (AudioEngine& eng)
/* nudge stuff */ /* nudge stuff */
nudge_forward_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(right_arrow_xpm))))); nudge_forward_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(right_arrow_xpm)))));
nudge_backward_button.add (*(manage (new Gtk::Image (Gdk::Pixbuf::create_from_xpm_data(left_arrow_xpm))))); nudge_backward_button.add (*(manage (new Image (Gdk::Pixbuf::create_from_xpm_data(left_arrow_xpm)))));
ARDOUR_UI::instance()->tooltips().set_tip (nudge_forward_button, _("Nudge region/selection forwards")); ARDOUR_UI::instance()->tooltips().set_tip (nudge_forward_button, _("Nudge region/selection forwards"));
ARDOUR_UI::instance()->tooltips().set_tip (nudge_backward_button, _("Nudge region/selection backwards")); ARDOUR_UI::instance()->tooltips().set_tip (nudge_backward_button, _("Nudge region/selection backwards"));
@ -1230,7 +1239,7 @@ Editor::connect_to_session (Session *t)
update_punch_range_view (true); update_punch_range_view (true);
session->ControlChanged.connect (mem_fun(*this, &Editor::queue_session_control_changed)); session->ControlChanged.connect (mem_fun(*this, &Editor::queue_session_control_changed));
session->StateSaved.connect (mem_fun(*this, &Editor::session_state_saved));
refresh_location_display (); refresh_location_display ();
session->locations()->added.connect (mem_fun(*this, &Editor::add_new_location)); session->locations()->added.connect (mem_fun(*this, &Editor::add_new_location));
@ -1243,19 +1252,13 @@ Editor::connect_to_session (Session *t)
redisplay_regions (); redisplay_regions ();
redisplay_named_selections (); redisplay_named_selections ();
redisplay_snapshots ();
// GTK2FIX
// route_list_display.set_model (Glib::RefPtr<TreeModel>(0));
route_display_model->clear (); route_display_model->clear ();
no_route_list_redisplay = true;
session->foreach_route (this, &Editor::handle_new_route); session->foreach_route (this, &Editor::handle_new_route);
// route_list_display.select_all (); no_route_list_redisplay = false;
// GTK2FIX route_list_display.get_selection()->select_all ();
//route_list_display.sort ();
route_list_reordered ();
// route_list_display.set_model (route_display_model);
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit); (static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
@ -2472,9 +2475,9 @@ Editor::setup_toolbar ()
mouse_mode_tearoff = manage (new TearOff (mouse_mode_button_table)); mouse_mode_tearoff = manage (new TearOff (mouse_mode_button_table));
mouse_mode_tearoff->set_name ("MouseModeBase"); mouse_mode_tearoff->set_name ("MouseModeBase");
mouse_mode_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox), mouse_mode_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&mouse_mode_tearoff->tearoff_window())); &mouse_mode_tearoff->tearoff_window()));
mouse_mode_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox), mouse_mode_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&mouse_mode_tearoff->tearoff_window(), 1)); &mouse_mode_tearoff->tearoff_window(), 1));
mouse_move_button.set_name ("MouseModeButton"); mouse_move_button.set_name ("MouseModeButton");
@ -2491,12 +2494,12 @@ Editor::setup_toolbar ()
ARDOUR_UI::instance()->tooltips().set_tip (mouse_timefx_button, _("stretch/shrink regions")); ARDOUR_UI::instance()->tooltips().set_tip (mouse_timefx_button, _("stretch/shrink regions"));
ARDOUR_UI::instance()->tooltips().set_tip (mouse_audition_button, _("listen to specific regions")); ARDOUR_UI::instance()->tooltips().set_tip (mouse_audition_button, _("listen to specific regions"));
mouse_move_button.unset_flags (Gtk::CAN_FOCUS); mouse_move_button.unset_flags (CAN_FOCUS);
mouse_select_button.unset_flags (Gtk::CAN_FOCUS); mouse_select_button.unset_flags (CAN_FOCUS);
mouse_gain_button.unset_flags (Gtk::CAN_FOCUS); mouse_gain_button.unset_flags (CAN_FOCUS);
mouse_zoom_button.unset_flags (Gtk::CAN_FOCUS); mouse_zoom_button.unset_flags (CAN_FOCUS);
mouse_timefx_button.unset_flags (Gtk::CAN_FOCUS); mouse_timefx_button.unset_flags (CAN_FOCUS);
mouse_audition_button.unset_flags (Gtk::CAN_FOCUS); mouse_audition_button.unset_flags (CAN_FOCUS);
mouse_select_button.signal_toggled().connect (bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange)); mouse_select_button.signal_toggled().connect (bind (mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange));
mouse_select_button.signal_button_release_event().connect (mem_fun(*this, &Editor::mouse_select_button_release)); mouse_select_button.signal_button_release_event().connect (mem_fun(*this, &Editor::mouse_select_button_release));
@ -2660,9 +2663,9 @@ Editor::setup_toolbar ()
tools_tearoff = new TearOff (*hbox); tools_tearoff = new TearOff (*hbox);
tools_tearoff->set_name ("MouseModeBase"); tools_tearoff->set_name ("MouseModeBase");
tools_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox), tools_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Box*>(&toolbar_hbox),
&tools_tearoff->tearoff_window())); &tools_tearoff->tearoff_window()));
tools_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox), tools_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Box*> (&toolbar_hbox),
&tools_tearoff->tearoff_window(), 0)); &tools_tearoff->tearoff_window(), 0));
@ -2675,7 +2678,7 @@ Editor::setup_toolbar ()
toolbar_base.set_name ("ToolBarBase"); toolbar_base.set_name ("ToolBarBase");
toolbar_base.add (toolbar_hbox); toolbar_base.add (toolbar_hbox);
toolbar_frame.set_shadow_type (Gtk::SHADOW_OUT); toolbar_frame.set_shadow_type (SHADOW_OUT);
toolbar_frame.set_name ("BaseFrame"); toolbar_frame.set_name ("BaseFrame");
toolbar_frame.add (toolbar_base); toolbar_frame.add (toolbar_base);
} }
@ -3308,7 +3311,7 @@ Editor::duplicate_dialog (bool dup_region)
win.add_button (Stock::OK, RESPONSE_ACCEPT); win.add_button (Stock::OK, RESPONSE_ACCEPT);
win.add_button (Stock::CANCEL, RESPONSE_CANCEL); win.add_button (Stock::CANCEL, RESPONSE_CANCEL);
win.set_position (Gtk::WIN_POS_MOUSE); win.set_position (WIN_POS_MOUSE);
entry.set_text ("1"); entry.set_text ("1");
set_size_request_to_display_given_text (entry, X_("12345678"), 20, 15); set_size_request_to_display_given_text (entry, X_("12345678"), 20, 15);
@ -3629,7 +3632,7 @@ Editor::ensure_float (Window& win)
} }
void void
Editor::pane_allocation_handler (Gtk::Allocation &alloc, Gtk::Paned* which) Editor::pane_allocation_handler (Allocation &alloc, Paned* which)
{ {
/* recover or initialize pane positions. do this here rather than earlier because /* recover or initialize pane positions. do this here rather than earlier because
we don't want the positions to change the child allocations, which they seem to do. we don't want the positions to change the child allocations, which they seem to do.
@ -3651,7 +3654,7 @@ Editor::pane_allocation_handler (Gtk::Allocation &alloc, Gtk::Paned* which)
height = atoi(geometry->property("y_size")->value()); height = atoi(geometry->property("y_size")->value());
} }
if (which == static_cast<Gtk::Paned*> (&edit_pane)) { if (which == static_cast<Paned*> (&edit_pane)) {
if (done[0]) { if (done[0]) {
return; return;
@ -3671,7 +3674,7 @@ Editor::pane_allocation_handler (Gtk::Allocation &alloc, Gtk::Paned* which)
} }
void void
Editor::detach_tearoff (Gtk::Box* b, Gtk::Window* w) Editor::detach_tearoff (Box* b, Window* w)
{ {
if (tools_tearoff->torn_off() && if (tools_tearoff->torn_off() &&
mouse_mode_tearoff->torn_off()) { mouse_mode_tearoff->torn_off()) {
@ -3680,7 +3683,7 @@ Editor::detach_tearoff (Gtk::Box* b, Gtk::Window* w)
} }
void void
Editor::reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n) Editor::reattach_tearoff (Box* b, Window* w, int32_t n)
{ {
if (toolbar_frame.get_parent() == 0) { if (toolbar_frame.get_parent() == 0) {
top_hbox.pack_end (toolbar_frame); top_hbox.pack_end (toolbar_frame);
@ -3790,7 +3793,7 @@ Editor::playlist_deletion_dialog (Playlist* pl)
"If deleted, audio files used by it alone by will cleaned."), "If deleted, audio files used by it alone by will cleaned."),
pl->name())); pl->name()));
dialog.set_position (Gtk::WIN_POS_CENTER); dialog.set_position (WIN_POS_CENTER);
dialog.get_vbox()->pack_start (label); dialog.get_vbox()->pack_start (label);
dialog.add_button (_("Delete playlist"), RESPONSE_ACCEPT); dialog.add_button (_("Delete playlist"), RESPONSE_ACCEPT);
@ -3889,3 +3892,67 @@ Editor::control_layout_scroll (GdkEventScroll* ev)
return false; return false;
} }
void
Editor::snapshot_display_selection_changed ()
{
if (snapshot_display.get_selection()->count_selected_rows() > 0) {
TreeModel::iterator i = snapshot_display.get_selection()->get_selected();
cerr << "snapshot selected\n";
Glib::ustring snap_name = (*i)[snapshot_display_columns.real_name];
cerr << "name is " << snap_name << endl;
if (snap_name.length() == 0) {
return;
}
if (session->snap_name() == snap_name) {
return;
}
ARDOUR_UI::instance()->load_session(session->path(), string (snap_name));
}
}
bool
Editor::snapshot_display_button_press (GdkEventButton* ev)
{
return false;
}
void
Editor::redisplay_snapshots ()
{
if (session == 0) {
return;
}
vector<string*>* states;
if ((states = session->possible_states()) == 0) {
return;
}
snapshot_display_model->clear ();
for (vector<string*>::iterator i = states->begin(); i != states->end(); ++i) {
string statename = *(*i);
TreeModel::Row row = *(snapshot_display_model->append());
row[snapshot_display_columns.visible_name] = statename;
row[snapshot_display_columns.real_name] = statename;
}
delete states;
}
void
Editor::session_state_saved (string snap_name)
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::session_state_saved), snap_name));
redisplay_snapshots ();
}

View file

@ -697,6 +697,7 @@ class Editor : public PublicEditor
Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action; Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
void region_list_selection_changed (); void region_list_selection_changed ();
bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
Gtk::Menu *region_list_menu; Gtk::Menu *region_list_menu;
Gtk::ScrolledWindow region_list_scroller; Gtk::ScrolledWindow region_list_scroller;
@ -722,6 +723,26 @@ class Editor : public PublicEditor
int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator); int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
/* snapshots */
Gtk::ScrolledWindow snapshot_display_scroller;
struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
SnapshotDisplayModelColumns() {
add (visible_name);
add (real_name);
}
Gtk::TreeModelColumn<Glib::ustring> visible_name;
Gtk::TreeModelColumn<Glib::ustring> real_name;
};
SnapshotDisplayModelColumns snapshot_display_columns;
Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
Gtk::TreeView snapshot_display;
bool snapshot_display_button_press (GdkEventButton*);
void snapshot_display_selection_changed ();
void redisplay_snapshots();
/* named selections */ /* named selections */
struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
@ -1008,8 +1029,9 @@ class Editor : public PublicEditor
void route_display_selection_changed (); void route_display_selection_changed ();
void redisplay_route_list(); void redisplay_route_list();
gint route_list_reordered (); void route_list_reordered (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* what);
bool ignore_route_list_reorder; bool ignore_route_list_reorder;
bool no_route_list_redisplay;
void queue_route_list_reordered (); void queue_route_list_reordered ();
struct DragInfo { struct DragInfo {
@ -1786,6 +1808,8 @@ class Editor : public PublicEditor
void init_colormap (); void init_colormap ();
bool on_key_press_event (GdkEventKey*); bool on_key_press_event (GdkEventKey*);
void session_state_saved (string);
}; };
#endif /* __ardour_editor_h__ */ #endif /* __ardour_editor_h__ */

View file

@ -95,6 +95,7 @@ Editor::initialize_canvas ()
track_canvas.set_name ("EditorMainCanvas"); track_canvas.set_name ("EditorMainCanvas");
track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK); track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK);
track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas)); track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
track_canvas.set_flags (CAN_FOCUS);
/* set up drag-n-drop */ /* set up drag-n-drop */
@ -128,6 +129,7 @@ Editor::initialize_canvas ()
time_canvas.set_name ("EditorTimeCanvas"); time_canvas.set_name ("EditorTimeCanvas");
time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK); time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
time_canvas.set_flags (CAN_FOCUS);
meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0); meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height); tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height);

View file

@ -80,6 +80,10 @@ Editor::track_canvas_event (GdkEvent *event, ArdourCanvas::Item* item)
track_canvas.get_pointer (x, y); track_canvas.get_pointer (x, y);
return track_canvas_motion (event); return track_canvas_motion (event);
case GDK_BUTTON_PRESS:
track_canvas.grab_focus();
break;
case GDK_BUTTON_RELEASE: case GDK_BUTTON_RELEASE:
switch (event->button.button) { switch (event->button.button) {
case 4: case 4:
@ -90,6 +94,7 @@ Editor::track_canvas_event (GdkEvent *event, ArdourCanvas::Item* item)
break; break;
case GDK_SCROLL: case GDK_SCROLL:
track_canvas.grab_focus();
track_canvas_scroll (&event->scroll); track_canvas_scroll (&event->scroll);
break; break;

View file

@ -287,6 +287,8 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
{ {
jack_nframes_t where = event_frame (event, 0, 0); jack_nframes_t where = event_frame (event, 0, 0);
track_canvas.grab_focus();
if (session && session->actively_recording()) { if (session && session->actively_recording()) {
return TRUE; return TRUE;
} }

View file

@ -45,142 +45,6 @@ using namespace Gtk;
using namespace Glib; using namespace Glib;
using namespace Editing; using namespace Editing;
#define wave_cursor_width 43
#define wave_cursor_height 61
#define wave_cursor_x_hot 0
#define wave_cursor_y_hot 25
static const gchar wave_cursor_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
0x03,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x00, 0x04, 0x00,
0x02,
0x02, 0x04, 0x00, 0x04, 0x00, 0x02, 0x02, 0x0c, 0x08, 0x0c, 0x00,
0x02,
0x02, 0x1c, 0x08, 0x0c, 0x00, 0x02, 0x02, 0x1c, 0x08, 0x0c, 0x04,
0x02,
0x02, 0x3c, 0x18, 0x0c, 0x04, 0x02, 0x02, 0x7c, 0x18, 0x1c, 0x0c,
0x02,
0x82, 0xfc, 0x38, 0x1c, 0x0c, 0x02, 0xc2, 0xfc, 0x78, 0x3c, 0x1c,
0x02,
0xe2, 0xfd, 0xf9, 0x7d, 0x1c, 0x02, 0xf2, 0xff, 0xfb, 0xff, 0x1c,
0x02,
0xfa, 0xff, 0xfb, 0xff, 0x3f, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff,
0x03,
0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0xfa, 0xff, 0xff, 0xff, 0x3f,
0x02,
0xf2, 0xff, 0xfb, 0xfd, 0x3c, 0x02, 0xe2, 0xfd, 0x7b, 0x7c, 0x1c,
0x02,
0xc2, 0xfc, 0x39, 0x3c, 0x1c, 0x02, 0x82, 0xfc, 0x18, 0x1c, 0x1c,
0x02,
0x02, 0xfc, 0x18, 0x1c, 0x0c, 0x02, 0x02, 0x7c, 0x18, 0x0c, 0x0c,
0x02,
0x02, 0x3c, 0x08, 0x0c, 0x04, 0x02, 0x02, 0x1c, 0x08, 0x0c, 0x04,
0x02,
0x02, 0x1c, 0x08, 0x0c, 0x00, 0x02, 0x02, 0x0c, 0x00, 0x04, 0x00,
0x02,
0x02, 0x04, 0x00, 0x04, 0x00, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00,
0x02,
0x02, 0x04, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02,
0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff,
0x03,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
0x00,
0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
#define wave_cursor_mask_width 43
#define wave_cursor_mask_height 61
#define wave_cursor_mask_x_hot 0
#define wave_cursor_mask_y_hot 25
static const gchar wave_cursor_mask_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00,
0x00,
0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x0c, 0x00,
0x00,
0x00, 0x1c, 0x08, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x0c, 0x04,
0x00,
0x00, 0x3c, 0x18, 0x0c, 0x04, 0x00, 0x00, 0x7c, 0x18, 0x1c, 0x0c,
0x00,
0x80, 0xfc, 0x38, 0x1c, 0x0c, 0x00, 0xc0, 0xfc, 0x78, 0x3c, 0x1c,
0x00,
0xe0, 0xfd, 0xf9, 0x7d, 0x1c, 0x00, 0xf0, 0xff, 0xfb, 0xff, 0x1c,
0x00,
0xf8, 0xff, 0xfb, 0xff, 0x3f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07,
0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0xff, 0x3f,
0x00,
0xf0, 0xff, 0xfb, 0xfd, 0x3c, 0x00, 0xe0, 0xfd, 0x7b, 0x7c, 0x1c,
0x00,
0xc0, 0xfc, 0x39, 0x3c, 0x1c, 0x00, 0x80, 0xfc, 0x18, 0x1c, 0x1c,
0x00,
0x00, 0xfc, 0x18, 0x1c, 0x0c, 0x00, 0x00, 0x7c, 0x18, 0x0c, 0x0c,
0x00,
0x00, 0x3c, 0x08, 0x0c, 0x04, 0x00, 0x00, 0x1c, 0x08, 0x0c, 0x04,
0x00,
0x00, 0x1c, 0x08, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x04, 0x00,
0x00,
0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
GdkCursor *wave_cursor = 0;
void void
Editor::handle_audio_region_removed (AudioRegion* ignored) Editor::handle_audio_region_removed (AudioRegion* ignored)
{ {
@ -218,7 +82,7 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
if (region->hidden()) { if (region->hidden()) {
TreeModel::iterator iter = region_list_model->get_iter (_("/Hidden")); TreeModel::iterator iter = region_list_model->get_iter ("0");
TreeModel::Row parent; TreeModel::Row parent;
TreeModel::Row child; TreeModel::Row child;
@ -228,10 +92,21 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
parent[region_list_columns.name] = _("Hidden"); parent[region_list_columns.name] = _("Hidden");
parent[region_list_columns.region] = 0; parent[region_list_columns.region] = 0;
} else {
if ((*iter)[region_list_columns.name] != _("Hidden")) {
parent = *(region_list_model->insert(iter));
parent[region_list_columns.name] = _("Hidden");
parent[region_list_columns.region] = 0;
} else { } else {
parent = *iter; parent = *iter;
} }
}
row = *(region_list_model->append (parent.children())); row = *(region_list_model->append (parent.children()));
} else if (region->whole_file()) { } else if (region->whole_file()) {
@ -547,6 +422,16 @@ Editor::region_list_sorter (TreeModel::iterator a, TreeModel::iterator b)
Region* r1 = (*a)[region_list_columns.region]; Region* r1 = (*a)[region_list_columns.region];
Region* r2 = (*b)[region_list_columns.region]; Region* r2 = (*b)[region_list_columns.region];
/* handle rows without regions, like "Hidden" */
if (r1 == 0) {
return -1;
}
if (r2 == 0) {
return 1;
}
AudioRegion* region1 = dynamic_cast<AudioRegion*> (r1); AudioRegion* region1 = dynamic_cast<AudioRegion*> (r1);
AudioRegion* region2 = dynamic_cast<AudioRegion*> (r2); AudioRegion* region2 = dynamic_cast<AudioRegion*> (r2);
@ -697,3 +582,10 @@ Editor::region_list_display_drag_data_received (const RefPtr<Gdk::DragContext>&
} }
} }
bool
Editor::region_list_selection_filter (const RefPtr<TreeModel>& model, const TreeModel::Path& path, bool yn)
{
/* not possible to select rows that do not represent regions, like "Hidden" */
return (*(model->get_iter (path)))[region_list_columns.region] != 0;
}

View file

@ -63,7 +63,7 @@ Editor::handle_new_route (Route& route)
ignore_route_list_reorder = true; ignore_route_list_reorder = true;
if (tv->marked_for_display()) { if (!no_route_list_redisplay && tv->marked_for_display()) {
route_list_display.get_selection()->select (row); route_list_display.get_selection()->select (row);
} }
@ -90,7 +90,7 @@ Editor::handle_gui_changes (const string & what, void *src)
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::handle_gui_changes), what, src)); ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::handle_gui_changes), what, src));
if (what == "track_height") { if (what == "track_height") {
route_list_reordered (); redisplay_route_list ();
} }
} }
@ -147,7 +147,6 @@ Editor::route_name_changed (TimeAxisView *tv)
void void
Editor::route_display_selection_changed () Editor::route_display_selection_changed ()
{ {
TimeAxisView *tv; TimeAxisView *tv;
TreeModel::Children rows = route_display_model->children(); TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator i; TreeModel::Children::iterator i;
@ -155,6 +154,7 @@ Editor::route_display_selection_changed ()
for (i = rows.begin(); i != rows.end(); ++i) { for (i = rows.begin(); i != rows.end(); ++i) {
tv = (*i)[route_display_columns.tv]; tv = (*i)[route_display_columns.tv];
if (!selection->is_selected (i)) { if (!selection->is_selected (i)) {
tv->set_marked_for_display (false); tv->set_marked_for_display (false);
} else { } else {
@ -169,7 +169,7 @@ Editor::route_display_selection_changed ()
} }
} }
route_list_reordered (); redisplay_route_list ();
} }
void void
@ -201,26 +201,13 @@ Editor::select_strip_in_display (TimeAxisView* tv)
} }
void void
Editor::queue_route_list_reordered () Editor::route_list_reordered (const TreeModel::Path& path,const TreeModel::iterator& iter,int* what)
{ {
/* the problem here is that we are called *before* the redisplay_route_list ();
list has been reordered. so just queue up
the actual re-drawer to happen once the re-ordering
is complete.
*/
Glib::signal_idle().connect (mem_fun(*this, &Editor::route_list_reordered));
} }
void void
Editor::redisplay_route_list () Editor::redisplay_route_list ()
{
route_list_reordered ();
}
gint
Editor::route_list_reordered ()
{ {
TreeModel::Children rows = route_display_model->children(); TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator i; TreeModel::Children::iterator i;
@ -228,9 +215,14 @@ Editor::route_list_reordered ()
uint32_t order; uint32_t order;
int n; int n;
if (no_route_list_redisplay) {
return;
}
for (n = 0, order = 0, position = 0, i = rows.begin(); i != rows.end(); ++i, ++order) { for (n = 0, order = 0, position = 0, i = rows.begin(); i != rows.end(); ++i, ++order) {
TimeAxisView *tv = (*i)[route_display_columns.tv]; TimeAxisView *tv = (*i)[route_display_columns.tv];
AudioTimeAxisView* at; AudioTimeAxisView* at;
if (!ignore_route_list_reorder) { if (!ignore_route_list_reorder) {
/* this reorder is caused by user action, so reassign sort order keys /* this reorder is caused by user action, so reassign sort order keys
@ -254,7 +246,6 @@ Editor::route_list_reordered ()
controls_layout.queue_resize (); controls_layout.queue_resize ();
reset_scrolling_region (); reset_scrolling_region ();
return FALSE;
} }
void void
@ -283,16 +274,6 @@ Editor::hide_all_tracks (bool with_select)
reset_scrolling_region (); reset_scrolling_region ();
} }
void
Editor::route_list_column_click ()
{
if (route_list_menu == 0) {
build_route_list_menu ();
}
route_list_menu->popup (0, 0);
}
void void
Editor::build_route_list_menu () Editor::build_route_list_menu ()
{ {

View file

@ -101,15 +101,6 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
group_display_scroller.add (group_display); group_display_scroller.add (group_display);
group_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); group_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
snapshot_display_model = ListStore::create (snapshot_display_columns);
snapshot_display.set_model (snapshot_display_model);
snapshot_display.append_column (X_("mixgroups"), snapshot_display_columns.visible_name);
snapshot_display.set_name ("MixerSnapshotDisplayList");
snapshot_display.set_size_request (75, -1);
snapshot_display.set_reorderable (true);
snapshot_display_scroller.add (snapshot_display);
snapshot_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
group_display_vbox.pack_start (group_display_button, false, false); group_display_vbox.pack_start (group_display_button, false, false);
group_display_vbox.pack_start (group_display_scroller, true, true); group_display_vbox.pack_start (group_display_scroller, true, true);
@ -122,10 +113,7 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
group_display_frame.add (group_display_vbox); group_display_frame.add (group_display_vbox);
rhs_pane1.add1 (track_display_frame); rhs_pane1.add1 (track_display_frame);
rhs_pane1.add2 (rhs_pane2); rhs_pane1.add2 (group_display_frame);
rhs_pane2.add1 (group_display_frame);
rhs_pane2.add2 (snapshot_display_scroller);
list_vpacker.pack_start (rhs_pane1, true, true); list_vpacker.pack_start (rhs_pane1, true, true);
@ -137,18 +125,14 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
rhs_pane1.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler), rhs_pane1.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler),
static_cast<Gtk::Paned*> (&rhs_pane1))); static_cast<Gtk::Paned*> (&rhs_pane1)));
rhs_pane2.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler),
static_cast<Gtk::Paned*> (&rhs_pane2)));
list_hpane.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler), list_hpane.signal_size_allocate().connect (bind (mem_fun(*this, &Mixer_UI::pane_allocation_handler),
static_cast<Gtk::Paned*> (&list_hpane))); static_cast<Gtk::Paned*> (&list_hpane)));
rhs_pane1.set_data ("collapse-direction", (gpointer) 0); rhs_pane1.set_data ("collapse-direction", (gpointer) 0);
rhs_pane2.set_data ("collapse-direction", (gpointer) 0);
list_hpane.set_data ("collapse-direction", (gpointer) 1); list_hpane.set_data ("collapse-direction", (gpointer) 1);
rhs_pane1.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane1))); rhs_pane1.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane1)));
rhs_pane2.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&rhs_pane2)));
list_hpane.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&list_hpane))); list_hpane.signal_button_release_event().connect (bind (ptr_fun (pane_handler), static_cast<Paned*>(&list_hpane)));
global_vpacker.pack_start (list_hpane, true, true); global_vpacker.pack_start (list_hpane, true, true);
@ -169,9 +153,6 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
group_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::group_display_button_press)); group_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::group_display_button_press));
group_display.get_selection()->signal_changed().connect (mem_fun (*this, &Mixer_UI::group_display_selection_changed)); group_display.get_selection()->signal_changed().connect (mem_fun (*this, &Mixer_UI::group_display_selection_changed));
snapshot_display.get_selection()->signal_changed().connect (mem_fun(*this, &Mixer_UI::snapshot_display_selection_changed));
snapshot_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::snapshot_display_button_press));
_plugin_selector = new PluginSelector (PluginManager::the_manager()); _plugin_selector = new PluginSelector (PluginManager::the_manager());
signal_configure_event().connect (mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler)); signal_configure_event().connect (mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
@ -275,7 +256,7 @@ Mixer_UI::follow_strip_selection ()
} }
} }
gint bool
Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip) Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
{ {
if (ev->button == 1) { if (ev->button == 1) {
@ -296,7 +277,7 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
} }
} }
return TRUE; return true;
} }
void void
@ -320,9 +301,6 @@ Mixer_UI::connect_to_session (Session* sess)
session->foreach_mix_group(this, &Mixer_UI::add_mix_group); session->foreach_mix_group(this, &Mixer_UI::add_mix_group);
session->StateSaved.connect (mem_fun(*this, &Mixer_UI::session_state_saved));
redisplay_snapshots ();
_plugin_selector->set_session (session); _plugin_selector->set_session (session);
start_updating (); start_updating ();
@ -492,26 +470,6 @@ Mixer_UI::show_strip (MixerStrip* ms)
} }
} }
void
Mixer_UI::snapshot_display_selection_changed ()
{
TreeModel::iterator i = snapshot_display.get_selection()->get_selected();
Glib::ustring snap_name = (*i)[snapshot_display_columns.real_name];
if (session->snap_name() == snap_name) {
return;
}
ARDOUR_UI::instance()->load_session(session->path(), string (snap_name));
}
bool
Mixer_UI::snapshot_display_button_press (GdkEventButton* ev)
{
return false;
}
void void
Mixer_UI::track_display_selection_changed () Mixer_UI::track_display_selection_changed ()
{ {
@ -783,48 +741,17 @@ Mixer_UI::add_mix_group (RouteGroup* group)
group->FlagsChanged.connect (bind (mem_fun(*this, &Mixer_UI::group_flags_changed), group)); group->FlagsChanged.connect (bind (mem_fun(*this, &Mixer_UI::group_flags_changed), group));
} }
void bool
Mixer_UI::redisplay_snapshots ()
{
if (session == 0) {
return;
}
vector<string*>* states;
if ((states = session->possible_states()) == 0) {
return;
}
snapshot_display_model->clear ();
for (vector<string*>::iterator i = states->begin(); i != states->end(); ++i) {
string statename = *(*i);
const TreeModel::Row & row = *snapshot_display_model->append();
row[snapshot_display_columns.visible_name] = statename;
row[snapshot_display_columns.real_name] = statename;
}
delete states;
}
void
Mixer_UI::session_state_saved (string snap_name)
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &Mixer_UI::session_state_saved), snap_name));
redisplay_snapshots ();
}
gint
Mixer_UI::strip_scroller_button_release (GdkEventButton* ev) Mixer_UI::strip_scroller_button_release (GdkEventButton* ev)
{ {
using namespace Menu_Helpers; using namespace Menu_Helpers;
if (Keyboard::is_context_menu_event (ev)) { if (Keyboard::is_context_menu_event (ev)) {
ARDOUR_UI::instance()->add_route(); ARDOUR_UI::instance()->add_route();
return TRUE; return true;
} }
return FALSE; return false;
} }
void void
@ -909,8 +836,6 @@ Mixer_UI::get_state (void)
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&rhs_pane1)->gobj())); snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&rhs_pane1)->gobj()));
geometry->add_property(X_("mixer_rhs_pane1_pos"), string(buf)); geometry->add_property(X_("mixer_rhs_pane1_pos"), string(buf));
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&rhs_pane2)->gobj()));
geometry->add_property(X_("mixer_rhs_pane2_pos"), string(buf));
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&list_hpane)->gobj())); snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&list_hpane)->gobj()));
geometry->add_property(X_("mixer_list_hpane_pos"), string(buf)); geometry->add_property(X_("mixer_list_hpane_pos"), string(buf));
@ -959,23 +884,6 @@ Mixer_UI::pane_allocation_handler (Allocation& alloc, Gtk::Paned* which)
rhs_pane1.set_position (pos); rhs_pane1.set_position (pos);
} }
} else if (which == static_cast<Gtk::Paned*> (&rhs_pane2)) {
if (done[1]) {
return;
}
if (!geometry || (prop = geometry->property("mixer_rhs_pane2_pos")) == 0) {
pos = height / 3;
snprintf (buf, sizeof(buf), "%d", pos);
} else {
pos = atoi (prop->value());
}
if ((done[1] = GTK_WIDGET(rhs_pane2.gobj())->allocation.height > pos)) {
rhs_pane2.set_position (pos);
}
} else if (which == static_cast<Gtk::Paned*> (&list_hpane)) { } else if (which == static_cast<Gtk::Paned*> (&list_hpane)) {
if (done[2]) { if (done[2]) {

View file

@ -92,12 +92,10 @@ class Mixer_UI : public Gtk::Window
Gtk::Button group_display_button; Gtk::Button group_display_button;
Gtk::ScrolledWindow track_display_scroller; Gtk::ScrolledWindow track_display_scroller;
Gtk::ScrolledWindow group_display_scroller; Gtk::ScrolledWindow group_display_scroller;
Gtk::ScrolledWindow snapshot_display_scroller;
Gtk::VBox group_display_vbox; Gtk::VBox group_display_vbox;
Gtk::Frame track_display_frame; Gtk::Frame track_display_frame;
Gtk::Frame group_display_frame; Gtk::Frame group_display_frame;
Gtk::VPaned rhs_pane1; Gtk::VPaned rhs_pane1;
Gtk::VPaned rhs_pane2;
Gtk::HBox strip_packer; Gtk::HBox strip_packer;
Gtk::HBox out_packer; Gtk::HBox out_packer;
Gtk::HPaned list_hpane; Gtk::HPaned list_hpane;
@ -106,7 +104,7 @@ class Mixer_UI : public Gtk::Window
list<MixerStrip *> strips; list<MixerStrip *> strips;
gint strip_scroller_button_release (GdkEventButton*); bool strip_scroller_button_release (GdkEventButton*);
void add_strip (ARDOUR::Route*); void add_strip (ARDOUR::Route*);
void remove_strip (MixerStrip *); void remove_strip (MixerStrip *);
@ -190,39 +188,22 @@ class Mixer_UI : public Gtk::Window
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> group; Gtk::TreeModelColumn<ARDOUR::RouteGroup*> group;
}; };
struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
SnapshotDisplayModelColumns() {
add (visible_name);
add (real_name);
}
Gtk::TreeModelColumn<Glib::ustring> visible_name;
Gtk::TreeModelColumn<Glib::ustring> real_name;
};
TrackDisplayModelColumns track_display_columns; TrackDisplayModelColumns track_display_columns;
GroupDisplayModelColumns group_display_columns; GroupDisplayModelColumns group_display_columns;
SnapshotDisplayModelColumns snapshot_display_columns;
Gtk::TreeView track_display; Gtk::TreeView track_display;
Gtk::TreeView group_display; Gtk::TreeView group_display;
Gtk::TreeView snapshot_display;
Glib::RefPtr<Gtk::ListStore> track_display_model; Glib::RefPtr<Gtk::ListStore> track_display_model;
Glib::RefPtr<Gtk::ListStore> group_display_model; Glib::RefPtr<Gtk::ListStore> group_display_model;
Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
bool track_display_button_press (GdkEventButton*); bool track_display_button_press (GdkEventButton*);
bool group_display_button_press (GdkEventButton*); bool group_display_button_press (GdkEventButton*);
bool snapshot_display_button_press (GdkEventButton*);
void track_display_selection_changed (); void track_display_selection_changed ();
void group_display_selection_changed (); void group_display_selection_changed ();
void snapshot_display_selection_changed ();
void redisplay_snapshots(); bool strip_button_release_event (GdkEventButton*, MixerStrip*);
void session_state_saved (string);
gint strip_button_release_event (GdkEventButton*, MixerStrip*);
RouteRedirectSelection _selection; RouteRedirectSelection _selection;

View file

@ -13,7 +13,7 @@ namespace ARDOUR {
typedef uint32_t state_id_t; typedef uint32_t state_id_t;
class StateManager : virtual public sigc::trackable class StateManager : public sigc::trackable
{ {
public: public:
struct State { struct State {

View file

@ -398,8 +398,6 @@ void
AudioEngine::set_session (Session *s) AudioEngine::set_session (Session *s)
{ {
if (!session) { if (!session) {
s->set_block_size (jack_get_buffer_size (_jack));
s->set_frame_rate (jack_get_sample_rate (_jack));
session = s; session = s;
} }
} }

View file

@ -375,6 +375,7 @@ Session::~Session ()
delete _click_io; delete _click_io;
} }
if (auditioner) { if (auditioner) {
delete auditioner; delete auditioner;
} }
@ -562,6 +563,9 @@ Session::when_engine_running ()
first_time_running.disconnect (); first_time_running.disconnect ();
set_block_size (_engine.frames_per_cycle());
set_frame_rate (_engine.frame_rate());
/* every time we reconnect, recompute worst case output latencies */ /* every time we reconnect, recompute worst case output latencies */
_engine.Running.connect (sigc::bind (mem_fun (*this, &Session::set_worst_io_latencies), true)); _engine.Running.connect (sigc::bind (mem_fun (*this, &Session::set_worst_io_latencies), true));
@ -1309,46 +1313,32 @@ Session::set_frame_rate (jack_nframes_t frames_per_second)
void void
Session::set_block_size (jack_nframes_t nframes) Session::set_block_size (jack_nframes_t nframes)
{ {
/** \fn void Session::set_block_size(jack_nframes_t) /* the AudioEngine guarantees
the AudioEngine object that calls this guarantees
that it will not be called while we are also in that it will not be called while we are also in
::process(). Its also fine to do things that block ::process(). It is therefore fine to do things that block
here. here.
*/ */
{ {
LockMonitor lm (route_lock, __LINE__, __FILE__); LockMonitor lm (route_lock, __LINE__, __FILE__);
vector<Sample*>::iterator i;
uint32_t np;
current_block_size = nframes; current_block_size = nframes;
for (vector<Sample*>::iterator i = _passthru_buffers.begin(); i != _passthru_buffers.end(); ++i) { for (np = 0, i = _passthru_buffers.begin(); i != _passthru_buffers.end(); ++i, ++np) {
free (*i); free (*i);
Sample *buf;
#ifdef NO_POSIX_MEMALIGN
buf = (Sample *) malloc(current_block_size * sizeof(Sample));
#else
posix_memalign((void **)&buf,16,current_block_size * 4);
#endif
*i = buf;
memset (*i, 0, sizeof (Sample) * current_block_size);
} }
for (vector<Sample*>::iterator i = _silent_buffers.begin(); i != _silent_buffers.end(); ++i) { for (vector<Sample*>::iterator i = _silent_buffers.begin(); i != _silent_buffers.end(); ++i) {
free (*i); free (*i);
Sample *buf;
#ifdef NO_POSIX_MEMALIGN
buf = (Sample *) malloc(current_block_size * sizeof(Sample));
#else
posix_memalign((void **)&buf,16,current_block_size * 4);
#endif
*i = buf;
memset (*i, 0, sizeof (Sample) * current_block_size);
} }
_passthru_buffers.clear ();
_silent_buffers.clear ();
ensure_passthru_buffers (np);
if (_gain_automation_buffer) { if (_gain_automation_buffer) {
delete [] _gain_automation_buffer; delete [] _gain_automation_buffer;
} }