Skip to content

Commit

Permalink
add parameters from class "ProtoFaustWidget"
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuther committed Jul 16, 2020
1 parent ec330f4 commit f2cd4d5
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 327 deletions.
105 changes: 0 additions & 105 deletions src/ProtoFaust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,111 +35,6 @@ ProtoFaust::ProtoFaust()
NUM_LED_PINS );

FaustDSP.buildUserInterface( &FaustUI );

// sorry for the following cruft -- I'd give my right arm for
// LISP-like macros in C++ ...

// ------ switches & buttons ------

addParameter( ProtoFaustWidget::THREE_WAY_SWITCH,
BUTTON_1_PARAM,
"/ProtoFaust/Buttons/1" );

addParameter( ProtoFaustWidget::THREE_WAY_SWITCH,
BUTTON_2_PARAM,
"/ProtoFaust/Buttons/2" );

addParameter( ProtoFaustWidget::TOGGLE_SWITCH,
BUTTON_3_PARAM,
"/ProtoFaust/Buttons/3" );

addParameter( ProtoFaustWidget::TOGGLE_SWITCH,
BUTTON_4_PARAM,
"/ProtoFaust/Buttons/4" );

addParameter( ProtoFaustWidget::PUSH_BUTTON,
BUTTON_5_PARAM,
"/ProtoFaust/Buttons/5" );

addParameter( ProtoFaustWidget::PUSH_BUTTON,
BUTTON_6_PARAM,
"/ProtoFaust/Buttons/6" );

addParameter( ProtoFaustWidget::PUSH_BUTTON,
BUTTON_7_PARAM,
"/ProtoFaust/Buttons/7" );

addParameter( ProtoFaustWidget::PUSH_BUTTON,
BUTTON_8_PARAM,
"/ProtoFaust/Buttons/8" );

// ------ knobs ------

addParameter( ProtoFaustWidget::KNOB_WHITE,
KNOB_1_PARAM,
"/ProtoFaust/Knobs/1" );

addParameter( ProtoFaustWidget::KNOB_RED,
KNOB_2_PARAM,
"/ProtoFaust/Knobs/2" );

addParameter( ProtoFaustWidget::KNOB_WHITE,
KNOB_3_PARAM,
"/ProtoFaust/Knobs/3" );

addParameter( ProtoFaustWidget::KNOB_RED,
KNOB_4_PARAM,
"/ProtoFaust/Knobs/4" );

addParameter( ProtoFaustWidget::KNOB_WHITE,
KNOB_5_PARAM,
"/ProtoFaust/Knobs/5" );

addParameter( ProtoFaustWidget::KNOB_RED,
KNOB_6_PARAM,
"/ProtoFaust/Knobs/6" );

addParameter( ProtoFaustWidget::KNOB_WHITE,
KNOB_7_PARAM,
"/ProtoFaust/Knobs/7" );

addParameter( ProtoFaustWidget::KNOB_RED,
KNOB_8_PARAM,
"/ProtoFaust/Knobs/8" );

// ------ RGB LEDs ------

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_1,
"/ProtoFaust/Lights/1" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_2,
"/ProtoFaust/Lights/2" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_3,
"/ProtoFaust/Lights/3" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_4,
"/ProtoFaust/Lights/4" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_5,
"/ProtoFaust/Lights/5" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_6,
"/ProtoFaust/Lights/6" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_7,
"/ProtoFaust/Lights/7" );

addParameterLed( ProtoFaustWidget::LED_RGB,
LED_8,
"/ProtoFaust/Lights/8" );
}


Expand Down
8 changes: 4 additions & 4 deletions src/ProtoFaust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ struct ProtoFaust : Module {
void onAdd() override;
void process( const ProcessArgs& args ) override;

private:
std::vector<WidgetAccess> activeWidgets;
std::vector<WidgetAccess> passiveWidgets;

void addParameter( int widgetType,
int parameterId,
const std::string& faustStringId );
Expand All @@ -143,6 +139,10 @@ struct ProtoFaust : Module {
int parameterId,
const std::string& faustStringId );

private:
std::vector<WidgetAccess> activeWidgets;
std::vector<WidgetAccess> passiveWidgets;

void updateParameterIn( WidgetAccess& widget );
void updateParameterOut( WidgetAccess& widget );
};
Expand Down
Loading

0 comments on commit f2cd4d5

Please sign in to comment.