2006-07-23 08:03:19 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2001, 2006 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
#include <cassert>
|
2007-05-31 17:37:20 -04:00
|
|
|
#include <utility>
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
|
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
|
|
|
|
|
|
|
#include <ardour/audioplaylist.h>
|
|
|
|
#include <ardour/audioregion.h>
|
2006-08-29 17:21:48 -04:00
|
|
|
#include <ardour/audiofilesource.h>
|
2006-07-23 08:03:19 -04:00
|
|
|
#include <ardour/audio_diskstream.h>
|
|
|
|
#include <ardour/audio_track.h>
|
|
|
|
#include <ardour/playlist_templates.h>
|
|
|
|
#include <ardour/source.h>
|
2006-08-29 17:21:48 -04:00
|
|
|
#include <ardour/region_factory.h>
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
#include "audio_streamview.h"
|
2006-08-01 13:19:38 -04:00
|
|
|
#include "audio_region_view.h"
|
|
|
|
#include "tape_region_view.h"
|
2006-07-23 08:03:19 -04:00
|
|
|
#include "audio_time_axis.h"
|
|
|
|
#include "canvas-waveview.h"
|
|
|
|
#include "canvas-simplerect.h"
|
|
|
|
#include "region_selection.h"
|
|
|
|
#include "selection.h"
|
|
|
|
#include "public_editor.h"
|
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "crossfade_view.h"
|
|
|
|
#include "rgb_macros.h"
|
|
|
|
#include "gui_thread.h"
|
|
|
|
#include "utils.h"
|
|
|
|
|
2007-01-28 12:44:13 -05:00
|
|
|
#include "i18n.h"
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
using namespace std;
|
2006-07-23 08:03:19 -04:00
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace PBD;
|
|
|
|
using namespace Editing;
|
|
|
|
|
|
|
|
AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
|
|
|
|
: StreamView (tv)
|
|
|
|
{
|
|
|
|
crossfades_visible = true;
|
2007-01-09 18:24:54 -05:00
|
|
|
_waveform_scale = LinearWaveform;
|
|
|
|
_waveform_shape = Traditional;
|
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
if (tv.is_track())
|
2007-06-29 13:13:09 -04:00
|
|
|
stream_base_color = ARDOUR_UI::config()->canvasvar_AudioTrackBase.get();
|
2006-07-23 08:03:19 -04:00
|
|
|
else
|
2007-06-29 13:13:09 -04:00
|
|
|
stream_base_color = ARDOUR_UI::config()->canvasvar_AudioBusBase.get();
|
2006-08-01 20:22:16 -04:00
|
|
|
|
|
|
|
canvas_rect->property_fill_color_rgba() = stream_base_color;
|
2007-06-15 18:08:27 -04:00
|
|
|
canvas_rect->property_outline_color_rgba() = RGBA_BLACK;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
_amplitude_above_axis = 1.0;
|
|
|
|
|
|
|
|
use_rec_regions = tv.editor.show_waveforms_recording ();
|
2006-09-18 23:29:16 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
AudioStreamView::~AudioStreamView ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
AudioStreamView::set_samples_per_unit (gdouble spp)
|
|
|
|
{
|
|
|
|
StreamView::set_samples_per_unit(spp);
|
|
|
|
|
|
|
|
for (CrossfadeViewList::iterator xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) {
|
|
|
|
(*xi)->set_samples_per_unit (spp);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
AudioStreamView::set_amplitude_above_axis (gdouble app)
|
|
|
|
{
|
|
|
|
RegionViewList::iterator i;
|
|
|
|
|
|
|
|
if (app < 1.0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
_amplitude_above_axis = app;
|
|
|
|
|
|
|
|
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
if (arv)
|
|
|
|
arv->set_amplitude_above_axis (app);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
RegionView*
|
2006-08-29 17:21:48 -04:00
|
|
|
AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2007-01-28 12:44:13 -05:00
|
|
|
AudioRegionView *region_view = 0;
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r);
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
if (region == 0) {
|
2007-05-31 17:37:20 -04:00
|
|
|
return NULL;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
for (list<RegionView *>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2006-08-29 17:21:48 -04:00
|
|
|
if ((*i)->region() == r) {
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
/* great. we already have a AudioRegionView for this Region. use it again. */
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
(*i)->set_valid (true);
|
2007-01-09 18:24:54 -05:00
|
|
|
|
|
|
|
// this might not be necessary
|
|
|
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
if (arv) {
|
|
|
|
arv->set_waveform_scale (_waveform_scale);
|
|
|
|
arv->set_waveform_shape (_waveform_shape);
|
|
|
|
}
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
return NULL;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
}
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
switch (_trackview.audio_track()->mode()) {
|
|
|
|
case Normal:
|
2006-08-29 17:21:48 -04:00
|
|
|
region_view = new AudioRegionView (canvas_group, _trackview, region,
|
2006-07-23 08:03:19 -04:00
|
|
|
_samples_per_unit, region_color);
|
|
|
|
break;
|
|
|
|
case Destructive:
|
2006-08-29 17:21:48 -04:00
|
|
|
region_view = new TapeAudioRegionView (canvas_group, _trackview, region,
|
2006-07-23 08:03:19 -04:00
|
|
|
_samples_per_unit, region_color);
|
|
|
|
break;
|
2007-01-28 12:44:13 -05:00
|
|
|
default:
|
|
|
|
fatal << string_compose (_("programming error: %1"), "illegal track mode in ::add_region_view_internal") << endmsg;
|
|
|
|
/*NOTREACHED*/
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
region_view->init (region_color, wait_for_waves);
|
|
|
|
region_view->set_amplitude_above_axis(_amplitude_above_axis);
|
|
|
|
region_views.push_front (region_view);
|
2007-01-09 18:24:54 -05:00
|
|
|
|
2007-04-12 19:20:37 -04:00
|
|
|
|
|
|
|
/* if its the special single-sample length that we use for rec-regions, make it
|
|
|
|
insensitive to events
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (region->length() == 1) {
|
|
|
|
region_view->set_sensitive (false);
|
|
|
|
}
|
|
|
|
|
2007-01-09 18:24:54 -05:00
|
|
|
/* if this was the first one, then lets query the waveform scale and shape.
|
|
|
|
otherwise, we set it to the current value */
|
|
|
|
|
|
|
|
if (region_views.size() == 1) {
|
|
|
|
if (region_view->waveform_logscaled()) {
|
|
|
|
_waveform_scale = LogWaveform;
|
|
|
|
} else {
|
|
|
|
_waveform_scale = LinearWaveform;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (region_view->waveform_rectified()) {
|
|
|
|
_waveform_shape = Rectified;
|
|
|
|
} else {
|
|
|
|
_waveform_shape = Traditional;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
region_view->set_waveform_scale(_waveform_scale);
|
|
|
|
region_view->set_waveform_shape(_waveform_shape);
|
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
/* follow global waveform setting */
|
|
|
|
|
|
|
|
region_view->set_waveform_visible(_trackview.editor.show_waveforms());
|
|
|
|
|
|
|
|
/* catch regionview going away */
|
2006-10-21 15:01:50 -04:00
|
|
|
region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_region_view), boost::weak_ptr<Region> (r)));
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
RegionViewAdded (region_view);
|
2007-05-31 17:37:20 -04:00
|
|
|
|
|
|
|
return region_view;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-10-21 15:01:50 -04:00
|
|
|
AudioStreamView::remove_region_view (boost::weak_ptr<Region> weak_r)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2006-10-21 15:01:50 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::remove_region_view), weak_r));
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
boost::shared_ptr<Region> r (weak_r.lock());
|
|
|
|
|
|
|
|
if (!r) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_trackview.session().deletion_in_progress()) {
|
|
|
|
|
|
|
|
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end();) {
|
|
|
|
list<CrossfadeView*>::iterator tmp;
|
|
|
|
|
|
|
|
tmp = i;
|
|
|
|
++tmp;
|
|
|
|
|
|
|
|
boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(r);
|
2007-01-11 14:50:49 -05:00
|
|
|
if (ar && (*i)->crossfade->involves (ar)) {
|
2006-10-21 15:01:50 -04:00
|
|
|
delete *i;
|
|
|
|
crossfade_views.erase (i);
|
|
|
|
}
|
|
|
|
|
|
|
|
i = tmp;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
}
|
2006-07-29 23:25:38 -04:00
|
|
|
|
|
|
|
StreamView::remove_region_view(r);
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::undisplay_diskstream ()
|
|
|
|
{
|
|
|
|
StreamView::undisplay_diskstream();
|
|
|
|
|
|
|
|
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
|
|
|
delete *i;
|
|
|
|
}
|
|
|
|
|
|
|
|
crossfade_views.clear ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-05-17 06:41:14 -04:00
|
|
|
AudioStreamView::playlist_modified_weak (boost::weak_ptr<Diskstream> ds)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2007-05-17 06:41:14 -04:00
|
|
|
boost::shared_ptr<Diskstream> sp (ds.lock());
|
|
|
|
if (!sp) {
|
|
|
|
return;
|
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
playlist_modified (sp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::playlist_modified (boost::shared_ptr<Diskstream> ds)
|
|
|
|
{
|
|
|
|
/* we do not allow shared_ptr<T> to be bound to slots */
|
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::playlist_modified_weak), ds));
|
|
|
|
|
|
|
|
StreamView::playlist_modified (ds);
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-09-18 23:29:16 -04:00
|
|
|
/* make sure xfades are on top and all the regionviews are stacked correctly. */
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
|
|
|
(*i)->get_canvas_group()->raise_to_top();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-08-24 03:37:17 -04:00
|
|
|
AudioStreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::playlist_changed), ds));
|
|
|
|
|
|
|
|
StreamView::playlist_changed(ds);
|
|
|
|
|
2007-01-09 18:24:54 -05:00
|
|
|
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(ds->playlist());
|
2006-07-23 08:03:19 -04:00
|
|
|
if (apl)
|
|
|
|
playlist_connections.push_back (apl->NewCrossfade.connect (mem_fun (*this, &AudioStreamView::add_crossfade)));
|
|
|
|
}
|
|
|
|
|
2007-04-29 13:23:11 -04:00
|
|
|
void
|
|
|
|
AudioStreamView::add_crossfade_weak (boost::weak_ptr<Crossfade> crossfade)
|
|
|
|
{
|
|
|
|
boost::shared_ptr<Crossfade> sp (crossfade.lock());
|
|
|
|
|
|
|
|
if (!sp) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
add_crossfade (sp);
|
|
|
|
}
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
void
|
2007-01-11 14:50:49 -05:00
|
|
|
AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
|
|
|
AudioRegionView* lview = 0;
|
|
|
|
AudioRegionView* rview = 0;
|
2007-04-29 13:23:11 -04:00
|
|
|
|
|
|
|
/* we do not allow shared_ptr<T> to be bound to slots */
|
2007-01-11 14:50:49 -05:00
|
|
|
|
2007-04-29 13:23:11 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::add_crossfade_weak), boost::weak_ptr<Crossfade> (crossfade)));
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
/* first see if we already have a CrossfadeView for this Crossfade */
|
|
|
|
|
|
|
|
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
2007-01-11 14:50:49 -05:00
|
|
|
if ((*i)->crossfade == crossfade) {
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
if (!crossfades_visible || layer_display == Stacked) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*i)->hide();
|
|
|
|
} else {
|
|
|
|
(*i)->show ();
|
|
|
|
}
|
|
|
|
(*i)->set_valid (true);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create a new one */
|
|
|
|
|
|
|
|
for (list<RegionView *>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
AudioRegionView* arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
if (!lview && arv && (arv->region() == crossfade->out())) {
|
2006-07-23 08:03:19 -04:00
|
|
|
lview = arv;
|
|
|
|
}
|
2006-08-29 17:21:48 -04:00
|
|
|
if (!rview && arv && (arv->region() == crossfade->in())) {
|
2006-07-23 08:03:19 -04:00
|
|
|
rview = arv;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CrossfadeView *cv = new CrossfadeView (_trackview.canvas_display,
|
|
|
|
_trackview,
|
2007-01-11 14:50:49 -05:00
|
|
|
crossfade,
|
2006-07-23 08:03:19 -04:00
|
|
|
_samples_per_unit,
|
|
|
|
region_color,
|
|
|
|
*lview, *rview);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
cv->set_valid (true);
|
2006-07-23 08:03:19 -04:00
|
|
|
crossfade->Invalidated.connect (mem_fun (*this, &AudioStreamView::remove_crossfade));
|
|
|
|
crossfade_views.push_back (cv);
|
2007-05-17 06:41:14 -04:00
|
|
|
if (!Config->get_xfades_visible() || !crossfades_visible || layer_display == Stacked) {
|
2006-07-23 08:03:19 -04:00
|
|
|
cv->hide ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-05-21 18:12:06 -04:00
|
|
|
AudioStreamView::remove_crossfade (boost::shared_ptr<Region> r)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2007-05-21 18:12:06 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::remove_crossfade), r));
|
|
|
|
|
|
|
|
boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade> (r);
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
for (list<CrossfadeView*>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
2007-01-11 14:50:49 -05:00
|
|
|
if ((*i)->crossfade == xfade) {
|
2006-07-23 08:03:19 -04:00
|
|
|
delete *i;
|
|
|
|
crossfade_views.erase (i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::redisplay_diskstream ()
|
|
|
|
{
|
|
|
|
list<RegionView *>::iterator i, tmp;
|
|
|
|
list<CrossfadeView*>::iterator xi, tmpx;
|
|
|
|
|
|
|
|
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
(*i)->set_valid (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (xi = crossfade_views.begin(); xi != crossfade_views.end(); ++xi) {
|
|
|
|
(*xi)->set_valid (false);
|
2007-05-17 06:41:14 -04:00
|
|
|
if ((*xi)->visible() && layer_display != Stacked) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*xi)->show ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_trackview.is_audio_track()) {
|
|
|
|
_trackview.get_diskstream()->playlist()->foreach_region (static_cast<StreamView*>(this), &StreamView::add_region_view);
|
2006-10-21 18:59:29 -04:00
|
|
|
|
2007-01-09 18:24:54 -05:00
|
|
|
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(_trackview.get_diskstream()->playlist());
|
2006-07-23 08:03:19 -04:00
|
|
|
if (apl)
|
|
|
|
apl->foreach_crossfade (this, &AudioStreamView::add_crossfade);
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
RegionViewList copy;
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
for (i = region_views.begin(); i != region_views.end(); ) {
|
|
|
|
tmp = i;
|
|
|
|
tmp++;
|
|
|
|
|
|
|
|
if (!(*i)->is_valid()) {
|
|
|
|
delete *i;
|
|
|
|
region_views.erase (i);
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
i = tmp;
|
|
|
|
continue;
|
2007-08-01 16:50:09 -04:00
|
|
|
} else {
|
|
|
|
(*i)->enable_display(true);
|
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
/*
|
|
|
|
sort regionviews by layer so that when we call region_layered ()
|
|
|
|
the canvas layering works out (in non-stacked mode).
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (copy.size() == 0) {
|
|
|
|
copy.push_front((*i));
|
|
|
|
i = tmp;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegionViewList::iterator k = copy.begin();
|
|
|
|
RegionViewList::iterator l = copy.end();
|
|
|
|
l--;
|
|
|
|
|
|
|
|
if ((*i)->region()->layer() <= (*k)->region()->layer()) {
|
|
|
|
copy.push_front((*i));
|
|
|
|
i = tmp;
|
|
|
|
continue;
|
|
|
|
} else if ((*i)->region()->layer() >= (*l)->region()->layer()) {
|
|
|
|
copy.push_back((*i));
|
|
|
|
i = tmp;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (RegionViewList::iterator j = copy.begin(); j != copy.end(); ++j) {
|
|
|
|
|
|
|
|
if ((*j)->region()->layer() >= (*i)->region()->layer()) {
|
|
|
|
copy.insert(j, (*i));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
i = tmp;
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
for (xi = crossfade_views.begin(); xi != crossfade_views.end();) {
|
|
|
|
tmpx = xi;
|
|
|
|
tmpx++;
|
|
|
|
|
|
|
|
if (!(*xi)->valid()) {
|
|
|
|
delete *xi;
|
|
|
|
crossfade_views.erase (xi);
|
|
|
|
}
|
|
|
|
|
|
|
|
xi = tmpx;
|
|
|
|
}
|
|
|
|
|
use filechooser widget in export dialog, selected files set format combos, hide progress bar until use in export dialog, speed up 'separate regions in range' operation on larger sessions, ruler scale now calculated separately to mark generation, fix for non-stacked layering regression, try not to generate 'buried' crossfades, use playlist->freeze() to speed up copying/moving regions on large playlists (not done for undo), width dependent items now reset on regionview init, get rid of jack_port_ensure_monitor check, remove audiosourse _length (only source has a length.. i think), make overlapend differ to overlapexternal where start points coincide.
git-svn-id: svn://localhost/ardour2/trunk@2576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-26 09:32:24 -04:00
|
|
|
/* now fix canvas layering */
|
|
|
|
|
|
|
|
for (RegionViewList::iterator j = copy.begin(); j != copy.end(); ++j) {
|
|
|
|
(*j)->enable_display(true);
|
|
|
|
(*j)->set_y_position_and_height(0, height);
|
|
|
|
region_layered (*j);
|
2006-10-21 18:59:29 -04:00
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::set_show_waveforms (bool yn)
|
|
|
|
{
|
|
|
|
for (list<RegionView *>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
if (arv)
|
|
|
|
arv->set_waveform_visible (yn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::set_waveform_shape (WaveformShape shape)
|
|
|
|
{
|
|
|
|
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
if (arv)
|
|
|
|
arv->set_waveform_shape (shape);
|
|
|
|
}
|
2007-01-09 18:24:54 -05:00
|
|
|
_waveform_shape = shape;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
2007-01-09 18:24:54 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::set_waveform_scale (WaveformScale scale)
|
|
|
|
{
|
|
|
|
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
|
|
|
|
if (arv)
|
|
|
|
arv->set_waveform_scale (scale);
|
|
|
|
}
|
|
|
|
_waveform_scale = scale;
|
|
|
|
}
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
void
|
|
|
|
AudioStreamView::setup_rec_box ()
|
|
|
|
{
|
|
|
|
// cerr << _trackview.name() << " streamview SRB\n";
|
|
|
|
|
|
|
|
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()) {
|
|
|
|
|
|
|
|
/* add a new region, but don't bother if they set use_rec_regions mid-record */
|
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
SourceList sources;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
for (list<sigc::connection>::iterator prc = rec_data_ready_connections.begin(); prc != rec_data_ready_connections.end(); ++prc) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*prc).disconnect();
|
|
|
|
}
|
2006-08-14 04:44:14 -04:00
|
|
|
rec_data_ready_connections.clear();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
// FIXME
|
2006-08-24 03:37:17 -04:00
|
|
|
boost::shared_ptr<AudioDiskstream> ads = boost::dynamic_pointer_cast<AudioDiskstream>(_trackview.get_diskstream());
|
2006-07-23 08:03:19 -04:00
|
|
|
assert(ads);
|
|
|
|
|
2007-05-09 23:50:17 -04:00
|
|
|
for (uint32_t n=0; n < ads->n_channels().n_audio(); ++n) {
|
2006-08-29 17:21:48 -04:00
|
|
|
boost::shared_ptr<AudioFileSource> src = boost::static_pointer_cast<AudioFileSource> (ads->write_source (n));
|
2006-07-23 08:03:19 -04:00
|
|
|
if (src) {
|
|
|
|
sources.push_back (src);
|
2006-10-21 15:01:50 -04:00
|
|
|
|
|
|
|
rec_data_ready_connections.push_back (src->PeakRangeReady.connect (bind
|
|
|
|
(mem_fun (*this, &AudioStreamView::rec_peak_range_ready), boost::weak_ptr<Source>(src))));
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// handle multi
|
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t start = 0;
|
2006-07-23 08:03:19 -04:00
|
|
|
if (rec_regions.size() > 0) {
|
2007-05-31 17:37:20 -04:00
|
|
|
start = rec_regions.back().first->start() + _trackview.get_diskstream()->get_captured_frames(rec_regions.size()-1);
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
boost::shared_ptr<AudioRegion> region (boost::dynamic_pointer_cast<AudioRegion>
|
|
|
|
(RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags | Region::DoNotSaveState), false)));
|
2006-09-18 23:29:16 -04:00
|
|
|
assert(region);
|
2006-07-23 08:03:19 -04:00
|
|
|
region->set_position (_trackview.session().transport_frame(), this);
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
rec_regions.push_back (make_pair(region, (RegionView*)0));
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* start a new rec box */
|
|
|
|
|
2007-06-15 18:05:07 -04:00
|
|
|
boost::shared_ptr<AudioTrack> at;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
at = _trackview.audio_track(); /* we know what it is already */
|
2006-08-24 03:37:17 -04:00
|
|
|
boost::shared_ptr<AudioDiskstream> ds = at->audio_diskstream();
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t frame_pos = ds->current_capture_start ();
|
2006-07-23 08:03:19 -04:00
|
|
|
gdouble xstart = _trackview.editor.frame_to_pixel (frame_pos);
|
|
|
|
gdouble xend;
|
|
|
|
uint32_t fill_color;
|
|
|
|
|
|
|
|
switch (_trackview.audio_track()->mode()) {
|
|
|
|
case Normal:
|
|
|
|
xend = xstart;
|
2007-06-29 13:13:09 -04:00
|
|
|
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
2006-07-23 08:03:19 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case Destructive:
|
|
|
|
xend = xstart + 2;
|
2007-06-29 13:13:09 -04:00
|
|
|
fill_color = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
2006-07-23 08:03:19 -04:00
|
|
|
/* make the recording rect translucent to allow
|
|
|
|
the user to see the peak data coming in, etc.
|
|
|
|
*/
|
|
|
|
fill_color = UINT_RGBA_CHANGE_A (fill_color, 120);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ArdourCanvas::SimpleRect * rec_rect = new Gnome::Canvas::SimpleRect (*canvas_group);
|
|
|
|
rec_rect->property_x1() = xstart;
|
|
|
|
rec_rect->property_y1() = 1.0;
|
|
|
|
rec_rect->property_x2() = xend;
|
|
|
|
rec_rect->property_y2() = (double) _trackview.height - 1;
|
2007-06-29 13:13:09 -04:00
|
|
|
rec_rect->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
|
2006-07-23 08:03:19 -04:00
|
|
|
rec_rect->property_fill_color_rgba() = fill_color;
|
2007-05-31 17:37:20 -04:00
|
|
|
rec_rect->lower_to_bottom();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
RecBoxInfo recbox;
|
|
|
|
recbox.rectangle = rec_rect;
|
|
|
|
recbox.start = _trackview.session().transport_frame();
|
|
|
|
recbox.length = 0;
|
|
|
|
|
|
|
|
rec_rects.push_back (recbox);
|
|
|
|
|
|
|
|
screen_update_connection.disconnect();
|
|
|
|
screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (mem_fun (*this, &AudioStreamView::update_rec_box));
|
|
|
|
rec_updating = true;
|
|
|
|
rec_active = true;
|
|
|
|
|
|
|
|
} else if (rec_active &&
|
|
|
|
(_trackview.session().record_status() != Session::Recording ||
|
|
|
|
!_trackview.get_diskstream()->record_enabled())) {
|
|
|
|
|
|
|
|
screen_update_connection.disconnect();
|
|
|
|
rec_active = false;
|
|
|
|
rec_updating = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// cerr << "\tNOT rolling, rec_rects = " << rec_rects.size() << " rec_regions = " << rec_regions.size() << endl;
|
|
|
|
|
|
|
|
if (!rec_rects.empty() || !rec_regions.empty()) {
|
|
|
|
|
|
|
|
/* disconnect rapid update */
|
|
|
|
screen_update_connection.disconnect();
|
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
for (list<sigc::connection>::iterator prc = rec_data_ready_connections.begin(); prc != rec_data_ready_connections.end(); ++prc) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*prc).disconnect();
|
|
|
|
}
|
2006-08-14 04:44:14 -04:00
|
|
|
rec_data_ready_connections.clear();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
rec_updating = false;
|
|
|
|
rec_active = false;
|
|
|
|
|
|
|
|
/* remove temp regions */
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
for (list<pair<boost::shared_ptr<Region>,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); ) {
|
|
|
|
list<pair<boost::shared_ptr<Region>,RegionView*> >::iterator tmp;
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-09-18 23:29:16 -04:00
|
|
|
tmp = iter;
|
|
|
|
++tmp;
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
(*iter).first->drop_references ();
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-09-18 23:29:16 -04:00
|
|
|
iter = tmp;
|
|
|
|
}
|
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
rec_regions.clear();
|
|
|
|
|
|
|
|
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
|
|
|
|
|
|
|
|
/* transport stopped, clear boxes */
|
|
|
|
for (vector<RecBoxInfo>::iterator iter=rec_rects.begin(); iter != rec_rects.end(); ++iter) {
|
|
|
|
RecBoxInfo &rect = (*iter);
|
|
|
|
delete rect.rectangle;
|
|
|
|
}
|
|
|
|
|
|
|
|
rec_rects.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::foreach_crossfadeview (void (CrossfadeView::*pmf)(void))
|
|
|
|
{
|
|
|
|
for (list<CrossfadeView*>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
|
|
|
((*i)->*pmf) ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-10-21 15:01:50 -04:00
|
|
|
AudioStreamView::rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<Source> weak_src)
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2006-10-21 15:01:50 -04:00
|
|
|
ENSURE_GUI_THREAD(bind (mem_fun (*this, &AudioStreamView::rec_peak_range_ready), start, cnt, weak_src));
|
|
|
|
|
|
|
|
boost::shared_ptr<Source> src (weak_src.lock());
|
|
|
|
|
|
|
|
if (!src) {
|
|
|
|
return;
|
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
// this is called from the peak building thread
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
if (rec_data_ready_map.size() == 0 || start+cnt > last_rec_data_frame) {
|
|
|
|
last_rec_data_frame = start + cnt;
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
rec_data_ready_map[src] = true;
|
2006-10-21 15:01:50 -04:00
|
|
|
|
2007-05-09 23:50:17 -04:00
|
|
|
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_audio()) {
|
2006-07-23 08:03:19 -04:00
|
|
|
this->update_rec_regions ();
|
2006-08-14 04:44:14 -04:00
|
|
|
rec_data_ready_map.clear();
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::update_rec_regions ()
|
|
|
|
{
|
|
|
|
if (use_rec_regions) {
|
|
|
|
|
|
|
|
uint32_t n = 0;
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
for (list<pair<boost::shared_ptr<Region>,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); n++) {
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
list<pair<boost::shared_ptr<Region>,RegionView*> >::iterator tmp;
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
tmp = iter;
|
|
|
|
++tmp;
|
|
|
|
|
|
|
|
if (!canvas_item_visible (rec_rects[n].rectangle)) {
|
|
|
|
/* rect already hidden, this region is done */
|
|
|
|
iter = tmp;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(iter->first);
|
2006-09-18 23:29:16 -04:00
|
|
|
if (!region) {
|
|
|
|
continue;
|
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t origlen = region->length();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2007-05-31 17:37:20 -04:00
|
|
|
if (region == rec_regions.back().first && rec_active) {
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-08-14 04:44:14 -04:00
|
|
|
if (last_rec_data_frame > region->start()) {
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t nlen = last_rec_data_frame - region->start();
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
if (nlen != region->length()) {
|
|
|
|
|
|
|
|
region->freeze ();
|
|
|
|
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
|
|
|
region->set_length (nlen, this);
|
|
|
|
region->thaw ("updated");
|
|
|
|
|
|
|
|
if (origlen == 1) {
|
|
|
|
/* our special initial length */
|
|
|
|
add_region_view_internal (region, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* also update rect */
|
|
|
|
ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
|
|
|
|
gdouble xend = _trackview.editor.frame_to_pixel (region->position() + region->length());
|
|
|
|
rect->property_x2() = xend;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
2006-10-21 15:01:50 -04:00
|
|
|
nframes_t nlen = _trackview.get_diskstream()->get_captured_frames(n);
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
if (nlen != region->length()) {
|
|
|
|
|
2006-08-29 17:21:48 -04:00
|
|
|
if (region->source(0)->length() >= region->start() + nlen) {
|
2006-07-23 08:03:19 -04:00
|
|
|
|
|
|
|
region->freeze ();
|
|
|
|
region->set_position (_trackview.get_diskstream()->get_capture_start_frame(n), this);
|
|
|
|
region->set_length (nlen, this);
|
|
|
|
region->thaw ("updated");
|
|
|
|
|
|
|
|
if (origlen == 1) {
|
|
|
|
/* our special initial length */
|
|
|
|
add_region_view_internal (region, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* also hide rect */
|
|
|
|
ArdourCanvas::Item * rect = rec_rects[n].rectangle;
|
|
|
|
rect->hide();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
iter = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::show_all_xfades ()
|
|
|
|
{
|
|
|
|
foreach_crossfadeview (&CrossfadeView::show);
|
|
|
|
crossfades_visible = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::hide_all_xfades ()
|
|
|
|
{
|
|
|
|
foreach_crossfadeview (&CrossfadeView::hide);
|
|
|
|
crossfades_visible = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::hide_xfades_involving (AudioRegionView& rv)
|
|
|
|
{
|
|
|
|
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
2007-01-11 14:50:49 -05:00
|
|
|
if ((*i)->crossfade->involves (rv.audio_region())) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*i)->fake_hide ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
AudioStreamView::reveal_xfades_involving (AudioRegionView& rv)
|
|
|
|
{
|
|
|
|
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
2007-05-17 06:41:14 -04:00
|
|
|
if ((*i)->crossfade->involves (rv.audio_region()) && (*i)->visible() && layer_display != Stacked) {
|
2006-07-23 08:03:19 -04:00
|
|
|
(*i)->show ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-06-15 18:08:27 -04:00
|
|
|
AudioStreamView::color_handler ()
|
2006-07-23 08:03:19 -04:00
|
|
|
{
|
2007-06-15 18:08:27 -04:00
|
|
|
//case cAudioTrackBase:
|
|
|
|
if (_trackview.is_track()) {
|
2007-06-29 13:13:09 -04:00
|
|
|
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioTrackBase.get();
|
2007-06-15 18:08:27 -04:00
|
|
|
}
|
2006-07-23 08:03:19 -04:00
|
|
|
|
2007-06-15 18:08:27 -04:00
|
|
|
//case cAudioBusBase:
|
|
|
|
if (!_trackview.is_track()) {
|
2007-06-29 13:13:09 -04:00
|
|
|
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_AudioBusBase.get();
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
2007-06-15 18:08:27 -04:00
|
|
|
|
2006-07-23 08:03:19 -04:00
|
|
|
}
|
2006-08-01 20:22:16 -04:00
|
|
|
|
2007-05-17 06:41:14 -04:00
|
|
|
void
|
|
|
|
AudioStreamView::update_contents_y_position_and_height ()
|
|
|
|
{
|
|
|
|
StreamView::update_contents_y_position_and_height ();
|
|
|
|
|
|
|
|
for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
|
|
|
if (layer_display == Overlaid) {
|
|
|
|
(*i)->show ();
|
|
|
|
(*i)->set_y_position_and_height (0, height);
|
|
|
|
} else {
|
|
|
|
(*i)->hide ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|