LMMS
Loading...
Searching...
No Matches
ctl_linegraph.h
Go to the documentation of this file.
1/* Calf DSP Library
2 * A few useful widgets - a line graph, a knob, a tube - Panama!
3 *
4 * Copyright (C) 2008-2010 Krzysztof Foltman, Torben Hohn, Markus
5 * Schmidt and others
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this program; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02111-1307, USA.
21 */
22
23#ifndef _USE_MATH_DEFINES
24#define _USE_MATH_DEFINES
25#endif
26#ifndef __CALF_CTL_LINEGRAPH
27#define __CALF_CTL_LINEGRAPH
28
29#include <gtk/gtk.h>
30#include <calf/giface.h>
31#include <calf/gui.h>
32
33G_BEGIN_DECLS
34
35#define CALF_TYPE_LINE_GRAPH (calf_line_graph_get_type())
36#define CALF_LINE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_LINE_GRAPH, CalfLineGraph))
37#define CALF_IS_LINE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_LINE_GRAPH))
38#define CALF_LINE_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALF_TYPE_LINE_GRAPH, CalfLineGraphClass))
39#define CALF_IS_LINE_GRAPH_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALF_TYPE_LINE_GRAPH))
40#define CALF_LINE_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALF_TYPE_LINE_GRAPH, CalfLineGraphClass))
41
43{
44 bool active;
46 int style;
47 char *label;
48
53 double value_x;
54 double value_y;
55 double value_z;
62 double pos_x;
63 double pos_y;
64 double pos_z;
68 gpointer data;
69
70 inline bool is_active() { return (param_active_no < 0 || active); }
71};
72
73#define FREQ_HANDLES 32
74#define HANDLE_WIDTH 20.0
75
77{
78 static const int debug = 0; // 0 - 3
79
80 GtkEventBox parent;
87 float fade;
90 unsigned int layers;
93 int x, y;
94 float zoom, offset;
96
97 cairo_surface_t *background_surface;
98 cairo_surface_t *grid_surface;
99 cairo_surface_t *cache_surface;
100 cairo_surface_t *moving_surface[2];
101 cairo_surface_t *handles_surface;
102 cairo_surface_t *realtime_surface;
103
104 // crosshairs and FreqHandles
105 gdouble mouse_x, mouse_y;
108
118 GdkCursor *hand_cursor;
120 GdkCursor *arrow_cursor;
121};
122
124{
125 GtkEventBoxClass parent_class;
126};
127
128extern GtkWidget *calf_line_graph_new();
129
130extern GType calf_line_graph_get_type();
131
132extern void calf_line_graph_set_square(CalfLineGraph *graph, bool is_square);
133
134extern void calf_line_graph_expose_request (GtkWidget *widget, bool force = false);
135
136G_END_DECLS
137
138#endif
GtkWidget * calf_line_graph_new()
Definition ctl_linegraph.cpp:1506
#define FREQ_HANDLES
Definition ctl_linegraph.h:73
void calf_line_graph_expose_request(GtkWidget *widget, bool force=false)
Definition ctl_linegraph.cpp:611
GType calf_line_graph_get_type()
Definition ctl_linegraph.cpp:1512
void calf_line_graph_set_square(CalfLineGraph *graph, bool is_square)
Definition ctl_linegraph.cpp:1342
Definition ctl_linegraph.h:124
GtkEventBoxClass parent_class
Definition ctl_linegraph.h:125
Definition ctl_linegraph.h:77
bool is_square
Definition ctl_linegraph.h:86
GdkCursor * arrow_cursor
Cached arrow (drag) cursor.
Definition ctl_linegraph.h:120
int handle_redraw
Definition ctl_linegraph.h:115
int y
Definition ctl_linegraph.h:93
bool use_freqhandles_buttons
Definition ctl_linegraph.h:110
bool use_crosshairs
Definition ctl_linegraph.h:106
bool force_redraw
Definition ctl_linegraph.h:84
unsigned int layers
Definition ctl_linegraph.h:90
int size_y
Definition ctl_linegraph.h:92
int generation
Definition ctl_linegraph.h:89
float offset
Definition ctl_linegraph.h:94
cairo_surface_t * realtime_surface
Definition ctl_linegraph.h:102
int x
Definition ctl_linegraph.h:93
float zoom
Definition ctl_linegraph.h:94
int size_x
Definition ctl_linegraph.h:92
float fade
Definition ctl_linegraph.h:87
const calf_plugins::line_graph_iface * source
Definition ctl_linegraph.h:81
static const int debug
Definition ctl_linegraph.h:78
cairo_surface_t * cache_surface
Definition ctl_linegraph.h:99
int movesurf
Definition ctl_linegraph.h:88
int param_offset
Definition ctl_linegraph.h:95
int mode
Definition ctl_linegraph.h:88
bool crosshairs_active
Definition ctl_linegraph.h:107
GdkCursor * hand_cursor
Cached hand (drag) cursor.
Definition ctl_linegraph.h:118
int param_zoom
Definition ctl_linegraph.h:95
cairo_surface_t * background_surface
Definition ctl_linegraph.h:97
gdouble mouse_y
Definition ctl_linegraph.h:105
GtkEventBox parent
Definition ctl_linegraph.h:80
bool enforce_handle_order
Definition ctl_linegraph.h:111
int handle_hovered
Definition ctl_linegraph.h:114
int recreate_surfaces
Definition ctl_linegraph.h:85
bool force_cache
Definition ctl_linegraph.h:83
cairo_surface_t * moving_surface[2]
Definition ctl_linegraph.h:100
cairo_surface_t * handles_surface
Definition ctl_linegraph.h:101
int handle_grabbed
Definition ctl_linegraph.h:113
gdouble mouse_x
Definition ctl_linegraph.h:105
FreqHandle freq_handles[FREQ_HANDLES]
Definition ctl_linegraph.h:116
int source_id
Definition ctl_linegraph.h:82
int pad_y
Definition ctl_linegraph.h:91
int freqhandles
Definition ctl_linegraph.h:109
int pad_x
Definition ctl_linegraph.h:91
float min_handle_distance
Definition ctl_linegraph.h:112
cairo_surface_t * grid_surface
Definition ctl_linegraph.h:98
Definition ctl_linegraph.h:43
double last_value_y
Definition ctl_linegraph.h:57
calf_plugins::parameter_properties props_z
Definition ctl_linegraph.h:65
double value_z
Definition ctl_linegraph.h:55
bool is_active()
Definition ctl_linegraph.h:70
float left_bound
Definition ctl_linegraph.h:66
float right_bound
Definition ctl_linegraph.h:67
char * label
Definition ctl_linegraph.h:47
int param_z_no
Definition ctl_linegraph.h:52
int param_active_no
Definition ctl_linegraph.h:49
int param_x_no
Definition ctl_linegraph.h:50
double default_value_z
Definition ctl_linegraph.h:61
double last_value_x
Definition ctl_linegraph.h:56
bool active
Definition ctl_linegraph.h:44
double default_value_y
Definition ctl_linegraph.h:60
int style
Definition ctl_linegraph.h:46
gpointer data
Definition ctl_linegraph.h:68
double pos_x
Definition ctl_linegraph.h:62
double pos_y
Definition ctl_linegraph.h:63
double pos_z
Definition ctl_linegraph.h:64
int dimensions
Definition ctl_linegraph.h:45
double last_value_z
Definition ctl_linegraph.h:58
int param_y_no
Definition ctl_linegraph.h:51
double value_x
Definition ctl_linegraph.h:53
double value_y
Definition ctl_linegraph.h:54
double default_value_x
Definition ctl_linegraph.h:59
'provides live line graph values' interface
Definition giface.h:198
Range, default value, flags and names for a parameter.
Definition giface.h:128