Skip to content

Commit

Permalink
fix: disable unstable winrt for plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
xivilay committed Feb 25, 2023
1 parent ce92eb5 commit 986fcbe
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.7.1] - 2023-02-25

### Fixed

* Disable WinRT in plugins due to performance issues

## [0.7.0] - 2023-02-15

### Fixed
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
JUCE_WEB_BROWSER=0
)

if(WIN32 AND NOT CMAKE_PLUGIN_IS_STANDALONE)
target_compile_definitions(${PROJECT_NAME} PRIVATE JUCE_USE_WINRT_MIDI=1)
endif()

if(BUILD_VST2)
message(STATUS "Adding VST2...")
target_compile_definitions(${PROJECT_NAME} PUBLIC JUCE_VST3_CAN_REPLACE_VST2=1)
Expand Down
3 changes: 1 addition & 2 deletions src/CustomEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ class CustomEditor : public AudioProcessorEditor, public AudioProcessorParameter

addAndMakeVisible(appRoot);

setSize(400, 200);
setSize(550, 750);

startTimerHz(30);
}
~CustomEditor() {
for (auto& p : processor.getParameters()) {
p->removeListener(this);
}
mediator.onQuit();
}

void parameterValueChanged(int parameterIndex, float newValue) {
Expand Down
9 changes: 3 additions & 6 deletions src/ScaleRemapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ AudioProcessorValueTreeState::ParameterLayout createParameterLayout() {
for (int i = 0; i < scaleLength; i++) {
auto istr = std::to_string(i);
auto defaultInterval = defaultScaleIntervals[i];
p.add(std::make_unique<AudioParameterInt>("interval" + istr, "Scale Interval " + istr, 1, scaleLength, defaultInterval));
p.add(std::make_unique<AudioParameterInt>("interval" + istr, "Scale Interval " + istr, 1, scaleLength,
defaultInterval));
}

return p;
Expand All @@ -47,11 +48,7 @@ class MidiScaleRemapper : public AudioProcessor {
}
}

AudioProcessorEditor *createEditor() {
auto *editor = new CustomEditor(*this);
editor->setSize(550, 750);
return editor;
}
AudioProcessorEditor *createEditor() { return new CustomEditor(*this); }

const String getName() const override { return ProjectInfo::projectName; }

Expand Down
17 changes: 11 additions & 6 deletions src/lumi/Mediator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ class Mediator : private TopologySource::Listener, Block::ProgramEventListener,
appRoot = &root;
pts.addListener(this);
};
void onQuit() {
~Mediator() {
if (b != nullptr) {
b->setProgram(nullptr);
b->removeProgramLoadedListener(this);
b->removeProgramEventListener(this);
b = nullptr;
}
};

pts.removeListener(this);
}
void sendCommand(int a) {
if (b != nullptr) {
Block::ProgramEventMessage e;
Expand All @@ -25,7 +30,7 @@ class Mediator : private TopologySource::Listener, Block::ProgramEventListener,
};

private:
void handleProgramEvent(Block& source, const Block::ProgramEventMessage& event) {
void handleProgramEvent(Block&, const Block::ProgramEventMessage& event) {
int messageId = event.values[0];
int messageValue = event.values[1];
if (messageId == octaveId) {
Expand All @@ -45,7 +50,6 @@ class Mediator : private TopologySource::Listener, Block::ProgramEventListener,
for (auto& block : currentTopology.blocks) {
if (block->getType() == Block::lumiKeysBlock) {
b = block;
p = block->getProgram();
block->setProgram(std::make_unique<CustomProgram>(*block));
block->addProgramLoadedListener(this);
block->addProgramEventListener(this);
Expand All @@ -54,13 +58,14 @@ class Mediator : private TopologySource::Listener, Block::ProgramEventListener,
}
};
PhysicalTopologySource pts;
Block::Program* p;
Block* b = nullptr;
Block::Ptr b;
reactjuce::ReactApplicationRoot* appRoot;
AudioProcessor& processor;

const int octaveShift = 4;
const int octaveId = 4;
const int octavesCount = 10;
const int colorModeId = 64;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Mediator);
};

0 comments on commit 986fcbe

Please sign in to comment.