Skip to content

Commit 4b0752c

Browse files
Fix a bug where mix presentations could not be added (#84)
1 parent bb4d241 commit 4b0752c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

rendererplugin/src/screens/EditPresentationScreen.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,22 @@ EditPresentationScreen::EditPresentationScreen(
6262
addMixPresentationButton_(IconStore::getInstance().getPlusIcon()) {
6363
setLookAndFeel(&lookAndFeel_);
6464
setWantsKeyboardFocus(true);
65-
6665
mixPresentationRepository_->registerListener(this);
66+
67+
// Configure adding mix presentations
6768
addMixPresentationButton_.setCyanLookAndFeel();
68-
addMixPresentationButton_.setButtonOnClick(addMixPresentation);
69+
addMixPresentationButton_.setButtonOnClick([this]() {
70+
// Add a new mix presentation
71+
MixPresentation presentation(
72+
juce::Uuid(), "My Mix Presentation" + juce::String(numMixes_ + 1), 1,
73+
LanguageData::MixLanguages::Undetermined, {});
74+
mixPresentationRepository_->add(presentation);
75+
76+
// Log the addition of a new mix presentation
77+
LOG_ANALYTICS(
78+
RendererProcessor::instanceId_,
79+
"Adding new mix presentation: " + presentation.getName().toStdString());
80+
});
6981

7082
// Update mix presentation information
7183
updateMixPresentations();

rendererplugin/src/screens/EditPresentationScreen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class EditPresentationScreen : public juce::Component,
7272
void updateTabButtonBounds(const juce::Rectangle<int>& mixEditingBounds);
7373
void updateMixPresentations();
7474
void updatePresentationTabs();
75-
std::function<void()> addMixPresentation;
7675

7776
void valueTreeChildAdded(juce::ValueTree& parentTree,
7877
juce::ValueTree& childWhichHasBeenAdded) override;

0 commit comments

Comments
 (0)