|
Canorus
0.7
|
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>

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) |
| void | writeFile () |
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, QString 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 |
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.
| 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.
References CAMidiDevice::_midiDeviceType, CAMidiDevice::MidiExportDevice, CAMidiDevice::setRealTime(), and trackTime.

| void CAMidiExport::closeInputPort | ( | ) | [inline, virtual] |
Implements CAMidiDevice.
| void CAMidiExport::closeOutputPort | ( | ) | [inline, virtual] |
Implements CAMidiDevice.
| void CAMidiExport::exportDocumentImpl | ( | CADocument * | doc | ) | [private, virtual] |
Exports the current document to Lilypond syntax as a complete .ly file.
Reimplemented from CAExport.
References CASheet::contextAt(), CASheet::contextCount(), CAContext::contextType(), CAPlayback::run(), setCurSheet(), setCurVoice(), CADocument::sheetAt(), CADocument::sheetCount(), CAContext::Staff, trackChunk, CAStaff::voiceAt(), CAStaff::voiceCount(), and writeFile().

| QMap<int, QString> CAMidiExport::getInputPorts | ( | ) | [inline, virtual] |
Implements CAMidiDevice.
| QMap<int, QString> CAMidiExport::getOutputPorts | ( | ) | [inline, virtual] |
Implements CAMidiDevice.
| QByteArray CAMidiExport::keySignature | ( | void | ) | [private] |
References META_KEYSIG, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().
Referenced by writeFile().


| bool CAMidiExport::openInputPort | ( | int | port | ) | [inline, virtual] |
Implements CAMidiDevice.
| bool CAMidiExport::openOutputPort | ( | int | port | ) | [inline, virtual] |
Implements CAMidiDevice.
| void CAMidiExport::printQByteArray | ( | QByteArray | x | ) | [private] |
| void CAMidiExport::send | ( | QVector< unsigned char > | message, |
| int | time | ||
| ) | [virtual] |
Implements CAMidiDevice.
References trackChunk, trackTime, and writeTime().
Referenced by CAMidiRecorder::onMidiInEvent().


| void CAMidiExport::setChunkLength | ( | QByteArray * | x | ) | [private] |
| void CAMidiExport::setCurSheet | ( | CASheet * | sheet | ) | [inline, private] |
References _curSheet.
Referenced by exportDocumentImpl().

| void CAMidiExport::setCurVoice | ( | CAVoice * | voice | ) | [inline, private] |
References _curVoice.
Referenced by exportDocumentImpl().

| QByteArray CAMidiExport::textEvent | ( | int | time, |
| QString | s | ||
| ) | [private] |
References META_TEXT, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().
Referenced by writeFile().


| QByteArray CAMidiExport::timeSignature | ( | void | ) | [private] |
References META_TIMESIG, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().
Referenced by writeFile().


| QByteArray CAMidiExport::trackEnd | ( | void | ) | [private] |
References META_TRACK_END, MIDI_CTL_EVENT, and writeTime().
Referenced by writeFile().


| QByteArray CAMidiExport::variableLengthValue | ( | int | value | ) | [private] |
Referenced by keySignature(), textEvent(), and timeSignature().

| QByteArray CAMidiExport::word16 | ( | int | x | ) | [private] |
| void CAMidiExport::writeFile | ( | ) |
References keySignature(), CAExport::out(), setChunkLength(), CAFile::stream(), textEvent(), timeSignature(), trackChunk, trackEnd(), and word16().
Referenced by exportDocumentImpl(), and CAMidiRecorder::stopRecording().


| QByteArray CAMidiExport::writeTime | ( | int | time | ) | [private] |
Referenced by keySignature(), send(), textEvent(), timeSignature(), and trackEnd().

CASheet* CAMidiExport::_curSheet [private] |
Referenced by setCurSheet().
CAVoice* CAMidiExport::_curVoice [private] |
Referenced by setCurVoice().
int CAMidiExport::midiTrackCount [private] |
QByteArray CAMidiExport::trackChunk [private] |
Referenced by exportDocumentImpl(), send(), and writeFile().
QVector<QByteArray> CAMidiExport::trackChunks [private] |
int CAMidiExport::trackTime [private] |
Referenced by CAMidiExport(), and send().
QVector<int> CAMidiExport::trackTimes [private] |
1.8.0