+bool
+PluginInsert::reset_map (bool emit)
+{
+ uint32_t pc = 0;
+ const PinMappings old_in (_in_map);
+ const PinMappings old_out (_out_map);
+
+ _in_map.clear ();
+ _out_map.clear ();
+ for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i, ++pc) {
+ if (_match.method == Split) {
+ _in_map[pc] = ChanMapping ();
+ /* connect inputs in round-robin fashion */
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ const uint32_t cend = _configured_in.get (*t);
+ if (cend == 0) { continue; }
+ uint32_t c = 0;
+ for (uint32_t in = 0; in < natural_input_streams().get (*t); ++in) {
+ _in_map[pc].set (*t, in, c);
+ c = c + 1 % cend;
+ }
+ }
+ } else {
+ _in_map[pc] = ChanMapping (ChanCount::min (natural_input_streams (), _configured_in));
+ }
+ _out_map[pc] = ChanMapping (ChanCount::min (natural_output_streams(), _configured_out));
+
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ _in_map[pc].offset_to(*t, pc * natural_input_streams().get(*t));
+ _out_map[pc].offset_to(*t, pc * natural_output_streams().get(*t));
+ }
+ }
+ if (old_in == _in_map && old_out == _out_map) {
+ return false;
+ }
+ if (emit) {
+ PluginMapChanged (); /* EMIT SIGNAL */
+ }
+ return true;
+}
+