Reaper extension base class interface.
More...
#include <ReaperExtBase.h>
|
| | ReaperExtBase (reaper_plugin_info_t *pRec) |
| |
| void | BeginInformHostOfParamChangeFromUI (int paramIdx) override |
| |
| void | EndInformHostOfParamChangeFromUI (int paramIdx) override |
| |
| bool | EditorResizeFromUI (int viewWidth, int viewHeight, bool needsPlatformResize) override |
| |
| virtual void | OnIdle () |
| | Called during idle processing - override to perform periodic tasks. More...
|
| |
| virtual void | OnActionRun (int commandId, int flag) |
| | Called after any action in the main section runs (via "hookpostcommand"). More...
|
| |
| virtual void | SaveProjectState (ProjectStateContext *ctx) |
| | Called (via "projectconfig") when the project is being saved, so the extension can persist state into the .RPP. More...
|
| |
| virtual bool | LoadProjectStateLine (const char *line) |
| | Called (via "projectconfig") for each project line not consumed by Reaper. More...
|
| |
| virtual void | OnBeginLoadProjectState (bool isUndo) |
| | Called (via "projectconfig") before project state is loaded (also on "new project"). More...
|
| |
| void | RegisterAction (const char *actionName, std::function< void()> func, bool addMenuItem=false, int *pToggle=nullptr, const char *contextMenuId=nullptr, const char *menuLabel=nullptr) |
| | Registers an action with the REAPER extension system. More...
|
| |
| void | ShowHideMainWindow () |
| | Toggles the visibility of the main extension window. More...
|
| |
| void | ToggleDocking () |
| | Toggles between docked and floating state. More...
|
| |
| bool | IsDocked () const |
| | Returns true if the window is currently docked. More...
|
| |
| int * | GetWindowTogglePtr () |
| | Toggle state for an action that shows/hides the main window. More...
|
| |
| int * | GetDockTogglePtr () |
| | Toggle state for an action that docks/undocks the main window. More...
|
| |
| void | SetDockId (const char *id) |
| | Sets the unique identifier used for dock state persistence. More...
|
| |
| void | SetMenuName (const char *name) |
| | Sets the title of the submenu that this extension's actions are added to, inside REAPER's Extensions menu. More...
|
| |
|
| static bool | HookCommandProc (int command, int flag) |
| |
| static int | ToggleActionCallback (int command) |
| |
| static void | MenuHook (const char *menuidstr, void *menu, int flag) |
| |
| static void | PostCommandProc (int command, int flag) |
| |
| static void | BeginLoadProjectState (bool isUndo, project_config_extension_t *reg) |
| |
| static bool | ProcessExtensionLine (const char *line, ProjectStateContext *ctx, bool isUndo, project_config_extension_t *reg) |
| |
| static void | SaveExtensionConfig (ProjectStateContext *ctx, bool isUndo, project_config_extension_t *reg) |
| |
Reaper extension base class interface.
Definition at line 40 of file ReaperExtBase.h.
◆ ReaperExtBase()
| ReaperExtBase::ReaperExtBase |
( |
reaper_plugin_info_t * |
pRec | ) |
|
◆ ~ReaperExtBase()
| ReaperExtBase::~ReaperExtBase |
( |
| ) |
|
|
virtual |
◆ BeginInformHostOfParamChangeFromUI()
| void ReaperExtBase::BeginInformHostOfParamChangeFromUI |
( |
int |
paramIdx | ) |
|
|
inlineoverride |
◆ BeginLoadProjectState()
| void ReaperExtBase::BeginLoadProjectState |
( |
bool |
isUndo, |
|
|
project_config_extension_t * |
reg |
|
) |
| |
|
static |
◆ EditorResizeFromUI()
| bool ReaperExtBase::EditorResizeFromUI |
( |
int |
viewWidth, |
|
|
int |
viewHeight, |
|
|
bool |
needsPlatformResize |
|
) |
| |
|
override |
◆ EndInformHostOfParamChangeFromUI()
| void ReaperExtBase::EndInformHostOfParamChangeFromUI |
( |
int |
paramIdx | ) |
|
|
inlineoverride |
◆ GetDockTogglePtr()
| int * ReaperExtBase::GetDockTogglePtr |
( |
| ) |
|
|
inline |
Toggle state for an action that docks/undocks the main window.
Pass to RegisterAction() as pToggle so the action gets a tick in menus and the action list while docked. Reflects the persisted preference, so it is meaningful even when the window is closed
Definition at line 108 of file ReaperExtBase.h.
◆ GetWindowTogglePtr()
| int * ReaperExtBase::GetWindowTogglePtr |
( |
| ) |
|
|
inline |
Toggle state for an action that shows/hides the main window.
Pass to RegisterAction() as pToggle so the action gets a tick in menus and the action list while the window is open
Definition at line 103 of file ReaperExtBase.h.
◆ HookCommandProc()
| bool ReaperExtBase::HookCommandProc |
( |
int |
command, |
|
|
int |
flag |
|
) |
| |
|
static |
◆ IsDocked()
| bool ReaperExtBase::IsDocked |
( |
| ) |
const |
|
inline |
◆ LoadProjectStateLine()
| virtual bool ReaperExtBase::LoadProjectStateLine |
( |
const char * |
line | ) |
|
|
inlinevirtual |
Called (via "projectconfig") for each project line not consumed by Reaper.
- Parameters
-
| line | The line of project data |
- Returns
- true if this line belonged to the extension and was handled
Definition at line 71 of file ReaperExtBase.h.
◆ MenuHook()
| void ReaperExtBase::MenuHook |
( |
const char * |
menuidstr, |
|
|
void * |
menu, |
|
|
int |
flag |
|
) |
| |
|
static |
◆ OnActionRun()
| virtual void ReaperExtBase::OnActionRun |
( |
int |
commandId, |
|
|
int |
flag |
|
) |
| |
|
inlinevirtual |
Called after any action in the main section runs (via "hookpostcommand").
Override to react to user edits without polling.
- Parameters
-
| commandId | The command that ran |
| flag | Reaper-supplied flag |
Definition at line 61 of file ReaperExtBase.h.
◆ OnBeginLoadProjectState()
| virtual void ReaperExtBase::OnBeginLoadProjectState |
( |
bool |
isUndo | ) |
|
|
inlinevirtual |
Called (via "projectconfig") before project state is loaded (also on "new project").
Override to reset state to defaults.
- Parameters
-
| isUndo | true if this load is part of an undo/redo |
Definition at line 76 of file ReaperExtBase.h.
◆ OnIdle()
| virtual void ReaperExtBase::OnIdle |
( |
| ) |
|
|
inlinevirtual |
Called during idle processing - override to perform periodic tasks.
Definition at line 55 of file ReaperExtBase.h.
◆ PostCommandProc()
| void ReaperExtBase::PostCommandProc |
( |
int |
command, |
|
|
int |
flag |
|
) |
| |
|
static |
◆ ProcessExtensionLine()
| bool ReaperExtBase::ProcessExtensionLine |
( |
const char * |
line, |
|
|
ProjectStateContext * |
ctx, |
|
|
bool |
isUndo, |
|
|
project_config_extension_t * |
reg |
|
) |
| |
|
static |
◆ RegisterAction()
| void ReaperExtBase::RegisterAction |
( |
const char * |
actionName, |
|
|
std::function< void()> |
func, |
|
|
bool |
addMenuItem = false, |
|
|
int * |
pToggle = nullptr, |
|
|
const char * |
contextMenuId = nullptr, |
|
|
const char * |
menuLabel = nullptr |
|
) |
| |
Registers an action with the REAPER extension system.
- Parameters
-
| actionName | The name of the action to register, as shown in the action list. Must be a persistent pointer (e.g. a string literal) |
| func | The function to call when the action is executed |
| addMenuItem | If true, adds a menu item for this action to the extension's submenu of REAPER's Extensions menu |
| pToggle | Optional pointer to an int for toggle state |
| contextMenuId | Optional REAPER context-menu id to also add this action to, e.g. "Media item context", "Track control panel context". nullptr = none. |
| menuLabel | Optional shorter label to use for menu items, since actionName is usually prefixed to disambiguate it in the action list. Must be a persistent pointer. nullptr = use actionName. |
Definition at line 212 of file ReaperExtBase.cpp.
◆ SaveExtensionConfig()
| void ReaperExtBase::SaveExtensionConfig |
( |
ProjectStateContext * |
ctx, |
|
|
bool |
isUndo, |
|
|
project_config_extension_t * |
reg |
|
) |
| |
|
static |
◆ SaveProjectState()
| virtual void ReaperExtBase::SaveProjectState |
( |
ProjectStateContext * |
ctx | ) |
|
|
inlinevirtual |
Called (via "projectconfig") when the project is being saved, so the extension can persist state into the .RPP.
Write lines with ctx->AddLine(...).
- Parameters
-
| ctx | The project state context to write to |
Definition at line 66 of file ReaperExtBase.h.
◆ SetDockId()
| void ReaperExtBase::SetDockId |
( |
const char * |
id | ) |
|
|
inline |
Sets the unique identifier used for dock state persistence.
- Parameters
-
| id | Unique identifier string (defaults to PLUG_CLASS_NAME) |
Definition at line 112 of file ReaperExtBase.h.
◆ SetMenuName()
| void ReaperExtBase::SetMenuName |
( |
const char * |
name | ) |
|
|
inline |
Sets the title of the submenu that this extension's actions are added to, inside REAPER's Extensions menu.
- Parameters
-
| name | Submenu title (defaults to PLUG_CLASS_NAME) |
Definition at line 117 of file ReaperExtBase.h.
◆ ShowHideMainWindow()
| void ReaperExtBase::ShowHideMainWindow |
( |
| ) |
|
◆ ToggleActionCallback()
| int ReaperExtBase::ToggleActionCallback |
( |
int |
command | ) |
|
|
static |
◆ ToggleDocking()
| void ReaperExtBase::ToggleDocking |
( |
| ) |
|
The documentation for this class was generated from the following files: