summaryrefslogtreecommitdiff
path: root/src/dssi-render.c
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-01-30 22:26:17 -0800
committeryo mama <pepper@scannerjammer.com>2015-01-30 22:26:17 -0800
commitdb45bebbe8870b705d5d09a21323df990de2f7e0 (patch)
tree5eed8ccb4b9944b02aa7cb25005587e160a29bbd /src/dssi-render.c
parent99fa69de4557b738eadb59bc4cb2742b0ba5bb97 (diff)
added HOWTO, calling it done
Diffstat (limited to 'src/dssi-render.c')
-rw-r--r--src/dssi-render.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/src/dssi-render.c b/src/dssi-render.c
index 621f4b3..bddfd06 100644
--- a/src/dssi-render.c
+++ b/src/dssi-render.c
@@ -163,8 +163,11 @@ main(int argc, char **argv) {
char *second_str;
parse_keyval(argv[++i], BANK_SEP, &first_str, &second_str);
if (second_str) {
+//check what happens to bank and program_no
bank = strtol(first_str, NULL, 0);
program_no = strtol(second_str, NULL, 0);
+ printf("bank: %d\n", bank);
+ printf("program_no: %d\n", program_no);
} else {
program_no = strtol(first_str, NULL, 0);
bank = 0;
@@ -174,6 +177,7 @@ main(int argc, char **argv) {
} else if (program_no == -2) {
src = from_random;
} else {
+//all endpoints go here
src = from_preset;
}
} else {
@@ -309,10 +313,13 @@ main(int argc, char **argv) {
connect_ports();
/* Set the control port values */
+ printf("PORT COUNT: %d", descriptor->LADSPA_Plugin->PortCount);
+ //FIXME change logic here
if (src == from_preset) {
/* Set the ports according to a preset */
if (descriptor->select_program) {
+ //select program...
descriptor->select_program(instanceHandle, bank, program_no);
}
} else {
@@ -321,20 +328,26 @@ main(int argc, char **argv) {
for (int j = 0; j < descriptor->LADSPA_Plugin->PortCount; j++) {
/* j is LADSPA port number */
- LADSPA_PortDescriptor pod =
- descriptor->LADSPA_Plugin->PortDescriptors[j];
-
+ //PortDescriptors are ints whose hex values determine whether the port is an input port, an output port, etc
+ //so here we go through all the descriptors...
+ LADSPA_PortDescriptor pod = descriptor->LADSPA_Plugin->PortDescriptors[j];
+
+ //if the descriptor is a control port and an input port...
if (LADSPA_IS_PORT_CONTROL(pod) && LADSPA_IS_PORT_INPUT(pod)) {
- LADSPA_Data val;
- if (src == from_defaults) {
- val = get_port_default(descriptor->LADSPA_Plugin, j);
- } else if (src == from_stdin) {
- scanf("%f", &val);
- } else if (src == from_random) {
- val = get_port_random(descriptor->LADSPA_Plugin, j);
- }
- pluginControlIns[controlIn] = val;
- controlIn++;
+ LADSPA_Data val; //this is a float...the value to assign to that port
+ if (src == from_defaults) {
+ //get the default value for that port
+ val = get_port_default(descriptor->LADSPA_Plugin, j);
+ } else if (src == from_stdin) {
+ //not sure how this works, but get a value from stdin I guess
+ scanf("%f", &val);
+ } else if (src == from_random) {
+ //get a random value appropritate for that port, set it to val
+ val = get_port_random(descriptor->LADSPA_Plugin, j);
+ }
+ //add it to the array of pluginControlIns... starts at 0
+ pluginControlIns[controlIn] = val;
+ controlIn++;
}
}
}
@@ -352,6 +365,7 @@ main(int argc, char **argv) {
*/
controlIn = 0;
+ //iterate again here...
for (int j = 0; j < descriptor->LADSPA_Plugin->PortCount; j++) {
/* j is LADSPA port number */
@@ -385,6 +399,7 @@ main(int argc, char **argv) {
}
}
+
/* Activate */
if (descriptor->LADSPA_Plugin->activate) {