View Issue Details

IDProjectCategoryView StatusLast Update
0007433ardourfeaturespublic2020-04-19 20:18
ReporterOnkelDead Assigned Toovenwerks  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version5.10 
Summary0007433: OSC: expand plugin_descriptor function to respond in a sequence of parameter messages
DescriptionDue to OSC message size limitation, a plugin with a huge amount of parameters aren't controlable via OSC.

Current implementation responses all parameters in a single message.

The attached patch file will change the response of a /strip/plugin/descriptor to a sequence of OSC messages for each plugin parameter. Each message is headed with strip_id and plugin_id to ensure correct processing by the surface application. The sequence is terminated by a /strip/plugin/descriptor_end message.
TagsNo tags attached.

Activities

OnkelDead

2017-07-30 09:10

reporter  

plugin_descriptor.patch (2,867 bytes)   
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 09939fd..dda98b5 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -4076,11 +4076,6 @@ OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) {
 	boost::shared_ptr<ARDOUR::Plugin> pip = pi->plugin();
 	bool ok = false;
 
-	lo_message reply = lo_message_new();
-	lo_message_add_int32 (reply, ssid);
-	lo_message_add_int32 (reply, piid);
-	lo_message_add_int32(reply, redi->enabled() ? 1 : 0);
-
 	for ( uint32_t ppi = 0; ppi < pip->parameter_count(); ppi++) {
 
 		uint32_t controlid = pip->nth_parameter(ppi, ok);
@@ -4089,6 +4084,10 @@ OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) {
 		}
 		boost::shared_ptr<AutomationControl> c = pi->automation_control(Evoral::Parameter(PluginAutomation, 0, controlid));
 
+		lo_message reply = lo_message_new();
+		lo_message_add_int32 (reply, ssid);
+		lo_message_add_int32 (reply, piid);
+
 		lo_message_add_int32 (reply, ppi + 1);
 		ParameterDescriptor pd;
 		pi->plugin()->get_parameter_descriptor(controlid, pd);
@@ -4101,6 +4100,10 @@ OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) {
 		flags |= pd.logarithmic ? 4 : 0;
 		flags |= pd.sr_dependent ? 32 : 0;
 		flags |= pd.toggled ? 64 : 0;
+		flags |= pip->parameter_is_input(controlid) ? 0x80 : 0;
+
+		std::string param_desc = pi->plugin()->describe_parameter(Evoral::Parameter(PluginAutomation, 0, controlid));
+		flags |= (param_desc == X_("hidden")) ? 0x100 : 0;
 		lo_message_add_int32 (reply, flags);
 
 		switch(pd.datatype) {
@@ -4138,27 +4141,34 @@ OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) {
 				lo_message_add_string(reply, _("UNKNOWN"));
 				break;
 		}
-
 		lo_message_add_float (reply, pd.lower);
 		lo_message_add_float (reply, pd.upper);
 		lo_message_add_string (reply, pd.print_fmt.c_str());
 		if ( pd.scale_points ) {
 			lo_message_add_int32 (reply, pd.scale_points->size());
 			for ( ARDOUR::ScalePoints::const_iterator i = pd.scale_points->begin(); i != pd.scale_points->end(); ++i) {
-				lo_message_add_int32 (reply, i->second);
+				lo_message_add_float (reply, i->second);
 				lo_message_add_string (reply, ((std::string)i->first).c_str());
 			}
-		} else {
+		}
+		else {
 			lo_message_add_int32 (reply, 0);
 		}
 		if ( c ) {
 			lo_message_add_double (reply, c->get_value());
-		} else {
+		}
+		else {
 			lo_message_add_double (reply, 0);
 		}
+
+		lo_send_message (get_address (msg), "/strip/plugin/descriptor", reply);
+		lo_message_free (reply);
 	}
 
-	lo_send_message (get_address (msg), "/strip/plugin/descriptor", reply);
+	lo_message reply = lo_message_new ();
+	lo_message_add_int32 (reply, ssid);
+	lo_message_add_int32 (reply, piid);
+	lo_send_message (get_address (msg), "/strip/plugin/descriptor_end", reply);
 	lo_message_free (reply);
 
 	return 0;
plugin_descriptor.patch (2,867 bytes)   

ovenwerks

2017-08-01 14:31

reporter   ~0019946

Patched applied as commit ab02284fc

ovenwerks

2017-08-01 14:47

reporter   ~0019947

I may be more likely to see these as a pr against https://github.com/Ardour/ardour and a ping on irc #ardour

system

2020-04-19 20:18

developer   ~0023767

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2017-07-30 09:10 OnkelDead New Issue
2017-07-30 09:10 OnkelDead File Added: plugin_descriptor.patch
2017-08-01 14:31 ovenwerks Note Added: 0019946
2017-08-01 14:31 ovenwerks Status new => resolved
2017-08-01 14:31 ovenwerks Resolution open => fixed
2017-08-01 14:31 ovenwerks Assigned To => ovenwerks
2017-08-01 14:47 ovenwerks Note Added: 0019947
2020-04-19 20:18 system Note Added: 0023767
2020-04-19 20:18 system Status resolved => closed