45 :
KwidgetGUI(owner), m_soSound(sound), m_owner(owner), m_sampleBrowserButton(
""),
46 m_removeEngineButton(
"", DrawableButton::ImageStretched), m_zoomInButton(
"", DrawableButton::ImageStretched),
48 Drawable::createFromImageData(KrotosBinaryData::Plus_Icon_svg, KrotosBinaryData::Plus_Icon_svgSize)),
49 m_zoomInButtonImageHover(
50 Drawable::createFromImageData(KrotosBinaryData::Plus_Icon_svg, KrotosBinaryData::Plus_Icon_svgSize)),
51 m_zoomOutButton(
"", DrawableButton::ImageStretched),
52 m_zoomOutButtonImage(Drawable::createFromImageData(KrotosBinaryData::Minus_Icon_svg,
53 KrotosBinaryData::Minus_Icon_svgSize)),
54 m_zoomOutButtonImageHover(
55 Drawable::createFromImageData(KrotosBinaryData::Minus_Icon_svg, KrotosBinaryData::Minus_Icon_svgSize))
57 setComponentID(
"Reformer");
68#if IS_DEVELOPMENT_BUILD
73 for (
int tabIndex = 0; tabIndex <
m_controlsTab.getNumTabs(); tabIndex++)
75 const auto& tabButton =
m_controlsTab.getTabbedButtonBar().getTabButton(tabIndex);
77 tabButton->setComponentID(
"ReformerTab" + tabButton->getName());
97 m_Pan.
getSlider().setSliderStyle(Slider::SliderStyle::LinearHorizontal);
255 if (owningKwidget !=
nullptr)
267 m_defaultDeleteButton = Drawable::createFromImageData(KrotosBinaryData::remove_engine_icon_default_png,
268 KrotosBinaryData::remove_engine_icon_default_pngSize);
270 m_hoverDeleteButton = Drawable::createFromImageData(KrotosBinaryData::remove_engine_icon_hover_png,
271 KrotosBinaryData::remove_engine_icon_hover_pngSize);
284 std::function<void(
int)> removeEngineCallback = [
this](
int option) {
291 MessageManager::callAsync([
this]() {
301 AlertWindow::showAsync(MessageBoxOptions()
302 .withIconType(MessageBoxIconType::WarningIcon)
303 .withTitle(
"Removing Engine")
304 .withMessage(
"Are you sure you want to proceed with the\nremoval? This "
305 "action cannot be undone!")
306 .withButton(
"Cancel")
307 .withButton(
"Remove")
308 .withAssociatedComponent(
this),
309 removeEngineCallback);
322#ifdef USE_LEGACY_GUI_FEATURES
324 addAndMakeVisible(m_AutoRateToggle);
325 addAndMakeVisible(m_PhaseLockToggle);
326 addAndMakeVisible(m_PhaseSyncToggle);
371 std::make_unique<krotos::WaveformViewerAndEditor>(Colour(152, 152, 152),
false,
true);
432 OwnedArray<SampleBrowser::Sample> samplesToShow;
453 browser->setSampleFunctionButtonsVisibility(
false);
457 menu.addCustomItem(item::Browser, std::move(browser));
459 menu.addItem(item::Add,
"Add More Samples",
true,
false,
460 Drawable::createFromImageData(KrotosBinaryData::Add_Sample_Icon_svg,
461 KrotosBinaryData::Add_Sample_Icon_svgSize));
462 menu.addItem(item::RemoveAll,
"Remove All Samples",
true,
false,
463 Drawable::createFromImageData(KrotosBinaryData::Remove_All_Samples_svg,
464 KrotosBinaryData::Remove_All_Samples_svgSize));
466 std::function<void(
int)> menuCallback = [&](
int itemResultID) {
467 switch (itemResultID)
472 case item::RemoveAll:
473 std::function<void(
int)> removeCallback = [
this,
474 target = WeakReference<Component>{
this}](
int option) {
475 if (target && option == 0)
487 AlertWindow::showAsync(
489 .withIconType(MessageBoxIconType::WarningIcon)
490 .withTitle(
"Sample Removal")
491 .withMessage(
"Are you sure you want to proceed with the\nremoval? This "
492 "action cannot be undone!")
493 .withButton(
"Cancel")
494 .withButton(
"Remove")
501 menu.showMenuAsync(PopupMenu::Options{}
503 .withMinimumNumColumns(1)
520 const Colour defaultIconColour(177, 177, 177);
521 const Colour hoverIconColour(217, 217, 217);
530 m_zoomInButton.setButtonStyle(DrawableButton::ButtonStyle::ImageStretched);
531 m_zoomOutButton.setButtonStyle(DrawableButton::ButtonStyle::ImageStretched);
546 1.0, NotificationType::dontSendNotification);
567 switch (segmentation)
569 case Segmentation::SegmentationNone:
570 m_Coeff0.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
571 m_Coeff1.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
572 m_Coeff2.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
573 m_Coeff3.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
574 m_Coeff4.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
575 m_Coeff7.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
577 case Segmentation::STFT:
578 m_Coeff0.
getLabel().setText(
"FrameSize", NotificationType::dontSendNotification);
579 m_Coeff1.
getLabel().setText(
"HopSize", NotificationType::dontSendNotification);
580 m_Coeff2.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
581 m_Coeff3.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
582 m_Coeff4.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
583 m_Coeff7.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
585 case Segmentation::EnvOnset:
586 m_Coeff0.
getLabel().setText(
"Thresh", NotificationType::dontSendNotification);
587 m_Coeff1.
getLabel().setText(
"Onset", NotificationType::dontSendNotification);
588 m_Coeff2.
getLabel().setText(
"Decay", NotificationType::dontSendNotification);
589 m_Coeff3.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
590 m_Coeff4.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
591 m_Coeff7.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
593 case Segmentation::OverlapWindow:
594 m_Coeff0.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
595 m_Coeff1.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
596 m_Coeff2.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
597 m_Coeff3.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
598 m_Coeff4.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
599 m_Coeff7.
getLabel().setText(
"Unused", NotificationType::dontSendNotification);
601 case Segmentation::SuperFlux:
602 m_Coeff0.
getLabel().setText(
"PreMax", NotificationType::dontSendNotification);
603 m_Coeff1.
getLabel().setText(
"PostMax", NotificationType::dontSendNotification);
604 m_Coeff2.
getLabel().setText(
"PreAvg", NotificationType::dontSendNotification);
605 m_Coeff3.
getLabel().setText(
"PostAvg", NotificationType::dontSendNotification);
606 m_Coeff4.
getLabel().setText(
"CombWidth", NotificationType::dontSendNotification);
607 m_Coeff7.
getLabel().setText(
"Thresh", NotificationType::dontSendNotification);
630 Colour bgColour(31, 37, 46);
631 g.setColour(bgColour);
632 g.fillRoundedRectangle(getLocalBounds().reduced(2).toFloat(), 3.0f);
634 g.setColour(Colours::black);
635 g.drawRoundedRectangle(getLocalBounds().reduced(1).toFloat(), 5.0f, 2.0f);
681 auto adsr0 =
m_AdsrControls.findChildWithID(kwidgetID +
":Adsr0");
682 if (adsr0 !=
nullptr)
730 MouseCursor::hideWaitCursor();
735 MouseCursor::showWaitCursor();
739 for (
const auto& s : files)
741 if (s.containsChar(
'\n'))
765 m_sampleBrowserButton.setButtonText(String(sampleEngine->getNumAudioSegments()) +
" Samples Loaded");
772 const double newStart = currentRange.getStart() + ((currentRange.getLength() - newThumbSize) / 2);
774 NotificationType::dontSendNotification);
780 newPosition -= (scrollBarSize * 0.5f);
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
void removeAllChildren()
Removes all children from the tree.
Definition CustomParameterTree.h:88
float get() const
Definition KParameter.cpp:126
float getValue() const override
Definition KParameter.cpp:181
void set(float newValue)
Definition KParameter.cpp:128
SegmentationMethod
Definition KrotosAudioBufferDSP.h:292
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
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
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 addSample(const String &name, const String &path, bool isMuted)
Add a new sample into the tree.
Definition SampleDataTree.cpp:98
Definition AirAbsorptionFilter.cpp:2
static const Identifier AlertHeightID
Definition Krotos_LookAndFeel.h:24
static const Identifier AlertWidthID
Definition Krotos_LookAndFeel.h:23
static const Identifier Samples
Definition SampleDataTree.h:13