Tweaks to modgui main variant
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
3413e17fec
commit
0e85ecf517
2 changed files with 25 additions and 1 deletions
|
@ -1,8 +1,20 @@
|
|||
function (event) {
|
||||
|
||||
function hideAllIfConnectionsPresent() {
|
||||
if (event.icon.find('.input-connected').length === 0 && event.icon.find('.output-connected').length === 0)
|
||||
return;
|
||||
event.icon.find('.mod-pedal-input .mod-audio-input').removeClass('cardinal-expanded');
|
||||
event.icon.find('.mod-pedal-output .mod-audio-output').removeClass('cardinal-expanded');
|
||||
event.icon.find('.mod-pedal-input .mod-cv-input').removeClass('cardinal-expanded');
|
||||
event.icon.find('.mod-pedal-output .mod-cv-output').removeClass('cardinal-expanded');
|
||||
event.icon.find('.visibility-audio').text('Show Audio');
|
||||
event.icon.find('.visibility-cv').text('Show CV');
|
||||
}
|
||||
|
||||
if (event.type == 'start') {
|
||||
event.data['visibility-audio'] = true;
|
||||
event.data['visibility-cv'] = true;
|
||||
event.data['visibility-triggered'] = false;
|
||||
event.icon.find('.visibility-audio').click(function() {
|
||||
var visible = event.data['visibility-audio'];
|
||||
if (visible) {
|
||||
|
@ -15,6 +27,7 @@ function (event) {
|
|||
$(this).text('Show Audio');
|
||||
}
|
||||
event.data['visibility-audio'] = !visible;
|
||||
event.data['visibility-triggered'] = true;
|
||||
});
|
||||
event.icon.find('.visibility-cv').click(function() {
|
||||
var visible = event.data['visibility-cv'];
|
||||
|
@ -33,7 +46,6 @@ function (event) {
|
|||
}
|
||||
|
||||
if (event.type == 'change') {
|
||||
console.log("change", event)
|
||||
if (event.uri === "https://distrho.kx.studio/plugins/cardinal#screenshot") {
|
||||
if (event.value) {
|
||||
event.icon.find('.screenshot').css({'background-image':'url(data:image/png;base64,'+event.value+')'});
|
||||
|
@ -43,6 +55,11 @@ function (event) {
|
|||
event.icon.find('.cardinal-main.mod-pedal .cardinal-patch-screeenshot').hide();
|
||||
event.icon.find('.cardinal-main.mod-pedal .cardinal-patch-comment').show();
|
||||
}
|
||||
// if we got a screenshot without the user ever triggering a visibility change, it is like from PB load
|
||||
if (!event.data['visibility-triggered']) {
|
||||
event.data['visibility-triggered'] = true;
|
||||
setTimeout(hideAllIfConnectionsPresent, 500);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -198,6 +198,13 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
.dummy > .cardinal-main.mod-pedal .mod-pedal-input > .mod-audio-input:not(.cardinal-expanded),
|
||||
.dummy > .cardinal-main.mod-pedal .mod-pedal-input > .mod-cv-input:not(.cardinal-expanded),
|
||||
.dummy > .cardinal-main.mod-pedal .mod-pedal-output > .mod-audio-output:not(.cardinal-expanded),
|
||||
.dummy > .cardinal-main.mod-pedal .mod-pedal-output > .mod-cv-output:not(.cardinal-expanded) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* initial state */
|
||||
/*.cardinal-main.mod-pedal .cardinal-patch-comment,*/
|
||||
.cardinal-main.mod-pedal .cardinal-patch-screeenshot {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue