+
+bool
+Editor::control_layout_scroll (GdkEventScroll* ev)
+{
+ switch (ev->direction) {
+ case GDK_SCROLL_UP:
+ scroll_tracks_up_line ();
+ return true;
+ break;
+
+ case GDK_SCROLL_DOWN:
+ scroll_tracks_down_line ();
+ return true;
+
+ default:
+ /* no left/right handling yet */
+ break;
+ }
+
+ 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();
+
+ Glib::ustring snap_name = (*i)[snapshot_display_columns.real_name];
+
+ 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 ();
+}
+
+void
+Editor::maximise_editing_space ()
+{
+ mouse_mode_tearoff->set_visible (false);
+ tools_tearoff->set_visible (false);
+
+ pre_maximal_pane_position = edit_pane.get_position();
+ edit_pane.set_position (edit_pane.get_width());
+
+ fullscreen();
+}
+
+void
+Editor::restore_editing_space ()
+{
+ mouse_mode_tearoff->set_visible (true);
+ tools_tearoff->set_visible (true);
+ edit_pane.set_position (pre_maximal_pane_position);
+
+ unfullscreen();
+}
+
+void
+Editor::new_playlists ()
+{
+ begin_reversible_command (_("new playlists"));
+ mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_new_playlist));
+ commit_reversible_command ();
+}
+
+void
+Editor::copy_playlists ()
+{
+ begin_reversible_command (_("copy playlists"));
+ mapover_audio_tracks (mem_fun (*this, &Editor::mapped_use_copy_playlist));
+ commit_reversible_command ();
+}
+
+void
+Editor::clear_playlists ()
+{
+ begin_reversible_command (_("clear playlists"));
+ mapover_audio_tracks (mem_fun (*this, &Editor::mapped_clear_playlist));
+ commit_reversible_command ();
+}
+
+void
+Editor::mapped_use_new_playlist (AudioTimeAxisView& atv, uint32_t sz)
+{
+ atv.use_new_playlist (sz > 1 ? false : true);
+}
+
+void
+Editor::mapped_use_copy_playlist (AudioTimeAxisView& atv, uint32_t sz)
+{
+ atv.use_copy_playlist (sz > 1 ? false : true);
+}
+
+void
+Editor::mapped_clear_playlist (AudioTimeAxisView& atv, uint32_t sz)
+{
+ atv.clear_playlist ();
+}
+
+bool
+Editor::on_key_press_event (GdkEventKey* ev)
+{
+ return key_press_focus_accelerator_handler (*this, ev);
+}
+
+void
+Editor::update_layering_model ()
+{
+ RefPtr<Action> act;
+
+ switch (session->get_layer_model()) {
+ case Session::LaterHigher:
+ act = ActionManager::get_action (X_("Editor"), X_("LayerLaterHigher"));
+ break;
+ case Session::MoveAddHigher:
+ act = ActionManager::get_action (X_("Editor"), X_("LayerMoveAddHigher"));
+ break;
+ case Session::AddHigher:
+ act = ActionManager::get_action (X_("Editor"), X_("LayerAddHigher"));
+ break;
+ }
+
+ if (act) {
+ RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
+ if (ract && !ract->get_active()) {
+ ract->set_active (true);
+ }
+ }
+}
+
+
+void
+Editor::update_crossfade_model ()
+{
+ RefPtr<Action> act;
+
+ switch (session->get_xfade_model()) {
+ case FullCrossfade:
+ act = ActionManager::get_action (X_("Editor"), X_("CrossfadesFull"));
+ break;
+ case ShortCrossfade:
+ act = ActionManager::get_action (X_("Editor"), X_("CrossfadesShort"));
+ break;
+ }
+
+ if (act) {
+ RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
+ if (ract && !ract->get_active()) {
+ ract->set_active (true);
+ }
+ }
+}
+