Mercurial > audlegacy-plugins
annotate src/skins/ui_main_evlisteners.c @ 3193:93cf4d0a0dde
alsa-ng: Prefer "PCM" volume control over "Wave" on systems that have both, for consistency with OSS plugin and maybe other apps (closes AUD-34 and AUD-36).
author | John Lindgren <john.lindgren@tds.net> |
---|---|
date | Mon, 29 Jun 2009 23:05:56 -0400 |
parents | 1ffcad5f406c |
children |
rev | line source |
---|---|
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
1 /* |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
2 * Audacious |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
3 * Copyright (c) 2006-2007 Audacious development team. |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
4 * |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
8 * |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
13 * |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
16 * |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
19 */ |
2967
165ccb8de035
audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2679
diff
changeset
|
20 |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
21 #include <glib.h> |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
22 #include <math.h> |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
23 |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2967
diff
changeset
|
24 #include <audlegacy/plugin.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2967
diff
changeset
|
25 #include <audlegacy/input.h> |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
26 |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
27 #include "ui_equalizer.h" |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
28 #include "ui_main.h" |
2640 | 29 #include "ui_playlist.h" |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
30 #include "ui_skinned_playstatus.h" |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
31 #include "ui_skinned_textbox.h" |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
32 #include "ui_skinned_window.h" |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
33 #include "skins_cfg.h" |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
34 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
35 static gint song_info_timeout_source = 0; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
36 |
2625 | 37 typedef struct { |
38 gint bitrate; | |
39 gint samplerate; | |
40 gint channels; | |
41 } PlaylistEventInfoChange; | |
42 | |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
43 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
44 ui_main_evlistener_title_change(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
45 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
46 gchar *text = (gchar *) hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
47 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
48 ui_skinned_textbox_set_text(mainwin_info, text); |
2625 | 49 playlistwin_update_list(aud_playlist_get_active()); |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
50 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
51 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
52 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
53 ui_main_evlistener_hide_seekbar(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
54 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
55 mainwin_disable_seekbar(); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
56 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
57 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
58 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
59 ui_main_evlistener_volume_change(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
60 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
61 gint *h_vol = (gint *) hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
62 gint vl, vr, b, v; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
63 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
64 vl = CLAMP(h_vol[0], 0, 100); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
65 vr = CLAMP(h_vol[1], 0, 100); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
66 v = MAX(vl, vr); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
67 if (vl > vr) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
68 b = (gint) rint(((gdouble) vr / vl) * 100) - 100; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
69 else if (vl < vr) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
70 b = 100 - (gint) rint(((gdouble) vl / vr) * 100); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
71 else |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
72 b = 0; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
73 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
74 mainwin_set_volume_slider(v); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
75 equalizerwin_set_volume_slider(v); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
76 mainwin_set_balance_slider(b); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
77 equalizerwin_set_balance_slider(b); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
78 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
79 |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
80 void ui_main_evlistener_playback_begin (void * hook_data, void * user_data) |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
81 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
82 ui_vis_clear_data(mainwin_vis); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
83 ui_svis_clear_data(mainwin_svis); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
84 mainwin_disable_seekbar(); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
85 mainwin_update_song_info(); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
86 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
87 if (config.player_shaded) { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
88 gtk_widget_show(mainwin_stime_min); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
89 gtk_widget_show(mainwin_stime_sec); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
90 gtk_widget_show(mainwin_sposition); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
91 } else { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
92 gtk_widget_show(mainwin_minus_num); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
93 gtk_widget_show(mainwin_10min_num); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
94 gtk_widget_show(mainwin_min_num); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
95 gtk_widget_show(mainwin_10sec_num); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
96 gtk_widget_show(mainwin_sec_num); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
97 gtk_widget_show(mainwin_position); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
98 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
99 |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
100 song_info_timeout_source = |
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
101 g_timeout_add (250, (GSourceFunc) mainwin_update_song_info, NULL); |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
102 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
103 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
104 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
105 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
106 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
107 ui_main_evlistener_playback_stop(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
108 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
109 if (song_info_timeout_source) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
110 g_source_remove(song_info_timeout_source); |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
111 |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
112 ui_skinned_playstatus_set_buffering(mainwin_playstatus, FALSE); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
113 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
114 |
3159
1ffcad5f406c
import new skins plugin
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2971
diff
changeset
|
115 void ui_main_evlistener_playback_pause (void * hook_data, void * user_data) |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
116 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
117 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PAUSE); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
118 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
119 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
120 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
121 ui_main_evlistener_playback_unpause(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
122 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
123 ui_skinned_playstatus_set_status(mainwin_playstatus, STATUS_PLAY); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
124 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
125 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
126 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
127 ui_main_evlistener_playback_play_file(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
128 { |
2679
fb5375e86a03
make setting random skin on play working
Tomasz Mon <desowin@gmail.com>
parents:
2669
diff
changeset
|
129 if (config.random_skin_on_play) |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
130 skin_set_random_skin(); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
131 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
132 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
133 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
134 ui_main_evlistener_playlist_end_reached(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
135 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
136 mainwin_clear_song_info(); |
2640 | 137 |
138 if (aud_cfg->stopaftersong) | |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
139 mainwin_set_stopaftersong(FALSE); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
140 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
141 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
142 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
143 ui_main_evlistener_playlist_info_change(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
144 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
145 PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
146 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
147 mainwin_set_song_info(msg->bitrate, msg->samplerate, msg->channels); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
148 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
149 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
150 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
151 ui_main_evlistener_mainwin_set_always_on_top(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
152 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
153 gboolean *ontop = (gboolean*)hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
154 mainwin_set_always_on_top(*ontop); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
155 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
156 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
157 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
158 ui_main_evlistener_mainwin_show(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
159 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
160 gboolean *show = (gboolean*)hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
161 mainwin_show(*show); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
162 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
163 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
164 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
165 ui_main_evlistener_equalizerwin_show(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
166 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
167 gboolean *show = (gboolean*)hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
168 equalizerwin_show(*show); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
169 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
170 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
171 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
172 ui_main_evlistener_visualization_timeout(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
173 { |
2669 | 174 if (hook_data == NULL) { |
175 if (config.player_shaded && config.player_visible) | |
176 ui_svis_timeout_func(mainwin_svis, NULL); | |
177 else | |
178 ui_vis_timeout_func(mainwin_vis, NULL); | |
179 return; | |
180 } | |
181 | |
182 VisNode *vis = (VisNode*) hook_data; | |
183 | |
184 guint8 intern_vis_data[512]; | |
185 gint16 mono_freq[2][256]; | |
186 gboolean mono_freq_calced = FALSE; | |
187 gint16 mono_pcm[2][512], stereo_pcm[2][512]; | |
188 gboolean mono_pcm_calced = FALSE, stereo_pcm_calced = FALSE; | |
189 gint i; | |
190 | |
191 if (config.vis_type == VIS_OFF) | |
192 return; | |
193 | |
194 if (config.vis_type == VIS_ANALYZER) { | |
195 /* Spectrum analyzer */ | |
196 /* 76 values */ | |
197 const gint long_xscale[] = | |
198 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, | |
199 17, 18, | |
200 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, | |
201 34, | |
202 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, | |
203 50, 51, | |
204 52, 53, 54, 55, 56, 57, 58, 61, 66, 71, 76, 81, 87, 93, | |
205 100, 107, | |
206 114, 122, 131, 140, 150, 161, 172, 184, 255 | |
207 }; | |
208 /* 20 values */ | |
209 const int short_xscale[] = | |
210 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 20, 27, | |
211 36, 47, 62, 82, 107, 141, 184, 255 | |
212 }; | |
213 const double y_scale = 3.60673760222; /* 20.0 / log(256) */ | |
214 const int *xscale; | |
215 gint j, y, max; | |
216 | |
217 if (!mono_freq_calced) | |
218 aud_calc_mono_freq(mono_freq, vis->data, vis->nch); | |
219 | |
220 memset(intern_vis_data, 0, 75); | |
221 | |
222 if (config.analyzer_type == ANALYZER_BARS) { | |
223 if (config.player_shaded) { | |
224 max = 13; | |
225 } | |
226 else { | |
227 max = 19; | |
228 } | |
229 xscale = short_xscale; | |
230 } | |
231 else { | |
232 if (config.player_shaded) { | |
233 max = 37; | |
234 } | |
235 else { | |
236 max = 75; | |
237 } | |
238 xscale = long_xscale; | |
239 } | |
240 | |
241 for (i = 0; i < max; i++) { | |
242 for (j = xscale[i], y = 0; j < xscale[i + 1]; j++) { | |
243 if (mono_freq[0][j] > y) | |
244 y = mono_freq[0][j]; | |
245 } | |
246 y >>= 7; | |
247 if (y != 0) { | |
248 intern_vis_data[i] = log(y) * y_scale; | |
249 if (intern_vis_data[i] > 15) | |
250 intern_vis_data[i] = 15; | |
251 } | |
252 else | |
253 intern_vis_data[i] = 0; | |
254 } | |
255 } | |
256 else if(config.vis_type == VIS_VOICEPRINT){ | |
257 if (config.player_shaded && config.player_visible) { | |
258 /* VU */ | |
259 gint vu, val; | |
260 | |
261 if (!stereo_pcm_calced) | |
262 aud_calc_stereo_pcm(stereo_pcm, vis->data, vis->nch); | |
263 vu = 0; | |
264 for (i = 0; i < 512; i++) { | |
265 val = abs(stereo_pcm[0][i]); | |
266 if (val > vu) | |
267 vu = val; | |
268 } | |
269 intern_vis_data[0] = (vu * 37) >> 15; | |
270 if (intern_vis_data[0] > 37) | |
271 intern_vis_data[0] = 37; | |
272 if (vis->nch == 2) { | |
273 vu = 0; | |
274 for (i = 0; i < 512; i++) { | |
275 val = abs(stereo_pcm[1][i]); | |
276 if (val > vu) | |
277 vu = val; | |
278 } | |
279 intern_vis_data[1] = (vu * 37) >> 15; | |
280 if (intern_vis_data[1] > 37) | |
281 intern_vis_data[1] = 37; | |
282 } | |
283 else | |
284 intern_vis_data[1] = intern_vis_data[0]; | |
285 } | |
286 else { /*Voiceprint*/ | |
287 if (!mono_freq_calced) | |
288 aud_calc_mono_freq(mono_freq, vis->data, vis->nch); | |
289 memset(intern_vis_data, 0, 256); | |
290 | |
291 /* For the values [0-16] we use the frequency that's 3/2 as much. | |
292 If we assume the 512 values calculated by calc_mono_freq to | |
293 cover 0-22kHz linearly we get a range of | |
294 [0-16] * 3/2 * 22000/512 = [0-1,031] Hz. | |
295 Most stuff above that is harmonics and we want to utilize the | |
296 16 samples we have to the max[tm] | |
297 */ | |
298 for (i = 0; i < 50 ; i+=3){ | |
299 intern_vis_data[i/3] += (mono_freq[0][i/2] >> 5); | |
300 | |
301 /*Boost frequencies above 257Hz a little*/ | |
302 //if(i > 4 * 3) | |
303 // intern_vis_data[i/3] += 8; | |
304 } | |
305 } | |
306 } | |
307 else { /* (config.vis_type == VIS_SCOPE) */ | |
308 | |
309 /* Oscilloscope */ | |
310 gint pos, step; | |
311 | |
312 if (!mono_pcm_calced) | |
313 aud_calc_mono_pcm(mono_pcm, vis->data, vis->nch); | |
314 | |
315 step = (vis->length << 8) / 74; | |
316 for (i = 0, pos = 0; i < 75; i++, pos += step) { | |
317 intern_vis_data[i] = ((mono_pcm[0][pos >> 8]) >> 12) + 7; | |
318 if (intern_vis_data[i] == 255) | |
319 intern_vis_data[i] = 0; | |
320 else if (intern_vis_data[i] > 12) | |
321 intern_vis_data[i] = 12; | |
322 /* Do not see the point of that? (comparison always false) -larne. | |
323 if (intern_vis_data[i] < 0) | |
324 intern_vis_data[i] = 0; */ | |
325 } | |
326 } | |
327 | |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
328 if (config.player_shaded && config.player_visible) |
2669 | 329 ui_svis_timeout_func(mainwin_svis, intern_vis_data); |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
330 else |
2669 | 331 ui_vis_timeout_func(mainwin_vis, intern_vis_data); |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
332 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
333 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
334 static void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
335 ui_main_evlistener_config_save(gpointer hook_data, gpointer user_data) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
336 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
337 ConfigDb *db = (ConfigDb *) hook_data; |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
338 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
339 if (SKINNED_WINDOW(mainwin)->x != -1 && |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
340 SKINNED_WINDOW(mainwin)->y != -1 ) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
341 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
342 aud_cfg_db_set_int(db, "skins", "player_x", SKINNED_WINDOW(mainwin)->x); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
343 aud_cfg_db_set_int(db, "skins", "player_y", SKINNED_WINDOW(mainwin)->y); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
344 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
345 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
346 aud_cfg_db_set_bool(db, "skins", "mainwin_use_bitmapfont", |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
347 config.mainwin_use_bitmapfont); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
348 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
349 |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
350 void |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
351 ui_main_evlistener_init(void) |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
352 { |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
353 aud_hook_associate("title change", ui_main_evlistener_title_change, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
354 aud_hook_associate("hide seekbar", ui_main_evlistener_hide_seekbar, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
355 aud_hook_associate("volume set", ui_main_evlistener_volume_change, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
356 aud_hook_associate("playback begin", ui_main_evlistener_playback_begin, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
357 aud_hook_associate("playback stop", ui_main_evlistener_playback_stop, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
358 aud_hook_associate("playback pause", ui_main_evlistener_playback_pause, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
359 aud_hook_associate("playback unpause", ui_main_evlistener_playback_unpause, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
360 aud_hook_associate("playback play file", ui_main_evlistener_playback_play_file, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
361 aud_hook_associate("playlist end reached", ui_main_evlistener_playlist_end_reached, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
362 aud_hook_associate("playlist info change", ui_main_evlistener_playlist_info_change, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
363 aud_hook_associate("mainwin set always on top", ui_main_evlistener_mainwin_set_always_on_top, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
364 aud_hook_associate("mainwin show", ui_main_evlistener_mainwin_show, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
365 aud_hook_associate("equalizerwin show", ui_main_evlistener_equalizerwin_show, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
366 aud_hook_associate("visualization timeout", ui_main_evlistener_visualization_timeout, NULL); |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
367 aud_hook_associate("config save", ui_main_evlistener_config_save, NULL); |
2633
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
368 |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
369 aud_hook_associate("playback audio error", (void *) mainwin_stop_pushed, NULL); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
370 aud_hook_associate("playback audio error", (void *) run_no_output_device_dialog, NULL); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
371 |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
372 aud_hook_associate("playback seek", (HookFunction) mainwin_update_song_info, NULL); |
2602
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
373 } |
7cd898f08f31
work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff
changeset
|
374 |
2633
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
375 void |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
376 ui_main_evlistener_dissociate(void) |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
377 { |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
378 aud_hook_dissociate("title change", ui_main_evlistener_title_change); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
379 aud_hook_dissociate("hide seekbar", ui_main_evlistener_hide_seekbar); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
380 aud_hook_dissociate("volume set", ui_main_evlistener_volume_change); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
381 aud_hook_dissociate("playback begin", ui_main_evlistener_playback_begin); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
382 aud_hook_dissociate("playback stop", ui_main_evlistener_playback_stop); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
383 aud_hook_dissociate("playback pause", ui_main_evlistener_playback_pause); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
384 aud_hook_dissociate("playback unpause", ui_main_evlistener_playback_unpause); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
385 aud_hook_dissociate("playback play file", ui_main_evlistener_playback_play_file); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
386 aud_hook_dissociate("playlist end reached", ui_main_evlistener_playlist_end_reached); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
387 aud_hook_dissociate("playlist info change", ui_main_evlistener_playlist_info_change); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
388 aud_hook_dissociate("mainwin set always on top", ui_main_evlistener_mainwin_set_always_on_top); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
389 aud_hook_dissociate("mainwin show", ui_main_evlistener_mainwin_show); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
390 aud_hook_dissociate("equalizerwin show", ui_main_evlistener_equalizerwin_show); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
391 aud_hook_dissociate("visualization timeout", ui_main_evlistener_visualization_timeout); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
392 aud_hook_dissociate("config save", ui_main_evlistener_config_save); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
393 |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
394 aud_hook_dissociate("playback audio error", (void *) mainwin_stop_pushed); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
395 aud_hook_dissociate("playback audio error", (void *) run_no_output_device_dialog); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
396 |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
397 aud_hook_dissociate("playback seek", (HookFunction) mainwin_update_song_info); |
8e4af29f7e17
dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents:
2625
diff
changeset
|
398 } |