|
Canorus
0.7
|
Canorus<->Midi bridge. More...
#include <mididevice.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 | midiInEvent (QVector< unsigned char > message) |
Public Member Functions | |
| 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 mSeconds=0)=0 |
Static Public Member Functions | |
| static unsigned char | freeMidiChannel (CASheet *) |
| static int | diatonicPitchToMidiPitch (CADiatonicPitch) |
| static CADiatonicPitch | midiPitchToDiatonicPitch (int) |
| static CADiatonicPitch | midiPitchToDiatonicPitch (int, CADiatonicKey k) |
Public Attributes | |
| QStringList | GM_INSTRUMENTS |
Protected Member Functions | |
| void | setRealTime (bool r) |
| void | setMidiDeviceType (CAMidiDeviceType t) |
Protected Attributes | |
| CAMidiDeviceType | _midiDeviceType |
| bool | _realTime |
Friends | |
| void | rtMidiInCallback (double deltatime, std::vector< unsigned char > *message, void *userData) |
Canorus<->Midi bridge.
This class represents generic Midiinterface to Canorus. Any Midi wrapper class should extend this class.
Currently CARtMidi is one of the Midi libraries implemented. This class is an example of the so called real-time Midi classes. This means that the midi event will be heard at the moment it is sent.
Another example is CAMidiExport. This is a Midi file writer. The class is an example of the non-real-time Midi classes. It needs the offset in miliseconds to write the midi event to a file.
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 COPYING for details.
References GM_INSTRUMENTS.
| virtual CAMidiDevice::~CAMidiDevice | ( | ) | [inline, virtual] |
| virtual void CAMidiDevice::closeInputPort | ( | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CASettings::setMidiInPort().

| virtual void CAMidiDevice::closeOutputPort | ( | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CAMainWin::playbackFinished().

| int CAMidiDevice::diatonicPitchToMidiPitch | ( | CADiatonicPitch | pitch | ) | [static] |
Converts the given internal Canorus pitch with accidentals acc to standard unsigned 7-bit MIDI pitch.
References CADiatonicPitch::accs(), and CADiatonicPitch::noteName().
Referenced by midiPitchToDiatonicPitch(), CAPlayback::playSelectionImpl(), and CAPlayback::run().


| unsigned char CAMidiDevice::freeMidiChannel | ( | CASheet * | s | ) | [static] |
Returns the first midi channel that isn't occupied by voices in the given sheet s yet. Returns 0, if all the channels are occupied.
References CASheet::voiceList().
Referenced by CAVoice::CAVoice().


| virtual QMap<int, QString> CAMidiDevice::getInputPorts | ( | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CASettingsDialog::setupPages().

| virtual QMap<int, QString> CAMidiDevice::getOutputPorts | ( | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CASettingsDialog::setupPages().

| bool CAMidiDevice::isRealTime | ( | ) | [inline] |
References _realTime.
| CAMidiDeviceType CAMidiDevice::midiDeviceType | ( | ) | [inline] |
References _midiDeviceType.
| void CAMidiDevice::midiInEvent | ( | QVector< unsigned char > | message | ) | [signal] |
| CADiatonicPitch CAMidiDevice::midiPitchToDiatonicPitch | ( | int | midiPitch | ) | [static] |
Converts the given standard unsigned 7-bit MIDI pitch to internal Canorus pitch.
\sa _pitch, pitchToMidiPitch()
Referenced by CAKeybdInput::midiInEventToScore(), CAKeybdInput::onMidiInEvent(), and CAMidiImport::writeMidiChannelEventsToVoice().

| CADiatonicPitch CAMidiDevice::midiPitchToDiatonicPitch | ( | int | midiPitch, |
| CADiatonicKey | k | ||
| ) | [static] |
Converts the given standard unsigned 7-bit MIDI pitch to internal Canorus pitch dependent on the
diatonic key k.\sa _pitch, pitchToMidiPitch()
References CADiatonicPitch::accs(), diatonicPitchToMidiPitch(), CADiatonicPitch::noteName(), CADiatonicPitch::setAccs(), and CADiatonicPitch::setNoteName().

| virtual bool CAMidiDevice::openInputPort | ( | int | port | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CASettings::setMidiInPort().

| virtual bool CAMidiDevice::openOutputPort | ( | int | port | ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CAMainWin::on_uiPlayFromSelection_toggled(), and CAPlayback::playImmediately().

| virtual void CAMidiDevice::send | ( | QVector< unsigned char > | message, |
| int | mSeconds = 0 |
||
| ) | [pure virtual] |
Implemented in CAMidiExport, and CARtMidiDevice.
Referenced by CAPlayback::initStreams(), CAPlayback::playSelectionImpl(), and CAPlayback::run().

| void CAMidiDevice::setMidiDeviceType | ( | CAMidiDeviceType | t | ) | [inline, protected] |
References _midiDeviceType.
| void CAMidiDevice::setRealTime | ( | bool | r | ) | [inline, protected] |
References _realTime.
Referenced by CAMidiExport::CAMidiExport(), and CARtMidiDevice::CARtMidiDevice().

| void rtMidiInCallback | ( | double | deltatime, |
| std::vector< unsigned char > * | message, | ||
| void * | userData | ||
| ) | [friend] |
Callback function which gets called by RtMidi automatically when an information on MidiIn device has come.
Referenced by CARtMidiDevice::openInputPort().
CAMidiDeviceType CAMidiDevice::_midiDeviceType [protected] |
Referenced by CAMidiExport::CAMidiExport(), CARtMidiDevice::CARtMidiDevice(), midiDeviceType(), and setMidiDeviceType().
bool CAMidiDevice::_realTime [protected] |
Referenced by isRealTime(), and setRealTime().
Human names for General Midi Instruments.
Referenced by CAMidiDevice(), and CADrawableMark::draw().
1.8.0