Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
Midi Class Reference

Class handling Midi input and output. More...

#include <midi.h>

Inheritance diagram for Midi:
Inheritance graph
Collaboration diagram for Midi:
Collaboration graph

Public Slots

void sendMidiMessage (const QMidiMessage &event)
 Send a Midi message to the output device. More...
 

Signals

void receivedMidiMessage (const QMidiMessage &event)
 
void onInputDevicesChanged (QVariant devices)
 
void onOutputDevicesChanged (QVariant devices)
 
void onCurrentInputDeviceChanged (QVariant device)
 
void onCurrentOutputDeviceChanged (QVariant device)
 
void onStatusChanged ()
 
void sendMidiEventToOutputDevice (const QMidiMessage &event)
 

Public Member Functions

 Midi ()
 Constructor without functionality. More...
 
 ~Midi ()
 
bool init (QObject *qml)
 Initialize the Midi wrapper and connect it with Qml. More...
 
void setVerbosity (int verbosity)
 Set the verbosity level of the class-specific messages. More...
 
int getVerbosity ()
 Get the actual verbosity level. More...
 

Private Slots

void selectInputDevice (QString deviceName)
 Select the input device from a given device name. More...
 
void selectOutputDevice (QString deviceName)
 Select the output device from a given device name. More...
 
void setAutomaticInputMode (bool autoconnect)
 Midi::setAutomaticInputMode. More...
 
void setAutomaticOutputMode (bool autoconnect)
 Set automatic output mode. More...
 
void inputDeviceAttached (const QMidiDeviceInfo info)
 Private slot: Input device attached. More...
 
void outputDeviceAttached (const QMidiDeviceInfo info)
 Private slot: Output device attached. More...
 
void inputDeviceDetached (const QMidiDeviceInfo info)
 Private slot: Input device detached. More...
 
void outputDeviceDetached (const QMidiDeviceInfo info)
 Private slot: Output device detached. More...
 
void inputDeviceCreated (const QMidiInput *device)
 Private slot: Input device created (connected) More...
 
void outputDeviceCreated (const QMidiOutput *device)
 Private slot: Output device created (connected) More...
 
void inputDeviceDeleted (QMidiDeviceInfo info)
 Private slot: Input device deleted (disconnected) More...
 
void outputDeviceDeleted (QMidiDeviceInfo info)
 Private slot: Output device deleted (disconnected) More...
 
void acInputDeviceCreated (const QMidiDevice *dev)
 Private slot: Automatically connected input device created. More...
 
void acOutputDeviceCreated (const QMidiDevice *dev)
 Private slot: Automatically connected output device created. More...
 
void acDeviceDeleted (const QMidiDeviceInfo info, QMidi::Mode mode)
 Private slot: Automatically connected device deleted (disconnected) More...
 
void receiveMessage (const QMidiMessage &m)
 Private slot: Receiving a Midi message from an external Midi device. More...
 

Private Member Functions

void disconnectInput ()
 Disconnect current input device. More...
 
void disconnectOutput ()
 Disconnect current output device. More...
 
void updateAvailableDevices (QMidi::Mode mode)
 Update the shown available devices. More...
 

Private Attributes

QMidiAutoConnector * pConnector
 
QMidiInput * pCurrentInputDevice
 
QMidiOutput * pCurrentOutputDevice
 

Detailed Description

Class handling Midi input and output.

Definition at line 39 of file midi.h.

Constructor & Destructor Documentation

Midi::Midi ( )
explicit

Constructor without functionality.

Definition at line 36 of file midi.cpp.

Here is the call graph for this function:

Midi::~Midi ( )
inline

Definition at line 44 of file midi.h.

Here is the call graph for this function:

Member Function Documentation

void Midi::acDeviceDeleted ( const QMidiDeviceInfo  info,
QMidi::Mode  mode 
)
privateslot

Private slot: Automatically connected device deleted (disconnected)

Parameters
info: QMidiDeviceInfo containing information about the deleted device
mode: Input or output mode

Definition at line 321 of file midi.cpp.

void Midi::acInputDeviceCreated ( const QMidiDevice *  dev)
privateslot

Private slot: Automatically connected input device created.

Parameters
dev: Pointer to the created device

Definition at line 284 of file midi.cpp.

Here is the call graph for this function:

void Midi::acOutputDeviceCreated ( const QMidiDevice *  dev)
privateslot

Private slot: Automatically connected output device created.

Parameters
dev: Pointer to the created device

Definition at line 302 of file midi.cpp.

void Midi::disconnectInput ( )
private

Disconnect current input device.

Definition at line 362 of file midi.cpp.

Here is the call graph for this function:

void Midi::disconnectOutput ( )
private

Disconnect current output device.

Definition at line 381 of file midi.cpp.

int Log::getVerbosity ( )
inherited

Get the actual verbosity level.

Returns
: Verbosity level (1...4)

Definition at line 118 of file log.cpp.

bool Midi::init ( QObject *  qml)

Initialize the Midi wrapper and connect it with Qml.

Parameters
qml: Pointer to qml root object
Returns
true

Definition at line 76 of file midi.cpp.

Here is the call graph for this function:

void Midi::inputDeviceAttached ( const QMidiDeviceInfo  info)
privateslot

Private slot: Input device attached.

Parameters
info: QMidiDeviceInfo holding information about the new device

Definition at line 152 of file midi.cpp.

Here is the call graph for this function:

void Midi::inputDeviceCreated ( const QMidiInput *  device)
privateslot

Private slot: Input device created (connected)

This slot is called when an input Midi device is connected.

Parameters
device: Pointer to the device

Definition at line 217 of file midi.cpp.

void Midi::inputDeviceDeleted ( QMidiDeviceInfo  info)
privateslot

Private slot: Input device deleted (disconnected)

This slot is called when an input Midi device is connected.

Parameters
info: Device invo

Definition at line 253 of file midi.cpp.

void Midi::inputDeviceDetached ( const QMidiDeviceInfo  info)
privateslot

Private slot: Input device detached.

Parameters
info: QMidiDeviceInfo holding information about the removed device

Definition at line 184 of file midi.cpp.

Here is the call graph for this function:

void Midi::onCurrentInputDeviceChanged ( QVariant  device)
signal
void Midi::onCurrentOutputDeviceChanged ( QVariant  device)
signal
void Midi::onInputDevicesChanged ( QVariant  devices)
signal
void Midi::onOutputDevicesChanged ( QVariant  devices)
signal
void Midi::onStatusChanged ( )
signal
void Midi::outputDeviceAttached ( const QMidiDeviceInfo  info)
privateslot

Private slot: Output device attached.

Parameters
info: QMidiDeviceInfo holding information about the new device

Definition at line 168 of file midi.cpp.

Here is the call graph for this function:

void Midi::outputDeviceCreated ( const QMidiOutput *  device)
privateslot

Private slot: Output device created (connected)

This slot is called when an output Midi device is connected.

Parameters
device: Pointer to the device

Definition at line 235 of file midi.cpp.

void Midi::outputDeviceDeleted ( QMidiDeviceInfo  info)
privateslot

Private slot: Output device deleted (disconnected)

This slot is called when an output Midi device is connected.

Parameters
info: Device information

Definition at line 269 of file midi.cpp.

void Midi::outputDeviceDetached ( const QMidiDeviceInfo  info)
privateslot

Private slot: Output device detached.

Parameters
info: QMidiDeviceInfo holding information about the removed device

Definition at line 200 of file midi.cpp.

Here is the call graph for this function:

void Midi::receivedMidiMessage ( const QMidiMessage &  event)
signal
void Midi::receiveMessage ( const QMidiMessage &  m)
privateslot

Private slot: Receiving a Midi message from an external Midi device.

Forwards the message to the corresponding signal. If the verbosity is sufficiently high the message is sent in hexadecimal numbers to qDebug()

Parameters
m: QMidiMessage that was received.

Definition at line 338 of file midi.cpp.

Here is the call graph for this function:

void Midi::selectInputDevice ( QString  deviceName)
privateslot

Select the input device from a given device name.

This function is needed for Qml. In contrast to ordinary widgets, where we can store the device info in the combo box as user data, the Qml combo boxes can only store a 'model' in form of a QStringList. This function selects the input device for a given deviceName.

Parameters
deviceName: String of the device name

Definition at line 405 of file midi.cpp.

Here is the call graph for this function:

void Midi::selectOutputDevice ( QString  deviceName)
privateslot

Select the output device from a given device name.

This function is needed for Qml. In contrast to ordinary widgets, where we can store the device info in the combo box as user data, the Qml combo boxes can only store a 'model' in form of a QStringList. This function selects the output device for a given deviceName.

Parameters
deviceName: String of the device name

Definition at line 439 of file midi.cpp.

Here is the call graph for this function:

void Midi::sendMidiEventToOutputDevice ( const QMidiMessage &  event)
signal
void Midi::sendMidiMessage ( const QMidiMessage &  event)
slot

Send a Midi message to the output device.

This function forwards a QMidiMessage to QMidi-Output. Moreover, if the verbosity is high, the hexadecimal numbers of the message will be sent to qDebug().

Parameters
event: qMidiMessage structure holding a Midi message

Definition at line 126 of file midi.cpp.

Here is the call graph for this function:

void Midi::setAutomaticInputMode ( bool  autoconnect)
privateslot

Midi::setAutomaticInputMode.

Parameters
autoconnect: true = automatic, false = manual

Definition at line 470 of file midi.cpp.

void Midi::setAutomaticOutputMode ( bool  autoconnect)
privateslot

Set automatic output mode.

Parameters
autoconnect: true = automatic, false = manual

Definition at line 485 of file midi.cpp.

void Log::setVerbosity ( int  verbosity)
inherited

Set the verbosity level of the class-specific messages.

Parameters
verbosity: Verbosity level (1...4)

Definition at line 107 of file log.cpp.

void Midi::updateAvailableDevices ( QMidi::Mode  mode)
private

Update the shown available devices.

Parameters
mode: Input or Output

Definition at line 500 of file midi.cpp.

Member Data Documentation

QMidiAutoConnector* Midi::pConnector
private

Definition at line 90 of file midi.h.

QMidiInput* Midi::pCurrentInputDevice
private

Definition at line 96 of file midi.h.

QMidiOutput* Midi::pCurrentOutputDevice
private

Definition at line 97 of file midi.h.


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