MBNG_EVENT

Data Structures

union  sysex_runtime_var_t
union  extra_par_available_t
struct  mbng_event_pool_item_t
struct  mbng_event_pool_map_t

Defines

#define MBNG_EVENT_POOL_MAX_SIZE   (24*1024)
#define MBNG_EVENT_NRPN_RECEIVE_PORTS_MASK   0x00ff
#define MBNG_EVENT_NRPN_RECEIVE_PORTS_OFFSET   0
#define MBNG_EVENT_NRPN_RECEIVE_PORTS   8
#define MBNG_EVENT_NRPN_RECEIVE_CHANNELS   16
#define MBNG_EVENT_NRPN_SEND_PORTS_MASK   0x00f0
#define MBNG_EVENT_NRPN_SEND_PORTS_OFFSET   4
#define MBNG_EVENT_NRPN_SEND_PORTS   4
#define MBNG_EVENT_NRPN_SEND_CHANNELS   16
#define LC_METERS_NUM_PORTS   8
#define LC_METERS_NUM_ITEMS   8

Functions

s32 MBNG_EVENT_Init (u32 mode)
s32 MBNG_EVENT_Tick (void)
s32 MBNG_EVENT_PoolClear (void)
s32 MBNG_EVENT_PoolUpdate (void)
s32 MBNG_EVENT_PoolPrint (void)
s32 MBNG_EVENT_PoolItemsPrint (void)
s32 MBNG_EVENT_PoolMapsPrint (void)
s32 MBNG_EVENT_PoolNumItemsGet (void)
s32 MBNG_EVENT_PoolNumMapsGet (void)
s32 MBNG_EVENT_PoolSizeGet (void)
s32 MBNG_EVENT_PoolMaxSizeGet (void)
s32 MBNG_EVENT_MapAdd (u8 map, mbng_event_map_type_t map_type, u8 *map_values, u8 len)
s32 MBNG_EVENT_MapGet (u8 map, mbng_event_map_type_t *map_type, u8 **map_values)
s32 MBNG_EVENT_MapValue (u8 map, u16 value, u16 range, u8 reverse_interpolation)
s32 MBNG_EVENT_MapItemValueInc (u8 map, mbng_event_item_t *item, s32 incrementer, u8 auto_wrap)
s32 MBNG_EVENT_MapIxFromValue (mbng_event_map_type_t map_type, u8 *map_values, u8 map_len, u8 value)
s32 MBNG_EVENT_NumBanksGet (void)
s32 MBNG_EVENT_SelectedBankGet (void)
s32 MBNG_EVENT_SelectedBankSet (u8 new_bank)
s32 MBNG_EVENT_HwIdBankGet (u16 hw_id)
s32 MBNG_EVENT_HwIdBankSet (u16 hw_id, u8 new_bank)
s32 MBNG_EVENT_ItemNoDumpDefault (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemInit (mbng_event_item_t *item, mbng_event_item_id_t id)
s32 MBNG_EVENT_ItemGet (u32 item_ix, mbng_event_item_t *item)
s32 MBNG_EVENT_ItemAdd (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemModify (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemSearchById (mbng_event_item_id_t id, mbng_event_item_t *item, u32 *continue_ix)
s32 MBNG_EVENT_ItemSearchByHwId (mbng_event_item_id_t hw_id, mbng_event_item_t *item, u32 *continue_ix)
s32 MBNG_EVENT_ItemRetrieveValues (mbng_event_item_id_t *id, s16 *value, u8 *secondary_value, u32 *continue_ix)
s32 MBNG_EVENT_ItemCopyValueToPool (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemSetActive (mbng_event_item_t *item, u8 active)
s32 MBNG_EVENT_ItemSetNoDump (mbng_event_item_t *item, u8 no_dump)
s32 MBNG_EVENT_ItemSetLock (mbng_event_item_t *item, u8 lock)
s32 MBNG_EVENT_ItemSetMapIx (mbng_event_item_t *item, u8 map_ix)
s32 MBNG_EVENT_ItemCheckMatchingCondition (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemPrint (mbng_event_item_t *item, u8 all)
s32 MBNG_EVENT_ItemSearchByIdAndPrint (mbng_event_item_id_t id)
s32 MBNG_EVENT_ItemSearchByHwIdAndPrint (mbng_event_item_id_t hw_id)
s32 MBNG_EVENT_LCMeters_Init (void)
s32 MBNG_EVENT_MidiLearnModeSet (u8 mode)
s32 MBNG_EVENT_MidiLearnModeGet (void)
s32 MBNG_EVENT_MidiLearnStatusMsg (char *line1, char *line2)
s32 MBNG_EVENT_MidiLearnIt (mbng_event_item_id_t hw_id)
s32 MBNG_EVENT_EventLearnIdSet (mbng_event_item_id_t id)
mbng_event_item_id_t MBNG_EVENT_EventLearnIdGet (void)
s32 MBNG_EVENT_EventLearnStatusMsg (char *line1, char *line2)
s32 MBNG_EVENT_EventLearnIt (mbng_event_item_t *item, u16 prev_value)
const char * MBNG_EVENT_ItemControllerStrGet (mbng_event_item_id_t id)
mbng_event_item_id_t MBNG_EVENT_ItemIdFromControllerStrGet (char *event)
const char * MBNG_EVENT_ItemTypeStrGet (mbng_event_item_t *item)
mbng_event_type_t MBNG_EVENT_ItemTypeFromStrGet (char *event_type)
const char * MBNG_EVENT_ItemConditionStrGet (mbng_event_item_t *item)
mbng_event_if_cond_t MBNG_EVENT_ItemConditionFromStrGet (char *condition)
const char * MBNG_EVENT_ItemButtonModeStrGet (mbng_event_item_t *item)
mbng_event_button_mode_t MBNG_EVENT_ItemButtonModeFromStrGet (char *button_mode)
const char * MBNG_EVENT_ItemAinModeStrGet (mbng_event_item_t *item)
mbng_event_ain_mode_t MBNG_EVENT_ItemAinModeFromStrGet (char *ain_mode)
const char * MBNG_EVENT_ItemAinSensorModeStrGet (mbng_event_item_t *item)
mbng_event_ain_sensor_mode_t MBNG_EVENT_ItemAinSensorModeFromStrGet (char *ain_sensor_mode)
const char * MBNG_EVENT_ItemEncModeStrGet (mbng_event_enc_mode_t enc_mode)
mbng_event_enc_mode_t MBNG_EVENT_ItemEncModeFromStrGet (char *enc_mode)
const char * MBNG_EVENT_ItemEncSpeedModeStrGet (mbng_event_item_t *item)
mbng_event_enc_speed_mode_t MBNG_EVENT_ItemEncSpeedModeFromStrGet (char *enc_speed_mode)
const char * MBNG_EVENT_ItemLedMatrixPatternStrGet (mbng_event_item_t *item)
mbng_event_led_matrix_pattern_t MBNG_EVENT_ItemLedMatrixPatternFromStrGet (char *led_matrix_pattern)
const char * MBNG_EVENT_ItemNrpnFormatStrGet (mbng_event_item_t *item)
mbng_event_nrpn_format_t MBNG_EVENT_ItemNrpnFormatFromStrGet (char *nrpn_format)
const char * MBNG_EVENT_ItemSysExVarStrGet (mbng_event_item_t *item, u8 stream_pos)
mbng_event_sysex_var_t MBNG_EVENT_ItemSysExVarFromStrGet (char *sysex_var)
const char * MBNG_EVENT_ItemMetaTypeStrGet (mbng_event_meta_type_t meta_type)
mbng_event_meta_type_t MBNG_EVENT_ItemMetaTypeFromStrGet (char *meta_type)
u8 MBNG_EVENT_ItemMetaNumBytesGet (mbng_event_meta_type_t meta_type)
s32 MBNG_EVENT_SendOptimizedNRPN (mios32_midi_port_t port, mios32_midi_chn_t chn, u16 nrpn_address, u16 nrpn_value, u8 msb_only)
s32 MBNG_EVENT_SendSysExStream (mios32_midi_port_t port, mbng_event_item_t *item)
s32 MBNG_EVENT_ExecMeta (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemSend (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemSendVirtual (mbng_event_item_t *item, mbng_event_item_id_t send_id)
s32 MBNG_EVENT_ItemReceive (mbng_event_item_t *item, u16 value, u8 from_midi, u8 fwd_enabled)
s32 MBNG_EVENT_ItemForward (mbng_event_item_t *item)
s32 MBNG_EVENT_ItemForwardToRadioGroup (mbng_event_item_t *item, u8 radio_group)
s32 MBNG_EVENT_NotifySendValue (mbng_event_item_t *item)
s32 MBNG_EVENT_Refresh (void)
s32 MBNG_EVENT_UpdateLCD (u8 force)
s32 MBNG_EVENT_Dump (void)
s32 MBNG_EVENT_MIDI_NotifyPackage (mios32_midi_port_t port, mios32_midi_package_t midi_package)
s32 MBNG_EVENT_ReceiveSysEx (mios32_midi_port_t port, u8 midi_in)

Variables

mbng_event_item_id_t last_event_item_id

Detailed Description

Event Handler for MIDIbox NG


Define Documentation

#define LC_METERS_NUM_ITEMS   8
#define LC_METERS_NUM_PORTS   8
#define MBNG_EVENT_NRPN_RECEIVE_CHANNELS   16
#define MBNG_EVENT_NRPN_RECEIVE_PORTS   8
#define MBNG_EVENT_NRPN_RECEIVE_PORTS_MASK   0x00ff
#define MBNG_EVENT_NRPN_RECEIVE_PORTS_OFFSET   0
#define MBNG_EVENT_NRPN_SEND_CHANNELS   16
#define MBNG_EVENT_NRPN_SEND_PORTS   4
#define MBNG_EVENT_NRPN_SEND_PORTS_MASK   0x00f0
#define MBNG_EVENT_NRPN_SEND_PORTS_OFFSET   4
#define MBNG_EVENT_POOL_MAX_SIZE   (24*1024)

Local variables


Function Documentation

s32 MBNG_EVENT_Dump ( void   ) 

This function dumps all MIDI events
Used in conjunction with snapshots

Here is the call graph for this function:

mbng_event_item_id_t MBNG_EVENT_EventLearnIdGet ( void   ) 
s32 MBNG_EVENT_EventLearnIdSet ( mbng_event_item_id_t  id  ) 

Enable/Get Event Learn Mode Status

s32 MBNG_EVENT_EventLearnIt ( mbng_event_item_t item,
u16  prev_value 
)

Here is the call graph for this function:

s32 MBNG_EVENT_EventLearnStatusMsg ( char *  line1,
char *  line2 
)

Here is the call graph for this function:

s32 MBNG_EVENT_ExecMeta ( mbng_event_item_t item  ) 

Sends a Meta Event

Here is the call graph for this function:

s32 MBNG_EVENT_HwIdBankGet ( u16  hw_id  ) 

the selected bank of a given hw_id

s32 MBNG_EVENT_HwIdBankSet ( u16  hw_id,
u8  new_bank 
)

Sets the new bank for the given hw_id only

Here is the call graph for this function:

s32 MBNG_EVENT_Init ( u32  mode  ) 

This function initializes the event pool structure

Here is the call graph for this function:

s32 MBNG_EVENT_ItemAdd ( mbng_event_item_t item  ) 

Adds an item to event pool

mbng_event_ain_mode_t MBNG_EVENT_ItemAinModeFromStrGet ( char *  ain_mode  ) 
const char* MBNG_EVENT_ItemAinModeStrGet ( mbng_event_item_t item  ) 

for AIN Mode

mbng_event_ain_sensor_mode_t MBNG_EVENT_ItemAinSensorModeFromStrGet ( char *  ain_sensor_mode  ) 
const char* MBNG_EVENT_ItemAinSensorModeStrGet ( mbng_event_item_t item  ) 

for AIN Sensor Mode

mbng_event_button_mode_t MBNG_EVENT_ItemButtonModeFromStrGet ( char *  button_mode  ) 
const char* MBNG_EVENT_ItemButtonModeStrGet ( mbng_event_item_t item  ) 

for button mode

s32 MBNG_EVENT_ItemCheckMatchingCondition ( mbng_event_item_t item  ) 
Return values:
0 if no matching condition
1 if matching condition (or no condition)
2 if matching condition and stop requested

Here is the call graph for this function:

mbng_event_if_cond_t MBNG_EVENT_ItemConditionFromStrGet ( char *  condition  ) 
Returns:
value of condition given as string
<0 if invalid type
const char* MBNG_EVENT_ItemConditionStrGet ( mbng_event_item_t item  ) 
Returns:
name of condition
const char* MBNG_EVENT_ItemControllerStrGet ( mbng_event_item_id_t  id  ) 
Returns:
name of controller
s32 MBNG_EVENT_ItemCopyValueToPool ( mbng_event_item_t item  ) 

set a value directly

mbng_event_enc_mode_t MBNG_EVENT_ItemEncModeFromStrGet ( char *  enc_mode  ) 
const char* MBNG_EVENT_ItemEncModeStrGet ( mbng_event_enc_mode_t  enc_mode  ) 

for ENC Mode

mbng_event_enc_speed_mode_t MBNG_EVENT_ItemEncSpeedModeFromStrGet ( char *  enc_speed_mode  ) 
const char* MBNG_EVENT_ItemEncSpeedModeStrGet ( mbng_event_item_t item  ) 

for ENC Speed Mode

s32 MBNG_EVENT_ItemForward ( mbng_event_item_t item  ) 

Called to forward an event

Here is the call graph for this function:

s32 MBNG_EVENT_ItemForwardToRadioGroup ( mbng_event_item_t item,
u8  radio_group 
)

Called to forward an event to a radio group

Here is the call graph for this function:

s32 MBNG_EVENT_ItemGet ( u32  item_ix,
mbng_event_item_t item 
)

an item of the event pool with the given index number (only used for dumping out all items in mbng_file_p.c)

mbng_event_item_id_t MBNG_EVENT_ItemIdFromControllerStrGet ( char *  event  ) 
Returns:
ID of controller given as string
s32 MBNG_EVENT_ItemInit ( mbng_event_item_t item,
mbng_event_item_id_t  id 
)

Initializes an item with default settings

mbng_event_led_matrix_pattern_t MBNG_EVENT_ItemLedMatrixPatternFromStrGet ( char *  led_matrix_pattern  ) 
const char* MBNG_EVENT_ItemLedMatrixPatternStrGet ( mbng_event_item_t item  ) 

for DOUT Matrix pattern selection

u8 MBNG_EVENT_ItemMetaNumBytesGet ( mbng_event_meta_type_t  meta_type  ) 
mbng_event_meta_type_t MBNG_EVENT_ItemMetaTypeFromStrGet ( char *  meta_type  ) 
const char* MBNG_EVENT_ItemMetaTypeStrGet ( mbng_event_meta_type_t  meta_type  ) 

for Meta events

s32 MBNG_EVENT_ItemModify ( mbng_event_item_t item  ) 

Modifies an existing item in the pool

s32 MBNG_EVENT_ItemNoDumpDefault ( mbng_event_item_t item  ) 

Returns default no_dump parameter for item depending in id and type

mbng_event_nrpn_format_t MBNG_EVENT_ItemNrpnFormatFromStrGet ( char *  nrpn_format  ) 
const char* MBNG_EVENT_ItemNrpnFormatStrGet ( mbng_event_item_t item  ) 

for (N)RPN format

s32 MBNG_EVENT_ItemPrint ( mbng_event_item_t item,
u8  all 
)

Sends the an item description to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_ItemReceive ( mbng_event_item_t item,
u16  value,
u8  from_midi,
u8  fwd_enabled 
)

Called when an item should be notified about a new value

Return values:
0 if no matching condition
1 if matching condition (or no condition)
2 if matching condition and stop requested

Here is the call graph for this function:

s32 MBNG_EVENT_ItemRetrieveValues ( mbng_event_item_id_t id,
s16 value,
u8 secondary_value,
u32 continue_ix 
)

Iterates through the event pool to retrieve values/secondary values
Used to store a snapshot in MBNG_FILE_S_Write

Returns:
0 if a new value set has been found
-1 if no new item
s32 MBNG_EVENT_ItemSearchByHwId ( mbng_event_item_id_t  hw_id,
mbng_event_item_t item,
u32 continue_ix 
)

Search an item in event pool based on the HW ID Takes the selected bank into account (means: only an active item will be returned)

Returns:
0 and copies item into *item if found
-1 if item not found
s32 MBNG_EVENT_ItemSearchByHwIdAndPrint ( mbng_event_item_id_t  hw_id  ) 

Sends detailed item informations to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_ItemSearchById ( mbng_event_item_id_t  id,
mbng_event_item_t item,
u32 continue_ix 
)

Search an item in event pool based on ID

Returns:
0 and copies item into *item if found
-1 if item not found
s32 MBNG_EVENT_ItemSearchByIdAndPrint ( mbng_event_item_id_t  id  ) 

Sends detailed item informations to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_ItemSend ( mbng_event_item_t item  ) 

Sends the item via MIDI

Here is the call graph for this function:

s32 MBNG_EVENT_ItemSendVirtual ( mbng_event_item_t item,
mbng_event_item_id_t  send_id 
)

Sends to a virtual item (which doesn't exist in the pool)

Here is the call graph for this function:

s32 MBNG_EVENT_ItemSetActive ( mbng_event_item_t item,
u8  active 
)

activates/deactivates an event (like bank mechanism)

Here is the call graph for this function:

s32 MBNG_EVENT_ItemSetLock ( mbng_event_item_t item,
u8  lock 
)

locks/unlocks an event for write operations (when items have received a new value)

s32 MBNG_EVENT_ItemSetMapIx ( mbng_event_item_t item,
u8  map_ix 
)

sets the map index

s32 MBNG_EVENT_ItemSetNoDump ( mbng_event_item_t item,
u8  no_dump 
)

activates/deactivates dump flag of an event

mbng_event_sysex_var_t MBNG_EVENT_ItemSysExVarFromStrGet ( char *  sysex_var  ) 
const char* MBNG_EVENT_ItemSysExVarStrGet ( mbng_event_item_t item,
u8  stream_pos 
)

for SysEx variables

mbng_event_type_t MBNG_EVENT_ItemTypeFromStrGet ( char *  event_type  ) 
Returns:
value of event type given as string
<0 if invalid type
const char* MBNG_EVENT_ItemTypeStrGet ( mbng_event_item_t item  ) 
Returns:
name of event type
s32 MBNG_EVENT_LCMeters_Init ( void   ) 

reset meters can also be called from external, e.g. used by mbng_file_c

s32 MBNG_EVENT_MapAdd ( u8  map,
mbng_event_map_type_t  map_type,
u8 map_values,
u8  len 
)

Adds a map to event pool

s32 MBNG_EVENT_MapGet ( u8  map,
mbng_event_map_type_t map_type,
u8 **  map_values 
)

Returns a map from the event pool

s32 MBNG_EVENT_MapItemValueInc ( u8  map,
mbng_event_item_t item,
s32  incrementer,
u8  auto_wrap 
)

Increments map items based on item->map_ix

Returns:
0 if map available but value index hasn't been changed
1 if map available and value index has been changed
-1 if no map assigned

Here is the call graph for this function:

s32 MBNG_EVENT_MapIxFromValue ( mbng_event_map_type_t  map_type,
u8 map_values,
u8  map_len,
u8  value 
)

Returns the index of a given value

s32 MBNG_EVENT_MapValue ( u8  map,
u16  value,
u16  range,
u8  reverse_interpolation 
)

Maps a 16bit value to a map (map type will be considered)

Returns:
>= 0 if map has been applied (returns value)
-1 if no map assigned

Here is the call graph for this function:

s32 MBNG_EVENT_MIDI_NotifyPackage ( mios32_midi_port_t  port,
mios32_midi_package_t  midi_package 
)

This function should be called from APP_MIDI_NotifyPackage whenver a new MIDI event has been received

Here is the call graph for this function:

s32 MBNG_EVENT_MidiLearnIt ( mbng_event_item_id_t  hw_id  ) 

Here is the call graph for this function:

s32 MBNG_EVENT_MidiLearnModeGet ( void   ) 
s32 MBNG_EVENT_MidiLearnModeSet ( u8  mode  ) 

Enable/Get MIDI Learn Mode Status

s32 MBNG_EVENT_MidiLearnStatusMsg ( char *  line1,
char *  line2 
)

Here is the call graph for this function:

s32 MBNG_EVENT_NotifySendValue ( mbng_event_item_t item  ) 

called from a controller to notify that a value should be sent

Return values:
0 if no matching condition
1 if matching condition (or no condition)
2 if matching condition and stop requested

Here is the call graph for this function:

s32 MBNG_EVENT_NumBanksGet ( void   ) 

the number of defined banks

s32 MBNG_EVENT_PoolClear ( void   ) 

Clear the event pool

s32 MBNG_EVENT_PoolItemsPrint ( void   ) 

Sends short item informations to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_PoolMapsPrint ( void   ) 

Sends short map informations to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_PoolMaxSizeGet ( void   ) 
Returns:
the maximum pool size
s32 MBNG_EVENT_PoolNumItemsGet ( void   ) 
Returns:
the number of EVENT items
s32 MBNG_EVENT_PoolNumMapsGet ( void   ) 
Returns:
the number of MAPs
s32 MBNG_EVENT_PoolPrint ( void   ) 

Sends the event pool to debug terminal

Here is the call graph for this function:

s32 MBNG_EVENT_PoolSizeGet ( void   ) 
Returns:
the current pool size
s32 MBNG_EVENT_PoolUpdate ( void   ) 

Called after a new file has been loaded (post-processing step).

s32 MBNG_EVENT_ReceiveSysEx ( mios32_midi_port_t  port,
u8  midi_in 
)

This function should be called from APP_SYSEX_Parser on incoming SysEx data

Here is the call graph for this function:

s32 MBNG_EVENT_Refresh ( void   ) 

Refresh all items

Here is the call graph for this function:

s32 MBNG_EVENT_SelectedBankGet ( void   ) 

the selected bank

s32 MBNG_EVENT_SelectedBankSet ( u8  new_bank  ) 

Called to set a new bank

Here is the call graph for this function:

s32 MBNG_EVENT_SendOptimizedNRPN ( mios32_midi_port_t  port,
mios32_midi_chn_t  chn,
u16  nrpn_address,
u16  nrpn_value,
u8  msb_only 
)

Sends a NRPN event. Skips address bytes if they already have been sent!

Here is the call graph for this function:

s32 MBNG_EVENT_SendSysExStream ( mios32_midi_port_t  port,
mbng_event_item_t item 
)

Sends a SysEx stream with derived SysEx variables

Here is the call graph for this function:

s32 MBNG_EVENT_Tick ( void   ) 

This function should be called each mS (with low priority)

s32 MBNG_EVENT_UpdateLCD ( u8  force  ) 

Prints all items with enabled 'update_lcd' flag
With force != 0 all active items will be print regardless of this flag

Here is the call graph for this function:


Variable Documentation


Generated on 22 Jan 2016 for MIDIboxNG by  doxygen 1.6.1