annotate src/crossfade/configure.c @ 3203:f5456241bff9 default tip

changed include path from audacious to audlegacy.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 10 Nov 2009 05:19:25 +0900
parents 7b80d4fb493d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
1 /*
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
2 * XMMS Crossfade Plugin
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
3 * Copyright (C) 2000-2007 Peter Eisenlohr <peter@eisenlohr.org>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
4 *
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
5 * based on the original OSS Output Plugin
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
6 * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
7 *
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
11 * (at your option) any later version.
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
12 *
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
16 * GNU General Public License for more details.
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
17 *
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
21 * USA.
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
22 */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
23
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
24 #include "crossfade.h"
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
25 #include "configure.h"
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
26 #include "cfgutil.h"
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
27
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
28 #include "interface-2.0.h"
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
29 #include "support-2.0.h"
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
30
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
31 #include <assert.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
32 #include <stdio.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
33 #include <string.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
34 #include <stdlib.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
35 #include <ctype.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
36
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
37 #include <fcntl.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
38 #include <unistd.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
39 #include <sys/ioctl.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
40 #include <sys/stat.h>
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
41
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
42 #define HIDE(name) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
43 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
44 gtk_widget_hide(set_wgt); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
45
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
46 #define SHOW(name) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
47 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
48 gtk_widget_show(set_wgt); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
49
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
50
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
51 #define SETW_SENSITIVE(wgt, sensitive) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
52 gtk_widget_set_sensitive(wgt, sensitive)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
53
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
54 #define SETW_TOGGLE(wgt, active) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
55 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wgt), active)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
56
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
57 #define SETW_SPIN(wgt, value) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
58 gtk_spin_button_set_value(GTK_SPIN_BUTTON(wgt), value)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
59
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
60
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
61 #define SET_SENSITIVE(name, sensitive) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
62 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
63 gtk_widget_set_sensitive(set_wgt, sensitive); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
64
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
65 #define SET_TOGGLE(name, active) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
66 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
67 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(set_wgt), active); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
68
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
69 #define SET_SPIN(name, value) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
70 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
71 gtk_spin_button_set_value(GTK_SPIN_BUTTON(set_wgt), value); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
72
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
73 #define SET_PAGE(name, index) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
74 { if ((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
75 gtk_notebook_set_page(GTK_NOTEBOOK(set_wgt), index); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
76
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
77 #define SET_HISTORY(name, index) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
78 { if((set_wgt = lookup_widget(config_win, name))) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
79 gtk_option_menu_set_history(GTK_OPTION_MENU(set_wgt), index); }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
80
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
81
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
82 #define GET_SENSITIVE(name) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
83 ((get_wgt = lookup_widget(config_win, name)) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
84 && GTK_WIDGET_SENSITIVE(get_wgt)) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
85
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
86 #define GET_TOGGLE(name) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
87 ((get_wgt = lookup_widget(config_win, name)) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
88 && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(get_wgt)))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
89
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
90 #define GET_SPIN(name) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
91 ((get_wgt = lookup_widget(config_win, name)) \
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
92 ? gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(get_wgt)) : 0)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
93
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
94
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
95 static GtkWidget *config_win = NULL;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
96 static GtkWidget *set_wgt;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
97 static GtkWidget *get_wgt;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
98
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
99 /* defined in cfgutil.c */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
100 extern config_t _xfg;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
101 static config_t *xfg = &_xfg;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
102
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
103 /* some helpers to keep track of the GUI's state */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
104 static gboolean checking = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
105 static gint op_index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
106 static plugin_config_t op_config;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
107
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
108 /* from crossfade.c */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
109 extern MUTEX buffer_mutex;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
110
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
111 /*** internal helpers ********************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
112
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
113 typedef void (*activate_func_t)(GtkWidget *, gint index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
114
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
115 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
116 add_menu_item(GtkWidget *menu, gchar *title, activate_func_t func, gint index, gint **imap)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
117 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
118 GtkWidget *item;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
119 if (!menu || !title || !func)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
120 return;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
121
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
122 item = gtk_menu_item_new_with_label(title);
3129
130edf534967 crossfade plugin code cleanups
Michal Lipski <tallica@o2.pl>
parents: 3066
diff changeset
123 gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc)func, GINT_TO_POINTER(index));
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
124 gtk_widget_show(item);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
125 gtk_menu_append(GTK_MENU(menu), item);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
126
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
127 if (imap)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
128 *((*imap)++) = index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
129 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
130
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
131 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
132 gtk2_spin_button_hack(GtkSpinButton *spin)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
133 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
134 static gboolean entered = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
135 const gchar *text;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
136
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
137 if (entered) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
138 entered = TRUE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
139
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
140 text = gtk_entry_get_text(GTK_ENTRY(spin));
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
141 if (text && *text)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
142 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
143 gint value = atoi(text);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
144 if (value != gtk_spin_button_get_value_as_int(spin))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
145 gtk_spin_button_set_value(spin, value);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
146 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
147 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
148 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
149 gtk_spin_button_set_value(spin, 0.0);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
150 gtk_entry_set_text(GTK_ENTRY(spin), "");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
151 }
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
152
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
153 entered = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
154 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
155
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
156 /*** plugin output ***********************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
157
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
158 static void config_plugin_cb(GtkWidget *widget, gint index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
159
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
160 static gint
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
161 scan_plugins(GtkWidget *option_menu, gchar *selected)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
162 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
163 GtkWidget *menu = gtk_menu_new();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
164 GList *list = g_list_first(xfplayer_get_output_list());
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
165 gint index = 0;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
166 gint sel_index = -1;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
167 gint def_index = -1;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
168
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
169 /* sanity check */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
170 if (selected == NULL)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
171 selected = "";
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
172
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
173 /* parse module list */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
174 while (list)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
175 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
176 OutputPlugin *op = (OutputPlugin *) list->data;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
177 GtkWidget *item = gtk_menu_item_new_with_label(op->description);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
178
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
179 if (op == get_crossfade_oplugin_info()) /* disable selecting ourselves */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
180 gtk_widget_set_sensitive(item, FALSE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
181 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
182 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
183 if (def_index == -1)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
184 def_index = index;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
185
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
186 if (op->filename && strcmp(g_basename(op->filename), selected) == 0)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
187 sel_index = index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
188 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
189
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
190 /* create menu item */
3129
130edf534967 crossfade plugin code cleanups
Michal Lipski <tallica@o2.pl>
parents: 3066
diff changeset
191 gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc)config_plugin_cb, GINT_TO_POINTER(index++));
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
192 gtk_widget_show(item);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
193 gtk_menu_append(GTK_MENU(menu), item);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
194
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
195 /* advance to next module */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
196 list = g_list_next(list);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
197 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
198
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
199 /* attach menu */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
200 gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
201
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
202 if (sel_index == -1)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
203 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
204 DEBUG(("[crossfade] scan_plugins: plugin not found (\"%s\")\n", selected));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
205 return def_index; /* use default (first entry) */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
206 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
207 return sel_index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
208 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
209
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
210 /*-- plugin output callbacks ------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
211
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
212 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
213 config_plugin_cb(GtkWidget *widget, gint index)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
214 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
215 OutputPlugin *op = g_list_nth_data(xfplayer_get_output_list(), index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
216
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
217 /* get plugin options from gui */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
218 op_config.throttle_enable = GET_TOGGLE("op_throttle_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
219 op_config.max_write_enable = GET_TOGGLE("op_maxblock_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
220 op_config.max_write_len = GET_SPIN ("op_maxblock_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
221 op_config.force_reopen = GET_TOGGLE("op_forcereopen_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
222
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
223 /* config -> string */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
224 xfade_save_plugin_config(&xfg->op_config_string, xfg->op_name, &op_config);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
225
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
226 /* select new plugin */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
227 op_index = index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
228
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
229 /* get new plugin's name */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
230 if (xfg->op_name) g_free(xfg->op_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
231 xfg->op_name = (op && op->filename) ? g_strdup(g_basename(op->filename)) : NULL;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
232
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
233 /* string -> config */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
234 xfade_load_plugin_config(xfg->op_config_string, xfg->op_name, &op_config);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
235
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
236 /* update gui */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
237 SET_SENSITIVE("op_configure_button", op && (op->configure != NULL));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
238 SET_SENSITIVE("op_about_button", op && (op->about != NULL));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
239 SET_TOGGLE ("op_throttle_check", op_config.throttle_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
240 SET_TOGGLE ("op_maxblock_check", op_config.max_write_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
241 SET_SPIN ("op_maxblock_spin", op_config.max_write_len);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
242 SET_SENSITIVE("op_maxblock_spin", op_config.max_write_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
243 SET_TOGGLE ("op_forcereopen_check", op_config.force_reopen);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
244 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
245
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
246 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
247 on_output_plugin_configure_button_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
248 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
249 OutputPlugin *op = g_list_nth_data(xfplayer_get_output_list(), op_index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
250 if ((op == NULL) || (op->configure == NULL))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
251 return;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
252
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
253 op->configure();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
254 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
255
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
256 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
257 on_output_plugin_about_button_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
258 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
259 OutputPlugin *op = g_list_nth_data(xfplayer_get_output_list(), op_index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
260 if ((op == NULL) || (op->about == NULL))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
261 return;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
262
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
263 op->about();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
264 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
265
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
266 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
267 on_op_throttle_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
268 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
269 op_config.throttle_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
270 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
271
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
272 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
273 on_op_maxblock_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
274 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
275 op_config.max_write_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
276 SET_SENSITIVE("op_maxblock_spin", op_config.max_write_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
277 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
278
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
279 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
280 on_op_maxblock_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
281 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
282 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
283 op_config.max_write_len = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
284 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
285
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
286 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
287 on_op_forcereopen_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
288 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
289 op_config.max_write_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
290 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
291
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
292 /*** crossfader **************************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
293
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
294 static void xf_config_cb(GtkWidget *widget, gint index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
295 static void xf_type_cb (GtkWidget *widget, gint index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
296
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
297 /* crude hack to keep track of menu items */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
298 static gint xf_config_index_map[MAX_FADE_CONFIGS];
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
299 static gint xf_type_index_map [MAX_FADE_TYPES];
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
300
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
301 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
302 create_crossfader_config_menu()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
303 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
304 GtkWidget *optionmenu, *menu;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
305 gint i, *imap;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
306
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
307 if ((optionmenu = lookup_widget(config_win, "xf_config_optionmenu")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
308 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
309 for (i = 0; i < MAX_FADE_CONFIGS; i++)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
310 xf_config_index_map[i] = -1;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
311
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
312 imap = xf_config_index_map;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
313 menu = gtk_menu_new();
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
314
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
315 add_menu_item(menu, _("Start of playback"), xf_config_cb, FADE_CONFIG_START, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
316 add_menu_item(menu, _("Automatic songchange"), xf_config_cb, FADE_CONFIG_XFADE, &imap);
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
317 #if 0
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
318 /* this should be FADE_TYPE_NONE all the time, anyway,
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
319 so no need to make it configureable by the user */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
320 add_menu_item(menu, "Automatic (gapless)", xf_config_cb, FADE_CONFIG_ALBUM, &imap);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
321 #endif
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
322 add_menu_item(menu, _("Manual songchange"), xf_config_cb, FADE_CONFIG_MANUAL, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
323 add_menu_item(menu, _("Manual stop"), xf_config_cb, FADE_CONFIG_STOP, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
324 add_menu_item(menu, _("End of playlist"), xf_config_cb, FADE_CONFIG_EOP, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
325 add_menu_item(menu, _("Seeking"), xf_config_cb, FADE_CONFIG_SEEK, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
326 add_menu_item(menu, _("Pause"), xf_config_cb, FADE_CONFIG_PAUSE, &imap);
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
327 gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu), menu);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
328 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
329
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
330 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
331
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
332 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
333 create_crossfader_type_menu()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
334 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
335 GtkWidget *optionmenu, *menu;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
336 gint i, *imap;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
337 guint32 mask;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
338
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
339 if ((optionmenu = lookup_widget(config_win, "xf_type_optionmenu")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
340 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
341 for (i = 0; i < MAX_FADE_TYPES; i++)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
342 xf_type_index_map[i] = -1;
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
343
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
344 imap = xf_type_index_map;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
345 menu = gtk_menu_new();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
346 mask = xfg->fc[xfg->xf_index].type_mask;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
347
3151
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
348 if (mask & (1 << FADE_TYPE_REOPEN)) add_menu_item(menu, _("Reopen output device"), xf_type_cb, FADE_TYPE_REOPEN, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
349 if (mask & (1 << FADE_TYPE_FLUSH)) add_menu_item(menu, _("Flush output device"), xf_type_cb, FADE_TYPE_FLUSH, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
350 if (mask & (1 << FADE_TYPE_NONE)) add_menu_item(menu, _("None (gapless/off)"), xf_type_cb, FADE_TYPE_NONE, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
351 if (mask & (1 << FADE_TYPE_PAUSE)) add_menu_item(menu, _("Pause"), xf_type_cb, FADE_TYPE_PAUSE, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
352 if (mask & (1 << FADE_TYPE_SIMPLE_XF)) add_menu_item(menu, _("Simple crossfade"), xf_type_cb, FADE_TYPE_SIMPLE_XF, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
353 if (mask & (1 << FADE_TYPE_ADVANCED_XF)) add_menu_item(menu, _("Advanced crossfade"), xf_type_cb, FADE_TYPE_ADVANCED_XF, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
354 if (mask & (1 << FADE_TYPE_FADEIN)) add_menu_item(menu, _("Fadein"), xf_type_cb, FADE_TYPE_FADEIN, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
355 if (mask & (1 << FADE_TYPE_FADEOUT)) add_menu_item(menu, _("Fadeout"), xf_type_cb, FADE_TYPE_FADEOUT, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
356 if (mask & (1 << FADE_TYPE_PAUSE_NONE)) add_menu_item(menu, _("None"), xf_type_cb, FADE_TYPE_PAUSE_NONE, &imap);
7b80d4fb493d crossfade : the plugin is now translatable.
Stany Henry <StrassBoy@gmail.com>
parents: 3136
diff changeset
357 if (mask & (1 << FADE_TYPE_PAUSE_ADV)) add_menu_item(menu, _("Fadeout/Fadein"), xf_type_cb, FADE_TYPE_PAUSE_ADV, &imap);
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
358 gtk_option_menu_set_menu(GTK_OPTION_MENU(optionmenu), menu);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
359 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
360 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
361
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
362 #define NONE 0x00000000L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
363 #define XF_CONFIG 0x00000001L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
364 #define XF_TYPE 0x00000002L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
365 #define XF_MIX_SIZE 0x00000004L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
366 #define XF_FADEOUT 0x00000008L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
367 #define XF_OFFSET 0x00000010L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
368 #define XF_FADEIN 0x00000020L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
369 #define XF_PAGE 0x00000040L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
370 #define XF_FLUSH 0x00000080L
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
371 #define ANY 0xffffffffL
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
372
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
373 static void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
374 check_crossfader_dependencies(guint32 mask)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
375 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
376 fade_config_t *fc = &xfg->fc[xfg->xf_index];
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
377 gint i;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
378
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
379 /* HACK: avoid endless recursion */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
380 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
381 checking = TRUE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
382
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
383 if (mask & XF_FLUSH)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
384 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
385 SET_TOGGLE("xftfp_enable_check", fc->flush_pause_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
386 SET_SENSITIVE("xftfp_length_label", fc->flush_pause_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
387 SET_SENSITIVE("xftfp_length_spin", fc->flush_pause_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
388 SET_TOGGLE("xftffi_enable_check", fc->flush_in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
389 SET_SENSITIVE("xftffi_length_label", fc->flush_in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
390 SET_SENSITIVE("xftffi_length_spin", fc->flush_in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
391 SET_SENSITIVE("xftffi_volume_label", fc->flush_in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
392 SET_SENSITIVE("xftffi_volume_spin", fc->flush_in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
393 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
394
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
395 if (mask & XF_MIX_SIZE)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
396 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
397 SET_TOGGLE("xf_autobuf_check", xfg->mix_size_auto);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
398 SET_SENSITIVE("xf_buffer_spin", !xfg->mix_size_auto);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
399 SET_SPIN("xf_buffer_spin", xfade_mix_size_ms(xfg));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
400 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
401
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
402 if (mask & XF_CONFIG)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
403 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
404 for (i = 0; i < MAX_FADE_CONFIGS && (xf_config_index_map[i] != xfg->xf_index); i++);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
405 if (i == MAX_FADE_CONFIGS)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
406 i = 0;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
407 SET_HISTORY("xf_config_optionmenu", i);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
408 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
409
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
410 if (mask & XF_TYPE)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
411 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
412 create_crossfader_type_menu();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
413 for (i = 0; i < MAX_FADE_TYPES && (xf_type_index_map[i] != fc->type); i++);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
414 if (i == MAX_FADE_TYPES)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
415 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
416 fc->type = FADE_TYPE_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
417 for (i = 0; i < MAX_FADE_TYPES && (xf_type_index_map[i] != fc->type); i++);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
418 if (i == MAX_FADE_CONFIGS)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
419 i = 0;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
420 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
421 SET_HISTORY("xf_type_optionmenu", i);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
422 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
423
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
424 if (mask & XF_PAGE)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
425 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
426 SET_PAGE("xf_type_notebook", fc->type);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
427 SET_SPIN("pause_length_spin", fc->pause_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
428 SET_SPIN("simple_length_spin", fc->simple_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
429 if (fc->config == FADE_CONFIG_SEEK)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
430 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
431 HIDE("xftf_pause_frame");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
432 HIDE("xftf_fadein_frame");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
433 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
434 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
435 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
436 SHOW("xftf_pause_frame");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
437 SHOW("xftf_fadein_frame");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
438 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
439 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
440
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
441 if (mask & XF_FADEOUT)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
442 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
443 SET_TOGGLE("fadeout_enable_check", fc->out_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
444 SET_SENSITIVE("fadeout_length_label", fc->out_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
445 SET_SENSITIVE("fadeout_length_spin", fc->out_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
446 SET_SPIN("fadeout_length_spin", fc->out_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
447 SET_SENSITIVE("fadeout_volume_label", fc->out_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
448 SET_SENSITIVE("fadeout_volume_spin", fc->out_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
449 SET_SPIN("fadeout_volume_spin", fc->out_volume);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
450 SET_SPIN("xftfo_length_spin", fc->out_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
451 SET_SPIN("xftfo_volume_spin", fc->out_volume);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
452 SET_SPIN("xftfoi_fadeout_spin", fc->out_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
453 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
454
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
455 if (mask & XF_FADEIN)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
456 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
457 SET_TOGGLE("fadein_lock_check", fc->in_locked);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
458 SET_SENSITIVE("fadein_enable_check", !fc->in_locked);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
459 SET_TOGGLE("fadein_enable_check", fc->in_locked ? fc->out_enable : fc->in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
460 SET_SENSITIVE("fadein_length_label", !fc->in_locked && fc->in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
461 SET_SENSITIVE("fadein_length_spin", !fc->in_locked && fc->in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
462 SET_SPIN("fadein_length_spin", fc->in_locked ? fc->out_len_ms : fc->in_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
463 SET_SENSITIVE("fadein_volume_label", !fc->in_locked && fc->in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
464 SET_SENSITIVE("fadein_volume_spin", !fc->in_locked && fc->in_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
465 SET_SPIN("fadein_volume_spin", fc->in_locked ? fc->out_volume : fc->in_volume);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
466 SET_SPIN("xftfi_length_spin", fc->in_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
467 SET_SPIN("xftfi_volume_spin", fc->in_volume);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
468 SET_SPIN("xftfoi_fadein_spin", fc->in_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
469 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
470
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
471 if (mask & XF_OFFSET)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
472 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
473 if (fc->out_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
474 SET_SENSITIVE("xfofs_lockout_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
475 if (!fc->in_locked && fc->in_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
476 SET_SENSITIVE("xfofs_lockin_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
477
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
478 switch (fc->ofs_type)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
479 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
480 case FC_OFFSET_LOCK_OUT:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
481 if (!fc->out_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
482 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
483 SET_TOGGLE("xfofs_none_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
484 fc->ofs_type = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
485 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
486 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
487
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
488 case FC_OFFSET_LOCK_IN:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
489 if (!(!fc->in_locked && fc->in_enable))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
490 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
491 if ((fc->in_locked && fc->out_enable))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
492 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
493 SET_TOGGLE("xfofs_lockout_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
494 fc->ofs_type = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
495 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
496 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
497 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
498 SET_TOGGLE("xfofs_none_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
499 fc->ofs_type = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
500 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
501 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
502 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
503 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
504
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
505 switch (fc->ofs_type_wanted)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
506 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
507 case FC_OFFSET_NONE:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
508 SET_TOGGLE("xfofs_none_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
509 fc->ofs_type = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
510 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
511
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
512 case FC_OFFSET_LOCK_OUT:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
513 if (fc->out_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
514 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
515 SET_TOGGLE("xfofs_lockout_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
516 fc->ofs_type = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
517 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
518 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
519
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
520 case FC_OFFSET_LOCK_IN:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
521 if (!fc->in_locked && fc->in_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
522 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
523 SET_TOGGLE("xfofs_lockin_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
524 fc->ofs_type = FC_OFFSET_LOCK_IN;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
525 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
526 else if (fc->out_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
527 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
528 SET_TOGGLE("xfofs_lockout_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
529 fc->ofs_type = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
530 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
531 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
532
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
533 case FC_OFFSET_CUSTOM:
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
534 SET_TOGGLE("xfofs_custom_radiobutton", TRUE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
535 fc->ofs_type = FC_OFFSET_CUSTOM;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
536 break;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
537 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
538
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
539 if (!fc->out_enable)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
540 SET_SENSITIVE("xfofs_lockout_radiobutton", FALSE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
541 if (!(!fc->in_locked && fc->in_enable))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
542 SET_SENSITIVE("xfofs_lockin_radiobutton", FALSE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
543
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
544 SET_SENSITIVE("xfofs_custom_spin", fc->ofs_type == FC_OFFSET_CUSTOM);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
545 SET_SPIN("xfofs_custom_spin", xfade_cfg_offset(fc));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
546 SET_SPIN("xftfo_silence_spin", xfade_cfg_offset(fc));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
547 SET_SPIN("xftfoi_silence_spin", xfade_cfg_offset(fc));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
548 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
549
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
550 checking = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
551 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
552
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
553 /*-- crossfader callbacks ---------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
554
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
555 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
556 on_xf_buffer_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
557 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
558 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
559 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
560 xfg->mix_size_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
561 check_crossfader_dependencies(NONE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
562 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
563
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
564 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
565 on_xf_autobuf_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
566 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
567 xfg->mix_size_auto = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
568 check_crossfader_dependencies(XF_MIX_SIZE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
569 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
570
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
571 /* - config/type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
572
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
573 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
574 xf_config_cb(GtkWidget *widget, gint index)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
575 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
576 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
577 xfg->xf_index = index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
578 check_crossfader_dependencies(ANY & ~XF_CONFIG);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
579 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
580
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
581 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
582 xf_type_cb(GtkWidget *widget, gint index)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
583 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
584 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
585 xfg->fc[xfg->xf_index].type = index;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
586 check_crossfader_dependencies(ANY & ~XF_CONFIG);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
587 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
588
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
589 /* - flush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
590
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
591 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
592 on_xftfp_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
593 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
594 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
595 xfg->fc[xfg->xf_index].flush_pause_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
596 check_crossfader_dependencies(XF_FLUSH | XF_MIX_SIZE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
597 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
598
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
599 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
600 on_xftfp_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
601 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
602 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
603 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
604 xfg->fc[xfg->xf_index].flush_pause_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
605 check_crossfader_dependencies(XF_FLUSH);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
606 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
607
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
608 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
609 on_xftffi_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
610 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
611 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
612 xfg->fc[xfg->xf_index].flush_in_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
613 check_crossfader_dependencies(XF_FLUSH | XF_OFFSET | XF_FADEOUT | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
614 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
615
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
616 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
617 on_xftffi_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
618 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
619 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
620 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
621 xfg->fc[xfg->xf_index].flush_in_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
622 check_crossfader_dependencies(XF_FLUSH);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
623 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
624
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
625 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
626 on_xftffi_volume_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
627 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
628 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
629 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
630 xfg->fc[xfg->xf_index].flush_in_volume = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
631 check_crossfader_dependencies(XF_FLUSH);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
632 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
633
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
634 /* - pause - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
635
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
636 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
637 on_pause_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
638 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
639 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
640 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
641 xfg->fc[xfg->xf_index].pause_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
642 check_crossfader_dependencies(XF_MIX_SIZE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
643 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
644
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
645 /* - simple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
646
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
647 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
648 on_simple_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
649 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
650 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
651 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
652 xfg->fc[xfg->xf_index].simple_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
653 check_crossfader_dependencies(XF_MIX_SIZE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
654 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
655
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
656 /* - crossfade-fadeout - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
657
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
658 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
659 on_fadeout_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
660 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
661 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
662 xfg->fc[xfg->xf_index].out_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
663 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET | XF_FADEOUT | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
664 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
665
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
666 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
667 on_fadeout_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
668 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
669 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
670 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
671 xfg->fc[xfg->xf_index].out_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
672 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
673 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
674
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
675 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
676 on_fadeout_volume_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
677 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
678 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
679 xfg->fc[xfg->xf_index].out_volume = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
680 check_crossfader_dependencies(XF_OFFSET | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
681 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
682
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
683 /* - crossfade-offset - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
684
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
685 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
686 on_xfofs_none_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
687 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
688 if (checking || !gtk_toggle_button_get_active(togglebutton)) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
689 xfg->fc[xfg->xf_index].ofs_type = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
690 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
691 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
692 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
693
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
694 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
695 on_xfofs_none_radiobutton_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
696 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
697 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
698 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_NONE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
699 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
700
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
701 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
702 on_xfofs_lockout_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
703 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
704 if (checking || !gtk_toggle_button_get_active(togglebutton)) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
705 xfg->fc[xfg->xf_index].ofs_type = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
706 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
707 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
708 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
709
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
710 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
711 on_xfofs_lockout_radiobutton_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
712 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
713 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
714 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_LOCK_OUT;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
715 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
716
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
717 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
718 on_xfofs_lockin_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
719 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
720 if (checking || !gtk_toggle_button_get_active(togglebutton)) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
721 xfg->fc[xfg->xf_index].ofs_type = FC_OFFSET_LOCK_IN;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
722 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_LOCK_IN;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
723 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
724 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
725
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
726 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
727 on_xfofs_lockin_radiobutton_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
728 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
729 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
730 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_LOCK_IN;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
731 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
732
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
733 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
734 on_xfofs_custom_radiobutton_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
735 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
736 if (checking || !gtk_toggle_button_get_active(togglebutton)) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
737 xfg->fc[xfg->xf_index].ofs_type = FC_OFFSET_CUSTOM;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
738 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_CUSTOM;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
739 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
740 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
741
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
742 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
743 on_xfofs_custom_radiobutton_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
744 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
745 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
746 xfg->fc[xfg->xf_index].ofs_type_wanted = FC_OFFSET_CUSTOM;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
747 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
748
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
749 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
750 on_xfofs_custom_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
751 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
752 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
753 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
754 xfg->fc[xfg->xf_index].ofs_custom_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
755 check_crossfader_dependencies(XF_MIX_SIZE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
756 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
757
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
758 /* - crossfade-fadein - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
759
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
760 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
761 on_fadein_lock_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
762 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
763 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
764 xfg->fc[xfg->xf_index].in_locked = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
765 check_crossfader_dependencies(XF_OFFSET | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
766 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
767
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
768 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
769 on_fadein_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
770 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
771 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
772 xfg->fc[xfg->xf_index].in_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
773 check_crossfader_dependencies(XF_OFFSET | XF_FADEIN);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
774 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
775
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
776 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
777 on_fadein_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
778 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
779 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
780 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
781 xfg->fc[xfg->xf_index].in_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
782 check_crossfader_dependencies(XF_MIX_SIZE | XF_OFFSET);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
783 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
784
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
785 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
786 on_fadein_volume_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
787 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
788 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
789 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
790 xfg->fc[xfg->xf_index].in_volume = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
791 check_crossfader_dependencies(NONE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
792 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
793
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
794 /*-- fadein -----------------------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
795
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
796 /* signal set to on_fadein_length_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
797 /* signal set to on_fadein_volume_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
798
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
799 /*-- fadeout ----------------------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
800
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
801 /* signal set to on_fadeout_length_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
802 /* signal set to on_fadeout_volume_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
803
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
804 /*-- fadeout/fadein ---------------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
805
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
806 /* signal set to on_fadeout_length_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
807 /* signal set to on_xfofs_custom_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
808 /* signal set to on_fadeout_volume_spin_changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
809
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
810 /*** gap killer **************************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
811
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
812 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
813 check_gapkiller_dependencies()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
814 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
815 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
816 checking = TRUE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
817
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
818 SET_SENSITIVE("lgap_length_spin", xfg->gap_lead_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
819 SET_SENSITIVE("lgap_level_spin", xfg->gap_lead_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
820 SET_SENSITIVE("tgap_enable_check", !xfg->gap_trail_locked);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
821 SET_SENSITIVE("tgap_length_spin", !xfg->gap_trail_locked && xfg->gap_trail_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
822 SET_SENSITIVE("tgap_level_spin", !xfg->gap_trail_locked && xfg->gap_trail_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
823
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
824 if (xfg->gap_trail_locked)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
825 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
826 SET_TOGGLE("tgap_enable_check", xfg->gap_lead_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
827 SET_SPIN("tgap_length_spin", xfg->gap_lead_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
828 SET_SPIN("tgap_level_spin", xfg->gap_lead_level);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
829 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
830 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
831 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
832 SET_TOGGLE("tgap_enable_check", xfg->gap_trail_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
833 SET_SPIN("tgap_length_spin", xfg->gap_trail_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
834 SET_SPIN("tgap_level_spin", xfg->gap_trail_level);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
835 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
836
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
837 if (xfg->mix_size_auto)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
838 SET_SPIN("xf_buffer_spin", xfade_mix_size_ms(xfg));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
839
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
840 checking = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
841 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
842
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
843 /*-- gapkiller callbacks ----------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
844
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
845 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
846 on_lgap_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
847 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
848 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
849 xfg->gap_lead_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
850 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
851 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
852
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
853 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
854 on_lgap_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
855 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
856 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
857 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
858 xfg->gap_lead_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
859 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
860 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
861
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
862 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
863 on_lgap_level_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
864 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
865 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
866 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
867 xfg->gap_lead_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
868 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
869 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
870
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
871 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
872 on_tgap_lock_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
873 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
874 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
875 xfg->gap_trail_locked = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
876 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
877 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
878
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
879 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
880 on_tgap_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
881 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
882 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
883 xfg->gap_trail_enable = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
884 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
885 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
886
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
887 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
888 on_tgap_length_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
889 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
890 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
891 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
892 xfg->gap_trail_len_ms = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
893 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
894
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
895 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
896 on_tgap_level_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
897 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
898 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
899 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
900 xfg->gap_trail_level = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
901 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
902
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
903 /*** misc ********************************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
904
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
905 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
906 check_misc_dependencies()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
907 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
908 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
909 checking = TRUE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
910
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
911 if (xfg->mix_size_auto)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
912 SET_SPIN("xf_buffer_spin", xfade_mix_size_ms(xfg));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
913
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
914 SET_SENSITIVE("moth_opmaxused_spin", xfg->enable_op_max_used);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
915
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
916 checking = FALSE;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
917 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
918
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
919 /*-- misc callbacks ---------------------------------------------------------*/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
920
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
921 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
922 on_config_mixopt_enable_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
923 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
924 SET_SENSITIVE("mixopt_reverse_check", gtk_toggle_button_get_active(togglebutton));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
925 SET_SENSITIVE("mixopt_software_check", gtk_toggle_button_get_active(togglebutton));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
926 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
927
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
928 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
929 on_moth_songchange_spin_changed(GtkEditable *editable, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
930 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
931 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
932 gtk2_spin_button_hack(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
933 xfg->songchange_timeout = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(editable));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
934 check_misc_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
935 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
936
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
937 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
938 on_moth_opmaxused_check_toggled(GtkToggleButton *togglebutton, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
939 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
940 if (checking) return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
941 xfg->enable_op_max_used = gtk_toggle_button_get_active(togglebutton);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
942 check_misc_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
943 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
944
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
945 /*** main config *************************************************************/
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
946
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
947 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
948 on_config_apply_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
949 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
950 GtkWidget *widget;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
951
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
952 /* get current notebook page */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
953 if ((widget = lookup_widget(config_win, "config_notebook")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
954 xfg->page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widget));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
955
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
956 /* output method: plugin */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
957 op_config.throttle_enable = GET_TOGGLE("op_throttle_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
958 op_config.max_write_enable = GET_TOGGLE("op_maxblock_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
959 op_config.max_write_len = GET_SPIN("op_maxblock_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
960 op_config.force_reopen = GET_TOGGLE("op_forcereopen_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
961
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
962 xfade_save_plugin_config(&xfg->op_config_string, xfg->op_name, &op_config);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
963
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
964 /* output method: none: */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
965
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
966 /* effects: pre-mixing effect plugin */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
967
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
968 /* effects: volume normalizer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
969
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
970 /* crossfader */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
971 xfg->mix_size_auto = GET_TOGGLE("xf_autobuf_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
972
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
973 /* gap killer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
974 xfg->gap_lead_enable = GET_TOGGLE("lgap_enable_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
975 xfg->gap_lead_len_ms = GET_SPIN("lgap_length_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
976 xfg->gap_lead_level = GET_SPIN("lgap_level_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
977
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
978 xfg->gap_trail_locked = GET_TOGGLE("tgap_lock_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
979
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
980 xfg->gap_crossing = GET_TOGGLE("gadv_crossing_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
981
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
982 /* misc */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
983 xfg->enable_debug = GET_TOGGLE("debug_stderr_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
984 xfg->enable_mixer = GET_TOGGLE("mixopt_enable_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
985 xfg->mixer_reverse = GET_TOGGLE("mixopt_reverse_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
986 xfg->mixer_software = GET_TOGGLE("mixopt_software_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
987 xfg->preload_size_ms = GET_SPIN("moth_preload_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
988 xfg->album_detection = GET_TOGGLE("noxf_album_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
989 xfg->no_xfade_if_same_file = GET_TOGGLE("noxf_samefile_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
990 xfg->enable_http_workaround = GET_TOGGLE("moth_httpworkaround_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
991 xfg->op_max_used_ms = GET_SPIN("moth_opmaxused_spin");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
992 xfg->output_keep_opened = GET_TOGGLE("moth_outputkeepopened_check");
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
993
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
994 /* presets */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
995
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
996 /* lock buffer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
997 MUTEX_LOCK(&buffer_mutex);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
998
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
999 /* free existing strings */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1000 if (config->op_config_string) g_free(config->op_config_string);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1001 if (config->op_name) g_free(config->op_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1002 if (config->ep_name) g_free(config->ep_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1003
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1004 /* copy current settings (dupping the strings) */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1005 *config = *xfg;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1006 config->op_config_string = g_strdup(xfg->op_config_string);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1007 config->op_name = g_strdup(xfg->op_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1008 config->ep_name = g_strdup(xfg->ep_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1009
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1010 /* tell the engine that the config has changed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1011 xfade_realize_config();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1012
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1013 /* unlock buffer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1014 MUTEX_UNLOCK(&buffer_mutex);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1015
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1016 /* save configuration */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1017 xfade_save_config();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1018 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1019
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1020 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1021 on_config_ok_clicked(GtkButton *button, gpointer user_data)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1022 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1023 /* apply and save config */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1024 on_config_apply_clicked(button, user_data);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1025
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1026 /* close and destroy window */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1027 gtk_widget_destroy(config_win);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1028 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1029
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1030 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1031 xfade_configure()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1032 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1033 GtkWidget *widget;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1034
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1035 if (!config_win)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1036 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1037 /* create */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1038 if (!(config_win = create_config_win()))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1039 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1040 DEBUG(("[crossfade] plugin_configure: error creating window!\n"));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1041 return;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1042 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1043
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1044 /* update config_win when window is destroyed */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1045 gtk_signal_connect(GTK_OBJECT(config_win), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &config_win);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1046
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1047 /* free any strings that might be left in our local copy of the config */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1048 if (xfg->op_config_string) g_free(xfg->op_config_string);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1049 if (xfg->op_name) g_free(xfg->op_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1050 if (xfg->ep_name) g_free(xfg->ep_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1051
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1052 /* copy current settings (dupping the strings) */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1053 *xfg = *config;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1054 xfg->op_config_string = g_strdup(config->op_config_string);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1055 xfg->op_name = g_strdup(config->op_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1056 xfg->ep_name = g_strdup(config->ep_name);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1057
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1058 /* go to remembered notebook page */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1059 if ((widget = lookup_widget(config_win, "config_notebook")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1060 gtk_notebook_set_page(GTK_NOTEBOOK(widget), config->page);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1061
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1062 /* output method: plugin */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1063 xfade_load_plugin_config(xfg->op_config_string, xfg->op_name, &op_config);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1064 SET_TOGGLE ("op_throttle_check", op_config.throttle_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1065 SET_TOGGLE ("op_maxblock_check", op_config.max_write_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1066 SET_SPIN ("op_maxblock_spin", op_config.max_write_len);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1067 SET_SENSITIVE("op_maxblock_spin", op_config.max_write_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1068 SET_TOGGLE ("op_forcereopen_check", op_config.force_reopen);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1069
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1070 if ((widget = lookup_widget(config_win, "op_plugin_optionmenu")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1071 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1072 OutputPlugin *op = NULL;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1073 if ((op_index = scan_plugins(widget, xfg->op_name)) >= 0)
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1074 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1075 gtk_option_menu_set_history(GTK_OPTION_MENU(widget), op_index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1076 op = g_list_nth_data(xfplayer_get_output_list(), op_index);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1077 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1078 SET_SENSITIVE("op_configure_button", op && (op->configure != NULL));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1079 SET_SENSITIVE("op_about_button", op && (op->about != NULL));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1080 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1081
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1082 /* crossfader */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1083 create_crossfader_config_menu();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1084
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1085 if ((xfg->xf_index < 0) || (xfg->xf_index >= MAX_FADE_CONFIGS))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1086 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1087 DEBUG(("[crossfade] plugin_configure: crossfade index out of range (%d)!\n", xfg->xf_index));
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1088 xfg->xf_index = CLAMP(xfg->xf_index, 0, MAX_FADE_CONFIGS);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1089 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1090
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1091 check_crossfader_dependencies(ANY);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1092
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1093 /* gap killer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1094 SET_TOGGLE("lgap_enable_check", xfg->gap_lead_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1095 SET_SPIN ("lgap_length_spin", xfg->gap_lead_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1096 SET_SPIN ("lgap_level_spin", xfg->gap_lead_level);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1097 SET_TOGGLE("tgap_lock_check", xfg->gap_trail_locked);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1098 SET_TOGGLE("tgap_enable_check", xfg->gap_trail_enable);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1099 SET_SPIN ("tgap_length_spin", xfg->gap_trail_len_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1100 SET_SPIN ("tgap_level_spin", xfg->gap_trail_level);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1101 SET_TOGGLE("gadv_crossing_check", xfg->gap_crossing);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1102
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1103 check_gapkiller_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1104
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1105 /* misc */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1106 SET_TOGGLE("debug_stderr_check", xfg->enable_debug);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1107 SET_TOGGLE("mixopt_enable_check", xfg->enable_mixer);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1108 SET_TOGGLE("mixopt_reverse_check", xfg->mixer_reverse);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1109 SET_TOGGLE("mixopt_software_check", xfg->mixer_software);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1110 SET_SPIN ("moth_songchange_spin", xfg->songchange_timeout);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1111 SET_SPIN ("moth_preload_spin", xfg->preload_size_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1112 SET_TOGGLE("noxf_album_check", xfg->album_detection);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1113 SET_TOGGLE("noxf_samefile_check", xfg->album_detection);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1114 SET_TOGGLE("moth_httpworkaround_check", xfg->enable_http_workaround);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1115 SET_TOGGLE("moth_opmaxused_check", xfg->enable_op_max_used);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1116 SET_SPIN ("moth_opmaxused_spin", xfg->op_max_used_ms);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1117 SET_TOGGLE("moth_outputkeepopened_check", xfg->output_keep_opened);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1118
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1119 check_misc_dependencies();
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1120
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1121 /* presets */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1122 if ((set_wgt = lookup_widget(config_win, "presets_list_list")))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1123 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1124 GList *item;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1125
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1126 for (item = config->presets; item; item = g_list_next(item))
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1127 {
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1128 gchar *name = (gchar *) item->data;
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1129 gchar *text[] = { name, "Default", "No" };
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1130 gtk_clist_append(GTK_CLIST(set_wgt), text);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1131 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1132 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1133
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1134 /* show window near mouse pointer */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1135 gtk_window_set_position(GTK_WINDOW(config_win), GTK_WIN_POS_MOUSE);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1136 gtk_widget_show(config_win);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1137 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1138 else
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1139 /* bring window to front */
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1140 gdk_window_raise(config_win->window);
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1141 }
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1142
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1143 void
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1144 xfade_about()
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1145 {
3136
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1146 static GtkWidget *dialog;
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1147
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1148 if (dialog != NULL)
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1149 return;
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1150
3136
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1151 dialog = audacious_info_dialog(
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1152 _("About Crossfade Plugin"),
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1153 _("Audacious Crossfade Plugin\n\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1154 "Copyright © 2009 William Pitcock <nenolod@atheme.org>\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1155 "\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1156 "...based in part on XMMS-Crossfade:\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1157 "Copyright © 2000-2009 Peter Eisenlohr <peter@eisenlohr.org>\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1158 "\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1159 "based on the original OSS Output Plugin Copyright (C) 1998-2000\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1160 "Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1161 "\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1162 "This program is free software; you can redistribute it and/or modify\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1163 "it under the terms of the GNU General Public License as published by\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1164 "the Free Software Foundation; either version 2 of the License, or\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1165 "(at your option) any later version.\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1166 "\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1167 "This program is distributed in the hope that it will be useful,\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1168 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1169 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1170 "GNU General Public License for more details.\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1171 "\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1172 "You should have received a copy of the GNU General Public License\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1173 "along with this program; if not, write to the Free Software\n"
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1174 "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,\n" "USA."),
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1175 _("Ok"), FALSE, NULL, NULL);
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1176
3136
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1177 g_signal_connect(G_OBJECT(dialog), "destroy",
a9593b76cf19 crossfade: change about dialog to use audacious_info_dialog()
Michal Lipski <tallica@o2.pl>
parents: 3134
diff changeset
1178 G_CALLBACK(gtk_widget_destroyed), &dialog);
3059
2e241e90494a Import work in progress xmms-crossfade rewrite.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1179 }