This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "reaper_plugin.h" | |
#define EEL_F_SIZE WDL_FFT_REALSIZE | |
#include "WDL/WDL/eel2/nseel-ram.c" | |
EEL_F *** (*eel_gmem_attach)(const char *nm, bool is_alloc); | |
void (*eel_enter_mutex)(); | |
void (*eel_leave_mutex)(); | |
void NSEEL_HOSTSTUB_EnterMutex() { eel_enter_mutex(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bare-bone REAPER extension | |
// | |
// 1. Grab reaper_plugin.h from https://github.com/justinfrankel/reaper-sdk/raw/main/sdk/reaper_plugin.h | |
// 2. Grab reaper_plugin_functions.h by running the REAPER action "[developer] Write C++ API functions header" | |
// 3. Grab WDL: git clone https://github.com/justinfrankel/WDL.git | |
// 4. Build then copy or link the binary file into <REAPER resource directory>/UserPlugins | |
// | |
// Linux | |
// ===== | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--dofile(reaper.GetResourcePath() .. | |
--'/Scripts/ReaTeam Extensions/API/imgui.lua')('0.7') | |
r = reaper | |
local demo, cache = {}, {} | |
function demo.EachEnum(enum) | |
local enum_cache = cache[enum] | |
if not enum_cache then | |
enum_cache = {} | |
cache[enum] = enum_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstring> | |
#define REAPERAPI_IMPLEMENT | |
#include <reaper_plugin_functions.h> | |
const char *(*__localizeFunc)(const char *str, const char *subctx, int flags); | |
static bool IsCustomAction(KbdSectionInfo *section, const int id) | |
{ | |
// logic from SWS's IsMacroOrScript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Toolbar demo by cfillion</title> | |
<meta charset="utf-8"/> | |
<style> | |
@font-face { | |
font-family: 'Bravura'; | |
src: url('https://cdn.rawgit.com/openlilylib/openlilylib/3d6a145a/custom-music-fonts/smufl/bravura-1.12/woff/Bravura.woff'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cl /nologo /O2 reaper_widemsg.cpp User32.lib /link /DLL /OUT:reaper_widemsg.dll | |
#include <cstdint> | |
#define REAPERAPI_IMPLEMENT | |
#include "reaper_plugin_functions.h" | |
template<typename T> | |
bool patch(const uintptr_t addr, const T newCode, T *backup = nullptr) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// c++ -fPIC -O2 -std=c++14 -DSWELL_PROVIDED_BY_APP -IWDL -IWDL/WDL -dynamiclib reaper_idenoreload.cpp WDL/WDL/swell/swell-modstub.mm -lc++ -framework AppKit -o reaper_ideautoreload.dylib | |
// | |
// cl /nologo /O2 reaper_idenoreload.cpp User32.lib /link /OPT:REF /PDBALTPATH:%_PDB% /DLL /OUT:reaper_ideautoreload.dll | |
#ifndef _WIN32 | |
# include <sys/mman.h> | |
# include <WDL/wdltypes.h> | |
#endif | |
#include <cstdint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// equivalent to __builtin_return_address(1); | |
uintptr_t rbp {}; | |
asm("mov %%rbp, %0" : "=r"(rbp)); | |
rbp = *reinterpret_cast<uintptr_t *>(rbp); // dig one level | |
intptr_t *ret { reinterpret_cast<uintptr_t *>(rbp + 8) }; | |
*ret = s_current->m_redirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConfigVar Layout | |
// | |
// 1. Grab reaper_plugin.h from https://landoleet.org/dev/reaper_plugin.h | |
// 2. Grab reaper_plugin_functions.h by running the REAPER action "[developer] Write C++ API functions header" | |
// 3. Grab WDL: git clone https://github.com/justinfrankel/WDL.git | |
// 4. Build then copy or link the binary file into <REAPER resource directory>/UserPlugins | |
// | |
// Linux | |
// ===== | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// if(rec->caller_version != REAPER_PLUGIN_VERSION || !loadAPI(rec->GetFunc)) | |
// return 0; | |
// See also (bare-bone REAPER extension): | |
// https://gist.github.com/cfillion/f32b04e75e84e03cc463abb1eda41400 | |
#define REQUIRED_API(name) {(void **)&name, #name, true} | |
#define OPTIONAL_API(name) {(void **)&name, #name, false} | |
static bool loadAPI(void *(*getFunc)(const char *)) |