Use shared_ptr for the TimeAxisView hierarchy.
git-svn-id: svn://localhost/ardour2/branches/3.0@5339 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0f8031da06
commit
4297071b3f
|
@ -261,7 +261,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
|||
if (!pl)
|
||||
continue;
|
||||
|
||||
RouteUI *rui = dynamic_cast<RouteUI *>(*i);
|
||||
boost::shared_ptr<RouteUI> rui = boost::dynamic_pointer_cast<RouteUI>(*i);
|
||||
int n_inputs = rui->route()->n_inputs().n_audio(); // FFT is audio only
|
||||
|
||||
// Busses don't have playlists, so we need to check that we actually are working with a playlist
|
||||
|
@ -306,7 +306,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
|||
} else if (source_selection_regions_rb.get_active()) {
|
||||
// cerr << "Analyzing selected regions on track " << *&rui->route().name() << endl;
|
||||
|
||||
TimeAxisView *current_axis = (*i);
|
||||
TimeAxisViewPtr current_axis = (*i);
|
||||
|
||||
for (RegionSelection::iterator j = ars.begin(); j != ars.end(); ++j) {
|
||||
// Check that the region is actually audio (so we can analyze it)
|
||||
|
@ -315,7 +315,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
|||
continue;
|
||||
|
||||
// Check that the region really is selected on _this_ track/solo
|
||||
if ( &arv->get_time_axis_view() != current_axis)
|
||||
if (arv->get_time_axis_view() != current_axis)
|
||||
continue;
|
||||
|
||||
// cerr << " - " << (*j)->region().name() << ": " << (*j)->region().length() << " samples starting at " << (*j)->region().position() << endl;
|
||||
|
|
|
@ -65,7 +65,7 @@ using namespace ArdourCanvas;
|
|||
|
||||
static const int32_t sync_mark_width = 9;
|
||||
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisViewPtr tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
Gdk::Color const & basic_color)
|
||||
: RegionView (parent, tv, r, spu, basic_color)
|
||||
, sync_mark(0)
|
||||
|
@ -82,7 +82,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
|
|||
}
|
||||
|
||||
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisViewPtr tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
||||
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
||||
, sync_mark(0)
|
||||
|
@ -165,7 +165,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
store_flags ();
|
||||
}
|
||||
|
||||
if (trackview.editor().new_regionviews_display_gain()) {
|
||||
if (trackview->editor().new_regionviews_display_gain()) {
|
||||
_flags |= EnvelopeVisible;
|
||||
}
|
||||
|
||||
|
@ -200,14 +200,14 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
|
||||
setup_fade_handle_positions ();
|
||||
|
||||
if (!trackview.session().config.get_show_region_fades()) {
|
||||
if (!trackview->session().config.get_show_region_fades()) {
|
||||
set_fade_visibility (false);
|
||||
}
|
||||
|
||||
const string line_name = _region->name() + ":gain";
|
||||
|
||||
if (!Profile->get_sae()) {
|
||||
gain_line = new AudioRegionGainLine (line_name, trackview.session(), *this, *group,
|
||||
gain_line = new AudioRegionGainLine (line_name, trackview->session(), *this, *group,
|
||||
audio_region()->envelope());
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
|
||||
gain_line->reset ();
|
||||
|
||||
set_height (trackview.current_height());
|
||||
set_height (trackview->current_height());
|
||||
|
||||
region_muted ();
|
||||
region_sync_changed ();
|
||||
|
@ -360,7 +360,7 @@ AudioRegionView::region_renamed ()
|
|||
{
|
||||
Glib::ustring str = RegionView::make_name ();
|
||||
|
||||
if (audio_region()->speed_mismatch (trackview.session().frame_rate())) {
|
||||
if (audio_region()->speed_mismatch (trackview->session().frame_rate())) {
|
||||
str = string ("*") + str;
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
|
|||
fade_in_handle->hide();
|
||||
fade_out_handle->hide();
|
||||
} else {
|
||||
if (trackview.session().config.get_show_region_fades()) {
|
||||
if (trackview->session().config.get_show_region_fades()) {
|
||||
fade_in_handle->show();
|
||||
fade_out_handle->show();
|
||||
}
|
||||
|
@ -575,7 +575,7 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
|
|||
return;
|
||||
}
|
||||
|
||||
if (trackview.session().config.get_show_region_fades()) {
|
||||
if (trackview->session().config.get_show_region_fades()) {
|
||||
fade_in_shape->show();
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
|
|||
return;
|
||||
}
|
||||
|
||||
if (trackview.session().config.get_show_region_fades()) {
|
||||
if (trackview->session().config.get_show_region_fades()) {
|
||||
fade_out_shape->show();
|
||||
}
|
||||
|
||||
|
@ -768,10 +768,10 @@ void
|
|||
AudioRegionView::show_region_editor ()
|
||||
{
|
||||
if (editor == 0) {
|
||||
editor = new AudioRegionEditor (trackview.session(), audio_region(), *this);
|
||||
editor = new AudioRegionEditor (trackview->session(), audio_region(), *this);
|
||||
// GTK2FIX : how to ensure float without realizing
|
||||
// editor->realize ();
|
||||
// trackview.editor.ensure_float (*editor);
|
||||
// trackview->editor.ensure_float (*editor);
|
||||
}
|
||||
|
||||
editor->present ();
|
||||
|
@ -836,13 +836,13 @@ void
|
|||
AudioRegionView::create_waves ()
|
||||
{
|
||||
// cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
|
||||
RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
|
||||
RouteTimeAxisViewPtr atv = boost::dynamic_pointer_cast<RouteTimeAxisView> (trackview); // ick
|
||||
|
||||
if (!atv.get_diskstream()) {
|
||||
if (!atv->get_diskstream()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ChanCount nchans = atv.get_diskstream()->n_channels();
|
||||
ChanCount nchans = atv->get_diskstream()->n_channels();
|
||||
|
||||
// cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data
|
||||
// << " and channels = " << nchans.n_audio() << endl;
|
||||
|
@ -884,16 +884,16 @@ void
|
|||
AudioRegionView::create_one_wave (uint32_t which, bool direct)
|
||||
{
|
||||
//cerr << "AudioRegionView::create_one_wave() called which: " << which << " this: " << this << endl;//DEBUG
|
||||
RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
|
||||
uint32_t nchans = atv.get_diskstream()->n_channels().n_audio();
|
||||
RouteTimeAxisViewPtr atv = boost::dynamic_pointer_cast<RouteTimeAxisView> (trackview); // ick
|
||||
uint32_t nchans = atv->get_diskstream()->n_channels().n_audio();
|
||||
uint32_t n;
|
||||
uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
|
||||
gdouble ht;
|
||||
|
||||
if (trackview.current_height() < NAME_HIGHLIGHT_THRESH) {
|
||||
ht = ((trackview.current_height()) / (double) nchans);
|
||||
if (trackview->current_height() < NAME_HIGHLIGHT_THRESH) {
|
||||
ht = ((trackview->current_height()) / (double) nchans);
|
||||
} else {
|
||||
ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
|
||||
ht = ((trackview->current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
|
||||
}
|
||||
|
||||
gdouble yoff = which * ht;
|
||||
|
@ -998,7 +998,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
|||
|
||||
item->w2i (x, y);
|
||||
|
||||
nframes_t fx = trackview.editor().pixel_to_frame (x);
|
||||
nframes_t fx = trackview->editor().pixel_to_frame (x);
|
||||
|
||||
if (fx > _region->length()) {
|
||||
return;
|
||||
|
@ -1012,21 +1012,21 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
|||
|
||||
gain_line->view_to_model_coord (x, y);
|
||||
|
||||
trackview.session().begin_reversible_command (_("add gain control point"));
|
||||
trackview->session().begin_reversible_command (_("add gain control point"));
|
||||
XMLNode &before = audio_region()->envelope()->get_state();
|
||||
|
||||
if (!audio_region()->envelope_active()) {
|
||||
XMLNode ®ion_before = audio_region()->get_state();
|
||||
audio_region()->set_envelope_active(true);
|
||||
XMLNode ®ion_after = audio_region()->get_state();
|
||||
trackview.session().add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after));
|
||||
trackview->session().add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after));
|
||||
}
|
||||
|
||||
audio_region()->envelope()->add (fx, y);
|
||||
|
||||
XMLNode &after = audio_region()->envelope()->get_state();
|
||||
trackview.session().add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
|
||||
trackview.session().commit_reversible_command ();
|
||||
trackview->session().add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
|
||||
trackview->session().commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1141,9 +1141,9 @@ AudioRegionView::set_waveform_scale (WaveformScale scale)
|
|||
|
||||
|
||||
GhostRegion*
|
||||
AudioRegionView::add_ghost (TimeAxisView& tv)
|
||||
AudioRegionView::add_ghost (TimeAxisViewPtr tv)
|
||||
{
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&trackview);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (trackview);
|
||||
assert(rtv);
|
||||
|
||||
double unit_position = _region->position () / samples_per_unit;
|
||||
|
|
|
@ -49,13 +49,13 @@ class AudioRegionView : public RegionView
|
|||
{
|
||||
public:
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color const & basic_color);
|
||||
|
||||
AudioRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double samples_per_unit,
|
||||
Gdk::Color const & basic_color,
|
||||
|
@ -101,7 +101,7 @@ class AudioRegionView : public RegionView
|
|||
void region_changed (ARDOUR::Change);
|
||||
void envelope_active_changed ();
|
||||
|
||||
GhostRegion* add_ghost (TimeAxisView&);
|
||||
GhostRegion* add_ghost (TimeAxisViewPtr);
|
||||
|
||||
void reset_fade_in_shape_width (nframes_t);
|
||||
void reset_fade_out_shape_width (nframes_t);
|
||||
|
|
|
@ -55,14 +55,14 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
|
||||
AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
|
||||
AudioStreamView::AudioStreamView (AudioTimeAxisViewPtr tv)
|
||||
: StreamView (tv)
|
||||
{
|
||||
crossfades_visible = true;
|
||||
color_handler ();
|
||||
_amplitude_above_axis = 1.0;
|
||||
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
use_rec_regions = tv->editor().show_waveforms_recording ();
|
||||
|
||||
Config->ParameterChanged.connect (sigc::mem_fun (*this, &AudioStreamView::parameter_changed));
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
|||
return 0;
|
||||
}
|
||||
|
||||
switch (_trackview.audio_track()->mode()) {
|
||||
switch (_trackview->audio_track()->mode()) {
|
||||
|
||||
case NonLayered:
|
||||
case Normal:
|
||||
|
@ -205,7 +205,7 @@ AudioStreamView::remove_region_view (boost::weak_ptr<Region> weak_r)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!_trackview.session().deletion_in_progress()) {
|
||||
if (!_trackview->session().deletion_in_progress()) {
|
||||
|
||||
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end();) {
|
||||
list<CrossfadeView*>::iterator tmp;
|
||||
|
@ -337,7 +337,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
|
|||
}
|
||||
}
|
||||
|
||||
CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display (),
|
||||
CrossfadeView *cv = new CrossfadeView (_trackview->canvas_display (),
|
||||
_trackview,
|
||||
crossfade,
|
||||
_samples_per_unit,
|
||||
|
@ -346,7 +346,7 @@ AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
|
|||
cv->set_valid (true);
|
||||
crossfade->Invalidated.connect (mem_fun (*this, &AudioStreamView::remove_crossfade));
|
||||
crossfade_views.push_back (cv);
|
||||
if (!_trackview.session().config.get_xfades_visible() || !crossfades_visible || _layer_display == Stacked) {
|
||||
if (!_trackview->session().config.get_xfades_visible() || !crossfades_visible || _layer_display == Stacked) {
|
||||
cv->hide ();
|
||||
}
|
||||
}
|
||||
|
@ -389,13 +389,13 @@ AudioStreamView::redisplay_diskstream ()
|
|||
|
||||
// Add and display region and crossfade views, and flag them as valid
|
||||
|
||||
if (_trackview.is_audio_track()) {
|
||||
_trackview.get_diskstream()->playlist()->foreach_region(
|
||||
if (_trackview->is_audio_track()) {
|
||||
_trackview->get_diskstream()->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.get_diskstream()->playlist()
|
||||
_trackview->get_diskstream()->playlist()
|
||||
);
|
||||
|
||||
if (apl) {
|
||||
|
@ -455,16 +455,16 @@ AudioStreamView::set_waveform_scale (WaveformScale scale)
|
|||
void
|
||||
AudioStreamView::setup_rec_box ()
|
||||
{
|
||||
//cerr << _trackview.name() << " streamview SRB region_views.size() = " << region_views.size() << endl;
|
||||
//cerr << _trackview->name() << " streamview SRB region_views.size() = " << region_views.size() << endl;
|
||||
|
||||
if (_trackview.session().transport_rolling()) {
|
||||
if (_trackview->session().transport_rolling()) {
|
||||
|
||||
// cerr << "\trolling\n";
|
||||
|
||||
if (!rec_active &&
|
||||
_trackview.session().record_status() == Session::Recording &&
|
||||
_trackview.get_diskstream()->record_enabled()) {
|
||||
if (_trackview.audio_track()->mode() == Normal && use_rec_regions && rec_regions.size() == rec_rects.size()) {
|
||||
_trackview->session().record_status() == Session::Recording &&
|
||||
_trackview->get_diskstream()->record_enabled()) {
|
||||
if (_trackview->audio_track()->mode() == Normal && use_rec_regions && rec_regions.size() == rec_rects.size()) {
|
||||
|
||||
/* add a new region, but don't bother if they set use_rec_regions mid-record */
|
||||
|
||||
|
@ -476,7 +476,7 @@ AudioStreamView::setup_rec_box ()
|
|||
rec_data_ready_connections.clear();
|
||||
|
||||
// FIXME
|
||||
boost::shared_ptr<AudioDiskstream> ads = boost::dynamic_pointer_cast<AudioDiskstream>(_trackview.get_diskstream());
|
||||
boost::shared_ptr<AudioDiskstream> ads = boost::dynamic_pointer_cast<AudioDiskstream>(_trackview->get_diskstream());
|
||||
assert(ads);
|
||||
|
||||
for (uint32_t n=0; n < ads->n_channels().n_audio(); ++n) {
|
||||
|
@ -493,14 +493,14 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
nframes_t start = 0;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->start() + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
||||
start = rec_regions.back().first->start() + _trackview->get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioRegion> region (boost::dynamic_pointer_cast<AudioRegion>
|
||||
(RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags), false)));
|
||||
assert(region);
|
||||
region->block_property_changes ();
|
||||
region->set_position (_trackview.session().transport_frame(), this);
|
||||
region->set_position (_trackview->session().transport_frame(), this);
|
||||
rec_regions.push_back (make_pair(region, (RegionView*)0));
|
||||
}
|
||||
|
||||
|
@ -508,14 +508,14 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
boost::shared_ptr<AudioTrack> at;
|
||||
|
||||
at = _trackview.audio_track(); /* we know what it is already */
|
||||
at = _trackview->audio_track(); /* we know what it is already */
|
||||
boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
|
||||
nframes_t frame_pos = ds->current_capture_start ();
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
|
||||
gdouble xstart = _trackview->editor().frame_to_pixel (frame_pos);
|
||||
gdouble xend;
|
||||
uint32_t fill_color;
|
||||
|
||||
switch (_trackview.audio_track()->mode()) {
|
||||
switch (_trackview->audio_track()->mode()) {
|
||||
case Normal:
|
||||
case NonLayered:
|
||||
xend = xstart;
|
||||
|
@ -544,7 +544,7 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
RecBoxInfo recbox;
|
||||
recbox.rectangle = rec_rect;
|
||||
recbox.start = _trackview.session().transport_frame();
|
||||
recbox.start = _trackview->session().transport_frame();
|
||||
recbox.length = 0;
|
||||
|
||||
rec_rects.push_back (recbox);
|
||||
|
@ -555,8 +555,8 @@ AudioStreamView::setup_rec_box ()
|
|||
rec_active = true;
|
||||
|
||||
} else if (rec_active &&
|
||||
(_trackview.session().record_status() != Session::Recording ||
|
||||
!_trackview.get_diskstream()->record_enabled())) {
|
||||
(_trackview->session().record_status() != Session::Recording ||
|
||||
!_trackview->get_diskstream()->record_enabled())) {
|
||||
screen_update_connection.disconnect();
|
||||
rec_active = false;
|
||||
rec_updating = false;
|
||||
|
@ -635,7 +635,7 @@ AudioStreamView::rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::we
|
|||
|
||||
rec_data_ready_map[src] = true;
|
||||
|
||||
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_audio()) {
|
||||
if (rec_data_ready_map.size() == _trackview->get_diskstream()->n_channels().n_audio()) {
|
||||
this->update_rec_regions ();
|
||||
rec_data_ready_map.clear();
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ AudioStreamView::update_rec_regions ()
|
|||
if (nlen != region->length()) {
|
||||
|
||||
region->freeze ();
|
||||
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_position (_trackview->get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_length (nlen, this);
|
||||
region->thaw ("updated");
|
||||
|
||||
|
@ -687,21 +687,21 @@ AudioStreamView::update_rec_regions ()
|
|||
|
||||
/* also update rect */
|
||||
ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
|
||||
gdouble xend = _trackview->editor().frame_to_pixel (region->position() + region->length());
|
||||
rect->property_x2() = xend;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
nframes_t nlen = _trackview.get_diskstream()->get_captured_frames(n);
|
||||
nframes_t nlen = _trackview->get_diskstream()->get_captured_frames(n);
|
||||
|
||||
if (nlen != region->length()) {
|
||||
|
||||
if (region->source_length(0) >= region->start() + nlen) {
|
||||
|
||||
region->freeze ();
|
||||
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_position (_trackview->get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_length (nlen, this);
|
||||
region->thaw ("updated");
|
||||
|
||||
|
@ -783,13 +783,13 @@ void
|
|||
AudioStreamView::color_handler ()
|
||||
{
|
||||
//case cAudioTrackBase:
|
||||
if (_trackview.is_track()) {
|
||||
if (_trackview->is_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioTrackBase.get();
|
||||
}
|
||||
|
||||
//case cAudioBusBase:
|
||||
if (!_trackview.is_track()) {
|
||||
if (Profile->get_sae() && _trackview.route()->is_master()) {
|
||||
if (!_trackview->is_track()) {
|
||||
if (Profile->get_sae() && _trackview->route()->is_master()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioMasterBusBase.get();
|
||||
} else {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioBusBase.get();
|
||||
|
|
|
@ -54,7 +54,7 @@ class Selection;
|
|||
class AudioStreamView : public StreamView
|
||||
{
|
||||
public:
|
||||
AudioStreamView (AudioTimeAxisView&);
|
||||
AudioStreamView (AudioTimeAxisViewPtr);
|
||||
~AudioStreamView ();
|
||||
|
||||
int set_samples_per_unit (gdouble spp);
|
||||
|
|
|
@ -79,13 +79,27 @@ using namespace Editing;
|
|||
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
: AxisView(sess)
|
||||
, RouteTimeAxisView(ed, sess, rt, canvas)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AudioTimeAxisViewPtr
|
||||
AudioTimeAxisView::create (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
{
|
||||
AudioTimeAxisViewPtr v (new AudioTimeAxisView (ed, sess, rt, canvas));
|
||||
v->init (ed, sess, rt, canvas);
|
||||
return v;
|
||||
}
|
||||
|
||||
void
|
||||
AudioTimeAxisView::init (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
{
|
||||
// Make sure things are sane...
|
||||
assert(!is_track() || is_audio_track());
|
||||
|
||||
subplugin_menu.set_name ("ArdourContextMenu");
|
||||
|
||||
_view = new AudioStreamView (*this);
|
||||
_view = new AudioStreamView (boost::dynamic_pointer_cast<AudioTimeAxisView> (shared_from_this ()));
|
||||
|
||||
ignore_toggle = false;
|
||||
|
||||
|
@ -246,13 +260,13 @@ AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
|||
}
|
||||
|
||||
boost::shared_ptr<AutomationTimeAxisView>
|
||||
gain_track(new AutomationTimeAxisView (_session,
|
||||
_route, _route->amp(), c,
|
||||
_editor,
|
||||
*this,
|
||||
false,
|
||||
parent_canvas,
|
||||
_route->amp()->describe_parameter(param)));
|
||||
gain_track = AutomationTimeAxisView::create (_session,
|
||||
_route, _route->amp(), c,
|
||||
_editor,
|
||||
shared_from_this (),
|
||||
false,
|
||||
parent_canvas,
|
||||
_route->amp()->describe_parameter(param));
|
||||
|
||||
add_automation_child(Evoral::Parameter(GainAutomation), gain_track, show);
|
||||
|
||||
|
@ -297,14 +311,14 @@ AudioTimeAxisView::ensure_pan_views (bool show)
|
|||
|
||||
std::string const name = _route->panner()->describe_parameter (pan_control->parameter ());
|
||||
|
||||
boost::shared_ptr<AutomationTimeAxisView> pan_track (
|
||||
new AutomationTimeAxisView (_session,
|
||||
_route, _route->panner(), pan_control,
|
||||
_editor,
|
||||
*this,
|
||||
false,
|
||||
parent_canvas,
|
||||
name));
|
||||
boost::shared_ptr<AutomationTimeAxisView> pan_track =
|
||||
AutomationTimeAxisView::create (_session,
|
||||
_route, _route->panner(), pan_control,
|
||||
_editor,
|
||||
shared_from_this (),
|
||||
false,
|
||||
parent_canvas,
|
||||
name);
|
||||
|
||||
add_automation_child (*p, pan_track, show);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "editing.h"
|
||||
#include "route_time_axis.h"
|
||||
#include "canvas.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
|
@ -66,7 +67,9 @@ class AutomationTimeAxisView;
|
|||
class AudioTimeAxisView : public RouteTimeAxisView
|
||||
{
|
||||
public:
|
||||
AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
static AudioTimeAxisViewPtr
|
||||
create (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
|
||||
virtual ~AudioTimeAxisView ();
|
||||
|
||||
AudioStreamView* audio_view();
|
||||
|
@ -90,6 +93,9 @@ class AudioTimeAxisView : public RouteTimeAxisView
|
|||
private:
|
||||
friend class AudioStreamView;
|
||||
friend class AudioRegionView;
|
||||
|
||||
AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
void init (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
|
||||
void route_active_changed ();
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ using namespace Gnome; // for Canvas
|
|||
|
||||
static const Evoral::IdentityConverter<double, sframes_t> default_converter;
|
||||
|
||||
AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Group& parent,
|
||||
AutomationLine::AutomationLine (const string& name, TimeAxisViewPtr tv, ArdourCanvas::Group& parent,
|
||||
boost::shared_ptr<AutomationList> al,
|
||||
const Evoral::TimeConverter<double, sframes_t>* converter)
|
||||
: trackview (tv)
|
||||
|
@ -88,7 +88,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
|
|||
|
||||
alist->StateChanged.connect (mem_fun(*this, &AutomationLine::list_changed));
|
||||
|
||||
trackview.session().register_with_memento_command_factory(alist->id(), this);
|
||||
trackview->session().register_with_memento_command_factory(alist->id(), this);
|
||||
|
||||
if (alist->parameter().type() == GainAutomation ||
|
||||
alist->parameter().type() == EnvelopeAutomation) {
|
||||
|
@ -214,10 +214,10 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
|
|||
y = min (1.0, y);
|
||||
y = _height - (y * _height);
|
||||
|
||||
double const x = trackview.editor().frame_to_unit (_time_converter.to((*cp.model())->when));
|
||||
double const x = trackview->editor().frame_to_unit (_time_converter.to((*cp.model())->when));
|
||||
|
||||
trackview.editor().current_session()->begin_reversible_command (_("automation event move"));
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
trackview->editor().current_session()->begin_reversible_command (_("automation event move"));
|
||||
trackview->editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
|
||||
cp.move_to (x, y, ControlPoint::Full);
|
||||
reset_line_coords (cp);
|
||||
|
@ -232,9 +232,9 @@ AutomationLine::modify_point_y (ControlPoint& cp, double y)
|
|||
|
||||
update_pending = false;
|
||||
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
trackview->editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview->editor().current_session()->commit_reversible_command ();
|
||||
trackview->editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -263,7 +263,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
|||
already in frames. it needs to be converted to canvas units.
|
||||
*/
|
||||
|
||||
x = trackview.editor().frame_to_unit (x);
|
||||
x = trackview->editor().frame_to_unit (x);
|
||||
|
||||
/* clamp x position using view coordinates */
|
||||
|
||||
|
@ -316,7 +316,7 @@ AutomationLine::modify_view_point (ControlPoint& cp, double x, double y, bool wi
|
|||
|
||||
/* leave the x-coordinate alone */
|
||||
|
||||
x = trackview.editor().frame_to_unit (_time_converter.to((*cp.model())->when));
|
||||
x = trackview->editor().frame_to_unit (_time_converter.to((*cp.model())->when));
|
||||
|
||||
}
|
||||
|
||||
|
@ -387,10 +387,10 @@ AutomationLine::model_representation (ControlPoint& cp, ModelRepresentation& mr)
|
|||
|
||||
/* if xval has not changed, set it directly from the model to avoid rounding errors */
|
||||
|
||||
if (mr.xval == trackview.editor().frame_to_unit(_time_converter.to((*cp.model())->when))) {
|
||||
if (mr.xval == trackview->editor().frame_to_unit(_time_converter.to((*cp.model())->when))) {
|
||||
mr.xval = (*cp.model())->when;
|
||||
} else {
|
||||
mr.xval = trackview.editor().unit_to_frame (mr.xval);
|
||||
mr.xval = trackview->editor().unit_to_frame (mr.xval);
|
||||
}
|
||||
|
||||
/* convert to model units
|
||||
|
@ -640,7 +640,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
|||
|
||||
}
|
||||
|
||||
set_selected_points (trackview.editor().get_selection().points);
|
||||
set_selected_points (trackview->editor().get_selection().points);
|
||||
|
||||
}
|
||||
|
||||
|
@ -724,7 +724,7 @@ AutomationLine::invalidate_point (ALPoints& p, uint32_t index)
|
|||
void
|
||||
AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
||||
{
|
||||
if (trackview.editor().current_session() == 0) { /* how? */
|
||||
if (trackview->editor().current_session() == 0) { /* how? */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -736,8 +736,8 @@ AutomationLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
|||
str = _("automation range drag");
|
||||
}
|
||||
|
||||
trackview.editor().current_session()->begin_reversible_command (str);
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
trackview->editor().current_session()->begin_reversible_command (str);
|
||||
trackview->editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &get_state(), 0));
|
||||
|
||||
drag_x = x;
|
||||
drag_distance = 0;
|
||||
|
@ -794,14 +794,14 @@ AutomationLine::line_drag (uint32_t i1, uint32_t i2, float fraction, bool with_p
|
|||
if (range_found) {
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
if ((*i)->selected()) {
|
||||
modify_view_point (*(*i), trackview.editor().unit_to_frame ((*i)->get_x()), ((_height - (*i)->get_y()) /_height) + ydelta, with_push);
|
||||
modify_view_point (*(*i), trackview->editor().unit_to_frame ((*i)->get_x()), ((_height - (*i)->get_y()) /_height) + ydelta, with_push);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ControlPoint *cp;
|
||||
for (uint32_t i = i1 ; i <= i2; i++) {
|
||||
cp = nth (i);
|
||||
modify_view_point (*cp, trackview.editor().unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
|
||||
modify_view_point (*cp, trackview->editor().unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -831,9 +831,9 @@ AutomationLine::end_drag (ControlPoint* cp)
|
|||
|
||||
update_pending = false;
|
||||
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
trackview->editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), 0, &alist->get_state()));
|
||||
trackview->editor().current_session()->commit_reversible_command ();
|
||||
trackview->editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -913,7 +913,7 @@ AutomationLine::control_points_adjacent (double xval, uint32_t & before, uint32_
|
|||
ControlPoint *acp = 0;
|
||||
double unit_xval;
|
||||
|
||||
unit_xval = trackview.editor().frame_to_unit (xval);
|
||||
unit_xval = trackview->editor().frame_to_unit (xval);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
@ -974,15 +974,15 @@ AutomationLine::remove_point (ControlPoint& cp)
|
|||
|
||||
model_representation (cp, mr);
|
||||
|
||||
trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
trackview->editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
XMLNode &before = alist->get_state();
|
||||
|
||||
alist->erase (mr.start, mr.end);
|
||||
|
||||
trackview.editor().current_session()->add_command(new MementoCommand<AutomationList>(
|
||||
trackview->editor().current_session()->add_command(new MementoCommand<AutomationList>(
|
||||
*alist.get(), &before, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
trackview->editor().current_session()->commit_reversible_command ();
|
||||
trackview->editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1058,7 +1058,7 @@ AutomationLine::set_selected_points (PointSelection& points)
|
|||
|
||||
for (PointSelection::iterator r = points.begin(); r != points.end(); ++r) {
|
||||
|
||||
if (&(*r).track != &trackview) {
|
||||
if (r->track != trackview) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1071,8 +1071,8 @@ AutomationLine::set_selected_points (PointSelection& points)
|
|||
|
||||
double rstart, rend;
|
||||
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
rstart = trackview->editor().frame_to_unit ((*r).start);
|
||||
rend = trackview->editor().frame_to_unit ((*r).end);
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ void AutomationLine::set_colors() {
|
|||
void
|
||||
AutomationLine::show_selection ()
|
||||
{
|
||||
TimeSelection& time (trackview.editor().get_selection().time);
|
||||
TimeSelection& time (trackview->editor().get_selection().time);
|
||||
|
||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||
|
||||
|
@ -1111,8 +1111,8 @@ AutomationLine::show_selection ()
|
|||
for (list<AudioRange>::iterator r = time.begin(); r != time.end(); ++r) {
|
||||
double rstart, rend;
|
||||
|
||||
rstart = trackview.editor().frame_to_unit ((*r).start);
|
||||
rend = trackview.editor().frame_to_unit ((*r).end);
|
||||
rstart = trackview->editor().frame_to_unit ((*r).start);
|
||||
rend = trackview->editor().frame_to_unit ((*r).end);
|
||||
|
||||
if ((*i)->get_x() >= rstart && (*i)->get_x() <= rend) {
|
||||
(*i)->set_selected(true);
|
||||
|
@ -1169,7 +1169,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
|||
void
|
||||
AutomationLine::add_model_point (ALPoints& tmp_points, double frame, double yfract)
|
||||
{
|
||||
tmp_points.push_back (ALPoint (trackview.editor().frame_to_unit (_time_converter.to(frame)),
|
||||
tmp_points.push_back (ALPoint (trackview->editor().frame_to_unit (_time_converter.to(frame)),
|
||||
_height - (yfract * _height)));
|
||||
}
|
||||
|
||||
|
@ -1191,10 +1191,10 @@ AutomationLine::clear ()
|
|||
/* parent must create command */
|
||||
XMLNode &before = get_state();
|
||||
alist->clear();
|
||||
trackview.editor().current_session()->add_command (
|
||||
trackview->editor().current_session()->add_command (
|
||||
new MementoCommand<AutomationLine>(*this, &before, &get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
trackview->editor().current_session()->commit_reversible_command ();
|
||||
trackview->editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <sigc++/signal.h>
|
||||
#include "canvas.h"
|
||||
#include "simplerect.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
#include "evoral/TimeConverter.hpp"
|
||||
|
||||
|
@ -55,7 +56,7 @@ namespace Gnome {
|
|||
class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoingAway
|
||||
{
|
||||
public:
|
||||
AutomationLine (const std::string& name, TimeAxisView&, ArdourCanvas::Group&,
|
||||
AutomationLine (const std::string& name, TimeAxisViewPtr, ArdourCanvas::Group&,
|
||||
boost::shared_ptr<ARDOUR::AutomationList>,
|
||||
const Evoral::TimeConverter<double, ARDOUR::sframes_t>* converter = 0);
|
||||
virtual ~AutomationLine ();
|
||||
|
@ -97,7 +98,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
|||
void set_uses_gain_mapping (bool yn);
|
||||
bool get_uses_gain_mapping () const { return _uses_gain_mapping; }
|
||||
|
||||
TimeAxisView& trackview;
|
||||
TimeAxisViewPtr trackview;
|
||||
|
||||
ArdourCanvas::Group& canvas_group() const { return *group; }
|
||||
ArdourCanvas::Item& parent_group() const { return _parent_group; }
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "i18n.h"
|
||||
|
||||
AutomationRegionView::AutomationRegionView(ArdourCanvas::Group* parent,
|
||||
AutomationTimeAxisView& time_axis,
|
||||
AutomationTimeAxisViewPtr time_axis,
|
||||
boost::shared_ptr<ARDOUR::Region> region,
|
||||
const Evoral::Parameter& param,
|
||||
boost::shared_ptr<ARDOUR::AutomationList> list,
|
||||
|
@ -56,7 +56,7 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
|
||||
reset_width_dependent_items ((double) _region->length() / samples_per_unit);
|
||||
|
||||
set_height (trackview.current_height());
|
||||
set_height (trackview->current_height());
|
||||
|
||||
_region->StateChanged.connect (mem_fun(*this, &AutomationRegionView::region_changed));
|
||||
|
||||
|
@ -75,7 +75,7 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
|
|||
_line->set_interpolation(list->interpolation());
|
||||
_line->show();
|
||||
_line->show_all_control_points();
|
||||
_line->set_height ((uint32_t)rint(trackview.current_height() - NAME_HIGHLIGHT_SIZE));
|
||||
_line->set_height ((uint32_t)rint(trackview->current_height() - NAME_HIGHLIGHT_SIZE));
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -83,7 +83,7 @@ AutomationRegionView::canvas_event(GdkEvent* ev)
|
|||
{
|
||||
if (ev->type == GDK_BUTTON_RELEASE) {
|
||||
|
||||
const nframes_t when = trackview.editor().pixel_to_frame((nframes_t)ev->button.x)
|
||||
const nframes_t when = trackview->editor().pixel_to_frame((nframes_t)ev->button.x)
|
||||
- _region->position();
|
||||
add_automation_event(ev, when, ev->button.y);
|
||||
}
|
||||
|
@ -104,13 +104,13 @@ AutomationRegionView::add_automation_event (GdkEvent* event, nframes_t when, dou
|
|||
assert(_line);
|
||||
|
||||
double x = 0;
|
||||
AutomationTimeAxisView* const view = automation_view();
|
||||
AutomationTimeAxisViewPtr view = automation_view();
|
||||
|
||||
view->canvas_display()->w2i (x, y);
|
||||
|
||||
/* compute vertical fractional position */
|
||||
|
||||
const double h = trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2;
|
||||
const double h = trackview->current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2;
|
||||
y = 1.0 - (y / h);
|
||||
|
||||
/* map using line */
|
||||
|
|
|
@ -40,7 +40,7 @@ class AutomationRegionView : public RegionView
|
|||
{
|
||||
public:
|
||||
AutomationRegionView(ArdourCanvas::Group*,
|
||||
AutomationTimeAxisView&,
|
||||
AutomationTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::Region>,
|
||||
const Evoral::Parameter& parameter,
|
||||
boost::shared_ptr<ARDOUR::AutomationList>,
|
||||
|
@ -51,14 +51,15 @@ public:
|
|||
|
||||
void init (Gdk::Color const & basic_color, bool wfd);
|
||||
|
||||
inline AutomationTimeAxisView* automation_view() const
|
||||
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
||||
inline AutomationTimeAxisViewPtr automation_view() const {
|
||||
return boost::dynamic_pointer_cast<AutomationTimeAxisView> (trackview);
|
||||
}
|
||||
|
||||
void set_line(boost::shared_ptr<AutomationLine> line) { _line = line; }
|
||||
boost::shared_ptr<AutomationLine> line() { return _line; }
|
||||
|
||||
// We are a ghost. Meta ghosts? Crazy talk.
|
||||
virtual GhostRegion* add_ghost(TimeAxisView&) { return NULL; }
|
||||
virtual GhostRegion* add_ghost(TimeAxisViewPtr) { return 0; }
|
||||
|
||||
void set_height (double);
|
||||
void reset_width_dependent_items(double pixel_width);
|
||||
|
|
|
@ -31,9 +31,9 @@ struct AutomationSelectable : public Selectable
|
|||
nframes_t end;
|
||||
double low_fract;
|
||||
double high_fract;
|
||||
TimeAxisView& track;
|
||||
TimeAxisViewPtr track;
|
||||
|
||||
AutomationSelectable (nframes_t s, nframes_t e, double l, double h, TimeAxisView& atv)
|
||||
AutomationSelectable (nframes_t s, nframes_t e, double l, double h, TimeAxisViewPtr atv)
|
||||
: start (s), end (e), low_fract (l), high_fract (h), track (atv) {}
|
||||
|
||||
bool operator== (const AutomationSelectable& other) {
|
||||
|
@ -41,7 +41,7 @@ struct AutomationSelectable : public Selectable
|
|||
end == other.end &&
|
||||
low_fract == other.low_fract &&
|
||||
high_fract == other.high_fract &&
|
||||
&track == &other.track;
|
||||
track == other.track;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -52,16 +52,16 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
|
||||
AutomationStreamView::AutomationStreamView (AutomationTimeAxisView& tv)
|
||||
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
|
||||
new ArdourCanvas::Group(*tv.canvas_display()))
|
||||
, _controller(tv.controller())
|
||||
AutomationStreamView::AutomationStreamView (AutomationTimeAxisViewPtr tv)
|
||||
: StreamView (boost::dynamic_pointer_cast<RouteTimeAxisView> (tv->get_parent()),
|
||||
new ArdourCanvas::Group(*tv->canvas_display()))
|
||||
, _controller(tv->controller())
|
||||
, _automation_view(tv)
|
||||
{
|
||||
//canvas_rect->property_fill_color_rgba() = stream_base_color;
|
||||
canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
|
||||
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
use_rec_regions = tv->editor().show_waveforms_recording ();
|
||||
}
|
||||
|
||||
AutomationStreamView::~AutomationStreamView ()
|
||||
|
@ -165,8 +165,8 @@ AutomationStreamView::redisplay_diskstream ()
|
|||
}
|
||||
|
||||
// Add and display region views, and flag them as valid
|
||||
if (_trackview.is_track()) {
|
||||
_trackview.get_diskstream()->playlist()->foreach_region (
|
||||
if (_trackview->is_track()) {
|
||||
_trackview->get_diskstream()->playlist()->foreach_region (
|
||||
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
|
||||
);
|
||||
}
|
||||
|
@ -199,11 +199,11 @@ AutomationStreamView::rec_data_range_ready (jack_nframes_t start, jack_nframes_t
|
|||
void
|
||||
AutomationStreamView::color_handler ()
|
||||
{
|
||||
/*if (_trackview.is_midi_track()) {
|
||||
/*if (_trackview->is_midi_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get();
|
||||
}
|
||||
|
||||
if (!_trackview.is_midi_track()) {
|
||||
if (!_trackview->is_midi_track()) {
|
||||
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();;
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class AutomationRegionView;
|
|||
class AutomationStreamView : public StreamView
|
||||
{
|
||||
public:
|
||||
AutomationStreamView (AutomationTimeAxisView& tv);
|
||||
AutomationStreamView (AutomationTimeAxisViewPtr tv);
|
||||
~AutomationStreamView ();
|
||||
|
||||
void set_automation_state (ARDOUR::AutoState state);
|
||||
|
@ -50,7 +50,7 @@ class AutomationStreamView : public StreamView
|
|||
void redisplay_diskstream ();
|
||||
|
||||
inline double contents_height() const {
|
||||
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
|
||||
return (_trackview->current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -65,7 +65,7 @@ class AutomationStreamView : public StreamView
|
|||
|
||||
boost::shared_ptr<AutomationController> _controller;
|
||||
|
||||
AutomationTimeAxisView& _automation_view;
|
||||
AutomationTimeAxisViewPtr _automation_view;
|
||||
};
|
||||
|
||||
#endif /* __ardour_automation_streamview_h__ */
|
||||
|
|
|
@ -58,20 +58,46 @@ const string AutomationTimeAxisView::state_node_name = "AutomationChild";
|
|||
* For region automation (e.g. MIDI CC), pass null for \a.
|
||||
*/
|
||||
AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r,
|
||||
boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
|
||||
PublicEditor& e, TimeAxisView& parent, bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
|
||||
boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
|
||||
PublicEditor& e, TimeAxisViewPtr parent, bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
|
||||
: AxisView (s),
|
||||
TimeAxisView (s, e, &parent, canvas),
|
||||
TimeAxisView (s, e, parent, canvas),
|
||||
_route (r),
|
||||
_control (c),
|
||||
_automatable (a),
|
||||
_controller(AutomationController::create(a, c->parameter(), c)),
|
||||
_base_rect (0),
|
||||
_view (show_regions ? new AutomationStreamView(*this) : NULL),
|
||||
_name (nom),
|
||||
auto_button (X_("")) /* force addition of a label */
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AutomationTimeAxisViewPtr
|
||||
AutomationTimeAxisView::create (Session& s, boost::shared_ptr<Route> r,
|
||||
boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
|
||||
PublicEditor& e, TimeAxisViewPtr parent, bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
|
||||
{
|
||||
AutomationTimeAxisViewPtr v (new AutomationTimeAxisView (s, r, a, c, e, parent, show_regions, canvas, nom, nomparent));
|
||||
v->init (s, r, a, c, e, parent, show_regions, canvas, nom, nomparent);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AutomationTimeAxisView::init (Session& s, boost::shared_ptr<Route> r,
|
||||
boost::shared_ptr<Automatable> a, boost::shared_ptr<AutomationControl> c,
|
||||
PublicEditor& e, TimeAxisViewPtr parent, bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas, const string & nom, const string & nomparent)
|
||||
{
|
||||
if (show_regions) {
|
||||
_view = new AutomationStreamView (boost::dynamic_pointer_cast<AutomationTimeAxisView> (shared_from_this()));
|
||||
} else {
|
||||
_view = 0;
|
||||
}
|
||||
|
||||
if (!have_name_font) {
|
||||
name_font = get_font_for_style (X_("AutomationTrackName"));
|
||||
have_name_font = true;
|
||||
|
@ -100,9 +126,15 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
|||
|
||||
_base_rect->set_data ("trackview", this);
|
||||
|
||||
_base_rect->signal_event().connect (bind (
|
||||
_base_rect->signal_event().connect (
|
||||
bind (
|
||||
mem_fun (_editor, &PublicEditor::canvas_automation_track_event),
|
||||
_base_rect, this));
|
||||
_base_rect,
|
||||
boost::weak_ptr<AutomationTimeAxisView> (
|
||||
boost::dynamic_pointer_cast<AutomationTimeAxisView> (shared_from_this ())
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// _base_rect->lower_to_bottom();
|
||||
|
||||
|
@ -207,7 +239,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
|
|||
} else {
|
||||
boost::shared_ptr<AutomationLine> line(new AutomationLine (
|
||||
ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
|
||||
*this,
|
||||
boost::dynamic_pointer_cast<AutomationTimeAxisView> (shared_from_this ()),
|
||||
*_canvas_display,
|
||||
_control->alist()));
|
||||
|
||||
|
@ -380,7 +412,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
|||
(height < hNormal && h >= hNormal)
|
||||
|| (height >= hNormal || h < hNormal) );
|
||||
|
||||
TimeAxisView* state_parent = get_parent_with_state ();
|
||||
TimeAxisViewPtr state_parent = get_parent_with_state ();
|
||||
assert(state_parent);
|
||||
XMLNode* xml_node = state_parent->get_automation_child_xml_node (_control->parameter());
|
||||
|
||||
|
@ -658,7 +690,7 @@ AutomationTimeAxisView::reset_objects_one (AutomationLine& line, PointSelection&
|
|||
|
||||
for (PointSelection::iterator i = selection.begin(); i != selection.end(); ++i) {
|
||||
|
||||
if (&(*i).track != this) {
|
||||
if (i->track != shared_from_this ()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -683,7 +715,7 @@ AutomationTimeAxisView::cut_copy_clear_objects_one (AutomationLine& line, PointS
|
|||
|
||||
for (PointSelection::iterator i = selection.begin(); i != selection.end(); ++i) {
|
||||
|
||||
if (&(*i).track != this) {
|
||||
if (i->track != shared_from_this ()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -888,7 +920,7 @@ AutomationTimeAxisView::set_state (const XMLNode& node)
|
|||
XMLNode*
|
||||
AutomationTimeAxisView::get_state_node ()
|
||||
{
|
||||
TimeAxisView* state_parent = get_parent_with_state ();
|
||||
TimeAxisViewPtr state_parent = get_parent_with_state ();
|
||||
|
||||
if (state_parent) {
|
||||
return state_parent->get_automation_child_xml_node (_control->parameter());
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "time_axis_view.h"
|
||||
#include "simplerect.h"
|
||||
#include "automation_controller.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
|
@ -54,16 +55,18 @@ class AutomationController;
|
|||
|
||||
class AutomationTimeAxisView : public TimeAxisView {
|
||||
public:
|
||||
AutomationTimeAxisView (ARDOUR::Session&,
|
||||
boost::shared_ptr<ARDOUR::Route>,
|
||||
boost::shared_ptr<ARDOUR::Automatable>,
|
||||
boost::shared_ptr<ARDOUR::AutomationControl>,
|
||||
PublicEditor&,
|
||||
TimeAxisView& parent,
|
||||
bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas,
|
||||
const std::string & name, /* translatable */
|
||||
const std::string & plug_name = "");
|
||||
|
||||
static AutomationTimeAxisViewPtr
|
||||
create (ARDOUR::Session&,
|
||||
boost::shared_ptr<ARDOUR::Route>,
|
||||
boost::shared_ptr<ARDOUR::Automatable>,
|
||||
boost::shared_ptr<ARDOUR::AutomationControl>,
|
||||
PublicEditor&,
|
||||
TimeAxisViewPtr parent,
|
||||
bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas,
|
||||
const std::string & name, /* translatable */
|
||||
const std::string & plug_name = "");
|
||||
|
||||
~AutomationTimeAxisView();
|
||||
|
||||
|
@ -164,6 +167,32 @@ class AutomationTimeAxisView : public TimeAxisView {
|
|||
|
||||
static Pango::FontDescription* name_font;
|
||||
static bool have_name_font;
|
||||
|
||||
private:
|
||||
|
||||
AutomationTimeAxisView (ARDOUR::Session&,
|
||||
boost::shared_ptr<ARDOUR::Route>,
|
||||
boost::shared_ptr<ARDOUR::Automatable>,
|
||||
boost::shared_ptr<ARDOUR::AutomationControl>,
|
||||
PublicEditor&,
|
||||
TimeAxisViewPtr parent,
|
||||
bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas,
|
||||
const std::string & name, /* translatable */
|
||||
const std::string & plug_name = "");
|
||||
|
||||
void
|
||||
init (ARDOUR::Session&,
|
||||
boost::shared_ptr<ARDOUR::Route>,
|
||||
boost::shared_ptr<ARDOUR::Automatable>,
|
||||
boost::shared_ptr<ARDOUR::AutomationControl>,
|
||||
PublicEditor&,
|
||||
TimeAxisViewPtr parent,
|
||||
bool show_regions,
|
||||
ArdourCanvas::Canvas& canvas,
|
||||
const std::string & name, /* translatable */
|
||||
const std::string & plug_name);
|
||||
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_automation_time_axis_h__ */
|
||||
|
|
|
@ -220,7 +220,7 @@ CanvasNoteEvent::on_event(GdkEvent* ev)
|
|||
bool select_mod;
|
||||
uint8_t d_velocity = 10;
|
||||
|
||||
if (_region.get_time_axis_view().editor().current_mouse_mode() != Editing::MouseNote) {
|
||||
if (_region.get_time_axis_view()->editor().current_mouse_mode() != Editing::MouseNote) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ CanvasNote::on_event(GdkEvent* ev)
|
|||
static double middle_point, last_x;
|
||||
Gdk::Cursor cursor;
|
||||
static NoteEnd note_end;
|
||||
Editing::MidiEditMode edit_mode = _region.get_trackview().editor().current_midi_edit_mode();
|
||||
Editing::MidiEditMode edit_mode = _region.get_trackview()->editor().current_midi_edit_mode();
|
||||
|
||||
switch (ev->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
|
|
@ -43,7 +43,7 @@ using namespace Canvas;
|
|||
sigc::signal<void,CrossfadeView*> CrossfadeView::GoingAway;
|
||||
|
||||
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
||||
RouteTimeAxisView &tv,
|
||||
RouteTimeAxisViewPtr tv,
|
||||
boost::shared_ptr<Crossfade> xf,
|
||||
double spu,
|
||||
Gdk::Color& basic_color,
|
||||
|
@ -69,7 +69,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
|||
fade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeLine.get();
|
||||
fade_out->property_width_pixels() = 1;
|
||||
|
||||
set_height (get_time_axis_view().current_height());
|
||||
set_height (get_time_axis_view()->current_height());
|
||||
|
||||
/* no frame around the xfade or overlap rects */
|
||||
|
||||
|
@ -80,7 +80,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
|||
vestigial_frame->hide();
|
||||
show_vestigial = false;
|
||||
|
||||
group->signal_event().connect (bind (mem_fun (tv.editor(), &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||
group->signal_event().connect (bind (mem_fun (tv->editor(), &PublicEditor::canvas_crossfade_view_event), group, this));
|
||||
|
||||
crossfade_changed (Change (~0));
|
||||
|
||||
|
@ -161,7 +161,7 @@ CrossfadeView::redraw_curves ()
|
|||
track is either Small or Smaller.
|
||||
*/
|
||||
|
||||
double tav_height = get_time_axis_view().current_height();
|
||||
double tav_height = get_time_axis_view()->current_height();
|
||||
if (tav_height == TimeAxisView::hSmaller ||
|
||||
tav_height == TimeAxisView::hSmall) {
|
||||
h = tav_height - 3.0;
|
||||
|
@ -174,7 +174,7 @@ CrossfadeView::redraw_curves ()
|
|||
return;
|
||||
}
|
||||
|
||||
npoints = get_time_axis_view().editor().frame_to_pixel (crossfade->length());
|
||||
npoints = get_time_axis_view()->editor().frame_to_pixel (crossfade->length());
|
||||
// npoints = std::min (gdk_screen_width(), npoints);
|
||||
|
||||
if (!_visible || !crossfade->active() || npoints < 3) {
|
||||
|
|
|
@ -33,7 +33,7 @@ class AudioRegionView;
|
|||
struct CrossfadeView : public TimeAxisViewItem
|
||||
{
|
||||
CrossfadeView (ArdourCanvas::Group*,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::Crossfade>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color& basic_color,
|
||||
|
|
|
@ -270,8 +270,6 @@ Editor::Editor ()
|
|||
cut_buffer = new Selection (this);
|
||||
|
||||
clicked_regionview = 0;
|
||||
clicked_axisview = 0;
|
||||
clicked_routeview = 0;
|
||||
clicked_crossfadeview = 0;
|
||||
clicked_control_point = 0;
|
||||
last_update_frame = 0;
|
||||
|
@ -330,8 +328,6 @@ Editor::Editor ()
|
|||
leftmost_frame = 0;
|
||||
ignore_mouse_mode_toggle = false;
|
||||
ignore_midi_edit_mode_toggle = false;
|
||||
current_stepping_trackview = 0;
|
||||
entered_track = 0;
|
||||
entered_regionview = 0;
|
||||
entered_marker = 0;
|
||||
clear_entered_track = false;
|
||||
|
@ -753,7 +749,7 @@ Editor::set_entered_regionview (RegionView* rv)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::set_entered_track (TimeAxisView* tav)
|
||||
Editor::set_entered_track (TimeAxisViewPtr tav)
|
||||
{
|
||||
if (entered_track) {
|
||||
entered_track->exited ();
|
||||
|
@ -782,10 +778,10 @@ Editor::show_window ()
|
|||
to be re-hidden
|
||||
*/
|
||||
|
||||
TimeAxisView *tv;
|
||||
TimeAxisViewPtr tv;
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
tv = (static_cast<TimeAxisView*>(*i));
|
||||
tv = (static_cast<TimeAxisViewPtr>(*i));
|
||||
tv->reset_height ();
|
||||
}
|
||||
}
|
||||
|
@ -1176,7 +1172,7 @@ Editor::connect_to_session (Session *t)
|
|||
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks);
|
||||
|
||||
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<TimeAxisViewPtr>(*i))->set_samples_per_unit (frames_per_unit);
|
||||
}
|
||||
|
||||
start_scrolling ();
|
||||
|
@ -1498,7 +1494,7 @@ Editor::build_track_region_context_menu (nframes64_t frame)
|
|||
MenuList& edit_items = track_region_context_menu.items();
|
||||
edit_items.clear();
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (clicked_axisview);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (clicked_axisview);
|
||||
|
||||
if (rtv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
|
@ -1535,7 +1531,7 @@ Editor::build_track_crossfade_context_menu (nframes64_t frame)
|
|||
MenuList& edit_items = track_crossfade_context_menu.items();
|
||||
edit_items.clear ();
|
||||
|
||||
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (clicked_axisview);
|
||||
AudioTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AudioTimeAxisView> (clicked_axisview);
|
||||
|
||||
if (atv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
|
@ -2502,18 +2498,18 @@ Editor::get_state ()
|
|||
* TimeAxisView may be 0. Layer index is the layer number if the TimeAxisView is valid and is
|
||||
* in stacked region display mode, otherwise 0.
|
||||
*/
|
||||
std::pair<TimeAxisView *, layer_t>
|
||||
std::pair<TimeAxisViewPtr, layer_t>
|
||||
Editor::trackview_by_y_position (double y)
|
||||
{
|
||||
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
||||
|
||||
std::pair<TimeAxisView*, int> const r = (*iter)->covers_y_position (y);
|
||||
std::pair<TimeAxisViewPtr, int> const r = (*iter)->covers_y_position (y);
|
||||
if (r.first) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_pair ( (TimeAxisView *) 0, 0);
|
||||
return std::make_pair (TimeAxisViewPtr (), 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3690,7 +3686,7 @@ Editor::mouse_select_button_release (GdkEventButton* ev)
|
|||
}
|
||||
|
||||
Editor::TrackViewList *
|
||||
Editor::get_valid_views (TimeAxisView* track, RouteGroup* group)
|
||||
Editor::get_valid_views (TimeAxisViewPtr track, RouteGroup* group)
|
||||
{
|
||||
TrackViewList::iterator i;
|
||||
|
||||
|
@ -4090,8 +4086,13 @@ Editor::restore_editing_space ()
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::new_playlists (TimeAxisView* v)
|
||||
Editor::new_playlists (boost::weak_ptr<TimeAxisView> w)
|
||||
{
|
||||
TimeAxisViewPtr v = w.lock ();
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_reversible_command (_("new playlists"));
|
||||
vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
|
||||
session->get_playlists(playlists);
|
||||
|
@ -4106,8 +4107,13 @@ Editor::new_playlists (TimeAxisView* v)
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::copy_playlists (TimeAxisView* v)
|
||||
Editor::copy_playlists (boost::weak_ptr<TimeAxisView> w)
|
||||
{
|
||||
TimeAxisViewPtr v = w.lock ();
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_reversible_command (_("copy playlists"));
|
||||
vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
|
||||
session->get_playlists(playlists);
|
||||
|
@ -4121,8 +4127,13 @@ Editor::copy_playlists (TimeAxisView* v)
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::clear_playlists (TimeAxisView* v)
|
||||
Editor::clear_playlists (boost::weak_ptr<TimeAxisView> w)
|
||||
{
|
||||
TimeAxisViewPtr v = w.lock ();
|
||||
if (!v) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_reversible_command (_("clear playlists"));
|
||||
vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
|
||||
session->get_playlists(playlists);
|
||||
|
@ -4131,21 +4142,21 @@ Editor::clear_playlists (TimeAxisView* v)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::mapped_use_new_playlist (RouteTimeAxisView& atv, uint32_t sz, vector<boost::shared_ptr<ARDOUR::Playlist> > const & playlists)
|
||||
Editor::mapped_use_new_playlist (RouteTimeAxisViewPtr atv, uint32_t sz, vector<boost::shared_ptr<ARDOUR::Playlist> > const & playlists)
|
||||
{
|
||||
atv.use_new_playlist (sz > 1 ? false : true, playlists);
|
||||
atv->use_new_playlist (sz > 1 ? false : true, playlists);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mapped_use_copy_playlist (RouteTimeAxisView& atv, uint32_t sz, vector<boost::shared_ptr<ARDOUR::Playlist> > const & playlists)
|
||||
Editor::mapped_use_copy_playlist (RouteTimeAxisViewPtr atv, uint32_t sz, vector<boost::shared_ptr<ARDOUR::Playlist> > const & playlists)
|
||||
{
|
||||
atv.use_copy_playlist (sz > 1 ? false : true, playlists);
|
||||
atv->use_copy_playlist (sz > 1 ? false : true, playlists);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mapped_clear_playlist (RouteTimeAxisView& atv, uint32_t sz)
|
||||
Editor::mapped_clear_playlist (RouteTimeAxisViewPtr atv, uint32_t sz)
|
||||
{
|
||||
atv.clear_playlist ();
|
||||
atv->clear_playlist ();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -4470,7 +4481,7 @@ Editor::idle_visual_changer ()
|
|||
}
|
||||
|
||||
struct EditorOrderTimeAxisSorter {
|
||||
bool operator() (const TimeAxisView* a, const TimeAxisView* b) const {
|
||||
bool operator() (const TimeAxisViewPtr a, const TimeAxisViewPtr b) const {
|
||||
return a->order () < b->order ();
|
||||
}
|
||||
};
|
||||
|
@ -4602,7 +4613,7 @@ Editor::get_regions_at (RegionSelection& rs, nframes64_t where, const TrackSelec
|
|||
}
|
||||
|
||||
for (TrackSelection::const_iterator t = tracks->begin(); t != tracks->end(); ++t) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(*t);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*t);
|
||||
if (rtv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
|
@ -4637,7 +4648,7 @@ Editor::get_regions_after (RegionSelection& rs, nframes64_t where, const TrackSe
|
|||
}
|
||||
|
||||
for (TrackSelection::const_iterator t = tracks->begin(); t != tracks->end(); ++t) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(*t);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*t);
|
||||
if (rtv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
|
@ -4677,7 +4688,7 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered)
|
|||
|
||||
for (RegionSelection::iterator i = to_map.begin (); i != to_map.end(); ++i) {
|
||||
|
||||
RouteGroup* g = (*i)->get_time_axis_view().route_group ();
|
||||
RouteGroup* g = (*i)->get_time_axis_view()->route_group ();
|
||||
if (g && g->active_property (RouteGroup::Edit)) {
|
||||
tracks.add (axis_views_from_routes (g->route_list()));
|
||||
}
|
||||
|
@ -4693,9 +4704,9 @@ Editor::get_regions_corresponding_to (boost::shared_ptr<Region> region, vector<R
|
|||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* tatv;
|
||||
RouteTimeAxisViewPtr tatv;
|
||||
|
||||
if ((tatv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
|
||||
if ((tatv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) != 0) {
|
||||
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
vector<boost::shared_ptr<Region> > results;
|
||||
|
@ -4787,7 +4798,7 @@ _idle_resizer (gpointer arg)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::add_to_idle_resize (TimeAxisView* view, int32_t h)
|
||||
Editor::add_to_idle_resize (TimeAxisViewPtr view, int32_t h)
|
||||
{
|
||||
if (resize_idle_id < 0) {
|
||||
resize_idle_id = g_idle_add (_idle_resizer, this);
|
||||
|
@ -4826,7 +4837,7 @@ Editor::idle_resize ()
|
|||
{
|
||||
_pending_resize_view->idle_resize (_pending_resize_view->current_height() + _pending_resize_amount);
|
||||
|
||||
if (dynamic_cast<AutomationTimeAxisView*> (_pending_resize_view) == 0 &&
|
||||
if (boost::dynamic_pointer_cast<AutomationTimeAxisView> (_pending_resize_view) == 0 &&
|
||||
selection->tracks.contains (_pending_resize_view)) {
|
||||
|
||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
|
@ -4871,7 +4882,7 @@ Editor::axis_views_from_routes (list<Route*> r) const
|
|||
for (list<Route*>::const_iterator i = r.begin(); i != r.end(); ++i) {
|
||||
TrackViewList::const_iterator j = track_views.begin ();
|
||||
while (j != track_views.end()) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*j);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*j);
|
||||
if (rtv && rtv->route().get() == *i) {
|
||||
t.push_back (rtv);
|
||||
}
|
||||
|
@ -4888,8 +4899,8 @@ Editor::handle_new_route (RouteList& routes)
|
|||
{
|
||||
ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_new_route), routes));
|
||||
|
||||
RouteTimeAxisView *rtv;
|
||||
list<RouteTimeAxisView*> new_views;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
list<RouteTimeAxisViewPtr> new_views;
|
||||
|
||||
for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
|
||||
boost::shared_ptr<Route> route = (*x);
|
||||
|
@ -4901,9 +4912,9 @@ Editor::handle_new_route (RouteList& routes)
|
|||
DataType dt = route->input()->default_type();
|
||||
|
||||
if (dt == ARDOUR::DataType::AUDIO) {
|
||||
rtv = new AudioTimeAxisView (*this, *session, route, *track_canvas);
|
||||
rtv = AudioTimeAxisView::create (*this, *session, route, *track_canvas);
|
||||
} else if (dt == ARDOUR::DataType::MIDI) {
|
||||
rtv = new MidiTimeAxisView (*this, *session, route, *track_canvas);
|
||||
rtv = MidiTimeAxisView::create (*this, *session, route, *track_canvas);
|
||||
} else {
|
||||
throw unknown_type();
|
||||
}
|
||||
|
@ -4931,16 +4942,16 @@ Editor::handle_new_route (RouteList& routes)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::remove_route (TimeAxisView *tv)
|
||||
Editor::remove_route (TimeAxisViewPtr tv)
|
||||
{
|
||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::remove_route), tv));
|
||||
ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::remove_route), tv));
|
||||
|
||||
TrackViewList::iterator i;
|
||||
boost::shared_ptr<Route> route;
|
||||
TimeAxisView* next_tv;
|
||||
TimeAxisViewPtr next_tv;
|
||||
|
||||
if (tv == entered_track) {
|
||||
entered_track = 0;
|
||||
entered_track.reset ();
|
||||
}
|
||||
|
||||
if ((i = find (track_views.begin(), track_views.end(), tv)) != track_views.end()) {
|
||||
|
@ -4948,7 +4959,7 @@ Editor::remove_route (TimeAxisView *tv)
|
|||
i = track_views.erase (i);
|
||||
|
||||
if (track_views.empty()) {
|
||||
next_tv = 0;
|
||||
next_tv.reset ();
|
||||
} else if (i == track_views.end()) {
|
||||
next_tv = track_views.front();
|
||||
} else {
|
||||
|
@ -4959,7 +4970,7 @@ Editor::remove_route (TimeAxisView *tv)
|
|||
if (current_mixer_strip && current_mixer_strip->route() == route) {
|
||||
|
||||
if (next_tv) {
|
||||
set_selected_mixer_strip (*next_tv);
|
||||
set_selected_mixer_strip (next_tv);
|
||||
} else {
|
||||
/* make the editor mixer strip go away setting the
|
||||
* button to inactive (which also unticks the menu option)
|
||||
|
@ -4971,9 +4982,9 @@ Editor::remove_route (TimeAxisView *tv)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::hide_track_in_display (TimeAxisView& tv, bool temponly)
|
||||
Editor::hide_track_in_display (TimeAxisViewPtr tv, bool temponly)
|
||||
{
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&tv);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv);
|
||||
|
||||
if (rtv && current_mixer_strip && (rtv->route() == current_mixer_strip->route())) {
|
||||
// this will hide the mixer strip
|
||||
|
@ -4995,27 +5006,27 @@ Editor::sync_track_view_list_and_routes ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::foreach_time_axis_view (sigc::slot<void,TimeAxisView&> theslot)
|
||||
Editor::foreach_time_axis_view (sigc::slot<void,TimeAxisViewPtr> theslot)
|
||||
{
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
theslot (**i);
|
||||
theslot (*i);
|
||||
}
|
||||
}
|
||||
|
||||
RouteTimeAxisView*
|
||||
RouteTimeAxisViewPtr
|
||||
Editor::get_route_view_by_id (PBD::ID& id)
|
||||
{
|
||||
RouteTimeAxisView* v;
|
||||
RouteTimeAxisViewPtr v;
|
||||
|
||||
for(TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if((v = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||
if((v = boost::dynamic_pointer_cast<RouteTimeAxisView>(*i)) != 0) {
|
||||
if(v->route()->id() == id) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return RouteTimeAxisViewPtr ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -5071,3 +5082,22 @@ Editor::hide_region_from_region_list ()
|
|||
_regions->selection_mapover (mem_fun (*this, &Editor::hide_a_region));
|
||||
}
|
||||
|
||||
TimeAxisViewPtr
|
||||
Editor::find_time_axis (TimeAxisView* v)
|
||||
{
|
||||
TrackViewList::iterator i = track_views.begin ();
|
||||
while (i != track_views.end()) {
|
||||
if (i->get() == v) {
|
||||
return *i;
|
||||
}
|
||||
|
||||
TimeAxisViewPtr p = (*i)->find_time_axis (v);
|
||||
if (p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
return TimeAxisViewPtr ();
|
||||
}
|
||||
|
|
|
@ -191,16 +191,16 @@ class Editor : public PublicEditor
|
|||
|
||||
#ifdef WITH_CMT
|
||||
void add_imageframe_time_axis(const std::string & track_name, void*) ;
|
||||
void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
|
||||
void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisViewPtr marked_track, void*) ;
|
||||
void connect_to_image_compositor() ;
|
||||
void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
|
||||
#endif
|
||||
|
||||
TimeAxisView* get_named_time_axis(const std::string & name) ;
|
||||
void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
|
||||
void add_to_idle_resize (TimeAxisView*, int32_t);
|
||||
TimeAxisViewPtr get_named_time_axis(const std::string & name) ;
|
||||
void foreach_time_axis_view (sigc::slot<void,TimeAxisViewPtr>);
|
||||
void add_to_idle_resize (TimeAxisViewPtr, int32_t);
|
||||
|
||||
RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
|
||||
RouteTimeAxisViewPtr get_route_view_by_id (PBD::ID& id);
|
||||
|
||||
void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
|
||||
void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
|
||||
|
@ -273,7 +273,7 @@ class Editor : public PublicEditor
|
|||
Selection& get_selection() const { return *selection; }
|
||||
Selection& get_cut_buffer() const { return *cut_buffer; }
|
||||
|
||||
bool extend_selection_to_track (TimeAxisView&);
|
||||
bool extend_selection_to_track (TimeAxisViewPtr);
|
||||
|
||||
void play_selection ();
|
||||
void select_all_in_track (Selection::Operation op);
|
||||
|
@ -315,11 +315,11 @@ class Editor : public PublicEditor
|
|||
PlaylistSelector& playlist_selector() const;
|
||||
void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
|
||||
|
||||
void new_playlists (TimeAxisView* v);
|
||||
void copy_playlists (TimeAxisView* v);
|
||||
void clear_playlists (TimeAxisView* v);
|
||||
void new_playlists (boost::weak_ptr<TimeAxisView>);
|
||||
void copy_playlists (boost::weak_ptr<TimeAxisView>);
|
||||
void clear_playlists (boost::weak_ptr<TimeAxisView>);
|
||||
|
||||
TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
|
||||
TrackViewList* get_valid_views (TimeAxisViewPtr, ARDOUR::RouteGroup* grp = 0);
|
||||
void get_onscreen_tracks (TrackViewList&);
|
||||
|
||||
Width editor_mixer_strip_width;
|
||||
|
@ -327,8 +327,8 @@ class Editor : public PublicEditor
|
|||
void show_editor_mixer (bool yn);
|
||||
void create_editor_mixer ();
|
||||
void show_editor_list (bool yn);
|
||||
void set_selected_mixer_strip (TimeAxisView&);
|
||||
void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
|
||||
void set_selected_mixer_strip (TimeAxisViewPtr);
|
||||
void hide_track_in_display (TimeAxisViewPtr tv, bool temporary = false);
|
||||
|
||||
/* nudge is initiated by transport controls owned by ARDOUR_UI */
|
||||
|
||||
|
@ -433,7 +433,7 @@ class Editor : public PublicEditor
|
|||
|
||||
PlaylistSelector* _playlist_selector;
|
||||
|
||||
typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
|
||||
typedef std::pair<TimeAxisViewPtr,XMLNode*> TAVState;
|
||||
|
||||
struct VisualState {
|
||||
double y_position;
|
||||
|
@ -531,8 +531,8 @@ class Editor : public PublicEditor
|
|||
void update_cd_marker_display ();
|
||||
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
|
||||
|
||||
TimeAxisView* clicked_axisview;
|
||||
RouteTimeAxisView* clicked_routeview;
|
||||
TimeAxisViewPtr clicked_axisview;
|
||||
RouteTimeAxisViewPtr clicked_routeview;
|
||||
/** The last RegionView that was clicked on, or 0 if the last click was not
|
||||
* on a RegionView. This is set up by the canvas event handlers in
|
||||
* editor_canvas_events.cc
|
||||
|
@ -545,18 +545,18 @@ class Editor : public PublicEditor
|
|||
|
||||
void sort_track_selection (TrackSelection* sel = 0);
|
||||
|
||||
void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
|
||||
void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
|
||||
void get_relevant_tracks (std::set<RouteTimeAxisViewPtr>& relevant_tracks) const;
|
||||
void get_equivalent_tracks (RouteTimeAxisViewPtr, std::set<RouteTimeAxisViewPtr> &, ARDOUR::RouteGroup::Property) const;
|
||||
void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
|
||||
RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
|
||||
void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
|
||||
void mapover_tracks (sigc::slot<void,RouteTimeAxisViewPtr,uint32_t> sl, TimeAxisViewPtr, ARDOUR::RouteGroup::Property) const;
|
||||
|
||||
/* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
|
||||
|
||||
void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
|
||||
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_regions (RouteTimeAxisViewPtr, uint32_t, RegionView *, std::vector<RegionView*>*) const;
|
||||
void mapped_use_new_playlist (RouteTimeAxisViewPtr, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
|
||||
void mapped_use_copy_playlist (RouteTimeAxisViewPtr, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
|
||||
void mapped_clear_playlist (RouteTimeAxisViewPtr, uint32_t);
|
||||
|
||||
/* end */
|
||||
|
||||
|
@ -565,7 +565,7 @@ class Editor : public PublicEditor
|
|||
|
||||
void catch_vanishing_regionview (RegionView *);
|
||||
|
||||
void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track (TimeAxisViewPtr, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void select_all_tracks ();
|
||||
|
||||
bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
|
@ -601,7 +601,7 @@ class Editor : public PublicEditor
|
|||
void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
|
||||
|
||||
void handle_new_route (ARDOUR::RouteList&);
|
||||
void remove_route (TimeAxisView *);
|
||||
void remove_route (TimeAxisViewPtr);
|
||||
bool route_removal;
|
||||
|
||||
Gtk::HBox global_hpacker;
|
||||
|
@ -846,7 +846,7 @@ class Editor : public PublicEditor
|
|||
void select_all_selectables_between (bool within);
|
||||
void select_range_between ();
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
|
||||
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisViewPtr * = 0);
|
||||
nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
|
||||
|
||||
std::vector<nframes64_t> region_boundary_cache;
|
||||
|
@ -969,7 +969,7 @@ class Editor : public PublicEditor
|
|||
|
||||
/* track views */
|
||||
TrackViewList track_views;
|
||||
std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
|
||||
std::pair<TimeAxisViewPtr, ARDOUR::layer_t> trackview_by_y_position (double);
|
||||
TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
|
||||
|
||||
static Gdk::Cursor* cross_hair_cursor;
|
||||
|
@ -1270,7 +1270,7 @@ class Editor : public PublicEditor
|
|||
bool have_pending_keyboard_selection;
|
||||
nframes64_t pending_keyboard_selection_start;
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
|
||||
boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisViewPtr *tv);
|
||||
void extend_selection_to_end_of_region (bool next);
|
||||
void extend_selection_to_start_of_region (bool previous);
|
||||
|
||||
|
@ -1350,12 +1350,12 @@ public:
|
|||
bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||
bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
|
||||
bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, boost::weak_ptr<TimeAxisView>);
|
||||
bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
|
||||
bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
|
||||
bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
|
||||
bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
|
||||
bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
|
||||
bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, boost::weak_ptr<AutomationTimeAxisView>);
|
||||
|
||||
bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
|
@ -1851,7 +1851,7 @@ public:
|
|||
|
||||
#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) ;
|
||||
void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisViewPtr marked_track) ;
|
||||
|
||||
void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
|
||||
void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
|
||||
|
@ -1924,12 +1924,12 @@ public:
|
|||
|
||||
/* tracking step changes of track height */
|
||||
|
||||
TimeAxisView* current_stepping_trackview;
|
||||
TimeAxisViewPtr current_stepping_trackview;
|
||||
ARDOUR::microseconds_t last_track_height_step_timestamp;
|
||||
gint track_height_step_timeout();
|
||||
sigc::connection step_timeout;
|
||||
|
||||
TimeAxisView* entered_track;
|
||||
TimeAxisViewPtr entered_track;
|
||||
RegionView* entered_regionview;
|
||||
|
||||
|
||||
|
@ -1937,9 +1937,9 @@ public:
|
|||
bool clear_entered_track;
|
||||
bool left_track_canvas (GdkEventCrossing*);
|
||||
bool entered_track_canvas (GdkEventCrossing*);
|
||||
void set_entered_track (TimeAxisView*);
|
||||
void set_entered_track (TimeAxisViewPtr);
|
||||
void set_entered_regionview (RegionView*);
|
||||
void ensure_track_visible (TimeAxisView*);
|
||||
void ensure_track_visible (TimeAxisViewPtr);
|
||||
gint left_automation_track ();
|
||||
|
||||
bool _new_regionviews_show_envelope;
|
||||
|
@ -2011,7 +2011,7 @@ public:
|
|||
bool idle_resize();
|
||||
friend gboolean _idle_resize (gpointer);
|
||||
int32_t _pending_resize_amount;
|
||||
TimeAxisView* _pending_resize_view;
|
||||
TimeAxisViewPtr _pending_resize_view;
|
||||
|
||||
void visible_order_range (int*, int*) const;
|
||||
|
||||
|
@ -2027,6 +2027,8 @@ public:
|
|||
EditorGroupTabs* _group_tabs;
|
||||
void fit_route_group (ARDOUR::RouteGroup *);
|
||||
|
||||
TimeAxisViewPtr find_time_axis (TimeAxisView *);
|
||||
|
||||
friend class Drag;
|
||||
friend class RegionDrag;
|
||||
friend class RegionMoveDrag;
|
||||
|
|
|
@ -105,7 +105,7 @@ Editor::external_audio_dialog ()
|
|||
track_cnt = 0;
|
||||
|
||||
for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) {
|
||||
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
AudioTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(*x);
|
||||
|
||||
if (!atv) {
|
||||
continue;
|
||||
|
@ -263,12 +263,12 @@ Editor::check_whether_and_how_to_import(string path, bool all_or_nothing)
|
|||
boost::shared_ptr<AudioTrack>
|
||||
Editor::get_nth_selected_audio_track (int nth) const
|
||||
{
|
||||
AudioTimeAxisView* atv;
|
||||
AudioTimeAxisViewPtr atv;
|
||||
TrackSelection::iterator x;
|
||||
|
||||
for (x = selection->tracks.begin(); nth > 0 && x != selection->tracks.end(); ++x) {
|
||||
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(*x);
|
||||
|
||||
if (!atv) {
|
||||
continue;
|
||||
|
@ -278,9 +278,9 @@ Editor::get_nth_selected_audio_track (int nth) const
|
|||
}
|
||||
|
||||
if (x == selection->tracks.end()) {
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(selection->tracks.back());
|
||||
atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(selection->tracks.back());
|
||||
} else {
|
||||
atv = dynamic_cast<AudioTimeAxisView*>(*x);
|
||||
atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(*x);
|
||||
}
|
||||
|
||||
if (!atv || !atv->is_audio_track()) {
|
||||
|
@ -293,12 +293,12 @@ Editor::get_nth_selected_audio_track (int nth) const
|
|||
boost::shared_ptr<MidiTrack>
|
||||
Editor::get_nth_selected_midi_track (int nth) const
|
||||
{
|
||||
MidiTimeAxisView* mtv;
|
||||
MidiTimeAxisViewPtr mtv;
|
||||
TrackSelection::iterator x;
|
||||
|
||||
for (x = selection->tracks.begin(); nth > 0 && x != selection->tracks.end(); ++x) {
|
||||
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(*x);
|
||||
mtv = boost::dynamic_pointer_cast<MidiTimeAxisView>(*x);
|
||||
|
||||
if (!mtv) {
|
||||
continue;
|
||||
|
@ -308,9 +308,9 @@ Editor::get_nth_selected_midi_track (int nth) const
|
|||
}
|
||||
|
||||
if (x == selection->tracks.end()) {
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(selection->tracks.back());
|
||||
mtv = boost::dynamic_pointer_cast<MidiTimeAxisView>(selection->tracks.back());
|
||||
} else {
|
||||
mtv = dynamic_cast<MidiTimeAxisView*>(*x);
|
||||
mtv = boost::dynamic_pointer_cast<MidiTimeAxisView>(*x);
|
||||
}
|
||||
|
||||
if (!mtv || !mtv->is_midi_track()) {
|
||||
|
|
|
@ -36,12 +36,12 @@ using namespace PBD;
|
|||
void
|
||||
Editor::set_show_waveforms_recording (bool yn)
|
||||
{
|
||||
AudioTimeAxisView* atv;
|
||||
AudioTimeAxisViewPtr atv;
|
||||
|
||||
if (_show_waveforms_recording != yn) {
|
||||
_show_waveforms_recording = yn;
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(*i)) != 0) {
|
||||
atv->set_show_waveforms_recording (yn);
|
||||
}
|
||||
}
|
||||
|
@ -51,12 +51,12 @@ Editor::set_show_waveforms_recording (bool yn)
|
|||
gint
|
||||
Editor::start_updating ()
|
||||
{
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
//cerr << "Editor::start_updating () called" << endl;//DEBUG
|
||||
if (is_mapped() && session) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*i)) != 0) {
|
||||
rtv->reset_meter ();
|
||||
}
|
||||
}
|
||||
|
@ -72,14 +72,14 @@ Editor::start_updating ()
|
|||
gint
|
||||
Editor::stop_updating ()
|
||||
{
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
meters_running = false;
|
||||
fast_screen_update_connection.disconnect();
|
||||
//cerr << "Editor::stop_updating () called" << endl;//DEBUG
|
||||
if (is_mapped() && session) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*i)) != 0) {
|
||||
rtv->hide_meter ();
|
||||
}
|
||||
}
|
||||
|
@ -102,11 +102,11 @@ Editor::toggle_meter_updating()
|
|||
void
|
||||
Editor::fast_update_strips ()
|
||||
{
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if (is_mapped() && session) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*i)) != 0) {
|
||||
rtv->fast_update ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -459,9 +459,9 @@ Editor::idle_drop_paths (vector<ustring> paths, nframes64_t frame, double ypos)
|
|||
void
|
||||
Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, double ypos)
|
||||
{
|
||||
RouteTimeAxisView* tv;
|
||||
RouteTimeAxisViewPtr tv;
|
||||
|
||||
std::pair<TimeAxisView*, int> const tvp = trackview_by_y_position (ypos);
|
||||
std::pair<TimeAxisViewPtr, int> const tvp = trackview_by_y_position (ypos);
|
||||
if (tvp.first == 0) {
|
||||
|
||||
/* drop onto canvas background: create new tracks */
|
||||
|
@ -474,13 +474,13 @@ Editor::drop_paths_part_two (const vector<ustring>& paths, nframes64_t frame, do
|
|||
do_embed (paths, Editing::ImportDistinctFiles, ImportAsTrack, frame);
|
||||
}
|
||||
|
||||
} else if ((tv = dynamic_cast<RouteTimeAxisView*> (tvp.first)) != 0) {
|
||||
} else if ((tv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tvp.first)) != 0) {
|
||||
|
||||
/* check that its an audio track, not a bus */
|
||||
|
||||
if (tv->get_diskstream()) {
|
||||
/* select the track, then embed/import */
|
||||
selection->set (tv);
|
||||
selection->set (boost::static_pointer_cast<TimeAxisView> (tv));
|
||||
|
||||
if (Profile->get_sae() || Config->get_only_copy_imported_files()) {
|
||||
do_import (paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame);
|
||||
|
@ -756,7 +756,7 @@ Editor::stop_canvas_autoscroll ()
|
|||
bool
|
||||
Editor::left_track_canvas (GdkEventCrossing *ev)
|
||||
{
|
||||
set_entered_track (0);
|
||||
set_entered_track (TimeAxisViewPtr ());
|
||||
set_entered_regionview (0);
|
||||
reset_canvas_action_sensitivity (false);
|
||||
return false;
|
||||
|
|
|
@ -99,7 +99,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||
if (!current_stepping_trackview) {
|
||||
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
|
||||
std::pair<TimeAxisView*, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
|
||||
std::pair<TimeAxisViewPtr, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
|
||||
current_stepping_trackview = p.first;
|
||||
if (!current_stepping_trackview) {
|
||||
return false;
|
||||
|
@ -134,7 +134,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||
if (!current_stepping_trackview) {
|
||||
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
|
||||
std::pair<TimeAxisView*, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
|
||||
std::pair<TimeAxisViewPtr, int> const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize);
|
||||
current_stepping_trackview = p.first;
|
||||
if (!current_stepping_trackview) {
|
||||
return false;
|
||||
|
@ -270,8 +270,8 @@ Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, Reg
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &rv->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = rv->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView> (clicked_axisview);
|
||||
ret = button_press_handler (item, event, RegionItem);
|
||||
break;
|
||||
|
||||
|
@ -284,12 +284,12 @@ Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, Reg
|
|||
break;
|
||||
|
||||
case GDK_ENTER_NOTIFY:
|
||||
set_entered_track (&rv->get_time_axis_view ());
|
||||
set_entered_track (rv->get_time_axis_view ());
|
||||
set_entered_regionview (rv);
|
||||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
set_entered_track (0);
|
||||
set_entered_track (TimeAxisViewPtr ());
|
||||
set_entered_regionview (0);
|
||||
break;
|
||||
|
||||
|
@ -301,8 +301,13 @@ Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, Reg
|
|||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, RouteTimeAxisView *tv)
|
||||
Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, boost::weak_ptr<TimeAxisView> w)
|
||||
{
|
||||
boost::shared_ptr<TimeAxisView> tv = w.lock ();
|
||||
if (!tv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = FALSE;
|
||||
|
||||
switch (event->type) {
|
||||
|
@ -312,7 +317,7 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou
|
|||
clicked_regionview = 0;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = tv;
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(tv);
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(tv);
|
||||
ret = button_press_handler (item, event, StreamItem);
|
||||
break;
|
||||
|
||||
|
@ -329,7 +334,7 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou
|
|||
break;
|
||||
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
set_entered_track (0);
|
||||
set_entered_track (TimeAxisViewPtr ());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -340,8 +345,13 @@ Editor::canvas_stream_view_event (GdkEvent *event, ArdourCanvas::Item* item, Rou
|
|||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item, AutomationTimeAxisView *atv)
|
||||
Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item, boost::weak_ptr<AutomationTimeAxisView> v)
|
||||
{
|
||||
boost::shared_ptr<AutomationTimeAxisView> atv = v.lock ();
|
||||
if (!atv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ret = false;
|
||||
|
||||
switch (event->type) {
|
||||
|
@ -350,8 +360,8 @@ Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = 0;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = atv;
|
||||
clicked_routeview = 0;
|
||||
clicked_axisview.reset ();
|
||||
clicked_routeview.reset ();
|
||||
ret = button_press_handler (item, event, AutomationTrackItem);
|
||||
break;
|
||||
|
||||
|
@ -391,8 +401,8 @@ Editor::canvas_fade_in_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRe
|
|||
case GDK_BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &rv->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = rv->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
if (event->button.button == 3) {
|
||||
return button_press_handler (item, event, FadeInItem);
|
||||
}
|
||||
|
@ -429,8 +439,8 @@ Editor::canvas_fade_in_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &rv->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = rv->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
ret = button_press_handler (item, event, FadeInHandleItem);
|
||||
break;
|
||||
|
||||
|
@ -470,8 +480,8 @@ Editor::canvas_fade_out_event (GdkEvent *event, ArdourCanvas::Item* item, AudioR
|
|||
case GDK_BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &rv->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = rv->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView> (clicked_axisview);
|
||||
if (event->button.button == 3) {
|
||||
return button_press_handler (item, event, FadeOutItem);
|
||||
}
|
||||
|
@ -508,8 +518,8 @@ Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &rv->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = rv->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
ret = button_press_handler (item, event, FadeOutHandleItem);
|
||||
break;
|
||||
|
||||
|
@ -550,7 +560,7 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
|||
switch (event->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
clicked_crossfadeview = xfv;
|
||||
clicked_axisview = &clicked_crossfadeview->get_time_axis_view();
|
||||
clicked_axisview = clicked_crossfadeview->get_time_axis_view();
|
||||
if (event->button.button == 3) {
|
||||
return button_press_handler (item, event, CrossfadeViewItem);
|
||||
}
|
||||
|
@ -580,10 +590,10 @@ Editor::canvas_crossfade_view_event (GdkEvent* event, ArdourCanvas::Item* item,
|
|||
and proxy to that when required.
|
||||
*/
|
||||
|
||||
TimeAxisView& tv (xfv->get_time_axis_view());
|
||||
AudioTimeAxisView* atv;
|
||||
TimeAxisViewPtr tv (xfv->get_time_axis_view());
|
||||
AudioTimeAxisViewPtr atv;
|
||||
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(&tv)) != 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(tv)) != 0) {
|
||||
|
||||
if (atv->is_audio_track()) {
|
||||
|
||||
|
@ -621,8 +631,8 @@ Editor::canvas_control_point_event (GdkEvent *event, ArdourCanvas::Item* item, C
|
|||
case GDK_2BUTTON_PRESS:
|
||||
case GDK_3BUTTON_PRESS:
|
||||
clicked_control_point = cp;
|
||||
clicked_axisview = &cp->line().trackview;
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = cp->line().trackview;
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
clicked_regionview = 0;
|
||||
break;
|
||||
|
||||
|
@ -769,8 +779,8 @@ Editor::canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &clicked_regionview->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = clicked_regionview->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
ret = button_press_handler (item, event, RegionViewNameHighlight);
|
||||
break;
|
||||
case GDK_BUTTON_RELEASE:
|
||||
|
@ -809,8 +819,8 @@ Editor::canvas_region_view_name_event (GdkEvent *event, ArdourCanvas::Item* item
|
|||
case GDK_3BUTTON_PRESS:
|
||||
clicked_regionview = rv;
|
||||
clicked_control_point = 0;
|
||||
clicked_axisview = &clicked_regionview->get_time_axis_view();
|
||||
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
|
||||
clicked_axisview = clicked_regionview->get_time_axis_view();
|
||||
clicked_routeview = boost::dynamic_pointer_cast<RouteTimeAxisView>(clicked_axisview);
|
||||
ret = button_press_handler (item, event, RegionViewName);
|
||||
break;
|
||||
case GDK_BUTTON_RELEASE:
|
||||
|
@ -920,12 +930,12 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & c, int
|
|||
double py;
|
||||
nframes64_t const pos = event_frame (&event, &px, &py);
|
||||
|
||||
std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py);
|
||||
std::pair<TimeAxisViewPtr, int> const tv = trackview_by_y_position (py);
|
||||
if (tv.first == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (tv.first);
|
||||
RouteTimeAxisViewPtr rtav = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv.first);
|
||||
if (rtav == 0 || !rtav->is_track ()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -935,14 +945,14 @@ Editor::track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const & c, int
|
|||
boost::shared_ptr<Region> region_copy = RegionFactory::create (region);
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 &&
|
||||
dynamic_cast<AudioTimeAxisView*> (tv.first) == 0) {
|
||||
boost::dynamic_pointer_cast<AudioTimeAxisView> (tv.first) == 0) {
|
||||
|
||||
/* audio -> non-audio */
|
||||
return true;
|
||||
}
|
||||
|
||||
if (boost::dynamic_pointer_cast<MidiRegion> (region_copy) == 0 &&
|
||||
dynamic_cast<MidiTimeAxisView*> (tv.first) != 0) {
|
||||
boost::dynamic_pointer_cast<MidiTimeAxisView> (tv.first) != 0) {
|
||||
|
||||
/* MIDI -> non-MIDI */
|
||||
return true;
|
||||
|
|
|
@ -253,7 +253,6 @@ RegionDrag::region_going_away (RegionView* v)
|
|||
|
||||
RegionMotionDrag::RegionMotionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool b)
|
||||
: RegionDrag (e, i, p, v),
|
||||
_dest_trackview (0),
|
||||
_dest_layer (0),
|
||||
_brushing (b)
|
||||
{
|
||||
|
@ -280,7 +279,7 @@ RegionMotionDrag::get_time_axis_view_summary ()
|
|||
/* get a bitmask representing the visible tracks */
|
||||
|
||||
for (Editor::TrackViewList::iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
TimeAxisView::Children children_list;
|
||||
|
||||
/* zeroes are audio/MIDI tracks. ones are other types. */
|
||||
|
@ -310,7 +309,7 @@ RegionMotionDrag::get_time_axis_view_summary ()
|
|||
|
||||
bool
|
||||
RegionMotionDrag::compute_y_delta (
|
||||
TimeAxisView const * last_pointer_view, TimeAxisView* current_pointer_view,
|
||||
TimeAxisViewConstPtr last_pointer_view, TimeAxisViewPtr current_pointer_view,
|
||||
int32_t last_pointer_layer, int32_t current_pointer_layer,
|
||||
TimeAxisViewSummary const & tavs,
|
||||
int32_t* pointer_order_span, int32_t* pointer_layer_span,
|
||||
|
@ -366,9 +365,9 @@ RegionMotionDrag::compute_y_delta (
|
|||
iy1 += _editor->vertical_adjustment.get_value() - _editor->canvas_timebars_vsize;
|
||||
|
||||
/* get the new trackview for this particular region */
|
||||
pair<TimeAxisView*, int> const tvp = _editor->trackview_by_y_position (iy1);
|
||||
pair<TimeAxisViewPtr, int> const tvp = _editor->trackview_by_y_position (iy1);
|
||||
assert (tvp.first);
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tvp.first);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tvp.first);
|
||||
|
||||
/* XXX: not sure that we should be passing canvas_pointer_order_span in here,
|
||||
as surely this is a per-region thing... */
|
||||
|
@ -495,14 +494,14 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
|||
current_pointer_layer the current layer on that TimeAxisView; in this code layer numbers
|
||||
are with respect to how the view's layers are displayed; if we are in Overlaid mode, layer
|
||||
is always 0 regardless of what the region's "real" layer is */
|
||||
RouteTimeAxisView* current_pointer_view;
|
||||
RouteTimeAxisViewPtr current_pointer_view;
|
||||
layer_t current_pointer_layer;
|
||||
if (!check_possible (¤t_pointer_view, ¤t_pointer_layer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* TimeAxisView that we were pointing at last time we entered this method */
|
||||
TimeAxisView const * const last_pointer_view = _dest_trackview;
|
||||
TimeAxisViewConstPtr const last_pointer_view = _dest_trackview;
|
||||
/* the order of the track that we were pointing at last time we entered this method */
|
||||
int32_t const last_pointer_order = last_pointer_view->order ();
|
||||
/* the layer that we were pointing at last time we entered this method */
|
||||
|
@ -573,7 +572,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
|||
|
||||
// hide any dependent views
|
||||
|
||||
rv->get_time_axis_view().hide_dependent_views (*rv);
|
||||
rv->get_time_axis_view()->hide_dependent_views (*rv);
|
||||
|
||||
/*
|
||||
reparent to a non scrolling group so that we can keep the
|
||||
|
@ -589,8 +588,8 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
|||
}
|
||||
|
||||
/* current view for this particular region */
|
||||
pair<TimeAxisView*, int> pos = _editor->trackview_by_y_position (iy1);
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (pos.first);
|
||||
pair<TimeAxisViewPtr, int> pos = _editor->trackview_by_y_position (iy1);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (pos.first);
|
||||
|
||||
if (pointer_order_span != 0 && !clamp_y_axis) {
|
||||
|
||||
|
@ -671,8 +670,8 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
|||
|
||||
/* find out where we'll be when we move and set height accordingly */
|
||||
|
||||
pair<TimeAxisView*, int> const pos = _editor->trackview_by_y_position (iy1 + y_delta);
|
||||
RouteTimeAxisView const * temp_rtv = dynamic_cast<RouteTimeAxisView*> (pos.first);
|
||||
pair<TimeAxisViewPtr, int> const pos = _editor->trackview_by_y_position (iy1 + y_delta);
|
||||
RouteTimeAxisViewConstPtr temp_rtv = boost::dynamic_pointer_cast<const RouteTimeAxisView> (pos.first);
|
||||
rv->set_height (temp_rtv->view()->child_height());
|
||||
|
||||
/* if you un-comment the following, the region colours will follow
|
||||
|
@ -734,8 +733,8 @@ RegionMoveDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
pair<PlaylistSet::iterator,bool> insert_result, frozen_insert_result;
|
||||
nframes64_t drag_delta;
|
||||
bool changed_tracks, changed_position;
|
||||
map<RegionView*, RouteTimeAxisView*> final;
|
||||
RouteTimeAxisView* source_tv;
|
||||
map<RegionView*, RouteTimeAxisViewPtr> final;
|
||||
RouteTimeAxisViewPtr source_tv;
|
||||
|
||||
if (!movement_occurred) {
|
||||
/* just a click */
|
||||
|
@ -784,7 +783,7 @@ RegionMoveDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
}
|
||||
|
||||
changed_position = (_last_frame_position != (nframes64_t) (_primary->region()->position()));
|
||||
changed_tracks = (_dest_trackview != &_primary->get_time_axis_view());
|
||||
changed_tracks = (_dest_trackview != _primary->get_time_axis_view());
|
||||
|
||||
drag_delta = _primary->region()->position() - _last_frame_position;
|
||||
|
||||
|
@ -796,7 +795,7 @@ RegionMoveDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
for (list<RegionView*>::const_iterator i = _views.begin(); i != _views.end(); ) {
|
||||
|
||||
RegionView* rv = (*i);
|
||||
RouteTimeAxisView* dest_rtv = final[*i];
|
||||
RouteTimeAxisViewPtr dest_rtv = final[*i];
|
||||
|
||||
nframes64_t where;
|
||||
|
||||
|
@ -892,7 +891,7 @@ RegionMoveDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
because we may have copied the region and it has not been attached to a playlist.
|
||||
*/
|
||||
|
||||
assert ((source_tv = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view())));
|
||||
assert ((source_tv = boost::dynamic_pointer_cast<RouteTimeAxisView> (rv->get_time_axis_view())));
|
||||
assert ((ds = source_tv->get_diskstream()));
|
||||
assert ((from_playlist = ds->playlist()));
|
||||
|
||||
|
@ -1060,12 +1059,12 @@ RegionMotionDrag::copy_regions (GdkEvent* event)
|
|||
}
|
||||
|
||||
bool
|
||||
RegionMotionDrag::check_possible (RouteTimeAxisView** tv, layer_t* layer)
|
||||
RegionMotionDrag::check_possible (RouteTimeAxisViewPtr* tv, layer_t* layer)
|
||||
{
|
||||
/* Which trackview is this ? */
|
||||
|
||||
pair<TimeAxisView*, int> const tvp = _editor->trackview_by_y_position (current_pointer_y ());
|
||||
(*tv) = dynamic_cast<RouteTimeAxisView*> (tvp.first);
|
||||
pair<TimeAxisViewPtr, int> const tvp = _editor->trackview_by_y_position (current_pointer_y ());
|
||||
(*tv) = boost::dynamic_pointer_cast<RouteTimeAxisView> (tvp.first);
|
||||
(*layer) = tvp.second;
|
||||
|
||||
if (*tv && (*tv)->layer_display() == Overlaid) {
|
||||
|
@ -1177,7 +1176,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
|
|||
: RegionMotionDrag (e, i, p, v, b),
|
||||
_copy (c)
|
||||
{
|
||||
TimeAxisView* const tv = &_primary->get_time_axis_view ();
|
||||
TimeAxisViewPtr const tv = _primary->get_time_axis_view ();
|
||||
|
||||
_dest_trackview = tv;
|
||||
if (tv->layer_display() == Overlaid) {
|
||||
|
@ -1187,7 +1186,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
|
|||
}
|
||||
|
||||
double speed = 1;
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv);
|
||||
if (rtv && rtv->is_track()) {
|
||||
speed = rtv->get_diskstream()->speed ();
|
||||
}
|
||||
|
@ -1203,11 +1202,11 @@ RegionMoveDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
|
|||
_pointer_frame_offset = _grab_frame - _last_frame_position;
|
||||
}
|
||||
|
||||
RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr<Region> r, RouteTimeAxisView* v, nframes64_t pos)
|
||||
RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr<Region> r, RouteTimeAxisViewPtr v, nframes64_t pos)
|
||||
: RegionMotionDrag (e, 0, 0, list<RegionView*> (), false)
|
||||
{
|
||||
assert ((boost::dynamic_pointer_cast<AudioRegion> (r) && dynamic_cast<AudioTimeAxisView*> (v)) ||
|
||||
(boost::dynamic_pointer_cast<MidiRegion> (r) && dynamic_cast<MidiTimeAxisView*> (v)));
|
||||
assert ((boost::dynamic_pointer_cast<AudioRegion> (r) && boost::dynamic_pointer_cast<AudioTimeAxisView> (v)) ||
|
||||
(boost::dynamic_pointer_cast<MidiRegion> (r) && boost::dynamic_pointer_cast<MidiTimeAxisView> (v)));
|
||||
|
||||
_primary = v->view()->create_region_view (r, false, false);
|
||||
|
||||
|
@ -1222,10 +1221,10 @@ RegionInsertDrag::RegionInsertDrag (Editor* e, boost::shared_ptr<Region> r, Rout
|
|||
_dest_layer = _primary->region()->layer ();
|
||||
}
|
||||
|
||||
map<RegionView*, RouteTimeAxisView*>
|
||||
map<RegionView*, RouteTimeAxisViewPtr>
|
||||
RegionMotionDrag::find_time_axis_views ()
|
||||
{
|
||||
map<RegionView*, RouteTimeAxisView*> tav;
|
||||
map<RegionView*, RouteTimeAxisViewPtr> tav;
|
||||
|
||||
for (list<RegionView*>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
|
||||
|
||||
|
@ -1234,8 +1233,8 @@ RegionMotionDrag::find_time_axis_views ()
|
|||
(*i)->get_canvas_frame()->i2w (ix1, iy1);
|
||||
iy1 += _editor->vertical_adjustment.get_value() - _editor->canvas_timebars_vsize;
|
||||
|
||||
pair<TimeAxisView*, int> tv = _editor->trackview_by_y_position (iy1);
|
||||
tav[*i] = dynamic_cast<RouteTimeAxisView*> (tv.first);
|
||||
pair<TimeAxisViewPtr, int> tv = _editor->trackview_by_y_position (iy1);
|
||||
tav[*i] = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv.first);
|
||||
}
|
||||
|
||||
return tav;
|
||||
|
@ -1247,9 +1246,9 @@ RegionInsertDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
{
|
||||
_editor->update_canvas_now ();
|
||||
|
||||
map<RegionView*, RouteTimeAxisView*> final = find_time_axis_views ();
|
||||
map<RegionView*, RouteTimeAxisViewPtr> final = find_time_axis_views ();
|
||||
|
||||
RouteTimeAxisView* dest_rtv = final[_primary];
|
||||
RouteTimeAxisViewPtr dest_rtv = final[_primary];
|
||||
|
||||
_primary->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
|
||||
_primary->get_canvas_group()->property_y() = 0;
|
||||
|
@ -1282,7 +1281,7 @@ struct RegionSelectionByPosition {
|
|||
void
|
||||
RegionSpliceDrag::motion (GdkEvent* event, bool)
|
||||
{
|
||||
RouteTimeAxisView* tv;
|
||||
RouteTimeAxisViewPtr tv;
|
||||
layer_t layer;
|
||||
|
||||
if (!check_possible (&tv, &layer)) {
|
||||
|
@ -1304,7 +1303,7 @@ RegionSpliceDrag::motion (GdkEvent* event, bool)
|
|||
|
||||
for (RegionSelection::iterator i = copy.begin(); i != copy.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* atv = dynamic_cast<RouteTimeAxisView*> (&(*i)->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr atv = boost::dynamic_pointer_cast<RouteTimeAxisView> ((*i)->get_time_axis_view());
|
||||
|
||||
if (!atv) {
|
||||
continue;
|
||||
|
@ -1344,7 +1343,7 @@ RegionSpliceDrag::finished (GdkEvent* event, bool)
|
|||
}
|
||||
|
||||
|
||||
RegionCreateDrag::RegionCreateDrag (Editor* e, ArdourCanvas::Item* i, TimeAxisView* v)
|
||||
RegionCreateDrag::RegionCreateDrag (Editor* e, ArdourCanvas::Item* i, TimeAxisViewPtr v)
|
||||
: Drag (e, i),
|
||||
_view (v)
|
||||
{
|
||||
|
@ -1373,13 +1372,13 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move)
|
|||
void
|
||||
RegionCreateDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||
{
|
||||
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*> (_dest_trackview);
|
||||
MidiTimeAxisViewPtr mtv = boost::dynamic_pointer_cast<MidiTimeAxisView> (_dest_trackview);
|
||||
if (!mtv) {
|
||||
return;
|
||||
}
|
||||
|
||||
const boost::shared_ptr<MidiDiskstream> diskstream =
|
||||
boost::dynamic_pointer_cast<MidiDiskstream>(mtv->view()->trackview().track()->diskstream());
|
||||
boost::dynamic_pointer_cast<MidiDiskstream>(mtv->view()->trackview()->track()->diskstream());
|
||||
|
||||
if (!diskstream) {
|
||||
warning << "Cannot create non-MIDI region" << endl;
|
||||
|
@ -1436,8 +1435,8 @@ void
|
|||
TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
|
||||
{
|
||||
double speed = 1.0;
|
||||
TimeAxisView* tvp = &_primary->get_time_axis_view ();
|
||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
||||
TimeAxisViewPtr tvp = _primary->get_time_axis_view ();
|
||||
RouteTimeAxisViewPtr tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tvp);
|
||||
|
||||
if (tv && tv->is_track()) {
|
||||
speed = tv->get_diskstream()->speed();
|
||||
|
@ -1490,8 +1489,8 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
|||
*/
|
||||
|
||||
double speed = 1.0;
|
||||
TimeAxisView* tvp = &_primary->get_time_axis_view ();
|
||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
||||
TimeAxisViewPtr tvp = _primary->get_time_axis_view ();
|
||||
RouteTimeAxisViewPtr tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tvp);
|
||||
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
|
||||
|
||||
if (tv && tv->is_track()) {
|
||||
|
@ -2762,7 +2761,7 @@ TimeFXDrag::motion (GdkEvent* event, bool)
|
|||
}
|
||||
|
||||
if (_current_pointer_frame > rv->region()->position()) {
|
||||
rv->get_time_axis_view().show_timestretch (rv->region()->position(), _current_pointer_frame);
|
||||
rv->get_time_axis_view()->show_timestretch (rv->region()->position(), _current_pointer_frame);
|
||||
}
|
||||
|
||||
_last_pointer_frame = _current_pointer_frame;
|
||||
|
@ -2773,7 +2772,7 @@ TimeFXDrag::motion (GdkEvent* event, bool)
|
|||
void
|
||||
TimeFXDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||
{
|
||||
_primary->get_time_axis_view().hide_timestretch ();
|
||||
_primary->get_time_axis_view()->hide_timestretch ();
|
||||
|
||||
if (!movement_occurred) {
|
||||
return;
|
||||
|
@ -3240,7 +3239,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
|
|||
|
||||
case MouseRange:
|
||||
/* find the two markers on either side of the click and make the range out of it */
|
||||
_editor->selection->set (0, start, end);
|
||||
_editor->selection->set (TimeAxisViewPtr (), start, end);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -186,19 +186,19 @@ protected:
|
|||
|
||||
void copy_regions (GdkEvent *);
|
||||
bool y_movement_disallowed (int, int, int, TimeAxisViewSummary const &) const;
|
||||
std::map<RegionView*, RouteTimeAxisView*> find_time_axis_views ();
|
||||
std::map<RegionView*, RouteTimeAxisViewPtr> find_time_axis_views ();
|
||||
double compute_x_delta (GdkEvent const *, nframes64_t *);
|
||||
bool compute_y_delta (
|
||||
TimeAxisView const *, TimeAxisView*, int32_t, int32_t, TimeAxisViewSummary const &,
|
||||
TimeAxisViewConstPtr, TimeAxisViewPtr, int32_t, int32_t, TimeAxisViewSummary const &,
|
||||
int32_t *, int32_t *, int32_t *
|
||||
);
|
||||
|
||||
TimeAxisViewSummary get_time_axis_view_summary ();
|
||||
virtual bool x_move_allowed () const = 0;
|
||||
|
||||
TimeAxisView* _dest_trackview;
|
||||
TimeAxisViewPtr _dest_trackview;
|
||||
ARDOUR::layer_t _dest_layer;
|
||||
bool check_possible (RouteTimeAxisView **, ARDOUR::layer_t *);
|
||||
bool check_possible (RouteTimeAxisViewPtr *, ARDOUR::layer_t *);
|
||||
bool _brushing;
|
||||
};
|
||||
|
||||
|
@ -230,7 +230,7 @@ private:
|
|||
class RegionInsertDrag : public RegionMotionDrag
|
||||
{
|
||||
public:
|
||||
RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, nframes64_t);
|
||||
RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisViewPtr, nframes64_t);
|
||||
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
|
@ -252,15 +252,15 @@ public:
|
|||
class RegionCreateDrag : public Drag
|
||||
{
|
||||
public:
|
||||
RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisView *);
|
||||
RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisViewPtr);
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
|
||||
private:
|
||||
TimeAxisView* _view;
|
||||
TimeAxisView* _dest_trackview;
|
||||
TimeAxisViewPtr _view;
|
||||
TimeAxisViewPtr _dest_trackview;
|
||||
};
|
||||
|
||||
/** Drag of region gain */
|
||||
|
|
|
@ -99,8 +99,8 @@ Editor::export_region ()
|
|||
boost::shared_ptr<Region> r = selection->regions.front()->region();
|
||||
AudioRegion & region (dynamic_cast<AudioRegion &> (*r));
|
||||
|
||||
RouteTimeAxisView & rtv (dynamic_cast<RouteTimeAxisView &> (selection->regions.front()->get_time_axis_view()));
|
||||
AudioTrack & track (dynamic_cast<AudioTrack &> (*rtv.route()));
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (selection->regions.front()->get_time_axis_view());
|
||||
AudioTrack & track (dynamic_cast<AudioTrack &> (*rtv->route()));
|
||||
|
||||
ExportRegionDialog dialog (*this, region, track);
|
||||
dialog.set_session (session);
|
||||
|
@ -132,7 +132,7 @@ Editor::bounce_region_selection ()
|
|||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
|
||||
boost::shared_ptr<Region> region ((*i)->region());
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&(*i)->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>((*i)->get_time_axis_view());
|
||||
Track* track = dynamic_cast<Track*>(rtv->route().get());
|
||||
|
||||
InterThreadInfo itt;
|
||||
|
@ -280,9 +280,9 @@ Editor::write_audio_selection (TimeSelection& ts)
|
|||
|
||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
|
||||
AudioTimeAxisView* atv;
|
||||
AudioTimeAxisViewPtr atv;
|
||||
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) == 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(*i)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ EditorGroupTabs::reflect_tabs (list<Tab> const & tabs)
|
|||
continue;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (rtv) {
|
||||
|
||||
if (j == tabs.end()) {
|
||||
|
|
|
@ -58,7 +58,7 @@ Editor::keyboard_selection_finish (bool add)
|
|||
if (add) {
|
||||
selection->add (pending_keyboard_selection_start, end);
|
||||
} else {
|
||||
selection->set (0, pending_keyboard_selection_start, end);
|
||||
selection->set (TimeAxisViewPtr (), pending_keyboard_selection_start, end);
|
||||
}
|
||||
|
||||
have_pending_keyboard_selection = false;
|
||||
|
|
|
@ -89,9 +89,9 @@ Editor::show_editor_mixer (bool yn)
|
|||
}
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
RouteTimeAxisView* atv;
|
||||
RouteTimeAxisViewPtr atv;
|
||||
|
||||
if ((atv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) != 0) {
|
||||
r = atv->route();
|
||||
break;
|
||||
}
|
||||
|
@ -101,9 +101,9 @@ Editor::show_editor_mixer (bool yn)
|
|||
sort_track_selection ();
|
||||
|
||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
RouteTimeAxisView* atv;
|
||||
RouteTimeAxisViewPtr atv;
|
||||
|
||||
if ((atv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) != 0) {
|
||||
r = atv->route();
|
||||
break;
|
||||
}
|
||||
|
@ -183,12 +183,12 @@ Editor::create_editor_mixer ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::set_selected_mixer_strip (TimeAxisView& view)
|
||||
Editor::set_selected_mixer_strip (TimeAxisViewPtr view)
|
||||
{
|
||||
RouteTimeAxisView* at;
|
||||
RouteTimeAxisViewPtr at;
|
||||
bool created;
|
||||
|
||||
if (!session || (at = dynamic_cast<RouteTimeAxisView*>(&view)) == 0) {
|
||||
if (!session || (at = boost::dynamic_pointer_cast<RouteTimeAxisView> (view)) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -323,9 +323,9 @@ Editor::current_mixer_strip_hidden ()
|
|||
{
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* tmp;
|
||||
RouteTimeAxisViewPtr tmp;
|
||||
|
||||
if ((tmp = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||
if ((tmp = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) != 0) {
|
||||
if (tmp->route() == current_mixer_strip->route()) {
|
||||
(*i)->set_selected (false);
|
||||
break;
|
||||
|
@ -354,11 +354,11 @@ Editor::session_going_away ()
|
|||
cut_buffer->clear ();
|
||||
|
||||
clicked_regionview = 0;
|
||||
clicked_axisview = 0;
|
||||
clicked_routeview = 0;
|
||||
clicked_axisview.reset ();
|
||||
clicked_routeview.reset ();
|
||||
clicked_crossfadeview = 0;
|
||||
entered_regionview = 0;
|
||||
entered_track = 0;
|
||||
entered_track.reset ();
|
||||
last_update_frame = 0;
|
||||
_drag = 0;
|
||||
|
||||
|
|
|
@ -1104,7 +1104,7 @@ bool
|
|||
Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||
{
|
||||
nframes64_t where = event_frame (event, 0, 0);
|
||||
AutomationTimeAxisView* atv = 0;
|
||||
AutomationTimeAxisViewPtr atv;
|
||||
|
||||
/* no action if we're recording */
|
||||
|
||||
|
@ -1338,7 +1338,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
case MouseObject:
|
||||
switch (item_type) {
|
||||
case AutomationTrackItem:
|
||||
atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview);
|
||||
atv = boost::dynamic_pointer_cast<AutomationTimeAxisView>(clicked_axisview);
|
||||
if (atv) {
|
||||
atv->add_automation_event (item, event, where, event->button.y);
|
||||
}
|
||||
|
@ -1371,7 +1371,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case AutomationTrackItem:
|
||||
dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)->
|
||||
boost::dynamic_pointer_cast<AutomationTimeAxisView> (clicked_axisview)->
|
||||
add_automation_event (item, event, where, event->button.y);
|
||||
return true;
|
||||
break;
|
||||
|
@ -1575,8 +1575,13 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
|
||||
track_canvas->get_window()->set_cursor (*cursor);
|
||||
|
||||
AutomationTimeAxisView* atv;
|
||||
if ((atv = static_cast<AutomationTimeAxisView*>(item->get_data ("trackview"))) != 0) {
|
||||
AutomationTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AutomationTimeAxisView> (
|
||||
find_time_axis (
|
||||
static_cast<TimeAxisView*> (item->get_data ("trackview"))
|
||||
)
|
||||
);
|
||||
|
||||
if (atv) {
|
||||
clear_entered_track = false;
|
||||
set_entered_track (atv);
|
||||
}
|
||||
|
@ -1638,7 +1643,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
break;
|
||||
|
||||
default:
|
||||
set_entered_track (0);
|
||||
set_entered_track (TimeAxisViewPtr ());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1770,7 +1775,7 @@ gint
|
|||
Editor::left_automation_track ()
|
||||
{
|
||||
if (clear_entered_track) {
|
||||
set_entered_track (0);
|
||||
set_entered_track (TimeAxisViewPtr ());
|
||||
clear_entered_track = false;
|
||||
}
|
||||
return false;
|
||||
|
@ -1875,7 +1880,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, bool from_aut
|
|||
|
||||
if (current_stepping_trackview) {
|
||||
/* don't keep the persistent stepped trackview if the mouse moves */
|
||||
current_stepping_trackview = 0;
|
||||
current_stepping_trackview.reset ();
|
||||
step_timeout.disconnect ();
|
||||
}
|
||||
|
||||
|
@ -1959,7 +1964,7 @@ Editor::visible_order_range (int* low, int* high) const
|
|||
|
||||
for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
|
||||
if (!rtv->hidden()) {
|
||||
|
||||
|
@ -1982,8 +1987,8 @@ Editor::region_view_item_click (AudioRegionView& rv, GdkEventButton* event)
|
|||
*/
|
||||
|
||||
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
|
||||
TimeAxisView* tv = &rv.get_time_axis_view();
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
|
||||
TimeAxisViewPtr tv = rv.get_time_axis_view();
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv);
|
||||
double speed = 1.0;
|
||||
if (rtv && rtv->is_track()) {
|
||||
speed = rtv->get_diskstream()->speed();
|
||||
|
@ -2187,8 +2192,8 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left
|
|||
nframes64_t new_bound;
|
||||
|
||||
double speed = 1.0;
|
||||
TimeAxisView* tvp = clicked_axisview;
|
||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
||||
TimeAxisViewPtr tvp = clicked_axisview;
|
||||
RouteTimeAxisViewPtr tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tvp);
|
||||
|
||||
if (tv && tv->is_track()) {
|
||||
speed = tv->get_diskstream()->speed();
|
||||
|
@ -2227,8 +2232,8 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
|
|||
nframes64_t new_bound;
|
||||
|
||||
double speed = 1.0;
|
||||
TimeAxisView* tvp = clicked_axisview;
|
||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
||||
TimeAxisViewPtr tvp = clicked_axisview;
|
||||
RouteTimeAxisViewPtr tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tvp);
|
||||
|
||||
if (tv && tv->is_track()) {
|
||||
speed = tv->get_diskstream()->speed();
|
||||
|
@ -2284,8 +2289,8 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
|
|||
nframes64_t new_bound;
|
||||
|
||||
double speed = 1.0;
|
||||
TimeAxisView* tvp = clicked_axisview;
|
||||
RouteTimeAxisView* tv = dynamic_cast<RouteTimeAxisView*>(tvp);
|
||||
TimeAxisViewPtr tvp = clicked_axisview;
|
||||
RouteTimeAxisViewPtr tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tvp);
|
||||
|
||||
if (tv && tv->is_track()) {
|
||||
speed = tv->get_diskstream()->speed();
|
||||
|
@ -2513,7 +2518,7 @@ Editor::mouse_brush_insert_region (RegionView* rv, nframes64_t pos)
|
|||
return;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&rv->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (rv->get_time_axis_view());
|
||||
|
||||
if (rtv == 0 || !rtv->is_track()) {
|
||||
return;
|
||||
|
@ -2536,7 +2541,7 @@ gint
|
|||
Editor::track_height_step_timeout ()
|
||||
{
|
||||
if (get_microseconds() - last_track_height_step_timestamp < 250000) {
|
||||
current_stepping_trackview = 0;
|
||||
current_stepping_trackview.reset ();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -198,7 +198,7 @@ Editor::split_regions_at (nframes64_t where, RegionSelection& regions)
|
|||
}
|
||||
|
||||
boost::shared_ptr<Region>
|
||||
Editor::select_region_for_operation (int dir, TimeAxisView **tv)
|
||||
Editor::select_region_for_operation (int dir, TimeAxisViewPtr *tv)
|
||||
{
|
||||
RegionView* rv;
|
||||
boost::shared_ptr<Region> region;
|
||||
|
@ -217,16 +217,16 @@ Editor::select_region_for_operation (int dir, TimeAxisView **tv)
|
|||
if (!selection->regions.empty()) {
|
||||
|
||||
rv = *(selection->regions.begin());
|
||||
(*tv) = &rv->get_time_axis_view();
|
||||
(*tv) = rv->get_time_axis_view();
|
||||
region = rv->region();
|
||||
|
||||
} else if (!selection->tracks.empty()) {
|
||||
|
||||
(*tv) = selection->tracks.front();
|
||||
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> (*tv)) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*tv)) != 0) {
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
|
||||
if ((pl = rtv->playlist()) == 0) {
|
||||
|
@ -243,7 +243,7 @@ Editor::select_region_for_operation (int dir, TimeAxisView **tv)
|
|||
void
|
||||
Editor::extend_selection_to_end_of_region (bool next)
|
||||
{
|
||||
TimeAxisView *tv;
|
||||
TimeAxisViewPtr tv;
|
||||
boost::shared_ptr<Region> region;
|
||||
nframes64_t start;
|
||||
|
||||
|
@ -271,7 +271,7 @@ Editor::extend_selection_to_end_of_region (bool next)
|
|||
void
|
||||
Editor::extend_selection_to_start_of_region (bool previous)
|
||||
{
|
||||
TimeAxisView *tv;
|
||||
TimeAxisViewPtr tv;
|
||||
boost::shared_ptr<Region> region;
|
||||
nframes64_t end;
|
||||
|
||||
|
@ -608,7 +608,7 @@ Editor::build_region_boundary_cache ()
|
|||
return;
|
||||
}
|
||||
|
||||
TimeAxisView *ontrack = 0;
|
||||
TimeAxisViewPtr ontrack;
|
||||
TrackViewList tlist;
|
||||
|
||||
if (!selection->tracks.empty()) {
|
||||
|
@ -651,9 +651,9 @@ Editor::build_region_boundary_cache ()
|
|||
}
|
||||
|
||||
float speed = 1.0f;
|
||||
RouteTimeAxisView *rtav;
|
||||
RouteTimeAxisViewPtr rtav;
|
||||
|
||||
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
|
||||
if (ontrack != 0 && (rtav = boost::dynamic_pointer_cast<RouteTimeAxisView>(ontrack)) != 0 ) {
|
||||
if (rtav->get_diskstream() != 0) {
|
||||
speed = rtav->get_diskstream()->speed();
|
||||
}
|
||||
|
@ -691,7 +691,7 @@ Editor::build_region_boundary_cache ()
|
|||
}
|
||||
|
||||
boost::shared_ptr<Region>
|
||||
Editor::find_next_region (nframes64_t frame, RegionPoint point, int32_t dir, TrackViewList& tracks, TimeAxisView **ontrack)
|
||||
Editor::find_next_region (nframes64_t frame, RegionPoint point, int32_t dir, TrackViewList& tracks, TimeAxisViewPtr *ontrack)
|
||||
{
|
||||
TrackViewList::iterator i;
|
||||
nframes64_t closest = max_frames;
|
||||
|
@ -700,7 +700,7 @@ Editor::find_next_region (nframes64_t frame, RegionPoint point, int32_t dir, Tra
|
|||
|
||||
float track_speed;
|
||||
nframes64_t track_frame;
|
||||
RouteTimeAxisView *rtav;
|
||||
RouteTimeAxisViewPtr rtav;
|
||||
|
||||
for (i = tracks.begin(); i != tracks.end(); ++i) {
|
||||
|
||||
|
@ -708,7 +708,7 @@ Editor::find_next_region (nframes64_t frame, RegionPoint point, int32_t dir, Tra
|
|||
boost::shared_ptr<Region> r;
|
||||
|
||||
track_speed = 1.0f;
|
||||
if ( (rtav = dynamic_cast<RouteTimeAxisView*>(*i)) != 0 ) {
|
||||
if ( (rtav = boost::dynamic_pointer_cast<RouteTimeAxisView>(*i)) != 0 ) {
|
||||
if (rtav->get_diskstream()!=0)
|
||||
track_speed = rtav->get_diskstream()->speed();
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ Editor::find_next_region_boundary (nframes64_t pos, int32_t dir, const TrackView
|
|||
nframes64_t contender;
|
||||
nframes64_t d;
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
|
||||
if (!rtv) {
|
||||
continue;
|
||||
|
@ -866,7 +866,7 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
|
|||
return;
|
||||
}
|
||||
|
||||
TimeAxisView *ontrack = 0;
|
||||
TimeAxisViewPtr ontrack;
|
||||
|
||||
// so we don't find the current region again..
|
||||
if (dir>0 || pos>0)
|
||||
|
@ -908,9 +908,9 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t
|
|||
}
|
||||
|
||||
float speed = 1.0f;
|
||||
RouteTimeAxisView *rtav;
|
||||
RouteTimeAxisViewPtr rtav;
|
||||
|
||||
if ( ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0 ) {
|
||||
if ( ontrack != 0 && (rtav = boost::dynamic_pointer_cast<RouteTimeAxisView>(ontrack)) != 0 ) {
|
||||
if (rtav->get_diskstream() != 0) {
|
||||
speed = rtav->get_diskstream()->speed();
|
||||
}
|
||||
|
@ -1069,7 +1069,7 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
|
|||
return;
|
||||
}
|
||||
|
||||
TimeAxisView *ontrack = 0;
|
||||
TimeAxisViewPtr ontrack;
|
||||
|
||||
pos = loc->start();
|
||||
|
||||
|
@ -1105,9 +1105,9 @@ Editor::selected_marker_to_region_point (RegionPoint point, int32_t dir)
|
|||
}
|
||||
|
||||
float speed = 1.0f;
|
||||
RouteTimeAxisView *rtav;
|
||||
RouteTimeAxisViewPtr rtav;
|
||||
|
||||
if (ontrack != 0 && (rtav = dynamic_cast<RouteTimeAxisView*>(ontrack)) != 0) {
|
||||
if (ontrack != 0 && (rtav = boost::dynamic_pointer_cast<RouteTimeAxisView>(ontrack)) != 0) {
|
||||
if (rtav->get_diskstream() != 0) {
|
||||
speed = rtav->get_diskstream()->speed();
|
||||
}
|
||||
|
@ -1673,7 +1673,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
|||
nframes64_t start = max_frames;
|
||||
nframes64_t end = 0;
|
||||
RegionSelection rs;
|
||||
set<TimeAxisView*> tracks;
|
||||
set<TimeAxisViewPtr> tracks;
|
||||
|
||||
get_regions_for_action (rs);
|
||||
|
||||
|
@ -1691,7 +1691,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
|||
end = (*i)->region()->last_frame() + 1;
|
||||
}
|
||||
|
||||
tracks.insert (&((*i)->get_time_axis_view()));
|
||||
tracks.insert ((*i)->get_time_axis_view());
|
||||
}
|
||||
|
||||
/* now comes an "interesting" hack ... make sure we leave a little space
|
||||
|
@ -1740,7 +1740,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
|||
|
||||
/* set visible track heights appropriately */
|
||||
|
||||
for (set<TimeAxisView*>::iterator t = tracks.begin(); t != tracks.end(); ++t) {
|
||||
for (set<TimeAxisViewPtr>::iterator t = tracks.begin(); t != tracks.end(); ++t) {
|
||||
(*t)->set_height (per_track_height);
|
||||
}
|
||||
|
||||
|
@ -1750,7 +1750,7 @@ Editor::temporal_zoom_region (bool both_axes)
|
|||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if (find (tracks.begin(), tracks.end(), (*i)) == tracks.end()) {
|
||||
hide_track_in_display (**i, true);
|
||||
hide_track_in_display (*i, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2209,7 +2209,7 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
|
|||
double wx, wy;
|
||||
double cx, cy;
|
||||
nframes64_t where;
|
||||
RouteTimeAxisView *rtv = 0;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
boost::shared_ptr<Playlist> playlist;
|
||||
|
||||
track_canvas->window_to_world (x, y, wx, wy);
|
||||
|
@ -2228,12 +2228,12 @@ Editor::insert_region_list_drag (boost::shared_ptr<Region> region, int x, int y)
|
|||
return;
|
||||
}
|
||||
|
||||
std::pair<TimeAxisView*, int> tv = trackview_by_y_position (cy);
|
||||
std::pair<TimeAxisViewPtr, int> tv = trackview_by_y_position (cy);
|
||||
if (tv.first == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> (tv.first)) == 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv.first)) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2255,8 +2255,8 @@ Editor::insert_route_list_drag (boost::shared_ptr<Route> route, int x, int y) {
|
|||
double wx, wy;
|
||||
double cx, cy;
|
||||
nframes_t where;
|
||||
RouteTimeAxisView *dest_rtv = 0;
|
||||
RouteTimeAxisView *source_rtv = 0;
|
||||
RouteTimeAxisViewPtr dest_rtv;
|
||||
RouteTimeAxisViewPtr source_rtv;
|
||||
|
||||
track_canvas->window_to_world (x, y, wx, wy);
|
||||
wx += horizontal_adjustment.get_value();
|
||||
|
@ -2269,19 +2269,19 @@ Editor::insert_route_list_drag (boost::shared_ptr<Route> route, int x, int y) {
|
|||
|
||||
where = event_frame (&event, &cx, &cy);
|
||||
|
||||
std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (cy);
|
||||
std::pair<TimeAxisViewPtr, int> const tv = trackview_by_y_position (cy);
|
||||
if (tv.first == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dest_rtv = dynamic_cast<RouteTimeAxisView*> (tv.first)) == 0) {
|
||||
if ((dest_rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv.first)) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* use this drag source to add underlay to a track. But we really don't care
|
||||
about the Route, only the view of the route, so find it first */
|
||||
for(TrackViewList::iterator it = track_views.begin(); it != track_views.end(); ++it) {
|
||||
if((source_rtv = dynamic_cast<RouteTimeAxisView*>(*it)) == 0) {
|
||||
if((source_rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*it)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2295,17 +2295,17 @@ Editor::insert_route_list_drag (boost::shared_ptr<Route> route, int x, int y) {
|
|||
void
|
||||
Editor::insert_region_list_selection (float times)
|
||||
{
|
||||
RouteTimeAxisView *tv = 0;
|
||||
RouteTimeAxisViewPtr tv;
|
||||
boost::shared_ptr<Playlist> playlist;
|
||||
|
||||
if (clicked_routeview != 0) {
|
||||
tv = clicked_routeview;
|
||||
} else if (!selection->tracks.empty()) {
|
||||
if ((tv = dynamic_cast<RouteTimeAxisView*>(selection->tracks.front())) == 0) {
|
||||
if ((tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(selection->tracks.front())) == 0) {
|
||||
return;
|
||||
}
|
||||
} else if (entered_track != 0) {
|
||||
if ((tv = dynamic_cast<RouteTimeAxisView*>(entered_track)) == 0) {
|
||||
if ((tv = boost::dynamic_pointer_cast<RouteTimeAxisView>(entered_track)) == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -2803,7 +2803,7 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||
get_regions_for_action (rs);
|
||||
|
||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||
TimeAxisView* tv = &(*i)->get_time_axis_view();
|
||||
TimeAxisViewPtr tv = (*i)->get_time_axis_view();
|
||||
|
||||
if (find (tmptracks.begin(), tmptracks.end(), tv) == tmptracks.end()) {
|
||||
tmptracks.push_back (tv);
|
||||
|
@ -2825,9 +2825,9 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||
|
||||
for (TrackSelection::iterator i = tmptracks.begin(); i != tmptracks.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> ((*i))) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> ((*i))) != 0) {
|
||||
|
||||
if (rtv->is_track()) {
|
||||
|
||||
|
@ -2991,9 +2991,9 @@ Editor::crop_region_to (nframes64_t start, nframes64_t end)
|
|||
|
||||
for (TrackSelection::iterator i = ts->begin(); i != ts->end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> ((*i))) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> ((*i))) != 0) {
|
||||
|
||||
boost::shared_ptr<Track> t = rtv->track();
|
||||
|
||||
|
@ -3473,7 +3473,7 @@ Editor::trim_region_to_location (const Location& loc, const char* str)
|
|||
continue;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr tav = boost::dynamic_pointer_cast<RouteTimeAxisView> (rv->get_time_axis_view());
|
||||
if (!tav) {
|
||||
return;
|
||||
}
|
||||
|
@ -3518,7 +3518,7 @@ Editor::trim_region_to_edit_point ()
|
|||
continue;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr tav = boost::dynamic_pointer_cast<RouteTimeAxisView> (rv->get_time_axis_view());
|
||||
if (!tav) {
|
||||
return;
|
||||
}
|
||||
|
@ -3558,7 +3558,7 @@ Editor::trim_region_from_edit_point ()
|
|||
continue;
|
||||
}
|
||||
|
||||
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (&rv->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr tav = boost::dynamic_pointer_cast<RouteTimeAxisView> (rv->get_time_axis_view());
|
||||
if (!tav) {
|
||||
return;
|
||||
}
|
||||
|
@ -3610,7 +3610,7 @@ Editor::trim_to_region(bool forward)
|
|||
continue;
|
||||
}
|
||||
|
||||
AudioTimeAxisView* atav = dynamic_cast<AudioTimeAxisView*> (&arv->get_time_axis_view());
|
||||
AudioTimeAxisViewPtr atav = boost::dynamic_pointer_cast<AudioTimeAxisView> (arv->get_time_axis_view());
|
||||
|
||||
if (!atav) {
|
||||
return;
|
||||
|
@ -3757,9 +3757,9 @@ Editor::bounce_range_selection (bool replace, bool enable_processing)
|
|||
|
||||
for (TrackViewList::iterator i = views.begin(); i != views.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> (*i)) == 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -3934,7 +3934,7 @@ Editor::cut_copy (CutCopyOp op)
|
|||
if (!get_edit_op_range (start, end)) {
|
||||
return;
|
||||
}
|
||||
selection->set ((TimeAxisView*) 0, start, end);
|
||||
selection->set (TimeAxisViewPtr (), start, end);
|
||||
}
|
||||
|
||||
begin_reversible_command (opname + _(" range"));
|
||||
|
@ -3967,7 +3967,7 @@ Editor::cut_copy_points (CutCopyOp op)
|
|||
{
|
||||
for (PointSelection::iterator i = selection->points.begin(); i != selection->points.end(); ++i) {
|
||||
|
||||
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*>(&(*i).track);
|
||||
AutomationTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AutomationTimeAxisView>(i->track);
|
||||
|
||||
if (atv) {
|
||||
atv->cut_copy_clear_objects (selection->points, op);
|
||||
|
@ -3987,10 +3987,10 @@ struct lt_playlist {
|
|||
};
|
||||
|
||||
struct PlaylistMapping {
|
||||
TimeAxisView* tv;
|
||||
TimeAxisViewPtr tv;
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
|
||||
PlaylistMapping (TimeAxisView* tvp) : tv (tvp) {}
|
||||
PlaylistMapping (TimeAxisViewPtr tvp) : tv (tvp) {}
|
||||
};
|
||||
|
||||
/** Remove `clicked_regionview' */
|
||||
|
@ -4135,7 +4135,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
}
|
||||
}
|
||||
|
||||
TimeAxisView* tv = &(*x)->get_trackview();
|
||||
TimeAxisViewPtr tv = (*x)->get_trackview();
|
||||
vector<PlaylistMapping>::iterator z;
|
||||
|
||||
for (z = pmap.begin(); z != pmap.end(); ++z) {
|
||||
|
@ -4158,7 +4158,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
continue;
|
||||
}
|
||||
|
||||
TimeAxisView& tv = (*x)->get_trackview();
|
||||
TimeAxisViewPtr tv = (*x)->get_trackview();
|
||||
boost::shared_ptr<Playlist> npl;
|
||||
RegionSelection::iterator tmp;
|
||||
|
||||
|
@ -4168,7 +4168,7 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs)
|
|||
vector<PlaylistMapping>::iterator z;
|
||||
|
||||
for (z = pmap.begin(); z != pmap.end(); ++z) {
|
||||
if ((*z).tv == &tv) {
|
||||
if (z->tv == tv) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4337,11 +4337,11 @@ Editor::paste_named_selection (float times)
|
|||
|
||||
for (t = selection->tracks.begin(); t != selection->tracks.end(); ++t) {
|
||||
|
||||
RouteTimeAxisView* rtv;
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
boost::shared_ptr<AudioPlaylist> apl;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> (*t)) == 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*t)) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -4383,8 +4383,8 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times)
|
|||
|
||||
boost::shared_ptr<Region> r ((*i)->region());
|
||||
|
||||
TimeAxisView& tv = (*i)->get_time_axis_view();
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&tv);
|
||||
TimeAxisViewPtr tv = (*i)->get_time_axis_view();
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv);
|
||||
latest_regionviews.clear ();
|
||||
sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
|
||||
|
||||
|
@ -4451,7 +4451,7 @@ Editor::reset_point_selection ()
|
|||
|
||||
for (PointSelection::iterator i = selection->points.begin(); i != selection->points.end(); ++i) {
|
||||
|
||||
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*>(&(*i).track);
|
||||
AutomationTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AutomationTimeAxisView> (i->track);
|
||||
|
||||
if (atv) {
|
||||
atv->reset_objects (selection->points);
|
||||
|
@ -5033,7 +5033,7 @@ Editor::toggle_record_enable ()
|
|||
bool new_state = false;
|
||||
bool first = true;
|
||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
RouteTimeAxisView *rtav = dynamic_cast<RouteTimeAxisView *>(*i);
|
||||
RouteTimeAxisViewPtr rtav = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (!rtav)
|
||||
continue;
|
||||
if (!rtav->is_track())
|
||||
|
@ -5357,7 +5357,7 @@ Editor::update_region_fade_visibility ()
|
|||
bool _fade_visibility = session->config.get_show_region_fades ();
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
AudioTimeAxisView* v = dynamic_cast<AudioTimeAxisView*>(*i);
|
||||
AudioTimeAxisViewPtr v = boost::dynamic_pointer_cast<AudioTimeAxisView> (*i);
|
||||
if (v) {
|
||||
if (_fade_visibility) {
|
||||
v->audio_view()->show_all_fades ();
|
||||
|
@ -5375,7 +5375,7 @@ 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);
|
||||
AudioTimeAxisViewPtr v = boost::dynamic_pointer_cast<AudioTimeAxisView> (*i);
|
||||
if (v) {
|
||||
if (_xfade_visibility) {
|
||||
v->show_all_xfades ();
|
||||
|
@ -5483,9 +5483,9 @@ Editor::select_next_route()
|
|||
return;
|
||||
}
|
||||
|
||||
TimeAxisView* current = selection->tracks.front();
|
||||
TimeAxisViewPtr current = selection->tracks.front();
|
||||
|
||||
RouteUI *rui;
|
||||
boost::shared_ptr<RouteUI> rui;
|
||||
do {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if (*i == current) {
|
||||
|
@ -5499,8 +5499,8 @@ Editor::select_next_route()
|
|||
break;
|
||||
}
|
||||
}
|
||||
rui = dynamic_cast<RouteUI *>(current);
|
||||
} while ( current->hidden() || (rui != NULL && !rui->route()->active()));
|
||||
rui = boost::dynamic_pointer_cast<RouteUI> (current);
|
||||
} while ( current->hidden() || (rui && !rui->route()->active()));
|
||||
|
||||
selection->set(current);
|
||||
|
||||
|
@ -5515,9 +5515,9 @@ Editor::select_prev_route()
|
|||
return;
|
||||
}
|
||||
|
||||
TimeAxisView* current = selection->tracks.front();
|
||||
TimeAxisViewPtr current = selection->tracks.front();
|
||||
|
||||
RouteUI *rui;
|
||||
boost::shared_ptr<RouteUI> rui;
|
||||
do {
|
||||
for (TrackViewList::reverse_iterator i = track_views.rbegin(); i != track_views.rend(); ++i) {
|
||||
if (*i == current) {
|
||||
|
@ -5530,8 +5530,8 @@ Editor::select_prev_route()
|
|||
break;
|
||||
}
|
||||
}
|
||||
rui = dynamic_cast<RouteUI *>(current);
|
||||
} while ( current->hidden() || (rui != NULL && !rui->route()->active()));
|
||||
rui = boost::dynamic_pointer_cast<RouteUI> (current);
|
||||
} while ( current->hidden() || (rui && !rui->route()->active()));
|
||||
|
||||
selection->set (current);
|
||||
|
||||
|
@ -5539,7 +5539,7 @@ Editor::select_prev_route()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::ensure_track_visible(TimeAxisView *track)
|
||||
Editor::ensure_track_visible(TimeAxisViewPtr track)
|
||||
{
|
||||
if (track->hidden())
|
||||
return;
|
||||
|
@ -6002,7 +6002,7 @@ Editor::tab_to_transient (bool forward)
|
|||
|
||||
for (TrackSelection::iterator t = selection->tracks.begin(); t != selection->tracks.end(); ++t) {
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*t);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*t);
|
||||
|
||||
if (rtv) {
|
||||
boost::shared_ptr<Diskstream> ds = rtv->get_diskstream();
|
||||
|
@ -6110,7 +6110,7 @@ Editor::toggle_tracks_active ()
|
|||
}
|
||||
|
||||
for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(*x);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*x);
|
||||
|
||||
if (rtv) {
|
||||
if (first) {
|
||||
|
@ -6140,7 +6140,7 @@ Editor::remove_tracks ()
|
|||
vector<boost::shared_ptr<Route> > routes;
|
||||
|
||||
for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*x);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*x);
|
||||
if (rtv) {
|
||||
if (rtv->is_track()) {
|
||||
ntracks++;
|
||||
|
@ -6313,7 +6313,7 @@ Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt,
|
|||
}
|
||||
|
||||
/* automation */
|
||||
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*x);
|
||||
RouteTimeAxisViewPtr rtav = boost::dynamic_pointer_cast<RouteTimeAxisView> (*x);
|
||||
if (rtav) {
|
||||
rtav->route ()->shift (pos, frames);
|
||||
commit = true;
|
||||
|
@ -6413,7 +6413,7 @@ Editor::fit_tracks (TrackSelection & tracks)
|
|||
first_y_pos = std::min ((*t)->y_position (), first_y_pos);
|
||||
} else {
|
||||
if (prev_was_selected && next_is_selected) {
|
||||
hide_track_in_display (**t);
|
||||
hide_track_in_display (*t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ EditorRouteGroups::new_from_selection ()
|
|||
_session->add_route_group (g);
|
||||
|
||||
for (TrackSelection::iterator i = _editor->get_selection().tracks.begin(); i != _editor->get_selection().tracks.end(); ++i) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (rtv) {
|
||||
rtv->route()->set_route_group (g, this);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ EditorRouteGroups::new_from_rec_enabled ()
|
|||
_session->add_route_group (g);
|
||||
|
||||
for (Editor::TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (rtv && rtv->route()->record_enabled()) {
|
||||
rtv->route()->set_route_group (g, this);
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ EditorRouteGroups::new_from_soloed ()
|
|||
_session->add_route_group (g);
|
||||
|
||||
for (Editor::TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (rtv && !rtv->route()->is_master() && rtv->route()->soloed()) {
|
||||
rtv->route()->set_route_group (g, this);
|
||||
}
|
||||
|
@ -517,13 +517,13 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeM
|
|||
if ((*iter)[_columns.is_visible]) {
|
||||
for (Editor::TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) {
|
||||
if ((*j)->route_group() == group) {
|
||||
_editor->_routes->show_track_in_display (**j);
|
||||
_editor->_routes->show_track_in_display (*j);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (Editor::TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) {
|
||||
if ((*j)->route_group() == group) {
|
||||
_editor->hide_track_in_display (**j);
|
||||
_editor->hide_track_in_display (*j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ EditorRouteGroups::collect (RouteGroup* g)
|
|||
int coll = -1;
|
||||
while (i != routes.end() && j != _editor->get_track_views().end()) {
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*j);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*j);
|
||||
if (rtv) {
|
||||
|
||||
boost::shared_ptr<Route> r = rtv->route ();
|
||||
|
|
|
@ -122,8 +122,8 @@ EditorRoutes::on_tv_rec_enable_toggled (Glib::ustring const & path_string)
|
|||
// Get the model row that has been toggled.
|
||||
Gtk::TreeModel::Row row = *_model->get_iter (Gtk::TreeModel::Path (path_string));
|
||||
|
||||
TimeAxisView *tv = row[_columns.tv];
|
||||
AudioTimeAxisView *atv = dynamic_cast<AudioTimeAxisView*> (tv);
|
||||
TimeAxisViewPtr tv = row[_columns.tv];
|
||||
AudioTimeAxisViewPtr atv = boost::dynamic_pointer_cast<AudioTimeAxisView> (tv);
|
||||
|
||||
if (atv != 0 && atv->is_audio_track()){
|
||||
atv->get_diskstream()->set_record_enabled(!atv->get_diskstream()->record_enabled());
|
||||
|
@ -173,7 +173,7 @@ EditorRoutes::redisplay ()
|
|||
}
|
||||
|
||||
for (n = 0, position = 0, i = rows.begin(); i != rows.end(); ++i) {
|
||||
TimeAxisView *tv = (*i)[_columns.tv];
|
||||
TimeAxisViewPtr tv = (*i)[_columns.tv];
|
||||
boost::shared_ptr<Route> route = (*i)[_columns.route];
|
||||
|
||||
if (tv == 0) {
|
||||
|
@ -192,7 +192,7 @@ EditorRoutes::redisplay ()
|
|||
|
||||
bool visible = (*i)[_columns.visible];
|
||||
|
||||
/* show or hide the TimeAxisView */
|
||||
/* show or hide the TimeAxisViewPtr */
|
||||
if (visible) {
|
||||
tv->set_marked_for_display (true);
|
||||
position += tv->show_at (position, n, &_editor->edit_controls_vbox);
|
||||
|
@ -250,14 +250,14 @@ EditorRoutes::changed (Gtk::TreeModel::Path const & path, Gtk::TreeModel::iterat
|
|||
}
|
||||
|
||||
void
|
||||
EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
|
||||
EditorRoutes::routes_added (list<RouteTimeAxisViewPtr> routes)
|
||||
{
|
||||
TreeModel::Row row;
|
||||
|
||||
_redisplay_does_not_sync_order_keys = true;
|
||||
suspend_redisplay ();
|
||||
|
||||
for (list<RouteTimeAxisView*>::iterator x = routes.begin(); x != routes.end(); ++x) {
|
||||
for (list<RouteTimeAxisViewPtr>::iterator x = routes.begin(); x != routes.end(); ++x) {
|
||||
|
||||
row = *(_model->append ());
|
||||
|
||||
|
@ -310,7 +310,7 @@ EditorRoutes::handle_gui_changes (string const & what, void *src)
|
|||
}
|
||||
|
||||
void
|
||||
EditorRoutes::route_removed (TimeAxisView *tv)
|
||||
EditorRoutes::route_removed (TimeAxisViewPtr tv)
|
||||
{
|
||||
ENSURE_GUI_THREAD (bind (mem_fun(*this, &EditorRoutes::route_removed), tv));
|
||||
|
||||
|
@ -324,7 +324,8 @@ EditorRoutes::route_removed (TimeAxisView *tv)
|
|||
_redisplay_does_not_sync_order_keys = true;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
if ((*ri)[_columns.tv] == tv) {
|
||||
TimeAxisViewPtr t = (*ri)[_columns.tv];
|
||||
if (t == tv) {
|
||||
_model->erase (ri);
|
||||
break;
|
||||
}
|
||||
|
@ -364,7 +365,7 @@ EditorRoutes::update_visibility ()
|
|||
suspend_redisplay ();
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
TimeAxisView *tv = (*i)[_columns.tv];
|
||||
TimeAxisViewPtr tv = (*i)[_columns.tv];
|
||||
(*i)[_columns.visible] = tv->marked_for_display ();
|
||||
cerr << "marked " << tv->name() << " for display = " << tv->marked_for_display() << endl;
|
||||
}
|
||||
|
@ -373,13 +374,14 @@ EditorRoutes::update_visibility ()
|
|||
}
|
||||
|
||||
void
|
||||
EditorRoutes::hide_track_in_display (TimeAxisView& tv)
|
||||
EditorRoutes::hide_track_in_display (TimeAxisViewPtr tv)
|
||||
{
|
||||
TreeModel::Children rows = _model->children();
|
||||
TreeModel::Children::iterator i;
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
if ((*i)[_columns.tv] == &tv) {
|
||||
TimeAxisViewPtr t = (*i)[_columns.tv];
|
||||
if (t == tv) {
|
||||
(*i)[_columns.visible] = false;
|
||||
break;
|
||||
}
|
||||
|
@ -387,13 +389,14 @@ EditorRoutes::hide_track_in_display (TimeAxisView& tv)
|
|||
}
|
||||
|
||||
void
|
||||
EditorRoutes::show_track_in_display (TimeAxisView& tv)
|
||||
EditorRoutes::show_track_in_display (TimeAxisViewPtr tv)
|
||||
{
|
||||
TreeModel::Children rows = _model->children();
|
||||
TreeModel::Children::iterator i;
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
if ((*i)[_columns.tv] == &tv) {
|
||||
TimeAxisViewPtr t = (*i)[_columns.tv];
|
||||
if (t == tv) {
|
||||
(*i)[_columns.visible] = true;
|
||||
break;
|
||||
}
|
||||
|
@ -459,7 +462,7 @@ EditorRoutes::hide_all_tracks (bool with_select)
|
|||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
|
||||
TreeModel::Row row = (*i);
|
||||
TimeAxisView *tv = row[_columns.tv];
|
||||
TimeAxisViewPtr tv = row[_columns.tv];
|
||||
|
||||
if (tv == 0) {
|
||||
continue;
|
||||
|
@ -488,7 +491,7 @@ EditorRoutes::set_all_tracks_visibility (bool yn)
|
|||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
|
||||
TreeModel::Row row = (*i);
|
||||
TimeAxisView* tv = row[_columns.tv];
|
||||
TimeAxisViewPtr tv = row[_columns.tv];
|
||||
|
||||
if (tv == 0) {
|
||||
continue;
|
||||
|
@ -510,14 +513,14 @@ EditorRoutes::set_all_audio_visibility (int tracks, bool yn)
|
|||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
TreeModel::Row row = (*i);
|
||||
TimeAxisView* tv = row[_columns.tv];
|
||||
AudioTimeAxisView* atv;
|
||||
TimeAxisViewPtr tv = row[_columns.tv];
|
||||
AudioTimeAxisViewPtr atv;
|
||||
|
||||
if (tv == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
|
||||
if ((atv = boost::dynamic_pointer_cast<AudioTimeAxisView>(tv)) != 0) {
|
||||
switch (tracks) {
|
||||
case 0:
|
||||
(*i)[_columns.visible] = yn;
|
||||
|
@ -600,7 +603,7 @@ EditorRoutes::button_press (GdkEventButton* ev)
|
|||
return false;
|
||||
case 1:
|
||||
if ((iter = _model->get_iter (path))) {
|
||||
TimeAxisView* tv = (*iter)[_columns.tv];
|
||||
TimeAxisViewPtr tv = (*iter)[_columns.tv];
|
||||
if (tv) {
|
||||
bool visible = (*iter)[_columns.visible];
|
||||
(*iter)[_columns.visible] = !visible;
|
||||
|
@ -656,10 +659,10 @@ EditorRoutes::initial_display ()
|
|||
_no_redisplay = true;
|
||||
|
||||
for (i = rows.begin(); i != rows.end(); ++i) {
|
||||
TimeAxisView *tv = (*i)[_columns.tv];
|
||||
RouteTimeAxisView *rtv;
|
||||
TimeAxisViewPtr tv = (*i)[_columns.tv];
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(tv)) != 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView>(tv)) != 0) {
|
||||
if (rtv->route()->is_master()) {
|
||||
_display.get_selection()->unselect (i);
|
||||
}
|
||||
|
@ -703,14 +706,14 @@ EditorRoutes::move_selected_tracks (bool up)
|
|||
return;
|
||||
}
|
||||
|
||||
typedef std::pair<TimeAxisView*,boost::shared_ptr<Route> > ViewRoute;
|
||||
typedef std::pair<TimeAxisViewPtr,boost::shared_ptr<Route> > ViewRoute;
|
||||
std::list<ViewRoute> view_routes;
|
||||
std::vector<int> neworder;
|
||||
TreeModel::Children rows = _model->children();
|
||||
TreeModel::Children::iterator ri;
|
||||
|
||||
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
||||
TimeAxisView* tv = (*ri)[_columns.tv];
|
||||
TimeAxisViewPtr tv = (*ri)[_columns.tv];
|
||||
boost::shared_ptr<Route> route = (*ri)[_columns.route];
|
||||
|
||||
view_routes.push_back (ViewRoute (tv, route));
|
||||
|
@ -828,10 +831,10 @@ EditorRoutes::update_rec_display ()
|
|||
}
|
||||
}
|
||||
|
||||
list<TimeAxisView*>
|
||||
list<TimeAxisViewPtr>
|
||||
EditorRoutes::views () const
|
||||
{
|
||||
list<TimeAxisView*> v;
|
||||
list<TimeAxisViewPtr> v;
|
||||
for (TreeModel::Children::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
|
||||
v.push_back ((*i)[_columns.tv]);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
}
|
||||
|
||||
void move_selected_tracks (bool);
|
||||
void show_track_in_display (TimeAxisView &);
|
||||
void show_track_in_display (TimeAxisViewPtr);
|
||||
void suspend_redisplay () {
|
||||
_no_redisplay = true;
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ public:
|
|||
}
|
||||
void redisplay ();
|
||||
void update_visibility ();
|
||||
void routes_added (std::list<RouteTimeAxisView*> routes);
|
||||
void hide_track_in_display (TimeAxisView &);
|
||||
std::list<TimeAxisView*> views () const;
|
||||
void routes_added (std::list<RouteTimeAxisViewPtr> routes);
|
||||
void hide_track_in_display (TimeAxisViewPtr);
|
||||
std::list<TimeAxisViewPtr> views () const;
|
||||
void hide_all_tracks (bool);
|
||||
void clear ();
|
||||
void sync_order_keys (std::string const &);
|
||||
|
@ -57,7 +57,7 @@ private:
|
|||
void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
|
||||
bool button_press (GdkEventButton *);
|
||||
void route_name_changed (boost::weak_ptr<ARDOUR::Route>);
|
||||
void route_removed (TimeAxisView *);
|
||||
void route_removed (TimeAxisViewPtr);
|
||||
void handle_gui_changes (std::string const &, void *);
|
||||
void update_rec_display ();
|
||||
void set_all_tracks_visibility (bool);
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
Gtk::TreeModelColumn<bool> visible;
|
||||
Gtk::TreeModelColumn<bool> rec_enabled;
|
||||
Gtk::TreeModelColumn<bool> is_track;
|
||||
Gtk::TreeModelColumn<TimeAxisView*> tv;
|
||||
Gtk::TreeModelColumn<TimeAxisViewPtr> tv;
|
||||
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
||||
};
|
||||
|
||||
|
|
|
@ -755,7 +755,7 @@ Editor::update_ruler_visibility ()
|
|||
}
|
||||
|
||||
gdouble bottom_track_pos = vertical_adjustment.get_value() + _canvas_height - canvas_timebars_vsize;
|
||||
std::pair<TimeAxisView*, int> const p = trackview_by_y_position (bottom_track_pos);
|
||||
std::pair<TimeAxisViewPtr, int> const p = trackview_by_y_position (bottom_track_pos);
|
||||
if (p.first) {
|
||||
p.first->clip_to_viewport ();
|
||||
}
|
||||
|
|
|
@ -49,23 +49,23 @@ using namespace Editing;
|
|||
|
||||
struct TrackViewByPositionSorter
|
||||
{
|
||||
bool operator() (const TimeAxisView* a, const TimeAxisView *b) {
|
||||
bool operator() (const TimeAxisViewPtr a, const TimeAxisViewPtr b) {
|
||||
return a->y_position() < b->y_position();
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
Editor::extend_selection_to_track (TimeAxisView& view)
|
||||
Editor::extend_selection_to_track (TimeAxisViewPtr view)
|
||||
{
|
||||
if (selection->selected (&view)) {
|
||||
if (selection->selected (view)) {
|
||||
/* already selected, do nothing */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (selection->tracks.empty()) {
|
||||
|
||||
if (!selection->selected (&view)) {
|
||||
selection->set (&view);
|
||||
if (!selection->selected (view)) {
|
||||
selection->set (view);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -82,15 +82,15 @@ Editor::extend_selection_to_track (TimeAxisView& view)
|
|||
|
||||
sorted.sort (cmp);
|
||||
|
||||
if (!selection->selected (&view)) {
|
||||
to_be_added.push_back (&view);
|
||||
if (!selection->selected (view)) {
|
||||
to_be_added.push_back (view);
|
||||
}
|
||||
|
||||
/* figure out if we should go forward or backwards */
|
||||
|
||||
for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
|
||||
|
||||
if ((*i) == &view) {
|
||||
if (*i == view) {
|
||||
passed_clicked = true;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ Editor::extend_selection_to_track (TimeAxisView& view)
|
|||
|
||||
for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
|
||||
|
||||
if ((*i) == &view) {
|
||||
if (*i == view) {
|
||||
passed_clicked = true;
|
||||
continue;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ Editor::extend_selection_to_track (TimeAxisView& view)
|
|||
|
||||
for (TrackViewList::reverse_iterator r = sorted.rbegin(); r != sorted.rend(); ++r) {
|
||||
|
||||
if ((*r) == &view) {
|
||||
if (*r == view) {
|
||||
passed_clicked = true;
|
||||
continue;
|
||||
}
|
||||
|
@ -180,36 +180,36 @@ Editor::set_selected_track_as_side_effect (bool force)
|
|||
|
||||
if (!selection->tracks.empty()) {
|
||||
if (!selection->selected (clicked_routeview)) {
|
||||
selection->add (clicked_routeview);
|
||||
selection->add (boost::static_pointer_cast<TimeAxisView> (clicked_routeview));
|
||||
}
|
||||
|
||||
} else if (force) {
|
||||
selection->set (clicked_routeview);
|
||||
selection->set (boost::static_pointer_cast<TimeAxisView> (clicked_routeview));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no_remove)
|
||||
Editor::set_selected_track (TimeAxisViewPtr view, Selection::Operation op, bool no_remove)
|
||||
{
|
||||
switch (op) {
|
||||
case Selection::Toggle:
|
||||
if (selection->selected (&view)) {
|
||||
if (selection->selected (view)) {
|
||||
if (!no_remove) {
|
||||
selection->remove (&view);
|
||||
selection->remove (view);
|
||||
}
|
||||
} else {
|
||||
selection->add (&view);
|
||||
selection->add (view);
|
||||
}
|
||||
break;
|
||||
|
||||
case Selection::Add:
|
||||
if (!selection->selected (&view)) {
|
||||
selection->add (&view);
|
||||
if (!selection->selected (view)) {
|
||||
selection->add (view);
|
||||
}
|
||||
break;
|
||||
|
||||
case Selection::Set:
|
||||
selection->set (&view);
|
||||
selection->set (view);
|
||||
break;
|
||||
|
||||
case Selection::Extend:
|
||||
|
@ -229,7 +229,7 @@ Editor::set_selected_track_from_click (bool press, Selection::Operation op, bool
|
|||
return;
|
||||
}
|
||||
|
||||
set_selected_track (*clicked_routeview, op, no_remove);
|
||||
set_selected_track (clicked_routeview, op, no_remove);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -269,7 +269,7 @@ Editor::get_onscreen_tracks (TrackViewList& tvl)
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::get_equivalent_tracks (RouteTimeAxisView* basis, set<RouteTimeAxisView*> & equivs, RouteGroup::Property prop) const
|
||||
Editor::get_equivalent_tracks (RouteTimeAxisViewPtr basis, set<RouteTimeAxisViewPtr> & equivs, RouteGroup::Property prop) const
|
||||
{
|
||||
equivs.insert (basis);
|
||||
|
||||
|
@ -280,7 +280,7 @@ Editor::get_equivalent_tracks (RouteTimeAxisView* basis, set<RouteTimeAxisView*>
|
|||
properties; find other members */
|
||||
|
||||
for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
RouteTimeAxisView* v = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||
RouteTimeAxisViewPtr v = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i);
|
||||
if (v && v->route()->route_group() == group) {
|
||||
equivs.insert (v);
|
||||
}
|
||||
|
@ -294,10 +294,10 @@ Editor::get_equivalent_tracks (RouteTimeAxisView* basis, set<RouteTimeAxisView*>
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::get_relevant_tracks (set<RouteTimeAxisView*>& relevant_tracks) const
|
||||
Editor::get_relevant_tracks (set<RouteTimeAxisViewPtr>& relevant_tracks) const
|
||||
{
|
||||
for (TrackSelection::iterator ti = selection->tracks.begin(); ti != selection->tracks.end(); ++ti) {
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*ti);
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*ti);
|
||||
if (rtv) {
|
||||
get_equivalent_tracks (rtv, relevant_tracks, RouteGroup::Select);
|
||||
}
|
||||
|
@ -313,37 +313,37 @@ Editor::get_relevant_tracks (set<RouteTimeAxisView*>& relevant_tracks) const
|
|||
*/
|
||||
|
||||
void
|
||||
Editor::mapover_tracks (slot<void, RouteTimeAxisView&, uint32_t> sl, TimeAxisView* basis, RouteGroup::Property prop) const
|
||||
Editor::mapover_tracks (slot<void, RouteTimeAxisViewPtr, uint32_t> sl, TimeAxisViewPtr basis, RouteGroup::Property prop) const
|
||||
{
|
||||
RouteTimeAxisView* route_basis = dynamic_cast<RouteTimeAxisView*> (basis);
|
||||
RouteTimeAxisViewPtr route_basis = boost::dynamic_pointer_cast<RouteTimeAxisView> (basis);
|
||||
if (route_basis == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
set<RouteTimeAxisView*> tracks;
|
||||
set<RouteTimeAxisViewPtr> tracks;
|
||||
get_equivalent_tracks (route_basis, tracks, prop);
|
||||
|
||||
/* call the slots */
|
||||
uint32_t const sz = tracks.size ();
|
||||
for (set<RouteTimeAxisView*>::iterator i = tracks.begin(); i != tracks.end(); ++i) {
|
||||
sl (**i, sz);
|
||||
for (set<RouteTimeAxisViewPtr>::iterator i = tracks.begin(); i != tracks.end(); ++i) {
|
||||
sl (*i, sz);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t ignored, RegionView * basis, vector<RegionView*>* all_equivs) const
|
||||
Editor::mapped_get_equivalent_regions (RouteTimeAxisViewPtr tv, uint32_t ignored, RegionView * basis, vector<RegionView*>* all_equivs) const
|
||||
{
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
vector<boost::shared_ptr<Region> > results;
|
||||
RegionView* marv;
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
|
||||
if ((ds = tv.get_diskstream()) == 0) {
|
||||
if ((ds = tv->get_diskstream()) == 0) {
|
||||
/* bus */
|
||||
return;
|
||||
}
|
||||
|
||||
if (&tv == &basis->get_time_axis_view()) {
|
||||
if (tv == basis->get_time_axis_view()) {
|
||||
/* looking in same track as the original */
|
||||
return;
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t ignored,
|
|||
}
|
||||
|
||||
for (vector<boost::shared_ptr<Region> >::iterator ir = results.begin(); ir != results.end(); ++ir) {
|
||||
if ((marv = tv.view()->find_view (*ir)) != 0) {
|
||||
if ((marv = tv->view()->find_view (*ir)) != 0) {
|
||||
all_equivs->push_back (marv);
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t ignored,
|
|||
void
|
||||
Editor::get_equivalent_regions (RegionView* basis, vector<RegionView*>& equivalent_regions, RouteGroup::Property prop) const
|
||||
{
|
||||
mapover_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), &basis->get_trackview(), prop);
|
||||
mapover_tracks (bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), basis, &equivalent_regions), basis->get_trackview(), prop);
|
||||
|
||||
/* add clicked regionview since we skipped all other regions in the same track as the one it was in */
|
||||
|
||||
|
@ -377,10 +377,9 @@ Editor::get_equivalent_regions (RegionSelection & basis, RouteGroup::Property pr
|
|||
for (RegionSelection::const_iterator i = basis.begin(); i != basis.end(); ++i) {
|
||||
|
||||
vector<RegionView*> eq;
|
||||
|
||||
|
||||
mapover_tracks (
|
||||
bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), *i, &eq),
|
||||
&(*i)->get_trackview(), prop
|
||||
bind (mem_fun (*this, &Editor::mapped_get_equivalent_regions), *i, &eq), (*i)->get_trackview(), prop
|
||||
);
|
||||
|
||||
for (vector<RegionView*>::iterator j = eq.begin(); j != eq.end(); ++j) {
|
||||
|
@ -401,9 +400,9 @@ Editor::get_regionview_count_from_region_list (boost::shared_ptr<Region> region)
|
|||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
|
||||
RouteTimeAxisView* tatv;
|
||||
RouteTimeAxisViewPtr tatv;
|
||||
|
||||
if ((tatv = dynamic_cast<RouteTimeAxisView*> (*i)) != 0) {
|
||||
if ((tatv = boost::dynamic_pointer_cast<RouteTimeAxisView> (*i)) != 0) {
|
||||
|
||||
boost::shared_ptr<Playlist> pl;
|
||||
vector<boost::shared_ptr<Region> > results;
|
||||
|
@ -530,7 +529,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
first_frame = max_frames;
|
||||
|
||||
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
|
||||
if (&(*x)->get_time_axis_view() == &clicked_regionview->get_time_axis_view()) {
|
||||
if ((*x)->get_time_axis_view() == clicked_regionview->get_time_axis_view()) {
|
||||
|
||||
if ((*x)->region()->last_frame() > last_frame) {
|
||||
last_frame = (*x)->region()->last_frame();
|
||||
|
@ -610,8 +609,8 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
|
||||
/* 2. find all the tracks we should select in */
|
||||
|
||||
set<RouteTimeAxisView*> relevant_tracks;
|
||||
set<RouteTimeAxisView*> already_in_selection;
|
||||
set<RouteTimeAxisViewPtr> relevant_tracks;
|
||||
set<RouteTimeAxisViewPtr> already_in_selection;
|
||||
|
||||
get_relevant_tracks (relevant_tracks);
|
||||
|
||||
|
@ -625,7 +624,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
|
||||
if (!selection->selected (entered_regionview)) {
|
||||
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&entered_regionview->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (entered_regionview->get_time_axis_view());
|
||||
|
||||
if (rtv) {
|
||||
|
||||
|
@ -637,17 +636,17 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
already a selected region.
|
||||
*/
|
||||
|
||||
RouteTimeAxisView* closest = 0;
|
||||
RouteTimeAxisViewPtr closest;
|
||||
int distance = INT_MAX;
|
||||
int key = rtv->route()->order_key ("editor");
|
||||
|
||||
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
|
||||
|
||||
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(&(*x)->get_time_axis_view());
|
||||
RouteTimeAxisViewPtr artv = boost::dynamic_pointer_cast<RouteTimeAxisView>((*x)->get_time_axis_view());
|
||||
|
||||
if (artv && artv != rtv) {
|
||||
|
||||
pair<set<RouteTimeAxisView*>::iterator,bool> result;
|
||||
pair<set<RouteTimeAxisViewPtr>::iterator,bool> result;
|
||||
|
||||
result = already_in_selection.insert (artv);
|
||||
|
||||
|
@ -678,7 +677,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
}
|
||||
|
||||
for (TrackViewList::iterator x = track_views.begin(); x != track_views.end(); ++x) {
|
||||
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(*x);
|
||||
RouteTimeAxisViewPtr artv = boost::dynamic_pointer_cast<RouteTimeAxisView>(*x);
|
||||
if (artv && artv != rtv) {
|
||||
|
||||
int k = artv->route()->order_key ("editor");
|
||||
|
@ -711,7 +710,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
|
|||
|
||||
get_relevant_tracks (relevant_tracks);
|
||||
|
||||
for (set<RouteTimeAxisView*>::iterator t = relevant_tracks.begin(); t != relevant_tracks.end(); ++t) {
|
||||
for (set<RouteTimeAxisViewPtr>::iterator t = relevant_tracks.begin(); t != relevant_tracks.end(); ++t) {
|
||||
(*t)->get_selectables (first_frame, last_frame, -1.0, -1.0, results);
|
||||
}
|
||||
|
||||
|
@ -808,7 +807,7 @@ Editor::track_selection_changed ()
|
|||
case 0:
|
||||
break;
|
||||
default:
|
||||
set_selected_mixer_strip (*(selection->tracks.front()));
|
||||
set_selected_mixer_strip (selection->tracks.front());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1061,7 +1060,7 @@ Editor::set_selection_from_region ()
|
|||
return;
|
||||
}
|
||||
|
||||
selection->set (0, selection->regions.start(), selection->regions.end_frame());
|
||||
selection->set (TimeAxisViewPtr (), selection->regions.start(), selection->regions.end_frame());
|
||||
if (!Profile->get_sae()) {
|
||||
set_mouse_mode (Editing::MouseRange, false);
|
||||
}
|
||||
|
@ -1094,7 +1093,7 @@ void
|
|||
Editor::set_selection_from_range (Location& loc)
|
||||
{
|
||||
begin_reversible_command (_("set selection from range"));
|
||||
selection->set (0, loc.start(), loc.end());
|
||||
selection->set (TimeAxisViewPtr (), loc.start(), loc.end());
|
||||
commit_reversible_command ();
|
||||
|
||||
if (!Profile->get_sae()) {
|
||||
|
@ -1321,7 +1320,7 @@ Editor::select_range_between ()
|
|||
}
|
||||
|
||||
set_mouse_mode (MouseRange);
|
||||
selection->set ((TimeAxisView*) 0, start, end);
|
||||
selection->set (TimeAxisViewPtr (), start, end);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -70,9 +70,10 @@ Editor::time_stretch (RegionSelection& regions, float fraction)
|
|||
return time_fx (regions, fraction, false);
|
||||
} else {
|
||||
// MIDI, just stretch
|
||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (®ions.front()->get_time_axis_view());
|
||||
if (!rtv)
|
||||
RouteTimeAxisViewPtr rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (regions.front()->get_time_axis_view());
|
||||
if (!rtv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Playlist> playlist
|
||||
= rtv->track()->diskstream()->playlist();
|
||||
|
@ -262,14 +263,14 @@ Editor::do_timefx (TimeFXDialog& dialog)
|
|||
}
|
||||
|
||||
boost::shared_ptr<AudioRegion> region (arv->audio_region());
|
||||
TimeAxisView* tv = &(arv->get_time_axis_view());
|
||||
RouteTimeAxisView* rtv;
|
||||
TimeAxisViewPtr tv = arv->get_time_axis_view();
|
||||
RouteTimeAxisViewPtr rtv;
|
||||
RegionSelection::iterator tmp;
|
||||
|
||||
tmp = i;
|
||||
++tmp;
|
||||
|
||||
if ((rtv = dynamic_cast<RouteTimeAxisView*> (tv)) == 0) {
|
||||
if ((rtv = boost::dynamic_pointer_cast<RouteTimeAxisView> (tv)) == 0) {
|
||||
i = tmp;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ using namespace Editing;
|
|||
using namespace ArdourCanvas;
|
||||
using namespace ARDOUR;
|
||||
|
||||
GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos)
|
||||
GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_pos)
|
||||
: trackview (tv)
|
||||
, source_trackview (source_tv)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi
|
|||
base_rect = new ArdourCanvas::SimpleRect (*group);
|
||||
base_rect->property_x1() = (double) 0.0;
|
||||
base_rect->property_y1() = (double) 0.0;
|
||||
base_rect->property_y2() = (double) trackview.current_height();
|
||||
base_rect->property_y2() = (double) trackview->current_height();
|
||||
base_rect->property_outline_what() = (guint32) 0;
|
||||
|
||||
if (!is_automation_ghost()) {
|
||||
|
@ -75,7 +75,7 @@ GhostRegion::set_duration (double units)
|
|||
void
|
||||
GhostRegion::set_height ()
|
||||
{
|
||||
base_rect->property_y2() = (double) trackview.current_height();
|
||||
base_rect->property_y2() = (double) trackview->current_height();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -89,7 +89,7 @@ GhostRegion::set_colors ()
|
|||
|
||||
guint
|
||||
GhostRegion::source_track_color(unsigned char alpha) {
|
||||
Gdk::Color color = source_trackview.color();
|
||||
Gdk::Color color = source_trackview->color();
|
||||
unsigned char r,g,b ;
|
||||
r = color.get_red()/256;
|
||||
g = color.get_green()/256;
|
||||
|
@ -99,11 +99,11 @@ GhostRegion::source_track_color(unsigned char alpha) {
|
|||
|
||||
bool
|
||||
GhostRegion::is_automation_ghost() {
|
||||
return (dynamic_cast<AutomationTimeAxisView*>(&trackview)) != 0;
|
||||
return (boost::dynamic_pointer_cast<AutomationTimeAxisViewPtr> (trackview)) != 0;
|
||||
}
|
||||
|
||||
AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
|
||||
: GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) {
|
||||
AudioGhostRegion::AudioGhostRegion(TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_unit_pos)
|
||||
: GhostRegion(tv->ghost_group(), tv, source_tv, initial_unit_pos) {
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -123,10 +123,10 @@ AudioGhostRegion::set_height ()
|
|||
|
||||
GhostRegion::set_height();
|
||||
|
||||
ht = ((trackview.current_height()) / (double) waves.size());
|
||||
ht = ((trackview->current_height()) / (double) waves.size());
|
||||
|
||||
for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
|
||||
gdouble yoff = n * ht;
|
||||
gdouble const yoff = n * ht;
|
||||
(*i)->property_height() = ht;
|
||||
(*i)->property_y() = yoff;
|
||||
}
|
||||
|
@ -158,14 +158,14 @@ AudioGhostRegion::set_colors ()
|
|||
* a midistreamview. But what to do when positioning the midi ghost here? For example, there is
|
||||
* no range controller in these tracks. maybe show the whole range.
|
||||
*/
|
||||
MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
|
||||
: GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
|
||||
MidiGhostRegion::MidiGhostRegion(TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_unit_pos)
|
||||
: GhostRegion (tv->ghost_group(), tv, source_tv, initial_unit_pos)
|
||||
{
|
||||
|
||||
base_rect->lower_to_bottom();
|
||||
}
|
||||
|
||||
MidiGhostRegion::MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos)
|
||||
MidiGhostRegion::MidiGhostRegion(MidiStreamView& msv, TimeAxisViewPtr source_tv, double initial_unit_pos)
|
||||
: GhostRegion(msv.midi_underlay_group, msv.trackview(), source_tv, initial_unit_pos)
|
||||
{
|
||||
base_rect->lower_to_bottom();
|
||||
|
@ -222,9 +222,9 @@ MidiGhostRegion::set_samples_per_unit (double spu)
|
|||
MidiStreamView*
|
||||
MidiGhostRegion::midi_view()
|
||||
{
|
||||
MidiTimeAxisView* mtv;
|
||||
MidiTimeAxisViewPtr mtv;
|
||||
|
||||
if ((mtv = dynamic_cast<MidiTimeAxisView*>(&trackview)) != 0) {
|
||||
if ((mtv = boost::dynamic_pointer_cast<MidiTimeAxisView> (trackview)) != 0) {
|
||||
return mtv->midi_view();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -40,7 +40,7 @@ class TimeAxisView;
|
|||
class GhostRegion : public sigc::trackable
|
||||
{
|
||||
public:
|
||||
GhostRegion(ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
|
||||
GhostRegion(ArdourCanvas::Group* parent, TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_unit_pos);
|
||||
virtual ~GhostRegion();
|
||||
|
||||
virtual void set_samples_per_unit(double spu) = 0;
|
||||
|
@ -54,15 +54,15 @@ public:
|
|||
|
||||
sigc::signal<void,GhostRegion*> GoingAway;
|
||||
|
||||
TimeAxisView& trackview;
|
||||
TimeAxisView& source_trackview;
|
||||
TimeAxisViewPtr trackview;
|
||||
TimeAxisViewPtr source_trackview;
|
||||
ArdourCanvas::Group* group;
|
||||
ArdourCanvas::SimpleRect* base_rect;
|
||||
};
|
||||
|
||||
class AudioGhostRegion : public GhostRegion {
|
||||
public:
|
||||
AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
|
||||
AudioGhostRegion(TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_unit_pos);
|
||||
|
||||
void set_samples_per_unit(double spu);
|
||||
void set_height();
|
||||
|
@ -100,8 +100,8 @@ public:
|
|||
ArdourCanvas::Diamond* diamond;
|
||||
};
|
||||
|
||||
MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
|
||||
MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos);
|
||||
MidiGhostRegion(TimeAxisViewPtr tv, TimeAxisViewPtr source_tv, double initial_unit_pos);
|
||||
MidiGhostRegion(MidiStreamView& msv, TimeAxisViewPtr source_tv, double initial_unit_pos);
|
||||
~MidiGhostRegion();
|
||||
|
||||
MidiStreamView* midi_view();
|
||||
|
|
|
@ -65,7 +65,7 @@ using namespace PBD;
|
|||
using namespace Editing;
|
||||
using namespace ArdourCanvas;
|
||||
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisViewPtr tv,
|
||||
boost::shared_ptr<MidiRegion> r, double spu, Gdk::Color const & basic_color)
|
||||
: RegionView (parent, tv, r, spu, basic_color)
|
||||
, _force_channel(-1)
|
||||
|
@ -84,7 +84,7 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
|
|||
_note_group->raise_to_top();
|
||||
}
|
||||
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisViewPtr tv,
|
||||
boost::shared_ptr<MidiRegion> r, double spu, Gdk::Color& basic_color,
|
||||
TimeAxisViewItem::Visibility visibility)
|
||||
: RegionView (parent, tv, r, spu, basic_color, false, visibility)
|
||||
|
@ -163,7 +163,7 @@ MidiRegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
|
||||
compute_colors (basic_color);
|
||||
|
||||
set_height (trackview.current_height());
|
||||
set_height (trackview->current_height());
|
||||
|
||||
region_muted ();
|
||||
region_sync_changed ();
|
||||
|
@ -202,10 +202,10 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
|
||||
static ArdourCanvas::SimpleRect* drag_rect = NULL;
|
||||
|
||||
if (trackview.editor().current_mouse_mode() != MouseNote)
|
||||
if (trackview->editor().current_mouse_mode() != MouseNote)
|
||||
return false;
|
||||
|
||||
const Editing::MidiEditMode midi_edit_mode = trackview.editor().current_midi_edit_mode();
|
||||
const Editing::MidiEditMode midi_edit_mode = trackview->editor().current_midi_edit_mode();
|
||||
|
||||
switch (ev->type) {
|
||||
case GDK_KEY_PRESS:
|
||||
|
@ -253,8 +253,8 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
group->w2i(event_x, event_y);
|
||||
|
||||
// convert event_x to global frame
|
||||
event_frame = trackview.editor().pixel_to_frame(event_x) + _region->position();
|
||||
trackview.editor().snap_to(event_frame);
|
||||
event_frame = trackview->editor().pixel_to_frame(event_x) + _region->position();
|
||||
trackview->editor().snap_to(event_frame);
|
||||
// convert event_frame back to local coordinates relative to position
|
||||
event_frame -= _region->position();
|
||||
|
||||
|
@ -294,7 +294,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
drag_start_y = event_y;
|
||||
|
||||
drag_rect = new ArdourCanvas::SimpleRect(*group);
|
||||
drag_rect->property_x1() = trackview.editor().frame_to_pixel(event_frame);
|
||||
drag_rect->property_x1() = trackview->editor().frame_to_pixel(event_frame);
|
||||
|
||||
drag_rect->property_y1() = midi_stream_view()->note_to_y(
|
||||
midi_stream_view()->y_to_note(event_y));
|
||||
|
@ -323,7 +323,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
}
|
||||
|
||||
if (_mouse_state == AddDragging)
|
||||
event_x = trackview.editor().frame_to_pixel(event_frame);
|
||||
event_x = trackview->editor().frame_to_pixel(event_frame);
|
||||
|
||||
if (drag_rect) {
|
||||
if (event_x > drag_start_x)
|
||||
|
@ -357,7 +357,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
event_y = ev->motion.y;
|
||||
group->w2i(event_x, event_y);
|
||||
group->ungrab(ev->button.time);
|
||||
event_frame = trackview.editor().pixel_to_frame(event_x);
|
||||
event_frame = trackview->editor().pixel_to_frame(event_x);
|
||||
|
||||
if (_pressed_button != 1) {
|
||||
return false;
|
||||
|
@ -385,7 +385,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
_mouse_state = None;
|
||||
if (drag_rect->property_x2() > drag_rect->property_x1() + 2) {
|
||||
const double x = drag_rect->property_x1();
|
||||
const double length = trackview.editor().pixel_to_frame(
|
||||
const double length = trackview->editor().pixel_to_frame(
|
||||
drag_rect->property_x2() - drag_rect->property_x1());
|
||||
|
||||
create_note_at(x, drag_rect->property_y1(), frames_to_beats(length));
|
||||
|
@ -410,7 +410,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
|||
void
|
||||
MidiRegionView::create_note_at(double x, double y, double length)
|
||||
{
|
||||
MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
|
||||
MidiTimeAxisViewPtr mtv = boost::dynamic_pointer_cast<MidiTimeAxisView> (trackview);
|
||||
MidiStreamView* const view = mtv->midi_view();
|
||||
|
||||
double note = midi_stream_view()->y_to_note(y);
|
||||
|
@ -419,7 +419,7 @@ MidiRegionView::create_note_at(double x, double y, double length)
|
|||
assert(note <= 127.0);
|
||||
|
||||
// Start of note in frames relative to region start
|
||||
nframes64_t start_frames = snap_frame_to_frame(trackview.editor().pixel_to_frame(x));
|
||||
nframes64_t start_frames = snap_frame_to_frame(trackview->editor().pixel_to_frame(x));
|
||||
assert(start_frames >= 0);
|
||||
|
||||
// Snap length
|
||||
|
@ -434,7 +434,7 @@ MidiRegionView::create_note_at(double x, double y, double length)
|
|||
|
||||
MidiModel::DeltaCommand* cmd = _model->new_delta_command("add note");
|
||||
cmd->add(new_note);
|
||||
_model->apply_command(trackview.session(), cmd);
|
||||
_model->apply_command(trackview->session(), cmd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -512,7 +512,7 @@ MidiRegionView::apply_command()
|
|||
_marked_for_selection.insert((*i)->note());
|
||||
}
|
||||
|
||||
_model->apply_command(trackview.session(), _delta_command);
|
||||
_model->apply_command(trackview->session(), _delta_command);
|
||||
_delta_command = NULL;
|
||||
midi_view()->midi_track()->diskstream()->playlist_modified();
|
||||
|
||||
|
@ -628,7 +628,7 @@ MidiRegionView::display_sysexes()
|
|||
string text = str.str();
|
||||
|
||||
ArdourCanvas::Group* const group = (ArdourCanvas::Group*)get_canvas_group();
|
||||
const double x = trackview.editor().frame_to_pixel(beats_to_frames(time));
|
||||
const double x = trackview->editor().frame_to_pixel(beats_to_frames(time));
|
||||
|
||||
double height = midi_stream_view()->contents_height();
|
||||
|
||||
|
@ -745,7 +745,7 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
|
|||
note->property_y1() = y1;
|
||||
note->property_y2() = y2;
|
||||
} else if (CanvasHit* hit = dynamic_cast<CanvasHit*>(event)) {
|
||||
double x = trackview.editor().frame_to_pixel(
|
||||
double x = trackview->editor().frame_to_pixel(
|
||||
beats_to_frames(event->note()->time()) - _region->start());
|
||||
const double diamond_size = midi_stream_view()->note_height() / 2.0;
|
||||
double y = midi_stream_view()->note_to_y(event->note()->note())
|
||||
|
@ -762,12 +762,12 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force)
|
|||
}
|
||||
|
||||
GhostRegion*
|
||||
MidiRegionView::add_ghost (TimeAxisView& tv)
|
||||
MidiRegionView::add_ghost (TimeAxisViewPtr tv)
|
||||
{
|
||||
CanvasNote* note;
|
||||
|
||||
double unit_position = _region->position () / samples_per_unit;
|
||||
MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv);
|
||||
MidiTimeAxisViewPtr mtv = boost::dynamic_pointer_cast<MidiTimeAxisView> (tv);
|
||||
MidiGhostRegion* ghost;
|
||||
|
||||
if (mtv && mtv->midi_view()) {
|
||||
|
@ -831,7 +831,7 @@ MidiRegionView::resolve_note(uint8_t note, double end_time)
|
|||
|
||||
if (_active_notes && _active_notes[note]) {
|
||||
const nframes64_t end_time_frames = beats_to_frames(end_time);
|
||||
_active_notes[note]->property_x2() = trackview.editor().frame_to_pixel(end_time_frames);
|
||||
_active_notes[note]->property_x2() = trackview->editor().frame_to_pixel(end_time_frames);
|
||||
_active_notes[note]->property_outline_what() = (guint32) 0xF; // all edges
|
||||
_active_notes[note] = NULL;
|
||||
}
|
||||
|
@ -849,7 +849,7 @@ MidiRegionView::extend_active_notes()
|
|||
|
||||
for (unsigned i=0; i < 128; ++i) {
|
||||
if (_active_notes[i]) {
|
||||
_active_notes[i]->property_x2() = trackview.editor().frame_to_pixel(_region->length());
|
||||
_active_notes[i]->property_x2() = trackview->editor().frame_to_pixel(_region->length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -857,11 +857,11 @@ MidiRegionView::extend_active_notes()
|
|||
void
|
||||
MidiRegionView::play_midi_note(boost::shared_ptr<NoteType> note)
|
||||
{
|
||||
if (!trackview.editor().sound_notes()) {
|
||||
if (!trackview->editor().sound_notes()) {
|
||||
return;
|
||||
}
|
||||
|
||||
RouteUI* route_ui = dynamic_cast<RouteUI*> (&trackview);
|
||||
boost::shared_ptr<RouteUI> route_ui = boost::dynamic_pointer_cast<RouteUI> (trackview);
|
||||
assert(route_ui);
|
||||
|
||||
route_ui->midi_track()->write_immediate_event(
|
||||
|
@ -877,7 +877,7 @@ MidiRegionView::play_midi_note(boost::shared_ptr<NoteType> note)
|
|||
bool
|
||||
MidiRegionView::play_midi_note_off(boost::shared_ptr<NoteType> note)
|
||||
{
|
||||
RouteUI* route_ui = dynamic_cast<RouteUI*> (&trackview);
|
||||
boost::shared_ptr<RouteUI> route_ui = boost::dynamic_pointer_cast<RouteUI> (trackview);
|
||||
assert(route_ui);
|
||||
|
||||
route_ui->midi_track()->write_immediate_event(
|
||||
|
@ -916,12 +916,12 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note)
|
|||
|
||||
CanvasNoteEvent* event = 0;
|
||||
|
||||
const double x = trackview.editor().frame_to_pixel(note_start_frames - _region->start());
|
||||
const double x = trackview->editor().frame_to_pixel(note_start_frames - _region->start());
|
||||
|
||||
if (midi_view()->note_mode() == Sustained) {
|
||||
const double y1 = midi_stream_view()->note_to_y(note->note());
|
||||
const double note_endpixel =
|
||||
trackview.editor().frame_to_pixel(note_end_frames - _region->start());
|
||||
trackview->editor().frame_to_pixel(note_end_frames - _region->start());
|
||||
|
||||
CanvasNote* ev_rect = new CanvasNote(*this, *group, note);
|
||||
ev_rect->property_x1() = x;
|
||||
|
@ -929,7 +929,7 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note)
|
|||
if (note->length() > 0) {
|
||||
ev_rect->property_x2() = note_endpixel;
|
||||
} else {
|
||||
ev_rect->property_x2() = trackview.editor().frame_to_pixel(_region->length());
|
||||
ev_rect->property_x2() = trackview->editor().frame_to_pixel(_region->length());
|
||||
}
|
||||
ev_rect->property_y2() = y1 + floor(midi_stream_view()->note_height());
|
||||
|
||||
|
@ -996,7 +996,7 @@ MidiRegionView::add_pgm_change(PCEvent& program, const string& displaytext)
|
|||
assert(program.time >= 0);
|
||||
|
||||
ArdourCanvas::Group* const group = (ArdourCanvas::Group*)get_canvas_group();
|
||||
const double x = trackview.editor().frame_to_pixel(beats_to_frames(program.time));
|
||||
const double x = trackview->editor().frame_to_pixel(beats_to_frames(program.time));
|
||||
|
||||
double height = midi_stream_view()->contents_height();
|
||||
|
||||
|
@ -1319,9 +1319,9 @@ MidiRegionView::note_dropped(CanvasNoteEvent* ev, double dt, uint8_t dnote)
|
|||
|
||||
nframes64_t start_frames = beats_to_frames((*i)->note()->time());
|
||||
if (dt >= 0) {
|
||||
start_frames += snap_frame_to_frame(trackview.editor().pixel_to_frame(dt));
|
||||
start_frames += snap_frame_to_frame(trackview->editor().pixel_to_frame(dt));
|
||||
} else {
|
||||
start_frames -= snap_frame_to_frame(trackview.editor().pixel_to_frame(-dt));
|
||||
start_frames -= snap_frame_to_frame(trackview->editor().pixel_to_frame(-dt));
|
||||
}
|
||||
|
||||
copy->set_time(frames_to_beats(start_frames));
|
||||
|
@ -1361,7 +1361,7 @@ MidiRegionView::note_dropped(CanvasNoteEvent* ev, double dt, uint8_t dnote)
|
|||
nframes64_t
|
||||
MidiRegionView::snap_pixel_to_frame(double x)
|
||||
{
|
||||
PublicEditor& editor = trackview.editor();
|
||||
PublicEditor& editor = trackview->editor();
|
||||
// x is region relative, convert it to global absolute frames
|
||||
nframes64_t frame = editor.pixel_to_frame(x) + _region->position();
|
||||
editor.snap_to(frame);
|
||||
|
@ -1371,7 +1371,7 @@ MidiRegionView::snap_pixel_to_frame(double x)
|
|||
nframes64_t
|
||||
MidiRegionView::snap_frame_to_frame(nframes64_t x)
|
||||
{
|
||||
PublicEditor& editor = trackview.editor();
|
||||
PublicEditor& editor = trackview->editor();
|
||||
// x is region relative, convert it to global absolute frames
|
||||
nframes64_t frame = x + _region->position();
|
||||
editor.snap_to(frame);
|
||||
|
@ -1381,14 +1381,14 @@ MidiRegionView::snap_frame_to_frame(nframes64_t x)
|
|||
double
|
||||
MidiRegionView::snap_to_pixel(double x)
|
||||
{
|
||||
return (double) trackview.editor().frame_to_pixel(snap_pixel_to_frame(x));
|
||||
return (double) trackview->editor().frame_to_pixel(snap_pixel_to_frame(x));
|
||||
}
|
||||
|
||||
double
|
||||
MidiRegionView::get_position_pixels()
|
||||
{
|
||||
nframes64_t region_frame = get_position();
|
||||
return trackview.editor().frame_to_pixel(region_frame);
|
||||
return trackview->editor().frame_to_pixel(region_frame);
|
||||
}
|
||||
|
||||
nframes64_t
|
||||
|
|
|
@ -63,7 +63,7 @@ class MidiRegionView : public RegionView
|
|||
typedef Evoral::Note<ARDOUR::MidiModel::TimeType> NoteType;
|
||||
|
||||
MidiRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color const & basic_color);
|
||||
|
@ -78,8 +78,9 @@ class MidiRegionView : public RegionView
|
|||
inline const boost::shared_ptr<ARDOUR::MidiRegion> midi_region() const
|
||||
{ return boost::dynamic_pointer_cast<ARDOUR::MidiRegion>(_region); }
|
||||
|
||||
inline MidiTimeAxisView* midi_view() const
|
||||
{ return dynamic_cast<MidiTimeAxisView*>(&trackview); }
|
||||
inline MidiTimeAxisViewPtr midi_view() const {
|
||||
return boost::dynamic_pointer_cast<MidiTimeAxisView> (trackview);
|
||||
}
|
||||
|
||||
inline MidiStreamView* midi_stream_view() const
|
||||
{ return midi_view()->midi_view(); }
|
||||
|
@ -93,7 +94,7 @@ class MidiRegionView : public RegionView
|
|||
|
||||
void redisplay_model();
|
||||
|
||||
GhostRegion* add_ghost (TimeAxisView&);
|
||||
GhostRegion* add_ghost (TimeAxisViewPtr);
|
||||
|
||||
void add_note(const boost::shared_ptr<NoteType> note);
|
||||
void resolve_note(uint8_t note_num, double end_time);
|
||||
|
@ -258,7 +259,7 @@ class MidiRegionView : public RegionView
|
|||
* to the TimeAxisViewItem parent class.
|
||||
*/
|
||||
MidiRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::MidiRegion>,
|
||||
double samples_per_unit,
|
||||
Gdk::Color& basic_color,
|
||||
|
|
|
@ -53,7 +53,7 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
|
||||
MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
||||
MidiStreamView::MidiStreamView (MidiTimeAxisViewPtr tv)
|
||||
: StreamView (tv)
|
||||
, note_range_adjustment(0.0f, 0.0f, 0.0f)
|
||||
, _range_dirty(false)
|
||||
|
@ -63,13 +63,13 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
|||
, _data_note_min(60)
|
||||
, _data_note_max(71)
|
||||
{
|
||||
if (tv.is_track()) {
|
||||
if (tv->is_track()) {
|
||||
stream_base_color = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get();
|
||||
} else {
|
||||
stream_base_color = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();
|
||||
}
|
||||
|
||||
use_rec_regions = tv.editor().show_waveforms_recording ();
|
||||
use_rec_regions = tv->editor().show_waveforms_recording ();
|
||||
|
||||
/* use a group dedicated to MIDI underlays. Audio underlays are not in this group. */
|
||||
midi_underlay_group = new ArdourCanvas::Group (*canvas_group);
|
||||
|
@ -81,12 +81,16 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv)
|
|||
|
||||
_note_lines->property_x1() = 0;
|
||||
_note_lines->property_y1() = 0;
|
||||
_note_lines->property_x2() = trackview().editor().frame_to_pixel (max_frames);
|
||||
_note_lines->property_x2() = trackview()->editor().frame_to_pixel (max_frames);
|
||||
_note_lines->property_y2() = 0;
|
||||
|
||||
_note_lines->signal_event().connect(bind(
|
||||
mem_fun(_trackview.editor(), &PublicEditor::canvas_stream_view_event),
|
||||
_note_lines, &_trackview));
|
||||
TimeAxisViewPtr w (_trackview);
|
||||
_note_lines->signal_event().connect(
|
||||
bind(
|
||||
mem_fun(_trackview->editor(), &PublicEditor::canvas_stream_view_event),
|
||||
_note_lines, w
|
||||
)
|
||||
);
|
||||
|
||||
_note_lines->lower_to_bottom();
|
||||
|
||||
|
@ -247,7 +251,7 @@ MidiStreamView::update_data_note_range(uint8_t min, uint8_t max)
|
|||
void
|
||||
MidiStreamView::redisplay_diskstream ()
|
||||
{
|
||||
if (!_trackview.is_midi_track()) {
|
||||
if (!_trackview->is_midi_track()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -257,7 +261,7 @@ MidiStreamView::redisplay_diskstream ()
|
|||
_range_dirty = false;
|
||||
_data_note_min = 127;
|
||||
_data_note_max = 0;
|
||||
_trackview.get_diskstream()->playlist()->foreach_region(
|
||||
_trackview->get_diskstream()->playlist()->foreach_region(
|
||||
sigc::mem_fun (*this, &StreamView::update_contents_metrics)
|
||||
);
|
||||
|
||||
|
@ -280,7 +284,7 @@ MidiStreamView::redisplay_diskstream ()
|
|||
}
|
||||
|
||||
// Add and display region views, and flag them as valid
|
||||
_trackview.get_diskstream()->playlist()->foreach_region(
|
||||
_trackview->get_diskstream()->playlist()->foreach_region(
|
||||
sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
|
||||
);
|
||||
|
||||
|
@ -382,11 +386,11 @@ MidiStreamView::setup_rec_box ()
|
|||
{
|
||||
// cerr << _trackview.name() << " streamview SRB\n";
|
||||
|
||||
if (_trackview.session().transport_rolling()) {
|
||||
if (_trackview->session().transport_rolling()) {
|
||||
|
||||
if (!rec_active &&
|
||||
_trackview.session().record_status() == Session::Recording &&
|
||||
_trackview.get_diskstream()->record_enabled()) {
|
||||
_trackview->session().record_status() == Session::Recording &&
|
||||
_trackview->get_diskstream()->record_enabled()) {
|
||||
|
||||
if (use_rec_regions && rec_regions.size() == rec_rects.size()) {
|
||||
|
||||
|
@ -400,7 +404,7 @@ MidiStreamView::setup_rec_box ()
|
|||
rec_data_ready_connections.clear();
|
||||
|
||||
// FIXME
|
||||
boost::shared_ptr<MidiDiskstream> mds = boost::dynamic_pointer_cast<MidiDiskstream>(_trackview.get_diskstream());
|
||||
boost::shared_ptr<MidiDiskstream> mds = boost::dynamic_pointer_cast<MidiDiskstream>(_trackview->get_diskstream());
|
||||
assert(mds);
|
||||
|
||||
sources.push_back(mds->write_source());
|
||||
|
@ -411,14 +415,14 @@ MidiStreamView::setup_rec_box ()
|
|||
|
||||
jack_nframes_t start = 0;
|
||||
if (rec_regions.size() > 0) {
|
||||
start = rec_regions.back().first->position() + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
||||
start = rec_regions.back().first->position() + _trackview->get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
||||
}
|
||||
|
||||
boost::shared_ptr<MidiRegion> region (boost::dynamic_pointer_cast<MidiRegion>
|
||||
(RegionFactory::create (sources, start, 1 , "", 0, Region::DefaultFlags, false)));
|
||||
assert(region);
|
||||
region->block_property_changes ();
|
||||
region->set_position (_trackview.session().transport_frame(), this);
|
||||
region->set_position (_trackview->session().transport_frame(), this);
|
||||
rec_regions.push_back (make_pair(region, (RegionView*)0));
|
||||
|
||||
// rec regions are destroyed in setup_rec_box
|
||||
|
@ -428,14 +432,14 @@ MidiStreamView::setup_rec_box ()
|
|||
|
||||
/* start a new rec box */
|
||||
|
||||
boost::shared_ptr<MidiTrack> mt = _trackview.midi_track(); /* we know what it is already */
|
||||
boost::shared_ptr<MidiTrack> mt = _trackview->midi_track(); /* we know what it is already */
|
||||
boost::shared_ptr<MidiDiskstream> ds = mt->midi_diskstream();
|
||||
jack_nframes_t frame_pos = ds->current_capture_start ();
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (frame_pos);
|
||||
gdouble xstart = _trackview->editor().frame_to_pixel (frame_pos);
|
||||
gdouble xend;
|
||||
uint32_t fill_color;
|
||||
|
||||
assert(_trackview.midi_track()->mode() == Normal);
|
||||
assert(_trackview->midi_track()->mode() == Normal);
|
||||
|
||||
xend = xstart;
|
||||
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
||||
|
@ -444,14 +448,14 @@ MidiStreamView::setup_rec_box ()
|
|||
rec_rect->property_x1() = xstart;
|
||||
rec_rect->property_y1() = 1.0;
|
||||
rec_rect->property_x2() = xend;
|
||||
rec_rect->property_y2() = (double) _trackview.current_height() - 1;
|
||||
rec_rect->property_y2() = (double) _trackview->current_height() - 1;
|
||||
rec_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
||||
rec_rect->property_fill_color_rgba() = fill_color;
|
||||
rec_rect->lower_to_bottom();
|
||||
|
||||
RecBoxInfo recbox;
|
||||
recbox.rectangle = rec_rect;
|
||||
recbox.start = _trackview.session().transport_frame();
|
||||
recbox.start = _trackview->session().transport_frame();
|
||||
recbox.length = 0;
|
||||
|
||||
rec_rects.push_back (recbox);
|
||||
|
@ -462,8 +466,8 @@ MidiStreamView::setup_rec_box ()
|
|||
rec_active = true;
|
||||
|
||||
} else if (rec_active &&
|
||||
(_trackview.session().record_status() != Session::Recording ||
|
||||
!_trackview.get_diskstream()->record_enabled())) {
|
||||
(_trackview->session().record_status() != Session::Recording ||
|
||||
!_trackview->get_diskstream()->record_enabled())) {
|
||||
|
||||
screen_update_connection.disconnect();
|
||||
rec_active = false;
|
||||
|
@ -557,7 +561,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
|
|||
if (nlen != region->length()) {
|
||||
|
||||
region->freeze ();
|
||||
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_position (_trackview->get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_length (start + dur - region->position(), this);
|
||||
region->thaw ("updated");
|
||||
|
||||
|
@ -569,7 +573,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
|
|||
|
||||
/* also update rect */
|
||||
ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
|
||||
gdouble xend = _trackview->editor().frame_to_pixel (region->position() + region->length());
|
||||
rect->property_x2() = xend;
|
||||
|
||||
/* draw events */
|
||||
|
@ -606,14 +610,14 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
|
|||
|
||||
} else {
|
||||
|
||||
nframes_t nlen = _trackview.get_diskstream()->get_captured_frames(n);
|
||||
nframes_t nlen = _trackview->get_diskstream()->get_captured_frames(n);
|
||||
|
||||
if (nlen != region->length()) {
|
||||
|
||||
if (region->source_length(0) >= region->position() + nlen) {
|
||||
|
||||
region->freeze ();
|
||||
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_position (_trackview->get_diskstream()->get_capture_start_frame(n), this);
|
||||
region->set_length (nlen, this);
|
||||
region->thaw ("updated");
|
||||
|
||||
|
@ -654,12 +658,12 @@ void
|
|||
MidiStreamView::color_handler ()
|
||||
{
|
||||
//case cMidiTrackBase:
|
||||
if (_trackview.is_midi_track()) {
|
||||
if (_trackview->is_midi_track()) {
|
||||
//canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get();
|
||||
}
|
||||
|
||||
//case cMidiBusBase:
|
||||
if (!_trackview.is_midi_track()) {
|
||||
if (!_trackview->is_midi_track()) {
|
||||
//canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiBusBase.get();;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class Selection;
|
|||
class MidiStreamView : public StreamView
|
||||
{
|
||||
public:
|
||||
MidiStreamView (MidiTimeAxisView&);
|
||||
MidiStreamView (MidiTimeAxisViewPtr);
|
||||
~MidiStreamView ();
|
||||
|
||||
void set_selected_regionviews (RegionSelection&);
|
||||
|
@ -79,7 +79,7 @@ class MidiStreamView : public StreamView
|
|||
void redisplay_diskstream ();
|
||||
|
||||
inline double contents_height() const
|
||||
{ return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); }
|
||||
{ return (_trackview->current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); }
|
||||
|
||||
inline double note_to_y(uint8_t note) const
|
||||
{ return contents_height()
|
||||
|
|
|
@ -89,7 +89,7 @@ static const uint32_t MIDI_CONTROLS_BOX_MIN_HEIGHT = 162;
|
|||
static const uint32_t KEYBOARD_MIN_HEIGHT = 140;
|
||||
|
||||
MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess,
|
||||
boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
: AxisView(sess) // virtually inherited
|
||||
, RouteTimeAxisView(ed, sess, rt, canvas)
|
||||
, _ignore_signals(false)
|
||||
|
@ -103,9 +103,27 @@ MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess,
|
|||
, _channel_color_mode_item(0)
|
||||
, _track_color_mode_item(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
MidiTimeAxisViewPtr
|
||||
MidiTimeAxisView::create (PublicEditor& ed, Session& sess,
|
||||
boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
{
|
||||
MidiTimeAxisViewPtr v (new MidiTimeAxisView (ed, sess, rt, canvas));
|
||||
v->init (ed, sess, rt, canvas);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MidiTimeAxisView::init (PublicEditor& ed, Session& sess,
|
||||
boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
{
|
||||
subplugin_menu.set_name ("ArdourContextMenu");
|
||||
|
||||
_view = new MidiStreamView (*this);
|
||||
_view = new MidiStreamView (boost::dynamic_pointer_cast<MidiTimeAxisView> (shared_from_this ()));
|
||||
|
||||
ignore_toggle = false;
|
||||
|
||||
|
@ -510,13 +528,16 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
|
|||
|
||||
assert(c);
|
||||
|
||||
boost::shared_ptr<AutomationTimeAxisView> track(new AutomationTimeAxisView (_session,
|
||||
boost::shared_ptr<AutomationTimeAxisView> track =
|
||||
AutomationTimeAxisView::create (
|
||||
_session,
|
||||
_route, boost::shared_ptr<ARDOUR::Automatable>(), c,
|
||||
_editor,
|
||||
*this,
|
||||
shared_from_this (),
|
||||
true,
|
||||
parent_canvas,
|
||||
_route->describe_parameter(param)));
|
||||
_route->describe_parameter(param)
|
||||
);
|
||||
|
||||
add_automation_child(param, track, show);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,9 @@ class PianoRollHeader;
|
|||
class MidiTimeAxisView : public RouteTimeAxisView
|
||||
{
|
||||
public:
|
||||
MidiTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
static MidiTimeAxisViewPtr
|
||||
create (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
|
||||
virtual ~MidiTimeAxisView ();
|
||||
|
||||
MidiStreamView* midi_view();
|
||||
|
@ -88,7 +90,10 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
|||
|
||||
private:
|
||||
sigc::signal<void, std::string, std::string> _midi_patch_settings_changed;
|
||||
|
||||
|
||||
MidiTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
void init (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
|
||||
|
||||
void model_changed();
|
||||
void custom_device_mode_changed();
|
||||
|
||||
|
|
|
@ -646,7 +646,7 @@ PianoRollHeader::on_size_allocate(Gtk::Allocation& a)
|
|||
void
|
||||
PianoRollHeader::send_note_on(uint8_t note)
|
||||
{
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track = _view.trackview().midi_track();
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track = _view.trackview()->midi_track();
|
||||
|
||||
//cerr << "note on: " << (int) note << endl;
|
||||
|
||||
|
@ -662,7 +662,7 @@ PianoRollHeader::send_note_on(uint8_t note)
|
|||
void
|
||||
PianoRollHeader::send_note_off(uint8_t note)
|
||||
{
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track = _view.trackview().midi_track();
|
||||
boost::shared_ptr<ARDOUR::MidiTrack> track = _view.trackview()->midi_track();
|
||||
|
||||
if (track) {
|
||||
_event[0] = MIDI_CMD_NOTE_OFF;
|
||||
|
|
|
@ -197,7 +197,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual gulong frame_to_pixel (nframes64_t frame) const = 0;
|
||||
virtual Selection& get_selection () const = 0;
|
||||
virtual Selection& get_cut_buffer () const = 0;
|
||||
virtual bool extend_selection_to_track (TimeAxisView&) = 0;
|
||||
virtual bool extend_selection_to_track (TimeAxisViewPtr) = 0;
|
||||
virtual void play_selection () = 0;
|
||||
virtual void set_show_measures (bool yn) = 0;
|
||||
virtual bool show_measures () const = 0;
|
||||
|
@ -219,13 +219,13 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual gdouble get_current_zoom () const = 0;
|
||||
virtual PlaylistSelector& playlist_selector() const = 0;
|
||||
virtual void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>) = 0;
|
||||
virtual void new_playlists (TimeAxisView*) = 0;
|
||||
virtual void copy_playlists (TimeAxisView*) = 0;
|
||||
virtual void clear_playlists (TimeAxisView*) = 0;
|
||||
virtual void new_playlists (boost::weak_ptr<TimeAxisView>) = 0;
|
||||
virtual void copy_playlists (boost::weak_ptr<TimeAxisView>) = 0;
|
||||
virtual void clear_playlists (boost::weak_ptr<TimeAxisView>) = 0;
|
||||
virtual void select_all_tracks () = 0;
|
||||
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
||||
virtual void hide_track_in_display (TimeAxisView& tv, bool temporary = false) = 0;
|
||||
virtual void set_selected_track (TimeAxisViewPtr, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||
virtual void set_selected_mixer_strip (TimeAxisViewPtr) = 0;
|
||||
virtual void hide_track_in_display (TimeAxisViewPtr tv, bool temporary = false) = 0;
|
||||
|
||||
/** Set whether the editor should follow the playhead.
|
||||
* @param yn true to follow playhead, otherwise false.
|
||||
|
@ -243,7 +243,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual double get_physical_screen_width() const = 0;
|
||||
virtual void ensure_float (Gtk::Window&) = 0;
|
||||
virtual void show_window () = 0;
|
||||
virtual TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0) = 0;
|
||||
virtual TrackViewList* get_valid_views (TimeAxisViewPtr, ARDOUR::RouteGroup* grp = 0) = 0;
|
||||
virtual nframes64_t leftmost_position() const = 0;
|
||||
virtual nframes64_t current_page_frames() const = 0;
|
||||
virtual void temporal_zoom_step (bool coarser) = 0;
|
||||
|
@ -260,18 +260,18 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual void toggle_meter_updating() = 0;
|
||||
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret) = 0;
|
||||
virtual void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||
virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisViewPtr>) = 0;
|
||||
virtual void add_to_idle_resize (TimeAxisViewPtr, int32_t) = 0;
|
||||
|
||||
#ifdef WITH_CMT
|
||||
virtual void add_imageframe_time_axis(const std::string & track_name, void*) = 0;
|
||||
virtual void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) = 0;
|
||||
virtual void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisViewPtr marked_track, void*) = 0;
|
||||
virtual void connect_to_image_compositor() = 0;
|
||||
virtual void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) = 0;
|
||||
virtual TimeAxisView* get_named_time_axis(const std::string & name) = 0;
|
||||
virtual TimeAxisViewPtr get_named_time_axis(const std::string & name) = 0;
|
||||
#endif
|
||||
|
||||
virtual RouteTimeAxisView* get_route_view_by_id (PBD::ID& id) = 0;
|
||||
virtual RouteTimeAxisViewPtr get_route_view_by_id (PBD::ID& id) = 0;
|
||||
|
||||
virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, ARDOUR::RouteGroup::Property) const = 0;
|
||||
|
||||
|
@ -298,12 +298,12 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
|
|||
virtual bool canvas_region_view_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*) = 0;
|
||||
virtual bool canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*) = 0;
|
||||
virtual bool canvas_region_view_name_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*) = 0;
|
||||
virtual bool canvas_stream_view_event (GdkEvent* event, ArdourCanvas::Item*, RouteTimeAxisView*) = 0;
|
||||
virtual bool canvas_stream_view_event (GdkEvent* event, ArdourCanvas::Item*, boost::weak_ptr<TimeAxisView>) = 0;
|
||||
virtual bool canvas_marker_event (GdkEvent* event, ArdourCanvas::Item*, Marker*) = 0;
|
||||
virtual bool canvas_zoom_rect_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
|
||||
virtual bool canvas_tempo_marker_event (GdkEvent* event, ArdourCanvas::Item*, TempoMarker*) = 0;
|
||||
virtual bool canvas_meter_marker_event (GdkEvent* event, ArdourCanvas::Item*, MeterMarker*) = 0;
|
||||
virtual bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) = 0;
|
||||
virtual bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, boost::weak_ptr<AutomationTimeAxisView>) = 0;
|
||||
|
||||
virtual bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
|
||||
virtual bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
|
||||
|
|
|
@ -54,7 +54,7 @@ AudioRegionGainLine::start_drag (ControlPoint* cp, nframes_t x, float fraction)
|
|||
{
|
||||
AutomationLine::start_drag (cp, x, fraction);
|
||||
if (!rv.audio_region()->envelope_active()) {
|
||||
trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &rv.audio_region()->get_state(), 0));
|
||||
trackview->session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &rv.audio_region()->get_state(), 0));
|
||||
rv.audio_region()->set_envelope_active(false);
|
||||
}
|
||||
}
|
||||
|
@ -67,21 +67,21 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
|
|||
|
||||
model_representation (cp, mr);
|
||||
|
||||
trackview.editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
trackview->editor().current_session()->begin_reversible_command (_("remove control point"));
|
||||
XMLNode &before = alist->get_state();
|
||||
|
||||
if (!rv.audio_region()->envelope_active()) {
|
||||
XMLNode ®ion_before = rv.audio_region()->get_state();
|
||||
rv.audio_region()->set_envelope_active(true);
|
||||
XMLNode ®ion_after = rv.audio_region()->get_state();
|
||||
trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), ®ion_before, ®ion_after));
|
||||
trackview->session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), ®ion_before, ®ion_after));
|
||||
}
|
||||
|
||||
alist->erase (mr.start, mr.end);
|
||||
|
||||
trackview.editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
trackview.editor().current_session()->commit_reversible_command ();
|
||||
trackview.editor().current_session()->set_dirty ();
|
||||
trackview->editor().current_session()->add_command (new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
|
||||
trackview->editor().current_session()->commit_reversible_command ();
|
||||
trackview->editor().current_session()->set_dirty ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -89,7 +89,7 @@ AudioRegionGainLine::end_drag (ControlPoint* cp)
|
|||
{
|
||||
if (!rv.audio_region()->envelope_active()) {
|
||||
rv.audio_region()->set_envelope_active(true);
|
||||
trackview.session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), 0, &rv.audio_region()->get_state()));
|
||||
trackview->session().add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), 0, &rv.audio_region()->get_state()));
|
||||
}
|
||||
|
||||
AutomationLine::end_drag(cp);
|
||||
|
|
|
@ -253,10 +253,10 @@ struct RegionSortByTrack {
|
|||
|
||||
/* really, track and position */
|
||||
|
||||
if (a->get_trackview().order() == b->get_trackview().order()) {
|
||||
if (a->get_trackview()->order() == b->get_trackview()->order()) {
|
||||
return a->region()->position() < b->region()->position();
|
||||
} else {
|
||||
return a->get_trackview().order() < b->get_trackview().order();
|
||||
return a->get_trackview()->order() < b->get_trackview()->order();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -295,10 +295,10 @@ RegionSelection::sort_by_position_and_track ()
|
|||
* @return true if any of the selection's regions are on tv.
|
||||
*/
|
||||
bool
|
||||
RegionSelection::involves (const TimeAxisView& tv) const
|
||||
RegionSelection::involves (TimeAxisViewPtr tv) const
|
||||
{
|
||||
for (RegionSelection::const_iterator i = begin(); i != end(); ++i) {
|
||||
if (&(*i)->get_trackview() == &tv) {
|
||||
if ((*i)->get_trackview() == tv) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <list>
|
||||
#include <sigc++/signal.h>
|
||||
#include "ardour/types.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
class RegionView;
|
||||
class TimeAxisView;
|
||||
|
@ -42,7 +43,7 @@ class RegionSelection : public std::list<RegionView*>, public sigc::trackable
|
|||
void sort_by_position_and_track ();
|
||||
|
||||
bool contains (RegionView*) const;
|
||||
bool involves (const TimeAxisView&) const;
|
||||
bool involves (TimeAxisViewPtr) const;
|
||||
|
||||
void clear_all();
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ static const int32_t sync_mark_width = 9;
|
|||
sigc::signal<void,RegionView*> RegionView::RegionViewGoingAway;
|
||||
|
||||
RegionView::RegionView (ArdourCanvas::Group* parent,
|
||||
TimeAxisView& tv,
|
||||
TimeAxisViewPtr tv,
|
||||
boost::shared_ptr<ARDOUR::Region> r,
|
||||
double spu,
|
||||
Gdk::Color const & basic_color)
|
||||
|
@ -115,7 +115,7 @@ RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other
|
|||
}
|
||||
|
||||
RegionView::RegionView (ArdourCanvas::Group* parent,
|
||||
TimeAxisView& tv,
|
||||
TimeAxisViewPtr tv,
|
||||
boost::shared_ptr<ARDOUR::Region> r,
|
||||
double spu,
|
||||
Gdk::Color const & basic_color,
|
||||
|
@ -163,7 +163,7 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
|
|||
if (wfd)
|
||||
_enable_display = true;
|
||||
|
||||
set_height (trackview.current_height());
|
||||
set_height (trackview->current_height());
|
||||
|
||||
_region->StateChanged.connect (mem_fun(*this, &RegionView::region_changed));
|
||||
|
||||
|
@ -496,7 +496,7 @@ RegionView::region_sync_changed ()
|
|||
|
||||
points.clear ();
|
||||
points.push_back (Gnome::Art::Point (offset, 0));
|
||||
points.push_back (Gnome::Art::Point (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE));
|
||||
points.push_back (Gnome::Art::Point (offset, trackview->current_height() - NAME_HIGHLIGHT_SIZE));
|
||||
|
||||
sync_line->property_points().set_value (points);
|
||||
sync_line->show ();
|
||||
|
@ -521,10 +521,10 @@ RegionView::move (double x_delta, double y_delta)
|
|||
}
|
||||
|
||||
void
|
||||
RegionView::remove_ghost_in (TimeAxisView& tv)
|
||||
RegionView::remove_ghost_in (TimeAxisViewPtr tv)
|
||||
{
|
||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||
if (&(*i)->trackview == &tv) {
|
||||
if ((*i)->trackview == tv) {
|
||||
delete *i;
|
||||
break;
|
||||
}
|
||||
|
@ -611,14 +611,14 @@ RegionView::update_coverage_frames (LayerDisplay d)
|
|||
|
||||
/* finish off any old rect, if required */
|
||||
if (cr && me != new_me) {
|
||||
cr->property_x2() = trackview.editor().frame_to_pixel (t - position);
|
||||
cr->property_x2() = trackview->editor().frame_to_pixel (t - position);
|
||||
}
|
||||
|
||||
/* start off any new rect, if required */
|
||||
if (cr == 0 || me != new_me) {
|
||||
cr = new ArdourCanvas::SimpleRect (*group);
|
||||
_coverage_frames.push_back (cr);
|
||||
cr->property_x1() = trackview.editor().frame_to_pixel (t - position);
|
||||
cr->property_x1() = trackview->editor().frame_to_pixel (t - position);
|
||||
cr->property_y1() = 1;
|
||||
cr->property_y2() = _height + 1;
|
||||
cr->property_outline_pixels() = 0;
|
||||
|
@ -636,6 +636,6 @@ RegionView::update_coverage_frames (LayerDisplay d)
|
|||
|
||||
if (cr) {
|
||||
/* finish off the last rectangle */
|
||||
cr->property_x2() = trackview.editor().frame_to_pixel (end - position);
|
||||
cr->property_x2() = trackview->editor().frame_to_pixel (end - position);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class RegionView : public TimeAxisViewItem
|
|||
{
|
||||
public:
|
||||
RegionView (ArdourCanvas::Group* parent,
|
||||
TimeAxisView& time_view,
|
||||
TimeAxisViewPtr time_view,
|
||||
boost::shared_ptr<ARDOUR::Region> region,
|
||||
double samples_per_unit,
|
||||
Gdk::Color const & basic_color);
|
||||
|
@ -77,8 +77,8 @@ class RegionView : public TimeAxisViewItem
|
|||
|
||||
virtual void region_changed (ARDOUR::Change);
|
||||
|
||||
virtual GhostRegion* add_ghost (TimeAxisView&) = 0;
|
||||
void remove_ghost_in (TimeAxisView&);
|
||||
virtual GhostRegion* add_ghost (TimeAxisViewPtr) = 0;
|
||||
void remove_ghost_in (TimeAxisViewPtr);
|
||||
void remove_ghost (GhostRegion*);
|
||||
|
||||
uint32_t get_fill_color ();
|
||||
|
@ -97,7 +97,7 @@ class RegionView : public TimeAxisViewItem
|
|||
* to the TimeAxisViewItem parent class
|
||||
*/
|
||||
RegionView (ArdourCanvas::Group *,
|
||||
TimeAxisView&,
|
||||
TimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::Region>,
|
||||
double samples_per_unit,
|
||||
Gdk::Color const & basic_color,
|
||||
|
|
|
@ -260,7 +260,7 @@ RhythmFerret::run_analysis ()
|
|||
}
|
||||
|
||||
for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||
(*i)->get_time_axis_view().show_feature_lines (current_results);
|
||||
(*i)->get_time_axis_view()->show_feature_lines (current_results);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ RhythmFerret::do_split_action ()
|
|||
tmp = i;
|
||||
++tmp;
|
||||
|
||||
(*i)->get_time_axis_view().hide_feature_lines ();
|
||||
(*i)->get_time_axis_view()->hide_feature_lines ();
|
||||
|
||||
editor.split_region_at_points ((*i)->region(), current_results, false);
|
||||
|
||||
|
@ -418,9 +418,9 @@ RhythmFerret::set_session (Session* s)
|
|||
current_results.clear ();
|
||||
}
|
||||
|
||||
static void hide_time_axis_features (TimeAxisView& tav)
|
||||
static void hide_time_axis_features (TimeAxisViewPtr tav)
|
||||
{
|
||||
tav.hide_feature_lines ();
|
||||
tav->hide_feature_lines ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -102,7 +102,7 @@ RouteTimeAxisView::setup_slider_pix ()
|
|||
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
|
||||
: AxisView(sess)
|
||||
, RouteUI(rt, sess)
|
||||
, TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas)
|
||||
, TimeAxisView (sess, ed, TimeAxisViewPtr (), canvas)
|
||||
, parent_canvas (canvas)
|
||||
, button_table (3, 3)
|
||||
, route_group_button (_("g"))
|
||||
|
@ -1173,7 +1173,7 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
|
|||
if (Keyboard::modifier_state_equals (ev->state, (Keyboard::TertiaryModifier|Keyboard::PrimaryModifier))) {
|
||||
|
||||
/* special case: select/deselect all tracks */
|
||||
if (_editor.get_selection().selected (this)) {
|
||||
if (_editor.get_selection().selected (shared_from_this ())) {
|
||||
_editor.get_selection().clear_tracks ();
|
||||
} else {
|
||||
_editor.select_all_tracks ();
|
||||
|
@ -1182,7 +1182,7 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
PublicEditor::TrackViewList* tracks = _editor.get_valid_views (this, _route->route_group());
|
||||
PublicEditor::TrackViewList* tracks = _editor.get_valid_views (shared_from_this(), _route->route_group());
|
||||
|
||||
switch (Keyboard::selection_type (ev->state)) {
|
||||
case Selection::Toggle:
|
||||
|
@ -1199,7 +1199,7 @@ RouteTimeAxisView::selection_click (GdkEventButton* ev)
|
|||
_editor.get_selection().add (*tracks);
|
||||
} else {
|
||||
/* extend to the single track */
|
||||
_editor.extend_selection_to_track (*tracks->front());
|
||||
_editor.extend_selection_to_track (tracks->front());
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ RouteTimeAxisView::hide_click ()
|
|||
// LAME fix for hide_button refresh fix
|
||||
hide_button.set_sensitive(false);
|
||||
|
||||
_editor.hide_track_in_display (*this);
|
||||
_editor.hide_track_in_display (shared_from_this ());
|
||||
|
||||
hide_button.set_sensitive(true);
|
||||
}
|
||||
|
@ -1532,19 +1532,21 @@ RouteTimeAxisView::build_playlist_menu (Gtk::Menu * menu)
|
|||
playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteTimeAxisView::rename_current_playlist)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
boost::weak_ptr<TimeAxisView> v (shared_from_this ());
|
||||
|
||||
if (!route_group() || !route_group()->is_active()) {
|
||||
playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New"), bind(mem_fun(_editor, &PublicEditor::new_playlists), v)));
|
||||
playlist_items.push_back (MenuElem (_("New Copy"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), v)));
|
||||
|
||||
} else {
|
||||
// Use a label which tells the user what is happening
|
||||
playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(_editor, &PublicEditor::new_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("New Take"), bind(mem_fun(_editor, &PublicEditor::new_playlists), v)));
|
||||
playlist_items.push_back (MenuElem (_("Copy Take"), bind(mem_fun(_editor, &PublicEditor::copy_playlists), v)));
|
||||
|
||||
}
|
||||
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(_editor, &PublicEditor::clear_playlists), this)));
|
||||
playlist_items.push_back (MenuElem (_("Clear Current"), bind(mem_fun(_editor, &PublicEditor::clear_playlists), v)));
|
||||
playlist_items.push_back (SeparatorElem());
|
||||
|
||||
playlist_items.push_back (MenuElem(_("Select from all ..."), mem_fun(*this, &RouteTimeAxisView::show_playlist_selector)));
|
||||
|
@ -1908,9 +1910,10 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor>
|
|||
boost::shared_ptr<AutomationControl> control
|
||||
= boost::dynamic_pointer_cast<AutomationControl>(processor->data().control(what, true));
|
||||
|
||||
pan->view = boost::shared_ptr<AutomationTimeAxisView>(
|
||||
new AutomationTimeAxisView (_session, _route, processor, control,
|
||||
_editor, *this, false, parent_canvas, name, state_name));
|
||||
pan->view = AutomationTimeAxisView::create (
|
||||
_session, _route, processor, control,
|
||||
_editor, shared_from_this(), false, parent_canvas, name, state_name
|
||||
);
|
||||
|
||||
pan->view->Hiding.connect (bind (mem_fun(*this, &RouteTimeAxisView::processor_automation_track_hidden), pan, processor));
|
||||
|
||||
|
@ -2290,7 +2293,7 @@ RouteTimeAxisView::build_underlay_menu(Gtk::Menu* parent_menu) {
|
|||
parent_items.push_back (MenuElem (_("Underlays"), *gs_menu));
|
||||
|
||||
for(UnderlayList::iterator it = _underlay_streams.begin(); it != _underlay_streams.end(); ++it) {
|
||||
gs_items.push_back(MenuElem(string_compose(_("Remove \"%1\""), (*it)->trackview().name()),
|
||||
gs_items.push_back(MenuElem(string_compose(_("Remove \"%1\""), (*it)->trackview()->name()),
|
||||
bind(mem_fun(*this, &RouteTimeAxisView::remove_underlay), *it)));
|
||||
}
|
||||
}
|
||||
|
@ -2318,7 +2321,7 @@ RouteTimeAxisView::set_underlay_state()
|
|||
if (prop) {
|
||||
PBD::ID id (prop->value());
|
||||
|
||||
RouteTimeAxisView* v = _editor.get_route_view_by_id (id);
|
||||
RouteTimeAxisViewPtr v = _editor.get_route_view_by_id (id);
|
||||
|
||||
if (v) {
|
||||
add_underlay(v->view(), false);
|
||||
|
@ -2336,16 +2339,16 @@ RouteTimeAxisView::add_underlay(StreamView* v, bool update_xml)
|
|||
return;
|
||||
}
|
||||
|
||||
RouteTimeAxisView& other = v->trackview();
|
||||
RouteTimeAxisViewPtr other = v->trackview();
|
||||
|
||||
if(find(_underlay_streams.begin(), _underlay_streams.end(), v) == _underlay_streams.end()) {
|
||||
if(find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this) != other._underlay_mirrors.end()) {
|
||||
if (find (_underlay_streams.begin(), _underlay_streams.end(), v) == _underlay_streams.end()) {
|
||||
if (find (other->_underlay_mirrors.begin(), other->_underlay_mirrors.end(), this) != other->_underlay_mirrors.end()) {
|
||||
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
_underlay_streams.push_back(v);
|
||||
other._underlay_mirrors.push_back(this);
|
||||
other->_underlay_mirrors.push_back(this);
|
||||
|
||||
v->foreach_regionview(mem_fun(*this, &RouteTimeAxisView::add_ghost));
|
||||
|
||||
|
@ -2357,7 +2360,7 @@ RouteTimeAxisView::add_underlay(StreamView* v, bool update_xml)
|
|||
|
||||
XMLNode* node = underlay_xml_node->add_child("Underlay");
|
||||
XMLProperty* prop = node->add_property("id");
|
||||
prop->set_value(v->trackview().route()->id().to_s());
|
||||
prop->set_value(v->trackview()->route()->id().to_s());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2370,12 +2373,12 @@ RouteTimeAxisView::remove_underlay(StreamView* v)
|
|||
}
|
||||
|
||||
UnderlayList::iterator it = find(_underlay_streams.begin(), _underlay_streams.end(), v);
|
||||
RouteTimeAxisView& other = v->trackview();
|
||||
RouteTimeAxisViewPtr other = v->trackview();
|
||||
|
||||
if(it != _underlay_streams.end()) {
|
||||
UnderlayMirrorList::iterator gm = find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this);
|
||||
UnderlayMirrorList::iterator gm = find (other->_underlay_mirrors.begin(), other->_underlay_mirrors.end(), this);
|
||||
|
||||
if(gm == other._underlay_mirrors.end()) {
|
||||
if (gm == other->_underlay_mirrors.end()) {
|
||||
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
@ -2383,10 +2386,10 @@ RouteTimeAxisView::remove_underlay(StreamView* v)
|
|||
v->foreach_regionview(mem_fun(*this, &RouteTimeAxisView::remove_ghost));
|
||||
|
||||
_underlay_streams.erase(it);
|
||||
other._underlay_mirrors.erase(gm);
|
||||
other->_underlay_mirrors.erase(gm);
|
||||
|
||||
if(underlay_xml_node) {
|
||||
underlay_xml_node->remove_nodes_and_delete("id", v->trackview().route()->id().to_s());
|
||||
if (underlay_xml_node) {
|
||||
underlay_xml_node->remove_nodes_and_delete("id", v->trackview()->route()->id().to_s());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ Selection::clear_tracks ()
|
|||
void
|
||||
Selection::clear_time ()
|
||||
{
|
||||
time.track = 0;
|
||||
time.track.reset ();
|
||||
time.group = 0;
|
||||
time.clear();
|
||||
|
||||
|
@ -170,21 +170,22 @@ Selection::toggle (boost::shared_ptr<Playlist> pl)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::toggle (const list<TimeAxisView*>& track_list)
|
||||
Selection::toggle (const list<TimeAxisViewPtr>& track_list)
|
||||
{
|
||||
for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
|
||||
for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
|
||||
toggle ( (*i) );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Selection::toggle (TimeAxisView* track)
|
||||
Selection::toggle (TimeAxisViewPtr track)
|
||||
{
|
||||
TrackSelection::iterator i;
|
||||
|
||||
if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
|
||||
void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
|
||||
track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track));
|
||||
void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove;
|
||||
boost::weak_ptr<TimeAxisView> w (track);
|
||||
track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w));
|
||||
tracks.push_back (track);
|
||||
} else {
|
||||
tracks.erase (i);
|
||||
|
@ -268,13 +269,14 @@ Selection::add (const list<boost::shared_ptr<Playlist> >& pllist)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::add (const list<TimeAxisView*>& track_list)
|
||||
Selection::add (const list<TimeAxisViewPtr>& track_list)
|
||||
{
|
||||
list<TimeAxisView*> added = tracks.add (track_list);
|
||||
list<TimeAxisViewPtr> added = tracks.add (track_list);
|
||||
|
||||
for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) {
|
||||
void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
|
||||
(*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), (*i)));
|
||||
for (list<TimeAxisViewPtr>::const_iterator i = added.begin(); i != added.end(); ++i) {
|
||||
void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove;
|
||||
boost::weak_ptr<TimeAxisView> w (*i);
|
||||
(*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w));
|
||||
}
|
||||
|
||||
if (!added.empty()) {
|
||||
|
@ -283,10 +285,10 @@ Selection::add (const list<TimeAxisView*>& track_list)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::add (TimeAxisView* track)
|
||||
Selection::add (TimeAxisViewPtr track)
|
||||
{
|
||||
if (find (tracks.begin(), tracks.end(), track) == tracks.end()) {
|
||||
void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
|
||||
void (Selection::*pmf)(TimeAxisViewPtr) = &Selection::remove;
|
||||
track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track));
|
||||
tracks.push_back (track);
|
||||
TracksChanged();
|
||||
|
@ -305,7 +307,7 @@ Selection::add (vector<RegionView*>& v)
|
|||
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
|
||||
changed = regions.add ((*i));
|
||||
if (Config->get_link_region_and_track_selection() && changed) {
|
||||
add (&(*i)->get_trackview());
|
||||
add ((*i)->get_trackview());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -327,7 +329,7 @@ Selection::add (const RegionSelection& rs)
|
|||
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
|
||||
changed = regions.add ((*i));
|
||||
if (Config->get_link_region_and_track_selection() && changed) {
|
||||
add (&(*i)->get_trackview());
|
||||
add ((*i)->get_trackview());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +345,7 @@ Selection::add (RegionView* r)
|
|||
if (find (regions.begin(), regions.end(), r) == regions.end()) {
|
||||
regions.add (r);
|
||||
if (Config->get_link_region_and_track_selection()) {
|
||||
add (&r->get_trackview());
|
||||
add (r->get_trackview());
|
||||
}
|
||||
RegionsChanged ();
|
||||
}
|
||||
|
@ -402,9 +404,9 @@ Selection::add (boost::shared_ptr<Evoral::ControlList> cl)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::remove (TimeAxisView* track)
|
||||
Selection::remove (TimeAxisViewPtr track)
|
||||
{
|
||||
list<TimeAxisView*>::iterator i;
|
||||
list<TimeAxisViewPtr>::iterator i;
|
||||
if ((i = find (tracks.begin(), tracks.end(), track)) != tracks.end()) {
|
||||
tracks.erase (i);
|
||||
TracksChanged();
|
||||
|
@ -412,13 +414,22 @@ Selection::remove (TimeAxisView* track)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::remove (const list<TimeAxisView*>& track_list)
|
||||
Selection::remove (boost::weak_ptr<TimeAxisView> w)
|
||||
{
|
||||
boost::shared_ptr<TimeAxisView> t = w.lock ();
|
||||
if (t) {
|
||||
remove (t);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Selection::remove (const list<TimeAxisViewPtr>& track_list)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
|
||||
for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) {
|
||||
|
||||
list<TimeAxisView*>::iterator x;
|
||||
list<TimeAxisViewPtr>::iterator x;
|
||||
|
||||
if ((x = find (tracks.begin(), tracks.end(), (*i))) != tracks.end()) {
|
||||
tracks.erase (x);
|
||||
|
@ -469,7 +480,7 @@ Selection::remove (RegionView* r)
|
|||
}
|
||||
|
||||
if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_trackview())) {
|
||||
remove (&r->get_trackview());
|
||||
remove (r->get_trackview());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -507,14 +518,14 @@ Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac)
|
|||
}
|
||||
|
||||
void
|
||||
Selection::set (TimeAxisView* track)
|
||||
Selection::set (TimeAxisViewPtr track)
|
||||
{
|
||||
clear_tracks ();
|
||||
add (track);
|
||||
}
|
||||
|
||||
void
|
||||
Selection::set (const list<TimeAxisView*>& track_list)
|
||||
Selection::set (const list<TimeAxisViewPtr>& track_list)
|
||||
{
|
||||
clear_tracks ();
|
||||
add (track_list);
|
||||
|
@ -565,7 +576,7 @@ Selection::set (vector<RegionView*>& v)
|
|||
}
|
||||
|
||||
long
|
||||
Selection::set (TimeAxisView* track, nframes_t start, nframes_t end)
|
||||
Selection::set (TimeAxisViewPtr track, nframes_t start, nframes_t end)
|
||||
{
|
||||
if ((start == 0 && end == 0) || end < start) {
|
||||
return 0;
|
||||
|
@ -587,7 +598,7 @@ Selection::set (TimeAxisView* track, nframes_t start, nframes_t end)
|
|||
time.track = track;
|
||||
time.group = track->route_group();
|
||||
} else {
|
||||
time.track = 0;
|
||||
time.track.reset ();
|
||||
time.group = 0;
|
||||
}
|
||||
|
||||
|
@ -612,7 +623,7 @@ Selection::selected (Marker* m)
|
|||
}
|
||||
|
||||
bool
|
||||
Selection::selected (TimeAxisView* tv)
|
||||
Selection::selected (TimeAxisViewPtr tv)
|
||||
{
|
||||
return find (tracks.begin(), tracks.end(), tv) != tracks.end();
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class Selection : public sigc::trackable
|
|||
|
||||
void dump_region_layers();
|
||||
|
||||
bool selected (TimeAxisView*);
|
||||
bool selected (TimeAxisViewPtr);
|
||||
bool selected (RegionView*);
|
||||
bool selected (Marker*);
|
||||
|
||||
|
@ -105,11 +105,11 @@ class Selection : public sigc::trackable
|
|||
void add (std::list<Selectable*>&);
|
||||
void toggle (std::list<Selectable*>&);
|
||||
|
||||
void set (TimeAxisView*);
|
||||
void set (const std::list<TimeAxisView*>&);
|
||||
void set (TimeAxisViewPtr);
|
||||
void set (const std::list<TimeAxisViewPtr>&);
|
||||
void set (RegionView*, bool also_clear_tracks = true);
|
||||
void set (std::vector<RegionView*>&);
|
||||
long set (TimeAxisView*, nframes_t, nframes_t);
|
||||
long set (TimeAxisViewPtr, nframes_t, nframes_t);
|
||||
void set (boost::shared_ptr<Evoral::ControlList>);
|
||||
void set (boost::shared_ptr<ARDOUR::Playlist>);
|
||||
void set (const std::list<boost::shared_ptr<ARDOUR::Playlist> >&);
|
||||
|
@ -117,8 +117,8 @@ class Selection : public sigc::trackable
|
|||
void set (Marker*);
|
||||
void set (const RegionSelection&);
|
||||
|
||||
void toggle (TimeAxisView*);
|
||||
void toggle (const std::list<TimeAxisView*>&);
|
||||
void toggle (TimeAxisViewPtr);
|
||||
void toggle (const std::list<TimeAxisViewPtr>&);
|
||||
void toggle (RegionView*);
|
||||
void toggle (std::vector<RegionView*>&);
|
||||
long toggle (nframes_t, nframes_t);
|
||||
|
@ -128,8 +128,8 @@ class Selection : public sigc::trackable
|
|||
void toggle (const std::vector<AutomationSelectable*>&);
|
||||
void toggle (Marker*);
|
||||
|
||||
void add (TimeAxisView*);
|
||||
void add (const std::list<TimeAxisView*>&);
|
||||
void add (TimeAxisViewPtr);
|
||||
void add (const std::list<TimeAxisViewPtr>&);
|
||||
void add (RegionView*);
|
||||
void add (std::vector<RegionView*>&);
|
||||
long add (nframes_t, nframes_t);
|
||||
|
@ -140,8 +140,9 @@ class Selection : public sigc::trackable
|
|||
void add (const std::list<Marker*>&);
|
||||
void add (const RegionSelection&);
|
||||
|
||||
void remove (TimeAxisView*);
|
||||
void remove (const std::list<TimeAxisView*>&);
|
||||
void remove (TimeAxisViewPtr);
|
||||
void remove (const std::list<TimeAxisViewPtr>&);
|
||||
void remove (boost::weak_ptr<TimeAxisView>);
|
||||
void remove (RegionView*);
|
||||
void remove (uint32_t selection_id);
|
||||
void remove (nframes_t, nframes_t);
|
||||
|
|
25
gtk2_ardour/shared_ptrs.h
Normal file
25
gtk2_ardour/shared_ptrs.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class TimeAxisView;
|
||||
|
||||
typedef boost::shared_ptr<TimeAxisView> TimeAxisViewPtr;
|
||||
typedef boost::shared_ptr<const TimeAxisView> TimeAxisViewConstPtr;
|
||||
|
||||
class RouteTimeAxisView;
|
||||
|
||||
typedef boost::shared_ptr<RouteTimeAxisView> RouteTimeAxisViewPtr;
|
||||
typedef boost::shared_ptr<const RouteTimeAxisView> RouteTimeAxisViewConstPtr;
|
||||
|
||||
class AutomationTimeAxisView;
|
||||
|
||||
typedef boost::shared_ptr<AutomationTimeAxisView> AutomationTimeAxisViewPtr;
|
||||
typedef boost::shared_ptr<const AutomationTimeAxisView> AutomationTimeAxisViewConstPtr;
|
||||
|
||||
class AudioTimeAxisView;
|
||||
|
||||
typedef boost::shared_ptr<AudioTimeAxisView> AudioTimeAxisViewPtr;
|
||||
|
||||
class MidiTimeAxisView;
|
||||
|
||||
typedef boost::shared_ptr<MidiTimeAxisView> MidiTimeAxisViewPtr;
|
||||
typedef boost::shared_ptr<const MidiTimeAxisView> MidiTimeAxisViewConstPtr;
|
|
@ -46,20 +46,20 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
|
||||
StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
|
||||
StreamView::StreamView (RouteTimeAxisViewPtr tv, ArdourCanvas::Group* group)
|
||||
: _trackview (tv)
|
||||
, owns_canvas_group(group == 0)
|
||||
, _background_group (new ArdourCanvas::Group (*_trackview.canvas_background()))
|
||||
, canvas_group(group ? group : new ArdourCanvas::Group(*_trackview.canvas_display()))
|
||||
, _samples_per_unit (_trackview.editor().get_current_zoom ())
|
||||
, _background_group (new ArdourCanvas::Group (*_trackview->canvas_background()))
|
||||
, canvas_group(group ? group : new ArdourCanvas::Group(*_trackview->canvas_display()))
|
||||
, _samples_per_unit (_trackview->editor().get_current_zoom ())
|
||||
, rec_updating(false)
|
||||
, rec_active(false)
|
||||
, use_rec_regions (tv.editor().show_waveforms_recording ())
|
||||
, region_color(_trackview.color())
|
||||
, use_rec_regions (tv->editor().show_waveforms_recording ())
|
||||
, region_color(_trackview->color())
|
||||
, stream_base_color(0xFFFFFFFF)
|
||||
, _layers (1)
|
||||
, _layer_display (Overlaid)
|
||||
, height(tv.height)
|
||||
, height(tv->height)
|
||||
, last_rec_data_frame(0)
|
||||
{
|
||||
/* set_position() will position the group */
|
||||
|
@ -67,26 +67,27 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* group)
|
|||
canvas_rect = new ArdourCanvas::SimpleRect (*_background_group);
|
||||
canvas_rect->property_x1() = 0.0;
|
||||
canvas_rect->property_y1() = 0.0;
|
||||
canvas_rect->property_x2() = _trackview.editor().get_physical_screen_width ();
|
||||
canvas_rect->property_y2() = (double) tv.current_height();
|
||||
canvas_rect->property_x2() = _trackview->editor().get_physical_screen_width ();
|
||||
canvas_rect->property_y2() = (double) tv->current_height();
|
||||
canvas_rect->raise(1); // raise above tempo lines
|
||||
|
||||
canvas_rect->property_outline_what() = (guint32) (0x2|0x8); // outline RHS and bottom
|
||||
|
||||
boost::weak_ptr<TimeAxisView> w (_trackview);
|
||||
canvas_rect->signal_event().connect (bind (
|
||||
mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event),
|
||||
canvas_rect, &_trackview));
|
||||
mem_fun (_trackview->editor(), &PublicEditor::canvas_stream_view_event),
|
||||
canvas_rect, w));
|
||||
|
||||
if (_trackview.is_track()) {
|
||||
_trackview.track()->DiskstreamChanged.connect (
|
||||
if (_trackview->is_track()) {
|
||||
_trackview->track()->DiskstreamChanged.connect (
|
||||
mem_fun (*this, &StreamView::diskstream_changed));
|
||||
_trackview.session().TransportStateChange.connect (
|
||||
_trackview->session().TransportStateChange.connect (
|
||||
mem_fun (*this, &StreamView::transport_changed));
|
||||
_trackview.session().TransportLooped.connect (
|
||||
_trackview->session().TransportLooped.connect (
|
||||
mem_fun (*this, &StreamView::transport_looped));
|
||||
_trackview.get_diskstream()->RecordEnableChanged.connect (
|
||||
_trackview->get_diskstream()->RecordEnableChanged.connect (
|
||||
mem_fun (*this, &StreamView::rec_enable_changed));
|
||||
_trackview.session().RecordStateChanged.connect (
|
||||
_trackview->session().RecordStateChanged.connect (
|
||||
mem_fun (*this, &StreamView::sess_rec_enable_changed));
|
||||
}
|
||||
|
||||
|
@ -107,8 +108,8 @@ StreamView::~StreamView ()
|
|||
void
|
||||
StreamView::attach ()
|
||||
{
|
||||
if (_trackview.is_track()) {
|
||||
display_diskstream (_trackview.get_diskstream());
|
||||
if (_trackview->is_track()) {
|
||||
display_diskstream (_trackview->get_diskstream());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,8 +160,8 @@ StreamView::set_samples_per_unit (gdouble spp)
|
|||
for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) {
|
||||
RecBoxInfo &recbox = (*xi);
|
||||
|
||||
gdouble xstart = _trackview.editor().frame_to_pixel (recbox.start);
|
||||
gdouble xend = _trackview.editor().frame_to_pixel (recbox.start + recbox.length);
|
||||
gdouble xstart = _trackview->editor().frame_to_pixel (recbox.start);
|
||||
gdouble xend = _trackview->editor().frame_to_pixel (recbox.start + recbox.length);
|
||||
|
||||
recbox.rectangle->property_x1() = xstart;
|
||||
recbox.rectangle->property_x2() = xend;
|
||||
|
@ -372,7 +373,7 @@ StreamView::diskstream_changed ()
|
|||
{
|
||||
boost::shared_ptr<Track> t;
|
||||
|
||||
if ((t = _trackview.track()) != 0) {
|
||||
if ((t = _trackview->track()) != 0) {
|
||||
Gtkmm2ext::UI::instance()->call_slot (bind (
|
||||
mem_fun (*this, &StreamView::display_diskstream),
|
||||
t->diskstream()));
|
||||
|
@ -444,23 +445,23 @@ StreamView::update_rec_box ()
|
|||
if (rec_active && rec_rects.size() > 0) {
|
||||
/* only update the last box */
|
||||
RecBoxInfo & rect = rec_rects.back();
|
||||
nframes_t at = _trackview.get_diskstream()->current_capture_end();
|
||||
nframes_t at = _trackview->get_diskstream()->current_capture_end();
|
||||
double xstart;
|
||||
double xend;
|
||||
|
||||
switch (_trackview.track()->mode()) {
|
||||
switch (_trackview->track()->mode()) {
|
||||
|
||||
case NonLayered:
|
||||
case Normal:
|
||||
rect.length = at - rect.start;
|
||||
xstart = _trackview.editor().frame_to_pixel (rect.start);
|
||||
xend = _trackview.editor().frame_to_pixel (at);
|
||||
xstart = _trackview->editor().frame_to_pixel (rect.start);
|
||||
xend = _trackview->editor().frame_to_pixel (at);
|
||||
break;
|
||||
|
||||
case Destructive:
|
||||
rect.length = 2;
|
||||
xstart = _trackview.editor().frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
|
||||
xend = _trackview.editor().frame_to_pixel (at);
|
||||
xstart = _trackview->editor().frame_to_pixel (_trackview->get_diskstream()->current_capture_start());
|
||||
xend = _trackview->editor().frame_to_pixel (at);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "enums.h"
|
||||
#include "simplerect.h"
|
||||
#include "canvas.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
namespace Gdk {
|
||||
class Color;
|
||||
|
@ -58,8 +59,8 @@ class StreamView : public sigc::trackable
|
|||
public:
|
||||
virtual ~StreamView ();
|
||||
|
||||
RouteTimeAxisView& trackview() { return _trackview; }
|
||||
const RouteTimeAxisView& trackview() const { return _trackview; }
|
||||
RouteTimeAxisViewPtr trackview() { return _trackview; }
|
||||
const RouteTimeAxisViewPtr trackview() const { return _trackview; }
|
||||
|
||||
void attach ();
|
||||
|
||||
|
@ -112,7 +113,7 @@ public:
|
|||
sigc::signal<void> HeightChanged;
|
||||
|
||||
protected:
|
||||
StreamView (RouteTimeAxisView&, ArdourCanvas::Group* group = NULL);
|
||||
StreamView (RouteTimeAxisViewPtr, ArdourCanvas::Group* group = NULL);
|
||||
|
||||
void transport_changed();
|
||||
void transport_looped();
|
||||
|
@ -137,7 +138,7 @@ protected:
|
|||
|
||||
virtual void color_handler () = 0;
|
||||
|
||||
RouteTimeAxisView& _trackview;
|
||||
RouteTimeAxisViewPtr _trackview;
|
||||
bool owns_canvas_group;
|
||||
ArdourCanvas::Group* _background_group;
|
||||
ArdourCanvas::Group* canvas_group;
|
||||
|
|
|
@ -49,7 +49,7 @@ const TimeAxisViewItem::Visibility TapeAudioRegionView::default_tape_visibility
|
|||
TimeAxisViewItem::HideFrameRight |
|
||||
TimeAxisViewItem::FullWidthNameHighlight);
|
||||
|
||||
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
|
||||
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisViewPtr tv,
|
||||
boost::shared_ptr<AudioRegion> r,
|
||||
double spu,
|
||||
Gdk::Color const & basic_color)
|
||||
|
|
|
@ -28,7 +28,7 @@ class TapeAudioRegionView : public AudioRegionView
|
|||
{
|
||||
public:
|
||||
TapeAudioRegionView (ArdourCanvas::Group *,
|
||||
RouteTimeAxisView&,
|
||||
RouteTimeAxisViewPtr,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double initial_samples_per_unit,
|
||||
Gdk::Color const & base_color);
|
||||
|
|
|
@ -74,7 +74,7 @@ uint32_t TimeAxisView::hSmall = 0;
|
|||
bool TimeAxisView::need_size_info = true;
|
||||
int const TimeAxisView::_max_order = 512;
|
||||
|
||||
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas)
|
||||
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisViewPtr rent, Canvas& canvas)
|
||||
: AxisView (sess),
|
||||
controls_table (2, 8),
|
||||
_y_position (0),
|
||||
|
@ -338,7 +338,7 @@ void
|
|||
TimeAxisView::selection_click (GdkEventButton* ev)
|
||||
{
|
||||
Selection::Operation op = Keyboard::selection_type (ev->state);
|
||||
_editor.set_selected_track (*this, op, false);
|
||||
_editor.set_selected_track (shared_from_this (), op, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -367,7 +367,7 @@ TimeAxisView::hide ()
|
|||
|
||||
/* if its hidden, it cannot be selected */
|
||||
|
||||
_editor.get_selection().remove (this);
|
||||
_editor.get_selection().remove (shared_from_this ());
|
||||
|
||||
Hiding ();
|
||||
}
|
||||
|
@ -436,9 +436,9 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
|||
case GDK_ISO_Left_Tab:
|
||||
case GDK_Tab:
|
||||
name_entry_changed ();
|
||||
allviews = _editor.get_valid_views (0);
|
||||
allviews = _editor.get_valid_views (TimeAxisViewPtr ());
|
||||
if (allviews != 0) {
|
||||
i = find (allviews->begin(), allviews->end(), this);
|
||||
i = find (allviews->begin(), allviews->end(), shared_from_this ());
|
||||
if (ev->keyval == GDK_Tab) {
|
||||
if (i != allviews->end()) {
|
||||
do {
|
||||
|
@ -564,8 +564,8 @@ TimeAxisView::conditionally_add_to_selection ()
|
|||
{
|
||||
Selection& s (_editor.get_selection ());
|
||||
|
||||
if (!s.selected (this)) {
|
||||
_editor.set_selected_track (*this, Selection::Set);
|
||||
if (!s.selected (shared_from_this ())) {
|
||||
_editor.set_selected_track (shared_from_this (), Selection::Set);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -878,12 +878,10 @@ TimeAxisView::get_selection_rect (uint32_t id)
|
|||
return rect;
|
||||
}
|
||||
|
||||
struct null_deleter { void operator()(void const *) const {} };
|
||||
|
||||
bool
|
||||
TimeAxisView::is_child (TimeAxisView* tav)
|
||||
TimeAxisView::is_child (TimeAxisViewPtr tav)
|
||||
{
|
||||
return find (children.begin(), children.end(), boost::shared_ptr<TimeAxisView>(tav, null_deleter())) != children.end();
|
||||
return find (children.begin(), children.end(), tav) != children.end();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -917,7 +915,7 @@ TimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>& resul
|
|||
void
|
||||
TimeAxisView::add_ghost (RegionView* rv)
|
||||
{
|
||||
GhostRegion* gr = rv->add_ghost (*this);
|
||||
GhostRegion* gr = rv->add_ghost (shared_from_this ());
|
||||
|
||||
if(gr) {
|
||||
ghosts.push_back(gr);
|
||||
|
@ -926,8 +924,9 @@ TimeAxisView::add_ghost (RegionView* rv)
|
|||
}
|
||||
|
||||
void
|
||||
TimeAxisView::remove_ghost (RegionView* rv) {
|
||||
rv->remove_ghost_in (*this);
|
||||
TimeAxisView::remove_ghost (RegionView* rv)
|
||||
{
|
||||
rv->remove_ghost_in (shared_from_this ());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -961,9 +960,9 @@ TimeAxisView::touched (double top, double bot)
|
|||
}
|
||||
|
||||
void
|
||||
TimeAxisView::set_parent (TimeAxisView& p)
|
||||
TimeAxisView::set_parent (TimeAxisViewPtr p)
|
||||
{
|
||||
parent = &p;
|
||||
parent = p;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -972,16 +971,12 @@ TimeAxisView::has_state () const
|
|||
return _has_state;
|
||||
}
|
||||
|
||||
TimeAxisView*
|
||||
TimeAxisViewPtr
|
||||
TimeAxisView::get_parent_with_state ()
|
||||
{
|
||||
if (parent == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parent->has_state()) {
|
||||
if (parent == 0 || parent->has_state()) {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
|
||||
return parent->get_parent_with_state ();
|
||||
}
|
||||
|
@ -1194,11 +1189,11 @@ TimeAxisView::color_handler ()
|
|||
* Layer index is the layer number if the TimeAxisView is valid and is in stacked
|
||||
* region display mode, otherwise 0.
|
||||
*/
|
||||
std::pair<TimeAxisView*, layer_t>
|
||||
std::pair<TimeAxisViewPtr, layer_t>
|
||||
TimeAxisView::covers_y_position (double y)
|
||||
{
|
||||
if (hidden()) {
|
||||
return std::make_pair ( (TimeAxisView *) 0, 0);
|
||||
return std::make_pair (TimeAxisViewPtr (), 0);
|
||||
}
|
||||
|
||||
if (_y_position <= y && y < (_y_position + height)) {
|
||||
|
@ -1220,13 +1215,13 @@ TimeAxisView::covers_y_position (double y)
|
|||
|
||||
for (Children::const_iterator i = children.begin(); i != children.end(); ++i) {
|
||||
|
||||
std::pair<TimeAxisView*, int> const r = (*i)->covers_y_position (y);
|
||||
std::pair<TimeAxisViewPtr, int> const r = (*i)->covers_y_position (y);
|
||||
if (r.first) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_pair ( (TimeAxisView *) 0, 0);
|
||||
return std::make_pair (TimeAxisViewPtr (), 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1302,7 +1297,7 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev)
|
|||
}
|
||||
|
||||
int32_t const delta = (int32_t) floor (ev->y_root - _resize_drag_start);
|
||||
_editor.add_to_idle_resize (this, delta);
|
||||
_editor.add_to_idle_resize (shared_from_this (), delta);
|
||||
_resize_drag_start = ev->y_root;
|
||||
|
||||
return true;
|
||||
|
@ -1349,3 +1344,17 @@ TimeAxisView::resizer_expose (GdkEventExpose* event)
|
|||
return true;
|
||||
}
|
||||
|
||||
TimeAxisViewPtr
|
||||
TimeAxisView::find_time_axis (TimeAxisView* v)
|
||||
{
|
||||
Children::iterator i = children.begin ();
|
||||
while (i != children.end() && i->get() != v) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (i == children.end()) {
|
||||
return TimeAxisViewPtr ();
|
||||
}
|
||||
|
||||
return *i;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/frame.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
|
@ -44,6 +46,7 @@
|
|||
#include "enums.h"
|
||||
#include "editing.h"
|
||||
#include "canvas.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class Session;
|
||||
|
@ -73,7 +76,7 @@ class StreamView;
|
|||
* This class provides the basic LHS controls and display methods. This should be
|
||||
* extended to create functional time-axis based views.
|
||||
*/
|
||||
class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
||||
class TimeAxisView : public virtual AxisView, public PBD::Stateful, public boost::enable_shared_from_this<TimeAxisView>
|
||||
{
|
||||
private:
|
||||
enum NamePackingBits {
|
||||
|
@ -89,7 +92,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
static uint32_t hSmaller;
|
||||
static uint32_t hSmall;
|
||||
|
||||
TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
|
||||
TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisViewPtr parent, ArdourCanvas::Canvas& canvas);
|
||||
virtual ~TimeAxisView ();
|
||||
|
||||
XMLNode& get_state ();
|
||||
|
@ -153,7 +156,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
virtual void set_height (uint32_t h);
|
||||
void reset_height();
|
||||
|
||||
std::pair<TimeAxisView*, ARDOUR::layer_t> covers_y_position (double);
|
||||
std::pair<TimeAxisViewPtr, ARDOUR::layer_t> covers_y_position (double);
|
||||
|
||||
/**
|
||||
* Steps through the defined heights for this TrackView.
|
||||
|
@ -204,8 +207,8 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
expensive data loading/redisplay code in here. */
|
||||
virtual void first_idle () {}
|
||||
|
||||
TimeAxisView* get_parent () { return parent; }
|
||||
void set_parent (TimeAxisView& p);
|
||||
TimeAxisViewPtr get_parent () { return parent; }
|
||||
void set_parent (TimeAxisViewPtr p);
|
||||
bool has_state () const;
|
||||
|
||||
/* call this on the parent */
|
||||
|
@ -214,6 +217,8 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
|
||||
virtual LayerDisplay layer_display () const { return Overlaid; }
|
||||
virtual StreamView* view () const { return 0; }
|
||||
|
||||
TimeAxisViewPtr find_time_axis (TimeAxisView *);
|
||||
|
||||
typedef std::vector<boost::shared_ptr<TimeAxisView> > Children;
|
||||
|
||||
|
@ -293,16 +298,16 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||
|
||||
Gtk::Label name_label;
|
||||
|
||||
TimeAxisView* parent;
|
||||
TimeAxisViewPtr parent;
|
||||
|
||||
/** Find the parent with state */
|
||||
TimeAxisView* get_parent_with_state();
|
||||
TimeAxisViewPtr get_parent_with_state();
|
||||
|
||||
Children children;
|
||||
bool is_child (TimeAxisView*);
|
||||
bool is_child (TimeAxisViewPtr);
|
||||
|
||||
void remove_child (boost::shared_ptr<TimeAxisView>);
|
||||
void add_child (boost::shared_ptr<TimeAxisView>);
|
||||
void remove_child (TimeAxisViewPtr);
|
||||
void add_child (TimeAxisViewPtr);
|
||||
|
||||
/* selection display */
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
|
|||
* @param start the start point of this item
|
||||
* @param duration the duration of this item
|
||||
*/
|
||||
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
|
||||
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisViewPtr tv, double spu, Gdk::Color const & base_color,
|
||||
nframes_t start, nframes_t duration, bool recording,
|
||||
Visibility vis)
|
||||
: trackview (tv), _recregion(recording)
|
||||
|
@ -144,14 +144,14 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & ba
|
|||
warning << "Time Axis Item Duration == 0" << endl ;
|
||||
}
|
||||
|
||||
vestigial_frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, 2.0, trackview.current_height());
|
||||
vestigial_frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, 2.0, trackview->current_height());
|
||||
vestigial_frame->hide ();
|
||||
vestigial_frame->property_outline_what() = 0xF;
|
||||
vestigial_frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
|
||||
vestigial_frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
|
||||
|
||||
if (visibility & ShowFrame) {
|
||||
frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, trackview.editor().frame_to_pixel(duration), trackview.current_height());
|
||||
frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, trackview->editor().frame_to_pixel(duration), trackview->current_height());
|
||||
frame->property_outline_pixels() = 1;
|
||||
frame->property_outline_what() = 0xF;
|
||||
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
|
||||
|
@ -180,9 +180,9 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & ba
|
|||
|
||||
if (visibility & ShowNameHighlight) {
|
||||
if (visibility & FullWidthNameHighlight) {
|
||||
name_highlight = new ArdourCanvas::SimpleRect (*group, 0.0, trackview.editor().frame_to_pixel(item_duration), trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height() - 1);
|
||||
name_highlight = new ArdourCanvas::SimpleRect (*group, 0.0, trackview->editor().frame_to_pixel(item_duration), trackview->current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview->current_height() - 1);
|
||||
} else {
|
||||
name_highlight = new ArdourCanvas::SimpleRect (*group, 1.0, trackview.editor().frame_to_pixel(item_duration) - 1, trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height() - 1);
|
||||
name_highlight = new ArdourCanvas::SimpleRect (*group, 1.0, trackview->editor().frame_to_pixel(item_duration) - 1, trackview->current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview->current_height() - 1);
|
||||
}
|
||||
name_highlight->set_data ("timeaxisviewitem", this);
|
||||
|
||||
|
@ -193,7 +193,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & ba
|
|||
if (visibility & ShowNameText) {
|
||||
name_pixbuf = new ArdourCanvas::Pixbuf(*group);
|
||||
name_pixbuf->property_x() = NAME_X_OFFSET;
|
||||
name_pixbuf->property_y() = trackview.current_height() - 1.0 - NAME_Y_OFFSET;
|
||||
name_pixbuf->property_y() = trackview->current_height() - 1.0 - NAME_Y_OFFSET;
|
||||
|
||||
} else {
|
||||
name_pixbuf = 0;
|
||||
|
@ -206,7 +206,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & ba
|
|||
frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 1.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH+1);
|
||||
frame_handle_start->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
|
||||
|
||||
frame_handle_end = new ArdourCanvas::SimpleRect (*group, trackview.editor().frame_to_pixel(get_duration()) - TimeAxisViewItem::GRAB_HANDLE_LENGTH, trackview.editor().frame_to_pixel(get_duration()), 1.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1);
|
||||
frame_handle_end = new ArdourCanvas::SimpleRect (*group, trackview->editor().frame_to_pixel(get_duration()) - TimeAxisViewItem::GRAB_HANDLE_LENGTH, trackview->editor().frame_to_pixel(get_duration()), 1.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1);
|
||||
frame_handle_end->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
|
||||
|
||||
} else {
|
||||
|
@ -308,7 +308,7 @@ TimeAxisViewItem::set_duration (nframes_t dur, void* src)
|
|||
|
||||
item_duration = dur;
|
||||
|
||||
reset_width_dependent_items (trackview.editor().frame_to_pixel (dur));
|
||||
reset_width_dependent_items (trackview->editor().frame_to_pixel (dur));
|
||||
|
||||
DurationChanged (dur, src) ; /* EMIT_SIGNAL */
|
||||
return true;
|
||||
|
@ -510,8 +510,8 @@ TimeAxisViewItem::set_should_show_selection (bool yn)
|
|||
*
|
||||
* @return the timeAxisView that this item is placed upon
|
||||
*/
|
||||
TimeAxisView&
|
||||
TimeAxisViewItem::get_time_axis_view()
|
||||
TimeAxisViewPtr
|
||||
TimeAxisViewItem::get_time_axis_view ()
|
||||
{
|
||||
return trackview;
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
|
|||
double font_size;
|
||||
|
||||
font_size = NAME_FONT->get_size() / Pango::SCALE;
|
||||
it_width = trackview.editor().frame_to_pixel(item_duration);
|
||||
it_width = trackview->editor().frame_to_pixel(item_duration);
|
||||
pb_width = new_name.length() * font_size;
|
||||
|
||||
if (pb_width > it_width - NAME_X_OFFSET) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "selectable.h"
|
||||
#include "simplerect.h"
|
||||
#include "canvas.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
class TimeAxisView;
|
||||
|
||||
|
@ -188,7 +189,7 @@ class TimeAxisViewItem : public Selectable
|
|||
*
|
||||
* @return the timeAxisView that this item is placed upon
|
||||
*/
|
||||
TimeAxisView& get_time_axis_view() ;
|
||||
TimeAxisViewPtr get_time_axis_view() ;
|
||||
|
||||
//---------------------------------------------------------------------------------------//
|
||||
// ui methods & data
|
||||
|
@ -239,7 +240,7 @@ class TimeAxisViewItem : public Selectable
|
|||
/**
|
||||
* Returns the time axis that this item is upon
|
||||
*/
|
||||
TimeAxisView& get_trackview() const { return trackview; }
|
||||
TimeAxisViewPtr get_trackview() const { return trackview; }
|
||||
|
||||
/**
|
||||
* Sets the samples per unit of this item.
|
||||
|
@ -341,7 +342,7 @@ class TimeAxisViewItem : public Selectable
|
|||
* @param start the start point of this item
|
||||
* @param duration the duration of this item
|
||||
*/
|
||||
TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
|
||||
TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisViewPtr tv, double spu, Gdk::Color const & base_color,
|
||||
nframes_t start, nframes_t duration, bool recording = false, Visibility v = Visibility (0));
|
||||
|
||||
TimeAxisViewItem (const TimeAxisViewItem& other);
|
||||
|
@ -385,7 +386,7 @@ class TimeAxisViewItem : public Selectable
|
|||
static gint idle_remove_this_item(TimeAxisViewItem* item, void* src) ;
|
||||
|
||||
/** The time axis that this item is upon */
|
||||
TimeAxisView& trackview ;
|
||||
TimeAxisViewPtr trackview ;
|
||||
|
||||
/** indicates whether this item is locked to its current position */
|
||||
bool position_locked ;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <list>
|
||||
#include "ardour/types.h"
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class RouteGroup;
|
||||
|
@ -41,7 +42,7 @@ struct TimeSelection : public std::list<ARDOUR::AudioRange> {
|
|||
the group.
|
||||
*/
|
||||
|
||||
TimeAxisView* track;
|
||||
TimeAxisViewPtr track;
|
||||
ARDOUR::RouteGroup* group;
|
||||
|
||||
ARDOUR::AudioRange& operator[](uint32_t);
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
TrackSelection::TrackSelection (list<TimeAxisView*> const &t)
|
||||
: list<TimeAxisView*> (t)
|
||||
TrackSelection::TrackSelection (list<TimeAxisViewPtr> const &t)
|
||||
: list<TimeAxisViewPtr> (t)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
list<TimeAxisView*>
|
||||
TrackSelection::add (list<TimeAxisView*> const & t)
|
||||
list<TimeAxisViewPtr>
|
||||
TrackSelection::add (list<TimeAxisViewPtr> const & t)
|
||||
{
|
||||
list<TimeAxisView*> added;
|
||||
list<TimeAxisViewPtr> added;
|
||||
|
||||
for (TrackSelection::const_iterator i = t.begin(); i != t.end(); ++i) {
|
||||
if (!contains (*i)) {
|
||||
|
@ -25,7 +25,7 @@ TrackSelection::add (list<TimeAxisView*> const & t)
|
|||
}
|
||||
|
||||
bool
|
||||
TrackSelection::contains (TimeAxisView const * t) const
|
||||
TrackSelection::contains (TimeAxisViewConstPtr t) const
|
||||
{
|
||||
return find (begin(), end(), t) != end();
|
||||
}
|
||||
|
|
|
@ -21,17 +21,18 @@
|
|||
#define __ardour_gtk_track_selection_h__
|
||||
|
||||
#include <list>
|
||||
#include "shared_ptrs.h"
|
||||
|
||||
class TimeAxisView;
|
||||
|
||||
class TrackSelection : public std::list<TimeAxisView*>
|
||||
class TrackSelection : public std::list<TimeAxisViewPtr>
|
||||
{
|
||||
public:
|
||||
TrackSelection () {}
|
||||
|
||||
TrackSelection (std::list<TimeAxisView*> const &);
|
||||
std::list<TimeAxisView*> add (std::list<TimeAxisView*> const &);
|
||||
bool contains (TimeAxisView const *) const;
|
||||
TrackSelection (std::list<TimeAxisViewPtr> const &);
|
||||
std::list<TimeAxisViewPtr> add (std::list<TimeAxisViewPtr> const &);
|
||||
bool contains (TimeAxisViewConstPtr) const;
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_track_selection_h__ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user