Skip to content

Commit

Permalink
Merge pull request #3112 from ronso0/controls-fx-parameter-buttons
Browse files Browse the repository at this point in the history
controlpickermenu: add fx parameter buttons & other missing controls
  • Loading branch information
Holzhaus committed Nov 5, 2020
2 parents 603879a + 67e5961 commit 51e1fc0
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 44 deletions.
192 changes: 155 additions & 37 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "controllers/controlpickermenu.h"

#include "vinylcontrol/defs_vinylcontrol.h"
#include "mixer/playermanager.h"
#include "engine/controls/cuecontrol.h"
#include "engine/controls/loopingcontrol.h"
#include "effects/effectrack.h"
#include "effects/effectchainslot.h"
#include "effects/effectslot.h"
#include "effects/effectparameterslot.h"
#include "effects/effectrack.h"
#include "effects/effectslot.h"
#include "engine/controls/cuecontrol.h"
#include "engine/controls/loopingcontrol.h"
#include "mixer/playermanager.h"
#include "recording/defs_recording.h"
#include "vinylcontrol/defs_vinylcontrol.h"

ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
: QMenu(pParent) {
Expand Down Expand Up @@ -344,6 +345,22 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
QString hotcueGotoAndStopDescription = tr("Jump to hotcue %1 and stop");
QString hotcueGotoAndPlayDescription = tr("Jump to hotcue %1 and play");
QString hotcuePreviewDescription = tr("Preview from hotcue %1");
addDeckControl("shift_cues_earlier",
tr("Shift cue points earlier"),
tr("Shift cue points 10 milliseconds earlier"),
hotcueMainMenu);
addDeckControl("shift_cues_earlier_small",
tr("Shift cue points earlier (fine)"),
tr("Shift cue points 1 millisecond earlier"),
hotcueMainMenu);
addDeckControl("shift_cues_later",
tr("Shift cue points later"),
tr("Shift cue points 10 milliseconds later"),
hotcueMainMenu);
addDeckControl("shift_cues_later_small",
tr("Shift cue points later (fine)"),
tr("Shift cue points 1 millisecond later"),
hotcueMainMenu);
// add menus for hotcues 1-16.
// though, keep the menu small put additional hotcues in a separate menu,
// but don't create that submenu for less than 4 additional hotcues.
Expand Down Expand Up @@ -704,10 +721,13 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("Super Knob"),
tr("Super Knob (control effects' Meta Knobs)"),
effectUnitMenu, true, descriptionPrefix);
addControl(effectUnitGroup, "Mix Mode",
tr("Mix Mode Toggle"),
tr("Toggle effect unit between D/W and D+W modes"),
effectUnitMenu, false, descriptionPrefix);
addControl(effectUnitGroup,
"mix_mode",
tr("Mix Mode Toggle"),
tr("Toggle effect unit between D/W and D+W modes"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup, "next_chain",
tr("Next Chain"),
tr("Next chain preset"),
Expand Down Expand Up @@ -842,6 +862,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("Switch to either next or previous effect"),
effectSlotMenu, false, slotDescriptionPrefix);

// Effect parameter knobs
const int numParameterSlots = static_cast<int>(ControlObject::get(
ConfigKey(effectSlotGroup, "num_parameterslots")));
for (int iParameterSlotNumber = 1; iParameterSlotNumber <= numParameterSlots;
Expand Down Expand Up @@ -879,6 +900,37 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
parameterSlotMenu, false,
parameterDescriptionPrefix);
}

// Effect parameter buttons
const int numButtonParameterSlots = static_cast<int>(ControlObject::get(
ConfigKey(effectSlotGroup, "num_button_parameterslots")));
for (int iParameterSlotNumber = 1; iParameterSlotNumber <= numButtonParameterSlots;
++iParameterSlotNumber) {
// The parameter slot group is the same as the effect slot
// group on a standard effect rack.
const QString parameterSlotGroup =
StandardEffectRack::formatEffectSlotGroupString(
iRackNumber - 1, iEffectUnitNumber - 1, iEffectSlotNumber - 1);
const QString parameterSlotItemPrefix =
EffectButtonParameterSlot::formatItemPrefix(
iParameterSlotNumber - 1);
QMenu* parameterSlotMenu = addSubmenu(
m_parameterStr.arg(iParameterSlotNumber),
effectSlotMenu);

QString parameterDescriptionPrefix =
QString("%1, %2").arg(slotDescriptionPrefix,
m_parameterStr.arg(iParameterSlotNumber));

// Likely to change soon.
addControl(parameterSlotGroup,
parameterSlotItemPrefix,
tr("Button Parameter Value"),
tr("Button Parameter Value"),
parameterSlotMenu,
true,
parameterDescriptionPrefix);
}
}
}
// Clear Effect Rack
Expand Down Expand Up @@ -974,42 +1026,91 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)

// Skin Controls
QMenu* guiMenu = addSubmenu(tr("User Interface"));
addControl("[Samplers]", "show_samplers",
tr("Samplers Show/Hide"),
tr("Show/hide the sampler section"), guiMenu);
addControl("[Microphone]", "show_microphone",
tr("Microphone Show/Hide"),
tr("Show/hide the microphone section"), guiMenu);
addControl(VINYL_PREF_KEY, "show_vinylcontrol",
tr("Vinyl Control Show/Hide"),
tr("Show/hide the vinyl control section"), guiMenu);
addControl("[PreviewDeck]", "show_previewdeck",
tr("Preview Deck Show/Hide"),
tr("Show/hide the preview deck"), guiMenu);
addControl("[EffectRack1]", "show",
tr("Effect Rack Show/Hide"),
tr("Show/hide the effect rack"), guiMenu);
addControl("[Library]", "show_coverart",
tr("Cover Art Show/Hide"),
tr("Show/hide cover art"), guiMenu);
addControl("[Master]", "maximize_library",
tr("Library Maximize/Restore"),
tr("Maximize the track library to take up all the available screen space."), guiMenu);
addControl("[Samplers]",
"show_samplers",
tr("Samplers Show/Hide"),
tr("Show/hide the sampler section"),
guiMenu);
addControl("[Microphone]",
"show_microphone",
tr("Microphone & Auxiliary Show/Hide"),
tr("Show/hide the microphone & auxiliary section"),
guiMenu);
addControl("[PreviewDeck]",
"show_previewdeck",
tr("Preview Deck Show/Hide"),
tr("Show/hide the preview deck"),
guiMenu);
addControl("[EffectRack1]",
"show",
tr("Effect Rack Show/Hide"),
tr("Show/hide the effect rack"),
guiMenu);
addControl("[Skin]",
"show_4effectunits",
tr("4 Effect Units Show/Hide"),
tr("Switches between showing 2 and 4 effect units"),
guiMenu);
addControl("[Master]",
"show_mixer",
tr("Mixer Show/Hide"),
tr("Show or hide the mixer."),
guiMenu);
addControl("[Library]",
"show_coverart",
tr("Cover Art Show/Hide (Library)"),
tr("Show/hide cover art in the library"),
guiMenu);
addControl("[Master]",
"maximize_library",
tr("Library Maximize/Restore"),
tr("Maximize the track library to take up all the available screen "
"space."),
guiMenu);

guiMenu->addSeparator();

// TODO(ronso0) Add hint that this currently only affects the Shade skin
addControl("[Skin]",
"show_4decks",
tr("Toggle 4 Decks"),
tr("Switches between showing 2 decks and 4 decks."),
guiMenu);
addControl("[Skin]",
"show_coverart",
tr("Cover Art Show/Hide (Decks)"),
tr("Show/hide cover art in the main decks"),
guiMenu);
addControl(VINYL_PREF_KEY,
"show_vinylcontrol",
tr("Vinyl Control Show/Hide"),
tr("Show/hide the vinyl control section"),
guiMenu);

QString spinnyTitle = tr("Vinyl Spinner Show/Hide");
QString spinnyDescription = tr("Show/hide spinning vinyl widget");
QMenu* spinnyMenu = addSubmenu(spinnyTitle, guiMenu);
guiMenu->addSeparator();
addControl("[Skin]",
"show_spinnies",
tr("Vinyl Spinners Show/Hide (All Decks)"),
tr("Show/Hide all spinnies"),
spinnyMenu);
// TODO(ronso0) Add hint that this currently only affects the Shade skin
for (int i = 1; i <= iNumDecks; ++i) {
addControl(QString("[Spinny%1]").arg(i), "show_spinny",
QString("%1: %2").arg(m_deckStr.arg(i), spinnyTitle),
QString("%1: %2").arg(m_deckStr.arg(i), spinnyDescription), guiMenu);

addControl(QString("[Spinny%1]").arg(i),
"show_spinny",
QString("%1: %2").arg(m_deckStr.arg(i), spinnyTitle),
QString("%1: %2").arg(m_deckStr.arg(i), spinnyDescription),
spinnyMenu);
}

guiMenu->addSeparator();

addControl("[Skin]",
"show_waveforms",
tr("Toggle Waveforms"),
tr("Show/hide the scrolling waveforms."),
guiMenu);
addDeckControl("waveform_zoom", tr("Waveform Zoom"), tr("Waveform zoom"), guiMenu);
addDeckControl("waveform_zoom_down", tr("Waveform Zoom In"), tr("Zoom waveform in"), guiMenu);
addDeckControl("waveform_zoom_up", tr("Waveform Zoom Out"), tr("Zoom waveform out"), guiMenu);
Expand All @@ -1021,6 +1122,18 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("Increase the track rating by one star"), guiMenu);
addDeckAndPreviewDeckControl("stars_down", tr("Star Rating Down"),
tr("Decrease the track rating by one star"), guiMenu);

// Misc. controls
addControl("[Shoutcast]",
"enabled",
tr("Start/Stop Live Broadcasting"),
tr("Stream your mix over the Internet."),
guiMenu);
addControl(RECORDING_PREF_KEY,
"toggle_recording",
tr("Record Mix"),
tr("Start/stop recording your mix."),
guiMenu);
}

ControlPickerMenu::~ControlPickerMenu() {
Expand Down Expand Up @@ -1106,7 +1219,12 @@ void ControlPickerMenu::addPlayerControl(QString control, QString controlTitle,

for (int i = 1; previewdeckControls && i <= iNumPreviewDecks; ++i) {
// PlayerManager::groupForPreviewDeck is 0-indexed.
QString prefix = m_previewdeckStr.arg(i);
QString prefix;
if (iNumPreviewDecks == 1) {
prefix = m_previewdeckStr.arg("");
} else {
prefix = m_previewdeckStr.arg(i);
}
QString group = PlayerManager::groupForPreviewDeck(i - 1);
addSingleControl(group, control, controlTitle, controlDescription,
controlMenu, prefix, prefix);
Expand Down
19 changes: 12 additions & 7 deletions src/controllers/dlgcontrollerlearning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,18 @@ void DlgControllerLearning::controlClicked(ControlObject* pControl) {
qWarning() << "Mixxx UI element clicked for which there is no "
"learnable control " << key.group << " " << key.item;
QMessageBox::warning(
this,
Version::applicationName(),
tr("The control you clicked in Mixxx is not learnable.\n"
"This could be because you are using an old skin"
" and this control is no longer supported.\n"
"\nYou tried to learn: %1,%2").arg(key.group, key.item),
QMessageBox::Ok, QMessageBox::Ok);
this,
Version::applicationName(),
tr("The control you clicked in Mixxx is not learnable.\n"
"This could be because you are either using an old skin"
" and this control is no longer supported, "
"or you clicked a control that provides visual feedback"
" and can only be mapped to outputs like LEDs via"
" scripts.\n"
"\nYou tried to learn: %1,%2")
.arg(key.group, key.item),
QMessageBox::Ok,
QMessageBox::Ok);
return;
}
controlPicked(key);
Expand Down

0 comments on commit 51e1fc0

Please sign in to comment.