-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d86786
commit f220bb6
Showing
9 changed files
with
227 additions
and
2 deletions.
There are no files selected for viewing
Submodule RemixIcon
updated
2966 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
#include "ControllerComponent.h" | ||
#include "../lookAndFeel/LookAndFeelFactory.h" | ||
#include "../Utils.h" | ||
#include <IconManager.h> | ||
|
||
ControllerComponent::ControllerComponent() { | ||
/** Look And Feel */ | ||
this->setLookAndFeel( | ||
LookAndFeelFactory::getInstance()->forController()); | ||
|
||
/** Icons */ | ||
this->playIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Media", "play-fill").getFullPathName()); | ||
this->playIcon->replaceColour(juce::Colours::black, juce::Colours::green); | ||
this->pauseIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Media", "pause-fill").getFullPathName()); | ||
this->pauseIcon->replaceColour(juce::Colours::black, | ||
this->getLookAndFeel().findColour(juce::TextButton::ColourIds::textColourOffId)); | ||
this->stopIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Media", "stop-fill").getFullPathName()); | ||
this->stopIcon->replaceColour(juce::Colours::black, | ||
this->getLookAndFeel().findColour(juce::TextButton::ColourIds::textColourOffId)); | ||
this->recordIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Design", "circle-fill").getFullPathName()); | ||
this->recordIcon->replaceColour(juce::Colours::black, juce::Colours::darkred); | ||
this->recordOnIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Design", "circle-fill").getFullPathName()); | ||
this->recordOnIcon->replaceColour(juce::Colours::black, juce::Colours::red); | ||
|
||
this->rewindIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Media", "skip-back-fill").getFullPathName()); | ||
this->rewindIcon->replaceColour(juce::Colours::black, | ||
this->getLookAndFeel().findColour(juce::TextButton::ColourIds::textColourOffId)); | ||
this->followIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Arrows", "arrow-right-fill").getFullPathName()); | ||
this->followIcon->replaceColour(juce::Colours::black, | ||
this->getLookAndFeel().findColour(juce::TextButton::ColourIds::textColourOffId)); | ||
this->followOnIcon = flowUI::IconManager::getSVG( | ||
utils::getIconFile("Arrows", "arrow-right-fill").getFullPathName()); | ||
this->followOnIcon->replaceColour(juce::Colours::black, | ||
this->getLookAndFeel().findColour(juce::TextButton::ColourIds::textColourOnId)); | ||
|
||
/** Buttons */ | ||
this->playButton = std::make_unique<juce::DrawableButton>( | ||
TRANS("Play/Pause"), juce::DrawableButton::ButtonStyle::ImageOnButtonBackgroundOriginalSize); | ||
this->playButton->setImages( | ||
this->playIcon.get(), nullptr, nullptr, nullptr, | ||
this->pauseIcon.get(), nullptr, nullptr, nullptr); | ||
this->playButton->setWantsKeyboardFocus(false); | ||
this->playButton->setMouseCursor(juce::MouseCursor::PointingHandCursor); | ||
this->addAndMakeVisible(this->playButton.get()); | ||
|
||
this->stopButton = std::make_unique<juce::DrawableButton>( | ||
TRANS("Stop"), juce::DrawableButton::ButtonStyle::ImageOnButtonBackgroundOriginalSize); | ||
this->stopButton->setImages(this->stopIcon.get()); | ||
this->stopButton->setWantsKeyboardFocus(false); | ||
this->stopButton->setMouseCursor(juce::MouseCursor::PointingHandCursor); | ||
this->addAndMakeVisible(this->stopButton.get()); | ||
|
||
this->recordButton = std::make_unique<juce::DrawableButton>( | ||
TRANS("Record"), juce::DrawableButton::ButtonStyle::ImageOnButtonBackgroundOriginalSize); | ||
this->recordButton->setImages( | ||
this->recordIcon.get(), nullptr, nullptr, nullptr, | ||
this->recordOnIcon.get(), nullptr, nullptr, nullptr); | ||
this->recordButton->setWantsKeyboardFocus(false); | ||
this->recordButton->setMouseCursor(juce::MouseCursor::PointingHandCursor); | ||
this->addAndMakeVisible(this->recordButton.get()); | ||
|
||
this->rewindButton = std::make_unique<juce::DrawableButton>( | ||
TRANS("Rewind"), juce::DrawableButton::ButtonStyle::ImageOnButtonBackgroundOriginalSize); | ||
this->rewindButton->setImages(this->rewindIcon.get()); | ||
this->rewindButton->setWantsKeyboardFocus(false); | ||
this->rewindButton->setMouseCursor(juce::MouseCursor::PointingHandCursor); | ||
this->addAndMakeVisible(this->rewindButton.get()); | ||
|
||
this->followButton = std::make_unique<juce::DrawableButton>( | ||
TRANS("Follow"), juce::DrawableButton::ButtonStyle::ImageOnButtonBackgroundOriginalSize); | ||
this->followButton->setImages( | ||
this->followIcon.get(), nullptr, nullptr, nullptr, | ||
this->followOnIcon.get(), nullptr, nullptr, nullptr); | ||
this->followButton->setWantsKeyboardFocus(false); | ||
this->followButton->setMouseCursor(juce::MouseCursor::PointingHandCursor); | ||
this->addAndMakeVisible(this->followButton.get()); | ||
} | ||
|
||
void ControllerComponent::resized() { | ||
auto screenSize = utils::getScreenSize(this); | ||
|
||
/** Size */ | ||
int paddingHeight = this->getHeight() * 0.1; | ||
int paddingWidth = this->getHeight() * 0.1; | ||
int splitHeight = this->getHeight() * 0.05; | ||
int splitWidth = this->getHeight() * 0.05; | ||
|
||
int rightPos = this->getWidth() - paddingWidth; | ||
int buttonHeight = this->getHeight() * 0.6; | ||
|
||
/** Record Button */ | ||
this->recordButton->setBounds( | ||
rightPos - buttonHeight, this->getHeight() / 2 - buttonHeight / 2, | ||
buttonHeight, buttonHeight); | ||
rightPos -= buttonHeight; | ||
rightPos -= splitWidth; | ||
|
||
/** Stop Button */ | ||
this->stopButton->setBounds( | ||
rightPos - buttonHeight, this->getHeight() / 2 - buttonHeight / 2, | ||
buttonHeight, buttonHeight); | ||
rightPos -= buttonHeight; | ||
rightPos -= splitWidth; | ||
|
||
/** Play Button */ | ||
this->playButton->setBounds( | ||
rightPos - buttonHeight, this->getHeight() / 2 - buttonHeight / 2, | ||
buttonHeight, buttonHeight); | ||
rightPos -= buttonHeight; | ||
rightPos -= splitWidth; | ||
|
||
/** Rewind Button */ | ||
this->rewindButton->setBounds( | ||
rightPos - buttonHeight, this->getHeight() / 2 - buttonHeight / 2, | ||
buttonHeight, buttonHeight); | ||
rightPos -= buttonHeight; | ||
rightPos -= splitWidth; | ||
|
||
/** Follow Button */ | ||
this->followButton->setBounds( | ||
rightPos - buttonHeight, this->getHeight() / 2 - buttonHeight / 2, | ||
buttonHeight, buttonHeight); | ||
rightPos -= buttonHeight; | ||
rightPos -= splitWidth; | ||
} | ||
|
||
void ControllerComponent::paint(juce::Graphics& g) { | ||
/** Nothing To Do */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <JuceHeader.h> | ||
|
||
class ControllerComponent final : public juce::Component { | ||
public: | ||
ControllerComponent(); | ||
|
||
void resized() override; | ||
void paint(juce::Graphics& g) override; | ||
|
||
private: | ||
std::unique_ptr<juce::DrawableButton> playButton = nullptr; | ||
std::unique_ptr<juce::DrawableButton> stopButton = nullptr; | ||
std::unique_ptr<juce::DrawableButton> recordButton = nullptr; | ||
|
||
std::unique_ptr<juce::DrawableButton> rewindButton = nullptr; | ||
std::unique_ptr<juce::DrawableButton> followButton = nullptr; | ||
|
||
std::unique_ptr<juce::Drawable> playIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> pauseIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> stopIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> recordIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> recordOnIcon = nullptr; | ||
|
||
std::unique_ptr<juce::Drawable> rewindIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> followIcon = nullptr; | ||
std::unique_ptr<juce::Drawable> followOnIcon = nullptr; | ||
|
||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ControllerComponent) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters