Index: sound-juicer.glade
===================================================================
RCS file: /cvs/gnome/sound-juicer/data/sound-juicer.glade,v
retrieving revision 1.33
diff -u -r1.33 sound-juicer.glade
--- sound-juicer.glade	20 Nov 2004 12:54:26 -0000	1.33
+++ sound-juicer.glade	4 Feb 2005 06:56:24 -0000
@@ -1450,29 +1450,6 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkCheckButton" id="check_strip">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">_Strip special characters</property>
-		  <property name="use_underline">True</property>
-		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
-		  <property name="active">False</property>
-		  <property name="inconsistent">False</property>
-		  <property name="draw_indicator">True</property>
-		  <signal name="toggled" handler="prefs_strip_toggled" last_modification_time="Fri, 25 Apr 2003 08:29:02 GMT"/>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">4</property>
-		  <property name="bottom_attach">5</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
 		<widget class="GtkComboBox" id="path_option">
 		  <property name="visible">True</property>
 		  <property name="items" translatable="yes"></property>
@@ -1501,6 +1478,61 @@
 		  <property name="y_options">fill</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="vbox14">
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="check_strip">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Strip special characters</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <signal name="toggled" handler="prefs_strip_toggled" last_modification_time="Fri, 25 Apr 2003 08:29:02 GMT"/>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="check_playlist">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Create Playlist After Extracting</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <signal name="toggled" handler="prefs_playlist_toggled" last_modification_time="Fri, 04 Feb 2005 05:42:47 GMT"/>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">4</property>
+		  <property name="bottom_attach">5</property>
+		  <property name="x_options">fill</property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>
Index: sj-prefs.c
===================================================================
RCS file: /cvs/gnome/sound-juicer/src/sj-prefs.c,v
retrieving revision 1.29
diff -u -r1.29 sj-prefs.c
--- sj-prefs.c	20 Nov 2004 12:54:26 -0000	1.29
+++ sj-prefs.c	4 Feb 2005 07:00:18 -0000
@@ -31,9 +31,12 @@
 #include "sj-extracting.h"
 #include "cd-drive.h"
 #include "bacon-cd-selection.h"
+#define PLAYLIST 0
+#define NO_LIST  1
 
 extern GladeXML *glade;
 extern GtkWidget *main_window;
+extern int mode;
 
 static GtkWidget *audio_profile;
 static GtkWidget *prefs_dialog;
@@ -198,6 +201,19 @@
   gconf_client_set_bool (gconf_client, GCONF_STRIP,
                          gtk_toggle_button_get_active (togglebutton),
                          NULL);
+}
+
+/**
+ * The Playlist check box was toggled.
+ */
+void prefs_playlist_toggled (GtkToggleButton *togglebutton, gpointer user_data)
+{
+  gboolean value;
+  value =  gtk_toggle_button_get_active (togglebutton);
+  if (value)
+  mode = PLAYLIST;
+  else
+  mode = NO_LIST;
 }
 
 static void device_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
Index: sj-extracting.c
===================================================================
RCS file: /cvs/gnome/sound-juicer/src/sj-extracting.c,v
retrieving revision 1.48
diff -u -r1.48 sj-extracting.c
--- sj-extracting.c	5 Jan 2005 10:23:29 -0000	1.48
+++ sj-extracting.c	4 Feb 2005 07:00:36 -0000
@@ -40,6 +40,11 @@
 #include "sj-extracting.h"
 #include "sj-util.h"
 
+#define PLAYLIST 0 /* In playlist mode,playlist file is created*/
+#define NO_LIST 1 /* In no_list mode, playlist file is not created*/
+
+int mode;
+
 typedef struct {
   int seconds;
   struct timeval time;
@@ -236,7 +241,7 @@
  * update the UI, and start the extractor.
  */
 static void
-pop_and_extract (void)
+pop_and_extract (int *mode) 
 {
   if (pending == NULL) {
     g_assert_not_reached ();
@@ -244,12 +249,36 @@
     char *file_path, *directory;
     GError *error = NULL;
     char *text;
-    
+    static int no_of_times;
+    char *filename;	
+
+    FILE *fp;
     /* Pop the next track to extract */
     track = pending->data;
+
     pending = g_list_remove (pending, track);
     /* Build the filename for this track */
+
     file_path = build_filename (track);
+    
+    /* Building Playlist */
+    if (*mode == PLAYLIST)
+    {
+    filename = g_build_filename (base_path,g_strconcat(track->artist,"-",track->album->title,".m3u",NULL), NULL);
+	    if (no_of_times == 0){
+	        fp=fopen(filename,"w");
+	    	fprintf(fp,"%s\n","#EXTM3U");
+		}
+	    else
+	        {
+		fp=fopen(filename,"a+");
+		}
+    no_of_times ++;	
+    fprintf(fp,"%s:%d,%s\n","#EXTINF",track->duration,track->title);
+    fprintf(fp,"%s\n",file_path);
+    fclose(fp); 	
+	}
+
     /* And create the directory it lives in */
     directory = create_directory_for (file_path, &error);
     if (error) {
@@ -273,7 +302,7 @@
     paths = g_list_append (paths, directory);
     /* See if the file exists */
     if (!check_for_file (file_path)) {
-      on_completion_cb (NULL, NULL);
+      on_completion_cb (NULL, mode);
       return;
     }
 
@@ -494,7 +523,7 @@
     /* Increment the duration */
     current_duration += track->duration;
     /* And go and do it all again */
-    pop_and_extract ();
+    pop_and_extract ((int*)data);
   }
 }
 
@@ -560,7 +589,7 @@
   if (!initialised) {
     /* Connect to the SjExtractor signals */
     g_signal_connect (extractor, "progress", G_CALLBACK (on_progress_cb), NULL);
-    g_signal_connect (extractor, "completion", G_CALLBACK (on_completion_cb), NULL);
+    g_signal_connect (extractor, "completion", G_CALLBACK (on_completion_cb), (gpointer)&mode);
     g_signal_connect (extractor, "error", G_CALLBACK (on_error_cb), NULL);
 
     /* Get the progress dialog */
@@ -610,7 +639,7 @@
   
   /* Start the extracting */
   extracting = TRUE;
-  pop_and_extract ();
+  pop_and_extract (&mode); 
 }
 
 /*
Index: sound-juicer.h
===================================================================
RCS file: /cvs/gnome/sound-juicer/src/sound-juicer.h,v
retrieving revision 1.12
diff -u -r1.12 sound-juicer.h
--- sound-juicer.h	20 Nov 2004 12:54:26 -0000	1.12
+++ sound-juicer.h	4 Feb 2005 07:00:51 -0000
@@ -60,6 +60,11 @@
 extern gboolean extracting;
 
 /**
+ * Set the mode
+ */
+extern int mode;
+
+/**
  * The columns in the list view
  */
 typedef enum {
