forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controlpickermenu.cpp
1682 lines (1577 loc) · 68.2 KB
/
controlpickermenu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "controllers/controlpickermenu.h"
#include "control/controlobject.h"
#include "effects/chains/equalizereffectchain.h"
#include "effects/chains/standardeffectchain.h"
#include "effects/defs.h"
#include "effects/effectbuttonparameterslot.h"
#include "effects/effectknobparameterslot.h"
#include "engine/controls/cuecontrol.h"
#include "engine/controls/loopingcontrol.h"
#include "mixer/playermanager.h"
#include "moc_controlpickermenu.cpp"
#include "recording/defs_recording.h"
#include "vinylcontrol/defs_vinylcontrol.h"
namespace {
const QString kAppGroup = QStringLiteral("[App]");
} // namespace
ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
: QMenu(pParent) {
m_effectMainOutputStr = tr("Main Output");
m_effectHeadphoneOutputStr = tr("Headphone Output");
m_deckStr = tr("Deck %1");
m_samplerStr = tr("Sampler %1");
m_previewdeckStr = tr("Preview Deck %1");
m_microphoneStr = tr("Microphone %1");
m_auxStr = tr("Auxiliary %1");
m_resetStr = tr("Reset to default");
m_effectRackStr = tr("Effect Rack %1");
m_effectUnitStr = tr("Effect Unit %1");
m_effectStr = tr("Slot %1");
m_parameterStr = tr("Parameter %1");
m_buttonParameterStr = tr("Button Parameter %1");
m_libraryStr = tr("Library");
m_numGroupsTrMap.insert("Channel", m_deckStr);
m_numGroupsTrMap.insert("Sampler", m_samplerStr);
m_numGroupsTrMap.insert("PreviewDeck", m_previewdeckStr);
m_numGroupsTrMap.insert("Microphone", m_microphoneStr);
m_numGroupsTrMap.insert("Auxiliary", m_auxStr);
m_numGroupsTrMap.insert("EffectRack", m_effectRackStr);
m_otherGroupsTrMap.insert("Skin", tr("Skin"));
m_otherGroupsTrMap.insert("Library", m_libraryStr);
m_otherGroupsTrMap.insert("Controller", tr("Controller"));
// TODO(ronso0) "translate" legacy 'Master' to 'Main' in main branch?
m_otherGroupsTrMap.insert("Master", "Master");
// Mixer Controls
QMenu* mixerMenu = addSubmenu(tr("Mixer"));
// Crossfader / Orientation
QMenu* crossfaderMenu = addSubmenu(tr("Crossfader / Orientation"), mixerMenu);
addControl("[Master]",
"crossfader",
tr("Crossfader"),
tr("Crossfader"),
crossfaderMenu,
true);
addDeckAndSamplerControl("orientation",
tr("Orientation"),
tr("Mix orientation (e.g. left, right, center)"),
crossfaderMenu);
addDeckAndSamplerControl("orientation_left",
tr("Orient Left"),
tr("Set mix orientation to left"),
crossfaderMenu);
addDeckAndSamplerControl("orientation_center",
tr("Orient Center"),
tr("Set mix orientation to center"),
crossfaderMenu);
addDeckAndSamplerControl("orientation_right",
tr("Orient Right"),
tr("Set mix orientation to right"),
crossfaderMenu);
// Main Output
QMenu* mainOutputMenu = addSubmenu(tr("Main Output"), mixerMenu);
addControl("[Master]",
"gain",
tr("Main Output Gain"),
tr("Main Output gain"),
mainOutputMenu,
true);
addControl("[Master]",
"balance",
tr("Main Output Balance"),
tr("Main Output balance"),
mainOutputMenu,
true);
addControl("[Master]",
"delay",
tr("Main Output Delay"),
tr("Main Output delay"),
mainOutputMenu,
true);
// Headphone
QMenu* headphoneMenu = addSubmenu(tr("Headphone"), mixerMenu);
addControl("[Master]",
"headGain",
tr("Headphone Gain"),
tr("Headphone gain"),
headphoneMenu,
true);
addControl("[Master]",
"headMix",
tr("Headphone Mix"),
tr("Headphone mix (pre/main)"),
headphoneMenu,
true);
addControl("[Master]",
"headSplit",
tr("Headphone Split Cue"),
tr("Toggle headphone split cueing"),
headphoneMenu);
addControl("[Master]",
"headDelay",
tr("Headphone Delay"),
tr("Headphone delay"),
headphoneMenu,
true);
mixerMenu->addSeparator();
// EQs
QMenu* eqMenu = addSubmenu(tr("Equalizers"), mixerMenu);
constexpr int kNumEqRacks = 1;
const int iNumDecks = static_cast<int>(ControlObject::get(
ConfigKey(kAppGroup, QStringLiteral("num_decks"))));
QList<QString> eqNames = {tr("Low EQ"), tr("Mid EQ"), tr("High EQ")};
for (int iRackNumber = 0; iRackNumber < kNumEqRacks; ++iRackNumber) {
// TODO: Although there is a mode with 4-band EQs, it's not feasible
// right now to add support for learning both it and regular 3-band eqs.
// Since 3-band is by far the most common, stick with that.
const int kMaxEqs = 3;
for (int deck = 1; deck <= iNumDecks; ++deck) {
QMenu* deckMenu = addSubmenu(QString("Deck %1").arg(deck), eqMenu);
for (int effect = kMaxEqs - 1; effect >= 0; --effect) {
const QString group = EqualizerEffectChain::formatEffectSlotGroup(
QString("[Channel%1]").arg(deck));
QMenu* bandMenu = addSubmenu(eqNames[effect], deckMenu);
QString control = "parameter%1";
addControl(group,
control.arg(effect + 1),
tr("Adjust %1").arg(eqNames[effect]),
tr("Adjust %1").arg(eqNames[effect]),
bandMenu,
true,
tr("Deck %1").arg(deck));
control = "button_parameter%1";
addControl(group,
control.arg(effect + 1),
tr("Kill %1").arg(eqNames[effect]),
tr("Kill %1").arg(eqNames[effect]),
bandMenu,
false,
tr("Deck %1").arg(deck));
}
}
}
mixerMenu->addSeparator();
// Volume / Pfl controls
addDeckAndSamplerControl("volume", tr("Volume"), tr("Volume Fader"), mixerMenu, true);
addDeckAndSamplerControl("volume_set_one",
tr("Full Volume"),
tr("Set to full volume"),
mixerMenu);
addDeckAndSamplerControl("volume_set_zero",
tr("Zero Volume"),
tr("Set to zero volume"),
mixerMenu);
addDeckAndSamplerAndPreviewDeckControl("pregain",
tr("Track Gain"),
tr("Track Gain knob"),
mixerMenu,
true);
addDeckAndSamplerControl("mute", tr("Mute"), tr("Mute button"), mixerMenu);
mixerMenu->addSeparator();
addDeckAndSamplerControl("pfl",
tr("Headphone Listen"),
tr("Headphone listen (pfl) button"),
mixerMenu);
addSeparator();
// Transport
QMenu* transportMenu = addSubmenu(tr("Transport"));
addDeckAndSamplerAndPreviewDeckControl("play", tr("Play"), tr("Play button"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("back", tr("Fast Rewind"), tr("Fast Rewind button"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("fwd", tr("Fast Forward"), tr("Fast Forward button"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("playposition",
tr("Strip Search"),
tr("Strip-search through track"),
transportMenu);
addDeckAndSamplerAndPreviewDeckControl("reverse", tr("Play Reverse"), tr("Play Reverse button"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("reverseroll",
tr("Reverse Roll (Censor)"),
tr("Reverse roll (Censor) button"),
transportMenu);
addDeckAndSamplerAndPreviewDeckControl("start", tr("Jump To Start"), tr("Jumps to start of track"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("start_play",
tr("Play From Start"),
tr("Jump to start of track and play"),
transportMenu);
addDeckAndSamplerAndPreviewDeckControl("stop", tr("Stop"), tr("Stop button"), transportMenu);
addDeckAndSamplerAndPreviewDeckControl("start_stop",
tr("Stop And Jump To Start"),
tr("Stop playback and jump to start of track"),
transportMenu);
addDeckAndSamplerAndPreviewDeckControl("end", tr("Jump To End"), tr("Jump to end of track"), transportMenu);
transportMenu->addSeparator();
addDeckAndSamplerAndPreviewDeckControl("eject",
tr("Eject"),
tr("Eject or un-eject track, i.e. reload the last-ejected track "
"(of any deck)<br>"
"Double-press to reload the last replaced track. In empty decks "
"it reloads the second-last ejected track."),
transportMenu);
addDeckAndSamplerControl("repeat", tr("Repeat Mode"), tr("Toggle repeat mode"), transportMenu);
addDeckAndSamplerControl("slip_enabled", tr("Slip Mode"), tr("Toggle slip mode"), transportMenu);
// BPM / Beatgrid
QMenu* bpmMenu = addSubmenu(tr("BPM / Beatgrid"));
addDeckAndSamplerControl("bpm", tr("BPM"), tr("BPM"), bpmMenu, true);
addDeckAndSamplerControl("bpm_up", tr("BPM +1"), tr("Increase BPM by 1"), bpmMenu);
addDeckAndSamplerControl("bpm_down", tr("BPM -1"), tr("Decrease BPM by 1"), bpmMenu);
addDeckAndSamplerControl("bpm_up_small", tr("BPM +0.1"), tr("Increase BPM by 0.1"), bpmMenu);
addDeckAndSamplerControl("bpm_down_small", tr("BPM -0.1"), tr("Decrease BPM by 0.1"), bpmMenu);
addDeckAndSamplerControl("bpm_tap", tr("BPM Tap"), tr("BPM tap button"), bpmMenu);
bpmMenu->addSeparator();
addDeckAndSamplerControl("beats_adjust_faster", tr("Adjust Beatgrid Faster +.01"), tr("Increase track's average BPM by 0.01"), bpmMenu);
addDeckAndSamplerControl("beats_adjust_slower", tr("Adjust Beatgrid Slower -.01"), tr("Decrease track's average BPM by 0.01"), bpmMenu);
addDeckAndSamplerControl("beats_translate_earlier", tr("Move Beatgrid Earlier"), tr("Adjust the beatgrid to the left"), bpmMenu);
addDeckAndSamplerControl("beats_translate_later", tr("Move Beatgrid Later"), tr("Adjust the beatgrid to the right"), bpmMenu);
addDeckAndSamplerControl("beats_translate_move",
tr("Move Beatgrid"),
tr("Adjust the beatgrid to the left or right"),
bpmMenu);
addDeckControl("beats_translate_curpos",
tr("Adjust Beatgrid"),
tr("Align beatgrid to current position"),
bpmMenu);
addDeckControl("beats_translate_match_alignment",
tr("Adjust Beatgrid - Match Alignment"),
tr("Adjust beatgrid to match another playing deck."),
bpmMenu);
bpmMenu->addSeparator();
addDeckAndSamplerControl("quantize", tr("Quantize Mode"), tr("Toggle quantize mode"), bpmMenu);
QMenu* syncMenu = addSubmenu(tr("Sync"));
addDeckAndSamplerControl("sync_enabled",
tr("Sync / Sync Lock"),
tr("Tap to sync tempo (and phase with quantize enabled), hold to "
"enable permanent sync"),
syncMenu);
addDeckAndSamplerControl("beatsync",
tr("Beat Sync One-Shot"),
tr("One-time beat sync tempo (and phase with quantize enabled)"),
syncMenu);
addDeckAndSamplerControl("beatsync_tempo",
tr("Sync Tempo One-Shot"),
tr("One-time beat sync (tempo only)"),
syncMenu);
addDeckAndSamplerControl("beatsync_phase",
tr("Sync Phase One-Shot"),
tr("One-time beat sync (phase only)"),
syncMenu);
syncMenu->addSeparator();
addControl("[InternalClock]",
"sync_leader",
tr("Internal Sync Leader"),
tr("Toggle Internal Sync Leader"),
syncMenu);
addControl("[InternalClock]",
"bpm",
tr("Internal Leader BPM"),
tr("Internal Leader BPM"),
syncMenu);
addControl("[InternalClock]",
"bpm_up",
tr("Internal Leader BPM +1"),
tr("Increase internal Leader BPM by 1"),
syncMenu);
addControl("[InternalClock]",
"bpm_down",
tr("Internal Leader BPM -1"),
tr("Decrease internal Leader BPM by 1"),
syncMenu);
addControl("[InternalClock]",
"bpm_up_small",
tr("Internal Leader BPM +0.1"),
tr("Increase internal Leader BPM by 0.1"),
syncMenu);
addControl("[InternalClock]",
"bpm_down_small",
tr("Internal Leader BPM -0.1"),
tr("Decrease internal Leader BPM by 0.1"),
syncMenu);
syncMenu->addSeparator();
addDeckAndSamplerControl("sync_leader",
tr("Sync Leader"),
tr("Sync mode 3-state toggle / indicator (Off, Soft Leader, "
"Explicit Leader)"),
syncMenu);
// Speed
QMenu* speedMenu = addSubmenu(tr("Speed"));
addDeckAndSamplerControl("rate",
tr("Playback Speed"),
tr("Playback speed control (Vinyl \"Pitch\" slider)"),
speedMenu,
true);
speedMenu->addSeparator();
addDeckAndSamplerControl("rate_perm_up",
tr("Increase Speed"),
tr("Adjust speed faster (coarse)"),
speedMenu);
addDeckAndSamplerControl("rate_perm_up_small",
tr("Increase Speed (Fine)"),
tr("Adjust speed faster (fine)"),
speedMenu);
addDeckAndSamplerControl("rate_perm_down",
tr("Decrease Speed"),
tr("Adjust speed slower (coarse)"),
speedMenu);
addDeckAndSamplerControl("rate_perm_down_small",
tr("Decrease Speed (Fine)"),
tr("Adjust speed slower (fine)"),
speedMenu);
speedMenu->addSeparator();
addDeckAndSamplerControl("rate_temp_up",
tr("Temporarily Increase Speed"),
tr("Temporarily increase speed (coarse)"),
speedMenu);
addDeckAndSamplerControl("rate_temp_up_small",
tr("Temporarily Increase Speed (Fine)"),
tr("Temporarily increase speed (fine)"),
speedMenu);
addDeckAndSamplerControl("rate_temp_down",
tr("Temporarily Decrease Speed"),
tr("Temporarily decrease speed (coarse)"),
speedMenu);
addDeckAndSamplerControl("rate_temp_down_small",
tr("Temporarily Decrease Speed (Fine)"),
tr("Temporarily decrease speed (fine)"),
speedMenu);
// Pitch (Musical Key)
QMenu* pitchMenu = addSubmenu(tr("Pitch (Musical Key)"));
addDeckAndSamplerControl("pitch",
tr("Pitch (Musical key)"),
tr("Pitch control (does not affect tempo), center is original "
"pitch"),
pitchMenu,
true);
addDeckAndSamplerControl("pitch_up",
tr("Increase Pitch"),
tr("Increases the pitch by one semitone"),
pitchMenu);
addDeckAndSamplerControl("pitch_up_small",
tr("Increase Pitch (Fine)"),
tr("Increases the pitch by 10 cents"),
pitchMenu);
addDeckAndSamplerControl("pitch_down",
tr("Decrease Pitch"),
tr("Decreases the pitch by one semitone"),
pitchMenu);
addDeckAndSamplerControl("pitch_down_small",
tr("Decrease Pitch (Fine)"),
tr("Decreases the pitch by 10 cents"),
pitchMenu);
addDeckAndSamplerControl("pitch_adjust",
tr("Pitch Adjust"),
tr("Adjust pitch from speed slider pitch"),
pitchMenu,
true);
pitchMenu->addSeparator();
addDeckAndSamplerControl("sync_key", tr("Match Key"), tr("Match musical key"), pitchMenu);
addDeckAndSamplerControl("reset_key", tr("Reset Key"), tr("Resets key to original"), pitchMenu);
addDeckAndSamplerControl("keylock", tr("Keylock"), tr("Toggle keylock mode"), pitchMenu);
// Vinyl Control
QMenu* vinylControlMenu = addSubmenu(tr("Vinyl Control"));
addDeckControl("vinylcontrol_enabled",
tr("Toggle Vinyl Control"),
tr("Toggle Vinyl Control (ON/OFF)"),
vinylControlMenu);
addDeckControl("vinylcontrol_mode",
tr("Vinyl Control Mode"),
tr("Toggle vinyl-control mode (ABS/REL/CONST)"),
vinylControlMenu);
addDeckControl("vinylcontrol_cueing",
tr("Vinyl Control Cueing Mode"),
tr("Toggle vinyl-control cueing mode (OFF/ONE/HOT)"),
vinylControlMenu);
addDeckControl("passthrough",
tr("Vinyl Control Passthrough"),
tr("Pass through external audio into the internal mixer"),
vinylControlMenu);
addControl(VINYL_PREF_KEY,
"Toggle",
tr("Vinyl Control Next Deck"),
tr("Single deck mode - Switch vinyl control to next deck"),
vinylControlMenu);
// Cues
QMenu* cueMenu = addSubmenu(tr("Cues"));
addDeckControl("cue_default", tr("Cue"), tr("Cue button"), cueMenu);
addDeckControl("cue_set", tr("Set Cue"), tr("Set cue point"), cueMenu);
addDeckControl("cue_goto", tr("Go-To Cue"), tr("Go to cue point"), cueMenu);
addDeckAndSamplerAndPreviewDeckControl("cue_gotoandplay",
tr("Go-To Cue And Play"),
tr("Go to cue point and play"),
cueMenu);
addDeckControl("cue_gotoandstop",
tr("Go-To Cue And Stop"),
tr("Go to cue point and stop"),
cueMenu);
addDeckControl("cue_preview", tr("Preview Cue"), tr("Preview from cue point"), cueMenu);
addDeckControl("cue_cdj", tr("Cue (CDJ Mode)"), tr("Cue button (CDJ mode)"), cueMenu);
addDeckControl("play_stutter", tr("Stutter Cue"), tr("Stutter cue"), cueMenu);
addDeckControl("cue_play",
tr("CUP (Cue + Play)"),
tr("Go to cue point and play after release"),
cueMenu);
// Hotcues
QMenu* hotcueMainMenu = addSubmenu(tr("Hotcues"));
QString hotcueActivateTitle = tr("Hotcue %1");
QString hotcueClearTitle = tr("Clear Hotcue %1");
QString hotcueSetTitle = tr("Set Hotcue %1");
QString hotcueGotoTitle = tr("Jump To Hotcue %1");
QString hotcueGotoAndStopTitle = tr("Jump To Hotcue %1 And Stop");
QString hotcueGotoAndPlayTitle = tr("Jump To Hotcue %1 And Play");
QString hotcuePreviewTitle = tr("Preview Hotcue %1");
QString hotcueActivateDescription = tr("Set, preview from or jump to hotcue %1");
QString hotcueClearDescription = tr("Clear hotcue %1");
QString hotcueSetDescription = tr("Set hotcue %1");
QString hotcueGotoDescription = tr("Jump to hotcue %1");
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.
int preferredHotcuesVisible = 16;
int moreMenuThreshold = 4;
QMenu* parentMenu = hotcueMainMenu;
QMenu* hotcueMoreMenu = nullptr;
bool moreHotcues = NUM_HOT_CUES >= preferredHotcuesVisible + moreMenuThreshold;
if (moreHotcues) {
// populate menu here, add it below #preferredHotcuesVisible
hotcueMoreMenu = new QMenu(
tr("Hotcues %1-%2").arg(preferredHotcuesVisible + 1).arg(NUM_HOT_CUES),
hotcueMainMenu);
}
for (int i = 1; i <= NUM_HOT_CUES; ++i) {
if (moreHotcues && i > preferredHotcuesVisible) {
parentMenu = hotcueMoreMenu;
}
QMenu* hotcueSubMenu = addSubmenu(tr("Hotcue %1").arg(QString::number(i)), parentMenu);
addDeckAndSamplerControl(QString("hotcue_%1_activate").arg(i),
hotcueActivateTitle.arg(QString::number(i)),
hotcueActivateDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_clear").arg(i),
hotcueClearTitle.arg(QString::number(i)),
hotcueClearDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_set").arg(i),
hotcueSetTitle.arg(QString::number(i)),
hotcueSetDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_goto").arg(i),
hotcueGotoTitle.arg(QString::number(i)),
hotcueGotoDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_gotoandstop").arg(i),
hotcueGotoAndStopTitle.arg(QString::number(i)),
hotcueGotoAndStopDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_gotoandplay").arg(i),
hotcueGotoAndPlayTitle.arg(QString::number(i)),
hotcueGotoAndPlayDescription.arg(QString::number(i)),
hotcueSubMenu);
addDeckAndSamplerControl(QString("hotcue_%1_activate_preview").arg(i),
hotcuePreviewTitle.arg(QString::number(i)),
hotcuePreviewDescription.arg(QString::number(i)),
hotcueSubMenu);
}
if (moreHotcues) {
hotcueMainMenu->addSeparator();
hotcueMainMenu->addMenu(hotcueMoreMenu);
}
// Intro/outro range markers
QMenu* introOutroMenu = addSubmenu(tr("Intro / Outro Markers"));
const QStringList markerTitles = {
tr("Intro Start Marker"),
tr("Intro End Marker"),
tr("Outro Start Marker"),
tr("Outro End Marker")};
const QStringList markerNames = {
tr("intro start marker"),
tr("intro end marker"),
tr("outro start marker"),
tr("outro end marker")};
const QStringList markerCOs = {
"intro_start",
"intro_end",
"outro_start",
"outro_end"};
for (int i = 0; i < markerTitles.size(); ++i) {
QMenu* tempMenu = addSubmenu(markerTitles[i], introOutroMenu);
addDeckAndSamplerAndPreviewDeckControl(
QString("%1_activate").arg(markerCOs[i]),
tr("Activate %1", "[intro/outro marker").arg(markerTitles[i]),
tr("Jump to or set the %1", "[intro/outro marker").arg(markerNames[i]),
tempMenu);
addDeckAndSamplerAndPreviewDeckControl(
QString("%1_set").arg(markerCOs[i]),
tr("Set %1", "[intro/outro marker").arg(markerTitles[i]),
tr("Set or jump to the %1", "[intro/outro marker").arg(markerNames[i]),
tempMenu);
addDeckAndSamplerAndPreviewDeckControl(
QString("%1_clear").arg(markerCOs[i]),
tr("Clear %1", "[intro/outro marker").arg(markerTitles[i]),
tr("Clear the %1", "[intro/outro marker").arg(markerNames[i]),
tempMenu);
}
// Loops
QMenu* loopMenu = addSubmenu(tr("Looping"));
// add beatloop_activate and beatlooproll_activate to both the
// Loop and Beat-Loop menus to make sure users can find them.
QString beatloopActivateTitle = tr("Loop Selected Beats");
QString beatloopActivateDescription = tr("Create a beat loop of selected beat size");
QString beatloopRollActivateTitle = tr("Loop Roll Selected Beats");
QString beatloopRollActivateDescription = tr("Create a rolling beat loop of selected beat size");
QString beatLoopTitle = tr("Loop %1 Beats");
QString beatLoopRollTitle = tr("Loop Roll %1 Beats");
QString beatLoopDescription = tr("Create %1-beat loop");
QString beatLoopRollDescription = tr("Create temporary %1-beat loop roll");
QList<double> beatSizes = LoopingControl::getBeatSizes();
QMap<double, QString> humanBeatSizes;
humanBeatSizes[0.03125] = tr("1/32");
humanBeatSizes[0.0625] = tr("1/16");
humanBeatSizes[0.125] = tr("1/8");
humanBeatSizes[0.25] = tr("1/4");
humanBeatSizes[0.5] = tr("1/2");
humanBeatSizes[1] = tr("1");
humanBeatSizes[2] = tr("2");
humanBeatSizes[4] = tr("4");
humanBeatSizes[8] = tr("8");
humanBeatSizes[16] = tr("16");
humanBeatSizes[32] = tr("32");
humanBeatSizes[64] = tr("64");
// Beatloops
addDeckControl("beatloop_activate",
beatloopActivateTitle,
beatloopActivateDescription,
loopMenu);
QMenu* loopActivateMenu = addSubmenu(tr("Loop Beats"), loopMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("beatloop_%1_toggle").arg(beats),
beatLoopTitle.arg(humanBeats),
beatLoopDescription.arg(humanBeats),
loopActivateMenu);
}
loopMenu->addSeparator();
addDeckControl("beatlooproll_activate",
beatloopRollActivateTitle,
beatloopRollActivateDescription,
loopMenu);
QMenu* looprollActivateMenu = addSubmenu(tr("Loop Roll Beats"), loopMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("beatlooproll_%1_activate").arg(beats),
beatLoopRollTitle.arg(humanBeats),
beatLoopRollDescription.arg(humanBeats),
looprollActivateMenu);
}
loopMenu->addSeparator();
addDeckControl("loop_in", tr("Loop In"), tr("Loop In button"), loopMenu);
addDeckControl("loop_in_goto", tr("Go To Loop In"), tr("Go to Loop In button"), loopMenu);
addDeckControl("loop_out", tr("Loop Out"), tr("Loop Out button"), loopMenu);
addDeckControl("loop_out_goto", tr("Go To Loop Out"), tr("Go to Loop Out button"), loopMenu);
addDeckControl("loop_exit", tr("Loop Exit"), tr("Loop Exit button"), loopMenu);
addDeckControl("reloop_toggle",
tr("Reloop/Exit Loop"),
tr("Toggle loop on/off and jump to Loop In point if loop is behind "
"play position"),
loopMenu);
addDeckControl("reloop_andstop",
tr("Reloop And Stop"),
tr("Enable loop, jump to Loop In point, and stop"),
loopMenu);
addDeckControl("loop_halve", tr("Loop Halve"), tr("Halve the loop length"), loopMenu);
addDeckControl("loop_double", tr("Loop Double"), tr("Double the loop length"), loopMenu);
// Beat Jump / Loop Move
QMenu* beatJumpMenu = addSubmenu(tr("Beat Jump / Loop Move"));
QString beatJumpForwardTitle = tr("Jump / Move Loop Forward %1 Beats");
QString beatJumpBackwardTitle = tr("Jump / Move Loop Backward %1 Beats");
QString beatJumpForwardDescription = tr("Jump forward by %1 beats, or if a loop is enabled, move the loop forward %1 beats");
QString beatJumpBackwardDescription = tr("Jump backward by %1 beats, or if a loop is enabled, move the loop backward %1 beats");
addDeckControl("beatjump_forward", tr("Beat Jump / Loop Move Forward Selected Beats"), tr("Jump forward by the selected number of beats, or if a loop is enabled, move the loop forward by the selected number of beats"), beatJumpMenu);
addDeckControl("beatjump_backward", tr("Beat Jump / Loop Move Backward Selected Beats"), tr("Jump backward by the selected number of beats, or if a loop is enabled, move the loop backward by the selected number of beats"), beatJumpMenu);
beatJumpMenu->addSeparator();
QMenu* beatjumpFwdSubmenu = addSubmenu(tr("Beat Jump / Loop Move Forward"), beatJumpMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("beatjump_%1_forward").arg(beats),
beatJumpForwardTitle.arg(humanBeats),
beatJumpForwardDescription.arg(humanBeats),
beatjumpFwdSubmenu);
}
QMenu* beatjumpBwdSubmenu = addSubmenu(tr("Beat Jump / Loop Move Backward"), beatJumpMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("beatjump_%1_backward").arg(beats),
beatJumpBackwardTitle.arg(humanBeats),
beatJumpBackwardDescription.arg(humanBeats),
beatjumpBwdSubmenu);
}
// Loop moving
QString loopMoveForwardTitle = tr("Move Loop +%1 Beats");
QString loopMoveBackwardTitle = tr("Move Loop -%1 Beats");
QString loopMoveForwardDescription = tr("Move loop forward by %1 beats");
QString loopMoveBackwardDescription = tr("Move loop backward by %1 beats");
QMenu* loopmoveFwdSubmenu = addSubmenu(tr("Loop Move Forward"), beatJumpMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("loop_move_%1_forward").arg(beats),
loopMoveForwardTitle.arg(humanBeats),
loopMoveForwardDescription.arg(humanBeats),
loopmoveFwdSubmenu);
}
QMenu* loopmoveBwdSubmenu = addSubmenu(tr("Loop Move Backward"), beatJumpMenu);
foreach (double beats, beatSizes) {
QString humanBeats = humanBeatSizes.value(beats, QString::number(beats));
addDeckControl(QString("loop_move_%1_backward").arg(beats),
loopMoveBackwardTitle.arg(humanBeats),
loopMoveBackwardDescription.arg(humanBeats),
loopmoveBwdSubmenu);
}
addSeparator();
// Library Controls
QMenu* libraryMenu = addSubmenu(m_libraryStr);
QMenu* navigationMenu = addSubmenu(tr("Navigation"), libraryMenu);
addLibraryControl("MoveUp",
tr("Move up"),
tr("Equivalent to pressing the UP key on the keyboard"),
navigationMenu);
addLibraryControl("MoveDown",
tr("Move down"),
tr("Equivalent to pressing the DOWN key on the keyboard"),
navigationMenu);
addLibraryControl("MoveVertical",
tr("Move up/down"),
tr("Move vertically in either direction using a knob, as if "
"pressing UP/DOWN keys"),
navigationMenu);
addLibraryControl("ScrollUp",
tr("Scroll Up"),
tr("Equivalent to pressing the PAGE UP key on the keyboard"),
navigationMenu);
addLibraryControl("ScrollDown",
tr("Scroll Down"),
tr("Equivalent to pressing the PAGE DOWN key on the keyboard"),
navigationMenu);
addLibraryControl("ScrollVertical",
tr("Scroll up/down"),
tr("Scroll vertically in either direction using a knob, as if "
"pressing PGUP/PGDOWN keys"),
navigationMenu);
addLibraryControl("MoveLeft",
tr("Move left"),
tr("Equivalent to pressing the LEFT key on the keyboard"),
navigationMenu);
addLibraryControl("MoveRight",
tr("Move right"),
tr("Equivalent to pressing the RIGHT key on the keyboard"),
navigationMenu);
addLibraryControl("MoveHorizontal",
tr("Move left/right"),
tr("Move horizontally in either direction using a knob, as if "
"pressing LEFT/RIGHT keys"),
navigationMenu);
navigationMenu->addSeparator();
addLibraryControl("MoveFocusForward",
tr("Move focus to right pane"),
tr("Equivalent to pressing the TAB key on the keyboard"),
navigationMenu);
addLibraryControl("MoveFocusBackward",
tr("Move focus to left pane"),
tr("Equivalent to pressing the SHIFT+TAB key on the keyboard"),
navigationMenu);
addLibraryControl("MoveFocus",
tr("Move focus to right/left pane"),
tr("Move focus one pane to right or left using a knob, as if "
"pressing TAB/SHIFT+TAB keys"),
navigationMenu);
addLibraryControl("sort_focused_column",
tr("Sort focused column"),
tr("Sort the column of the cell that is currently focused, "
"equivalent to clicking on its header"),
navigationMenu);
libraryMenu->addSeparator();
addLibraryControl("GoToItem",
tr("Go to the currently selected item"),
tr("Choose the currently selected item and advance forward one "
"pane if appropriate"),
libraryMenu);
// Load track (these can be loaded into any channel)
addDeckAndSamplerControl("LoadSelectedTrack",
tr("Load Track"),
tr("Load selected track"),
libraryMenu);
addDeckAndSamplerAndPreviewDeckControl("LoadSelectedTrackAndPlay",
tr("Load Track and Play"),
tr("Load selected track and play"),
libraryMenu);
libraryMenu->addSeparator();
// Auto DJ
addLibraryControl("AutoDjAddBottom",
tr("Add to Auto DJ Queue (bottom)"),
tr("Append the selected track to the Auto DJ Queue"),
libraryMenu);
addLibraryControl("AutoDjAddTop",
tr("Add to Auto DJ Queue (top)"),
tr("Prepend selected track to the Auto DJ Queue"),
libraryMenu);
addLibraryControl("AutoDjAddReplace",
tr("Add to Auto DJ Queue (replace)"),
tr("Replace Auto DJ Queue with selected tracks"),
libraryMenu);
libraryMenu->addSeparator();
// Search box
addLibraryControl("search_history_next",
tr("Select next search history"),
tr("Selects the next search history entry"),
libraryMenu);
addLibraryControl("search_history_prev",
tr("Select previous search history"),
tr("Selects the previous search history entry"),
libraryMenu);
addLibraryControl("search_history_selector",
tr("Move selected search entry"),
tr("Moves the selected search history item into given direction "
"and steps"),
libraryMenu);
addLibraryControl("clear_search",
tr("Clear search"),
tr("Clears the search query"),
libraryMenu);
libraryMenu->addSeparator();
addControl("[Recording]",
"toggle_recording",
tr("Record Mix"),
tr("Toggle mix recording"),
libraryMenu,
false,
m_libraryStr);
// Effect Controls
QMenu* effectsMenu = addSubmenu(tr("Effects"));
// Quick Effect Rack COs
QMenu* quickEffectMenu = addSubmenu(tr("Quick Effects"), effectsMenu);
for (int i = 1; i <= iNumDecks; ++i) {
addControl(QString("[QuickEffectRack1_[Channel%1]]").arg(i),
"super1",
tr("Deck %1 Quick Effect Super Knob").arg(i),
tr("Quick Effect Super Knob (control linked effect "
"parameters)"),
quickEffectMenu,
false,
tr("Quick Effect"));
addControl(QString("[QuickEffectRack1_[Channel%1]_Effect1]").arg(i),
"enabled",
tr("Deck %1 Quick Effect Enable Button").arg(i),
tr("Quick Effect Enable Button"),
quickEffectMenu,
false,
tr("Quick Effect"));
}
effectsMenu->addSeparator();
for (int iEffectUnitNumber = 1; iEffectUnitNumber <= kNumStandardEffectUnits;
++iEffectUnitNumber) {
const QString effectUnitGroup =
StandardEffectChain::formatEffectChainGroup(iEffectUnitNumber - 1);
const QString descriptionPrefix = QString("%1").arg(m_effectUnitStr.arg(iEffectUnitNumber));
QMenu* effectUnitMenu = addSubmenu(m_effectUnitStr.arg(iEffectUnitNumber),
effectsMenu);
addControl(effectUnitGroup,
"clear",
tr("Clear Unit"),
tr("Clear effect unit"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup,
"enabled",
tr("Toggle Unit"),
tr("Enable or disable effect processing"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup,
"mix",
tr("Dry/Wet"),
tr("Adjust the balance between the original (dry) and "
"processed (wet) signal."),
effectUnitMenu,
true,
descriptionPrefix);
addControl(effectUnitGroup,
"super1",
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,
"next_chain",
tr("Next Chain"),
tr("Next chain preset"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup,
"prev_chain",
tr("Previous Chain"),
tr("Previous chain preset"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup,
"chain_selector",
tr("Next/Previous Chain"),
tr("Next or previous chain preset"),
effectUnitMenu,
false,
descriptionPrefix);
addControl(effectUnitGroup,
"show_parameters",
tr("Show Effect Parameters"),
tr("Show Effect Parameters"),
effectUnitMenu,
false,
descriptionPrefix);
QString assignMenuTitle = tr("Effect Unit Assignment");
QString assignString = tr("Assign ");
QMenu* effectUnitGroups = addSubmenu(assignMenuTitle,
effectUnitMenu);
QString groupDescriptionPrefix = QString("%1").arg(
m_effectUnitStr.arg(iEffectUnitNumber));
addControl(effectUnitGroup, "group_[Master]_enable",
assignString + m_effectMainOutputStr, // in ComboBox
assignString + m_effectMainOutputStr, // description below
effectUnitGroups,
false,
groupDescriptionPrefix);
addControl(effectUnitGroup,
"group_[Headphone]_enable",
assignString + m_effectHeadphoneOutputStr,
assignString + m_effectHeadphoneOutputStr,
effectUnitGroups,
false,
groupDescriptionPrefix);
for (int iDeckNumber = 1; iDeckNumber <= iNumDecks; ++iDeckNumber) {
// PlayerManager::groupForDeck is 0-indexed.
QString playerGroup = PlayerManager::groupForDeck(iDeckNumber - 1);
// TODO(owen): Fix bad i18n here.
addControl(effectUnitGroup,
QString("group_%1_enable").arg(playerGroup),
assignString + m_deckStr.arg(iDeckNumber),
assignString + m_deckStr.arg(iDeckNumber),
effectUnitGroups,
false,
groupDescriptionPrefix);
}
const int iNumSamplers = static_cast<int>(ControlObject::get(
ConfigKey(kAppGroup, QStringLiteral("num_samplers"))));
for (int iSamplerNumber = 1; iSamplerNumber <= iNumSamplers;
++iSamplerNumber) {
// PlayerManager::groupForSampler is 0-indexed.
QString playerGroup = PlayerManager::groupForSampler(iSamplerNumber - 1);
// TODO(owen): Fix bad i18n here.
addControl(effectUnitGroup,
QString("group_%1_enable").arg(playerGroup),
assignString + m_samplerStr.arg(iSamplerNumber),
assignString + m_samplerStr.arg(iSamplerNumber),
effectUnitGroups,
false,
groupDescriptionPrefix);
}
const int iNumMicrophones = static_cast<int>(ControlObject::get(
ConfigKey(kAppGroup, QStringLiteral("num_microphones"))));
for (int iMicrophoneNumber = 1; iMicrophoneNumber <= iNumMicrophones;
++iMicrophoneNumber) {
QString micGroup = PlayerManager::groupForMicrophone(iMicrophoneNumber - 1);
// TODO(owen): Fix bad i18n here.
addControl(effectUnitGroup,
QString("group_%1_enable").arg(micGroup),
assignString + m_microphoneStr.arg(iMicrophoneNumber),
assignString + m_microphoneStr.arg(iMicrophoneNumber),
effectUnitGroups,
false,
groupDescriptionPrefix);
}
const int iNumAuxiliaries = static_cast<int>(ControlObject::get(
ConfigKey(kAppGroup, QStringLiteral("num_auxiliaries"))));
for (int iAuxiliaryNumber = 1; iAuxiliaryNumber <= iNumAuxiliaries;
++iAuxiliaryNumber) {
QString auxGroup = PlayerManager::groupForAuxiliary(iAuxiliaryNumber - 1);
// TODO(owen): Fix bad i18n here.
addControl(effectUnitGroup,
QString("group_%1_enable").arg(auxGroup),
assignString + m_auxStr.arg(iAuxiliaryNumber),
assignString + m_auxStr.arg(iAuxiliaryNumber),
effectUnitGroups,
false,
groupDescriptionPrefix);
}
const int numEffectSlots = static_cast<int>(ControlObject::get(
ConfigKey(effectUnitGroup, "num_effectslots")));
for (int iEffectSlotNumber = 1; iEffectSlotNumber <= numEffectSlots;
++iEffectSlotNumber) {
const QString effectSlotGroup =
StandardEffectChain::formatEffectSlotGroup(
iEffectUnitNumber - 1, iEffectSlotNumber - 1);
QMenu* effectSlotMenu = addSubmenu(m_effectStr.arg(iEffectSlotNumber),
effectUnitMenu);
QString slotDescriptionPrefix =
QString("%1, %2").arg(descriptionPrefix,
m_effectStr.arg(iEffectSlotNumber));
addControl(effectSlotGroup,
"clear",
tr("Clear"),
tr("Clear the current effect"),
effectSlotMenu,
false,
slotDescriptionPrefix);
addControl(effectSlotGroup,
"meta",