Browse Source

MIDI API in wrapper lib.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2026 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.71
sletz 17 years ago
parent
commit
c63bbf8fb5
2 changed files with 68 additions and 1 deletions
  1. +1
    -1
      ChangeLog
  2. +67
    -0
      common/JackAPIWrapper.cpp

+ 1
- 1
ChangeLog View File

@@ -24,7 +24,7 @@ Fernando Lopez-Lezcano
* New jack_server_control client to test notifications when linked to the server library.
* Correct JackClient::Activate so that first kGraphOrderCallback can be received by the client notification thread.
* MIDI API in wrapper lib (in progress).
* MIDI API in wrapper lib.

2008-03-16 Stephane Letz <letz@grame.fr>


+ 67
- 0
common/JackAPIWrapper.cpp View File

@@ -1261,6 +1261,65 @@ EXPORT int jack_client_close(jack_client_t *client)
}
}

// MIDI

typedef jack_nframes_t (*jack_midi_get_event_count_fun_def)(void* port_buffer);
static jack_midi_get_event_count_fun_def jack_midi_get_event_count_fun = 0;
EXPORT jack_nframes_t jack_midi_get_event_count(void* port_buffer)
{
jack_log("jack_midi_get_event_count");
return (*jack_midi_get_event_count_fun)(port_buffer);
}

typedef int (*jack_midi_event_get_fun_def)(void* port_buffer);
static jack_midi_event_get_fun_def jack_midi_event_get_fun = 0;
EXPORT int jack_midi_event_get(void* port_buffer)
{
jack_log("jack_midi_get_event_count");
return (*jack_midi_event_get_fun)(port_buffer);
}

typedef void (*jack_midi_clear_buffer_fun_def)(void* port_buffer);
static jack_midi_clear_buffer_fun_def jack_midi_clear_buffer_fun = 0;
EXPORT void jack_midi_clear_buffer(void* port_buffer)
{
jack_log("jack_midi_clear_buffer");
(*jack_midi_clear_buffer_fun)(port_buffer);
}

typedef size_t (*jack_midi_max_event_size_fun_def)(void* port_buffer);
static jack_midi_max_event_size_fun_def jack_midi_max_event_size_fun = 0;
EXPORT size_t jack_midi_max_event_size(void* port_buffer)
{
jack_log("jack_midi_max_event_size");
return (*jack_midi_max_event_size_fun)(port_buffer);
}

typedef jack_midi_data_t* (*jack_midi_event_reserve_fun_def)(void* port_buffer, jack_nframes_t time, size_t data_size);
static jack_midi_event_reserve_fun_def jack_midi_event_reserve_fun = 0;
EXPORT jack_midi_data_t* jack_midi_event_reserve(void* port_buffer, jack_nframes_t time, size_t data_size)
{
jack_log("jack_midi_event_reserve");
return (*jack_midi_event_reserve_fun)(port_buffer, time, data_size);
}

typedef int (*jack_midi_event_write_fun_def)(void* port_buffer, jack_nframes_t time, const jack_midi_data_t *data, size_t data_size);
static jack_midi_event_write_fun_def jack_midi_event_write_fun = 0;
EXPORT int jack_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t *data, size_t data_size)
{
jack_log("jack_midi_event_write");
return (*jack_midi_event_write_fun)(port_buffer, time, data, data_size);
}

typedef jack_nframes_t (*jack_midi_get_lost_event_count_fun_def)(void *port_buffer);
static jack_midi_get_lost_event_count_fun_def jack_midi_get_lost_event_count_fun = 0;
EXPORT jack_nframes_t jack_midi_get_lost_event_count(void* port_buffer)
{
jack_log("jack_midi_get_lost_event_count");
return (*jack_midi_get_lost_event_count_fun)(port_buffer);
}


// Library loader
static bool get_jack_library_in_directory(const char* dir_name, const char* library_name, char* library_res_name)
{
@@ -1463,6 +1522,14 @@ static bool open_library()
jack_internal_client_handle_fun = (jack_internal_client_handle_fun_def)dlsym(gLibrary, "jack_internal_client_handle");
jack_internal_client_load_aux_fun = (jack_internal_client_load_aux_fun_def)dlsym(gLibrary, "jack_internal_client_load_aux");
jack_internal_client_unload_fun = (jack_internal_client_unload_fun_def)dlsym(gLibrary, "jack_internal_client_unload");
// MIDI
jack_midi_get_event_count_fun = (jack_midi_get_event_count_fun_def)dlsym(gLibrary, "jack_midi_get_event_count");
jack_midi_event_get_fun = (jack_midi_event_get_fun_def)dlsym(gLibrary, "jack_midi_event_get");
jack_midi_clear_buffer_fun = (jack_midi_clear_buffer_fun_def)dlsym(gLibrary, "jack_midi_clear_buffer");
jack_midi_max_event_size_fun = (jack_midi_max_event_size_fun_def)dlsym(gLibrary, "jack_midi_max_event_size");
jack_midi_event_reserve_fun = (jack_midi_event_reserve_fun_def)dlsym(gLibrary, "jack_midi_event_reserve");
jack_midi_event_write_fun = (jack_midi_event_write_fun_def)dlsym(gLibrary, "jack_midi_event_write");
jack_midi_get_lost_event_count_fun = (jack_midi_get_lost_event_count_fun_def)dlsym(gLibrary, "jack_midi_get_lost_event_count");

// Functions were kept...
if (error_fun)


Loading…
Cancel
Save