meta


A meta contains MIDI meta-messages found in MIDI files. It is like a tagged union but the data members are all present rather than overlapping.

class meta
{	
public:
    struct offs
    {
        enum fmt { f24, f25, f30d, f30 } format;
        uchar hr, min, sec, fr, centifr;
    };
    struct tsig { uchar num, denom, Mclks_p_beat, not32s_p_24_Mclks; };
    struct ksig
    {
        enum mod { flat, sharp } m;
        uchar n;
        enum qual { major, minor } q;
    };
	
    uchar mt;
    int seq_num;
    int ch_prefix;
    long tem;
    offs o;
    tsig t;
    ksig k;
    baws seq_spec;
    UtilStringPtr txt;

    enum
    {
        sequence_num   =    0,
        txt_generic    =    1,
        txt_copyright  =    2,
        txt_seq_or_trk =    3,
        txt_instrument =    4,
        txt_lyric      =    5,
        txt_marker     =    6,
        txt_cue        =    7,
        chan_prefix    = 0x20,
        trk_end        = 0x2F,
        tempo          = 0x51,
        SMPTE_offset   = 0x54,
        time_sig       = 0x58,
        key_sig        = 0x59,
        sequencer_spec = 0x7F
    };

    meta();
    meta(const meta& m);
    meta     (int meta_ty, const uchar* r, long len);
    void init(int meta_ty, const uchar *r, long len);

    int sprint( char *s ) const;
    UtilStringPtr unparse() const;

    meta& operator=(const meta& m);
};
uchar mt
Indicates the type of the meta message. Below is a list of what values it may take and what corresponding members of meta contain the data for that type of meta message.
sequence_num
int seq_num contains the sequence number.
txt_...
UtilStringPtr txt contains the text.
chan_prefix
int ch_prefix contains the channel prefix.
trk_end
No data: indicates end of track.
tempo
long tem contains the tempo.
SMPTE_offset
offs o contains the SMPTE offset.
time_sig
tsig t contains the time signature.
key_sig
ksig k contains the key signature.
sequencer_spec
baws seq_spec contains sequencer-specific information.
meta(int meta_ty, const uchar* r, long len)
Creates a meta object of type ty from the raw sequence of len bytes pointed to by r. These bytes are in the format you would find them in a MIDI file.
void init(int meta_ty, const uchar* r, long len)
Same as the constructor, but for "late construction."
int sprint( char *s )
Puts a textual representation of the object into s.
UtilStringPtr unparse()
Same as sprint() but returns a UtilStringPtr.