
Contents of /Public_Sound_Midi-1.0/Midi.c:
/* Generated from "Midi.cmod" by precompile.pike
*
* Do NOT edit this file.
*/
#undef PRECOMPILE_API_VERSION
#define PRECOMPILE_API_VERSION 2
#line 1 "Midi.cmod"
#include "global.h"
#include "svalue.h"
#include "interpret.h"
#include "backend.h"
#include "module_support.h"
#include "object.h"
#include "builtin_functions.h"
#include "mapping.h"
#include "threads.h"
#include "bignum.h"
/* All your includes here */
#include "portmidi/porttime.h"
#include "portmidi/portmidi.h"
/* Global variables
*/
#define TIME_PROC ((long (*)(void *)) Pt_Time)
#define TIME_INFO NULL
#define TIME_START Pt_Start(1, 0, 0)
#ifndef DEFAULT_CMOD_STORAGE
#define DEFAULT_CMOD_STORAGE
#endif
/*! @module Public
*/
/*! @module Sound
*/
/*! @module Midi
*/
/*! @class Device
*/
#line 38 "Midi.cmod"
/* note
This MIDI module is a wrapper around portmidi (http://portmedia.sourceforge.net/) and consists of two classes:
The class Device is used for the actual communication, and the additional class Control is used to find out about the available MIDI devices.
*/
#undef class_Device_defined
#define class_Device_defined
DEFAULT_CMOD_STORAGE struct program *Device_program=NULL;
static int Device_program_fun_num=-1;
#undef var_info_Device_defined
#define var_info_Device_defined
#undef var_stream_Device_defined
#define var_stream_Device_defined
#undef var_ID_Device_defined
#define var_ID_Device_defined
#undef var_output_buffer_Device_defined
#define var_output_buffer_Device_defined
#undef var_input_buffer_Device_defined
#define var_input_buffer_Device_defined
#undef var_status_Device_defined
#define var_status_Device_defined
#undef var_data1_Device_defined
#define var_data1_Device_defined
#undef var_data2_Device_defined
#define var_data2_Device_defined
#undef THIS
#define THIS ((struct Device_struct *)(Pike_interpreter.frame_pointer->current_storage))
#undef THIS_DEVICE
#define THIS_DEVICE ((struct Device_struct *)(Pike_interpreter.frame_pointer->current_storage))
#undef OBJ2_DEVICE
#define OBJ2_DEVICE(o) ((struct Device_struct *)(o->storage+Device_storage_offset))
#undef GET_DEVICE_STORAGE
#define GET_DEVICE_STORAGE ((struct Device_struct *)(o->storage+Device_storage_offset)
static ptrdiff_t Device_storage_offset;
struct Device_struct {
#ifdef var_info_Device_defined
#line 44 "Midi.cmod"
const PmDeviceInfo * info;
#endif /* var_info_Device_defined */
#ifdef var_stream_Device_defined
#line 45 "Midi.cmod"
PmStream * stream;
#endif /* var_stream_Device_defined */
#ifdef var_ID_Device_defined
#line 46 "Midi.cmod"
int ID;
#endif /* var_ID_Device_defined */
#ifdef var_output_buffer_Device_defined
#line 47 "Midi.cmod"
PmEvent output_buffer[1];
#endif /* var_output_buffer_Device_defined */
#ifdef var_input_buffer_Device_defined
#line 48 "Midi.cmod"
PmEvent input_buffer[1];
#endif /* var_input_buffer_Device_defined */
#ifdef var_status_Device_defined
#line 49 "Midi.cmod"
int status;
#endif /* var_status_Device_defined */
#ifdef var_data1_Device_defined
#line 50 "Midi.cmod"
int data1;
#endif /* var_data1_Device_defined */
#ifdef var_data2_Device_defined
#line 51 "Midi.cmod"
int data2;
#endif /* var_data2_Device_defined */
};
#ifdef PIKE_DEBUG
/* Ensure the struct is used in a variable declaration, or else gdb might not see it. */
static struct Device_struct *Device_gdb_dummy_ptr;
#endif
/*! @decl void create(int ID)
*! Create a MIDI object for communication. You have to provide a device ID. ID numbers start from zero and go up until the maximum available. (Which can be checked with a control object, using the count_devices() function.)
*! @note
*! Each port is another device!
*/
#define f_Device_create_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_create_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_create(INT32 args) {
#line 59 "Midi.cmod"
INT_TYPE device_id;
#line 59 "Midi.cmod"
if(args != 1) wrong_number_of_args_error("create",args,1);
#line 59 "Midi.cmod"
if(Pike_sp[0-1].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("create",1,"int");
#line 59 "Midi.cmod"
device_id=Pike_sp[0-1].u.integer;
#line 59 "Midi.cmod"
{
THIS->info = Pm_GetDeviceInfo(device_id);
THIS->ID = device_id;
pop_n_elems(args);
}
}
/*! @decl void set_ID(int ID)
*! Access another device with this object.
*/
#define f_Device_set_ID_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_set_ID_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_set_ID(INT32 args) {
#line 69 "Midi.cmod"
INT_TYPE device_id;
#line 69 "Midi.cmod"
if(args != 1) wrong_number_of_args_error("set_ID",args,1);
#line 69 "Midi.cmod"
if(Pike_sp[0-1].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("set_ID",1,"int");
#line 69 "Midi.cmod"
device_id=Pike_sp[0-1].u.integer;
#line 69 "Midi.cmod"
{
/* this does the same as the previous function, we should be able to merge them */
THIS->info = Pm_GetDeviceInfo(device_id);
THIS->ID = device_id;
pop_n_elems(args);
}
}
/*! @decl int get_ID()
*! Retrieve the ID of the MIDI device this object addresses.
*/
#define f_Device_get_ID_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_ID_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_ID(INT32 args) {
#line 80 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_ID",args,0);
#line 80 "Midi.cmod"
{
do { INT_TYPE ret_=((THIS->ID)); push_int(ret_); return; }while(0);
#line 82 "Midi.cmod"
}
}
/*! @decl int get_version()
*! Not really needed in most circumstanses. It gives you the version number of the PortMidi library.
*/
#define f_Device_get_version_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_version_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_version(INT32 args) {
#line 88 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_version",args,0);
#line 88 "Midi.cmod"
{
do { INT_TYPE ret_=((THIS->info->structVersion)); push_int(ret_); return; }while(0);
#line 90 "Midi.cmod"
}
}
/*! @decl string get_interface()
*! This gives you the type of interface that goes with the device, like ALSA or Jack.
*/
#define f_Device_get_interface_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_interface_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_interface(INT32 args) {
#line 96 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_interface",args,0);
#line 96 "Midi.cmod"
{
struct pike_string *interface = make_shared_string(THIS->info->interf);
do { struct pike_string * ret_=((interface)); push_string(ret_); return; }while(0);
#line 99 "Midi.cmod"
}
}
/*! @decl string get_name()
*! This gives you the descriptive name of this interface.
*/
#define f_Device_get_name_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_name_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_name(INT32 args) {
#line 105 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_name",args,0);
#line 105 "Midi.cmod"
{
struct pike_string *name = make_shared_string(THIS->info->name);
do { struct pike_string * ret_=((name)); push_string(ret_); return; }while(0);
#line 108 "Midi.cmod"
}
}
/*! @decl int is_input()
*! See if this device is an input or output.
*/
#define f_Device_is_input_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_is_input_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_is_input(INT32 args) {
#line 114 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("is_input",args,0);
#line 114 "Midi.cmod"
{
do { INT_TYPE ret_=((THIS->info->input)); push_int(ret_); return; }while(0);
#line 116 "Midi.cmod"
}
}
/*! @decl int is_output()
*! See if this device is an input or output.
*/
#define f_Device_is_output_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_is_output_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_is_output(INT32 args) {
#line 122 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("is_output",args,0);
#line 122 "Midi.cmod"
{
do { INT_TYPE ret_=((THIS->info->output)); push_int(ret_); return; }while(0);
#line 124 "Midi.cmod"
}
}
/*! @decl int is_open()
*! See if this device is opened, which is needed before you can use it.
*/
#define f_Device_is_open_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_is_open_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_is_open(INT32 args) {
#line 130 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("is_open",args,0);
#line 130 "Midi.cmod"
{
do { INT_TYPE ret_=((THIS->info->opened)); push_int(ret_); return; }while(0);
#line 132 "Midi.cmod"
}
}
/*! @decl int open()
*! Open the device. The return value will be null or an error id.
*/
#define f_Device_open_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_open_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_open(INT32 args) {
#line 138 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("open",args,0);
#line 138 "Midi.cmod"
{
int err;
if (THIS->info->output) {
err = Pm_OpenOutput(&THIS->stream, THIS->ID, NULL, 0, NULL, NULL, 0);
} else {
/* must be an input */
err = Pm_OpenInput(&THIS->stream, THIS->ID, NULL, 0, NULL, NULL);
}
do { INT_TYPE ret_=((err)); push_int(ret_); return; }while(0);
#line 147 "Midi.cmod"
}
}
/*! @decl int message(int status, int data1, int data2)
*! Directly output a MIDI message.
*! @param status
*! The status byte, like 0x90 for a note-on event. Consult a MIDI manual for more information.
*! @param data1
*! @param data2
*! The two parts of the midi message
*/
#define f_Device_message_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_message_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_message(INT32 args) {
#line 158 "Midi.cmod"
INT_TYPE status;
#line 158 "Midi.cmod"
INT_TYPE data1;
#line 158 "Midi.cmod"
INT_TYPE data2;
#line 158 "Midi.cmod"
if(args != 3) wrong_number_of_args_error("message",args,3);
#line 158 "Midi.cmod"
if(Pike_sp[0-3].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("message",1,"int");
#line 158 "Midi.cmod"
status=Pike_sp[0-3].u.integer;
#line 158 "Midi.cmod"
if(Pike_sp[1-3].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("message",2,"int");
#line 158 "Midi.cmod"
data1=Pike_sp[1-3].u.integer;
#line 158 "Midi.cmod"
if(Pike_sp[2-3].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("message",3,"int");
#line 158 "Midi.cmod"
data2=Pike_sp[2-3].u.integer;
#line 158 "Midi.cmod"
{
THIS->output_buffer[0].message = Pm_Message(status, data1, data2);
THIS->output_buffer[0].timestamp = TIME_PROC(TIME_INFO);
int err = Pm_Write(THIS->stream, THIS->output_buffer, 1);
do { INT_TYPE ret_=((err)); pop_n_elems(3); push_int(ret_); return; }while(0);
#line 163 "Midi.cmod"
}
}
/*! @decl int read()
*! Call this function to see if there is MIDI input waiting to be parsed. Returns 1 if a new message is waiting or 0 zero when the MIDI buffer was empty. A negative number signals an error.
*! @note
*! Use the functions get_status(), get_data1() and get_data2() to get the actual information contained in the message.
*/
#define f_Device_read_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_read_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_read(INT32 args) {
#line 171 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("read",args,0);
#line 171 "Midi.cmod"
{
int count = Pm_Read(THIS->stream, THIS->input_buffer, 1);
do { INT_TYPE ret_=((count)); push_int(ret_); return; }while(0);
#line 174 "Midi.cmod"
}
}
/*! @decl int get_status()
*! Retreive the status byte from the last read message.
*/
#define f_Device_get_status_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_status_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_status(INT32 args) {
#line 180 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_status",args,0);
#line 180 "Midi.cmod"
{
THIS->status = Pm_MessageStatus(THIS->input_buffer[0].message);
do { INT_TYPE ret_=((THIS->status)); push_int(ret_); return; }while(0);
#line 183 "Midi.cmod"
}
}
/*! @decl int is_data1()
*! Retreive the first data byte from the last read message.
*/
#define f_Device_get_data1_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_data1_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_data1(INT32 args) {
#line 189 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_data1",args,0);
#line 189 "Midi.cmod"
{
THIS->data1 = Pm_MessageData1(THIS->input_buffer[0].message);
do { INT_TYPE ret_=((THIS->data1)); push_int(ret_); return; }while(0);
#line 192 "Midi.cmod"
}
}
/*! @decl int is_data2()
*! Retreive the second data byte from the last read message.
*/
#define f_Device_get_data2_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_get_data2_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_get_data2(INT32 args) {
#line 198 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_data2",args,0);
#line 198 "Midi.cmod"
{
THIS->data2 = Pm_MessageData2(THIS->input_buffer[0].message);
do { INT_TYPE ret_=((THIS->data2)); push_int(ret_); return; }while(0);
#line 201 "Midi.cmod"
}
}
/*! @decl int is_data1()
*! Retreive the first data byte from the last read message.
*/
#define f_Device_abort_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_abort_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_abort(INT32 args) {
#line 207 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("abort",args,0);
#line 207 "Midi.cmod"
{
int err = Pm_Abort(THIS->stream);
do { INT_TYPE ret_=((err)); push_int(ret_); return; }while(0);
#line 210 "Midi.cmod"
}
}
/*! @decl int close()
*! Close this device. Returns zero or an error code.
*/
#define f_Device_close_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Device_close_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Device_close(INT32 args) {
#line 216 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("close",args,0);
#line 216 "Midi.cmod"
{
int err = Pm_Close(THIS->stream);
do { INT_TYPE ret_=((err)); push_int(ret_); return; }while(0);
#line 219 "Midi.cmod"
}
}
#undef internal_init_Device_defined
#define internal_init_Device_defined
#undef Device_event_handler_defined
#define Device_event_handler_defined
static void init_Device_struct(void)
#line 221 "Midi.cmod"
{
}
#ifdef Device_event_handler_defined
static void Device_event_handler(int ev) {
switch(ev) {
#ifdef internal_init_Device_defined
case PROG_EVENT_INIT: init_Device_struct(); break;
#endif /* internal_init_Device_defined */
default: break;
}
}
#endif /* Device_event_handler_defined */
/*! @endclass
*/
/*! @class Control
*/
#line 236 "Midi.cmod"
/* note
This MIDI module is a wrapper around portmidi (http://portmedia.sourceforge.net/) and consists of two classes:
The class Device is used for the actual communication, and the additional class Control is used to find out about the available MIDI devices.
*/
#undef class_Control_defined
#define class_Control_defined
DEFAULT_CMOD_STORAGE struct program *Control_program=NULL;
static int Control_program_fun_num=-1;
#define f_Control_create_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_create_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_create(INT32 args) {
#line 243 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("create",args,0);
#line 243 "Midi.cmod"
{
int x = Pm_Initialize();
TIME_START;
do { INT_TYPE ret_=((x)); push_int(ret_); return; }while(0);
#line 247 "Midi.cmod"
}
}
/*! @decl int count_devices()
*! Query the number of available devices.
*/
#define f_Control_count_devices_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_count_devices_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_count_devices(INT32 args) {
#line 253 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("count_devices",args,0);
#line 253 "Midi.cmod"
{
int x = Pm_CountDevices();
do { INT_TYPE ret_=((x)); push_int(ret_); return; }while(0);
#line 256 "Midi.cmod"
}
}
/*! @decl int get_default_input_device_id()
*! Get the ID of the default input device.
*/
#define f_Control_get_default_input_device_id_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_get_default_input_device_id_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_get_default_input_device_id(INT32 args) {
#line 262 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_default_input_device_id",args,0);
#line 262 "Midi.cmod"
{
int x = Pm_GetDefaultInputDeviceID();
do { INT_TYPE ret_=((x)); push_int(ret_); return; }while(0);
#line 265 "Midi.cmod"
}
}
/*! @decl int get_default_output_device_id()
*! Get the ID of the default output device.
*/
#define f_Control_get_default_output_device_id_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_get_default_output_device_id_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_get_default_output_device_id(INT32 args) {
#line 271 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("get_default_output_device_id",args,0);
#line 271 "Midi.cmod"
{
int x = Pm_GetDefaultOutputDeviceID();
do { INT_TYPE ret_=((x)); push_int(ret_); return; }while(0);
#line 274 "Midi.cmod"
}
}
/*! @decl string get_error_text(int error)
*! Convert an errorcode to a textual explanation.
*/
#define f_Control_get_error_text_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_get_error_text_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_get_error_text(INT32 args) {
#line 280 "Midi.cmod"
INT_TYPE error;
#line 280 "Midi.cmod"
if(args != 1) wrong_number_of_args_error("get_error_text",args,1);
#line 280 "Midi.cmod"
if(Pike_sp[0-1].type != PIKE_T_INT) SIMPLE_ARG_TYPE_ERROR("get_error_text",1,"int");
#line 280 "Midi.cmod"
error=Pike_sp[0-1].u.integer;
#line 280 "Midi.cmod"
{
struct pike_string *str;
str = make_shared_string(Pm_GetErrorText(error));
do { struct pike_string * ret_=((str)); pop_stack(); push_string(ret_); return; }while(0);
#line 284 "Midi.cmod"
}
}
/*! @decl void terminate()
*! Close all MIDI connections. Call this when your program ends or when you want to initialize all over again.
*/
#define f_Control_terminate_defined
DEFAULT_CMOD_STORAGE ptrdiff_t f_Control_terminate_fun_num = 0;
DEFAULT_CMOD_STORAGE void f_Control_terminate(INT32 args) {
#line 290 "Midi.cmod"
if(args != 0) wrong_number_of_args_error("terminate",args,0);
#line 290 "Midi.cmod"
{
Pm_Terminate();
pop_n_elems(args);
}
}
#undef internal_init_Control_defined
#define internal_init_Control_defined
#undef Control_event_handler_defined
#define Control_event_handler_defined
static void init_Control_struct(void)
#line 297 "Midi.cmod"
{
}
#undef Control_gc_live_obj
#define Control_gc_live_obj
#undef internal_exit_Control_defined
#define internal_exit_Control_defined
#undef Control_event_handler_defined
#define Control_event_handler_defined
static void exit_Control_struct(void)
#line 300 "Midi.cmod"
{
}
#ifdef Control_event_handler_defined
static void Control_event_handler(int ev) {
switch(ev) {
#ifdef internal_init_Control_defined
case PROG_EVENT_INIT: init_Control_struct(); break;
#endif /* internal_init_Control_defined */
#ifdef internal_exit_Control_defined
case PROG_EVENT_EXIT: exit_Control_struct(); break;
#endif /* internal_exit_Control_defined */
default: break;
}
}
#endif /* Control_event_handler_defined */
/*! @endclass
*/
/*! @endmodule
*/
/*! @endmodule
*/
/*! @endmodule
*/
PIKE_MODULE_INIT {
#ifdef class_Device_defined
#ifdef PROG_DEVICE_ID
#line 43 "Midi.cmod"
START_NEW_PROGRAM_ID(DEVICE);
#else
#line 43 "Midi.cmod"
start_new_program();
#endif /* PROG_DEVICE_ID */
#ifndef tObjImpl_DEVICE
#undef tObjImpl_DEVICE
#define tObjImpl_DEVICE tObj
#endif /* tObjImpl_DEVICE */
#ifdef THIS_DEVICE
Device_storage_offset = ADD_STORAGE(struct Device_struct);
#endif /* THIS_DEVICE */
#ifdef Device_event_handler_defined
pike_set_prog_event_callback(Device_event_handler);
#ifndef Device_gc_live_obj
Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;
#endif /* Device_gc_live_obj */
#endif /* Device_event_handler_defined */
#ifdef f_Device_create_defined
f_Device_create_fun_num =
#line 59 "Midi.cmod"
ADD_FUNCTION2("create", f_Device_create, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_create_defined */
#ifdef f_Device_set_ID_defined
f_Device_set_ID_fun_num =
#line 69 "Midi.cmod"
ADD_FUNCTION2("set_ID", f_Device_set_ID, tFunc("\10\200\0\0\0\177\377\377\377",tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_set_ID_defined */
#ifdef f_Device_get_ID_defined
f_Device_get_ID_fun_num =
#line 80 "Midi.cmod"
ADD_FUNCTION2("get_ID", f_Device_get_ID, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_ID_defined */
#ifdef f_Device_get_version_defined
f_Device_get_version_fun_num =
#line 88 "Midi.cmod"
ADD_FUNCTION2("get_version", f_Device_get_version, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_version_defined */
#ifdef f_Device_get_interface_defined
f_Device_get_interface_fun_num =
#line 96 "Midi.cmod"
ADD_FUNCTION2("get_interface", f_Device_get_interface, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_interface_defined */
#ifdef f_Device_get_name_defined
f_Device_get_name_fun_num =
#line 105 "Midi.cmod"
ADD_FUNCTION2("get_name", f_Device_get_name, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_name_defined */
#ifdef f_Device_is_input_defined
f_Device_is_input_fun_num =
#line 114 "Midi.cmod"
ADD_FUNCTION2("is_input", f_Device_is_input, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_is_input_defined */
#ifdef f_Device_is_output_defined
f_Device_is_output_fun_num =
#line 122 "Midi.cmod"
ADD_FUNCTION2("is_output", f_Device_is_output, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_is_output_defined */
#ifdef f_Device_is_open_defined
f_Device_is_open_fun_num =
#line 130 "Midi.cmod"
ADD_FUNCTION2("is_open", f_Device_is_open, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_is_open_defined */
#ifdef f_Device_open_defined
f_Device_open_fun_num =
#line 138 "Midi.cmod"
ADD_FUNCTION2("open", f_Device_open, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_open_defined */
#ifdef f_Device_message_defined
f_Device_message_fun_num =
#line 158 "Midi.cmod"
ADD_FUNCTION2("message", f_Device_message, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377","\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_message_defined */
#ifdef f_Device_read_defined
f_Device_read_fun_num =
#line 171 "Midi.cmod"
ADD_FUNCTION2("read", f_Device_read, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_read_defined */
#ifdef f_Device_get_status_defined
f_Device_get_status_fun_num =
#line 180 "Midi.cmod"
ADD_FUNCTION2("get_status", f_Device_get_status, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_status_defined */
#ifdef f_Device_get_data1_defined
f_Device_get_data1_fun_num =
#line 189 "Midi.cmod"
ADD_FUNCTION2("get_data1", f_Device_get_data1, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_data1_defined */
#ifdef f_Device_get_data2_defined
f_Device_get_data2_fun_num =
#line 198 "Midi.cmod"
ADD_FUNCTION2("get_data2", f_Device_get_data2, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_get_data2_defined */
#ifdef f_Device_abort_defined
f_Device_abort_fun_num =
#line 207 "Midi.cmod"
ADD_FUNCTION2("abort", f_Device_abort, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_abort_defined */
#ifdef f_Device_close_defined
f_Device_close_fun_num =
#line 216 "Midi.cmod"
ADD_FUNCTION2("close", f_Device_close, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Device_close_defined */
#line 43 "Midi.cmod"
Device_program=end_program();
#line 43 "Midi.cmod"
Device_program_fun_num=add_program_constant("Device",Device_program,0);
#endif /* class_Device_defined */
#ifdef class_Control_defined
#ifdef PROG_CONTROL_ID
#line 241 "Midi.cmod"
START_NEW_PROGRAM_ID(CONTROL);
#else
#line 241 "Midi.cmod"
start_new_program();
#endif /* PROG_CONTROL_ID */
#ifndef tObjImpl_CONTROL
#undef tObjImpl_CONTROL
#define tObjImpl_CONTROL tObj
#endif /* tObjImpl_CONTROL */
#ifdef Control_event_handler_defined
pike_set_prog_event_callback(Control_event_handler);
#ifndef Control_gc_live_obj
Pike_compiler->new_program->flags &= ~PROGRAM_LIVE_OBJ;
#endif /* Control_gc_live_obj */
#endif /* Control_event_handler_defined */
#ifdef f_Control_create_defined
f_Control_create_fun_num =
#line 243 "Midi.cmod"
ADD_FUNCTION2("create", f_Control_create, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_create_defined */
#ifdef f_Control_count_devices_defined
f_Control_count_devices_fun_num =
#line 253 "Midi.cmod"
ADD_FUNCTION2("count_devices", f_Control_count_devices, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_count_devices_defined */
#ifdef f_Control_get_default_input_device_id_defined
f_Control_get_default_input_device_id_fun_num =
#line 262 "Midi.cmod"
ADD_FUNCTION2("get_default_input_device_id", f_Control_get_default_input_device_id, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_get_default_input_device_id_defined */
#ifdef f_Control_get_default_output_device_id_defined
f_Control_get_default_output_device_id_fun_num =
#line 271 "Midi.cmod"
ADD_FUNCTION2("get_default_output_device_id", f_Control_get_default_output_device_id, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_get_default_output_device_id_defined */
#ifdef f_Control_get_error_text_defined
f_Control_get_error_text_fun_num =
#line 280 "Midi.cmod"
ADD_FUNCTION2("get_error_text", f_Control_get_error_text, tFunc("\10\200\0\0\0\177\377\377\377",tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_get_error_text_defined */
#ifdef f_Control_terminate_defined
f_Control_terminate_fun_num =
#line 290 "Midi.cmod"
ADD_FUNCTION2("terminate", f_Control_terminate, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);
#endif /* f_Control_terminate_defined */
#line 241 "Midi.cmod"
Control_program=end_program();
#line 241 "Midi.cmod"
Control_program_fun_num=add_program_constant("Control",Control_program,0);
#endif /* class_Control_defined */
}
PIKE_MODULE_EXIT {
#ifdef class_Device_defined
if(Device_program) {
#line 43 "Midi.cmod"
free_program(Device_program);
Device_program=0;
}
#endif /* class_Device_defined */
#ifdef class_Control_defined
if(Control_program) {
#line 241 "Midi.cmod"
free_program(Control_program);
Control_program=0;
}
#endif /* class_Control_defined */
}