iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
ReaperExtBase.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#pragma once
12
19#include "IPlugTimer.h"
21
22struct reaper_plugin_info_t;
23
24BEGIN_IPLUG_NAMESPACE
25
27class ReaperExtBase : public EDITOR_DELEGATE_CLASS
28{
29public:
30 ReaperExtBase(reaper_plugin_info_t* pRec);
31
32 virtual ~ReaperExtBase();
33
34 //IEditorDelegate
35 void BeginInformHostOfParamChangeFromUI(int paramIdx) override {}; // NO-OP
36
37 void EndInformHostOfParamChangeFromUI(int paramIdx) override {}; // NO-OP
38
39 bool EditorResizeFromUI(int viewWidth, int viewHeight, bool needsPlatformResize) override;
40
42 virtual void OnIdle() {}; // NO-OP
43
47 void RegisterAction(const char* actionName, std::function<void()> func, bool addMenuItem = false, int* pToggle = nullptr/*, IKeyPress keyCmd*/);
48
50 void ShowHideMainWindow();
51
52 void ToggleDocking();
53
54public:
55 // Reaper calls back to this when it wants to execute an action registered by the extension plugin
56 static bool HookCommandProc(int command, int flag);
57
58 // Reaper calls back to this when it wants to know an actions toggle state
59 static int ToggleActionCallback(int command);
60
61private:
62 static WDL_DLGRET MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
63
64 void OnTimer(Timer& t);
65
66 reaper_plugin_info_t* mRec = nullptr;
67 std::unique_ptr<Timer> mTimer;
68 bool mDocked = false;
69};
70
71END_IPLUG_NAMESPACE
Used for choosing an editor delegate.
This file includes classes for implementing timers - in order to get a regular callback on the main t...
Reaper extension base class interface.
Definition: ReaperExtBase.h:28
void ShowHideMainWindow()
void RegisterAction(const char *actionName, std::function< void()> func, bool addMenuItem=false, int *pToggle=nullptr)
virtual void OnIdle()
Definition: ReaperExtBase.h:42
Base class for timer.
Definition: IPlugTimer.h:40