mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-03 09:09:47 +02:00
This brings the builtin, LV2, and VAMP effects inline with the Audio Units, LADSPA, and VST effects. All effects now share a common UI. This gives all effects (though not implemented for all): User and factory preset capability Preset import/export capability Shared or private configuration options Builtin effects can now be migrated to RTP, depending on algorithm. LV2 effects now support graphical interfaces if the plugin supplies one. Nyquist prompt enhanced to provide some features of the Nyquist Workbench. It may not look like it, but this was a LOT of work, so trust me, there WILL be problems and everything effect related should be suspect. Keep a sharp eye (or two) open.
236 lines
5.3 KiB
C++
236 lines
5.3 KiB
C++
/**********************************************************************
|
|
|
|
NyqBench.h
|
|
|
|
Leland Lucius
|
|
|
|
**********************************************************************/
|
|
|
|
#ifndef __NYQUIST_EFFECT_WORKBENCH__
|
|
#define __NYQUIST_EFFECT_WORKBENCH__
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/button.h>
|
|
#include <wx/dialog.h>
|
|
#include <wx/filename.h>
|
|
#include <wx/fdrepdlg.h>
|
|
#include <wx/hashmap.h>
|
|
#include <wx/splitter.h>
|
|
#include <wx/statbox.h>
|
|
#include <wx/stattext.h>
|
|
#include <wx/string.h>
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <iostream>
|
|
#include <ostream>
|
|
#include <sstream>
|
|
|
|
#include "commands/CommandManager.h"
|
|
#include "effects/nyquist/Nyquist.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
// NyqTextCtrl
|
|
//----------------------------------------------------------------------------
|
|
|
|
class NyqTextCtrl:public wxTextCtrl
|
|
{
|
|
public:
|
|
NyqTextCtrl(wxWindow *parent,
|
|
wxWindowID id,
|
|
const wxString & value,
|
|
const wxPoint & pos,
|
|
const wxSize & size,
|
|
int style = 0);
|
|
|
|
void SetFocusFromKbd();
|
|
void MarkDirty();
|
|
|
|
void GoMatch();
|
|
void GoTop();
|
|
void GoUp();
|
|
void GoPrev();
|
|
void GoNext();
|
|
|
|
private:
|
|
#if defined(__WXMAC__)
|
|
void OnKeyDown(wxKeyEvent & e);
|
|
#endif
|
|
void OnKeyUp(wxKeyEvent & e);
|
|
void OnChar(wxKeyEvent & e);
|
|
void OnUpdate(wxUpdateUIEvent & e);
|
|
|
|
void MoveCursor(long first, long second);
|
|
void Colorize(long left, long right);
|
|
void FindParens();
|
|
|
|
private:
|
|
wxLongToLongHashMap mLeftParens;
|
|
wxLongToLongHashMap mRightParens;
|
|
|
|
long mLeftParen;
|
|
long mRightParen;
|
|
|
|
long mLastCaretPos;
|
|
|
|
wxTextAttr mOn;
|
|
wxTextAttr mOff;
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
};
|
|
|
|
//----------------------------------------------------------------------------
|
|
// NyqRedirector
|
|
//----------------------------------------------------------------------------
|
|
|
|
class NyqRedirector:wxSTD streambuf
|
|
{
|
|
public:
|
|
NyqRedirector(NyqTextCtrl *text);
|
|
virtual ~NyqRedirector();
|
|
|
|
int overflow(int c);
|
|
|
|
private:
|
|
void AppendText();
|
|
|
|
std::string s;
|
|
std::streambuf *mOld;
|
|
NyqTextCtrl *mText;
|
|
};
|
|
|
|
//----------------------------------------------------------------------------
|
|
// NyqBench
|
|
//----------------------------------------------------------------------------
|
|
|
|
class NyqBench:public wxFrame
|
|
{
|
|
public:
|
|
NyqBench(wxWindow *parent);
|
|
virtual ~NyqBench();
|
|
|
|
virtual bool Validate();
|
|
|
|
private:
|
|
void PopulateOrExchange(ShuttleGui & S);
|
|
|
|
void OnClose(wxCloseEvent & e);
|
|
void OnMove(wxMoveEvent & e);
|
|
void OnSize(wxSizeEvent & e);
|
|
|
|
void OnNew(wxCommandEvent & e);
|
|
void OnOpen(wxCommandEvent & e);
|
|
void OnSave(wxCommandEvent & e);
|
|
void OnSaveAs(wxCommandEvent & e);
|
|
void OnRevert(wxCommandEvent & e);
|
|
void OnAutoLoad(wxCommandEvent & e);
|
|
void OnCloseWindow(wxCommandEvent & e);
|
|
|
|
void OnUndo(wxCommandEvent & e);
|
|
void OnRedo(wxCommandEvent & e);
|
|
void OnCut(wxCommandEvent & e);
|
|
void OnCopy(wxCommandEvent & e);
|
|
void OnPaste(wxCommandEvent & e);
|
|
void OnClear(wxCommandEvent & e);
|
|
void OnSelectAll(wxCommandEvent & e);
|
|
void OnFind(wxCommandEvent & e);
|
|
void OnGoMatch(wxCommandEvent & e);
|
|
void OnGoTop(wxCommandEvent & e);
|
|
void OnGoUp(wxCommandEvent & e);
|
|
void OnGoPrev(wxCommandEvent & e);
|
|
void OnGoNext(wxCommandEvent & e);
|
|
void OnAutoWrap(wxCommandEvent & e);
|
|
|
|
void OnFont(wxCommandEvent & e);
|
|
void OnSplitV(wxCommandEvent & e);
|
|
void OnSplitH(wxCommandEvent & e);
|
|
void OnToggleCode(wxCommandEvent & e);
|
|
void OnToggleOutput(wxCommandEvent & e);
|
|
void OnSmallIcons(wxCommandEvent & e);
|
|
void OnLargeIcons(wxCommandEvent & e);
|
|
|
|
void OnGo(wxCommandEvent & e);
|
|
void OnStop(wxCommandEvent & e);
|
|
|
|
void OnAbout(wxCommandEvent & e);
|
|
|
|
void OnFindDialog(wxFindDialogEvent & e);
|
|
|
|
void OnTextUpdate(wxCommandEvent & e);
|
|
|
|
void OnMenuUpdate(wxUpdateUIEvent & e);
|
|
|
|
void OnUndoUpdate(wxUpdateUIEvent & e);
|
|
void OnRedoUpdate(wxUpdateUIEvent & e);
|
|
void OnCutUpdate(wxUpdateUIEvent & e);
|
|
void OnCopyUpdate(wxUpdateUIEvent & e);
|
|
void OnPasteUpdate(wxUpdateUIEvent & e);
|
|
void OnClearUpdate(wxUpdateUIEvent & e);
|
|
|
|
void OnViewUpdate(wxUpdateUIEvent & e);
|
|
|
|
void OnRunUpdate(wxUpdateUIEvent & e);
|
|
|
|
void OnScriptUpdate(wxUpdateUIEvent & e);
|
|
void OnOutputUpdate(wxUpdateUIEvent & e);
|
|
|
|
void SetWindowTitle();
|
|
|
|
void RecreateToolbar(bool large = false);
|
|
|
|
void LoadFile();
|
|
|
|
private:
|
|
wxStaticBox *mScriptBox;
|
|
wxStaticBox *mOutputBox;
|
|
NyqTextCtrl *mScript;
|
|
NyqTextCtrl *mOutput;
|
|
wxSplitterWindow *mSplitter;
|
|
|
|
wxFindReplaceDialog *mFindDlg;
|
|
wxFindReplaceData mFindData;
|
|
NyqTextCtrl *mFindText;
|
|
|
|
NyquistEffect *mEffect;
|
|
|
|
wxFont mScriptFont;
|
|
wxFont mOutputFont;
|
|
|
|
wxBitmap mPics[20];
|
|
|
|
int mSplitMode;
|
|
bool mShowCode;
|
|
bool mShowOutput;
|
|
|
|
bool mLargeIcons;
|
|
|
|
bool mRunning;
|
|
|
|
wxFileName mPath;
|
|
bool mAutoLoad;
|
|
bool mAutoWrap;
|
|
|
|
wxRect mLastSize;
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
};
|
|
|
|
class ModNyqBenchCommandFunctor:public CommandFunctor
|
|
{
|
|
public:
|
|
virtual void operator()(int index = 0, const wxEvent *e = NULL);
|
|
};
|
|
|
|
#endif
|
|
|
|
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
|
// version control system. Please do not modify past this point.
|
|
//
|
|
// Local Variables:
|
|
// c-basic-offset: 3
|
|
// indent-tabs-mode: nil
|
|
// End:
|
|
//
|
|
// vim: et sts=3 sw=3
|
|
// arch-tag: cad436f5-7c97-40a2-8ee9-3748e8f3e56f
|