summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-20 15:11:18 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-20 15:11:18 +0100
commitf35922ae85f82b939b93a8d38fd5a91e4504fe35 (patch)
tree079e6abc631de34fbbfc30bbe44f26a3a9464f39
parent759a59968c30d5e155f13a68aca9301a3eba11a7 (diff)
fixed seekbar redraw bug after end of playlist
added "stop after current track" menu item and hotkey
-rw-r--r--deadbeef.h14
-rw-r--r--playlist.c31
-rw-r--r--plugins/gtkui/callbacks.c7
-rw-r--r--plugins/gtkui/callbacks.h8
-rw-r--r--plugins/gtkui/deadbeef.glade27
-rw-r--r--plugins/gtkui/gtkplaylist.c14
-rw-r--r--plugins/gtkui/gtkui.c20
-rw-r--r--plugins/gtkui/interface.c92
-rw-r--r--streamer.c7
9 files changed, 151 insertions, 69 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 5c510167..90fcd1f8 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -107,6 +107,20 @@ enum output_state_t {
OUTPUT_STATE_PAUSED = 2,
};
+// playback order
+enum playback_order_t {
+ PLAYBACK_ORDER_LINEAR = 0,
+ PLAYBACK_ORDER_SHUFFLE = 1,
+ PLAYBACK_ORDER_RANDOM = 2,
+};
+
+// playback modes
+enum playback_mode_t {
+ PLAYBACK_MODE_LOOP_ALL = 0, // loop playlist
+ PLAYBACK_MODE_NOLOOP = 1, // don't loop
+ PLAYBACK_MODE_LOOP_SINGLE = 2, // loop single track
+};
+
typedef struct {
int event;
time_t time;
diff --git a/playlist.c b/playlist.c
index e6807cf1..58d3680c 100644
--- a/playlist.c
+++ b/playlist.c
@@ -56,8 +56,6 @@ int playlist_current_row[PL_MAX_ITERATORS];
playItem_t *playlist_current_ptr;
int pl_count = 0;
float pl_totaltime = 0;
-//static int pl_order = 0; // 0 = linear, 1 = shuffle, 2 = random
-//static int pl_loop_mode = 0; // 0 = loop, 1 = don't loop, 2 = loop single
void
pl_free (void) {
@@ -885,7 +883,7 @@ pl_prevsong (void) {
}
int pl_order = conf_get_int ("playback.order", 0);
int pl_loop_mode = conf_get_int ("playback.loop", 0);
- if (pl_order == 1) { // shuffle
+ if (pl_order == PLAYBACK_ORDER_SHUFFLE) { // shuffle
if (!playlist_current_ptr) {
return pl_nextsong (1);
}
@@ -910,7 +908,7 @@ pl_prevsong (void) {
playItem_t *it = pmax;
if (!it) {
// that means 1st in playlist, take amax
- if (pl_loop_mode == 0) {
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) {
if (!amax) {
pl_reshuffle (NULL, &amax);
}
@@ -926,13 +924,13 @@ pl_prevsong (void) {
return 0;
}
}
- else if (pl_order == 0) { // linear
+ else if (pl_order == PLAYBACK_ORDER_LINEAR) { // linear
playItem_t *it = NULL;
if (playlist_current_ptr) {
it = playlist_current_ptr->prev[PL_MAIN];
}
if (!it) {
- if (pl_loop_mode == 0) {
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) {
it = playlist_tail[PL_MAIN];
}
}
@@ -943,7 +941,7 @@ pl_prevsong (void) {
streamer_set_nextsong (r, 1);
return 0;
}
- else if (pl_order == 2) { // random
+ else if (pl_order == PLAYBACK_ORDER_RANDOM) { // random
pl_randomsong ();
}
return -1;
@@ -958,7 +956,7 @@ pl_nextsong (int reason) {
}
int pl_order = conf_get_int ("playback.order", 0);
int pl_loop_mode = conf_get_int ("playback.loop", 0);
- if (pl_order == 1) { // shuffle
+ if (pl_order == PLAYBACK_ORDER_SHUFFLE) { // shuffle
if (!curr) {
// find minimal notplayed
playItem_t *pmin = NULL; // notplayed minimum
@@ -974,7 +972,7 @@ pl_nextsong (int reason) {
playItem_t *it = pmin;
if (!it) {
// all songs played, reshuffle and try again
- if (pl_loop_mode == 0) { // loop
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) { // loop
pl_reshuffle (&it, NULL);
}
}
@@ -987,7 +985,7 @@ pl_nextsong (int reason) {
}
else {
trace ("pl_next_song: reason=%d, loop=%d\n", reason, pl_loop_mode);
- if (reason == 0 && pl_loop_mode == 2) { // song finished, loop mode is "loop 1 track"
+ if (reason == 0 && pl_loop_mode == PLAYBACK_MODE_LOOP_SINGLE) { // song finished, loop mode is "loop 1 track"
int r = pl_get_idx_of (curr);
streamer_set_nextsong (r, 1);
return 0;
@@ -1008,7 +1006,7 @@ pl_nextsong (int reason) {
if (!it) {
trace ("all songs played! reshuffle\n");
// all songs played, reshuffle and try again
- if (pl_loop_mode == 0) { // loop
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) { // loop
pl_reshuffle (&it, NULL);
}
}
@@ -1020,10 +1018,10 @@ pl_nextsong (int reason) {
return 0;
}
}
- else if (pl_order == 0) { // linear
+ else if (pl_order == PLAYBACK_ORDER_LINEAR) { // linear
playItem_t *it = NULL;
if (curr) {
- if (reason == 0 && pl_loop_mode == 2) { // loop same track
+ if (reason == 0 && pl_loop_mode == PLAYBACK_MODE_LOOP_SINGLE) { // loop same track
int r = pl_get_idx_of (curr);
streamer_set_nextsong (r, 1);
return 0;
@@ -1031,7 +1029,8 @@ pl_nextsong (int reason) {
it = curr->next[PL_MAIN];
}
if (!it) {
- if (pl_loop_mode == 0) {
+ trace ("pl_nextsong: was last track\n");
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) {
it = playlist_head[PL_MAIN];
}
else {
@@ -1046,8 +1045,8 @@ pl_nextsong (int reason) {
streamer_set_nextsong (r, 1);
return 0;
}
- else if (pl_order == 2) { // random
- if (reason == 0 && pl_loop_mode == 2 && curr) {
+ else if (pl_order == PLAYBACK_ORDER_RANDOM) { // random
+ if (reason == 0 && pl_loop_mode == PLAYBACK_MODE_LOOP_SINGLE && curr) {
int r = pl_get_idx_of (curr);
streamer_set_nextsong (r, 1);
return 0;
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index f6321a81..31b48baa 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -2104,3 +2104,10 @@ on_toggle_column_headers_activate (GtkMenuItem *menuitem,
}
}
+void
+on_stop_after_current_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ deadbeef->conf_set_int ("playlist.stop_after_current", gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)));
+}
+
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index e5c04fe2..d7d2fd6a 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -717,3 +717,11 @@ on_toggle_menu_activate (GtkMenuItem *menuitem,
void
on_toggle_column_headers_activate (GtkMenuItem *menuitem,
gpointer user_data);
+
+void
+on_stop_after_current1_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+on_stop_after_current_activate (GtkMenuItem *menuitem,
+ gpointer user_data);
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 7f208fa5..fb4cd963 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -57,7 +57,7 @@
<accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image227">
+ <widget class="GtkImage" id="image255">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
@@ -84,7 +84,7 @@
<signal name="activate" handler="on_add_files_activate" last_modification_time="Sat, 04 Jul 2009 13:04:01 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image228">
+ <widget class="GtkImage" id="image256">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@@ -105,7 +105,7 @@
<signal name="activate" handler="on_add_folders_activate" last_modification_time="Sun, 06 Sep 2009 17:51:40 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image229">
+ <widget class="GtkImage" id="image257">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@@ -126,7 +126,7 @@
<signal name="activate" handler="on_add_audio_cd_activate" last_modification_time="Sat, 10 Oct 2009 15:29:22 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image230">
+ <widget class="GtkImage" id="image258">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
@@ -163,7 +163,7 @@
<accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image231">
+ <widget class="GtkImage" id="image259">
<property name="visible">True</property>
<property name="stock">gtk-quit</property>
<property name="icon_size">1</property>
@@ -197,7 +197,7 @@
<signal name="activate" handler="on_clear1_activate" last_modification_time="Sun, 06 Sep 2009 18:30:03 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image232">
+ <widget class="GtkImage" id="image260">
<property name="visible">True</property>
<property name="stock">gtk-clear</property>
<property name="icon_size">1</property>
@@ -238,7 +238,7 @@
<accelerator key="Delete" modifiers="0" signal="activate"/>
<child internal-child="image">
- <widget class="GtkImage" id="image233">
+ <widget class="GtkImage" id="image261">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
@@ -461,6 +461,17 @@
<signal name="activate" handler="on_scroll_follows_playback_activate" last_modification_time="Wed, 02 Sep 2009 17:46:43 GMT"/>
</widget>
</child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="stop_after_current">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Stop after current</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ <signal name="activate" handler="on_stop_after_current_activate" last_modification_time="Sun, 20 Dec 2009 13:32:19 GMT"/>
+ <accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+ </widget>
+ </child>
</widget>
</child>
</widget>
@@ -492,7 +503,7 @@
<signal name="activate" handler="on_help1_activate" last_modification_time="Tue, 08 Sep 2009 17:32:06 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image234">
+ <widget class="GtkImage" id="image262">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 663ec76a..f6add405 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -1917,12 +1917,26 @@ update_win_title_idle (gpointer data) {
return FALSE;
}
+static gboolean
+redraw_seekbar_cb (gpointer nothing) {
+ void seekbar_draw (GtkWidget *widget);
+ void seekbar_expose (GtkWidget *widget, int x, int y, int w, int h);
+ GtkWidget *widget = lookup_widget (mainwin, "seekbar");
+ seekbar_draw (widget);
+ seekbar_expose (widget, 0, 0, widget->allocation.width, widget->allocation.height);
+ return FALSE;
+}
+
void
gtkpl_songchanged_wrapper (int from, int to) {
struct fromto_t *ft = malloc (sizeof (struct fromto_t));
ft->from = from;
ft->to = to;
g_idle_add (update_win_title_idle, ft);
+ if (ft->to == -1 && ft->from != -1) {
+ // redraw seekbar
+ g_idle_add (redraw_seekbar_cb, NULL);
+ }
}
void
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index f66b4dc7..9a4453f2 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -367,15 +367,27 @@ gtkui_thread (void *ctx) {
gtk_window_maximize (GTK_WINDOW (mainwin));
}
}
+
// order and looping
- const char *orderwidgets[3] = { "order_linear", "order_shuffle", "order_random" };
- const char *loopingwidgets[3] = { "loop_all", "loop_disable", "loop_single" };
const char *w;
- w = orderwidgets[deadbeef->conf_get_int ("playback.order", 0)];
+
+ // order
+ const char *orderwidgets[3] = { "order_linear", "order_shuffle", "order_random" };
+ w = orderwidgets[deadbeef->conf_get_int ("playback.order", PLAYBACK_ORDER_LINEAR)];
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, w)), TRUE);
- w = loopingwidgets[deadbeef->conf_get_int ("playback.loop", 0)];
+
+ // looping
+ const char *loopingwidgets[3] = { "loop_all", "loop_disable", "loop_single" };
+ w = loopingwidgets[deadbeef->conf_get_int ("playback.loop", PLAYBACK_MODE_LOOP_ALL)];
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, w)), TRUE);
+
+ // scroll follows playback
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "scroll_follows_playback")), deadbeef->conf_get_int ("playlist.scroll.followplayback", 0) ? TRUE : FALSE);
+
+ // stop after current
+ int stop_after_current = deadbeef->conf_get_int ("playlist.stop_after_current", 0);
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "stop_after_current")), stop_after_current ? TRUE : FALSE);
+
// visibility of statusbar and headers
GtkWidget *header_mi = lookup_widget (mainwin, "view_headers");
GtkWidget *sb_mi = lookup_widget (mainwin, "view_status_bar");
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 4a387165..eeec2b07 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -35,27 +35,27 @@ create_mainwin (void)
GtkWidget *menuitem1;
GtkWidget *menuitem1_menu;
GtkWidget *open;
- GtkWidget *image227;
+ GtkWidget *image255;
GtkWidget *separator2;
GtkWidget *add_files;
- GtkWidget *image228;
+ GtkWidget *image256;
GtkWidget *add_folders;
- GtkWidget *image229;
+ GtkWidget *image257;
GtkWidget *add_audio_cd;
- GtkWidget *image230;
+ GtkWidget *image258;
GtkWidget *add_location1;
GtkWidget *separatormenuitem1;
GtkWidget *quit;
- GtkWidget *image231;
+ GtkWidget *image259;
GtkWidget *edit1;
GtkWidget *edit1_menu;
GtkWidget *clear1;
- GtkWidget *image232;
+ GtkWidget *image260;
GtkWidget *select_all1;
GtkWidget *selection1;
GtkWidget *selection1_menu;
GtkWidget *remove1;
- GtkWidget *image233;
+ GtkWidget *image261;
GtkWidget *crop1;
GtkWidget *find1;
GtkWidget *separator5;
@@ -82,11 +82,12 @@ create_mainwin (void)
GtkWidget *loop_single;
GtkWidget *loop_disable;
GtkWidget *scroll_follows_playback;
+ GtkWidget *stop_after_current;
GtkWidget *menuitem4;
GtkWidget *menuitem4_menu;
GtkWidget *about1;
GtkWidget *help1;
- GtkWidget *image234;
+ GtkWidget *image262;
GtkWidget *hbox2;
GtkWidget *hbox3;
GtkWidget *stopbtn;
@@ -141,9 +142,9 @@ create_mainwin (void)
GDK_O, (GdkModifierType) GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
- image227 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image227);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (open), image227);
+ image255 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image255);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (open), image255);
separator2 = gtk_separator_menu_item_new ();
gtk_widget_show (separator2);
@@ -154,25 +155,25 @@ create_mainwin (void)
gtk_widget_show (add_files);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), add_files);
- image228 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image228);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_files), image228);
+ image256 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image256);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_files), image256);
add_folders = gtk_image_menu_item_new_with_mnemonic ("Add folder(s)");
gtk_widget_show (add_folders);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), add_folders);
- image229 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image229);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_folders), image229);
+ image257 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image257);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_folders), image257);
add_audio_cd = gtk_image_menu_item_new_with_mnemonic ("Add Audio CD");
gtk_widget_show (add_audio_cd);
gtk_container_add (GTK_CONTAINER (menuitem1_menu), add_audio_cd);
- image230 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image230);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_audio_cd), image230);
+ image258 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image258);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_audio_cd), image258);
add_location1 = gtk_menu_item_new_with_mnemonic ("Add location");
gtk_widget_show (add_location1);
@@ -190,9 +191,9 @@ create_mainwin (void)
GDK_Q, (GdkModifierType) GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
- image231 = gtk_image_new_from_stock ("gtk-quit", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image231);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (quit), image231);
+ image259 = gtk_image_new_from_stock ("gtk-quit", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image259);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (quit), image259);
edit1 = gtk_menu_item_new_with_mnemonic ("_Edit");
gtk_widget_show (edit1);
@@ -205,9 +206,9 @@ create_mainwin (void)
gtk_widget_show (clear1);
gtk_container_add (GTK_CONTAINER (edit1_menu), clear1);
- image232 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image232);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (clear1), image232);
+ image260 = gtk_image_new_from_stock ("gtk-clear", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image260);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (clear1), image260);
select_all1 = gtk_menu_item_new_with_mnemonic ("Select all");
gtk_widget_show (select_all1);
@@ -230,9 +231,9 @@ create_mainwin (void)
GDK_Delete, (GdkModifierType) 0,
GTK_ACCEL_VISIBLE);
- image233 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image233);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (remove1), image233);
+ image261 = gtk_image_new_from_stock ("gtk-remove", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image261);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (remove1), image261);
crop1 = gtk_menu_item_new_with_mnemonic ("Crop");
gtk_widget_show (crop1);
@@ -343,6 +344,13 @@ create_mainwin (void)
gtk_container_add (GTK_CONTAINER (playlist1_menu), scroll_follows_playback);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (scroll_follows_playback), TRUE);
+ stop_after_current = gtk_check_menu_item_new_with_mnemonic ("Stop after current");
+ gtk_widget_show (stop_after_current);
+ gtk_container_add (GTK_CONTAINER (playlist1_menu), stop_after_current);
+ gtk_widget_add_accelerator (stop_after_current, "activate", accel_group,
+ GDK_M, (GdkModifierType) GDK_CONTROL_MASK,
+ GTK_ACCEL_VISIBLE);
+
menuitem4 = gtk_menu_item_new_with_mnemonic ("_Help");
gtk_widget_show (menuitem4);
gtk_container_add (GTK_CONTAINER (menubar1), menuitem4);
@@ -358,9 +366,9 @@ create_mainwin (void)
gtk_widget_show (help1);
gtk_container_add (GTK_CONTAINER (menuitem4_menu), help1);
- image234 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU);
- gtk_widget_show (image234);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image234);
+ image262 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image262);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image262);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
@@ -583,6 +591,9 @@ create_mainwin (void)
g_signal_connect ((gpointer) scroll_follows_playback, "activate",
G_CALLBACK (on_scroll_follows_playback_activate),
NULL);
+ g_signal_connect ((gpointer) stop_after_current, "activate",
+ G_CALLBACK (on_stop_after_current_activate),
+ NULL);
g_signal_connect ((gpointer) about1, "activate",
G_CALLBACK (on_about1_activate),
NULL);
@@ -717,27 +728,27 @@ create_mainwin (void)
GLADE_HOOKUP_OBJECT (mainwin, menuitem1, "menuitem1");
GLADE_HOOKUP_OBJECT (mainwin, menuitem1_menu, "menuitem1_menu");
GLADE_HOOKUP_OBJECT (mainwin, open, "open");
- GLADE_HOOKUP_OBJECT (mainwin, image227, "image227");
+ GLADE_HOOKUP_OBJECT (mainwin, image255, "image255");
GLADE_HOOKUP_OBJECT (mainwin, separator2, "separator2");
GLADE_HOOKUP_OBJECT (mainwin, add_files, "add_files");
- GLADE_HOOKUP_OBJECT (mainwin, image228, "image228");
+ GLADE_HOOKUP_OBJECT (mainwin, image256, "image256");
GLADE_HOOKUP_OBJECT (mainwin, add_folders, "add_folders");
- GLADE_HOOKUP_OBJECT (mainwin, image229, "image229");
+ GLADE_HOOKUP_OBJECT (mainwin, image257, "image257");
GLADE_HOOKUP_OBJECT (mainwin, add_audio_cd, "add_audio_cd");
- GLADE_HOOKUP_OBJECT (mainwin, image230, "image230");
+ GLADE_HOOKUP_OBJECT (mainwin, image258, "image258");
GLADE_HOOKUP_OBJECT (mainwin, add_location1, "add_location1");
GLADE_HOOKUP_OBJECT (mainwin, separatormenuitem1, "separatormenuitem1");
GLADE_HOOKUP_OBJECT (mainwin, quit, "quit");
- GLADE_HOOKUP_OBJECT (mainwin, image231, "image231");
+ GLADE_HOOKUP_OBJECT (mainwin, image259, "image259");
GLADE_HOOKUP_OBJECT (mainwin, edit1, "edit1");
GLADE_HOOKUP_OBJECT (mainwin, edit1_menu, "edit1_menu");
GLADE_HOOKUP_OBJECT (mainwin, clear1, "clear1");
- GLADE_HOOKUP_OBJECT (mainwin, image232, "image232");
+ GLADE_HOOKUP_OBJECT (mainwin, image260, "image260");
GLADE_HOOKUP_OBJECT (mainwin, select_all1, "select_all1");
GLADE_HOOKUP_OBJECT (mainwin, selection1, "selection1");
GLADE_HOOKUP_OBJECT (mainwin, selection1_menu, "selection1_menu");
GLADE_HOOKUP_OBJECT (mainwin, remove1, "remove1");
- GLADE_HOOKUP_OBJECT (mainwin, image233, "image233");
+ GLADE_HOOKUP_OBJECT (mainwin, image261, "image261");
GLADE_HOOKUP_OBJECT (mainwin, crop1, "crop1");
GLADE_HOOKUP_OBJECT (mainwin, find1, "find1");
GLADE_HOOKUP_OBJECT (mainwin, separator5, "separator5");
@@ -762,11 +773,12 @@ create_mainwin (void)
GLADE_HOOKUP_OBJECT (mainwin, loop_single, "loop_single");
GLADE_HOOKUP_OBJECT (mainwin, loop_disable, "loop_disable");
GLADE_HOOKUP_OBJECT (mainwin, scroll_follows_playback, "scroll_follows_playback");
+ GLADE_HOOKUP_OBJECT (mainwin, stop_after_current, "stop_after_current");
GLADE_HOOKUP_OBJECT (mainwin, menuitem4, "menuitem4");
GLADE_HOOKUP_OBJECT (mainwin, menuitem4_menu, "menuitem4_menu");
GLADE_HOOKUP_OBJECT (mainwin, about1, "about1");
GLADE_HOOKUP_OBJECT (mainwin, help1, "help1");
- GLADE_HOOKUP_OBJECT (mainwin, image234, "image234");
+ GLADE_HOOKUP_OBJECT (mainwin, image262, "image262");
GLADE_HOOKUP_OBJECT (mainwin, hbox2, "hbox2");
GLADE_HOOKUP_OBJECT (mainwin, hbox3, "hbox3");
GLADE_HOOKUP_OBJECT (mainwin, stopbtn, "stopbtn");
diff --git a/streamer.c b/streamer.c
index 06fd298f..1fae0256 100644
--- a/streamer.c
+++ b/streamer.c
@@ -771,7 +771,12 @@ streamer_read_async (char *bytes, int size) {
if (bytes_until_next_song < 0) {
trace ("finished streaming song, queueing next\n");
bytes_until_next_song = streambuffer_fill;
- pl_nextsong (0);
+ if (conf_get_int ("playlist.stop_after_current", 0)) {
+ streamer_set_nextsong (-2, 1);
+ }
+ else {
+ pl_nextsong (0);
+ }
}
break;
}