Ajout octaver
This commit is contained in:
1 parent
faef8f3673
commit
10c023cc3c
12 files changed
+701
-5
No files matched your search
@@ -0,0 +1,36 @@
|
||||
#ifndef OCTAVERPRESENTER_HPP
|
||||
#define OCTAVERPRESENTER_HPP
|
||||
|
||||
#include <gui/model/ModelListener.hpp>
|
||||
#include <mvp/Presenter.hpp>
|
||||
|
||||
using namespace touchgfx;
|
||||
|
||||
class OctaverView;
|
||||
|
||||
class OctaverPresenter : public touchgfx::Presenter, public ModelListener
|
||||
{
|
||||
public:
|
||||
OctaverPresenter(OctaverView& v);
|
||||
|
||||
/**
|
||||
* The activate function is called automatically when this screen is "switched in"
|
||||
* (ie. made active). Initialization logic can be placed here.
|
||||
*/
|
||||
virtual void activate();
|
||||
|
||||
/**
|
||||
* The deactivate function is called automatically when this screen is "switched out"
|
||||
* (ie. made inactive). Teardown functionality can be placed here.
|
||||
*/
|
||||
virtual void deactivate();
|
||||
|
||||
virtual ~OctaverPresenter() {}
|
||||
|
||||
private:
|
||||
OctaverPresenter();
|
||||
|
||||
OctaverView& view;
|
||||
};
|
||||
|
||||
#endif // OCTAVERPRESENTER_HPP
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef OCTAVERVIEW_HPP
|
||||
#define OCTAVERVIEW_HPP
|
||||
|
||||
#include <gui_generated/octaver_screen/OctaverViewBase.hpp>
|
||||
#include <gui/octaver_screen/OctaverPresenter.hpp>
|
||||
|
||||
class OctaverView : public OctaverViewBase
|
||||
{
|
||||
public:
|
||||
OctaverView();
|
||||
virtual ~OctaverView() {}
|
||||
virtual void setupScreen();
|
||||
virtual void tearDownScreen();
|
||||
|
||||
virtual void toggleClicked();
|
||||
virtual void slider1Clicked(int value);
|
||||
virtual void slider2Clicked(int value);
|
||||
virtual void slider3Clicked(int value);
|
||||
virtual void slider4Clicked(int value);
|
||||
virtual void slider5Clicked(int value);
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif // OCTAVERVIEW_HPP
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <gui/octaver_screen/OctaverView.hpp>
|
||||
#include <gui/octaver_screen/OctaverPresenter.hpp>
|
||||
|
||||
OctaverPresenter::OctaverPresenter(OctaverView& v)
|
||||
: view(v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OctaverPresenter::activate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OctaverPresenter::deactivate()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#include <gui/octaver_screen/OctaverView.hpp>
|
||||
#include <audio_effects.h>
|
||||
|
||||
OctaverView::OctaverView()
|
||||
{
|
||||
}
|
||||
|
||||
void OctaverView::setupScreen()
|
||||
{
|
||||
OctaverViewBase::setupScreen();
|
||||
toggleButton1.forceState(AudioEffects_GetParams()->octaver.enabled);
|
||||
slider1.setValue((int16_t)(AudioEffects_GetParams()->octaver.level_down2 * 100.0f));
|
||||
slider2.setValue((int16_t)(AudioEffects_GetParams()->octaver.level_down1 * 100.0f));
|
||||
slider3.setValue((int16_t)(AudioEffects_GetParams()->octaver.level_dry * 100.0f));
|
||||
slider4.setValue((int16_t)(AudioEffects_GetParams()->octaver.level_up1 * 100.0f));
|
||||
slider5.setValue((int16_t)(AudioEffects_GetParams()->octaver.level_up2 * 100.0f));
|
||||
}
|
||||
|
||||
void OctaverView::tearDownScreen()
|
||||
{
|
||||
OctaverViewBase::tearDownScreen();
|
||||
}
|
||||
|
||||
void OctaverView::toggleClicked()
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.enabled = toggleButton1.getState();
|
||||
}
|
||||
|
||||
void OctaverView::slider1Clicked(int value)
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.level_down2 = value / 100.0f;
|
||||
}
|
||||
void OctaverView::slider2Clicked(int value)
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.level_down1 = value / 100.0f;
|
||||
}
|
||||
void OctaverView::slider3Clicked(int value)
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.level_dry = value / 100.0f;
|
||||
}
|
||||
void OctaverView::slider4Clicked(int value)
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.level_up1 = value / 100.0f;
|
||||
}
|
||||
void OctaverView::slider5Clicked(int value)
|
||||
{
|
||||
AudioEffects_GetParams()->octaver.level_up2 = value / 100.0f;
|
||||
}
|
||||
Reference in new issue
Block a user