VCV Rack API v2
rack::settings Namespace Reference

Process-scope globals, most of which are persisted across launches. More...

Classes

struct  ModuleInfo
 
struct  PluginWhitelist
 The VCV JSON API returns the data structure {pluginSlug: [moduleSlugs] or true} where "true" represents that the user is subscribed to the plugin (all modules and future modules). More...
 

Enumerations

enum  KnobMode { KNOB_MODE_LINEAR , KNOB_MODE_SCALED_LINEAR , KNOB_MODE_ROTARY_ABSOLUTE , KNOB_MODE_ROTARY_RELATIVE }
 
enum  BrowserSort {
  BROWSER_SORT_UPDATED , BROWSER_SORT_LAST_USED , BROWSER_SORT_MOST_USED , BROWSER_SORT_BRAND ,
  BROWSER_SORT_NAME , BROWSER_SORT_RANDOM
}
 

Functions

ModuleInfogetModuleInfo (const std::string &pluginSlug, const std::string &moduleSlug)
 Returns a ModuleInfo if exists for the given slugs. More...
 
bool isModuleWhitelisted (const std::string &pluginSlug, const std::string &moduleSlug)
 
PRIVATE void init ()
 
PRIVATE json_t * toJson ()
 
PRIVATE void fromJson (json_t *rootJ)
 
PRIVATE void save (std::string path="")
 
PRIVATE void load (std::string path="")
 

Variables

std::string settingsPath
 Path to settings.json. More...
 
bool devMode
 
bool headless
 
bool isPlugin
 
std::string token
 vcvrack.com user token More...
 
bool windowMaximized
 Whether the window is maximized. More...
 
math::Vec windowSize
 Size of window in pixels. More...
 
math::Vec windowPos
 Position in window in pixels. More...
 
bool invertZoom
 Reverse the zoom scroll direction. More...
 
float pixelRatio
 Ratio between UI pixel and physical screen pixel. More...
 
float cableOpacity
 Opacity of cables in the range [0, 1]. More...
 
float cableTension
 Straightness of cables in the range [0, 1]. More...
 
float rackBrightness
 
float haloBrightness
 
bool allowCursorLock
 Allows rack to hide and lock the cursor position when dragging knobs etc. More...
 
KnobMode knobMode
 
bool knobScroll
 
float knobLinearSensitivity
 
float knobScrollSensitivity
 
float sampleRate
 
int threadCount
 
bool tooltips
 
bool cpuMeter
 
bool lockModules
 
int frameSwapInterval
 
float autosaveInterval
 
bool skipLoadOnLaunch
 
std::list< std::string > recentPatchPaths
 
std::vector< NVGcolor > cableColors
 
bool autoCheckUpdates
 
bool showTipsOnLaunch
 
int tipIndex
 
bool discordUpdateActivity
 
BrowserSort browserSort
 
float browserZoom
 
std::map< std::string, std::map< std::string, ModuleInfo > > moduleInfos
 pluginSlug -> (moduleSlug -> ModuleInfo) More...
 
std::map< std::string, PluginWhitelistmoduleWhitelist
 

Detailed Description

Process-scope globals, most of which are persisted across launches.

Enumeration Type Documentation

◆ KnobMode

Enumerator
KNOB_MODE_LINEAR 
KNOB_MODE_SCALED_LINEAR 
KNOB_MODE_ROTARY_ABSOLUTE 
KNOB_MODE_ROTARY_RELATIVE 

◆ BrowserSort

Enumerator
BROWSER_SORT_UPDATED 
BROWSER_SORT_LAST_USED 
BROWSER_SORT_MOST_USED 
BROWSER_SORT_BRAND 
BROWSER_SORT_NAME 
BROWSER_SORT_RANDOM 

Function Documentation

◆ getModuleInfo()

ModuleInfo * rack::settings::getModuleInfo ( const std::string &  pluginSlug,
const std::string &  moduleSlug 
)

Returns a ModuleInfo if exists for the given slugs.

◆ isModuleWhitelisted()

bool rack::settings::isModuleWhitelisted ( const std::string &  pluginSlug,
const std::string &  moduleSlug 
)

◆ init()

PRIVATE void rack::settings::init ( )

◆ toJson()

PRIVATE json_t * rack::settings::toJson ( )

◆ fromJson()

PRIVATE void rack::settings::fromJson ( json_t *  rootJ)

◆ save()

PRIVATE void rack::settings::save ( std::string  path = "")

◆ load()

PRIVATE void rack::settings::load ( std::string  path = "")

Variable Documentation

◆ settingsPath

std::string rack::settings::settingsPath
extern

Path to settings.json.

◆ devMode

bool rack::settings::devMode
extern

◆ headless

bool rack::settings::headless
extern

◆ isPlugin

bool rack::settings::isPlugin
extern

◆ token

std::string rack::settings::token
extern

vcvrack.com user token

◆ windowMaximized

bool rack::settings::windowMaximized
extern

Whether the window is maximized.

◆ windowSize

math::Vec rack::settings::windowSize
extern

Size of window in pixels.

◆ windowPos

math::Vec rack::settings::windowPos
extern

Position in window in pixels.

◆ invertZoom

bool rack::settings::invertZoom
extern

Reverse the zoom scroll direction.

◆ pixelRatio

float rack::settings::pixelRatio
extern

Ratio between UI pixel and physical screen pixel.

0 for auto.

◆ cableOpacity

float rack::settings::cableOpacity
extern

Opacity of cables in the range [0, 1].

◆ cableTension

float rack::settings::cableTension
extern

Straightness of cables in the range [0, 1].

Unitless and arbitrary.

◆ rackBrightness

float rack::settings::rackBrightness
extern

◆ haloBrightness

float rack::settings::haloBrightness
extern

◆ allowCursorLock

bool rack::settings::allowCursorLock
extern

Allows rack to hide and lock the cursor position when dragging knobs etc.

◆ knobMode

KnobMode rack::settings::knobMode
extern

◆ knobScroll

bool rack::settings::knobScroll
extern

◆ knobLinearSensitivity

float rack::settings::knobLinearSensitivity
extern

◆ knobScrollSensitivity

float rack::settings::knobScrollSensitivity
extern

◆ sampleRate

float rack::settings::sampleRate
extern

◆ threadCount

int rack::settings::threadCount
extern

◆ tooltips

bool rack::settings::tooltips
extern

◆ cpuMeter

bool rack::settings::cpuMeter
extern

◆ lockModules

bool rack::settings::lockModules
extern

◆ frameSwapInterval

int rack::settings::frameSwapInterval
extern

◆ autosaveInterval

float rack::settings::autosaveInterval
extern

◆ skipLoadOnLaunch

bool rack::settings::skipLoadOnLaunch
extern

◆ recentPatchPaths

std::list<std::string> rack::settings::recentPatchPaths
extern

◆ cableColors

std::vector<NVGcolor> rack::settings::cableColors
extern

◆ autoCheckUpdates

bool rack::settings::autoCheckUpdates
extern

◆ showTipsOnLaunch

bool rack::settings::showTipsOnLaunch
extern

◆ tipIndex

int rack::settings::tipIndex
extern

◆ discordUpdateActivity

bool rack::settings::discordUpdateActivity
extern

◆ browserSort

BrowserSort rack::settings::browserSort
extern

◆ browserZoom

float rack::settings::browserZoom
extern

◆ moduleInfos

std::map<std::string, std::map<std::string, ModuleInfo> > rack::settings::moduleInfos
extern

pluginSlug -> (moduleSlug -> ModuleInfo)

◆ moduleWhitelist

std::map<std::string, PluginWhitelist> rack::settings::moduleWhitelist
extern