summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2007-10-10 14:49:25 +0000
committerCarl Hetherington <carl@carlh.net>2007-10-10 14:49:25 +0000
commit796bfc025e4c4e4fa7c2659e57af6cde13319af8 (patch)
tree57656a9c4ec8392711f4d47ae3b32409a03ffad7 /libs
parentcf1adb02db2e51c8ca96169b91d84a18b512f64f (diff)
Make sure we notice when an IO's port count is reduced as well as when it's increased. Fixes an assertion failure when removing a port from an IO with 3 existing ports.
git-svn-id: svn://localhost/ardour2/trunk@2537 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/io.h3
-rw-r--r--libs/ardour/io.cc32
-rw-r--r--libs/ardour/midi_track.cc4
-rw-r--r--libs/ardour/plugin_insert.cc4
-rw-r--r--libs/ardour/session_state.cc2
5 files changed, 25 insertions, 20 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index a0b9df3c04..6c040be63e 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -204,7 +204,8 @@ class IO : public Automatable, public Latent
static sigc::signal<int> PortsLegal;
static sigc::signal<int> PannersLegal;
static sigc::signal<int> ConnectingLegal;
- static sigc::signal<void,ChanCount> MoreChannels;
+ /// raised when the number of input or output ports changes
+ static sigc::signal<void,ChanCount> PortCountChanged;
static sigc::signal<int> PortsCreated;
static void update_meters();
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index c1aac7ab94..a708821c20 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -70,7 +70,7 @@ sigc::signal<void> IO::Meter;
sigc::signal<int> IO::ConnectingLegal;
sigc::signal<int> IO::PortsLegal;
sigc::signal<int> IO::PannersLegal;
-sigc::signal<void,ChanCount> IO::MoreChannels;
+sigc::signal<void,ChanCount> IO::PortCountChanged;
sigc::signal<int> IO::PortsCreated;
Glib::StaticMutex IO::m_meter_signal_lock = GLIBMM_STATIC_MUTEX_INIT;
@@ -148,8 +148,8 @@ IO::IO (Session& s, const string& name,
m_meter_connection = Meter.connect (mem_fun (*this, &IO::meter));
}
- // Connect to our own MoreChannels signal to connect output buffers
- IO::MoreChannels.connect (mem_fun (*this, &IO::attach_buffers));
+ // Connect to our own PortCountChanged signal to connect output buffers
+ IO::PortCountChanged.connect (mem_fun (*this, &IO::attach_buffers));
_session.add_controllable (_gain_control);
@@ -188,8 +188,8 @@ IO::IO (Session& s, const XMLNode& node, DataType dt)
m_meter_connection = Meter.connect (mem_fun (*this, &IO::meter));
}
- // Connect to our own MoreChannels signal to connect output buffers
- IO::MoreChannels.connect (mem_fun (*this, &IO::attach_buffers));
+ // Connect to our own PortCountChanged signal to connect output buffers
+ IO::PortCountChanged.connect (mem_fun (*this, &IO::attach_buffers));
_session.add_controllable (_gain_control);
@@ -548,6 +548,8 @@ IO::remove_output_port (Port* port, void* src)
reset_panner ();
}
}
+
+ PortCountChanged (n_outputs()); /* EMIT SIGNAL */
}
if (change == ConnectionsChanged) {
@@ -558,8 +560,8 @@ IO::remove_output_port (Port* port, void* src)
output_changed (change, src);
_session.set_dirty ();
return 0;
- }
-
+ }
+
return -1;
}
@@ -609,7 +611,7 @@ IO::add_output_port (string destination, void* src, DataType type)
reset_panner ();
}
- MoreChannels (n_outputs()); /* EMIT SIGNAL */
+ PortCountChanged (n_outputs()); /* EMIT SIGNAL */
}
if (destination.length()) {
@@ -622,7 +624,7 @@ IO::add_output_port (string destination, void* src, DataType type)
output_changed (ConfigurationChanged, src); /* EMIT SIGNAL */
setup_bundles ();
_session.set_dirty ();
-
+
return 0;
}
@@ -657,6 +659,8 @@ IO::remove_input_port (Port* port, void* src)
reset_panner ();
}
}
+
+ PortCountChanged (n_inputs ()); /* EMIT SIGNAL */
}
if (change == ConfigurationChanged) {
@@ -718,7 +722,7 @@ IO::add_input_port (string source, void* src, DataType type)
reset_panner ();
}
- MoreChannels (n_inputs()); /* EMIT SIGNAL */
+ PortCountChanged (n_inputs()); /* EMIT SIGNAL */
}
if (source.length()) {
@@ -838,7 +842,7 @@ IO::ensure_inputs_locked (ChanCount count, bool clear, void* src)
drop_input_bundle ();
setup_peak_meters ();
reset_panner ();
- MoreChannels (n_inputs()); /* EMIT SIGNAL */
+ PortCountChanged (n_inputs()); /* EMIT SIGNAL */
_session.set_dirty ();
}
@@ -854,7 +858,7 @@ IO::ensure_inputs_locked (ChanCount count, bool clear, void* src)
/** Attach output_buffers to port buffers.
*
- * Connected to IO's own MoreChannels signal.
+ * Connected to IO's own PortCountChanged signal.
*/
void
IO::attach_buffers(ChanCount ignored)
@@ -1012,7 +1016,7 @@ IO::ensure_io (ChanCount in, ChanCount out, bool clear, void* src)
}
if (in_changed || out_changed) {
- MoreChannels (max (n_outputs(), n_inputs())); /* EMIT SIGNAL */
+ PortCountChanged (max (n_outputs(), n_inputs())); /* EMIT SIGNAL */
setup_bundles ();
_session.set_dirty ();
}
@@ -1101,7 +1105,7 @@ IO::ensure_outputs_locked (ChanCount count, bool clear, void* src)
if (changed) {
drop_output_bundle ();
- MoreChannels (n_outputs()); /* EMIT SIGNAL */
+ PortCountChanged (n_outputs()); /* EMIT SIGNAL */
_session.set_dirty ();
}
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index a6cd964e82..3b62fb0f84 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -73,7 +73,7 @@ MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mo
set_output_minimum(ChanCount(DataType::MIDI, 1));
set_output_maximum(ChanCount(DataType::MIDI, 1));
- MoreChannels(ChanCount(DataType::MIDI, 2)); /* EMIT SIGNAL */
+ PortCountChanged(ChanCount(DataType::MIDI, 2)); /* EMIT SIGNAL */
}
MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
@@ -87,7 +87,7 @@ MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
set_output_minimum(ChanCount(DataType::MIDI, 1));
set_output_maximum(ChanCount(DataType::MIDI, 1));
- MoreChannels(ChanCount(DataType::MIDI, 2)); /* EMIT SIGNAL */
+ PortCountChanged(ChanCount(DataType::MIDI, 2)); /* EMIT SIGNAL */
}
MidiTrack::~MidiTrack ()
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index 81c615aa11..3faebd7179 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -63,7 +63,7 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug, Placemen
{
Glib::Mutex::Lock em (_session.engine().process_lock());
- IO::MoreChannels (max(input_streams(), output_streams()));
+ IO::PortCountChanged (max(input_streams(), output_streams()));
}
ProcessorCreated (this); /* EMIT SIGNAL */
@@ -80,7 +80,7 @@ PluginInsert::PluginInsert (Session& s, const XMLNode& node)
{
Glib::Mutex::Lock em (_session.engine().process_lock());
- IO::MoreChannels (max(input_streams(), output_streams()));
+ IO::PortCountChanged (max(input_streams(), output_streams()));
}
}
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 618660e98f..f2f396cbee 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -266,7 +266,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
Controllable::Destroyed.connect (mem_fun (*this, &Session::remove_controllable));
- IO::MoreChannels.connect (mem_fun (*this, &Session::ensure_buffers));
+ IO::PortCountChanged.connect (mem_fun (*this, &Session::ensure_buffers));
/* stop IO objects from doing stuff until we're ready for them */