From cee9092ff79de92489983af99d416bb726fe23d8 Mon Sep 17 00:00:00 2001 From: kunitoki Date: Mon, 8 Apr 2024 23:24:08 +0200 Subject: [PATCH] Added plugin demo --- cmake/ArchivePythonStdlib.py | 6 +- demos/plugin/CMakeLists.txt | 151 ++++++++++++ demos/plugin/PopsiclePluginEditor.cpp | 33 +++ demos/plugin/PopsiclePluginEditor.h | 22 ++ demos/plugin/PopsiclePluginProcessor.cpp | 232 ++++++++++++++++++ demos/plugin/PopsiclePluginProcessor.h | 50 ++++ {demo => demos/standalone}/CMakeLists.txt | 12 +- {demo => demos/standalone}/Main.cpp | 0 {demo => demos/standalone}/PopsicleDemo.cpp | 0 {demo => demos/standalone}/PopsicleDemo.h | 0 .../ScriptJuceGuiEntryPointsBindings.cpp | 2 + modules/juce_python/juce_python.h | 2 +- setup.py | 2 +- 13 files changed, 502 insertions(+), 10 deletions(-) create mode 100644 demos/plugin/CMakeLists.txt create mode 100644 demos/plugin/PopsiclePluginEditor.cpp create mode 100644 demos/plugin/PopsiclePluginEditor.h create mode 100644 demos/plugin/PopsiclePluginProcessor.cpp create mode 100644 demos/plugin/PopsiclePluginProcessor.h rename {demo => demos/standalone}/CMakeLists.txt (94%) rename {demo => demos/standalone}/Main.cpp (100%) rename {demo => demos/standalone}/PopsicleDemo.cpp (100%) rename {demo => demos/standalone}/PopsicleDemo.h (100%) diff --git a/cmake/ArchivePythonStdlib.py b/cmake/ArchivePythonStdlib.py index c6c0d8d3fa..37556bb989 100644 --- a/cmake/ArchivePythonStdlib.py +++ b/cmake/ArchivePythonStdlib.py @@ -41,7 +41,7 @@ def make_archive(file, directory): parser.add_argument("-o", "--output-folder", type=Path, help="Path to the output folder.") parser.add_argument("-M", "--version-major", type=int, help="Major version number (integer).") parser.add_argument("-m", "--version-minor", type=int, help="Minor version number (integer).") - parser.add_argument("-i", "--ignore-patterns", type=str, default=None, help="Ignored patterns (semicolon separated list).") + parser.add_argument("-x", "--exclude-patterns", type=str, default=None, help="Excluded patterns (semicolon separated list).") args = parser.parse_args() @@ -74,8 +74,8 @@ def make_archive(file, directory): "LICENSE.txt", ] - if args.ignore_patterns: - custom_patterns = [x.strip() for x in args.ignore_patterns.split(";")] + if args.exclude_patterns: + custom_patterns = [x.strip() for x in args.exclude_patterns.split(";")] base_patterns += custom_patterns ignored_files = shutil.ignore_patterns(*base_patterns) diff --git a/demos/plugin/CMakeLists.txt b/demos/plugin/CMakeLists.txt new file mode 100644 index 0000000000..f4119a8454 --- /dev/null +++ b/demos/plugin/CMakeLists.txt @@ -0,0 +1,151 @@ +cmake_minimum_required (VERSION 3.21) + +set (PROJECT_NAME popsicle_plugin_demo) +get_filename_component (ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) +file (STRINGS "${ROOT_PATH}/modules/juce_python/juce_python.h" JUCE_PYTHON_MODULE) +#string (REGEX REPLACE "(.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)" "\\2" VERSION_NUMBER ${JUCE_PYTHON_MODULE}) +set(VERSION_NUMBER "0.0") +project (${PROJECT_NAME} VERSION ${VERSION_NUMBER}) + +# Set browsable modules in IDE +set_property (GLOBAL PROPERTY USE_FOLDERS YES) +option (JUCE_ENABLE_MODULE_SOURCE_GROUPS "Enable Module Source Groups" ON) + +# Configure fetching content +#include (FetchContent) +#set (FETCHCONTENT_UPDATES_DISCONNECTED TRUE) + +# Add the juce modules +add_subdirectory (${ROOT_PATH}/JUCE JUCE) +#FetchContent_Declare (JUCE +# GIT_REPOSITORY https://github.com/juce-framework/JUCE.git +# GIT_TAG origin/master +# GIT_SHALLOW TRUE +# GIT_PROGRESS TRUE +# SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/JUCE) +#FetchContent_MakeAvailable (JUCE) + +# Add the popsicle modules +get_filename_component (MODULES_PATH "${ROOT_PATH}/modules" ABSOLUTE) +add_subdirectory (${MODULES_PATH} ./modules) +#FetchContent_Declare (popsicle +# GIT_REPOSITORY https://github.com/kunitoki/popsicle.git +# GIT_TAG origin/master +# GIT_SHALLOW TRUE +# GIT_PROGRESS TRUE +# SOURCE_SUBDIR modules +# SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/popsicle) +#FetchContent_MakeAvailable (popsicle) + +# Configure python +if (APPLE) + set (Python_ROOT_DIR "/Library/Frameworks/Python.framework/Versions/Current") +endif() +set (Python_USE_STATIC_LIBS TRUE) +find_package (Python REQUIRED Interpreter Development.Embed) + +# Setup the juce app +juce_add_plugin ("${PROJECT_NAME}" + PRODUCT_NAME "PopsiclePluginDemo" + VERSION "${VERSION_NUMBER}" + BUNDLE_ID "org.kunitoki.popsicleplugindemo" + FORMATS Standalone AU VST3 + PLUGIN_MANUFACTURER_CODE POPS + PLUGIN_CODE Ppd0 + IS_SYNTH OFF + NEEDS_MIDI_INPUT OFF + NEEDS_MIDI_OUTPUT OFF + IS_MIDI_EFFECT OFF + APP_SANDBOX_ENABLED ON + COPY_PLUGIN_AFTER_BUILD ON) +juce_generate_juce_header (${PROJECT_NAME}) + +# Add the binary target for the python standard library +set (ADDITIONAL_IGNORED_PYTHON_PATTERNS "lib2to3" "pydoc_data" "_xxtestfuzz*") +set (PYTHON_STANDARD_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}.zip") + +add_custom_target ( + ${PROJECT_NAME}_stdlib + ${Python_EXECUTABLE} ${ROOT_PATH}/cmake/ArchivePythonStdlib.py + -b ${Python_ROOT_DIR} -o ${CMAKE_CURRENT_BINARY_DIR} -M ${Python_VERSION_MAJOR} -m ${Python_VERSION_MINOR} + -x "\"${ADDITIONAL_IGNORED_PYTHON_PATTERNS}\"" + BYPRODUCTS ${PYTHON_STANDARD_LIBRARY}) +add_dependencies (${PROJECT_NAME} ${PROJECT_NAME}_stdlib) + +juce_add_binary_data (BinaryData SOURCES ${PYTHON_STANDARD_LIBRARY}) +add_dependencies (BinaryData ${PROJECT_NAME}_stdlib) + +# Setup target properties +target_sources (${PROJECT_NAME} PRIVATE + PopsiclePluginEditor.cpp + PopsiclePluginEditor.h + PopsiclePluginProcessor.cpp + PopsiclePluginProcessor.h) + +#set_target_properties (${PROJECT_NAME} PROPERTIES JUCE_TARGET_KIND_STRING "App") +set_target_properties (${PROJECT_NAME} PROPERTIES CXX_STANDARD 17) +set_target_properties (${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET "hidden") +set_target_properties (${PROJECT_NAME} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE) +set_target_properties (${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +if (APPLE) + #set_target_properties (${PROJECT_NAME} PROPERTIES OSX_ARCHITECTURES "arm64;x86_64") + #set_target_properties (BinaryData PROPERTIES OSX_ARCHITECTURES "arm64;x86_64") + target_link_options (${PROJECT_NAME} PRIVATE "-Wl,-weak_reference_mismatches,weak") + #set (LTO_CONFIGURATION "juce::juce_recommended_lto_flags") + set (LTO_CONFIGURATION "") +else() + set (LTO_CONFIGURATION "") +endif() + +if (APPLE) + add_custom_command( + TARGET "${PROJECT_NAME}" POST_BUILD DEPENDS "${PROJECT_NAME}" + COMMAND $<$:${CMAKE_STRIP}> + ARGS -x $) +elseif (UNIX) + add_custom_command( + TARGET "${PROJECT_NAME}" POST_BUILD DEPENDS "${PROJECT_NAME}" + COMMAND $<$:${CMAKE_STRIP}> + ARGS --strip-all $) +endif() + +target_compile_definitions (${PROJECT_NAME} PRIVATE + #JUCE_STANDALONE_APPLICATION=1 + JUCE_DISPLAY_SPLASH_SCREEN=0 + JUCE_MODAL_LOOPS_PERMITTED=1 + JUCE_CATCH_UNHANDLED_EXCEPTIONS=0 + JUCE_LOG_ASSERTIONS=1 + JUCE_ALLOW_STATIC_NULL_VARIABLES=0 + JUCE_STRICT_REFCOUNTEDPOINTER=1 + JUCE_WEB_BROWSER=0 + JUCE_LOAD_CURL_SYMBOLS_LAZILY=1 + JUCE_SILENCE_XCODE_15_LINKER_WARNING=1 + PYBIND11_DETAILED_ERROR_MESSAGES=1) + +target_link_libraries (${PROJECT_NAME} PRIVATE + #juce::juce_analytics + juce::juce_audio_basics + juce::juce_audio_devices + juce::juce_audio_formats + juce::juce_audio_plugin_client + juce::juce_audio_processors + juce::juce_audio_utils + juce::juce_core + #juce::juce_cryptography + juce::juce_data_structures + #juce::juce_dsp + juce::juce_events + juce::juce_graphics + juce::juce_gui_basics + juce::juce_gui_extra + #juce::juce_opengl + #juce::juce_osc + #juce::juce_video + juce::juce_recommended_config_flags + juce::juce_recommended_warning_flags + Python::Python + popsicle::juce_python + popsicle::juce_python_recommended_warning_flags + BinaryData + ${LTO_CONFIGURATION}) diff --git a/demos/plugin/PopsiclePluginEditor.cpp b/demos/plugin/PopsiclePluginEditor.cpp new file mode 100644 index 0000000000..f1889a5251 --- /dev/null +++ b/demos/plugin/PopsiclePluginEditor.cpp @@ -0,0 +1,33 @@ +#include "PopsiclePluginProcessor.h" +#include "PopsiclePluginEditor.h" + +//============================================================================== +AudioPluginAudioProcessorEditor::AudioPluginAudioProcessorEditor (AudioPluginAudioProcessor& p) + : AudioProcessorEditor (&p), processorRef (p) +{ + juce::ignoreUnused (processorRef); + // Make sure that before the constructor has finished, you've set the + // editor's size to whatever you need it to be. + setSize (400, 300); +} + +AudioPluginAudioProcessorEditor::~AudioPluginAudioProcessorEditor() +{ +} + +//============================================================================== +void AudioPluginAudioProcessorEditor::paint (juce::Graphics& g) +{ + // (Our component is opaque, so we must completely fill the background with a solid colour) + g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId)); + + g.setColour (juce::Colours::white); + g.setFont (15.0f); + g.drawFittedText ("Hello World!", getLocalBounds(), juce::Justification::centred, 1); +} + +void AudioPluginAudioProcessorEditor::resized() +{ + // This is generally where you'll want to lay out the positions of any + // subcomponents in your editor.. +} diff --git a/demos/plugin/PopsiclePluginEditor.h b/demos/plugin/PopsiclePluginEditor.h new file mode 100644 index 0000000000..1c87fc6f6b --- /dev/null +++ b/demos/plugin/PopsiclePluginEditor.h @@ -0,0 +1,22 @@ +#pragma once + +#include "PopsiclePluginProcessor.h" + +//============================================================================== +class AudioPluginAudioProcessorEditor : public juce::AudioProcessorEditor +{ +public: + explicit AudioPluginAudioProcessorEditor (AudioPluginAudioProcessor&); + ~AudioPluginAudioProcessorEditor() override; + + //============================================================================== + void paint (juce::Graphics&) override; + void resized() override; + +private: + // This reference is provided as a quick way for your editor to + // access the processor object that created it. + AudioPluginAudioProcessor& processorRef; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginAudioProcessorEditor) +}; diff --git a/demos/plugin/PopsiclePluginProcessor.cpp b/demos/plugin/PopsiclePluginProcessor.cpp new file mode 100644 index 0000000000..18a09f5f04 --- /dev/null +++ b/demos/plugin/PopsiclePluginProcessor.cpp @@ -0,0 +1,232 @@ +#include "PopsiclePluginProcessor.h" +#include "PopsiclePluginEditor.h" + +// ================================================================================================= + +PYBIND11_EMBEDDED_MODULE(custom, m) +{ + namespace py = pybind11; + + //py::module_::import (popsicle::PythonModuleName); + + //py::class_ (m, "PopsicleDemo") + // .def_readwrite ("text", &PopsicleDemo::text); +} + +// ================================================================================================= + +AudioPluginAudioProcessor::AudioPluginAudioProcessor() + : AudioProcessor (BusesProperties() + #if ! JucePlugin_IsMidiEffect + #if ! JucePlugin_IsSynth + .withInput ("Input", juce::AudioChannelSet::stereo(), true) + #endif + .withOutput ("Output", juce::AudioChannelSet::stereo(), true) + #endif + ) +/* , engine (popsicle::ScriptEngine::prepareScriptingHome ( + juce::JUCEApplication::getInstance()->getApplicationName(), + juce::File::getSpecialLocation (juce::File::tempDirectory), + [](const char* resourceName) -> juce::MemoryBlock + { + int dataSize = 0; + auto data = BinaryData::getNamedResource (resourceName, dataSize); + return { data, static_cast (dataSize) }; + }))*/ +{ + pybind11::dict locals; + //locals["custom"] = pybind11::module_::import ("custom"); + locals["juce"] = pybind11::module_::import (popsicle::PythonModuleName); + //locals["this"] = pybind11::cast (this); + + auto result = engine.runScript (R"( +# import sys + +# An example of scriptable self +print("Scripting JUCE!") + +#this.text = "Popsicle " + sys.version.split(" ")[0] +#this.setOpaque(True) +#this.setSize(600, 300) + )", locals); + + if (result.failed()) + std::cout << result.getErrorMessage(); +} + +AudioPluginAudioProcessor::~AudioPluginAudioProcessor() +{ +} + +// ================================================================================================= + +const juce::String AudioPluginAudioProcessor::getName() const +{ + return JucePlugin_Name; +} + +bool AudioPluginAudioProcessor::acceptsMidi() const +{ + #if JucePlugin_WantsMidiInput + return true; + #else + return false; + #endif +} + +bool AudioPluginAudioProcessor::producesMidi() const +{ + #if JucePlugin_ProducesMidiOutput + return true; + #else + return false; + #endif +} + +bool AudioPluginAudioProcessor::isMidiEffect() const +{ + #if JucePlugin_IsMidiEffect + return true; + #else + return false; + #endif +} + +double AudioPluginAudioProcessor::getTailLengthSeconds() const +{ + return 0.0; +} + +int AudioPluginAudioProcessor::getNumPrograms() +{ + return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs, + // so this should be at least 1, even if you're not really implementing programs. +} + +int AudioPluginAudioProcessor::getCurrentProgram() +{ + return 0; +} + +void AudioPluginAudioProcessor::setCurrentProgram (int index) +{ + juce::ignoreUnused (index); +} + +const juce::String AudioPluginAudioProcessor::getProgramName (int index) +{ + juce::ignoreUnused (index); + return {}; +} + +void AudioPluginAudioProcessor::changeProgramName (int index, const juce::String& newName) +{ + juce::ignoreUnused (index, newName); +} + +// ================================================================================================= + +void AudioPluginAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) +{ + // Use this method as the place to do any pre-playback + // initialisation that you need.. + juce::ignoreUnused (sampleRate, samplesPerBlock); +} + +void AudioPluginAudioProcessor::releaseResources() +{ + // When playback stops, you can use this as an opportunity to free up any + // spare memory, etc. +} + +bool AudioPluginAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const +{ + #if JucePlugin_IsMidiEffect + juce::ignoreUnused (layouts); + return true; + #else + // This is the place where you check if the layout is supported. + // In this template code we only support mono or stereo. + // Some plugin hosts, such as certain GarageBand versions, will only + // load plugins that support stereo bus layouts. + if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() + && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) + return false; + + // This checks if the input layout matches the output layout + #if ! JucePlugin_IsSynth + if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) + return false; + #endif + + return true; + #endif +} + +void AudioPluginAudioProcessor::processBlock (juce::AudioBuffer& buffer, + juce::MidiBuffer& midiMessages) +{ + juce::ignoreUnused (midiMessages); + + juce::ScopedNoDenormals noDenormals; + auto totalNumInputChannels = getTotalNumInputChannels(); + auto totalNumOutputChannels = getTotalNumOutputChannels(); + + // In case we have more outputs than inputs, this code clears any output + // channels that didn't contain input data, (because these aren't + // guaranteed to be empty - they may contain garbage). + // This is here to avoid people getting screaming feedback + // when they first compile a plugin, but obviously you don't need to keep + // this code if your algorithm always overwrites all the output channels. + for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) + buffer.clear (i, 0, buffer.getNumSamples()); + + // This is the place where you'd normally do the guts of your plugin's + // audio processing... + // Make sure to reset the state if your inner loop is processing + // the samples and the outer loop is handling the channels. + // Alternatively, you can process the samples with the channels + // interleaved by keeping the same state. + for (int channel = 0; channel < totalNumInputChannels; ++channel) + { + auto* channelData = buffer.getWritePointer (channel); + juce::ignoreUnused (channelData); + // ..do something to the data... + } +} + +// ================================================================================================= + +bool AudioPluginAudioProcessor::hasEditor() const +{ + return true; // (change this to false if you choose to not supply an editor) +} + +juce::AudioProcessorEditor* AudioPluginAudioProcessor::createEditor() +{ + return new AudioPluginAudioProcessorEditor (*this); +} + +// ================================================================================================= + +void AudioPluginAudioProcessor::getStateInformation (juce::MemoryBlock& destData) +{ + // You should use this method to store your parameters in the memory block. + // You could do that either as raw data, or use the XML or ValueTree classes + // as intermediaries to make it easy to save and load complex data. + juce::ignoreUnused (destData); +} + +void AudioPluginAudioProcessor::setStateInformation (const void* data, int sizeInBytes) +{ + // You should use this method to restore your parameters from this memory block, + // whose contents will have been created by the getStateInformation() call. + juce::ignoreUnused (data, sizeInBytes); +} + +// ================================================================================================= + +juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() +{ + return new AudioPluginAudioProcessor(); +} diff --git a/demos/plugin/PopsiclePluginProcessor.h b/demos/plugin/PopsiclePluginProcessor.h new file mode 100644 index 0000000000..85c5b96721 --- /dev/null +++ b/demos/plugin/PopsiclePluginProcessor.h @@ -0,0 +1,50 @@ +#pragma once + +#include "JuceHeader.h" + +//============================================================================== +class AudioPluginAudioProcessor : public juce::AudioProcessor +{ +public: + //============================================================================== + AudioPluginAudioProcessor(); + ~AudioPluginAudioProcessor() override; + + //============================================================================== + void prepareToPlay (double sampleRate, int samplesPerBlock) override; + void releaseResources() override; + + bool isBusesLayoutSupported (const BusesLayout& layouts) const override; + + void processBlock (juce::AudioBuffer&, juce::MidiBuffer&) override; + using AudioProcessor::processBlock; + + //============================================================================== + juce::AudioProcessorEditor* createEditor() override; + bool hasEditor() const override; + + //============================================================================== + const juce::String getName() const override; + + bool acceptsMidi() const override; + bool producesMidi() const override; + bool isMidiEffect() const override; + double getTailLengthSeconds() const override; + + //============================================================================== + int getNumPrograms() override; + int getCurrentProgram() override; + void setCurrentProgram (int index) override; + const juce::String getProgramName (int index) override; + void changeProgramName (int index, const juce::String& newName) override; + + //============================================================================== + void getStateInformation (juce::MemoryBlock& destData) override; + void setStateInformation (const void* data, int sizeInBytes) override; + +private: + popsicle::ScriptEngine engine; + + //============================================================================== + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginAudioProcessor) +}; diff --git a/demo/CMakeLists.txt b/demos/standalone/CMakeLists.txt similarity index 94% rename from demo/CMakeLists.txt rename to demos/standalone/CMakeLists.txt index 28084bfa31..9811b8a0c1 100644 --- a/demo/CMakeLists.txt +++ b/demos/standalone/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.21) -set (PROJECT_NAME popsicle_demo) -get_filename_component (ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) +set (PROJECT_NAME popsicle_standalone_demo) +get_filename_component (ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) file (STRINGS "${ROOT_PATH}/modules/juce_python/juce_python.h" JUCE_PYTHON_MODULE) string (REGEX REPLACE "(.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)" "\\2" VERSION_NUMBER ${JUCE_PYTHON_MODULE}) project (${PROJECT_NAME} VERSION ${VERSION_NUMBER}) @@ -36,8 +36,10 @@ add_subdirectory (${MODULES_PATH} ./modules) # SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/popsicle) #FetchContent_MakeAvailable (popsicle) -# Configure python (APPLE only for now) -set (Python_ROOT_DIR "/Library/Frameworks/Python.framework/Versions/Current") +# Configure python +if (APPLE) + set (Python_ROOT_DIR "/Library/Frameworks/Python.framework/Versions/Current") +endif() set (Python_USE_STATIC_LIBS TRUE) find_package (Python REQUIRED Interpreter Development.Embed) @@ -56,7 +58,7 @@ add_custom_target ( ${PROJECT_NAME}_stdlib ${Python_EXECUTABLE} ${ROOT_PATH}/cmake/ArchivePythonStdlib.py -b ${Python_ROOT_DIR} -o ${CMAKE_CURRENT_BINARY_DIR} -M ${Python_VERSION_MAJOR} -m ${Python_VERSION_MINOR} - -i "\"${ADDITIONAL_IGNORED_PYTHON_PATTERNS}\"" + -x "\"${ADDITIONAL_IGNORED_PYTHON_PATTERNS}\"" BYPRODUCTS ${PYTHON_STANDARD_LIBRARY}) add_dependencies (${PROJECT_NAME} ${PROJECT_NAME}_stdlib) diff --git a/demo/Main.cpp b/demos/standalone/Main.cpp similarity index 100% rename from demo/Main.cpp rename to demos/standalone/Main.cpp diff --git a/demo/PopsicleDemo.cpp b/demos/standalone/PopsicleDemo.cpp similarity index 100% rename from demo/PopsicleDemo.cpp rename to demos/standalone/PopsicleDemo.cpp diff --git a/demo/PopsicleDemo.h b/demos/standalone/PopsicleDemo.h similarity index 100% rename from demo/PopsicleDemo.h rename to demos/standalone/PopsicleDemo.h diff --git a/modules/juce_python/bindings/ScriptJuceGuiEntryPointsBindings.cpp b/modules/juce_python/bindings/ScriptJuceGuiEntryPointsBindings.cpp index f975911a92..de83e90b4b 100644 --- a/modules/juce_python/bindings/ScriptJuceGuiEntryPointsBindings.cpp +++ b/modules/juce_python/bindings/ScriptJuceGuiEntryPointsBindings.cpp @@ -55,6 +55,7 @@ namespace { // ============================================================================================ +#if ! JUCE_PYTHON_EMBEDDED_INTERPRETER void runApplication (JUCEApplicationBase* application, int milliseconds) { { @@ -91,6 +92,7 @@ void runApplication (JUCEApplicationBase* application, int milliseconds) throw py::error_already_set(); } } +#endif } // namespace diff --git a/modules/juce_python/juce_python.h b/modules/juce_python/juce_python.h index ed5ad9459a..238c59be5b 100644 --- a/modules/juce_python/juce_python.h +++ b/modules/juce_python/juce_python.h @@ -47,7 +47,7 @@ //============================================================================== /** Config: JUCE_PYTHON_EMBEDDED_INTERPRETER - Enable or disable embedding the interpreter. This should be disabled when + Enable or disable embedding the interpreter. This should be disabled when building standalone wheels. */ #ifndef JUCE_PYTHON_EMBEDDED_INTERPRETER #define JUCE_PYTHON_EMBEDDED_INTERPRETER 1 diff --git a/setup.py b/setup.py index 0fc7aabb51..8e09b18e79 100644 --- a/setup.py +++ b/setup.py @@ -263,7 +263,7 @@ def load_description(version): long_description=load_description(version), long_description_content_type="text/x-rst", url="https://github.com/kunitoki/popsicle", - packages=setuptools.find_packages(".", exclude=["*cmake*", "*demo*", "*examples*", "*images*", "*JUCE*", "*scripts*", "*tests*"]), + packages=setuptools.find_packages(".", exclude=["*cmake*", "*demos*", "*examples*", "*images*", "*JUCE*", "*scripts*", "*tests*"]), include_package_data=True, cmdclass={"build_ext": CMakeBuildExtension, "install_scripts": CustomInstallScripts}, ext_modules=[CMakeExtension(project_name)],