annotate src/audacious/playlist_evlisteners.c @ 4312:45505a00a6cf

store sliders' values as is
author Eugene Zagidullin <e.asphyx@gmail.com>
date Sun, 02 Mar 2008 21:50:02 +0300
parents a575c29cee05
children 0becb809bdc9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3159
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
1 /*
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
2 * Audacious
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
3 * Copyright (c) 2006-2007 Audacious development team.
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
4 *
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
7 * the Free Software Foundation; under version 3 of the License.
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
8 *
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
12 * GNU General Public License for more details.
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
13 *
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses>.
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
16 *
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
17 * The Audacious team does not consider modular code linking to
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
18 * Audacious or using our public API to be a derived work.
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
19 */
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
20
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
21 #include <glib.h>
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
22 #include "hook.h"
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
23 #include "playback.h"
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
24 #include "playlist.h"
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
25 #include "playlist_evmessages.h"
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
26 #include "playlist_evlisteners.h"
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
27
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
28 #include "ui_main.h"
3959
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
29 #include "ui_playlist.h"
3159
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
30
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
31 static void
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
32 playlist_evlistener_playlist_info_change(gpointer hook_data, gpointer user_data)
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
33 {
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
34 PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data;
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
35
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
36 mainwin_set_song_info(msg->bitrate, msg->samplerate, msg->channels);
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
37
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
38 g_free(msg);
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
39 }
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
40
3959
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
41 static void
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
42 playlist_evlistener_playlistwin_update_list(gpointer hook_data, gpointer user_data)
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
43 {
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
44 Playlist *playlist = (Playlist *) hook_data;
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
45
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
46 playlistwin_update_list(playlist);
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
47 }
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
48
3159
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
49 void playlist_evlistener_init(void)
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
50 {
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
51 hook_associate("playlist info change", playlist_evlistener_playlist_info_change, NULL);
3959
a575c29cee05 - revive on-demand metadata retrieving. in the combination with "Detect file formats on demand", now audacious can load large directory in a few seconds.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 3159
diff changeset
52 hook_associate("playlistwin update list", playlist_evlistener_playlistwin_update_list, NULL);
3159
a2d552ea48f0 Use message passing to make sure the UI is updated in the main thread.
William Pitcock <nenolod@atheme-project.org>
parents:
diff changeset
53 }