aboutsummaryrefslogtreecommitdiff
path: root/pluginhost~/src/pluginhost~.h
diff options
context:
space:
mode:
Diffstat (limited to 'pluginhost~/src/pluginhost~.h')
-rw-r--r--pluginhost~/src/pluginhost~.h205
1 files changed, 100 insertions, 105 deletions
diff --git a/pluginhost~/src/pluginhost~.h b/pluginhost~/src/pluginhost~.h
index ddf439c..48dff96 100644
--- a/pluginhost~/src/pluginhost~.h
+++ b/pluginhost~/src/pluginhost~.h
@@ -5,7 +5,7 @@
* This file incorporates code from the following sources:
*
* jack-dssi-host (BSD-style license): Copyright 2004 Chris Cannam, Steve Harris and Sean Bolton.
- *
+ *
* Hexter (GPL license): Copyright (C) 2004 Sean Bolton and others.
*
*
@@ -25,15 +25,15 @@
*/
#include <dlfcn.h>
-#include <lo/lo.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
-#include <stdlib.h> /*for exit()*/
-#include <sys/types.h> /* for fork() */
-#include <signal.h> /* for kill() */
-#include <sys/wait.h> /* for wait() */
-#include <dirent.h> /* for readdir() */
+#include <stdint.h> /* for uint8_t */
+#include <stdlib.h> /* for exit() */
+#include <sys/types.h> /* for fork() */
+#include <signal.h> /* for kill() */
+#include <sys/wait.h> /* for wait() */
+#include <dirent.h> /* for readdir() */
#include "m_pd.h"
#include "dssi.h"
@@ -41,30 +41,26 @@
#define DX7_VOICE_SIZE_PACKED 128 /*From hexter_types.h by Sean Bolton */
#define DX7_DUMP_SIZE_BULK 4096+8
-
-#define VERSION 0.99
-#define MY_NAME "pluginhost~"
-#define EVENT_BUFSIZE 1024
-#define OSC_BASE_MAX 1024
-#define TYPE_STRING_SIZE 20 /* Max size of event type string (must be two more bytes than needed) */
-#define DIR_STRING_SIZE 1024 /* Max size of directory string */
+#define VERSION 0.99
+#define MY_NAME "pluginhost~"
+#define EVENT_BUFSIZE 1024
+#define OSC_BASE_MAX 1024
+#define TYPE_STRING_SIZE 20
+#define DIR_STRING_SIZE 1024
#define DEBUG_STRING_SIZE 1024
-#define ASCII_n 110
-#define ASCII_p 112
-#define ASCII_c 99
-#define ASCII_b 98
-#define ASCII_t 116
-#define ASCII_a 97
-
-#define LOADGUI 0 /* FIX: depracate this */
+#define ASCII_n 110
+#define ASCII_p 112
+#define ASCII_c 99
+#define ASCII_b 98
+#define ASCII_t 116
+#define ASCII_a 97
+
+#define LOADGUI 0 /* FIX: deprecate this */
#ifdef DEBUG
#define CHECKSUM_PATCH_FILES_ON_LOAD 1
#endif
-#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
/*From dx7_voice.h by Sean Bolton */
@@ -74,114 +70,113 @@ typedef struct _dx7_patch_t {
typedef struct _ph_instance {
- long currentBank;
- long currentProgram;
- int pendingBankLSB;
- int pendingBankMSB;
- int pendingProgramChange;
-
- int plugin_ProgramCount;
- DSSI_Program_Descriptor *pluginPrograms;
-
- lo_address uiTarget; /*osc stuff */
- int ui_hidden;
- int ui_show;
- int uiNeedsProgramUpdate;
+ unsigned int plugin_ProgramCount;
char *ui_osc_control_path;
char *ui_osc_configure_path;
char *ui_osc_program_path;
char *ui_osc_show_path;
char *ui_osc_hide_path;
char *ui_osc_quit_path;
+ char *osc_url_path;
+ long currentBank;
+ long currentProgram;
+ int uiNeedsProgramUpdate;
+ int pendingProgramChange;
+ int pendingBankLSB;
+ int pendingBankMSB;
+ int ui_hidden;
+ int ui_show;
int *plugin_PortControlInNumbers; /*not sure if this should go here?*/
+ DSSI_Program_Descriptor *pluginPrograms;
- char *osc_url_path;
- pid_t gui_pid;
+} ph_instance;
-} t_ph_instance;
+typedef struct ph_configure_pair {
-struct ph_configure_pair {
- t_int instance;
- char *key,
- *value;
struct ph_configure_pair *next;
-};
+ char *value;
+ char *key;
+ int instance;
+
+} ph_configure_pair;
-typedef struct ph_configure_pair t_ph_configure_pair;
+//typedef struct ph_configure_pair t_ph_configure_pair;
typedef struct _port_info {
- t_atom type,
- data_type,
- name,
- lower_bound,
- upper_bound,
- p_default;
-} t_port_info;
+
+ t_atom lower_bound;
+ t_atom upper_bound;
+ t_atom data_type;
+ t_atom p_default;
+ t_atom type;
+ t_atom name;
+
+} ph_port_info;
typedef struct _ph_tilde {
- t_object x_obj;
- t_int is_DSSI;
+
+ int sr;
+ int blksize;
+ int time_ref;
+ int ports_in;
+ int ports_out;
+ int ports_controlIn;
+ int ports_controlOut;
+ int bufWriteIndex;
+ int bufReadIndex;
+
+ bool is_DSSI;
+ bool dsp;
+ bool dsp_loop;
+
+ char *plugin_basename;
char *plugin_label;
- char *plugin_full_path; /*absolute path to plugin */
- t_canvas *x_canvas; /* pointer to the canvas the object is instantiated on */
+ char *plugin_full_path;
+ char *project_dir;
void *plugin_handle;
- char *project_dir; /* project dircetory */
- LADSPA_Handle *instanceHandles; /*was handle*/
- t_ph_instance *instances;
- int n_instances;
+ char *osc_url_base;
+
+ float f;
+ float sr_inv;
+ float **plugin_InputBuffers;
+ float **plugin_OutputBuffers;
+ float *plugin_ControlDataInput;
+ float *plugin_ControlDataOutput;
+
+ unsigned int n_instances;
+ unsigned int plugin_ins;
+ unsigned int plugin_outs;
+ unsigned int plugin_controlIns;
+ unsigned int plugin_controlOuts;
unsigned long *instanceEventCounts;
+ unsigned long *plugin_ControlInPortNumbers;
unsigned char channelMap[128];
- snd_seq_event_t **instanceEventBuffers;
-
- snd_seq_event_t midiEventBuf[EVENT_BUFSIZE];
- /*static snd_seq_event_t **instanceEventBuffers;*/
- int bufWriteIndex, bufReadIndex;
- pthread_mutex_t midiEventBufferMutex;
- /*static pthread_mutex_t listHandlerMutex = PTHREAD_MUTEX_INITIALIZER;*/
DSSI_Descriptor_Function desc_func;
DSSI_Descriptor *descriptor;
+ LADSPA_Handle *instanceHandles;
- t_port_info *port_info;
-
- t_int ports_in, ports_out, ports_controlIn, ports_controlOut;
- t_int plugin_ins;/* total audio input ports for plugin*/
- t_int plugin_outs;/* total audio output ports plugin*/
- t_int plugin_controlIns;/* total control input ports*/
- t_int plugin_controlOuts;/* total control output ports */
-
- unsigned long *plugin_ControlInPortNumbers; /*Array of input port numbers for the plugin */
-
- t_float **plugin_InputBuffers, **plugin_OutputBuffers; /* arrays of arrays for buffering audio for each audio port */
- t_float *plugin_ControlDataInput, *plugin_ControlDataOutput; /*arrays for control data for each port (1 item per 'run')*/
- lo_server_thread osc_thread;
- char *osc_url_base;
- char *plugin_basename;
-
- t_int time_ref; /*logical time reference */
- t_int sr;
- t_float sr_inv;
- t_int blksize;
- t_float f;
-
- t_outlet **outlets;
- t_inlet **inlets;
+ t_inlet **inlets;
+ t_outlet **outlets;
t_outlet *control_outlet;
+ t_canvas *x_canvas;
+ t_object x_obj;
- t_ph_configure_pair *configure_buffer_head;
+ ph_port_info *port_info;
+ ph_instance *instances;
+ ph_configure_pair *configure_buffer_head;
- t_int dsp; /* boolean dsp setting */
- t_int dsp_loop;
-
-} t_ph_tilde;
+ snd_seq_event_t **instanceEventBuffers;
+ snd_seq_event_t midiEventBuf[EVENT_BUFSIZE];
-static char *ph_tilde_send_configure(t_ph_tilde *x, char *key,
- char *value, t_int instance);
-static int osc_message_handler(const char *path, const char *types,
- lo_arg **argv, int argc, void *data, void *user_data);
-static LADSPA_Data get_port_default(t_ph_tilde *x, int port);
-static void MIDIbuf(int type, int chan, int param, int val, t_ph_tilde *x);
-static void ph_debug_post(const char *fmt, ...);
+ pthread_mutex_t midiEventBufferMutex;
+} ph_tilde;
+static char *ph_tilde_send_configure(ph_tilde *x, char *key, char *value,
+ int instance);
+static void MIDIbuf(int type, unsigned int chan, int param, int val,
+ ph_tilde *x);
+static void ph_debug_post(const char *fmt, ...);
+static LADSPA_Data get_port_default(ph_tilde *x, int port);