annotate src/audacious/ui_main_evlisteners.c @ 4586:5fa09aa0b14a

add equalizer changed hook
author Tomasz Mon <desowin@gmail.com>
date Fri, 23 May 2008 15:37:45 +0200
parents 78e21c07ba6a
children a77d02342ee1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
1 /*
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
2 * Audacious
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
3 * Copyright (c) 2006-2007 Audacious development team.
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
4 *
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
7 * the Free Software Foundation; under version 3 of the License.
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
8 *
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
12 * GNU General Public License for more details.
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
13 *
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses>.
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
16 *
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
17 * The Audacious team does not consider modular code linking to
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
18 * Audacious or using our public API to be a derived work.
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
19 */
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
20
4504
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
21 #include "ui_playlist_evlisteners.h"
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
22
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
23 #include <glib.h>
3899
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
24 #include <math.h>
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
25
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
26 #include "hook.h"
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
27 #include "playback.h"
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
28 #include "playlist.h"
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
29 #include "playlist_evmessages.h"
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
30 #include "visualization.h"
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
31
4544
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
32 #include "ui_credits.h"
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
33 #include "ui_equalizer.h"
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
34 #include "ui_fileopener.h"
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
35 #include "ui_jumptotrack.h"
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
36 #include "ui_main.h"
4544
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
37 #include "ui_playlist.h"
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
38 #include "ui_preferences.h"
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
39 #include "ui_skinned_playstatus.h"
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
40 #include "ui_skinned_textbox.h"
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
41 #include "ui_skinned_window.h"
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
42
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
43 static gint song_info_timeout_source = 0;
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
44 static gint update_vis_timeout_source = 0;
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
45
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
46 /* XXX: there has to be a better way than polling here! */
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
47 /* also: where should this function go? should it stay here? --mf0102 */
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
48 static gboolean
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
49 update_vis_func(gpointer unused)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
50 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
51 if (!playback_get_playing())
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
52 return FALSE;
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
53
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
54 input_update_vis(playback_get_time());
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
55
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
56 return TRUE;
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
57 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
58
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
59 static void
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
60 ui_main_evlistener_title_change(gpointer hook_data, gpointer user_data)
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
61 {
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
62 gchar *text = (gchar *) hook_data;
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
63
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
64 ui_skinned_textbox_set_text(mainwin_info, text);
3248
3cf247e4508c fix not updating playlist on title change
Tomasz Mon <desowin@gmail.com>
parents: 3197
diff changeset
65 playlistwin_update_list(playlist_get_active());
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
66 }
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
67
3197
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
68 static void
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
69 ui_main_evlistener_hide_seekbar(gpointer hook_data, gpointer user_data)
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
70 {
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
71 mainwin_disable_seekbar();
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
72 }
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
73
3899
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
74 static void
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
75 ui_main_evlistener_volume_change(gpointer hook_data, gpointer user_data)
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
76 {
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
77 gint *h_vol = (gint *) hook_data;
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
78 gint vl, vr, b, v;
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
79
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
80 vl = CLAMP(h_vol[0], 0, 100);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
81 vr = CLAMP(h_vol[1], 0, 100);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
82 v = MAX(vl, vr);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
83 if (vl > vr)
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
84 b = (gint) rint(((gdouble) vr / vl) * 100) - 100;
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
85 else if (vl < vr)
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
86 b = 100 - (gint) rint(((gdouble) vl / vr) * 100);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
87 else
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
88 b = 0;
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
89
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
90 mainwin_set_volume_slider(v);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
91 equalizerwin_set_volume_slider(v);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
92 mainwin_set_balance_slider(b);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
93 equalizerwin_set_balance_slider(b);
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
94 }
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
95
4026
17bf734f8187 avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3899
diff changeset
96 static void
4584
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
97 ui_main_evlistener_playback_initiate(gpointer hook_data, gpointer user_data)
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
98 {
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
99 playback_initiate();
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
100 }
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
101
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
102 static void
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
103 ui_main_evlistener_playback_begin(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
104 {
4360
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
105 PlaylistEntry *entry = (PlaylistEntry*)hook_data;
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
106 g_return_if_fail(entry != NULL);
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
107
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
108 equalizerwin_load_auto_preset(entry->filename);
4586
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
109 hook_call("equalizer changed", NULL);
4360
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
110
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
111 ui_vis_clear_data(mainwin_vis);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
112 ui_svis_clear_data(mainwin_svis);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
113 mainwin_disable_seekbar();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
114 mainwin_update_song_info();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
115
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
116 if (cfg.player_shaded) {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
117 gtk_widget_show(mainwin_stime_min);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
118 gtk_widget_show(mainwin_stime_sec);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
119 gtk_widget_show(mainwin_sposition);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
120 } else {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
121 gtk_widget_show(mainwin_minus_num);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
122 gtk_widget_show(mainwin_10min_num);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
123 gtk_widget_show(mainwin_min_num);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
124 gtk_widget_show(mainwin_10sec_num);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
125 gtk_widget_show(mainwin_sec_num);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
126 gtk_widget_show(mainwin_position);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
127 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
128
4360
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
129 song_info_timeout_source =
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
130 g_timeout_add_seconds(1, (GSourceFunc) mainwin_update_song_info, NULL);
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
131
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
132 update_vis_timeout_source =
313dd79a2d24 move some more GUI functions
mf0102 <0102@gmx.at>
parents: 4359
diff changeset
133 g_timeout_add(10, (GSourceFunc) update_vis_func, NULL);
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
134
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
135 vis_playback_start();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
136
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
137 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
138 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
139
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
140 static void
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
141 ui_main_evlistener_playback_stop(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
142 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
143 if (song_info_timeout_source)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
144 g_source_remove(song_info_timeout_source);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
145
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
146 vis_playback_stop();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
147 free_vis_data();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
148
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
149 ui_skinned_playstatus_set_buffering(mainwin_playstatus, FALSE);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
150 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
151
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
152 static void
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
153 ui_main_evlistener_playback_pause(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
154 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
155 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PAUSE);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
156 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
157
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
158 static void
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
159 ui_main_evlistener_playback_unpause(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
160 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
161 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
162 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
163
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
164 static void
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
165 ui_main_evlistener_playback_seek(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
166 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
167 free_vis_data();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
168 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
169
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
170 static void
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
171 ui_main_evlistener_playback_play_file(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
172 {
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
173 if (cfg.random_skin_on_play)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
174 skin_set_random_skin();
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
175 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
176
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
177 static void
4504
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
178 ui_main_evlistener_playlist_end_reached(gpointer hook_data, gpointer user_data)
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
179 {
4510
3429239e22e7 very little intendation cleanup
mf0102 <0102@gmx.at>
parents: 4504
diff changeset
180 mainwin_clear_song_info();
4546
d4c5719d30d1 - rename dock.c to ui_dock.c
mf0102 <0102@gmx.at>
parents: 4544
diff changeset
181
d4c5719d30d1 - rename dock.c to ui_dock.c
mf0102 <0102@gmx.at>
parents: 4544
diff changeset
182 if (cfg.stopaftersong)
d4c5719d30d1 - rename dock.c to ui_dock.c
mf0102 <0102@gmx.at>
parents: 4544
diff changeset
183 mainwin_set_stopaftersong(FALSE);
4504
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
184 }
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
185
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
186 static void
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
187 ui_main_evlistener_playlist_info_change(gpointer hook_data, gpointer user_data)
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
188 {
4510
3429239e22e7 very little intendation cleanup
mf0102 <0102@gmx.at>
parents: 4504
diff changeset
189 PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data;
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
190
4510
3429239e22e7 very little intendation cleanup
mf0102 <0102@gmx.at>
parents: 4504
diff changeset
191 mainwin_set_song_info(msg->bitrate, msg->samplerate, msg->channels);
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
192 }
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
193
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
194 static void
4544
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
195 ui_main_evlistener_mainwin_set_always_on_top(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
196 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
197 gboolean *ontop = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
198 mainwin_set_always_on_top(*ontop);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
199 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
200
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
201 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
202 ui_main_evlistener_mainwin_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
203 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
204 gboolean *show = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
205 mainwin_show(*show);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
206 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
207
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
208 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
209 ui_main_evlistener_equalizerwin_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
210 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
211 gboolean *show = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
212 equalizerwin_show(*show);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
213 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
214
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
215 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
216 ui_main_evlistener_prefswin_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
217 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
218 gboolean *show = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
219 if (*show == TRUE)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
220 show_prefs_window();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
221 else
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
222 hide_prefs_window();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
223 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
224
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
225 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
226 ui_main_evlistener_aboutwin_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
227 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
228 gboolean *show = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
229 if (*show == TRUE)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
230 show_about_window();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
231 else
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
232 hide_about_window();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
233 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
234
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
235
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
236 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
237 ui_main_evlistener_ui_jump_to_track_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
238 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
239 gboolean *show = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
240 if (*show == TRUE)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
241 ui_jump_to_track();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
242 else
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
243 ui_jump_to_track_hide();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
244 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
245
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
246 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
247 ui_main_evlistener_filebrowser_show(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
248 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
249 gboolean *play_button = (gboolean*)hook_data;
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
250 run_filebrowser(*play_button);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
251 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
252
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
253 static void
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
254 ui_main_evlistener_filebrowser_hide(gpointer hook_data, gpointer user_data)
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
255 {
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
256 hide_filebrowser();
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
257 }
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
258
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
259 static void
4553
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
260 ui_main_evlistener_visualization_timeout(gpointer hook_data, gpointer user_data)
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
261 {
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
262 if (cfg.player_shaded && cfg.player_visible)
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
263 ui_svis_timeout_func(mainwin_svis, hook_data);
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
264 else
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
265 ui_vis_timeout_func(mainwin_vis, hook_data);
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
266 }
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
267
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
268 static void
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
269 ui_main_evlistener_config_save(gpointer hook_data, gpointer user_data)
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
270 {
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
271 ConfigDb *db = (ConfigDb *) hook_data;
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
272
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
273 if (SKINNED_WINDOW(mainwin)->x != -1 &&
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
274 SKINNED_WINDOW(mainwin)->y != -1 )
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
275 {
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
276 cfg_db_set_int(db, NULL, "player_x", SKINNED_WINDOW(mainwin)->x);
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
277 cfg_db_set_int(db, NULL, "player_y", SKINNED_WINDOW(mainwin)->y);
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
278 }
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
279
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
280 cfg_db_set_bool(db, NULL, "mainwin_use_bitmapfont",
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
281 cfg.mainwin_use_bitmapfont);
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
282 }
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
283
4586
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
284 static void
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
285 ui_main_evlistener_equalizer_changed(gpointer hook_data, gpointer user_data)
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
286 {
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
287 /* um .. i think we need both of these for xmms compatibility ..
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
288 not sure. -larne */
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
289 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
290 cfg.equalizer_bands);
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
291 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
292 cfg.equalizer_bands);
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
293 }
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
294
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
295 void
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
296 ui_main_evlistener_init(void)
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
297 {
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
298 hook_associate("title change", ui_main_evlistener_title_change, NULL);
3197
5dd8bc77a590 now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3165
diff changeset
299 hook_associate("hide seekbar", ui_main_evlistener_hide_seekbar, NULL);
3899
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
300 hook_associate("volume set", ui_main_evlistener_volume_change, NULL);
4584
41400d8a5dc9 Backed out changeset 25ec507c23bc
Tomasz Mon <desowin@gmail.com>
parents: 4580
diff changeset
301 hook_associate("playback initiate", ui_main_evlistener_playback_initiate, NULL);
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
302 hook_associate("playback begin", ui_main_evlistener_playback_begin, NULL);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
303 hook_associate("playback stop", ui_main_evlistener_playback_stop, NULL);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
304 hook_associate("playback pause", ui_main_evlistener_playback_pause, NULL);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
305 hook_associate("playback unpause", ui_main_evlistener_playback_unpause, NULL);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
306 hook_associate("playback seek", ui_main_evlistener_playback_seek, NULL);
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
307 hook_associate("playback play file", ui_main_evlistener_playback_play_file, NULL);
4504
a47288ced5d5 - renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents: 4360
diff changeset
308 hook_associate("playlist end reached", ui_main_evlistener_playlist_end_reached, NULL);
4359
0becb809bdc9 moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents: 4026
diff changeset
309 hook_associate("playlist info change", ui_main_evlistener_playlist_info_change, NULL);
4544
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
310 hook_associate("mainwin set always on top", ui_main_evlistener_mainwin_set_always_on_top, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
311 hook_associate("mainwin show", ui_main_evlistener_mainwin_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
312 hook_associate("equalizerwin show", ui_main_evlistener_equalizerwin_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
313 hook_associate("prefswin show", ui_main_evlistener_prefswin_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
314 hook_associate("aboutwin show", ui_main_evlistener_aboutwin_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
315 hook_associate("ui jump to track show", ui_main_evlistener_ui_jump_to_track_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
316 hook_associate("filebrowser show", ui_main_evlistener_filebrowser_show, NULL);
084dbc8d23da removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents: 4513
diff changeset
317 hook_associate("filebrowser hide", ui_main_evlistener_filebrowser_hide, NULL);
4553
47cc110bef0c Hookify a visualization function
mf0102 <0102@gmx.at>
parents: 4546
diff changeset
318 hook_associate("visualization timeout", ui_main_evlistener_visualization_timeout, NULL);
4513
867d7caeb95b - indentation of ui_main.c
mf0102 <0102@gmx.at>
parents: 4510
diff changeset
319 hook_associate("config save", ui_main_evlistener_config_save, NULL);
4586
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
320
5fa09aa0b14a add equalizer changed hook
Tomasz Mon <desowin@gmail.com>
parents: 4585
diff changeset
321 hook_associate("equalizer changed", ui_main_evlistener_equalizer_changed, NULL);
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
322 }
3899
2c768d923bcf Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents: 3248
diff changeset
323