From 70fd14afe809c7ac7d3b5b382c77580d7b8f6085 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 4 Jun 2007 00:05:33 +0000 Subject: Show selected MIDI track in editor mixer. Minor code cleanups. git-svn-id: svn://localhost/ardour2/trunk@1949 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/chan_count.h | 8 ++++---- libs/ardour/ardour/port_set.h | 6 +++--- libs/ardour/audio_track.cc | 6 +++--- libs/ardour/io.cc | 2 +- libs/ardour/midi_track.cc | 2 +- libs/ardour/route.cc | 14 +++++++------- libs/ardour/session.cc | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h index 35052e4aea..a859c37b5a 100644 --- a/libs/ardour/ardour/chan_count.h +++ b/libs/ardour/ardour/chan_count.h @@ -47,11 +47,8 @@ public: // -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()]; } - size_t get_total() const + size_t n_total() const { size_t ret = 0; for (size_t i=0; i < DataType::num_types; ++i) @@ -60,6 +57,9 @@ public: return ret; } + void set(DataType type, size_t count) { _counts[type.to_index()] = count; } + size_t get(DataType type) const { return _counts[type.to_index()]; } + bool operator==(const ChanCount& other) const { for (size_t i=0; i < DataType::num_types; ++i) diff --git a/libs/ardour/ardour/port_set.h b/libs/ardour/ardour/port_set.h index 34967831e7..947730a5b9 100644 --- a/libs/ardour/ardour/port_set.h +++ b/libs/ardour/ardour/port_set.h @@ -63,7 +63,7 @@ public: const ChanCount& count() const { return _count; } - bool empty() const { return (_count.get_total() == 0); } + bool empty() const { return (_count.n_total() == 0); } // ITERATORS @@ -95,7 +95,7 @@ public: iterator end(DataType type = DataType::NIL) { return iterator(*this, type, - (type == DataType::NIL) ? _count.get_total() : _count.get(type)); + (type == DataType::NIL) ? _count.n_total() : _count.get(type)); } // FIXME: typeify @@ -118,7 +118,7 @@ public: }; const_iterator begin() const { return const_iterator(*this, 0); } - const_iterator end() const { return const_iterator(*this, _count.get_total()); } + const_iterator end() const { return const_iterator(*this, _count.n_total()); } class audio_iterator { diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 58cf38ec6e..b066f4000e 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -427,7 +427,7 @@ int AudioTrack::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_total() == 0) { + if (n_outputs().n_total() == 0) { return 0; } @@ -523,7 +523,7 @@ AudioTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, } - if (n_outputs().get_total() == 0 && _redirects.empty()) { + if (n_outputs().n_total() == 0 && _redirects.empty()) { return 0; } @@ -619,7 +619,7 @@ int AudioTrack::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_total() == 0 && _redirects.empty()) { + if (n_outputs().n_total() == 0 && _redirects.empty()) { return 0; } diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index d7ac2b7e74..b08450d549 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -493,7 +493,7 @@ IO::set_input (Port* other_port, void* src) to the specified source. */ - if (_input_minimum.get_total() > 1) { + if (_input_minimum.n_total() > 1) { /* sorry, you can't do this */ return -1; } diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index cf08cc9072..72e703d906 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -426,7 +426,7 @@ MidiTrack::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, int dret; boost::shared_ptr diskstream = midi_diskstream(); - if (n_outputs().get_total() == 0 && _redirects.empty()) { + if (n_outputs().n_total() == 0 && _redirects.empty()) { return 0; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e431df1ba9..9359c8f767 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2159,8 +2159,8 @@ Route::feeds (boost::shared_ptr other) uint32_t i, j; IO& self = *this; - uint32_t no = self.n_outputs().get_total(); - uint32_t ni = other->n_inputs ().get_total(); + uint32_t no = self.n_outputs().n_total(); + uint32_t ni = other->n_inputs ().n_total(); for (i = 0; i < no; ++i) { for (j = 0; j < ni; ++j) { @@ -2174,7 +2174,7 @@ Route::feeds (boost::shared_ptr other) for (RedirectList::iterator r = _redirects.begin(); r != _redirects.end(); r++) { - no = (*r)->n_outputs().get_total(); + no = (*r)->n_outputs().n_total(); for (i = 0; i < no; ++i) { for (j = 0; j < ni; ++j) { @@ -2189,7 +2189,7 @@ Route::feeds (boost::shared_ptr other) if (_control_outs) { - no = _control_outs->n_outputs().get_total(); + no = _control_outs->n_outputs().n_total(); for (i = 0; i < no; ++i) { for (j = 0; j < ni; ++j) { @@ -2321,7 +2321,7 @@ int Route::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_total() == 0) { + if (n_outputs().n_total() == 0) { return 0; } @@ -2332,7 +2332,7 @@ Route::no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, n apply_gain_automation = false; - if (n_inputs().get_total()) { + if (n_inputs().n_total()) { passthru (start_frame, end_frame, nframes, offset, 0, false); } else { silence (nframes, offset); @@ -2379,7 +2379,7 @@ Route::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nfra } } - if ((n_outputs().get_total() == 0 && _redirects.empty()) || n_inputs().get_total() == 0 || !_active) { + if ((n_outputs().n_total() == 0 && _redirects.empty()) || n_inputs().n_total() == 0 || !_active) { silence (nframes, offset); return 0; } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 3f1760c88a..af66f776d0 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -698,8 +698,8 @@ Session::when_engine_running () Bundle* c = new OutputBundle (_("Master Out"), true); - c->set_nchannels (_master_out->n_inputs().get_total()); - for (uint32_t n = 0; n < _master_out->n_inputs ().get_total(); ++n) { + c->set_nchannels (_master_out->n_inputs().n_total()); + for (uint32_t n = 0; n < _master_out->n_inputs ().n_total(); ++n) { c->add_port_to_channel ((int) n, _master_out->input(n)->name()); } add_bundle (c); -- cgit v1.2.3