Mercurial > audlegacy
annotate src/audacious/ui_main_evlisteners.c @ 4553:47cc110bef0c
Hookify a visualization function
author | mf0102 <0102@gmx.at> |
---|---|
date | Sun, 18 May 2008 16:06:33 +0200 |
parents | d4c5719d30d1 |
children | 910ed095b5a9 |
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 | 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 g_free(text); |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
67 } |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
68 |
3197
5dd8bc77a590
now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3165
diff
changeset
|
69 static void |
5dd8bc77a590
now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3165
diff
changeset
|
70 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
|
71 { |
5dd8bc77a590
now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3165
diff
changeset
|
72 mainwin_disable_seekbar(); |
5dd8bc77a590
now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3165
diff
changeset
|
73 } |
5dd8bc77a590
now "hide seekbar on streaming" uses message passing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3165
diff
changeset
|
74 |
3899
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
75 static void |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
76 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
|
77 { |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
78 gint *h_vol = (gint *) hook_data; |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
79 gint vl, vr, b, v; |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
80 |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
81 vl = CLAMP(h_vol[0], 0, 100); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
82 vr = CLAMP(h_vol[1], 0, 100); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
83 v = MAX(vl, vr); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
84 if (vl > vr) |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
85 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
|
86 else if (vl < vr) |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
87 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
|
88 else |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
89 b = 0; |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
90 |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
91 mainwin_set_volume_slider(v); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
92 equalizerwin_set_volume_slider(v); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
93 mainwin_set_balance_slider(b); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
94 equalizerwin_set_balance_slider(b); |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
95 } |
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
96 |
4026
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
97 static void |
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
98 ui_main_evlistener_playback_initiate(gpointer hook_data, gpointer user_data) |
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
99 { |
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
100 playback_initiate(); |
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
101 } |
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
102 |
4359
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
103 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
104 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
|
105 { |
4360 | 106 PlaylistEntry *entry = (PlaylistEntry*)hook_data; |
107 g_return_if_fail(entry != NULL); | |
108 | |
109 equalizerwin_load_auto_preset(entry->filename); | |
110 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, | |
111 cfg.equalizer_bands); | |
112 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp, | |
113 cfg.equalizer_bands); | |
114 | |
4359
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
115 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
|
116 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
|
117 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
|
118 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
|
119 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
120 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
|
121 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
|
122 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
|
123 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
|
124 } else { |
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_minus_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_10min_num); |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
127 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
|
128 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
|
129 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
|
130 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
|
131 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
132 |
4360 | 133 song_info_timeout_source = |
134 g_timeout_add_seconds(1, (GSourceFunc) mainwin_update_song_info, NULL); | |
135 | |
136 update_vis_timeout_source = | |
137 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
|
138 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
139 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
|
140 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
141 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
|
142 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
143 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
144 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
145 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
|
146 { |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
147 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
|
148 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
|
149 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
150 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
|
151 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
|
152 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
153 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
|
154 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
155 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
156 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
157 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
|
158 { |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
159 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
|
160 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
161 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
162 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
163 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
|
164 { |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
165 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
|
166 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
167 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
168 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
169 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
|
170 { |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
171 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
|
172 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
173 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
174 static void |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
175 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
|
176 { |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
177 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
|
178 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
|
179 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
180 |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
181 static void |
4504
a47288ced5d5
- renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents:
4360
diff
changeset
|
182 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
|
183 { |
4510 | 184 mainwin_clear_song_info(); |
4546 | 185 |
186 if (cfg.stopaftersong) | |
187 mainwin_set_stopaftersong(FALSE); | |
4504
a47288ced5d5
- renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents:
4360
diff
changeset
|
188 } |
a47288ced5d5
- renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents:
4360
diff
changeset
|
189 |
a47288ced5d5
- renamed some files to reflect their UI contents
mf0102 <0102@gmx.at>
parents:
4360
diff
changeset
|
190 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
|
191 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
|
192 { |
4510 | 193 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
|
194 |
4510 | 195 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
|
196 |
4510 | 197 g_free(msg); |
4359
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
198 } |
0becb809bdc9
moved most GUI-related functions from playback.c to ui_main_evlisteners.c
mf0102 <0102@gmx.at>
parents:
4026
diff
changeset
|
199 |
4513 | 200 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
|
201 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
|
202 { |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
203 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
|
204 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
|
205 } |
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 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
|
208 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
|
209 { |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
210 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
|
211 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
|
212 } |
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 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
|
215 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
|
216 { |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
217 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
|
218 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
|
219 } |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
220 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
221 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
|
222 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
|
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 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
|
225 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
|
226 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
|
227 else |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
228 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
|
229 } |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
230 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
231 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
|
232 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
|
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 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
|
235 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
|
236 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
|
237 else |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
238 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
|
239 } |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
240 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
241 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
242 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
|
243 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
|
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 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
|
246 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
|
247 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
|
248 else |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
249 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
|
250 } |
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 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
|
253 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
|
254 { |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
255 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
|
256 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
|
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 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
260 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
|
261 { |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
262 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
|
263 } |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
264 |
084dbc8d23da
removed variable "has_x11_connection" from main.c, needed to hookify some functions therefore
mf0102 <0102@gmx.at>
parents:
4513
diff
changeset
|
265 static void |
4553 | 266 ui_main_evlistener_visualization_timeout(gpointer hook_data, gpointer user_data) |
267 { | |
268 if (cfg.player_shaded && cfg.player_visible) | |
269 ui_svis_timeout_func(mainwin_svis, hook_data); | |
270 else | |
271 ui_vis_timeout_func(mainwin_vis, hook_data); | |
272 } | |
273 | |
274 static void | |
4513 | 275 ui_main_evlistener_config_save(gpointer hook_data, gpointer user_data) |
276 { | |
277 ConfigDb *db = (ConfigDb *) hook_data; | |
278 | |
279 if (SKINNED_WINDOW(mainwin)->x != -1 && | |
280 SKINNED_WINDOW(mainwin)->y != -1 ) | |
281 { | |
282 cfg_db_set_int(db, NULL, "player_x", SKINNED_WINDOW(mainwin)->x); | |
283 cfg_db_set_int(db, NULL, "player_y", SKINNED_WINDOW(mainwin)->y); | |
284 } | |
285 | |
286 cfg_db_set_bool(db, NULL, "mainwin_use_bitmapfont", | |
287 cfg.mainwin_use_bitmapfont); | |
288 } | |
289 | |
3165
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
290 void |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
291 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
|
292 { |
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
293 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
|
294 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
|
295 hook_associate("volume set", ui_main_evlistener_volume_change, NULL); |
4026
17bf734f8187
avoid crash when audacious is launched with -p option.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3899
diff
changeset
|
296 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
|
297 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
|
298 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
|
299 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
|
300 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
|
301 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
|
302 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
|
303 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
|
304 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
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 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
|
312 hook_associate("filebrowser hide", ui_main_evlistener_filebrowser_hide, NULL); |
4553 | 313 hook_associate("visualization timeout", ui_main_evlistener_visualization_timeout, NULL); |
4513 | 314 hook_associate("config save", ui_main_evlistener_config_save, NULL); |
3165
8775dfc57ead
Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents:
diff
changeset
|
315 } |
3899
2c768d923bcf
Add an event listener for volume changes.
William Pitcock <nenolod@atheme.org>
parents:
3248
diff
changeset
|
316 |