Go to the documentation of this file.
21 #ifndef DRUMSTICK_QSMF_H
22 #define DRUMSTICK_QSMF_H
38 #define MThd 0x4d546864
39 #define MTrk 0x4d54726b
42 #define meta_event 0xff
43 #define sequence_number 0x00
44 #define text_event 0x01
45 #define copyright_notice 0x02
46 #define sequence_name 0x03
47 #define instrument_name 0x04
50 #define cue_point 0x07
51 #define forced_channel 0x20
52 #define forced_port 0x21
53 #define end_of_track 0x2f
54 #define set_tempo 0x51
55 #define smpte_offset 0x54
56 #define time_signature 0x58
57 #define key_signature 0x59
58 #define sequencer_specific 0x7f
63 #define poly_aftertouch 0xa0
64 #define control_change 0xb0
65 #define program_chng 0xc0
66 #define channel_aftertouch 0xd0
67 #define pitch_wheel 0xe0
68 #define system_exclusive 0xf0
69 #define end_of_sysex 0xf7
71 #define midi_command_mask 0xf0
72 #define midi_channel_mask 0x0f
82 class DRUMSTICK_EXPORT QSmf : public QObject
90 void readFromStream(QDataStream *stream);
91 void readFromFile(
const QString& fileName);
92 void writeToStream(QDataStream *stream);
93 void writeToFile(
const QString& fileName);
95 void writeMetaEvent(
long deltaTime,
int type,
const QByteArray& data);
96 void writeMetaEvent(
long deltaTime,
int type,
const QString& data);
97 void writeMetaEvent(
long deltaTime,
int type,
int data);
98 void writeMetaEvent(
long deltaTime,
int type);
100 void writeMidiEvent(
long deltaTime,
int type,
int chan,
int b1);
101 void writeMidiEvent(
long deltaTime,
int type,
int chan,
int b1,
int b2);
102 void writeMidiEvent(
long deltaTime,
int type,
int chan,
const QByteArray& data);
103 void writeMidiEvent(
long deltaTime,
int type,
long len,
char* data);
105 void writeTempo(
long deltaTime,
long tempo);
106 void writeBpmTempo(
long deltaTime,
int tempo);
107 void writeTimeSignature(
long deltaTime,
int num,
int den,
int cc,
int bb);
108 void writeKeySignature(
long deltaTime,
int tone,
int mode);
109 void writeSequenceNumber(
long deltaTime,
int seqnum);
111 long getCurrentTime();
112 long getCurrentTempo();
116 void setDivision(
int division);
118 void setTracks(
int tracks);
120 void setFileFormat(
int fileFormat);
121 QTextCodec* getTextCodec();
122 void setTextCodec(QTextCodec *codec);
294 void putByte(quint8 value);
297 quint16 to16bit(quint8 c1, quint8 c2);
298 quint32 to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4);
301 void write16bit(quint16 data);
302 void write32bit(quint32 data);
303 void writeVarLen(quint64 value);
304 double ticksToSecs(quint64 ticks, quint16 division, quint64 tempo);
306 void readExpected(
const QString& s);
307 void addTempo(quint64 tempo, quint64 time);
309 void SMFError(
const QString& s);
310 void channelMessage(quint8 status, quint8 c1, quint8 c2);
312 void msgAdd(quint8 b);
313 void metaEvent(quint8 b);
315 void badByte(quint8 b,
int p);
316 quint8 lowerByte(quint16 x);
317 quint8 upperByte(quint16 x);
319 void writeHeaderChunk(
int format,
int ntracks,
int division);
320 void writeTrackChunk(
int track);
The QObject class is the base class of all Qt objects.
void signalSMFCtlChange(int chan, int ctl, int value)
Emitted after reading a Control Change message.
void signalSMFSeqSpecific(const QByteArray &data)
Emitted after reading a Sequencer specific message.
void signalSMFText(int typ, const QString &data)
Emitted after reading a SMF text message.
void signalSMFforcedPort(int port)
Emitted after reading a Forced port message.
void signalSMFWriteTrack(int track)
Emitted to request the user to write a track.
Drumstick visibility macros.
void signalSMFTrackStart()
Emitted after reading a track prefix.
void signalSMFProgram(int chan, int patch)
Emitted after reading a Program change message.
void signalSMFforcedChannel(int channel)
Emitted after reading a Forced channel message.
void signalSMFError(const QString &errorStr)
Emitted for a SMF read or write error.
void signalSMFSmpte(int b0, int b1, int b2, int b3, int b4)
Emitted after reading a SMPT offset message.
void signalSMFSequenceNum(int seq)
Emitted after reading a Sequence number message.
void signalSMFSysex(const QByteArray &data)
Emitted after reading a System Exclusive message.
void signalSMFKeyPress(int chan, int pitch, int press)
Emitted after reading a Polyphonic Aftertouch message.
void signalSMFNoteOn(int chan, int pitch, int vol)
Emitted after reading a Note On message.
void signalSMFPitchBend(int chan, int value)
Emitted after reading a Bender message.
void signalSMFKeySig(int b0, int b1)
Emitted after reading a SMF Key Signature smessage.
void signalSMFTrackEnd()
Emitted after a track has finished.
void signalSMFTimeSig(int b0, int b1, int b2, int b3)
Emitted after reading a SMF Time signature message.
Standard MIDI Files input/output.
void signalSMFTempo(int tempo)
Emitted after reading a Tempo Change message.
void signalSMFWriteTempoTrack()
Emitted to request the user to write the tempo track.
void signalSMFendOfTrack()
Emitted after reading a End-Of-Track message.
void signalSMFChanPress(int chan, int press)
Emitted after reading a Channel Aftertouch message.
void signalSMFMetaMisc(int typ, const QByteArray &data)
Emitted after reading any SMF Meta message.
void signalSMFMetaUnregistered(int typ, const QByteArray &data)
Emitted after reading an unregistered SMF Meta message.
void signalSMFNoteOff(int chan, int pitch, int vol)
Emitted after reading a Note Off message.
void signalSMFHeader(int format, int ntrks, int division)
Emitted after reading a SMF header.