MidiCodec Class Reference

Auxiliary class to translate between raw MIDI streams and ALSA events. More...

#include <alsaevent.h>

Inheritance diagram for MidiCodec:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 MidiCodec (int bufsize, QObject *parent=0)
 MidiCodec constructor.
 ~MidiCodec ()
 Destructor.
void init ()
 CODEC initialization.
long decode (unsigned char *buf, long count, const snd_seq_event_t *ev)
 Decode from event to bytes.
long encode (const unsigned char *buf, long count, snd_seq_event_t *ev)
 Encode from byte stream.
long encode (int c, snd_seq_event_t *ev)
 Read one byte and encode to sequencer event if finished.
void enableRunningStatus (bool enable)
 Enable MIDI running status (command merge).
void resetEncoder ()
 Reset MIDI encode parser.
void resetDecoder ()
 Reset MIDI decode parser.
void resizeBuffer (int bufsize)
 Resize the CODEC buffer.


Detailed Description

Auxiliary class to translate between raw MIDI streams and ALSA events.

Definition at line 623 of file alsaevent.h.


Constructor & Destructor Documentation

MidiCodec ( int  bufsize,
QObject parent = 0 
) [explicit]

MidiCodec constructor.

Parameters:
bufsize The buffer size of the CODEC
parent The optional parent object

Definition at line 945 of file alsaevent.cpp.

References CHECK_ERROR.

~MidiCodec (  ) 

Destructor.

Definition at line 953 of file alsaevent.cpp.


Member Function Documentation

long decode ( unsigned char *  buf,
long  count,
const snd_seq_event_t *  ev 
)

Decode from event to bytes.

Parameters:
buf A buffer to get the results
count Available bytes in MIDI byte stream
ev The input event
Returns:
The number of written bytes if success.

Definition at line 975 of file alsaevent.cpp.

References CHECK_WARNING.

void enableRunningStatus ( bool  enable  ) 

Enable MIDI running status (command merge).

Parameters:
enable True to enable, false to disable.

Definition at line 1015 of file alsaevent.cpp.

long encode ( int  c,
snd_seq_event_t *  ev 
)

Read one byte and encode to sequencer event if finished.

Parameters:
c A byte of MIDI stream
ev Result - sequencer event
Returns:
1 - sequencer event is completed, 0 - next byte is required for completion, otherwise a negative error code

Definition at line 1004 of file alsaevent.cpp.

References CHECK_WARNING.

long encode ( const unsigned char *  buf,
long  count,
snd_seq_event_t *  ev 
)

Encode from byte stream.

Parameters:
buf MIDI byte stream
count Bytes of MIDI byte stream to encode
ev Result - sequencer event
Returns:
Number of written bytes if success.

Definition at line 990 of file alsaevent.cpp.

References CHECK_WARNING.

void init (  ) 

CODEC initialization.

Definition at line 962 of file alsaevent.cpp.

void resetDecoder (  ) 

Reset MIDI decode parser.

Definition at line 1024 of file alsaevent.cpp.

void resetEncoder (  ) 

Reset MIDI encode parser.

Definition at line 1033 of file alsaevent.cpp.

void resizeBuffer ( int  bufsize  ) 

Resize the CODEC buffer.

Parameters:
bufsize New buffer size.

Definition at line 1043 of file alsaevent.cpp.

References CHECK_WARNING.


The documentation for this class was generated from the following files:

Generated on Wed Sep 8 10:12:50 2010 for drumstick by  doxygen 1.5.9