Mercurial > hg > ambi-plugin
view Source/GUI.h @ 0:2fa9c10568d1
Initial setup.
author | martinm_home <martin.morrell@eecs.qmul.ac.uk> |
---|---|
date | Tue, 14 Aug 2012 09:34:15 +0100 |
parents | |
children | e85bd6381a58 |
line wrap: on
line source
//----------------------------------------------------------------------------- // VSTGUI: Graphical User Interface Framework for VST plugins : // // Version 3.5 // //----------------------------------------------------------------------------- // VSTGUI LICENSE // © 2008, Steinberg Media Technologies, All Rights Reserved //----------------------------------------------------------------------------- // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of the Steinberg Media Technologies nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED // OF THE POSSIBILITY OF SUCH DAMAGE. //----------------------------------------------------------------------------- #ifndef __MyEditor__ #define __MyEditor__ #include "aeffguieditor.h" #include <vstgui.h> #include "SoundField.h" //#include <stream.h> //#include <stdio.h> #include "SoundFieldParameters.h" #include "MyPlot.h" class MyEditor : public AEffGUIEditor, public CControlListener { public: MyEditor (void*); // from AEffGUIEditor bool open (void* ptr); void close (); void setParameter (VstInt32 index, float value); void setParameterAutomated(); void getParameterDisplay (VstInt32 index, char *text); // from CControlListener void valueChanged (CControl* pControl); CControl* controls[kNumParameters]; char displayText; CTextLabel* paramMode; CTextLabel* paramModeSelect; CTextLabel* paramWidth; CTextLabel* paramPattern; CTextLabel* paramRotate; CTextLabel* paramTilt; CTextLabel* paramTumble; CTextLabel* paramZoom; CTextLabel* paramZoomMethod; CTextLabel* paramRearVerb; CTextLabel* paramHiVerb; CTextLabel* paramModeStereo; //CDrawContext* stereoPlotDraw; MyPlot *PolarPlot; // own function void transformsDisplay(int &transformsHoz, int &transformsEl, int &transformsSep, CFrame* newFrame); void zoomDisplay(int &zoomHoz, int &zoomEl, int &zoomSep, CFrame* newFrame); void stereoDisplay(int &stereoHoz, int &stereoEl, int &stereoSep, CFrame* newFrame); void nameDisplay(int &nameHoz, int &nameEl, int &nameSep, CFrame* newFrame); void stereoPlot(int &plotHoz, int &plotEl); void suspendDisplay(); void resumeDisplay(); protected: int textDepth, textDepthLarge, labelOffset, displayOffset; CAnimKnob *knobRotate; CAnimKnob *knobTilt; CAnimKnob *knobTumble; CHorizontalSwitch *knobZoomMethod; CAnimKnob *knobZoom; CAnimKnob *knobWidth; CAnimKnob *knobPattern; CHorizontalSwitch *knobMode; CAnimKnob *knobRearVerb; CAnimKnob *knobHiVerb; CRect frameSize; CRect DisplaySize; CRect LabelSize; CRect r; CColor kDisplayText; CColor kDisplayBackground; CColor kLabelText; CColor kBlank; CBitmap* knob_360; CBitmap* knob_red; CBitmap* knob_blue; CBitmap* knob_red_blue; CBitmap* knob_mode2; CBitmap* knob_mode4; CBitmap *bRotations; CBitmap *bZoom; CBitmap *bStereo; CBitmap *bName; CTextLabel* suspend; CTextLabel* bitMode; }; class LineStyleTestView : public CControl { public: LineStyleTestView (const CRect& size) : CControl (size) {} void setupLineStyle (CDrawContext* context) { context->setFrameColor (kBlackCColor); context->setDrawMode (kAntiAliasing); context->setLineWidth (5); const CCoord kDefaultOnOffDashLength[] = {1, 2}; switch ((int32_t)value) { case 0: context->setLineStyle (kLineSolid); break; case 1: context->setLineStyle (CLineStyle (CLineStyle::kLineCapButt, CLineStyle::kLineJoinRound)); break; case 2: context->setLineStyle (CLineStyle (CLineStyle::kLineCapButt, CLineStyle::kLineJoinBevel)); break; case 3: context->setLineStyle (kLineOnOffDash); break; case 4: context->setLineStyle (CLineStyle (CLineStyle::kLineCapRound, CLineStyle::kLineJoinMiter, 0, 2, kDefaultOnOffDashLength)); break; case 5: context->setLineStyle (CLineStyle (CLineStyle::kLineCapSquare, CLineStyle::kLineJoinMiter, 0, 2, kDefaultOnOffDashLength)); break; } } void draw (CDrawContext* context) { CGraphicsPath* path = context->createGraphicsPath (); if (path) { CRect r (getViewSize ()); r.inset (5, 5); path->beginSubpath (CPoint (r.left + r.getWidth () / 2, r.top)); path->addLine (CPoint (r.left, r.bottom)); path->addLine (CPoint (r.right, r.bottom)); path->closeSubpath (); setupLineStyle (context); context->drawGraphicsPath (path, CDrawContext::kPathStroked); path->forget (); } setDirty (false); } CLASS_METHODS(LineStyleTestView, CControl) }; #endif // __MyEditor__