| 1 |
/* |
| 2 |
* midisnoop - MIDI monitor and prober |
| 3 |
* Copyright (C) 2012 Devin Anderson |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify it |
| 6 |
* under the terms of the GNU General Public License as published by the Free |
| 7 |
* Software Foundation; either version 2 of the License, or (at your option) |
| 8 |
* any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
| 11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 |
* more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License along with |
| 16 |
* this program; if not, write to the Free Software Foundation, Inc., 675 Mass |
| 17 |
* Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <cassert> |
| 21 |
|
| 22 |
#include <QtCore/QDebug> |
| 23 |
|
| 24 |
#include "engine.h"cxx . . $ `<file>/src/engine.h`/ |
| 25 |
#include "error.h"cxx . . $ `<file>/src/error.h`/ |
| 26 |
|
| 27 |
// RtError was renamed to RtMidiError in rtmidi 2.1 |
| •28 |
typedef RtMidiErrorcxx . . $ RtMidiError# RtErrorcxx . . $ RtError#; |
| 29 |
|
| 30 |
#if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= 0x040700 |
| 31 |
#include <QtCore/QDateTime> |
| 32 |
#else |
| 33 |
#include <cerrno> |
| 34 |
#include <cstring> |
| 35 |
#include <sys/time.h> |
| 36 |
#endif |
| 37 |
|
| 38 |
// Static functions |
| 39 |
|
| 40 |
void |
| 41 |
Enginecxx . . $ Engine#::handleMidiInputcxx . . $ Engine#handleMidiInput(d6168d484d249804).(double timeStamp, stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned char> *message, |
| 42 |
void *engine) |
| 43 |
{ |
| 44 |
static_cast<Enginecxx . . $ Engine# *>(engine)->handleMidiInputcxx . . $ Engine#handleMidiInput(aaf76a23751cd870).(timeStamp, *message); |
| 45 |
} |
| 46 |
|
| 47 |
// Class definition |
| 48 |
|
| 49 |
Enginecxx . . $ Engine#::Enginecxx . . $ Engine#Engine(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent): |
| 50 |
QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 51 |
{ |
| 52 |
// Get available MIDI drivers. |
| 53 |
stdcxx . . $ std/::vectorcxx . . $ std/vector#<RtMidicxx . . $ RtMidi#::Apicxx . . $ RtMidi#Api#> apiscxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 54 |
RtMidicxx . . $ RtMidi#::getCompiledApicxx . . $ RtMidi#getCompiledApi(2f61c008fe23eeba).(apis); |
| 55 |
int apiCount = apis.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 56 |
|
| 57 |
for (int i = 0; i < apiCount; i++) { |
| 58 |
RtMidicxx . . $ RtMidi#::Apicxx . . $ RtMidi#Api# api = apis[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 59 |
switch (api) { |
| 60 |
case RtMidicxx . . $ RtMidi#::LINUX_ALSAcxx . . $ RtMidi#LINUX_ALSA.: |
| 61 |
driverNamescxx . . $ Engine#driverNames..appendcxx . . $ QList#append(77d9f17553126ecb).(trcxx . . $ Engine#tr(75d9f1c324b4579d).("ALSA Sequencer")); |
| 62 |
break; |
| 63 |
case RtMidicxx . . $ RtMidi#::MACOSX_COREcxx . . $ RtMidi#MACOSX_CORE.: |
| 64 |
driverNamescxx . . $ Engine#driverNames..appendcxx . . $ QList#append(77d9f17553126ecb).(trcxx . . $ Engine#tr(75d9f1c324b4579d).("CoreMidi")); |
| 65 |
break; |
| 66 |
case RtMidicxx . . $ RtMidi#::UNIX_JACKcxx . . $ RtMidi#UNIX_JACK.: |
| 67 |
driverNamescxx . . $ Engine#driverNames..appendcxx . . $ QList#append(77d9f17553126ecb).(trcxx . . $ Engine#tr(75d9f1c324b4579d).("JACK Audio Connection Kit")); |
| 68 |
break; |
| 69 |
case RtMidicxx . . $ RtMidi#::WINDOWS_MMcxx . . $ RtMidi#WINDOWS_MM.: |
| 70 |
driverNamescxx . . $ Engine#driverNames..appendcxx . . $ QList#append(77d9f17553126ecb).(trcxx . . $ Engine#tr(75d9f1c324b4579d).("Windows Multimedia MIDI")); |
| 71 |
break; |
| 72 |
default: |
| 73 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). trcxx . . $ Engine#tr(75d9f1c324b4579d).("Unexpected MIDI API constant: %1"). |
| 74 |
argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<int>(api)); |
| 75 |
// Fallthrough on purpose |
| 76 |
case RtMidicxx . . $ RtMidi#::RTMIDI_DUMMYcxx . . $ RtMidi#RTMIDI_DUMMY.: |
| 77 |
case RtMidicxx . . $ RtMidi#::UNSPECIFIEDcxx . . $ RtMidi#UNSPECIFIED.: |
| 78 |
continue; |
| 79 |
} |
| 80 |
driverAPIscxx . . $ Engine#driverAPIs..appendcxx . . $ QList#append(77d9f17553126ecb).(api); |
| 81 |
} |
| 82 |
|
| 83 |
drivercxx . . $ Engine#driver. = -1; |
| 84 |
ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents. = true; |
| 85 |
ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents. = true; |
| 86 |
ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents. = true; |
| 87 |
inputPortcxx . . $ Engine#inputPort. = -1; |
| 88 |
outputPortcxx . . $ Engine#outputPort. = -1; |
| 89 |
} |
| 90 |
|
| 91 |
Enginecxx . . $ Engine#::~cxx . . $ Engine#`~Engine`(ced63f7c635d850d).Enginecxx . . $ Engine#() |
| 92 |
{ |
| 93 |
setDrivercxx . . $ Engine#setDriver(d4f767463ce0a6b3).(-1); |
| 94 |
} |
| 95 |
|
| 96 |
int |
| 97 |
Enginecxx . . $ Engine#::getDrivercxx . . $ Engine#getDriver(455f465bc33b4cdf).() const |
| 98 |
{ |
| 99 |
return drivercxx . . $ Engine#driver.; |
| 100 |
} |
| 101 |
|
| 102 |
int |
| 103 |
Enginecxx . . $ Engine#::getDriverCountcxx . . $ Engine#getDriverCount(455f465bc33b4cdf).() const |
| 104 |
{ |
| 105 |
return driverAPIscxx . . $ Engine#driverAPIs..countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 106 |
} |
| 107 |
|
| 108 |
QStringcxx . . $ QString# |
| 109 |
Enginecxx . . $ Engine#::getDriverNamecxx . . $ Engine#getDriverName(3f3c3d0e9c0eb37f).(int index) const |
| 110 |
{ |
| 111 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= 0) && (index < driverAPIs.count())); |
| 112 |
return driverNamescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index]; |
| 113 |
} |
| 114 |
|
| 115 |
bool |
| 116 |
Enginecxx . . $ Engine#::getIgnoreActiveSensingEventscxx . . $ Engine#getIgnoreActiveSensingEvents(50ce9a9e25b4a850).() const |
| 117 |
{ |
| 118 |
return ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents.; |
| 119 |
} |
| 120 |
|
| 121 |
bool |
| 122 |
Enginecxx . . $ Engine#::getIgnoreSystemExclusiveEventscxx . . $ Engine#getIgnoreSystemExclusiveEvents(50ce9a9e25b4a850).() const |
| 123 |
{ |
| 124 |
return ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents.; |
| 125 |
} |
| 126 |
|
| 127 |
bool |
| 128 |
Enginecxx . . $ Engine#::getIgnoreTimeEventscxx . . $ Engine#getIgnoreTimeEvents(50ce9a9e25b4a850).() const |
| 129 |
{ |
| 130 |
return ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents.; |
| 131 |
} |
| 132 |
|
| 133 |
int |
| 134 |
Enginecxx . . $ Engine#::getInputPortcxx . . $ Engine#getInputPort(455f465bc33b4cdf).() const |
| 135 |
{ |
| 136 |
return inputPortcxx . . $ Engine#inputPort.; |
| 137 |
} |
| 138 |
|
| 139 |
int |
| 140 |
Enginecxx . . $ Engine#::getInputPortCountcxx . . $ Engine#getInputPortCount(455f465bc33b4cdf).() const |
| 141 |
{ |
| 142 |
return inputPortNamescxx . . $ Engine#inputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 143 |
} |
| 144 |
|
| 145 |
QStringcxx . . $ QString# |
| 146 |
Enginecxx . . $ Engine#::getInputPortNamecxx . . $ Engine#getInputPortName(3f3c3d0e9c0eb37f).(int index) const |
| 147 |
{ |
| 148 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= 0) && (index < inputPortNames.count())); |
| 149 |
return inputPortNamescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index]; |
| 150 |
} |
| 151 |
|
| 152 |
int |
| 153 |
Enginecxx . . $ Engine#::getOutputPortcxx . . $ Engine#getOutputPort(455f465bc33b4cdf).() const |
| 154 |
{ |
| 155 |
return outputPortcxx . . $ Engine#outputPort.; |
| 156 |
} |
| 157 |
|
| 158 |
int |
| 159 |
Enginecxx . . $ Engine#::getOutputPortCountcxx . . $ Engine#getOutputPortCount(455f465bc33b4cdf).() const |
| 160 |
{ |
| 161 |
return outputPortNamescxx . . $ Engine#outputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 162 |
} |
| 163 |
|
| 164 |
QStringcxx . . $ QString# |
| 165 |
Enginecxx . . $ Engine#::getOutputPortNamecxx . . $ Engine#getOutputPortName(3f3c3d0e9c0eb37f).(int index) const |
| 166 |
{ |
| 167 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= 0) && (index < outputPortNames.count())); |
| 168 |
return outputPortNamescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).index]; |
| 169 |
} |
| 170 |
|
| 171 |
quint64cxx . . $ quint64# |
| 172 |
Enginecxx . . $ Engine#::getCurrentTimestampcxx . . $ Engine#getCurrentTimestamp(1c5fc1fd41a99ae7).() const |
| 173 |
{ |
| 174 |
|
| 175 |
#if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= 0x040700 |
| 176 |
return QDateTimecxx . . $ QDateTime#::currentDateTimecxx . . $ QDateTime#currentDateTime(bf5129c8228c71c0).().toMSecsSinceEpochcxx . . $ QDateTime#toMSecsSinceEpoch(98833e9ab7de59a4).(); |
| 177 |
#else |
| 178 |
struct timeval time; |
| 179 |
if (gettimeofday(&time, 0) == -1) { |
| 180 |
throw Error(tr("failed to get time of day: %1").arg(strerror(errno))); |
| 181 |
} |
| 182 |
return (static_cast<quint64>(time.tv_sec) * 1000) + |
| 183 |
(static_cast<quint64>(time.tv_usec) / 1000); |
| 184 |
#endif |
| 185 |
|
| 186 |
} |
| 187 |
|
| 188 |
void |
| 189 |
Enginecxx . . $ Engine#::handleMidiInputcxx . . $ Engine#handleMidiInput(aaf76a23751cd870).(double /*timeStamp*/, |
| 190 |
const stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned char> &message) |
| 191 |
{ |
| 192 |
switch (message[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]) { |
| 193 |
case 0xf0: |
| 194 |
if (ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents.) { |
| 195 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "RtMidi did not filter system exclusive event"; |
| 196 |
return; |
| 197 |
} |
| 198 |
break; |
| 199 |
case 0xf1: |
| 200 |
case 0xf8: |
| 201 |
case 0xf9: |
| 202 |
if (ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents.) { |
| 203 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "RtMidi did not filter time event"; |
| 204 |
return; |
| 205 |
} |
| 206 |
break; |
| 207 |
case 0xfe: |
| 208 |
if (ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents.) { |
| 209 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "RtMidi did not filter active sensing event"; |
| 210 |
return; |
| 211 |
} |
| 212 |
} |
| 213 |
quint64cxx . . $ quint64# timeStamp = getCurrentTimestampcxx . . $ Engine#getCurrentTimestamp(1c5fc1fd41a99ae7).(); |
| 214 |
QByteArraycxx . . $ QByteArray# msgcxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 215 |
int size = static_cast<int>(message.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()); |
| 216 |
for (int i = 0; i < size; i++) { |
| 217 |
msg.appendcxx . . $ QByteArray#append(1815c0e4073627df).(message[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).i]); |
| 218 |
} |
| 219 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! messageReceivedcxx . . $ Engine#messageReceived(a7e3eb4d802fd6a1).(timeStamp, msg); |
| 220 |
} |
| 221 |
|
| 222 |
void |
| 223 |
Enginecxx . . $ Engine#::removePortscxx . . $ Engine#removePorts(49f6e7a06ebc5aa8).() |
| 224 |
{ |
| 225 |
setInputPortcxx . . $ Engine#setInputPort(d4f767463ce0a6b3).(-1); |
| 226 |
setOutputPortcxx . . $ Engine#setOutputPort(d4f767463ce0a6b3).(-1); |
| 227 |
for (int i = inputPortNamescxx . . $ Engine#inputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1; i >= 0; i--) { |
| 228 |
inputPortNamescxx . . $ Engine#inputPortNames..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(i); |
| 229 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! inputPortRemovedcxx . . $ Engine#inputPortRemoved(d4f767463ce0a6b3).(i); |
| 230 |
} |
| 231 |
for (int i = outputPortNamescxx . . $ Engine#outputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1; i >= 0; i--) { |
| 232 |
outputPortNamescxx . . $ Engine#outputPortNames..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(i); |
| 233 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputPortRemovedcxx . . $ Engine#outputPortRemoved(d4f767463ce0a6b3).(i); |
| 234 |
} |
| 235 |
} |
| 236 |
|
| 237 |
quint64cxx . . $ quint64# |
| 238 |
Enginecxx . . $ Engine#::sendMessagecxx . . $ Engine#sendMessage(a0c38bcf9df53632).(const QByteArraycxx . . $ QByteArray# &message) |
| 239 |
{ |
| 240 |
assertcxx . . $ `/usr/include/assert.h:102:11`!(outputPort != -1); |
| 241 |
stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned char> msgcxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 242 |
for (int i = 0; i < message.countcxx . . $ QByteArray#count(455f465bc33b4cdf).(); i++) { |
| 243 |
msg.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(static_cast<unsigned char>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).i])); |
| 244 |
} |
| 245 |
try { |
| 246 |
outputcxx . . $ Engine#output.->sendMessagecxx . . $ RtMidiOut#sendMessage(21d329f57d31ed19).(&msg); |
| 247 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 248 |
throw Errorcxx . . $ Error#(ecxx . . $ QString#QString(85c52e162fed56f9)..whatcxx . . $ RtMidiError#what(ba32b354807b2b81).()); |
| 249 |
} |
| 250 |
return getCurrentTimestampcxx . . $ Engine#getCurrentTimestamp(1c5fc1fd41a99ae7).(); |
| 251 |
} |
| 252 |
|
| 253 |
void |
| 254 |
Enginecxx . . $ Engine#::setDrivercxx . . $ Engine#setDriver(d4f767463ce0a6b3).(int index) |
| 255 |
{ |
| 256 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= -1) && (index < driverAPIs.count())); |
| 257 |
if (drivercxx . . $ Engine#driver. != index) { |
| 258 |
|
| 259 |
// Close the currently open MIDI driver. |
| 260 |
if (drivercxx . . $ Engine#driver. != -1) { |
| 261 |
removePortscxx . . $ Engine#removePorts(49f6e7a06ebc5aa8).(); |
| 262 |
delete inputcxx . . $ Engine#input.; |
| 263 |
delete outputcxx . . $ Engine#output.; |
| 264 |
drivercxx . . $ Engine#driver. = -1; |
| 265 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! driverChangedcxx . . $ Engine#driverChanged(d4f767463ce0a6b3).(-1); |
| 266 |
} |
| 267 |
|
| 268 |
// Open the new driver. |
| 269 |
if (index != -1) { |
| 270 |
RtMidicxx . . $ RtMidi#::Apicxx . . $ RtMidi#Api# api = driverAPIscxx . . $ Engine#driverAPIs.[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).index]; |
| 271 |
try { |
| 272 |
inputcxx . . $ Engine#input. = new RtMidiIncxx . . $ RtMidiIn#(api, "midisnoop"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 273 |
QScopedPointercxx . . $ QScopedPointer#<RtMidiIncxx . . $ RtMidiIn#> inputPtrcxx . . $ QScopedPointer#QScopedPointer(6f97683fca3ece44).(inputcxx . . $ Engine#input.); |
| 274 |
outputcxx . . $ Engine#output. = new RtMidiOutcxx . . $ RtMidiOut#(api, "midisnoop"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 275 |
QScopedPointercxx . . $ QScopedPointer#<RtMidiOutcxx . . $ RtMidiOut#> outputPtrcxx . . $ QScopedPointer#QScopedPointer(6f97683fca3ece44).(outputcxx . . $ Engine#output.); |
| 276 |
inputcxx . . $ Engine#input.->setCallbackcxx . . $ RtMidiIn#setCallback(237824937f8b60d4).(handleMidiInputcxx . . $ Engine#handleMidiInput(d6168d484d249804)., this); |
| 277 |
|
| 278 |
// Add ports. |
| 279 |
try { |
| 280 |
unsigned int count = inputcxx . . $ Engine#input.->getPortCountcxx . . $ RtMidiIn#getPortCount(db52760e79bf9054).(); |
| 281 |
QStringcxx . . $ QString# namecxx . . $ QString#QString(ced63f7c635d850d).; |
| 282 |
for (unsigned int i = 0; i < count; i++) { |
| 283 |
name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(inputcxx . . $ Engine#input.->getPortNamecxx . . $ RtMidiIn#getPortName(8297fed3afd4179b).(i)); |
| 284 |
inputPortNamescxx . . $ Engine#inputPortNames..appendcxx . . $ QList#append(77d9f17553126ecb).(name); |
| 285 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! inputPortAddedcxx . . $ Engine#inputPortAdded(4b11a7293b4ed91c).(i, name); |
| 286 |
} |
| 287 |
count = outputcxx . . $ Engine#output.->getPortCountcxx . . $ RtMidiOut#getPortCount(db52760e79bf9054).(); |
| 288 |
for (unsigned int i = 0; i < count; i++) { |
| 289 |
name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(outputcxx . . $ Engine#output.->getPortNamecxx . . $ RtMidiOut#getPortName(8297fed3afd4179b).(i)); |
| 290 |
outputPortNamescxx . . $ Engine#outputPortNames..appendcxx . . $ QList#append(77d9f17553126ecb).(name); |
| 291 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputPortAddedcxx . . $ Engine#outputPortAdded(4b11a7293b4ed91c).(i, name); |
| 292 |
} |
| 293 |
|
| 294 |
// Add a virtual port to drivers that support virtual ports. |
| 295 |
switch (api) { |
| 296 |
case RtMidicxx . . $ RtMidi#::LINUX_ALSAcxx . . $ RtMidi#LINUX_ALSA.: |
| 297 |
case RtMidicxx . . $ RtMidi#::MACOSX_COREcxx . . $ RtMidi#MACOSX_CORE.: |
| 298 |
case RtMidicxx . . $ RtMidi#::UNIX_JACKcxx . . $ RtMidi#UNIX_JACK.: |
| 299 |
name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Engine#tr(75d9f1c324b4579d).("[virtual input]"); |
| 300 |
inputPortNamescxx . . $ Engine#inputPortNames..appendcxx . . $ QList#append(77d9f17553126ecb).(name); |
| 301 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! inputPortAddedcxx . . $ Engine#inputPortAdded(4b11a7293b4ed91c).(inputPortNamescxx . . $ Engine#inputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1, name); |
| 302 |
name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Engine#tr(75d9f1c324b4579d).("[virtual output]"); |
| 303 |
outputPortNamescxx . . $ Engine#outputPortNames..appendcxx . . $ QList#append(77d9f17553126ecb).(name); |
| 304 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputPortAddedcxx . . $ Engine#outputPortAdded(4b11a7293b4ed91c).(outputPortNamescxx . . $ Engine#outputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1, name); |
| 305 |
virtualPortsAddedcxx . . $ Engine#virtualPortsAdded. = true; |
| 306 |
break; |
| 307 |
default: |
| 308 |
virtualPortsAddedcxx . . $ Engine#virtualPortsAdded. = false; |
| 309 |
} |
| 310 |
} catch (...) { |
| 311 |
removePortscxx . . $ Engine#removePorts(49f6e7a06ebc5aa8).(); |
| 312 |
throw; |
| 313 |
} |
| 314 |
inputPtr.takecxx . . $ QScopedPointer#take(258ee1c9e0a18a5c).(); |
| 315 |
outputPtr.takecxx . . $ QScopedPointer#take(258ee1c9e0a18a5c).(); |
| 316 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 317 |
throw Errorcxx . . $ Error#(ecxx . . $ QString#QString(85c52e162fed56f9)..whatcxx . . $ RtMidiError#what(ba32b354807b2b81).()); |
| 318 |
} |
| 319 |
drivercxx . . $ Engine#driver. = index; |
| 320 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! driverChangedcxx . . $ Engine#driverChanged(d4f767463ce0a6b3).(index); |
| 321 |
} |
| 322 |
} |
| 323 |
} |
| 324 |
|
| 325 |
void |
| 326 |
Enginecxx . . $ Engine#::setIgnoreActiveSensingEventscxx . . $ Engine#setIgnoreActiveSensingEvents(b45ddcbc8423892c).(bool ignore) |
| 327 |
{ |
| 328 |
if (ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents. != ignore) { |
| 329 |
ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents. = ignore; |
| 330 |
updateEventFiltercxx . . $ Engine#updateEventFilter(49f6e7a06ebc5aa8).(); |
| 331 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! ignoreActiveSensingEventsChangedcxx . . $ Engine#ignoreActiveSensingEventsChanged(b45ddcbc8423892c).(ignore); |
| 332 |
} |
| 333 |
} |
| 334 |
|
| 335 |
void |
| 336 |
Enginecxx . . $ Engine#::setIgnoreSystemExclusiveEventscxx . . $ Engine#setIgnoreSystemExclusiveEvents(b45ddcbc8423892c).(bool ignore) |
| 337 |
{ |
| 338 |
if (ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents. != ignore) { |
| 339 |
ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents. = ignore; |
| 340 |
updateEventFiltercxx . . $ Engine#updateEventFilter(49f6e7a06ebc5aa8).(); |
| 341 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! ignoreSystemExclusiveEventsChangedcxx . . $ Engine#ignoreSystemExclusiveEventsChanged(b45ddcbc8423892c).(ignore); |
| 342 |
} |
| 343 |
} |
| 344 |
|
| 345 |
void |
| 346 |
Enginecxx . . $ Engine#::setIgnoreTimeEventscxx . . $ Engine#setIgnoreTimeEvents(b45ddcbc8423892c).(bool ignore) |
| 347 |
{ |
| 348 |
if (ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents. != ignore) { |
| 349 |
ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents. = ignore; |
| 350 |
updateEventFiltercxx . . $ Engine#updateEventFilter(49f6e7a06ebc5aa8).(); |
| 351 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! ignoreTimeEventsChangedcxx . . $ Engine#ignoreTimeEventsChanged(b45ddcbc8423892c).(ignore); |
| 352 |
} |
| 353 |
} |
| 354 |
|
| 355 |
void |
| 356 |
Enginecxx . . $ Engine#::setInputPortcxx . . $ Engine#setInputPort(d4f767463ce0a6b3).(int index) |
| 357 |
{ |
| 358 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= -1) && (index < inputPortNames.count())); |
| 359 |
if (inputPortcxx . . $ Engine#inputPort. != index) { |
| 360 |
|
| 361 |
// Close the currently open input port. |
| 362 |
if (inputPortcxx . . $ Engine#inputPort. != -1) { |
| 363 |
try { |
| 364 |
inputcxx . . $ Engine#input.->closePortcxx . . $ RtMidiIn#closePort(49f6e7a06ebc5aa8).(); |
| 365 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 366 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). e.whatcxx . . $ RtMidiError#what(ba32b354807b2b81).(); |
| 367 |
} |
| 368 |
inputPortcxx . . $ Engine#inputPort. = -1; |
| 369 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! inputPortChangedcxx . . $ Engine#inputPortChanged(d4f767463ce0a6b3).(-1); |
| 370 |
} |
| 371 |
|
| 372 |
// Open the new input port. |
| 373 |
if (index != -1) { |
| 374 |
try { |
| 375 |
if (virtualPortsAddedcxx . . $ Engine#virtualPortsAdded. && |
| 376 |
(index == (inputPortNamescxx . . $ Engine#inputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1))) { |
| 377 |
inputcxx . . $ Engine#input.->openVirtualPortcxx . . $ RtMidiIn#openVirtualPort(9c546c94e5fcce4e).("MIDI Input"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 378 |
} else { |
| 379 |
inputcxx . . $ Engine#input.->openPortcxx . . $ RtMidiIn#openPort(7cdd6fa636f85550).(index, "MIDI Input"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 380 |
} |
| 381 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 382 |
throw Errorcxx . . $ Error#(ecxx . . $ QString#QString(85c52e162fed56f9)..whatcxx . . $ RtMidiError#what(ba32b354807b2b81).()); |
| 383 |
} |
| 384 |
inputPortcxx . . $ Engine#inputPort. = index; |
| 385 |
updateEventFiltercxx . . $ Engine#updateEventFilter(49f6e7a06ebc5aa8).(); |
| 386 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! inputPortChangedcxx . . $ Engine#inputPortChanged(d4f767463ce0a6b3).(index); |
| 387 |
} |
| 388 |
} |
| 389 |
} |
| 390 |
|
| 391 |
void |
| 392 |
Enginecxx . . $ Engine#::setOutputPortcxx . . $ Engine#setOutputPort(d4f767463ce0a6b3).(int index) |
| 393 |
{ |
| 394 |
assertcxx . . $ `/usr/include/assert.h:102:11`!((index >= -1) && (index < outputPortNames.count())); |
| 395 |
if (outputPortcxx . . $ Engine#outputPort. != index) { |
| 396 |
|
| 397 |
// Close the currently open output port. |
| 398 |
if (outputPortcxx . . $ Engine#outputPort. != -1) { |
| 399 |
try { |
| 400 |
outputcxx . . $ Engine#output.->closePortcxx . . $ RtMidiOut#closePort(49f6e7a06ebc5aa8).(); |
| 401 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 402 |
qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). e.whatcxx . . $ RtMidiError#what(ba32b354807b2b81).(); |
| 403 |
} |
| 404 |
outputPortcxx . . $ Engine#outputPort. = -1; |
| 405 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputPortChangedcxx . . $ Engine#outputPortChanged(d4f767463ce0a6b3).(-1); |
| 406 |
} |
| 407 |
|
| 408 |
// Open the new output port. |
| 409 |
if (index != -1) { |
| 410 |
try { |
| 411 |
if (virtualPortsAddedcxx . . $ Engine#virtualPortsAdded. && |
| 412 |
(index == (outputPortNamescxx . . $ Engine#outputPortNames..countcxx . . $ QList#count(455f465bc33b4cdf).() - 1))) { |
| 413 |
outputcxx . . $ Engine#output.->openVirtualPortcxx . . $ RtMidiOut#openVirtualPort(9c546c94e5fcce4e).("MIDI Output"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 414 |
} else { |
| 415 |
outputcxx . . $ Engine#output.->openPortcxx . . $ RtMidiOut#openPort(7cdd6fa636f85550).(index, "MIDI Output"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 416 |
} |
| 417 |
} catch (RtErrorcxx . . $ RtError# &e) { |
| 418 |
throw Errorcxx . . $ Error#(ecxx . . $ QString#QString(85c52e162fed56f9)..whatcxx . . $ RtMidiError#what(ba32b354807b2b81).()); |
| 419 |
} |
| 420 |
outputPortcxx . . $ Engine#outputPort. = index; |
| 421 |
emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! outputPortChangedcxx . . $ Engine#outputPortChanged(d4f767463ce0a6b3).(index); |
| 422 |
} |
| 423 |
} |
| 424 |
} |
| 425 |
|
| 426 |
void |
| 427 |
Enginecxx . . $ Engine#::updateEventFiltercxx . . $ Engine#updateEventFilter(49f6e7a06ebc5aa8).() |
| 428 |
{ |
| 429 |
if (inputPortcxx . . $ Engine#inputPort. != -1) { |
| 430 |
inputcxx . . $ Engine#input.->ignoreTypescxx . . $ RtMidiIn#ignoreTypes(9e113dd3a0d25c95).(ignoreSystemExclusiveEventscxx . . $ Engine#ignoreSystemExclusiveEvents., ignoreTimeEventscxx . . $ Engine#ignoreTimeEvents., |
| 431 |
ignoreActiveSensingEventscxx . . $ Engine#ignoreActiveSensingEvents.); |
| 432 |
} |
| 433 |
} |