summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc226
1 files changed, 0 insertions, 226 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 3a7023ba94..51ad761d64 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -90,7 +90,6 @@
#include "canvas-noevent-text.h"
#include "canvas_impl.h"
#include "crossfade_edit.h"
-#include "crossfade_view.h"
#include "debug.h"
#include "editing.h"
#include "editor.h"
@@ -303,7 +302,6 @@ Editor::Editor ()
clicked_regionview = 0;
clicked_axisview = 0;
clicked_routeview = 0;
- clicked_crossfadeview = 0;
clicked_control_point = 0;
last_update_frame = 0;
pre_press_cursor = 0;
@@ -340,7 +338,6 @@ Editor::Editor ()
have_pending_keyboard_selection = false;
_follow_playhead = true;
_stationary_playhead = false;
- _xfade_visibility = true;
editor_ruler_menu = 0;
no_ruler_shown_update = false;
marker_menu = 0;
@@ -1514,10 +1511,6 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
}
break;
- case CrossfadeViewItem:
- build_menu_function = &Editor::build_track_crossfade_context_menu;
- break;
-
case StreamItem:
if (clicked_routeview->track()) {
build_menu_function = &Editor::build_track_context_menu;
@@ -1563,9 +1556,6 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
case SelectionItem:
break;
- case CrossfadeViewItem:
- break;
-
case StreamItem:
break;
@@ -1650,11 +1640,6 @@ Editor::build_track_region_context_menu ()
region_edit_menu_split_item = 0;
region_edit_menu_split_multichannel_item = 0;
- /* we might try to use items that are currently attached to a crossfade menu,
- so clear that, too.
- */
- track_crossfade_context_menu.items().clear ();
-
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (clicked_axisview);
if (rtv) {
@@ -1671,54 +1656,6 @@ Editor::build_track_region_context_menu ()
return &track_region_context_menu;
}
-Menu*
-Editor::build_track_crossfade_context_menu ()
-{
- using namespace Menu_Helpers;
- MenuList& edit_items = track_crossfade_context_menu.items();
- edit_items.clear ();
-
- /* we might try to use items that are currently attached to a crossfade menu,
- so clear that, too.
- */
- track_region_context_menu.items().clear ();
-
- AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (clicked_axisview);
-
- if (atv) {
- boost::shared_ptr<Track> tr;
- boost::shared_ptr<Playlist> pl;
- boost::shared_ptr<AudioPlaylist> apl;
-
- if ((tr = atv->track()) && ((pl = tr->playlist()) != 0) && ((apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl)) != 0)) {
-
- AudioPlaylist::Crossfades xfades;
- framepos_t where;
- bool ignored;
-
- /* The xfade menu is a bit of a special case, as we always use the mouse position
- to decide whether or not to display it (rather than the edit point). No particularly
- strong reasons for this, other than it is a bit surprising to right-click on a xfade
- and not get a menu.
- */
- mouse_frame (where, ignored);
- apl->crossfades_at (where, xfades);
-
- bool const many = xfades.size() > 1;
-
- for (AudioPlaylist::Crossfades::iterator i = xfades.begin(); i != xfades.end(); ++i) {
- add_crossfade_context_items (atv->audio_view(), (*i), edit_items, many);
- }
-
- add_region_context_items (edit_items, tr);
- }
- }
-
- add_dstream_context_items (edit_items);
-
- return &track_crossfade_context_menu;
-}
-
void
Editor::analyze_region_selection ()
{
@@ -1769,73 +1706,6 @@ Editor::build_track_selection_context_menu ()
return &track_selection_context_menu;
}
-/** Add context menu items relevant to crossfades.
- * @param edit_items List to add the items to.
- */
-void
-Editor::add_crossfade_context_items (AudioStreamView* view, boost::shared_ptr<Crossfade> xfade, Menu_Helpers::MenuList& edit_items, bool many)
-{
- using namespace Menu_Helpers;
- Menu *xfade_menu = manage (new Menu);
- MenuList& items = xfade_menu->items();
- xfade_menu->set_name ("ArdourContextMenu");
- string str;
-
- if (xfade->active()) {
- str = _("Mute");
- } else {
- str = _("Unmute");
- }
-
- items.push_back (
- MenuElem (str, sigc::bind (sigc::mem_fun (*this, &Editor::toggle_xfade_active), &view->trackview(), 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()) {
-
- if (xfade->following_overlap()) {
- str = _("Convert to Short");
- } else {
- str = _("Convert to Full");
- }
-
- items.push_back (
- MenuElem (str, sigc::bind (sigc::mem_fun (*this, &Editor::toggle_xfade_length), &view->trackview(), xfade))
- );
- }
-
- if (many) {
- str = xfade->out()->name();
- str += "->";
- str += xfade->in()->name();
- } else {
- str = _("Crossfade");
- }
-
- edit_items.push_back (MenuElem (str, *xfade_menu));
- edit_items.push_back (SeparatorElem());
-}
-
-void
-Editor::xfade_edit_left_region ()
-{
- if (clicked_crossfadeview) {
- clicked_crossfadeview->left_view.show_region_editor ();
- }
-}
-
-void
-Editor::xfade_edit_right_region ()
-{
- if (clicked_crossfadeview) {
- clicked_crossfadeview->right_view.show_region_editor ();
- }
-}
-
void
Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items, boost::shared_ptr<Track> track)
{
@@ -2391,12 +2261,6 @@ Editor::set_state (const XMLNode& node, int /*version*/)
_regions->reset_sort_type ((RegionListSortType) string_2_enum (prop->value(), st), true);
}
- if ((prop = node.property ("xfades-visible"))) {
- bool yn = string_is_affirmative (prop->value());
- _xfade_visibility = !yn;
- // set_xfade_visibility (yn);
- }
-
if ((prop = node.property ("show-editor-mixer"))) {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
@@ -2523,7 +2387,6 @@ Editor::get_state ()
node->add_property ("maximised", _maximised ? "yes" : "no");
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
- node->add_property ("xfades-visible", _xfade_visibility ? "yes" : "no");
node->add_property ("region-list-sort-type", enum_2_string (_regions->sort_type ()));
node->add_property ("mouse-mode", enum2str(mouse_mode));
node->add_property ("internal-edit", _internal_editing ? "yes" : "no");
@@ -3745,80 +3608,6 @@ Editor::set_stationary_playhead (bool yn)
}
}
-void
-Editor::toggle_xfade_active (RouteTimeAxisView* tv, boost::weak_ptr<Crossfade> wxfade)
-{
- boost::shared_ptr<Crossfade> xfade (wxfade.lock());
- if (!xfade) {
- return;
- }
-
- vector<boost::shared_ptr<Crossfade> > all = get_equivalent_crossfades (*tv, xfade, ARDOUR::Properties::edit.property_id);
-
- _session->begin_reversible_command (_("Change crossfade active state"));
-
- for (vector<boost::shared_ptr<Crossfade> >::iterator i = all.begin(); i != all.end(); ++i) {
- (*i)->clear_changes ();
- (*i)->set_active (!(*i)->active());
- _session->add_command (new StatefulDiffCommand (*i));
- }
-
- _session->commit_reversible_command ();
-}
-
-void
-Editor::toggle_xfade_length (RouteTimeAxisView* tv, boost::weak_ptr<Crossfade> wxfade)
-{
- boost::shared_ptr<Crossfade> xfade (wxfade.lock());
- if (!xfade) {
- return;
- }
-
- vector<boost::shared_ptr<Crossfade> > all = get_equivalent_crossfades (*tv, xfade, ARDOUR::Properties::edit.property_id);
-
- /* This can't be a StatefulDiffCommand as the fade shapes are not
- managed by the Stateful properties system.
- */
- _session->begin_reversible_command (_("Change crossfade length"));
-
- for (vector<boost::shared_ptr<Crossfade> >::iterator i = all.begin(); i != all.end(); ++i) {
- XMLNode& before = (*i)->get_state ();
- (*i)->set_follow_overlap (!(*i)->following_overlap());
- XMLNode& after = (*i)->get_state ();
-
- _session->add_command (new MementoCommand<Crossfade> (*i->get(), &before, &after));
- }
-
- _session->commit_reversible_command ();
-}
-
-void
-Editor::edit_xfade (boost::weak_ptr<Crossfade> wxfade)
-{
- boost::shared_ptr<Crossfade> xfade (wxfade.lock());
-
- if (!xfade) {
- return;
- }
-
- CrossfadeEditor cew (_session, xfade, xfade->fade_in().get_min_y(), 1.0);
-
- ensure_float (cew);
-
- switch (cew.run ()) {
- case RESPONSE_ACCEPT:
- break;
- default:
- return;
- }
-
- cew.apply ();
- PropertyChange all_crossfade_properties;
- all_crossfade_properties.add (ARDOUR::Properties::active);
- all_crossfade_properties.add (ARDOUR::Properties::follow_overlap);
- xfade->PropertyChanged (all_crossfade_properties);
-}
-
PlaylistSelector&
Editor::playlist_selector () const
{
@@ -4396,19 +4185,6 @@ Editor::idle_visual_changer ()
double const last_time_origin = horizontal_position ();
- if (p & VisualChange::TimeOrigin) {
- /* This is a bit of a hack, but set_frames_per_unit
- below will (if called) end up with the
- CrossfadeViews looking at Editor::leftmost_frame,
- and if we're changing origin and zoom in the same
- operation it will be the wrong value unless we
- update it here.
- */
-
- leftmost_frame = pending_visual_change.time_origin;
- assert (leftmost_frame >= 0);
- }
-
if (p & VisualChange::ZoomLevel) {
set_frames_per_unit (pending_visual_change.frames_per_unit);
@@ -5382,7 +5158,6 @@ Editor::session_going_away ()
clicked_regionview = 0;
clicked_axisview = 0;
clicked_routeview = 0;
- clicked_crossfadeview = 0;
entered_regionview = 0;
entered_track = 0;
last_update_frame = 0;
@@ -5506,7 +5281,6 @@ Editor::setup_fade_images ()
_fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-out-long-cut")));
}
-
/** @return Gtk::manage()d menu item for a given action from `editor_actions' */
Gtk::MenuItem&
Editor::action_menu_item (std::string const & name)