fdms.h File Reference

#include <sys/types.h>
#include <inttypes.h>

Data Structures

struct  fdms_prg_info
struct  fdms_tempo
struct  fdms_sig

Defines

#define PRG_HEADER_SIZE   (0x200LL*8)

Typedefs

typedef struct _fdms_vol fdms_vol
typedef struct _fdms_prg fdms_prg
typedef struct _fdms_trk fdms_trk
typedef struct _fdms_seg fdms_seg

Enumerations

enum  midi_sync { fdms_sync_off, fdms_sync_clk, fdms_sync_mtc }
enum  offset_mode { fdms_abs, fdms_bar }

Functions

int fdms_open (const char *path, fdms_vol **pp_vol)
int fdms_get_prg_capacity (fdms_vol *vol)
int fdms_get_prg_count (fdms_vol *vol)
int fdms_open_prg (fdms_vol *vol, int p, fdms_prg **pp_prg)
int fdms_get_trk_capacity (fdms_prg *prg)
int fdms_get_trk_count (fdms_prg *prg)
int fdms_get_trk (fdms_prg *prg, int t, fdms_trk **pp_trk)
size_t fdms_get_trk_length (fdms_trk *trk)
int fdms_get_seg_count (fdms_trk *trk)
size_t fdms_get_seg_length (fdms_trk *trk, int s)
int fdms_read_seg_audio (char *buffer, fdms_trk *trk, int s, off_t offset, size_t count)
int fdms_read_trk_audio (char *buffer, fdms_trk *trk, off_t offset, size_t count)
int fdms_close (fdms_vol *vol)
const char * fdms_get_prg_name (fdms_prg *prg)
int fdms_get_prg_info (fdms_prg *prg, struct fdms_prg_info *prg_info)
int fdms_get_tempo_map (fdms_prg *prg, struct fdms_tempo *tempo_map)
int fdms_get_timesig_map (fdms_prg *prg, struct fdms_sig *sig_map)
int fdms_get_prg_header_raw (fdms_vol *vol, int p, char *header)
int fdms_get_tempo_map_raw (fdms_vol *vol, int p, char *tempo_map)
int fdms_get_timesig_map_raw (fdms_vol *vol, int p, char *timesig_map)

Detailed Description


Define Documentation

#define PRG_HEADER_SIZE   (0x200LL*8)

Size of a program header


Typedef Documentation

typedef struct _fdms_prg fdms_prg

Opaque FDMS program handle

typedef struct _fdms_seg fdms_seg

Opaque FDMS segment handle

typedef struct _fdms_trk fdms_trk

Opaque FDMS track handle

typedef struct _fdms_vol fdms_vol

Opaque FDMS disk handle


Enumeration Type Documentation

enum midi_sync

Midi sync setting values.

Enumerator:
fdms_sync_off  OFF
fdms_sync_clk  CLK
fdms_sync_mtc  MTC

Offset mode setting values.

Enumerator:
fdms_abs  ABS
fdms_bar  BAR


Function Documentation

int fdms_close ( fdms_vol vol  ) 

Close fdms and release resources.

int fdms_get_prg_capacity ( fdms_vol vol  ) 

Get the program capacity.

This is the number of possible programs for this filesystem. Usually 128 (limited to 99 by the device).

Parameters:
vol the volume handle.

int fdms_get_prg_count ( fdms_vol vol  ) 

Get program count.

Returns the actual number of valid programs in the volume.

Parameters:
vol the volume handle.

int fdms_get_prg_header_raw ( fdms_vol vol,
int  p,
char *  header 
)

Return the raw header in the (caller-allocated) buffer header.

This method takes fdms_vol* rather than fdms_prg* in case fdms_open_prg can't parse the program header

int fdms_get_prg_info ( fdms_prg prg,
struct fdms_prg_info prg_info 
)

Return program information.

const char* fdms_get_prg_name ( fdms_prg prg  ) 

Return the program name.

int fdms_get_seg_count ( fdms_trk trk  ) 

Get segment count.

A track is made up of logically consecutive segments numbered 0..n-1. This returns n.

Parameters:
trk the track handle.

size_t fdms_get_seg_length ( fdms_trk trk,
int  s 
)

Get segment length (bytes) of segment s.

Parameters:
trk the track handle.
s the 0-based segment index.

int fdms_get_tempo_map ( fdms_prg prg,
struct fdms_tempo tempo_map 
)

Return tempo map.

int fdms_get_tempo_map_raw ( fdms_vol vol,
int  p,
char *  tempo_map 
)

Return the raw tempo map in the (caller-allocated) buffer tempo_map.

This method takes fdms_vol* rather than fdms_prg* in case fdms_open_prg can't parse the program header

int fdms_get_timesig_map ( fdms_prg prg,
struct fdms_sig sig_map 
)

Return time sig map.

int fdms_get_timesig_map_raw ( fdms_vol vol,
int  p,
char *  timesig_map 
)

Return the raw time sig map in the (caller-allocated) buffer timesig_map.

This method takes fdms_vol* rather than fdms_prg* in case fdms_open_prg can't parse the program header

int fdms_get_trk ( fdms_prg prg,
int  t,
fdms_trk **  pp_trk 
)

Open track.

The track handle must be passed to fdms_close_trk() once it is no longer needed.

Parameters:
prg the program handle.
t the 0-based track index
pp_trk the track handle will be stored here.

int fdms_get_trk_capacity ( fdms_prg prg  ) 

Get track cacity.

Returns the number of tracks this program can hold. Usually 24, limited by the device to whatever it can handle.

Parameters:
prg the volume handle.

int fdms_get_trk_count ( fdms_prg prg  ) 

Get track count.

Returns the number of actual tracks in the program.

Parameters:
prg the volume handle.

size_t fdms_get_trk_length ( fdms_trk trk  ) 

Get track length (bytes).

Parameters:
trk the track handle.

int fdms_open ( const char *  path,
fdms_vol **  pp_vol 
)

Open volume.

path should point to an image or device.

Opens the device or image path, and stores a volume handle in pp_vol. This handle must be passed to fdms_close() once it is no longer needed.

Parameters:
path the path to an FDMS image or device.
pp_vol the volume handle will be stored here.

int fdms_open_prg ( fdms_vol vol,
int  p,
fdms_prg **  pp_prg 
)

Open program.

The program handle must be passed to fdms_close_prg() once it is no longer needed.

Parameters:
vol the volume handle.
p the 0-based program index
pp_prg the program handle will be stored here.

int fdms_read_seg_audio ( char *  buffer,
fdms_trk trk,
int  s,
off_t  offset,
size_t  count 
)

Read a maximum of count bytes from segment s starting at offset. Return the number of bytes actually read.

int fdms_read_trk_audio ( char *  buffer,
fdms_trk trk,
off_t  offset,
size_t  count 
)

Read a maximum of count bytes from all segments of trk starting at offset. Return the number of bytes actually read.


Generated on Sun Dec 13 03:30:00 2009 for fdms by  doxygen 1.5.6