More details for mini version, make menubar variant specific

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-12-29 15:33:16 +00:00
parent b71acc9f22
commit 91cac905cc
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
17 changed files with 331 additions and 79 deletions

View file

@ -209,10 +209,15 @@ static void Engine_stepFrame(Engine* that) {
float smoothValue = internal->smoothValue;
Param* smoothParam = &smoothModule->params[smoothParamId];
float value = smoothParam->value;
// Use decay rate of roughly 1 graphics frame
const float smoothLambda = 60.f;
float newValue = value + (smoothValue - value) * smoothLambda * internal->sampleTime;
if (value == newValue) {
float newValue;
if (internal->blockFrames != 1) {
// Use decay rate of roughly 1 graphics frame
const float smoothLambda = 60.f;
newValue = value + (smoothValue - value) * smoothLambda * internal->sampleTime;
} else {
newValue = value;
}
if (d_isEqual(value, newValue)) {
// Snap to actual smooth value if the value doesn't change enough (due to the granularity of floats)
smoothParam->setValue(smoothValue);
internal->smoothModule = NULL;

View file

@ -53,6 +53,7 @@
#include "../CardinalCommon.hpp"
#include "../CardinalRemote.hpp"
#include "DistrhoPlugin.hpp"
#include "DistrhoStandaloneUtils.hpp"
#ifdef HAVE_LIBLO
@ -98,14 +99,14 @@ struct MenuButton : ui::Button {
struct FileButton : MenuButton {
const bool isStandalone;
#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD))
#if ! CARDINAL_VARIANT_MINI
std::vector<std::string> demoPatches;
#endif
FileButton(const bool standalone)
: MenuButton(), isStandalone(standalone)
{
#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD))
#if ! CARDINAL_VARIANT_MINI
const std::string patchesDir = asset::patchesPath() + DISTRHO_OS_SEP_STR "examples";
if (system::isDirectory(patchesDir))
@ -167,7 +168,7 @@ struct FileButton : MenuButton {
patchUtils::revertDialog();
}, APP->patch->path.empty()));
#ifdef HAVE_LIBLO
// #if defined(HAVE_LIBLO) && ! CARDINAL_VARIANT_MINI
menu->addChild(new ui::MenuSeparator);
remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote();
@ -186,7 +187,7 @@ struct FileButton : MenuButton {
remoteUtils::connectToRemote();
}));
}
#endif
// #endif
#ifndef DISTRHO_OS_WASM
menu->addChild(new ui::MenuSeparator);
@ -201,7 +202,7 @@ struct FileButton : MenuButton {
}));
#endif
#if !(defined(DISTRHO_OS_WASM) && defined(STATIC_BUILD))
#if ! CARDINAL_VARIANT_MINI
if (!demoPatches.empty())
{
menu->addChild(new ui::MenuSeparator);

View file

@ -50,6 +50,9 @@ namespace rack {
namespace app {
widget::Widget* createMenuBar(bool isStandalone);
struct ResizeHandle : widget::OpaqueWidget {
math::Vec size;
@ -131,7 +134,7 @@ Scene::Scene() {
rack = rackScroll->rackWidget;
menuBar = createMenuBar();
menuBar = createMenuBar(isStandalone());
addChild(menuBar);
browser = browserCreate();
@ -209,7 +212,7 @@ void Scene::step() {
if (remoteDetails->autoDeploy) {
const int actionIndex = APP->history->actionIndex;
const double time = system::getTime();
if (internal->historyActionIndex != actionIndex && time - internal->lastSceneChangeTime >= 5.0) {
if (internal->historyActionIndex != actionIndex && time - internal->lastSceneChangeTime >= 1.0) {
internal->historyActionIndex = actionIndex;
internal->lastSceneChangeTime = time;
remoteUtils::deployToRemote(remoteDetails);
@ -315,7 +318,8 @@ void Scene::onHoverKey(const HoverKeyEvent& e) {
e.consume(this);
}
if (e.key == GLFW_KEY_F7 && (e.mods & RACK_MOD_MASK) == 0) {
remoteUtils::deployToRemote(remoteUtils::getRemote());
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
remoteUtils::deployToRemote(remoteDetails);
window::generateScreenshot();
e.consume(this);
}