Browse Source

Merge remote-tracking branch 'origin/v0.6' into v1

tags/v1.0.0
Andrew Belt 6 years ago
parent
commit
24b7a0f6af
4 changed files with 26 additions and 9 deletions
  1. +1
    -0
      Makefile
  2. +17
    -1
      include/dsp/digital.hpp
  3. +7
    -7
      src/app/Toolbar.cpp
  4. +1
    -1
      src/gamepad.cpp

+ 1
- 0
Makefile View File

@@ -111,6 +111,7 @@ ifdef ARCH_MAC
cp plugins/Fundamental/dist/Fundamental-*.zip $(BUNDLE)/Contents/Resources/Fundamental.zip
cp -R Bridge/AU/dist/VCV-Bridge.component dist/
cp -R Bridge/VST/dist/VCV-Bridge.vst dist/
cp -R Bridge/VST/dist/VCV-Bridge-fx.vst dist/
@# Make DMG image
cd dist && ln -s /Applications Applications
cd dist && ln -s /Library/Audio/Plug-Ins/Components Components


+ 17
- 1
include/dsp/digital.hpp View File

@@ -8,7 +8,6 @@ namespace rack {

/** Turns HIGH when value reaches 1.f, turns LOW when value reaches 0.f. */
struct SchmittTrigger {
// UNKNOWN is used to represent a stable state when the previous state is not yet set
enum State {
UNKNOWN,
LOW,
@@ -58,6 +57,23 @@ struct SchmittTrigger {
};


struct BooleanTrigger {
bool lastState;

BooleanTrigger() {
reset();
}
void reset() {
lastState = true;
}
bool process(bool state) {
bool triggered = (state && !lastState);
lastState = state;
return triggered;
}
};


/** When triggered, holds a high value for a specified time before going low again */
struct PulseGenerator {
float time;


+ 7
- 7
src/app/Toolbar.cpp View File

@@ -32,7 +32,7 @@ struct TooltipIconButton : IconButton {
struct NewButton : TooltipIconButton {
NewButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_146097_cc.svg")));
tooltipText = "New (" WINDOW_MOD_KEY_NAME "+N)";
tooltipText = "New patch (" WINDOW_MOD_KEY_NAME "+N)";
}
void onAction(EventAction &e) override {
gRackWidget->reset();
@@ -42,7 +42,7 @@ struct NewButton : TooltipIconButton {
struct OpenButton : TooltipIconButton {
OpenButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_31859_cc.svg")));
tooltipText = "Open (" WINDOW_MOD_KEY_NAME "+O)";
tooltipText = "Open patch (" WINDOW_MOD_KEY_NAME "+O)";
}
void onAction(EventAction &e) override {
gRackWidget->loadDialog();
@@ -52,7 +52,7 @@ struct OpenButton : TooltipIconButton {
struct SaveButton : TooltipIconButton {
SaveButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_1343816_cc.svg")));
tooltipText = "Save (" WINDOW_MOD_KEY_NAME "+S)";
tooltipText = "Save patch (" WINDOW_MOD_KEY_NAME "+S)";
}
void onAction(EventAction &e) override {
gRackWidget->saveDialog();
@@ -62,7 +62,7 @@ struct SaveButton : TooltipIconButton {
struct SaveAsButton : TooltipIconButton {
SaveAsButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_1343811_cc.svg")));
tooltipText = "Save as (" WINDOW_MOD_KEY_NAME "+Shift+S)";
tooltipText = "Save patch as (" WINDOW_MOD_KEY_NAME "+Shift+S)";
}
void onAction(EventAction &e) override {
gRackWidget->saveAsDialog();
@@ -72,7 +72,7 @@ struct SaveAsButton : TooltipIconButton {
struct RevertButton : TooltipIconButton {
RevertButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_1084369_cc.svg")));
tooltipText = "Revert";
tooltipText = "Revert patch";
}
void onAction(EventAction &e) override {
gRackWidget->revert();
@@ -116,14 +116,14 @@ struct SampleRateItem : MenuItem {
struct SampleRateButton : TooltipIconButton {
SampleRateButton() {
setSVG(SVG::load(assetGlobal("res/icons/noun_1240789_cc.svg")));
tooltipText = "Internal sample rate";
tooltipText = "Engine sample rate";
}
void onAction(EventAction &e) override {
Menu *menu = gScene->createMenu();
menu->box.pos = getAbsoluteOffset(Vec(0, box.size.y));
menu->box.size.x = box.size.x;

menu->addChild(MenuLabel::create("Internal sample rate"));
menu->addChild(MenuLabel::create("Engine sample rate"));

EnginePauseItem *pauseItem = new EnginePauseItem();
pauseItem->text = gPaused ? "Resume engine" : "Pause engine";


+ 1
- 1
src/gamepad.cpp View File

@@ -22,7 +22,7 @@ void GamepadInputDevice::step() {
ccs.resize(numAxes);
for (int i = 0; i < numAxes; i++) {
// Allow CC value to go negative, but clamp at -127 instead of -128 for symmetry
int8_t cc = clamp((int) (axes[i] * 127), -127, 127);
int8_t cc = clamp((int) roundf(axes[i] * 127), -127, 127);
if (cc != ccs[i]) {
ccs[i] = cc;



Loading…
Cancel
Save