21#ifndef DRUMSTICK_QSMF_H
22#define DRUMSTICK_QSMF_H
26#include <QScopedPointer>
36#if defined(DRUMSTICK_STATIC)
37#define DRUMSTICK_FILE_EXPORT
39#if defined(drumstick_file_EXPORTS)
40#define DRUMSTICK_FILE_EXPORT Q_DECL_EXPORT
42#define DRUMSTICK_FILE_EXPORT Q_DECL_IMPORT
58const quint32
MThd = 0x4d546864;
59const quint32
MTrk = 0x4d54726b;
110 void readFromStream(QDataStream *stream);
111 void readFromFile(
const QString& fileName);
112 void writeToStream(QDataStream *stream);
113 void writeToFile(
const QString& fileName);
115 void writeMetaEvent(
long deltaTime,
int type,
const QByteArray& data);
116 void writeMetaEvent(
long deltaTime,
int type,
const QString& data);
117 void writeMetaEvent(
long deltaTime,
int type,
int data);
118 void writeMetaEvent(
long deltaTime,
int type);
120 void writeMidiEvent(
long deltaTime,
int type,
int chan,
int b1);
121 void writeMidiEvent(
long deltaTime,
int type,
int chan,
int b1,
int b2);
122 void writeMidiEvent(
long deltaTime,
int type,
int chan,
const QByteArray& data);
123 void writeMidiEvent(
long deltaTime,
int type,
long len,
char* data);
125 void writeTempo(
long deltaTime,
long tempo);
126 void writeBpmTempo(
long deltaTime,
int tempo);
127 void writeTimeSignature(
long deltaTime,
int num,
int den,
int cc,
int bb);
128 void writeKeySignature(
long deltaTime,
int tone,
int mode);
129 void writeSequenceNumber(
long deltaTime,
int seqnum);
131 long getCurrentTime();
132 long getCurrentTempo();
136 void setDivision(
int division);
138 void setTracks(
int tracks);
140 void setFileFormat(
int fileFormat);
141 Q_DECL_DEPRECATED QTextCodec* getTextCodec();
142 Q_DECL_DEPRECATED
void setTextCodec(QTextCodec *codec);
323 QScopedPointer<QSmfPrivate> d;
328 void putByte(quint8 value);
331 quint16 to16bit(quint8 c1, quint8 c2);
332 quint32 to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4);
335 void write16bit(quint16 data);
336 void write32bit(quint32 data);
337 void writeVarLen(quint64 value);
338 double ticksToSecs(quint64 ticks, quint16 division, quint64 tempo);
340 void readExpected(
const QString& s);
341 void addTempo(quint64 tempo, quint64 time);
343 void SMFError(
const QString& s);
344 void channelMessage(quint8 status, quint8 c1, quint8 c2);
346 void msgAdd(quint8 b);
347 void metaEvent(quint8 b);
349 void badByte(quint8 b,
int p);
350 quint8 lowerByte(quint16 x);
351 quint8 upperByte(quint16 x);
353 void writeHeaderChunk(
int format,
int ntracks,
int division);
354 void writeTrackChunk(
int track);
The QObject class is the base class of all Qt objects.
Standard MIDI Files input/output.
void signalSMFKeyPress(int chan, int pitch, int press)
Emitted after reading a Polyphonic Aftertouch message.
void signalSMFforcedChannel(int channel)
Emitted after reading a Forced channel message.
void signalSMFforcedPort(int port)
Emitted after reading a Forced port message.
void signalSMFTimeSig(int b0, int b1, int b2, int b3)
Emitted after reading a SMF Time signature message.
void signalSMFKeySig(int b0, int b1)
Emitted after reading a SMF Key Signature smessage.
void signalSMFChanPress(int chan, int press)
Emitted after reading a Channel Aftertouch message.
void signalSMFTrackEnd()
Emitted after a track has finished.
void signalSMFNoteOn(int chan, int pitch, int vol)
Emitted after reading a Note On message.
void signalSMFTempo(int tempo)
Emitted after reading a Tempo Change message.
void signalSMFWriteTrack(int track)
Emitted to request the user to write a track.
Q_DECL_DEPRECATED void signalSMFText(int typ, const QString &data)
Emitted after reading a SMF text message.
void signalSMFTrackStart()
Emitted after reading a track prefix.
void signalSMFError(const QString &errorStr)
Emitted for a SMF read or write error.
void signalSMFSeqSpecific(const QByteArray &data)
Emitted after reading a Sequencer specific message.
void signalSMFWriteTempoTrack()
Emitted to request the user to prepare the tempo track.
void signalSMFendOfTrack()
Emitted after reading a End-Of-Track message.
void signalSMFHeader(int format, int ntrks, int division)
Emitted after reading a SMF header.
void signalSMFProgram(int chan, int patch)
Emitted after reading a Program change message.
void signalSMFText2(int typ, const QByteArray &data)
Emitted after reading a SMF text message.
void signalSMFNoteOff(int chan, int pitch, int vol)
Emitted after reading a Note Off message.
void signalSMFSequenceNum(int seq)
Emitted after reading a Sequence number message.
void signalSMFMetaMisc(int typ, const QByteArray &data)
Emitted after reading any SMF Meta message.
void signalSMFSysex(const QByteArray &data)
Emitted after reading a System Exclusive message.
void signalSMFCtlChange(int chan, int ctl, int value)
Emitted after reading a Control Change message.
void signalSMFPitchBend(int chan, int value)
Emitted after reading a Bender message.
void signalSMFMetaUnregistered(int typ, const QByteArray &data)
Emitted after reading an unregistered SMF Meta message.
void signalSMFSmpte(int b0, int b1, int b2, int b3, int b4)
Emitted after reading a SMPT offset message.
const quint8 cue_point
SMF Cue point.
const quint8 system_exclusive
MIDI event System Exclusive begin.
const quint8 sequencer_specific
SMF Sequencer specific.
const quint32 MTrk
SMF Track prefix.
const quint8 forced_channel
SMF Forced MIDI channel.
const quint8 midi_channel_mask
Mask to extract the channel from the status byte.
QString drumstickLibraryVersion()
drumstickLibraryVersion provides the Drumstick version as an edited QString
const quint8 note_on
MIDI event Note On.
const quint8 control_change
MIDI event Control change.
const quint8 major_mode
Major mode scale.
const quint8 note_off
MIDI event Note Off.
const quint8 smpte_offset
SMF SMPTE offset.
const quint8 sequence_number
SMF Sequence number.
const quint8 minor_mode
Minor mode scale.
const quint8 sequence_name
SMF Sequence name.
const quint8 pitch_wheel
MIDI event Bender.
const quint8 meta_event
SMF Meta Event prefix.
const quint8 time_signature
SMF Time signature.
const quint8 end_of_track
SMF End of track.
const quint32 MThd
SMF Header prefix.
const quint8 poly_aftertouch
MIDI event Polyphonic pressure.
const quint8 key_signature
SMF Key signature.
const quint8 text_event
SMF Text event.
const quint8 channel_aftertouch
MIDI event Channel after-touch.
const quint8 instrument_name
SMF Instrument name.
const quint8 marker
SMF Marker.
const quint8 forced_port
SMF Forced MIDI port.
const quint8 copyright_notice
SMF Copyright notice.
const quint8 program_chng
MIDI event Program change.
const quint8 midi_command_mask
Mask to extract the command from the status byte.
const quint8 end_of_sysex
MIDI event System Exclusive end.
const quint8 lyric
SMF Lyric.
const quint8 set_tempo
SMF Tempo change.