| @@ -28,24 +28,6 @@ namespace BinaryData | |||
| extern const char* MontserratRegular_ttf; | |||
| const int MontserratRegular_ttfSize = 245708; | |||
| #endif | |||
| extern const char* default_vitalskin; | |||
| const int default_vitalskinSize = 12912; | |||
| #ifdef TUNINGS | |||
| extern const char* _5_Limit_scl; | |||
| const int _5_Limit_sclSize = 87; | |||
| #endif | |||
| #ifdef TUNINGS | |||
| extern const char* _7_Limit_scl; | |||
| const int _7_Limit_sclSize = 85; | |||
| #endif | |||
| #ifdef TUNINGS | |||
| extern const char* Pythagorean_scl; | |||
| const int Pythagorean_sclSize = 108; | |||
| #endif | |||
| #ifdef ICONS | |||
| extern const char* chorus_svg; | |||
| @@ -117,10 +99,28 @@ namespace BinaryData | |||
| const int shuffle_svgSize = 382; | |||
| #endif | |||
| extern const char* vitaliumunfa_png; | |||
| const int vitaliumunfa_pngSize = 36106; | |||
| #ifdef TUNINGS | |||
| extern const char* _5_Limit_scl; | |||
| const int _5_Limit_sclSize = 87; | |||
| #endif | |||
| #ifdef TUNINGS | |||
| extern const char* _7_Limit_scl; | |||
| const int _7_Limit_sclSize = 85; | |||
| #endif | |||
| #ifdef TUNINGS | |||
| extern const char* Pythagorean_scl; | |||
| const int Pythagorean_sclSize = 108; | |||
| #endif | |||
| extern const char* default_vitalskin; | |||
| const int default_vitalskinSize = 12912; | |||
| extern const char* vitaliumunfabg_svg; | |||
| const int vitaliumunfabg_svgSize = 1051; | |||
| extern const char* BinaryData_cpp; | |||
| const int BinaryData_cppSize = 2555792; | |||
| extern const char* vitaliumunfafg_svg; | |||
| const int vitaliumunfafg_svgSize = 540; | |||
| } | |||
| @@ -0,0 +1,28 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
| <!-- Created with Inkscape (http://www.inkscape.org/) --> | |||
| <svg | |||
| version="1.1" | |||
| id="svg2" | |||
| width="467" | |||
| height="454" | |||
| viewBox="0 0 467 454" | |||
| xml:space="preserve" | |||
| xmlns="http://www.w3.org/2000/svg" | |||
| xmlns:svg="http://www.w3.org/2000/svg"><defs | |||
| id="defs6" /><path | |||
| style="fill:#000000" | |||
| d="M 1.2108367,62.047902 62.997971,61.989002 99.163658,183.99976 54.997332,241.15662 Z" | |||
| id="path434" /><path | |||
| style="fill:#000000" | |||
| d="m 65.50489,276.3531 43.97832,-56.70387 10.72703,35.03033 -44.10171,56.89806 z" | |||
| id="path432" /><path | |||
| style="fill:#000000" | |||
| d="m 86.677062,347.04891 43.908578,-57.06729 10.74608,35.0751 -43.979338,56.9909 z" | |||
| id="path428" /><path | |||
| style="fill:#000000" | |||
| d="m 107.89578,417.68335 43.60593,-57.30193 11.29501,34.69185 -44.33816,57.37036 z" | |||
| id="path424" /><path | |||
| style="fill:#000000" | |||
| d="M 186.66288,70.532749 238.81788,1.5067382 336.57257,1.4121669 213.93016,161.08548 Z" | |||
| id="path436" /></svg> | |||
| @@ -0,0 +1,16 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
| <!-- Created with Inkscape (http://www.inkscape.org/) --> | |||
| <svg | |||
| version="1.1" | |||
| id="svg2" | |||
| width="467" | |||
| height="454" | |||
| viewBox="0 0 467 454" | |||
| xml:space="preserve" | |||
| xmlns="http://www.w3.org/2000/svg" | |||
| xmlns:svg="http://www.w3.org/2000/svg"><defs | |||
| id="defs6" /><path | |||
| style="display:inline;fill:#000000" | |||
| d="M 92.702971,61.829015 154.12166,61.790333 201.05898,218.82881 367.95894,1.9755249 465.03525,2.3951663 184.22551,367.28588 Z" | |||
| id="path430" /></svg> | |||
| @@ -25,19 +25,37 @@ | |||
| class LogoButton : public Button { | |||
| public: | |||
| LogoButton(const String& name) : Button(name), logo_(Paths::vitaliumLogo()) { | |||
| LogoButton(const String& name) : Button(name) { | |||
| image_component_.setComponent(this); | |||
| } | |||
| void setPaths(const Path& letter, const Path& ring) { | |||
| letter_ = letter; | |||
| ring_ = ring; | |||
| } | |||
| void resized() override { | |||
| logo_->setTransformToFit(getLocalBounds().toFloat(), RectanglePlacement::stretchToFit); | |||
| Rectangle<float> bounds = getLocalBounds().toFloat(); | |||
| letter_.applyTransform(letter_.getTransformToScaleToFit(bounds, true)); | |||
| ring_.applyTransform(ring_.getTransformToScaleToFit(bounds, true)); | |||
| redoImage(); | |||
| } | |||
| void paintButton(Graphics& g, bool hover, bool down) override { | |||
| logo_->setTransformToFit(getLocalBounds().toFloat(), RectanglePlacement::stretchToFit); | |||
| logo_->draw(g, 1.0f); | |||
| Rectangle<float> bounds = getLocalBounds().toFloat(); | |||
| letter_.applyTransform(letter_.getTransformToScaleToFit(bounds, true)); | |||
| ring_.applyTransform(ring_.getTransformToScaleToFit(bounds, true)); | |||
| g.setColour(findColour(Skin::kShadow, true)); | |||
| ColourGradient letter_gradient(letter_top_color_, 0.0f, 0.0f, letter_bottom_color_, 0.0f, getHeight(), false); | |||
| ColourGradient ring_gradient(ring_top_color_, 0.0f, 0.0f, ring_bottom_color_, 0.0f, getHeight(), false); | |||
| g.setGradientFill(letter_gradient); | |||
| g.fillPath(letter_); | |||
| g.setGradientFill(ring_gradient); | |||
| g.fillPath(ring_); | |||
| if (hover) { | |||
| g.setColour(findColour(Skin::kLightenScreen, true)); | |||
| @@ -49,6 +67,18 @@ class LogoButton : public Button { | |||
| } | |||
| } | |||
| void setLetterColors(Colour top, Colour bottom) { | |||
| letter_top_color_ = top; | |||
| letter_bottom_color_ = bottom; | |||
| redoImage(); | |||
| } | |||
| void setRingColors(Colour top, Colour bottom) { | |||
| ring_top_color_ = top; | |||
| ring_bottom_color_ = bottom; | |||
| redoImage(); | |||
| } | |||
| void mouseEnter(const MouseEvent& e) override { | |||
| Button::mouseEnter(e); | |||
| image_component_.setColor(Colour(0xffdddddd)); | |||
| @@ -65,12 +95,20 @@ class LogoButton : public Button { | |||
| private: | |||
| OpenGlImageComponent image_component_; | |||
| std::unique_ptr<Drawable> logo_; | |||
| Path letter_; | |||
| Path ring_; | |||
| Colour letter_top_color_; | |||
| Colour letter_bottom_color_; | |||
| Colour ring_top_color_; | |||
| Colour ring_bottom_color_; | |||
| }; | |||
| LogoSection::LogoSection() : SynthSection("logo_section") { | |||
| #if !defined(NO_TEXT_ENTRY) | |||
| logo_button_ = std::make_unique<LogoButton>("logo"); | |||
| logo_button_->setPaths(Paths::unfaLogoFg(), Paths::unfaLogoBg()); | |||
| addAndMakeVisible(logo_button_.get()); | |||
| addOpenGlComponent(logo_button_->getImageComponent()); | |||
| logo_button_->addListener(this); | |||
| @@ -87,7 +125,11 @@ void LogoSection::resized() { | |||
| logo_button_->setBounds(logo_padding_x, logo_padding_y, logo_height, logo_height); | |||
| } | |||
| void LogoSection::paintBackground(Graphics&) { | |||
| void LogoSection::paintBackground(Graphics& g) { | |||
| if (logo_button_) { | |||
| logo_button_->setRingColors(findColour(Skin::kWidgetPrimary1, true), findColour(Skin::kWidgetPrimary2, true)); | |||
| logo_button_->setLetterColors(findColour(Skin::kWidgetSecondary1, true), findColour(Skin::kWidgetSecondary2, true)); | |||
| } | |||
| } | |||
| void LogoSection::buttonClicked(Button* clicked_button) { | |||
| @@ -112,16 +112,30 @@ class LoadingWheel : public OpenGlQuad { | |||
| class AppLogo : public OpenGlImageComponent { | |||
| public: | |||
| AppLogo(String name) : OpenGlImageComponent(std::move(name)) { | |||
| logo_ = Paths::vitaliumLogo(); | |||
| logo_letter_ = Paths::unfaLogoFg(); | |||
| logo_ring_ = Paths::unfaLogoBg(); | |||
| } | |||
| void paint(Graphics& g) override { | |||
| logo_->setTransformToFit(getLocalBounds().toFloat(), RectanglePlacement::stretchToFit); | |||
| logo_->draw(g, 1.0f); | |||
| logo_letter_.applyTransform(logo_letter_.getTransformToScaleToFit(getLocalBounds().toFloat(), true)); | |||
| logo_ring_.applyTransform(logo_ring_.getTransformToScaleToFit(getLocalBounds().toFloat(), true)); | |||
| Colour letter_top_color = findColour(Skin::kWidgetSecondary1, true); | |||
| Colour letter_bottom_color = findColour(Skin::kWidgetSecondary2, true); | |||
| Colour ring_top_color = findColour(Skin::kWidgetPrimary1, true); | |||
| Colour ring_bottom_color = findColour(Skin::kWidgetPrimary2, true); | |||
| ColourGradient letter_gradient(letter_top_color, 0.0f, 12.0f, letter_bottom_color, 0.0f, 96.0f, false); | |||
| ColourGradient ring_gradient(ring_top_color, 0.0f, 12.0f, ring_bottom_color, 0.0f, 96.0f, false); | |||
| g.setGradientFill(letter_gradient); | |||
| g.fillPath(logo_letter_); | |||
| g.setGradientFill(ring_gradient); | |||
| g.fillPath(logo_ring_); | |||
| } | |||
| private: | |||
| std::unique_ptr<Drawable> logo_; | |||
| Path logo_letter_; | |||
| Path logo_ring_; | |||
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AppLogo) | |||
| }; | |||
| @@ -24,7 +24,7 @@ | |||
| class Paths { | |||
| public: | |||
| static constexpr int kLogoWidth = 1701; | |||
| static constexpr int kLogoWidth = 467; | |||
| Paths() = delete; | |||
| @@ -33,9 +33,18 @@ class Paths { | |||
| return drawable->getOutlineAsPath(); | |||
| } | |||
| static std::unique_ptr<Drawable> vitaliumLogo() { | |||
| return Drawable::createFromImageData((const void*)BinaryData::vitaliumunfa_png, | |||
| BinaryData::vitaliumunfa_pngSize); | |||
| static Path unfaLogoBg() { | |||
| Path path = fromSvgData((const void*)BinaryData::vitaliumunfabg_svg, BinaryData::vitaliumunfabg_svgSize); | |||
| path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f); | |||
| path.addLineSegment(Line<float>(kLogoWidth, kLogoWidth, kLogoWidth, kLogoWidth), 0.2f); | |||
| return path; | |||
| } | |||
| static Path unfaLogoFg() { | |||
| Path path = fromSvgData((const void*)BinaryData::vitaliumunfafg_svg, BinaryData::vitaliumunfafg_svgSize); | |||
| path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f); | |||
| path.addLineSegment(Line<float>(kLogoWidth, kLogoWidth, kLogoWidth, kLogoWidth), 0.2f); | |||
| return path; | |||
| } | |||
| static Path chorus() { | |||