VCV Rack API v2
Loading...
Searching...
No Matches
patch.hpp
Go to the documentation of this file.
1#pragma once
2#include <jansson.h>
3
4#include <common.hpp>
5
6
7namespace rack {
9namespace patch {
10
11
13struct Manager {
14 struct Internal;
15 Internal* internal;
16
18 std::string path;
20 std::string autosavePath;
22 std::string templatePath;
25
28 PRIVATE void launch(std::string pathArg);
30 void clear();
32 void save(std::string path);
33 void saveDialog();
34 void saveAsDialog(bool setPath = true);
44 void load(std::string path);
54 void loadAction(std::string path);
55 void loadDialog();
56 void loadPathDialog(std::string path);
59 void pushRecentPath(std::string path);
62
63 json_t* toJson();
64 void fromJson(json_t* rootJ);
68 bool checkUnavailableModulesJson(json_t* rootJ);
69};
70
71
72} // namespace patch
73} // namespace rack
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Handles the Rack patch file state.
Definition patch.hpp:13
std::string factoryTemplatePath
Path to factory template patch.
Definition patch.hpp:24
std::string templatePath
Path to user template patch.
Definition patch.hpp:22
void clearAutosave()
Delete and re-create autosave dir.
void loadAutosave()
Loads the patch from the autosave folder.
void loadPathDialog(std::string path)
void loadTemplate()
Loads the template patch file.
std::string path
The currently loaded patch file path.
Definition patch.hpp:18
void revertDialog()
Asks the user to reload the current patch.
void loadAction(std::string path)
Loads a patch, sets the current path, and updates the recent patches.
void cleanAutosave()
Clean up nonexistent module patch storage dirs in autosave dir.
bool checkUnavailableModulesJson(json_t *rootJ)
Checks if the JSON patch object contains modules not found in the loaded plugins, and launches a dial...
void pushRecentPath(std::string path)
void load(std::string path)
Loads a patch and nothing else.
PRIVATE void launch(std::string pathArg)
void clear()
Clears the patch.
void fromJson(json_t *rootJ)
void saveAsDialog(bool setPath=true)
void disconnectDialog()
Disconnects all cables.
Internal * internal
Definition patch.hpp:15
void save(std::string path)
Saves the patch and nothing else.
std::string autosavePath
Path to autosave dir.
Definition patch.hpp:20