Skip to content

Commit

Permalink
Ready for first v2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
kockie69 committed Sep 28, 2021
1 parent e9ce9f5 commit adee5b9
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"slug": "RPJ",
"name": "RPJ",
"version": "2.0.5",
"version": "2.0.0",
"license": "GPL-3.0-or-later",
"brand": "RPJ",
"author": "Robert Kock",
Expand Down
7 changes: 4 additions & 3 deletions src/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ void Display::setEnd(float endRatio) {
}

void Display::setDisplayBuff(float begin, float end, vector<vector<float>> playBuffer) {
if (((end-begin)/width)>=1) {
if (abs(((end-begin)/width))>=1) {
vector<double>().swap(displayBuff);

for (int i=floor(begin); i < floor(end); i = i + floor((end-begin)/width)) {
float q = playBuffer[0][i];
displayBuff.push_back(playBuffer[0][i]);
}
}
float q = displayBuff.size();
}

void Display::draw(const DrawArgs &args) {
nvgGlobalTint(args.vg, color::WHITE);
if (fontPath!="") {
std::shared_ptr<Font> font = APP->window->loadFont(fontPath);
nvgFontSize(args.vg, 12);
Expand Down Expand Up @@ -102,7 +104,6 @@ void Display::draw(const DrawArgs &args) {
for (unsigned int i = 0; i < displayBuff.size(); i++) {
float x, y;
x = (float)i / (displayBuff.size() - 1);
float q = displayBuff.size();
y = displayBuff[i] + 0.5;
Vec p;
p.x = b.pos.x + b.size.x * x;
Expand Down
10 changes: 10 additions & 0 deletions src/RPJ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ struct buttonPlusSmall : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ButtonPlus_0.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ButtonPlus_1.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};

struct buttonMinSmall : SvgSwitch {
Expand All @@ -84,6 +89,11 @@ struct buttonMinSmall : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ButtonMin_0.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ButtonMin_1.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};


37 changes: 36 additions & 1 deletion src/TuxOn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ void TuxOn::process(const ProcessArgs &args) {
adp.begin = getBegin();
adp.end = getEnd();


if (params[PARAM_FWD].getValue())
audio.forward(stepSize());
if (params[PARAM_RWD].getValue())
Expand Down Expand Up @@ -148,6 +147,11 @@ void TuxOn::process(const ProcessArgs &args) {

if (zoominTrigger.process((bool)params[PARAM_ZOOMIN].getValue())) {

if (endRatio < beginRatio) {
float temp = beginRatio;
beginRatio = endRatio;
endRatio = temp;
}
zoom++;
zoomParameters.push_back(zoomParameter());
zoomParameters[zoom].begin=zoomParameters[zoom-1].begin+zoomParameters[zoom-1].totalPCMFrameCount*beginRatio/1024;
Expand Down Expand Up @@ -200,6 +204,11 @@ struct StartButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Start_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Start_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};

struct StopButton : SvgSwitch {
Expand All @@ -209,6 +218,11 @@ struct StopButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Stop_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Stop_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};

struct PauseButton : SvgSwitch {
Expand All @@ -217,6 +231,11 @@ struct PauseButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Pause_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Pause_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};


Expand All @@ -226,6 +245,11 @@ struct FwdButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Fwd_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Fwd_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};

struct RwdButton : SvgSwitch {
Expand All @@ -234,6 +258,11 @@ struct RwdButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Rwd_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Rwd_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};

struct EjectButton : SvgSwitch {
Expand All @@ -242,6 +271,11 @@ struct EjectButton : SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Ejct_Off.svg")));
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Buttons/Ejct_On.svg")));
}

void draw(const DrawArgs &args)override {
nvgGlobalTint(args.vg, color::WHITE);
SvgSwitch::draw(args);
}
};


Expand Down Expand Up @@ -272,6 +306,7 @@ void ButtonSVG::addFrame(std::shared_ptr<Svg> svg) {
}

void ButtonSVG::draw(const DrawArgs &args) {
nvgGlobalTint(args.vg, color::WHITE);
if (module) {
// Bit weird check, shouldn't that be module->start ?
if (!(module->buttonToDisplay == START && !module->audio.fileLoaded)) {
Expand Down
5 changes: 3 additions & 2 deletions src/VuMeters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ void VuMeterBase::processPeakHold() {// use APP->window->getLastFrameRate()
}

void VuMeterBase::draw(const DrawArgs &args) {

processPeakHold();

setColor();

nvgGlobalTint(args.vg, color::WHITE);

// PEAK
drawVu(args, VuMeterAllDual::getPeak(srcLevels, 0), 0, 0);
drawVu(args, VuMeterAllDual::getPeak(srcLevels, 1), barX + gapX, 0);
Expand All @@ -61,7 +63,6 @@ void VuMeterBase::draw(const DrawArgs &args) {
drawPeakHold(args, peakHold[0], 0);
drawPeakHold(args, peakHold[1], barX + gapX);


Widget::draw(args);
}

Expand Down

0 comments on commit adee5b9

Please sign in to comment.