summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-06-04 00:05:33 +0000
committerDavid Robillard <d@drobilla.net>2007-06-04 00:05:33 +0000
commit70fd14afe809c7ac7d3b5b382c77580d7b8f6085 (patch)
treeb996da4ea8757e58bbef4db13ca70f508a7464c2
parent5ee467790081b90b929bbeafda6b6d1f593929b5 (diff)
Show selected MIDI track in editor mixer.
Minor code cleanups. git-svn-id: svn://localhost/ardour2/trunk@1949 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/ardour_ui.cc6
-rw-r--r--gtk2_ardour/editor_mixer.cc8
-rw-r--r--gtk2_ardour/editor_mouse.cc6
-rw-r--r--gtk2_ardour/gain_meter.cc6
-rw-r--r--gtk2_ardour/mixer_strip.cc17
-rw-r--r--gtk2_ardour/mixer_strip.h2
-rw-r--r--gtk2_ardour/redirect_box.cc4
-rw-r--r--libs/ardour/ardour/chan_count.h8
-rw-r--r--libs/ardour/ardour/port_set.h6
-rw-r--r--libs/ardour/audio_track.cc6
-rw-r--r--libs/ardour/io.cc2
-rw-r--r--libs/ardour/midi_track.cc2
-rw-r--r--libs/ardour/route.cc14
-rw-r--r--libs/ardour/session.cc4
14 files changed, 47 insertions, 44 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index eacd19a328..e47362be88 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -724,7 +724,7 @@ ARDOUR_UI::count_recenabled_streams (Route& route)
{
Track* track = dynamic_cast<Track*>(&route);
if (track && track->diskstream()->record_enabled()) {
- rec_enabled_streams += track->n_inputs().get_total();
+ rec_enabled_streams += track->n_inputs().n_total();
}
}
@@ -1620,7 +1620,7 @@ ARDOUR_UI::name_io_setup (AudioEngine& engine,
bool in)
{
if (in) {
- if (io.n_inputs().get_total() == 0) {
+ if (io.n_inputs().n_total() == 0) {
buf = _("none");
return;
}
@@ -1639,7 +1639,7 @@ ARDOUR_UI::name_io_setup (AudioEngine& engine,
} else {
- if (io.n_outputs().get_total() == 0) {
+ if (io.n_outputs().n_total() == 0) {
buf = _("none");
return;
}
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc
index 5804381102..9bb481966e 100644
--- a/gtk2_ardour/editor_mixer.cc
+++ b/gtk2_ardour/editor_mixer.cc
@@ -133,10 +133,10 @@ Editor::show_editor_mixer (bool yn)
void
Editor::set_selected_mixer_strip (TimeAxisView& view)
{
- AudioTimeAxisView* at;
+ RouteTimeAxisView* rt;
bool show = false;
- if (!session || (at = dynamic_cast<AudioTimeAxisView*>(&view)) == 0) {
+ if (!session || (rt = dynamic_cast<RouteTimeAxisView*>(&view)) == 0) {
return;
}
@@ -144,7 +144,7 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
/* might be nothing to do */
- if (current_mixer_strip->route() == at->route()) {
+ if (current_mixer_strip->route() == rt->route()) {
return;
}
@@ -157,7 +157,7 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(),
*session,
- at->route());
+ rt->route());
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::cms_deleted));
if (show) {
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index e8a50686b3..22bb6e8a08 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -3404,12 +3404,12 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
boost::shared_ptr<Region> newregion;
boost::shared_ptr<Region> ar;
+ boost::shared_ptr<Region> mr;
if ((ar = boost::dynamic_pointer_cast<AudioRegion>(rv->region())) != 0) {
newregion = RegionFactory::create (ar);
- } else {
- /* XXX MIDI HERE drobilla */
- continue;
+ } else if ((mr = boost::dynamic_pointer_cast<MidiRegion>(rv->region())) != 0) {
+ newregion = RegionFactory::create (mr);
}
/* add it */
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 358db28edf..8c765a28ad 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -411,7 +411,7 @@ GainMeter::hide_all_meters ()
void
GainMeter::setup_meters ()
{
- uint32_t nmeters = _io->n_outputs().n_audio();
+ uint32_t nmeters = _io->n_outputs().n_total();
guint16 width;
hide_all_meters ();
@@ -432,7 +432,7 @@ GainMeter::setup_meters ()
} else {
- nmeters = _io->n_outputs().n_audio();
+ nmeters = _io->n_outputs().n_total();
}
@@ -453,7 +453,7 @@ GainMeter::setup_meters ()
/* pack them backwards */
if (_width == Wide) {
- meter_packer.pack_end (meter_metric_area, false, false);
+ meter_packer.pack_end (meter_metric_area, false, false);
meter_metric_area.show_all ();
}
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 1e007cac4c..2a3b045b27 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -622,7 +622,7 @@ MixerStrip::add_bundle_to_input_menu (ARDOUR::Bundle* c)
MenuList& citems = input_menu.items();
- if (c->nchannels() == _route->n_inputs().get_total()) {
+ if (c->nchannels() == _route->n_inputs().n_total()) {
citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_input_chosen), c)));
@@ -645,7 +645,7 @@ MixerStrip::add_bundle_to_output_menu (ARDOUR::Bundle* c)
return;
}
- if (c->nchannels() == _route->n_outputs().get_total()) {
+ if (c->nchannels() == _route->n_outputs().n_total()) {
MenuList& citems = output_menu.items();
citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::bundle_output_chosen), c)));
@@ -1171,6 +1171,7 @@ MixerStrip::route_active_changed ()
set_name ("MidiTrackStripBaseInactive");
gpm.set_meter_strip_name ("MidiTrackStripBaseInactive");
}
+ gpm.set_fader_name ("MidiTrackFader");
} else if (is_audio_track()) {
if (_route->active()) {
set_name ("AudioTrackStripBase");
@@ -1189,6 +1190,8 @@ MixerStrip::route_active_changed ()
gpm.set_meter_strip_name ("AudioBusStripBaseInactive");
}
gpm.set_fader_name ("AudioBusFader");
+
+ /* (no MIDI busses yet) */
}
}
@@ -1214,20 +1217,20 @@ MixerStrip::meter_changed (void *src)
ENSURE_GUI_THREAD (bind (mem_fun(*this, &MixerStrip::meter_changed), src));
- switch (_route->meter_point()) {
+ switch (_route->meter_point()) {
case MeterInput:
meter_point_label.set_text (_("input"));
break;
-
+
case MeterPreFader:
meter_point_label.set_text (_("pre"));
break;
-
+
case MeterPostFader:
meter_point_label.set_text (_("post"));
break;
- }
+ }
- gpm.setup_meters ();
+ gpm.setup_meters ();
}
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 02a78575ad..eb57037808 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -124,7 +124,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
RedirectBox pre_redirect_box;
RedirectBox post_redirect_box;
GainMeter gpm;
- PannerUI panners;
+ PannerUI panners;
Gtk::Table button_table;
Gtk::Table middle_button_table;
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index 99d7b9735d..9533cbf782 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -452,8 +452,8 @@ RedirectBox::weird_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr
p.name(),
p.get_info()->n_inputs,
p.get_info()->n_outputs,
- io->n_inputs().get_total(),
- io->n_outputs().get_total(),
+ io->n_inputs().n_total(),
+ io->n_outputs().n_total(),
streams));
}
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<MidiDiskstream> 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<Route> 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<Route> 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<Route> 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);