File: EffectsWindow.cpp

package info (click to toggle)
alsaplayer 0.99.76-9%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,752 kB
  • ctags: 2,970
  • sloc: ansic: 16,775; sh: 10,709; cpp: 9,442; makefile: 694
file content (81 lines) | stat: -rw-r--r-- 2,373 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*  EffectsWindow.cpp
 *  Copyright (C) 1998 Andy Lo A Foe <andy@alsa-project.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ 
#include "EffectsWindow.h"
#include "support.h"
#include "gladesrc.h"
#include "gtk_interface.h"

extern int global_effects_show;
extern int global_reverb_delay;
extern int global_reverb_feedback;

void effects_scale_cb(GtkWidget *widget, GdkEvent *, gpointer data)
{
	GtkAdjustment *adj;
	gint *val;

	val = (gint *)data;
	
	adj = GTK_RANGE(widget)->adjustment;

	*val = (gint) adj->value;
}


void effects_delete_event(GtkWidget *widget, GdkEvent *, gpointer data)
{
        gint x, y;
       	static gint e_windows_x_offset = 0;
	static gint e_windows_y_offset = 0;

	gdk_window_get_origin(widget->window, &x, &y);
	if (windows_x_offset >= 0) {
                x -= e_windows_x_offset;
                y -= e_windows_y_offset;
        }	
        gtk_widget_hide(widget);
        gtk_widget_set_uposition(widget, x, y);
        global_effects_show = 0;
}


void reverb_off(GtkWidget *, gpointer data)
{
	GtkWidget *feedback_scale;
	GtkAdjustment *adj;

	feedback_scale = get_widget(GTK_WIDGET(data), "feedback_scale");
	adj = GTK_RANGE(feedback_scale)->adjustment;
        gtk_adjustment_set_value(adj, 0.0);
        global_reverb_feedback = 0;
}


GtkWidget *init_effects_window()
{
	GtkWidget *effects_window;

	effects_window = create_effects_window();
	
	// Close/delete signals
	gtk_signal_connect(GTK_OBJECT(effects_window), "destroy",
                GTK_SIGNAL_FUNC(effects_delete_event), NULL);
	gtk_signal_connect(GTK_OBJECT(effects_window), "delete_event",
                GTK_SIGNAL_FUNC(effects_delete_event), NULL);
	return effects_window;
}