19#ifndef DRUMSTICK_QWRK_H
20#define DRUMSTICK_QWRK_H
24#include <QScopedPointer>
34#if defined(DRUMSTICK_STATIC)
35#define DRUMSTICK_FILE_EXPORT
37#if defined(drumstick_file_EXPORTS)
38#define DRUMSTICK_FILE_EXPORT Q_DECL_EXPORT
40#define DRUMSTICK_FILE_EXPORT Q_DECL_IMPORT
103 void readFromStream(QDataStream *stream);
104 void readFromFile(
const QString& fileName);
105 Q_DECL_DEPRECATED QTextCodec* getTextCodec();
106 Q_DECL_DEPRECATED
void setTextCodec(QTextCodec *codec);
112 int getKeySig()
const;
113 int getClock()
const;
114 int getAutoSave()
const;
115 int getPlayDelay()
const;
116 bool getZeroCtrls()
const;
117 bool getSendSPP()
const;
118 bool getSendCont()
const;
119 bool getPatchSearch()
const;
120 bool getAutoStop()
const;
121 unsigned int getStopTime()
const;
122 bool getAutoRewind()
const;
123 int getRewindTime()
const;
124 bool getMetroPlay()
const;
125 bool getMetroRecord()
const;
126 bool getMetroAccent()
const;
127 int getCountIn()
const;
128 bool getThruOn()
const;
129 bool getAutoRestart()
const;
130 int getCurTempoOfs()
const;
131 int getTempoOfs1()
const;
132 int getTempoOfs2()
const;
133 int getTempoOfs3()
const;
134 bool getPunchEnabled()
const;
135 int getPunchInTime()
const;
136 int getPunchOutTime()
const;
137 int getEndAllTime()
const;
139 QByteArray getLastChunkRawData()
const;
140 double getRealTime(
long ticks)
const;
193 void signalWRKNote(
int track,
long time,
int chan,
int pitch,
int vol,
int dur);
265 void signalWRKSysex(
int bank,
const QString& name,
bool autosend,
int port,
const QByteArray& data);
277 Q_DECL_DEPRECATED
void signalWRKText(
int track,
long time,
int type,
const QString& data);
325 const QString& name2,
326 int trackno,
int channel,
int pitch,
327 int velocity,
int port,
328 bool selected,
bool muted,
bool loop );
361 void signalWRKThru(
int mode,
int port,
int channel,
int keyPlus,
int velPlus,
int localPort);
446 int trackno,
int channel,
int pitch,
447 int velocity,
int port,
448 bool selected,
bool muted,
bool loop );
495 void signalWRKChord(
int track,
long time,
const QString& name,
const QByteArray& data);
546 const QByteArray& name2,
547 int trackno,
int channel,
int pitch,
548 int velocity,
int port,
549 bool selected,
bool muted,
bool loop );
574 int trackno,
int channel,
int pitch,
575 int velocity,
int port,
576 bool selected,
bool muted,
bool loop );
640 quint16 to16bit(quint8 c1, quint8 c2);
641 quint32 to32bit(quint8 c1, quint8 c2, quint8 c3, quint8 c4);
645 QString readString(
int len);
646 QString readVarString();
647 void readRawData(
int size);
648 void readGap(
int size);
650 void seek(qint64 pos);
653 void processTrackChunk();
654 void processVarsChunk();
655 void processTimebaseChunk();
656 void processNoteArray(
int track,
int events);
657 void processStreamChunk();
658 void processMeterChunk();
659 void processTempoChunk(
int factor = 1);
660 void processSysexChunk();
661 void processSysex2Chunk();
662 void processNewSysexChunk();
663 void processThruChunk();
664 void processTrackOffset();
665 void processTrackReps();
666 void processTrackPatch();
667 void processTrackBank();
668 void processTimeFormat();
669 void processComments();
670 void processVariableRecord(
int max);
671 void processNewTrack();
672 void processSoftVer();
673 void processTrackName();
674 void processStringTable();
675 void processLyricsStream();
676 void processTrackVol();
677 void processNewTrackOffset();
678 void processMeterKeyChunk();
679 void processSegmentChunk();
680 void processNewStream();
681 void processUnknown(
int id);
682 void processEndChunk();
684 QByteArray readByteArray(
int len);
685 QByteArray readVarByteArray();
686 void processMarkers();
695 QScopedPointer<QWrkPrivate> d;
The QObject class is the base class of all Qt objects.
Cakewalk WRK file format (input only)
void signalWRKTrackPatch(int track, int patch)
Emitted after reading a track patch chunk.
Q_DECL_DEPRECATED void signalWRKSegment(int track, long time, const QString &name)
Emitted after reading a segment prefix chunk.
void signalWRKProgram(int track, long time, int chan, int patch)
Emitted after reading a Program change message.
void signalWRKChord(int track, long time, const QString &name, const QByteArray &data)
Emitted after reading a chord diagram chunk.
static const QByteArray HEADER
Cakewalk WRK file format header string id.
void signalWRKHeader(int verh, int verl)
Emitted after reading a WRK header.
void signalWRKSysexEvent(int track, long time, int bank)
Emitted after reading a System Exclusive event.
void signalWRKMarker2(long time, int type, const QByteArray &data)
Emitted after reading a text marker This signal is emitted when getTextCodec() is nullptr.
void signalWRKGlobalVars()
Emitted after reading the global variables chunk.
void signalWRKSoftVer(const QString &version)
Emitted after reading a software version chunk.
void signalWRKSegment2(int track, long time, const QByteArray &name)
Emitted after reading a segment prefix chunk.
void signalWRKTrackOffset(int track, int offset)
Emitted after reading a track offset chunk.
void signalWRKChanPress(int track, long time, int chan, int press)
Emitted after reading a Channel Aftertouch message.
void signalWRKStreamEnd(long time)
Emitted after reading the last event of a event stream.
void signalWRKText2(int track, long time, int type, const QByteArray &data)
Emitted after reading a text message This signal is emitted when getTextCodec() is nullptr.
void signalWRKKeyPress(int track, long time, int chan, int pitch, int press)
Emitted after reading a Polyphonic Aftertouch message.
void signalWRKVariableRecord(const QString &name, const QByteArray &data)
Emitted after reading a variable chunk.
void signalWRKTrackVol(int track, int vol)
Emitted after reading a track volume chunk.
void signalWRKExpression2(int track, long time, int code, const QByteArray &text)
Emitted after reading an expression indication (notation) chunk.
void signalWRKTrackName2(int track, const QByteArray &name)
Emitted after reading a track name chunk.
Q_DECL_DEPRECATED void signalWRKNewTrack(const QString &name, int trackno, int channel, int pitch, int velocity, int port, bool selected, bool muted, bool loop)
Emitted after reading a new track prefix.
void signalWRKTrack2(const QByteArray &name1, const QByteArray &name2, int trackno, int channel, int pitch, int velocity, int port, bool selected, bool muted, bool loop)
Emitted after reading a track prefix chunk This signal is emitted when getTextCodec() is nullptr.
void signalWRKError(const QString &errorStr)
Emitted for a WRK file read error.
void signalWRKTempo(long time, int tempo)
Emitted after reading a Tempo Change message.
void signalWRKTimeSig(int bar, int num, int den)
Emitted after reading a WRK Time signature.
void signalWRKHairpin(int track, long time, int code, int dur)
Emitted after reading a hairpin symbol (notation) chunk.
void signalWRKPitchBend(int track, long time, int chan, int value)
Emitted after reading a Bender message.
void signalWRKEnd()
Emitted after reading the last chunk of a WRK file.
Q_DECL_DEPRECATED void signalWRKTrackName(int track, const QString &name)
Emitted after reading a track name chunk.
void signalWRKNewTrack2(const QByteArray &name, int trackno, int channel, int pitch, int velocity, int port, bool selected, bool muted, bool loop)
Emitted after reading a new track prefix This signal is emitted when getTextCodec() is nullptr.
void signalWRKThru(int mode, int port, int channel, int keyPlus, int velPlus, int localPort)
Emitted after reading an Extended Thru parameters chunk.
void signalWRKNote(int track, long time, int chan, int pitch, int vol, int dur)
Emitted after reading a Note message.
Q_DECL_DEPRECATED void signalWRKStringTable(const QStringList &strs)
Emitted after reading a string event types chunk.
void signalWRKUnknownChunk(int type, const QByteArray &data)
Emitted after reading an unknown chunk.
void signalWRKTrackBank(int track, int bank)
Emitted after reading a track bank chunk.
void signalWRKComments2(const QByteArray &data)
Emitted after reading a comments chunk This signal is emitted when getTextCodec() is nullptr.
void signalWRKTimeBase(int timebase)
Emitted after reading the timebase chunk.
Q_DECL_DEPRECATED void signalWRKExpression(int track, long time, int code, const QString &text)
Emitted after reading an expression indication (notation) chunk.
Q_DECL_DEPRECATED void signalWRKText(int track, long time, int type, const QString &data)
Emitted after reading a text message.
void signalWRKTimeFormat(int frames, int offset)
Emitted after reading a SMPTE time format chunk.
void signalWRKSysex(int bank, const QString &name, bool autosend, int port, const QByteArray &data)
Emitted after reading a System Exclusive Bank.
Q_DECL_DEPRECATED void signalWRKComments(const QString &data)
Emitted after reading a comments chunk.
void signalWRKCtlChange(int track, long time, int chan, int ctl, int value)
Emitted after reading a Control Change message.
void signalWRKTrackReps(int track, int reps)
Emitted after reading a track offset chunk.
void signalWRKKeySig(int bar, int alt)
Emitted after reading a WRK Key Signature.
Q_DECL_DEPRECATED void signalWRKTrack(const QString &name1, const QString &name2, int trackno, int channel, int pitch, int velocity, int port, bool selected, bool muted, bool loop)
Emitted after reading a track prefix chunk.
Q_DECL_DEPRECATED void signalWRKMarker(long time, int type, const QString &data)
Emitted after reading a text marker This is deprecated because the class QTextCodec was removed from ...
void signalWRKStringTable2(const QList< QByteArray > &strs)
Emitted after reading a string event types chunk.
WrkChunkType
Record types within a WRK file.
@ NTRKOFS_CHUNK
Track offset.
@ NTRACK_CHUNK
Track prefix.
@ TRKPATCH_CHUNK
Track patch.
@ STRTAB_CHUNK
Table of text event types.
@ NTEMPO_CHUNK
New Tempo map.
@ VARS_CHUNK
Global variables.
@ TRKBANK_CHUNK
Track bank.
@ COMMENTS_CHUNK
Comments.
@ SGMNT_CHUNK
Segment prefix.
@ SOFTVER_CHUNK
Software version which saved the file.
@ TRKNAME_CHUNK
Track name.
@ TIMEFMT_CHUNK
SMPTE time format.
@ END_CHUNK
Last chunk, end of file.
@ STREAM_CHUNK
Events stream.
@ TRACK_CHUNK
Track prefix.
@ TIMEBASE_CHUNK
Timebase. If present is the first chunk in the file.
@ TRKOFFS_CHUNK
Track offset.
@ NSYSEX_CHUNK
System exclusive bank.
@ THRU_CHUNK
Extended thru parameters.
@ SYSEX2_CHUNK
System exclusive bank.
@ NSTREAM_CHUNK
Events stream.
@ VARIABLE_CHUNK
Variable record chunk.
@ METERKEY_CHUNK
Meter/Key map.
@ MEMRGN_CHUNK
Memory region.
@ TRKREPS_CHUNK
Track repetitions.
@ TRKVOL_CHUNK
Track volume.
@ SYSEX_CHUNK
System exclusive bank.
@ LYRICS_CHUNK
Events stream with lyrics.