drumstick 0.5.0

QWrk Class Reference

Cakewalk WRK file format (input only) More...

#include <qwrk.h>

Inheritance diagram for QWrk:

List of all members.

Signals

void signalWRKError (const QString &errorStr)
 Emitted for a WRK file read error.
void signalWRKUnknownChunk (int type, const QByteArray &data)
 Emitted after reading an unknown chunk.
void signalWRKHeader (int verh, int verl)
 Emitted after reading a WRK header.
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.
void signalWRKNote (int track, long time, int chan, int pitch, int vol, int dur)
 Emitted after reading a Note message.
void signalWRKKeyPress (int track, long time, int chan, int pitch, int press)
 Emitted after reading a Polyphonic Aftertouch message.
void signalWRKCtlChange (int track, long time, int chan, int ctl, int value)
 Emitted after reading a Control Change message.
void signalWRKPitchBend (int track, long time, int chan, int value)
 Emitted after reading a Bender message.
void signalWRKProgram (int track, long time, int chan, int patch)
 Emitted after reading a Program change message.
void signalWRKChanPress (int track, long time, int chan, int press)
 Emitted after reading a Channel Aftertouch message.
void signalWRKSysexEvent (int track, long time, int bank)
 Emitted after reading a System Exclusive event.
void signalWRKSysex (int bank, const QString &name, bool autosend, int port, const QByteArray &data)
 Emitted after reading a System Exclusive Bank.
void signalWRKText (int track, long time, int type, const QString &data)
 Emitted after reading a text message.
void signalWRKTimeSig (int bar, int num, int den)
 Emitted after reading a WRK Time signature.
void signalWRKKeySig (int bar, int alt)
 Emitted after reading a WRK Key Signature.
void signalWRKTempo (long time, int tempo)
 Emitted after reading a Tempo Change message.
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.
void signalWRKTimeBase (int timebase)
 Emitted after reading the timebase chunk.
void signalWRKGlobalVars ()
 Emitted after reading the global variables chunk.
void signalWRKThru (int mode, int port, int channel, int keyPlus, int velPlus, int localPort)
 Emitted after reading an Extended Thru parameters chunk.
void signalWRKTrackOffset (int track, int offset)
 Emitted after reading a track offset chunk.
void signalWRKTrackReps (int track, int reps)
 Emitted after reading a track offset chunk.
void signalWRKTrackPatch (int track, int patch)
 Emitted after reading a track patch chunk.
void signalWRKTrackBank (int track, int bank)
 Emitted after reading a track bank chunk.
void signalWRKTimeFormat (int frames, int offset)
 Emitted after reading a SMPTE time format chunk.
void signalWRKComments (const QString &data)
 Emitted after reading a comments chunk.
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 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 signalWRKSoftVer (const QString &version)
 Emitted after reading a software version chunk.
void signalWRKTrackName (int track, const QString &name)
 Emitted after reading a track name chunk.
void signalWRKStringTable (const QStringList &strs)
 Emitted after reading a string event types chunk.
void signalWRKSegment (int track, long time, const QString &name)
 Emitted after reading a segment prefix chunk.
void signalWRKChord (int track, long time, const QString &name, const QByteArray &data)
 Emitted after reading a chord diagram chunk.
void signalWRKExpression (int track, long time, int code, const QString &text)
 Emitted after reading an expression indication (notation) chunk.
void signalWRKHairpin (int track, long time, int code, int dur)
 Emitted after reading a hairpin symbol (notation) chunk.

Public Member Functions

 QWrk (QObject *parent=0)
 Constructor.
virtual ~QWrk ()
 Destructor.
void readFromStream (QDataStream *stream)
 Reads a stream.
void readFromFile (const QString &fileName)
 Reads a stream from a disk file.
QTextCodec * getTextCodec ()
 Gets the text codec used for text meta-events I/O.
void setTextCodec (QTextCodec *codec)
 Sets the text codec for text meta-events.
long getFilePos ()
 Current position in the data stream.
int getNow () const
 Now marker time.
int getFrom () const
 From marker time.
int getThru () const
 Thru marker time.
int getKeySig () const
 Key signature (0=C, 1=C#, ...
int getClock () const
 Clock Source (0=Int, 1=MIDI, 2=FSK, 3=SMPTE)
int getAutoSave () const
 Auto save (0=disabled, 1..256=minutes)
int getPlayDelay () const
 Play Delay.
bool getZeroCtrls () const
 Zero continuous controllers?
bool getSendSPP () const
 Send Song Position Pointer?
bool getSendCont () const
 Send MIDI Continue?
bool getPatchSearch () const
 Patch/controller search-back?
bool getAutoStop () const
 Auto-stop?
unsigned int getStopTime () const
 Auto-stop time.
bool getAutoRewind () const
 Auto-rewind?
int getRewindTime () const
 Auto-rewind time.
bool getMetroPlay () const
 Metronome on during playback?
bool getMetroRecord () const
 Metronome on during recording?
bool getMetroAccent () const
 Metronome accents primary beats?
int getCountIn () const
 Measures of count-in (0=no count-in)
bool getThruOn () const
 MIDI Thru enabled? (only used if no THRU rec)
bool getAutoRestart () const
 Auto-restart?
int getCurTempoOfs () const
 Which of the 3 tempo offsets is used: 0..2.
int getTempoOfs1 () const
 Fixed-point ratio value of tempo offset 1.
int getTempoOfs2 () const
 Fixed-point ratio value of tempo offset 2.
int getTempoOfs3 () const
 Fixed-point ratio value of tempo offset 3.
bool getPunchEnabled () const
 Auto-Punch enabled?
int getPunchInTime () const
 Punch-in time.
int getPunchOutTime () const
 Punch-out time.
int getEndAllTime () const
 Time of latest event (incl.
QByteArray getLastChunkRawData () const
 Gets the last chunk raw data (undecoded)

Detailed Description

Cakewalk WRK file format (input only)

This class is used to parse Cakewalk WRK Files

Since:
0.3.0
Examples:

dumpwrk.cpp, and guiplayer.cpp.

Definition at line 81 of file qwrk.h.


Member Function Documentation

bool getAutoRestart ( ) const

Auto-restart?

Returns:
Auto-restart

Definition at line 360 of file qwrk.cpp.

bool getAutoRewind ( ) const

Auto-rewind?

Returns:
Auto-rewind

Definition at line 297 of file qwrk.cpp.

int getAutoSave ( ) const

Auto save (0=disabled, 1..256=minutes)

Returns:
Auto save

Definition at line 225 of file qwrk.cpp.

bool getAutoStop ( ) const

Auto-stop?

Returns:
Auto-stop

Definition at line 279 of file qwrk.cpp.

int getClock ( ) const

Clock Source (0=Int, 1=MIDI, 2=FSK, 3=SMPTE)

Returns:
Clock Source

Definition at line 216 of file qwrk.cpp.

int getCountIn ( ) const

Measures of count-in (0=no count-in)

Returns:
Measures of count-in

Definition at line 342 of file qwrk.cpp.

int getCurTempoOfs ( ) const

Which of the 3 tempo offsets is used: 0..2.

Returns:
tempo offset index

Definition at line 369 of file qwrk.cpp.

int getEndAllTime ( ) const

Time of latest event (incl.

all tracks)

Returns:
Time of latest event

Definition at line 462 of file qwrk.cpp.

long getFilePos ( )

Current position in the data stream.

Returns:
current position

Definition at line 596 of file qwrk.cpp.

int getFrom ( ) const

From marker time.

Returns:
From marker time

Definition at line 189 of file qwrk.cpp.

int getKeySig ( ) const

Key signature (0=C, 1=C#, ...

11=B)

Returns:
Key signature

Definition at line 207 of file qwrk.cpp.

QByteArray getLastChunkRawData ( ) const

Gets the last chunk raw data (undecoded)

Returns:
last chunk raw data

Definition at line 163 of file qwrk.cpp.

bool getMetroAccent ( ) const

Metronome accents primary beats?

Returns:
Metronome accents primary beats

Definition at line 333 of file qwrk.cpp.

bool getMetroPlay ( ) const

Metronome on during playback?

Returns:
Metronome on during playback

Definition at line 315 of file qwrk.cpp.

bool getMetroRecord ( ) const

Metronome on during recording?

Returns:
Metronome on during recording

Definition at line 324 of file qwrk.cpp.

int getNow ( ) const

Now marker time.

Returns:
Now marker time

Definition at line 180 of file qwrk.cpp.

bool getPatchSearch ( ) const

Patch/controller search-back?

Returns:
Patch/controller search-back

Definition at line 270 of file qwrk.cpp.

int getPlayDelay ( ) const

Play Delay.

Returns:
Play Delay

Definition at line 234 of file qwrk.cpp.

bool getPunchEnabled ( ) const

Auto-Punch enabled?

Returns:
Auto-Punch enabled

Definition at line 435 of file qwrk.cpp.

int getPunchInTime ( ) const

Punch-in time.

Returns:
punch-in time

Definition at line 444 of file qwrk.cpp.

int getPunchOutTime ( ) const

Punch-out time.

Returns:
Punch-out time

Definition at line 453 of file qwrk.cpp.

int getRewindTime ( ) const

Auto-rewind time.

Returns:
Auto-rewind time

Definition at line 306 of file qwrk.cpp.

bool getSendCont ( ) const

Send MIDI Continue?

Returns:
Send MIDI Continue

Definition at line 261 of file qwrk.cpp.

bool getSendSPP ( ) const

Send Song Position Pointer?

Returns:
Send Song Position Pointer

Definition at line 252 of file qwrk.cpp.

unsigned int getStopTime ( ) const

Auto-stop time.

Returns:
Auto-stop time

Definition at line 288 of file qwrk.cpp.

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

Returns:
tempo offset 1

Definition at line 388 of file qwrk.cpp.

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

Returns:
tempo offset 2

Definition at line 407 of file qwrk.cpp.

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

Returns:
tempo offset 3

Definition at line 426 of file qwrk.cpp.

QTextCodec * getTextCodec ( )

Gets the text codec used for text meta-events I/O.

Returns:
QTextCodec pointer

Definition at line 142 of file qwrk.cpp.

int getThru ( ) const

Thru marker time.

Returns:
Thru marker time

Definition at line 198 of file qwrk.cpp.

bool getThruOn ( ) const

MIDI Thru enabled? (only used if no THRU rec)

Returns:
MIDI Thru enabled

Definition at line 351 of file qwrk.cpp.

bool getZeroCtrls ( ) const

Zero continuous controllers?

Returns:
Zero continuous controllers

Definition at line 243 of file qwrk.cpp.

void readFromFile ( const QString &  fileName)

Reads a stream from a disk file.

Parameters:
fileNameName of an existing file.

Definition at line 643 of file qwrk.cpp.

References QWrk::readFromStream().

void readFromStream ( QDataStream *  stream)

Reads a stream.

Parameters:
streamPointer to an existing and opened stream

Definition at line 633 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.

Parameters:
codecQTextCodec pointer

Definition at line 153 of file qwrk.cpp.

void signalWRKChanPress ( int  track,
long  time,
int  chan,
int  press 
) [signal]

Emitted after reading a Channel Aftertouch message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
pressPressure amount
void signalWRKChord ( int  track,
long  time,
const QString &  name,
const QByteArray &  data 
) [signal]

Emitted after reading a chord diagram chunk.

Parameters:
tracktrack number
timeevent time in ticks
namechord name
datachord data definition (not decoded)
void signalWRKComments ( const QString &  data) [signal]

Emitted after reading a comments chunk.

Parameters:
datafile text comments
void signalWRKCtlChange ( int  track,
long  time,
int  chan,
int  ctl,
int  value 
) [signal]

Emitted after reading a Control Change message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
ctlMIDI Controller
valueControl value
void signalWRKError ( const QString &  errorStr) [signal]

Emitted for a WRK file read error.

Parameters:
errorStrError string
void signalWRKExpression ( int  track,
long  time,
int  code,
const QString &  text 
) [signal]

Emitted after reading an expression indication (notation) chunk.

Parameters:
tracktrack number
timeevent time in ticks
codeexpression event code
textexpression text
void signalWRKGlobalVars ( ) [signal]

Emitted after reading the global variables chunk.

This record contains miscellaneous Cakewalk global variables that can be retrieved using individual getters.

See also:
getNow(), getFrom(), getThru()
void signalWRKHairpin ( int  track,
long  time,
int  code,
int  dur 
) [signal]

Emitted after reading a hairpin symbol (notation) chunk.

Parameters:
tracktrack number
timeevent time in ticks
codehairpin code
durduration
void signalWRKHeader ( int  verh,
int  verl 
) [signal]

Emitted after reading a WRK header.

Parameters:
verhWRK file format version major
verlWRK file format version minor
void signalWRKKeyPress ( int  track,
long  time,
int  chan,
int  pitch,
int  press 
) [signal]

Emitted after reading a Polyphonic Aftertouch message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
pitchMIDI Note
pressPressure amount
void signalWRKKeySig ( int  bar,
int  alt 
) [signal]

Emitted after reading a WRK Key Signature.

Parameters:
barMeasure number
altNumber of alterations (negative=flats, positive=sharps)
void signalWRKNewTrack ( const QString &  name,
int  trackno,
int  channel,
int  pitch,
int  velocity,
int  port,
bool  selected,
bool  muted,
bool  loop 
) [signal]

Emitted after reading a new track prefix.

Parameters:
nametrack name
tracknotrack number
channelforced MIDI channel
pitchNote transposition
velocityVelocity increment
portMIDI port number
selectedtrack is selected
mutedtrack is muted
looptrack loop enabled
void signalWRKNote ( int  track,
long  time,
int  chan,
int  pitch,
int  vol,
int  dur 
) [signal]

Emitted after reading a Note message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
pitchMIDI Note
volVelocity
durDuration
void signalWRKPitchBend ( int  track,
long  time,
int  chan,
int  value 
) [signal]

Emitted after reading a Bender message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
valueBender value
void signalWRKProgram ( int  track,
long  time,
int  chan,
int  patch 
) [signal]

Emitted after reading a Program change message.

Parameters:
tracktrack number
timemusical time
chanMIDI Channel
patchProgram number
void signalWRKSegment ( int  track,
long  time,
const QString &  name 
) [signal]

Emitted after reading a segment prefix chunk.

Parameters:
tracktrack number
timesegment time offset
namesegment name
void signalWRKSoftVer ( const QString &  version) [signal]

Emitted after reading a software version chunk.

Parameters:
versionsoftware version string
void signalWRKStringTable ( const QStringList &  strs) [signal]

Emitted after reading a string event types chunk.

Parameters:
strslist of declared string event types
void signalWRKSysex ( int  bank,
const QString &  name,
bool  autosend,
int  port,
const QByteArray &  data 
) [signal]

Emitted after reading a System Exclusive Bank.

Parameters:
bankSysex Bank number
nameSysex Bank name
autosendSend automatically after loading the song
portMIDI output port
dataSysex bytes
void signalWRKSysexEvent ( int  track,
long  time,
int  bank 
) [signal]

Emitted after reading a System Exclusive event.

Parameters:
tracktrack number
timemusical time
bankSysex Bank number
void signalWRKTempo ( long  time,
int  tempo 
) [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.

Parameters:
timemusical time
tempobeats per minute multiplied by 100
void signalWRKText ( int  track,
long  time,
int  type,
const QString &  data 
) [signal]

Emitted after reading a text message.

Parameters:
tracktrack number
timemusical time
typeText type
dataText data
void signalWRKThru ( int  mode,
int  port,
int  channel,
int  keyPlus,
int  velPlus,
int  localPort 
) [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.

Parameters:
mode(auto, off, on)
portMIDI port
channelMIDI channel
keyPlusNote transpose
velPlusVelocity transpose
localPortMIDI local port
void signalWRKTimeBase ( int  timebase) [signal]

Emitted after reading the timebase chunk.

Parameters:
timebaseticks per quarter note
void signalWRKTimeFormat ( int  frames,
int  offset 
) [signal]

Emitted after reading a SMPTE time format chunk.

Parameters:
framesframes/sec (24, 25, 29=30-drop, 30)
offsetframes of offset
void signalWRKTimeSig ( int  bar,
int  num,
int  den 
) [signal]

Emitted after reading a WRK Time signature.

Parameters:
barMeasure number
numNumerator
denDenominator (exponent in a power of two)
void signalWRKTrack ( const QString &  name1,
const QString &  name2,
int  trackno,
int  channel,
int  pitch,
int  velocity,
int  port,
bool  selected,
bool  muted,
bool  loop 
) [signal]

Emitted after reading a track prefix chunk.

Parameters:
name1track 1st name
name2track 2nd name
tracknotrack number
channeltrack forced channel (-1=no forced)
pitchtrack pitch transpose in semitones (-127..127)
velocitytrack velocity increment (-127..127)
porttrack forced port
selectedtrue if track is selected
mutedtrue if track is muted
looptrue if loop is enabled
void signalWRKTrackBank ( int  track,
int  bank 
) [signal]

Emitted after reading a track bank chunk.

Parameters:
tracktrack number
bank
void signalWRKTrackName ( int  track,
const QString &  name 
) [signal]

Emitted after reading a track name chunk.

Parameters:
tracktrack number
nametrack name
void signalWRKTrackOffset ( int  track,
int  offset 
) [signal]

Emitted after reading a track offset chunk.

Parameters:
tracktrack number
offsettime offset
void signalWRKTrackPatch ( int  track,
int  patch 
) [signal]

Emitted after reading a track patch chunk.

Parameters:
tracktrack number
patch
void signalWRKTrackReps ( int  track,
int  reps 
) [signal]

Emitted after reading a track offset chunk.

Parameters:
tracktrack number
repsnumber of repetitions
void signalWRKTrackVol ( int  track,
int  vol 
) [signal]

Emitted after reading a track volume chunk.

Parameters:
tracktrack number
volinitial volume
void signalWRKUnknownChunk ( int  type,
const QByteArray &  data 
) [signal]

Emitted after reading an unknown chunk.

Parameters:
typechunk type
datachunk data (not decoded)
void signalWRKVariableRecord ( const QString &  name,
const QByteArray &  data 
) [signal]

Emitted after reading a variable chunk.

This record may contain data in text or binary format.

Parameters:
namerecord identifier
datarecord variable data

The documentation for this class was generated from the following files: