Browse Source

Move App from rack::app:: to rack::. Remove ambiguous operator overloads in simd.hpp. Include simd.hpp in rack.hpp.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
0b17f9e2ca
7 changed files with 26 additions and 51 deletions
  1. +7
    -11
      include/app.hpp
  2. +4
    -0
      include/app/common.hpp
  3. +0
    -12
      include/dsp/simd.hpp
  4. +1
    -0
      include/rack.hpp
  5. +12
    -14
      src/app.cpp
  6. +0
    -12
      src/app/ParamWidget.cpp
  7. +2
    -2
      src/main.cpp

+ 7
- 11
include/app.hpp View File

@@ -3,7 +3,7 @@


/** Accesses the global App pointer */
#define APP rack::app::get()
#define APP rack::appGet()


namespace rack {
@@ -28,18 +28,15 @@ struct Window;
struct PatchManager;


/** Rack-specific GUI widgets and functions that control and offer feedback for the rack state.
*/
namespace app {


struct Scene;
struct Scene;
} // namespace app


/** Contains the application state */
struct App {
event::State *event = NULL;
Scene *scene = NULL;
app::Scene *scene = NULL;
engine::Engine *engine = NULL;
Window *window = NULL;
history::State *history = NULL;
@@ -50,11 +47,10 @@ struct App {
};


void init(bool headless);
void destroy();
void appInit(bool headless);
void appDestroy();
/** Returns the global App pointer */
App *get();
App *appGet();


} // namespace app
} // namespace rack

+ 4
- 0
include/app/common.hpp View File

@@ -5,6 +5,10 @@


namespace rack {


/** Rack-specific GUI widgets and functions that control and offer feedback for the rack state.
*/
namespace app {




+ 0
- 12
include/dsp/simd.hpp View File

@@ -90,14 +90,6 @@ typedef f32<4> f32_4;
#define DECLARE_F32_4_OPERATOR_INFIX(operator, func) \
inline f32_4 operator(const f32_4 &a, const f32_4 &b) { \
return f32_4(func(a.v, b.v)); \
} \
template <typename T> \
f32_4 operator(const T &a, const f32_4 &b) { \
return operator(f32_4(a), b); \
} \
template <typename T> \
f32_4 operator(const f32_4 &a, const T &b) { \
return operator(a, f32_4(b)); \
}

/** `a @= b` */
@@ -105,10 +97,6 @@ typedef f32<4> f32_4;
inline f32_4 &operator(f32_4 &a, const f32_4 &b) { \
a = opfunc(a, b); \
return a; \
} \
template <typename T> \
f32_4 &operator(f32_4 &a, const T &b) { \
return operator(a, f32_4(b)); \
}

DECLARE_F32_4_OPERATOR_INFIX(operator+, _mm_add_ps)


+ 1
- 0
include/rack.hpp View File

@@ -80,6 +80,7 @@
#include "plugin/callbacks.hpp"

#include "dsp/common.hpp"
#include "dsp/simd.hpp"
#include "dsp/digital.hpp"
#include "dsp/fft.hpp"
#include "dsp/filter.hpp"


+ 12
- 14
src/app.cpp View File

@@ -8,7 +8,6 @@


namespace rack {
namespace app {


void App::init(bool headless) {
@@ -18,7 +17,7 @@ void App::init(bool headless) {
history = new history::State;
window = new Window;
patch = new PatchManager;
scene = new Scene;
scene = new app::Scene;
event->rootWidget = scene;
}
}
@@ -40,24 +39,23 @@ App::~App() {
}


static App *app = NULL;
static App *appInstance = NULL;

void init(bool headless) {
assert(!app);
app = new App;
app->init(headless);
void appInit(bool headless) {
assert(!appInstance);
appInstance = new App;
appInstance->init(headless);
}

void destroy() {
assert(app);
delete app;
app = NULL;
void appDestroy() {
assert(appInstance);
delete appInstance;
appInstance = NULL;
}

App *get() {
return app;
App *appGet() {
return appInstance;
}


} // namespace app
} // namespace rack

+ 0
- 12
src/app/ParamWidget.cpp View File

@@ -132,18 +132,6 @@ void ParamWidget::step() {
void ParamWidget::draw(const DrawArgs &args) {
Widget::draw(args);

// if (paramQuantity) {
// nvgBeginPath(args.vg);
// nvgRect(args.vg,
// box.size.x - 12, box.size.y - 12,
// 12, 12);
// nvgFillColor(args.vg, nvgRGBAf(1, 0, 1, 0.9));
// nvgFill(args.vg);

// std::string mapText = string::f("%d", paramQuantity->paramId);
// bndLabel(args.vg, box.size.x - 17.0, box.size.y - 16.0, INFINITY, INFINITY, -1, mapText.c_str());
// }

// Param map indicator
engine::ParamHandle *paramHandle = paramQuantity ? APP->engine->getParamHandle(paramQuantity->module, paramQuantity->paramId) : NULL;
if (paramHandle) {


+ 2
- 2
src/main.cpp View File

@@ -122,7 +122,7 @@ int main(int argc, char *argv[]) {
// Initialize app
INFO("Initializing app");
settings.load(asset::user("settings.json"));
app::init(headless);
appInit(headless);
if (!headless) {
APP->scene->devMode = devMode;
APP->patch->init(patchPath);
@@ -148,7 +148,7 @@ int main(int argc, char *argv[]) {
APP->patch->save(asset::user("autosave.vcv"));
}
INFO("Destroying app");
app::destroy();
appDestroy();
settings.save(asset::user("settings.json"));

// Destroy environment


Loading…
Cancel
Save