Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Rack v2 API #2

Merged
merged 1 commit into from
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 9 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# Must follow the format in the Naming section of https://vcvrack.com/manual/PluginDevelopmentTutorial.html

# Must follow the format in the Versioning section of https://vcvrack.com/manual/PluginDevelopmentTutorial.html
# If RACK_DIR is not defined when calling the Makefile, default to two directories above
RACK_DIR ?= ../..

# FLAGS will be passed to both the C and C++ compiler
FLAGS +=
CFLAGS +=
CXXFLAGS +=

# Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.
# Static libraries are fine.
# Static libraries are fine, but they should be added to this plugin's build system.
LDFLAGS +=

# Add .cpp and .c files to the build
# Add .cpp files to the build
SOURCES += $(wildcard src/*.cpp)

# Add files to the ZIP package when running `make dist`
# The compiled plugin is automatically added.
DISTRIBUTABLES += $(wildcard LICENSE*) res

# If RACK_DIR is not defined when calling the Makefile, default to two levels above
RACK_DIR ?= ../..
# The compiled plugin and "plugin.json" are automatically added.
DISTRIBUTABLES += res
DISTRIBUTABLES += $(wildcard LICENSE*)
DISTRIBUTABLES += $(wildcard presets)

# Include the VCV Rack plugin Makefile framework
# Include the Rack plugin Makefile framework
include $(RACK_DIR)/plugin.mk

# Make resources

RESOURCES += $(subst src/res/,res/,$(wildcard src/res/*.svg))
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"pluginUrl": "https://github.com/The-Great-Assyr/Chiptuner",
"sourceUrl": "https://github.com/The-Great-Assyr/Chiptuner",
"manualUrl": "https://github.com/The-Great-Assyr/Chiptuner/blob/master/README.md",
"version": "1.0.0",
"version": "2.0.0",
"modules": [
{
"slug":"Blank1HP",
Expand Down
13 changes: 0 additions & 13 deletions src/Blanks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ struct BlankBaseWidget : ModuleWidget {
delete bmp;
loadBitmap();
}
json_t *toJson() override {
json_t *rootJ = ModuleWidget::toJson();
json_object_set_new(rootJ, "style", json_real(selected));
return rootJ;
}
void fromJson(json_t *rootJ) override {
ModuleWidget::fromJson(rootJ);
int sel = selected;
json_t *styleJ = json_object_get(rootJ, "style");
if (styleJ)
sel = json_number_value(styleJ);
setBitmap(sel);
}

};

Expand Down