Mixer: Teach modules how to serializer their input port settings.
This commit is contained in:
parent
07ae3f3ade
commit
20530efd3d
|
@ -487,6 +487,14 @@ Chain::build_process_queue ( void )
|
||||||
DMESSAGE( "\t%s -->", (*i)->name() );
|
DMESSAGE( "\t%s -->", (*i)->name() );
|
||||||
else if ( m->control_input.size() )
|
else if ( m->control_input.size() )
|
||||||
DMESSAGE( "\t%s <--", (*i)->name() );
|
DMESSAGE( "\t%s <--", (*i)->name() );
|
||||||
|
|
||||||
|
{
|
||||||
|
char *s = m->describe_inputs();
|
||||||
|
|
||||||
|
DMESSAGE( "(%s)", s );
|
||||||
|
|
||||||
|
delete[] s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ public:
|
||||||
|
|
||||||
const char *name ( void ) const { return "Meter Indicator"; }
|
const char *name ( void ) const { return "Meter Indicator"; }
|
||||||
|
|
||||||
int can_support_inputs ( int n ) { return 0; }
|
int can_support_inputs ( int ) { return 0; }
|
||||||
bool configure_inputs ( int n ) { return false; }
|
bool configure_inputs ( int ) { return false; }
|
||||||
|
|
||||||
void pad ( bool v ) { _pad = v; }
|
void pad ( bool v ) { _pad = v; }
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "Module_Parameter_Editor.H"
|
#include "Module_Parameter_Editor.H"
|
||||||
|
|
||||||
|
@ -46,6 +47,30 @@ Module::~Module ( )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* return a string serializing this module's parameter settings. The
|
||||||
|
format is 1.0:2.0:... Where 1.0 is the value of the first control
|
||||||
|
input, 2.0 is the value of the second control input etc.
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
Module::describe_inputs ( void ) const
|
||||||
|
{
|
||||||
|
char *s = new char[1024];
|
||||||
|
s[0] = 0;
|
||||||
|
char *sp = s;
|
||||||
|
|
||||||
|
if ( control_input.size() )
|
||||||
|
{
|
||||||
|
for ( unsigned int i = 0; i < control_input.size(); ++i )
|
||||||
|
sp += snprintf( sp, 1024 - (sp - s),"%f:", control_input[i].control_value() );
|
||||||
|
|
||||||
|
*(sp - 1) = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Module::draw_box ( void )
|
Module::draw_box ( void )
|
||||||
{
|
{
|
||||||
|
|
|
@ -289,6 +289,8 @@ public:
|
||||||
Chain *chain ( void ) const { return _chain; }
|
Chain *chain ( void ) const { return _chain; }
|
||||||
void chain ( Chain * v ) { _chain = v; }
|
void chain ( Chain * v ) { _chain = v; }
|
||||||
|
|
||||||
|
char *describe_inputs ( void ) const;
|
||||||
|
|
||||||
virtual bool initialize ( void ) { return true; }
|
virtual bool initialize ( void ) { return true; }
|
||||||
|
|
||||||
/* for the given number of inputs, return how many outputs this
|
/* for the given number of inputs, return how many outputs this
|
||||||
|
@ -312,6 +314,8 @@ public:
|
||||||
|
|
||||||
virtual void handle_port_connection_change () {}
|
virtual void handle_port_connection_change () {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void draw_connections ( void );
|
void draw_connections ( void );
|
||||||
|
|
Loading…
Reference in New Issue