annotate src/skins/ui_main_evlisteners.c @ 2619:a066a10b2398

fix double free
author Tomasz Mon <desowin@gmail.com>
date Wed, 21 May 2008 18:40:48 +0200
parents ca6873c5a778
children 29526d9db9cc
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 */
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
20 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
21 #include "ui_playlist_evlisteners.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
22 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
23 #include <glib.h>
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
24 #include <math.h>
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
25 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
26 #include "hook.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
27 #include "playback.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
28 #include "playlist.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
29 #include "playlist_evmessages.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
30 #include "visualization.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
31 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
32 #include <audacious/plugin.h>
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
33 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
34 #include "ui_credits.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
35 #include "ui_equalizer.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
36 #include "ui_jumptotrack.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
37 #endif
2614
c9463d350985 Added ui_fileopener
mf0102 <0102@gmx.at>
parents: 2602
diff changeset
38 #include "ui_fileopener.h"
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
39 #include "ui_main.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
40 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
41 #include "ui_playlist.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
42 #include "ui_preferences.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
43 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
44 #include "ui_skinned_playstatus.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
45 #include "ui_skinned_textbox.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
46 #include "ui_skinned_window.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
47 #include "skins_cfg.h"
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
48
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
49 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
50 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
51
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
52 /* 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
53 /* 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
54 static gboolean
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
55 update_vis_func(gpointer unused)
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 if (!audacious_drct_get_playing())
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
58 return FALSE;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
59 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
60 input_update_vis(audacious_drct_get_time());
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
61 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
62 return TRUE;
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
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
65 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
66 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
67 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
68 gchar *text = (gchar *) hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
69
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
70 ui_skinned_textbox_set_text(mainwin_info, text);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
71 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
72 playlistwin_update_list(playlist_get_active());
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
73 #endif
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
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
76 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
77 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
78 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
79 mainwin_disable_seekbar();
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
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
82 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
83 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
84 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
85 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
86 gint vl, vr, b, v;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
87
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
88 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
89 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
90 v = MAX(vl, vr);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
91 if (vl > vr)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
92 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
93 else if (vl < vr)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
94 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
95 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
96 b = 0;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
97
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
98 mainwin_set_volume_slider(v);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
99 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
100 equalizerwin_set_volume_slider(v);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
101 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
102 mainwin_set_balance_slider(b);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
103 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
104 equalizerwin_set_balance_slider(b);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
105 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
106 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
109 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
110 {
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);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
114 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
115 equalizerwin_load_auto_preset(entry->filename);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
116 input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
117 cfg.equalizer_bands);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
118 output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
119 cfg.equalizer_bands);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
120 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
121 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
122 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
123 mainwin_disable_seekbar();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
124 mainwin_update_song_info();
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 if (config.player_shaded) {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
127 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
128 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
129 gtk_widget_show(mainwin_sposition);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
130 } else {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
131 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
132 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
133 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
134 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
135 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
136 gtk_widget_show(mainwin_position);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
137 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
138
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
139 song_info_timeout_source =
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
140 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
141
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
142 update_vis_timeout_source =
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
143 g_timeout_add(10, (GSourceFunc) update_vis_func, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
144 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
145 vis_playback_start();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
146 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
147 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
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_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
152 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
153 if (song_info_timeout_source)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
154 g_source_remove(song_info_timeout_source);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
155 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
156 vis_playback_stop();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
157 free_vis_data();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
158 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
159 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
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_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
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_PAUSE);
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_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
170 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
171 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
172 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
173
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
174 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
175 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
176 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
177 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
178 free_vis_data();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
179 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
180 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
183 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
184 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
185 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
186 if (cfg.random_skin_on_play)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
187 skin_set_random_skin();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
188 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
189 }
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 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
192 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
193 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
194 mainwin_clear_song_info();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
195 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
196 if (cfg.stopaftersong)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
197 mainwin_set_stopaftersong(FALSE);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
198 #endif
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
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
201 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
202 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
203 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
204 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
205 PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data;
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 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
208 #endif
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
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
211 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
212 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
213 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
214 gboolean *ontop = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
215 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
216 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
217
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
218 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
219 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
220 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
221 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
222 mainwin_show(*show);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
223 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
224
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
225 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
226 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
227 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
228 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
229 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
230 equalizerwin_show(*show);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
231 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
232 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
233
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
234 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
235 ui_main_evlistener_prefswin_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
236 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
237 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
238 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
239 if (*show == TRUE)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
240 show_prefs_window();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
241 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
242 hide_prefs_window();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
243 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
244 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
245
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
246 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
247 ui_main_evlistener_aboutwin_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
248 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
249 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
250 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
251 if (*show == TRUE)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
252 show_about_window();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
253 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
254 hide_about_window();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
255 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
256 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
257
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
258
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
259 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
260 ui_main_evlistener_ui_jump_to_track_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
261 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
262 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
263 gboolean *show = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
264 if (*show == TRUE)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
265 ui_jump_to_track();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
266 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
267 ui_jump_to_track_hide();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
268 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
269 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
270
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
271 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
272 ui_main_evlistener_filebrowser_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
273 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
274 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
275 gboolean *play_button = (gboolean*)hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
276 run_filebrowser(*play_button);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
277 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
278 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
279
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
280 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
281 ui_main_evlistener_filebrowser_hide(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
282 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
283 #if 0
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
284 hide_filebrowser();
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
285 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
286 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
287
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
288 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
289 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
290 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
291 if (config.player_shaded && config.player_visible)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
292 ui_svis_timeout_func(mainwin_svis, hook_data);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
293 else
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
294 ui_vis_timeout_func(mainwin_vis, hook_data);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
295 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
296
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
297 static void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
298 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
299 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
300 ConfigDb *db = (ConfigDb *) hook_data;
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
301
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
302 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
303 SKINNED_WINDOW(mainwin)->y != -1 )
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
304 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
305 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
306 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
307 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
308
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
309 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
310 config.mainwin_use_bitmapfont);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
311 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
312
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
313 void
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
314 ui_main_evlistener_init(void)
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
315 {
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
316 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
317 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
318 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
319 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
320 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
321 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
322 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
323 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
324 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
325 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
326 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
327 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
328 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
329 aud_hook_associate("equalizerwin show", ui_main_evlistener_equalizerwin_show, NULL);
2618
ca6873c5a778 set track info on change
Tomasz Mon <desowin@gmail.com>
parents: 2614
diff changeset
330 #if 0
2602
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
331 aud_hook_associate("prefswin show", ui_main_evlistener_prefswin_show, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
332 aud_hook_associate("aboutwin show", ui_main_evlistener_aboutwin_show, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
333 aud_hook_associate("ui jump to track show", ui_main_evlistener_ui_jump_to_track_show, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
334 aud_hook_associate("filebrowser show", ui_main_evlistener_filebrowser_show, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
335 aud_hook_associate("filebrowser hide", ui_main_evlistener_filebrowser_hide, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
336 #endif
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
337 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
338 aud_hook_associate("config save", ui_main_evlistener_config_save, NULL);
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
339 }
7cd898f08f31 work in progress - add ui_manager and ui_main_evlisteners
Tomasz Mon <desowin@gmail.com>
parents:
diff changeset
340