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::ModuleGUI Class Referenceabstract

#include <ModuleGUI.hpp>

Inheritance diagram for AlgAudio::ModuleGUI:
AlgAudio::StandardModuleGUI

Classes

struct  WhatIsHere
 

Public Types

enum  WhatIsHereType {
  WhatIsHereType::Nothing, WhatIsHereType::Inlet, WhatIsHereType::Outlet, WhatIsHereType::SliderInput,
  WhatIsHereType::SliderOutputRelative, WhatIsHereType::SliderOutputAbsolute, WhatIsHereType::SliderBody
}
 

Public Member Functions

virtual std::string GetIoletParamID (UIWidget::ID) const =0
 
std::shared_ptr< ModuleGetModule ()
 
virtual WhatIsHere GetWhatIsHere (Point2D) const =0
 
virtual void OnInletsChanged ()
 
Point2Dposition ()
 
virtual void SetHighlight (bool)=0
 
virtual void SliderDragEnd (UIWidget::ID)
 
virtual void SliderDragStart (UIWidget::ID)
 
virtual void SliderDragStep (UIWidget::ID, Point2D_< float >)
 
virtual std::shared_ptr< UIWidgetWidget ()=0
 
virtual Point2D WhereIsInlet (std::string inlet)=0
 
virtual Point2D WhereIsOutlet (std::string outlet)=0
 
virtual Point2D WhereIsParamInlet (std::string inlet)=0
 
virtual Point2D WhereIsParamRelativeOutlet (std::string inlet)=0
 
virtual Point2D WhereIsParamAbsoluteOutlet (std::string inlet)=0
 

Protected Member Functions

 ModuleGUI (std::shared_ptr< Module > mod)
 

Protected Attributes

std::weak_ptr< Modulemodule
 

Detailed Description

Merely an interface implemented by standard box types. Module creators may wish to implement a custom version of a module GUI, by inheriting from this class and writing a custom Module::BuildGUI.

Each Module has zero or one corresponding ModuleGUI. ModuleGUIs are drawn by the CanvasView.

Member Enumeration Documentation

Enumerator
Nothing 
Inlet 
Outlet 
SliderInput 
SliderOutputRelative 
SliderOutputAbsolute 
SliderBody 

Constructor & Destructor Documentation

AlgAudio::ModuleGUI::ModuleGUI ( std::shared_ptr< Module mod)
inlineprotected

Member Function Documentation

virtual std::string AlgAudio::ModuleGUI::GetIoletParamID ( UIWidget::ID  ) const
pure virtual

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

Implemented in AlgAudio::StandardModuleGUI.

std::shared_ptr<Module> AlgAudio::ModuleGUI::GetModule ( )
inline

Gets the corresponding module instance

virtual WhatIsHere AlgAudio::ModuleGUI::GetWhatIsHere ( Point2D  ) const
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual void AlgAudio::ModuleGUI::OnInletsChanged ( )
inlinevirtual

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 in AlgAudio::StandardModuleGUI.

Point2D& AlgAudio::ModuleGUI::position ( )
inline

The position of this module on the parent CanvasView.

virtual void AlgAudio::ModuleGUI::SetHighlight ( bool  )
pure virtual

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

Implemented in AlgAudio::StandardModuleGUI.

virtual void AlgAudio::ModuleGUI::SliderDragEnd ( UIWidget::ID  )
inlinevirtual

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 in AlgAudio::StandardModuleGUI.

virtual void AlgAudio::ModuleGUI::SliderDragStart ( UIWidget::ID  )
inlinevirtual

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 in AlgAudio::StandardModuleGUI.

virtual void AlgAudio::ModuleGUI::SliderDragStep ( UIWidget::ID  ,
Point2D_< float >   
)
inlinevirtual

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 in AlgAudio::StandardModuleGUI.

virtual Point2D AlgAudio::ModuleGUI::WhereIsInlet ( std::string  inlet)
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual Point2D AlgAudio::ModuleGUI::WhereIsOutlet ( std::string  outlet)
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual Point2D AlgAudio::ModuleGUI::WhereIsParamAbsoluteOutlet ( std::string  inlet)
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual Point2D AlgAudio::ModuleGUI::WhereIsParamInlet ( std::string  inlet)
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual Point2D AlgAudio::ModuleGUI::WhereIsParamRelativeOutlet ( std::string  inlet)
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

virtual std::shared_ptr<UIWidget> AlgAudio::ModuleGUI::Widget ( )
pure virtual

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.

Implemented in AlgAudio::StandardModuleGUI.

Member Data Documentation

std::weak_ptr<Module> AlgAudio::ModuleGUI::module
protected

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