# HG changeset patch # User nhjm449 # Date 1143703323 28800 # Node ID c800beaac0f9b7d6b5dce0628a8499a99529f2c9 # Parent eeed0ddebdfc10aa71c52f37f7a5bc3d6b142259 [svn] - 'stop after current song' feature diff -r eeed0ddebdfc -r c800beaac0f9 audacious/main.c --- a/audacious/main.c Wed Mar 29 22:17:26 2006 -0800 +++ b/audacious/main.c Wed Mar 29 23:22:03 2006 -0800 @@ -116,6 +116,7 @@ FALSE, FALSE, /* shuffle, repeat */ FALSE, /* UNUSED (double size) */ TRUE, /* autoscroll */ + FALSE, /* stop after current song */ TRUE, /* analyzer peaks */ FALSE, /* equalizer autoload */ FALSE, /* easy move */ @@ -245,6 +246,7 @@ {"shuffle", &cfg.shuffle, TRUE}, {"repeat", &cfg.repeat, TRUE}, {"autoscroll_songname", &cfg.autoscroll, TRUE}, + {"stop_after_current_song", &cfg.stopaftersong, TRUE}, {"playlist_shaded", &cfg.playlist_shaded, TRUE}, {"playlist_visible", &cfg.playlist_visible, TRUE}, {"playlist_transparent", &cfg.playlist_transparent, TRUE}, diff -r eeed0ddebdfc -r c800beaac0f9 audacious/mainwin.c --- a/audacious/mainwin.c Wed Mar 29 22:17:26 2006 -0800 +++ b/audacious/mainwin.c Wed Mar 29 23:22:03 2006 -0800 @@ -112,7 +112,8 @@ MAINWIN_SONGNAME_FILEINFO, MAINWIN_SONGNAME_JTF, MAINWIN_SONGNAME_JTT, - MAINWIN_SONGNAME_SCROLL + MAINWIN_SONGNAME_SCROLL, + MAINWIN_SONGNAME_STOPAFTERSONG }; enum { @@ -251,6 +252,8 @@ {"/-", NULL, NULL, 0, "", NULL}, {N_("/Autoscroll Songname"), NULL, mainwin_songname_menu_callback, MAINWIN_SONGNAME_SCROLL, "", NULL}, + {N_("/Stop After Current Song"), "M", mainwin_songname_menu_callback, + MAINWIN_SONGNAME_STOPAFTERSONG, "", NULL}, }; static gint mainwin_songname_menu_entries_num = @@ -341,6 +344,8 @@ MAINWIN_OPT_SHUFFLE, "", NULL}, {N_("/No Playlist Advance"), "N", mainwin_play_menu_callback, MAINWIN_OPT_NPA, "", NULL}, + {N_("/Stop After Current Song"), "M", mainwin_songname_menu_callback, + MAINWIN_SONGNAME_STOPAFTERSONG, "", NULL}, {"/-", NULL, NULL, 0, "", NULL}, {N_("/Play"), "x", mainwin_general_menu_callback, MAINWIN_GENERAL_PLAY, "", GTK_STOCK_MEDIA_PLAY}, @@ -2441,9 +2446,22 @@ check = GTK_CHECK_MENU_ITEM(item); mainwin_set_title_scroll(gtk_check_menu_item_get_active(check)); break; + case MAINWIN_SONGNAME_STOPAFTERSONG: + check = GTK_CHECK_MENU_ITEM(item); + cfg.stopaftersong = gtk_check_menu_item_get_active(check); + check_set(mainwin_songname_menu, "/Stop After Current Song", cfg.stopaftersong); + check_set(mainwin_play_menu, "/Stop After Current Song", cfg.stopaftersong); + break; } } +void +mainwin_set_stopaftersong(gboolean stop) +{ + cfg.stopaftersong = stop; + check_set(mainwin_songname_menu, "/Stop After Current Song", cfg.stopaftersong); +} + static void mainwin_play_menu_callback(gpointer data, guint action, @@ -2970,6 +2988,7 @@ /* Songname menu */ check_set(mainwin_songname_menu, "/Autoscroll Songname", cfg.autoscroll); + check_set(mainwin_songname_menu, "/Stop After Current Song", cfg.stopaftersong); /* Playback menu */ diff -r eeed0ddebdfc -r c800beaac0f9 audacious/mainwin.h --- a/audacious/mainwin.h Wed Mar 29 22:17:26 2006 -0800 +++ b/audacious/mainwin.h Wed Mar 29 23:22:03 2006 -0800 @@ -155,6 +155,7 @@ void mainwin_set_info_text(void); void mainwin_set_song_info(gint rate, gint freq, gint nch); void mainwin_clear_song_info(void); +void mainwin_set_stopaftersong(gboolean stop); void mainwin_set_always_on_top(gboolean always); void mainwin_set_volume_diff(gint diff); diff -r eeed0ddebdfc -r c800beaac0f9 audacious/playlist.c --- a/audacious/playlist.c Wed Mar 29 22:17:26 2006 -0800 +++ b/audacious/playlist.c Wed Mar 29 23:22:03 2006 -0800 @@ -1099,6 +1099,13 @@ return; } + if (cfg.stopaftersong) { + PLAYLIST_UNLOCK(); + mainwin_clear_song_info(); + mainwin_set_stopaftersong(FALSE); + return; + } + if (queued_list) { play_queued(); }