iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE > Class Template Reference

Vectorial bar graph spectrum analyzer control with segmented LEDs. More...

#include <IVBarGraphSpectrumAnalyzerControl.h>

Inheritance diagram for IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >:
[legend]

Public Types

enum  MsgTags {
  kMsgTagSampleRate = 1 , kMsgTagFFTSize , kMsgTagOverlap , kMsgTagWindowType ,
  kMsgTagOctaveGain
}
 Message tags for synchronization with ISpectrumSender. More...
 
enum class  EFrequencyScale { Linear , Log , ThirdOctave }
 
enum class  EColorMode { Segments , Smooth }
 
enum class  EChannelMode {
  Left , Right , Sum , SideBySide ,
  Split
}
 
using TDataPacket = std::array< float, MAX_FFT_SIZE >
 

Public Member Functions

 IVBarGraphSpectrumAnalyzerControl (const IRECT &bounds, const char *label="", const IVStyle &style=DEFAULT_STYLE, int nBars=32, int nSegsPerBar=16, EFrequencyScale freqScale=EFrequencyScale::Log, EColorMode colorMode=EColorMode::Segments, EChannelMode channelMode=EChannelMode::Sum, const IPattern &barPattern=IPattern(COLOR_GREEN), const std::vector< SpectrumLEDRange > &ledRanges={ {0.f, 6.f, 2, SPEC_LED5}, {-12.f, 0.f, 3, SPEC_LED4}, {-24.f, -12.f, 3, SPEC_LED3}, {-48.f, -24.f, 4, SPEC_LED2}, {-72.f, -48.f, 4, SPEC_LED1} }, float gapRatio=0.2f, float segGapRatio=0.1f, float attackTimeMs=5.0f, float decayTimeMs=50.0f, float lowRangeDB=-72.f, float highRangeDB=6.f)
 Create a bar graph spectrum analyzer. More...
 
void OnResize () override
 Called when IControl is constructed or resized using SetRect(). More...
 
void OnMsgFromDelegate (int msgTag, int dataSize, const void *pData) override
 Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate() More...
 
void OnMouseDown (float x, float y, const IMouseMod &mod) override
 Implement this method to respond to a mouse down event on this control. More...
 
void OnPopupMenuSelection (IPopupMenu *pSelectedMenu, int valIdx) override
 Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput. More...
 
void Draw (IGraphics &g) override
 Draw the control to the graphics context. More...
 
void SetNumBars (int nBars)
 
void SetNumSegments (int nSegs)
 
void SetColorMode (EColorMode mode)
 
void SetChannelMode (EChannelMode mode)
 
void SetBarPattern (const IPattern &pattern)
 Set the bar pattern for Smooth color mode. More...
 
void SetFrequencyScale (EFrequencyScale scale)
 
void SetPeakHoldTime (int timeMs)
 
void SetShowPeaks (bool show)
 
void SetClipIndicator (float thresholdDB, const IColor &clipColor=COLOR_RED)
 Enable a clip indicator segment above a threshold. More...
 
void SetShowClipIndicator (bool show)
 
void SetFFTSize (int fftSize)
 
void SetSampleRate (double sr)
 
void SetOctaveGain (float octaveGain)
 
- Public Member Functions inherited from IControl
 IControl (const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
 Constructor. More...
 
 IControl (const IRECT &bounds, const std::initializer_list< int > &params, IActionFunction actionFunc=nullptr)
 Constructor (range of parameters) More...
 
 IControl (const IRECT &bounds, IActionFunction actionFunc)
 Constructor (no paramIdx) More...
 
 IControl (const IControl &)=delete
 
void operator= (const IControl &)=delete
 
virtual ~IControl ()
 Destructor. More...
 
virtual void OnMouseDown (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse down event on this control. More...
 
virtual void OnMouseUp (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse up event on this control. More...
 
virtual void OnMouseDrag (float x, float y, float dX, float dY, const IMouseMod &mod)
 Implement this method to respond to a mouse drag event on this control. More...
 
virtual void OnMouseDblClick (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouse double click event on this control. More...
 
virtual void OnMouseWheel (float x, float y, const IMouseMod &mod, float d)
 Implement this method to respond to a mouse wheel event on this control. More...
 
virtual bool OnKeyDown (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key down event on this control. More...
 
virtual bool OnKeyUp (float x, float y, const IKeyPress &key)
 Implement this method to respond to a key up event on this control. More...
 
virtual void OnMouseOver (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a mouseover event on this control. More...
 
virtual void OnMouseOut ()
 Implement this method to respond to a mouseout event on this control. More...
 
virtual void OnTouchCancelled (float x, float y, const IMouseMod &mod)
 Implement this method to respond to a touch cancel event on this control. More...
 
virtual void OnDrop (const char *str)
 Implement to do something when something was drag 'n dropped onto this control. More...
 
virtual void OnDropMultiple (const std::vector< const char * > &paths)
 Implement to handle multiple items drag 'n dropped onto this control. More...
 
virtual void OnRescale ()
 Implement to do something when graphics is scaled globally (e.g. More...
 
virtual void OnResize ()
 Called when IControl is constructed or resized using SetRect(). More...
 
virtual void OnInit ()
 Called just prior to when the control is attached, after its delegate and graphics member variable set. More...
 
virtual void OnAttached ()
 Called after the control has been attached, and its delegate and graphics member variable set. More...
 
virtual void OnMsgFromDelegate (int msgTag, int dataSize, const void *pData)
 Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate() More...
 
virtual void OnMidi (const IMidiMsg &msg)
 Implement to receive MIDI messages sent to the control if mWantsMidi == true, see IEditorDelegate:SendMidiMsgFromDelegate() More...
 
virtual bool OnGesture (const IGestureInfo &info)
 
virtual void CreateContextMenu (IPopupMenu &contextMenu)
 Called by default when the user right clicks a control. More...
 
virtual void OnPopupMenuSelection (IPopupMenu *pSelectedMenu, int valIdx)
 Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput. More...
 
virtual void OnDeleteFromPopupMenu (IPopupMenu *pMenu, int itemIdx)
 Implement this method to handle popup menu deletion interactions (on IOS) after IGraphics::CreatePopupMenu/IControlPromptUserInput. More...
 
virtual void OnTextEntryCompletion (const char *str, int valIdx)
 Implement this method to handle text input after IGraphics::CreateTextEntry/IControlPromptUserInput. More...
 
virtual void OnContextSelection (int itemSelected)
 Implement this to respond to a menu selection from CreateContextMenu();. More...
 
virtual void Draw (IGraphics &g)=0
 Draw the control to the graphics context. More...
 
virtual void DrawPTHighlight (IGraphics &g)
 Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format only), when a control is linked to a parameter that is automated. More...
 
void PromptUserInput (int valIdx=0)
 Call this method in response to a mouse event to create an edit box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) More...
 
void PromptUserInput (const IRECT &bounds, int valIdx=0)
 Create a text entry box so the user can enter a value, or pop up a pop-up menu, if the control is linked to a parameter (mParamIdx > kNoParameter) specifying the bounds. More...
 
IControlSetActionFunction (IActionFunction actionFunc)
 Set an Action Function for this control. More...
 
IControlSetAnimationEndActionFunction (IActionFunction actionFunc)
 Set an Action Function to be called at the end of an animation. More...
 
IControlSetTooltip (const char *str)
 Set a tooltip for the control. More...
 
const char * GetTooltip () const
 
int GetParamIdx (int valIdx=0) const
 Get the index of a parameter that the control is linked to Normaly controls are either linked to a single parameter or no parameter but some may be linked to multiple parameters. More...
 
virtual void SetParamIdx (int paramIdx, int valIdx=0)
 Set the index of a parameter that the control is linked to If you are calling this "manually" to reuse a control for multiple parameters, you probably want to call IEditorDelegate::SendCurrentParamValuesFromDelegate() afterward, to update the control values. More...
 
int LinkedToParam (int paramIdx) const
 Check if the control is linked to a particular parameter. More...
 
int NVals () const
 
virtual int GetValIdxForPos (float x, float y) const
 Check to see which of the control's values relates to this x and y coordinate. More...
 
const IParamGetParam (int valIdx=0) const
 Get a const pointer to the IParam object (owned by the editor delegate class), associated with this control. More...
 
virtual void SetValueFromDelegate (double value, int valIdx=0)
 Set the control's value from the delegate This method is called from the class implementing the IEditorDelegate interface in order to update a control's value members and set it to be marked dirty for redraw. More...
 
virtual void SetValueFromUserInput (double value, int valIdx=0)
 Set the control's value after user input. More...
 
virtual void SetValueToDefault (int valIdx=kNoValIdx)
 Set one or all of the control's values to the default value of the associated parameter. More...
 
virtual void SetValue (double value, int valIdx=0)
 Set one of the control's values. More...
 
double GetValue (int valIdx=0) const
 Get the control's value. More...
 
void SetGroup (const char *groupName)
 Assign the control to a control group. More...
 
const char * GetGroup () const
 Get the group that the control belongs to, if any. More...
 
const ITextGetText () const
 Get the Text object for the control. More...
 
virtual void SetText (const IText &txt)
 Set the Text object typically used to determine font/layout/size etc of the main text in a control. More...
 
void SetBlend (const IBlend &blend)
 Set the Blend for this control. More...
 
IBlend GetBlend () const
 Get the Blend for this control. More...
 
int GetTextEntryLength () const
 Get the max number of characters that are allowed in text entry. More...
 
void SetTextEntryLength (int len)
 Set the max number of characters that are allowed in text entry. More...
 
const IRECTGetRECT () const
 Get the rectangular draw area for this control, within the graphics context. More...
 
void SetRECT (const IRECT &bounds)
 Set the rectangular draw area for this control, within the graphics context. More...
 
const IRECTGetTargetRECT () const
 Get the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetRECT (const IRECT &bounds)
 Set the rectangular mouse tracking target area, within the graphics context for this control. More...
 
void SetTargetAndDrawRECTs (const IRECT &bounds)
 Set BOTH the draw rect and the target area, within the graphics context for this control. More...
 
virtual void SetPosition (float x, float y)
 Set the position of the control, preserving the width and height. More...
 
virtual void SetSize (float w, float h)
 Set the size of the control, preserving the current position. More...
 
void SetPTParameterHighlight (bool isHighlighted, int color)
 Used internally by the AAX wrapper view interface to set the control parmeter highlight. More...
 
bool GetMouseDblAsSingleClick () const
 Get double click as single click By default, mouse double click has its own handler. More...
 
virtual void Hide (bool hide)
 Shows or hides the IControl. More...
 
bool IsHidden () const
 
virtual void SetDisabled (bool disable)
 Sets disabled mode for the control, the default implementation modifies the mBlend member. More...
 
bool IsDisabled () const
 
void SetMouseOverWhenDisabled (bool allow)
 Specify whether the control should respond to mouse overs when disabled. More...
 
void SetMouseEventsWhenDisabled (bool allow)
 Specify whether the control should respond to other mouse events when disabled. More...
 
bool GetMouseOverWhenDisabled () const
 
bool GetMouseEventsWhenDisabled () const
 
bool GetIgnoreMouse () const
 
virtual void SetIgnoreMouse (bool ignore)
 Specify whether the control should respond to mouse events. More...
 
bool GetPromptShowsParamLabel () const
 
void SetPromptShowsParamLabel (bool enable)
 Set if the control should show parameter labels/units e.g. More...
 
virtual bool IsHit (float x, float y) const
 Hit test the control. More...
 
virtual void SetDirty (bool triggerAction=true, int valIdx=kNoValIdx)
 Mark the control as dirty, i.e. More...
 
virtual void SetClean ()
 
void Animate ()
 
virtual bool IsDirty ()
 Called at each display refresh by the IGraphics draw loop, after IControl::Animate(), to determine if the control is marked as dirty. More...
 
void DisablePrompt (bool disable)
 Disable/enable default prompt for user input. More...
 
virtual void OnGUIIdle ()
 This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined. More...
 
int GetTag () const
 Get the control's tag. More...
 
void SetWantsMidi (bool enable=true)
 Specify whether this control wants to know about MIDI messages sent to the UI. More...
 
bool GetWantsMidi () const
 
void SetWantsMultiTouch (bool enable=true)
 Specify whether this control supports multiple touches. More...
 
bool GetWantsMultiTouch () const
 
IControlAttachGestureRecognizer (EGestureType type, IGestureFunc func)
 Add a IGestureFunc that should be triggered in response to a certain type of gesture. More...
 
virtual bool GetWantsGestures () const
 
EGestureType GetLastGesture () const
 
IGEditorDelegateGetDelegate ()
 Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes from this IGraphics instance. More...
 
void SetDelegate (IGEditorDelegate &dlg)
 Used internally to set the mDelegate (and mGraphics) variables. More...
 
IContainerBaseGetParent () const
 
void SetParent (IContainerBase *pParent)
 
IGraphicsGetUI ()
 
const IGraphicsGetUI () const
 
bool GetMouseIsOver () const
 This can be used in IControl::Draw() to check if the mouse is over the control, without implementing mouse over methods. More...
 
virtual void SnapToMouse (float x, float y, EDirection direction, const IRECT &bounds, int valIdx=-1, double minClip=0., double maxClip=1.)
 Set control value based on x, y position within a rectangle. More...
 
virtual void OnEndAnimation ()
 
void StartAnimation (int duration)
 
void SetAnimation (IAnimationFunction func)
 Set the animation function. More...
 
void SetAnimation (IAnimationFunction func, int duration)
 Set the animation function and starts it. More...
 
IAnimationFunction GetAnimationFunction ()
 Get the control's animation function, if it exists. More...
 
IActionFunction GetActionFunction ()
 Get the control's action function, if it exists. More...
 
double GetAnimationProgress () const
 Get the progress in a control's animation, in the range 0-1. More...
 
Milliseconds GetAnimationDuration () const
 Get the duration of animations applied to the control. More...
 
template<class T >
T * As ()
 Helper function to dynamic cast an IControl to a subclass. More...
 
- Public Member Functions inherited from IVectorBase
 IVectorBase (const IVStyle &style, bool labelInWidget=false, bool valueInWidget=false)
 IVectorBase Constructor. More...
 
void AttachIControl (IControl *pControl, const char *label)
 Call in the constructor of your IVControl to link the IVectorBase and IControl. More...
 
virtual void OnStyleChanged ()
 Implement if extra changes are required in response to style changing. More...
 
void SetColor (EVColor colorIdx, const IColor &color)
 Set one of the IVColors that style the IVControl. More...
 
void SetColors (const IVColorSpec &spec)
 Set the colors of this IVControl. More...
 
const IColorGetColor (EVColor color) const
 Get value of a specific EVColor in the IVControl. More...
 
void SetLabelStr (const char *label)
 
const char * GetLabelStr () const
 
void SetValueStr (const char *value)
 
void SetWidgetFrac (float frac)
 
void SetAngle (float angle)
 
void SetShowLabel (bool show)
 
void SetShowValue (bool show)
 
void SetRoundness (float roundness)
 
void SetDrawFrame (bool draw)
 
void SetDrawShadows (bool draw)
 
void SetEmboss (bool draw)
 
void SetShadowOffset (float offset)
 
void SetFrameThickness (float thickness)
 
void SetSplashRadius (float radius)
 
void SetSplashPoint (float x, float y)
 
void SetShape (EVShape shape)
 
virtual void SetStyle (const IVStyle &style)
 Set the Style of this IVControl. More...
 
IVStyle GetStyle () const
 Get the style of this IVControl. More...
 
IRECT GetAdjustedHandleBounds (IRECT handleBounds) const
 Get the adjusted bounds for the widget handle, based on the style settings. More...
 
float GetRoundedCornerRadius (const IRECT &bounds) const
 Get the radius of rounded corners for a rectangle, based on the style roundness factor. More...
 
IRECT GetWidgetBounds () const
 
IRECT GetLabelBounds () const
 
IRECT GetValueBounds () const
 
void DrawSplash (IGraphics &g, const IRECT &clipRegion=IRECT())
 Draw a splash effect when a widget handle is clicked (via SplashClickAnimationFunc) More...
 
virtual void DrawBackground (IGraphics &g, const IRECT &rect)
 Draw the IVControl background (usually transparent) More...
 
virtual void DrawWidget (IGraphics &g)
 Draw the IVControl main widget (override) More...
 
virtual void DrawLabel (IGraphics &g)
 Draw the IVControl label text. More...
 
virtual void DrawValue (IGraphics &g, bool mouseOver)
 Draw the IVControl value text. More...
 
virtual void DrawPressableShape (IGraphics &g, EVShape shape, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled)
 Call one of the DrawPressableShape methods. More...
 
void DrawPressableEllipse (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled)
 Draw an ellipse-shaped vector button. More...
 
IRECT DrawPressableRectangle (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled, bool rtl=true, bool rtr=true, bool rbl=true, bool rbr=true)
 Draw a rectangle-shaped vector button. More...
 
IRECT DrawPressableTriangle (IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, float angle, bool disabled)
 Draw a triangle-shaped vector button. More...
 
IRECT MakeRects (const IRECT &parent, bool hasHandle=false)
 Calculate the rectangles for the various areas, depending on the style. More...
 

Static Public Attributes

static constexpr float kPeakDecayRate = 0.95f
 

Additional Inherited Members

- Protected Member Functions inherited from IControl
template<typename T , typename... Args>
void ForValIdx (int valIdx, T func, Args... args)
 A helper template function to call a method for an individual value, or for all values. More...
 
void SetNVals (int nVals)
 
- Protected Attributes inherited from IControl
IRECT mRECT
 
IRECT mTargetRECT
 
WDL_String mGroup
 Controls can be grouped for hiding and showing panels. More...
 
IText mText
 
IBlend mBlend
 
int mTextEntryLength = DEFAULT_TEXT_ENTRY_LEN
 
bool mDirty = true
 
bool mHide = false
 
bool mDisabled = false
 
bool mDisablePrompt = true
 
bool mDblAsSingleClick = false
 
bool mMouseOverWhenDisabled = false
 
bool mMouseEventsWhenDisabled = false
 
bool mIgnoreMouse = false
 
bool mWantsMidi = false
 
bool mWantsMultiTouch = false
 
bool mPromptShowsParamLabel = false
 
bool mMouseIsOver = false
 if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control. More...
 
WDL_String mTooltip
 
IColor mPTHighlightColor = COLOR_RED
 
bool mPTisHighlighted = false
 
- Protected Attributes inherited from IVectorBase
IControlmControl = nullptr
 
IVStyle mStyle
 
bool mLabelInWidget = false
 
bool mValueInWidget = false
 
float mSplashRadius = 0.f
 
IVec2 mSplashPoint = {0.f, 0.f}
 
float mMaxSplashRadius = 50.f
 
float mTrackSize = 2.f
 
float mValueDisplayFrac = 0.66f
 
IRECT mWidgetBounds
 
IRECT mLabelBounds
 
IRECT mValueBounds
 
WDL_String mLabelStr
 
WDL_String mValueStr
 
EVShape mShape = EVShape::Rectangle
 

Detailed Description

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
class IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >

Vectorial bar graph spectrum analyzer control with segmented LEDs.

Definition at line 56 of file IVBarGraphSpectrumAnalyzerControl.h.

Member Typedef Documentation

◆ TDataPacket

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
using IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::TDataPacket = std::array<float, MAX_FFT_SIZE>

Definition at line 60 of file IVBarGraphSpectrumAnalyzerControl.h.

Member Enumeration Documentation

◆ EChannelMode

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
enum class IVBarGraphSpectrumAnalyzerControl::EChannelMode
strong

Definition at line 74 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ EColorMode

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
enum class IVBarGraphSpectrumAnalyzerControl::EColorMode
strong

Definition at line 73 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ EFrequencyScale

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
enum class IVBarGraphSpectrumAnalyzerControl::EFrequencyScale
strong

Definition at line 72 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ MsgTags

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
enum IVBarGraphSpectrumAnalyzerControl::MsgTags

Message tags for synchronization with ISpectrumSender.

Definition at line 63 of file IVBarGraphSpectrumAnalyzerControl.h.

Constructor & Destructor Documentation

◆ IVBarGraphSpectrumAnalyzerControl()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::IVBarGraphSpectrumAnalyzerControl ( const IRECT bounds,
const char *  label = "",
const IVStyle style = DEFAULT_STYLE,
int  nBars = 32,
int  nSegsPerBar = 16,
EFrequencyScale  freqScale = EFrequencyScale::Log,
EColorMode  colorMode = EColorMode::Segments,
EChannelMode  channelMode = EChannelMode::Sum,
const IPattern barPattern = IPattern(COLOR_GREEN),
const std::vector< SpectrumLEDRange > &  ledRanges = { {0.f, 6.f, 2, SPEC_LED5}, {-12.f, 0.f, 3, SPEC_LED4}, {-24.f, -12.f, 3, SPEC_LED3}, {-48.f, -24.f, 4, SPEC_LED2}, {-72.f, -48.f, 4, SPEC_LED1} },
float  gapRatio = 0.2f,
float  segGapRatio = 0.1f,
float  attackTimeMs = 5.0f,
float  decayTimeMs = 50.0f,
float  lowRangeDB = -72.f,
float  highRangeDB = 6.f 
)
inline

Create a bar graph spectrum analyzer.

Parameters
boundsThe rectangular area that the control occupies
labelA CString to label the control
styleIVStyle for the control
nBarsNumber of frequency bars to display
nSegsPerBarNumber of vertical LED segments per bar
freqScaleLinear or logarithmic frequency distribution
colorModeSegments (LED-style) or Smooth (continuous gradient)
channelModeHow to display stereo channels (Left, Right, Sum, SideBySide)
barPatternIPattern for Smooth mode - solid color or gradient
ledRangesLED color ranges for Segments mode
gapRatioGap between bars as ratio of bar width (0-1)
segGapRatioGap between segments as ratio of segment height (0-1)
attackTimeMsAttack smoothing in milliseconds
decayTimeMsDecay smoothing in milliseconds
lowRangeDBLower dB range for display
highRangeDBUpper dB range for display

Definition at line 95 of file IVBarGraphSpectrumAnalyzerControl.h.

Member Function Documentation

◆ Draw()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw ( IGraphics g)
inlineoverridevirtual

Draw the control to the graphics context.

Parameters
gThe graphics context to which this control belongs.

Implements IControl.

Definition at line 281 of file IVBarGraphSpectrumAnalyzerControl.h.

References IVectorBase::DrawBackground(), IVectorBase::DrawLabel(), IGraphics::DrawRect(), IVectorBase::GetColor(), and IRECT::W().

◆ OnMouseDown()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseDown ( float  x,
float  y,
const IMouseMod mod 
)
inlineoverridevirtual

Implement this method to respond to a mouse down event on this control.

Parameters
xThe X coordinate of the mouse event
yThe Y coordinate of the mouse event
modA struct indicating which modifier keys are held for the event

Reimplemented from IControl.

Definition at line 187 of file IVBarGraphSpectrumAnalyzerControl.h.

References IGraphics::CreatePopupMenu(), and IControl::GetUI().

◆ OnMsgFromDelegate()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMsgFromDelegate ( int  msgTag,
int  dataSize,
const void *  pData 
)
inlineoverridevirtual

Implement to receive messages sent to the control, see IEditorDelegate:SendControlMsgFromDelegate()

Reimplemented from IControl.

Definition at line 145 of file IVBarGraphSpectrumAnalyzerControl.h.

References IByteStream::Get(), and IControl::IsDisabled().

◆ OnPopupMenuSelection()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnPopupMenuSelection ( IPopupMenu pSelectedMenu,
int  valIdx 
)
inlineoverridevirtual

Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptUserInput.

Parameters
pSelectedMenuIf pSelectedMenu is invalid it means the user didn't select anything
valIdxAn index that indicates which of the control's vals the menu relates to

Reimplemented from IControl.

Definition at line 231 of file IVBarGraphSpectrumAnalyzerControl.h.

References IControl::GetDelegate(), and IEditorDelegate::SendArbitraryMsgFromUI().

◆ OnResize()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnResize ( )
inlineoverridevirtual

Called when IControl is constructed or resized using SetRect().

NOTE: if you call SetDirty() in this method, you should call SetDirty(false) to avoid triggering parameter changes

Reimplemented from IControl.

Definition at line 139 of file IVBarGraphSpectrumAnalyzerControl.h.

References IVectorBase::MakeRects(), IControl::SetDirty(), and IControl::SetTargetRECT().

◆ SetBarPattern()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetBarPattern ( const IPattern pattern)
inline

Set the bar pattern for Smooth color mode.

Parameters
patternAn IPattern - solid color or gradient

Definition at line 334 of file IVBarGraphSpectrumAnalyzerControl.h.

References IControl::SetDirty().

◆ SetChannelMode()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetChannelMode ( EChannelMode  mode)
inline

Definition at line 325 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetClipIndicator()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetClipIndicator ( float  thresholdDB,
const IColor clipColor = COLOR_RED 
)
inline

Enable a clip indicator segment above a threshold.

Parameters
thresholdDBThe dB level where clipping starts (e.g., 0.0 for 0dB)
clipColorThe color for the clip indicator segment

Definition at line 373 of file IVBarGraphSpectrumAnalyzerControl.h.

References IControl::SetDirty().

◆ SetColorMode()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetColorMode ( EColorMode  mode)
inline

Definition at line 319 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetFFTSize()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetFFTSize ( int  fftSize)
inline

Definition at line 387 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetFrequencyScale()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetFrequencyScale ( EFrequencyScale  scale)
inline

Definition at line 340 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetNumBars()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetNumBars ( int  nBars)
inline

Definition at line 305 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetNumSegments()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetNumSegments ( int  nSegs)
inline

Definition at line 313 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetOctaveGain()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetOctaveGain ( float  octaveGain)
inline

Definition at line 403 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetPeakHoldTime()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetPeakHoldTime ( int  timeMs)
inline

Definition at line 359 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetSampleRate()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetSampleRate ( double  sr)
inline

Definition at line 395 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetShowClipIndicator()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetShowClipIndicator ( bool  show)
inline

Definition at line 381 of file IVBarGraphSpectrumAnalyzerControl.h.

◆ SetShowPeaks()

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
void IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::SetShowPeaks ( bool  show)
inline

Definition at line 364 of file IVBarGraphSpectrumAnalyzerControl.h.

Member Data Documentation

◆ kPeakDecayRate

template<int MAXNC = 2, int MAX_FFT_SIZE = 4096>
constexpr float IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::kPeakDecayRate = 0.95f
staticconstexpr

Definition at line 76 of file IVBarGraphSpectrumAnalyzerControl.h.


The documentation for this class was generated from the following file: