libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::StandardModuleGUI Class Reference

#include <StandardModuleGUI.hpp>

Inheritance diagram for AlgAudio::StandardModuleGUI:
AlgAudio::ModuleGUI AlgAudio::UIContainerSingle AlgAudio::UIWidget AlgAudio::UIMouseEventsBase AlgAudio::SubscriptionsManager AlgAudio::UIVisibilityBase

Public Member Functions

void CustomDraw (DrawContext &c) override
 
virtual std::shared_ptr< UIWidgetCustomFindChild (ID id) const override
 
virtual void CustomMouseEnter (Point2D pos) override
 
virtual void CustomMouseLeave (Point2D pos) override
 
virtual void CustomMouseMotion (Point2D pos1, Point2D pos2) override
 
virtual bool CustomMousePress (bool down, MouseButton b, Point2D pos) override
 
void CustomResize (Size2D s) override
 
virtual Point2D GetChildPos () const
 
virtual std::string GetIoletParamID (UIWidget::ID) const override
 
virtual WhatIsHere GetWhatIsHere (Point2D) const override
 
void OnChildRequestedSizeChanged () override
 
void OnChildVisibilityChanged () override
 
virtual void OnInletsChanged ()
 
void SetHighlight (bool) override
 
virtual void SliderDragEnd (UIWidget::ID id) override
 
virtual void SliderDragStart (UIWidget::ID id) override
 
virtual void SliderDragStep (UIWidget::ID id, Point2D_< float > current_offset) override
 
virtual Point2D WhereIsInlet (std::string inlet) override
 
virtual Point2D WhereIsOutlet (std::string outlet) override
 
virtual Point2D WhereIsParamAbsoluteOutlet (std::string outlet) override
 
virtual Point2D WhereIsParamInlet (std::string inlet) override
 
virtual Point2D WhereIsParamRelativeOutlet (std::string outlet) override
 
virtual std::shared_ptr< UIWidgetWidget () override
 
- Public Member Functions inherited from AlgAudio::ModuleGUI
std::shared_ptr< ModuleGetModule ()
 
Point2Dposition ()
 
- Public Member Functions inherited from AlgAudio::UIContainerSingle
virtual void Insert (std::shared_ptr< UIWidget >)
 
virtual void OnChildFocusRequested (std::shared_ptr< UIWidget >) override
 
virtual bool OnChildFocusTested (std::shared_ptr< const UIWidget >) override
 
virtual void OnFocusChanged (bool has_focus) override
 
virtual void OnKeyboard (KeyData k) override
 
virtual void RemoveChild ()
 
virtual void RequestFocus () override
 
- Public Member Functions inherited from AlgAudio::UIWidget
void Draw (DrawContext &c)
 
std::shared_ptr< UIWidgetFindChild (ID search_id)
 
Size2D GetCurrentSize () const
 
Point2D GetPosInParent (std::shared_ptr< UIWidget > ancestor)
 
Size2D GetRequestedSize () const
 
std::shared_ptr< WindowGetWindow ()
 
bool HasParent ()
 
bool HasZeroArea () const
 
void Resize (Size2D s)
 
void SetBackColor (const Color &c)
 
void SetCustomSize (Size2D size)
 
void SetFrontColor (const Color &c)
 
void TriggerFakeResize ()
 
virtual ~UIWidget ()
 
- Public Member Functions inherited from AlgAudio::UIMouseEventsBase
void OnMouseEnter (Point2D)
 
void OnMouseLeave (Point2D)
 
void OnMouseMotion (Point2D, Point2D)
 
bool OnMousePress (bool, MouseButton, Point2D)
 
void SetFocusable (bool f)
 
- Public Member Functions inherited from AlgAudio::UIVisibilityBase
bool IsDrawn () const
 
bool IsInvisible () const
 
void SetDisplayMode (DisplayMode m)
 

Static Public Member Functions

static std::shared_ptr
< StandardModuleGUI
CreateFromTemplate (std::shared_ptr< Window > w, std::shared_ptr< Module > mod)
 
static std::shared_ptr
< StandardModuleGUI
CreateFromXML (std::shared_ptr< Window > w, std::string xml_data, std::shared_ptr< Module > mod)
 

Protected Member Functions

 StandardModuleGUI (std::shared_ptr< Window > w, std::shared_ptr< Module > mod)
 
- Protected Member Functions inherited from AlgAudio::ModuleGUI
 ModuleGUI (std::shared_ptr< Module > mod)
 
- Protected Member Functions inherited from AlgAudio::UIContainerSingle
 UIContainerSingle (std::weak_ptr< Window > parent_window)
 
- Protected Member Functions inherited from AlgAudio::UIWidget
bool IsFocused () const
 
bool IsRoot () const
 
void SetMinimalSize (Size2D)
 
void SetNeedsRedrawing ()
 
 UIWidget (std::weak_ptr< Window > parent_window)
 
- Protected Member Functions inherited from AlgAudio::UIMouseEventsBase
 UIMouseEventsBase ()
 
- Protected Member Functions inherited from AlgAudio::UIVisibilityBase
 UIVisibilityBase ()
 

Additional Inherited Members

- Public Types inherited from AlgAudio::ModuleGUI
enum  WhatIsHereType {
  WhatIsHereType::Nothing, WhatIsHereType::Inlet, WhatIsHereType::Outlet, WhatIsHereType::SliderInput,
  WhatIsHereType::SliderOutputRelative, WhatIsHereType::SliderOutputAbsolute, WhatIsHereType::SliderBody
}
 
- Public Types inherited from AlgAudio::UIVisibilityBase
enum  DisplayMode { DisplayMode::Visible, DisplayMode::EmptySpace, DisplayMode::Invisible }
 
- Public Attributes inherited from AlgAudio::UIWidget
bool debug_this_widget = false
 
std::weak_ptr< UIWidgetparent
 
ID widget_id
 
- Public Attributes inherited from AlgAudio::UIMouseEventsBase
Point2D last_mouse_pos
 
Signal on_clicked
 
Signal< Point2Don_motion
 
Signal< bool > on_pointed
 
Signal< bool > on_pressed
 
- Public Attributes inherited from AlgAudio::UIVisibilityBase
Signal on_display_mode_changed
 
- Public Attributes inherited from AlgAudio::SubscriptionsManager
SubscriptionList subscriptions
 
- Protected Attributes inherited from AlgAudio::ModuleGUI
std::weak_ptr< Modulemodule
 
- Protected Attributes inherited from AlgAudio::UIContainerSingle
std::shared_ptr< UIWidgetchild
 
bool child_is_focused = false
 
- Protected Attributes inherited from AlgAudio::UIWidget
Size2D current_size = Size2D(0,0)
 
std::weak_ptr< Windowwindow
 
- Protected Attributes inherited from AlgAudio::UIMouseEventsBase
bool focusable = true
 
bool pointed = false
 
bool pressed = false
 
- Protected Attributes inherited from AlgAudio::UIVisibilityBase
DisplayMode display_mode = DisplayMode::Visible
 

Constructor & Destructor Documentation

AlgAudio::StandardModuleGUI::StandardModuleGUI ( std::shared_ptr< Window w,
std::shared_ptr< Module mod 
)
inlineprotected

Member Function Documentation

static std::shared_ptr<StandardModuleGUI> AlgAudio::StandardModuleGUI::CreateFromTemplate ( std::shared_ptr< Window w,
std::shared_ptr< Module mod 
)
static
static std::shared_ptr<StandardModuleGUI> AlgAudio::StandardModuleGUI::CreateFromXML ( std::shared_ptr< Window w,
std::string  xml_data,
std::shared_ptr< Module mod 
)
static
void AlgAudio::StandardModuleGUI::CustomDraw ( DrawContext c)
overridevirtual

Implements AlgAudio::UIWidget.

virtual std::shared_ptr<UIWidget> AlgAudio::StandardModuleGUI::CustomFindChild ( ID  id) const
inlineoverridevirtual

Reimplemented from AlgAudio::UIContainerSingle.

virtual void AlgAudio::StandardModuleGUI::CustomMouseEnter ( Point2D  pos)
inlineoverridevirtual

Reimplemented from AlgAudio::UIMouseEventsBase.

virtual void AlgAudio::StandardModuleGUI::CustomMouseLeave ( Point2D  pos)
inlineoverridevirtual

Reimplemented from AlgAudio::UIMouseEventsBase.

virtual void AlgAudio::StandardModuleGUI::CustomMouseMotion ( Point2D  pos1,
Point2D  pos2 
)
inlineoverridevirtual

Reimplemented from AlgAudio::UIMouseEventsBase.

virtual bool AlgAudio::StandardModuleGUI::CustomMousePress ( bool  ,
MouseButton  ,
Point2D   
)
inlineoverridevirtual

This call is supposed to return TRUE iff it's the end of the click chain, i.e. the event was NOT passed to another widget. It must return FALSE if the event was passed to any child widget.

Reimplemented from AlgAudio::UIMouseEventsBase.

void AlgAudio::StandardModuleGUI::CustomResize ( Size2D  s)
overridevirtual

Reimplemented from AlgAudio::UIWidget.

virtual Point2D AlgAudio::StandardModuleGUI::GetChildPos ( ) const
inlinevirtual
virtual std::string AlgAudio::StandardModuleGUI::GetIoletParamID ( UIWidget::ID  ) const
overridevirtual

This method shall translate an inlet/outlet widget id to the corresponding param id.

Implements AlgAudio::ModuleGUI.

virtual WhatIsHere AlgAudio::StandardModuleGUI::GetWhatIsHere ( Point2D  ) const
overridevirtual

This function is used by the CanvasView to ask the module GUI what kind of element is located at a given point. This way the CanvasView can handle connections etc. and ModuleGUI does not have to bother about them.

Implements AlgAudio::ModuleGUI.

void AlgAudio::StandardModuleGUI::OnChildRequestedSizeChanged ( )
overridevirtual

This method will be called by a child when it changes the desired size.

Reimplemented from AlgAudio::UIWidget.

void AlgAudio::StandardModuleGUI::OnChildVisibilityChanged ( )
overridevirtual

This method will be called by a child when it changes its visibility.

Reimplemented from AlgAudio::UIWidget.

virtual void AlgAudio::StandardModuleGUI::OnInletsChanged ( )
virtual

A Module may call this method sometimes to notify its GUI that the set of inlets has changed, and the ModuleGUI should take appropriate changes.

Reimplemented from AlgAudio::ModuleGUI.

void AlgAudio::StandardModuleGUI::SetHighlight ( bool  )
overridevirtual

When set to true, the module shall draw itself in it's "highlighted" variant.

Implements AlgAudio::ModuleGUI.

virtual void AlgAudio::StandardModuleGUI::SliderDragEnd ( UIWidget::ID  )
overridevirtual

This method is called by CanvasView when a slider drag has ended. Usually, the ModuleGUI will pass this event to the right slider widget.

Reimplemented from AlgAudio::ModuleGUI.

virtual void AlgAudio::StandardModuleGUI::SliderDragStart ( UIWidget::ID  )
overridevirtual

CanvasView uses this function to notify the ModuleGUI that a slider is being dragged. This way the drag can continue outside the ModuleGUI. The only arguments is the slider widget id (as returned by WhatIsHere). Usually, the ModuleGUI will pass this event to the right slider widget.

Reimplemented from AlgAudio::ModuleGUI.

virtual void AlgAudio::StandardModuleGUI::SliderDragStep ( UIWidget::ID  ,
Point2D_< float >   
)
overridevirtual

This method is called by CanvasView for each step of a slider drag. Note that offset values may be outside moduleGUI, or even negative. Usually, the ModuleGUI will pass this event to the right slider widget.

Reimplemented from AlgAudio::ModuleGUI.

virtual Point2D AlgAudio::StandardModuleGUI::WhereIsInlet ( std::string  inlet)
overridevirtual

These methods are used by the CanvasView to query where it should draw connection wire endings. The only parameter is iolet ID. The ModuleGUI implementation should return the coordinates where the connector is drawn.

Implements AlgAudio::ModuleGUI.

virtual Point2D AlgAudio::StandardModuleGUI::WhereIsOutlet ( std::string  outlet)
overridevirtual

These methods are used by the CanvasView to query where it should draw connection wire endings. The only parameter is iolet ID. The ModuleGUI implementation should return the coordinates where the connector is drawn.

Implements AlgAudio::ModuleGUI.

virtual Point2D AlgAudio::StandardModuleGUI::WhereIsParamAbsoluteOutlet ( std::string  inlet)
overridevirtual

These methods are used by the CanvasView to query where it should draw connection wire endings. The only parameter is iolet ID. The ModuleGUI implementation should return the coordinates where the connector is drawn.

Implements AlgAudio::ModuleGUI.

virtual Point2D AlgAudio::StandardModuleGUI::WhereIsParamInlet ( std::string  inlet)
overridevirtual

These methods are used by the CanvasView to query where it should draw connection wire endings. The only parameter is iolet ID. The ModuleGUI implementation should return the coordinates where the connector is drawn.

Implements AlgAudio::ModuleGUI.

virtual Point2D AlgAudio::StandardModuleGUI::WhereIsParamRelativeOutlet ( std::string  inlet)
overridevirtual

These methods are used by the CanvasView to query where it should draw connection wire endings. The only parameter is iolet ID. The ModuleGUI implementation should return the coordinates where the connector is drawn.

Implements AlgAudio::ModuleGUI.

virtual std::shared_ptr<UIWidget> AlgAudio::StandardModuleGUI::Widget ( )
inlineoverridevirtual

Returns the widget representing this module. Cannot return nullptr. Must be implemented by all ModuleGUI specialisations. ModuleGUI is just an interface defining a set of methods. It cannot inherit from UIWidget, as that would mess up inheritance completely. Tuhs, to access the underlyin widget use this method. Custom implementations, like StandardModuleGUI, return a pointer to itself, because StandardModuleGUI inherts from both ModuleGUI and UIWidget.

Implements AlgAudio::ModuleGUI.


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