|
Canorus 0.0
|
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 | sendMetaEvent (int timeLength, int event, int a, int b, int c) |
| void | writeFile () |
Public Member Functions inherited from CAExport | |
| CAExport (QTextStream *stream=0) | |
| virtual | ~CAExport () |
| virtual const QString | readableStatus () |
| void | exportDocument (CADocument *, bool bStartThread=true) |
| void | exportSheet (CASheet *) |
| void | exportStaff (CAStaff *) |
| void | exportVoice (CAVoice *) |
| void | exportLyricsContext (CALyricsContext *) |
| void | exportFunctionMarkContext (CAFunctionMarkContext *) |
| CADocument * | exportedDocument () |
| CASheet * | exportedSheet () |
| CAStaff * | exportedStaff () |
| CAVoice * | exportedVoice () |
| CALyricsContext * | exportedLyricsContext () |
| CAFunctionMarkContext * | exportedFunctionMarkContext () |
| virtual void | setStreamToFile (const QString filename) |
| bool | wait (unsigned long time=ULONG_MAX) |
Public Member Functions inherited from CAFile | |
| CAFile () | |
| virtual | ~CAFile () |
| const int | status () |
| const int | progress () |
| virtual const QString | readableStatus ()=0 |
| void | setStreamFromFile (const QString filename) |
| void | setStreamToFile (const QString filename) |
| void | setStreamFromDevice (QIODevice *device) |
| void | setStreamToDevice (QIODevice *device) |
| void | setStreamToString () |
| QString | getStreamAsString () |
Public Member Functions inherited from CAMidiDevice | |
| CAMidiDevice () | |
| virtual | ~CAMidiDevice () |
| CAMidiDeviceType | midiDeviceType () |
| bool | isRealTime () |
| virtual QMap< int, QString > | getOutputPorts ()=0 |
| virtual QMap< int, QString > | getInputPorts ()=0 |
| virtual bool | openOutputPort (int port)=0 |
| virtual bool | openInputPort (int port)=0 |
| virtual void | closeOutputPort ()=0 |
| virtual void | closeInputPort ()=0 |
| virtual void | send (QVector< unsigned char > message, int time)=0 |
| virtual void | sendMetaEvent (int time, int event, int a, int b, int c)=0 |
Private Member Functions | |
| QByteArray | writeTime (int time) |
| void | exportDocumentImpl (CADocument *doc) |
| void | exportSheetImpl (CASheet *sheet) |
| int | timeIncrement (int time) |
| void | streamQByteArray (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 |
| QMap< int, QString > | m_InputPorts |
| QMap< int, QString > | m_OutputPorts |
Additional Inherited Members | |
Public Types inherited from CAMidiDevice | |
| enum | CAMidiDeviceType { RtMidiDevice , MidiExportDevice } |
| enum | midiCommands { Meta_Text = 0x01 , Meta_Copyright = 0x02 , Meta_SeqTrkName = 0x03 , Meta_InstrName = 0x04 , Meta_Lyric = 0x05 , Meta_Marker = 0x06 , Meta_CuePoint = 0x07 , Meta_Tempo = 0x51 , Meta_SMPTEOffs = 0x54 , Meta_Timesig = 0x58 , Meta_Keysig = 0x59 , Meta_Track_End = 0x2f , Midi_Ctl_Reverb = 0x5b , Midi_Ctl_Chorus = 0x5d , Midi_Ctl_Pan = 0x0a , Midi_Ctl_Volume = 0x07 , Midi_Ctl_Sustain = 0x40 , Midi_Ctl_Event = 0xff , Midi_Note_Off = 0x80 , Midi_Note_On = 0x90 , Midi_Prog_Change = 0xc0 , Midi_Control_Chg = 0xb0 } |
Signals inherited from CAExport | |
| void | documentExported (CADocument *) |
| void | sheetExported (CASheet *) |
| void | staffExported (CAStaff *) |
| void | voiceExported (CAVoice *) |
| void | lyricsContextExported (CALyricsContext *) |
| void | functionMarkContextExported (CAFunctionMarkContext *) |
| void | exportDone (int status) |
Signals inherited from CAMidiDevice | |
| void | midiInEvent (QVector< unsigned char > message) |
Static Public Member Functions inherited from CAMidiDevice | |
| static QStringList | gmInstrumentList () |
| static QString | instrumentName (int midiProgram) |
| static QStringList | instrumentNames () |
| static unsigned char | freeMidiChannel (CASheet *) |
Protected Member Functions inherited from CAExport | |
| virtual void | exportDocumentImpl (CADocument *) |
| virtual void | exportSheetImpl (CASheet *) |
| virtual void | exportStaffImpl (CAStaff *) |
| virtual void | exportVoiceImpl (CAVoice *) |
| virtual void | exportLyricsContextImpl (CALyricsContext *) |
| virtual void | exportFunctionMarkContextImpl (CAFunctionMarkContext *) |
| QTextStream & | out () |
| void | run () |
Protected Member Functions inherited from CAFile | |
| void | setStatus (const int status) |
| void | setProgress (const int progress) |
| QTextStream * | stream () |
| virtual void | setStream (QTextStream *stream) |
| QFile * | file () |
| void | setFile (QFile *file) |
Protected Member Functions inherited from CAMidiDevice | |
| void | setRealTime (bool r) |
| void | setMidiDeviceType (CAMidiDeviceType t) |
Protected Attributes inherited from CAMidiDevice | |
| CAMidiDeviceType | _midiDeviceType |
| bool | _realTime |
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.
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, _trackTime, CAMidiDevice::MidiExportDevice, and CAMidiDevice::setRealTime().

|
inlinevirtual |
Implements CAMidiDevice.
|
inlinevirtual |
Implements CAMidiDevice.
|
privatevirtual |
Exports the current document to Lilypond syntax as a complete .ly file.
Reimplemented from CAExport.
References CASheet::contextList(), CAContext::FiguredBassContext, CAContext::FunctionMarkContext, CAContext::LyricsContext, CAPlayback::run(), setCurSheet(), setCurVoice(), CADocument::sheetList(), CAContext::Staff, trackChunk, CAStaff::voiceList(), and writeFile().

|
privatevirtual |
Exports the current document to Lilypond syntax as a complete .ly file.
Reimplemented from CAExport.
References CASheet::contextList(), CAContext::FiguredBassContext, CAContext::FunctionMarkContext, CAContext::LyricsContext, CAPlayback::run(), setCurSheet(), setCurVoice(), CAContext::Staff, trackChunk, CAStaff::voiceList(), and writeFile().

|
inlinevirtual |
Implements CAMidiDevice.
References m_OutputPorts.
|
inlinevirtual |
Implements CAMidiDevice.
References m_InputPorts.
|
private |
|
inlinevirtual |
Implements CAMidiDevice.
|
inlinevirtual |
Implements CAMidiDevice.
|
virtual |
Implements CAMidiDevice.
References timeIncrement(), trackChunk, and writeTime().
Referenced by CAMidiRecorder::onMidiInEvent().


|
virtual |
Implements CAMidiDevice.
References CAMidiDevice::Meta_Keysig, CAMidiDevice::Meta_Tempo, CAMidiDevice::Meta_Timesig, CAMidiDevice::Midi_Ctl_Event, timeIncrement(), trackChunk, variableLengthValue(), and writeTime().
Referenced by CAMidiRecorder::startRecording().


|
private |
|
inlineprivate |
References _curSheet.
Referenced by exportDocumentImpl(), and exportSheetImpl().

|
inlineprivate |
References _curVoice.
Referenced by exportDocumentImpl(), and exportSheetImpl().

|
private |
References CAExport::out().
Referenced by writeFile().


|
private |
References META_TEXT, MIDI_CTL_EVENT, variableLengthValue(), and writeTime().
Referenced by writeFile().


|
private |
Compute the time offset for a new event and update the current track time.
References _trackTime.
Referenced by send(), and sendMetaEvent().

|
private |
|
private |
References META_TRACK_END, MIDI_CTL_EVENT, and writeTime().
Referenced by writeFile().


|
private |
|
private |
| void CAMidiExport::writeFile | ( | ) |
References CAPlayableLength::playableLengthToTimeLength(), CAPlayableLength::Quarter, setChunkLength(), streamQByteArray(), textEvent(), trackChunk, trackEnd(), and word16().
Referenced by exportDocumentImpl(), exportSheetImpl(), and CAMidiRecorder::stopRecording().


|
private |
Referenced by send(), sendMetaEvent(), textEvent(), and trackEnd().

|
private |
Referenced by setCurSheet().
|
private |
Referenced by setCurVoice().
|
private |
Referenced by CAMidiExport(), and timeIncrement().
|
private |
Referenced by getOutputPorts().
|
private |
Referenced by getInputPorts().
|
private |
|
private |
Referenced by exportDocumentImpl(), exportSheetImpl(), send(), sendMetaEvent(), and writeFile().
|
private |
|
private |