Skip to content

Commit

Permalink
add custom UI handler
Browse files Browse the repository at this point in the history
- format "architecture_rack.cpp" using astyle
  • Loading branch information
mzuther committed Jul 14, 2020
1 parent ce5611b commit dd382af
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ProtoFaust.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct ProtoFaust : Module {
const FAUSTFLOAT voltageScaling = 5.0f;

faust::FaustDSP FaustDSP;
faust::APIUI FaustUI;
faust::VCVRACKUI FaustUI;

ProtoFaust();

Expand Down
28 changes: 27 additions & 1 deletion src/faust/architecture_rack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "faust/gui/meta.h"
#include "faust/dsp/one-sample-dsp.h"

// *INDENT-OFF* --> make astyle behave ...

/******************************************************************************
*******************************************************************************
Expand All @@ -58,6 +60,30 @@

/*******************BEGIN ARCHITECTURE SECTION (part 2/2)***************/

// EMPTY !!!
// *INDENT-ON* --> give astyle free reign ...

class VCVRACKUI : public APIUI
{
public:
VCVRACKUI() : APIUI() {}
virtual ~VCVRACKUI() {}

virtual void declare( FAUSTFLOAT* zone, const char* key, const char* val ) override
{
APIUI::declare( zone, key, val );
}


virtual void addParameter( const char* label,
FAUSTFLOAT* zone,
FAUSTFLOAT init,
FAUSTFLOAT min,
FAUSTFLOAT max,
FAUSTFLOAT step,
ItemType type ) override
{
APIUI::addParameter( label, zone, init, min, max, step, type );
}
};

/********************END ARCHITECTURE SECTION (part 2/2)****************/
4 changes: 2 additions & 2 deletions src/format_code.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ rem
rem ----------------------------------------------------------------------------


@AStyle --recursive --exclude="faust" --exclude="faust_generated.cpp" --options=./.astylerc "*.cpp"
@AStyle --recursive --exclude="faust_generated.cpp" --options=./.astylerc "*.cpp"
@echo.

@AStyle --recursive --exclude="faust" --options=./.astylerc "*.hpp"
@AStyle --recursive --options=./.astylerc "*.hpp"
@pause
4 changes: 2 additions & 2 deletions src/format_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
# ----------------------------------------------------------------------------


astyle --recursive --exclude="faust" --exclude="faust_generated.cpp" --options=./.astylerc \
astyle --recursive --exclude="faust_generated.cpp" --options=./.astylerc \
"*.cpp"

printf "\n"

astyle --recursive --exclude="faust" --options=./.astylerc \
astyle --recursive --options=./.astylerc \
"*.hpp"

0 comments on commit dd382af

Please sign in to comment.