~noskcaj/ubuntu/trusty/ekiga/ftbfs

« back to all changes in this revision

Viewing changes to lib/gui/gmlevelmeter.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-01-28 18:49:20 UTC
  • Revision ID: james.westby@ubuntu.com-20060128184920-v525ihmiv7id40xs
Tags: upstream-1.99.0
Import upstream version 1.99.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* GnomeMeeting -- A Video-Conferencing application
 
3
 * Copyright (C) 2000-2006 Damien Sandras
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
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
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 *
 
19
 *
 
20
 * GnomeMeeting is licensed under the GPL license and as a special exception,
 
21
 * you have permission to link or otherwise combine this program with the
 
22
 * programs OpenH323 and Pwlib, and distribute the combination, without
 
23
 * applying the requirements of the GNU GPL to the OpenH323 program, as long
 
24
 * as you do follow the requirements of the GNU GPL for all the rest of the
 
25
 * software thus combined.
 
26
 */
 
27
 
 
28
 
 
29
/*
 
30
 *                         gtklevelmeter.h  -  description
 
31
 *                         -------------------------------
 
32
 *   begin                : Sat Dec 23 2003
 
33
 *   copyright            : (C) 2003 by Stefan Br�ns <lurch@gmx.li>
 
34
 *   description          : This file contains a GTK VU Meter.
 
35
 *
 
36
 */
 
37
 
 
38
 
 
39
#ifndef __GTK_LEVELMETER_H__
 
40
#define __GTK_LEVELMETER_H__
 
41
 
 
42
#include <gdk/gdk.h>
 
43
#include <gtk/gtkwidget.h>
 
44
 
 
45
#include <stdlib.h>
 
46
 
 
47
 
 
48
G_BEGIN_DECLS
 
49
 
 
50
#define GTK_LEVELMETER(obj) GTK_CHECK_CAST (obj, gtk_levelmeter_get_type (), GtkLevelMeter)
 
51
#define GTK_LEVELMETER_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_levelmeter_get_type (), GtkLevelMeterClass)
 
52
#define GTK_IS_LEVELMETER(obj) GTK_CHECK_TYPE (obj, gtk_levelmeter_get_type ())
 
53
 
 
54
 
 
55
typedef struct _GtkLevelMeter GtkLevelMeter;
 
56
typedef struct _GtkLevelMeterClass GtkLevelMeterClass;
 
57
 
 
58
 
 
59
typedef enum
 
60
{
 
61
  GTK_METER_LEFT_TO_RIGHT,
 
62
  GTK_METER_BOTTOM_TO_TOP
 
63
} GtkLevelMeterOrientation;
 
64
 
 
65
 
 
66
struct _GtkLevelMeter
 
67
{
 
68
  GtkWidget widget;
 
69
 
 
70
  /* Orientation of the level meter */
 
71
  GtkLevelMeterOrientation orientation;
 
72
 
 
73
  /* show a peak indicator */
 
74
  gboolean showPeak;
 
75
 
 
76
  /* show a continous or a segmented (LED like) display */
 
77
  gboolean isSegmented;
 
78
 
 
79
  /* The ranges of different color of the display */
 
80
  GArray* colorEntries;
 
81
 
 
82
  /* The pixmap for double buffering */
 
83
  GdkPixmap* offscreen_image;
 
84
 
 
85
  /* The pixmap with the highlighted bar */
 
86
  GdkPixmap* offscreen_image_hl;
 
87
 
 
88
  /* The pixmap with the dark bar */
 
89
  GdkPixmap* offscreen_image_dark;
 
90
 
 
91
  /* The levels */
 
92
  gfloat level, peak;
 
93
};
 
94
 
 
95
 
 
96
struct _GtkLevelMeterClass
 
97
{
 
98
  GtkWidgetClass parent_class;
 
99
};
 
100
 
 
101
 
 
102
struct _GtkLevelMeterColorEntry
 
103
{
 
104
  GdkColor color;
 
105
  gfloat stopvalue;
 
106
  GdkColor darkcolor;
 
107
};
 
108
 
 
109
 
 
110
typedef struct _GtkLevelMeterColorEntry GtkLevelMeterColorEntry;
 
111
 
 
112
/* DESCRIPTION  :  /
 
113
 * BEHAVIOR     :  Creates a new VU meter
 
114
 * PRE          :  /
 
115
 */
 
116
GtkWidget *gtk_levelmeter_new (void);
 
117
 
 
118
/* DESCRIPTION  :  /
 
119
 * BEHAVIOR     :  Get the GType 
 
120
 * PRE          :  /
 
121
 */
 
122
GType gtk_levelmeter_get_type (void);
 
123
 
 
124
/* DESCRIPTION  :  /
 
125
 * BEHAVIOR     :  Set new values for level.
 
126
 * PRE          :  Level should be between 0.0 and 1.0,
 
127
 *                 lower/higher values are clamped.
 
128
 */
 
129
void gtk_levelmeter_set_level (GtkLevelMeter *, 
 
130
                               gfloat);
 
131
 
 
132
 
 
133
/* DESCRIPTION  :  /
 
134
 * BEHAVIOR     :  Clear the GtkLevelMeter.
 
135
 * PRE          :  /
 
136
 */
 
137
void gtk_levelmeter_clear (GtkLevelMeter *);
 
138
 
 
139
 
 
140
/* DESCRIPTION  :  /
 
141
 * BEHAVIOR     :  Set new colors for the different ranges of the meter
 
142
 * PRE          :  Each array entry has to be a GtkLevelMeterColorEntry,
 
143
 *                 the number of entries is not limited, each range starts
 
144
 *                 at the stopvalue of the previous entry (or 0.0 for the
 
145
 *                 first), color allocation is done by the widget. A copy
 
146
 *                 of the array is stored, so the array given as an argument
 
147
 *                 can be deleted after the function call.
 
148
 */
 
149
void gtk_levelmeter_set_colors (GtkLevelMeter *,
 
150
                                GArray *);
 
151
 
 
152
G_END_DECLS
 
153
 
 
154
#endif /* __GTK_LEVELMETER_H__ */