Canorus 0.0
Public Member Functions | Private Attributes | List of all members
CARtMidiDevice Class Reference

Canorus wrapper for RtMidi library CARtMidiDevice is a Canorus wrapper class for a cross-platform MIDI library RtMidi written by Gary P. Scavone (http://www.music.mcgill.ca/~gary/rtmidi/). More...

#include <rtmididevice.h>

Inheritance diagram for CARtMidiDevice:
Inheritance graph
[legend]

Public Member Functions

 CARtMidiDevice ()
 
virtual ~CARtMidiDevice ()
 
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 time, int event, int a, int b, int c)
 
- 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 Attributes

RtMidiOut_out
 
RtMidiIn_in
 
bool _outOpen
 
bool _inOpen
 
qint64 _pid
 
std::stringstream _midiNameIn
 
std::stringstream _midiNameOut
 

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 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 CAMidiDevice
void setRealTime (bool r)
 
void setMidiDeviceType (CAMidiDeviceType t)
 
- Protected Attributes inherited from CAMidiDevice
CAMidiDeviceType _midiDeviceType
 
bool _realTime
 

Detailed Description

Canorus wrapper for RtMidi library CARtMidiDevice is a Canorus wrapper class for a cross-platform MIDI library RtMidi written by Gary P. Scavone (http://www.music.mcgill.ca/~gary/rtmidi/).

Copyright (c) 2006, 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.

Usage: 1) When created, Input and Output MIDI devices get initialized. 2) Call getOutputPorts() and getInputPorts() to retreive a map of portNumber/portName. 3) Call openOutputPort(port) and/or openInputPort(port) to open an Output/Input port. 4) Send MIDI events (for midi output) using send(QVector<unsigned char>).

Todo:
Callback function implementation for retreiving MIDI-IN events. This should probably be done by using Qt's signal-slot implementation. -Matevz

Constructor & Destructor Documentation

◆ CARtMidiDevice()

CARtMidiDevice::CARtMidiDevice ( )

◆ ~CARtMidiDevice()

CARtMidiDevice::~CARtMidiDevice ( )
virtual

References _in, _out, closeInputPort(), and closeOutputPort().

Here is the call graph for this function:

Member Function Documentation

◆ closeInputPort()

void CARtMidiDevice::closeInputPort ( )
virtual

Implements CAMidiDevice.

References _in, _inOpen, RtMidiIn::cancelCallback(), RtMidiIn::closePort(), and RtError::printMessage().

Referenced by ~CARtMidiDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeOutputPort()

void CARtMidiDevice::closeOutputPort ( )
virtual

Implements CAMidiDevice.

References _out, _outOpen, RtMidiOut::closePort(), and RtError::printMessage().

Referenced by ~CARtMidiDevice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInputPorts()

QMap< int, QString > CARtMidiDevice::getInputPorts ( )
virtual

Implements CAMidiDevice.

References _in, RtMidiIn::getPortCount(), RtMidiIn::getPortName(), and RtError::printMessage().

Here is the call graph for this function:

◆ getOutputPorts()

QMap< int, QString > CARtMidiDevice::getOutputPorts ( )
virtual

Implements CAMidiDevice.

References _out, RtMidiOut::getPortCount(), RtMidiOut::getPortName(), and RtError::printMessage().

Here is the call graph for this function:

◆ openInputPort()

bool CARtMidiDevice::openInputPort ( int  port)
virtual

◆ openOutputPort()

bool CARtMidiDevice::openOutputPort ( int  port)
virtual

Implements CAMidiDevice.

References _out, _outOpen, RtMidiOut::getPortCount(), RtMidiOut::openPort(), and RtError::printMessage().

Here is the call graph for this function:

◆ send()

void CARtMidiDevice::send ( QVector< unsigned char >  message,
int  time 
)
virtual

Sends the given message to the midi device. offset is ignored because CARtMidiDevice is a realtime device.

Implements CAMidiDevice.

References _out, _outOpen, and RtMidiOut::sendMessage().

Here is the call graph for this function:

◆ sendMetaEvent()

void CARtMidiDevice::sendMetaEvent ( int  time,
int  event,
int  a,
int  b,
int  c 
)
inlinevirtual

Implements CAMidiDevice.

Member Data Documentation

◆ _in

RtMidiIn* CARtMidiDevice::_in
private

◆ _inOpen

bool CARtMidiDevice::_inOpen
private

◆ _midiNameIn

std::stringstream CARtMidiDevice::_midiNameIn
private

Referenced by CARtMidiDevice().

◆ _midiNameOut

std::stringstream CARtMidiDevice::_midiNameOut
private

Referenced by CARtMidiDevice().

◆ _out

RtMidiOut* CARtMidiDevice::_out
private

◆ _outOpen

bool CARtMidiDevice::_outOpen
private

◆ _pid

qint64 CARtMidiDevice::_pid
private

Referenced by CARtMidiDevice().


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