diff -Nru qmidiarp-0.4.2+git20110704/debian/changelog qmidiarp-0.4.2+git20110708/debian/changelog --- qmidiarp-0.4.2+git20110704/debian/changelog 2011-07-06 18:37:55.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/debian/changelog 2011-07-08 11:12:00.000000000 +0000 @@ -1,3 +1,16 @@ +qmidiarp (0.4.2+git20110708-0lucid0~autostatic0) lucid; urgency=low + + * Controller handling for grooveWidget simplified (only has sliders) + * Obsolete member variable removed + * Groove Widget made MIDI controllable + - GrooveWidget is now passed to engine as argument + - For MIDI controllers, GrooveWidget has WidgetID -1 + * Translation hunks updated + * Modules, engine and MidiCCTable widget now use the new MidiControl class + * New MidiControl class introduced for managing MIDI Learn in Module Widgets + + -- Jeremy Jongepier Fri, 08 Jul 2011 13:10:14 +0200 + qmidiarp (0.4.2+git20110704-0lucid0~autostatic0) lucid; urgency=low * Translation hunks updated diff -Nru qmidiarp-0.4.2+git20110704/.gitignore qmidiarp-0.4.2+git20110708/.gitignore --- qmidiarp-0.4.2+git20110704/.gitignore 2011-07-06 18:32:50.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -*.o -*_moc.cpp -Makefile -Makefile.in -.deps -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/depcomp -/install-sh -/missing -/src/config.h -/src/config.h.in -/src/qmidiarp -/src/stamp-h1 -*.qm -/doxygen-doc -/qmidiarp-*.tar.bz2 -/qmidiarp-*.tar.gz diff -Nru qmidiarp-0.4.2+git20110704/src/arpwidget.cpp qmidiarp-0.4.2+git20110708/src/arpwidget.cpp --- qmidiarp-0.4.2+git20110704/src/arpwidget.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/arpwidget.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -50,23 +50,9 @@ QWidget(parent), midiWorker(p_midiWorker), modified(false) { int l1; - - // QSignalMappers allow identifying signal senders for MIDI learn/forget - learnSignalMapper = new QSignalMapper(this); - connect(learnSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiLearn(int))); - - forgetSignalMapper = new QSignalMapper(this); - connect(forgetSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiForget(int))); - - // we need the cancel MIDI Learn action only once for all - cancelMidiLearnAction = new QAction(tr("Cancel MIDI &Learning"), this); - connect(cancelMidiLearnAction, SIGNAL(triggered()), this, SLOT(midiLearnCancel())); - cancelMidiLearnAction->setEnabled(false); - + QStringList midiCCNames; midiCCNames << "MuteToggle" << "PresetSwitch" << "unknown"; - + midiControl = new MidiControl(midiCCNames); // Management Buttons on the right top QHBoxLayout *manageBoxLayout = new QHBoxLayout; @@ -160,7 +146,7 @@ muteOut = new QCheckBox(this); connect(muteOut, SIGNAL(toggled(bool)), this, SLOT(setMuted(bool))); muteLabel->setBuddy(muteOut); - addMidiLearnMenu(muteOut, 0); + midiControl->addMidiLearnMenu(muteOut, 0); QLabel *portLabel = new QLabel(tr("&Port"), portBox); portOut = new QComboBox(portBox); @@ -232,7 +218,7 @@ patternPresetBox->setMinimumContentsLength(20); connect(patternPresetBox, SIGNAL(activated(int)), this, SLOT(selectPatternPreset(int))); - addMidiLearnMenu(patternPresetBox, 1); + midiControl->addMidiLearnMenu(patternPresetBox, 1); repeatPatternThroughChord = new QComboBox(patternBox); QStringList repeatPatternNames; @@ -384,7 +370,6 @@ widgetLayout->setRowStretch(3, 1); widgetLayout->setColumnStretch(0, 5); setLayout(widgetLayout); - ccList.clear(); } ArpWidget::~ArpWidget() @@ -486,28 +471,13 @@ releaseTime->value())); xml.writeEndElement(); - xml.writeStartElement("midiControllers"); - for (int l1 = 0; l1 < ccList.count(); l1++) { - xml.writeStartElement("MIDICC"); - xml.writeAttribute("CtrlID", QString::number(ccList.at(l1).ID)); - xml.writeTextElement("ccnumber", QString::number( - ccList.at(l1).ccnumber)); - xml.writeTextElement("channel", QString::number( - ccList.at(l1).channel)); - xml.writeTextElement("min", QString::number( - ccList.at(l1).min)); - xml.writeTextElement("max", QString::number( - ccList.at(l1).max)); - xml.writeEndElement(); - } - xml.writeEndElement(); + midiControl->writeData(xml); xml.writeEndElement(); } void ArpWidget::readData(QXmlStreamReader& xml) { - int controlID, ccnumber, channel, min, max; int tmp; while (!xml.atEnd()) { @@ -600,36 +570,7 @@ } } else if (xml.isStartElement() && (xml.name() == "midiControllers")) { - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.isStartElement() && (xml.name() == "MIDICC")) { - controlID = xml.attributes().value("CtrlID").toString().toInt(); - ccnumber = -1; - channel = -1; - min = -1; - max = -1; - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.name() == "ccnumber") - ccnumber = xml.readElementText().toInt(); - else if (xml.name() == "channel") - channel = xml.readElementText().toInt(); - else if (xml.name() == "min") - min = xml.readElementText().toInt(); - else if (xml.name() == "max") - max = xml.readElementText().toInt(); - else skipXmlElement(xml); - } - if ((-1 < ccnumber) && (-1 < channel) && (-1 < min) && (-1 < max)) - appendMidiCC(controlID, ccnumber, channel, min, max); - else qWarning("Controller data incomplete"); - } - else skipXmlElement(xml); - } + midiControl->readData(xml); } else skipXmlElement(xml); } @@ -699,7 +640,7 @@ int min = qs2.toInt(); qs2 = qs.section(' ', 4, 4); int max = qs2.toInt(); - appendMidiCC(controlID, ccnumber, channel, min, max); + midiControl->appendMidiCC(controlID, ccnumber, channel, min, max); qs = arpText.readLine(); } qs = arpText.readLine(); @@ -990,12 +931,13 @@ bool ArpWidget::isModified() { - return modified; + return (modified || midiControl->isModified()); } void ArpWidget::setModified(bool m) { modified = m; + midiControl->setModified(m); } void ArpWidget::moduleDelete() @@ -1027,84 +969,3 @@ emit dockRename(name, parentDockID); } } - -void ArpWidget::appendMidiCC(int controlID, int ccnumber, int channel, int min, int max) -{ - MidiCC midiCC; - int l1 = 0; - midiCC.name = midiCCNames.at(controlID); - midiCC.ID = controlID; - midiCC.ccnumber = ccnumber; - midiCC.channel = channel; - midiCC.min = min; - midiCC.max = max; - - while ( (l1 < ccList.count()) && - ((controlID != ccList.at(l1).ID) || - (ccnumber != ccList.at(l1).ccnumber) || - (channel != ccList.at(l1).channel)) ) l1++; - - if (ccList.count() == l1) { - ccList.append(midiCC); - qWarning("MIDI Controller %d appended for %s" - , ccnumber, qPrintable(midiCC.name)); - } - else { - qWarning("MIDI Controller %d already attributed to %s" - , ccnumber, qPrintable(midiCC.name)); - } - - cancelMidiLearnAction->setEnabled(false); - modified = true; -} - -void ArpWidget::removeMidiCC(int controlID, int ccnumber, int channel) -{ - for (int l1 = 0; l1 < ccList.count(); l1++) { - if (ccList.at(l1).ID == controlID) { - if (((ccList.at(l1).ccnumber == ccnumber) - && (ccList.at(l1).channel == channel)) - || (0 > channel)) { - ccList.remove(l1); - l1--; - qWarning("controller removed"); - } - } - } - modified = true; -} - -void ArpWidget::midiLearn(int controlID) -{ - emit setMidiLearn(parentDockID, ID, controlID); - qWarning("Requesting Midi Learn for %s", qPrintable(midiCCNames.at(controlID))); - cancelMidiLearnAction->setEnabled(true); -} - -void ArpWidget::midiForget(int controlID) -{ - removeMidiCC(controlID, 0, -1); -} - -void ArpWidget::midiLearnCancel() -{ - emit setMidiLearn(parentDockID, ID, -1); - qWarning("Cancelling Midi Learn request"); - cancelMidiLearnAction->setEnabled(false); -} - -void ArpWidget::addMidiLearnMenu(QWidget *widget, int count) -{ - widget->setContextMenuPolicy(Qt::ContextMenuPolicy(Qt::ActionsContextMenu)); - QAction *learnAction = new QAction(tr("MIDI &Learn"), this); - widget->addAction(learnAction); - connect(learnAction, SIGNAL(triggered()), learnSignalMapper, SLOT(map())); - learnSignalMapper->setMapping(learnAction, count); - - QAction *forgetAction = new QAction(tr("MIDI &Forget"), this); - widget->addAction(forgetAction); - connect(forgetAction, SIGNAL(triggered()), forgetSignalMapper, SLOT(map())); - forgetSignalMapper->setMapping(forgetAction, count); - - widget->addAction(cancelMidiLearnAction); -} diff -Nru qmidiarp-0.4.2+git20110704/src/arpwidget.h qmidiarp-0.4.2+git20110708/src/arpwidget.h --- qmidiarp-0.4.2+git20110704/src/arpwidget.h 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/arpwidget.h 2011-07-08 11:06:44.000000000 +0000 @@ -42,22 +42,7 @@ #include "midiarp.h" #include "slider.h" #include "arpscreen.h" - -#ifndef MIDICC_H - -/*! @brief Structure holding all elements of a MIDI controller allocated to - * a QMidiArp parameter assigned via MIDI learn - */ -struct MidiCC { - QString name; /**< @brief Name of the assigned parameter (GUI element)*/ - int min; /**< @brief Value output when the CC value is 0 */ - int max; /**< @brief Value output when the CC value is 127 */ - int ccnumber; /**< @brief MIDI CC number of the assigned controller event */ - int channel; /**< @brief MIDI channel on which the controller has to come in */ - int ID; /**< @brief Internal ID of the assigned parameter (GUI element)*/ - }; -#define MIDICC_H -#endif +#include "midicontrol.h" /*! @brief GUI class associated with and controlling a MidiArp worker * @@ -90,8 +75,6 @@ QAction *latchModeAction; QAction *deleteAction, *renameAction; QAction *cancelMidiLearnAction; - QSignalMapper *learnSignalMapper, *forgetSignalMapper; - QStringList midiCCNames; MidiArp *midiWorker; QLineEdit *patternText; Slider *randomVelocity, *randomTick, *randomLength; @@ -108,16 +91,6 @@ */ void skipXmlElement(QXmlStreamReader& xml); void loadPatternPresets(); -/*! -* @brief This function creates and attributes a MIDI-Learn context menu -* to the passed QWidget. -* -* The menu is connected to a QSignalMapper for dispatching its actions -* -* @param *widget QWidget to which the context menu is attributed -* @param count Internal identifier of the controllable QWidget -*/ - void addMidiLearnMenu(QWidget *widget, int count = 0); /* PUBLIC MEMBERS */ public: @@ -138,8 +111,8 @@ QString name; /**< @brief The name of this ArpWidget as shown in the DockWidget TitleBar */ int ID; /**< @brief Corresponds to the Engine::midiArpList index of the associated MidiArp */ int parentDockID; /**< @brief The index of the ArpWidget's parent DockWidget in Engine::moduleWindowList */ - QVector ccList; /**< @brief Contains MIDI controller - GUI element bindings */ + MidiControl *midiControl; ArpScreen *screen; QStringList patternPresets, patternNames; QCheckBox *muteOut; @@ -222,16 +195,6 @@ * @param parentDockID SeqWidget::parentDockID of the module to rename * */ void dockRename(const QString& mname, int parentDockID); -/*! @brief Emitted to Engine::setMidiLearn to listen for incoming events. - * @param parentDockID SeqWidget::parentDockID of the module to rename - * @param ID SeqWidget::ID of the module receiving the MIDI controller - * @param controlID ID of the GUI element to be assigned to the controller - * */ - void setMidiLearn(int parentDockID, int ID, int controlID); -/*! @brief Forwarded context menu action by signalMapper to call MIDI-Learn/Forget functions. - * @param controlID ID of the GUI element requesting the MIDI controller - * */ - void triggered(int controlID); /* PUBLIC SLOTS */ public slots: @@ -305,63 +268,6 @@ * signal to MainWindow with the new name and the dockWidget ID to rename. */ void moduleRename(); -/*! -* @brief This function appends a new MIDI controller - GUI element -* binding to ArpWidget::ccList. -* -* Before appending, it checks whether this binding already exists. -* @param controlID The ID of the control GUI element (found -* in ArpWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be attributed -* @param channel The MIDI Channel of the MIDI controller to be attributed -* @param min The minimum value to which the controller range is mapped -* @param max The maximum value to which the controller range is mapped -*/ - void appendMidiCC(int controlID, int ccnumber, int channel, int min, int max); -/*! -* @brief This function removes a MIDI controller - GUI element -* binding from the ArpWidget::ccList. -* -* @param controlID The ID of the control GUI element (found -* in ArpWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be removed -* @param channel The MIDI Channel of the MIDI controller to be removed -*/ - void removeMidiCC(int controlID, int ccnumber, int channel); -/*! -* @brief Slot for ArpWidget::triggered signal created by MIDI-Learn context -* menu MIDI Learn action. -* -* This function sets Engine into -* MIDI Learn status for this module and controlID. -* It emits ArpWidget::setMidiLearn with the necessary module and GUI element -* information parameters. -* Engine will then wait for an incoming controller event and trigger the -* attribution by calling appendMidiCC. -* -* @param controlID The ID of the control GUI element (found -* in ArpWidget::midiCCNames) -*/ - void midiLearn(int controlID); -/*! -* @brief Slot for ArpWidget::triggered signal created by a -* MIDI-Learn context menu Forget action. -* -* This function removes a controller -* binding attribution by calling removeMidiCC. -* -* @param controlID The ID of the control GUI element (found -* in ArpWidget::midiCCNames) -*/ - void midiForget(int controlID); -/*! -* @brief Slot for ArpWidget::cancelMidiLearnAction in MIDI-Learn -* context menu. This function signals cancellation of the -* MIDI-Learn Process to Engine. -* -* It emits ArpWidget::setMidiLearn with controlID set to -1 meaning cancel. -*/ - void midiLearnCancel(); }; #endif diff -Nru qmidiarp-0.4.2+git20110704/src/engine.cpp qmidiarp-0.4.2+git20110708/src/engine.cpp --- qmidiarp-0.4.2+git20110704/src/engine.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/engine.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -29,8 +29,17 @@ #include "engine.h" -Engine::Engine(int p_portCount, QWidget *parent) : QWidget(parent), modified(false) +Engine::Engine(GrooveWidget *p_grooveWidget, int p_portCount, QWidget *parent) : QWidget(parent), modified(false) { + grooveWidget = p_grooveWidget; + connect(grooveWidget, SIGNAL(newGrooveTick(int)), + this, SLOT(setGrooveTick(int))); + connect(grooveWidget, SIGNAL(newGrooveVelocity(int)), + this, SLOT(setGrooveVelocity(int))); + connect(grooveWidget, SIGNAL(newGrooveLength(int)), + this, SLOT(setGrooveLength(int))); + connect(grooveWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), + this, SLOT(setMidiLearn(int, int, int))); portCount = p_portCount; seqDriver = new SeqDriver(&midiArpList, &midiLfoList, &midiSeqList, portCount, this); connect(seqDriver, SIGNAL(controlEvent(int, int, int)), @@ -347,8 +356,36 @@ int min, max, sval; QVector cclist; if (!midiLearnFlag) { + cclist = grooveWidget->midiControl->ccList; + for (int l2 = 0; l2 < cclist.count(); l2++) { + min = cclist.at(l2).min; + max = cclist.at(l2).max; + sval = min + ((double)value * (max - min) / 127); + if ((ccnumber == cclist.at(l2).ccnumber) && + (channel == cclist.at(l2).channel)) { + switch (cclist.at(l2).ID) { + case 0: + grooveWidget->grooveTick->setValue(sval); + return; + break; + + case 1: + grooveWidget->grooveVelocity->setValue(sval); + return; + break; + + case 2: + grooveWidget->grooveLength->setValue(sval); + return; + break; + + default: + break; + } + } + } for (int l1 = 0; l1 < arpWidgetCount(); l1++) { - cclist = arpWidget(l1)->ccList; + cclist = arpWidget(l1)->midiControl->ccList; for (int l2 = 0; l2 < cclist.count(); l2++) { min = cclist.at(l2).min; max = cclist.at(l2).max; @@ -362,12 +399,6 @@ arpWidget(l1)->muteOut->setChecked(!m); return; } - case 1: - sval = min + ((double)value * (max - min) - / 127); - arpWidget(l1)->selectPatternPreset(sval); - return; - break; } else { if (value == max) { @@ -378,6 +409,12 @@ } } break; + case 1: + sval = min + ((double)value * (max - min) + / 127); + arpWidget(l1)->selectPatternPreset(sval); + return; + break; default: break; } @@ -386,7 +423,7 @@ } for (int l1 = 0; l1 < lfoWidgetCount(); l1++) { - cclist = lfoWidget(l1)->ccList; + cclist = lfoWidget(l1)->midiControl->ccList; for (int l2 = 0; l2 < cclist.count(); l2++) { min = cclist.at(l2).min; max = cclist.at(l2).max; @@ -476,7 +513,7 @@ } for (int l1 = 0; l1 < seqWidgetCount(); l1++) { - cclist = seqWidget(l1)->ccList; + cclist = seqWidget(l1)->midiControl->ccList; for (int l2 = 0; l2 < cclist.count(); l2++) { min = cclist.at(l2).min; max = cclist.at(l2).max; @@ -553,17 +590,23 @@ } } else { + if (midiLearnWindowID == -1) { + grooveWidget->midiControl->appendMidiCC(midiLearnID, + ccnumber, channel, -100, 100); + midiLearnFlag = false; + return; + } int min = (midiLearnID) ? 0 : 127; //if control is toggle min=max if (moduleWindow(midiLearnWindowID)->objectName().startsWith("Arp")) { - arpWidget(midiLearnModuleID)->appendMidiCC(midiLearnID, + arpWidget(midiLearnModuleID)->midiControl->appendMidiCC(midiLearnID, ccnumber, channel, min, 127); } if (moduleWindow(midiLearnWindowID)->objectName().startsWith("LFO")) { - lfoWidget(midiLearnModuleID)->appendMidiCC(midiLearnID, + lfoWidget(midiLearnModuleID)->midiControl->appendMidiCC(midiLearnID, ccnumber, channel, min, 127); } if (moduleWindow(midiLearnWindowID)->objectName().startsWith("Seq")) { - seqWidget(midiLearnModuleID)->appendMidiCC(midiLearnID, + seqWidget(midiLearnModuleID)->midiControl->appendMidiCC(midiLearnID, ccnumber, channel, min, 127); } diff -Nru qmidiarp-0.4.2+git20110704/src/engine.h qmidiarp-0.4.2+git20110708/src/engine.h --- qmidiarp-0.4.2+git20110704/src/engine.h 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/engine.h 2011-07-08 11:06:44.000000000 +0000 @@ -35,6 +35,7 @@ #include "lfowidget.h" #include "midiseq.h" #include "seqwidget.h" +#include "groovewidget.h" /*! * @brief Manages created module components in lists. Instantiates SeqDriver. @@ -69,9 +70,10 @@ int grooveTick, grooveVelocity, grooveLength; public: + GrooveWidget *grooveWidget; SeqDriver *seqDriver; - Engine(int p_portCount, QWidget* parent=0); + Engine(GrooveWidget *p_grooveWidget, int p_portCount, QWidget* parent=0); ~Engine(); int getPortCount(); bool isModified(); diff -Nru qmidiarp-0.4.2+git20110704/src/groovewidget.cpp qmidiarp-0.4.2+git20110708/src/groovewidget.cpp --- qmidiarp-0.4.2+git20110704/src/groovewidget.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/groovewidget.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -39,22 +39,31 @@ GrooveWidget::GrooveWidget(QWidget *parent) : QWidget(parent) { + QStringList midiCCNames; + midiCCNames << "Tick" << "Velocity" << "Length" << "unknown"; + midiControl = new MidiControl(midiCCNames); + midiControl->ID = -1; + midiControl->parentDockID = -1; + QVBoxLayout *GrooveWidgetLayout = new QVBoxLayout; grooveTick = new Slider(-100, 100, 1, 10, 0, Qt::Horizontal, tr("&Shift"), this); connect(grooveTick, SIGNAL(valueChanged(int)), this, SLOT(updateGrooveTick(int))); + midiControl->addMidiLearnMenu(grooveTick, 0); grooveVelocity = new Slider(-100, 100, 1, 10, 0, Qt::Horizontal, tr("&Velocity"), this); connect(grooveVelocity, SIGNAL(valueChanged(int)), this, SLOT(updateGrooveVelocity(int))); + midiControl->addMidiLearnMenu(grooveVelocity, 1); grooveLength = new Slider(-100, 100, 1, 10, 0, Qt::Horizontal, tr("&Length"), this); connect(grooveLength, SIGNAL(valueChanged(int)), this, SLOT(updateGrooveLength(int))); + midiControl->addMidiLearnMenu(grooveLength, 2); GrooveWidgetLayout->addWidget(grooveTick); GrooveWidgetLayout->addWidget(grooveVelocity); diff -Nru qmidiarp-0.4.2+git20110704/src/groovewidget.h qmidiarp-0.4.2+git20110708/src/groovewidget.h --- qmidiarp-0.4.2+git20110704/src/groovewidget.h 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/groovewidget.h 2011-07-08 11:06:44.000000000 +0000 @@ -33,6 +33,7 @@ #include #include #include "slider.h" +#include "midicontrol.h" /*! * @brief Creates a QWidget with three sliders controlling the arpeggiator groove. @@ -54,6 +55,7 @@ public: GrooveWidget(QWidget* parent=0); ~GrooveWidget(); + MidiControl *midiControl; signals: void newGrooveVelocity(int); diff -Nru qmidiarp-0.4.2+git20110704/src/lfowidget.cpp qmidiarp-0.4.2+git20110708/src/lfowidget.cpp --- qmidiarp-0.4.2+git20110704/src/lfowidget.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/lfowidget.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -52,23 +52,10 @@ QWidget(parent), midiWorker(p_midiWorker), modified(false) { int l1; - - // QSignalMappers allow identifying signal senders for MIDI learn/forget - learnSignalMapper = new QSignalMapper(this); - connect(learnSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiLearn(int))); - - forgetSignalMapper = new QSignalMapper(this); - connect(forgetSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiForget(int))); - - // we need the cancel MIDI Learn action only once for all - cancelMidiLearnAction = new QAction(tr("Cancel MIDI &Learning"), this); - connect(cancelMidiLearnAction, SIGNAL(triggered()), this, SLOT(midiLearnCancel())); - cancelMidiLearnAction->setEnabled(false); - + QStringList midiCCNames; midiCCNames << "MuteToggle" << "Amplitude" << "Offset" << "WaveForm" << "Frequency" << "RecordToggle"<< "Resolution"<< "Size" << "unknown"; + midiControl = new MidiControl(midiCCNames); // Management Buttons on the right top QHBoxLayout *manageBoxLayout = new QHBoxLayout; @@ -136,7 +123,7 @@ muteOut = new QCheckBox(this); connect(muteOut, SIGNAL(toggled(bool)), this, SLOT(setMuted(bool))); muteLabel->setBuddy(muteOut); - addMidiLearnMenu(muteOut, 0); + midiControl->addMidiLearnMenu(muteOut, 0); QLabel *ccnumberLabel = new QLabel(tr("MIDI &CC#"), portBox); @@ -216,7 +203,7 @@ connect(waveFormBox, SIGNAL(activated(int)), this, SLOT(updateWaveForm(int))); - addMidiLearnMenu(waveFormBox, 3); + midiControl->addMidiLearnMenu(waveFormBox, 3); QLabel *freqBoxLabel = new QLabel(tr("&Frequency"), @@ -234,7 +221,7 @@ freqBox->setMinimumContentsLength(3); connect(freqBox, SIGNAL(activated(int)), this, SLOT(updateFreq(int))); - addMidiLearnMenu(freqBox, 4); + midiControl->addMidiLearnMenu(freqBox, 4); QLabel *resBoxLabel = new QLabel(tr("&Resolution"), waveBox); @@ -249,7 +236,7 @@ resBox->setMinimumContentsLength(3); connect(resBox, SIGNAL(activated(int)), this, SLOT(updateRes(int))); - addMidiLearnMenu(resBox, 6); + midiControl->addMidiLearnMenu(resBox, 6); QLabel *sizeBoxLabel = new QLabel(tr("&Length"), waveBox); sizeBox = new QComboBox(waveBox); @@ -263,7 +250,7 @@ sizeBox->setMinimumContentsLength(3); connect(sizeBox, SIGNAL(activated(int)), this, SLOT(updateSize(int))); - addMidiLearnMenu(sizeBox, 7); + midiControl->addMidiLearnMenu(sizeBox, 7); QLabel *recordButtonLabel = new QLabel(tr("Re&cord"), waveBox); recordAction = new QAction(QIcon(seqrecord_xpm), tr("Re&cord"), waveBox); @@ -273,20 +260,20 @@ recordButton->setDefaultAction(recordAction); recordButtonLabel->setBuddy(recordButton); connect(recordAction, SIGNAL(toggled(bool)), this, SLOT(setRecord(bool))); - addMidiLearnMenu(recordButton, 5); + midiControl->addMidiLearnMenu(recordButton, 5); amplitude = new Slider(0, 127, 1, 8, 64, Qt::Horizontal, tr("&Amplitude"), waveBox); connect(amplitude, SIGNAL(valueChanged(int)), this, SLOT(updateAmp(int))); - addMidiLearnMenu(amplitude, 1); + midiControl->addMidiLearnMenu(amplitude, 1); offset = new Slider(0, 127, 1, 8, 0, Qt::Horizontal, tr("&Offset"), waveBox); connect(offset, SIGNAL(valueChanged(int)), this, SLOT(updateOffs(int))); - addMidiLearnMenu(offset, 2); + midiControl->addMidiLearnMenu(offset, 2); QVBoxLayout* sliderLayout = new QVBoxLayout; sliderLayout->addWidget(amplitude); @@ -334,7 +321,6 @@ setLayout(widgetLayout); updateAmp(64); - ccList.clear(); lastMute = false; } @@ -407,28 +393,13 @@ xml.writeTextElement("data", tempArray.toHex()); xml.writeEndElement(); - xml.writeStartElement("midiControllers"); - for (int l1 = 0; l1 < ccList.count(); l1++) { - xml.writeStartElement("MIDICC"); - xml.writeAttribute("CtrlID", QString::number(ccList.at(l1).ID)); - xml.writeTextElement("ccnumber", QString::number( - ccList.at(l1).ccnumber)); - xml.writeTextElement("channel", QString::number( - ccList.at(l1).channel)); - xml.writeTextElement("min", QString::number( - ccList.at(l1).min)); - xml.writeTextElement("max", QString::number( - ccList.at(l1).max)); - xml.writeEndElement(); - } - xml.writeEndElement(); + midiControl->writeData(xml); xml.writeEndElement(); } void LfoWidget::readData(QXmlStreamReader& xml) { - int controlID, ccnumber, channel, min, max; int tmp; int wvtmp = 0; Sample sample; @@ -545,36 +516,7 @@ } } else if (xml.isStartElement() && (xml.name() == "midiControllers")) { - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.isStartElement() && (xml.name() == "MIDICC")) { - controlID = xml.attributes().value("CtrlID").toString().toInt(); - ccnumber = -1; - channel = -1; - min = -1; - max = -1; - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.name() == "ccnumber") - ccnumber = xml.readElementText().toInt(); - else if (xml.name() == "channel") - channel = xml.readElementText().toInt(); - else if (xml.name() == "min") - min = xml.readElementText().toInt(); - else if (xml.name() == "max") - max = xml.readElementText().toInt(); - else skipXmlElement(xml); - } - if ((-1 < ccnumber) && (-1 < channel) && (-1 < min) && (-1 < max)) - appendMidiCC(controlID, ccnumber, channel, min, max); - else qWarning("Controller data incomplete"); - } - else skipXmlElement(xml); - } + midiControl->readData(xml); } else skipXmlElement(xml); } @@ -642,7 +584,7 @@ int min = qs2.toInt(); qs2 = qs.section(' ', 4, 4); int max = qs2.toInt(); - appendMidiCC(controlID, ccnumber, channel, min, max); + midiControl->appendMidiCC(controlID, ccnumber, channel, min, max); qs = arpText.readLine(); } qs = arpText.readLine(); @@ -886,12 +828,13 @@ bool LfoWidget::isModified() { - return modified; + return (modified || midiControl->isModified()); } void LfoWidget::setModified(bool m) { modified = m; + midiControl->setModified(m); } void LfoWidget::moduleDelete() @@ -929,71 +872,6 @@ emit moduleClone(ID); } -void LfoWidget::appendMidiCC(int controlID, int ccnumber, int channel, int min, int max) -{ - MidiCC midiCC; - int l1 = 0; - midiCC.name = midiCCNames.at(controlID); - midiCC.ID = controlID; - midiCC.ccnumber = ccnumber; - midiCC.channel = channel; - midiCC.min = min; - midiCC.max = max; - - while ( (l1 < ccList.count()) && - ((controlID != ccList.at(l1).ID) || - (ccnumber != ccList.at(l1).ccnumber) || - (channel != ccList.at(l1).channel)) ) l1++; - - if (ccList.count() == l1) { - ccList.append(midiCC); - qWarning("MIDI Controller %d appended for %s" - , ccnumber, qPrintable(midiCC.name)); - } - else { - qWarning("MIDI Controller %d already attributed to %s" - , ccnumber, qPrintable(midiCC.name)); - } - - cancelMidiLearnAction->setEnabled(false); - modified = true; -} - -void LfoWidget::removeMidiCC(int controlID, int ccnumber, int channel) -{ - for (int l1 = 0; l1 < ccList.count(); l1++) { - if (ccList.at(l1).ID == controlID) { - if (((ccList.at(l1).ccnumber == ccnumber) - && (ccList.at(l1).channel == channel)) - || (0 > channel)) { - ccList.remove(l1); - l1--; - qWarning("controller removed"); - } - } - } - modified = true; -} - -void LfoWidget::midiLearn(int controlID) -{ - emit setMidiLearn(parentDockID, ID, controlID); - qWarning("Requesting Midi Learn for %s", qPrintable(midiCCNames.at(controlID))); - cancelMidiLearnAction->setEnabled(true); -} - -void LfoWidget::midiForget(int controlID) -{ - removeMidiCC(controlID, 0, -1); -} - -void LfoWidget::midiLearnCancel() -{ - emit setMidiLearn(parentDockID, ID, -1); - qWarning("Cancelling Midi Learn request"); - cancelMidiLearnAction->setEnabled(false); -} - void LfoWidget::copyParamsFrom(LfoWidget *fromWidget) { int tmp; @@ -1033,7 +911,7 @@ for (int l1 = 0; l1 < midiWorker->customWave.count(); l1++) { midiWorker->muteMask.append(midiWorker->customWave.at(l1).muted); } - ccList = fromWidget->ccList; + midiControl->setCcList(fromWidget->midiControl->ccList); muteOut->setChecked(true); tmp = fromWidget->waveFormBox->currentIndex(); @@ -1045,19 +923,3 @@ { return midiWorker->customWave; } - -void LfoWidget::addMidiLearnMenu(QWidget *widget, int count) -{ - widget->setContextMenuPolicy(Qt::ContextMenuPolicy(Qt::ActionsContextMenu)); - QAction *learnAction = new QAction(tr("MIDI &Learn"), this); - widget->addAction(learnAction); - connect(learnAction, SIGNAL(triggered()), learnSignalMapper, SLOT(map())); - learnSignalMapper->setMapping(learnAction, count); - - QAction *forgetAction = new QAction(tr("MIDI &Forget"), this); - widget->addAction(forgetAction); - connect(forgetAction, SIGNAL(triggered()), forgetSignalMapper, SLOT(map())); - forgetSignalMapper->setMapping(forgetAction, count); - - widget->addAction(cancelMidiLearnAction); -} diff -Nru qmidiarp-0.4.2+git20110704/src/lfowidget.h qmidiarp-0.4.2+git20110708/src/lfowidget.h --- qmidiarp-0.4.2+git20110704/src/lfowidget.h 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/lfowidget.h 2011-07-08 11:06:44.000000000 +0000 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include "midilfo.h" #include "slider.h" #include "lfoscreen.h" +#include "midicontrol.h" /*! This array holds the currently available resolution values. */ @@ -46,21 +46,6 @@ /*! This array holds the currently available frequency values. */ const int lfoFreqValues[14] = {1, 2, 4, 8, 16, 24, 32, 64, 96, 128, 160, 192, 224, 256}; -#ifndef MIDICC_H - -/*! @brief Structure holding all elements of a MIDI controller allocated to - * a QMidiArp parameter assigned via MIDI learn - */ -struct MidiCC { - QString name; /**< @brief Name of the assigned parameter (GUI element)*/ - int min; /**< @brief Value output when the CC value is 0 */ - int max; /**< @brief Value output when the CC value is 127 */ - int ccnumber; /**< @brief MIDI CC number of the assigned controller event */ - int channel; /**< @brief MIDI channel on which the controller has to come in */ - int ID; /**< @brief Internal ID of the assigned parameter (GUI element)*/ - }; -#define MIDICC_H -#endif /*! * @brief GUI class associated with and controlling a MidiLfo worker @@ -80,9 +65,6 @@ Q_OBJECT QAction *deleteAction, *renameAction, *cloneAction; - QAction *cancelMidiLearnAction; - QSignalMapper *learnSignalMapper, *forgetSignalMapper; - QStringList midiCCNames; /**< List of from GUI-element names for index = ControlID */ MidiLfo *midiWorker; QVector data; @@ -112,16 +94,6 @@ * */ void loadWaveForms(); -/*! -* @brief This function creates and attributes a MIDI-Learn context menu -* to the passed QWidget. -* -* The menu is connected to a QSignalMapper for dispatching its actions -* -* @param *widget QWidget to which the context menu is attributed -* @param count Internal identifier of the controllable QWidget -*/ - void addMidiLearnMenu(QWidget *widget, int count = 0); /*! * @brief This function determines the minimum of the current waveform and @@ -152,8 +124,8 @@ QString name; /**< The name of this LfoWidget as shown in the DockWidget TitleBar */ int ID; /**< Corresponds to the Engine::midiLfoList index of the associated MidiLfo */ int parentDockID; /**< The index of the LfoWidget's parent DockWidget in Engine::moduleWindowList */ - QVector ccList; /**< Contains MIDI controller - GUI element bindings */ + MidiControl *midiControl; LfoScreen *screen; QStringList waveForms; QComboBox *chIn; @@ -249,16 +221,6 @@ * @param ID MidiLfo::ID of the module to clone * */ void moduleClone(int ID); -/*! @brief Emitted to Engine::setMidiLearn to listen for incoming events. - * @param parentDockID SeqWidget::parentDockID of the module to rename - * @param ID SeqWidget::ID of the module receiving the MIDI controller - * @param controlID ID of the GUI element to be assigned to the controller - * */ - void setMidiLearn(int parentDockID, int ID, int controlID); -/*! @brief Forwarded context menu action by signalMapper to call MIDI-Learn/Forget functions. - * @param controlID ID of the GUI element requesting the MIDI controller - * */ - void triggered(int controlID); /* PUBLIC SLOTS */ public slots: @@ -429,63 +391,6 @@ * signal to MainWindow with the module ID and the dockWidget ID. */ void moduleClone(); -/*! -* @brief This function appends a new MIDI controller - GUI element -* binding to LfoWidget::ccList. -* -* Before appending, it checks whether this binding already exists. -* @param controlID The ID of the control GUI element (found in -* LfoWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be attributed -* @param channel The MIDI Channel of the MIDI controller to be attributed -* @param min The minimum value to which the controller range is mapped -* @param max The maximum value to which the controller range is mapped -*/ - void appendMidiCC(int controlID, int ccnumber, int channel, int min, int max); -/*! -* @brief This function removes a MIDI controller - GUI element -* binding from the LfoWidget::ccList. -* -* @param controlID The ID of the control GUI element (found in -* LfoWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be removed -* @param channel The MIDI Channel of the MIDI controller to be removed -*/ - void removeMidiCC(int controlID, int ccnumber, int channel); -/*! -* @brief Slot for LfoWidget::triggered signal created by MIDI-Learn context -* menu MIDI Learn action. -* -* This function sets Engine into -* MIDI Learn status for this module and controlID. -* It emits LfoWidget::setMidiLearn with the necessary module and GUI element -* information parameters. -* Engine will then wait for an incoming controller event and trigger the -* attribution by calling appendMidiCC. -* -* @param controlID The ID of the control GUI element (found in -* LfoWidget::midiCCNames) -*/ - void midiLearn(int controlID); -/*! -* @brief Slot for LfoWidget::triggered signal created by a MIDI-Learn -* context menu Forget action. -* -* This function removes a controller -* binding attribution by calling removeMidiCC. -* -* @param controlID The ID of the control GUI element (found in -* LfoWidget::midiCCNames) -*/ - void midiForget(int controlID); -/*! -* @brief Slot for LfoWidget::cancelMidiLearnAction in MIDI-Learn context -* menu. This function signals cancellation of the MIDI-Learn Process to -* Engine. -* -* It emits LfoWidget::setMidiLearn with controlID set to -1 meaning cancel. -*/ - void midiLearnCancel(); }; #endif diff -Nru qmidiarp-0.4.2+git20110704/src/mainwindow.cpp qmidiarp-0.4.2+git20110708/src/mainwindow.cpp --- qmidiarp-0.4.2+git20110704/src/mainwindow.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/mainwindow.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -74,7 +74,17 @@ filename = ""; lastDir = QDir::homePath(); - engine = new Engine(p_portCount, this); + grooveWidget = new GrooveWidget(this); + grooveWindow = new QDockWidget(tr("Groove"), this); + grooveWindow->setFeatures(QDockWidget::DockWidgetClosable + | QDockWidget::DockWidgetMovable + | QDockWidget::DockWidgetFloatable); + grooveWindow->setWidget(grooveWidget);; + grooveWindow->setObjectName("grooveWidget"); + grooveWindow->setVisible(true); + addDockWidget(Qt::BottomDockWidgetArea, grooveWindow); + + engine = new Engine(grooveWidget, p_portCount, this); midiCCTable = new MidiCCTable(engine, this); @@ -97,21 +107,6 @@ connect(this, SIGNAL(runQueue(bool)), engine->seqDriver, SLOT(setQueueStatus(bool))); - grooveWidget = new GrooveWidget(this); - grooveWindow = new QDockWidget(tr("Groove"), this); - grooveWindow->setFeatures(QDockWidget::DockWidgetClosable - | QDockWidget::DockWidgetMovable - | QDockWidget::DockWidgetFloatable); - grooveWindow->setWidget(grooveWidget);; - grooveWindow->setObjectName("grooveWidget"); - grooveWindow->setVisible(true); - addDockWidget(Qt::BottomDockWidgetArea, grooveWindow); - connect(grooveWidget, SIGNAL(newGrooveTick(int)), - engine, SLOT(setGrooveTick(int))); - connect(grooveWidget, SIGNAL(newGrooveVelocity(int)), - engine, SLOT(setGrooveVelocity(int))); - connect(grooveWidget, SIGNAL(newGrooveLength(int)), - engine, SLOT(setGrooveLength(int))); addArpAction = new QAction(QIcon(arpadd_xpm), tr("&New Arp..."), this); addArpAction->setShortcut(QKeySequence(tr("Ctrl+A", "Module|New Arp"))); @@ -378,7 +373,7 @@ this, SLOT(removeArp(int))); connect(moduleWidget, SIGNAL(dockRename(const QString&, int)), this, SLOT(renameDock(const QString&, int))); - connect(moduleWidget, SIGNAL(setMidiLearn(int, int, int)), + connect(moduleWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), engine, SLOT(setMidiLearn(int, int, int))); connect(grooveWidget, SIGNAL(newGrooveTick(int)), @@ -391,12 +386,14 @@ widgetID = engine->arpWidgetCount(); moduleWidget->name = name; moduleWidget->ID = widgetID; + moduleWidget->midiControl->ID = widgetID; engine->addArpWidget(moduleWidget); engine->sendGroove(); count = engine->moduleWindowCount(); moduleWidget->parentDockID = count; + moduleWidget->midiControl->parentDockID = count; appendDock(moduleWidget, name, count); checkIfFirstModule(); @@ -417,16 +414,18 @@ connect(moduleWidget, SIGNAL(moduleClone(int)), this, SLOT(cloneLfo(int))); connect(moduleWidget, SIGNAL(dockRename(const QString&, int)), this, SLOT(renameDock(const QString&, int))); - connect(moduleWidget, SIGNAL(setMidiLearn(int, int, int)), + connect(moduleWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), engine, SLOT(setMidiLearn(int, int, int))); widgetID = engine->lfoWidgetCount(); moduleWidget->name = name; moduleWidget->ID = widgetID; + moduleWidget->midiControl->ID = widgetID; engine->addLfoWidget(moduleWidget); count = engine->moduleWindowCount(); moduleWidget->parentDockID = count; + moduleWidget->midiControl->parentDockID = count; appendDock(moduleWidget, name, count); checkIfFirstModule(); @@ -446,7 +445,7 @@ connect(moduleWidget, SIGNAL(moduleClone(int)), this, SLOT(cloneSeq(int))); connect(moduleWidget, SIGNAL(dockRename(const QString&, int)), this, SLOT(renameDock(const QString&, int))); - connect(moduleWidget, SIGNAL(setMidiLearn(int, int, int)), + connect(moduleWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), engine, SLOT(setMidiLearn(int, int, int))); connect(midiWorker, SIGNAL(noteEvent(int, int)), moduleWidget, SLOT(processNote(int, int))); @@ -454,10 +453,12 @@ widgetID = engine->seqWidgetCount(); moduleWidget->name = name; moduleWidget->ID = widgetID; + moduleWidget->midiControl->ID = widgetID; engine->addSeqWidget(moduleWidget); count = engine->moduleWindowCount(); moduleWidget->parentDockID = count; + moduleWidget->midiControl->parentDockID = count; appendDock(moduleWidget, moduleWidget->name, count); checkIfFirstModule(); @@ -478,18 +479,20 @@ connect(moduleWidget, SIGNAL(moduleClone(int)), this, SLOT(cloneLfo(int))); connect(moduleWidget, SIGNAL(dockRename(const QString&, int)), this, SLOT(renameDock(const QString&, int))); - connect(moduleWidget, SIGNAL(setMidiLearn(int, int, int)), + connect(moduleWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), engine, SLOT(setMidiLearn(int, int, int))); widgetID = engine->lfoWidgetCount(); moduleWidget->name = engine->lfoWidget(ID)->name + "_0"; moduleWidget->ID = widgetID; + moduleWidget->midiControl->ID = widgetID; moduleWidget->copyParamsFrom(engine->lfoWidget(ID)); engine->addLfoWidget(moduleWidget); count = engine->moduleWindowCount(); moduleWidget->parentDockID = count; + moduleWidget->midiControl->parentDockID = count; appendDock(moduleWidget, moduleWidget->name, count); checkIfFirstModule(); @@ -511,7 +514,7 @@ connect(moduleWidget, SIGNAL(moduleClone(int)), this, SLOT(cloneSeq(int))); connect(moduleWidget, SIGNAL(dockRename(const QString&, int)), this, SLOT(renameDock(const QString&, int))); - connect(moduleWidget, SIGNAL(setMidiLearn(int, int, int)), + connect(moduleWidget->midiControl, SIGNAL(setMidiLearn(int, int, int)), engine, SLOT(setMidiLearn(int, int, int))); connect(midiWorker, SIGNAL(noteEvent(int, int)), moduleWidget, SLOT(processNote(int, int))); @@ -519,12 +522,14 @@ widgetID = engine->seqWidgetCount(); moduleWidget->name = engine->seqWidget(ID)->name + "_0"; moduleWidget->ID = widgetID; + moduleWidget->midiControl->ID = widgetID; moduleWidget->copyParamsFrom(engine->seqWidget(ID)); engine->addSeqWidget(moduleWidget); count = engine->moduleWindowCount(); moduleWidget->parentDockID = count; + moduleWidget->midiControl->parentDockID = count; appendDock(moduleWidget, moduleWidget->name, count); } @@ -736,6 +741,9 @@ grooveWidget->grooveVelocity->setValue(xml.readElementText().toInt()); else if (xml.name() == "length") grooveWidget->grooveLength->setValue(xml.readElementText().toInt()); + else if (xml.isStartElement() && (xml.name() == "midiControllers")) { + grooveWidget->midiControl->readData(xml); + } else skipXmlElement(xml); } } @@ -959,6 +967,7 @@ QString::number(engine->grooveVelocity)); xml.writeTextElement("length", QString::number(engine->grooveLength)); + grooveWidget->midiControl->writeData(xml); xml.writeEndElement(); xml.writeEndElement(); diff -Nru qmidiarp-0.4.2+git20110704/src/Makefile.am qmidiarp-0.4.2+git20110708/src/Makefile.am --- qmidiarp-0.4.2+git20110704/src/Makefile.am 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/Makefile.am 2011-07-08 11:06:44.000000000 +0000 @@ -18,6 +18,7 @@ midilfo_moc.cpp \ midiseq_moc.cpp \ midicctable_moc.cpp \ + midicontrol_moc.cpp \ passwidget_moc.cpp \ jacksync_moc.cpp \ seqdriver_moc.cpp \ @@ -39,6 +40,7 @@ midilfo.cpp midilfo.h \ midiseq.cpp midiseq.h \ midicctable.cpp midicctable.h \ + midicontrol.cpp midicontrol.h \ midievent.h \ passwidget.cpp passwidget.h \ jacksync.cpp jacksync.h \ diff -Nru qmidiarp-0.4.2+git20110704/src/midicctable.cpp qmidiarp-0.4.2+git20110708/src/midicctable.cpp --- qmidiarp-0.4.2+git20110704/src/midicctable.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/midicctable.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -74,10 +74,21 @@ midiCCTable->clear(); + ccList = engine->grooveWidget->midiControl->ccList; + + for (l2 = 0; l2 < engine->grooveWidget->midiControl->ccList.count(); l2++) { + + midiCCTable->setVerticalHeaderItem(nrows, + new QTableWidgetItem("Groove")); + + fillControlRow(nrows, ccList.at(l2), -1); + nrows++; + } + for (l1 = 0; l1 < engine->arpWidgetCount(); l1++) { - ccList = engine->arpWidget(l1)->ccList; + ccList = engine->arpWidget(l1)->midiControl->ccList; - for (l2 = 0; l2 < engine->arpWidget(l1)->ccList.count(); l2++) { + for (l2 = 0; l2 < engine->arpWidget(l1)->midiControl->ccList.count(); l2++) { midiCCTable->setVerticalHeaderItem(nrows, new QTableWidgetItem(engine->arpWidget(l1)->name)); @@ -88,9 +99,9 @@ } for (l1 = 0; l1 < engine->lfoWidgetCount(); l1++) { - ccList = engine->lfoWidget(l1)->ccList; + ccList = engine->lfoWidget(l1)->midiControl->ccList; - for (l2 = 0; l2 < engine->lfoWidget(l1)->ccList.count(); l2++) { + for (l2 = 0; l2 < engine->lfoWidget(l1)->midiControl->ccList.count(); l2++) { midiCCTable->setVerticalHeaderItem(nrows, new QTableWidgetItem(engine->lfoWidget(l1)->name)); @@ -101,9 +112,9 @@ } for (l1 = 0; l1 < engine->seqWidgetCount(); l1++) { - ccList = engine->seqWidget(l1)->ccList; + ccList = engine->seqWidget(l1)->midiControl->ccList; - for (l2 = 0; l2 < engine->seqWidget(l1)->ccList.count(); l2++) { + for (l2 = 0; l2 < engine->seqWidget(l1)->midiControl->ccList.count(); l2++) { midiCCTable->setVerticalHeaderItem(nrows, new QTableWidgetItem(engine->seqWidget(l1)->name)); @@ -148,12 +159,14 @@ int l1; QChar moduleType; + engine->grooveWidget->midiControl->ccList.clear(); + for (l1 = 0; l1 < engine->arpWidgetCount(); l1++) - engine->arpWidget(l1)->ccList.clear(); + engine->arpWidget(l1)->midiControl->ccList.clear(); for (l1 = 0; l1 < engine->lfoWidgetCount(); l1++) - engine->lfoWidget(l1)->ccList.clear(); + engine->lfoWidget(l1)->midiControl->ccList.clear(); for (l1 = 0; l1 < engine->seqWidgetCount(); l1++) - engine->seqWidget(l1)->ccList.clear(); + engine->seqWidget(l1)->midiControl->ccList.clear(); for (l1 = 0; l1 < midiCCTable->rowCount(); l1++) { ccnumber = midiCCTable->item(l1, 1)->text().toInt(); @@ -165,16 +178,20 @@ moduleType = midiCCTable->verticalHeaderItem(l1)->text().at(0); switch (moduleType.toLatin1()) { + case 'G': + engine->grooveWidget->midiControl + ->appendMidiCC(ctrlID, ccnumber, channel, min, max); + break; case 'A': - engine->arpWidget(moduleID) + engine->arpWidget(moduleID)->midiControl ->appendMidiCC(ctrlID, ccnumber, channel, min, max); break; case 'L': - engine->lfoWidget(moduleID) + engine->lfoWidget(moduleID)->midiControl ->appendMidiCC(ctrlID, ccnumber, channel, min, max); break; case 'S': - engine->seqWidget(moduleID) + engine->seqWidget(moduleID)->midiControl ->appendMidiCC(ctrlID, ccnumber, channel, min, max); break; } diff -Nru qmidiarp-0.4.2+git20110704/src/midicontrol.cpp qmidiarp-0.4.2+git20110708/src/midicontrol.cpp --- qmidiarp-0.4.2+git20110704/src/midicontrol.cpp 1970-01-01 00:00:00.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/midicontrol.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -0,0 +1,219 @@ +/** + * @file midicontrol.cpp + * @brief Implements the MidiControl QWidget class. + * + * @section LICENSE + * + * Copyright 2009, 2010, 2011 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include +#include +#include "midicontrol.h" + +MidiControl::MidiControl(const QStringList &p_names) +{ + ID = 0; + parentDockID = 0; + names = p_names; + // QSignalMappers allow identifying signal senders for MIDI learn/forget + learnSignalMapper = new QSignalMapper(this); + connect(learnSignalMapper, SIGNAL(mapped(int)), + this, SLOT(midiLearn(int))); + + forgetSignalMapper = new QSignalMapper(this); + connect(forgetSignalMapper, SIGNAL(mapped(int)), + this, SLOT(midiForget(int))); + + // we need the cancel MIDI Learn action only once for all + cancelMidiLearnAction = new QAction(tr("Cancel MIDI &Learning"), this); + connect(cancelMidiLearnAction, SIGNAL(triggered()), this, SLOT(midiLearnCancel())); + cancelMidiLearnAction->setEnabled(false); + ccList.clear(); + modified = false; +} + +MidiControl::~MidiControl() +{ +} + +void MidiControl::appendMidiCC(int controlID, int ccnumber, int channel, int min, int max) +{ + MidiCC midiCC; + int l1 = 0; + midiCC.name = names.at(controlID); + midiCC.ID = controlID; + midiCC.ccnumber = ccnumber; + midiCC.channel = channel; + midiCC.min = min; + midiCC.max = max; + + while ( (l1 < ccList.count()) && + ((controlID != ccList.at(l1).ID) || + (ccnumber != ccList.at(l1).ccnumber) || + (channel != ccList.at(l1).channel)) ) l1++; + + if (ccList.count() == l1) { + ccList.append(midiCC); + qWarning("MIDI Controller %d appended for %s" + , ccnumber, qPrintable(midiCC.name)); + } + else { + qWarning("MIDI Controller %d already attributed to %s" + , ccnumber, qPrintable(midiCC.name)); + } + + cancelMidiLearnAction->setEnabled(false); + modified = true; +} + +bool MidiControl::isModified() +{ + return modified; +} + +void MidiControl::setModified(bool m) +{ + modified = m; +} + +void MidiControl::removeMidiCC(int controlID, int ccnumber, int channel) +{ + for (int l1 = 0; l1 < ccList.count(); l1++) { + if (ccList.at(l1).ID == controlID) { + if (((ccList.at(l1).ccnumber == ccnumber) + && (ccList.at(l1).channel == channel)) + || (0 > channel)) { + ccList.remove(l1); + l1--; + qWarning("controller removed"); + } + } + } + modified = true; +} + +void MidiControl::midiLearn(int controlID) +{ + emit setMidiLearn(parentDockID, ID, controlID); + qWarning("Requesting Midi Learn for %s", qPrintable(names.at(controlID))); + cancelMidiLearnAction->setEnabled(true); +} + +void MidiControl::midiForget(int controlID) +{ + removeMidiCC(controlID, 0, -1); +} + +void MidiControl::midiLearnCancel() +{ + emit setMidiLearn(parentDockID, ID, -1); + qWarning("Cancelling Midi Learn request"); + cancelMidiLearnAction->setEnabled(false); +} + +void MidiControl::addMidiLearnMenu(QWidget *widget, int count) +{ + widget->setContextMenuPolicy(Qt::ContextMenuPolicy(Qt::ActionsContextMenu)); + QAction *learnAction = new QAction(tr("MIDI &Learn"), this); + widget->addAction(learnAction); + connect(learnAction, SIGNAL(triggered()), learnSignalMapper, SLOT(map())); + learnSignalMapper->setMapping(learnAction, count); + + QAction *forgetAction = new QAction(tr("MIDI &Forget"), this); + widget->addAction(forgetAction); + connect(forgetAction, SIGNAL(triggered()), forgetSignalMapper, SLOT(map())); + forgetSignalMapper->setMapping(forgetAction, count); + + widget->addAction(cancelMidiLearnAction); +} + +void MidiControl::readData(QXmlStreamReader& xml) +{ + int controlID, ccnumber, channel, min, max; + while (!xml.atEnd()) { + xml.readNext(); + if (xml.isEndElement()) + break; + if (xml.isStartElement() && (xml.name() == "MIDICC")) { + controlID = xml.attributes().value("CtrlID").toString().toInt(); + ccnumber = -1; + channel = -1; + min = -1; + max = -1; + while (!xml.atEnd()) { + xml.readNext(); + if (xml.isEndElement()) + break; + if (xml.name() == "ccnumber") + ccnumber = xml.readElementText().toInt(); + else if (xml.name() == "channel") + channel = xml.readElementText().toInt(); + else if (xml.name() == "min") + min = xml.readElementText().toInt(); + else if (xml.name() == "max") + max = xml.readElementText().toInt(); + else skipXmlElement(xml); + } + if ((-1 < ccnumber) && (-1 < channel)) + appendMidiCC(controlID, ccnumber, channel, min, max); + else qWarning("Controller data incomplete"); + } + else skipXmlElement(xml); + } +} +void MidiControl::writeData(QXmlStreamWriter& xml) +{ + xml.writeStartElement("midiControllers"); + for (int l1 = 0; l1 < ccList.count(); l1++) { + xml.writeStartElement("MIDICC"); + xml.writeAttribute("CtrlID", QString::number(ccList.at(l1).ID)); + xml.writeTextElement("ccnumber", QString::number( + ccList.at(l1).ccnumber)); + xml.writeTextElement("channel", QString::number( + ccList.at(l1).channel)); + xml.writeTextElement("min", QString::number( + ccList.at(l1).min)); + xml.writeTextElement("max", QString::number( + ccList.at(l1).max)); + xml.writeEndElement(); + } + xml.writeEndElement(); +} + +void MidiControl::skipXmlElement(QXmlStreamReader& xml) +{ + if (xml.isStartElement()) { + qWarning("Unknown Element in XML File: %s",qPrintable(xml.name().toString())); + while (!xml.atEnd()) { + xml.readNext(); + + if (xml.isEndElement()) + break; + + if (xml.isStartElement()) { + skipXmlElement(xml); + } + } + } +} + +void MidiControl::setCcList(const QVector &p_ccList) +{ + ccList = p_ccList; +} diff -Nru qmidiarp-0.4.2+git20110704/src/midicontrol.h qmidiarp-0.4.2+git20110708/src/midicontrol.h --- qmidiarp-0.4.2+git20110704/src/midicontrol.h 1970-01-01 00:00:00.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/midicontrol.h 2011-07-08 11:06:44.000000000 +0000 @@ -0,0 +1,194 @@ +/** + * @file midicontrol.h + * @brief Member definitions for the MidiControl QWidget class. + * + * @section LICENSE + * + * Copyright 2009, 2010, 2011 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#ifndef MIDICONTROL_H +#define MIDICONTROL_H + +#include +#include +#include +#include +#include +#include +#include + +#ifndef MIDICC_H + +/*! @brief Structure holding all elements of a MIDI controller allocated to + * a QMidiArp parameter assigned via MIDI learn + */ +struct MidiCC { + QString name; /**< @brief Name of the assigned parameter (GUI element)*/ + int min; /**< @brief Value output when the CC value is 0 */ + int max; /**< @brief Value output when the CC value is 127 */ + int ccnumber; /**< @brief MIDI CC number of the assigned controller event */ + int channel; /**< @brief MIDI channel on which the controller has to come in */ + int ID; /**< @brief Internal ID of the assigned parameter (GUI element)*/ + }; +#define MIDICC_H +#endif + +/*! + * @brief Manages the list of MIDI-controllable Widgets for a Module. + * + * A MidiControl is instantiated by each of QMidiArp's module widgets. + */ +class MidiControl : public QWidget + +{ + Q_OBJECT + + private: + QAction *cancelMidiLearnAction; + QSignalMapper *learnSignalMapper, *forgetSignalMapper; + QStringList names; + bool modified; +/*! +* @brief This function allows ignoring one XML element in the XML stream +* passed by the caller. +* +* It also advances the stream read-in. It is used to +* ignore unknown elements for both-ways-compatibility +* +* @param xml reference to QXmlStreamReader containing the open XML stream +*/ + void skipXmlElement(QXmlStreamReader& xml); + + public: + MidiControl(const QStringList &p_names); + ~MidiControl(); + int ID; + int parentDockID; + QVector ccList; /**< Contains MIDI controller - GUI element bindings */ +/*! +* @brief Accessor for LfoWidget::modified. +* @return True if unsaved parameter modifications exist +* +*/ + bool isModified(); +/*! +* @brief This function sets LfoWidget::modified. +* @param m Set to True if unsaved parameter modifications appear +* +*/ + void setModified(bool); +/*! +* @brief This function creates and attributes a MIDI-Learn context menu +* to the passed QWidget. +* +* The menu is connected to a QSignalMapper for dispatching its actions +* +* @param *widget QWidget to which the context menu is attributed +* @param count Internal identifier of the controllable QWidget +*/ + void addMidiLearnMenu(QWidget *widget, int count = 0); + + signals: +/*! @brief Emitted to Engine::setMidiLearn to listen for incoming events. + * @param parentDockID SeqWidget::parentDockID of the module to rename + * @param ID SeqWidget::ID of the module receiving the MIDI controller + * @param controlID ID of the GUI element to be assigned to the controller + * */ + void setMidiLearn(int parentDockID, int ID, int controlID); +/*! @brief Forwarded context menu action by signalMapper to call MIDI-Learn/Forget functions. + * @param controlID ID of the GUI element requesting the MIDI controller + * */ + void triggered(int controlID); + + public slots: +/*! +* @brief This function appends a new MIDI controller - GUI element +* binding to LfoWidget::ccList. +* +* Before appending, it checks whether this binding already exists. +* @param controlID The ID of the control GUI element (found in +* LfoWidget::midiCCNames) +* @param ccnumber The CC of the MIDI controller to be attributed +* @param channel The MIDI Channel of the MIDI controller to be attributed +* @param min The minimum value to which the controller range is mapped +* @param max The maximum value to which the controller range is mapped +*/ + void appendMidiCC(int controlID, int ccnumber, int channel, int min, int max); +/*! +* @brief This function removes a MIDI controller - GUI element +* binding from the LfoWidget::ccList. +* +* @param controlID The ID of the control GUI element (found in +* LfoWidget::midiCCNames) +* @param ccnumber The CC of the MIDI controller to be removed +* @param channel The MIDI Channel of the MIDI controller to be removed +*/ + void removeMidiCC(int controlID, int ccnumber, int channel); +/*! +* @brief Slot for LfoWidget::triggered signal created by MIDI-Learn context +* menu MIDI Learn action. +* +* This function sets Engine into +* MIDI Learn status for this module and controlID. +* It emits LfoWidget::setMidiLearn with the necessary module and GUI element +* information parameters. +* Engine will then wait for an incoming controller event and trigger the +* attribution by calling appendMidiCC. +* +* @param controlID The ID of the control GUI element (found in +* LfoWidget::midiCCNames) +*/ + void midiLearn(int controlID); +/*! +* @brief Slot for LfoWidget::triggered signal created by a MIDI-Learn +* context menu Forget action. +* +* This function removes a controller +* binding attribution by calling removeMidiCC. +* +* @param controlID The ID of the control GUI element (found in +* LfoWidget::midiCCNames) +*/ + void midiForget(int controlID); +/*! +* @brief Slot for LfoWidget::cancelMidiLearnAction in MIDI-Learn context +* menu. This function signals cancellation of the MIDI-Learn Process to +* Engine. +* +* It emits LfoWidget::setMidiLearn with controlID set to -1 meaning cancel. +*/ + void midiLearnCancel(); +/*! +* @brief This function reads all parameters of this LFO from an XML stream +* passed by the caller, i.e. MainWindow. +* +* @param xml QXmlStreamWriter to read from +*/ + void readData(QXmlStreamReader& xml); +/*! +* @brief This function writes all parameters of this LFO to an XML stream +* passed by the caller, i.e. MainWindow. +* +* @param xml QXmlStreamWriter to write to +*/ + void writeData(QXmlStreamWriter& xml); + + void setCcList(const QVector &p_ccList); +}; +#endif diff -Nru qmidiarp-0.4.2+git20110704/src/seqwidget.cpp qmidiarp-0.4.2+git20110708/src/seqwidget.cpp --- qmidiarp-0.4.2+git20110704/src/seqwidget.cpp 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/seqwidget.cpp 2011-07-08 11:06:44.000000000 +0000 @@ -46,23 +46,10 @@ QWidget(parent), midiWorker(p_midiWorker), modified(false) { int l1; - - // QSignalMappers allow identifying signal senders for MIDI learn/forget - learnSignalMapper = new QSignalMapper(this); - connect(learnSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiLearn(int))); - - forgetSignalMapper = new QSignalMapper(this); - connect(forgetSignalMapper, SIGNAL(mapped(int)), - this, SLOT(midiForget(int))); - - // we need the cancel MIDI Learn action only once for all - cancelMidiLearnAction = new QAction(tr("Cancel MIDI &Learning"), this); - connect(cancelMidiLearnAction, SIGNAL(triggered()), this, SLOT(midiLearnCancel())); - cancelMidiLearnAction->setEnabled(false); - + QStringList midiCCNames; midiCCNames << "MuteToggle" << "Velocity" << "NoteLength" << "RecordToggle" << "Resolution"<< "Size" << "unknown"; + midiControl = new MidiControl(midiCCNames); // Management Buttons on the right top QHBoxLayout *manageBoxLayout = new QHBoxLayout; @@ -208,7 +195,7 @@ muteOut = new QCheckBox(this); connect(muteOut, SIGNAL(toggled(bool)), this, SLOT(setMuted(bool))); muteLabel->setBuddy(muteOut); - addMidiLearnMenu(muteOut, 0); + midiControl->addMidiLearnMenu(muteOut, 0); QLabel *portLabel = new QLabel(tr("&Port"), portBox); portOut = new QComboBox(portBox); @@ -279,7 +266,7 @@ recordButton->setDefaultAction(recordAction); recordButtonLabel->setBuddy(recordButton); connect(recordAction, SIGNAL(toggled(bool)), this, SLOT(setRecord(bool))); - addMidiLearnMenu(recordButton, 3); + midiControl->addMidiLearnMenu(recordButton, 3); QLabel *resBoxLabel = new QLabel(tr("&Resolution"), seqBox); @@ -295,7 +282,7 @@ resBox->setMinimumContentsLength(3); connect(resBox, SIGNAL(activated(int)), this, SLOT(updateRes(int))); - addMidiLearnMenu(resBox, 4); + midiControl->addMidiLearnMenu(resBox, 4); QLabel *sizeBoxLabel = new QLabel(tr("&Length"), seqBox); sizeBox = new QComboBox(seqBox); @@ -308,7 +295,7 @@ sizeBox->setMinimumContentsLength(3); connect(sizeBox, SIGNAL(activated(int)), this, SLOT(updateSize(int))); - addMidiLearnMenu(sizeBox, 5); + midiControl->addMidiLearnMenu(sizeBox, 5); //temporarily hide these elements until multiple patterns are implemented waveFormBox->setEnabled(false); @@ -320,14 +307,14 @@ tr("Veloc&ity"), seqBox); connect(velocity, SIGNAL(valueChanged(int)), this, SLOT(updateVelocity(int))); - addMidiLearnMenu(velocity, 1); + midiControl->addMidiLearnMenu(velocity, 1); notelength = new Slider(0, 127, 1, 16, 64, Qt::Horizontal, tr("N&ote Length"), seqBox); connect(notelength, SIGNAL(valueChanged(int)), this, SLOT(updateNoteLength(int))); - addMidiLearnMenu(notelength, 2); + midiControl->addMidiLearnMenu(notelength, 2); transpose = new Slider(-24, 24, 1, 2, 0, Qt::Horizontal, tr("&Transpose"), seqBox); @@ -376,7 +363,6 @@ recordMode = false; updateVelocity(64); updateWaveForm(0); - ccList.clear(); lastMute = false; } @@ -461,24 +447,13 @@ xml.writeTextElement("data", tempArray.toHex()); xml.writeEndElement(); - xml.writeStartElement("midiControllers"); - for (int l1 = 0; l1 < ccList.count(); l1++) { - xml.writeStartElement("MIDICC"); - xml.writeAttribute("CtrlID", QString::number(ccList.at(l1).ID)); - xml.writeTextElement("ccnumber", QString::number(ccList.at(l1).ccnumber)); - xml.writeTextElement("channel", QString::number(ccList.at(l1).channel)); - xml.writeTextElement("min", QString::number(ccList.at(l1).min)); - xml.writeTextElement("max", QString::number(ccList.at(l1).max)); - xml.writeEndElement(); - } - xml.writeEndElement(); + midiControl->writeData(xml); xml.writeEndElement(); } void SeqWidget::readData(QXmlStreamReader& xml) { - int controlID, ccnumber, channel, min, max; int tmp; int wvtmp = 0; Sample sample; @@ -615,37 +590,7 @@ } } else if (xml.isStartElement() && (xml.name() == "midiControllers")) { - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.isStartElement() && (xml.name() == "MIDICC")) { - controlID = xml.attributes().value("CtrlID").toString().toInt(); - ccnumber = -1; - channel = -1; - min = -1; - max = -1; - while (!xml.atEnd()) { - xml.readNext(); - if (xml.isEndElement()) - break; - if (xml.name() == "ccnumber") - ccnumber = xml.readElementText().toInt(); - else if (xml.name() == "channel") - channel = xml.readElementText().toInt(); - else if (xml.name() == "min") - min = xml.readElementText().toInt(); - else if (xml.name() == "max") - max = xml.readElementText().toInt(); - else skipXmlElement(xml); - } - - if ((-1 < ccnumber) && (-1 < channel) && (-1 < min) && (-1 < max)) - appendMidiCC(controlID, ccnumber, channel, min, max); - else qWarning("Controller data incomplete"); - } - else skipXmlElement(xml); - } + midiControl->readData(xml); } else skipXmlElement(xml); } @@ -717,7 +662,7 @@ int min = qs2.toInt(); qs2 = qs.section(' ', 4, 4); int max = qs2.toInt(); - appendMidiCC(controlID, ccnumber, channel, min, max); + midiControl->appendMidiCC(controlID, ccnumber, channel, min, max); qs = arpText.readLine(); } qs = arpText.readLine(); @@ -962,12 +907,13 @@ bool SeqWidget::isModified() { - return modified; + return (modified || midiControl->isModified()); } void SeqWidget::setModified(bool m) { modified = m; + midiControl->setModified(m); } void SeqWidget::moduleDelete() @@ -1005,71 +951,6 @@ emit moduleClone(ID); } -void SeqWidget::appendMidiCC(int controlID, int ccnumber, int channel, int min, int max) -{ - MidiCC midiCC; - int l1 = 0; - midiCC.name = midiCCNames.at(controlID); - midiCC.ID = controlID; - midiCC.ccnumber = ccnumber; - midiCC.channel = channel; - midiCC.min = min; - midiCC.max = max; - - while ( (l1 < ccList.count()) && - ((controlID != ccList.at(l1).ID) || - (ccnumber != ccList.at(l1).ccnumber) || - (channel != ccList.at(l1).channel)) ) l1++; - - if (ccList.count() == l1) { - ccList.append(midiCC); - qWarning("MIDI Controller %d appended for %s" - , ccnumber, qPrintable(midiCC.name)); - } - else { - qWarning("MIDI Controller %d already attributed to %s" - , ccnumber, qPrintable(midiCC.name)); - } - - cancelMidiLearnAction->setEnabled(false); - modified = true; -} - -void SeqWidget::removeMidiCC(int controlID, int ccnumber, int channel) -{ - for (int l1 = 0; l1 < ccList.count(); l1++) { - if (ccList.at(l1).ID == controlID) { - if (((ccList.at(l1).ccnumber == ccnumber) - && (ccList.at(l1).channel == channel)) - || (0 > channel)) { - ccList.remove(l1); - l1--; - qWarning("controller removed"); - } - } - } - modified = true; -} - -void SeqWidget::midiLearn(int controlID) -{ - emit setMidiLearn(parentDockID, ID, controlID); - qWarning("Requesting Midi Learn for %s", qPrintable(midiCCNames.at(controlID))); - cancelMidiLearnAction->setEnabled(true); -} - -void SeqWidget::midiForget(int controlID) -{ - removeMidiCC(controlID, 0, -1); -} - -void SeqWidget::midiLearnCancel() -{ - emit setMidiLearn(parentDockID, ID, -1); - qWarning("Cancelling Midi Learn request"); - cancelMidiLearnAction->setEnabled(false); -} - void SeqWidget::setDispVert(int mode) { dispVert[mode]->setChecked(true); @@ -1151,7 +1032,7 @@ for (int l1 = 0; l1 < midiWorker->customWave.count(); l1++) { midiWorker->muteMask.append(midiWorker->customWave.at(l1).muted); } - ccList = fromWidget->ccList; + midiControl->setCcList(fromWidget->midiControl->ccList); muteOut->setChecked(true); updateWaveForm(0); } @@ -1160,19 +1041,3 @@ { return midiWorker->customWave; } - -void SeqWidget::addMidiLearnMenu(QWidget *widget, int count) -{ - widget->setContextMenuPolicy(Qt::ContextMenuPolicy(Qt::ActionsContextMenu)); - QAction *learnAction = new QAction(tr("MIDI &Learn"), this); - widget->addAction(learnAction); - connect(learnAction, SIGNAL(triggered()), learnSignalMapper, SLOT(map())); - learnSignalMapper->setMapping(learnAction, count); - - QAction *forgetAction = new QAction(tr("MIDI &Forget"), this); - widget->addAction(forgetAction); - connect(forgetAction, SIGNAL(triggered()), forgetSignalMapper, SLOT(map())); - forgetSignalMapper->setMapping(forgetAction, count); - - widget->addAction(cancelMidiLearnAction); -} diff -Nru qmidiarp-0.4.2+git20110704/src/seqwidget.h qmidiarp-0.4.2+git20110708/src/seqwidget.h --- qmidiarp-0.4.2+git20110704/src/seqwidget.h 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/seqwidget.h 2011-07-08 11:06:44.000000000 +0000 @@ -40,25 +40,11 @@ #include "midiseq.h" #include "slider.h" #include "seqscreen.h" +#include "midicontrol.h" /*! @brief This array holds the currently available resolution values. */ const int seqResValues[5] = {1, 2, 4, 8, 16}; -#ifndef MIDICC_H - -/*! @brief Structure holding all elements of a MIDI controller allocated to - * a QMidiArp parameter assigned via MIDI learn - */ -struct MidiCC { - QString name; /**< @brief Name of the assigned parameter (GUI element)*/ - int min; /**< @brief Value output when the CC value is 0 */ - int max; /**< @brief Value output when the CC value is 127 */ - int ccnumber; /**< @brief MIDI CC number of the assigned controller event */ - int channel; /**< @brief MIDI channel on which the controller has to come in */ - int ID; /**< @brief Internal ID of the assigned parameter (GUI element)*/ - }; -#define MIDICC_H -#endif /*! * @brief GUI class associated with and controlling a MidiSeq worker @@ -78,9 +64,6 @@ QAction *copyToCustomAction; QAction *deleteAction, *renameAction, *cloneAction; - QAction *cancelMidiLearnAction; - QSignalMapper *learnSignalMapper, *forgetSignalMapper; - QStringList midiCCNames; /**< List of GUI-element names with index = ControlID */ MidiSeq *midiWorker; QVector data; @@ -107,16 +90,6 @@ * */ void loadWaveForms(); -/*! -* @brief This function creates and attributes a MIDI-Learn context menu -* to the passed QWidget. -* -* The menu is connected to a QSignalMapper for dispatching its actions -* -* @param *widget QWidget to which the context menu is attributed -* @param count Internal identifier of the controllable QWidget -*/ - void addMidiLearnMenu(QWidget *widget, int count = 0); bool recordMode; /**< Is set to True if incoming notes are to be step-recorded*/ @@ -139,8 +112,8 @@ QString name; /**< @brief The name of this SeqWidget as shown in the DockWidget TitleBar */ int ID; /**< @brief Corresponds to the Engine::midiSeqList index of the associated MidiSeq */ int parentDockID; /**< @brief The index of the ArpWidget's parent DockWidget in Engine::moduleWindowList */ - QVector ccList; /**< @brief Contains MIDI controller - GUI element bindings */ + MidiControl *midiControl; SeqScreen *screen; QStringList waveForms; QComboBox *chIn; @@ -249,10 +222,6 @@ * @param controlID ID of the GUI element to be assigned to the controller * */ void setMidiLearn(int parentDockID, int ID, int controlID); -/*! @brief Forwarded context menu action by signalMapper to call MIDI-Learn/Forget functions. - * @param controlID ID of the GUI element requesting the MIDI controller - * */ - void triggered(int controlID); /* PUBLIC SLOTS */ public slots: @@ -419,63 +388,6 @@ * signal to MainWindow with the module ID and the dockWidget ID. */ void moduleClone(); -/*! -* @brief This function appends a new MIDI controller - GUI element -* binding to SeqWidget::ccList. -* -* Before appending, it checks whether this binding already exists. -* @param controlID The ID of the control GUI element (found -* in SeqWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be attributed -* @param channel The MIDI Channel of the MIDI controller to be attributed -* @param min The minimum value to which the controller range is mapped -* @param max The maximum value to which the controller range is mapped -*/ - void appendMidiCC(int controlID, int ccnumber, int channel, int min, int max); -/*! -* @brief This function removes a MIDI controller - GUI element -* binding from the SeqWidget::ccList. -* -* @param controlID The ID of the control GUI element (found -* in SeqWidget::midiCCNames) -* @param ccnumber The CC of the MIDI controller to be removed -* @param channel The MIDI Channel of the MIDI controller to be removed -*/ - void removeMidiCC(int controlID, int ccnumber, int channel); -/*! -* @brief Slot for SeqWidget::triggered signal created by MIDI-Learn context -* menu MIDI Learn action. -* -* This function sets Engine into -* MIDI Learn status for this module and controlID. -* It emits SeqWidget::setMidiLearn with the necessary module and GUI element -* information parameters. -* Engine will then wait for an incoming controller event and trigger the -* attribution by calling appendMidiCC. -* -* @param controlID The ID of the control GUI element (found -* in SeqWidget::midiCCNames) -*/ - void midiLearn(int controlID); -/*! -* @brief Slot for SeqWidget::triggered signal created by a -* MIDI-Learn context menu Forget action. -* -* This function removes a controller -* binding attribution by calling removeMidiCC. -* -* @param controlID The ID of the control GUI element (found -* in SeqWidget::midiCCNames) -*/ - void midiForget(int controlID); -/*! -* @brief Slot for SeqWidget::cancelMidiLearnAction in MIDI-Learn -* context menu. This function signals cancellation of the -* MIDI-Learn Process to Engine. -* -* It emits SeqWidget::setMidiLearn with controlID set to -1 meaning cancel. -*/ - void midiLearnCancel(); }; #endif diff -Nru qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_cs.ts qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_cs.ts --- qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_cs.ts 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_cs.ts 2011-07-08 11:06:44.000000000 +0000 @@ -4,98 +4,95 @@ ArpWidget - + Input Vstup - - + + Note Filter Notový filtr - + &Note &Nota - + Output Výstup - + &Mute &Ztlumit - MIDI &Learn - &Učení se MIDI + &Učení se MIDI - Cancel MIDI &Learning - Zrušit &učení se MIDI + Zrušit &učení se MIDI - MIDI &Forget - &Zapomenutí nastavení MIDI + &Zapomenutí nastavení MIDI - + &Port &Přípojka - + Pattern Vzor - + &Edit Pattern &Upravit vzor - + &Remove Pattern &Odstranit vzor - + &Store Pattern &Uložit vzor - + Pattern preset Přednastavení vzoru - + No trigger Přehrát - + Kbd restart Nové spuštění - + Trigger Mode Zůstat stát na nové staccato notě - + &Latch Mode &Držet noty - + Note Filter - ACTIVE Notový filtr - ČINNÝ @@ -120,23 +117,23 @@ p Pause - + &Attack (s) &Náběh (s) - + &Release (s) &Uvolnění (s) - - + + Random Náhodný - + &Rename... Pře&jmenovat... @@ -146,12 +143,12 @@ Strg+R - + Rename this Arp Přejmenovat tento arpeggiator - + &Delete... S&mazat... @@ -161,22 +158,22 @@ Strg+Del - + Delete this Arp Smazat tento arpeggiator - + Repeat mode Režim opakování - + Kbd trigger Rozběhnout se - + 0..9 note played on keyboard, 0 is lowest ( ) numbers in parenthesis are stacked to chords + = - octave up/reset/down @@ -193,33 +190,33 @@ p Přestávka - + &Shift &Posunutí - + Vel&ocity &Rychlost - + &Length &Délka - - + + Envelope Obálka - + Delete "%1"? Smazat "%1"? - + New Name Nový název @@ -228,67 +225,67 @@ Konnte Ressourcendatei nicht speichern - + Could not read from resource file Nepodařilo se číst ze zdrojového souboru - + Random - ACTIVE Náhodný - ČINNÝ - + Envelope - ACTIVE Obálka - ČINNÁ - + %1: Store pattern %1: Uložit vzor - + New pattern Nový vzor - + Arp pattern Vzor pro arpeggiator - + Remove "%1"? Odstranit "%1"? - + &Channel &Каnál - + &Velocity &Rychlost - + C&hannel Ka&nál - + Static Statický - + Up Nahoru - + Down Dolů @@ -314,98 +311,95 @@ LfoWidget - + Output Výstup - + &Mute &Ztlumit - - + + MIDI &CC# - + MIDI Controller number sent to output Číslo ovladače MIDI poslaného do výstupu - + C&hannel &Kanál - + &Port &Přípojka - + &Clone... - + Duplicate this LFO in muted state - + &Rename... Pře&jmenovat... - + Rename this LFO Přejmenovat tento nízkokmitočtový oscilátor (LFO) - + &Delete... S&mazat... - + Delete this LFO Smazat tento nízkokmitočtový oscilátor (LFO) - + Input Vstup - + MIDI Controller number to record Číslo ovladače MIDI pro nahrávání - + &Channel &Каnál - MIDI &Learn - &Učení se MIDI + &Učení se MIDI - Cancel MIDI &Learning - Zrušit &učení se MIDI + Zrušit &učení se MIDI - MIDI &Forget - &Zapomenutí nastavení MIDI + &Zapomenutí nastavení MIDI - + Wave Vlna @@ -414,7 +408,7 @@ Rechte Maustaste: Stummschalten einzelner Punkte, linke Maustaste: Zeichnen der Wellenform - + Waveform Basis Základ tvaru vlny @@ -439,7 +433,7 @@ Län&ge (Takte) - + Right button to mute points Left button to draw custom wave Wheel to change offset @@ -448,32 +442,32 @@ Kolečko myši: změna posunu - + &Frequency &Kmitočet - + Frequency (cycles/beat): Number of wave cycles produced every beat Kmitočet (cyklů za dobu): Počet vytvořených vlnových cyklů za čtvrťový takt - + &Resolution &Rozlišení - + Resolution (events/beat): Number of events produced every beat Rozlišení (události (signály) za dobu): Počet signálů MIDI vytvořených za čtvrťový takt - + &Length &Délka - + Length of LFO wave in beats Délka tvaru vlny LFO ve čtvrťových taktech @@ -482,63 +476,63 @@ &In die freie Wellenform kopieren - - + + Re&cord &Nahrát - + Record incoming controller Nahrát příchozí ovladač - + &Amplitude Ro&zkmit - + &Offset Pos&un - + Sine Sinus - + Saw up Pila nahoru - + Triangle Trojúhelník - + Saw down Pila dolů - + Square Čtverec - + Custom Vlastní - + Delete "%1"? Smazat "%1"? - + New Name Nový název @@ -547,7 +541,7 @@ &MIDI CC# - + &Waveform &Tvar vlny @@ -769,59 +763,59 @@ Přidat krokový sekvencer - + QMidiArp XML files Soubory QMidiArp XML - + Old QMidiArp files Soubory textové soubory QMidiArp - - + + Could not read from file '%1'. Nepodařilo se číst ze souboru '%1'. - + This is not a valid xml file for Toto není platný soubor XML pro - + The QMidiArp text file was imported. If you save this file, it will be saved using the newer xml format under the name '%1'. Textový soubor QMidiArp byl zaveden. Při novém ukládání bude tento uložen v novém formátu xml pod názvem '%1'. - + Could not write to file '%1'. Nepodařilo se zapsat do souboru '%1'. - + Unnamed file was changed. Save changes? Nepojmenovaný soubor byl změněn. Uložit změny? - + File '%1' was changed. Save changes? Soubor '%1' byl změněn. Uložit změny? - + Save changes Uložit změny - + Could not read from resource file Nepodařilo se číst ze zdrojového souboru @@ -885,7 +879,7 @@ - + Open arpeggiator file Otevřít soubor s arpeggiatorem @@ -895,22 +889,22 @@ Tempo vnitřních hodin - + Not a QMidiArp xml file. Není souborem XML QMidiArp. - + Save arpeggiator Uložit arpeggiator - + QMidiArp files Soubory QMidiArp - + Could not write to resource file Nepodařilo se zapsat do zdrojového souboru @@ -1020,6 +1014,24 @@ + MidiControl + + + Cancel MIDI &Learning + Zrušit &učení se MIDI + + + + MIDI &Learn + &Učení se MIDI + + + + MIDI &Forget + &Zapomenutí nastavení MIDI + + + PassWidget @@ -1062,138 +1074,135 @@ SeqWidget - + Transpose the sequence following incoming notes Převést sekvenci skrz příchozí noty - + Output Výstup - + &Mute &Ztlumit - MIDI &Learn - &Učení se MIDI + &Učení se MIDI - Cancel MIDI &Learning - Zrušit &učení se MIDI + Zrušit &učení se MIDI - + Duplicate this Sequencer in muted state - + Display - + &Full - + &Upper - + &Mid - + &Lower - + &Note Off &Nota vypnuta - + Stop output when Note is released Zastavit výstup, když je nota vydána - + &Restart &Spustit znovu - + Restart sequence when a new note is received Spustit sekvenci znovu, když je nota přijata - + &Trigger &Spoušť - + Retrigger sequence when a new note is received Spustit sekvenci znovu, když je přijata nová nota - + &Loop &Smyčka - + Play sequence as loop instead of a single run Přehrávat sekvenci ve smyčce namísto jednoho přehrání - MIDI &Forget - &Zapomenutí nastavení MIDI + &Zapomenutí nastavení MIDI - + Sequence Sekvence - + &Sequence &Sekvence - + Preset Number Číslo přednastavení - - + + Re&cord &Nahrát - + Record step by step Příchozí noty nahrávat krok za krokem - + Resolution (notes/beat): Number of notes produced every beat Rozlišení (not za dobu): Počet not zahraných za čtvrťový takt - + Length of Sequence in beats Délka sekvence ve čtvrťových taktech @@ -1202,17 +1211,17 @@ &Kopírovat do nové vlny - + Veloc&ity &Rychlost - + Delete "%1"? Smazat "%1"? - + New Name Nový název @@ -1225,57 +1234,57 @@ An&schlag - + N&ote Length Délka n&oty - + &Velocity &Rychlost - + &Clone... - + &Rename... Pře&jmenovat... - + Rename this Sequencer Přejmenovat tento sekvencer - + &Delete... S&mazat... - + Delete this Sequencer Smazat tento sekvencer - + Input Vstup - + &Note &Nota - + Set sequence velocity to that of incoming notes Nastavit rychlost sekvence na rychlost příchozích not - + &Channel &Каnál @@ -1284,7 +1293,7 @@ &Notenlänge - + &Transpose &Převést @@ -1297,12 +1306,12 @@ Nummer des gesendeten MIDI Controllers - + &Port &Přípojka - + C&hannel &Kanál @@ -1311,7 +1320,7 @@ Welle - + Right button to mute points, left button to draw custom wave Pravé tlačítko myši: ztlumení jednotlivých bodů, levé tlačítko myši: kreslení tvaru vlny @@ -1332,7 +1341,7 @@ Frequenz (Zyklen pro beat): Anzahl der erzeugten Wellenzyklen pro Vierteltakt - + &Resolution &Rozlišení @@ -1341,7 +1350,7 @@ Auflösung (Signale/beat): Anzahl der pro Vierteltakt erzeugten MIDI Signale - + &Length &Délka @@ -1378,7 +1387,7 @@ Rechteck - + Custom Vlastní diff -Nru qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_de.ts qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_de.ts --- qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_de.ts 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_de.ts 2011-07-08 11:06:44.000000000 +0000 @@ -4,98 +4,95 @@ ArpWidget - + Input Eingang - - + + Note Filter Notenfilter - + &Note &Note - + Output Ausgang - + &Mute &Stumm - MIDI &Learn - &Lerne von MIDI + &Lerne von MIDI - Cancel MIDI &Learning - MIDI-Lernen &Abbrechen + MIDI-Lernen &Abbrechen - MIDI &Forget - MIDI-Steuerungen &vergessen + MIDI-Steuerungen &vergessen - + &Port Anschl&uss - + Pattern Muster - + &Edit Pattern &Bearbeiten - + &Remove Pattern &Löschen - + &Store Pattern &Speichern - + Pattern preset Mustervorlage - + No trigger Durchspielen - + Kbd restart Neustart - + Trigger Mode Verhalten bei neuer Stakato-Note - + &Latch Mode &Noten ha&lten - + Note Filter - ACTIVE Notenfilter - AKTIV @@ -120,23 +117,23 @@ p Pause - + &Attack (s) A&ttack (s) - + &Release (s) - - + + Random Zufall - + &Rename... &Umbenennen... @@ -146,12 +143,12 @@ Strg+R - + Rename this Arp Diesen arpeggiator umbenennen - + &Delete... &Löschen... @@ -161,22 +158,22 @@ Strg+Del - + Delete this Arp Diesen Arpeggiator löschen - + Repeat mode Wiederholungsmodus - + Kbd trigger Loslaufen - + 0..9 note played on keyboard, 0 is lowest ( ) numbers in parenthesis are stacked to chords + = - octave up/reset/down @@ -193,33 +190,33 @@ p Pause - + &Shift &Verschiebung - + Vel&ocity Ans&chlag - + &Length &Dauer - - + + Envelope Hüllkurve - + Delete "%1"? "%1" löschen? - + New Name Neuer Name @@ -228,67 +225,67 @@ Konnte Ressourcendatei nicht speichern - + Could not read from resource file Konnte Ressourcendatei nicht einlesen - + Random - ACTIVE Zufall - AKTIV - + Envelope - ACTIVE Hüllkurve - AKTIV - + %1: Store pattern %1: Muster speichern - + New pattern Neues Muster - + Arp pattern Arp-Muster - + Remove "%1"? "%1" löschen? - + &Channel &Kanal - + &Velocity &Anschlag - + C&hannel Kana&l - + Static Statisch - + Up Aufwärts - + Down Abwärts @@ -314,98 +311,95 @@ LfoWidget - + Output Ausgang - + &Mute &Stumm - - + + MIDI &CC# - + MIDI Controller number sent to output Nummer des gesendeten MIDI Controllers - + C&hannel &Kanal - + &Port An&schluss - + &Clone... &Duplizieren... - + Duplicate this LFO in muted state Diesen LFO in stummem Zustand duplizieren - + &Rename... &Umbenennen... - + Rename this LFO Diesen LFO umbenennen - + &Delete... &Löschen... - + Delete this LFO Diesen LFO löschen - + Input Eingang - + MIDI Controller number to record Die aufzunehmende MIDI Controller ID - + &Channel &Kanal - MIDI &Learn - &Lerne von MIDI + &Lerne von MIDI - Cancel MIDI &Learning - MIDI-Lernen &Abbrechen + MIDI-Lernen &Abbrechen - MIDI &Forget - MIDI-Steuerungen &vergessen + MIDI-Steuerungen &vergessen - + Wave Welle @@ -414,7 +408,7 @@ Rechte Maustaste: Stummschalten einzelner Punkte, linke Maustaste: Zeichnen der Wellenform - + Waveform Basis Wellenformbasis @@ -439,7 +433,7 @@ Län&ge (Takte) - + Right button to mute points Left button to draw custom wave Wheel to change offset @@ -448,32 +442,32 @@ Mausrad: Verschieben des Offsets - + &Frequency &Frequenz - + Frequency (cycles/beat): Number of wave cycles produced every beat Frequenz (Zyklen pro beat): Anzahl der erzeugten Wellenzyklen pro Vierteltakt - + &Resolution &Auflösung - + Resolution (events/beat): Number of events produced every beat Auflösung (Signale/beat): Anzahl der pro Vierteltakt erzeugten MIDI Signale - + &Length &Dauer - + Length of LFO wave in beats Länge der LFO Wellenform in Vierteltakten @@ -482,63 +476,63 @@ &In die freie Wellenform kopieren - - + + Re&cord &Aufnahme - + Record incoming controller Eingehenden MIDI controller aufzeichnen - + &Amplitude Am&plitude - + &Offset &Offset - + Sine Sinus - + Saw up Sägezahn auf - + Triangle Dreieck - + Saw down Sägezahn ab - + Square Rechteck - + Custom Frei - + Delete "%1"? "%1" löschen? - + New Name Neuer Name @@ -547,7 +541,7 @@ &MIDI CC# - + &Waveform &Wellenform @@ -769,59 +763,59 @@ Sequenzer hinzufügen - + QMidiArp XML files QMidiArp XML Dateien - + Old QMidiArp files Alte QMidiArp Textdateien - - + + Could not read from file '%1'. Konnte die Datei '%1' nicht lesen. - + This is not a valid xml file for Dies ist keine gültige xml Datei für - + The QMidiArp text file was imported. If you save this file, it will be saved using the newer xml format under the name '%1'. Die QMidiArp Textdatei wurde importiert. Beim nächsten Speichern wird diese im neueren xml Format gespeichert unter dem Namen '%1'. - + Could not write to file '%1'. Konnte in die Datei '%1' nicht schreiben. - + Unnamed file was changed. Save changes? Die unbenannte Datei wurde verändert. Die Änderungen speichern? - + File '%1' was changed. Save changes? Die Datei '%1' wurde verändert. Die Änderungen speichern? - + Save changes Änderungen speichern - + Could not read from resource file Konnte Ressourcendatei nicht einlesen @@ -885,7 +879,7 @@ - + Open arpeggiator file Arpeggiator-Datei öffnen @@ -895,22 +889,22 @@ Tempo der internen Uhr - + Not a QMidiArp xml file. Keine QMidiArp xml Datei. - + Save arpeggiator Arpeggiator Speichern - + QMidiArp files QMidiArp Dateien - + Could not write to resource file Konnte Ressourcendatei nicht speichern @@ -1020,6 +1014,24 @@ + MidiControl + + + Cancel MIDI &Learning + MIDI-Lernen &Abbrechen + + + + MIDI &Learn + &Lerne von MIDI + + + + MIDI &Forget + MIDI-Steuerungen &vergessen + + + PassWidget @@ -1062,138 +1074,135 @@ SeqWidget - + Transpose the sequence following incoming notes Die Sequenz durch eingehende Note transponieren - + Output Ausgang - + &Mute &Stumm - MIDI &Learn - &Lerne von MIDI + &Lerne von MIDI - Cancel MIDI &Learning - MIDI-Lernen &Abbrechen + MIDI-Lernen &Abbrechen - + Duplicate this Sequencer in muted state Diesen Sequenzer in stummem Zustand duplizieren - + Display Ansicht - + &Full &Voll - + &Upper &Oben - + &Mid &Mitte - + &Lower &Unten - + &Note Off - + Stop output when Note is released Keine Noten senden wenn die Taste losgelassen wird - + &Restart &Neustarten - + Restart sequence when a new note is received Die Sequenz neu starten wenn eine neue Note empfangen wird - + &Trigger - + Retrigger sequence when a new note is received Die Sequenz mit dem timing der empfangenen Noten starten (triggern) - + &Loop &Schleife - + Play sequence as loop instead of a single run Die Sequenz ständig wiederholen anstatt sie nur einmal zu spielen - MIDI &Forget - MIDI-Steuerungen &vergessen + MIDI-Steuerungen &vergessen - + Sequence Sequenz - + &Sequence &Sequenz - + Preset Number Preset Index - - + + Re&cord &Aufnahme - + Record step by step Eingehende Noten Schritt für Schritt aufnehmen - + Resolution (notes/beat): Number of notes produced every beat Auflösung (Noten/Beat): Zahl der in jedem Vierteltakt gespielten Noten - + Length of Sequence in beats Länge der Sequenz in Vierteltakten @@ -1202,17 +1211,17 @@ In neue Wellenform &kopieren - + Veloc&ity An&schlag - + Delete "%1"? "%1" löschen? - + New Name Neuer Name @@ -1225,57 +1234,57 @@ An&schlag - + N&ote Length N&otenlänge - + &Velocity &Anschlag - + &Clone... &Duplizieren... - + &Rename... &Umbenennen... - + Rename this Sequencer Diesen Sequenzer umbenennen - + &Delete... &Löschen... - + Delete this Sequencer Diesen Sequenzer löschen - + Input Eingang - + &Note &Note - + Set sequence velocity to that of incoming notes Anschlag der Sequenz folgt dem der eingehende Noten - + &Channel &Kanal @@ -1284,7 +1293,7 @@ &Notenlänge - + &Transpose &Transponieren @@ -1297,12 +1306,12 @@ Nummer des gesendeten MIDI Controllers - + &Port Anschl&uß - + C&hannel Ka&nal @@ -1311,7 +1320,7 @@ Welle - + Right button to mute points, left button to draw custom wave Rechte Maustaste: Stummschalten einzelner Punkte, linke Maustaste: Zeichnen der Wellenform @@ -1332,7 +1341,7 @@ Frequenz (Zyklen pro beat): Anzahl der erzeugten Wellenzyklen pro Vierteltakt - + &Resolution &Auflösung @@ -1341,7 +1350,7 @@ Auflösung (Signale/beat): Anzahl der pro Vierteltakt erzeugten MIDI Signale - + &Length &Dauer @@ -1378,7 +1387,7 @@ Rechteck - + Custom Frei diff -Nru qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_es.ts qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_es.ts --- qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_es.ts 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_es.ts 2011-07-08 11:06:44.000000000 +0000 @@ -4,158 +4,155 @@ ArpWidget - + &Rename... &Renombrar... - + Rename this Arp Renombrar este arpegiador - + &Delete... &Borrar... - + Delete this Arp Borrar este arpegiador - + Input Entrada - + &Channel &Canal - - + + Note Filter Filtro de nota - + &Note &Nota - + &Velocity &Velocidad - + Output Salida - + &Mute &Silenciar - MIDI &Learn - &Aprendizaje MIDI + &Aprendizaje MIDI - Cancel MIDI &Learning - &Cancelar aprendizaje MIDI + &Cancelar aprendizaje MIDI - MIDI &Forget - &Olvidar MIDI + &Olvidar MIDI - + &Port &Puerto - + C&hannel &Canal - + Pattern Patrón - + &Edit Pattern &Editar patrón - + &Remove Pattern &Borrar patrón - + &Store Pattern &Guardar patrón - + Pattern preset Patrón predefinido - + Static Estático - + Up Subiendo - + Down Bajando - + Repeat mode Modo repetición - + No trigger Sin disparador - + Kbd restart Reinicio de teclado - + Kbd trigger Disparador de teclado - + Trigger Mode Modo disparador - + &Latch Mode &Modo bloqueo - + 0..9 note played on keyboard, 0 is lowest ( ) numbers in parenthesis are stacked to chords + = - octave up/reset/down @@ -172,89 +169,89 @@ p pausa - - + + Random Al azar - + &Shift &Desfase - + Vel&ocity &Velocidad - + &Length &Longitud - - + + Envelope Envoltura - + &Attack (s) &Ataque (s) - + &Release (s) &Liberación (es) - + Note Filter - ACTIVE Filtro de notas - ACTIVO - + Could not read from resource file No se ha podido leer el archivo de recursos - + Random - ACTIVE Aleatorización - ACTIVADA - + Envelope - ACTIVE Envoltura - ACTIVADA - + %1: Store pattern %1: Guardar patrón - + New pattern Nuevo patrón - + Arp pattern Patrón de Arp - + Remove "%1"? ¿Borrar "%1"? - + Delete "%1"? ¿Eliminar "%1"? - + New Name Nuevo nombre @@ -280,103 +277,100 @@ LfoWidget - + &Rename... &Renombrar... - + Rename this LFO Renombrar este LFO - + &Delete... &Borrar... - + Delete this LFO Borrar este LFO - + Output Salida - + &Mute &Silenciar - Cancel MIDI &Learning - &Cancelar aprendizaje MIDI + &Cancelar aprendizaje MIDI - MIDI &Learn - &Aprendizaje MIDI + &Aprendizaje MIDI - MIDI &Forget - &Olvidar MIDI + &Olvidar MIDI - - + + MIDI &CC# MIDI &CC# - + &Clone... - + Duplicate this LFO in muted state - + Input Entrada - + MIDI Controller number to record Número de controlador MIDI a grabar - + &Channel &Canal - + MIDI Controller number sent to output Número de controlador MIDI enviado a la salida - + &Port &Puerto - + C&hannel &Canal - + Wave Onda - + Right button to mute points Left button to draw custom wave Wheel to change offset @@ -385,103 +379,103 @@ Rueda para cambiar desplazamiento - + &Waveform &Forma de onda - + Waveform Basis Forma de onda base - + &Frequency &Frecuencia - + Frequency (cycles/beat): Number of wave cycles produced every beat Frecuencia (ciclos/tiempo): Numero de ciclos de onda producidos en cada tiempo - + &Resolution &Resolución - + Resolution (events/beat): Number of events produced every beat Resolución (eventos/tiempo): Número de eventos producidos por cada tiempo - + &Length &Longitud - + Length of LFO wave in beats Longitud de la onda LFO en tiempos - - + + Re&cord &Grabar - + Record incoming controller Grabar controlador entrante - + &Amplitude &Amplitud - + &Offset &Desplazamiento - + Sine Seno - + Saw up Sierra hacia arriba - + Triangle Triángulo - + Saw down Sierra hacia abajo - + Square Cuadrado - + Custom Personalizado - + Delete "%1"? ¿Eliminar "%1"? - + New Name Nuevo nombre @@ -606,7 +600,7 @@ - + Open arpeggiator file Abrir archivo de arpegiador @@ -782,77 +776,77 @@ Añadir secuenciador de pasos - + QMidiArp XML files Archivos XML de QMidiArp - + Old QMidiArp files Archivos antiguos de QMidiArp - - + + Could not read from file '%1'. No se ha podido leer el archivo '%1'. - + Not a QMidiArp xml file. No es un archivo XML de QMidiArp. - + This is not a valid xml file for Este no es un archivo XML válido para - + The QMidiArp text file was imported. If you save this file, it will be saved using the newer xml format under the name '%1'. El archivo de texto de QMidiArp ha sido importado. Si se guarda este archivo, será almacenado utilizando el nuevo formato XML bajo el nombre '%1'. - + Could not write to file '%1'. No se ha podido grabar el archivo '%1'. - + Save arpeggiator Guardar arpegiador - + QMidiArp files Archivos de QMidiArp - + Unnamed file was changed. Save changes? El archivo sin nombre ha cambiado. ¿Guardarlo? - + File '%1' was changed. Save changes? Archivo '%1' ha cambiado. ¿Guardarlo? - + Save changes Guardar cambios - + Could not read from resource file No se ha podido leer el archivo de recursos - + Could not write to resource file No se ha podido guardar el archivo de recursos @@ -901,6 +895,24 @@ + MidiControl + + + Cancel MIDI &Learning + &Cancelar aprendizaje MIDI + + + + MIDI &Learn + &Aprendizaje MIDI + + + + MIDI &Forget + &Olvidar MIDI + + + PassWidget @@ -931,213 +943,210 @@ SeqWidget - + &Rename... &Renombrar... - + Rename this Sequencer Renombrar este secuenciador - + &Delete... &Borrar... - + Delete this Sequencer Borrar este secuenciador - + Input Entrada - + &Note &Nota - + Transpose the sequence following incoming notes Transportar la secuencia siguiendo las notas siguientes - + &Velocity &Velocidad - + Set sequence velocity to that of incoming notes Establecer la velocidad de la secuencia igual a las notas recibidas - + &Channel &Canal - + Output Salida - + &Mute &Silenciar - Cancel MIDI &Learning - &Cancelar aprendizaje MIDI + &Cancelar aprendizaje MIDI - + &Clone... - + Duplicate this Sequencer in muted state - + Display - + &Full - + &Upper - + &Mid - + &Lower - + &Note Off Desconectar &Nota - + Stop output when Note is released Parar la salida cuando la nota sea liberada - + &Restart &Reinicio - + Restart sequence when a new note is received Reiniciar la secuencia cuando una nueva nota sea recibida - + &Trigger &Disparador - + Retrigger sequence when a new note is received Volver a disparar la secuencia cuando una nueva nota sea recibida - + &Loop &Bucle - + Play sequence as loop instead of a single run Reproducir la secuencia en bucle en lugar de una vez - MIDI &Learn - &Aprendizaje MIDI + &Aprendizaje MIDI - MIDI &Forget - &Olvidar MIDI + &Olvidar MIDI - + &Port &Puerto - + C&hannel &Canal - + Sequence Secuencia - + Right button to mute points, left button to draw custom wave Botón derecho para silenciar puntos, botón izquierdo para dibujar onda personalizada - + &Sequence &Secuencia - + Preset Number Número de patrón - - + + Re&cord &Grabar - + Record step by step Grabar paso a paso - + &Resolution &Resolución - + Resolution (notes/beat): Number of notes produced every beat Resolución (notas/tiempo): número de notas producidas por cada tiempo - + &Length &Longitud - + Length of Sequence in beats Longitud de la secuencia en tiempos @@ -1146,32 +1155,32 @@ C&opiar a nueva onda - + Veloc&ity &Velocidad - + N&ote Length &Longitud de nota - + &Transpose &Transportar - + Custom Personalizado - + Delete "%1"? ¿Eliminar "%1"? - + New Name Nuevo nombre diff -Nru qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_fr.ts qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_fr.ts --- qmidiarp-0.4.2+git20110704/src/translations/qmidiarp_fr.ts 2011-07-06 18:32:51.000000000 +0000 +++ qmidiarp-0.4.2+git20110708/src/translations/qmidiarp_fr.ts 2011-07-08 11:06:44.000000000 +0000 @@ -4,47 +4,47 @@ ArpWidget - + Input Entrée - + &Note - + Output Sortie - + &Port - + Pattern Motif - + &Edit Pattern &Editer le Motif - + &Remove Pattern &Supprimer le Motif - + &Store Pattern &Mémoriser le Motif - + Pattern preset Preset de motif @@ -69,49 +69,49 @@ p pause - + &Attack (s) - + &Release (s) - - + + Random Randomisation - + Repeat mode Mode de répétition - + Kbd trigger Déclenche - + &Shift &Décalage - + Vel&ocity Vél&ocité - + &Length &Durée - - + + Envelope Enveloppe @@ -120,138 +120,135 @@ Erreur d'écriture du fichier ressources - + Could not read from resource file Erreur de lecture du fichier ressources - + Random - ACTIVE Randomisation - ACTIVE - + Envelope - ACTIVE Enveloppe - ACTIVE - + %1: Store pattern %1: Mémoriser le motif - + New pattern Nouveau motif - + Arp pattern Motif d'arpège - + Remove "%1"? Supprimer "%1"? - + &Channel &Canal - + &Rename... &Renommer... - + Rename this Arp Renommer cet arpégiateur - + &Delete... &Supprimer... - + Delete this Arp Supprimer cet arpégiateur - - + + Note Filter Filtre - + &Velocity &Vélocité - + &Mute &Muet - MIDI &Learn - &Apprendre du MIDI + &Apprendre du MIDI - Cancel MIDI &Learning - &Annuler l'apprentissage + &Annuler l'apprentissage - MIDI &Forget - &Oublier les contrôleurs MIDI + &Oublier les contrôleurs MIDI - + C&hannel C&anal - + Static Statique - + Up Monte - + Down Descend - + No trigger Continu - + Kbd restart Redémarre - + Trigger Mode Mode de déclenchement par clavier - + &Latch Mode Véroui&llage clavier - + 0..9 note played on keyboard, 0 is lowest ( ) numbers in parenthesis are stacked to chords + = - octave up/reset/down @@ -268,17 +265,17 @@ p pause - + Note Filter - ACTIVE Filtre - AKTIF - + Delete "%1"? Supprimer "%1"? - + New Name Nouveau nom @@ -304,98 +301,95 @@ LfoWidget - + Output Sortie - + &Mute &Muet - - + + MIDI &CC# - + MIDI Controller number sent to output Numéro du contrôleur envoyé à la sortie - + C&hannel C&anal - + &Port - + &Clone... &Dupliquer... - + Duplicate this LFO in muted state Dupliquer ce LFO en état muet - + &Rename... &Renommer... - + Rename this LFO Renommer ce LFO - + &Delete... &Supprimer... - + Delete this LFO Supprimer ce LFO - + Input Entrée - + MIDI Controller number to record Le numéro du contrôleur MIDI à enregistrer - + &Channel &Canal - MIDI &Learn - &Apprendre du MIDI + &Apprendre du MIDI - Cancel MIDI &Learning - &Annuler l'apprentissage + &Annuler l'apprentissage - MIDI &Forget - &Oublier les contrôleurs MIDI + &Oublier les contrôleurs MIDI - + Wave Forme @@ -404,12 +398,12 @@ Bouton droit de la souris pour rendre muet chaque point, bouton gauche pour dessiner la forme d'onde - + &Waveform Forme d'&onde - + Waveform Basis Base de la forme d'onde @@ -434,7 +428,7 @@ &Longueur (beats) - + Right button to mute points Left button to draw custom wave Wheel to change offset @@ -443,32 +437,32 @@ Molette pour changer l'offset - + &Frequency &Fréquence - + Frequency (cycles/beat): Number of wave cycles produced every beat Fréquence (cycles/beat): Nombre de cycles d'onde produits à chaque quart de temps - + &Resolution &Résolution - + Resolution (events/beat): Number of events produced every beat Résolution (év/beat): Nombre d'évênements produits à chaque quart de temps - + &Length &Durée - + Length of LFO wave in beats Longueur de la forme d'onde du LFO en quarts de temps (beats) @@ -477,63 +471,63 @@ &Copier dans la forme d'onde libre - - + + Re&cord &Enregistrer - + Record incoming controller Enregistrer les évênements contrôleurs reçus à l'entrée - + &Amplitude - + &Offset &Décalage - + Sine Sinus - + Saw up Scie montant - + Triangle - + Saw down Scie descendant - + Square Créneau - + Custom Libre - + Delete "%1"? Supprimer "%1"? - + New Name Nouveau nom @@ -759,59 +753,59 @@ Ajouter un séquenceur - + QMidiArp XML files Fichiers QMidiArp XML - + Old QMidiArp files Vieux fichiers texte QMidiArp - - + + Could not read from file '%1'. Erreur lors de la lecture du fichier '%1'. - + This is not a valid xml file for Ceci n'est pas un fichier xml valide pour - + The QMidiArp text file was imported. If you save this file, it will be saved using the newer xml format under the name '%1'. Le fichier texte QMidiArp a été importé. A la prochaine sauvegarde, il sera écrit au format xml actuel sous le nom '%1'. - + Could not write to file '%1'. Erreur lors de l'écriture du fichier '%1'. - + Unnamed file was changed. Save changes? Le fichier sans nom a été modifié. Enregistrer les modifications? - + File '%1' was changed. Save changes? Le fichier '%1' a été modifié. Enregistrer les modifications? - + Save changes Enregistrer les modifications - + Could not read from resource file Erreur de lecture du fichier ressources @@ -875,27 +869,27 @@ - + Open arpeggiator file Ouvrir un fichier arpège - + Not a QMidiArp xml file. Pas un fichier xml QMidiArp. - + Save arpeggiator Enregistrer l'arpège - + QMidiArp files Fichiers QMidiArp - + Could not write to resource file Erreur d'écriture du fichier ressources @@ -991,6 +985,24 @@ + MidiControl + + + Cancel MIDI &Learning + &Annuler l'apprentissage + + + + MIDI &Learn + &Apprendre du MIDI + + + + MIDI &Forget + &Oublier les contrôleurs MIDI + + + PassWidget @@ -1033,138 +1045,135 @@ SeqWidget - + Transpose the sequence following incoming notes Transposer la séquence suivant les notes entrants - + Output Sortie - + &Mute M&uet - MIDI &Learn - &Apprendre du MIDI + &Apprendre du MIDI - Cancel MIDI &Learning - &Annuler l'apprentissage + &Annuler l'apprentissage - + Duplicate this Sequencer in muted state Dupliquer ce séquenceur en état muet - + Display Affichage - + &Full &Plein - + &Upper &Haut - + &Mid &Milieu - + &Lower &Bas - + &Note Off - + Stop output when Note is released Arrêter l'envoi de notes quand la touche est relâchée - + &Restart &Redémarre - + Restart sequence when a new note is received Redémarrer la séquence au départ quand une nouvelle note est reçue - + &Trigger - + Retrigger sequence when a new note is received Déclencher la séquence avec le timing des notes reçues - + &Loop &Boucle - + Play sequence as loop instead of a single run Jouer la séquence en boucle au lieu d'un passage unique - MIDI &Forget - &Oublier les contrôleurs MIDI + &Oublier les contrôleurs MIDI - + Sequence Séquence - + &Sequence &Séquence - + Preset Number Index Preset - - + + Re&cord &Enregistrer - + Record step by step Enregistrer pas à pas les notes de l'entrée - + Resolution (notes/beat): Number of notes produced every beat Résolution (notes/beat): Nombre de notes produites à chaque quart de mesure - + Length of Sequence in beats Durée de la séquence en quarts de mesure @@ -1173,17 +1182,17 @@ C&opier dans la forme d'onde libre - + Veloc&ity Véloc&ité - + Delete "%1"? Supprimer "%1"? - + New Name Nouveau nom @@ -1196,57 +1205,57 @@ Vélo&cité - + N&ote Length Du&rée des Notes - + &Velocity &Vélocité - + &Clone... &Dupliquer... - + &Rename... &Renommer... - + Rename this Sequencer Renommer ce séquenceur - + &Delete... &Supprimer... - + Delete this Sequencer Supprimer ce séquenceur - + Input Entrée - + &Note &Note - + Set sequence velocity to that of incoming notes La vélocité de la séquence suit celle des notes à l'entrée - + &Channel &Canal @@ -1255,7 +1264,7 @@ &Durée des notes - + &Transpose &Transposer @@ -1268,12 +1277,12 @@ Numéro du contrôleur envoyé à la sortie - + &Port - + C&hannel Cana&l @@ -1282,7 +1291,7 @@ Forme - + Right button to mute points, left button to draw custom wave Bouton droit de la souris pour rendre muet chaque point, bouton gauche pour dessiner la forme d'onde @@ -1303,7 +1312,7 @@ Fréquence (cycles/beat): Nombre de cycles d'onde produits à chaque quart de temps - + &Resolution &Résolution @@ -1312,7 +1321,7 @@ Résolution (év/beat): Nombre d'évênements produits à chaque quart de temps - + &Length &Durée @@ -1341,7 +1350,7 @@ Créneau - + Custom Libre