-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adds support for MIDI CC events inside LMMS #5581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
374abf2
First commit
IanCaio f1603ea
Updates the MIDI CC Rack GUI
IanCaio 53fe0d0
Keeps working on the MIDI CC Rack GUI
IanCaio 755cf12
Add class members
IanCaio 7599fec
Starts implementing the track ComboBox syncing
IanCaio fb71375
Updates tracks ComboBox when tracks are moved
IanCaio c58fbbe
Merge branch 'master' into feature/midiCCSupport
IanCaio a309207
Merge branch 'master' into feature/midiCCSupport
IanCaio cfead27
Starts implementing the CC controllers models
IanCaio f73d42f
Implements the CC event handling itself
IanCaio 72addfe
Adds the enable/disable functionality for MIDI CC
IanCaio 65a2bc0
Changes shortcuts and titles
IanCaio 7546e22
Merge branch 'master' into feature/midiCCSupport
IanCaio f2d5302
Removes unused comment
IanCaio 15141a9
Fix SEGFAULT bug and hide MIDI CC rack at start up
IanCaio 6dc7018
Save/Load MIDI controllers models on project file
IanCaio cedcf6b
Uses lambda functions instead of QSignalMapper
IanCaio 0ff2835
Corrects tooltip of MIDI CC rack
IanCaio 64c83ff
Removes unused header
IanCaio 36a6de3
Includes the MIDI CC Rack in the View Menu
IanCaio 73216f4
Merge branch 'master' into feature/midiCCSupport
IanCaio c40fc49
Replaces constant with existent one from Midi.h
IanCaio e0a3939
Processes MIDI CC rack events as hardware ones
IanCaio d18b25b
Merge branch 'master' into feature/midiCCSupport
IanCaio 6abd130
Fixes a Segmentation Fault bug
IanCaio 279832a
Merge branch 'master' into feature/midiCCSupport
IanCaio 56363bf
Fixes mistake on processInEvent logic
IanCaio 91d9d06
Fixes memory leak and "used ID" bug
IanCaio df544ee
Merge branch 'master' into feature/midiCCSupport
IanCaio 39c21b6
Changes MIDI CC Rack GUI
IanCaio b3e2479
Fixes bug where CC events are ignored on export
IanCaio 527a959
Removes argument from MidiEvent copy constructor
IanCaio b8081a4
Changes variable fromHardware to ignoreOnExport
IanCaio 19018c3
Remove unused signals
IanCaio 23911d2
Randomizes MIDI CC rack position
IanCaio b104f99
Merge branch 'master' into feature/midiCCSupport
IanCaio c0a5c66
Merge branch 'master' into feature/midiCCSupport
IanCaio aba42c2
Fixes some code style issues
IanCaio babeb8e
Merge branch 'master' into feature/midiCCSupport
IanCaio d791b7e
Moves MidiCCRackView.cpp to src/gui
IanCaio df71382
Removes track label and increases knobs per row
IanCaio 7d78af8
Adds tr and remove unnecessary QString conversions
IanCaio c928f97
Uses std::unique_ptr for the MIDI CC models
IanCaio aa6345b
Implements the MidiCCRackView destructor
IanCaio 2e2b7c0
Uses lazy creation on the MidiCCRackView
IanCaio f4e5662
Merge branch 'master' into feature/midiCCSupport
IanCaio 9d1aab6
Changes access specifiers and destructor
IanCaio 6bc6d8b
Changes MIDI CC Rack icon
IanCaio 2c6a55f
Uses the MIDI CC icon on the menu action too
IanCaio 4a4cead
Reorganizes included headers
IanCaio 291ebc4
Changes code to use std::make_unique
IanCaio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #ifndef MIDI_CC_RACK_VIEW_H | ||
| #define MIDI_CC_RACK_VIEW_H | ||
|
|
||
| #include <QWidget> | ||
|
|
||
| #include "GroupBox.h" | ||
| #include "Knob.h" | ||
| #include "Midi.h" | ||
| #include "SerializingObject.h" | ||
|
|
||
| class InstrumentTrack; | ||
|
|
||
| class MidiCCRackView : public QWidget, public SerializingObject | ||
| { | ||
| Q_OBJECT | ||
| public: | ||
| MidiCCRackView(InstrumentTrack * track); | ||
| ~MidiCCRackView() override; | ||
|
|
||
| void saveSettings(QDomDocument & doc, QDomElement & parent) override; | ||
| void loadSettings(const QDomElement &) override; | ||
|
|
||
| inline QString nodeName() const override | ||
| { | ||
| return "MidiCCRackView"; | ||
| } | ||
|
|
||
| private slots: | ||
| void renameWindow(); | ||
|
|
||
| private: | ||
| InstrumentTrack *m_track; | ||
|
|
||
| GroupBox *m_midiCCGroupBox; // MIDI CC GroupBox (used to enable disable MIDI CC) | ||
|
|
||
| Knob *m_controllerKnob[MidiControllerCount]; // Holds the knob widgets for each controller | ||
|
|
||
| }; | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| /* | ||
| * MidiCCRackView.cpp - implementation of the MIDI CC rack widget | ||
| * | ||
| * Copyright (c) 2020 Ian Caio <iancaio_dev/at/hotmail.com> | ||
| * | ||
| * This file is part of LMMS - https://lmms.io | ||
| * | ||
| * 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 (see COPYING); if not, write to the | ||
| * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| * Boston, MA 02110-1301 USA. | ||
| * | ||
| */ | ||
|
|
||
|
|
||
| #include "MidiCCRackView.h" | ||
|
|
||
| #include <QGridLayout> | ||
| #include <QMdiSubWindow> | ||
| #include <QScrollArea> | ||
| #include <QVBoxLayout> | ||
| #include <QWidget> | ||
|
|
||
| #include "embed.h" | ||
| #include "GroupBox.h" | ||
| #include "GuiApplication.h" | ||
| #include "InstrumentTrack.h" | ||
| #include "Knob.h" | ||
| #include "MainWindow.h" | ||
| #include "Track.h" | ||
|
|
||
|
|
||
| MidiCCRackView::MidiCCRackView(InstrumentTrack * track) : | ||
| QWidget(), | ||
| m_track(track) | ||
| { | ||
| setWindowIcon(embed::getIconPixmap("midi_cc_rack")); | ||
| setWindowTitle(tr("MIDI CC Rack - %1").arg(m_track->name())); | ||
|
|
||
| QMdiSubWindow * subWin = gui->mainWindow()->addWindowedWidget(this); | ||
|
|
||
| // Remove maximize button | ||
| Qt::WindowFlags flags = subWin->windowFlags(); | ||
| flags &= ~Qt::WindowMaximizeButtonHint; | ||
| subWin->setWindowFlags(flags); | ||
|
|
||
| // Adjust window attributes, sizing and position | ||
| subWin->setAttribute(Qt::WA_DeleteOnClose, false); | ||
| subWin->resize(350, 300); | ||
| subWin->setFixedWidth(350); | ||
| subWin->setMinimumHeight(300); | ||
| subWin->hide(); | ||
|
|
||
| // Main window layout | ||
| QVBoxLayout *mainLayout = new QVBoxLayout(this); | ||
|
|
||
| // Knobs GroupBox - Here we have the MIDI CC controller knobs for the selected track | ||
| m_midiCCGroupBox = new GroupBox(tr("MIDI CC Knobs:")); | ||
|
|
||
| // Layout to keep scrollable area under the GroupBox header | ||
| QVBoxLayout *knobsGroupBoxLayout = new QVBoxLayout(); | ||
| knobsGroupBoxLayout->setContentsMargins(5, 16, 5, 5); | ||
|
|
||
| m_midiCCGroupBox->setLayout(knobsGroupBoxLayout); | ||
|
|
||
| // Scrollable area + widget + its layout that will have all the knobs | ||
| QScrollArea *knobsScrollArea = new QScrollArea(); | ||
| QWidget *knobsArea = new QWidget(); | ||
| QGridLayout *knobsAreaLayout = new QGridLayout(); | ||
|
|
||
| knobsArea->setLayout(knobsAreaLayout); | ||
| knobsScrollArea->setWidget(knobsArea); | ||
| knobsScrollArea->setWidgetResizable(true); | ||
|
|
||
| knobsGroupBoxLayout->addWidget(knobsScrollArea); | ||
|
|
||
| // Adds the controller knobs | ||
| for (int i = 0; i < MidiControllerCount; ++i) | ||
| { | ||
| m_controllerKnob[i] = new Knob(knobBright_26); | ||
| m_controllerKnob[i]->setLabel(tr("CC %1").arg(i)); | ||
| knobsAreaLayout->addWidget(m_controllerKnob[i], i/4, i%4); | ||
| } | ||
|
|
||
| // Set all the models | ||
| // Set the LED button to enable/disable the track midi cc | ||
| m_midiCCGroupBox->setModel(m_track->m_midiCCEnable.get()); | ||
|
|
||
| // Set the model for each Knob | ||
| for (int i = 0; i < MidiControllerCount; ++i) | ||
| { | ||
| m_controllerKnob[i]->setModel(m_track->m_midiCCModel[i].get()); | ||
| } | ||
|
|
||
| // Connection to update the name of the track on the label | ||
| connect(m_track, SIGNAL(nameChanged()), | ||
| this, SLOT(renameWindow())); | ||
|
|
||
| // Adding everything to the main layout | ||
| mainLayout->addWidget(m_midiCCGroupBox); | ||
| } | ||
|
|
||
| MidiCCRackView::~MidiCCRackView() | ||
| { | ||
| if(parentWidget()) | ||
| { | ||
| parentWidget()->hide(); | ||
| parentWidget()->deleteLater(); | ||
| } | ||
| } | ||
|
|
||
| void MidiCCRackView::renameWindow() | ||
| { | ||
| setWindowTitle(tr("MIDI CC Rack - %1").arg(m_track->name())); | ||
| } | ||
|
|
||
| void MidiCCRackView::saveSettings(QDomDocument & doc, QDomElement & parent) | ||
| { | ||
| } | ||
|
|
||
| void MidiCCRackView::loadSettings(const QDomElement &) | ||
| { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.