QWrk Class Reference

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

#include <qwrk.h>

Inheritance diagram for QWrk:
[legend]

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.
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.
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

void readFromStream ( QDataStream *  stream  ) 

Reads a stream.

Parameters:
stream Pointer to an existing and opened stream

Definition at line 633 of file qwrk.cpp.

Referenced by QWrk::readFromFile().

void readFromFile ( const QString &  fileName  ) 

Reads a stream from a disk file.

Parameters:
fileName Name of an existing file.

Definition at line 643 of file qwrk.cpp.

References QWrk::readFromStream().

QTextCodec * getTextCodec (  ) 

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

Returns:
QTextCodec pointer

Definition at line 142 of file qwrk.cpp.

void setTextCodec ( QTextCodec *  codec  ) 

Sets the text codec for text meta-events.

The engine doesn't take ownership of the codec instance.

Parameters:
codec QTextCodec pointer

Definition at line 153 of file qwrk.cpp.

long getFilePos (  ) 

Current position in the data stream.

Returns:
current position

Definition at line 596 of file qwrk.cpp.

int getNow (  )  const

Now marker time.

Returns:
Now marker time

Definition at line 180 of file qwrk.cpp.

int getFrom (  )  const

From marker time.

Returns:
From marker time

Definition at line 189 of file qwrk.cpp.

int getThru (  )  const

Thru marker time.

Returns:
Thru marker time

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

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 getAutoSave (  )  const

Auto save (0=disabled, 1.

.256=minutes)

Returns:
Auto save

Definition at line 225 of file qwrk.cpp.

int getPlayDelay (  )  const

Play Delay.

Returns:
Play Delay

Definition at line 234 of file qwrk.cpp.

bool getZeroCtrls (  )  const

Zero continuous controllers?

Returns:
Zero continuous controllers

Definition at line 243 of file qwrk.cpp.

bool getSendSPP (  )  const

Send Song Position Pointer?

Returns:
Send Song Position Pointer

Definition at line 252 of file qwrk.cpp.

bool getSendCont (  )  const

Send MIDI Continue?

Returns:
Send MIDI Continue

Definition at line 261 of file qwrk.cpp.

bool getPatchSearch (  )  const

Patch/controller search-back?

Returns:
Patch/controller search-back

Definition at line 270 of file qwrk.cpp.

bool getAutoStop (  )  const

Auto-stop?

Returns:
Auto-stop

Definition at line 279 of file qwrk.cpp.

unsigned int getStopTime (  )  const

Auto-stop time.

Returns:
Auto-stop time

Definition at line 288 of file qwrk.cpp.

bool getAutoRewind (  )  const

Auto-rewind?

Returns:
Auto-rewind

Definition at line 297 of file qwrk.cpp.

int getRewindTime (  )  const

Auto-rewind time.

Returns:
Auto-rewind time

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

bool getMetroAccent (  )  const

Metronome accents primary beats?

Returns:
Metronome accents primary beats

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

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 getAutoRestart (  )  const

Auto-restart?

Returns:
Auto-restart

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

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 getEndAllTime (  )  const

Time of latest event (incl.

all tracks)

Returns:
Time of latest event

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

void signalWRKError ( const QString &  errorStr  )  [signal]

Emitted for a WRK file read error.

Parameters:
errorStr Error string

void signalWRKUnknownChunk ( int  type,
const QByteArray &  data 
) [signal]

Emitted after reading an unknown chunk.

Parameters:
type chunk type
data chunk data (not decoded)

void signalWRKHeader ( int  verh,
int  verl 
) [signal]

Emitted after reading a WRK header.

Parameters:
verh WRK file format version major
verl WRK file format version minor

void signalWRKNote ( int  track,
long  time,
int  chan,
int  pitch,
int  vol,
int  dur 
) [signal]

Emitted after reading a Note message.

Parameters:
track track number
time musical time
chan MIDI Channel
pitch MIDI Note
vol Velocity
dur Duration

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

Emitted after reading a Polyphonic Aftertouch message.

Parameters:
track track number
time musical time
chan MIDI Channel
pitch MIDI Note
press Pressure amount

void signalWRKCtlChange ( int  track,
long  time,
int  chan,
int  ctl,
int  value 
) [signal]

Emitted after reading a Control Change message.

Parameters:
track track number
time musical time
chan MIDI Channel
ctl MIDI Controller
value Control value

void signalWRKPitchBend ( int  track,
long  time,
int  chan,
int  value 
) [signal]

Emitted after reading a Bender message.

Parameters:
track track number
time musical time
chan MIDI Channel
value Bender value

void signalWRKProgram ( int  track,
long  time,
int  chan,
int  patch 
) [signal]

Emitted after reading a Program change message.

Parameters:
track track number
time musical time
chan MIDI Channel
patch Program number

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

Emitted after reading a Channel Aftertouch message.

Parameters:
track track number
time musical time
chan MIDI Channel
press Pressure amount

void signalWRKSysexEvent ( int  track,
long  time,
int  bank 
) [signal]

Emitted after reading a System Exclusive event.

Parameters:
track track number
time musical time
bank Sysex Bank number

void signalWRKSysex ( int  bank,
const QString &  name,
bool  autosend,
int  port,
const QByteArray &  data 
) [signal]

Emitted after reading a System Exclusive Bank.

Parameters:
bank Sysex Bank number
name Sysex Bank name
autosend Send automatically after loading the song
port MIDI output port
data Sysex bytes

void signalWRKText ( int  track,
long  time,
int  type,
const QString &  data 
) [signal]

Emitted after reading a text message.

Parameters:
track track number
time musical time
type Text type
data Text data

void signalWRKTimeSig ( int  bar,
int  num,
int  den 
) [signal]

Emitted after reading a WRK Time signature.

Parameters:
bar Measure number
num Numerator
den Denominator (exponent in a power of two)

void signalWRKKeySig ( int  bar,
int  alt 
) [signal]

Emitted after reading a WRK Key Signature.

Parameters:
bar Measure number
alt Number of alterations (negative=flats, positive=sharps)

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:
time musical time
tempo beats per minute multiplied by 100

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:
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

void signalWRKTimeBase ( int  timebase  )  [signal]

Emitted after reading the timebase chunk.

Parameters:
timebase ticks per quarter note

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 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)
port MIDI port
channel MIDI channel
keyPlus Note transpose
velPlus Velocity transpose
localPort MIDI local port

void signalWRKTrackOffset ( int  track,
int  offset 
) [signal]

Emitted after reading a track offset chunk.

Parameters:
track track number
offset time offset

void signalWRKTrackReps ( int  track,
int  reps 
) [signal]

Emitted after reading a track offset chunk.

Parameters:
track track number
reps number of repetitions

void signalWRKTrackPatch ( int  track,
int  patch 
) [signal]

Emitted after reading a track patch chunk.

Parameters:
track track number
patch 

void signalWRKTrackBank ( int  track,
int  bank 
) [signal]

Emitted after reading a track bank chunk.

Parameters:
track track number
bank 

void signalWRKTimeFormat ( int  frames,
int  offset 
) [signal]

Emitted after reading a SMPTE time format chunk.

Parameters:
frames frames/sec (24, 25, 29=30-drop, 30)
offset frames of offset

void signalWRKComments ( const QString &  data  )  [signal]

Emitted after reading a comments chunk.

Parameters:
data file text comments

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:
name record identifier
data record variable data

void signalWRKTrackVol ( int  track,
int  vol 
) [signal]

Emitted after reading a track volume chunk.

Parameters:
track track number
vol initial volume

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:
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

void signalWRKSoftVer ( const QString &  version  )  [signal]

Emitted after reading a software version chunk.

Parameters:
version software version string

void signalWRKTrackName ( int  track,
const QString &  name 
) [signal]

Emitted after reading a track name chunk.

Parameters:
track track number
name track name

void signalWRKStringTable ( const QStringList &  strs  )  [signal]

Emitted after reading a string event types chunk.

Parameters:
strs list of declared string event types

void signalWRKSegment ( int  track,
long  time,
const QString &  name 
) [signal]

Emitted after reading a segment prefix chunk.

Parameters:
track track number
time segment time offset
name segment name

void signalWRKChord ( int  track,
long  time,
const QString &  name,
const QByteArray &  data 
) [signal]

Emitted after reading a chord diagram chunk.

Parameters:
track track number
time event time in ticks
name chord name
data chord data definition (not decoded)

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

Emitted after reading an expression indication (notation) chunk.

Parameters:
track track number
time event time in ticks
code expression event code
text expression text

void signalWRKHairpin ( int  track,
long  time,
int  code,
int  dur 
) [signal]

Emitted after reading a hairpin symbol (notation) chunk.

Parameters:
track track number
time event time in ticks
code hairpin code
dur duration


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

Generated on Sun Jan 6 20:27:02 2013 for drumstick by  doxygen 1.5.6