Browse Source

Add generic event port type

I don't know how useful it is yet, maybe I'll remove it later on (tell me if you don't like it)
pull/514/head
piegames 6 years ago
parent
commit
52ab82d802
5 changed files with 18 additions and 2 deletions
  1. +8
    -0
      common/JackEventPort.cpp
  2. +5
    -0
      common/JackEventPort.h
  3. +2
    -1
      common/JackPortType.cpp
  4. +1
    -0
      common/JackPortType.h
  5. +2
    -1
      common/jack/types.h

+ 8
- 0
common/JackEventPort.cpp View File

@@ -167,4 +167,12 @@ const JackPortType gOscPortType =
EventBufferMixdown
};

const JackPortType gEventPortType =
{
JACK_DEFAULT_EVENT_TYPE,
EventBufferSize,
EventBufferInit,
EventBufferMixdown
};

} // namespace Jack

+ 5
- 0
common/JackEventPort.h View File

@@ -41,6 +41,11 @@ struct jack_event_t
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
/** A Jack OSC port type. */
#define JACK_DEFAULT_OSC_TYPE "32 bit OSC"
/** If you want to toy around with a custom
* event protocol (maybe MIDI 3.0?). Please put details
* about it into the metadata.
*/
#define JACK_DEFAULT_EVENT_TYPE "generic binary data"

namespace Jack
{


+ 2
- 1
common/JackPortType.cpp View File

@@ -28,7 +28,8 @@ static const JackPortType* gPortTypes[] =
{
&gAudioPortType,
&gMidiPortType,
&gOscPortType,
&gOscPortType,
&gEventPortType,
};

jack_port_type_id_t PORT_TYPES_MAX = sizeof(gPortTypes) / sizeof(gPortTypes[0]);


+ 1
- 0
common/JackPortType.h View File

@@ -43,6 +43,7 @@ extern const struct JackPortType* GetPortType(jack_port_type_id_t port_type_id);
extern const struct JackPortType gAudioPortType;
extern const struct JackPortType gMidiPortType;
extern const struct JackPortType gOscPortType;
extern const struct JackPortType gEventPortType;

} // namespace Jack



+ 2
- 1
common/jack/types.h View File

@@ -446,11 +446,12 @@ typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason,

/**
* Used for the type argument of jack_port_register() for default
* audio ports and midi ports.
* audio ports and event ports.
*/
#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
#define JACK_DEFAULT_OSC_TYPE "32 bit OSC"
#define JACK_DEFAULT_EVENT_TYPE "generic binary data"

/**
* For convenience, use this typedef if you want to be able to change


Loading…
Cancel
Save