Logo Search packages:      
Sourcecode: canorus version File versions  Download package

CAMidiExport Class Reference

#include <midiexport.h>

Inheritance diagram for CAMidiExport:

CAExport CAMidiDevice CAFile

List of all members.


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.


Public Types

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

void documentExported (CADocument *)
void exportDone (int status)
void functionMarkContextExported (CAFunctionMarkContext *)
void lyricsContextExported (CALyricsContext *)
void midiInEvent (QVector< unsigned char > message)
void sheetExported (CASheet *)
void staffExported (CAStaff *)
void voiceExported (CAVoice *)

Public Member Functions

 CAMidiExport (QTextStream *out=0)
void closeInputPort ()
void closeOutputPort ()
void exportDocument (CADocument *, bool bStartThread=true)
CADocumentexportedDocument ()
CAFunctionMarkContextexportedFunctionMarkContext ()
CALyricsContextexportedLyricsContext ()
CASheetexportedSheet ()
CAStaffexportedStaff ()
CAVoiceexportedVoice ()
void exportFunctionMarkContext (CAFunctionMarkContext *)
void exportLyricsContext (CALyricsContext *)
void exportSheet (CASheet *)
void exportStaff (CAStaff *)
void exportVoice (CAVoice *)
QMap< int, QString > getInputPorts ()
QMap< int, QString > getOutputPorts ()
bool isRealTime ()
CAMidiDeviceType midiDeviceType ()
bool openInputPort (int port)
bool openOutputPort (int port)
const int progress ()
virtual const QString readableStatus ()
void send (QVector< unsigned char > message, int time)
void setStreamFromDevice (QIODevice *device)
void setStreamFromFile (const QString filename)
void setStreamToDevice (QIODevice *device)
virtual void setStreamToFile (const QString filename)
const int status ()
bool wait (unsigned long time=ULONG_MAX)
void writeFile ()

Static Public Member Functions

static int diatonicPitchToMidiPitch (CADiatonicPitch)
static unsigned char freeMidiChannel (CASheet *)
static CADiatonicPitch midiPitchToDiatonicPitch (int, CADiatonicKey k)
static CADiatonicPitch midiPitchToDiatonicPitch (int)

Public Attributes

QStringList GM_INSTRUMENTS

Protected Member Functions

virtual void exportFunctionMarkContextImpl (CAFunctionMarkContext *)
virtual void exportLyricsContextImpl (CALyricsContext *)
virtual void exportSheetImpl (CASheet *)
virtual void exportStaffImpl (CAStaff *)
virtual void exportVoiceImpl (CAVoice *)
QFile * file ()
QTextStream & out ()
void run ()
void setFile (QFile *file)
void setMidiDeviceType (CAMidiDeviceType t)
void setProgress (const int progress)
void setRealTime (bool r)
void setStatus (const int status)
virtual void setStream (QTextStream *stream)
QTextStream * stream ()

Protected Attributes

CAMidiDeviceType _midiDeviceType
bool _realTime

Private Member Functions

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

Private Attributes

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

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

Generated by  Doxygen 1.6.0   Back to index