diff options
author | David Robillard <d@drobilla.net> | 2006-08-01 03:23:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-01 03:23:35 +0000 |
commit | 6f4a92f740b2fd75794489ce58f9348f8adf6bf4 (patch) | |
tree | 68ecd4d29bf7d1db00da9dfa9e14ac2e93ca1e42 /libs/ardour/auditioner.cc | |
parent | ba0c8bc2ef92a84b99040df46e76d8ac54d3d9da (diff) |
Heavy-duty abstraction work to split type-specific classes into
specializations of (new, for the most part) generic bases. (eg. most everything
from the MIDI branch except for actual MIDI things, so merges have a chance of
succeeding). Also the new edit toolbar, and various other cleanup things I did
along the way.
Should be functionally equivalent (except the toolbar), this is just design work.
She's a big'un....
git-svn-id: svn://localhost/ardour2/trunk@727 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/auditioner.cc')
-rw-r--r-- | libs/ardour/auditioner.cc | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index 2f0b943c0e..81f64d2671 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -44,12 +44,12 @@ Auditioner::Auditioner (Session& s) defer_pan_reset (); if (left.length()) { - add_output_port (left, this); + add_output_port (left, this, AUDIO); } if (right.length()) { - disk_stream().add_channel(); - add_output_port (right, this); + audio_diskstream().add_channel(); + add_output_port (right, this, AUDIO); } allow_pan_reset (); @@ -67,8 +67,12 @@ Auditioner::~Auditioner () AudioPlaylist& Auditioner::prepare_playlist () { - diskstream->playlist()->clear (false, false); - return *diskstream->playlist(); + // FIXME auditioner is still audio-only + AudioPlaylist* const apl = dynamic_cast<AudioPlaylist*>(_diskstream->playlist()); + assert(apl); + + apl->clear (false, false); + return *apl; } void @@ -82,13 +86,13 @@ Auditioner::audition_current_playlist () } Glib::Mutex::Lock lm (lock); - diskstream->seek (0); - length = diskstream->playlist()->get_maximum_extent(); + _diskstream->seek (0); + length = _diskstream->playlist()->get_maximum_extent(); current_frame = 0; /* force a panner reset now that we have all channels */ - _panner->reset (n_outputs(), diskstream->n_channels()); + _panner->reset (n_outputs(), _diskstream->n_channels()); g_atomic_int_set (&_active, 1); } @@ -108,23 +112,23 @@ Auditioner::audition_region (AudioRegion& region) the_region = new AudioRegion (region); the_region->set_position (0, this); - diskstream->playlist()->clear (true, false); - diskstream->playlist()->add_region (*the_region, 0, 1, false); + _diskstream->playlist()->clear (true, false); + _diskstream->playlist()->add_region (*the_region, 0, 1, false); - while (diskstream->n_channels() < the_region->n_channels()) { - diskstream->add_channel (); + while (_diskstream->n_channels() < the_region->n_channels()) { + audio_diskstream().add_channel (); } - while (diskstream->n_channels() > the_region->n_channels()) { - diskstream->remove_channel (); + while (_diskstream->n_channels() > the_region->n_channels()) { + audio_diskstream().remove_channel (); } /* force a panner reset now that we have all channels */ - _panner->reset (n_outputs(), diskstream->n_channels()); + _panner->reset (n_outputs(), _diskstream->n_channels()); length = the_region->length(); - diskstream->seek (0); + _diskstream->seek (0); current_frame = 0; g_atomic_int_set (&_active, 1); } @@ -143,14 +147,14 @@ Auditioner::play_audition (jack_nframes_t nframes) this_nframes = min (nframes, length - current_frame); - diskstream->prepare (); + _diskstream->prepare (); if ((ret = roll (this_nframes, current_frame, current_frame + nframes, 0, false, false, false)) != 0) { silence (nframes, 0); return ret; } - need_butler = diskstream->commit (this_nframes); + need_butler = _diskstream->commit (this_nframes); current_frame += this_nframes; if (current_frame >= length) { |