| @@ -155,10 +155,8 @@ | |||
| #endif | |||
| #if JUCE_MAC || JUCE_IOS | |||
| #define Point CarbonDummyPointName | |||
| #define Component CarbonDummyCompName | |||
| #include <Accelerate/Accelerate.h> | |||
| #undef Point | |||
| #undef Component | |||
| #endif | |||
| @@ -496,7 +496,7 @@ namespace GuiHelpers | |||
| case Slow: | |||
| { | |||
| Path p; | |||
| p.addPolygon (Point<float> (50.0f, 50.0f), | |||
| p.addPolygon (juce::Point<float> (50.0f, 50.0f), | |||
| 8, | |||
| 50.0f, | |||
| -float_Pi * 0.125f); | |||
| @@ -563,4 +563,4 @@ namespace GuiHelpers | |||
| } | |||
| } | |||
| #endif // __DROWAUDIO_GUIHELPERS_H__ | |||
| #endif // __DROWAUDIO_GUIHELPERS_H__ | |||
| @@ -111,7 +111,7 @@ void BasicFileBrowser::removeListener (FileBrowserListener* const listener) | |||
| void BasicFileBrowser::mouseDoubleClick (const MouseEvent &e) | |||
| { | |||
| if (resizer->contains (Point<int> (e.x, e.y))) | |||
| if (resizer->contains (juce::Point<int> (e.x, e.y))) | |||
| { | |||
| setSize (jmax (getLongestWidth(), resizeLimits.getMinimumWidth()), 800); | |||
| } | |||
| @@ -72,7 +72,7 @@ public: | |||
| } | |||
| template <typename ValueType> | |||
| static String convertToString (const Point<ValueType>& arg) | |||
| static String convertToString (const juce::Point<ValueType>& arg) | |||
| { | |||
| return arg.toString(); | |||
| } | |||
| @@ -188,7 +188,7 @@ inline static void drawBufferToImage (const Image& image, const float* samples, | |||
| const float x2 = x1 + imageXScale; | |||
| const float y2 = image.getHeight() - (samples[i] * image.getHeight()); | |||
| const Line<float> line (Point<float> (x1, y1), Point<float> (x2, y2)); | |||
| const Line<float> line (juce::Point<float> (x1, y1), juce::Point<float> (x2, y2)); | |||
| g.drawLine (line, thickness); | |||
| y1 = y2; | |||
| @@ -582,4 +582,4 @@ struct ScopedChangeSender | |||
| #endif // #ifndef UNUSED_NOWARN | |||
| #endif //__DROWAUDIO_UTILITY_H__ | |||
| #endif //__DROWAUDIO_UTILITY_H__ | |||
| @@ -489,7 +489,7 @@ public: | |||
| { | |||
| const int numChannels = jmax (numIn, numOut); | |||
| AudioBuffer<FloatType> chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); | |||
| juce::AudioBuffer<FloatType> chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); | |||
| if (isBypassed) | |||
| processor->processBlockBypassed (chans, midiEvents); | |||
| @@ -23,6 +23,8 @@ | |||
| ============================================================================== | |||
| */ | |||
| #pragma once | |||
| #include <juce_audio_plugin_client/juce_audio_plugin_client.h> | |||
| #include "juce_CreatePluginFilter.h" | |||
| @@ -455,7 +455,7 @@ public: | |||
| { | |||
| const int numChannels = jmax (numIn, numOut); | |||
| AudioBuffer<FloatType> chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); | |||
| juce::AudioBuffer<FloatType> chans (tmpBuffers.channels, isMidiEffect ? 0 : numChannels, numSamples); | |||
| if (isBypassed) | |||
| processor->processBlockBypassed (chans, midiEvents); | |||
| @@ -111,7 +111,7 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone | |||
| AutoResizingNSViewComponent::AutoResizingNSViewComponent() | |||
| : recursive (false) {} | |||
| void AutoResizingNSViewComponent::childBoundsChanged (Component*) override | |||
| void AutoResizingNSViewComponent::childBoundsChanged (Component*) | |||
| { | |||
| if (recursive) | |||
| { | |||
| @@ -125,7 +125,7 @@ void AutoResizingNSViewComponent::childBoundsChanged (Component*) override | |||
| } | |||
| } | |||
| void AutoResizingNSViewComponent::handleAsyncUpdate() override | |||
| void AutoResizingNSViewComponent::handleAsyncUpdate() | |||
| { | |||
| resizeToFitView(); | |||
| } | |||
| @@ -149,7 +149,7 @@ JUCE_IOS_MAC_VIEW* AutoResizingNSViewComponentWithParent::getChildView() const | |||
| return nil; | |||
| } | |||
| void AutoResizingNSViewComponentWithParent::timerCallback() override | |||
| void AutoResizingNSViewComponentWithParent::timerCallback() | |||
| { | |||
| if (JUCE_IOS_MAC_VIEW* child = getChildView()) | |||
| { | |||
| @@ -32,11 +32,7 @@ | |||
| } | |||
| #endif | |||
| #include "modules/juce_audio_processors/format_types/juce_VSTMidiEventList.h" | |||
| #ifdef JUCE_MAC | |||
| #include "modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm" | |||
| #else | |||
| #include "modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp" | |||
| #endif | |||
| #include "modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp" | |||
| #elif JucePlugin_Build_VST3 | |||
| #include "modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp" | |||
| #elif JucePlugin_Build_Standalone | |||
| @@ -24,3 +24,8 @@ | |||
| #if ! JucePlugin_Build_Standalone | |||
| #include "modules/juce_audio_plugin_client/utility/juce_PluginUtilities.cpp" | |||
| #endif | |||
| #if JUCE_MAC && (JucePlugin_Build_VST || JucePlugin_Build_VST3) | |||
| #undef JUCE_CHECKSETTINGMACROS_H | |||
| #include "modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm" | |||
| #endif | |||
| @@ -54,7 +54,7 @@ endif | |||
| if os_darwin | |||
| bin_suffix = '' | |||
| lib_suffix = '.dylib' | |||
| bintype_prefix = 'Mac-' | |||
| bintype_prefix = 'macOS-' | |||
| elif os_windows | |||
| bin_suffix = '.exe' | |||
| lib_suffix = '.dll' | |||
| @@ -102,26 +102,38 @@ build_flags = [ | |||
| '-Wall', | |||
| '-Wno-multichar', | |||
| '-Wno-strict-overflow', | |||
| '-Wno-unused-but-set-variable', | |||
| '-Wno-unused-function', | |||
| ] | |||
| build_flags_cpp = [ | |||
| '-Wno-class-memaccess', | |||
| '-std=gnu++11', | |||
| ] | |||
| if not os_darwin | |||
| build_flags += [ | |||
| '-Wno-unused-but-set-variable', | |||
| ] | |||
| build_flags_cpp += [ | |||
| '-Wno-class-memaccess', | |||
| ] | |||
| endif | |||
| build_flags_debug = [ | |||
| '-O0', '-ggdb', | |||
| '-DDEBUG=1', '-D_DEBUG=1', | |||
| '-O0', | |||
| '-ggdb', | |||
| '-DDEBUG=1', | |||
| '-D_DEBUG=1', | |||
| ] | |||
| build_flags_debug_cpp = [ | |||
| ] | |||
| build_flags_release = [ | |||
| '-O3', '-fvisibility=hidden', | |||
| '-O3', | |||
| '-fvisibility=hidden', | |||
| '-DNDEBUG=1', | |||
| '-fdata-sections', | |||
| '-ffunction-sections', | |||
| ] | |||
| build_flags_release_cpp = [ | |||
| @@ -134,15 +146,10 @@ if optimizations and not linux_embed | |||
| ] | |||
| endif | |||
| if not os_darwin | |||
| build_flags_release += [ | |||
| '-fdata-sections', '-ffunction-sections', | |||
| ] | |||
| endif | |||
| if os_darwin | |||
| build_flags += [ | |||
| '-DMAC=1', | |||
| '-DGL_SILENCE_DEPRECATION=1', | |||
| ] | |||
| build_flags_cpp += [ | |||
| '-ObjC++', | |||
| @@ -179,6 +186,8 @@ link_flags_debug = [ | |||
| ] | |||
| link_flags_release = [ | |||
| '-fdata-sections', | |||
| '-ffunction-sections', | |||
| ] | |||
| if os_windows | |||
| @@ -187,13 +196,19 @@ if os_windows | |||
| ] | |||
| endif | |||
| if not os_darwin | |||
| if os_darwin | |||
| link_flags_release += [ | |||
| '-Wl,-dead_strip', | |||
| '-Wl,-dead_strip_dylibs', | |||
| ] | |||
| else | |||
| link_flags += [ | |||
| '-Wl,--no-undefined', | |||
| ] | |||
| link_flags_release += [ | |||
| '-fdata-sections', '-ffunction-sections', '-Wl,--gc-sections', | |||
| '-Wl,-O1', | |||
| '-Wl,--as-needed', | |||
| '-Wl,--gc-sections', | |||
| '-Wl,--strip-all', | |||
| ] | |||
| endif | |||
| @@ -26,7 +26,7 @@ private: | |||
| float sqrt2 = std::sqrt(2); | |||
| Point<float> center(getWidth() / 2, getHeight() / 2); | |||
| juce::Point<float> center(getWidth() / 2, getHeight() / 2); | |||
| float lineScaleX = (getWidth()) / 2 - margin; | |||
| float lineScaleY = (getHeight()) / 2 - margin; | |||
| @@ -64,9 +64,9 @@ public: | |||
| initLayers(); | |||
| } | |||
| template <typename T> Point<T> movePoint(Point<T> source, T x, T y) | |||
| template <typename T> juce::Point<T> movePoint(juce::Point<T> source, T x, T y) | |||
| { | |||
| Point<T> newPoint(source); | |||
| juce::Point<T> newPoint(source); | |||
| newPoint.addXY(x, y); | |||
| @@ -48,9 +48,11 @@ typedef unsigned char BYTE; | |||
| // This type is declared in WinDef.h as follows: | |||
| typedef uint16_t WORD; | |||
| #if ! JUCE_MAC | |||
| // BOOL - A boolean variable | |||
| // This type is declared in WinDef.h as follows: | |||
| typedef BYTE BOOL; | |||
| #endif | |||
| DWORD GetStdHandle (DWORD handle) { return handle; } | |||
| @@ -75,6 +75,21 @@ plugin_include_dirs = [ | |||
| dependencies_plugin = [ | |||
| ] | |||
| if os_darwin | |||
| dependencies_plugin += [ | |||
| dependency('Accelerate', method: 'extraframework'), | |||
| dependency('AudioToolbox', method: 'extraframework'), | |||
| dependency('Carbon', method: 'extraframework'), | |||
| dependency('Cocoa', method: 'extraframework'), | |||
| dependency('CoreAudio', method: 'extraframework'), | |||
| dependency('CoreAudioKit', method: 'extraframework'), | |||
| dependency('CoreMIDI', method: 'extraframework'), | |||
| dependency('IOKit', method: 'extraframework'), | |||
| dependency('QuartzCore', method: 'extraframework'), | |||
| dependency('WebKit', method: 'extraframework'), | |||
| ] | |||
| endif | |||
| if os_windows | |||
| dependencies_plugin += [ | |||
| cc.find_library('comdlg32'), | |||
| @@ -114,32 +129,26 @@ endif | |||
| ############################################################################### | |||
| # link flags for plugins | |||
| link_flags_plugin = [ | |||
| link_flags_plugin_lv2 = [ | |||
| ] | |||
| link_flags_plugin_vst2 = [ | |||
| ] | |||
| if os_darwin | |||
| link_flags_plugin += [ | |||
| '-Wl,-export-symbols=' + meson.source_root() + '/scripts/plugin-symbols.txt', | |||
| link_flags_plugin_lv2 += [ | |||
| '-Wl,-exported_symbol,_lv2_generate_ttl', | |||
| '-Wl,-exported_symbol,_lv2_descriptor', | |||
| '-Wl,-exported_symbol,_lv2ui_descriptor', | |||
| ] | |||
| link_flags_plugin_vst2 += [ | |||
| '-Wl,-exported_symbol,_VSTPluginMain', | |||
| ] | |||
| else | |||
| link_flags_plugin += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols.version', | |||
| link_flags_plugin_lv2 += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols-lv2.version', | |||
| ] | |||
| endif | |||
| if os_darwin | |||
| link_flags_plugin += [ | |||
| '-framework Accelerate', | |||
| '-framework AudioToolbox', | |||
| '-framework AudioUnit', | |||
| '-framework Carbon', | |||
| '-framework Cocoa', | |||
| '-framework CoreAudio', | |||
| '-framework CoreAudioKit', | |||
| '-framework CoreMIDI', | |||
| '-framework IOKit', | |||
| '-framework QuartzCore', | |||
| '-framework WebKit', | |||
| link_flags_plugin_vst2 += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols-vst2.version', | |||
| ] | |||
| endif | |||
| @@ -220,9 +229,9 @@ if build_lv2 or build_vst2 | |||
| if plugin_uses_opengl | |||
| if os_darwin | |||
| plugin_extra_link_flags += [ | |||
| '-framework OpenGL', | |||
| ] | |||
| plugin_extra_dependencies += [ | |||
| dependency('OpenGL', method: 'extraframework'), | |||
| ] | |||
| elif os_windows | |||
| plugin_extra_dependencies += [ | |||
| cc.find_library('opengl32'), | |||
| @@ -262,7 +271,7 @@ if build_lv2 or build_vst2 | |||
| ], | |||
| c_args: build_flags + build_flags_plugin + build_flags_plugin_lv2 + plugin_extra_build_flags, | |||
| cpp_args: build_flags_cpp + build_flags_plugin + build_flags_plugin_lv2 + plugin_extra_build_flags, | |||
| link_args: link_flags + link_flags_plugin, | |||
| link_args: link_flags + link_flags_plugin_lv2, | |||
| link_with: link_with_plugin, | |||
| ) | |||
| @@ -293,7 +302,7 @@ if build_lv2 or build_vst2 | |||
| ], | |||
| c_args: build_flags + build_flags_plugin + build_flags_plugin_vst2 + plugin_extra_build_flags, | |||
| cpp_args: build_flags_cpp + build_flags_plugin + build_flags_plugin_vst2 + plugin_extra_build_flags, | |||
| link_args: link_flags + link_flags_plugin, | |||
| link_args: link_flags + link_flags_plugin_vst2, | |||
| link_with: link_with_plugin, | |||
| install: true, | |||
| install_dir: vst2dir, | |||
| @@ -673,7 +673,7 @@ void ObxdAudioProcessorEditor::mouseUp(const MouseEvent& e) | |||
| menu.addSubMenu("Banks", bankMenu); | |||
| } | |||
| const Point<int> pos = e.getMouseDownScreenPosition(); | |||
| const juce::Point<int> pos = e.getMouseDownScreenPosition(); | |||
| int result = menu.showAt(Rectangle<int>(pos.getX(), pos.getY(), 1, 1)); | |||
| if (result >= (skinStart + 1) && result <= (skinStart + skins.size())) | |||
| @@ -310,7 +310,7 @@ void DelayGraph::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& w | |||
| } | |||
| int DelayGraph::getDelayUnderMouse(Point<int> mousePos, float minDistance) | |||
| int DelayGraph::getDelayUnderMouse(juce::Point<int> mousePos, float minDistance) | |||
| { | |||
| const float w = (float) getWidth(); | |||
| const float h = (float) getHeight(); | |||
| @@ -334,7 +334,7 @@ int DelayGraph::getDelayUnderMouse(Point<int> mousePos, float minDistance) | |||
| const float x = float(1 + (w-2) * (delayTime - minDelay) / (maxDelay - minDelay)); | |||
| const float y = float(h - (h-16) * (volume+60)/60); | |||
| const float d = Point<float>(x, y).getDistanceFrom(mousePos.toFloat()); | |||
| const float d = juce::Point<float>(x, y).getDistanceFrom(mousePos.toFloat()); | |||
| if (d < newDistancs) | |||
| { | |||
| @@ -68,7 +68,7 @@ private: | |||
| } | |||
| }; | |||
| int getDelayUnderMouse(Point<int> mousePos, float minDistance = 10); | |||
| int getDelayUnderMouse(juce::Point<int> mousePos, float minDistance = 10); | |||
| OwnedArray<PitchedDelayTab>& tabs; | |||
| PitchedDelayAudioProcessor* Proc; | |||
| @@ -130,7 +130,7 @@ private: | |||
| float scaleX = (x - points[i]->getCenterPosition().getX()) * 1.0f / deltaX; | |||
| Point<float> result = su.PointOnCubicBezier( | |||
| juce::Point<float> result = su.PointOnCubicBezier( | |||
| scaleX, | |||
| points[i]->getCenterPosition(), | |||
| points[i]->getControlPointRight(), | |||
| @@ -171,8 +171,8 @@ public: | |||
| //const ScopedLock myScopedLock (myCriticalSectionBuffer); | |||
| points.clear(); | |||
| SplinePoint *start = new SplinePoint(Point<float>(0.0f, 0.5f)); | |||
| SplinePoint *end = new SplinePoint(Point<float>(1.0f, 0.5f)); | |||
| SplinePoint *start = new SplinePoint(juce::Point<float>(0.0f, 0.5f)); | |||
| SplinePoint *end = new SplinePoint(juce::Point<float>(1.0f, 0.5f)); | |||
| start->setStartPoint(true); | |||
| end->setEndPoint(true); | |||
| @@ -257,7 +257,7 @@ public: | |||
| } | |||
| } | |||
| SplinePoint* getSplinePoint(Point<float> positionNormalized) | |||
| SplinePoint* getSplinePoint(juce::Point<float> positionNormalized) | |||
| { | |||
| for (int i = 0; i < this->points.size(); i++) | |||
| { | |||
| @@ -311,7 +311,7 @@ public: | |||
| } | |||
| } | |||
| SplinePoint* add(Point<float> positionNormalized) | |||
| SplinePoint* add(juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *newPoint = new SplinePoint(positionNormalized); | |||
| points.insert(1, newPoint); | |||
| @@ -442,4 +442,4 @@ public: | |||
| this->setDirty(); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -111,12 +111,12 @@ public: | |||
| { | |||
| g.setColour(this->splineColor); | |||
| Point<float> bufferPoint(0.0f, 0.5f); | |||
| juce::Point<float> bufferPoint(0.0f, 0.5f); | |||
| for (int i = 0; i < this->pu->getWidth(); i += 3) | |||
| { | |||
| float normalizedValueX = 1.0f / this->pu->getWidth() * i; | |||
| float normalizedValueY = envelopeEditor->getEnvelopeValue(normalizedValueX); | |||
| Point<int> splinePoint(this->pu->calculateViewPosition(Point<float>(normalizedValueX, normalizedValueY))); | |||
| juce::Point<int> splinePoint(this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, normalizedValueY))); | |||
| if (i == 0) | |||
| { | |||
| @@ -177,8 +177,8 @@ public: | |||
| } | |||
| float normalizedValueY = 1.0f / NUMBER_OF_VERTICAL_LINES * i; | |||
| Point<int> start = this->pu->calculateViewPosition(Point<float>(0.0f, normalizedValueY)); | |||
| Point<int> end = this->pu->calculateViewPosition(Point<float>(1.0f, normalizedValueY)); | |||
| juce::Point<int> start = this->pu->calculateViewPosition(juce::Point<float>(0.0f, normalizedValueY)); | |||
| juce::Point<int> end = this->pu->calculateViewPosition(juce::Point<float>(1.0f, normalizedValueY)); | |||
| g.drawLine((float)start.getX(), (float)start.getY(), (float)end.getX(), (float)end.getY()); | |||
| } | |||
| } | |||
| @@ -208,8 +208,8 @@ public: | |||
| } | |||
| float normalizedValueX = 1.0f / numberOfBars * i; | |||
| Point<int> start = this->pu->calculateViewPosition(Point<float>(normalizedValueX, 0.0f)); | |||
| Point<int> end = this->pu->calculateViewPosition(Point<float>(normalizedValueX, 1.0f)); | |||
| juce::Point<int> start = this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, 0.0f)); | |||
| juce::Point<int> end = this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, 1.0f)); | |||
| g.drawLine((float)start.getX(), (float)start.getY(), (float)end.getX(), (float)end.getY()); | |||
| } | |||
| } | |||
| @@ -223,7 +223,7 @@ public: | |||
| void mouseDown(const MouseEvent &e) | |||
| { | |||
| EnvelopeEditor *envelopeEditor = this->filter->getEnvelopeEditor(); | |||
| Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getMouseDownPosition()); | |||
| juce::Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getMouseDownPosition()); | |||
| if (!this->selectControlPoint(envelopeEditor, positionNormalized)) | |||
| { | |||
| @@ -234,7 +234,7 @@ public: | |||
| this->repaint(); | |||
| } | |||
| void selectOrInsertCenterPoint(EnvelopeEditor *envelopeEditor, Point<float> positionNormalized) | |||
| void selectOrInsertCenterPoint(EnvelopeEditor *envelopeEditor, juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *selectedPoint = envelopeEditor->getSplinePoint(positionNormalized); | |||
| this->deselectAllPoints(); | |||
| @@ -250,7 +250,7 @@ public: | |||
| } | |||
| } | |||
| bool selectControlPoint(EnvelopeEditor *envelopeEditor, Point<float> positionNormalized) | |||
| bool selectControlPoint(EnvelopeEditor *envelopeEditor, juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *alreadySelectedPoint = envelopeEditor->getSelectedSplinePoint(); | |||
| @@ -295,7 +295,7 @@ public: | |||
| if (selectedPoint != NULL) | |||
| { | |||
| Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getPosition()); | |||
| juce::Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getPosition()); | |||
| if (!this->moveControlPoint(envelopeEditor, selectedPoint, positionNormalized)) | |||
| { | |||
| @@ -312,7 +312,7 @@ public: | |||
| bool moveControlPoint( | |||
| EnvelopeEditor *envelopeEditor, | |||
| SplinePoint *selectedPoint, | |||
| Point<float> positionNormalized) | |||
| juce::Point<float> positionNormalized) | |||
| { | |||
| if (selectedPoint->isControlPointSelectedLeft() | |||
| || selectedPoint->isControlPointSelectedRight()) | |||
| @@ -336,7 +336,7 @@ public: | |||
| void moveCenterPoint( | |||
| EnvelopeEditor *envelopeEditor, | |||
| SplinePoint *selectedPoint, | |||
| Point<float> positionNormalized, | |||
| juce::Point<float> positionNormalized, | |||
| const MouseEvent &e) | |||
| { | |||
| if (e.getPosition().getY() > this->pu->getHeight() + 20 | |||
| @@ -358,4 +358,4 @@ public: | |||
| envelopeEditor->deselect(); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -65,17 +65,17 @@ public: | |||
| { | |||
| float centerX = (float)e->getDoubleAttribute(T("centerPointX"), 0.0); | |||
| float centerY = (float)e->getDoubleAttribute(T("centerPointY"), 0.0); | |||
| Point<float> centerPoint(centerX, centerY); | |||
| juce::Point<float> centerPoint(centerX, centerY); | |||
| SplinePoint *splinePoint = new SplinePoint(centerPoint); | |||
| centerX = (float)e->getDoubleAttribute(T("controlPointLeftX"), 0.0); | |||
| centerY = (float)e->getDoubleAttribute(T("controlPointLeftY"), 0.0); | |||
| Point<float> controlPointLeft(centerX, centerY); | |||
| juce::Point<float> controlPointLeft(centerX, centerY); | |||
| splinePoint->setControlPointLeftPosition(controlPointLeft); | |||
| centerX = (float)e->getDoubleAttribute(T("controlPointRightX"), 0.0); | |||
| centerY = (float)e->getDoubleAttribute(T("controlPointRightY"), 0.0); | |||
| Point<float> controlPointRight(centerX, centerY); | |||
| juce::Point<float> controlPointRight(centerX, centerY); | |||
| splinePoint->setControlPointRightPosition(controlPointRight); | |||
| bool isStartPoint = e->getBoolAttribute(T("isStartPoint"), false); | |||
| @@ -89,12 +89,12 @@ public: | |||
| else | |||
| { | |||
| // set default points | |||
| Point<float> centerPointStart(0.0f, 0.5f); | |||
| juce::Point<float> centerPointStart(0.0f, 0.5f); | |||
| SplinePoint *splinePointStart = new SplinePoint(centerPointStart); | |||
| splinePointStart->setStartPoint(true); | |||
| splinePoints.add(splinePointStart); | |||
| Point<float> centerPointEnd(1.0f, 0.5f); | |||
| juce::Point<float> centerPointEnd(1.0f, 0.5f); | |||
| SplinePoint *splinePointEnd = new SplinePoint(centerPointEnd); | |||
| splinePointEnd->setEndPoint(true); | |||
| splinePoints.add(splinePointEnd); | |||
| @@ -110,4 +110,4 @@ public: | |||
| return splinePoints; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -51,18 +51,18 @@ public: | |||
| // In x[0..1], y[0..1] | |||
| // Out x[0..width], y[0..height] | |||
| Point<int> calculateViewPosition(Point<float> normalizedValues) | |||
| juce::Point<int> calculateViewPosition(juce::Point<float> normalizedValues) | |||
| { | |||
| float viewX = normalizedValues.getX() * this->width; | |||
| float viewY = (1.0f - normalizedValues.getY()) * this->height; | |||
| return Point<int>( (int)(viewX + 0.5f), (int)(viewY + 0.5f)); | |||
| return juce::Point<int>( (int)(viewX + 0.5f), (int)(viewY + 0.5f)); | |||
| } | |||
| Point<float> calculateNormalizedPosition(Point<int> pixelValues) | |||
| juce::Point<float> calculateNormalizedPosition(juce::Point<int> pixelValues) | |||
| { | |||
| float viewX = (float)pixelValues.getX() / (float)this->width; | |||
| float viewY = 1.0f - (float)pixelValues.getY() / (float)this->height; | |||
| return Point<float>(viewX, viewY); | |||
| return juce::Point<float>(viewX, viewY); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -32,10 +32,10 @@ class SplinePoint | |||
| private: | |||
| const float SELECTION_RADIUS; | |||
| Point<float> centerPosition; | |||
| juce::Point<float> centerPosition; | |||
| Point<float> controlPointLeft; | |||
| Point<float> controlPointRight; | |||
| juce::Point<float> controlPointLeft; | |||
| juce::Point<float> controlPointRight; | |||
| bool isStartPoint; | |||
| bool isEndPoint; | |||
| @@ -47,7 +47,7 @@ private: | |||
| SplinePoint *linkedPoint; | |||
| public: | |||
| SplinePoint(Point<float> centerPosition) : SELECTION_RADIUS(1.0f / 24.0f) | |||
| SplinePoint(juce::Point<float> centerPosition) : SELECTION_RADIUS(1.0f / 24.0f) | |||
| { | |||
| this->isStartPoint = false; | |||
| this->isEndPoint = false; | |||
| @@ -129,17 +129,17 @@ public: | |||
| this->linkedPoint = linkedPoint; | |||
| } | |||
| Point<float> getCenterPosition() | |||
| juce::Point<float> getCenterPosition() | |||
| { | |||
| return this->centerPosition; | |||
| } | |||
| Point<float> getControlPointLeft() | |||
| juce::Point<float> getControlPointLeft() | |||
| { | |||
| return this->controlPointLeft; | |||
| } | |||
| Point<float> getControlPointRight() | |||
| juce::Point<float> getControlPointRight() | |||
| { | |||
| return this->controlPointRight; | |||
| } | |||
| @@ -154,12 +154,12 @@ public: | |||
| return this->centerPosition.getY(); | |||
| } | |||
| void setPosition(Point<float> position) | |||
| void setPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| Point<float> deltaPointLeft = this->centerPosition - this->controlPointLeft; | |||
| Point<float> deltaPointRight = this->centerPosition - this->controlPointRight; | |||
| juce::Point<float> deltaPointLeft = this->centerPosition - this->controlPointLeft; | |||
| juce::Point<float> deltaPointRight = this->centerPosition - this->controlPointRight; | |||
| // start and end points cant move in x | |||
| if (!this->isStartPoint && !this->isEndPoint) | |||
| @@ -180,7 +180,7 @@ public: | |||
| this->controlPointRight = this->limitBoundaries(this->controlPointRight); | |||
| } | |||
| void setLinkedPointPosition(Point<float> position, bool doLinkEndpoints) | |||
| void setLinkedPointPosition(juce::Point<float> position, bool doLinkEndpoints) | |||
| { | |||
| if (this->linkedPoint != NULL && doLinkEndpoints) | |||
| { | |||
| @@ -188,7 +188,7 @@ public: | |||
| } | |||
| } | |||
| void setControlPointLeftPosition(Point<float> position) | |||
| void setControlPointLeftPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| this->controlPointLeft.setXY(position.getX(), position.getY()); | |||
| @@ -199,7 +199,7 @@ public: | |||
| } | |||
| } | |||
| void setControlPointRightPosition(Point<float> position) | |||
| void setControlPointRightPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| this->controlPointRight.setXY(position.getX(), position.getY()); | |||
| @@ -210,7 +210,7 @@ public: | |||
| } | |||
| } | |||
| Point<float> limitBoundaries(Point<float> position) | |||
| juce::Point<float> limitBoundaries(juce::Point<float> position) | |||
| { | |||
| if (position.getX() < 0.0f) position.setX(0.0f); | |||
| if (position.getX() > 1.0f) position.setX(1.0f); | |||
| @@ -220,7 +220,7 @@ public: | |||
| return position; | |||
| } | |||
| bool isSelected(Point<float> positionNormalized) | |||
| bool isSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| float deltaX = positionNormalized.getX() - this->centerPosition.getX(); | |||
| float deltaY = positionNormalized.getY() - this->centerPosition.getY(); | |||
| @@ -228,7 +228,7 @@ public: | |||
| return this->verifyDistance(deltaX, deltaY, SELECTION_RADIUS); | |||
| } | |||
| bool isLeftControlPointSelected(Point<float> positionNormalized) | |||
| bool isLeftControlPointSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| if (this->isSelected() && !this->IsStartPoint()) | |||
| { | |||
| @@ -241,7 +241,7 @@ public: | |||
| return false; | |||
| } | |||
| bool isRightControlPointSelected(Point<float> positionNormalized) | |||
| bool isRightControlPointSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| if (this->isSelected() && !this->IsEndPoint()) | |||
| { | |||
| @@ -318,4 +318,4 @@ public: | |||
| return 0; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -55,14 +55,14 @@ public: | |||
| if (!this->splinePoint->IsStartPoint()) | |||
| { | |||
| this->setControlPointColor(g, splinePoint->isControlPointSelectedLeft()); | |||
| Point<int> pointLeft = pu->calculateViewPosition(splinePoint->getControlPointLeft()); | |||
| juce::Point<int> pointLeft = pu->calculateViewPosition(splinePoint->getControlPointLeft()); | |||
| g.fillEllipse((float)pointLeft.getX() - CENTER_SIZE / 4, (float)pointLeft.getY() - CENTER_SIZE / 4, (float)CENTER_SIZE / 2, (float)CENTER_SIZE / 2); | |||
| } | |||
| if (!this->splinePoint->IsEndPoint()) | |||
| { | |||
| this->setControlPointColor(g, splinePoint->isControlPointSelectedRight()); | |||
| Point<int> pointRight = pu->calculateViewPosition(splinePoint->getControlPointRight()); | |||
| juce::Point<int> pointRight = pu->calculateViewPosition(splinePoint->getControlPointRight()); | |||
| g.fillEllipse((float)pointRight.getX() - CENTER_SIZE / 4, (float)pointRight.getY() - CENTER_SIZE / 4, (float)CENTER_SIZE / 2, (float)CENTER_SIZE / 2); | |||
| } | |||
| } | |||
| @@ -85,11 +85,11 @@ public: | |||
| g.setColour(Colour((const uint8)100, (const uint8)100, (const uint8)100, (const uint8)200)); | |||
| } | |||
| Point<int> point = pu->calculateViewPosition(splinePoint->getCenterPosition()); | |||
| juce::Point<int> point = pu->calculateViewPosition(splinePoint->getCenterPosition()); | |||
| g.fillEllipse((float)point.getX() - CENTER_SIZE / 2, (float)point.getY() - CENTER_SIZE / 2, (float)CENTER_SIZE, (float)CENTER_SIZE); | |||
| g.setColour(Colour((const uint8)255, (const uint8)255, (const uint8)255, (const uint8)150)); | |||
| g.drawEllipse((float)point.getX() - CENTER_SIZE / 2, (float)point.getY() - CENTER_SIZE / 2, (float)CENTER_SIZE, (float)CENTER_SIZE, 2.0f); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -42,12 +42,12 @@ public: | |||
| cp[3] is the end point, or P3 in the above diagram | |||
| t is the parameter value, 0 <= t <= 1 | |||
| */ | |||
| Point<float> PointOnCubicBezier(float t, Point<float> p1, Point<float> p2, Point<float> p3, Point<float> p4) | |||
| juce::Point<float> PointOnCubicBezier(float t, juce::Point<float> p1, juce::Point<float> p2, juce::Point<float> p3, juce::Point<float> p4) | |||
| { | |||
| float ax, bx, cx; | |||
| float ay, by, cy; | |||
| float tSquared, tCubed; | |||
| Point<float> result; | |||
| juce::Point<float> result; | |||
| /* calculate the polynomial coefficients */ | |||
| cx = 3.0f * (p2.getX() - p1.getX()); | |||
| @@ -69,4 +69,4 @@ public: | |||
| return result; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -130,7 +130,7 @@ private: | |||
| float scaleX = (x - points[i]->getX()) * 1.0f / deltaX; | |||
| Point<float> result = su.PointOnCubicBezier( | |||
| juce::Point<float> result = su.PointOnCubicBezier( | |||
| scaleX, | |||
| points[i]->getCenterPosition(), | |||
| points[i]->getControlPointRight(), | |||
| @@ -171,8 +171,8 @@ public: | |||
| //const ScopedLock myScopedLock (myCriticalSectionBuffer); | |||
| points.clear(); | |||
| SplinePoint *start = new SplinePoint(Point<float>(0.0f, 0.5f)); | |||
| SplinePoint *end = new SplinePoint(Point<float>(1.0f, 0.5f)); | |||
| SplinePoint *start = new SplinePoint(juce::Point<float>(0.0f, 0.5f)); | |||
| SplinePoint *end = new SplinePoint(juce::Point<float>(1.0f, 0.5f)); | |||
| start->setStartPoint(true); | |||
| end->setEndPoint(true); | |||
| @@ -257,7 +257,7 @@ public: | |||
| } | |||
| } | |||
| SplinePoint* getSplinePoint(Point<float> positionNormalized) | |||
| SplinePoint* getSplinePoint(juce::Point<float> positionNormalized) | |||
| { | |||
| for (int i = 0; i < this->points.size(); i++) | |||
| { | |||
| @@ -311,7 +311,7 @@ public: | |||
| } | |||
| } | |||
| SplinePoint* add(Point<float> positionNormalized) | |||
| SplinePoint* add(juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *newPoint = new SplinePoint(positionNormalized); | |||
| points.insert(1, newPoint); | |||
| @@ -442,4 +442,4 @@ public: | |||
| this->setDirty(); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -111,12 +111,12 @@ public: | |||
| { | |||
| g.setColour(this->splineColor); | |||
| Point<float> bufferPoint(0.0f, 0.5f); | |||
| juce::Point<float> bufferPoint(0.0f, 0.5f); | |||
| for (int i = 0; i < this->pu->getWidth(); i += 3) | |||
| { | |||
| float normalizedValueX = 1.0f / this->pu->getWidth() * i; | |||
| float normalizedValueY = envelopeEditor->getEnvelopeValue(normalizedValueX); | |||
| Point<int> splinePoint(this->pu->calculateViewPosition(Point<float>(normalizedValueX, normalizedValueY))); | |||
| juce::Point<int> splinePoint(this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, normalizedValueY))); | |||
| if (i == 0) | |||
| { | |||
| @@ -177,8 +177,8 @@ public: | |||
| } | |||
| float normalizedValueY = 1.0f / NUMBER_OF_VERTICAL_LINES * i; | |||
| Point<int> start = this->pu->calculateViewPosition(Point<float>(0.0f, normalizedValueY)); | |||
| Point<int> end = this->pu->calculateViewPosition(Point<float>(1.0f, normalizedValueY)); | |||
| juce::Point<int> start = this->pu->calculateViewPosition(juce::Point<float>(0.0f, normalizedValueY)); | |||
| juce::Point<int> end = this->pu->calculateViewPosition(juce::Point<float>(1.0f, normalizedValueY)); | |||
| g.drawLine((float)start.getX(), (float)start.getY(), (float)end.getX(), (float)end.getY()); | |||
| } | |||
| } | |||
| @@ -208,8 +208,8 @@ public: | |||
| } | |||
| float normalizedValueX = 1.0f / numberOfBars * i; | |||
| Point<int> start = this->pu->calculateViewPosition(Point<float>(normalizedValueX, 0.0f)); | |||
| Point<int> end = this->pu->calculateViewPosition(Point<float>(normalizedValueX, 1.0f)); | |||
| juce::Point<int> start = this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, 0.0f)); | |||
| juce::Point<int> end = this->pu->calculateViewPosition(juce::Point<float>(normalizedValueX, 1.0f)); | |||
| g.drawLine((float)start.getX(), (float)start.getY(), (float)end.getX(), (float)end.getY()); | |||
| } | |||
| } | |||
| @@ -223,7 +223,7 @@ public: | |||
| void mouseDown(const MouseEvent &e) | |||
| { | |||
| EnvelopeEditor *envelopeEditor = this->filter->getEnvelopeEditor(); | |||
| Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getMouseDownPosition()); | |||
| juce::Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getMouseDownPosition()); | |||
| if (!this->selectControlPoint(envelopeEditor, positionNormalized)) | |||
| { | |||
| @@ -234,7 +234,7 @@ public: | |||
| this->repaint(); | |||
| } | |||
| void selectOrInsertCenterPoint(EnvelopeEditor *envelopeEditor, Point<float> positionNormalized) | |||
| void selectOrInsertCenterPoint(EnvelopeEditor *envelopeEditor, juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *selectedPoint = envelopeEditor->getSplinePoint(positionNormalized); | |||
| this->deselectAllPoints(); | |||
| @@ -250,7 +250,7 @@ public: | |||
| } | |||
| } | |||
| bool selectControlPoint(EnvelopeEditor *envelopeEditor, Point<float> positionNormalized) | |||
| bool selectControlPoint(EnvelopeEditor *envelopeEditor, juce::Point<float> positionNormalized) | |||
| { | |||
| SplinePoint *alreadySelectedPoint = envelopeEditor->getSelectedSplinePoint(); | |||
| @@ -295,7 +295,7 @@ public: | |||
| if (selectedPoint != NULL) | |||
| { | |||
| Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getPosition()); | |||
| juce::Point<float> positionNormalized = this->pu->calculateNormalizedPosition(e.getPosition()); | |||
| if (!this->moveControlPoint(envelopeEditor, selectedPoint, positionNormalized)) | |||
| { | |||
| @@ -312,7 +312,7 @@ public: | |||
| bool moveControlPoint( | |||
| EnvelopeEditor *envelopeEditor, | |||
| SplinePoint *selectedPoint, | |||
| Point<float> positionNormalized) | |||
| juce::Point<float> positionNormalized) | |||
| { | |||
| if (selectedPoint->isControlPointSelectedLeft() | |||
| || selectedPoint->isControlPointSelectedRight()) | |||
| @@ -336,7 +336,7 @@ public: | |||
| void moveCenterPoint( | |||
| EnvelopeEditor *envelopeEditor, | |||
| SplinePoint *selectedPoint, | |||
| Point<float> positionNormalized, | |||
| juce::Point<float> positionNormalized, | |||
| const MouseEvent &e) | |||
| { | |||
| if (e.getPosition().getY() > this->pu->getHeight() + 20 | |||
| @@ -358,4 +358,4 @@ public: | |||
| envelopeEditor->deselect(); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -65,17 +65,17 @@ public: | |||
| { | |||
| float centerX = (float)e->getDoubleAttribute("centerPointX", 0.0); | |||
| float centerY = (float)e->getDoubleAttribute("centerPointY", 0.0); | |||
| Point<float> centerPoint(centerX, centerY); | |||
| juce::Point<float> centerPoint(centerX, centerY); | |||
| SplinePoint *splinePoint = new SplinePoint(centerPoint); | |||
| centerX = (float)e->getDoubleAttribute("controlPointLeftX", 0.0); | |||
| centerY = (float)e->getDoubleAttribute("controlPointLeftY", 0.0); | |||
| Point<float> controlPointLeft(centerX, centerY); | |||
| juce::Point<float> controlPointLeft(centerX, centerY); | |||
| splinePoint->setControlPointLeftPosition(controlPointLeft); | |||
| centerX = (float)e->getDoubleAttribute("controlPointRightX", 0.0); | |||
| centerY = (float)e->getDoubleAttribute("controlPointRightY", 0.0); | |||
| Point<float> controlPointRight(centerX, centerY); | |||
| juce::Point<float> controlPointRight(centerX, centerY); | |||
| splinePoint->setControlPointRightPosition(controlPointRight); | |||
| bool isStartPoint = e->getBoolAttribute("isStartPoint", false); | |||
| @@ -89,12 +89,12 @@ public: | |||
| else | |||
| { | |||
| // set default points | |||
| Point<float> centerPointStart(0.0f, 0.5f); | |||
| juce::Point<float> centerPointStart(0.0f, 0.5f); | |||
| SplinePoint *splinePointStart = new SplinePoint(centerPointStart); | |||
| splinePointStart->setStartPoint(true); | |||
| splinePoints.add(splinePointStart); | |||
| Point<float> centerPointEnd(1.0f, 0.5f); | |||
| juce::Point<float> centerPointEnd(1.0f, 0.5f); | |||
| SplinePoint *splinePointEnd = new SplinePoint(centerPointEnd); | |||
| splinePointEnd->setEndPoint(true); | |||
| splinePoints.add(splinePointEnd); | |||
| @@ -110,4 +110,4 @@ public: | |||
| return splinePoints; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -51,18 +51,18 @@ public: | |||
| // In x[0..1], y[0..1] | |||
| // Out x[0..width], y[0..height] | |||
| Point<int> calculateViewPosition(Point<float> normalizedValues) | |||
| juce::Point<int> calculateViewPosition(juce::Point<float> normalizedValues) | |||
| { | |||
| float viewX = normalizedValues.getX() * this->width; | |||
| float viewY = (1.0f - normalizedValues.getY()) * this->height; | |||
| return Point<int>( (int)(viewX + 0.5f), (int)(viewY + 0.5f)); | |||
| return juce::Point<int>( (int)(viewX + 0.5f), (int)(viewY + 0.5f)); | |||
| } | |||
| Point<float> calculateNormalizedPosition(Point<int> pixelValues) | |||
| juce::Point<float> calculateNormalizedPosition(juce::Point<int> pixelValues) | |||
| { | |||
| float viewX = (float)pixelValues.getX() / (float)this->width; | |||
| float viewY = 1.0f - (float)pixelValues.getY() / (float)this->height; | |||
| return Point<float>(viewX, viewY); | |||
| return juce::Point<float>(viewX, viewY); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -32,10 +32,10 @@ class SplinePoint | |||
| private: | |||
| const float SELECTION_RADIUS; | |||
| Point<float> centerPosition; | |||
| juce::Point<float> centerPosition; | |||
| Point<float> controlPointLeft; | |||
| Point<float> controlPointRight; | |||
| juce::Point<float> controlPointLeft; | |||
| juce::Point<float> controlPointRight; | |||
| bool isStartPoint; | |||
| bool isEndPoint; | |||
| @@ -47,7 +47,7 @@ private: | |||
| SplinePoint *linkedPoint; | |||
| public: | |||
| SplinePoint(Point<float> centerPosition) : SELECTION_RADIUS(1.0f / 24.0f) | |||
| SplinePoint(juce::Point<float> centerPosition) : SELECTION_RADIUS(1.0f / 24.0f) | |||
| { | |||
| this->isStartPoint = false; | |||
| this->isEndPoint = false; | |||
| @@ -129,17 +129,17 @@ public: | |||
| this->linkedPoint = linkedPoint; | |||
| } | |||
| Point<float> getCenterPosition() | |||
| juce::Point<float> getCenterPosition() | |||
| { | |||
| return this->centerPosition; | |||
| } | |||
| Point<float> getControlPointLeft() | |||
| juce::Point<float> getControlPointLeft() | |||
| { | |||
| return this->controlPointLeft; | |||
| } | |||
| Point<float> getControlPointRight() | |||
| juce::Point<float> getControlPointRight() | |||
| { | |||
| return this->controlPointRight; | |||
| } | |||
| @@ -154,12 +154,12 @@ public: | |||
| return this->centerPosition.getY(); | |||
| } | |||
| void setPosition(Point<float> position) | |||
| void setPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| Point<float> deltaPointLeft = this->centerPosition - this->controlPointLeft; | |||
| Point<float> deltaPointRight = this->centerPosition - this->controlPointRight; | |||
| juce::Point<float> deltaPointLeft = this->centerPosition - this->controlPointLeft; | |||
| juce::Point<float> deltaPointRight = this->centerPosition - this->controlPointRight; | |||
| // start and end points cant move in x | |||
| if (!this->isStartPoint && !this->isEndPoint) | |||
| @@ -180,7 +180,7 @@ public: | |||
| this->controlPointRight = this->limitBoundaries(this->controlPointRight); | |||
| } | |||
| void setLinkedPointPosition(Point<float> position, bool doLinkEndpoints) | |||
| void setLinkedPointPosition(juce::Point<float> position, bool doLinkEndpoints) | |||
| { | |||
| if (this->linkedPoint != NULL && doLinkEndpoints) | |||
| { | |||
| @@ -188,7 +188,7 @@ public: | |||
| } | |||
| } | |||
| void setControlPointLeftPosition(Point<float> position) | |||
| void setControlPointLeftPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| this->controlPointLeft.setXY(position.getX(), position.getY()); | |||
| @@ -199,7 +199,7 @@ public: | |||
| } | |||
| } | |||
| void setControlPointRightPosition(Point<float> position) | |||
| void setControlPointRightPosition(juce::Point<float> position) | |||
| { | |||
| position = this->limitBoundaries(position); | |||
| this->controlPointRight.setXY(position.getX(), position.getY()); | |||
| @@ -210,7 +210,7 @@ public: | |||
| } | |||
| } | |||
| Point<float> limitBoundaries(Point<float> position) | |||
| juce::Point<float> limitBoundaries(juce::Point<float> position) | |||
| { | |||
| if (position.getX() < 0.0f) position.setX(0.0f); | |||
| if (position.getX() > 1.0f) position.setX(1.0f); | |||
| @@ -220,7 +220,7 @@ public: | |||
| return position; | |||
| } | |||
| bool isSelected(Point<float> positionNormalized) | |||
| bool isSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| float deltaX = positionNormalized.getX() - this->centerPosition.getX(); | |||
| float deltaY = positionNormalized.getY() - this->centerPosition.getY(); | |||
| @@ -228,7 +228,7 @@ public: | |||
| return this->verifyDistance(deltaX, deltaY, SELECTION_RADIUS); | |||
| } | |||
| bool isLeftControlPointSelected(Point<float> positionNormalized) | |||
| bool isLeftControlPointSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| if (this->isSelected() && !this->IsStartPoint()) | |||
| { | |||
| @@ -241,7 +241,7 @@ public: | |||
| return false; | |||
| } | |||
| bool isRightControlPointSelected(Point<float> positionNormalized) | |||
| bool isRightControlPointSelected(juce::Point<float> positionNormalized) | |||
| { | |||
| if (this->isSelected() && !this->IsEndPoint()) | |||
| { | |||
| @@ -318,4 +318,4 @@ public: | |||
| return 0; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -55,14 +55,14 @@ public: | |||
| if (!this->splinePoint->IsStartPoint()) | |||
| { | |||
| this->setControlPointColor(g, splinePoint->isControlPointSelectedLeft()); | |||
| Point<int> pointLeft = pu->calculateViewPosition(splinePoint->getControlPointLeft()); | |||
| juce::Point<int> pointLeft = pu->calculateViewPosition(splinePoint->getControlPointLeft()); | |||
| g.fillEllipse((float)pointLeft.getX() - CENTER_SIZE / 4, (float)pointLeft.getY() - CENTER_SIZE / 4, (float)CENTER_SIZE / 2, (float)CENTER_SIZE / 2); | |||
| } | |||
| if (!this->splinePoint->IsEndPoint()) | |||
| { | |||
| this->setControlPointColor(g, splinePoint->isControlPointSelectedRight()); | |||
| Point<int> pointRight = pu->calculateViewPosition(splinePoint->getControlPointRight()); | |||
| juce::Point<int> pointRight = pu->calculateViewPosition(splinePoint->getControlPointRight()); | |||
| g.fillEllipse((float)pointRight.getX() - CENTER_SIZE / 4, (float)pointRight.getY() - CENTER_SIZE / 4, (float)CENTER_SIZE / 2, (float)CENTER_SIZE / 2); | |||
| } | |||
| } | |||
| @@ -85,11 +85,11 @@ public: | |||
| g.setColour(Colour((const uint8)100, (const uint8)100, (const uint8)100, (const uint8)200)); | |||
| } | |||
| Point<int> point = pu->calculateViewPosition(splinePoint->getCenterPosition()); | |||
| juce::Point<int> point = pu->calculateViewPosition(splinePoint->getCenterPosition()); | |||
| g.fillEllipse((float)point.getX() - CENTER_SIZE / 2, (float)point.getY() - CENTER_SIZE / 2, (float)CENTER_SIZE, (float)CENTER_SIZE); | |||
| g.setColour(Colour((const uint8)255, (const uint8)255, (const uint8)255, (const uint8)150)); | |||
| g.drawEllipse((float)point.getX() - CENTER_SIZE / 2, (float)point.getY() - CENTER_SIZE / 2, (float)CENTER_SIZE, (float)CENTER_SIZE, 2.0f); | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -42,12 +42,12 @@ public: | |||
| cp[3] is the end point, or P3 in the above diagram | |||
| t is the parameter value, 0 <= t <= 1 | |||
| */ | |||
| Point<float> PointOnCubicBezier(float t, Point<float> p1, Point<float> p2, Point<float> p3, Point<float> p4) | |||
| juce::Point<float> PointOnCubicBezier(float t, juce::Point<float> p1, juce::Point<float> p2, juce::Point<float> p3, juce::Point<float> p4) | |||
| { | |||
| float ax, bx, cx; | |||
| float ay, by, cy; | |||
| float tSquared, tCubed; | |||
| Point<float> result; | |||
| juce::Point<float> result; | |||
| /* calculate the polynomial coefficients */ | |||
| cx = 3.0f * (p2.getX() - p1.getX()); | |||
| @@ -69,4 +69,4 @@ public: | |||
| return result; | |||
| } | |||
| }; | |||
| #endif | |||
| #endif | |||
| @@ -23,6 +23,22 @@ plugin_include_dirs = [ | |||
| dependencies_plugin = [ | |||
| ] | |||
| if os_darwin | |||
| dependencies_plugin += [ | |||
| dependency('Accelerate', method: 'extraframework'), | |||
| dependency('AudioToolbox', method: 'extraframework'), | |||
| dependency('AudioUnit', method: 'extraframework'), | |||
| dependency('Carbon', method: 'extraframework'), | |||
| dependency('Cocoa', method: 'extraframework'), | |||
| dependency('CoreAudio', method: 'extraframework'), | |||
| dependency('CoreAudioKit', method: 'extraframework'), | |||
| dependency('CoreMIDI', method: 'extraframework'), | |||
| dependency('IOKit', method: 'extraframework'), | |||
| dependency('QuartzCore', method: 'extraframework'), | |||
| dependency('WebKit', method: 'extraframework'), | |||
| ] | |||
| endif | |||
| if os_windows | |||
| dependencies_plugin += [ | |||
| cc.find_library('comdlg32'), | |||
| @@ -66,32 +82,36 @@ endif | |||
| ############################################################################### | |||
| # link flags for plugins | |||
| link_flags_plugin = [ | |||
| link_flags_plugin_lv2 = [ | |||
| ] | |||
| link_flags_plugin_vst2 = [ | |||
| ] | |||
| link_flags_plugin_vst3 = [ | |||
| ] | |||
| if os_darwin | |||
| link_flags_plugin += [ | |||
| '-Wl,-export-symbols=' + meson.source_root() + '/scripts/plugin-symbols.txt', | |||
| link_flags_plugin_lv2 += [ | |||
| '-Wl,-exported_symbol,_lv2_generate_ttl', | |||
| '-Wl,-exported_symbol,_lv2_descriptor', | |||
| '-Wl,-exported_symbol,_lv2ui_descriptor', | |||
| ] | |||
| link_flags_plugin_vst2 += [ | |||
| '-Wl,-exported_symbol,_VSTPluginMain', | |||
| ] | |||
| link_flags_plugin_vst3 += [ | |||
| '-Wl,-exported_symbol,_bundleEntry', | |||
| '-Wl,-exported_symbol,_bundleExit', | |||
| '-Wl,-exported_symbol,_GetPluginFactory', | |||
| ] | |||
| else | |||
| link_flags_plugin += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols.version', | |||
| link_flags_plugin_lv2 += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols-lv2.version', | |||
| ] | |||
| endif | |||
| if os_darwin | |||
| link_flags_plugin += [ | |||
| '-framework Accelerate', | |||
| '-framework AudioToolbox', | |||
| '-framework AudioUnit', | |||
| '-framework Carbon', | |||
| '-framework Cocoa', | |||
| '-framework CoreAudio', | |||
| '-framework CoreAudioKit', | |||
| '-framework CoreMIDI', | |||
| '-framework IOKit', | |||
| '-framework QuartzCore', | |||
| '-framework WebKit', | |||
| link_flags_plugin_vst2 += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols-vst2.version', | |||
| ] | |||
| link_flags_plugin_vst3 += [ | |||
| '-Wl,--version-script=' + meson.source_root() + '/scripts/plugin-symbols-vst3.version', | |||
| ] | |||
| endif | |||
| @@ -168,9 +188,9 @@ foreach plugin : plugins | |||
| if plugin_uses_opengl | |||
| if os_darwin | |||
| plugin_extra_link_flags += [ | |||
| '-framework OpenGL', | |||
| ] | |||
| plugin_extra_dependencies += [ | |||
| dependency('OpenGL', method: 'extraframework'), | |||
| ] | |||
| elif os_windows | |||
| plugin_extra_dependencies += [ | |||
| cc.find_library('opengl32'), | |||
| @@ -208,7 +228,7 @@ foreach plugin : plugins | |||
| ], | |||
| c_args: build_flags + build_flags_plugin + build_flags_plugin_lv2 + plugin_extra_build_flags, | |||
| cpp_args: build_flags_cpp + build_flags_plugin + build_flags_plugin_lv2 + build_flag_plugin_cpp + plugin_extra_build_flags, | |||
| link_args: link_flags + link_flags_plugin, | |||
| link_args: link_flags + link_flags_plugin_lv2, | |||
| link_with: [ lib_juce_current, plugin_lib ], | |||
| ) | |||
| @@ -239,7 +259,7 @@ foreach plugin : plugins | |||
| ], | |||
| c_args: build_flags + build_flags_plugin + build_flags_plugin_vst2 + plugin_extra_build_flags, | |||
| cpp_args: build_flags_cpp + build_flags_plugin + build_flags_plugin_vst2 + build_flag_plugin_cpp + plugin_extra_build_flags, | |||
| link_args: link_flags + link_flags_plugin, | |||
| link_args: link_flags + link_flags_plugin_vst2, | |||
| link_with: [ lib_juce_current, plugin_lib ], | |||
| install: true, | |||
| install_dir: vst2dir, | |||
| @@ -257,7 +277,7 @@ foreach plugin : plugins | |||
| ], | |||
| c_args: build_flags + build_flags_plugin + build_flags_plugin_vst3 + plugin_extra_build_flags, | |||
| cpp_args: build_flags_cpp + build_flags_plugin + build_flags_plugin_vst3 + build_flag_plugin_cpp + plugin_extra_build_flags, | |||
| link_args: link_flags + link_flags_plugin, | |||
| link_args: link_flags + link_flags_plugin_vst3, | |||
| link_with: [ lib_juce_current, plugin_lib ], | |||
| ) | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| global: lv2_descriptor; lv2ui_descriptor; lv2_generate_ttl; | |||
| local: *; | |||
| }; | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| global: lv2_descriptor; VSTPluginMain; | |||
| local: *; | |||
| }; | |||
| @@ -0,0 +1,4 @@ | |||
| { | |||
| global: lv2_descriptor; DllMain; InitDll; ExitDll; ModuleEntry; ModuleExit; GetPluginFactory; | |||
| local: *; | |||
| }; | |||
| @@ -1,17 +0,0 @@ | |||
| # LV2 | |||
| lv2_generate_ttl | |||
| lv2_descriptor | |||
| lv2ui_descriptor | |||
| # VST2 | |||
| VSTPluginMain | |||
| # VST3 | |||
| DllMain | |||
| InitDll | |||
| ExitDll | |||
| ModuleEntry | |||
| ModuleExit | |||
| bundleEntry | |||
| bundleExit | |||
| GetPluginFactory | |||
| @@ -1,4 +0,0 @@ | |||
| { | |||
| global: lv2_descriptor; lv2ui_descriptor; lv2_generate_ttl; VSTPluginMain; DllMain; InitDll; ExitDll; ModuleEntry; ModuleExit; bundleEntry; bundleExit; GetPluginFactory; | |||
| local: *; | |||
| }; | |||