initial attempt at GUI
This commit is contained in:
parent
cdca13f412
commit
c722ee7e96
@ -28,6 +28,7 @@
|
||||
#define DISTRHO_PLUGIN_IS_RT_SAFE 1
|
||||
|
||||
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1
|
||||
#define DISTRHO_PLUGIN_HAS_UI 1
|
||||
|
||||
enum Parameters {
|
||||
paramProg,
|
||||
|
@ -15,9 +15,18 @@ FILES_DSP = \
|
||||
chassis.cpp \
|
||||
voice.cpp
|
||||
|
||||
FILES_UI = \
|
||||
back.cpp \
|
||||
ui.cpp \
|
||||
DistrhoArtworkNekobi.cpp
|
||||
|
||||
UI_TYPE = generic
|
||||
USE_FILE_BROWSER = false
|
||||
SKIP_NATIVE_AUDIO_FALLBACK = true
|
||||
|
||||
include ../dpf/Makefile.plugins.mk
|
||||
|
||||
TARGETS += jack lv2
|
||||
TARGETS += jack lv2_sep
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
|
19800
plugin/back.cpp
Normal file
19800
plugin/back.cpp
Normal file
File diff suppressed because it is too large
Load Diff
9
plugin/back.hpp
Normal file
9
plugin/back.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace Artwork {
|
||||
extern const char *backgroundData;
|
||||
const uint32_t backgroundDataSize = 677980;
|
||||
const uint32_t backgroundWidth = 545;
|
||||
const uint32_t backgroundHeight = 311;
|
||||
} // namespace Artwork
|
34
plugin/ui.cpp
Normal file
34
plugin/ui.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
#include "ui.hpp"
|
||||
|
||||
#include "DistrhoArtworkNekobi.hpp"
|
||||
#include "back.hpp"
|
||||
|
||||
START_NAMESPACE_DISTRHO
|
||||
|
||||
namespace Art = Artwork;
|
||||
|
||||
DistrhoUIchassis::DistrhoUIchassis() : UI(Art::backgroundWidth, Art::backgroundHeight, true),
|
||||
// UI
|
||||
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatRGBA)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
void DistrhoUIchassis::programLoaded(uint32_t index) {
|
||||
printf("in programLoaded %d\n", index);
|
||||
}
|
||||
void DistrhoUIchassis::parameterChanged(uint32_t index, float value) {
|
||||
printf("in parameterchanged %d %f\n", index, value);
|
||||
}
|
||||
|
||||
void DistrhoUIchassis::onDisplay() {
|
||||
const GraphicsContext& context(getGraphicsContext());
|
||||
fImgBackground.draw(context);
|
||||
};
|
||||
|
||||
UI* createUI() {
|
||||
return new DistrhoUIchassis();
|
||||
}
|
||||
|
||||
END_NAMESPACE_DISTRHO
|
25
plugin/ui.hpp
Normal file
25
plugin/ui.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "DistrhoUI.hpp"
|
||||
#include "ImageWidgets.hpp"
|
||||
|
||||
START_NAMESPACE_DISTRHO
|
||||
|
||||
class DistrhoUIchassis : public UI {
|
||||
public:
|
||||
DistrhoUIchassis();
|
||||
|
||||
protected:
|
||||
void parameterChanged(uint32_t index, float value) override;
|
||||
void programLoaded(uint32_t index) override;
|
||||
void onDisplay() override;
|
||||
|
||||
private:
|
||||
Image fImgBackground;
|
||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIchassis)
|
||||
// ImageAboutWindow fAboutWindow;
|
||||
|
||||
};
|
||||
|
||||
END_NAMESPACE_DISTRHO
|
||||
|
Loading…
Reference in New Issue
Block a user