annotate src/skins/ui_main_evlisteners.c @ 3123:a2093254960a

Sanity check to work around a WMA decoding error.
author John Lindgren <john.lindgren@tds.net>
date Wed, 06 May 2009 12:11:06 -0400
parents 3134a0987162
children 1ffcad5f406c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 #define UPDATEVIS 1
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
21
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
22 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
23 #include "ui_playlist_evlisteners.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
24 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
25 #include <glib.h>
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
26 #include <math.h>
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
27 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
28 #include "hook.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
29 #include "playback.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
30 #include "playlist.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
31 #include "playlist_evmessages.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
32 #include "visualization.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
33 #endif
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2967
diff changeset
34 #include <audlegacy/plugin.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2967
diff changeset
35 #include <audlegacy/input.h>
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
36 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
37 #include "ui_credits.h"
2640
dd255ad225f3 use more hooks
Tomasz Mon <desowin@gmail.com>
parents: 2633
diff changeset
38 #endif
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
39 #include "ui_equalizer.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
40 #include "ui_main.h"
2640
dd255ad225f3 use more hooks
Tomasz Mon <desowin@gmail.com>
parents: 2633
diff changeset
41 #include "ui_playlist.h"
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
42 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
43 #include "ui_preferences.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
44 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
45 #include "ui_skinned_playstatus.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
46 #include "ui_skinned_textbox.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
47 #include "ui_skinned_window.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
48 #include "skins_cfg.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
49
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
50 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
51 static gint update_vis_timeout_source = 0;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
52
2625
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
53 typedef struct {
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
54 gint bitrate;
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
55 gint samplerate;
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
56 gint channels;
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
57 } PlaylistEventInfoChange;
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
58
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
59 /* XXX: there has to be a better way than polling here! */
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
60 /* also: where should this function go? should it stay here? --mf0102 */
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
61 static gboolean
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
62 update_vis_func(gpointer unused)
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 if (!audacious_drct_get_playing())
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
65 return FALSE;
2967
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
66 #if UPDATEVIS
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
67 aud_input_update_vis(audacious_drct_get_time());
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
68 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
69 return TRUE;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
70 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
71
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
72 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
73 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
74 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
75 gchar *text = (gchar *) hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
76
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
77 ui_skinned_textbox_set_text(mainwin_info, text);
2625
29526d9db9cc remove few more #if 0's
Tomasz Mon <desowin@gmail.com>
parents: 2619
diff changeset
78 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
79 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
80
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
81 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
82 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
83 {
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 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
88 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
89 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
90 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
91 gint vl, vr, b, v;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
92
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
93 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
94 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
95 v = MAX(vl, vr);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
96 if (vl > vr)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
97 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
98 else if (vl < vr)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
99 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
100 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
101 b = 0;
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 mainwin_set_volume_slider(v);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
104 equalizerwin_set_volume_slider(v);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
105 mainwin_set_balance_slider(b);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
106 equalizerwin_set_balance_slider(b);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
107 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
110 ui_main_evlistener_playback_begin(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
111 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
112 PlaylistEntry *entry = (PlaylistEntry*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
113 g_return_if_fail(entry != NULL);
2641
ba91ea50f214 use equalzier changed hook
Tomasz Mon <desowin@gmail.com>
parents: 2640
diff changeset
114
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
115 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
116 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
117 mainwin_disable_seekbar();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
118 mainwin_update_song_info();
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 if (config.player_shaded) {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
121 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
122 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
123 gtk_widget_show(mainwin_sposition);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
124 } else {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
125 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
126 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
127 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
128 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
129 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
130 gtk_widget_show(mainwin_position);
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 song_info_timeout_source =
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
134 g_timeout_add_seconds(1, (GSourceFunc) mainwin_update_song_info, NULL);
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 update_vis_timeout_source =
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
137 g_timeout_add(10, (GSourceFunc) update_vis_func, NULL);
2967
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
138 #if UPDATEVIS
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
139 aud_vis_playback_start();
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
140 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
141 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
142 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
143
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
144 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
145 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
146 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
147 if (song_info_timeout_source)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
148 g_source_remove(song_info_timeout_source);
2967
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
149 #if UPDATEVIS
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
150 aud_vis_playback_stop();
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
151 aud_free_vis_data();
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
152 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
153 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
154 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
157 ui_main_evlistener_playback_pause(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
158 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
159 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
160 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
161
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
162 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
163 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
164 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
165 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
166 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
167
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
168 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
169 ui_main_evlistener_playback_seek(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
170 {
2967
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
171 #if UPDATEVIS
165ccb8de035 audlegacy-plugins begins.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2679
diff changeset
172 aud_free_vis_data();
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
173 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
174 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
175
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
176 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
177 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
178 {
2679
fb5375e86a03 make setting random skin on play working
Tomasz Mon <desowin@gmail.com>
parents: 2669
diff changeset
179 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
180 skin_set_random_skin();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
181 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
182
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
183 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
184 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
185 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
186 mainwin_clear_song_info();
2640
dd255ad225f3 use more hooks
Tomasz Mon <desowin@gmail.com>
parents: 2633
diff changeset
187
dd255ad225f3 use more hooks
Tomasz Mon <desowin@gmail.com>
parents: 2633
diff changeset
188 if (aud_cfg->stopaftersong)
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
189 mainwin_set_stopaftersong(FALSE);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
190 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
191
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
192 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
193 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
194 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
195 PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
196
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
197 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
198 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
199
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
200 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
201 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
202 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
203 gboolean *ontop = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
204 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
205 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
206
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
207 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
208 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
209 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
210 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
211 mainwin_show(*show);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
212 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
213
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
214 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
215 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
216 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
217 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
218 equalizerwin_show(*show);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
219 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
220
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
221 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
222 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
223 {
2669
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
224 if (hook_data == NULL) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
225 if (config.player_shaded && config.player_visible)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
226 ui_svis_timeout_func(mainwin_svis, NULL);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
227 else
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
228 ui_vis_timeout_func(mainwin_vis, NULL);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
229 return;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
230 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
231
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
232 VisNode *vis = (VisNode*) hook_data;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
233
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
234 guint8 intern_vis_data[512];
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
235 gint16 mono_freq[2][256];
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
236 gboolean mono_freq_calced = FALSE;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
237 gint16 mono_pcm[2][512], stereo_pcm[2][512];
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
238 gboolean mono_pcm_calced = FALSE, stereo_pcm_calced = FALSE;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
239 gint i;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
240
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
241 if (config.vis_type == VIS_OFF)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
242 return;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
243
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
244 if (config.vis_type == VIS_ANALYZER) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
245 /* Spectrum analyzer */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
246 /* 76 values */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
247 const gint long_xscale[] =
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
248 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
249 17, 18,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
250 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
251 34,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
252 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
253 50, 51,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
254 52, 53, 54, 55, 56, 57, 58, 61, 66, 71, 76, 81, 87, 93,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
255 100, 107,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
256 114, 122, 131, 140, 150, 161, 172, 184, 255
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
257 };
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
258 /* 20 values */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
259 const int short_xscale[] =
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
260 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 20, 27,
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
261 36, 47, 62, 82, 107, 141, 184, 255
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
262 };
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
263 const double y_scale = 3.60673760222; /* 20.0 / log(256) */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
264 const int *xscale;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
265 gint j, y, max;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
266
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
267 if (!mono_freq_calced)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
268 aud_calc_mono_freq(mono_freq, vis->data, vis->nch);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
269
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
270 memset(intern_vis_data, 0, 75);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
271
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
272 if (config.analyzer_type == ANALYZER_BARS) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
273 if (config.player_shaded) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
274 max = 13;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
275 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
276 else {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
277 max = 19;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
278 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
279 xscale = short_xscale;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
280 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
281 else {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
282 if (config.player_shaded) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
283 max = 37;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
284 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
285 else {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
286 max = 75;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
287 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
288 xscale = long_xscale;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
289 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
290
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
291 for (i = 0; i < max; i++) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
292 for (j = xscale[i], y = 0; j < xscale[i + 1]; j++) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
293 if (mono_freq[0][j] > y)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
294 y = mono_freq[0][j];
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
295 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
296 y >>= 7;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
297 if (y != 0) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
298 intern_vis_data[i] = log(y) * y_scale;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
299 if (intern_vis_data[i] > 15)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
300 intern_vis_data[i] = 15;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
301 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
302 else
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
303 intern_vis_data[i] = 0;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
304 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
305 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
306 else if(config.vis_type == VIS_VOICEPRINT){
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
307 if (config.player_shaded && config.player_visible) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
308 /* VU */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
309 gint vu, val;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
310
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
311 if (!stereo_pcm_calced)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
312 aud_calc_stereo_pcm(stereo_pcm, vis->data, vis->nch);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
313 vu = 0;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
314 for (i = 0; i < 512; i++) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
315 val = abs(stereo_pcm[0][i]);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
316 if (val > vu)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
317 vu = val;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
318 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
319 intern_vis_data[0] = (vu * 37) >> 15;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
320 if (intern_vis_data[0] > 37)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
321 intern_vis_data[0] = 37;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
322 if (vis->nch == 2) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
323 vu = 0;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
324 for (i = 0; i < 512; i++) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
325 val = abs(stereo_pcm[1][i]);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
326 if (val > vu)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
327 vu = val;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
328 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
329 intern_vis_data[1] = (vu * 37) >> 15;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
330 if (intern_vis_data[1] > 37)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
331 intern_vis_data[1] = 37;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
332 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
333 else
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
334 intern_vis_data[1] = intern_vis_data[0];
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
335 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
336 else { /*Voiceprint*/
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
337 if (!mono_freq_calced)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
338 aud_calc_mono_freq(mono_freq, vis->data, vis->nch);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
339 memset(intern_vis_data, 0, 256);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
340
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
341 /* For the values [0-16] we use the frequency that's 3/2 as much.
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
342 If we assume the 512 values calculated by calc_mono_freq to
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
343 cover 0-22kHz linearly we get a range of
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
344 [0-16] * 3/2 * 22000/512 = [0-1,031] Hz.
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
345 Most stuff above that is harmonics and we want to utilize the
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
346 16 samples we have to the max[tm]
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
347 */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
348 for (i = 0; i < 50 ; i+=3){
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
349 intern_vis_data[i/3] += (mono_freq[0][i/2] >> 5);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
350
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
351 /*Boost frequencies above 257Hz a little*/
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
352 //if(i > 4 * 3)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
353 // intern_vis_data[i/3] += 8;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
354 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
355 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
356 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
357 else { /* (config.vis_type == VIS_SCOPE) */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
358
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
359 /* Oscilloscope */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
360 gint pos, step;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
361
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
362 if (!mono_pcm_calced)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
363 aud_calc_mono_pcm(mono_pcm, vis->data, vis->nch);
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
364
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
365 step = (vis->length << 8) / 74;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
366 for (i = 0, pos = 0; i < 75; i++, pos += step) {
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
367 intern_vis_data[i] = ((mono_pcm[0][pos >> 8]) >> 12) + 7;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
368 if (intern_vis_data[i] == 255)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
369 intern_vis_data[i] = 0;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
370 else if (intern_vis_data[i] > 12)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
371 intern_vis_data[i] = 12;
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
372 /* Do not see the point of that? (comparison always false) -larne.
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
373 if (intern_vis_data[i] < 0)
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
374 intern_vis_data[i] = 0; */
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
375 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
376 }
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
377
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
378 if (config.player_shaded && config.player_visible)
2669
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
379 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
380 else
2669
ed0ad7b373d3 make vis working
Tomasz Mon <desowin@gmail.com>
parents: 2641
diff changeset
381 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
382 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
383
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
384 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
385 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
386 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
387 ConfigDb *db = (ConfigDb *) hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
388
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
389 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
390 SKINNED_WINDOW(mainwin)->y != -1 )
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
391 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
392 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
393 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
394 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
395
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
396 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
397 config.mainwin_use_bitmapfont);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
398 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
399
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
400 void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
401 ui_main_evlistener_init(void)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
402 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
403 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
404 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
405 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
406 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
407 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
408 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
409 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
410 aud_hook_associate("playback seek", ui_main_evlistener_playback_seek, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
411 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
412 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
413 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
414 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
415 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
416 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
417 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
418 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
419
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
420 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
421 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
422
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
423 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
424 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
425
2633
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
426 void
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
427 ui_main_evlistener_dissociate(void)
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
428 {
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
429 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
430 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
431 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
432 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
433 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
434 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
435 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
436 aud_hook_dissociate("playback seek", ui_main_evlistener_playback_seek);
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
437 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
438 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
439 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
440 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
441 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
442 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
443 #if 0
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
444 aud_hook_dissociate("prefswin show", ui_main_evlistener_prefswin_show);
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
445 aud_hook_dissociate("aboutwin show", ui_main_evlistener_aboutwin_show);
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
446 aud_hook_dissociate("ui jump to track show", ui_main_evlistener_ui_jump_to_track_show);
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
447 #endif
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
448 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
449 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
450
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
451 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
452 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
453
8e4af29f7e17 dissociate hooks at plugin cleanup
Tomasz Mon <desowin@gmail.com>
parents: 2625
diff changeset
454 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
455 }