commit 538280dada3ca43fc5368bf7e64a55b877d4408d
parent 0ce820b39e8dd4aebe97810f781e353688e7f603
Author: Adam M <[email protected]>
Date: Tue, 26 Jan 2021 21:33:51 -0600
bork animation end action, use next file action instead. next button
Diffstat:
5 files changed, 281 insertions(+), 34 deletions(-)
diff --git a/res/computerscare-next-button-down.svg b/res/computerscare-next-button-down.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="10mm"
+ height="5mm"
+ viewBox="0 0 10 5"
+ version="1.1"
+ id="svg890"
+ inkscape:version="1.0.1 (c497b03c, 2020-09-10)"
+ sodipodi:docname="computerscare-next-button-down.svg">
+ <defs
+ id="defs884" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.839192"
+ inkscape:cx="21.741072"
+ inkscape:cy="6.1409295"
+ inkscape:document-units="mm"
+ inkscape:current-layer="text1460"
+ showgrid="false"
+ units="mm"
+ inkscape:window-width="1440"
+ inkscape:window-height="855"
+ inkscape:window-x="0"
+ inkscape:window-y="23"
+ inkscape:window-maximized="1"
+ inkscape:snap-global="false"
+ inkscape:document-rotation="0" />
+ <metadata
+ id="metadata887">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-292)">
+ <g
+ aria-label="rst"
+ style="font-style:normal;font-weight:normal;font-size:6.29599571px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.15739989"
+ id="text1460">
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:connector-curvature="0"
+ id="path2434"
+ d="m 0.95659426,292.68898 -0.0111558,3.91358 8.14423548,0.19878 -0.034522,-4.03983 z"
+ style="fill:#848484;fill-opacity:1;stroke:#000000;stroke-width:0.25272471;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#dedede;fill-opacity:1;stroke:#000000;stroke-width:0.03266888;stroke-opacity:1"
+ d="m 1.6845928,293.59372 7.2968297,0.2008 -0.011812,2.89105 -7.285018,-0.18899 z"
+ id="rect2390"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#adadad;fill-opacity:1;stroke:#000000;stroke-width:0.13618915;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 0.90968224,292.76446 0.73334076,0.86093 0.011269,2.93259 -0.70917519,-0.02 z"
+ id="path2394"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#848484;fill-opacity:1;stroke:#000000;stroke-width:0.1530488;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 1.0451761,292.78158 0.6137626,0.78031 7.388625,0.179 -0.030176,-1.00553 z"
+ id="path2396"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ d="m 3.3746397,296.75578 -0.3033235,-0.0201 0.069097,-1.54094 q 0.00837,-0.18657 0.00112,-0.34985 -0.00714,-0.16573 -0.041727,-0.26035 -0.035774,-0.10447 -0.1094302,-0.15792 -0.07355,-0.0559 -0.1945565,-0.0639 -0.1242337,-0.008 -0.2638873,0.0747 -0.1396537,0.083 -0.2702992,0.21779 l -0.090603,2.02063 -0.303324,-0.0201 0.1213546,-2.70633 0.3033234,0.0201 -0.013471,0.30042 q 0.1499118,-0.16745 0.3060282,-0.25674 0.1561147,-0.0893 0.3158435,-0.0787 0.2920293,0.0193 0.4334625,0.2936 0.1414331,0.27426 0.1191611,0.77095 z"
+ style="font-style:normal;font-weight:normal;font-size:3.67761px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0159573"
+ id="path1569" />
+ <path
+ d="M 5.5338373,295.49605 H 4.0413241 q 0,0.23191 0.056218,0.4053 0.056218,0.17115 0.1541478,0.28148 0.094302,0.10813 0.2230609,0.16212 0.1305724,0.054 0.2865336,0.054 0.2067394,0 0.4152922,-0.10135 0.2103665,-0.10358 0.2992281,-0.20266 h 0.018134 v 0.4616 q -0.1722829,0.09 -0.3518196,0.15088 -0.1795367,0.0608 -0.3772085,0.0608 -0.504154,0 -0.7870605,-0.33776 -0.2829065,-0.34001 -0.2829065,-0.96374 0,-0.61697 0.270212,-0.9795 0.2720255,-0.36254 0.7145203,-0.36254 0.4098517,0 0.6310992,0.29723 0.2230607,0.29723 0.2230607,0.8444 z m -0.3318711,-0.32426 q -0.00182,-0.33326 -0.1360128,-0.51564 -0.1323856,-0.1824 -0.4044111,-0.1824 -0.2738391,0 -0.4370543,0.20041 -0.1614019,0.2004 -0.1831639,0.49763 z"
+ style="font-style:normal;font-weight:normal;font-size:3.67761px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0162853"
+ id="path1571" />
+ <path
+ d="M 7.5568425,296.71639 H 7.1738933 l -0.5122145,-0.77914 -0.5154462,0.77914 H 5.7923685 l 0.7044968,-1.01161 -0.6980335,-1.01704 h 0.3829489 l 0.5089829,0.76642 0.5105988,-0.76642 h 0.3554801 l -0.7093445,0.99889 z"
+ style="font-style:normal;font-weight:normal;font-size:3.67761px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0138055"
+ id="path1573" />
+ <path
+ d="m 9.0569361,296.70194 q -0.098232,0.0256 -0.2149986,0.0419 -0.1149125,0.0165 -0.205731,0.0165 -0.3169372,0 -0.4818928,-0.16781 -0.1649555,-0.16781 -0.1649555,-0.53808 v -1.08346 h -0.235386 v -0.28818 h 0.235386 v -0.58558 h 0.3484454 v 0.58552 h 0.7191325 v 0.28819 H 8.3378036 v 0.92841 q 0,0.16052 0.00741,0.25172 0.00741,0.0894 0.051896,0.1678 0.040776,0.073 0.1112059,0.10762 0.072285,0.0328 0.2187054,0.0328 0.085258,0 0.1779294,-0.0238 0.092672,-0.0255 0.1334484,-0.0419 h 0.018534 z"
+ style="font-style:normal;font-weight:normal;font-size:3.67761px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0148177"
+ id="path1575" />
+ </g>
+ </g>
+</svg>
diff --git a/res/computerscare-next-button.svg b/res/computerscare-next-button.svg
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="10mm"
+ height="5mm"
+ viewBox="0 0 10 5"
+ version="1.1"
+ id="svg890"
+ inkscape:version="1.0.1 (c497b03c, 2020-09-10)"
+ sodipodi:docname="computerscare-next-button.svg">
+ <defs
+ id="defs884" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="7.919596"
+ inkscape:cx="39.790474"
+ inkscape:cy="-4.8818861"
+ inkscape:document-units="mm"
+ inkscape:current-layer="text1567"
+ showgrid="false"
+ units="mm"
+ inkscape:window-width="1440"
+ inkscape:window-height="855"
+ inkscape:window-x="0"
+ inkscape:window-y="23"
+ inkscape:window-maximized="1"
+ inkscape:snap-global="false"
+ inkscape:document-rotation="0" />
+ <metadata
+ id="metadata887">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-292)">
+ <g
+ aria-label="rst"
+ style="font-style:normal;font-weight:normal;font-size:6.29599571px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.15739989"
+ id="text1460">
+ <rect
+ style="fill:#dedede;fill-opacity:1;stroke:#000000;stroke-width:0.0391602;stroke-opacity:1"
+ id="rect2390"
+ width="7.7864323"
+ height="3.7822468"
+ x="0.21136901"
+ y="292.08505" />
+ <path
+ style="fill:#adadad;fill-opacity:1;stroke:#000000;stroke-width:0.13618915;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 7.9731123,292.09119 1.1703757,0.58926 0.058516,4.13739 -1.2288925,-1.00035 z"
+ id="path2394"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#848484;fill-opacity:1;stroke:#000000;stroke-width:0.1530488;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 0.3010355,295.89989 0.61376262,0.78031 8.14457738,0.19081 -1.1050461,-1.01734 z"
+ id="path2396"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <g
+ aria-label="next"
+ transform="matrix(0.89982262,0,0,1.1113301,0.10022607,4.1760864)"
+ id="text1567"
+ style="font-style:normal;font-weight:normal;font-size:3.67761px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.0144715">
+ <path
+ d="m 2.1121646,261.98606 -0.3370925,-0.0181 0.07679,-1.38657 q 0.0093,-0.16788 0.00125,-0.31481 -0.00793,-0.14912 -0.046372,-0.23427 -0.039757,-0.094 -0.1216131,-0.1421 -0.081738,-0.0503 -0.2162165,-0.0575 -0.1380646,-0.007 -0.2932659,0.0672 -0.1552014,0.0747 -0.30039165,0.19598 l -0.10069626,1.81824 -0.33709313,-0.0181 0.13486502,-2.43522 0.33709244,0.0181 -0.0149711,0.27033 q 0.16660148,-0.15068 0.34009828,-0.23102 0.173495,-0.0804 0.3510065,-0.0708 0.324541,0.0174 0.48172,0.26419 0.1571788,0.24678 0.1324273,0.69372 z"
+ style="stroke-width:0.0159573"
+ id="path1569" />
+ <path
+ d="M 4.511746,260.85253 H 2.8530711 q 0,0.20868 0.062477,0.3647 0.062477,0.154 0.1713091,0.25328 0.104801,0.0973 0.2478943,0.14588 0.1451089,0.0486 0.3184334,0.0486 0.2297557,0 0.4615267,-0.0912 0.2337865,-0.0932 0.3325411,-0.18236 h 0.020154 v 0.41536 q -0.1914632,0.081 -0.3909879,0.13577 -0.1995246,0.0547 -0.4192033,0.0547 -0.5602814,0 -0.8746839,-0.30393 -0.3144025,-0.30595 -0.3144025,-0.86719 0,-0.55517 0.3002947,-0.88138 0.3023101,-0.32622 0.7940679,-0.32622 0.4554806,0 0.7013595,0.26745 0.2478943,0.26746 0.2478943,0.75981 z m -0.3688184,-0.29178 q -0.00202,-0.29987 -0.1511551,-0.46398 -0.1471242,-0.16413 -0.4494343,-0.16413 -0.3043256,0 -0.4857116,0.18033 -0.1793707,0.18033 -0.2035555,0.44778 z"
+ style="stroke-width:0.0162853"
+ id="path1571" />
+ <path
+ d="M 6.7599726,261.95062 H 6.3343898 l -0.5692395,-0.70109 -0.5728308,0.70109 h -0.39326 l 0.7829286,-0.91027 -0.7757458,-0.91516 h 0.4255828 l 0.565648,0.68965 0.5674437,-0.68965 h 0.3950558 l -0.7883158,0.89883 z"
+ style="stroke-width:0.0138055"
+ id="path1573" />
+ <path
+ d="m 8.4270718,261.93135 q -0.1091687,0.0257 -0.2389342,0.0422 -0.127706,0.0166 -0.2286351,0.0166 -0.3522219,0 -0.535542,-0.169 -0.1833202,-0.16899 -0.1833202,-0.54188 v -1.09111 H 6.9790487 v -0.29022 h 0.2615916 v -0.58965 h 0.3872381 v 0.58965 h 0.7991934 v 0.29022 H 7.6278784 v 0.93497 q 0,0.16166 0.00824,0.2535 0.00824,0.09 0.057674,0.16899 0.045316,0.0735 0.1235866,0.10837 0.080332,0.033 0.2430538,0.033 0.09475,0 0.1977385,-0.0239 0.1029884,-0.0257 0.148304,-0.0422 h 0.020598 z"
+ style="stroke-width:0.0156758"
+ id="path1575" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp
@@ -199,6 +199,13 @@ struct ComputerscareResetButton : app::SvgSwitch {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-rst-text-red.svg")));
}
};
+struct ComputerscareNextButton : app::SvgSwitch {
+ ComputerscareNextButton() {
+ momentary = true;
+ addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-next-button.svg")));
+ addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-next-button-down.svg")));
+ }
+};
struct ComputerscareClearButton : app::SvgSwitch {
ComputerscareClearButton() {
momentary = true;
diff --git a/src/ComputerscareBlank.cpp b/src/ComputerscareBlank.cpp
@@ -83,21 +83,26 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
int clockMode = CLOCK_MODE_SYNC;
bool clockConnected = false;
bool resetConnected = false;
- bool speedConnected = false;
+ bool nextFileInputConnected = false;
std::vector<std::string> animationModeDescriptions;
std::vector<std::string> endBehaviorDescriptions;
+ std::vector<std::string> nextFileDescriptions;
+
dsp::SchmittTrigger clockTrigger;
dsp::SchmittTrigger resetTrigger;
dsp::SchmittTrigger resetButtonTrigger;
+ dsp::SchmittTrigger nextFileTrigger;
+ dsp::SchmittTrigger nextFileButtonTrigger;
+
dsp::Timer syncTimer;
ComputerscareSVGPanel* panelRef;
- float leftMessages[2][10] = {};
+ float leftMessages[2][11] = {};
enum ClockModes {
CLOCK_MODE_SYNC,
@@ -112,6 +117,7 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
ANIMATION_MODE,
END_BEHAVIOR,
SHUFFLE_SEED,
+ NEXT_FILE_BEHAVIOR,
NUM_PARAMS
};
enum InputIds {
@@ -138,13 +144,17 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
endBehaviorDescriptions.push_back("Load Next");
endBehaviorDescriptions.push_back("Load Previous");
+ nextFileDescriptions.push_back("Load Next (Alphabetical) File in Directory");
+ nextFileDescriptions.push_back("Load Previous (Alphabetical) File in Directory");
+ nextFileDescriptions.push_back("Load Random File from Directory");
+
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
configMenuParam(ANIMATION_SPEED, 0.05f, 20.f, 1.f, "Animation Speed", 2, "x");
configParam(ANIMATION_ENABLED, 0.f, 1.f, 1.f, "Animation Enabled");
configParam(CONSTANT_FRAME_DELAY, 0.f, 1.f, 0.f, "Constant Frame Delay");
configMenuParam(ANIMATION_MODE, 0.f, "Animation Mode", animationModeDescriptions);
- configMenuParam(END_BEHAVIOR, 0.f, "Animation End Behavior", endBehaviorDescriptions);
+ configMenuParam(NEXT_FILE_BEHAVIOR, 0.f, "Next File Trigger / Button Behavior", nextFileDescriptions);
configMenuParam(SHUFFLE_SEED, 0.f, 1.f, 0.5f, "Shuffle Seed", 2);
paths.push_back("empty");
@@ -172,6 +182,8 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
samplesDelay = frameDelay * args.sampleRate;
bool shouldAdvanceAnimation = false;
+ bool clockTriggered = false;
+
if (ready && leftExpander.module && leftExpander.module->model == modelComputerscareBlankExpander) {
expanderConnected = true;
// me
@@ -182,7 +194,7 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
clockMode = messageFromExpander[0];
clockConnected = messageFromExpander[1];
resetConnected = messageFromExpander[3];
- speedConnected = messageFromExpander[5];
+ nextFileInputConnected = messageFromExpander[5];
zeroOffset = messageFromExpander[7];
@@ -193,7 +205,7 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
updateScrubFrame();
if (clockConnected) {
- bool clockTriggered = clockTrigger.process(messageFromExpander[2]);
+ clockTriggered = clockTrigger.process(messageFromExpander[2]);
if (clockMode == CLOCK_MODE_SYNC) {
//sync
float currentSyncTime = syncTimer.process(args.sampleTime);
@@ -217,6 +229,16 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
}
}
+ if (nextFileInputConnected) {
+ if (nextFileTrigger.process(messageFromExpander[6])) {
+ checkAndPerformEndAction(true);
+ }
+ }
+
+ if (nextFileButtonTrigger.process(messageFromExpander[10])) {
+ checkAndPerformEndAction(true);
+ }
+
if (resetConnected) {
if (resetTrigger.process(messageFromExpander[4])) {
goToFrame(0);
@@ -248,8 +270,18 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
shouldAdvanceAnimation = true;
}
}
- if (params[ANIMATION_ENABLED].getValue() && shouldAdvanceAnimation) {
- tickAnimation();
+ if (numFrames > 1) {
+ if (params[ANIMATION_ENABLED].getValue() && shouldAdvanceAnimation) {
+ tickAnimation();
+ //checkAndPerformEndAction();
+ }
+ }
+ else {
+ if ((clockTriggered && (clockConnected && clockMode == CLOCK_MODE_SYNC)) || numFrames > 1) {
+ if (currentFrame == 0) {
+ //checkAndPerformEndAction();
+ }
+ }
}
}
@@ -318,7 +350,6 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
}
void loadNewFileByIndex() {
- DEBUG("numFilesInCatalog:%i", numFilesInCatalog);
if (numFilesInCatalog > 0) {
setPath(catalog[fileIndexInCatalog]);
}
@@ -357,7 +388,6 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
currentFrame = 0;
}
void setFrameCount(int frameCount) {
- DEBUG("setting frame count %i", frameCount);
numFrames = frameCount;
}
void setImageStatus(int status) {
@@ -499,30 +529,27 @@ struct ComputerscareBlank : ComputerscareMenuParamModule {
}
}
- checkAndPerformEndAction();
-
float shuf = params[SHUFFLE_SEED].getValue();
if (shuf != lastShuffle) {
- DEBUG("reshuffle!!!");
setFrameShuffle();
}
lastShuffle = shuf;
//DEBUG("current:%i, samplesDelay:%i", currentFrame, samplesDelay);
}
}
- void checkAndPerformEndAction() {
- if (currentFrame == 0) {
- int eb = params[END_BEHAVIOR].getValue();
+ void checkAndPerformEndAction(bool forceEndAction = false) {
+ if (currentFrame == 0 || forceEndAction) {
+ int eb = params[NEXT_FILE_BEHAVIOR].getValue();
- if (eb == 2 ) {
- loadRandomGif();
- }
- else if (eb == 3) {
+ if (eb == 0) {
nextFileInCatalog();
}
- else if (eb == 4) {
+ else if (eb == 1) {
prevFileInCatalog();
}
+ else if (eb == 2 ) {
+ loadRandomGif();
+ }
}
}
void setCurrentFrameDelayFromTable() {
@@ -893,10 +920,9 @@ struct GiantFrameDisplay : TransparentWidget {
TransparentWidget::step();
}
void draw(const DrawArgs &args) {
- if (!module) {
- visible = false;
+ if (module) {
+ TransparentWidget::draw(args);
}
- TransparentWidget::draw(args);
}
};
@@ -960,10 +986,10 @@ struct ComputerscareBlankWidget : MenuParamModuleWidget {
modeMenu->options = blankModule->animationModeDescriptions;
endMenu = new ParamSelectMenu();
- endMenu->text = "Animation End Behavior";
+ endMenu->text = "Next File Trigger / Button Behavior";
endMenu->rightText = RIGHT_ARROW;
- endMenu->param = blankModule->paramQuantities[ComputerscareBlank::END_BEHAVIOR];
- endMenu->options = blankModule->endBehaviorDescriptions;
+ endMenu->param = blankModule->paramQuantities[ComputerscareBlank::NEXT_FILE_BEHAVIOR];
+ endMenu->options = blankModule->nextFileDescriptions;
menu->addChild(new MenuEntry);
diff --git a/src/ComputerscareBlankExpander.cpp b/src/ComputerscareBlankExpander.cpp
@@ -29,7 +29,7 @@ struct ClockModeParamQuantity : ParamQuantity {
struct ComputerscareBlankExpander : Module {
- float rightMessages[2][10] = {};
+ float rightMessages[2][11] = {};
bool motherConnected = false;
float lastFrame = -1;
int numFrames = 1;
@@ -41,12 +41,13 @@ struct ComputerscareBlankExpander : Module {
CLOCK_MODE,
MANUAL_RESET_BUTTON,
ZERO_OFFSET,
+ MANUAL_NEXT_FILE_BUTTON,
NUM_PARAMS
};
enum InputIds {
SYNC_INPUT,
RESET_INPUT,
- SPEED_INPUT,
+ NEXT_FILE_INPUT,
NUM_INPUTS
};
enum OutputIds {
@@ -76,6 +77,7 @@ struct ComputerscareBlankExpander : Module {
configParam<ClockModeParamQuantity>(CLOCK_MODE, 0.f, 2.f, 0.f, "Clock Mode");
configParam(MANUAL_RESET_BUTTON, 0.f, 1.f, 0.f, "Manual Reset");
configParam<FrameOffsetParam>(ZERO_OFFSET, 0.f, 0.999f, 0.f, "EOC / Reset Frame #");
+ configParam(MANUAL_NEXT_FILE_BUTTON, 0.f, 1.f, 0.f, "Next File (see right click menu of mother for options)");
frameOffsetQuantity = dynamic_cast<FrameOffsetParam*>(paramQuantities[ZERO_OFFSET]);
@@ -119,8 +121,8 @@ struct ComputerscareBlankExpander : Module {
messageToSendToMother[3] = inputs[RESET_INPUT].isConnected();
messageToSendToMother[4] = inputs[RESET_INPUT].getVoltage();
- messageToSendToMother[5] = 0.f;
- messageToSendToMother[6] = 0.f;
+ messageToSendToMother[5] = inputs[NEXT_FILE_INPUT].isConnected();
+ messageToSendToMother[6] = inputs[NEXT_FILE_INPUT].getVoltage();;
messageToSendToMother[7] = params[ZERO_OFFSET].getValue();
@@ -128,6 +130,8 @@ struct ComputerscareBlankExpander : Module {
messageToSendToMother[9] = params[MANUAL_RESET_BUTTON].getValue() * 10;
+ messageToSendToMother[10] = params[MANUAL_NEXT_FILE_BUTTON].getValue() * 10;
+
outputs[EOC_OUTPUT].setVoltage(eocPulse.process(args.sampleTime) ? 10.f : 0.f);
outputs[EACH_FRAME_OUTPUT].setVoltage(eachFramePulse.process(args.sampleTime) ? 10.f : 0.f);
@@ -207,11 +211,14 @@ struct ComputerscareBlankExpanderWidget : ModuleWidget {
float outStartY = 250;
- addParam(createParam<ClockModeButton>(Vec(0.5, inStartY + dY / 2), module, ComputerscareBlankExpander::CLOCK_MODE));
- addInput(createInput<InPort>(Vec(2, inStartY + dY), module, ComputerscareBlankExpander::SYNC_INPUT));
+ addParam(createParam<ClockModeButton>(Vec(0.5, inStartY + .25 * dY), module, ComputerscareBlankExpander::CLOCK_MODE));
+ addInput(createInput<InPort>(Vec(2, inStartY + 0.75 * dY), module, ComputerscareBlankExpander::SYNC_INPUT));
+
+ addParam(createParam<ComputerscareResetButton>(Vec(0, inStartY + 1.75 * dY), module, ComputerscareBlankExpander::MANUAL_RESET_BUTTON));
+ addInput(createInput<InPort>(Vec(2, inStartY + 2.25 * dY), module, ComputerscareBlankExpander::RESET_INPUT));
- addParam(createParam<ComputerscareResetButton>(Vec(0, inStartY + 2 * dY), module, ComputerscareBlankExpander::MANUAL_RESET_BUTTON));
- addInput(createInput<InPort>(Vec(2, inStartY + 2.5 * dY), module, ComputerscareBlankExpander::RESET_INPUT));
+ addParam(createParam<ComputerscareNextButton>(Vec(0, inStartY + 3.25 * dY), module, ComputerscareBlankExpander::MANUAL_NEXT_FILE_BUTTON));
+ addInput(createInput<InPort>(Vec(2, inStartY + 3.75 * dY), module, ComputerscareBlankExpander::NEXT_FILE_INPUT));
addOutput(createOutput<PointingUpPentagonPort>(Vec(2, 236), module, ComputerscareBlankExpander::EACH_FRAME_OUTPUT));