Reaper plugin functions.h

From CockosWiki

Jump to: navigation, search

The file reaper_plugin_functions.h can be generated within REAPER, Actions Menu, dev in search box.

The partial listing below is for illustration only, go generate an up to date (and complete) version from REAPER.

#ifndef _REAPER_PLUGIN_FUNCTIONS_H_
#define _REAPER_PLUGIN_FUNCTIONS_H_

// REAPER API functions
// Generated by REAPER v3.15

// Note: the C++ pure virtual interfaces used require the MSVC-compatible C++ ABI on Win32.  Sorry, mingw users.
//
// Reaper extensions: see http://www.cockos.com/reaper/sdk/plugin/plugin.php and reaper_plugin.h.
// The API functions in this header can be retrieved using reaper_plugin_info_t.GetFunc().
//
// VST plugins: see http://www.cockos.com/reaper/sdk/vst/vst_ext.php
// The API functions in this header can be retrieved using audioMasterCallback.
//
// Because the API is dynamic, callers should never assume a function exists.
// Check that a non-NULL function pointer was returned before using it.

#ifndef _LICE_H
typedef unsigned int LICE_pixel;
typedef unsigned char LICE_pixel_chan;
class LICE_IBitmap;
class LICE_IFont;
#endif

class WDL_VirtualWnd_BGCfg;

// easiest to include reaper_plugin.h before reaper_plugin_functions.h in your application code.
// if not, you may need to edit this path.
#ifndef _REAPER_PLUGIN_H_
#include "reaper_plugin.h"
#endif

#ifndef REAPERAPI_DECL
#define REAPERAPI_DECL extern
#endif

// __mergesort is a stable sorting function with an API similar to qsort().
// HOWEVER, it requires some temporary space, equal to the size of the data being sorted, so you can pass it as the last parameter,
// or NULL and it will allocate and free space internally.
REAPERAPI_DECL void (*__mergesort)(void* base, size_t nmemb, size_t size, int (*cmpfunc)(const void*,const void*), void* tmpspace);

// menuidstr is some unique identifying string
// menuname is for main menus only (displayed in a menu bar somewhere), NULL otherwise
// kbdsecname is the name of the KbdSectionInfo registered by this plugin, or NULL for the main actions section
REAPERAPI_DECL bool (*AddCustomizableMenu)(const char* menuidstr, const char* menuname, const char* kbdsecname, bool addtomainmenu);

// Add an Extensions main menu, which the extension can populate/modify with plugin_register("hookcustommenu")
REAPERAPI_DECL bool (*AddExtensionsMainMenu)();

// creates a new media item.
REAPERAPI_DECL MediaItem* (*AddMediaItemToTrack)(MediaTrack* tr);

// Returns the index of the created marker/region, or -1 on failure. Supply wantidx>=0 if you want a particular index number, but you'll get a different index number a region and wantidx is already in use.
REAPERAPI_DECL int (*AddProjectMarker)(ReaProject* proj, bool isrgn, double pos, double rgnend, const char* name, int wantidx);

// creates a new take in an item
REAPERAPI_DECL MediaItem_Take* (*AddTakeToMediaItem)(MediaItem* item);

// forceset=0,doupd=true,centermode=-1 for default
REAPERAPI_DECL void (*adjustZoom)(double amt, int forceset, bool doupd, int centermode);

REAPERAPI_DECL void (*APITest)();

// is in pre-buffer? threadsafe
REAPERAPI_DECL int (*Audio_IsPreBuffer)();

// is audio running at all? threadsafe
REAPERAPI_DECL int (*Audio_IsRunning)();

// return >0 on success
REAPERAPI_DECL int (*Audio_RegHardwareHook)(bool isAdd, audio_hook_register_t* reg);

// -1 = bypass all if not all bypassed,otherwise unbypass all
REAPERAPI_DECL void (*BypassFxAllTracks)(int bypass);

REAPERAPI_DECL int (*CalculatePeaks)(PCM_source_transfer_t* srcBlock, PCM_source_peaktransfer_t* pksBlock);

REAPERAPI_DECL void (*ClearAllRecArmed)();

// resets the global peak caches
REAPERAPI_DECL void (*ClearPeakCache)();

// count the number of items in the project (proj=0 for active project)
REAPERAPI_DECL int (*CountMediaItems)(ReaProject* proj);

// count the number of selected items in the project (proj=0 for active project)
REAPERAPI_DECL int (*CountSelectedMediaItems)(ReaProject* proj);

// count the number of selected tracks in the project (proj=0 for active project)
REAPERAPI_DECL int (*CountSelectedTracks)(ReaProject* proj);

// count the number of takes in the item
REAPERAPI_DECL int (*CountTakes)(MediaItem* item);

// see GetTrackEnvelope
REAPERAPI_DECL int (*CountTrackEnvelopes)(MediaTrack* track);

// count the number of items in the track
REAPERAPI_DECL int (*CountTrackMediaItems)(MediaTrack* track);

// count the number of tracks in the project (proj=0 for active project)
REAPERAPI_DECL int (*CountTracks)(ReaProject* proj);

REAPERAPI_DECL midi_Input* (*CreateMIDIInput)(int dev);

REAPERAPI_DECL midi_Output* (*CreateMIDIOutput)(int dev, bool streamMode, int* msoffset100);

// call this to force flushing of the undo states after using CSurf_On*Change()
REAPERAPI_DECL void (*CSurf_FlushUndo)(bool force);

(and lots more)