smf_decode.c File Reference

Event decoding routines. More...

Go to the source code of this file.

Functions

int smf_event_is_metadata (const smf_event_t *event)
int smf_event_is_system_realtime (const smf_event_t *event)
int smf_event_is_system_common (const smf_event_t *event)
int smf_event_is_sysex (const smf_event_t *event)
char * smf_event_decode (const smf_event_t *event)
char * smf_decode (const smf_t *smf)

Detailed Description

Event decoding routines.

Definition in file smf_decode.c.


Function Documentation

char* smf_decode ( const smf_t smf  ) 
Returns:
Textual representation of the data extracted from MThd header, or NULL, if something goes wrong. Returned string looks like this:

format: 1 (several simultaneous tracks); number of tracks: 4; division: 192 PPQN.

You should free the returned string afterwards, using free(3).

Definition at line 598 of file smf_decode.c.

References smf_struct::format, smf_struct::frames_per_second, smf_struct::number_of_tracks, smf_struct::ppqn, and smf_struct::resolution.

char* smf_event_decode ( const smf_event_t event  ) 
Returns:
Textual representation of the event given, or NULL, if event is unknown. Returned string looks like this:

Note On, channel 1, note F#3, velocity 0

You should free the returned string afterwards, using free(3).

Definition at line 514 of file smf_decode.c.

References smf_event_struct::midi_buffer, smf_event_is_metadata(), smf_event_is_system_common(), smf_event_is_system_realtime(), and smf_event_length_is_valid().

int smf_event_is_metadata ( const smf_event_t event  ) 
Returns:
Nonzero if event is metaevent. You should never send metaevents; they are not really MIDI messages. They carry information like track title, time signature etc.

Definition at line 57 of file smf_decode.c.

References smf_event_struct::midi_buffer, and smf_event_struct::midi_buffer_length.

Referenced by maybe_add_to_tempo_map(), smf_event_decode(), smf_event_is_system_realtime(), smf_event_is_tempo_change_or_time_signature(), and smf_event_is_textual().

int smf_event_is_sysex ( const smf_event_t event  ) 
Returns:
Nonzero if event is SysEx message.

Definition at line 104 of file smf_decode.c.

References smf_event_struct::midi_buffer, and smf_event_struct::midi_buffer_length.

Referenced by smf_event_length_is_valid().

int smf_event_is_system_common ( const smf_event_t event  ) 
Returns:
Nonzero if event is System Common.

Definition at line 90 of file smf_decode.c.

References smf_event_struct::midi_buffer, and smf_event_struct::midi_buffer_length.

Referenced by smf_event_decode().

int smf_event_is_system_realtime ( const smf_event_t event  ) 
Returns:
Nonzero if event is System Realtime.

Definition at line 72 of file smf_decode.c.

References smf_event_struct::midi_buffer, smf_event_struct::midi_buffer_length, and smf_event_is_metadata().

Referenced by smf_event_decode().

Generated on Sun Mar 28 19:42:17 2010 for libsmf by  doxygen 1.6.3