| 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 "controller.h"cxx . . $ `<file>/src/controller.h`/ |
| 25 | #include "error.h"cxx . . $ `<file>/src/error.h`/ |
| 26 | #include "util.h"cxx . . $ `<file>/src/util.h`/ |
| 27 | |
| 28 | // Static data |
| 29 | |
| 30 | const int statusLengthscxx . . $ statusLengths.[0x80] = { |
| 31 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 32 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 33 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 34 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 35 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 36 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 37 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 38 | 0, 2, 3, 2, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1 |
| 39 | }; |
| 40 | |
| 41 | // Class definition |
| 42 | |
| 43 | Controllercxx . . $ Controller#::Controllercxx . . $ Controller#Controller(35d70d227b7d2743).(Applicationcxx . . $ Application# &application, QObjectcxx . . $ QObject# *parent): |
| 44 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent), |
| 45 | applicationcxx . . $ Controller#application.(application) |
| 46 | { |
| 47 | // Setup about view |
| 48 | aboutViewcxx . . $ Controller#aboutView..setMajorVersioncxx . . $ AboutView#setMajorVersion(d4f767463ce0a6b3).(MIDISNOOP_MAJOR_VERSIONcxx . . $ `<built-in>:484:9`!); |
| 49 | aboutViewcxx . . $ Controller#aboutView..setMinorVersioncxx . . $ AboutView#setMinorVersion(d4f767463ce0a6b3).(MIDISNOOP_MINOR_VERSIONcxx . . $ `<built-in>:485:9`!); |
| 50 | aboutViewcxx . . $ Controller#aboutView..setRevisioncxx . . $ AboutView#setRevision(d4f767463ce0a6b3).(MIDISNOOP_REVISIONcxx . . $ `<built-in>:486:9`!); |
| 51 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&aboutViewcxx . . $ Controller#aboutView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(closeRequest()), |
| 52 | &aboutViewcxx . . $ Controller#aboutView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 53 | |
| 54 | // Setup configure view |
| 55 | int driverCount = enginecxx . . $ Controller#engine..getDriverCountcxx . . $ Engine#getDriverCount(455f465bc33b4cdf).(); |
| 56 | if (! driverCount) { |
| 57 | throw Errorcxx . . $ Error#(trcxx . . $ Controller#tr(75d9f1c324b4579d).("no MIDI drivers found")); |
| 58 | } |
| 59 | for (int i = 0; i < driverCount; i++) { |
| 60 | configureViewcxx . . $ Controller#configureView..addDrivercxx . . $ ConfigureView#addDriver(4b11a7293b4ed91c).(i, enginecxx . . $ Controller#engine..getDriverNamecxx . . $ Engine#getDriverName(3f3c3d0e9c0eb37f).(i)); |
| 61 | } |
| 62 | int driver = enginecxx . . $ Controller#engine..getDrivercxx . . $ Engine#getDriver(455f465bc33b4cdf).(); |
| 63 | int outputPort = enginecxx . . $ Controller#engine..getOutputPortcxx . . $ Engine#getOutputPort(455f465bc33b4cdf).(); |
| 64 | configureViewcxx . . $ Controller#configureView..setDrivercxx . . $ ConfigureView#setDriver(d4f767463ce0a6b3).(driver); |
| 65 | configureViewcxx . . $ Controller#configureView..setInputPortcxx . . $ ConfigureView#setInputPort(d4f767463ce0a6b3).(enginecxx . . $ Controller#engine..getInputPortcxx . . $ Engine#getInputPort(455f465bc33b4cdf).()); |
| 66 | configureViewcxx . . $ Controller#configureView..setIgnoreActiveSensingEventscxx . . $ ConfigureView#setIgnoreActiveSensingEvents(b45ddcbc8423892c). |
| 67 | (enginecxx . . $ Controller#engine..getIgnoreActiveSensingEventscxx . . $ Engine#getIgnoreActiveSensingEvents(50ce9a9e25b4a850).()); |
| 68 | configureViewcxx . . $ Controller#configureView..setIgnoreSystemExclusiveEventscxx . . $ ConfigureView#setIgnoreSystemExclusiveEvents(b45ddcbc8423892c). |
| 69 | (enginecxx . . $ Controller#engine..getIgnoreSystemExclusiveEventscxx . . $ Engine#getIgnoreSystemExclusiveEvents(50ce9a9e25b4a850).()); |
| 70 | configureViewcxx . . $ Controller#configureView..setIgnoreTimeEventscxx . . $ ConfigureView#setIgnoreTimeEvents(b45ddcbc8423892c).(enginecxx . . $ Controller#engine..getIgnoreTimeEventscxx . . $ Engine#getIgnoreTimeEvents(50ce9a9e25b4a850).()); |
| 71 | configureViewcxx . . $ Controller#configureView..setOutputPortcxx . . $ ConfigureView#setOutputPort(d4f767463ce0a6b3).(outputPort); |
| 72 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(closeRequest()), |
| 73 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 74 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(driverChangeRequest(int)), |
| 75 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setDriver(int))); |
| 76 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., |
| 77 | SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreActiveSensingEventsChangeRequest(bool)), |
| 78 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreActiveSensingEvents(bool))); |
| 79 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., |
| 80 | SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreSystemExclusiveEventsChangeRequest(bool)), |
| 81 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreSystemExclusiveEvents(bool))); |
| 82 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreTimeEventsChangeRequest(bool)), |
| 83 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreTimeEvents(bool))); |
| 84 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortChangeRequest(int)), |
| 85 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setInputPort(int))); |
| 86 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&configureViewcxx . . $ Controller#configureView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortChangeRequest(int)), |
| 87 | &enginecxx . . $ Controller#engine., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setOutputPort(int))); |
| 88 | |
| 89 | // Setup error view |
| 90 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&errorViewcxx . . $ Controller#errorView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(closeRequest()), |
| 91 | &errorViewcxx . . $ Controller#errorView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 92 | |
| 93 | // Setup main view |
| 94 | mainViewcxx . . $ Controller#mainView..setMessageSendEnabledcxx . . $ MainView#setMessageSendEnabled(b45ddcbc8423892c).((driver != -1) && (outputPort != -1)); |
| 95 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mainViewcxx . . $ Controller#mainView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(aboutRequest()), |
| 96 | &aboutViewcxx . . $ Controller#aboutView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(show())); |
| 97 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mainViewcxx . . $ Controller#mainView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(addMessageRequest()), |
| 98 | &messageViewcxx . . $ Controller#messageView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(show())); |
| 99 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mainViewcxx . . $ Controller#mainView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(clearMessagesRequest()), |
| 100 | &mainViewcxx . . $ Controller#mainView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(clearMessages())); |
| 101 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mainViewcxx . . $ Controller#mainView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(configureRequest()), |
| 102 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(show())); |
| 103 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&mainViewcxx . . $ Controller#mainView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(closeRequest()), |
| 104 | &application, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(quit())); |
| 105 | |
| 106 | // Setup message view |
| 107 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&messageViewcxx . . $ Controller#messageView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(closeRequest()), |
| 108 | &messageViewcxx . . $ Controller#messageView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 109 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&messageViewcxx . . $ Controller#messageView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendRequest(const QString &)), |
| 110 | &messageViewcxx . . $ Controller#messageView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(hide())); |
| 111 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(&messageViewcxx . . $ Controller#messageView., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendRequest(const QString &)), |
| 112 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleMessageSend(const QString &))); |
| 113 | |
| 114 | // Setup engine |
| 115 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(messageReceived(quint64, const QByteArray &)), |
| 116 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleReceivedMessage(quint64, const QByteArray &))); |
| 117 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(driverChanged(int)), |
| 118 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setDriver(int))); |
| 119 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(driverChanged(int)), |
| 120 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 121 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreActiveSensingEventsChanged(bool)), |
| 122 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreActiveSensingEvents(bool))); |
| 123 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreSystemExclusiveEventsChanged(bool)), |
| 124 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreSystemExclusiveEvents(bool))); |
| 125 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ignoreTimeEventsChanged(bool)), |
| 126 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setIgnoreTimeEvents(bool))); |
| 127 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortAdded(int, QString)), |
| 128 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(addInputPort(int, QString))); |
| 129 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortChanged(int)), |
| 130 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setInputPort(int))); |
| 131 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortChanged(int)), |
| 132 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 133 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortRemoved(int)), |
| 134 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(removeInputPort(int))); |
| 135 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortAdded(int, QString)), |
| 136 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(addOutputPort(int, QString))); |
| 137 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortChanged(int)), |
| 138 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setOutputPort(int))); |
| 139 | connectcxx . . $ QObject#connect(f4332061c7e4ca89).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortChanged(int)), |
| 140 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 141 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortRemoved(int)), |
| 142 | &configureViewcxx . . $ Controller#configureView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(removeOutputPort(int))); |
| 143 | |
| 144 | // Setup application |
| 145 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&application, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(eventError(QString)), |
| 146 | &errorViewcxx . . $ Controller#errorView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setMessage(QString))); |
| 147 | connectcxx . . $ QObject#connect(158df1d9a01a3410).(&application, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(eventError(QString)), |
| 148 | &errorViewcxx . . $ Controller#errorView., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(show())); |
| 149 | } |
| 150 | |
| 151 | Controllercxx . . $ Controller#::~cxx . . $ Controller#`~Controller`(ced63f7c635d850d).Controllercxx . . $ Controller#() |
| 152 | { |
| 153 | // Disconnect engine signals handled by the controller before the engine is |
| 154 | // deleted. |
| 155 | disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(messageReceived(quint64, const QByteArray &)), |
| 156 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleReceivedMessage(quint64, const QByteArray &))); |
| 157 | disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(driverChanged(int)), |
| 158 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 159 | disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(inputPortChanged(int)), |
| 160 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 161 | disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(&enginecxx . . $ Controller#engine., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(outputPortChanged(int)), |
| 162 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(handleDriverChange())); |
| 163 | } |
| 164 | |
| 165 | QStringcxx . . $ QString# |
| 166 | Controllercxx . . $ Controller#::getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(const QByteArraycxx . . $ QByteArray# &message, int lastIndex) |
| 167 | { |
| 168 | assertcxx . . $ `/usr/include/assert.h:102:11`!((lastIndex >= -1) && (lastIndex < message.count())); |
| 169 | if (lastIndex == -1) { |
| 170 | lastIndex = message.countcxx . . $ QByteArray#count(455f465bc33b4cdf).() - 1; |
| 171 | } |
| 172 | |
| 173 | QStringListcxx . . $ QStringList# dataPartscxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 174 | for (int i = 1; i <= lastIndex; i++) { |
| 175 | dataParts +=cxx . . $ QList#`operator+=`(309d1580d8f5dc58). QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1"). |
| 176 | argcxx . . $ QString#arg(173a29139b43af1f).(static_cast<uintcxx . . $ uint#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).i]), 2, 16, QCharcxx . . $ QChar#('0')); |
| 177 | } |
| 178 | dataParts +=cxx . . $ QList#`operator+=`(309d1580d8f5dc58). trcxx . . $ Controller#tr(75d9f1c324b4579d).("(%1 bytes)").argcxx . . $ QString#arg(64ab2ed17cc11715).(lastIndex); |
| 179 | return dataParts.joincxx . . $ QListSpecialMethods#join(5555d9024dcf93fb).(" "cxx . . $ QString#QString(85c52e162fed56f9).); |
| 180 | } |
| 181 | |
| 182 | void |
| 183 | Controllercxx . . $ Controller#::handleDriverChangecxx . . $ Controller#handleDriverChange(49f6e7a06ebc5aa8).() |
| 184 | { |
| 185 | mainViewcxx . . $ Controller#mainView..setMessageSendEnabledcxx . . $ MainView#setMessageSendEnabled(b45ddcbc8423892c).((enginecxx . . $ Controller#engine..getDrivercxx . . $ Engine#getDriver(455f465bc33b4cdf).() != -1) && |
| 186 | (enginecxx . . $ Controller#engine..getOutputPortcxx . . $ Engine#getOutputPort(455f465bc33b4cdf).() != -1)); |
| 187 | } |
| 188 | |
| 189 | void |
| 190 | Controllercxx . . $ Controller#::handleMessageSendcxx . . $ Controller#handleMessageSend(3520e46b33348bf6).(const QStringcxx . . $ QString# &message) |
| 191 | { |
| 192 | // Convert the message to bytes. |
| 193 | QStringListcxx . . $ QStringList# bytes = message.splitcxx . . $ QString#split(2ba03f79dd8e9c12).(' 'cxx . . $ QChar#QChar(f349c77f591a7878)., QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.); |
| 194 | int count = bytes.countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 195 | QByteArraycxx . . $ QByteArray# msgcxx . . $ QByteArray#QByteArray(ced63f7c635d850d).; |
| 196 | for (int i = 0; i < count; i++) { |
| 197 | QStringcxx . . $ QString# byteStr = bytescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i]; |
| 198 | bool success; |
| 199 | uintcxx . . $ uint# value = byteStr.toUIntcxx . . $ QString#toUInt(a0efe6e2edfc86a0).(&success, 16); |
| 200 | if ((! success) || (value > 0xff)) { |
| 201 | showErrorcxx . . $ Controller#showError(3520e46b33348bf6).(trcxx . . $ Controller#tr(75d9f1c324b4579d).("'%1' is not a valid hexadecimal MIDI byte"). |
| 202 | argcxx . . $ QString#arg(bc823072288cbbb5).(byteStr)); |
| 203 | return; |
| 204 | } |
| 205 | msg.appendcxx . . $ QByteArray#append(1815c0e4073627df).(static_cast<char>(static_cast<quint8cxx . . $ quint8#>(value))); |
| 206 | } |
| 207 | |
| 208 | // Make sure the bytes represent a valid MIDI message. |
| 209 | parseMessagecxx . . $ Controller#parseMessage(45672f3c6961a244).(msg); |
| 210 | if (! validcxx . . $ Controller#valid.) { |
| 211 | showErrorcxx . . $ Controller#showError(3520e46b33348bf6).(trcxx . . $ Controller#tr(75d9f1c324b4579d).("The given message is not a valid MIDI message.")); |
| 212 | return; |
| 213 | } |
| 214 | |
| 215 | // Send the message. |
| 216 | quint64cxx . . $ quint64# timeStamp = enginecxx . . $ Controller#engine..sendMessagecxx . . $ Engine#sendMessage(a0c38bcf9df53632).(msg); |
| 217 | mainViewcxx . . $ Controller#mainView..addSentMessagecxx . . $ MainView#addSentMessage(e22750454831b9e4).(timeStamp, statusDescriptioncxx . . $ Controller#statusDescription., dataDescriptioncxx . . $ Controller#dataDescription., |
| 218 | validcxx . . $ Controller#valid.); |
| 219 | } |
| 220 | |
| 221 | void |
| 222 | Controllercxx . . $ Controller#::handleReceivedMessagecxx . . $ Controller#handleReceivedMessage(a7e3eb4d802fd6a1).(quint64cxx . . $ quint64# timeStamp, const QByteArraycxx . . $ QByteArray# &message) |
| 223 | { |
| 224 | parseMessagecxx . . $ Controller#parseMessage(45672f3c6961a244).(message); |
| 225 | mainViewcxx . . $ Controller#mainView..addReceivedMessagecxx . . $ MainView#addReceivedMessage(e22750454831b9e4).(timeStamp, statusDescriptioncxx . . $ Controller#statusDescription., dataDescriptioncxx . . $ Controller#dataDescription., |
| 226 | validcxx . . $ Controller#valid.); |
| 227 | } |
| 228 | |
| 229 | void |
| 230 | Controllercxx . . $ Controller#::parseMessagecxx . . $ Controller#parseMessage(45672f3c6961a244).(const QByteArraycxx . . $ QByteArray# &message) |
| 231 | { |
| 232 | // Make sure we have an actual message. |
| 233 | int length = message.countcxx . . $ QByteArray#count(455f465bc33b4cdf).(); |
| 234 | if (! length) { |
| 235 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 236 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("empty message"); |
| 237 | validcxx . . $ Controller#valid. = false; |
| 238 | return; |
| 239 | } |
| 240 | |
| 241 | // Validate status byte. |
| 242 | quint8cxx . . $ quint8# status = static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).0]); |
| 243 | if (status < 0x80) { |
| 244 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message); |
| 245 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("%1 (invalid status)"). |
| 246 | argcxx . . $ QString#arg(173a29139b43af1f).(static_cast<uintcxx . . $ uint#>(status), 2, 16, QCharcxx . . $ QChar#('0')); |
| 247 | validcxx . . $ Controller#valid. = false; |
| 248 | return; |
| 249 | } |
| 250 | |
| 251 | // Validate length and data. |
| 252 | QStringcxx . . $ QString# errorMessagecxx . . $ QString#QString(ced63f7c635d850d).; |
| 253 | int expectedLength = statusLengthscxx . . $ statusLengths.[status - 0x80]; |
| 254 | int lastDataIndex; |
| 255 | switch (expectedLength) { |
| 256 | |
| 257 | case -1: |
| 258 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message); |
| 259 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("%1 (undefined status)"). |
| 260 | argcxx . . $ QString#arg(173a29139b43af1f).(static_cast<uintcxx . . $ uint#>(status), 2, 16, QCharcxx . . $ QChar#('0')); |
| 261 | validcxx . . $ Controller#valid. = false; |
| 262 | return; |
| 263 | |
| 264 | case 0: |
| 265 | if (length == 1) { |
| 266 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 267 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("System Exclusive (no data)"); |
| 268 | validcxx . . $ Controller#valid. = false; |
| 269 | return; |
| 270 | } |
| 271 | if (static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).length - 1]) != 0xf7) { |
| 272 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message); |
| 273 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("System Exclusive (end not found)"); |
| 274 | validcxx . . $ Controller#valid. = false; |
| 275 | return; |
| 276 | } |
| 277 | lastDataIndex = length - 2; |
| 278 | break; |
| 279 | |
| 280 | default: |
| 281 | if (length != expectedLength) { |
| 282 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message); |
| 283 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("%1 (incorrect length)"). |
| 284 | argcxx . . $ QString#arg(173a29139b43af1f).(static_cast<uintcxx . . $ uint#>(status), 2, 16, QCharcxx . . $ QChar#('0')); |
| 285 | validcxx . . $ Controller#valid. = false; |
| 286 | return; |
| 287 | } |
| 288 | lastDataIndex = length - 1; |
| 289 | } |
| 290 | |
| 291 | // Validate data bytes. |
| 292 | for (int i = 1; i <= lastDataIndex; i++) { |
| 293 | if (static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).i]) >= 0x80) { |
| 294 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message); |
| 295 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("%1 (invalid data)"). |
| 296 | argcxx . . $ QString#arg(173a29139b43af1f).(static_cast<uintcxx . . $ uint#>(status), 2, 16, QCharcxx . . $ QChar#('0')); |
| 297 | validcxx . . $ Controller#valid. = false; |
| 298 | return; |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | // Convert message to user-friendly strings. |
| 303 | QStringcxx . . $ QString# scxx . . $ QString#QString(ced63f7c635d850d).; |
| 304 | int value; |
| 305 | validcxx . . $ Controller#valid. = true; |
| 306 | switch (status & 0xf0) { |
| 307 | |
| 308 | case 0x80: |
| 309 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Note: %1, Velocity: %2"). |
| 310 | argcxx . . $ QString#arg(bc823072288cbbb5).(getMIDINoteStringcxx . . $ getMIDINoteString(e76153c3c184c917).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))). |
| 311 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])); |
| 312 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Note Off, Channel %1").argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 313 | break; |
| 314 | |
| 315 | case 0x90: |
| 316 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Note: %1, Velocity: %2"). |
| 317 | argcxx . . $ QString#arg(bc823072288cbbb5).(getMIDINoteStringcxx . . $ getMIDINoteString(e76153c3c184c917).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))). |
| 318 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])); |
| 319 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Note On, Channel %1").argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 320 | break; |
| 321 | |
| 322 | case 0xa0: |
| 323 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Note: %1, Pressure: %2"). |
| 324 | argcxx . . $ QString#arg(bc823072288cbbb5).(getMIDINoteStringcxx . . $ getMIDINoteString(e76153c3c184c917).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))). |
| 325 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])); |
| 326 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Aftertouch, Channel %1"). |
| 327 | argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 328 | break; |
| 329 | |
| 330 | case 0xb0: |
| 331 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Controller: %1, Value: %2"). |
| 332 | argcxx . . $ QString#arg(bc823072288cbbb5).(getMIDIControlStringcxx . . $ getMIDIControlString(e76153c3c184c917).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))). |
| 333 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])); |
| 334 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Controller, Channel %1"). |
| 335 | argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 336 | break; |
| 337 | |
| 338 | case 0xc0: |
| 339 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Number: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1])); |
| 340 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Program Change, Channel %1"). |
| 341 | argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 342 | break; |
| 343 | |
| 344 | case 0xd0: |
| 345 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Pressure: %1"). |
| 346 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1])); |
| 347 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Channel Pressure, Channel %1"). |
| 348 | argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 349 | break; |
| 350 | |
| 351 | case 0xe0: |
| 352 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Value: %1"). |
| 353 | argcxx . . $ QString#arg(64ab2ed17cc11715).((((static_cast<qint16cxx . . $ qint16#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])) << 7) | |
| 354 | (static_cast<qint16cxx . . $ qint16#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))) - 0x2000); |
| 355 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Pitch Wheel, Channel %1"). |
| 356 | argcxx . . $ QString#arg(64ab2ed17cc11715).((status & 0xf) + 1); |
| 357 | break; |
| 358 | |
| 359 | case 0xf0: |
| 360 | switch (status & 0xf) { |
| 361 | |
| 362 | case 0x0: |
| 363 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). getGenericDataDescriptioncxx . . $ Controller#getGenericDataDescription(edcb45d4eb8ee8d7).(message, lastDataIndex); |
| 364 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("System Exclusive"); |
| 365 | break; |
| 366 | |
| 367 | case 0x1: |
| 368 | value = message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).0] & 0xf; |
| 369 | switch (message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).0] & 0x70) { |
| 370 | |
| 371 | case 0x00: |
| 372 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Frames Low Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 373 | break; |
| 374 | |
| 375 | case 0x10: |
| 376 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Frames High Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 377 | break; |
| 378 | |
| 379 | case 0x20: |
| 380 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Seconds Low Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 381 | break; |
| 382 | |
| 383 | case 0x30: |
| 384 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Seconds High Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 385 | break; |
| 386 | |
| 387 | case 0x40: |
| 388 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Minutes Low Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 389 | break; |
| 390 | |
| 391 | case 0x50: |
| 392 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Minutes High Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 393 | break; |
| 394 | |
| 395 | case 0x60: |
| 396 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Hours Low Nibble: %1").argcxx . . $ QString#arg(64ab2ed17cc11715).(value); |
| 397 | break; |
| 398 | |
| 399 | case 0x70: |
| 400 | switch ((value & 0x6) >> 1) { |
| 401 | |
| 402 | case 0: |
| 403 | s =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("24 fps"); |
| 404 | break; |
| 405 | |
| 406 | case 1: |
| 407 | s =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("25 fps"); |
| 408 | break; |
| 409 | |
| 410 | case 2: |
| 411 | s =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("30 fps (drop-frame)"); |
| 412 | break; |
| 413 | |
| 414 | case 3: |
| 415 | s =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("30 fps"); |
| 416 | break; |
| 417 | |
| 418 | default: |
| 419 | // We shouldn't get here. |
| 420 | assertcxx . . $ `/usr/include/assert.h:102:11`!(false); |
| 421 | } |
| 422 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Hours High Nibble: %1, SMPTE Type: %2"). |
| 423 | argcxx . . $ QString#arg(64ab2ed17cc11715).(value & 1).argcxx . . $ QString#arg(bc823072288cbbb5).(s); |
| 424 | break; |
| 425 | |
| 426 | default: |
| 427 | // We shouldn't get here. |
| 428 | assertcxx . . $ `/usr/include/assert.h:102:11`!(false); |
| 429 | } |
| 430 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MTC Quarter Frame"); |
| 431 | break; |
| 432 | |
| 433 | case 0x2: |
| 434 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Beat: %1"). |
| 435 | argcxx . . $ QString#arg(64ab2ed17cc11715).(((static_cast<qint16cxx . . $ qint16#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2])) << 7) | |
| 436 | (static_cast<qint16cxx . . $ qint16#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1]))); |
| 437 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Song Position Pointer"); |
| 438 | break; |
| 439 | |
| 440 | case 0x3: |
| 441 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Song Number: %1"). |
| 442 | argcxx . . $ QString#arg(64ab2ed17cc11715).(static_cast<quint8cxx . . $ quint8#>(message[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).1])); |
| 443 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Song Select"); |
| 444 | break; |
| 445 | |
| 446 | case 0x6: |
| 447 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 448 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Tune Request"); |
| 449 | break; |
| 450 | |
| 451 | case 0x8: |
| 452 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 453 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Clock"); |
| 454 | break; |
| 455 | |
| 456 | case 0x9: |
| 457 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 458 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Tick"); |
| 459 | break; |
| 460 | |
| 461 | case 0xa: |
| 462 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 463 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Start"); |
| 464 | break; |
| 465 | |
| 466 | case 0xb: |
| 467 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 468 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Continue"); |
| 469 | break; |
| 470 | |
| 471 | case 0xc: |
| 472 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 473 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("MIDI Stop"); |
| 474 | break; |
| 475 | |
| 476 | case 0xe: |
| 477 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 478 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Active Sense"); |
| 479 | break; |
| 480 | |
| 481 | case 0xf: |
| 482 | dataDescriptioncxx . . $ Controller#dataDescription. =cxx . . $ QString#`operator=`(d02845eef0c33901). ""; |
| 483 | statusDescriptioncxx . . $ Controller#statusDescription. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Controller#tr(75d9f1c324b4579d).("Reset"); |
| 484 | break; |
| 485 | |
| 486 | default: |
| 487 | // We shouldn't get here. |
| 488 | assertcxx . . $ `/usr/include/assert.h:102:11`!(false); |
| 489 | } |
| 490 | break; |
| 491 | |
| 492 | default: |
| 493 | // We shouldn't get here. |
| 494 | assertcxx . . $ `/usr/include/assert.h:102:11`!(false); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | void |
| 499 | Controllercxx . . $ Controller#::runcxx . . $ Controller#run(49f6e7a06ebc5aa8).() |
| 500 | { |
| 501 | mainViewcxx . . $ Controller#mainView..showcxx . . $ View#show(49f6e7a06ebc5aa8).(); |
| 502 | applicationcxx . . $ Controller#application..execcxx . . $ QApplication#exec(b126dc7c1de90089).(); |
| 503 | } |
| 504 | |
| 505 | void |
| 506 | Controllercxx . . $ Controller#::showErrorcxx . . $ Controller#showError(3520e46b33348bf6).(const QStringcxx . . $ QString# &message) |
| 507 | { |
| 508 | errorViewcxx . . $ Controller#errorView..setMessagecxx . . $ ErrorView#setMessage(3520e46b33348bf6).(message); |
| 509 | errorViewcxx . . $ Controller#errorView..showcxx . . $ View#show(49f6e7a06ebc5aa8).(); |
| 510 | } |