Skip to content

Commit

Permalink
Add a testcase and addressing couple of nits
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Mar 30, 2024
1 parent 53ef29e commit 3bf2f62
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,7 @@ add_executable(mixxx-test
src/test/configobject_test.cpp
src/test/controller_mapping_validation_test.cpp
src/test/controller_mapping_settings_test.cpp
src/test/controllers/controller_columnid_regression_test.cpp
src/test/controllerscriptenginelegacy_test.cpp
src/test/controlobjecttest.cpp
src/test/controlobjectaliastest.cpp
Expand Down
54 changes: 27 additions & 27 deletions res/controllers/Traktor Kontrol S4 MK3.hid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
</description>
</option>
<option
variable="mixerControlsMixAuxOnShift"
variable="mixerControlsMicAuxOnShift"
type="boolean"
default="false"
default="true"
label="Shift to mix microphones or auxiliary lines">
<description>
When shifting decks, the mixer controls microphones or auxiliary lines. If both a microphone and an auxiliary are configured on the same channel, the mixer will prioritize controlling the auxiliary.
Expand Down Expand Up @@ -352,19 +352,19 @@
<value label="Artist" default="true">1</value>
<value label="Title">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -379,19 +379,19 @@
<value label="Artist">1</value>
<value label="Title" default="true">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -406,19 +406,19 @@
<value label="Artist">1</value>
<value label="Title">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM" default="true">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -433,19 +433,19 @@
<value label="Artist">1</value>
<value label="Title">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -460,19 +460,19 @@
<value label="Artist">1</value>
<value label="Title">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -487,19 +487,19 @@
<value label="Artist">1</value>
<value label="Title">2</value>
<value label="Album">3</value>
<value label="Albumartist">4</value>
<value label="Album Artist">4</value>
<value label="Year">5</value>
<value label="Genre">6</value>
<value label="Composer">7</value>
<value label="Grouping">8</value>
<value label="Tracknumber">9</value>
<value label="Filetype">10</value>
<value label="Track Number">9</value>
<value label="File Type">10</value>
<value label="Native Location">11</value>
<value label="Comment">12</value>
<value label="Duration">13</value>
<value label="Bitrate">14</value>
<value label="BPM">15</value>
<value label="ReplayGain">16</value>
<value label="Replay Gain">16</value>
<value label="Datetime Added">17</value>
<value label="Times Played">18</value>
<value label="Rating">19</value>
Expand All @@ -513,7 +513,7 @@
variable="loopWheelMoveFactor"
type="integer"
min="20"
max="250"
max="500"
step="2"
default="50"
label="Jogwheel sensitivity in loop mode" />
Expand Down
4 changes: 2 additions & 2 deletions res/controllers/Traktor-Kontrol-S4-MK3.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const KeyboardColors = [

/*
* USER CONFIGURABLE SETTINGS
* Change settings in the preferences (Mixxx >= 2.5)
* Change settings in the preferences
*/

const DeckColors = [
Expand Down Expand Up @@ -88,7 +88,7 @@ const WheelLedBlinkOnTrackEnd = !!engine.getSetting("wheelLedBlinkOnTrackEnd");

// When shifting either decks, the mixer will control microphones or auxiliary lines. If there is both a mic and an configure on the same channel, the mixer will control the auxiliary.
// Default: false
const MixerControlsMixAuxOnShift = !!engine.getSetting("mixerControlsMixAuxOnShift");
const MixerControlsMixAuxOnShift = !!engine.getSetting("mixerControlsMicAuxOnShift");

// Define how many wheel moves are sampled to compute the speed. The more you have, the more the speed is accurate, but the
// less responsive it gets in Mixxx. Default: 5
Expand Down
5 changes: 5 additions & 0 deletions src/controllers/legacycontrollersettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ class LegacyControllerEnumSetting
return QJSValue(stringify());
}

const QList<std::tuple<QString, QString>>& options() const {
return m_options;
}

QString stringify() const override {
return std::get<0>(m_options.value(static_cast<int>(m_savedValue)));
}
Expand Down Expand Up @@ -416,6 +420,7 @@ class LegacyControllerEnumSetting
size_t m_editedValue;

friend class LegacyControllerMappingSettingsTest_enumSettingEditing_Test;
friend class ControllerS4MK3SettingTest_ensureLibrarySettingValueAndEnumEquals;
};

template<>
Expand Down

0 comments on commit 3bf2f62

Please sign in to comment.