+ // send feedback for newly created control surface
+ strip_feedback (sur, true);
+ global_feedback (sur);
+ _strip_select (boost::shared_ptr<ARDOUR::Stripable>(), get_address (msg));
+
+}
+
+void
+OSC::surface_list (lo_message msg)
+{
+ /* this function is for debugging and prints lots of
+ * information about what surfaces Ardour knows about and their
+ * internal parameters. It is best accessed by sending:
+ * /surface/list from oscsend. This command does not create
+ * a surface entry.
+ */
+
+ cerr << "List of known Surfaces: " << _surface.size() << "\n\n";
+
+ Glib::Threads::Mutex::Lock lm (surfaces_lock);
+ for (uint32_t it = 0; it < _surface.size(); it++) {
+ OSCSurface* sur = &_surface[it];
+ cerr << string_compose (" Surface: %1 URL: %2\n", it, sur->remote_url);
+ cerr << string_compose (" Number of strips: %1 Bank size: %2 Current Bank %3\n", sur->nstrips, sur->bank_size, sur->bank);
+ cerr << string_compose (" Use Custom: %1 Custom Strips: %2\n", sur->custom_enable, sur->custom_strips.size ());
+ bool ug = false;
+ if (sur->usegroup == PBD::Controllable::UseGroup) {
+ ug = true;
+ }
+ cerr << string_compose (" Strip Types: %1 Feedback: %2 no_clear: %3 gain mode: %4 use groups? %5\n", \
+ sur->strip_types.to_ulong(), sur->feedback.to_ulong(), sur->no_clear, sur->gainmode, ug);
+ cerr << string_compose (" using plugin: %1 of %2 plugins, with %3 params. page size: %4 page: %5\n", \
+ sur->plugin_id, sur->plugins.size(), sur->plug_params.size(), sur->plug_page_size, sur->plug_page);
+ cerr << string_compose (" send page size: %1 page: %2\n", sur->send_page_size, sur->send_page);
+ cerr << string_compose (" expanded? %1 track: %2 jogmode: %3\n", sur->expand_enable, sur->expand, sur->jogmode);
+ cerr << string_compose (" personal monitor? %1, Aux master: %2, number of sends: %3\n", sur->cue, sur->aux, sur->sends.size());
+ cerr << string_compose (" Linkset: %1 Device Id: %2\n", sur->linkset, sur->linkid);
+ }
+ cerr << "\nList of LinkSets " << link_sets.size() << "\n\n";
+ std::map<uint32_t, LinkSet>::iterator it;
+ for (it = link_sets.begin(); it != link_sets.end(); it++) {
+ if (!(*it).first) {
+ continue;
+ }
+ uint32_t devices = 0;
+ LinkSet* set = &(*it).second;
+ if (set->urls.size()) {
+ devices = set->urls.size() - 1;
+ }
+ cerr << string_compose (" Linkset %1 has %2 devices and sees %3 strips\n", (*it).first, devices, set->strips.size());
+ cerr << string_compose (" Bank size: %1 Current bank: %2 Strip Types: %3\n", set->banksize, set->bank, set->strip_types.to_ulong());
+ cerr << string_compose (" auto bank sizing: %1 linkset not ready: %2\n", set->autobank, set->not_ready);
+ }
+ cerr << "\n";
+}
+
+int
+OSC::custom_clear (lo_message msg)
+{
+ if (!session) {
+ return 0;
+ }
+ OSCSurface *sur = get_surface(get_address (msg), true);
+ sur->custom_enable = false;
+ sur->custom_strips.clear ();
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, false, sur->custom_strips);
+ sur->nstrips = sur->strips.size();
+ return set_bank (1, msg);
+}
+
+int
+OSC::custom_enable (float state, lo_message msg)
+{
+ if (!session) {
+ return 0;
+ }
+ OSCSurface *sur = get_surface(get_address (msg), true);
+ if (state > 0){
+ if (sur->custom_strips.size () == 0) {
+ PBD::warning << "No custom strips set to enable" << endmsg;
+ sur->custom_enable = false;
+ return -1;
+ } else {
+ sur->custom_enable = true;
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, true, sur->custom_strips);
+ sur->nstrips = sur->custom_strips.size();
+ return set_bank (1, msg);
+ }
+ } else {
+ sur->custom_enable = false;
+ sur->strips = get_sorted_stripables(sur->strip_types, sur->cue, false, sur->custom_strips);
+ sur->nstrips = sur->strips.size();
+ return set_bank (1, msg);
+ }
+ return -1;