Browse Source

Mixer: Teach modules how to serializer their input port settings.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
20530efd3d
4 changed files with 39 additions and 2 deletions
  1. +8
    -0
      Mixer/Chain.C
  2. +2
    -2
      Mixer/Meter_Indicator_Module.H
  3. +25
    -0
      Mixer/Module.C
  4. +4
    -0
      Mixer/Module.H

+ 8
- 0
Mixer/Chain.C View File

@@ -487,6 +487,14 @@ Chain::build_process_queue ( void )
DMESSAGE( "\t%s -->", (*i)->name() );
else if ( m->control_input.size() )
DMESSAGE( "\t%s <--", (*i)->name() );

{
char *s = m->describe_inputs();

DMESSAGE( "(%s)", s );

delete[] s;
}
}
}



+ 2
- 2
Mixer/Meter_Indicator_Module.H View File

@@ -44,8 +44,8 @@ public:

const char *name ( void ) const { return "Meter Indicator"; }

int can_support_inputs ( int n ) { return 0; }
bool configure_inputs ( int n ) { return false; }
int can_support_inputs ( int ) { return 0; }
bool configure_inputs ( int ) { return false; }

void pad ( bool v ) { _pad = v; }



+ 25
- 0
Mixer/Module.C View File

@@ -22,6 +22,7 @@

#include <stdlib.h>
#include <string.h>
#include <stdio.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
Module::draw_box ( void )
{


+ 4
- 0
Mixer/Module.H View File

@@ -289,6 +289,8 @@ public:
Chain *chain ( void ) const { return _chain; }
void chain ( Chain * v ) { _chain = v; }

char *describe_inputs ( void ) const;

virtual bool initialize ( void ) { return true; }

/* for the given number of inputs, return how many outputs this
@@ -312,6 +314,8 @@ public:

virtual void handle_port_connection_change () {}



protected:

void draw_connections ( void );


Loading…
Cancel
Save