summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-12 08:20:24 +0000
committerDavid Robillard <d@drobilla.net>2006-08-12 08:20:24 +0000
commit30ab1fd61569f9d7fb7410d483fa68cbf9865c37 (patch)
tree60cf9b5228a2728cda6608d517528066253d1a17 /libs/ardour/audio_diskstream.cc
parentcbdf686e391bc2e7b93f37a5d3fa9197cb178078 (diff)
Towards MIDI:
- Converted vector<Sample*> to BufferList and numerous counts from int to ChanCount (and related changes) - Added fancy type-generic iterators to BufferList, PortIterator (see IO::collect_input for a good example of the idea - the same code will work to read all input (of various types in a single IO, eg instruments) without modification no matter how many types we add) - Fixed comparison operator bugs with ChanCount (screwed up metering among other things) - Moved peak metering into it's own object, and moved most of the pan related code out of IO to panner (still a touch more to be done here for MIDI playback) Not directly MIDI related fixes for problems in trunk: - Fixed varispeed gain/pan automation to work properly (was reading the wrong range of automation data, probably causing nasty clicks?) - Fixed crash on varispeed looping (possibly only a 64-bit problem). It still doesn't work, but at least it doesn't die Quite a few things broken, and the new classes are pretty filthy still, but I think the direction is a lot better than all my previous plans... git-svn-id: svn://localhost/ardour2/branches/midi@795 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 04fb95ce62..6973ebd877 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -140,7 +140,7 @@ AudioDiskstream::init (Diskstream::Flag f)
allocate_temporary_buffers ();
add_channel ();
- assert(_n_channels == 1);
+ assert(_n_channels == ChanCount(DataType::AUDIO, 1));
}
void
@@ -212,7 +212,7 @@ AudioDiskstream::non_realtime_input_change ()
if (input_change_pending & ConfigurationChanged) {
- if (_io->n_inputs().get(DataType::AUDIO) > _n_channels) {
+ if (_io->n_inputs().get(DataType::AUDIO) > _n_channels.get(DataType::AUDIO)) {
// we need to add new channel infos
@@ -222,7 +222,7 @@ AudioDiskstream::non_realtime_input_change ()
add_channel ();
}
- } else if (_io->n_inputs().get(DataType::AUDIO) < _n_channels) {
+ } else if (_io->n_inputs().get(DataType::AUDIO) < _n_channels.get(DataType::AUDIO)) {
// we need to get rid of channels
@@ -1866,7 +1866,7 @@ AudioDiskstream::set_state (const XMLNode& node)
// create necessary extra channels
// we are always constructed with one and we always need one
- if (nchans > _n_channels) {
+ if (nchans > _n_channels.get(DataType::AUDIO)) {
// we need to add new channel infos
//LockMonitor lm (state_lock, __LINE__, __FILE__);
@@ -1877,7 +1877,7 @@ AudioDiskstream::set_state (const XMLNode& node)
add_channel ();
}
- } else if (nchans < _n_channels) {
+ } else if (nchans < _n_channels.get(DataType::AUDIO)) {
// we need to get rid of channels
//LockMonitor lm (state_lock, __LINE__, __FILE__);
@@ -1922,7 +1922,7 @@ AudioDiskstream::set_state (const XMLNode& node)
}
}
- _n_channels = channels.size();
+ _n_channels.set(DataType::AUDIO, channels.size());
in_set_state = false;
@@ -2134,7 +2134,7 @@ AudioDiskstream::add_channel ()
channels.push_back (chan);
- _n_channels = channels.size();
+ _n_channels.set(DataType::AUDIO, channels.size());
return 0;
}
@@ -2148,7 +2148,7 @@ AudioDiskstream::remove_channel ()
destroy_channel (chan);
channels.pop_back();
- _n_channels = channels.size();
+ _n_channels.set(DataType::AUDIO, channels.size());
return 0;
}
@@ -2224,7 +2224,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
return 1;
}
- if (pending_sources.size() != _n_channels) {
+ if (pending_sources.size() != _n_channels.get(DataType::AUDIO)) {
error << string_compose (_("%1: incorrect number of pending sources listed - ignoring them all"), _name)
<< endmsg;
return -1;