# HG changeset patch # User Yoshiki Yazawa # Date 1195575936 -32400 # Node ID bf0471c64f6a6c42b58cbf46242c566e2f750aa4 # Parent 67f01143e6133e760ec00ad809ac34e6dbfb7512 remove duplicated code between playlist_set_info() and playlist_set_info_old_abi(). now playlist_set_info_old_abi() become wrapper function for playlist_set_info(). diff -r 67f01143e613 -r bf0471c64f6a src/audacious/playlist.c --- a/src/audacious/playlist.c Wed Nov 21 00:46:54 2007 +0900 +++ b/src/audacious/playlist.c Wed Nov 21 01:25:36 2007 +0900 @@ -1113,20 +1113,20 @@ return entries; } +/* set info for current song. */ void -playlist_set_info_old_abi(const gchar * title, gint length, gint rate, +playlist_set_info(Playlist * playlist, const gchar * title, gint length, gint rate, gint freq, gint nch) { - Playlist *playlist = playlist_get_active(); PlaylistEventInfoChange *msg; gchar *text; + g_return_if_fail(playlist != NULL); + if(length == -1) { event_queue("hide seekbar", (gpointer)0xdeadbeef); // event_queue hates NULL --yaz } - g_return_if_fail(playlist != NULL); - if (playlist->position) { g_free(playlist->position->title); playlist->position->title = g_strdup(title); @@ -1156,25 +1156,13 @@ hook_call( "playlist set info" , playlist->position ); } +/* wrapper for playlist_set_info. this function is called by input plugins. */ void -playlist_set_info(Playlist * playlist, const gchar * title, gint length, gint rate, - gint freq, gint nch) +playlist_set_info_old_abi(const gchar * title, gint length, gint rate, + gint freq, gint nch) { - g_return_if_fail(playlist != NULL); - - if (playlist->position) { - g_free(playlist->position->title); - playlist->position->title = g_strdup(title); - playlist->position->length = length; - } - - playlist_recalc_total_time(playlist); - PLAYLIST_INCR_SERIAL(playlist); //tentative --yaz - - mainwin_set_song_info(rate, freq, nch); - - if (playlist->position) - hook_call( "playlist set info" , playlist->position ); + Playlist *playlist = playlist_get_active(); + playlist_set_info(playlist, title, length, rate, freq, nch); } void