LMMS
Loading...
Searching...
No Matches
CalfCurve Struct Reference

#include <ctl_curve.h>

Classes

struct  EventSink
 User callbacks for handling curve events. More...
struct  EventAdapter
 Null implementation of EventSink. More...
struct  EventTester
 Debug implementation of EventSink. More...

Public Types

typedef std::pair< float, float > point
 A point with floating point X and Y coordinates.
typedef std::vector< pointpoint_vector
 A collection of points.

Public Member Functions

void log2phys (float &x, float &y)
 Convert logical (mapping) to physical (screen) coordinates.
void phys2log (float &x, float &y)
 Convert physical (screen) to logical (mapping) coordinates.
void clip (int pt, float &x, float &y, bool &hide)

Public Attributes

GtkWidget parent
 Base class instance members.
point_vectorpoints
 Array of points.
float x0
 Coordinate ranges (in logical coordinates for top left and bottom right).
float y0
float x1
float y1
int cur_pt
 Currently selected point (when dragging/adding), or -1 if none is selected.
bool hide_current
 If currently selected point is a candidate for deletion (ie. outside of graph+margin range).
EventSinksink
 Interface for notification.
GdkCursor * hand_cursor
 Cached hand (drag) cursor.
GdkCursor * pencil_cursor
 Cached pencil (add point) cursor.
GdkCursor * arrow_cursor
 Cached arrow (do not add point) cursor.
unsigned int point_limit
 Maximum number of points.

Detailed Description

Mapping curve editor control. May be used for editing multisegment lines (key mapping, velocity mapping etc). This version isn't suitable for envelope editing because both ends (start and end) have fixed X coordinates and it doesn't resize.

Member Typedef Documentation

◆ point

typedef std::pair<float, float> CalfCurve::point

A point with floating point X and Y coordinates.

◆ point_vector

typedef std::vector<point> CalfCurve::point_vector

A collection of points.

Member Function Documentation

◆ clip()

void CalfCurve::clip ( int pt,
float & x,
float & y,
bool & hide )

Clip function

Parameters
ptpoint being clipped
xhorizontal logical coordinate
yvertical logical coordinate
hidetrue if point is outside "valid" range and about to be deleted

◆ log2phys()

void CalfCurve::log2phys ( float & x,
float & y )

Convert logical (mapping) to physical (screen) coordinates.

◆ phys2log()

void CalfCurve::phys2log ( float & x,
float & y )

Convert physical (screen) to logical (mapping) coordinates.

Member Data Documentation

◆ arrow_cursor

GdkCursor* CalfCurve::arrow_cursor

Cached arrow (do not add point) cursor.

◆ cur_pt

int CalfCurve::cur_pt

Currently selected point (when dragging/adding), or -1 if none is selected.

◆ hand_cursor

GdkCursor* CalfCurve::hand_cursor

Cached hand (drag) cursor.

◆ hide_current

bool CalfCurve::hide_current

If currently selected point is a candidate for deletion (ie. outside of graph+margin range).

◆ parent

GtkWidget CalfCurve::parent

Base class instance members.

◆ pencil_cursor

GdkCursor* CalfCurve::pencil_cursor

Cached pencil (add point) cursor.

◆ point_limit

unsigned int CalfCurve::point_limit

Maximum number of points.

◆ points

point_vector* CalfCurve::points

Array of points.

◆ sink

EventSink* CalfCurve::sink

Interface for notification.

◆ x0

float CalfCurve::x0

Coordinate ranges (in logical coordinates for top left and bottom right).

◆ x1

float CalfCurve::x1

◆ y0

float CalfCurve::y0

◆ y1

float CalfCurve::y1

The documentation for this struct was generated from the following files: