diff options
author | Carl Hetherington <carl@carlh.net> | 2012-04-16 16:32:22 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-04-16 16:32:22 +0000 |
commit | a2897ecef6da6a458aa1de8c2d9973a1e809dca2 (patch) | |
tree | 189e34b829823fc73d11fba249f283e00336d44d /gtk2_ardour | |
parent | 02c498a8fa1c2e47988a256321bdcf5e9e869de1 (diff) |
Fairly major change to the way in which crossfades are handled;
they are now done with region fades, rather than separate objects.
After this commit, Ardour will try to convert your session files
to the new crossfade format, but will make a backup in your
session folder first.
If you have works in progress using Ardour 3 it is
***STRONGLY RECOMMENDED*** that you back up session files before
updating to this commit.
git-svn-id: svn://localhost/ardour2/branches/3.0@11986 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/audio_streamview.cc | 297 | ||||
-rw-r--r-- | gtk2_ardour/audio_streamview.h | 27 | ||||
-rw-r--r-- | gtk2_ardour/audio_time_axis.cc | 65 | ||||
-rw-r--r-- | gtk2_ardour/audio_time_axis.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/crossfade_view.cc | 302 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 226 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 27 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas_events.cc | 122 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 50 | ||||
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/streamview.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/streamview.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_selection.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/wscript | 2 |
19 files changed, 15 insertions, 1148 deletions
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index c7afa6e3bf..b01fbdc630 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -46,7 +46,6 @@ #include "selection.h" #include "public_editor.h" #include "ardour_ui.h" -#include "crossfade_view.h" #include "rgb_macros.h" #include "gui_thread.h" #include "utils.h" @@ -61,32 +60,12 @@ using namespace Editing; AudioStreamView::AudioStreamView (AudioTimeAxisView& tv) : StreamView (tv) { - crossfades_visible = tv.session()->config.get_xfades_visible (); color_handler (); _amplitude_above_axis = 1.0; Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&AudioStreamView::parameter_changed, this, _1), gui_context()); } -AudioStreamView::~AudioStreamView () -{ - for (CrossfadeViewList::iterator xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) { - delete xi->second; - } -} - -int -AudioStreamView::set_samples_per_unit (gdouble spp) -{ - StreamView::set_samples_per_unit(spp); - - for (CrossfadeViewList::iterator xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) { - xi->second->set_samples_per_unit (spp); - } - - return 0; -} - int AudioStreamView::set_amplitude_above_axis (gdouble app) { @@ -210,162 +189,9 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai } void -AudioStreamView::remove_region_view (boost::weak_ptr<Region> weak_r) -{ - ENSURE_GUI_THREAD (*this, &AudioStreamView::remove_region_view, weak_r); - - boost::shared_ptr<Region> r (weak_r.lock()); - - if (!r) { - return; - } - - if (!_trackview.session()->deletion_in_progress()) { - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end();) { - CrossfadeViewList::iterator tmp; - - tmp = i; - ++tmp; - - boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(r); - if (ar && i->second->crossfade->involves (ar)) { - delete i->second; - crossfade_views.erase (i); - } - - i = tmp; - } - } - - StreamView::remove_region_view(r); -} - -void -AudioStreamView::undisplay_track () -{ - StreamView::undisplay_track (); - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - delete i->second; - } - - crossfade_views.clear (); -} - -void -AudioStreamView::playlist_layered (boost::weak_ptr<Track> wtr) -{ - boost::shared_ptr<Track> tr (wtr.lock()); - - if (!tr) { - return; - } - - StreamView::playlist_layered (wtr); - - /* make sure xfades are on top and all the regionviews are stacked correctly. */ - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - i->second->get_canvas_group()->raise_to_top(); - } -} - -void -AudioStreamView::playlist_switched (boost::weak_ptr<Track> wtr) -{ - boost::shared_ptr<Track> tr (wtr.lock()); - - if (!tr) { - return; - } - - playlist_connections.drop_connections (); - - StreamView::playlist_switched (tr); - - boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (tr->playlist()); - - if (apl) { - apl->NewCrossfade.connect (playlist_connections, invalidator (*this), ui_bind (&AudioStreamView::add_crossfade, this, _1), gui_context()); - } -} - -void -AudioStreamView::add_crossfade (boost::weak_ptr<Crossfade> wc) -{ - boost::shared_ptr<Crossfade> crossfade (wc.lock()); - - if (!crossfade) { - return; - } - - AudioRegionView* lview = 0; - AudioRegionView* rview = 0; - - /* first see if we already have a CrossfadeView for this Crossfade */ - - CrossfadeViewList::iterator i = crossfade_views.find (crossfade); - if (i != crossfade_views.end()) { - if (!crossfades_visible) { - i->second->hide(); - } else { - i->second->show (); - } - i->second->set_valid (true); - return; - } - - /* create a new one */ - - for (list<RegionView *>::iterator i = region_views.begin(); i != region_views.end(); ++i) { - AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i); - - if (!lview && arv && (arv->region() == crossfade->out())) { - lview = arv; - } - if (!rview && arv && (arv->region() == crossfade->in())) { - rview = arv; - } - } - - CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display (), - _trackview, - crossfade, - _samples_per_unit, - region_color, - *lview, *rview); - cv->set_valid (true); - crossfade->Invalidated.connect (*this, invalidator (*this), ui_bind (&AudioStreamView::remove_crossfade, this, _1), gui_context()); - crossfade_views[cv->crossfade] = cv; - if (!crossfades_visible) { - cv->hide (); - } - - update_content_height (cv); -} - -void -AudioStreamView::remove_crossfade (boost::shared_ptr<Region> r) -{ - ENSURE_GUI_THREAD (*this, &AudioStreamView::remove_crossfade, r) - - boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade> (r); - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - if (i->second->crossfade == xfade) { - delete i->second; - crossfade_views.erase (i); - break; - } - } -} - -void AudioStreamView::redisplay_track () { list<RegionView *>::iterator i; - CrossfadeViewList::iterator xi, tmpx; // Flag region views as invalid and disable drawing for (i = region_views.begin(); i != region_views.end(); ++i) { @@ -373,41 +199,11 @@ AudioStreamView::redisplay_track () (*i)->enable_display (false); } - // Flag crossfade views as invalid - for (xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) { - xi->second->set_valid (false); - if (xi->second->visible()) { - xi->second->show (); - } - } - - // Add and display region and crossfade views, and flag them as valid - + // Add and display views, and flag them as valid if (_trackview.is_audio_track()) { _trackview.track()->playlist()->foreach_region( sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view)) ); - - boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>( - _trackview.track()->playlist() - ); - - if (apl) { - apl->foreach_crossfade (sigc::mem_fun (*this, &AudioStreamView::add_crossfade)); - } - } - - // Remove invalid crossfade views - for (xi = crossfade_views.begin(); xi != crossfade_views.end();) { - tmpx = xi; - tmpx++; - - if (!xi->second->valid()) { - delete xi->second; - crossfade_views.erase (xi); - } - - xi = tmpx; } // Stack regions by layer, and remove invalid regions @@ -601,14 +397,6 @@ AudioStreamView::setup_rec_box () } void -AudioStreamView::foreach_crossfadeview (void (CrossfadeView::*pmf)(void)) -{ - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - (i->second->*pmf) (); - } -} - -void AudioStreamView::rec_peak_range_ready (framepos_t start, framecnt_t cnt, boost::weak_ptr<Source> weak_src) { ENSURE_GUI_THREAD (*this, &AudioStreamView::rec_peak_range_ready, start, cnt, weak_src) @@ -745,40 +533,6 @@ AudioStreamView::hide_all_fades () } void -AudioStreamView::show_all_xfades () -{ - foreach_crossfadeview (&CrossfadeView::show); - crossfades_visible = true; -} - -void -AudioStreamView::hide_all_xfades () -{ - foreach_crossfadeview (&CrossfadeView::hide); - crossfades_visible = false; -} - -void -AudioStreamView::hide_xfades_involving (AudioRegionView& rv) -{ - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - if (i->second->crossfade->involves (rv.audio_region())) { - i->second->fake_hide (); - } - } -} - -void -AudioStreamView::reveal_xfades_involving (AudioRegionView& rv) -{ - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - if (i->second->crossfade->involves (rv.audio_region()) && i->second->visible()) { - i->second->show (); - } - } -} - -void AudioStreamView::color_handler () { //case cAudioTrackBase: @@ -797,45 +551,6 @@ AudioStreamView::color_handler () } void -AudioStreamView::update_contents_height () -{ - StreamView::update_contents_height (); - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - update_content_height (i->second); - } -} - -void -AudioStreamView::update_content_height (CrossfadeView* cv) -{ - switch (_layer_display) { - case Overlaid: - cv->set_y (0); - cv->set_heights (height, height); - break; - - case Stacked: - case Expanded: - layer_t const inl = cv->crossfade->in()->layer (); - layer_t const outl = cv->crossfade->out()->layer (); - - layer_t const high = max (inl, outl); - layer_t const low = min (inl, outl); - - const double h = child_height (); - - if (_layer_display == Stacked) { - cv->set_y ((_layers - high - 1) * h); - cv->set_heights ((high - low + 1) * h, h); - } else { - cv->set_y (((_layers - high) * 2 - 1) * h); - cv->set_heights (((high - low) * 2 + 1) * h, h); - } - } -} - -void AudioStreamView::parameter_changed (string const & p) { if (p == "show-waveforms") { @@ -847,13 +562,3 @@ AudioStreamView::parameter_changed (string const & p) } } -void -AudioStreamView::horizontal_position_changed () -{ - /* we only `draw' the bit of the curve that is visible, so we need to update here */ - - for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) { - i->second->horizontal_position_changed (); - } -} - diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h index 0c50986f93..4812903a35 100644 --- a/gtk2_ardour/audio_streamview.h +++ b/gtk2_ardour/audio_streamview.h @@ -36,7 +36,6 @@ namespace Gdk { namespace ARDOUR { class Route; - class Crossfade; class PeakData; class AudioRegion; class Source; @@ -47,33 +46,21 @@ class Selectable; class AudioTimeAxisView; class AudioRegionView; class RegionSelection; -class CrossfadeView; class Selection; class AudioStreamView : public StreamView { public: AudioStreamView (AudioTimeAxisView&); - ~AudioStreamView (); - - int set_samples_per_unit (gdouble spp); - void horizontal_position_changed (); int set_amplitude_above_axis (gdouble app); gdouble get_amplitude_above_axis () { return _amplitude_above_axis; } void set_show_waveforms (bool yn); - void foreach_crossfadeview (void (CrossfadeView::*pmf)(void)); - void show_all_fades (); void hide_all_fades (); - void show_all_xfades (); - void hide_all_xfades (); - void hide_xfades_involving (AudioRegionView&); - void reveal_xfades_involving (AudioRegionView&); - RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool); private: @@ -82,32 +69,18 @@ class AudioStreamView : public StreamView void update_rec_regions (ARDOUR::framepos_t, ARDOUR::framecnt_t); RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool recording = false); - void remove_region_view (boost::weak_ptr<ARDOUR::Region> ); void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> ); - void undisplay_track (); void redisplay_track (); - void playlist_layered (boost::weak_ptr<ARDOUR::Track>); - void playlist_switched (boost::weak_ptr<ARDOUR::Track>); - - void add_crossfade (boost::weak_ptr<ARDOUR::Crossfade>); - void remove_crossfade (boost::shared_ptr<ARDOUR::Region>); void color_handler (); - void update_contents_height (); - void update_content_height (CrossfadeView *); - void parameter_changed (std::string const &); void set_waveform_shape (ARDOUR::WaveformShape); void set_waveform_scale (ARDOUR::WaveformScale); double _amplitude_above_axis; - typedef std::map<boost::shared_ptr<ARDOUR::Crossfade>, CrossfadeView*> CrossfadeViewList; - CrossfadeViewList crossfade_views; - bool crossfades_visible; - std::map<boost::shared_ptr<ARDOUR::Source>, bool> rec_data_ready_map; bool outline_region; diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index b2a1d6bf10..eca908eeb4 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -55,7 +55,6 @@ #include "audio_time_axis.h" #include "automation_line.h" #include "canvas_impl.h" -#include "crossfade_view.h" #include "enums.h" #include "gui_thread.h" #include "automation_time_axis.h" @@ -176,22 +175,6 @@ AudioTimeAxisView::hide () TimeAxisView::hide (); } - -void -AudioTimeAxisView::append_extra_display_menu_items () -{ - using namespace Menu_Helpers; - - MenuList& items = display_menu->items(); - - // crossfade stuff - if (!Profile->get_sae() && is_track ()) { - items.push_back (MenuElem (_("Hide All Crossfades"), sigc::bind (sigc::mem_fun(*this, &AudioTimeAxisView::hide_all_xfades), true))); - items.push_back (MenuElem (_("Show All Crossfades"), sigc::bind (sigc::mem_fun(*this, &AudioTimeAxisView::show_all_xfades), true))); - items.push_back (SeparatorElem ()); - } -} - void AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool show) { @@ -366,54 +349,6 @@ AudioTimeAxisView::hide_all_automation (bool apply_to_selection) } void -AudioTimeAxisView::show_all_xfades (bool apply_to_selection) -{ - if (apply_to_selection) { - _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::show_all_xfades, _1, false)); - } else { - AudioStreamView* asv = audio_view (); - if (asv) { - asv->show_all_xfades (); - } - } -} - -void -AudioTimeAxisView::hide_all_xfades (bool apply_to_selection) -{ - if (apply_to_selection) { - _editor.get_selection().tracks.foreach_audio_time_axis (boost::bind (&AudioTimeAxisView::hide_all_xfades, _1, false)); - } else { - AudioStreamView* asv = audio_view (); - if (asv) { - asv->hide_all_xfades (); - } - } -} - -void -AudioTimeAxisView::hide_dependent_views (TimeAxisViewItem& tavi) -{ - AudioStreamView* asv = audio_view(); - AudioRegionView* rv; - - if (asv && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) { - asv->hide_xfades_involving (*rv); - } -} - -void -AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi) -{ - AudioStreamView* asv = audio_view(); - AudioRegionView* rv; - - if (asv && (rv = dynamic_cast<AudioRegionView*>(&tavi)) != 0) { - asv->reveal_xfades_involving (*rv); - } -} - -void AudioTimeAxisView::route_active_changed () { update_control_names (); diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h index c096c6706a..8a5b6ab0ac 100644 --- a/gtk2_ardour/audio_time_axis.h +++ b/gtk2_ardour/audio_time_axis.h @@ -73,10 +73,6 @@ class AudioTimeAxisView : public RouteTimeAxisView AudioStreamView* audio_view(); void set_show_waveforms_recording (bool yn); - void show_all_xfades (bool apply_to_selection = false); - void hide_all_xfades (bool apply_to_selection = false); - void hide_dependent_views (TimeAxisViewItem&); - void reveal_dependent_views (TimeAxisViewItem&); /* Overridden from parent to store display state */ guint32 show_at (double y, int& nth, Gtk::VBox *parent); @@ -94,7 +90,6 @@ class AudioTimeAxisView : public RouteTimeAxisView void route_active_changed (); - void append_extra_display_menu_items (); Gtk::Menu* build_mode_menu(); void build_automation_action_menu (bool); diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc deleted file mode 100644 index 10792e0a93..0000000000 --- a/gtk2_ardour/crossfade_view.cc +++ /dev/null @@ -1,302 +0,0 @@ -/* - Copyright (C) 2003 Paul Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include <algorithm> - -#include "ardour/region.h" -#include <gtkmm2ext/doi.h> - -#include "canvas-simplerect.h" -#include "canvas-curve.h" -#include "crossfade_view.h" -#include "global_signals.h" -#include "gui_thread.h" -#include "rgb_macros.h" -#include "audio_time_axis.h" -#include "public_editor.h" -#include "audio_region_view.h" -#include "utils.h" -#include "canvas_impl.h" -#include "ardour_ui.h" - -using namespace ARDOUR; -using namespace PBD; -using namespace Editing; -using namespace Gnome; -using namespace Canvas; - -PBD::Signal1<void,CrossfadeView*> CrossfadeView::CatchDeletion; - -CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent, - RouteTimeAxisView &tv, - boost::shared_ptr<Crossfade> xf, - double spu, - Gdk::Color& basic_color, - AudioRegionView& lview, - AudioRegionView& rview) - - - : TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf->position(), - xf->length(), false, false, TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)), - crossfade (xf), - left_view (lview), - right_view (rview), - _all_in_view (false), - _child_height (0) -{ - _valid = true; - _visible = true; - - fade_in = new Line (*group); - fade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeLine.get(); - fade_in->property_width_pixels() = 1; - - fade_out = new Line (*group); - fade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeLine.get(); - fade_out->property_width_pixels() = 1; - - /* no frame around the xfade or overlap rects */ - - frame->property_outline_what() = 0; - - /* never show the vestigial frame */ - vestigial_frame->hide(); - show_vestigial = false; - - group->signal_event().connect (sigc::bind (sigc::mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this)); - - PropertyChange all_crossfade_properties; - all_crossfade_properties.add (ARDOUR::Properties::active); - all_crossfade_properties.add (ARDOUR::Properties::follow_overlap); - crossfade_changed (all_crossfade_properties); - - crossfade->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context()); - crossfade->FadesChanged.connect (*this, invalidator (*this), ui_bind (&CrossfadeView::crossfade_fades_changed, this), gui_context()); - ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler)); -} - -CrossfadeView::~CrossfadeView () -{ - CatchDeletion (this) ; /* EMIT_SIGNAL */ -} - -void -CrossfadeView::reset_width_dependent_items (double pixel_width) -{ - TimeAxisViewItem::reset_width_dependent_items (pixel_width); - - active_changed (); - - if (pixel_width < 5) { - fade_in->hide(); - fade_out->hide(); - } -} - -void -CrossfadeView::set_heights (double fade_height, double child_height) -{ - if (child_height > TimeAxisViewItem::NAME_HIGHLIGHT_THRESH) { - fade_height -= NAME_HIGHLIGHT_SIZE; - child_height -= NAME_HIGHLIGHT_SIZE; - } - - TimeAxisViewItem::set_height (fade_height); - _child_height = child_height; - - redraw_curves (); -} - -void -CrossfadeView::crossfade_changed (const PropertyChange& what_changed) -{ - bool need_redraw_curves = false; - - if (what_changed.contains (ARDOUR::bounds_change)) { - set_position (crossfade->position(), this); - set_duration (crossfade->length(), this); - - /* set_duration will call reset_width_dependent_items which in turn will call redraw_curves via active_changed, - so no need for us to call it */ - need_redraw_curves = false; - } - - if (what_changed.contains (ARDOUR::Properties::follow_overlap)) { - need_redraw_curves = true; - } - - if (what_changed.contains (ARDOUR::Properties::active)) { - /* calls redraw_curves */ - active_changed (); - } else if (need_redraw_curves) { - redraw_curves (); - } -} - -/** Set up our fade_in and fade_out curves to contain points for the currently visible portion - * of the crossfade. - */ -void -CrossfadeView::redraw_curves () -{ - if (!crossfade->following_overlap()) { - /* curves should not be visible */ - fade_in->hide (); - fade_out->hide (); - return; - } - - if (_height < 0) { - /* no space allocated yet */ - return; - } - - PublicEditor& editor = get_time_axis_view().editor (); - - framepos_t const editor_left = editor.leftmost_position (); - framepos_t const editor_right = editor_left + editor.current_page_frames (); - framepos_t const xfade_left = crossfade->position (); - framepos_t const xfade_right = xfade_left + crossfade->length (); - - /* Work out the range of our frames that are visible */ - framepos_t const min_frames = std::max (editor_left, xfade_left); - framepos_t const max_frames = std::min (editor_right, xfade_right); - - _all_in_view = (editor_left <= xfade_left && editor_right >= xfade_right); - - /* Hence the number of points that we will render */ - int32_t const npoints = editor.frame_to_pixel (max_frames - min_frames); - - if (!_visible || !crossfade->active() || npoints < 3) { - fade_in->hide(); - fade_out->hide(); - return; - } else { - fade_in->show(); - fade_out->show(); - } - - Points* points = get_canvas_points ("xfade edit redraw", npoints); - float* vec = new float[npoints]; - - crossfade->fade_in().curve().get_vector (min_frames - crossfade->position(), max_frames - crossfade->position(), vec, npoints); - - /* Work out the offset from the start of the crossfade to the visible part, in pixels */ - double xoff = 0; - if (crossfade->position() < editor.leftmost_position()) { - xoff = editor.frame_to_pixel (min_frames) - editor.frame_to_pixel (crossfade->position ()); - } - - for (int i = 0, pci = 0; i < npoints; ++i) { - Art::Point &p = (*points)[pci++]; - p.set_x (xoff + i + 1); - - double const ho = crossfade->in()->layer() > crossfade->out()->layer() ? _child_height : _height; - p.set_y (ho - ((_child_height - 2) * vec[i])); - } - - fade_in->property_points() = *points; - - crossfade->fade_out().curve().get_vector (min_frames - crossfade->position(), max_frames - crossfade->position(), vec, npoints); - - for (int i = 0, pci = 0; i < npoints; ++i) { - Art::Point &p = (*points)[pci++]; - p.set_x (xoff + i + 1); - - double const ho = crossfade->in()->layer() < crossfade->out()->layer() ? _child_height : _height; - p.set_y (ho - ((_child_height - 2) * vec[i])); - } - - fade_out->property_points() = *points; - - delete [] vec; - - delete points; - - /* XXX this is ugly, but it will have to wait till Crossfades are reimplented - as regions. This puts crossfade views on top of a track, above all regions. - */ - - group->raise_to_top(); -} - -void -CrossfadeView::active_changed () -{ - if (crossfade->active()) { - frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get(); - } else { - frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_InactiveCrossfade.get(); - } - - redraw_curves (); -} - -void -CrossfadeView::color_handler () -{ - active_changed (); -} - -void -CrossfadeView::set_valid (bool yn) -{ - _valid = yn; -} - -void -CrossfadeView::show () -{ - _visible = true; - group->show(); - redraw_curves (); -} - -void -CrossfadeView::hide () -{ - group->hide(); - _visible = false; -} - -void -CrossfadeView::fake_hide () -{ - group->hide(); -} - -void -CrossfadeView::crossfade_fades_changed () -{ - redraw_curves (); -} - -void -CrossfadeView::horizontal_position_changed () -{ - /* If the crossfade curves are entirely within the editor's visible space, there is - no need to redraw them here as they will be completely drawn (as distinct from - the other case where the horizontal position change will uncover `undrawn' - sections). - */ - - if (!_all_in_view) { - redraw_curves (); - } -} 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) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 89ee98d29c..177f862939 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -83,7 +83,6 @@ namespace ARDOUR { class NamedSelection; class Session; class Filter; - class Crossfade; class ChanCount; class MidiOperator; class Track; @@ -106,7 +105,6 @@ class AutomationTimeAxisView; class BundleManager; class ButtonJoiner; class ControlPoint; -class CrossfadeView; class DragManager; class GroupedButtons; class GUIObjectState; @@ -370,12 +368,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_measure_visibility (); void toggle_logo_visibility (); - /* fades/xfades */ + /* fades */ void toggle_region_fades (int dir); void update_region_fade_visibility (); - bool xfade_visibility() const { return _xfade_visibility; } - void update_xfade_visibility (); /* redirect shared ops menu. caller must free returned menu */ @@ -632,16 +628,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD RegionView* clicked_regionview; RegionSelection latest_regionviews; uint32_t clicked_selection; - CrossfadeView* clicked_crossfadeview; ControlPoint* clicked_control_point; void sort_track_selection (TrackViewList&); void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const; RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const; - std::vector<boost::shared_ptr<ARDOUR::Crossfade> > get_equivalent_crossfades ( - RouteTimeAxisView&, boost::shared_ptr<ARDOUR::Crossfade>, PBD::PropertyID - ) const; void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const; void mapover_tracks_with_unique_playlists (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const; @@ -650,9 +642,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &); void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &); void mapped_clear_playlist (RouteTimeAxisView&, uint32_t); - void mapped_get_equivalent_crossfades ( - RouteTimeAxisView&, uint32_t, boost::shared_ptr<ARDOUR::Crossfade>, std::vector<boost::shared_ptr<ARDOUR::Crossfade> >* - ) const; void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type); bool button_release_can_deselect; @@ -675,7 +664,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Menu track_context_menu; Gtk::Menu track_region_context_menu; Gtk::Menu track_selection_context_menu; - Gtk::Menu track_crossfade_context_menu; Gtk::MenuItem* region_edit_menu_split_item; Gtk::MenuItem* region_edit_menu_split_multichannel_item; @@ -689,12 +677,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Menu* build_track_context_menu (); Gtk::Menu* build_track_bus_context_menu (); Gtk::Menu* build_track_region_context_menu (); - Gtk::Menu* build_track_crossfade_context_menu (); Gtk::Menu* build_track_selection_context_menu (); void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&); void add_bus_context_items (Gtk::Menu_Helpers::MenuList&); void add_region_context_items (Gtk::Menu_Helpers::MenuList&, boost::shared_ptr<ARDOUR::Track>); - void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many); void add_selection_context_items (Gtk::Menu_Helpers::MenuList&); Gtk::MenuItem* _popup_region_menu_item; @@ -1386,7 +1372,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*); bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*); bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*); - bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*); bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); @@ -1864,10 +1849,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void nudge_track (bool use_edit_point, bool forwards); - /* xfades */ - - bool _xfade_visibility; - #ifdef WITH_CMT void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ; void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ; @@ -1909,12 +1890,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ImageFrameSocketHandler* image_socket_listener ; #endif - void toggle_xfade_active (RouteTimeAxisView *, boost::weak_ptr<ARDOUR::Crossfade>); - void toggle_xfade_length (RouteTimeAxisView *, boost::weak_ptr<ARDOUR::Crossfade>); - void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>); - void xfade_edit_left_region (); - void xfade_edit_right_region (); - static const int32_t default_width = 995; static const int32_t default_height = 765; diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 2a55c20630..071e76ffff 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -1428,8 +1428,6 @@ Editor::parameter_changed (std::string p) update_punch_range_view (true); } else if (p == "timecode-format") { update_just_timecode (); - } else if (p == "xfades-visible") { - update_xfade_visibility (); } else if (p == "show-region-fades") { update_region_fade_visibility (); } else if (p == "edit-mode") { diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 71f5a9fb21..72de353500 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -35,7 +35,6 @@ #include "audio_region_view.h" #include "audio_streamview.h" #include "canvas-noevent-text.h" -#include "crossfade_view.h" #include "audio_time_axis.h" #include "region_gain_line.h" #include "automation_line.h" @@ -518,127 +517,6 @@ struct DescendingRegionLayerSorter { }; bool -Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item, CrossfadeView* xfv) -{ - /* we handle only button 3 press/release events */ - - switch (event->type) { - case GDK_BUTTON_PRESS: - clicked_crossfadeview = xfv; - clicked_axisview = &clicked_crossfadeview->get_time_axis_view(); - clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview); - if (event->button.button == 3) { - return button_press_handler (item, event, CrossfadeViewItem); - } - break; - - case GDK_BUTTON_RELEASE: - if (event->button.button == 3) { - bool ret = button_release_handler (item, event, CrossfadeViewItem); - return ret; - } - break; - - default: - break; - - } - - /* XXX do not forward double clicks */ - - if (event->type == GDK_2BUTTON_PRESS) { - return false; - } - - /* proxy for an underlying regionview */ - - /* XXX really need to check if we are in the name highlight, - and proxy to that when required. - - XXX or in the trim rectangles - */ - - TimeAxisView& tv (xfv->get_time_axis_view()); - AudioTimeAxisView* atv; - - if ((atv = dynamic_cast<AudioTimeAxisView*>(&tv)) != 0) { - - if (atv->is_audio_track()) { - - boost::shared_ptr<AudioPlaylist> pl; - if ((pl = boost::dynamic_pointer_cast<AudioPlaylist> (atv->track()->playlist())) != 0) { - - boost::shared_ptr<RegionList> rl = pl->regions_at (event_frame (event)); - if (!rl->empty()) { - - if (atv->layer_display() == Overlaid) { - - /* we're in overlaid mode; proxy to the uppermost region view */ - - DescendingRegionLayerSorter cmp; - rl->sort (cmp); - - RegionView* rv = atv->view()->find_view (rl->front()); - - /* proxy */ - return canvas_region_view_event (event, rv->get_canvas_group(), rv); - - } else { - - /* we're in stacked mode; proxy to the region view under the mouse */ - - double cx = 0; - double cy = 0; - switch (event->type) { - case GDK_BUTTON_PRESS: - case GDK_BUTTON_RELEASE: - cx = event->button.x; - cy = event->button.y; - break; - case GDK_MOTION_NOTIFY: - cx = event->motion.x; - cy = event->motion.y; - break; - case GDK_ENTER_NOTIFY: - case GDK_LEAVE_NOTIFY: - cx = event->crossing.x; - cy = event->crossing.y; - break; - default: - /* XXX: this may be wrong for some events */ - cx = event->button.x; - cy = event->button.y; - } - - /* position of the event within the track */ - atv->view()->canvas_item()->w2i (cx, cy); - - /* hence layer that we're over */ - double const c = atv->view()->child_height (); - layer_t const l = pl->top_layer () + 1 - (cy / c); - - /* hence region */ - RegionList::iterator i = rl->begin(); - while (i != rl->end() && (*i)->layer() != l) { - ++i; - } - - if (i != rl->end()) { - RegionView* rv = atv->view()->find_view (*i); - - /* proxy */ - return canvas_region_view_event (event, rv->get_canvas_group(), rv); - } - } - } - } - } - } - - return TRUE; -} - -bool Editor::canvas_control_point_event (GdkEvent *event, ArdourCanvas::Item* item, ControlPoint* cp) { switch (event->type) { diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 21b47c388f..e377509351 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4117,7 +4117,7 @@ AutomationRangeDrag::setup (list<boost::shared_ptr<AutomationLine> > const & lin /* check this range against all the AudioRanges that we are using */ list<AudioRange>::const_iterator k = _ranges.begin (); while (k != _ranges.end()) { - if (k->coverage (r.first, r.second) != OverlapNone) { + if (k->coverage (r.first, r.second) != Evoral::OverlapNone) { break; } ++k; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 92d4ed63f5..fdca009185 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2510,7 +2510,7 @@ static void add_if_covered (RegionView* rv, const AudioRange* ar, RegionSelection* rs) { switch (rv->region()->coverage (ar->start, ar->end - 1)) { - case OverlapNone: + case Evoral::OverlapNone: break; default: rs->push_back (rv); @@ -3263,7 +3263,7 @@ Editor::trim_region_to_location (const Location& loc, const char* str) /* require region to span proposed trim */ switch (rv->region()->coverage (loc.start(), loc.end())) { - case OverlapInternal: + case Evoral::OverlapInternal: break; default: continue; @@ -5245,24 +5245,6 @@ Editor::update_region_fade_visibility () } } -/** Update crossfade visibility after its configuration has been changed */ -void -Editor::update_xfade_visibility () -{ - _xfade_visibility = _session->config.get_xfades_visible (); - - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - AudioTimeAxisView* v = dynamic_cast<AudioTimeAxisView*>(*i); - if (v) { - if (_xfade_visibility) { - v->show_all_xfades (); - } else { - v->hide_all_xfades (); - } - } - } -} - void Editor::set_edit_point () { diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 17597d9d15..f788ef1f9d 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -38,7 +38,6 @@ #include "audio_streamview.h" #include "automation_line.h" #include "control_point.h" -#include "crossfade_view.h" #include "editor_regions.h" #include "editor_cursors.h" #include "midi_region_view.h" @@ -479,32 +478,6 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi } void -Editor::mapped_get_equivalent_crossfades ( - RouteTimeAxisView& tv, uint32_t, boost::shared_ptr<Crossfade> basis, vector<boost::shared_ptr<Crossfade> >* equivs - ) const -{ - boost::shared_ptr<Playlist> pl; - vector<boost::shared_ptr<Crossfade> > results; - boost::shared_ptr<Track> tr; - - if ((tr = tv.track()) == 0) { - /* bus */ - return; - } - - if ((pl = tr->playlist()) != 0) { - boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl); - if (apl) { - apl->get_equivalent_crossfades (basis, *equivs); - } - } - - /* We might have just checked basis for equivalency with itself, so we need to remove dupes */ - sort (equivs->begin (), equivs->end ()); - unique (equivs->begin (), equivs->end ()); -} - -void Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions, PBD::PropertyID property) const { mapover_tracks_with_unique_playlists (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_time_axis_view(), property); @@ -537,19 +510,6 @@ Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) c return equivalent; } -vector<boost::shared_ptr<Crossfade> > -Editor::get_equivalent_crossfades (RouteTimeAxisView& v, boost::shared_ptr<Crossfade> c, PBD::PropertyID prop) const -{ - vector<boost::shared_ptr<Crossfade> > e; - mapover_tracks_with_unique_playlists ( - sigc::bind (sigc::mem_fun (*this, &Editor::mapped_get_equivalent_crossfades), c, &e), - &v, - prop - ); - - return e; -} - int Editor::get_regionview_count_from_region_list (boost::shared_ptr<Region> region) { @@ -700,7 +660,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op) /* 2. figure out the boundaries for our search for new objects */ switch (clicked_regionview->region()->coverage (first_frame, last_frame)) { - case OverlapNone: + case Evoral::OverlapNone: if (last_frame < clicked_regionview->region()->first_frame()) { first_frame = last_frame; last_frame = clicked_regionview->region()->last_frame(); @@ -710,7 +670,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op) } break; - case OverlapExternal: + case Evoral::OverlapExternal: if (last_frame < clicked_regionview->region()->first_frame()) { first_frame = last_frame; last_frame = clicked_regionview->region()->last_frame(); @@ -720,7 +680,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op) } break; - case OverlapInternal: + case Evoral::OverlapInternal: if (last_frame < clicked_regionview->region()->first_frame()) { first_frame = last_frame; last_frame = clicked_regionview->region()->last_frame(); @@ -730,8 +690,8 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op) } break; - case OverlapStart: - case OverlapEnd: + case Evoral::OverlapStart: + case Evoral::OverlapEnd: /* nothing to do except add clicked region to selection, since it overlaps with the existing selection in this track. */ diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 259f7c14d2..f449dcaef0 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -63,7 +63,6 @@ #include "automation_time_axis.h" #include "canvas-note-event.h" #include "canvas_impl.h" -#include "crossfade_view.h" #include "editor.h" #include "enums.h" #include "ghostregion.h" diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 5a0a6138e1..ee4c7162cb 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -73,7 +73,6 @@ class Selection; class AutomationLine; class ControlPoint; class SelectionRect; -class CrossfadeView; class RouteTimeAxisView; class RegionView; class AudioRegionView; @@ -315,7 +314,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual bool canvas_selection_rect_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0; virtual bool canvas_selection_start_trim_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0; virtual bool canvas_selection_end_trim_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0; - virtual bool canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item*, CrossfadeView*) = 0; virtual bool canvas_fade_in_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0; virtual bool canvas_fade_in_handle_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0; virtual bool canvas_fade_out_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 13f169b96e..751d44e077 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -68,7 +68,6 @@ #include "route_time_axis.h" #include "automation_time_axis.h" #include "canvas_impl.h" -#include "crossfade_view.h" #include "enums.h" #include "gui_thread.h" #include "keyboard.h" diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 040635d628..9ee7907a48 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -547,7 +547,7 @@ StreamView::get_selectables (framepos_t start, framepos_t end, double top, doubl layer_ok = (min_layer <= l && l <= max_layer); } - if ((*i)->region()->coverage (start, end) != OverlapNone && layer_ok) { + if ((*i)->region()->coverage (start, end) != Evoral::OverlapNone && layer_ok) { results.push_back (*i); } } diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 349b380d9f..f49bc87259 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -142,7 +142,7 @@ protected: void diskstream_changed (); void layer_regions (); - virtual void playlist_switched (boost::weak_ptr<ARDOUR::Track>); + void playlist_switched (boost::weak_ptr<ARDOUR::Track>); virtual void color_handler () = 0; diff --git a/gtk2_ardour/time_selection.cc b/gtk2_ardour/time_selection.cc index 064e654cff..4bc0e2a96a 100644 --- a/gtk2_ardour/time_selection.cc +++ b/gtk2_ardour/time_selection.cc @@ -55,9 +55,9 @@ TimeSelection::consolidate () continue; } - if ((*a).coverage ((*b).start, (*b).end) != OverlapNone) { - (*a).start = std::min ((*a).start, (*b).start); - (*a).end = std::max ((*a).end, (*b).end); + if (a->coverage (b->start, b->end) != Evoral::OverlapNone) { + a->start = std::min (a->start, b->start); + a->end = std::max (a->end, b->end); erase (b); changed = true; goto restart; diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 575a7a50d9..338a585dca 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -67,8 +67,6 @@ gtk2_ardour_sources = [ 'configinfo.cc', 'control_point.cc', 'control_point_dialog.cc', - 'crossfade_edit.cc', - 'crossfade_view.cc', 'curvetest.cc', 'debug.cc', 'diamond.cc', |