LMMS
Loading...
Searching...
No Matches
ctl_phasegraph.h
Go to the documentation of this file.
1/* Calf DSP Library
2 * A goniometer widget
3 *
4 * Copyright (C) 2008-2015 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_PHASEGRAPH
27#define __CALF_CTL_PHASEGRAPH
28
29#include <cairo/cairo.h>
30#include <gtk/gtk.h>
31#include <calf/giface.h>
32#include <calf/drawingutils.h>
33#include <calf/gui.h>
34
35G_BEGIN_DECLS
36
38
39#define CALF_TYPE_PHASE_GRAPH (calf_phase_graph_get_type())
40#define CALF_PHASE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALF_TYPE_PHASE_GRAPH, CalfPhaseGraph))
41#define CALF_IS_PHASE_GRAPH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALF_TYPE_PHASE_GRAPH))
42#define CALF_PHASE_GRAPH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALF_TYPE_PHASE_GRAPH, CalfPhaseGraphClass))
43#define CALF_IS_PHASE_GRAPH_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALF_TYPE_PHASE_GRAPH))
44#define CALF_PHASE_GRAPH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALF_TYPE_PHASE_GRAPH, CalfPhaseGraphClass))
45
47{
48 GtkDrawingArea parent;
51 cairo_surface_t *background, *cache;
52 inline float _atan(float x, float l, float r) {
53 if(l >= 0 and r >= 0)
54 return atan(x);
55 else if(l >= 0 and r < 0)
56 return M_PI + atan(x);
57 else if(l < 0 and r < 0)
58 return M_PI + atan(x);
59 else if(l < 0 and r >= 0)
60 return (2.f * M_PI) + atan(x);
61 return 0.f;
62 }
63};
64
66{
67 GtkDrawingAreaClass parent_class;
68};
69
70extern GtkWidget *calf_phase_graph_new();
71
72extern GType calf_phase_graph_get_type();
73
74
75G_END_DECLS
76
77#endif
#define M_PI
Definition compat.h:149
GtkWidget * calf_phase_graph_new()
Definition ctl_phasegraph.cpp:315
GType calf_phase_graph_get_type()
Definition ctl_phasegraph.cpp:321
int * l
Definition inflate.c:1579
unsigned x[BMAX+1]
Definition inflate.c:1586
Definition ctl_phasegraph.h:66
GtkDrawingAreaClass parent_class
Definition ctl_phasegraph.h:67
Definition ctl_phasegraph.h:47
const calf_plugins::phase_graph_iface * source
Definition ctl_phasegraph.h:49
cairo_surface_t * background
Definition ctl_phasegraph.h:51
GtkDrawingArea parent
Definition ctl_phasegraph.h:48
cairo_surface_t * cache
Definition ctl_phasegraph.h:51
float _atan(float x, float l, float r)
Definition ctl_phasegraph.h:52
int source_id
Definition ctl_phasegraph.h:50
'provides live line graph values' interface
Definition giface.h:251
int r
Definition crypt.c:458