View Issue Details

IDProjectCategoryView StatusLast Update
0007176ardourfeaturespublic2020-04-19 20:18
Reporter.onkel. Assigned Toovenwerks  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version5.5 
Summary0007176: OSC support for plugins needs improvment
DescriptionAs discussed in former issue 7137, we should modify the function OSC::route_plugin_descriptor(...) for some reason.

- remove redundant plugin name from response. It's already part of the plugin list.
- add boolean value which indicates the bypass state (enable/disable).
- the flags value owns a new bit which indicates if a parameter is input or output (0x80).
- mark "hidden" parameters with another flag bit (0x100).
- notify the parameter data type as an enumerated string instead of an obscures integer.

Please find a corresponding patch file attached.

Sorry for the delay, I wasn't able to report this before release of 5.5
TagsNo tags attached.

  Users sponsoring this issue
Sponsors List Total Sponsorship = US$ 5

2017-01-12 07:05: .onkel. (US$ 5)
  Users sponsoring this issue (Total Sponsorship = US$ 5)

Activities

.onkel.

2016-12-13 09:09

reporter  

plugin_descriptor.patch (4,854 bytes)   
--- 5.5/ardour/libs/surfaces/osc/osc.cc	2016-12-13 09:06:39.572145483 +0100
+++ 5.5.3/ardour/libs/surfaces/osc/osc.cc	2016-12-02 09:38:54.189879363 +0100
@@ -2877,54 +2877,90 @@
 	lo_message reply = lo_message_new();
 	lo_message_add_int32 (reply, ssid);
 	lo_message_add_int32 (reply, piid);
-	lo_message_add_string (reply, pip->name());
+	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);
 		if (!ok) {
 			continue;
 		}
-		if ( pip->parameter_is_input(controlid) || pip->parameter_is_control(controlid) ) {
-			boost::shared_ptr<AutomationControl> c = pi->automation_control(Evoral::Parameter(PluginAutomation, 0, controlid));
+		boost::shared_ptr<AutomationControl> c = pi->automation_control(Evoral::Parameter(PluginAutomation, 0, controlid));
 
-				lo_message_add_int32 (reply, ppi + 1);
-				ParameterDescriptor pd;
-				pi->plugin()->get_parameter_descriptor(controlid, pd);
-				lo_message_add_string (reply, pd.label.c_str());
-
-				// I've combined those binary descriptor parts in a bit-field to reduce lilo message elements
-				int flags = 0;
-				flags |= pd.enumeration ? 1 : 0;
-				flags |= pd.integer_step ? 2 : 0;
-				flags |= pd.logarithmic ? 4 : 0;
-				flags |= pd.max_unbound ? 8 : 0;
-				flags |= pd.min_unbound ? 16 : 0;
-				flags |= pd.sr_dependent ? 32 : 0;
-				flags |= pd.toggled ? 64 : 0;
-				flags |= c != NULL ? 128 : 0; // bit 7 indicates in input control
-				lo_message_add_int32 (reply, flags);
-
-				lo_message_add_int32 (reply, pd.datatype);
-				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_string (reply, ((std::string)i->first).c_str());
-					}
-				}
-				else {
-					lo_message_add_int32 (reply, 0);
-				}
-				if ( c ) {
-					lo_message_add_double (reply, c->get_value());
-				}
-				else {
-					lo_message_add_double (reply, 0);
+		lo_message_add_int32 (reply, ppi + 1);
+		ParameterDescriptor pd;
+		pi->plugin()->get_parameter_descriptor(controlid, pd);
+		lo_message_add_string (reply, pd.label.c_str());
+
+		// I've combined those binary descriptor parts in a bit-field to reduce lilo message elements
+		int flags = 0;
+		flags |= pd.enumeration ? 1 : 0;
+		flags |= pd.integer_step ? 2 : 0;
+		flags |= pd.logarithmic ? 4 : 0;
+		flags |= pd.max_unbound ? 8 : 0;
+		flags |= pd.min_unbound ? 16 : 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) {
+			case ARDOUR::Variant::BEATS:
+				lo_message_add_string(reply, _("BEATS"));
+				break;
+			case ARDOUR::Variant::BOOL:
+				lo_message_add_string(reply, _("BOOL"));
+				break;
+			case ARDOUR::Variant::DOUBLE:
+				lo_message_add_string(reply, _("DOUBLE"));
+				break;
+			case ARDOUR::Variant::FLOAT:
+				lo_message_add_string(reply, _("FLOAT"));
+				break;
+			case ARDOUR::Variant::INT:
+				lo_message_add_string(reply, _("INT"));
+				break;
+			case ARDOUR::Variant::LONG:
+				lo_message_add_string(reply, _("LONG"));
+				break;
+			case ARDOUR::Variant::NOTHING:
+				lo_message_add_string(reply, _("NOTHING"));
+				break;
+			case ARDOUR::Variant::PATH:
+				lo_message_add_string(reply, _("PATH"));
+				break;
+			case ARDOUR::Variant::STRING:
+				lo_message_add_string(reply, _("STRING"));
+				break;
+			case ARDOUR::Variant::URI:
+				lo_message_add_string(reply, _("URI"));
+				break;
+			default:
+				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_float (reply, i->second);
+				lo_message_add_string (reply, ((std::string)i->first).c_str());
 			}
 		}
+		else {
+			lo_message_add_int32 (reply, 0);
+		}
+		if ( c ) {
+			lo_message_add_double (reply, c->get_value());
+		}
+		else {
+			lo_message_add_double (reply, 0);
+		}
 	}
 
 	lo_send_message (get_address (msg), "/strip/plugin/descriptor", reply);
plugin_descriptor.patch (4,854 bytes)   

ovenwerks

2017-07-01 15:35

reporter   ~0019851

How will this extensive change affect those who have already created a surface based on current behavior? It seems it will break current surfaces using this code.

ovenwerks

2017-07-01 19:30

reporter   ~0019858

Sorry, looking back at the code added earlier I see it is your's anyway and you are likely the only one using it. I didn't see this earlier. Your patch will not apply cleanly as the file has changed too much since. (there are about 1000 lines of new code above this) applying manually.

ovenwerks

2017-07-01 20:20

reporter   ~0019860

Ok, I have added this to the code base. One concern I have is that with the plugins I have tested with, the pd.datatype is always "NOTHING". They are all LV2s, so maybe a different type of plugin does something else. Also, as pd.max_unbound and pd.min_unbound have already been removed from the code as per RG, I have not added them back in as your patch would suggest.

system

2020-04-19 20:18

developer   ~0023695

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
2016-12-13 09:09 .onkel. New Issue
2016-12-13 09:09 .onkel. File Added: plugin_descriptor.patch
2017-01-12 07:05 .onkel. Sponsorship Added .onkel.: US$ 5
2017-01-12 07:05 .onkel. Sponsorship Total 0 => 5
2017-07-01 15:35 ovenwerks Note Added: 0019851
2017-07-01 19:30 ovenwerks Note Added: 0019858
2017-07-01 20:20 ovenwerks Note Added: 0019860
2017-07-01 20:20 ovenwerks Status new => resolved
2017-07-01 20:20 ovenwerks Resolution open => fixed
2017-07-01 20:20 ovenwerks Assigned To => ovenwerks
2020-04-19 20:18 system Note Added: 0023695
2020-04-19 20:18 system Status resolved => closed