- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::GUI::Controls::CADSREditor Class Reference

Inheritance diagram for Exponent::GUI::Controls::CADSREditor:

List of all members.

## Detailed Description

Allows you to edit an envelope, essential a four contrller fixed setup.

Date:
  01/06/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CADSREditor.hpp,v 1.7 2007/02/08 21:07:54 paul Exp

Definition at line 34 of file CADSREditor.hpp.

## Public Member Functions

- CADSREditor (IControlRoot *root, const long uniqueId, const CRect &area, IActionListener *listener=NULL)
- virtual void drawControl (CGraphics &graphics)
- virtual double getValue (const long index)
- virtual void handleLeftButtonDown (CMouseEvent &event)
- virtual void handleLeftButtonUp (CMouseEvent &event)
- virtual void handleMouseLeavingArea (CMouseEvent &event)
- virtual void handleMouseMovement (CMouseEvent &event)
- virtual void setValue (const long index, const double value)
- virtual ~CADSREditor ()

## Protected Types

- enum EADSRHandles {
  e_noSelection = -1,
  e_attackSelected,
  e_decaySelected,
  e_sustainSelected,
  e_releaseSelected,
  e_numberOfHandles
  }
    Enumeration of the (internal) handles. More...

## Protected Member Functions

- void constructHandlePositions ()
- void moveAttack (CMouseEvent &event)
- void moveDecay (CMouseEvent &event)
- void moveRelease (CMouseEvent &event)
- void moveSustain (CMouseEvent &event)

## Protected Attributes

- CPolygon m_envelopePolygon
- CRect m_handles [e_numberOfHandles]
- long m_innerHeight
- long m_innerWidth
- bool m_mouseDown
- bool m_mouseIsOver
- long m_selectedPoint
- long m_sizeOfQuarter
- double m_values [4]

## Static Protected Attributes

- static const long CADSR_EDITOR_HANDLE_HALF_SIZE = 4
- static const long CADSR_EDITOR_HANDLE_SIZE = 8
- static const long CADSR_EDITOR_WINDOW_OFFSET = 4

## Member Enumeration Documentation

enum Exponent::GUI::Controls::CADSREditor::EADSRHandles`[protected]`

Enumeration of the (internal) handles.

Enumerator:

  e_noSelection | Nothing selected
  e_attackSelected | Attack selected
  e_decaySelected | Decay selected
  e_sustainSelected | Sustain selected
  e_releaseSelected | Release selected
  e_numberOfHandles | Total number of handles

Definition at line 120 of file CADSREditor.hpp.

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CADSREditor::CADSREditor | ( | IControlRoot * | root,
|  | const long | uniqueId,
|  | const CRect & | area,
|  | IActionListener * | listener = `NULL` |
| ) |  |  |

Construction

Parameters:

  | root | The root control that this control is being added to
  | uniqueId | The unique Identifier of this control or CCONTROL_NO_ID_REQUIRED if no id is required
  | area | The area of this control relative to the root controls top left
  | listener | The action listener

virtual Exponent::GUI::Controls::CADSREditor::~CADSREditor | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

void Exponent::GUI::Controls::CADSREditor::constructHandlePositions | ( |  | ) | `[protected]`

Construct the handle positions

virtual void Exponent::GUI::Controls::CADSREditor::drawControl | ( | CGraphics & | graphics | ) | `[virtual]`

Draw the control

Parameters:

  | graphics | The graphics context

Reimplemented from Exponent::GUI::Controls::CControl.

virtual double Exponent::GUI::Controls::CADSREditor::getValue | ( | const long | index | ) | `[inline, virtual]`

Get a value

Parameters:

  | index | The index, 0=A, 1=D, 2=S, 3=R

Return values:

  | double | The scaled value in range 0 - 1

Definition at line 101 of file CADSREditor.hpp.

References m_values.

virtual void Exponent::GUI::Controls::CADSREditor::handleLeftButtonDown | ( | CMouseEvent & | event | ) | `[virtual]`

Handle left button being clicked

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::CADSREditor::handleLeftButtonUp | ( | CMouseEvent & | event | ) | `[virtual]`

Handle left button being released

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::CADSREditor::handleMouseLeavingArea | ( | CMouseEvent & | event | ) | `[virtual]`

Handle a mouse leaving the root area

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::CADSREditor::handleMouseMovement | ( | CMouseEvent & | event | ) | `[virtual]`

Handle the mouse movement

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

void Exponent::GUI::Controls::CADSREditor::moveAttack | ( | CMouseEvent & | event | ) | `[protected]`

Move attack

Parameters:

  | event | The mouse event to move the attack using

void Exponent::GUI::Controls::CADSREditor::moveDecay | ( | CMouseEvent & | event | ) | `[protected]`

Move decay

Parameters:

  | event | The mouse event to move the decay using

void Exponent::GUI::Controls::CADSREditor::moveRelease | ( | CMouseEvent & | event | ) | `[protected]`

Move the release

Parameters:

  | event | The mouse event to move the release using

void Exponent::GUI::Controls::CADSREditor::moveSustain | ( | CMouseEvent & | event | ) | `[protected]`

Move the sustain

Parameters:

  | event | The mouse event to move the sustain using

virtual void Exponent::GUI::Controls::CADSREditor::setValue | ( | const long | index,
|  | const double | value |
| ) |  |  | `[virtual]`

Set the value at a specific index (ADSR)

Parameters:

  | index | The index, 0=A, 1=D, 2=S, 3=R
  | value | The normalised value to set (0 - 1 range)

## Member Data Documentation

const long Exponent::GUI::Controls::CADSREditor::CADSR_EDITOR_HANDLE_HALF_SIZE = 4`[static, protected]`

Size of square offset

Definition at line 136 of file CADSREditor.hpp.

const long Exponent::GUI::Controls::CADSREditor::CADSR_EDITOR_HANDLE_SIZE = 8`[static, protected]`

Size of a handle

Definition at line 135 of file CADSREditor.hpp.

const long Exponent::GUI::Controls::CADSREditor::CADSR_EDITOR_WINDOW_OFFSET = 4`[static, protected]`

Offset from the edges

Definition at line 134 of file CADSREditor.hpp.

CPolygon Exponent::GUI::Controls::CADSREditor::m_envelopePolygon`[protected]`

The actual envelope curve

Definition at line 178 of file CADSREditor.hpp.

CRect Exponent::GUI::Controls::CADSREditor::m_handles[e_numberOfHandles]`[protected]`

The handles that the user can grab

Definition at line 179 of file CADSREditor.hpp.

long Exponent::GUI::Controls::CADSREditor::m_innerHeight`[protected]`

Height inside

Definition at line 175 of file CADSREditor.hpp.

long Exponent::GUI::Controls::CADSREditor::m_innerWidth`[protected]`

Width inside

Definition at line 176 of file CADSREditor.hpp.

bool Exponent::GUI::Controls::CADSREditor::m_mouseDown`[protected]`

Is the mouse down?

Definition at line 172 of file CADSREditor.hpp.

bool Exponent::GUI::Controls::CADSREditor::m_mouseIsOver`[protected]`

Is the mouse over our area?

Definition at line 171 of file CADSREditor.hpp.

long Exponent::GUI::Controls::CADSREditor::m_selectedPoint`[protected]`

What are we mousing with (-1 if nothing)

Definition at line 173 of file CADSREditor.hpp.

long Exponent::GUI::Controls::CADSREditor::m_sizeOfQuarter`[protected]`

How big is 1/4 of the available space

Definition at line 174 of file CADSREditor.hpp.

double Exponent::GUI::Controls::CADSREditor::m_values[4]`[protected]`

The values of each stage

Definition at line 181 of file CADSREditor.hpp.

Referenced by getValue().