Krotos Modules 3
Loading...
Searching...
No Matches
KwidgetGUI_CoreEngine.cpp
Go to the documentation of this file.
1namespace krotos
2{
31 const String KwidgetGUI_CoreEngine::ComponentIds::ButtonSampleBrowserId("SampleSelectDropdown");
32 const String KwidgetGUI_CoreEngine::ComponentIds::ButtonZoomInId("WaveformZoomIn");
33 const String KwidgetGUI_CoreEngine::ComponentIds::ButtonZoomOutId("WaveformZoomOut");
37 const std::string KwidgetGUI_CoreEngine::analyticsEventClearedEngine{"analyticsEventClearedEngine"};
38 const std::string KwidgetGUI_CoreEngine::analyticsEventAddedSamplesEngine{"analyticsEventAddedSamplesEngine"};
40 "analyticsEventChangedMidiTriggerEngine"};
41 const std::string KwidgetGUI_CoreEngine::analyticsEventRemovedEngine{"analyticsEventRemovedEngine"};
43
45 : KwidgetGUI(owner), m_soSound(sound), m_owner(owner),
46 m_zoomInButtonImage(
47 Drawable::createFromImageData(KrotosBinaryData::Plus_Icon_svg, KrotosBinaryData::Plus_Icon_svgSize)),
48 m_zoomInButtonImageMouseOver(
49 Drawable::createFromImageData(KrotosBinaryData::Plus_Icon_svg, KrotosBinaryData::Plus_Icon_svgSize)),
50 m_zoomOutButtonImage(Drawable::createFromImageData(KrotosBinaryData::Minus_Icon_svg,
51 KrotosBinaryData::Minus_Icon_svgSize)),
52 m_zoomOutButtonImageMouseOver(Drawable::createFromImageData(KrotosBinaryData::Minus_Icon_svg,
53 KrotosBinaryData::Minus_Icon_svgSize)),
54 m_sampleBrowserButton(""), m_removeEngineButton("", DrawableButton::ImageStretched)
55 {
56 // TODO: Fix the these var names, m_size instead of m_Size etc...
57
58 // Labels
59 addAndMakeVisible(m_coreEngineNameLabel);
60 m_coreEngineNameLabel.setFont(Font(m_layout.modeFontSize).withExtraKerningFactor(m_layout.modeExtraKerning));
61
62 // Sliders
63 m_Start.getSlider().setTextValueSuffix(" % ");
66 m_Size.getSlider().setTextValueSuffix(" % ");
79
80 // Slider specific layout
81 m_Level.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
84 m_Level.setValueFormat("%.1f");
85
86 m_LevelRand.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
91
92 m_Pan.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
94 m_Pan.setValueFormat("%.1f");
97
98 m_PanRand.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
103
111
112 // Rand Sliders
125
126 // Extras Sliders
134
135 // Vehicle Sliders
146
147 // Mute- Solo Text Buttons
150
151 // Mode select combobox
153
154 // Trigger select combobox - adds and makes visible
155 addAndMakeVisible(m_trigger);
156 m_trigger.addItemList(Kwidget_CoreEngine::MIDIModeNames, /*itemOffset*/ 1);
157 m_trigger.setSelectedId(static_cast<int>(MIDIMode::All) + 1); // add offset
158
159 // Vehicle colours
160 m_ASize.setDebugColour(Colours::sandybrown);
161 m_ARate.setDebugColour(Colours::sandybrown);
162 m_ASpray.setDebugColour(Colours::sandybrown);
163 m_AMix.setDebugColour(Colours::sandybrown);
164 m_BSize.setDebugColour(Colours::sandybrown);
165 m_BRate.setDebugColour(Colours::sandybrown);
166 m_BSpray.setDebugColour(Colours::sandybrown);
167 m_BMix.setDebugColour(Colours::sandybrown);
168 m_Tracking.setDebugColour(Colours::sandybrown);
169 m_Cycles.setDebugColour(Colours::sandybrown);
170 m_Smoothing.setDebugColour(Colours::sandybrown);
171 m_Sensitivity.setDebugColour(Colours::sandybrown);
172
173 // Misc colours
174 m_Shape.setDebugColour(Colours::darkred);
175 m_GrainMax.setDebugColour(Colours::darkred);
176
177 addAndMakeVisible(m_clearButton);
178 addAndMakeVisible(m_tweakButton1);
179 addAndMakeVisible(m_tweakButton2);
180
181 Kwidget_CoreEngine* owningKwidget = dynamic_cast<Kwidget_CoreEngine*>(&getOwner());
182
183 if (owningKwidget != nullptr)
184 {
185 // init right panel tabbed component
187 // TODO: Fix the these var names, m_size instead of m_Size etc...!
188
189 // Sliders
190 m_Start.getSlider().setTextValueSuffix(" % ");
192 m_Size.getSlider().setTextValueSuffix(" % ");
204
205 // Slider specific layout
206 m_Pan.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
207 m_Pan.setValueFormat("%.1f");
208
209 m_Level.getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
211 m_Level.setValueFormat("%.1f");
212
213 // Rand Sliders
218
219 // Extras Sliders
225
226 // Vehicle Sliders
237
238 // Mute- Solo Text Buttons
241
242 // Mode select combobox
245
246 // Trigger select combobox - adds and makes visible
248 // set initial m_trigger selected ID
250 if (midiParameter != nullptr)
251 {
252 const String midiName = midiParameter->getValue();
253 if (Kwidget_CoreEngine::MIDIModeNames.contains(midiName))
254 {
255 m_trigger.setSelectedId(Kwidget_CoreEngine::MIDIModeNames.indexOf(midiName) +
256 1); //+1 for combobox offset
257 }
258 }
259 m_trigger.onChange = [this] {
260 // Send midi note change to the sample engine
261 const int newMidiMode = Kwidget_CoreEngine::MIDIModeNames.indexOf(m_trigger.getText());
262 Kwidget_CoreEngine& owner = dynamic_cast<Kwidget_CoreEngine&>(m_owner);
263 if (&owner != nullptr)
264 {
265 owner.setActiveMidiMode(static_cast<MIDIMode>(newMidiMode));
266 }
268 {
269 // Mixpanel analytics: Midi note trigger selection
271 }
272 };
273
274 // Vehicle colours
275 m_ASize.setDebugColour(Colours::sandybrown);
276 m_ARate.setDebugColour(Colours::sandybrown);
277 m_ASpray.setDebugColour(Colours::sandybrown);
278 m_AMix.setDebugColour(Colours::sandybrown);
279 m_BSize.setDebugColour(Colours::sandybrown);
280 m_BRate.setDebugColour(Colours::sandybrown);
281 m_BSpray.setDebugColour(Colours::sandybrown);
282 m_BMix.setDebugColour(Colours::sandybrown);
283 m_Tracking.setDebugColour(Colours::sandybrown);
284 m_Cycles.setDebugColour(Colours::sandybrown);
285 m_Smoothing.setDebugColour(Colours::sandybrown);
286 m_Sensitivity.setDebugColour(Colours::sandybrown);
287
288 // Misc colours
289 m_Shape.setDebugColour(Colours::darkred);
290 m_GrainMax.setDebugColour(Colours::darkred);
291
292 addAndMakeVisible(m_clearButton);
293 addAndMakeVisible(m_tweakButton1);
294 addAndMakeVisible(m_tweakButton2);
295
296 m_tweakButton1.setEnabled(false);
297 m_tweakButton2.setEnabled(false);
298 }
299
300 addAndMakeVisible(m_muteButton);
302 addAndMakeVisible(m_soloButton);
304
305 m_defaultDeleteButton = Drawable::createFromImageData(KrotosBinaryData::remove_engine_icon_default_png,
306 KrotosBinaryData::remove_engine_icon_default_pngSize);
307
308 m_hoverDeleteButton = Drawable::createFromImageData(KrotosBinaryData::remove_engine_icon_hover_png,
309 KrotosBinaryData::remove_engine_icon_hover_pngSize);
310
311 // delete button
312 addAndMakeVisible(m_removeEngineButton);
314 m_removeEngineButton.toFront(true);
315 m_removeEngineButton.setImages(
316 /*normal*/ m_defaultDeleteButton.get(),
317 /* hover */ m_hoverDeleteButton.get(),
318 /* clicked */ m_hoverDeleteButton.get());
319
320 m_removeEngineButton.onClick = [&]() {
321 if (onDelete)
322 {
323 std::function<void(int)> removeEngineCallback = [this](int option) {
324 if (option == 0) // clicked remove
325 {
326 // Mixpanel analytics: removed engine
327 sendActionMessage(analyticsEventRemovedEngine);
328
329 // defer deletion to ensure the action message is sent and processed
330 MessageManager::callAsync([this]() {
331 auto ownerId = m_owner.getKwidgetID();
332 onDelete(ownerId);
333 });
334 }
335 };
336
339
340 AlertWindow::showAsync(MessageBoxOptions()
341 .withIconType(MessageBoxIconType::WarningIcon)
342 .withTitle("Removing Engine")
343 .withMessage("Are you sure you want to proceed with the\nremoval? This "
344 "action cannot be undone!")
345 .withButton("Cancel")
346 .withButton("Remove")
347 .withAssociatedComponent(this),
348 removeEngineCallback);
349 }
350 };
351
352 addAndMakeVisible(m_QuenchToggle);
353 addAndMakeVisible(m_NORToggle);
355 addAndMakeVisible(m_AutoRateToggle);
356 addAndMakeVisible(m_PhaseLockToggle);
357 addAndMakeVisible(m_PhaseSyncToggle);
358 addAndMakeVisible(m_NormaliseToggle);
360 addAndMakeVisible(m_AutoplayToggle);
361 addAndMakeVisible(m_EnableMuteUpToggle);
362 addAndMakeVisible(m_EnableMuteDownToggle);
363 addAndMakeVisible(m_SALoopToggle);
364 addAndMakeVisible(m_RobinToggle);
365
366 // Lets get a callback when the mode combobox changes, so we can set engine slider defaults
367 // we don't want this to happen when the attached parameter changes - only when the user manually changes the
368 // mode
369 m_mode.onStateChange = [this] {
371 static_cast<Kwidget_CoreEngine::EngineMode>(m_mode.getControlComponent().getSelectedItemIndex());
372 switch (mode)
373 {
377 m_waveformViewerAndEditor->setStartPosInPercentage(0.f);
379 m_waveformViewerAndEditor->setEndPosInPercentage(1.f);
393 break;
397 m_waveformViewerAndEditor->setStartPosInPercentage(0.f);
399 m_waveformViewerAndEditor->setEndPosInPercentage(1.f);
413 break;
431
436
441
446 break;
447 }
448
455 };
456
457 m_clearButton.setButtonText("CLEAR");
458 m_clearButton.onClick = [this] { clearEngine(); };
459
460 // Mute Button
461 m_muteButton.setClickingTogglesState(true);
462 m_muteButton.setButtonText("M");
463
464 // Solo Button
465 m_soloButton.setClickingTogglesState(true);
466 m_soloButton.setButtonText("S");
467
468 // Toggle Switches
485
490 // ---------------
491 Range<double> scrollbarRange(0.0, 1.0);
492 m_waveformViewScrollbar.setRangeLimits(scrollbarRange, NotificationType::dontSendNotification);
493 m_waveformViewScrollbar.setCurrentRange(
494 /*starting point*/ 0.0,
495 /*size*/ 1.0, NotificationType::dontSendNotification);
496 m_waveformViewScrollbar.setColour(ScrollBar::ColourIds::thumbColourId, Colour(74, 74, 74));
497 m_waveformViewScrollbar.addListener(this);
498
500 std::make_unique<krotos::WaveformViewerAndEditor>(m_colourDefinitions.waveformColour, false, false);
501
502 addAndMakeVisible(m_waveformViewerAndEditor.get());
505 m_waveformViewerAndEditor->getWaveformViewer()->setDrawGrid(false);
506 m_waveformViewerAndEditor->getWaveformViewer()->setShowBorderOnDragHover(true);
507 m_waveformViewerAndEditor->getWaveformViewer()->setShowFileName(false);
508
509 // - limit the loaded files by name
510 m_waveformViewerAndEditor->getWaveformViewer()->setRegexFileFilter(
511 String("")); // Empty string - loads everything which is in the dragged folder
512 m_waveformViewerAndEditor->addListener(this);
513
515
518
519 addParameterCallback(Parameters::Mode, [this](float val) { modeParamChanged(val); });
520 auto modeVal = getOwner().getParameter(Parameters::Mode)->get();
521 modeParamChanged(modeVal);
522
523 // start-point change
524 addParameterCallback(Parameters::Start, [this](float val) {
525 // if called from marquee
527 {
529 return;
530 }
531 else // if changed from slider
532 {
534 m_mode.getControlComponent().getSelectedItemIndex());
536 {
537 auto sizeVal = getOwner().getParameter(Parameters::Size)->get();
538 if (val >= sizeVal)
539 val = sizeVal;
540 // repaint the viewer
541 m_waveformViewerAndEditor->setStartPosInPercentage(val * 0.01f);
542 }
544 {
545 // repaint the viewer
546 m_waveformViewerAndEditor->setStartPosInPercentage(val * 0.01f);
547 }
548 }
549 });
550
551 // end-point change
552 addParameterCallback(Parameters::Size, [this](float val) {
553 // if called from the marquee
555 {
557 return;
558 }
559 else // if changed from the slider
560 {
561 auto startVal = getOwner().getParameter(Parameters::Start)->get();
562 if (val <= startVal)
563 val = startVal;
564 // repaint the viewer
565 m_waveformViewerAndEditor->setEndPosInPercentage(val * 0.01f);
566 }
567 });
568
570
572
573 // Sample Browser Dropdown Menu
575 addAndMakeVisible(m_sampleBrowserButton);
576
578 if (auto* sampleEngine = m_soSound.getSampleEngine())
579 {
580 const bool engineHasAudioSegments = sampleEngine->getNumAudioSegments() > 1;
581 if (engineHasAudioSegments)
582 {
583 // Wrap around
584 auto nextSegmentIndex = (m_selectedSegment + 1) % sampleEngine->getNumAudioSegments();
585
586 selectSample(nextSegmentIndex);
587 }
588 }
589 };
590
592 if (auto* sampleEngine = m_soSound.getSampleEngine())
593 {
594 const bool engineHasAudioSegments = sampleEngine->getNumAudioSegments() > 1;
595 if (engineHasAudioSegments)
596 {
597 // Inverse wrap around
598 auto nextSegmentIndex = (sampleEngine->getNumAudioSegments() - 1 + m_selectedSegment) %
599 sampleEngine->getNumAudioSegments();
600
601 selectSample(nextSegmentIndex);
602 }
603 }
604 };
605
606 m_samplesTree.sampleAdded = [this](SamplesTree::Sample& newSample) {
608 };
609
610 m_samplesTree.sampleRemoved = [this](ValueTree& childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved) {
611 bool lastSampleDeleted = m_samplesTree.getNumSamples() == 0;
612 if (lastSampleDeleted)
613 {
614 clearEngine();
615 }
616 else
617 {
618 selectSample(jmax<int>(indexFromWhichChildWasRemoved - 1, 0));
619 }
620
622 };
623
624 m_sampleBrowserButton.onClick = [&] { showSampleBrowser(); };
625
626 // Initialise current waveform / sample display update
628 if (m_samplesTree.getNumSamples() == 0)
629 {
630 clearEngine();
631 }
632
633 // Setup the callback to update the UI when the sample index has changed from a note on event
634 m_samplesTree.sampleIndexChanged = [&](int index) { selectSample(index, false); };
635
636 // Setup the callback to update the selected sample
637 m_samplesTree.selectedSampleChanged = [&](int index) { selectSample(index, true); };
638
639 // Initialise sample select
641 }
642
644 {
645 OwnedArray<SampleBrowser::Sample> samplesToShow{m_samplesTree.getSampleDataAsBrowserSamples()};
646
647 int sampleItemCount = jlimit(0, m_layout.sampleBrowserMaxItemsToShow, samplesToShow.size());
648
649 enum item
650 {
651 Browser = -1,
652 Add = 1,
653 RemoveAll
654 };
655
656 auto browser = std::make_unique<SampleBrowser>(m_layout.sampleBrowserWidth,
657 m_layout.sampleBrowserItemHeight * sampleItemCount,
658 m_layout.sampleBrowserItemHeight, std::move(samplesToShow));
659
660 // Use m_cuedSegment for cyan dot to remain next to user cued samples only.
661 browser->setCuedSample(m_cuedSegment, true);
662
663 browser->onSampleSelected = [this](int sampleIndex) {
664 selectSample(sampleIndex);
665 PopupMenu::dismissAllActiveMenus();
666 };
667
668 browser->onSampleDeleted = [this](int sampleIndex) {
669 m_samplesTree.removeSample(sampleIndex);
670 PopupMenu::dismissAllActiveMenus();
671 // refresh the waveformViewerAndEditor to set selector ranges from updated SampleEngine
672 m_waveformViewerAndEditor->copySegmentsToSelectors();
673 };
674
675 browser->onSampleSolo = [this](int sampleIndex, bool soloState) { selectSample(sampleIndex, false); };
676
677 PopupMenu menu;
678
679 menu.addCustomItem(item::Browser, std::move(browser));
680
681 menu.addItem(item::Add, "Add More Samples", true, false,
682 Drawable::createFromImageData(KrotosBinaryData::Add_Sample_Icon_svg,
683 KrotosBinaryData::Add_Sample_Icon_svgSize));
684 menu.addItem(item::RemoveAll, "Remove All Samples", true, false,
685 Drawable::createFromImageData(KrotosBinaryData::Remove_All_Samples_svg,
686 KrotosBinaryData::Remove_All_Samples_svgSize));
687
688 std::function<void(int)> menuCallback = [&](int itemResultID) {
689 switch (itemResultID)
690 {
691 case item::Add:
692 m_waveformViewerAndEditor->showFileChooser();
693 break;
694 case item::RemoveAll:
695 std::function<void(int)> removeCallback = [this, target = WeakReference<Component>{this}](int option) {
696 if (target && option == 0)
697 {
698 clearEngine();
699
700 // Mixpanel: core engine clear all samples
701 sendActionMessage(analyticsEventClearedEngine);
702 }
703 };
705 440);
707 172);
708 AlertWindow::showAsync(MessageBoxOptions()
709 .withIconType(MessageBoxIconType::WarningIcon)
710 .withTitle("Sample Removal")
711 .withMessage("Are you sure you want to proceed with the\nremoval? This "
712 "action cannot be undone!")
713 .withButton("Cancel")
714 .withButton("Remove")
715 .withAssociatedComponent(&m_sampleBrowserButton),
716 removeCallback);
717 break;
718 }
719 };
720
721 menu.showMenuAsync(PopupMenu::Options{}
722 .withTargetComponent(m_sampleBrowserButton)
723 .withMinimumNumColumns(1)
724 .withStandardItemHeight(m_layout.sampleBrowserItemHeight),
725 menuCallback);
726 }
727
728 // Assuming you have a TabbedComponent named m_tabbedComponent
730 {
731 // Create your TabbedComponent
732 m_tabbedComponent = std::make_unique<TabbedComponent>(TabbedButtonBar::TabsAtTop);
733
734 switch (m_activeMode)
735 {
738 break;
741 break;
742 }
743
744 m_tabbedComponent->setOutline(0);
745
746 // Add the TabbedComponent to main core enginedGUI component
747 addAndMakeVisible(*m_tabbedComponent);
748 }
749
751 {
752 // initial start value setting
753 auto startValue = getOwner().getParameter(Parameters::Start)->get();
754 m_waveformViewerAndEditor->setStartPosInPercentage(startValue * 0.01f);
755
756 // intial end value setting
757 auto sizeValue = getOwner().getParameter(Parameters::Size)->get();
758 m_waveformViewerAndEditor->setEndPosInPercentage(sizeValue * 0.01f);
759 }
760
762 {
764 val * static_cast<float>(Kwidget_CoreEngine::EngineMode::modeNUM_MODES - 1));
766 // change the waveformViewer according to the active mode
767 auto modeVal = static_cast<AreaSelectionComp::WaveformMode>(m_activeMode);
768 switch (m_activeMode)
769 {
772 break;
775 break;
778 break;
779 }
780 repaint();
781 }
782
811
813 {
815 m_waveformViewScrollbar.removeListener(this);
816
817 m_Start.setLookAndFeel(nullptr);
818 m_Size.setLookAndFeel(nullptr);
819 m_Rate.setLookAndFeel(nullptr);
820 m_Detune.setLookAndFeel(nullptr);
821 m_Width.setLookAndFeel(nullptr);
822 m_GranularLevel.setLookAndFeel(nullptr);
823 m_SamplerLevel.setLookAndFeel(nullptr);
824 }
825
827 {
828 Colour bgColour(31, 37, 46);
829 g.setColour(bgColour);
830 g.fillRoundedRectangle(getLocalBounds().reduced(2).toFloat(), /*corner*/ 3.0f);
831
832 g.setColour(Colours::black);
833 g.drawRoundedRectangle(getLocalBounds().reduced(1).toFloat(), /*corner*/ 5.0f, /*thickness*/ 2.0f);
834 }
835
837 {
839
840 // shared left panel
843 NotificationType::dontSendNotification);
844
847
850
852
855
856 // wavefrom area bounds
858
860
864
865 // right panel tabbed component bounds
866 if (m_tabbedComponent != nullptr)
868
869 auto kwidgetID = getKwidgetID();
870
871 // amp env
872 auto adsr0 = m_ampEnvTab.findChildWithID(kwidgetID + ":Adsr0");
873 if (adsr0 != nullptr)
874 {
875 adsr0->setBounds(m_layout.controlsTabs.ampEnvBounds);
876 }
877
878 // pitch env
879 auto adsr1 = m_pitchEnvTab.findChildWithID(kwidgetID + ":Adsr1");
880 if (adsr1 != nullptr)
881 {
882 adsr1->setBounds(m_layout.controlsTabs.pitchEnvBounds);
883 }
884
885 // toggle group bounds
886 Rectangle<int> playbackControls(m_layout.toggleGroupAreaSampler);
887 m_SALoopToggle.setBounds(playbackControls.removeFromLeft(m_layout.loopToggleWidth));
888 m_NormaliseToggle.setBounds(playbackControls.removeFromLeft(m_layout.normalizeToggleWidth));
889 m_AutoplayToggle.setBounds(playbackControls.removeFromLeft(m_layout.autoplayToggleWidth));
890 m_NORToggle.setBounds(playbackControls.removeFromLeft(m_layout.releaseTrigToggleWidth));
891 m_RobinToggle.setBounds(playbackControls.removeFromLeft(m_layout.randomToggleWidth));
892
894
895 switch (m_activeMode)
896 {
899 break;
902 break;
905 break;
906 }
907 }
908
910 {
911 m_waveformViewerAndEditor->update(*sound);
912 // Todo: Fix the edit dropdown and associated states so that updateBrowserButtonStatus() doesn't need to be in
913 // paint(), an overridden method which is called asynchronously and unreliably. Probably needs an investigation,
914 // but likely that this wont work properly until the work in KST-2269: Custom Parameter Tree is applied to
915 // mute / solo state etc.
916 auto* sampler = m_soSound.getSampleEngine();
917 jassert(sampler);
918 if (sampler)
919 {
920 // Select the last sample in the audio buffer
921 // ie the most recently dragged
922 selectSample(sampler->getNumAudioSegments() - 1);
923 repaint();
924 }
925
926 MouseCursor::hideWaitCursor();
927 }
928
930 {
931 MouseCursor::showWaitCursor();
932 m_waveformViewerAndEditor->clear(); // switch off the Grain display
933
934 // This is is a safety check to ensure sure none of the file paths contain a return char
935 for (const auto& s : files)
936 {
937 if (s.containsChar('\n'))
938 {
939 jassertfalse;
940 return;
941 }
942
943 // Add new samples to samples tree
944 m_samplesTree.addSample(File(s).getFileNameWithoutExtension(), s, false);
945 }
946
948 {
950 }
951
954
955 // Mixpanel analytics: added samples to core engine
956 sendActionMessage(analyticsEventAddedSamplesEngine);
957 }
958
960 std::vector<Range<int>> selections)
961 {
962 int i = 0;
963 for (auto& selection : selections)
964 {
965 m_samplesTree.setSampleSelection(i++, selection);
966 }
967 }
968
969 String KwidgetGUI_CoreEngine::findSimilarAudioFile(String samplePaths, bool isCommandDown)
970 {
971 auto files = StringArray::fromLines(samplePaths);
972 if (files.size() == 1) // Only do match if we have a single file loaded
973 {
974 // keep track of current file so we can restore later if needed
975 m_samplePathRestore = files[0];
976
977 auto query = AssetManager::convertFilePathString(files[0]).toStdString();
978
979 // return at most 20 closest matches
980 auto pathsAndScores = m_audioDataset->sample(query, 20, true);
981
982 // show a popup menu of results
983 if (isCommandDown)
984 {
985 PopupMenu resultsMenu;
986 int idx = 0;
987 std::reverse(pathsAndScores.begin(), pathsAndScores.end());
988 for (const auto& [path, score] : pathsAndScores)
989 {
990 auto fileName = AssetManager::convertFilePath(path).getFileName();
991 auto itemText = "[" + String(score, 2) + "] " + fileName;
992 resultsMenu.addItem(++idx, itemText);
993 }
994 auto item = resultsMenu.showMenu(PopupMenu::Options());
995 // return user selection
996 return item > 0 ? String(pathsAndScores[item - 1].first) : samplePaths;
997 }
998 // no menu - just return a random choice from the results
999 else
1000 {
1001 jassert(!pathsAndScores.empty());
1002 if (pathsAndScores.size() <= 2)
1003 {
1004 // not enough results to make a random pick
1005 return String(pathsAndScores.front().first);
1006 }
1007 else
1008 {
1009 // random pick avoiding query (last element)
1010 auto n = (int)pathsAndScores.size() - 1;
1011 auto randomIndex = Random::getSystemRandom().nextInt(n);
1012 return String(pathsAndScores[randomIndex].first);
1013 }
1014 }
1015 }
1016 return samplePaths;
1017 }
1018
1019 void KwidgetGUI_CoreEngine::scrollBarMoved(ScrollBar* /*scrollBarThatHasMoved*/, double newRangeStart)
1020 {
1021 m_waveformViewerAndEditor->setViewCentre(float(newRangeStart));
1022 }
1023
1025 {
1026 const Range currentRange = m_waveformViewScrollbar.getCurrentRange();
1027 const double newStart = currentRange.getStart() + ((currentRange.getLength() - newThumbSize) / 2);
1028 m_waveformViewScrollbar.setCurrentRange(/*starting point*/ newStart, /*size*/ double(newThumbSize),
1029 NotificationType::dontSendNotification);
1030 }
1031
1033 {
1034 if (newRange.isEmpty())
1035 {
1036 return;
1037 }
1038 m_waveformViewScrollbar.setCurrentRange(static_cast<double>(newRange.getStart()),
1039 static_cast<double>(newRange.getLength()),
1040 NotificationType::dontSendNotification);
1041 }
1042
1044 {
1045 // Set zoom in/out button images and hover states
1046 const Colour defaultIconColour(177, 177, 177);
1047 const Colour hoverIconColour(217, 217, 217);
1048 m_zoomInButtonImage->replaceColour(Colours::white, Colours::transparentWhite);
1049 m_zoomOutButtonImage->replaceColour(Colours::white, Colours::transparentWhite);
1050 m_zoomInButtonImageMouseOver->replaceColour(defaultIconColour, hoverIconColour);
1051 m_zoomInButtonImageMouseOver->replaceColour(Colours::white, Colours::transparentWhite);
1052 m_zoomOutButtonImageMouseOver->replaceColour(defaultIconColour, hoverIconColour);
1053 m_zoomOutButtonImageMouseOver->replaceColour(Colours::white, Colours::transparentWhite);
1056 addAndMakeVisible(m_zoomInButton);
1057 addAndMakeVisible(m_zoomOutButton);
1060 // set zoom in/out button controls
1061 m_zoomInButton.onClick = [this] { m_waveformViewerAndEditor->zoomIn(); };
1062 m_zoomOutButton.onClick = [this] { m_waveformViewerAndEditor->zoomOut(); };
1063
1064 // set scroll bar colour and behaviour
1066 m_waveformViewScrollbar.setAutoHide(false);
1067 addAndMakeVisible(m_waveformViewScrollbar);
1068 }
1069
1071 {
1073 m_waveformViewerAndEditor->clear(); // stop grain display
1074 m_waveformViewerAndEditor->setViewerDropText(m_defaultDropText);
1078 // Update the waveform selectors
1079 m_waveformViewerAndEditor->copySegmentsToSelectors();
1080 }
1081
1088
1090
1091 void KwidgetGUI_CoreEngine::selectSample(int segmentIndex, bool cueSelected)
1092 {
1093 if (m_samplesTree.getNumSamples() == 0)
1094 {
1095 return;
1096 }
1097 jassert(segmentIndex >= 0);
1098 jassert(segmentIndex < m_samplesTree.getNumSamples());
1099
1100 // This member is used for the handling forward/back button position
1101 m_selectedSegment = segmentIndex;
1102 // This member is used for the cyan dot to remain next to user cued samples only
1103 m_cuedSegment = cueSelected ? segmentIndex : m_cuedSegment;
1104
1105 // Update sample browser UI
1108 auto sampleName = sample ? sample->nameValue : String();
1109 if (m_sampleBrowserButton.getButtonText() != sampleName)
1110 {
1111 m_sampleBrowserButton.setButtonText(sampleName);
1112 }
1113
1114 // Update waveform viewer
1116
1117 // Cue the user selected sample in the engine
1118 if (auto* sampler = m_soSound.getSampleEngine();
1119 sampler && cueSelected && segmentIndex < sampler->getNumSamples())
1120 {
1121 sampler->setNextSegmentIndex(segmentIndex);
1122 }
1123 }
1124
1125 void KwidgetGUI_CoreEngine::mouseEnter(const MouseEvent& event)
1126 {
1127 // Fix for repeated midi note change events being to analytics on preset load.
1128 // Only send events after the mouse has entered the component for the first time.
1130 }
1131
1132} // namespace krotos
WaveformMode
Definition AreaSelectionComp.h:7
static File convertFilePath(const String &)
Definition AssetManager.cpp:604
static String convertFilePathString(const String &)
Definition AssetManager.cpp:583
std::function< void()> onStateChange
Definition AttachedComboBox.h:24
ComboBox & getControlComponent()
Definition AttachedComboBox.cpp:20
void setValueSuffix(String valueSuffix)
Definition AttachedSlider.h:56
Label & getLabel()
Definition AttachedSlider.cpp:163
void setDebugColour(Colour newColour)
Definition AttachedSlider.cpp:171
void setValueFormat(String valueFormat)
Definition AttachedSlider.h:59
Slider & getSlider()
Definition AttachedSlider.cpp:165
void setLabelPosition(LabelPosition position)
Definition AttachedSlider.h:49
Button & getButton()
Definition AttachedToggleButton.cpp:26
std::unique_ptr< ButtonParameterAttachment > & getAttachment()
Definition AttachedToggleButton.cpp:30
A wrapper around juce::ValueTree designed to store custom plugin state (strings, arrays,...
Definition CustomParameter.h:9
const var & getValue() const
Definition CustomParameter.cpp:39
void removeAllChildren()
Removes all children from the tree.
Definition CustomParameterTree.h:88
float get() const
Definition KParameter.cpp:126
void set(float newValue)
Definition KParameter.cpp:128
Definition KrotosSynthesiserSound.h:19
void clearAndFreeBuffer()
Definition KrotosSynthesiserSound.cpp:115
void removeListener(Listener *l)
Definition KrotosSynthesiserSound.h:49
SampleEngine * getSampleEngine() override
Definition KrotosSynthesiserSound.h:44
void addListener(Listener *l)
Definition KrotosSynthesiserSound.h:48
Definition Kwidget_CoreEngine.h:4
static const StringArray ModeNames
Definition Kwidget_CoreEngine.h:79
EngineMode
Definition Kwidget_CoreEngine.h:83
@ modeSampler
Definition Kwidget_CoreEngine.h:84
@ modeVehicle
Definition Kwidget_CoreEngine.h:86
@ modeGranular
Definition Kwidget_CoreEngine.h:85
@ modeNUM_MODES
Definition Kwidget_CoreEngine.h:87
void setActiveMidiMode(MIDIMode newMidiMode)
Definition Kwidget_CoreEngine.cpp:550
static const StringArray MIDIModeNames
Definition Kwidget_CoreEngine.h:80
AttachedSlider m_DetuneRand
Definition KwidgetGUI_CoreEngine.h:116
TextButton m_clearButton
Definition KwidgetGUI_CoreEngine.h:158
AttachedComboBox m_mode
Definition KwidgetGUI_CoreEngine.h:141
AttachedSlider m_ARate
Definition KwidgetGUI_CoreEngine.h:123
void scrollBarMoved(ScrollBar *scrollBarThatHasMoved, double newRangeStart) override
Definition KwidgetGUI_CoreEngine.cpp:1019
void setGranularControlsVisibility(bool shouldBeVisible)
Definition KwidgetGUI_CoreEngineGranular.cpp:3
DrawableButton m_removeEngineButton
Definition KwidgetGUI_CoreEngine.h:162
TextButton m_tweakButton1
Definition KwidgetGUI_CoreEngine.h:159
void setVisibleControlsSet(Kwidget_CoreEngine::EngineMode mode)
Definition KwidgetGUI_CoreEngine.cpp:783
AttachedToggleButton m_AutoRateToggle
Definition KwidgetGUI_CoreEngine.h:149
SamplesTree m_samplesTree
Definition KwidgetGUI_CoreEngine.h:308
AttachedSlider m_Cycles
Definition KwidgetGUI_CoreEngine.h:136
std::unique_ptr< TabbedComponent > m_tabbedComponent
Definition KwidgetGUI_CoreEngine.h:331
void selectionsChanged(WaveformViewerAndEditor *, std::vector< Range< int > > selections) override
Definition KwidgetGUI_CoreEngine.cpp:959
String findSimilarAudioFile(String samplePaths, bool isCommandDown)
Definition KwidgetGUI_CoreEngine.cpp:969
AttachedSlider m_Tracking
Definition KwidgetGUI_CoreEngine.h:135
void setSamplerControlsVisibility(bool shouldBeVisible)
Definition KwidgetGUI_CoreEngineSampler.cpp:3
AttachedSlider m_Pan
Definition KwidgetGUI_CoreEngine.h:108
AttachedToggleButton m_QuenchToggle
Definition KwidgetGUI_CoreEngine.h:145
struct krotos::KwidgetGUI_CoreEngine::ColourDefinitions m_colourDefinitions
AttachedSlider m_Size
Definition KwidgetGUI_CoreEngine.h:104
AttachedSlider m_RateRand
Definition KwidgetGUI_CoreEngine.h:115
SharedResourcePointer< AudioDataset > m_audioDataset
Definition KwidgetGUI_CoreEngine.h:320
void initialiseTabbedComponent()
Definition KwidgetGUI_CoreEngine.cpp:729
std::unique_ptr< krotos::WaveformViewerAndEditor > m_waveformViewerAndEditor
Definition KwidgetGUI_CoreEngine.h:171
AttachedSlider m_Shape
Definition KwidgetGUI_CoreEngine.h:132
void paint(Graphics &g) override
Definition KwidgetGUI_CoreEngine.cpp:826
KwidgetGUI_CoreEngine(Kwidget &owner, KrotosSampleOscillatorSound &sound)
Definition KwidgetGUI_CoreEngine.cpp:44
void resizeVehicle()
Definition KwidgetGUI_CoreEngineVehicle.cpp:35
AttachedToggleButton m_RobinToggle
Definition KwidgetGUI_CoreEngine.h:147
static const std::string analyticsEventAddedSamplesEngine
Definition KwidgetGUI_CoreEngine.h:97
AttachedToggleButton m_EnableMuteUpToggle
Definition KwidgetGUI_CoreEngine.h:154
void setVehicleControlsVisibility(bool shouldBeVisible)
Definition KwidgetGUI_CoreEngineVehicle.cpp:3
std::unique_ptr< Drawable > m_hoverDeleteButton
Definition KwidgetGUI_CoreEngine.h:323
AttachedSlider m_AMix
Definition KwidgetGUI_CoreEngine.h:125
std::unique_ptr< Drawable > m_defaultDeleteButton
Definition KwidgetGUI_CoreEngine.h:323
AttachedToggleButton m_SALoopToggle
Definition KwidgetGUI_CoreEngine.h:148
void clearEngine()
Definition KwidgetGUI_CoreEngine.cpp:1070
ScrollBar m_waveformViewScrollbar
Definition KwidgetGUI_CoreEngine.h:329
AttachedToggleButton m_EnableMuteDownToggle
Definition KwidgetGUI_CoreEngine.h:155
void resetBrowserButtonStatus()
Definition KwidgetGUI_CoreEngine.cpp:1082
AttachedSlider m_WidthRand
Definition KwidgetGUI_CoreEngine.h:117
ComboBox m_trigger
Definition KwidgetGUI_CoreEngine.h:142
AttachedSlider m_Distance
Definition KwidgetGUI_CoreEngine.h:134
TextButton m_muteButton
Definition KwidgetGUI_CoreEngine.h:164
TextButton m_soloButton
Definition KwidgetGUI_CoreEngine.h:166
AttachedSlider m_BMix
Definition KwidgetGUI_CoreEngine.h:130
std::unique_ptr< Drawable > m_zoomOutButtonImageMouseOver
Definition KwidgetGUI_CoreEngine.h:326
Component m_pitchEnvTab
Definition KwidgetGUI_CoreEngine.h:332
AttachedSlider m_SizeRand
Definition KwidgetGUI_CoreEngine.h:114
void mouseEnter(const MouseEvent &event)
Definition KwidgetGUI_CoreEngine.cpp:1125
AttachedSlider m_StartRand
Definition KwidgetGUI_CoreEngine.h:113
SampleBrowserButton m_sampleBrowserButton
Definition KwidgetGUI_CoreEngine.h:334
int m_selectedSegment
Definition KwidgetGUI_CoreEngine.h:336
String m_samplePathRestore
Definition KwidgetGUI_CoreEngine.h:319
AttachedSlider m_PanRand
Definition KwidgetGUI_CoreEngine.h:118
AttachedSlider m_ASize
Definition KwidgetGUI_CoreEngine.h:122
AttachedToggleButton m_AutoplayToggle
Definition KwidgetGUI_CoreEngine.h:153
Component m_extrasTab
Definition KwidgetGUI_CoreEngine.h:332
AttachedSlider m_Smoothing
Definition KwidgetGUI_CoreEngine.h:137
void resizeScrollBar(float newThumbSize) override
Definition KwidgetGUI_CoreEngine.cpp:1024
void tabSetupGranular()
Definition KwidgetGUI_CoreEngineGranular.cpp:59
~KwidgetGUI_CoreEngine() override
Definition KwidgetGUI_CoreEngine.cpp:812
static const std::string analyticsEventClearedEngine
Definition KwidgetGUI_CoreEngine.h:96
AttachedToggleButton m_NormaliseToggle
Definition KwidgetGUI_CoreEngine.h:152
void selectSample(int segmentIndex, bool cueSelected)
Updates the waveform veiwer and sample browser to show a single segment.
Definition KwidgetGUI_CoreEngine.cpp:1091
AttachedSlider m_Sensitivity
Definition KwidgetGUI_CoreEngine.h:138
void resizeGranular()
Definition KwidgetGUI_CoreEngineGranular.cpp:36
std::unique_ptr< ButtonParameterAttachment > m_muteButtonAttachment
Definition KwidgetGUI_CoreEngine.h:165
const String m_defaultDropText
Definition KwidgetGUI_CoreEngine.h:321
Label m_coreEngineNameLabel
Definition KwidgetGUI_CoreEngine.h:173
AttachedSlider m_Width
Definition KwidgetGUI_CoreEngine.h:107
AttachedSlider m_ASpray
Definition KwidgetGUI_CoreEngine.h:124
DrawableButton m_zoomInButton
Definition KwidgetGUI_CoreEngine.h:327
void modeParamChanged(float val)
Definition KwidgetGUI_CoreEngine.cpp:761
AttachedToggleButton m_PhaseSyncToggle
Definition KwidgetGUI_CoreEngine.h:151
void fileHasBeenDropped(WaveformViewerAndEditor *areaSelectionComp, const StringArray &files) override
Definition KwidgetGUI_CoreEngine.cpp:929
AttachedSlider m_GranularLevel
Definition KwidgetGUI_CoreEngine.h:111
void resizeScrollBarFromRange(Range< float > newRange) override
Definition KwidgetGUI_CoreEngine.cpp:1032
void soundChanged(KrotosSampleOscillatorSound *sound) override
Definition KwidgetGUI_CoreEngine.cpp:909
Component m_mainTab
Definition KwidgetGUI_CoreEngine.h:332
void showSampleBrowser()
Definition KwidgetGUI_CoreEngine.cpp:643
bool m_calledFromMarqueeEnd
Definition KwidgetGUI_CoreEngine.h:316
AttachedToggleButton m_PhaseLockToggle
Definition KwidgetGUI_CoreEngine.h:150
Component m_ampEnvTab
Definition KwidgetGUI_CoreEngine.h:332
AttachedSlider m_BRate
Definition KwidgetGUI_CoreEngine.h:128
Kwidget_CoreEngine::EngineMode m_activeMode
Definition KwidgetGUI_CoreEngine.h:311
void initialiseZoomControls()
Definition KwidgetGUI_CoreEngine.cpp:1043
AttachedSlider m_Level
Definition KwidgetGUI_CoreEngine.h:109
void finalSetup() override
Definition KwidgetGUI_CoreEngine.cpp:750
DrawableButton m_zoomOutButton
Definition KwidgetGUI_CoreEngine.h:328
TextButton m_tweakButton2
Definition KwidgetGUI_CoreEngine.h:160
AttachedSlider m_BSize
Definition KwidgetGUI_CoreEngine.h:127
AttachedSlider m_GrainMax
Definition KwidgetGUI_CoreEngine.h:133
bool m_calledFromMarqueeStart
Definition KwidgetGUI_CoreEngine.h:315
std::unique_ptr< Drawable > m_zoomInButtonImage
Definition KwidgetGUI_CoreEngine.h:325
KrotosSampleOscillatorSound & m_soSound
Definition KwidgetGUI_CoreEngine.h:309
Component m_randTab
Definition KwidgetGUI_CoreEngine.h:332
int m_cuedSegment
Definition KwidgetGUI_CoreEngine.h:337
AttachedSlider m_BSpray
Definition KwidgetGUI_CoreEngine.h:129
static const std::string analyticsEventChangedMidiTriggerEngine
Definition KwidgetGUI_CoreEngine.h:98
void resized() override
Definition KwidgetGUI_CoreEngine.cpp:836
void tabSetupSampler()
Definition KwidgetGUI_CoreEngineSampler.cpp:35
AttachedSlider m_LevelRand
Definition KwidgetGUI_CoreEngine.h:119
AttachedSlider m_VehicleLevel
Definition KwidgetGUI_CoreEngine.h:112
std::unique_ptr< ButtonParameterAttachment > m_soloButtonAttachment
Definition KwidgetGUI_CoreEngine.h:167
AttachedSlider m_Detune
Definition KwidgetGUI_CoreEngine.h:106
AttachedSlider m_SamplerLevel
Definition KwidgetGUI_CoreEngine.h:110
AttachedSlider m_Rate
Definition KwidgetGUI_CoreEngine.h:105
AttachedToggleButton m_NORToggle
Definition KwidgetGUI_CoreEngine.h:146
Kwidget & m_owner
Definition KwidgetGUI_CoreEngine.h:312
bool m_notifyMidiTriggerChange
Definition KwidgetGUI_CoreEngine.h:340
void resizeSampler()
Definition KwidgetGUI_CoreEngineSampler.cpp:27
std::unique_ptr< Drawable > m_zoomInButtonImageMouseOver
Definition KwidgetGUI_CoreEngine.h:325
static const std::string analyticsEventRemovedEngine
Definition KwidgetGUI_CoreEngine.h:99
AttachedSlider m_Start
Definition KwidgetGUI_CoreEngine.h:103
std::unique_ptr< Drawable > m_zoomOutButtonImage
Definition KwidgetGUI_CoreEngine.h:326
struct krotos::KwidgetGUI_CoreEngine::Layout m_layout
Interface for a UI Component that controls a KwidgetProcessor.
Definition KwidgetGUI.h:24
std::unique_ptr< SliderParameterAttachment > createParameterAttachment(const String &paramID, Slider &slider)
Definition KwidgetGUI.cpp:72
void addParameterCallback(const String &paramID, std::function< void(float)> callback)
Definition KwidgetGUI.cpp:108
Kwidget & getOwner()
Definition KwidgetGUI.cpp:106
void addAttachedComponent(AttachedComponentType &component, const String &paramID, bool isDraggable=true)
Definition KwidgetGUI.h:112
void resized() override
Definition KwidgetGUI.cpp:45
const String & getKwidgetID() const
Definition KwidgetGUI.cpp:70
std::function< void(const String &)> onDelete
Definition KwidgetGUI.h:95
void setRenderStyle(RenderStyle newStyle)
Definition KwidgetGUI.cpp:114
Definition Kwidget.h:8
KParameter * getParameter(const String &parameterID) const noexcept
Get a raw pointer to a KParameter belonging to this Kwidget's KwidgetProcessor. Useful for low overhe...
Definition Kwidget.cpp:168
const String & getKwidgetID() const
Definition Kwidget.cpp:367
CustomParameter * getCustomParameter(const String &parameterID)
Definition Kwidget.cpp:188
void setSampleIndex(int index)
Sets the number of the sample counter indicator e.g. "<index> of 10".
Definition SampleBrowserButton.cpp:88
std::function< void()> onNextButtonClick
Callback for when the "next" sample button is clicked.
Definition SampleBrowserButton.h:22
void setSampleCount(size_t count)
Sets the number of samples loaded in the sampler to display in the sample counter e....
Definition SampleBrowserButton.cpp:96
std::function< void()> onPreviousButtonClick
Callback for when the "previous" sample button is clicked.
Definition SampleBrowserButton.h:27
A wrapper around an individual sample in the tree, with parameters for mute, solo,...
Definition SampleDataTree.h:38
A CustomParameterTree for managing a list of samples, with parameters for mute, solo,...
Definition SampleDataTree.h:9
std::function< void()> dropCompleted
Assign this to do something once a "drop" action has been completed. This is called internally by the...
Definition SampleDataTree.h:175
std::function< void(int sampleIndex)> sampleIndexChanged
Assign a lambda to this callback to do something when the sample_index property has been changed.
Definition SampleDataTree.h:181
std::function< void(Sample &newSample)> sampleAdded
Assign this to do something when a sample has been added to the tree.
Definition SampleDataTree.h:151
const OwnedArray< Sample > & getSamples() const
Definition SampleDataTree.h:140
OwnedArray< SampleBrowser::Sample > getSampleDataAsBrowserSamples()
Helper function to return an array of SampleBrowser::Sample objects populated from the SamplesTree....
Definition SampleDataTree.cpp:180
void removeSample(const String &name)
Removes a sample from the tree by name.
Definition SampleDataTree.cpp:116
CachedValue< int > selectedSampleValue
The index of the last sample to be selected by the user.
Definition SampleDataTree.h:260
const int getNumSamples() const
Returns the number of samples in the samples tree.
Definition SampleDataTree.h:145
void addSample(const String &name, const String &path, bool isMuted)
Add a new sample into the tree.
Definition SampleDataTree.cpp:98
void setSampleSelection(int index, const Range< int > selection)
Set the selection range for a sample by index.
Definition SampleDataTree.cpp:134
std::function< void(ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved)> sampleRemoved
Assign this to do something when a sample has been removed from the tree.
Definition SampleDataTree.h:155
std::function< void(int sampleIndex)> selectedSampleChanged
Assign a lambda to this callback to do something when the selected_sample property has been changed.
Definition SampleDataTree.h:187
Definition WaveformViewerAndEditor.h:8
Definition AirAbsorptionFilter.cpp:2
MIDIMode
Definition SampleEngine.h:54
static const Identifier AlertHeightID
Definition Krotos_LookAndFeel.h:24
static const Identifier AlertWidthID
Definition Krotos_LookAndFeel.h:23
Definition Kwidget_CoreEngine.h:20
static const String MIDIMode
Definition Kwidget_CoreEngine.h:71
static const String NOR
Definition Kwidget_CoreEngine.h:41
static const String Mode
Definition Kwidget_CoreEngine.h:65
static const String PitchRand
Definition Kwidget_CoreEngine.h:36
static const String BMix
Definition Kwidget_CoreEngine.h:64
static const String BSpray
Definition Kwidget_CoreEngine.h:63
static const String PhaseSync
Definition Kwidget_CoreEngine.h:46
static const String Width
Definition Kwidget_CoreEngine.h:26
static const String PhaseLock
Definition Kwidget_CoreEngine.h:45
static const String SizeRand
Definition Kwidget_CoreEngine.h:34
static const String Distance
Definition Kwidget_CoreEngine.h:72
static const String Solo
Definition Kwidget_CoreEngine.h:70
static const String MuteUp
Definition Kwidget_CoreEngine.h:48
static const String SamplerLevel
Definition Kwidget_CoreEngine.h:29
static const String VehicleLevel
Definition Kwidget_CoreEngine.h:31
static const String Pan
Definition Kwidget_CoreEngine.h:27
static const String Robin
Definition Kwidget_CoreEngine.h:42
static const String Start
Definition Kwidget_CoreEngine.h:21
static const String Mute
Definition Kwidget_CoreEngine.h:69
static const String AMix
Definition Kwidget_CoreEngine.h:60
static const String GrainMax
Definition Kwidget_CoreEngine.h:52
static const String Pitch
Definition Kwidget_CoreEngine.h:24
static const String PanRand
Definition Kwidget_CoreEngine.h:38
static const String Level
Definition Kwidget_CoreEngine.h:28
static const String Size
Definition Kwidget_CoreEngine.h:22
static const String Smoothing
Definition Kwidget_CoreEngine.h:55
static const String Rate
Definition Kwidget_CoreEngine.h:23
static const String LevelRand
Definition Kwidget_CoreEngine.h:39
static const String ARate
Definition Kwidget_CoreEngine.h:58
static const String WidthRand
Definition Kwidget_CoreEngine.h:37
static const String Tracking
Definition Kwidget_CoreEngine.h:53
static const String Normalise
Definition Kwidget_CoreEngine.h:47
static const String Autoplay
Definition Kwidget_CoreEngine.h:50
static const String StartRand
Definition Kwidget_CoreEngine.h:33
static const String BRate
Definition Kwidget_CoreEngine.h:62
static const String SALoop
Definition Kwidget_CoreEngine.h:43
static const String BSize
Definition Kwidget_CoreEngine.h:61
static const String RateRand
Definition Kwidget_CoreEngine.h:35
static const String AutoRate
Definition Kwidget_CoreEngine.h:44
static const String GranularLevel
Definition Kwidget_CoreEngine.h:30
static const String Shape
Definition Kwidget_CoreEngine.h:51
static const String ASpray
Definition Kwidget_CoreEngine.h:59
static const String Sensitivity
Definition Kwidget_CoreEngine.h:56
static const String Quench
Definition Kwidget_CoreEngine.h:40
static const String Cycles
Definition Kwidget_CoreEngine.h:54
static const String MuteDown
Definition Kwidget_CoreEngine.h:49
static const String ASize
Definition Kwidget_CoreEngine.h:57
const Colour waveformColour
Definition KwidgetGUI_CoreEngine.h:305
static const String ButtonZoomInId
Definition KwidgetGUI_CoreEngine.h:89
static const String SliderPanId
Definition KwidgetGUI_CoreEngine.h:65
static const String ScrollBarWaveformViewId
Definition KwidgetGUI_CoreEngine.h:91
static const String SliderGrainSizeRNDId
Definition KwidgetGUI_CoreEngine.h:76
static const String SliderPanRandId
Definition KwidgetGUI_CoreEngine.h:66
static const String ButtonRoundRobinId
Definition KwidgetGUI_CoreEngine.h:82
static const String SliderGrainShapeId
Definition KwidgetGUI_CoreEngine.h:70
static const String SliderGrainWidthId
Definition KwidgetGUI_CoreEngine.h:74
static const String SliderLevelRandId
Definition KwidgetGUI_CoreEngine.h:64
static const String ButtonReleaseTriggerId
Definition KwidgetGUI_CoreEngine.h:84
static const String ButtonZoomOutId
Definition KwidgetGUI_CoreEngine.h:90
static const String ButtonSampleBrowserId
Definition KwidgetGUI_CoreEngine.h:88
static const String ButtonLoopToggleGranularId
Definition KwidgetGUI_CoreEngine.h:86
static const String ButtonLoopToggleSamplerId
Definition KwidgetGUI_CoreEngine.h:85
static const String SliderGrainStartId
Definition KwidgetGUI_CoreEngine.h:71
static const String SliderPitchGranularId
Definition KwidgetGUI_CoreEngine.h:68
static const String SliderGrainStartRNDId
Definition KwidgetGUI_CoreEngine.h:75
static const String SliderGrainWidthRNDId
Definition KwidgetGUI_CoreEngine.h:78
static const String SliderPitchGranularRNDId
Definition KwidgetGUI_CoreEngine.h:79
static const String ButtonMuteId
Definition KwidgetGUI_CoreEngine.h:80
static const String SliderLevelSamplerId
Definition KwidgetGUI_CoreEngine.h:63
static const String WaveformViewerId
Definition KwidgetGUI_CoreEngine.h:92
static const String SliderGrainRateRNDId
Definition KwidgetGUI_CoreEngine.h:77
static const String ComboboxModeId
Definition KwidgetGUI_CoreEngine.h:61
static const String ButtonClearEngineId
Definition KwidgetGUI_CoreEngine.h:93
static const String ButtonAutoplayId
Definition KwidgetGUI_CoreEngine.h:83
static const String ButtonSoloId
Definition KwidgetGUI_CoreEngine.h:81
static const String SliderGrainSizeId
Definition KwidgetGUI_CoreEngine.h:72
static const String SliderGrainMaxId
Definition KwidgetGUI_CoreEngine.h:69
static const String SliderPitchSamplerId
Definition KwidgetGUI_CoreEngine.h:67
static const String SliderGrainRateId
Definition KwidgetGUI_CoreEngine.h:73
static const String SliderLevelGranularId
Definition KwidgetGUI_CoreEngine.h:62
static const String ComboboxTriggerId
Definition KwidgetGUI_CoreEngine.h:60
static const String ButtonNormaliseToggleId
Definition KwidgetGUI_CoreEngine.h:87
const Rectangle< int > pitchEnvBounds
Definition KwidgetGUI_CoreEngine.h:258
const Rectangle< int > tabbedComponentBounds
Definition KwidgetGUI_CoreEngine.h:256
const Rectangle< int > ampEnvBounds
Definition KwidgetGUI_CoreEngine.h:257
const Rectangle< int > levelSlider
Definition KwidgetGUI_CoreEngine.h:245
const Rectangle< int > panSlider
Definition KwidgetGUI_CoreEngine.h:248
const Rectangle< int > triggerCombobox
Definition KwidgetGUI_CoreEngine.h:234
const Rectangle< int > muteButton
Definition KwidgetGUI_CoreEngine.h:232
const Rectangle< int > soloButton
Definition KwidgetGUI_CoreEngine.h:233
const Rectangle< int > randLevelSlider
Definition KwidgetGUI_CoreEngine.h:246
const Rectangle< int > panRandSlider
Definition KwidgetGUI_CoreEngine.h:249
const Rectangle< int > modeLabel
Definition KwidgetGUI_CoreEngine.h:235
const float modeFontSize
Definition KwidgetGUI_CoreEngine.h:299
Rectangle< int > toggleGroupAreaSampler
Definition KwidgetGUI_CoreEngine.h:279
struct krotos::KwidgetGUI_CoreEngine::Layout::ControlsTabs controlsTabs
const Rectangle< int > waveformZoomScrollbar
Definition KwidgetGUI_CoreEngine.h:285
const int sampleBrowserWidth
Definition KwidgetGUI_CoreEngine.h:295
const int sampleBrowserItemHeight
Definition KwidgetGUI_CoreEngine.h:292
const int randomToggleWidth
Definition KwidgetGUI_CoreEngine.h:277
const float modeExtraKerning
Definition KwidgetGUI_CoreEngine.h:300
const int loopToggleWidth
Definition KwidgetGUI_CoreEngine.h:273
const int sampleBrowserMaxItemsToShow
Definition KwidgetGUI_CoreEngine.h:293
const int autoplayToggleWidth
Definition KwidgetGUI_CoreEngine.h:275
struct krotos::KwidgetGUI_CoreEngine::Layout::LeftPanel leftPanel
const Rectangle< int > waveformZoomInButton
Definition KwidgetGUI_CoreEngine.h:287
const Rectangle< int > waveformArea
Definition KwidgetGUI_CoreEngine.h:282
const int releaseTrigToggleWidth
Definition KwidgetGUI_CoreEngine.h:276
const Rectangle< int > waveformZoomOutButton
Definition KwidgetGUI_CoreEngine.h:286
const Rectangle< int > sampleBrowserButton
Definition KwidgetGUI_CoreEngine.h:291
const int normalizeToggleWidth
Definition KwidgetGUI_CoreEngine.h:274
const Rectangle< int > removeEngineButton
Definition KwidgetGUI_CoreEngine.h:297
static const Identifier Samples
Definition SampleDataTree.h:13