CAMidiExport Class Reference

Midi file export filter This class is used to export the document or parts of the document to a midi file. The most common use is to simply call one of the constructors. More...

#include <midiexport.h>

Inheritance diagram for CAMidiExport:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CAMidiExport (QTextStream *out=0)
QMap< int, QString > getOutputPorts ()
QMap< int, QString > getInputPorts ()
bool openOutputPort (int port)
bool openInputPort (int port)
void closeOutputPort ()
void closeInputPort ()
void send (QVector< unsigned char > message, int time)

Private Member Functions

QByteArray writeTime (int time)
void exportDocumentImpl (CADocument *doc)
void printQByteArray (QByteArray x)
QByteArray variableLengthValue (int value)
QByteArray word16 (int x)
QByteArray textEvent (int time, const char *s)
QByteArray trackEnd (void)
QByteArray timeSignature (void)
QByteArray keySignature (void)
void setChunkLength (QByteArray *x)
void setCurVoice (CAVoice *voice)
void setCurSheet (CASheet *sheet)

Private Attributes

int midiTrackCount
QByteArray trackChunk
int trackTime
QVector< QByteArray > trackChunks
QVector< int > trackTimes
CAVoice_curVoice
CASheet_curSheet


Detailed Description

Midi file export filter This class is used to export the document or parts of the document to a midi file. The most common use is to simply call one of the constructors.

Copyright (c) 2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.

Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.

        CAMidiExport( myDocument, &textStream );

textStream is usually the file stream.

See also:
CAMidiImport

Definition at line 32 of file midiexport.h.


Constructor & Destructor Documentation

CAMidiExport::CAMidiExport ( QTextStream *  out = 0  ) 

Constructor for midi file export. Called when choosing the mid/midi file extension in the export dialog. Exports all voices to the given text stream.

Definition at line 44 of file midiexport.cpp.

References CAMidiDevice::_midiDeviceType, CAMidiDevice::MidiExportDevice, CAMidiDevice::setRealTime(), and trackTime.

Here is the call graph for this function:


Member Function Documentation

QMap<int, QString> CAMidiExport::getOutputPorts (  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 41 of file midiexport.h.

QMap<int, QString> CAMidiExport::getInputPorts (  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 42 of file midiexport.h.

bool CAMidiExport::openOutputPort ( int  port  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 44 of file midiexport.h.

bool CAMidiExport::openInputPort ( int  port  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 45 of file midiexport.h.

void CAMidiExport::closeOutputPort (  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 46 of file midiexport.h.

void CAMidiExport::closeInputPort (  )  [inline, virtual]

Implements CAMidiDevice.

Definition at line 47 of file midiexport.h.

void CAMidiExport::send ( QVector< unsigned char >  message,
int  time 
) [virtual]

Implements CAMidiDevice.

Definition at line 51 of file midiexport.cpp.

References trackChunk, trackTime, and writeTime().

Here is the call graph for this function:

QByteArray CAMidiExport::writeTime ( int  time  )  [private]

Definition at line 124 of file midiexport.cpp.

Referenced by keySignature(), send(), textEvent(), timeSignature(), and trackEnd().

Here is the caller graph for this function:

void CAMidiExport::exportDocumentImpl ( CADocument doc  )  [private, virtual]

Exports the current document to Lilypond syntax as a complete .ly file.

Reimplemented from CAExport.

Definition at line 199 of file midiexport.cpp.

References CASheet::contextAt(), CASheet::contextCount(), CAContext::contextType(), keySignature(), CAExport::out(), CAPlayback::run(), setChunkLength(), setCurSheet(), setCurVoice(), CADocument::sheetAt(), CADocument::sheetCount(), CAContext::Staff, CAFile::stream(), textEvent(), timeSignature(), trackChunk, trackEnd(), CAStaff::voiceAt(), CAStaff::voiceCount(), and word16().

Here is the call graph for this function:

void CAMidiExport::printQByteArray ( QByteArray  x  )  [private]

Definition at line 278 of file midiexport.cpp.

QByteArray CAMidiExport::variableLengthValue ( int  value  )  [private]

Definition at line 97 of file midiexport.cpp.

Referenced by keySignature(), textEvent(), and timeSignature().

Here is the caller graph for this function:

QByteArray CAMidiExport::word16 ( int  x  )  [private]

Definition at line 88 of file midiexport.cpp.

Referenced by exportDocumentImpl().

Here is the caller graph for this function:

QByteArray CAMidiExport::textEvent ( int  time,
const char *  s 
) [private]

Definition at line 186 of file midiexport.cpp.

References META_TEXT, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().

Referenced by exportDocumentImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

QByteArray CAMidiExport::trackEnd ( void   )  [private]

Definition at line 176 of file midiexport.cpp.

References META_TRACK_END, MIDI_CTL_EVENT, and writeTime().

Referenced by exportDocumentImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

QByteArray CAMidiExport::timeSignature ( void   )  [private]

Definition at line 162 of file midiexport.cpp.

References META_TIMESIG, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().

Referenced by exportDocumentImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

QByteArray CAMidiExport::keySignature ( void   )  [private]

Definition at line 150 of file midiexport.cpp.

References META_KEYSIG, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().

Referenced by exportDocumentImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

void CAMidiExport::setChunkLength ( QByteArray *  x  )  [private]

Definition at line 270 of file midiexport.cpp.

Referenced by exportDocumentImpl().

Here is the caller graph for this function:

void CAMidiExport::setCurVoice ( CAVoice voice  )  [inline, private]

Definition at line 84 of file midiexport.h.

References _curVoice.

Referenced by exportDocumentImpl().

Here is the caller graph for this function:

void CAMidiExport::setCurSheet ( CASheet sheet  )  [inline, private]

Definition at line 85 of file midiexport.h.

References _curSheet.

Referenced by exportDocumentImpl().

Here is the caller graph for this function:


Member Data Documentation

int CAMidiExport::midiTrackCount [private]

Definition at line 60 of file midiexport.h.

QByteArray CAMidiExport::trackChunk [private]

Definition at line 61 of file midiexport.h.

Referenced by exportDocumentImpl(), and send().

int CAMidiExport::trackTime [private]

Definition at line 62 of file midiexport.h.

Referenced by CAMidiExport(), and send().

QVector<QByteArray> CAMidiExport::trackChunks [private]

Definition at line 63 of file midiexport.h.

QVector<int> CAMidiExport::trackTimes [private]

Definition at line 64 of file midiexport.h.

CAVoice* CAMidiExport::_curVoice [private]

Definition at line 92 of file midiexport.h.

Referenced by setCurVoice().

CASheet* CAMidiExport::_curSheet [private]

Definition at line 93 of file midiexport.h.

Referenced by setCurSheet().


The documentation for this class was generated from the following files:
Generated on Sat Feb 9 13:17:58 2008 for Canorus by  doxygen 1.5.3