2 * Line graph custom control - communication interface
3 * Copyright (C) 2007-2008 Krzysztof Foltman
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 #ifndef __CALF_LINEGRAPH_IFACE_H
21 #define __CALF_LINEGRAPH_IFACE_H
25 typedef struct _cairo cairo_t
;
27 /// 'provides live line graph values' interface
28 struct line_graph_iface
30 /// Obtain subindex'th graph of parameter index
31 /// @param index parameter/graph number (usually tied to particular plugin control port)
32 /// @param subindex graph number (there may be multiple overlaid graphs for one parameter, eg. for monosynth 2x12dB filters)
33 /// @param data buffer for normalized output values
34 /// @param points number of points to fill
35 /// @param context cairo context to adjust (for multicolour graphs etc.)
36 /// @retval true graph data was returned; subindex+1 graph may or may not be available
37 /// @retval false graph data was not returned; subindex+1 graph does not exist either
38 virtual bool get_graph(int index
, int subindex
, float *data
, int points
, cairo_t
*context
) { return false; }
40 /// Obtain subindex'th static graph of parameter index (static graphs are only dependent on parameter value, not plugin state)
41 /// @param index parameter/graph number (usually tied to particular plugin control port)
42 /// @param subindex graph number (there may be multiple overlaid graphs for one parameter, eg. for monosynth 2x12dB filters)
43 /// @param value parameter value to pick the graph for
44 /// @param data buffer for normalized output values
45 /// @param points number of points to fill
46 /// @param context cairo context to adjust (for multicolour graphs etc.)
47 /// @retval true graph data was returned; subindex+1 graph may or may not be available
48 /// @retval false graph data was not returned; subindex+1 graph does not exist either
49 virtual bool get_static_graph(int index
, int subindex
, float value
, float *data
, int points
, cairo_t
*context
) { return false; }
50 /// Obtain subindex'th dot of parameter 'index'
51 /// @param index parameter/dot number (usually tied to particular plugin control port)
52 /// @param subindex dot number (there may be multiple dots graphs for one parameter)
53 virtual bool get_dot(int index
, int subindex
, float &x
, float &y
, int &size
, cairo_t
*context
) { return false; }
54 /// Standard destructor to make compiler happy
55 virtual ~line_graph_iface() {}