Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 2b471379494a2acc128492c7574ce12f > files > 8

xmms-1.2.10-35mdv2008.0.src.rpm

? diff
? make.log
Index: Output/disk_writer/disk_writer.c
===================================================================
RCS file: /cvs/xmms/Output/disk_writer/disk_writer.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 disk_writer.c
--- Output/disk_writer/disk_writer.c	22 Feb 2004 17:29:13 -0000	1.17
+++ Output/disk_writer/disk_writer.c	25 Feb 2004 21:13:59 -0000
@@ -3,6 +3,9 @@
  *                           Thomas Nilsson and 4Front Technologies
  *  Copyright (C) 1999-2004  Haavard Kvaalen
  *
+ *  File name suffix option added by Heikki Orsila 2003
+ *  <heikki.orsila@iki.fi> (no copyrights claimed)
+ * 
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -53,6 +56,9 @@ static GtkWidget *path_hbox, *path_label
 static GtkWidget *configure_separator;
 static GtkWidget *configure_bbox, *configure_ok, *configure_cancel;
 
+static GtkWidget *use_suffix_toggle = NULL;
+static gboolean use_suffix = FALSE;
+
 static gchar *file_path = NULL;
 static FILE *output_file = NULL;
 static struct wavhead header;
@@ -107,6 +113,7 @@ static void disk_init(void)
 	if (cfgfile)
 	{
 		xmms_cfg_read_string(cfgfile, "disk_writer", "file_path", &file_path);
+		xmms_cfg_read_boolean(cfgfile, "disk_writer", "use_suffix", &use_suffix);
 		xmms_cfg_free(cfgfile);
 	}
 
@@ -133,8 +140,11 @@ static gint disk_open(AFormat fmt, gint 
 
 	pos = xmms_remote_get_playlist_pos(ctrlsocket_get_session_id());
 	title = xmms_remote_get_playlist_file(ctrlsocket_get_session_id(), pos);
-	if (title != NULL && (temp = strrchr(title, '.')) != NULL)
-		*temp = '\0';
+	if (!use_suffix) {
+		if (title != NULL && (temp = strrchr(title, '.')) != NULL) {
+			*temp = '\0';
+		}
+	}
 	if (title == NULL || strlen(g_basename(title)) == 0)
 	{
 		g_free(title);
@@ -314,11 +324,15 @@ static void configure_ok_cb(gpointer dat
 		g_free(file_path);
 	file_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(path_entry)));
 
+	use_suffix =
+		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_suffix_toggle));
+
 	cfgfile = xmms_cfg_open_default_file();
 	if (!cfgfile)
 		cfgfile = xmms_cfg_new();
 
 	xmms_cfg_write_string(cfgfile, "disk_writer", "file_path", file_path);
+	xmms_cfg_write_boolean(cfgfile, "disk_writer", "use_suffix", use_suffix);
 	xmms_cfg_write_default_file(cfgfile);
 	xmms_cfg_free(cfgfile);
 
@@ -335,6 +349,8 @@ static void configure_destroy(void)
 
 static void disk_configure(void)
 {
+	GtkTooltips *use_suffix_tooltips;
+
 	if (!configure_win)
 	{
 		configure_win = gtk_window_new(GTK_WINDOW_DIALOG);
@@ -369,6 +385,14 @@ static void disk_configure(void)
 		gtk_widget_show(path_browse);
 
 		gtk_widget_show(path_hbox);
+
+		use_suffix_toggle = gtk_check_button_new_with_label(_("Don't strip file name extension"));
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_suffix_toggle), use_suffix);
+		gtk_box_pack_start(GTK_BOX(configure_vbox), use_suffix_toggle, FALSE, FALSE, 0);
+		use_suffix_tooltips = gtk_tooltips_new();
+		gtk_tooltips_set_tip(use_suffix_tooltips, use_suffix_toggle, "If enabled, the extension from the original filename will not be stripped before adding the .wav extension to the end.", NULL);
+		gtk_tooltips_enable(use_suffix_tooltips);
+		gtk_widget_show(use_suffix_toggle);
 
 		configure_separator = gtk_hseparator_new();
 		gtk_box_pack_start(GTK_BOX(configure_vbox), configure_separator, FALSE, FALSE, 0);