This file contains hidden or 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
-- @version 1.0beta | |
-- @author cfillion | |
local EXT_SECTION = 'cfillion_project_list' | |
local function makeKey(i) | |
return string.format('project%d', i) | |
end | |
local function enumOpenedProjects() |
This file contains hidden or 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
// ==UserScript== | |
// @name Original poster indicator | |
// @namespace https://cfillion.ca | |
// @version 1.2 | |
// @author cfillion | |
// @include https://forum.cockos.com/showthread.php* | |
// ==/UserScript== | |
// See also: syntax-highlighting.user.js https://gist.github.com/cfillion/7fd2bfe13465a8a37d28a9f0fd60b13b |
This file contains hidden or 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
// Extracted from ReaPack's and ReaImGui's source code (LGPL v3) | |
/* Usage example: | |
static int HelloWorld(int foo, int bar) { return foo * bar; } | |
extern "C" REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT( | |
REAPER_PLUGIN_HINSTANCE instance, reaper_plugin_info_t *rec) | |
{ | |
// ... | |
// API_HelloWorld and APIdef_HelloWorld must also be registered as usual |
This file contains hidden or 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 <memory> | |
#ifdef _WIN32 | |
# include <windows.h> | |
#else | |
# include <swell/swell.h> | |
# include <wdltypes.h> // GWLP_WNDPROC | |
#endif | |
#define REAPERAPI_IMPLEMENT |
This file contains hidden or 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
// Demo REAPER extension to intercept keyboard input | |
// https://i.imgur.com/xMSrqRr.gif | |
#include <cstdio> | |
#include <reaper_plugin.h> | |
static int (*plugin_register)(const char *name, void *infostruct); | |
static int HandleKey(MSG *, accelerator_register_t *); | |
static accelerator_register_t g_accel{HandleKey, true}; |
This file contains hidden or 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
function checkJSAPI(requiredVersion) | |
if reaper.JS_ReaScriptAPI_Version and reaper.JS_ReaScriptAPI_Version() >= requiredVersion then | |
return true | |
end | |
local button = reaper.MB(string.format([[ | |
This script requires js_ReaScriptAPI %s or newer. Do you want to install it now? | |
Choose [Yes] to open ReaPack's package browser. | |
]], requiredVersion), "js_ReaScriptAPI not found", 4) |
This file contains hidden or 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
-- http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html | |
-- usage example at the end | |
local WavReader = {} | |
WavReader.__index = WavReader | |
function WavReader.new(fn) | |
local self = setmetatable({}, WavReader) | |
self.file, err = io.open(fn) |
This file contains hidden or 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++ -lfontconfig fctest.cpp | |
// ./a.out 'DejaVu Sans Mono' monospace 'Andale Mono' 'Ubuntu Mono' Lato | |
#include <cstdio> | |
#include <fontconfig/fontconfig.h> | |
class FontConfig { | |
public: | |
FontConfig() : m_config(FcInitLoadConfigAndFonts()) {} | |
FontConfig(const FontConfig &) = delete; |
This file contains hidden or 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
-- https://forum.cockos.com/showthread.php?t=200086 | |
function solo(trackIndex) | |
local track = reaper.GetTrack(0, trackIndex) | |
if not track then return false end | |
reaper.PreventUIRefresh(1) | |
reaper.SoloAllTracks(0) | |
reaper.SetMediaTrackInfo_Value(track, 'I_SOLO', 1) |