Re: patch to append files to playlist

Chris Hellberg <[email protected]>
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
Hi Morten,

Thanks for the feedback....

--- Morten Nilsen <[email protected]> wrote:

> Chris Hellberg wrote:
> > Hi,
> > 
> > ...
> 
> I don't think adding whitespace like that is
> necessary...
> 

Done.

> and please, either attach the patch or post an url..
> wordwrapped patches
> aren't very helpful.
> 

Fair enough. Attached is the rehash without the
whitespace.

> -- 
> Morten

Cheers,
Chris

_______________________________________________
xmms-devel mailing list
[email protected]
http://lists.xmms.org/mailman/listinfo/xmms-devel
xmms-1.2.10-append.diff (text/x-patch, 4.8 KB)
--- xmms-1.2.10-orig/xmms/main.c	Thu Dec  2 09:39:24 2004
+++ xmms-1.2.10/xmms/main.c	Fri Dec  3 08:31:11 2004
@@ -116,7 +116,8 @@
 	MAINWIN_OPT_REPEAT, MAINWIN_OPT_SHUFFLE, MAINWIN_OPT_NPA,
 	MAINWIN_OPT_TELAPSED, MAINWIN_OPT_TREMAINING, MAINWIN_OPT_ALWAYS,
 	MAINWIN_OPT_STICKY, MAINWIN_OPT_WS, MAINWIN_OPT_PWS,
-	MAINWIN_OPT_EQWS, MAINWIN_OPT_DOUBLESIZE, MAINWIN_OPT_EASY_MOVE
+	MAINWIN_OPT_EQWS, MAINWIN_OPT_DOUBLESIZE, MAINWIN_OPT_EASY_MOVE,
+	MAINWIN_OPT_ATP
 };
 
 GtkItemFactoryEntry mainwin_options_menu_entries[] =
@@ -128,6 +129,7 @@
 	{N_("/Repeat"), "R", mainwin_options_menu_callback, MAINWIN_OPT_REPEAT, "<ToggleItem>"},
 	{N_("/Shuffle"), "S", mainwin_options_menu_callback, MAINWIN_OPT_SHUFFLE, "<ToggleItem>"},
 	{N_("/No Playlist Advance"), "<control>N", mainwin_options_menu_callback, MAINWIN_OPT_NPA, "<ToggleItem>"},
+	{N_("/Append to playlist"), "<control>T", mainwin_options_menu_callback, MAINWIN_OPT_ATP, "<ToggleItem>"},
 	{N_("/-"), NULL, NULL, 0, "<Separator>"},
 	{N_("/Time Elapsed"), "<control>E", mainwin_options_menu_callback, MAINWIN_OPT_TELAPSED, "<RadioItem>"},
 	{N_("/Time Remaining"), "<control>R", mainwin_options_menu_callback, MAINWIN_OPT_TREMAINING, "/Time Elapsed"},
@@ -341,6 +343,7 @@
 	cfg.eq_doublesize_linked = TRUE;
 	cfg.player_visible = TRUE;
 	cfg.no_playlist_advance = FALSE;
+	cfg.append_to_playlist = FALSE;
 	cfg.smooth_title_scroll = TRUE;
 	cfg.random_skin_on_play = FALSE;
 	cfg.mainwin_use_xfont = FALSE;
@@ -393,6 +396,7 @@
 		xmms_cfg_read_boolean(cfgfile, "xmms", "get_info_on_demand", &cfg.get_info_on_demand);
 		xmms_cfg_read_boolean(cfgfile, "xmms", "eq_doublesize_linked", &cfg.eq_doublesize_linked);
 		xmms_cfg_read_boolean(cfgfile, "xmms", "no_playlist_advance", &cfg.no_playlist_advance);
+		xmms_cfg_read_boolean(cfgfile, "xmms", "append_to_playlist", &cfg.append_to_playlist);
 		xmms_cfg_read_boolean(cfgfile, "xmms", "sort_jump_to_file", &cfg.sort_jump_to_file);
 		xmms_cfg_read_boolean(cfgfile, "xmms", "use_pl_metadata", &cfg.use_pl_metadata);
 		xmms_cfg_read_boolean(cfgfile, "xmms", "smooth_title_scroll", &cfg.smooth_title_scroll);
@@ -558,6 +562,7 @@
 	xmms_cfg_write_boolean(cfgfile, "xmms", "get_info_on_demand", cfg.get_info_on_demand);
 	xmms_cfg_write_boolean(cfgfile, "xmms", "eq_doublesize_linked", cfg.eq_doublesize_linked);
 	xmms_cfg_write_boolean(cfgfile, "xmms", "no_playlist_advance", cfg.no_playlist_advance);
+	xmms_cfg_write_boolean(cfgfile, "xmms", "append_to_playlist", cfg.append_to_playlist);
 	xmms_cfg_write_boolean(cfgfile, "xmms", "sort_jump_to_file", cfg.sort_jump_to_file);
 	xmms_cfg_write_boolean(cfgfile, "xmms", "smooth_title_scroll", cfg.smooth_title_scroll);
 	xmms_cfg_write_boolean(cfgfile, "xmms", "use_backslash_as_dir_delimiter", cfg.use_backslash_as_dir_delimiter);
@@ -2415,9 +2420,14 @@
 		break;
 	case MAINWIN_OPT_NPA:
 		cfg.no_playlist_advance = GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_options_menu, "/No Playlist Advance"))->active;
+		break;
+	case MAINWIN_OPT_ATP:
+		cfg.append_to_playlist = GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget(mainwin_options_menu, "/Append to playlist"))->active;
+		cfg.append_to_playlist = TRUE;
 	}
 }
 
+
 void mainwin_vis_menu_callback(gpointer cb_data, guint action, GtkWidget * w)
 {
 	switch (action)
@@ -2765,6 +2775,7 @@
 	CHECK_SET(mainwin_options_menu, "/Repeat", cfg.repeat);
 	CHECK_SET(mainwin_options_menu, "/Easy Move", cfg.easy_move);
 	CHECK_SET(mainwin_options_menu, "/No Playlist Advance", cfg.no_playlist_advance);
+	CHECK_SET(mainwin_options_menu, "/Append to playlist", cfg.append_to_playlist);
 	if (cfg.timer_mode == TIMER_ELAPSED)
 		widget = gtk_item_factory_get_widget(mainwin_options_menu, "/Time Elapsed");
 	else
@@ -3348,10 +3359,12 @@
 		GList *node;
 		int pos = 0;
 
-		if (opt->enqueue && opt->play)
+		if (opt->enqueue && opt->play) {
 			pos = xmms_remote_get_playlist_length (opt->session);
-		if (!opt->enqueue)
+			}
+		if (!opt->enqueue && !cfg.append_to_playlist) {
 			xmms_remote_playlist_clear(opt->session);
+			}
 		xmms_remote_playlist_add(opt->session, opt->filenames);
 		node = opt->filenames;
 		while (node)
--- xmms-1.2.10-orig/xmms/main.h	Thu Dec  2 09:39:24 2004
+++ xmms-1.2.10/xmms/main.h	Thu Dec  2 09:46:59 2004
@@ -44,7 +44,7 @@
 	gboolean no_playlist_advance, smooth_title_scroll, use_pl_metadata;
 	gboolean use_backslash_as_dir_delimiter;
 	gboolean random_skin_on_play, use_fontsets;
-	gboolean mainwin_use_xfont;
+	gboolean append_to_playlist, mainwin_use_xfont;
 	gfloat equalizer_preamp, equalizer_bands[10];
 	gchar *skin, *outputplugin, *filesel_path, *playlist_path;
 	gchar *playlist_font, *mainwin_font;
@@ -94,6 +94,8 @@
 void mainwin_adjust_balance_release(void);
 void mainwin_set_volume_slider(gint percent);
 void mainwin_set_balance_slider(gint percent);
+
+void set_append_playlist(void);
 
 void mainwin_vis_set_type(VisType mode);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.