Added nicer looking wrapper methods for ChanCount::get(DataType), sedified code to use it.
git-svn-id: svn://localhost/ardour2/trunk@1816 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2a52135c66
commit
9a4a9cbb63
|
@ -2397,7 +2397,7 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
|
|||
AutoConnectOption oac = Config->get_output_auto_connect();
|
||||
|
||||
if (oac & AutoConnectMaster) {
|
||||
output_chan = (session->master_out() ? session->master_out()->n_inputs().get(DataType::AUDIO) : input_chan);
|
||||
output_chan = (session->master_out() ? session->master_out()->n_inputs().n_audio() : input_chan);
|
||||
} else {
|
||||
output_chan = input_chan;
|
||||
}
|
||||
|
|
|
@ -784,7 +784,7 @@ AudioRegionView::create_waves ()
|
|||
return;
|
||||
}
|
||||
|
||||
uint32_t nchans = atv.get_diskstream()->n_channels().get(DataType::AUDIO);
|
||||
uint32_t nchans = atv.get_diskstream()->n_channels().n_audio();
|
||||
|
||||
/* in tmp_waves, set up null pointers for each channel so the vector is allocated */
|
||||
for (uint32_t n = 0; n < nchans; ++n) {
|
||||
|
@ -814,7 +814,7 @@ void
|
|||
AudioRegionView::create_one_wave (uint32_t which, bool direct)
|
||||
{
|
||||
RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
|
||||
uint32_t nchans = atv.get_diskstream()->n_channels().get(DataType::AUDIO);
|
||||
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;
|
||||
|
@ -1069,7 +1069,7 @@ AudioRegionView::add_ghost (AutomationTimeAxisView& atv)
|
|||
GhostRegion* ghost = new GhostRegion (atv, unit_position);
|
||||
uint32_t nchans;
|
||||
|
||||
nchans = rtv->get_diskstream()->n_channels().get(DataType::AUDIO);
|
||||
nchans = rtv->get_diskstream()->n_channels().n_audio();
|
||||
|
||||
for (uint32_t n = 0; n < nchans; ++n) {
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@ AudioStreamView::setup_rec_box ()
|
|||
boost::shared_ptr<AudioDiskstream> ads = boost::dynamic_pointer_cast<AudioDiskstream>(_trackview.get_diskstream());
|
||||
assert(ads);
|
||||
|
||||
for (uint32_t n=0; n < ads->n_channels().get(DataType::AUDIO); ++n) {
|
||||
for (uint32_t n=0; n < ads->n_channels().n_audio(); ++n) {
|
||||
boost::shared_ptr<AudioFileSource> src = boost::static_pointer_cast<AudioFileSource> (ads->write_source (n));
|
||||
if (src) {
|
||||
sources.push_back (src);
|
||||
|
@ -638,7 +638,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().get(DataType::AUDIO)) {
|
||||
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_audio()) {
|
||||
this->update_rec_regions ();
|
||||
rec_data_ready_map.clear();
|
||||
}
|
||||
|
|
|
@ -434,7 +434,7 @@ AudioTimeAxisView::update_pans ()
|
|||
/* we don't draw lines for "greater than stereo" panning.
|
||||
*/
|
||||
|
||||
if (_route->n_outputs().get(DataType::AUDIO) > 2) {
|
||||
if (_route->n_outputs().n_audio() > 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_fi
|
|||
Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External)));
|
||||
|
||||
if (Config->get_output_auto_connect() & AutoConnectMaster) {
|
||||
output_chan = (session->master_out() ? session->master_out()->n_inputs().get(DataType::AUDIO) : input_chan);
|
||||
output_chan = (session->master_out() ? session->master_out()->n_inputs().n_audio() : input_chan);
|
||||
} else {
|
||||
output_chan = input_chan;
|
||||
}
|
||||
|
|
|
@ -316,7 +316,7 @@ Editor::write_audio_range (AudioPlaylist& playlist, const ChanCount& count, list
|
|||
string path;
|
||||
vector<boost::shared_ptr<AudioFileSource> > sources;
|
||||
|
||||
uint32_t channels = count.get(DataType::AUDIO);
|
||||
uint32_t channels = count.n_audio();
|
||||
|
||||
for (uint32_t n=0; n < channels; ++n) {
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ ExportDialog::set_state()
|
|||
}
|
||||
|
||||
TreeModel::Children rows = master_selector.get_model()->children();
|
||||
for (uint32_t r = 0; r < session->master_out()->n_outputs().get(DataType::AUDIO); ++r) {
|
||||
for (uint32_t r = 0; r < session->master_out()->n_outputs().n_audio(); ++r) {
|
||||
if (nchns == 2) {
|
||||
if (r % 2) {
|
||||
rows[r][exp_cols.right] = true;
|
||||
|
@ -1096,9 +1096,9 @@ ExportDialog::fill_lists ()
|
|||
continue;
|
||||
}
|
||||
|
||||
for (uint32_t i=0; i < route->n_outputs().get(DataType::AUDIO); ++i) {
|
||||
for (uint32_t i=0; i < route->n_outputs().n_audio(); ++i) {
|
||||
string name;
|
||||
if (route->n_outputs().get(DataType::AUDIO) == 1) {
|
||||
if (route->n_outputs().n_audio() == 1) {
|
||||
name = route->name();
|
||||
} else {
|
||||
name = string_compose("%1: out-%2", route->name(), i+1);
|
||||
|
|
|
@ -389,7 +389,7 @@ GainMeter::hide_all_meters ()
|
|||
void
|
||||
GainMeter::setup_meters ()
|
||||
{
|
||||
uint32_t nmeters = _io->n_outputs().get(DataType::AUDIO);
|
||||
uint32_t nmeters = _io->n_outputs().n_audio();
|
||||
guint16 width;
|
||||
|
||||
hide_all_meters ();
|
||||
|
@ -401,16 +401,16 @@ GainMeter::setup_meters ()
|
|||
switch (r->meter_point()) {
|
||||
case MeterPreFader:
|
||||
case MeterInput:
|
||||
nmeters = r->n_inputs().get(DataType::AUDIO);
|
||||
nmeters = r->n_inputs().n_audio();
|
||||
break;
|
||||
case MeterPostFader:
|
||||
nmeters = r->n_outputs().get(DataType::AUDIO);
|
||||
nmeters = r->n_outputs().n_audio();
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
nmeters = _io->n_outputs().get(DataType::AUDIO);
|
||||
nmeters = _io->n_outputs().n_audio();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ MidiStreamView::rec_data_range_ready (jack_nframes_t start, jack_nframes_t cnt,
|
|||
|
||||
rec_data_ready_map[src] = true;
|
||||
|
||||
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().get(DataType::MIDI)) {
|
||||
if (rec_data_ready_map.size() == _trackview.get_diskstream()->n_channels().n_midi()) {
|
||||
this->update_rec_regions ();
|
||||
rec_data_ready_map.clear();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ Amp::run (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target, boo
|
|||
if (nframes == 0)
|
||||
return;
|
||||
|
||||
if (bufs.count().get(DataType::AUDIO) == 0)
|
||||
if (bufs.count().n_audio() == 0)
|
||||
return;
|
||||
|
||||
// assert(bufs.buffer_capacity(DataType::AUDIO) >= nframes);
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
};
|
||||
|
||||
audio_iterator audio_begin() { return audio_iterator(*this, 0); }
|
||||
audio_iterator audio_end() { return audio_iterator(*this, _count.get(DataType::AUDIO)); }
|
||||
audio_iterator audio_end() { return audio_iterator(*this, _count.n_audio()); }
|
||||
|
||||
class iterator {
|
||||
public:
|
||||
|
|
|
@ -43,6 +43,10 @@ public:
|
|||
_counts[(*t).to_index()] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// -1 is what to_index does. inlined for speed. this should maybe be changed..
|
||||
inline size_t n_audio() const { return _counts[DataType::AUDIO-1]; }
|
||||
inline size_t n_midi() const { return _counts[DataType::MIDI-1]; }
|
||||
|
||||
void set(DataType type, size_t count) { _counts[type.to_index()] = count; }
|
||||
size_t get(DataType type) const { return _counts[type.to_index()]; }
|
||||
|
|
|
@ -292,7 +292,7 @@ class IO : public PBD::StatefulDestructible
|
|||
void reset_panner ();
|
||||
|
||||
virtual uint32_t pans_required() const
|
||||
{ return _inputs.count().get(DataType::AUDIO); }
|
||||
{ return _inputs.count().n_audio(); }
|
||||
|
||||
struct GainControllable : public PBD::Controllable {
|
||||
GainControllable (std::string name, IO& i) : Controllable (name), io (i) {}
|
||||
|
|
|
@ -140,10 +140,7 @@ public:
|
|||
};
|
||||
|
||||
audio_iterator audio_begin() { return audio_iterator(*this, 0); }
|
||||
audio_iterator audio_end() { return audio_iterator(*this, _count.get(DataType::AUDIO)); }
|
||||
|
||||
|
||||
|
||||
audio_iterator audio_end() { return audio_iterator(*this, _count.n_audio()); }
|
||||
|
||||
private:
|
||||
// Prevent copies (undefined)
|
||||
|
|
|
@ -53,7 +53,7 @@ class Send : public Redirect
|
|||
XMLNode& get_state(void);
|
||||
int set_state(const XMLNode& node);
|
||||
|
||||
uint32_t pans_required() const { return _expected_inputs.get(DataType::AUDIO); }
|
||||
uint32_t pans_required() const { return _expected_inputs.n_audio(); }
|
||||
void expect_inputs (const ChanCount&);
|
||||
|
||||
static uint32_t how_many_sends();
|
||||
|
|
|
@ -170,10 +170,10 @@ AudioDiskstream::non_realtime_input_change ()
|
|||
|
||||
_n_channels.set(DataType::AUDIO, c->size());
|
||||
|
||||
if (_io->n_inputs().get(DataType::AUDIO) > _n_channels.get(DataType::AUDIO)) {
|
||||
add_channel_to (c, _io->n_inputs().get(DataType::AUDIO) - _n_channels.get(DataType::AUDIO));
|
||||
} else if (_io->n_inputs().get(DataType::AUDIO) < _n_channels.get(DataType::AUDIO)) {
|
||||
remove_channel_from (c, _n_channels.get(DataType::AUDIO) - _io->n_inputs().get(DataType::AUDIO));
|
||||
if (_io->n_inputs().n_audio() > _n_channels.n_audio()) {
|
||||
add_channel_to (c, _io->n_inputs().n_audio() - _n_channels.n_audio());
|
||||
} else if (_io->n_inputs().n_audio() < _n_channels.n_audio()) {
|
||||
remove_channel_from (c, _n_channels.n_audio() - _io->n_inputs().n_audio());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ AudioDiskstream::get_input_sources ()
|
|||
|
||||
uint32_t n;
|
||||
ChannelList::iterator chan;
|
||||
uint32_t ni = _io->n_inputs().get(DataType::AUDIO);
|
||||
uint32_t ni = _io->n_inputs().n_audio();
|
||||
|
||||
for (n = 0, chan = c->begin(); chan != c->end() && n < ni; ++chan, ++n) {
|
||||
|
||||
|
@ -612,7 +612,7 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_
|
|||
|
||||
if (nominally_recording || rec_nframes) {
|
||||
|
||||
uint32_t limit = _io->n_inputs ().get(DataType::AUDIO);
|
||||
uint32_t limit = _io->n_inputs ().n_audio();
|
||||
|
||||
/* one or more ports could already have been removed from _io, but our
|
||||
channel setup hasn't yet been updated. prevent us from trying to
|
||||
|
@ -1691,7 +1691,7 @@ AudioDiskstream::finish_capture (bool rec_monitors_input, boost::shared_ptr<Chan
|
|||
void
|
||||
AudioDiskstream::set_record_enabled (bool yn)
|
||||
{
|
||||
if (!recordable() || !_session.record_enabling_legal() || _io->n_inputs().get(DataType::AUDIO) == 0) {
|
||||
if (!recordable() || !_session.record_enabling_legal() || _io->n_inputs().n_audio() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1873,13 +1873,13 @@ AudioDiskstream::set_state (const XMLNode& node)
|
|||
|
||||
_n_channels.set(DataType::AUDIO, channels.reader()->size());
|
||||
|
||||
if (nchans > _n_channels.get(DataType::AUDIO)) {
|
||||
if (nchans > _n_channels.n_audio()) {
|
||||
|
||||
add_channel (nchans - _n_channels.get(DataType::AUDIO));
|
||||
add_channel (nchans - _n_channels.n_audio());
|
||||
|
||||
} else if (nchans < _n_channels.get(DataType::AUDIO)) {
|
||||
} else if (nchans < _n_channels.n_audio()) {
|
||||
|
||||
remove_channel (_n_channels.get(DataType::AUDIO) - nchans);
|
||||
remove_channel (_n_channels.n_audio() - nchans);
|
||||
}
|
||||
|
||||
if ((prop = node.property ("playlist")) == 0) {
|
||||
|
@ -2227,7 +2227,7 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (pending_sources.size() != _n_channels.get(DataType::AUDIO)) {
|
||||
if (pending_sources.size() != _n_channels.n_audio()) {
|
||||
error << string_compose (_("%1: incorrect number of pending sources listed - ignoring them all"), _name)
|
||||
<< endmsg;
|
||||
return -1;
|
||||
|
|
|
@ -579,7 +579,7 @@ AudioTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
|
|||
|
||||
/* copy the diskstream data to all output buffers */
|
||||
|
||||
const size_t limit = n_process_buffers().get(DataType::AUDIO);
|
||||
const size_t limit = n_process_buffers().n_audio();
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||
|
||||
uint32_t n;
|
||||
|
@ -587,7 +587,7 @@ AudioTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
|
|||
|
||||
for (i = 0, n = 1; i < limit; ++i, ++n) {
|
||||
memcpy (bufs.get_audio(i).data(), b, sizeof (Sample) * nframes);
|
||||
if (n < diskstream->n_channels().get(DataType::AUDIO)) {
|
||||
if (n < diskstream->n_channels().n_audio()) {
|
||||
tmpb = diskstream->playback_buffer(n);
|
||||
if (tmpb!=0) {
|
||||
b = tmpb;
|
||||
|
@ -657,13 +657,13 @@ AudioTrack::export_stuff (BufferSet& buffers, nframes_t start, nframes_t nframes
|
|||
return -1;
|
||||
}
|
||||
|
||||
assert(buffers.count().get(DataType::AUDIO) >= 1);
|
||||
assert(buffers.count().n_audio() >= 1);
|
||||
uint32_t n=1;
|
||||
Sample* b = buffers.get_audio(0).data();
|
||||
BufferSet::audio_iterator bi = buffers.audio_begin();
|
||||
++bi;
|
||||
for ( ; bi != buffers.audio_end(); ++bi, ++n) {
|
||||
if (n < diskstream->n_channels().get(DataType::AUDIO)) {
|
||||
if (n < diskstream->n_channels().n_audio()) {
|
||||
if (apl->read (bi->data(), mix_buffer, gain_buffer, start, nframes, n) != nframes) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ Auditioner::audition_current_playlist ()
|
|||
|
||||
/* force a panner reset now that we have all channels */
|
||||
|
||||
_panner->reset (n_outputs().get(DataType::AUDIO), _diskstream->n_channels().get(DataType::AUDIO));
|
||||
_panner->reset (n_outputs().n_audio(), _diskstream->n_channels().n_audio());
|
||||
|
||||
g_atomic_int_set (&_active, 1);
|
||||
}
|
||||
|
@ -140,10 +140,10 @@ Auditioner::audition_region (boost::shared_ptr<Region> region)
|
|||
_diskstream->playlist()->clear ();
|
||||
_diskstream->playlist()->add_region (the_region, 0, 1);
|
||||
|
||||
if (_diskstream->n_channels().get(DataType::AUDIO) < the_region->n_channels()) {
|
||||
audio_diskstream()->add_channel (the_region->n_channels() - _diskstream->n_channels().get(DataType::AUDIO));
|
||||
} else if (_diskstream->n_channels().get(DataType::AUDIO) > the_region->n_channels()) {
|
||||
audio_diskstream()->remove_channel (_diskstream->n_channels().get(DataType::AUDIO) - the_region->n_channels());
|
||||
if (_diskstream->n_channels().n_audio() < the_region->n_channels()) {
|
||||
audio_diskstream()->add_channel (the_region->n_channels() - _diskstream->n_channels().n_audio());
|
||||
} else if (_diskstream->n_channels().n_audio() > the_region->n_channels()) {
|
||||
audio_diskstream()->remove_channel (_diskstream->n_channels().n_audio() - the_region->n_channels());
|
||||
}
|
||||
|
||||
/* force a panner reset now that we have all channels */
|
||||
|
|
|
@ -283,14 +283,14 @@ IO::deliver_output (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame,
|
|||
/* ********** MIDI ********** */
|
||||
|
||||
// No MIDI, we're done here
|
||||
if (bufs.count().get(DataType::MIDI) == 0) {
|
||||
if (bufs.count().n_midi() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const DataType type = DataType::MIDI;
|
||||
|
||||
// Copy any MIDI 1:1 to outputs
|
||||
assert(bufs.count().get(DataType::MIDI) == output_buffers().count().get(DataType::MIDI));
|
||||
assert(bufs.count().n_midi() == output_buffers().count().n_midi());
|
||||
BufferSet::iterator o = output_buffers().begin(type);
|
||||
for (BufferSet::iterator i = bufs.begin(type); i != bufs.end(type); ++i, ++o) {
|
||||
o->read_from(*i, nframes, offset);
|
||||
|
@ -1143,7 +1143,7 @@ IO::reset_panner ()
|
|||
{
|
||||
if (panners_legal) {
|
||||
if (!no_panner_reset) {
|
||||
_panner->reset (n_outputs().get(DataType::AUDIO), pans_required());
|
||||
_panner->reset (n_outputs().n_audio(), pans_required());
|
||||
}
|
||||
} else {
|
||||
panner_legal_c.disconnect ();
|
||||
|
@ -1154,7 +1154,7 @@ IO::reset_panner ()
|
|||
int
|
||||
IO::panners_became_legal ()
|
||||
{
|
||||
_panner->reset (n_outputs().get(DataType::AUDIO), pans_required());
|
||||
_panner->reset (n_outputs().n_audio(), pans_required());
|
||||
_panner->load (); // automation
|
||||
panner_legal_c.disconnect ();
|
||||
return 0;
|
||||
|
|
|
@ -536,7 +536,7 @@ LadspaPlugin::connect_and_run (BufferSet& bufs, uint32_t& in_index, uint32_t& ou
|
|||
|
||||
then = get_cycles ();
|
||||
|
||||
const uint32_t nbufs = bufs.count().get(DataType::AUDIO);
|
||||
const uint32_t nbufs = bufs.count().n_audio();
|
||||
|
||||
while (port_index < parameter_count()) {
|
||||
if (LADSPA_IS_PORT_AUDIO (port_descriptor(port_index))) {
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace ARDOUR {
|
|||
void
|
||||
PeakMeter::run (BufferSet& bufs, nframes_t nframes, nframes_t offset)
|
||||
{
|
||||
size_t meterable = std::min(bufs.count().get(DataType::AUDIO), _peak_power.size());
|
||||
size_t meterable = std::min(bufs.count().n_audio(), _peak_power.size());
|
||||
|
||||
// Meter what we have
|
||||
for (size_t n = 0; n < meterable; ++n) {
|
||||
|
@ -67,7 +67,7 @@ PeakMeter::reset_max ()
|
|||
void
|
||||
PeakMeter::setup (const ChanCount& in)
|
||||
{
|
||||
uint32_t limit = in.get(DataType::AUDIO);
|
||||
uint32_t limit = in.n_audio();
|
||||
|
||||
while (_peak_power.size() > limit) {
|
||||
_peak_power.pop_back();
|
||||
|
|
|
@ -184,7 +184,7 @@ MidiDiskstream::non_realtime_input_change ()
|
|||
void
|
||||
MidiDiskstream::get_input_sources ()
|
||||
{
|
||||
uint32_t ni = _io->n_inputs().get(DataType::MIDI);
|
||||
uint32_t ni = _io->n_inputs().n_midi();
|
||||
|
||||
if (ni == 0) {
|
||||
return;
|
||||
|
|
|
@ -355,7 +355,7 @@ int
|
|||
MidiTrack::no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset,
|
||||
bool session_state_changing, bool can_record, bool rec_monitors_input)
|
||||
{
|
||||
if (n_outputs().get(DataType::MIDI) == 0) {
|
||||
if (n_outputs().n_midi() == 0) {
|
||||
//return 0;
|
||||
throw; // FIXME
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ MidiTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame,
|
|||
|
||||
/* copy the diskstream data to all output buffers */
|
||||
|
||||
//const size_t limit = n_process_buffers().get(DataType::AUDIO);
|
||||
//const size_t limit = n_process_buffers().n_audio();
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||
|
||||
diskstream->get_playback(bufs.get_midi(0), start_frame, end_frame);
|
||||
|
@ -510,7 +510,7 @@ int
|
|||
MidiTrack::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset,
|
||||
bool can_record, bool rec_monitors_input)
|
||||
{
|
||||
if (n_outputs().get(DataType::MIDI) == 0 && _redirects.empty()) {
|
||||
if (n_outputs().n_midi() == 0 && _redirects.empty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
|
|||
void
|
||||
BaseStereoPanner::distribute (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, nframes_t nframes)
|
||||
{
|
||||
assert(obufs.count().get(DataType::AUDIO) == 2);
|
||||
assert(obufs.count().n_audio() == 2);
|
||||
|
||||
pan_t delta;
|
||||
Sample* dst;
|
||||
|
@ -430,7 +430,7 @@ EqualPowerStereoPanner::distribute_automated (AudioBuffer& srcbuf, BufferSet& ob
|
|||
nframes_t start, nframes_t end, nframes_t nframes,
|
||||
pan_t** buffers)
|
||||
{
|
||||
assert(obufs.count().get(DataType::AUDIO) == 2);
|
||||
assert(obufs.count().n_audio() == 2);
|
||||
|
||||
Sample* dst;
|
||||
pan_t* pbuf;
|
||||
|
@ -1335,9 +1335,9 @@ Panner::set_position (float xpos, float ypos, float zpos, StreamPanner& orig)
|
|||
void
|
||||
Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes_t nframes, nframes_t offset, gain_t gain_coeff)
|
||||
{
|
||||
if (outbufs.count().get(DataType::AUDIO) == 0) {
|
||||
if (outbufs.count().n_audio() == 0) {
|
||||
// Don't want to lose audio...
|
||||
assert(inbufs.count().get(DataType::AUDIO) == 0);
|
||||
assert(inbufs.count().n_audio() == 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1346,7 +1346,7 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
|
|||
assert(!empty());
|
||||
|
||||
|
||||
if (outbufs.count().get(DataType::AUDIO) == 1) {
|
||||
if (outbufs.count().n_audio() == 1) {
|
||||
|
||||
AudioBuffer& dst = outbufs.get_audio(0);
|
||||
|
||||
|
@ -1402,9 +1402,9 @@ Panner::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, nframes
|
|||
void
|
||||
Panner::distribute (BufferSet& inbufs, BufferSet& outbufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset)
|
||||
{
|
||||
if (outbufs.count().get(DataType::AUDIO) == 0) {
|
||||
if (outbufs.count().n_audio() == 0) {
|
||||
// Failing to deliver audio we were asked to deliver is a bug
|
||||
assert(inbufs.count().get(DataType::AUDIO) == 0);
|
||||
assert(inbufs.count().n_audio() == 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ Panner::distribute (BufferSet& inbufs, BufferSet& outbufs, nframes_t start_frame
|
|||
|
||||
// Otherwise.. let the automation flow, baby
|
||||
|
||||
if (outbufs.count().get(DataType::AUDIO) == 1) {
|
||||
if (outbufs.count().n_audio() == 1) {
|
||||
|
||||
AudioBuffer& dst = outbufs.get_audio(0);
|
||||
|
||||
|
@ -1447,7 +1447,7 @@ Panner::distribute (BufferSet& inbufs, BufferSet& outbufs, nframes_t start_frame
|
|||
}
|
||||
|
||||
// More than 1 output, we should have 1 panner for each input
|
||||
assert(size() == inbufs.count().get(DataType::AUDIO));
|
||||
assert(size() == inbufs.count().n_audio());
|
||||
|
||||
/* the terrible silence ... */
|
||||
for (BufferSet::audio_iterator i = outbufs.audio_begin(); i != outbufs.audio_end(); ++i) {
|
||||
|
|
|
@ -1789,7 +1789,7 @@ Route::set_control_outs (const vector<string>& ports)
|
|||
|
||||
// XXX its stupid that we have to get this value twice
|
||||
|
||||
limit = n_outputs().get(DataType::AUDIO);
|
||||
limit = n_outputs().n_audio();
|
||||
|
||||
if (_control_outs->ensure_io (ChanCount::ZERO, ChanCount (DataType::AUDIO, n_outputs().get (DataType::AUDIO)), true, this)) {
|
||||
return -1;
|
||||
|
@ -2018,7 +2018,7 @@ Route::output_change_handler (IOChange change, void *ignored)
|
|||
{
|
||||
if (change & ConfigurationChanged) {
|
||||
if (_control_outs) {
|
||||
_control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().get(DataType::AUDIO)), true, this);
|
||||
_control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().n_audio()), true, this);
|
||||
}
|
||||
|
||||
reset_plugin_counts (0);
|
||||
|
@ -2028,11 +2028,11 @@ Route::output_change_handler (IOChange change, void *ignored)
|
|||
uint32_t
|
||||
Route::pans_required () const
|
||||
{
|
||||
if (n_outputs().get(DataType::AUDIO) < 2) {
|
||||
if (n_outputs().n_audio() < 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return max (n_inputs ().get(DataType::AUDIO), static_cast<size_t>(redirect_max_outs.get(DataType::AUDIO)));
|
||||
return max (n_inputs ().n_audio(), static_cast<size_t>(redirect_max_outs.n_audio()));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -804,8 +804,8 @@ Session::when_engine_running ()
|
|||
|
||||
_master_out->defer_pan_reset ();
|
||||
|
||||
while (_master_out->n_inputs().get(DataType::AUDIO)
|
||||
< _master_out->input_maximum().get(DataType::AUDIO)) {
|
||||
while (_master_out->n_inputs().n_audio()
|
||||
< _master_out->input_maximum().n_audio()) {
|
||||
if (_master_out->add_input_port ("", this, DataType::AUDIO)) {
|
||||
error << _("cannot setup master inputs")
|
||||
<< endmsg;
|
||||
|
@ -813,8 +813,8 @@ Session::when_engine_running ()
|
|||
}
|
||||
}
|
||||
n = 0;
|
||||
while (_master_out->n_outputs().get(DataType::AUDIO)
|
||||
< _master_out->output_maximum().get(DataType::AUDIO)) {
|
||||
while (_master_out->n_outputs().n_audio()
|
||||
< _master_out->output_maximum().n_audio()) {
|
||||
if (_master_out->add_output_port (_engine.get_nth_physical_output (DataType::AUDIO, n), this, DataType::AUDIO)) {
|
||||
error << _("cannot setup master outputs")
|
||||
<< endmsg;
|
||||
|
@ -915,7 +915,7 @@ Session::hookup_io ()
|
|||
uint32_t n;
|
||||
vector<string> cports;
|
||||
|
||||
while (_control_out->n_inputs().get(DataType::AUDIO) < _control_out->input_maximum().get(DataType::AUDIO)) {
|
||||
while (_control_out->n_inputs().n_audio() < _control_out->input_maximum().n_audio()) {
|
||||
if (_control_out->add_input_port ("", this)) {
|
||||
error << _("cannot setup control inputs")
|
||||
<< endmsg;
|
||||
|
@ -923,7 +923,7 @@ Session::hookup_io ()
|
|||
}
|
||||
}
|
||||
n = 0;
|
||||
while (_control_out->n_outputs().get(DataType::AUDIO) < _control_out->output_maximum().get(DataType::AUDIO)) {
|
||||
while (_control_out->n_outputs().n_audio() < _control_out->output_maximum().n_audio()) {
|
||||
if (_control_out->add_output_port (_engine.get_nth_physical_output (DataType::AUDIO, n), this)) {
|
||||
error << _("cannot set up master outputs")
|
||||
<< endmsg;
|
||||
|
@ -1633,7 +1633,7 @@ Session::new_midi_track (TrackMode mode, uint32_t how_many)
|
|||
if (dynamic_cast<MidiTrack*>((*i).get()) != 0) {
|
||||
if (!(*i)->hidden()) {
|
||||
n++;
|
||||
channels_used += (*i)->n_inputs().get(DataType::MIDI);
|
||||
channels_used += (*i)->n_inputs().n_midi();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1666,7 +1666,7 @@ Session::new_midi_track (TrackMode mode, uint32_t how_many)
|
|||
error << "cannot configure 1 in/1 out configuration for new midi track" << endmsg;
|
||||
}
|
||||
|
||||
channels_used += track->n_inputs ().get(DataType::MIDI);
|
||||
channels_used += track->n_inputs ().n_midi();
|
||||
|
||||
track->DiskstreamChanged.connect (mem_fun (this, &Session::resort_routes));
|
||||
track->set_remote_control_id (ntracks());
|
||||
|
@ -1714,7 +1714,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
|
|||
if (dynamic_cast<AudioTrack*>((*i).get()) != 0) {
|
||||
if (!(*i)->hidden()) {
|
||||
n++;
|
||||
channels_used += (*i)->n_inputs().get(DataType::AUDIO);
|
||||
channels_used += (*i)->n_inputs().n_audio();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1774,7 +1774,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
|
|||
}
|
||||
|
||||
if (nphysical_in) {
|
||||
for (uint32_t x = 0; x < track->n_inputs().get(DataType::AUDIO) && x < nphysical_in; ++x) {
|
||||
for (uint32_t x = 0; x < track->n_inputs().n_audio() && x < nphysical_in; ++x) {
|
||||
|
||||
port = "";
|
||||
|
||||
|
@ -1788,7 +1788,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
|
|||
}
|
||||
}
|
||||
|
||||
for (uint32_t x = 0; x < track->n_outputs().get(DataType::MIDI); ++x) {
|
||||
for (uint32_t x = 0; x < track->n_outputs().n_midi(); ++x) {
|
||||
|
||||
port = "";
|
||||
|
||||
|
@ -1796,7 +1796,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
|
|||
port = physoutputs[(channels_used+x)%nphysical_out];
|
||||
} else if (Config->get_output_auto_connect() & AutoConnectMaster) {
|
||||
if (_master_out) {
|
||||
port = _master_out->input (x%_master_out->n_inputs().get(DataType::AUDIO))->name();
|
||||
port = _master_out->input (x%_master_out->n_inputs().n_audio())->name();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1805,7 +1805,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
|
|||
}
|
||||
}
|
||||
|
||||
channels_used += track->n_inputs ().get(DataType::AUDIO);
|
||||
channels_used += track->n_inputs ().n_audio();
|
||||
|
||||
track->audio_diskstream()->non_realtime_input_change();
|
||||
|
||||
|
@ -1939,7 +1939,7 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
|
|||
goto failure;
|
||||
}
|
||||
|
||||
for (uint32_t x = 0; n_physical_inputs && x < bus->n_inputs().get(DataType::AUDIO); ++x) {
|
||||
for (uint32_t x = 0; n_physical_inputs && x < bus->n_inputs().n_audio(); ++x) {
|
||||
|
||||
port = "";
|
||||
|
||||
|
@ -1952,7 +1952,7 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
|
|||
}
|
||||
}
|
||||
|
||||
for (uint32_t x = 0; n_physical_outputs && x < bus->n_outputs().get(DataType::AUDIO); ++x) {
|
||||
for (uint32_t x = 0; n_physical_outputs && x < bus->n_outputs().n_audio(); ++x) {
|
||||
|
||||
port = "";
|
||||
|
||||
|
@ -1960,7 +1960,7 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
|
|||
port = physoutputs[((n+x)%n_physical_outputs)];
|
||||
} else if (Config->get_output_auto_connect() & AutoConnectMaster) {
|
||||
if (_master_out) {
|
||||
port = _master_out->input (x%_master_out->n_inputs().get(DataType::AUDIO))->name();
|
||||
port = _master_out->input (x%_master_out->n_inputs().n_audio())->name();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2031,7 +2031,7 @@ Session::add_routes (RouteList& new_routes, bool save)
|
|||
if (_control_out && IO::connecting_legal) {
|
||||
|
||||
vector<string> cports;
|
||||
uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO);
|
||||
uint32_t ni = _control_out->n_inputs().n_audio();
|
||||
|
||||
for (uint32_t n = 0; n < ni; ++n) {
|
||||
cports.push_back (_control_out->input(n)->name());
|
||||
|
@ -3121,7 +3121,7 @@ Session::audio_path_from_name (string name, uint32_t nchan, uint32_t chan, bool
|
|||
boost::shared_ptr<AudioFileSource>
|
||||
Session::create_audio_source_for_session (AudioDiskstream& ds, uint32_t chan, bool destructive)
|
||||
{
|
||||
string spath = audio_path_from_name (ds.name(), ds.n_channels().get(DataType::AUDIO), chan, destructive);
|
||||
string spath = audio_path_from_name (ds.name(), ds.n_channels().n_audio(), chan, destructive);
|
||||
return boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *this, spath, destructive, frame_rate()));
|
||||
}
|
||||
|
@ -3817,7 +3817,7 @@ Session::ensure_buffers (ChanCount howmany)
|
|||
_send_buffers->ensure_buffers(howmany, current_block_size);
|
||||
_silent_buffers->ensure_buffers(howmany, current_block_size);
|
||||
|
||||
allocate_pan_automation_buffers (current_block_size, howmany.get(DataType::AUDIO), false);
|
||||
allocate_pan_automation_buffers (current_block_size, howmany.n_audio(), false);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
@ -4049,7 +4049,7 @@ Session::write_one_audio_track (AudioTrack& track, nframes_t start, nframes_t le
|
|||
|
||||
dir = discover_best_sound_dir ();
|
||||
|
||||
for (uint32_t chan_n=0; chan_n < nchans.get(DataType::AUDIO); ++chan_n) {
|
||||
for (uint32_t chan_n=0; chan_n < nchans.n_audio(); ++chan_n) {
|
||||
|
||||
for (x = 0; x < 99999; ++x) {
|
||||
snprintf (buf, sizeof(buf), "%s/%s-%d-bounce-%" PRIu32 ".wav", dir.c_str(), playlist->name().c_str(), chan_n, x+1);
|
||||
|
|
Loading…
Reference in New Issue