ardour
Macros | Functions
smf_decode.c File Reference
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <errno.h>
#include <arpa/inet.h>
#include <stdint.h>
#include "smf.h"
#include "smf_private.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE   1024
 

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)
 
static char * smf_event_decode_textual (const smf_event_t *event, const char *name)
 
static char * smf_event_decode_metadata (const smf_event_t *event)
 
static char * smf_event_decode_system_realtime (const smf_event_t *event)
 
static char * smf_event_decode_sysex (const smf_event_t *event)
 
static char * smf_event_decode_system_common (const smf_event_t *event)
 
static void note_from_int (char *buf, int note_number)
 
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.

Macro Definition Documentation

#define BUFFER_SIZE   1024

Definition at line 49 of file smf_decode.c.

Function Documentation

static void note_from_int ( char *  buf,
int  note_number 
)
static

Definition at line 499 of file smf_decode.c.

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 605 of file smf_decode.c.

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 519 of file smf_decode.c.

static char* smf_event_decode_metadata ( const smf_event_t event)
static

Definition at line 139 of file smf_decode.c.

static char* smf_event_decode_sysex ( const smf_event_t event)
static

Definition at line 351 of file smf_decode.c.

static char* smf_event_decode_system_common ( const smf_event_t event)
static

Definition at line 456 of file smf_decode.c.

static char* smf_event_decode_system_realtime ( const smf_event_t event)
static

Definition at line 298 of file smf_decode.c.

static char* smf_event_decode_textual ( const smf_event_t event,
const char *  name 
)
static

Definition at line 116 of file smf_decode.c.

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.

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.

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.

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.