drumstick 2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
|
Cakewalk WRK file format (input only) More...
#include <qwrk.h>
Signals | |
void | signalWRKError (const QString &errorStr) |
Emitted for a WRK file read error. More... | |
void | signalWRKUnknownChunk (int type, const QByteArray &data) |
Emitted after reading an unknown chunk. More... | |
void | signalWRKHeader (int verh, int verl) |
Emitted after reading a WRK header. More... | |
void | signalWRKEnd () |
Emitted after reading the last chunk of a WRK file. | |
void | signalWRKStreamEnd (long time) |
Emitted after reading the last event of a event stream. More... | |
void | signalWRKNote (int track, long time, int chan, int pitch, int vol, int dur) |
Emitted after reading a Note message. More... | |
void | signalWRKKeyPress (int track, long time, int chan, int pitch, int press) |
Emitted after reading a Polyphonic Aftertouch message. More... | |
void | signalWRKCtlChange (int track, long time, int chan, int ctl, int value) |
Emitted after reading a Control Change message. More... | |
void | signalWRKPitchBend (int track, long time, int chan, int value) |
Emitted after reading a Bender message. More... | |
void | signalWRKProgram (int track, long time, int chan, int patch) |
Emitted after reading a Program change message. More... | |
void | signalWRKChanPress (int track, long time, int chan, int press) |
Emitted after reading a Channel Aftertouch message. More... | |
void | signalWRKSysexEvent (int track, long time, int bank) |
Emitted after reading a System Exclusive event. More... | |
void | signalWRKSysex (int bank, const QString &name, bool autosend, int port, const QByteArray &data) |
Emitted after reading a System Exclusive Bank. More... | |
Q_DECL_DEPRECATED void | signalWRKText (int track, long time, int type, const QString &data) |
Emitted after reading a text message. More... | |
void | signalWRKTimeSig (int bar, int num, int den) |
Emitted after reading a WRK Time signature. More... | |
void | signalWRKKeySig (int bar, int alt) |
Emitted after reading a WRK Key Signature. More... | |
void | signalWRKTempo (long time, int tempo) |
Emitted after reading a Tempo Change message. More... | |
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. More... | |
void | signalWRKTimeBase (int timebase) |
Emitted after reading the timebase chunk. More... | |
void | signalWRKGlobalVars () |
Emitted after reading the global variables chunk. More... | |
void | signalWRKThru (int mode, int port, int channel, int keyPlus, int velPlus, int localPort) |
Emitted after reading an Extended Thru parameters chunk. More... | |
void | signalWRKTrackOffset (int track, int offset) |
Emitted after reading a track offset chunk. More... | |
void | signalWRKTrackReps (int track, int reps) |
Emitted after reading a track offset chunk. More... | |
void | signalWRKTrackPatch (int track, int patch) |
Emitted after reading a track patch chunk. More... | |
void | signalWRKTrackBank (int track, int bank) |
Emitted after reading a track bank chunk. More... | |
void | signalWRKTimeFormat (int frames, int offset) |
Emitted after reading a SMPTE time format chunk. More... | |
Q_DECL_DEPRECATED void | signalWRKComments (const QString &data) |
Emitted after reading a comments chunk. More... | |
void | signalWRKVariableRecord (const QString &name, const QByteArray &data) |
Emitted after reading a variable chunk. More... | |
void | signalWRKTrackVol (int track, int vol) |
Emitted after reading a track volume chunk. More... | |
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. More... | |
void | signalWRKSoftVer (const QString &version) |
Emitted after reading a software version chunk. More... | |
Q_DECL_DEPRECATED void | signalWRKTrackName (int track, const QString &name) |
Emitted after reading a track name chunk. More... | |
Q_DECL_DEPRECATED void | signalWRKStringTable (const QStringList &strs) |
Emitted after reading a string event types chunk. More... | |
Q_DECL_DEPRECATED void | signalWRKSegment (int track, long time, const QString &name) |
Emitted after reading a segment prefix chunk. More... | |
void | signalWRKChord (int track, long time, const QString &name, const QByteArray &data) |
Emitted after reading a chord diagram chunk. More... | |
Q_DECL_DEPRECATED void | signalWRKExpression (int track, long time, int code, const QString &text) |
Emitted after reading an expression indication (notation) chunk. More... | |
void | signalWRKHairpin (int track, long time, int code, int dur) |
Emitted after reading a hairpin symbol (notation) chunk. More... | |
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. More... | |
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. More... | |
void | signalWRKComments2 (const QByteArray &data) |
Emitted after reading a comments chunk This signal is emitted when getTextCodec() is nullptr. More... | |
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. More... | |
void | signalWRKTrackName2 (int track, const QByteArray &name) |
Emitted after reading a track name chunk. More... | |
void | signalWRKStringTable2 (const QList< QByteArray > &strs) |
Emitted after reading a string event types chunk. More... | |
void | signalWRKSegment2 (int track, long time, const QByteArray &name) |
Emitted after reading a segment prefix chunk. More... | |
void | signalWRKExpression2 (int track, long time, int code, const QByteArray &text) |
Emitted after reading an expression indication (notation) chunk. More... | |
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 QtCore since Qt6 Use signalWRKMarker2() instead. More... | |
void | signalWRKMarker2 (long time, int type, const QByteArray &data) |
Emitted after reading a text marker This signal is emitted when getTextCodec() is nullptr. More... | |
Public Member Functions | |
QWrk (QObject *parent=nullptr) | |
Constructor. More... | |
virtual | ~QWrk () |
Destructor. | |
void | readFromStream (QDataStream *stream) |
Reads a stream. More... | |
void | readFromFile (const QString &fileName) |
Reads a stream from a disk file. More... | |
Q_DECL_DEPRECATED QTextCodec * | getTextCodec () |
Gets the text codec used for text meta-events I/O. More... | |
Q_DECL_DEPRECATED void | setTextCodec (QTextCodec *codec) |
Sets the text codec for text meta-events. More... | |
long | getFilePos () |
Current position in the data stream. More... | |
int | getNow () const |
Now marker time. More... | |
int | getFrom () const |
From marker time. More... | |
int | getThru () const |
Thru marker time. More... | |
int | getKeySig () const |
Key signature (0=C, 1=C#, ... 11=B) More... | |
int | getClock () const |
Clock Source (0=Int, 1=MIDI, 2=FSK, 3=SMPTE) More... | |
int | getAutoSave () const |
Auto save (0=disabled, 1..256=minutes) More... | |
int | getPlayDelay () const |
Play Delay. More... | |
bool | getZeroCtrls () const |
Zero continuous controllers? More... | |
bool | getSendSPP () const |
Send Song Position Pointer? More... | |
bool | getSendCont () const |
Send MIDI Continue? More... | |
bool | getPatchSearch () const |
Patch/controller search-back? More... | |
bool | getAutoStop () const |
Auto-stop? More... | |
unsigned int | getStopTime () const |
Auto-stop time. More... | |
bool | getAutoRewind () const |
Auto-rewind? More... | |
int | getRewindTime () const |
Auto-rewind time. More... | |
bool | getMetroPlay () const |
Metronome on during playback? More... | |
bool | getMetroRecord () const |
Metronome on during recording? More... | |
bool | getMetroAccent () const |
Metronome accents primary beats? More... | |
int | getCountIn () const |
Measures of count-in (0=no count-in) More... | |
bool | getThruOn () const |
MIDI Thru enabled? (only used if no THRU rec) More... | |
bool | getAutoRestart () const |
Auto-restart? More... | |
int | getCurTempoOfs () const |
Which of the 3 tempo offsets is used: 0..2. More... | |
int | getTempoOfs1 () const |
Fixed-point ratio value of tempo offset 1. More... | |
int | getTempoOfs2 () const |
Fixed-point ratio value of tempo offset 2. More... | |
int | getTempoOfs3 () const |
Fixed-point ratio value of tempo offset 3. More... | |
bool | getPunchEnabled () const |
Auto-Punch enabled? More... | |
int | getPunchInTime () const |
Punch-in time. More... | |
int | getPunchOutTime () const |
Punch-out time. More... | |
int | getEndAllTime () const |
Time of latest event (incl. More... | |
QByteArray | getLastChunkRawData () const |
Gets the last chunk raw data (undecoded) More... | |
Static Public Attributes | |
static const QByteArray | HEADER = QByteArrayLiteral("CAKEWALK") |
Cakewalk WRK file format header string id. More... | |
Cakewalk WRK file format (input only)
This class is used to parse Cakewalk WRK Files. Signals with QString parameters are deprecated because the class QTextCodec was removed from QtCore since Qt6.
bool getAutoRestart | ( | ) | const |
bool getAutoRewind | ( | ) | const |
int getAutoSave | ( | ) | const |
int getClock | ( | ) | const |
int getCountIn | ( | ) | const |
int getCurTempoOfs | ( | ) | const |
int getEndAllTime | ( | ) | const |
long getFilePos | ( | ) |
int getFrom | ( | ) | const |
int getKeySig | ( | ) | const |
QByteArray getLastChunkRawData | ( | ) | const |
bool getMetroAccent | ( | ) | const |
bool getMetroPlay | ( | ) | const |
bool getMetroRecord | ( | ) | const |
int getNow | ( | ) | const |
bool getPatchSearch | ( | ) | const |
bool getPunchEnabled | ( | ) | const |
int getPunchInTime | ( | ) | const |
int getPunchOutTime | ( | ) | const |
int getRewindTime | ( | ) | const |
bool getSendCont | ( | ) | const |
bool getSendSPP | ( | ) | const |
unsigned int getStopTime | ( | ) | const |
int getTempoOfs1 | ( | ) | const |
Fixed-point ratio value of tempo offset 1.
NOTE: The offset ratios are expressed as a numerator in the expression n/64. To get a ratio from this number, divide the number by 64. To get this number from a ratio, multiply the ratio by 64. Examples: 32 ==> 32/64 = 0.5 63 ==> 63/64 = 0.9 64 ==> 64/64 = 1.0 128 ==> 128/64 = 2.0
int getTempoOfs2 | ( | ) | const |
Fixed-point ratio value of tempo offset 2.
NOTE: The offset ratios are expressed as a numerator in the expression n/64. To get a ratio from this number, divide the number by 64. To get this number from a ratio, multiply the ratio by 64. Examples: 32 ==> 32/64 = 0.5 63 ==> 63/64 = 0.9 64 ==> 64/64 = 1.0 128 ==> 128/64 = 2.0
int getTempoOfs3 | ( | ) | const |
Fixed-point ratio value of tempo offset 3.
NOTE: The offset ratios are expressed as a numerator in the expression n/64. To get a ratio from this number, divide the number by 64. To get this number from a ratio, multiply the ratio by 64. Examples: 32 ==> 32/64 = 0.5 63 ==> 63/64 = 0.9 64 ==> 64/64 = 1.0 128 ==> 128/64 = 2.0
QTextCodec * getTextCodec | ( | ) |
Gets the text codec used for text meta-events I/O.
int getThru | ( | ) | const |
bool getThruOn | ( | ) | const |
bool getZeroCtrls | ( | ) | const |
void readFromFile | ( | const QString & | fileName | ) |
Reads a stream from a disk file.
fileName | Name of an existing file. |
Definition at line 701 of file qwrk.cpp.
References QWrk::readFromStream().
void readFromStream | ( | QDataStream * | stream | ) |
Reads a stream.
stream | Pointer to an existing and opened stream |
Definition at line 691 of file qwrk.cpp.
Referenced by QWrk::readFromFile().
void setTextCodec | ( | QTextCodec * | codec | ) |
Sets the text codec for text meta-events.
The engine doesn't take ownership of the codec instance.
codec | QTextCodec pointer |
|
signal |
Emitted after reading a Channel Aftertouch message.
track | track number |
time | musical time |
chan | MIDI Channel |
press | Pressure amount |
|
signal |
Emitted after reading a chord diagram chunk.
track | track number |
time | event time in ticks |
name | chord name |
data | chord data definition (not decoded) |
|
signal |
Emitted after reading a comments chunk.
data | file text comments |
|
signal |
Emitted after reading a comments chunk This signal is emitted when getTextCodec() is nullptr.
data | file text comments |
|
signal |
Emitted after reading a Control Change message.
track | track number |
time | musical time |
chan | MIDI Channel |
ctl | MIDI Controller |
value | Control value |
|
signal |
Emitted for a WRK file read error.
errorStr | Error string |
|
signal |
Emitted after reading an expression indication (notation) chunk.
track | track number |
time | event time in ticks |
code | expression event code |
text | expression text |
|
signal |
Emitted after reading an expression indication (notation) chunk.
This signal is emitted when getTextCodec() is nullptr
track | track number |
time | event time in ticks |
code | expression event code |
text | expression text |
|
signal |
|
signal |
Emitted after reading a hairpin symbol (notation) chunk.
track | track number |
time | event time in ticks |
code | hairpin code |
dur | duration |
|
signal |
Emitted after reading a WRK header.
verh | WRK file format version major |
verl | WRK file format version minor |
|
signal |
Emitted after reading a Polyphonic Aftertouch message.
track | track number |
time | musical time |
chan | MIDI Channel |
pitch | MIDI Note |
press | Pressure amount |
|
signal |
Emitted after reading a WRK Key Signature.
bar | Measure number |
alt | Number of alterations (negative=flats, positive=sharps) |
|
signal |
Emitted after reading a text marker This is deprecated because the class QTextCodec was removed from QtCore since Qt6 Use signalWRKMarker2() instead.
time | event time in ticks or smpte |
type | tipe of time: 0=ticks or 1=smpte |
data | marker text |
|
signal |
Emitted after reading a text marker This signal is emitted when getTextCodec() is nullptr.
time | event time in ticks or smpte |
type | tipe of time: 0=ticks or 1=smpte |
data | marker text |
|
signal |
Emitted after reading a new track prefix.
name | track name |
trackno | track number |
channel | forced MIDI channel |
pitch | Note transposition |
velocity | Velocity increment |
port | MIDI port number |
selected | track is selected |
muted | track is muted |
loop | track loop enabled |
|
signal |
Emitted after reading a new track prefix This signal is emitted when getTextCodec() is nullptr.
name | track name |
trackno | track number |
channel | forced MIDI channel |
pitch | Note transposition |
velocity | Velocity increment |
port | MIDI port number |
selected | track is selected |
muted | track is muted |
loop | track loop enabled |
|
signal |
Emitted after reading a Note message.
track | track number |
time | musical time |
chan | MIDI Channel |
pitch | MIDI Note |
vol | Velocity |
dur | Duration |
|
signal |
Emitted after reading a Bender message.
track | track number |
time | musical time |
chan | MIDI Channel |
value | Bender value |
|
signal |
Emitted after reading a Program change message.
track | track number |
time | musical time |
chan | MIDI Channel |
patch | Program number |
|
signal |
Emitted after reading a segment prefix chunk.
track | track number |
time | segment time offset |
name | segment name |
|
signal |
Emitted after reading a segment prefix chunk.
This signal is emitted when getTextCodec() is nullptr
track | track number |
time | segment time offset |
name | segment name |
|
signal |
Emitted after reading a software version chunk.
version | software version string |
|
signal |
Emitted after reading the last event of a event stream.
time | musical time |
|
signal |
Emitted after reading a string event types chunk.
strs | list of declared string event types |
|
signal |
Emitted after reading a string event types chunk.
This signal is emitted when getTextCodec() is nullptr
strs | list of declared string event types |
|
signal |
Emitted after reading a System Exclusive Bank.
bank | Sysex Bank number |
name | Sysex Bank name |
autosend | Send automatically after loading the song |
port | MIDI output port |
data | Sysex bytes |
|
signal |
Emitted after reading a System Exclusive event.
track | track number |
time | musical time |
bank | Sysex Bank number |
|
signal |
Emitted after reading a Tempo Change message.
Tempo units are given in beats * 100 per minute, so to obtain BPM it is necessary to divide by 100 the tempo.
time | musical time |
tempo | beats per minute multiplied by 100 |
|
signal |
Emitted after reading a text message.
track | track number |
time | musical time |
type | Text type |
data | Text data |
|
signal |
Emitted after reading a text message This signal is emitted when getTextCodec() is nullptr.
track | track number |
time | musical time |
type | Text type |
data | Text data |
|
signal |
Emitted after reading an Extended Thru parameters chunk.
It was introduced in Cakewalk version 4.0. These parameters are intended to override the global vars Thruon value, so this record should come after the VARS_CHUNK record. It is optional.
mode | (auto, off, on) |
port | MIDI port |
channel | MIDI channel |
keyPlus | Note transpose |
velPlus | Velocity transpose |
localPort | MIDI local port |
|
signal |
Emitted after reading the timebase chunk.
timebase | ticks per quarter note |
|
signal |
Emitted after reading a SMPTE time format chunk.
frames | frames/sec (24, 25, 29=30-drop, 30) |
offset | frames of offset |
|
signal |
Emitted after reading a WRK Time signature.
bar | Measure number |
num | Numerator |
den | Denominator (exponent in a power of two) |
|
signal |
Emitted after reading a track prefix chunk.
name1 | track 1st name |
name2 | track 2nd name |
trackno | track number |
channel | track forced channel (-1=no forced) |
pitch | track pitch transpose in semitones (-127..127) |
velocity | track velocity increment (-127..127) |
port | track forced port |
selected | true if track is selected |
muted | true if track is muted |
loop | true if loop is enabled |
|
signal |
Emitted after reading a track prefix chunk This signal is emitted when getTextCodec() is nullptr.
name1 | track 1st name |
name2 | track 2nd name |
trackno | track number |
channel | track forced channel (-1=no forced) |
pitch | track pitch transpose in semitones (-127..127) |
velocity | track velocity increment (-127..127) |
port | track forced port |
selected | true if track is selected |
muted | true if track is muted |
loop | true if loop is enabled |
|
signal |
Emitted after reading a track bank chunk.
track | track number |
bank |
|
signal |
Emitted after reading a track name chunk.
track | track number |
name | track name |
|
signal |
Emitted after reading a track name chunk.
This signal is emitted when getTextCodec() is nullptr
track | track number |
name | track name |
|
signal |
Emitted after reading a track offset chunk.
track | track number |
offset | time offset |
|
signal |
Emitted after reading a track patch chunk.
track | track number |
patch |
|
signal |
Emitted after reading a track offset chunk.
track | track number |
reps | number of repetitions |
|
signal |
Emitted after reading a track volume chunk.
track | track number |
vol | initial volume |
|
signal |
Emitted after reading an unknown chunk.
type | chunk type |
data | chunk data (not decoded) |
|
signal |
Emitted after reading a variable chunk.
This record may contain data in text or binary format.
name | record identifier |
data | record variable data |
|
static |