Skip to content

Commit

Permalink
JIVE example
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Dec 20, 2023
1 parent 8831faf commit 8dfa5b4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option(WARNINGS "Enable all warnings" ON)

include("${CMAKE_CURRENT_LIST_DIR}/lib/CPM.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/lib/JUCE.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/lib/JIVE.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/lib/Pluginval.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/lib/PocketFFT.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/lib/StftPitchShift.cmake")
Expand Down
14 changes: 14 additions & 0 deletions lib/JIVE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://github.com/ImJimmi/JIVE

CPMAddPackage(
NAME JIVE
VERSION 1.0.0
GIT_TAG 2cadd3a84fe7f502376d18b20087c3d96bbbf0cb
GITHUB_REPOSITORY jurihock/JIVE
DOWNLOAD_ONLY YES)

if(JIVE_ADDED)

add_subdirectory(${JIVE_SOURCE_DIR})

endif()
23 changes: 20 additions & 3 deletions src/StftPitchShiftPlugin/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,28 @@
#include <StftPitchShiftPlugin/Logger.h>

Editor::Editor(juce::AudioProcessor& process) :
GenericAudioProcessorEditor(process),
juce::AudioProcessorEditor(process),
process(process)
{
const int w = 550;
const int h = 550;
jive::Interpreter interpreter;

view = interpreter.interpret(juce::ValueTree
{
"Button",
{
{ "width", 200 },
{ "height", 100 },
}
});

addAndMakeVisible(*view->getComponent());

// setSize(
// view->getComponent()->getWidth(),
// view->getComponent()->getHeight());

const int w = 500;
const int h = 500;

setSize(w, h);
}
Expand Down
4 changes: 3 additions & 1 deletion src/StftPitchShiftPlugin/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <JuceHeader.h>

class Editor final : public juce::GenericAudioProcessorEditor
class Editor final : public juce::AudioProcessorEditor
{

public:
Expand All @@ -14,6 +14,8 @@ class Editor final : public juce::GenericAudioProcessorEditor

juce::AudioProcessor& process;

std::unique_ptr<jive::GuiItem> view;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Editor)

};
5 changes: 4 additions & 1 deletion src/StftPitchShiftPlugin/Plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
target_link_libraries(${CMAKE_PROJECT_NAME}
PRIVATE
juce::juce_audio_utils
jive::jive_layouts
jive::jive_style_sheets
PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags)

target_compile_definitions(${CMAKE_PROJECT_NAME}
PUBLIC
DONT_SET_USING_JUCE_NAMESPACE=1
JUCE_WEB_BROWSER=0
JUCE_USE_CURL=0
JUCE_VST3_CAN_REPLACE_VST2=0
DONT_SET_USING_JUCE_NAMESPACE=1)
JIVE_GUI_ITEMS_HAVE_STYLE_SHEETS=1)

if(FASTMATH)

Expand Down

0 comments on commit 8dfa5b4

Please sign in to comment.