changeset 1293:c727a0f74374

Automated merge with ssh://monkeh@hg.atheme-project.org//hg/audacious-plugins
author Alex Maclean <monkeh@monkeh.net>
date Thu, 19 Jul 2007 00:50:01 +0000
parents bd19eda4ae66 (current diff) 8298974410fe (diff)
children ea7c0a4fe793
files
diffstat 45 files changed, 760 insertions(+), 493 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Fri Jul 13 02:00:46 2007 +0000
+++ b/configure.ac	Thu Jul 19 00:50:01 2007 +0000
@@ -206,8 +206,8 @@
 case "$target" in
 	*-apple-*)
 		AC_MSG_RESULT([Mac OS X: -fPIC -bundle -fno-common -flat_namespace -undefined suppress, .dylib])
-		PICFLAGS="-fPIC -DPIC"
-		PICLDFLAGS="-fPIC -DPIC -bundle -fno-common -flat_namespace -undefined suppress"
+		PICFLAGS="-DPIC -fno-common"
+		PICLDFLAGS="-DPIC -bundle -fno-common -flat_namespace -undefined suppress"
 		LIBLDFLAGS="-dynamiclib"
 		AUDLDFLAGS=""
 		SHARED_SUFFIX=".dylib"
--- a/src/adplug/adplug-xmms.cc	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/adplug/adplug-xmms.cc	Thu Jul 19 00:50:01 2007 +0000
@@ -256,7 +256,7 @@
   GtkTooltips *tooltips = gtk_tooltips_new ();
   GPtrArray *rblist = g_ptr_array_new ();
 
-  gtk_window_set_title (GTK_WINDOW (config_dlg), "AdPlug :: Configuration");
+  gtk_window_set_title (GTK_WINDOW (config_dlg), _("AdPlug :: Configuration"));
   gtk_window_set_policy (GTK_WINDOW (config_dlg), FALSE, FALSE, TRUE);  // Window is auto sized
   gtk_window_set_modal (GTK_WINDOW (config_dlg), TRUE);
   gtk_container_add (GTK_CONTAINER (config_dlg->vbox), GTK_WIDGET (notebook));
@@ -265,7 +265,7 @@
   {
     GtkWidget *button;
 
-    button = gtk_button_new_with_label ("Ok");
+    button = gtk_button_new_with_label (_("Ok"));
     g_signal_connect (G_OBJECT (button), "clicked",
                       G_CALLBACK (close_config_box_ok), (gpointer) rblist);
     g_signal_connect_data (G_OBJECT (button), "clicked",
@@ -275,7 +275,7 @@
                                             G_CONNECT_SWAPPED));
     gtk_container_add (GTK_CONTAINER (config_dlg->action_area), button);
 
-    button = gtk_button_new_with_label ("Cancel");
+    button = gtk_button_new_with_label (_("Cancel"));
     g_signal_connect (G_OBJECT (button), "clicked",
                       G_CALLBACK (close_config_box_cancel),
                       (gpointer) rblist);
@@ -291,7 +291,7 @@
   gtk_table_set_row_spacings (table, 5);
   gtk_table_set_col_spacings (table, 5);
   gtk_notebook_append_page (notebook, GTK_WIDGET (table),
-                            print_left ("General"));
+                            print_left (_("General")));
 
   // Add "Sound quality" section
   {
@@ -303,19 +303,19 @@
     gtk_table_set_col_spacings (sqt, 5);
     gtk_table_attach_defaults (table,
                                make_framed (GTK_WIDGET (sqt),
-                                            "Sound quality"), 0, 1, 0, 1);
+                                            _("Sound quality")), 0, 1, 0, 1);
 
     // Add "Resolution" section
     fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0));
     gtk_table_attach_defaults (sqt,
-                               make_framed (GTK_WIDGET (fvb), "Resolution"),
+                               make_framed (GTK_WIDGET (fvb), _("Resolution")),
                                0, 1, 0, 1);
-    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, "8bit"));
+    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("8bit")));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !cfg.bit16);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     rb =
       GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
-                        (rb, "16bit"));
+                        (rb, _("16bit")));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), cfg.bit16);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     g_ptr_array_add (rblist, (gpointer) rb);
@@ -323,49 +323,49 @@
     // Add "Channels" section
     fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0));
     gtk_table_attach_defaults (sqt,
-                               make_framed (GTK_WIDGET (fvb), "Channels"), 0,
+                               make_framed (GTK_WIDGET (fvb), _("Channels")), 0,
                                1, 1, 2);
-    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, "Mono"));
+    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("Mono")));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), !cfg.stereo);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     rb =
       GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
-                        (rb, "Stereo"));
+                        (rb, _("Stereo")));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), cfg.stereo);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     gtk_tooltips_set_tip (tooltips, GTK_WIDGET (rb),
-                          "Setting stereo is not recommended, unless you need to. "
+                          _("Setting stereo is not recommended, unless you need to. "
                           "This won't add any stereo effects to the sound - OPL2 "
-                          "is just mono - but eats up more CPU power!", NULL);
+                          "is just mono - but eats up more CPU power!"), NULL);
     g_ptr_array_add (rblist, (gpointer) rb);
 
     // Add "Frequency" section
     fvb = GTK_VBOX (gtk_vbox_new (TRUE, 0));
     gtk_table_attach_defaults (sqt,
-                               make_framed (GTK_WIDGET (fvb), "Frequency"), 1,
+                               make_framed (GTK_WIDGET (fvb), _("Frequency")), 1,
                                2, 0, 2);
-    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, "11025"));
+    rb = GTK_RADIO_BUTTON (gtk_radio_button_new_with_label (NULL, _("11025")));
     if (cfg.freq == 11025)
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     g_ptr_array_add (rblist, (gpointer) rb);
     rb =
       GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
-                        (rb, "22050"));
+                        (rb, _("22050")));
     if (cfg.freq == 22050)
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     g_ptr_array_add (rblist, (gpointer) rb);
     rb =
       GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
-                        (rb, "44100"));
+                        (rb, _("44100")));
     if (cfg.freq == 44100)
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
     g_ptr_array_add (rblist, (gpointer) rb);
     rb =
       GTK_RADIO_BUTTON (gtk_radio_button_new_with_label_from_widget
-                        (rb, "48000"));
+                        (rb, _("48000")));
     if (cfg.freq == 48000)
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rb), TRUE);
     gtk_container_add (GTK_CONTAINER (fvb), GTK_WIDGET (rb));
@@ -378,18 +378,18 @@
     GtkCheckButton *cb;
 
     gtk_table_attach_defaults (table,
-                               make_framed (GTK_WIDGET (vb), "Playback"), 1,
+                               make_framed (GTK_WIDGET (vb), _("Playback")), 1,
                                2, 0, 1);
 
     cb =
-      GTK_CHECK_BUTTON (gtk_check_button_new_with_label ("Detect songend"));
+      GTK_CHECK_BUTTON (gtk_check_button_new_with_label (_("Detect songend")));
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), !cfg.endless);
     gtk_container_add (GTK_CONTAINER (vb), GTK_WIDGET (cb));
     gtk_tooltips_set_tip (tooltips, GTK_WIDGET (cb),
-                          "If enabled, XMMS will detect a song's ending, stop "
+                          _("If enabled, XMMS will detect a song's ending, stop "
                           "it and advance in the playlist. If disabled, XMMS "
                           "won't take notice of a song's ending and loop it all "
-                          "over again and again.", NULL);
+                          "over again and again."), NULL);
     g_ptr_array_add (rblist, (gpointer) cb);
   }
 
@@ -397,17 +397,17 @@
 
   table = GTK_TABLE (gtk_table_new (1, 1, TRUE));
   gtk_notebook_append_page (notebook, GTK_WIDGET (table),
-                            print_left ("Formats"));
+                            print_left (_("Formats")));
 
   // Add "Format selection" section
   {
     GtkHBox *vb = GTK_HBOX (gtk_hbox_new (FALSE, 0));
     gtk_table_attach_defaults (table,
                                make_framed (GTK_WIDGET (vb),
-                                            "Format selection"), 0, 1, 0, 1);
+                                            _("Format selection")), 0, 1, 0, 1);
     // Add scrollable list
     {
-      const gchar *rowstr[] = { "Format", "Extension" };
+      const gchar *rowstr[] = { _("Format"), _("Extension") };
       GtkEventBox *eventbox = GTK_EVENT_BOX (gtk_event_box_new ());
       GtkScrolledWindow *formatswnd =
         GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
@@ -447,10 +447,10 @@
       gtk_container_add (GTK_CONTAINER (eventbox), GTK_WIDGET (formatswnd));
       gtk_container_add (GTK_CONTAINER (vb), GTK_WIDGET (eventbox));
       gtk_tooltips_set_tip (tooltips, GTK_WIDGET (eventbox),
-                            "Selected file types will be recognized and played "
+                            _("Selected file types will be recognized and played "
                             "back by this plugin. Deselected types will be "
                             "ignored to make room for other plugins to play "
-                            "these files.", NULL);
+                            "these files."), NULL);
       g_ptr_array_add (rblist, pl);
     }
   }
@@ -526,14 +526,14 @@
   std::ostringstream infotext;
   unsigned int i;
   GtkDialog *infobox = GTK_DIALOG (gtk_dialog_new ());
-  GtkButton *okay_button = GTK_BUTTON (gtk_button_new_with_label ("Ok"));
+  GtkButton *okay_button = GTK_BUTTON (gtk_button_new_with_label (_("Ok")));
 
   GtkVBox *box = GTK_VBOX (gtk_vbox_new (TRUE, 2));
   GtkHBox *hbox = GTK_HBOX (gtk_hbox_new (TRUE, 2));
   GtkHBox *hbox2 = GTK_HBOX (gtk_hbox_new (TRUE, 2));
 
   // Build file info box
-  gtk_window_set_title (GTK_WINDOW (infobox), "AdPlug :: File Info");
+  gtk_window_set_title (GTK_WINDOW (infobox), _("AdPlug :: File Info"));
   gtk_window_set_policy (GTK_WINDOW (infobox), FALSE, FALSE, TRUE); // Window is auto sized
 
   gtk_container_add (GTK_CONTAINER (infobox->vbox), GTK_WIDGET (box));
@@ -555,25 +555,25 @@
 //            GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X);
   gtk_box_pack_end (GTK_BOX (box), GTK_WIDGET (hbox2), TRUE, TRUE, 2);
   gtk_box_pack_end (GTK_BOX (box),
-                    make_framed (print_left (filename), "Filename"), TRUE,
+                    make_framed (print_left (filename), _("Filename")), TRUE,
                     TRUE, 2);
 
   // Add "Song info" section
-  infotext << "Title: " << p->gettitle () << std::endl <<
-    "Author: " << p->getauthor () << std::endl <<
-    "File Type: " << p->gettype () << std::endl <<
-    "Subsongs: " << p->getsubsongs () << std::endl <<
-    "Instruments: " << p->getinstruments ();
+  infotext << _("Title: ") << p->gettitle () << std::endl <<
+    _("Author: ") << p->getauthor () << std::endl <<
+    _("File Type: ") << p->gettype () << std::endl <<
+    _("Subsongs: ") << p->getsubsongs () << std::endl <<
+    _("Instruments: ") << p->getinstruments ();
   if (plr.p == p)
     infotext << std::ends;
   else
   {
-    infotext << std::endl << "Orders: " << p->getorders () << std::endl <<
-      "Patterns: " << p->getpatterns () << std::ends;
+    infotext << std::endl << _("Orders: ") << p->getorders () << std::endl <<
+      _("Patterns: ") << p->getpatterns () << std::ends;
   }
   gtk_container_add (GTK_CONTAINER (hbox),
                      make_framed (print_left (infotext.str ().c_str ()),
-                                  "Song"));
+                                  _("Song")));
 
   // Add "Playback info" section if currently playing
   if (plr.p == p)
@@ -582,7 +582,7 @@
     gtk_label_set_justify (plr.infobox, GTK_JUSTIFY_LEFT);
     gtk_misc_set_padding (GTK_MISC (plr.infobox), 2, 2);
     gtk_container_add (GTK_CONTAINER (hbox),
-                       make_framed (GTK_WIDGET (plr.infobox), "Playback"));
+                       make_framed (GTK_WIDGET (plr.infobox), _("Playback")));
   }
 
 // Former packer layout, for future reproduction
@@ -599,7 +599,7 @@
     gchar tmpstr[10];
 
     {
-      const gchar *rowstr[] = { "#", "Instrument name" };
+      const gchar *rowstr[] = { _("#"), _("Instrument name") };
       instnames = GTK_CLIST (gtk_clist_new_with_titles (2, (gchar **)rowstr));
     }
     gtk_clist_set_column_justification (instnames, 0, GTK_JUSTIFY_RIGHT);
@@ -641,7 +641,7 @@
 //    gtk_packer_add(packer, make_framed(GTK_WIDGET(msgwnd), "Song message"),
 //         GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X, 2, 0, 0, 200, 50);
     gtk_box_pack_end (GTK_BOX (hbox2),
-                      make_framed (GTK_WIDGET (msgwnd), "Song message"), TRUE,
+                      make_framed (GTK_WIDGET (msgwnd), _("Song message")), TRUE,
                       TRUE, 2);
   }
 
@@ -663,7 +663,7 @@
 //   gtk_packer_add_defaults(packer, make_framed(GTK_WIDGET(slider), "Subsong selection"),
 //              GTK_SIDE_TOP, GTK_ANCHOR_CENTER, GTK_FILL_X);
     gtk_box_pack_end (GTK_BOX (hbox2),
-                      make_framed (GTK_WIDGET (slider), "Subsong selection"),
+                      make_framed (GTK_WIDGET (slider), _("Subsong selection")),
                       TRUE, TRUE, 2);
   }
 
@@ -685,13 +685,13 @@
   std::ostringstream infotext;
 
   // Recreate info string
-  infotext << "Order: " << plr.p->getorder () << " / " << plr.p->
-    getorders () << std::endl << "Pattern: " << plr.p->
-    getpattern () << " / " << plr.p->
-    getpatterns () << std::endl << "Row: " << plr.p->
-    getrow () << std::endl << "Speed: " << plr.p->
-    getspeed () << std::endl << "Timer: " << plr.p->
-    getrefresh () << "Hz" << std::ends;
+  infotext << _("Order: ") << plr.p->getorder () << _(" / ") << plr.p->
+    getorders () << std::endl << _("Pattern: ") << plr.p->
+    getpattern () << _(" / ") << plr.p->
+    getpatterns () << std::endl << _("Row: ") << plr.p->
+    getrow () << std::endl << _("Speed: ") << plr.p->
+    getspeed () << std::endl << _("Timer: ") << plr.p->
+    getrefresh () << _("Hz") << std::ends;
 
   GDK_THREADS_ENTER ();
   gtk_label_set_text (plr.infobox, infotext.str ().c_str ());
--- a/src/alac/plugin.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/alac/plugin.c	Thu Jul 19 00:50:01 2007 +0000
@@ -71,19 +71,19 @@
     if (ext != NULL)
         ++ext;
 
-    return ext;  
+    return ext;
 }
 
 static void alac_about(void)
 {
 	static GtkWidget *aboutbox;
-    
+
 	if(aboutbox != NULL)
 		return;
 
-	aboutbox = xmms_show_message("About Apple Lossless Audio Plugin",
-				     "Copyright (c) 2006 Audacious team\n"
-				     "Portions (c) 2005-2006 David Hammerton <crazney -at- crazney.net>",
+	aboutbox = xmms_show_message(_("About Apple Lossless Audio Plugin"),
+				     _("Copyright (c) 2006 Audacious team\n"
+				     "Portions (c) 2005-2006 David Hammerton <crazney -at- crazney.net>"),
 				     _("Ok"), FALSE, NULL, NULL);
 
 	g_signal_connect(G_OBJECT(aboutbox), "destroy",
@@ -102,7 +102,7 @@
 
     if (!input_stream)
         return FALSE;
-        
+
     /* if qtmovie_read returns successfully, the stream is up to
      * the movie data, which can be used directly by the decoder */
     if (!qtmovie_read(input_stream, &demux_res))
@@ -156,7 +156,7 @@
 	vfs_fclose(input_file);
         return NULL;
     }
-        
+
     /* if qtmovie_read returns successfully, the stream is up to
      * the movie data, which can be used directly by the decoder */
     if (!qtmovie_read(input_stream, &demux_res))
--- a/src/alarm/interface.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/alarm/interface.c	Thu Jul 19 00:50:01 2007 +0000
@@ -18,6 +18,8 @@
 #include "interface.h"
 #include "support.h"
 
+#include <audacious/i18n.h>
+
 GtkWidget*
 create_about_dialog (void)
 {
@@ -31,7 +33,7 @@
   about_dialog = gtk_dialog_new ();
   gtk_widget_set_name (about_dialog, "about_dialog");
   gtk_object_set_data (GTK_OBJECT (about_dialog), "about_dialog", about_dialog);
-  gtk_window_set_title (GTK_WINDOW (about_dialog), "About XMMS Alarm");
+  gtk_window_set_title (GTK_WINDOW (about_dialog), _("About XMMS Alarm"));
 /*
  * GTK2 hack
  * GTK_WINDOW (about_dialog)->type = GTK_WINDOW_DIALOG;
@@ -44,7 +46,7 @@
   gtk_object_set_data (GTK_OBJECT (about_dialog), "dialog_vbox2", dialog_vbox2);
   gtk_widget_show (dialog_vbox2);
 
-  frame6 = gtk_frame_new ("XMMS Alarm");
+  frame6 = gtk_frame_new (_("XMMS Alarm"));
   gtk_widget_set_name (frame6, "frame6");
   gtk_widget_ref (frame6);
   gtk_object_set_data_full (GTK_OBJECT (about_dialog), "frame6", frame6,
@@ -53,7 +55,7 @@
   gtk_box_pack_start (GTK_BOX (dialog_vbox2), frame6, TRUE, TRUE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (frame6), 10);
 
-  label18 = gtk_label_new ("An XMMS plugin which can be used\nto start playing at a certain time.\n\nSend all complaints to:\nAdam Feakin <adamf@snika.uklinux.net>\nDaniel Stodden <stodden@in.tum.de>\n\nhttp://www.snika.uklinux.net/xmms-alarm/");
+  label18 = gtk_label_new (_("An XMMS plugin which can be used\nto start playing at a certain time.\n\nSend all complaints to:\nAdam Feakin <adamf@snika.uklinux.net>\nDaniel Stodden <stodden@in.tum.de>\n\nhttp://www.snika.uklinux.net/xmms-alarm/"));
   gtk_widget_set_name (label18, "label18");
   gtk_widget_ref (label18);
   gtk_object_set_data_full (GTK_OBJECT (about_dialog), "label18", label18,
@@ -68,7 +70,7 @@
   gtk_widget_show (dialog_action_area2);
   gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area2), 10);
 
-  close = gtk_button_new_with_label ("Close");
+  close = gtk_button_new_with_label (_("Close"));
   gtk_widget_set_name (close, "close");
   gtk_widget_ref (close);
   gtk_object_set_data_full (GTK_OBJECT (about_dialog), "close", close,
@@ -98,7 +100,7 @@
   alarm_dialog = gtk_dialog_new ();
   gtk_widget_set_name (alarm_dialog, "alarm_dialog");
   gtk_object_set_data (GTK_OBJECT (alarm_dialog), "alarm_dialog", alarm_dialog);
-  gtk_window_set_title (GTK_WINDOW (alarm_dialog), "Alarm");
+  gtk_window_set_title (GTK_WINDOW (alarm_dialog), _("Alarm"));
   gtk_window_set_policy (GTK_WINDOW (alarm_dialog), FALSE, FALSE, FALSE);
 
   dialog_vbox3 = GTK_DIALOG (alarm_dialog)->vbox;
@@ -106,7 +108,7 @@
   gtk_object_set_data (GTK_OBJECT (alarm_dialog), "dialog_vbox3", dialog_vbox3);
   gtk_widget_show (dialog_vbox3);
 
-  label19 = gtk_label_new ("This is your wakeup call.");
+  label19 = gtk_label_new (_("This is your wakeup call."));
   gtk_widget_set_name (label19, "label19");
   gtk_widget_ref (label19);
   gtk_object_set_data_full (GTK_OBJECT (alarm_dialog), "label19", label19,
@@ -121,7 +123,7 @@
   gtk_widget_show (dialog_action_area3);
   gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area3), 10);
 
-  button9 = gtk_button_new_with_label ("OK");
+  button9 = gtk_button_new_with_label (_("OK"));
   gtk_widget_set_name (button9, "button9");
   gtk_widget_ref (button9);
   gtk_object_set_data_full (GTK_OBJECT (alarm_dialog), "button9", button9,
@@ -149,7 +151,7 @@
   GtkWidget *ok_button1;
   GtkWidget *cancel_button1;
 
-  playlist_fileselection = gtk_file_selection_new ("Select Playlist");
+  playlist_fileselection = gtk_file_selection_new (_("Select Playlist"));
   gtk_widget_set_name (playlist_fileselection, "playlist_fileselection");
   gtk_object_set_data (GTK_OBJECT (playlist_fileselection), "playlist_fileselection", playlist_fileselection);
   gtk_container_set_border_width (GTK_CONTAINER (playlist_fileselection), 10);
@@ -193,7 +195,7 @@
   warning_dialog = gtk_dialog_new ();
   gtk_widget_set_name (warning_dialog, "warning_dialog");
   gtk_object_set_data (GTK_OBJECT (warning_dialog), "warning_dialog", warning_dialog);
-  gtk_window_set_title (GTK_WINDOW (warning_dialog), "Sorry");
+  gtk_window_set_title (GTK_WINDOW (warning_dialog), _("Sorry"));
   gtk_window_set_policy (GTK_WINDOW (warning_dialog), FALSE, FALSE, FALSE);
 
   dialog_vbox4 = GTK_DIALOG (warning_dialog)->vbox;
@@ -201,7 +203,7 @@
   gtk_object_set_data (GTK_OBJECT (warning_dialog), "dialog_vbox4", dialog_vbox4);
   gtk_widget_show (dialog_vbox4);
 
-  frame9 = gtk_frame_new ("Warning");
+  frame9 = gtk_frame_new (_("Warning"));
   gtk_widget_set_name (frame9, "frame9");
   gtk_widget_ref (frame9);
   gtk_object_set_data_full (GTK_OBJECT (warning_dialog), "frame9", frame9,
@@ -210,7 +212,7 @@
   gtk_box_pack_start (GTK_BOX (dialog_vbox4), frame9, TRUE, TRUE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (frame9), 10);
 
-  label70 = gtk_label_new ("For safety reasons the \"quiet\" time must be at least 65 seconds longer than the fading time, it must also be more than 10 seconds.  This basically means that there is a bug in the code and until I find a way of really fixing it this message will appear :)\n\nYour fading settings have NOT been saved\n\n--\nAdam");
+  label70 = gtk_label_new (_("For safety reasons the \"quiet\" time must be at least 65 seconds longer than the fading time, it must also be more than 10 seconds.  This basically means that there is a bug in the code and until I find a way of really fixing it this message will appear :)\n\nYour fading settings have NOT been saved\n\n--\nAdam"));
   gtk_widget_set_name (label70, "label70");
   gtk_widget_ref (label70);
   gtk_object_set_data_full (GTK_OBJECT (warning_dialog), "label70", label70,
@@ -226,7 +228,7 @@
   gtk_widget_show (dialog_action_area4);
   gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area4), 10);
 
-  button10 = gtk_button_new_with_label ("Oh Well");
+  button10 = gtk_button_new_with_label (_("Oh Well"));
   gtk_widget_set_name (button10, "button10");
   gtk_widget_ref (button10);
   gtk_object_set_data_full (GTK_OBJECT (warning_dialog), "button10", button10,
@@ -385,7 +387,7 @@
   config_dialog = gtk_dialog_new ();
   gtk_widget_set_name (config_dialog, "config_dialog");
   gtk_object_set_data (GTK_OBJECT (config_dialog), "config_dialog", config_dialog);
-  gtk_window_set_title (GTK_WINDOW (config_dialog), "Alarm Settings");
+  gtk_window_set_title (GTK_WINDOW (config_dialog), _("Alarm Settings"));
   gtk_window_set_policy (GTK_WINDOW (config_dialog), FALSE, FALSE, FALSE);
 
   dialog_vbox5 = GTK_DIALOG (config_dialog)->vbox;
@@ -401,7 +403,7 @@
   gtk_widget_show (notebook1);
   gtk_box_pack_start (GTK_BOX (dialog_vbox5), notebook1, TRUE, TRUE, 0);
 
-  frame10 = gtk_frame_new ("Time");
+  frame10 = gtk_frame_new (_("Time"));
   gtk_widget_set_name (frame10, "frame10");
   gtk_widget_ref (frame10);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame10", frame10,
@@ -442,7 +444,7 @@
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (stop_h_spin), TRUE);
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (stop_h_spin), GTK_UPDATE_IF_VALID);
 
-  label75 = gtk_label_new ("hours");
+  label75 = gtk_label_new (_("hours"));
   gtk_widget_set_name (label75, "label75");
   gtk_widget_ref (label75);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label75", label75,
@@ -472,7 +474,7 @@
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (alarm_h_spin), GTK_UPDATE_IF_VALID);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (alarm_h_spin), TRUE);
 
-  label76 = gtk_label_new (":");
+  label76 = gtk_label_new (_(":"));
   gtk_widget_set_name (label76, "label76");
   gtk_widget_ref (label76);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label76", label76,
@@ -503,7 +505,7 @@
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (alarm_m_spin), GTK_UPDATE_IF_VALID);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (alarm_m_spin), TRUE);
 
-  label77 = gtk_label_new ("h");
+  label77 = gtk_label_new (_("h"));
   gtk_widget_set_name (label77, "label77");
   gtk_widget_ref (label77);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label77", label77,
@@ -551,7 +553,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (0), 0, 0);
 
-  label79 = gtk_label_new ("Quiet after:");
+  label79 = gtk_label_new (_("Quiet after:"));
   gtk_widget_set_name (label79, "label79");
   gtk_widget_ref (label79);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label79", label79,
@@ -561,7 +563,7 @@
   gtk_label_set_justify (GTK_LABEL (label79), GTK_JUSTIFY_LEFT);
   gtk_misc_set_alignment (GTK_MISC (label79), 0, 0.5);
 
-  label80 = gtk_label_new ("Alarm at (default):");
+  label80 = gtk_label_new (_("Alarm at (default):"));
   gtk_widget_set_name (label80, "label80");
   gtk_widget_ref (label80);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label80", label80,
@@ -573,7 +575,7 @@
   gtk_label_set_justify (GTK_LABEL (label80), GTK_JUSTIFY_LEFT);
   gtk_misc_set_alignment (GTK_MISC (label80), 0, 0.5);
 
-  label71 = gtk_label_new ("Time");
+  label71 = gtk_label_new (_("Time"));
   gtk_widget_set_name (label71, "label71");
   gtk_widget_ref (label71);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label71", label71,
@@ -581,7 +583,7 @@
   gtk_widget_show (label71);
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label71);
 
-  frame15 = gtk_frame_new ("Choose the days for the alarm to come on");
+  frame15 = gtk_frame_new (_("Choose the days for the alarm to come on"));
   gtk_widget_set_name (frame15, "frame15");
   gtk_widget_ref (frame15);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame15", frame15,
@@ -609,7 +611,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  mon_def = gtk_check_button_new_with_label ("Default");
+  mon_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (mon_def, "mon_def");
   gtk_widget_ref (mon_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "mon_def", mon_def,
@@ -628,7 +630,7 @@
   gtk_box_pack_start (GTK_BOX (hbox31), mon_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (mon_h), TRUE);
 
-  label89 = gtk_label_new (":");
+  label89 = gtk_label_new (_(":"));
   gtk_widget_set_name (label89, "label89");
   gtk_widget_ref (label89);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label89", label89,
@@ -657,7 +659,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  tue_def = gtk_check_button_new_with_label ("Default");
+  tue_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (tue_def, "tue_def");
   gtk_widget_ref (tue_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "tue_def", tue_def,
@@ -676,7 +678,7 @@
   gtk_box_pack_start (GTK_BOX (hbox32), tue_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (tue_h), TRUE);
 
-  label90 = gtk_label_new (":");
+  label90 = gtk_label_new (_(":"));
   gtk_widget_set_name (label90, "label90");
   gtk_widget_ref (label90);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label90", label90,
@@ -705,7 +707,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  wed_def = gtk_check_button_new_with_label ("Default");
+  wed_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (wed_def, "wed_def");
   gtk_widget_ref (wed_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "wed_def", wed_def,
@@ -724,7 +726,7 @@
   gtk_box_pack_start (GTK_BOX (hbox33), wed_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (wed_h), TRUE);
 
-  label91 = gtk_label_new (":");
+  label91 = gtk_label_new (_(":"));
   gtk_widget_set_name (label91, "label91");
   gtk_widget_ref (label91);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label91", label91,
@@ -753,7 +755,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  thu_def = gtk_check_button_new_with_label ("Default");
+  thu_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (thu_def, "thu_def");
   gtk_widget_ref (thu_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "thu_def", thu_def,
@@ -772,7 +774,7 @@
   gtk_box_pack_start (GTK_BOX (hbox34), thu_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (thu_h), TRUE);
 
-  label92 = gtk_label_new (":");
+  label92 = gtk_label_new (_(":"));
   gtk_widget_set_name (label92, "label92");
   gtk_widget_ref (label92);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label92", label92,
@@ -801,7 +803,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  fri_def = gtk_check_button_new_with_label ("Default");
+  fri_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (fri_def, "fri_def");
   gtk_widget_ref (fri_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "fri_def", fri_def,
@@ -820,7 +822,7 @@
   gtk_box_pack_start (GTK_BOX (hbox35), fri_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fri_h), TRUE);
 
-  label93 = gtk_label_new (":");
+  label93 = gtk_label_new (_(":"));
   gtk_widget_set_name (label93, "label93");
   gtk_widget_ref (label93);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label93", label93,
@@ -849,7 +851,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  sat_def = gtk_check_button_new_with_label ("Default");
+  sat_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (sat_def, "sat_def");
   gtk_widget_ref (sat_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "sat_def", sat_def,
@@ -868,7 +870,7 @@
   gtk_box_pack_start (GTK_BOX (hbox36), sat_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (sat_h), TRUE);
 
-  label94 = gtk_label_new (":");
+  label94 = gtk_label_new (_(":"));
   gtk_widget_set_name (label94, "label94");
   gtk_widget_ref (label94);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label94", label94,
@@ -897,7 +899,7 @@
                     (GtkAttachOptions) (GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
 
-  sun_def = gtk_check_button_new_with_label ("Default");
+  sun_def = gtk_check_button_new_with_label (_("Default"));
   gtk_widget_set_name (sun_def, "sun_def");
   gtk_widget_ref (sun_def);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "sun_def", sun_def,
@@ -916,7 +918,7 @@
   gtk_box_pack_start (GTK_BOX (hbox37), sun_h, TRUE, TRUE, 0);
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (sun_h), TRUE);
 
-  label95 = gtk_label_new (":");
+  label95 = gtk_label_new (_(":"));
   gtk_widget_set_name (label95, "label95");
   gtk_widget_ref (label95);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label95", label95,
@@ -935,7 +937,7 @@
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (sun_m), TRUE);
   gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (sun_m), TRUE);
 
-  label87 = gtk_label_new ("Day");
+  label87 = gtk_label_new (_("Day"));
   gtk_widget_set_name (label87, "label87");
   gtk_widget_ref (label87);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label87", label87,
@@ -945,7 +947,7 @@
                     (GtkAttachOptions) (0),
                     (GtkAttachOptions) (0), 0, 0);
 
-  label88 = gtk_label_new ("Time");
+  label88 = gtk_label_new (_("Time"));
   gtk_widget_set_name (label88, "label88");
   gtk_widget_ref (label88);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label88", label88,
@@ -955,7 +957,7 @@
                     (GtkAttachOptions) (0),
                     (GtkAttachOptions) (0), 0, 0);
 
-  tue_cb = gtk_check_button_new_with_label ("Tuesday");
+  tue_cb = gtk_check_button_new_with_label (_("Tuesday"));
   gtk_widget_set_name (tue_cb, "tue_cb");
   gtk_widget_ref (tue_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "tue_cb", tue_cb,
@@ -966,7 +968,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tue_cb), TRUE);
 
-  wed_cb = gtk_check_button_new_with_label ("Wednesday");
+  wed_cb = gtk_check_button_new_with_label (_("Wednesday"));
   gtk_widget_set_name (wed_cb, "wed_cb");
   gtk_widget_ref (wed_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "wed_cb", wed_cb,
@@ -977,7 +979,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wed_cb), TRUE);
 
-  thu_cb = gtk_check_button_new_with_label ("Thursday");
+  thu_cb = gtk_check_button_new_with_label (_("Thursday"));
   gtk_widget_set_name (thu_cb, "thu_cb");
   gtk_widget_ref (thu_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "thu_cb", thu_cb,
@@ -988,7 +990,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (thu_cb), TRUE);
 
-  fri_cb = gtk_check_button_new_with_label ("Friday");
+  fri_cb = gtk_check_button_new_with_label (_("Friday"));
   gtk_widget_set_name (fri_cb, "fri_cb");
   gtk_widget_ref (fri_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "fri_cb", fri_cb,
@@ -999,7 +1001,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fri_cb), TRUE);
 
-  sat_cb = gtk_check_button_new_with_label ("Saturday");
+  sat_cb = gtk_check_button_new_with_label (_("Saturday"));
   gtk_widget_set_name (sat_cb, "sat_cb");
   gtk_widget_ref (sat_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "sat_cb", sat_cb,
@@ -1010,7 +1012,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sat_cb), TRUE);
 
-  sun_cb = gtk_check_button_new_with_label ("Sunday");
+  sun_cb = gtk_check_button_new_with_label (_("Sunday"));
   gtk_widget_set_name (sun_cb, "sun_cb");
   gtk_widget_ref (sun_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "sun_cb", sun_cb,
@@ -1020,7 +1022,7 @@
                     (GtkAttachOptions) (0),
                     (GtkAttachOptions) (0), 0, 0);
 
-  mon_cb = gtk_check_button_new_with_label ("Monday");
+  mon_cb = gtk_check_button_new_with_label (_("Monday"));
   gtk_widget_set_name (mon_cb, "mon_cb");
   gtk_widget_ref (mon_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "mon_cb", mon_cb,
@@ -1031,7 +1033,7 @@
                     (GtkAttachOptions) (0), 0, 0);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mon_cb), TRUE);
 
-  label72 = gtk_label_new ("Days");
+  label72 = gtk_label_new (_("Days"));
   gtk_widget_set_name (label72, "label72");
   gtk_widget_ref (label72);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label72", label72,
@@ -1047,7 +1049,7 @@
   gtk_widget_show (vbox8);
   gtk_container_add (GTK_CONTAINER (notebook1), vbox8);
 
-  frame11 = gtk_frame_new ("Fading");
+  frame11 = gtk_frame_new (_("Fading"));
   gtk_widget_set_name (frame11, "frame11");
   gtk_widget_ref (frame11);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame11", frame11,
@@ -1084,7 +1086,7 @@
   gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (fading_spin), TRUE);
   gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (fading_spin), GTK_UPDATE_IF_VALID);
 
-  label81 = gtk_label_new ("seconds");
+  label81 = gtk_label_new (_("seconds"));
   gtk_widget_set_name (label81, "label81");
   gtk_widget_ref (label81);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label81", label81,
@@ -1092,7 +1094,7 @@
   gtk_widget_show (label81);
   gtk_box_pack_start (GTK_BOX (hbox25), label81, FALSE, TRUE, 0);
 
-  frame12 = gtk_frame_new ("Volume");
+  frame12 = gtk_frame_new (_("Volume"));
   gtk_widget_set_name (frame12, "frame12");
   gtk_widget_ref (frame12);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame12", frame12,
@@ -1118,16 +1120,16 @@
   gtk_widget_show (alignment11);
   gtk_box_pack_end (GTK_BOX (vbox9), alignment11, FALSE, FALSE, 0);
 
-  current_button = gtk_button_new_with_label ("Current");
+  current_button = gtk_button_new_with_label (_("Current"));
   gtk_widget_set_name (current_button, "current_button");
   gtk_widget_ref (current_button);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "current_button", current_button,
                             (GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (current_button);
   gtk_container_add (GTK_CONTAINER (alignment11), current_button);
-  gtk_tooltips_set_tip (tooltips, current_button, "reset to current output volume", NULL);
+  gtk_tooltips_set_tip (tooltips, current_button, _("reset to current output volume"), NULL);
 
-  label82 = gtk_label_new ("Start at");
+  label82 = gtk_label_new (_("Start at"));
   gtk_widget_set_name (label82, "label82");
   gtk_widget_ref (label82);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label82", label82,
@@ -1171,7 +1173,7 @@
   gtk_widget_show (hseparator2);
   gtk_box_pack_start (GTK_BOX (vbox9), hseparator2, TRUE, TRUE, 0);
 
-  label84 = gtk_label_new ("Final");
+  label84 = gtk_label_new (_("Final"));
   gtk_widget_set_name (label84, "label84");
   gtk_widget_ref (label84);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label84", label84,
@@ -1208,7 +1210,7 @@
   gtk_box_pack_start (GTK_BOX (hbox27), label85, FALSE, TRUE, 0);
   gtk_label_set_justify (GTK_LABEL (label85), GTK_JUSTIFY_FILL);
 
-  label73 = gtk_label_new ("Volume");
+  label73 = gtk_label_new (_("Volume"));
   gtk_widget_set_name (label73, "label73");
   gtk_widget_ref (label73);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label73", label73,
@@ -1224,7 +1226,7 @@
   gtk_widget_show (vbox10);
   gtk_container_add (GTK_CONTAINER (notebook1), vbox10);
 
-  frame13 = gtk_frame_new ("Additional Command");
+  frame13 = gtk_frame_new (_("Additional Command"));
   gtk_widget_set_name (frame13, "frame13");
   gtk_widget_ref (frame13);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame13", frame13,
@@ -1250,7 +1252,7 @@
   gtk_widget_show (cmd_entry);
   gtk_box_pack_start (GTK_BOX (hbox28), cmd_entry, TRUE, TRUE, 0);
 
-  cmd_checkb = gtk_check_button_new_with_label ("enable");
+  cmd_checkb = gtk_check_button_new_with_label (_("enable"));
   gtk_widget_set_name (cmd_checkb, "cmd_checkb");
   gtk_widget_ref (cmd_checkb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "cmd_checkb", cmd_checkb,
@@ -1258,7 +1260,7 @@
   gtk_widget_show (cmd_checkb);
   gtk_box_pack_start (GTK_BOX (hbox28), cmd_checkb, FALSE, FALSE, 0);
 
-  frame14 = gtk_frame_new ("Playlist (optional)");
+  frame14 = gtk_frame_new (_("Playlist (optional)"));
   gtk_widget_set_name (frame14, "frame14");
   gtk_widget_ref (frame14);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame14", frame14,
@@ -1284,7 +1286,7 @@
   gtk_widget_show (playlist);
   gtk_box_pack_start (GTK_BOX (hbox29), playlist, TRUE, TRUE, 0);
 
-  playlist_browse_button = gtk_button_new_with_label ("Browse...");
+  playlist_browse_button = gtk_button_new_with_label (_("Browse..."));
   gtk_widget_set_name (playlist_browse_button, "playlist_browse_button");
   gtk_widget_ref (playlist_browse_button);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "playlist_browse_button", playlist_browse_button,
@@ -1292,7 +1294,7 @@
   gtk_widget_show (playlist_browse_button);
   gtk_box_pack_start (GTK_BOX (hbox29), playlist_browse_button, FALSE, FALSE, 0);
 
-  frame18 = gtk_frame_new ("Reminder");
+  frame18 = gtk_frame_new (_("Reminder"));
   gtk_widget_set_name (frame18, "frame18");
   gtk_widget_ref (frame18);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame18", frame18,
@@ -1309,7 +1311,7 @@
   gtk_widget_show (hbox38);
   gtk_container_add (GTK_CONTAINER (frame18), hbox38);
 
-  reminder_cb = gtk_check_button_new_with_label ("Use reminder");
+  reminder_cb = gtk_check_button_new_with_label (_("Use reminder"));
   gtk_widget_set_name (reminder_cb, "reminder_cb");
   gtk_widget_ref (reminder_cb);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "reminder_cb", reminder_cb,
@@ -1325,7 +1327,7 @@
   gtk_widget_show (reminder_text);
   gtk_box_pack_start (GTK_BOX (hbox38), reminder_text, TRUE, TRUE, 5);
 
-  label74 = gtk_label_new ("Options");
+  label74 = gtk_label_new (_("Options"));
   gtk_widget_set_name (label74, "label74");
   gtk_widget_ref (label74);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label74", label74,
@@ -1333,7 +1335,7 @@
   gtk_widget_show (label74);
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label74);
 
-  frame16 = gtk_frame_new ("What do these options mean?");
+  frame16 = gtk_frame_new (_("What do these options mean?"));
   gtk_widget_set_name (frame16, "frame16");
   gtk_widget_ref (frame16);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "frame16", frame16,
@@ -1361,9 +1363,9 @@
   gtk_widget_show (text1);
   gtk_container_add (GTK_CONTAINER (scrolledwindow1), text1);
   gtk_text_buffer_insert (text1buffer, &iter,
-                   "Time\n  Alarm at: \n    The time for the alarm to come on.\n\n  Quiet After: \n    Stop alarm after this amount of time.\n       (if the wakeup dialog is not closed)\n\n\nDays\n  Day:\n    Select the days for the alarm to activate.\n\n  Time:\n    Choose the time for the alarm on each day,\n    or select the toggle button to use the default\n    time.\n\n\nVolume\n  Fading: \n    Fade the volume up to the chosen volume \n    for this amount of time.\n\n  Start at: \n    Start fading from this volume.\n\n  Final: \n    The volume to stop fading at.  If the fading\n    time is 0 then set volume to this and start\n    playing.\n\n\nOptions:\n  Additional Command:\n    Run this command at the alarm time.\n\n  Playlist: \n    Load this playlist for playing songs from \n    (must have .m3u extension).  If no playlist\n    is given then the songs which are currently\n    in the list will be used.\n    The URL of an mp3/ogg stream can also be\n    entered here, but loading of playlists from\n    URLs is not currently supported by xmms.\n\n  Reminder:\n    Display a reminder when the alarm goes off,\n    type the reminder in the box and turn on the\n    toggle button if you want it to be shown.", 1143);
+                   _("\nTime\n  Alarm at: \n    The time for the alarm to come on.\n\n  Quiet After: \n    Stop alarm after this amount of time.\n       (if the wakeup dialog is not closed)\n\n\nDays\n  Day:\n    Select the days for the alarm to activate.\n\n  Time:\n    Choose the time for the alarm on each day,\n    or select the toggle button to use the default\n    time.\n\n\nVolume\n  Fading: \n    Fade the volume up to the chosen volume \n    for this amount of time.\n\n  Start at: \n    Start fading from this volume.\n\n  Final: \n    The volume to stop fading at.  If the fading\n    time is 0 then set volume to this and start\n    playing.\n\n\nOptions:\n  Additional Command:\n    Run this command at the alarm time.\n\n  Playlist: \n    Load this playlist for playing songs from \n    (must have .m3u extension).  If no playlist\n    is given then the songs which are currently\n    in the list will be used.\n    The URL of an mp3/ogg stream can also be\n    entered here, but loading of playlists from\n    URLs is not currently supported by xmms.\n\n  Reminder:\n    Display a reminder when the alarm goes off,\n    type the reminder in the box and turn on the\n    toggle button if you want it to be shown.\n"), -1);
 
-  label86 = gtk_label_new ("Help");
+  label86 = gtk_label_new (_("Help"));
   gtk_widget_set_name (label86, "label86");
   gtk_widget_ref (label86);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "label86", label86,
@@ -1386,7 +1388,7 @@
   gtk_box_pack_start (GTK_BOX (dialog_action_area5), hbox20, TRUE, TRUE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (hbox20), 10);
 
-  ok_button = gtk_button_new_with_label ("OK");
+  ok_button = gtk_button_new_with_label (_("OK"));
   gtk_widget_set_name (ok_button, "ok_button");
   gtk_widget_ref (ok_button);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "ok_button", ok_button,
@@ -1395,7 +1397,7 @@
   gtk_box_pack_start (GTK_BOX (hbox20), ok_button, FALSE, TRUE, 0);
   GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT);
 
-  cancel_button = gtk_button_new_with_label ("Cancel");
+  cancel_button = gtk_button_new_with_label (_("Cancel"));
   gtk_widget_set_name (cancel_button, "cancel_button");
   gtk_widget_ref (cancel_button);
   gtk_object_set_data_full (GTK_OBJECT (config_dialog), "cancel_button", cancel_button,
@@ -1457,7 +1459,7 @@
   reminder_dialog = gtk_dialog_new ();
   gtk_widget_set_name (reminder_dialog, "reminder_dialog");
   gtk_object_set_data (GTK_OBJECT (reminder_dialog), "reminder_dialog", reminder_dialog);
-  gtk_window_set_title (GTK_WINDOW (reminder_dialog), "Reminder");
+  gtk_window_set_title (GTK_WINDOW (reminder_dialog), _("Reminder"));
   gtk_window_set_policy (GTK_WINDOW (reminder_dialog), TRUE, TRUE, FALSE);
 
   dialog_vbox6 = GTK_DIALOG (reminder_dialog)->vbox;
--- a/src/amidi-plug/amidi-plug.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/amidi-plug.c	Thu Jul 19 00:50:01 2007 +0000
@@ -24,7 +24,7 @@
 
 DECLARE_PLUGIN(amidi-plug, NULL, NULL, amidiplug_iplist, NULL, NULL, NULL, NULL);
 
-static gboolean amidiplug_detect_by_content( gchar * filename , VFSFile * fp )
+static gboolean amidiplug_detect_by_content( gchar * filename_uri , VFSFile * fp )
 {
   gchar magic_bytes[4];
   gint res = 0;
@@ -37,7 +37,7 @@
 
   if ( !strncmp( magic_bytes , "MThd" , 4 ) )
   {
-    DEBUGMSG( "MIDI found, %s is a standard midi file\n" , filename );
+    DEBUGMSG( _("MIDI found, %s is a standard midi file\n") , filename_uri );
     return TRUE;
   }
 
@@ -53,7 +53,7 @@
 
     if ( !strncmp( magic_bytes , "RMID" , 4 ) )
     {
-      DEBUGMSG( "MIDI found, %s is a riff midi file\n" , filename );
+      DEBUGMSG( _("MIDI found, %s is a riff midi file\n") , filename_uri );
       return TRUE;
     }
   }
@@ -62,33 +62,33 @@
 }
 
 
-static gint amidiplug_is_our_file( gchar * filename )
+static gint amidiplug_is_our_file( gchar * filename_uri )
 {
   VFSFile * fp;
   gboolean result = FALSE;
 
-  fp = VFS_FOPEN( filename , "rb" );
+  fp = VFS_FOPEN( filename_uri , "rb" );
 
   if ( fp == NULL )
     return FALSE;
 
-  result = amidiplug_detect_by_content( filename , fp );
+  result = amidiplug_detect_by_content( filename_uri , fp );
   VFS_FCLOSE( fp );
 
   return result;
 }
 
 
-static gint amidiplug_is_our_file_from_vfs( gchar *filename , VFSFile *fp )
+static gint amidiplug_is_our_file_from_vfs( gchar *filename_uri , VFSFile *fp )
 {
-  return amidiplug_detect_by_content( filename , fp );
+  return amidiplug_detect_by_content( filename_uri , fp );
 }
 
 
 static void amidiplug_init( void )
 {
   g_log_set_handler(NULL , G_LOG_LEVEL_WARNING , g_log_default_handler , NULL);
-  DEBUGMSG( "init, read configuration\n" );
+  DEBUGMSG( _("init, read configuration\n") );
   /* read configuration for amidi-plug */
   i_configure_cfg_ap_read();
   amidiplug_playing_status = AMIDIPLUG_STOP;
@@ -107,7 +107,7 @@
 static void amidiplug_configure( void )
 {
   /* display the nice config dialog */
-  DEBUGMSG( "opening config system\n" );
+  DEBUGMSG( _("opening config system\n") );
   i_configure_gui();
 }
 
@@ -118,15 +118,15 @@
 }
 
 
-static void amidiplug_file_info_box( gchar * filename )
+static void amidiplug_file_info_box( gchar * filename_uri )
 {
-  i_fileinfo_gui( filename );
+  i_fileinfo_gui( filename_uri );
 }
 
 
 static void amidiplug_stop( InputPlayback * playback )
 {
-  DEBUGMSG( "STOP request at tick: %i\n" , midifile.playing_tick );
+  DEBUGMSG( _("STOP request at tick: %i\n") , midifile.playing_tick );
   pthread_mutex_lock( &amidiplug_playing_mutex );
   if (( amidiplug_playing_status == AMIDIPLUG_PLAY ) ||
       ( amidiplug_playing_status == AMIDIPLUG_STOP ))
@@ -136,17 +136,17 @@
     pthread_join( amidiplug_play_thread , NULL );
     if ( backend.autonomous_audio == FALSE )
       pthread_join( amidiplug_audio_thread , NULL );
-    DEBUGMSG( "STOP activated (play thread joined)\n" );
+    DEBUGMSG( _("STOP activated (play thread joined)\n") );
   }
   else if ( amidiplug_playing_status == AMIDIPLUG_PAUSE )
   {
     amidiplug_playing_status = AMIDIPLUG_STOP;
-    DEBUGMSG( "STOP activated (from PAUSE to STOP)\n" );
+    DEBUGMSG( _("STOP activated (from PAUSE to STOP)\n") );
     pthread_mutex_unlock( &amidiplug_playing_mutex );
   }
   else /* AMIDIPLUG_ERR */
   {
-    DEBUGMSG( "STOP activated (in error handling, ok)\n" );
+    DEBUGMSG( _("STOP activated (in error handling, ok)\n") );
     pthread_mutex_unlock( &amidiplug_playing_mutex );
   }
 
@@ -162,7 +162,7 @@
   /* close audio if current backend works with output plugin */
   if (( backend.gmodule != NULL ) && ( backend.autonomous_audio == FALSE ))
   {
-    DEBUGMSG( "STOP activated, closing audio output plugin\n" );
+    DEBUGMSG( _("STOP activated, closing audio output plugin\n") );
     playback->output->buffer_free();
     playback->output->buffer_free();
     playback->output->close_audio();
@@ -176,7 +176,7 @@
 {
   if ( paused )
   {
-    DEBUGMSG( "PAUSE request at tick: %i\n" , midifile.playing_tick );
+    DEBUGMSG( _("PAUSE request at tick: %i\n") , midifile.playing_tick );
     pthread_mutex_lock( &amidiplug_playing_mutex );
     /* this cond is used to avoid race conditions */
     while ( amidiplug_playing_status != AMIDIPLUG_PLAY )
@@ -187,7 +187,7 @@
     pthread_join( amidiplug_play_thread , NULL );
     if ( backend.autonomous_audio == FALSE )
       pthread_join( amidiplug_audio_thread , NULL );
-    DEBUGMSG( "PAUSE activated (play thread joined)\n" , midifile.playing_tick );
+    DEBUGMSG( _("PAUSE activated (play thread joined)\n") , midifile.playing_tick );
 
     if ( backend.autonomous_audio == FALSE )
       playback->output->pause(paused);
@@ -197,7 +197,7 @@
   }
   else
   {
-    DEBUGMSG( "PAUSE deactivated, returning to tick %i\n" , midifile.playing_tick );
+    DEBUGMSG( _("PAUSE deactivated, returning to tick %i\n") , midifile.playing_tick );
     /* revive the sequencer */
     backend.seq_on();
     /* re-set initial tempo */
@@ -211,7 +211,7 @@
 
     pthread_mutex_lock( &amidiplug_playing_mutex );
     /* play play play! */
-    DEBUGMSG( "PAUSE deactivated, starting play thread again\n" );
+    DEBUGMSG( _("PAUSE deactivated, starting play thread again\n") );
     pthread_create(&amidiplug_play_thread, NULL, amidiplug_play_loop, playback);
     /* this cond is used to avoid race conditions */
     while ( amidiplug_playing_status != AMIDIPLUG_PLAY )
@@ -223,7 +223,7 @@
 
 static void amidiplug_seek( InputPlayback * playback, gint time )
 {
-  DEBUGMSG( "SEEK requested (time %i), pausing song...\n" , time );
+  DEBUGMSG( _("SEEK requested (time %i), pausing song...\n") , time );
   pthread_mutex_lock( &amidiplug_playing_mutex );
   /* this cond is used to avoid race conditions */
   while ( amidiplug_playing_status != AMIDIPLUG_PLAY )
@@ -234,7 +234,7 @@
   pthread_join( amidiplug_play_thread , NULL );
   if ( backend.autonomous_audio == FALSE )
     pthread_join( amidiplug_audio_thread , NULL );
-  DEBUGMSG( "SEEK requested (time %i), song paused\n" , time );
+  DEBUGMSG( _("SEEK requested (time %i), song paused\n") , time );
   /* kill the sequencer */
   backend.seq_off();
   /* revive the sequencer */
@@ -243,7 +243,7 @@
   i_midi_setget_tempo( &midifile );
   backend.seq_queue_tempo( midifile.current_tempo , midifile.ppq );
   /* get back to the previous state */
-  DEBUGMSG( "SEEK requested (time %i), moving to tick %i of %i\n" ,
+  DEBUGMSG( _("SEEK requested (time %i), moving to tick %i of %i\n") ,
             time , (gint)((time * 1000000) / midifile.avg_microsec_per_tick) , midifile.max_tick );
   midifile.playing_tick = (gint)((time * 1000000) / midifile.avg_microsec_per_tick);
   amidiplug_skipto( midifile.playing_tick );
@@ -252,7 +252,7 @@
     playback->output->flush(time * 1000);
 
   /* play play play! */
-  DEBUGMSG( "SEEK done, starting play thread again\n" );
+  DEBUGMSG( _("SEEK done, starting play thread again\n") );
   pthread_create(&amidiplug_play_thread, NULL, amidiplug_play_loop, playback);
 }
 
@@ -272,13 +272,13 @@
     else if ( amidiplug_playing_status == AMIDIPLUG_STOP )
     {
       pthread_mutex_unlock( &amidiplug_playing_mutex );
-      DEBUGMSG( "GETTIME on stopped song, returning -1\n" , time );
+      DEBUGMSG( _("GETTIME on stopped song, returning -1\n") , time );
       return -1;
     }
     else /* AMIDIPLUG_ERR */
     {
       pthread_mutex_unlock( &amidiplug_playing_mutex );
-      DEBUGMSG( "GETTIME on halted song (an error occurred?), returning -1 and stopping the player\n" );
+      DEBUGMSG( _("GETTIME on halted song (an error occurred?), returning -1 and stopping the player\n") );
       audacious_drct_stop();
       return -1;
     }
@@ -299,13 +299,13 @@
     else if ( amidiplug_playing_status == AMIDIPLUG_STOP )
     {
       pthread_mutex_unlock( &amidiplug_playing_mutex );
-      DEBUGMSG( "GETTIME on stopped song, returning -1\n" , time );
+      DEBUGMSG( _("GETTIME on stopped song, returning -1\n") , time );
       return -1;
     }
     else /* AMIDIPLUG_ERR */
     {
       pthread_mutex_unlock( &amidiplug_playing_mutex );
-      DEBUGMSG( "GETTIME on halted song (an error occurred?), returning -1 and stopping the player\n" , time );
+      DEBUGMSG( _("GETTIME on halted song (an error occurred?), returning -1 and stopping the player\n") , time );
       audacious_drct_stop();
       return -1;
     }
@@ -335,10 +335,13 @@
 }
 
 
-static void amidiplug_get_song_info( gchar * filename , gchar ** title , gint * length )
+static void amidiplug_get_song_info( gchar * filename_uri , gchar ** title , gint * length )
 {
   /* song title, get it from the filename */
-  *title = G_PATH_GET_BASENAME(filename);
+  gchar * filename = g_filename_from_uri( filename_uri , NULL , NULL );
+  if ( !filename ) filename = g_strdup( filename_uri );
+  *title = G_PATH_GET_BASENAME(filename_uri);
+  g_free( filename );
 
   /* sure, it's possible to calculate the length of a MIDI file anytime,
      but the file must be entirely parsed to calculate it; this could
@@ -349,7 +352,7 @@
        will return 0 if a problem occurs and the length can't be calculated */
     midifile_t mf;
 
-    if ( i_midi_parse_from_filename( filename , &mf ) )
+    if ( i_midi_parse_from_filename( filename_uri , &mf ) )
       *length = (gint)(mf.length / 1000);
     else
       *length = -1;
@@ -363,15 +366,16 @@
 }
 
 
-static void amidiplug_play( InputPlayback * playback)
+static void amidiplug_play( InputPlayback * playback )
 {
-  gchar * filename = playback->filename;
+  gchar * filename_uri = playback->filename;
+  gchar * filename = NULL;
   gint port_count = 0;
   gint au_samplerate = -1, au_bitdepth = -1, au_channels = -1;
 
   if ( backend.gmodule == NULL )
   {
-    g_warning( "No sequencer backend selected\n" );
+    g_warning( _("No sequencer backend selected\n") );
     i_message_gui( _("AMIDI-Plug - warning") ,
                    _("No sequencer backend has been selected!\nPlease configure AMIDI-Plug before playing.") ,
                    AMIDIPLUG_MESSAGE_WARN , NULL , TRUE );
@@ -381,16 +385,16 @@
 
   /* get information about audio from backend, if available */
   backend.audio_info_get( &au_channels , &au_bitdepth , &au_samplerate );
-  DEBUGMSG( "PLAY requested, audio details: channels -> %i , bitdepth -> %i , samplerate -> %i\n" ,
+  DEBUGMSG( _("PLAY requested, audio details: channels -> %i , bitdepth -> %i , samplerate -> %i\n") ,
             au_channels , au_bitdepth , au_samplerate );
 
   if ( backend.autonomous_audio == FALSE )
   {
-    DEBUGMSG( "PLAY requested, opening audio output plugin\n" );
+    DEBUGMSG( _("PLAY requested, opening audio output plugin\n") );
     playback->output->open_audio( FMT_S16_NE , au_samplerate , au_channels );
   }
 
-  DEBUGMSG( "PLAY requested, midifile init\n" );
+  DEBUGMSG( _("PLAY requested, midifile init\n") );
   /* midifile init */
   i_midi_init( &midifile );
 
@@ -398,77 +402,81 @@
   port_count = backend.seq_get_port_count();
   if ( port_count < 1 )
   {
-    g_warning( "No ports selected\n" );
+    g_warning( _("No ports selected\n") );
     amidiplug_playing_status = AMIDIPLUG_ERR;
     return;
   }
 
-  DEBUGMSG( "PLAY requested, opening file: %s\n" , filename );
-  midifile.file_pointer = VFS_FOPEN( filename , "rb" );
+  DEBUGMSG( _("PLAY requested, opening file: %s\n") , filename_uri );
+  midifile.file_pointer = VFS_FOPEN( filename_uri , "rb" );
   if (!midifile.file_pointer)
   {
-    g_warning( "Cannot open %s\n" , filename );
+    g_warning( _("Cannot open %s\n") , filename_uri );
     amidiplug_playing_status = AMIDIPLUG_ERR;
     return;
   }
-  midifile.file_name = filename;
+  midifile.file_name = filename_uri;
 
   switch( i_midi_file_read_id( &midifile ) )
   {
     case MAKE_ID('R', 'I', 'F', 'F'):
     {
-      DEBUGMSG( "PLAY requested, RIFF chunk found, processing...\n" );
+      DEBUGMSG( _("PLAY requested, RIFF chunk found, processing...\n") );
       /* read riff chunk */
       if ( !i_midi_file_parse_riff( &midifile ) )
-        WARNANDBREAKANDPLAYERR( "%s: invalid file format (riff parser)\n" , filename );
+        WARNANDBREAKANDPLAYERR( _("%s: invalid file format (riff parser)\n") , filename_uri );
 
       /* if that was read correctly, go ahead and read smf data */
     }
 
     case MAKE_ID('M', 'T', 'h', 'd'):
     {
-      DEBUGMSG( "PLAY requested, MThd chunk found, processing...\n" );
+      DEBUGMSG( _("PLAY requested, MThd chunk found, processing...\n") );
       if ( !i_midi_file_parse_smf( &midifile , port_count ) )
-        WARNANDBREAKANDPLAYERR( "%s: invalid file format (smf parser)\n" , filename );
+        WARNANDBREAKANDPLAYERR( _("%s: invalid file format (smf parser)\n") , filename_uri );
 
       if ( midifile.time_division < 1 )
-        WARNANDBREAKANDPLAYERR( "%s: invalid time division (%i)\n" , filename , midifile.time_division );
+        WARNANDBREAKANDPLAYERR( _("%s: invalid time division (%i)\n") , filename_uri , midifile.time_division );
 
-      DEBUGMSG( "PLAY requested, setting ppq and tempo...\n" );
+      DEBUGMSG( _("PLAY requested, setting ppq and tempo...\n") );
       /* fill midifile.ppq and midifile.tempo using time_division */
       if ( !i_midi_setget_tempo( &midifile ) )
-        WARNANDBREAKANDPLAYERR( "%s: invalid values while setting ppq and tempo\n" , filename );
+        WARNANDBREAKANDPLAYERR( _("%s: invalid values while setting ppq and tempo\n") , filename_uri );
 
-      DEBUGMSG( "PLAY requested, sequencer start\n" );
+      DEBUGMSG( _("PLAY requested, sequencer start\n") );
       /* sequencer start */
-      if ( !backend.seq_start( filename ) )
-        WARNANDBREAKANDPLAYERR( "%s: problem with seq_start, play aborted\n" , filename );
+      if ( !backend.seq_start( filename_uri ) )
+        WARNANDBREAKANDPLAYERR( _("%s: problem with seq_start, play aborted\n") , filename_uri );
 
-      DEBUGMSG( "PLAY requested, sequencer on\n" );
+      DEBUGMSG( _("PLAY requested, sequencer on\n") );
       /* sequencer on */
       if ( !backend.seq_on() )
-        WARNANDBREAKANDPLAYERR( "%s: problem with seq_on, play aborted\n" , filename );
+        WARNANDBREAKANDPLAYERR( _("%s: problem with seq_on, play aborted\n") , filename_uri );
 
-      DEBUGMSG( "PLAY requested, setting sequencer queue tempo...\n" );
+      DEBUGMSG( _("PLAY requested, setting sequencer queue tempo...\n") );
       /* set sequencer queue tempo using ppq and tempo (call only after i_midi_setget_tempo) */
       if ( !backend.seq_queue_tempo( midifile.current_tempo , midifile.ppq ) )
       {
         backend.seq_off(); /* kill the sequencer */
-        WARNANDBREAKANDPLAYERR( "%s: ALSA queue problem, play aborted\n" , filename );
+        WARNANDBREAKANDPLAYERR( _("%s: ALSA queue problem, play aborted\n") , filename_uri );
       }
 
       /* fill midifile.length, keeping in count tempo-changes */
       i_midi_setget_length( &midifile );
-      DEBUGMSG( "PLAY requested, song length calculated: %i msec\n" , (gint)(midifile.length / 1000) );
+      DEBUGMSG( _("PLAY requested, song length calculated: %i msec\n") , (gint)(midifile.length / 1000) );
+
 
       /* our length is in microseconds, but the player wants milliseconds */
+      filename = g_filename_from_uri( filename_uri , NULL , NULL );
+      if ( !filename ) filename = g_strdup( filename_uri );
       amidiplug_ip.set_info( G_PATH_GET_BASENAME(filename) ,
                              (gint)(midifile.length / 1000) ,
                              au_bitdepth * au_samplerate * au_channels / 8 ,
                              au_samplerate , au_channels );
+      g_free( filename );
 
       /* play play play! */
-      DEBUGMSG( "PLAY requested, starting play thread\n" );
+      DEBUGMSG( _("PLAY requested, starting play thread\n") );
       amidiplug_playing_status = AMIDIPLUG_PLAY;
       pthread_create(&amidiplug_play_thread, NULL, amidiplug_play_loop, playback);
       break;
@@ -477,7 +485,7 @@
     default:
     {
       amidiplug_playing_status = AMIDIPLUG_ERR;
-      g_warning( "%s is not a Standard MIDI File\n" , filename );
+      g_warning( _("%s is not a Standard MIDI File\n") , filename_uri );
       break;
     }
   }
@@ -496,12 +504,12 @@
   pthread_mutex_lock( &amidiplug_playing_mutex );
   if ( amidiplug_playing_status != AMIDIPLUG_PAUSE )
   {
-    DEBUGMSG( "PLAY thread, rewind tracks to their first event\n" );
+    DEBUGMSG( _("PLAY thread, rewind tracks to their first event\n") );
     rewind = TRUE;
   }
   else
   {
-    DEBUGMSG( "PLAY thread, do not rewind tracks to their first event (coming from a PAUSE status)\n" );
+    DEBUGMSG( _("PLAY thread, do not rewind tracks to their first event (coming from a PAUSE status)\n") );
     amidiplug_playing_status = AMIDIPLUG_PLAY;
     pthread_cond_signal( &amidiplug_playing_cond );
   }
@@ -523,7 +531,7 @@
   /* common settings for all our events */
   backend.seq_event_init();
 
-  DEBUGMSG( "PLAY thread, start the play loop\n" );
+  DEBUGMSG( _("PLAY thread, start the play loop\n") );
   for (;;)
   {
     midievent_t * event = NULL;
@@ -547,7 +555,7 @@
     pthread_mutex_lock( &amidiplug_playing_mutex );
     if ( amidiplug_playing_status != AMIDIPLUG_PLAY )
     {
-      DEBUGMSG( "PLAY thread, PAUSE or STOP requested, exiting from play loop\n" );
+      DEBUGMSG( _("PLAY thread, PAUSE or STOP requested, exiting from play loop\n") );
       event = NULL;
     }
     pthread_mutex_unlock( &amidiplug_playing_mutex );
@@ -589,7 +597,7 @@
         break;
       case SND_SEQ_EVENT_TEMPO:
         backend.seq_event_tempo( event );
-        DEBUGMSG( "PLAY thread, processing tempo event with value %i on tick %i\n" ,
+        DEBUGMSG( _("PLAY thread, processing tempo event with value %i on tick %i\n") ,
                   event->data.tempo , event->tick );
         pthread_mutex_lock(&amidiplug_gettime_mutex);
         midifile.current_tempo = event->data.tempo;
@@ -602,7 +610,7 @@
         /* do nothing */
         break;
       default:
-        DEBUGMSG( "PLAY thread, encountered invalid event type %i\n" , event->type );
+        DEBUGMSG( _("PLAY thread, encountered invalid event type %i\n") , event->type );
         break;
     }
 
@@ -623,7 +631,7 @@
   if ( amidiplug_playing_status != AMIDIPLUG_PAUSE )
   {
     amidiplug_playing_status = AMIDIPLUG_STOP;
-    DEBUGMSG( "PLAY thread, song stopped/ended\n" );
+    DEBUGMSG( _("PLAY thread, song stopped/ended\n") );
   }
   pthread_mutex_unlock( &amidiplug_playing_mutex );
 
@@ -651,7 +659,7 @@
   backend.seq_event_init();
   backend.seq_queue_start();
 
-  DEBUGMSG( "SKIPTO request, starting skipto loop\n" );
+  DEBUGMSG( _("SKIPTO request, starting skipto loop\n") );
   for (;;)
   {
     midievent_t * event = NULL;
@@ -674,14 +682,14 @@
     /* unlikely here... unless very strange MIDI files are played :) */
     if (!event)
     {
-      DEBUGMSG( "SKIPTO request, reached the last event but not the requested tick (!)\n" );
+      DEBUGMSG( _("SKIPTO request, reached the last event but not the requested tick (!)\n") );
       break; /* end of song reached */
     }
 
     /* reached the requested tick, job done */
     if ( event->tick >= playing_tick )
     {
-      DEBUGMSG( "SKIPTO request, reached the requested tick, exiting from skipto loop\n" );
+      DEBUGMSG( _("SKIPTO request, reached the requested tick, exiting from skipto loop\n") );
       break;
     }
 
--- a/src/amidi-plug/backend-alsa/b-alsa.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/backend-alsa/b-alsa.c	Thu Jul 19 00:50:01 2007 +0000
@@ -32,7 +32,7 @@
   if ( name != NULL )
     *name = g_strdup( "alsa" );
   if ( longname != NULL )
-    *longname = g_strdup( "ALSA Backend " AMIDIPLUG_VERSION );
+    *longname = g_strjoin( "", _("ALSA Backend "), AMIDIPLUG_VERSION, NULL );
   if ( desc != NULL )
     *desc = g_strdup( _("This backend sends MIDI events to a group of user-chosen "
                         "ALSA sequencer ports. The ALSA sequencer interface is very "
@@ -164,7 +164,7 @@
 
   if ( snd_seq_set_queue_tempo( sc.seq , sc.queue , sc.queue_tempo ) < 0 )
   {
-    g_warning( "Cannot set queue tempo (%u/%i)\n",
+    g_warning( _("Cannot set queue tempo (%u/%i)\n"),
                snd_seq_queue_tempo_get_tempo(sc.queue_tempo),
                snd_seq_queue_tempo_get_ppq(sc.queue_tempo) );
     return 0;
@@ -373,14 +373,14 @@
         snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT , &lc );
         /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */
         *left_volume = (gint)(((lc - pv_min) * 100) / pv_range);
-        DEBUGMSG( "GET VOLUME requested, get left channel (%i)\n" , *left_volume );
+        DEBUGMSG( _("GET VOLUME requested, get left channel (%i)\n") , *left_volume );
       }
       if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) )
       {
         snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT , &rc );
         /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */
         *right_volume = (gint)(((rc - pv_min) * 100) / pv_range);
-        DEBUGMSG( "GET VOLUME requested, get right channel (%i)\n" , *right_volume );
+        DEBUGMSG( _("GET VOLUME requested, get right channel (%i)\n") , *right_volume );
       }
     }
   }
@@ -418,13 +418,13 @@
     {
       if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ) )
       {
-        DEBUGMSG( "SET VOLUME requested, setting left channel to %i%%\n" , left_volume );
+        DEBUGMSG( _("SET VOLUME requested, setting left channel to %i%%\n") , left_volume );
         snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ,
                                              (gint)((gdouble)(0.01 * (gdouble)(left_volume * pv_range)) + pv_min) );
       }
       if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) )
       {
-        DEBUGMSG( "SET VOLUME requested, setting right channel to %i%%\n" , right_volume );
+        DEBUGMSG( _("SET VOLUME requested, setting right channel to %i%%\n") , right_volume );
         snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ,
                                              (gint)((gdouble)(0.01 * (gdouble)(right_volume * pv_range)) + pv_min) );
       }
@@ -803,7 +803,7 @@
         /* remove lf and cr from the end of the string */
         g_strdelimit( &buffer[11] , "\r\n" , '\0' );
         /* ready to go */
-        DEBUGMSG( "init, default values for seq ports detected: %s\n" , &buffer[11] );
+        DEBUGMSG( _("init, default values for seq ports detected: %s\n") , &buffer[11] );
         fclose( fp );
         return g_strdup( &buffer[11] );
       }
--- a/src/amidi-plug/backend-dummy/b-dummy.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/backend-dummy/b-dummy.c	Thu Jul 19 00:50:01 2007 +0000
@@ -32,7 +32,7 @@
   if ( name != NULL )
     *name = g_strdup( "dummy" );
   if ( longname != NULL )
-    *longname = g_strdup( "Dummy Backend " AMIDIPLUG_VERSION );
+    *longname = g_strjoin( "", _("Dummy Backend "), AMIDIPLUG_VERSION, NULL );
   if ( desc != NULL )
     *desc = g_strdup( _("This backend does not produce audio at all. It is mostly "
                         "useful for analysis and testing purposes, as it can log "
@@ -292,7 +292,7 @@
 /* unimplemented (useless for dummy backend) */
 gint audio_volume_get( gint * left_volume , gint * right_volume )
 {
-  return 0; 
+  return 0;
 }
 gint audio_volume_set( gint left_volume , gint right_volume )
 {
--- a/src/amidi-plug/backend-fluidsynth/b-fluidsynth.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/backend-fluidsynth/b-fluidsynth.c	Thu Jul 19 00:50:01 2007 +0000
@@ -32,7 +32,7 @@
   if ( name != NULL )
     *name = g_strdup( "fluidsynth" );
   if ( longname != NULL )
-    *longname = g_strdup( "FluidSynth Backend " AMIDIPLUG_VERSION );
+    *longname = g_strjoin( "", _("FluidSynth Backend "), AMIDIPLUG_VERSION, NULL );
   if ( desc != NULL )
     *desc = g_strdup( _("This backend produces audio by sending MIDI events "
                         "to FluidSynth, a real-time software synthesizer based "
@@ -277,7 +277,7 @@
 gint sequencer_output( gpointer * buffer , gint * len )
 {
   gdouble current_time = g_timer_elapsed( sc.timer_sample , NULL );
-  if (( current_time > 0.000500 ) && 
+  if (( current_time > 0.000500 ) &&
       ( (current_time - sc.last_sample_time) * 1000000 >=
         ((gdouble)amidiplug_cfg_fsyn.fsyn_buffer_size * 1000000 / sc.sample_rate) ))
   {
@@ -311,7 +311,7 @@
    output plugin mixer controls and is not handled by input plugins */
 gint audio_volume_get( gint * left_volume , gint * right_volume )
 {
-  return 0; 
+  return 0;
 }
 gint audio_volume_set( gint left_volume , gint right_volume )
 {
@@ -360,15 +360,15 @@
     while ( sffiles[i] != NULL )
     {
       gint sf_id = 0;
-      DEBUGMSG( "loading soundfont %s\n" , sffiles[i] );
+      DEBUGMSG( _("loading soundfont %s\n") , sffiles[i] );
       sf_id = fluid_synth_sfload( sc.synth , sffiles[i] , 0 );
       if ( sf_id == -1 )
       {
-        g_warning( "unable to load SoundFont file %s\n" , sffiles[i] );
+        g_warning( _("unable to load SoundFont file %s\n") , sffiles[i] );
       }
       else
       {
-        DEBUGMSG( "soundfont %s successfully loaded\n" , sffiles[i] );
+        DEBUGMSG( _("soundfont %s successfully loaded\n") , sffiles[i] );
         g_array_append_val( sc.soundfont_ids , sf_id );
       }
       i++;
@@ -377,7 +377,7 @@
   }
   else
   {
-    g_warning( "FluidSynth backend was selected, but no SoundFont has been specified\n" );
+    g_warning( _("FluidSynth backend was selected, but no SoundFont has been specified\n") );
   }
 }
 
--- a/src/amidi-plug/i_backend.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_backend.c	Thu Jul 19 00:50:01 2007 +0000
@@ -51,7 +51,7 @@
         /* seems to be a backend for amidi-plug , try to load it */
         module = g_module_open( module_pathfilename , G_MODULE_BIND_LOCAL );
         if ( module == NULL )
-          g_warning( "Error loading module %s - %s\n" , module_pathfilename , g_module_error() );
+          g_warning( _("Error loading module %s - %s\n") , module_pathfilename , g_module_error() );
         else
         {
           /* try to get the module name */
@@ -62,14 +62,14 @@
             /* name and desc dinamically allocated */
             getapmoduleinfo( &mn->name , &mn->longname , &mn->desc , &mn->ppos );
             mn->filename = g_strdup(module_pathfilename); /* dinamically allocated */
-            DEBUGMSG( "Backend found and added in list, filename: %s and lname: %s\n" ,
+            DEBUGMSG( _("Backend found and added in list, filename: %s and lname: %s\n") ,
                       mn->filename, mn->longname );
             backend_list = g_slist_append( backend_list , mn );
           }
           else
           {
             /* module name not found, this is not a backend for amidi-plug */
-            g_warning( "File %s is not a backend for amidi-plug!\n" , module_pathfilename );
+            g_warning( _("File %s is not a backend for amidi-plug!\n") , module_pathfilename );
           }
           g_module_close( module );
         }
@@ -79,7 +79,7 @@
     g_dir_close( backend_directory );
   }
   else
-    g_warning( "Unable to open the backend directory %s\n" , AMIDIPLUGBACKENDDIR );
+    g_warning( _("Unable to open the backend directory %s\n") , AMIDIPLUGBACKENDDIR );
 
   return backend_list;
 }
@@ -104,7 +104,7 @@
 gint i_backend_load( gchar * module_name )
 {
   gchar * module_pathfilename = g_strjoin( "" , AMIDIPLUGBACKENDDIR , "/ap-" , module_name , ".so" , NULL );
-  DEBUGMSG( "loading backend '%s'\n" , module_pathfilename );
+  DEBUGMSG( _("loading backend '%s'\n") , module_pathfilename );
   backend.gmodule = g_module_open( module_pathfilename , 0 );
 
   if ( backend.gmodule != NULL )
@@ -140,7 +140,7 @@
     g_module_symbol( backend.gmodule , "audio_check_autonomous" , (gpointer*)&checkautonomousaudio );
     getapmoduleinfo( &backend.name , NULL , NULL , NULL );
     backend.autonomous_audio = checkautonomousaudio();
-    DEBUGMSG( "backend %s (name '%s') successfully loaded\n" , module_pathfilename , backend.name );
+    DEBUGMSG( _("backend %s (name '%s') successfully loaded\n") , module_pathfilename , backend.name );
     backend.init( i_configure_cfg_get_file );
     g_free( module_pathfilename );
     return 1;
@@ -148,7 +148,7 @@
   else
   {
     backend.name = NULL;
-    g_warning( "unable to load backend '%s'\n" , module_pathfilename );
+    g_warning( _("unable to load backend '%s'\n") , module_pathfilename );
     g_free( module_pathfilename );
     return 0;
   }
@@ -159,17 +159,17 @@
 {
   if ( backend.gmodule != NULL )
   {
-    DEBUGMSG( "unloading backend '%s'\n" , backend.name );
+    DEBUGMSG( _("unloading backend '%s'\n") , backend.name );
     backend.cleanup();
     g_module_close( backend.gmodule );
-    DEBUGMSG( "backend '%s' unloaded\n" , backend.name );
+    DEBUGMSG( _("backend '%s' unloaded\n") , backend.name );
     g_free( backend.name );
     backend.gmodule = NULL;
     return 1;
   }
   else
   {
-    g_warning( "attempting to unload backend, but no backend is loaded\n" );
+    g_warning( _("attempting to unload backend, but no backend is loaded\n") );
     return 0;
   }
 }
--- a/src/amidi-plug/i_common.h	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_common.h	Thu Jul 19 00:50:01 2007 +0000
@@ -28,8 +28,8 @@
 #include <strings.h>
 #include <glib.h>
 
-#define _(String) (String)
-#define N_(String) String
+#include <audacious/i18n.h>
+
 #define textdomain(Domain)
 #define bindtextdomain(Package, Directory)
 
@@ -43,7 +43,7 @@
 #endif /* DEBUG */
 
 
-#define AMIDIPLUG_VERSION "0.7++"
+#define AMIDIPLUG_VERSION "0.7p1"
 #define PLAYER_NAME "Audacious"
 #define PLAYER_LOCALRCDIR ".audacious"
 #define G_PATH_GET_BASENAME(x) g_path_get_basename(x)
--- a/src/amidi-plug/i_configure-alsa.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure-alsa.c	Thu Jul 19 00:50:01 2007 +0000
@@ -460,7 +460,7 @@
   pagelabel_image_pix = gdk_pixbuf_new_from_xpm_data( (const gchar **)backend_alsa_icon_xpm );
   pagelabel_image = gtk_image_new_from_pixbuf( pagelabel_image_pix ); g_object_unref( pagelabel_image_pix );
   pagelabel_label = gtk_label_new( "" );
-  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , "<span size=\"smaller\">ALSA\nbackend</span>" );
+  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , _("<span size=\"smaller\">ALSA\nbackend</span>") );
   gtk_label_set_justify( GTK_LABEL(pagelabel_label) , GTK_JUSTIFY_CENTER );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_image , FALSE , FALSE , 1 );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_label , FALSE , FALSE , 1 );
--- a/src/amidi-plug/i_configure-ap.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure-ap.c	Thu Jul 19 00:50:01 2007 +0000
@@ -372,7 +372,7 @@
   pagelabel_image_pix = gdk_pixbuf_new_from_xpm_data( (const gchar **)amidi_plug_icon_xpm );
   pagelabel_image = gtk_image_new_from_pixbuf( pagelabel_image_pix ); g_object_unref( pagelabel_image_pix );
   pagelabel_label = gtk_label_new( "" );
-  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , "<span size=\"smaller\">AMIDI\nPlug</span>" );
+  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , _("<span size=\"smaller\">AMIDI\nPlug</span>") );
   gtk_label_set_justify( GTK_LABEL(pagelabel_label) , GTK_JUSTIFY_CENTER );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_image , FALSE , FALSE , 1 );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_label , FALSE , FALSE , 1 );
--- a/src/amidi-plug/i_configure-dummy.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure-dummy.c	Thu Jul 19 00:50:01 2007 +0000
@@ -345,7 +345,7 @@
   pagelabel_image_pix = gdk_pixbuf_new_from_xpm_data( (const gchar **)backend_dummy_icon_xpm );
   pagelabel_image = gtk_image_new_from_pixbuf( pagelabel_image_pix ); g_object_unref( pagelabel_image_pix );
   pagelabel_label = gtk_label_new( "" );
-  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , "<span size=\"smaller\">Dummy\nbackend</span>" );
+  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , _("<span size=\"smaller\">Dummy\nbackend</span>") );
   gtk_label_set_justify( GTK_LABEL(pagelabel_label) , GTK_JUSTIFY_CENTER );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_image , FALSE , FALSE , 1 );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_label , FALSE , FALSE , 1 );
--- a/src/amidi-plug/i_configure-fluidsynth.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure-fluidsynth.c	Thu Jul 19 00:50:01 2007 +0000
@@ -806,7 +806,7 @@
     gtk_tooltips_set_tip( GTK_TOOLTIPS(tips) , soundfont_file_lv ,
                           _("* Select SoundFont files *\n"
                           "In order to play MIDI with FluidSynth, you need to specify at "
-                          "least one valid SoundFont file here (use absolute paths). The " 
+                          "least one valid SoundFont file here (use absolute paths). The "
                           "loading order is from the top (first) to the bottom (last).") , "" );
     gtk_tooltips_set_tip( GTK_TOOLTIPS(tips) , soundfont_load_option[0] ,
                           _("* Load SoundFont on player start *\n"
@@ -953,7 +953,7 @@
   pagelabel_image_pix = gdk_pixbuf_new_from_xpm_data( (const gchar **)backend_fluidsynth_icon_xpm );
   pagelabel_image = gtk_image_new_from_pixbuf( pagelabel_image_pix ); g_object_unref( pagelabel_image_pix );
   pagelabel_label = gtk_label_new( "" );
-  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , "<span size=\"smaller\">FluidSynth\nbackend</span>" );
+  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , _("<span size=\"smaller\">FluidSynth\nbackend</span>") );
   gtk_label_set_justify( GTK_LABEL(pagelabel_label) , GTK_JUSTIFY_CENTER );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_image , FALSE , FALSE , 1 );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_label , FALSE , FALSE , 1 );
--- a/src/amidi-plug/i_configure-timidity.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure-timidity.c	Thu Jul 19 00:50:01 2007 +0000
@@ -61,7 +61,7 @@
   {
     /* display "not available" information */
     GtkWidget * info_label;
-    info_label = gtk_label_new( "TiMidity Backend not loaded or not available" );
+    info_label = gtk_label_new( _("TiMidity Backend not loaded or not available") );
     gtk_box_pack_start( GTK_BOX(timi_page_vbox) , info_label , FALSE , FALSE , 2 );
   }
 
@@ -80,7 +80,7 @@
   pagelabel_image_pix = gdk_pixbuf_new_from_xpm_data( (const gchar **)backend_timidity_icon_xpm );
   pagelabel_image = gtk_image_new_from_pixbuf( pagelabel_image_pix ); g_object_unref( pagelabel_image_pix );
   pagelabel_label = gtk_label_new( "" );
-  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , "<span size=\"smaller\">TiMidity\nbackend</span>" );
+  gtk_label_set_markup( GTK_LABEL(pagelabel_label) , _("<span size=\"smaller\">TiMidity\nbackend</span>") );
   gtk_label_set_justify( GTK_LABEL(pagelabel_label) , GTK_JUSTIFY_CENTER );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_image , FALSE , FALSE , 1 );
   gtk_box_pack_start( GTK_BOX(pagelabel_vbox) , pagelabel_label , FALSE , FALSE , 1 );
--- a/src/amidi-plug/i_configure.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_configure.c	Thu Jul 19 00:50:01 2007 +0000
@@ -83,7 +83,7 @@
     {
       gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(browse_dialog) );
       gtk_entry_set_text( GTK_ENTRY(target_entry) , filename );
-      DEBUGMSG( "selected file: %s\n" , filename );
+      DEBUGMSG( _("selected file: %s\n") , filename );
       g_free( filename );
     }
     gtk_widget_destroy( browse_dialog );
@@ -109,7 +109,7 @@
 
   if ( configwin != NULL )
   {
-    DEBUGMSG( "config window is already open!\n" );
+    DEBUGMSG( _("config window is already open!\n") );
     return;
   }
 
@@ -255,15 +255,15 @@
 
 void i_configure_ev_bok( GtkWidget * button_ok , gpointer configwin )
 {
-  DEBUGMSG( "saving configuration...\n" );
+  DEBUGMSG( _("saving configuration...\n") );
   i_configure_cfg_ap_save(); /* save amidiplug settings */
   i_configure_cfg_backend_save(); /* save backend settings */
-  DEBUGMSG( "configuration saved\n" );
+  DEBUGMSG( _("configuration saved\n") );
 
   /* check if a different backend has been selected */
   if (( backend.name == NULL ) || ( strcmp( amidiplug_cfg_ap.ap_seq_backend , backend.name ) ))
   {
-    DEBUGMSG( "a new backend has been selected, unloading previous and loading the new one\n" );
+    DEBUGMSG( _("a new backend has been selected, unloading previous and loading the new one\n") );
     i_backend_unload(); /* unload previous backend */
     i_backend_load( amidiplug_cfg_ap.ap_seq_backend ); /* load new backend */
   }
@@ -271,7 +271,7 @@
   {
     if ( backend.gmodule != NULL )
     {
-      DEBUGMSG( "the selected backend is already loaded, so just perform backend cleanup and reinit\n" );
+      DEBUGMSG( _("the selected backend is already loaded, so just perform backend cleanup and reinit\n") );
       backend.cleanup();
       backend.init( i_configure_cfg_get_file );
     }
--- a/src/amidi-plug/i_fileinfo.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_fileinfo.c	Thu Jul 19 00:50:01 2007 +0000
@@ -106,7 +106,7 @@
 }
 
 
-void i_fileinfo_gui( gchar * filename )
+void i_fileinfo_gui( gchar * filename_uri )
 {
   static GtkWidget *fileinfowin = NULL;
   GtkWidget *fileinfowin_vbox, *fileinfowin_columns_hbox;
@@ -121,7 +121,7 @@
   PangoAttrList *pangoattrlist;
   PangoAttribute *pangoattr;
   GString *value_gstring;
-  gchar *title , *filename_utf8;
+  gchar *title , *filename, *filename_utf8;
   gint bpm = 0, wavg_bpm = 0;
   midifile_t *mf;
 
@@ -131,7 +131,7 @@
   mf = g_malloc(sizeof(midifile_t));
 
   /****************** midifile parser ******************/
-  if ( !i_midi_parse_from_filename( filename , mf ) )
+  if ( !i_midi_parse_from_filename( filename_uri , mf ) )
     return;
   /* midifile is filled with information at this point,
      bpm information is needed too */
@@ -333,6 +333,9 @@
 
 
   /* utf8-ize filename and set window title */
+  filename = g_filename_from_uri( filename_uri , NULL , NULL );
+  if ( !filename )
+    filename = g_strdup( filename_uri );
   filename_utf8 = g_strdup(g_filename_to_utf8( filename , -1 , NULL , NULL , NULL ));
   if ( !filename_utf8 )
   {
@@ -353,6 +356,7 @@
   gtk_entry_set_text( GTK_ENTRY(title_name_v_entry) , filename_utf8 );
   gtk_editable_set_position( GTK_EDITABLE(title_name_v_entry) , -1 );
   g_free(filename_utf8);
+  g_free(filename);
 
   gtk_widget_grab_focus( GTK_WIDGET(footer_bclose) );
   gtk_widget_show_all( fileinfowin );
--- a/src/amidi-plug/i_utils.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/amidi-plug/i_utils.c	Thu Jul 19 00:50:01 2007 +0000
@@ -39,7 +39,7 @@
 
   aboutwin = gtk_window_new( GTK_WINDOW_TOPLEVEL );
   gtk_window_set_type_hint( GTK_WINDOW(aboutwin), GDK_WINDOW_TYPE_HINT_DIALOG );
-  gtk_window_set_title( GTK_WINDOW(aboutwin), "AMIDI-Plug - about" );
+  gtk_window_set_title( GTK_WINDOW(aboutwin), _("AMIDI-Plug - about") );
   gtk_window_set_resizable( GTK_WINDOW(aboutwin) , FALSE );
   gtk_container_set_border_width( GTK_CONTAINER(aboutwin), 10 );
   g_signal_connect( G_OBJECT(aboutwin) , "destroy" , G_CALLBACK(gtk_widget_destroyed) , &aboutwin );
@@ -130,7 +130,7 @@
 
   gtk_window_set_title( GTK_WINDOW(win) , title );
   g_signal_connect_swapped( G_OBJECT(win) , "response" , G_CALLBACK(gtk_widget_destroy) , win );
- 
+
   if ( show_win == TRUE )
     gtk_widget_show_all( win );
 
--- a/src/audiocompress/audacious-glue.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/audiocompress/audacious-glue.c	Thu Jul 19 00:50:01 2007 +0000
@@ -255,7 +255,7 @@
 
 	look = lookup_widget(prefs->dialog, "anticlip");
 	gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(look), FALSE);
-	
+
 	look = lookup_widget(prefs->dialog, "target");
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(look),(gfloat)TARGET);
 
@@ -289,8 +289,8 @@
 
 	GtkWidget *look;
 
-	/* Set values */ 
-	
+	/* Set values */
+
 	look = lookup_widget(prefs->dialog, "anticlip");
 	gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(look),
 				     prefs->anticlip);
@@ -321,18 +321,18 @@
 	/* Preferences dialog */
 
 	gchar *clip_tip =
-		"If checked, when the sound peaks the volume will be "
+		_("If checked, when the sound peaks the volume will be "
 		"cut instantly; otherwise, it will ramp down just in time "
-		"for the peak (but some minor clipping may still occur).";
+		"for the peak (but some minor clipping may still occur).");
 	gchar *gainmax_tip =
-		"The maximum amount to amplify the audio by";
+		_("The maximum amount to amplify the audio by");
 	gchar *gainsmooth_tip =
-		"Defines how smoothly the volume will ramp up";
+		_("Defines how smoothly the volume will ramp up");
 	gchar *target_tip =
-		"The target audio level for ramping up. Lowering the "
+		_("The target audio level for ramping up. Lowering the "
 		"value gives a bit more dynamic range for peaks, but "
-		"will make the overall sound quieter.";
-	gchar *hist_text = "How long of a window to maintain";
+		"will make the overall sound quieter.");
+	gchar *hist_text = _("How long of a window to maintain");
 
 	GtkWidget *preferences;
 	GtkWidget *vbox2;
@@ -373,7 +373,7 @@
 			     preferences);
 	gtk_container_set_border_width(GTK_CONTAINER(preferences), 10);
 	gtk_window_set_title(GTK_WINDOW(preferences),
-			      "AudioCompress preferences");
+			      _("AudioCompress preferences"));
 	gtk_window_set_policy(GTK_WINDOW(preferences), TRUE, TRUE, FALSE);
 	gtk_window_set_wmclass(GTK_WINDOW(preferences), "prefs", "xmms");
 
@@ -390,12 +390,12 @@
 	gtk_container_add(GTK_CONTAINER(notebook1), vbox5);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox5), 5);
 
-	frame1 = gtk_frame_new(" Quality Options ");
+	frame1 = gtk_frame_new(_(" Quality Options "));
 	gtk_widget_show(frame1);
 	gtk_box_pack_start(GTK_BOX(vbox5), frame1, FALSE, FALSE, 0);
 
 	clipping = gtk_check_button_new_with_label
-		(" Aggressively prevent clipping");
+		(_(" Aggressively prevent clipping"));
 	gtk_widget_ref(clipping);
 	g_object_set_data_full(G_OBJECT(preferences), "anticlip",
 				  clipping,
@@ -407,7 +407,7 @@
 	gtk_container_set_border_width(GTK_CONTAINER(clipping), 5);
 	gtk_tooltips_set_tip(tooltips, clipping, clip_tip, NULL);
 
-	frame2 = gtk_frame_new(" Target & gain");
+	frame2 = gtk_frame_new(_(" Target & gain"));
 	gtk_widget_show(frame2);
 	gtk_box_pack_start(GTK_BOX(vbox5), frame2, TRUE, TRUE, 0);
 
@@ -418,7 +418,7 @@
 	gtk_table_set_row_spacings(GTK_TABLE(table1), 5);
 	gtk_table_set_col_spacings(GTK_TABLE(table1), 5);
 
-	label5 = gtk_label_new("Target audio level:");
+	label5 = gtk_label_new(_("Target audio level:"));
 	gtk_widget_show(label5);
 	gtk_table_attach(GTK_TABLE(table1), label5, 0, 1, 0, 1,
 			 (GtkAttachOptions)(GTK_FILL),
@@ -426,7 +426,7 @@
 	gtk_label_set_justify(GTK_LABEL(label5), GTK_JUSTIFY_RIGHT);
 	gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5);
 
-	label6 = gtk_label_new("Maximum gain:");
+	label6 = gtk_label_new(_("Maximum gain:"));
 	gtk_widget_show(label6);
 	gtk_table_attach(GTK_TABLE(table1), label6, 0, 1, 1, 2,
 			 (GtkAttachOptions)(GTK_FILL),
@@ -434,7 +434,7 @@
 	gtk_label_set_justify(GTK_LABEL(label6), GTK_JUSTIFY_LEFT);
 	gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);
 
-	label7 = gtk_label_new("Gain smooth:");
+	label7 = gtk_label_new(_("Gain smooth:"));
 	gtk_widget_show(label7);
 	gtk_table_attach(GTK_TABLE(table1), label7, 0, 1, 2, 3,
 			 (GtkAttachOptions)(GTK_FILL),
@@ -486,7 +486,7 @@
 	gtk_tooltips_set_tip(tooltips, target_sp, target_tip, NULL);
 	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(target_sp), TRUE);
 
-	frame3 = gtk_frame_new(" History ");
+	frame3 = gtk_frame_new(_(" History "));
 	gtk_widget_show(frame3);
 	gtk_box_pack_start(GTK_BOX(vbox5), frame3, TRUE, TRUE, 0);
 
@@ -518,9 +518,9 @@
 			 (GtkAttachOptions)(0), 0, 0);
 
 	gtk_tooltips_set_tip(tooltips, buckets_sp,
-			     "How long of a history to maintain.  "
+			     _("How long of a history to maintain.  "
 			     "A higher number will make the volume changes "
-			     "less responsive.",
+			     "less responsive."),
 			      NULL);
 
 	hbuttonbox7 = gtk_hbutton_box_new();
@@ -529,12 +529,12 @@
 	gtk_button_box_set_layout(GTK_BUTTON_BOX(hbuttonbox7),
 				   GTK_BUTTONBOX_END);
 
-	button8 = gtk_button_new_with_label("Load default values");
+	button8 = gtk_button_new_with_label(_("Load default values"));
 	gtk_widget_show(button8);
 	gtk_container_add(GTK_CONTAINER(hbuttonbox7), button8);
 	GTK_WIDGET_SET_FLAGS(button8, GTK_CAN_DEFAULT);
 
-	label4 = gtk_label_new("Audio values");
+	label4 = gtk_label_new(_("Audio values"));
 	gtk_widget_show(label4);
 	gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1),
 				    gtk_notebook_get_nth_page(GTK_NOTEBOOK
@@ -553,17 +553,17 @@
 	gtk_button_box_set_child_ipadding(GTK_BUTTON_BOX(hbuttonbox2), 0,
 					   0);
 
-	button3 = gtk_button_new_with_label("Ok");
+	button3 = gtk_button_new_with_label(_("Ok"));
 	gtk_widget_show(button3);
 	gtk_container_add(GTK_CONTAINER(hbuttonbox2), button3);
 	GTK_WIDGET_SET_FLAGS(button3, GTK_CAN_DEFAULT);
 
-	button4 = gtk_button_new_with_label("Cancel");
+	button4 = gtk_button_new_with_label(_("Cancel"));
 	gtk_widget_show(button4);
 	gtk_container_add(GTK_CONTAINER(hbuttonbox2), button4);
 	GTK_WIDGET_SET_FLAGS(button4, GTK_CAN_DEFAULT);
 
-	button7 = gtk_button_new_with_label("Apply");
+	button7 = gtk_button_new_with_label(_("Apply"));
 	gtk_widget_show(button7);
 	gtk_container_add(GTK_CONTAINER(hbuttonbox2), button7);
 	GTK_WIDGET_SET_FLAGS(button7, GTK_CAN_DEFAULT);
--- a/src/cdaudio-ng/cdaudio-ng.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/cdaudio-ng/cdaudio-ng.c	Thu Jul 19 00:50:01 2007 +0000
@@ -2,13 +2,12 @@
 /*
 	todo: 
 		- vis_pcm...?!
-		- limit cd read speed
-		- cddb
 		- fileinfo dialog
 		- about dialog
 		- remove //'s & todo's
 		- additional comments
 		- stop playback when configure
+		- configuration for cddb (server, port)
 */
 
 #include <string.h>
@@ -24,6 +23,7 @@
 #include <cdio/audio.h>
 #include <cdio/sector.h>
 #include <cdio/cd_types.h>
+#include <cddb/cddb.h>
 
 #include <glib.h>
 
@@ -41,7 +41,7 @@
 static int				lasttrackno = -1;
 static CdIo_t			*pcdio = NULL;
 static trackinfo_t		*trackinfo = NULL;
-static char				album_name[DEF_STRING_LEN];
+
 static gboolean			use_dae = TRUE;
 static gboolean			use_cdtext = TRUE;
 static gboolean			use_cddb = TRUE;
@@ -74,11 +74,9 @@
 static int				find_trackno_from_filename(char *filename);
 static void				cleanup_on_error();
 
-
-/*
 static int				calculate_digit_sum(int n);
 static unsigned long	calculate_cddb_discid();
-*/
+
 
 
 static InputPlugin inputplugin = {
@@ -124,7 +122,9 @@
 		cleanup_on_error();
 		return;
 	}
-
+	
+	libcddb_init();
+	
 	ConfigDb *db = bmp_cfg_db_open();
 	gchar *string = NULL;
 
@@ -218,8 +218,13 @@
 	}
 
 		/* find an available, audio capable, cd drive  */
-	if (device != NULL && strlen(device) > 0)
+	if (device != NULL && strlen(device) > 0) {
 		pcdio = cdio_open(device, DRIVER_UNKNOWN);
+		if (pcdio == NULL) {
+			fprintf(stderr, "cdaudio-ng: failed to open cd device \"%s\"\n", device);
+			return NULL;
+		}
+	}
 	else {
 		char **ppcd_drives = cdio_get_devices_with_cap(NULL, CDIO_FS_AUDIO, false);
 		if (ppcd_drives != NULL) { /* we have at least one audio capable cd drive */
@@ -241,67 +246,164 @@
 	}
 
 		/* limit read speed */
-	if (limitspeed > 0) {
+	if (limitspeed > 0 && !use_dae) {
 		if (debug)
 			printf("cdaudio-ng: setting drive speed limit to %dx\n", limitspeed);
 		if (cdio_set_speed(pcdio, limitspeed) != DRIVER_OP_SUCCESS)
 			fprintf(stderr, "cdaudio-ng: failed to set drive speed to %dx\n", limitspeed);
 	}
-		/* get track information */
+
+		/* get general track initialization */
 	cdrom_drive_t *pcdrom_drive = cdio_cddap_identify_cdio(pcdio, 1, NULL);	// todo : check return / NULL
 	firsttrackno = cdio_get_first_track_num(pcdrom_drive->p_cdio);
 	lasttrackno = cdio_get_last_track_num(pcdrom_drive->p_cdio);
 	if (firsttrackno == CDIO_INVALID_TRACK || lasttrackno == CDIO_INVALID_TRACK) {
-		fprintf(stderr, "cdaudio-ng: failed to retrieve first/last track number");
+		fprintf(stderr, "cdaudio-ng: failed to retrieve first/last track number\n");
 		cleanup_on_error();
 		return NULL;
 	}
 	if (debug)
 		printf("cdaudio-ng: first track is %d and last track is %d\n", firsttrackno, lasttrackno);
 
-		/* add track "file" names to the list */
-	GList *list = NULL;
 	if (trackinfo != NULL) /* if a previously allocated track information exists, we free it */
 		free(trackinfo);
 	trackinfo = (trackinfo_t *) malloc(sizeof(trackinfo_t) * (lasttrackno + 1));
 	int trackno;
+
+	for (trackno = firsttrackno; trackno <= lasttrackno; trackno++) {
+		trackinfo[trackno].startlsn = cdio_get_track_lsn(pcdrom_drive->p_cdio, trackno);
+		trackinfo[trackno].endlsn = cdio_get_track_last_lsn(pcdrom_drive->p_cdio, trackno);
+
+		if (trackinfo[trackno].startlsn == CDIO_INVALID_LSN || trackinfo[trackno].endlsn == CDIO_INVALID_LSN) {
+			fprintf(stderr, "cdaudio-ng: failed to retrieve stard/end lsn for track %d\n", trackno);
+			cleanup_on_error();
+			return NULL;
+		}
+	}
+
+		/* initialize de cddb subsystem */
+	cddb_conn_t *pcddb_conn = NULL;
+	cddb_disc_t *pcddb_disc = NULL;
+	cddb_track_t *pcddb_track = NULL;
+
+	if (use_cddb) {
+		pcddb_conn = cddb_new();
+		if (pcddb_conn == NULL)
+			fprintf(stderr, "cdaudio-ng: failed to create the cddb connection\n");
+		else {
+			if (debug)
+				printf("cdaudio-ng: getting cddb info\n");
+
+			// todo: change the default cddb settings
+
+			pcddb_disc = cddb_disc_new();
+			for (trackno = firsttrackno; trackno <= lasttrackno; trackno++) {
+				pcddb_track = cddb_track_new();
+				cddb_track_set_frame_offset(pcddb_track, trackinfo[trackno].startlsn);
+				cddb_disc_add_track(pcddb_disc, pcddb_track);
+			}
+
+			msf_t startmsf, endmsf;
+			cdio_get_track_msf(pcdio, 1, &startmsf);
+			cdio_get_track_msf(pcdio, CDIO_CDROM_LEADOUT_TRACK, &endmsf);
+			cddb_disc_set_length(pcddb_disc, cdio_audio_get_msf_seconds(&endmsf) - cdio_audio_get_msf_seconds(&startmsf));
+
+			int matches;
+			if ((matches = cddb_query(pcddb_conn, pcddb_disc)) == -1) {
+				fprintf(stderr, "cdaudio-ng: failed to query the cddb server: %s\n", cddb_error_str(cddb_errno(pcddb_conn)));
+				cddb_disc_destroy(pcddb_disc);
+				pcddb_disc = NULL;
+			}
+			else {
+				if (debug)
+					printf("cdaudio-ng: discid = %X, category = \"%s\"\n", cddb_disc_get_discid(pcddb_disc), cddb_disc_get_category_str(pcddb_disc));
+	
+				cddb_read(pcddb_conn, pcddb_disc);
+				if (cddb_errno(pcddb_conn) != CDDB_ERR_OK) {
+					fprintf(stderr, "cdaudio-ng: failed to read the cddb info: %s\n", cddb_error_str(cddb_errno(pcddb_conn)));
+					cddb_disc_destroy(pcddb_disc);
+					pcddb_disc = NULL;
+				}
+				else {
+					if (debug)
+						printf("cdaudio-ng: we have got the cddb info\n");
+	
+					strcpy(trackinfo[0].performer, cddb_disc_get_artist(pcddb_disc));
+					strcpy(trackinfo[0].name, cddb_disc_get_title(pcddb_disc));
+					strcpy(trackinfo[0].genre, cddb_disc_get_genre(pcddb_disc));
+				}
+			}
+		}
+	}
+
+		/* adding trackinfo[0] information (the disc) */
+	if (use_cdtext) {
+		if (debug)
+			printf("cdaudio-ng: getting cd-text information for disc\n");
+		cdtext_t *pcdtext = cdio_get_cdtext(pcdrom_drive->p_cdio, 0);
+		if (pcdtext == NULL || pcdtext->field[CDTEXT_TITLE] == NULL) {
+			if (debug)
+				printf("cdaudio-ng: no cd-text available for disc\n");
+		}
+		else {
+			strcpy(trackinfo[0].performer, pcdtext->field[CDTEXT_PERFORMER] != NULL ? pcdtext->field[CDTEXT_PERFORMER] : "");
+			strcpy(trackinfo[0].name, pcdtext->field[CDTEXT_TITLE] != NULL ? pcdtext->field[CDTEXT_TITLE] : "");
+			strcpy(trackinfo[0].genre, pcdtext->field[CDTEXT_GENRE] != NULL ? pcdtext->field[CDTEXT_GENRE] : "");
+		}
+	}
+
+		/* add track "file" names to the list */
+	GList *list = NULL;
 	for (trackno = firsttrackno; trackno <= lasttrackno; trackno++) {
 		list = g_list_append(list, g_strdup_printf("track%02u.cda", trackno));	
 		cdtext_t *pcdtext = NULL;
-		if (use_cdtext)
+		if (use_cdtext) {
+			if (debug)
+				printf("cdaudio-ng: getting cd-text information for track %d\n", trackno);
 			pcdtext = cdio_get_cdtext(pcdrom_drive->p_cdio, trackno);
+			if (pcdtext == NULL || pcdtext->field[CDTEXT_PERFORMER] == NULL) {
+				if (debug)
+					printf("cdaudio-ng: no cd-text available for track %d\n", trackno);
+				pcdtext = NULL;
+			}
+		}
 
 		if (pcdtext != NULL) {
 			strcpy(trackinfo[trackno].performer, pcdtext->field[CDTEXT_PERFORMER] != NULL ? pcdtext->field[CDTEXT_PERFORMER] : "");
 			strcpy(trackinfo[trackno].name, pcdtext->field[CDTEXT_TITLE] != NULL ? pcdtext->field[CDTEXT_TITLE] : "");
 			strcpy(trackinfo[trackno].genre, pcdtext->field[CDTEXT_GENRE] != NULL ? pcdtext->field[CDTEXT_GENRE] : "");
 		}
-		else {
-			strcpy(trackinfo[trackno].performer, "");
-			strcpy(trackinfo[trackno].name, "");
-			strcpy(trackinfo[trackno].genre, "");
-		}
-		
-		// todo: implement cddb
-		
+		else
+			if (pcddb_disc != NULL) {
+				cddb_track_t *pcddb_track = cddb_disc_get_track(pcddb_disc, trackno - 1);
+				strcpy(trackinfo[trackno].performer, cddb_track_get_artist(pcddb_track));
+				strcpy(trackinfo[trackno].name, cddb_track_get_title(pcddb_track));
+				strcpy(trackinfo[trackno].genre, cddb_disc_get_genre(pcddb_disc));
+			}
+			else {
+				strcpy(trackinfo[trackno].performer, "");
+				strcpy(trackinfo[trackno].name, "");
+				strcpy(trackinfo[trackno].genre, "");
+			}
+
 		if (strlen(trackinfo[trackno].name) == 0)
 			sprintf(trackinfo[trackno].name, "CD Audio Track %02u", trackno);
 
-		trackinfo[trackno].startlsn = cdio_get_track_lsn(pcdrom_drive->p_cdio, trackno);
-		trackinfo[trackno].endlsn = cdio_get_track_last_lsn(pcdrom_drive->p_cdio, trackno);
-		
-		if (trackinfo[trackno].startlsn == CDIO_INVALID_LSN || trackinfo[trackno].endlsn == CDIO_INVALID_LSN) {
-			fprintf(stderr, "cdaudio-ng: failed to retrieve stard/end lsn for track %d\n", trackno);
-			g_list_free(list);
-			cleanup_on_error();
-			return NULL;
+	}
+
+	if (debug) {
+		printf("cdaudio-ng: disc has : performer = \"%s\", name = \"%s\", genre = \"%s\"\n", 
+			   trackinfo[0].performer, trackinfo[0].name, trackinfo[0].genre);
+		for (trackno = firsttrackno; trackno <= lasttrackno; trackno++) {
+			printf("cdaudio-ng: track %d has : performer = \"%s\", name = \"%s\", genre = \"%s\", startlsn = %d, endlsn = %d\n", 
+				trackno, trackinfo[trackno].performer, trackinfo[trackno].name, trackinfo[trackno].genre, trackinfo[trackno].startlsn, trackinfo[trackno].endlsn);
 		}
+	}
 
-		if (debug)
-			printf("cdaudio-ng: track %d has : performer = \"%s\", name = \"%s\", genre = \"%s\", startlsn = %d, endlsn = %d\n", 
-				trackno, trackinfo[trackno].performer, trackinfo[trackno].name, trackinfo[trackno].genre, trackinfo[trackno].startlsn, trackinfo
-				[trackno].endlsn);
-	}
+	if (pcddb_disc != NULL)
+		cddb_disc_destroy(pcddb_disc);
+	if (pcddb_conn != NULL)
+		cddb_destroy(pcddb_conn);
 
 	return list;
 }
@@ -543,6 +645,8 @@
 	if (debug)
 		printf("cdaudio-ng: cdaudio_cleanup()\n");
 
+	libcddb_shutdown();
+
 	if (pcdio!= NULL) {
 		if (playing_track != -1 && !use_dae)
 			cdio_audio_stop(pcdio);
@@ -554,7 +658,7 @@
 		trackinfo = NULL;
 	}
 	playing_track = -1;
-	
+
 	// todo: destroy the gui
 
 	ConfigDb *db = bmp_cfg_db_open();
@@ -606,7 +710,7 @@
 		return NULL;
 
 	tuple->performer = strlen(trackinfo[trackno].performer) > 0 ? g_strdup(trackinfo[trackno].performer) : NULL;
-	tuple->album_name = strlen(album_name) > 0 ? g_strdup(album_name) : NULL;
+	tuple->album_name = strlen(trackinfo[0].name) > 0 ? g_strdup(trackinfo[0].name) : NULL;
 	tuple->track_name = strlen(trackinfo[trackno].name) > 0 ? g_strdup(trackinfo[trackno].name) : NULL;
 	tuple->track_number = trackno;
 	tuple->file_name = g_strdup(basename(filename));
@@ -622,7 +726,7 @@
 
 	/* auxiliar functions */
 
-/*
+
 static int calculate_digit_sum(int n)
 {
 	int ret = 0;
@@ -634,9 +738,9 @@
 			return ret;
 	}
 }
-*/
+
 
-/*
+
 static unsigned long calculate_cddb_discid()
 {
 	int trackno, t, n = 0;
@@ -644,18 +748,18 @@
 	msf_t msf;
 	
 	for (trackno = firsttrackno; trackno <= lasttrackno; trackno++) {
-		cdio_get_track_msf(pcdrom_drive->p_cdio, trackno, &msf);
+		cdio_get_track_msf(pcdio, trackno, &msf);
 		n += calculate_digit_sum(cdio_audio_get_msf_seconds(&msf));
 	}
 	
-	cdio_get_track_msf(pcdrom_drive->p_cdio, 1, &startmsf);
-	cdio_get_track_msf(pcdrom_drive->p_cdio, CDIO_CDROM_LEADOUT_TRACK, &msf);
+	cdio_get_track_msf(pcdio, 1, &startmsf);
+	cdio_get_track_msf(pcdio, CDIO_CDROM_LEADOUT_TRACK, &msf);
 	
 	t = cdio_audio_get_msf_seconds(&msf) - cdio_audio_get_msf_seconds(&startmsf);
 	
 	return ((n % 0xFF) << 24 | t << 8 | (lasttrackno - firsttrackno + 1));
 }
-*/
+
 
 void *dae_playing_thread_core(dae_params_t *pdae_params)
 {
--- a/src/cue/cuesheet.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/cue/cuesheet.c	Thu Jul 19 00:50:01 2007 +0000
@@ -351,31 +351,25 @@
 extern void playback_stop(void);
 extern void mainwin_clear_song_info(void);
 
-static gpointer do_stop(gpointer data)
+static gboolean do_stop(gpointer data)
 {
-//    InputPlayback *playback = (InputPlayback *)data;
-    Playlist *playlist = playlist_get_active();
 #ifdef DEBUG
     g_print("f: do_stop\n");
 #endif
+
     ip_data.stop = TRUE;
     playback_stop();
     ip_data.stop = FALSE;
 
-    PLAYLIST_LOCK(playlist->mutex);
-    gdk_threads_enter();
     mainwin_clear_song_info();
-    gdk_threads_leave();
-    PLAYLIST_UNLOCK(playlist->mutex);
 
 #ifdef DEBUG
     g_print("e: do_stop\n");
 #endif
-    g_thread_exit(NULL);
-    return NULL; //dummy
+    return FALSE; //one-shot
 }
 
-static gpointer do_setpos(gpointer data)
+static gboolean do_setpos(gpointer data)
 {
     Playlist *playlist = playlist_get_active();
     gint pos = playlist_get_position_nolock(playlist);
@@ -388,9 +382,16 @@
 #ifdef DEBUG
     g_print("do_setpos: pos = %d\n\n", pos);
 #endif
+    /* being done from the main loop thread, does not require locks */
     playlist_set_position(playlist, (guint)pos);
-    g_thread_exit(NULL);
-    return NULL; //dummy
+
+    /* kick watchdog */
+    g_mutex_lock(cue_mutex);
+    watchdog_state = RUN;
+    g_mutex_unlock(cue_mutex);
+    g_cond_signal(cue_cond);
+
+    return FALSE; //one-shot
 }
 
 static void cue_pause(InputPlayback * data, short p)
@@ -545,7 +546,7 @@
 #ifdef DEBUG
             g_print("e: watchdog exit\n");
 #endif
-            g_mutex_unlock(cue_mutex); // stop() locks cue_mutex.
+            g_mutex_unlock(cue_mutex); // stop() will lock cue_mutex.
             stop(real_ip); // need not to care about real_ip != NULL here.
             g_thread_exit(NULL);
             break;
@@ -574,7 +575,7 @@
         // prev track
         if (time < cue_tracks[cur_cue_track].index)
         {
-            gint incr;
+            static gint incr = 0;
             gint oldpos = cur_cue_track;
 #ifdef DEBUG
             g_print("i: watchdog prev\n");
@@ -589,14 +590,18 @@
                     finetune_seek = time;
             }
 
-            exec_thread = g_thread_create(do_setpos, &incr, FALSE, NULL);
-            g_usleep(TRANSITION_GUARD_TIME);
+            g_mutex_lock(cue_mutex);
+            watchdog_state = STOP;
+            g_mutex_unlock(cue_mutex);
+
+            g_idle_add_full(G_PRIORITY_HIGH , do_setpos, &incr, NULL);
+            continue;
         }
 
         // next track
         if (cur_cue_track + 1 < last_cue_track && time > cue_tracks[cur_cue_track + 1].index)
         {
-            gint incr;
+            static gint incr = 0;
             gint oldpos = cur_cue_track;
 #ifdef DEBUG
             g_print("i: watchdog next\n");
@@ -612,12 +617,17 @@
                     finetune_seek = time;
             }
 
+            g_mutex_lock(cue_mutex);
+            watchdog_state = STOP;
+            g_mutex_unlock(cue_mutex);
+
             if(cfg.stopaftersong) {
-                exec_thread = g_thread_create(do_stop, (void *)real_ip, FALSE, NULL);
+                g_idle_add_full(G_PRIORITY_HIGH, do_stop, (void *)real_ip, NULL);
+                continue;
             }
             else {
-                exec_thread = g_thread_create(do_setpos, &incr, FALSE, NULL);
-                g_usleep(TRANSITION_GUARD_TIME);
+                g_idle_add_full(G_PRIORITY_HIGH , do_setpos, &incr, NULL);
+                continue;
             }
         }
 
@@ -631,27 +641,32 @@
 #ifdef DEBUG
                     g_print("i: watchdog eof reached\n\n");
 #endif
-                
+                    g_mutex_lock(cue_mutex);
+                    watchdog_state = STOP;
+                    g_mutex_unlock(cue_mutex);
+
                     if(cfg.repeat) {
-                        gint incr = -pos;
-                        exec_thread = g_thread_create(do_setpos, &incr, FALSE, NULL);
-                        g_usleep(TRANSITION_GUARD_TIME);
+                        static gint incr = 0;
+                        incr = -pos;
+                        g_idle_add_full(G_PRIORITY_HIGH , do_setpos, &incr, NULL);
+                        continue;
                     }
                     else {
-                        exec_thread = g_thread_create(do_stop, (void *)real_ip, FALSE, NULL);
-                        g_usleep(TRANSITION_GUARD_TIME);
+                        g_idle_add_full(G_PRIORITY_HIGH, do_stop, (void *)real_ip, NULL);
+                        continue;
                     }
                 }
                 else {
                     if(cfg.stopaftersong) {
-                        exec_thread = g_thread_create(do_stop, (void *)real_ip, FALSE, NULL);
+                        g_idle_add_full(G_PRIORITY_HIGH, do_stop, (void *)real_ip, NULL);
+                        continue;
                     }
 #ifdef DEBUG
                     g_print("i: watchdog end of cue, advance in playlist\n\n");
 #endif
-                    gint incr = 1;
-                    exec_thread = g_thread_create(do_setpos, &incr, FALSE, NULL);
-                    g_usleep(TRANSITION_GUARD_TIME);
+                    static gint incr = 1;
+                    g_idle_add_full(G_PRIORITY_HIGH , do_setpos, &incr, NULL);
+                    continue;
                 }
             }
         }
--- a/src/curl/Makefile	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/curl/Makefile	Thu Jul 19 00:50:01 2007 +0000
@@ -3,7 +3,7 @@
 
 SUBDIRS = 
 
-OBJECTIVE_LIBS = libcurl$(SHARED_SUFFIX)
+OBJECTIVE_LIBS = libcurlsrc$(SHARED_SUFFIX)
 
 LIBDIR = $(plugindir)/$(TRANSPORT_PLUGIN_DIR)
 
--- a/src/filewriter/filewriter.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/filewriter/filewriter.c	Thu Jul 19 00:50:01 2007 +0000
@@ -254,7 +254,7 @@
     else
         directory = g_strdup(file_path);
 
-    temp = g_strdup_printf("%s/%s.%s",
+    temp = g_strdup_printf("file://%s/%s.%s",
                            directory, filename, fileext_str[fileext]);
     g_free(directory);
     g_free(filename);
--- a/src/filewriter/flac.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/filewriter/flac.c	Thu Jul 19 00:50:01 2007 +0000
@@ -191,7 +191,7 @@
 static gint flac_get_written_time(void)
 {
     if (input.frequency && input.channels)
-        return (gint) ((olen * 1000) / (input.frequency * 2 * input.channels));
+        return (gint) ((olen * 1000) / (input.frequency * 2 * input.channels) + offset);
 
     return 0;
 }
--- a/src/filewriter/vorbis.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/filewriter/vorbis.c	Thu Jul 19 00:50:01 2007 +0000
@@ -222,7 +222,7 @@
 static gint vorbis_get_written_time(void)
 {
     if (input.frequency && input.channels)
-        return (gint) ((olen * 1000) / (input.frequency * 2 * input.channels));
+        return (gint) ((olen * 1000) / (input.frequency * 2 * input.channels) + offset);
 
     return 0;
 }
--- a/src/filewriter/wav.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/filewriter/wav.c	Thu Jul 19 00:50:01 2007 +0000
@@ -113,6 +113,6 @@
 static gint wav_get_written_time(void)
 {
     if (header.byte_p_sec != 0)
-        return (gint) ((written * 1000) / header.byte_p_sec);
+        return (gint) ((written * 1000) / header.byte_p_sec + offset);
     return 0;
 }
--- a/src/flacng/plugin.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/flacng/plugin.c	Thu Jul 19 00:50:01 2007 +0000
@@ -57,7 +57,7 @@
     flac_get_song_tuple,	// get a tuple
     NULL,
     NULL,			// write a tuple back to a file as a tag
-/*    flac_is_our_fd */ NULL,	// version of is_our_file which is handed an FD
+    flac_is_our_fd,	// version of is_our_file which is handed an FD
     flac_fmts			// vector of fileextensions allowed by the plugin
 };
 
@@ -175,7 +175,7 @@
 
 /* --- */
 
-gboolean flac_is_our_file(gchar* filename) {
+gboolean flac_is_our_fd(gchar* filename, VFSFile* fd) {
 
     _ENTER;
 
@@ -184,9 +184,9 @@
         _LEAVE FALSE;
     }
 
-    _DEBUG("Testing file: %s", filename);
+    _DEBUG("Testing fd for file: %s", filename);
 
-    if (FALSE == read_metadata(filename, test_decoder, test_info)) {
+    if (FALSE == read_metadata(fd, test_decoder, test_info)) {
         _DEBUG("File not handled by this plugin!");
         _LEAVE FALSE;
     }
@@ -203,13 +203,8 @@
      * If we get here, the file is supported by FLAC.
      * The stream characteristics have been filled in by
      * the metadata callback.
-     * We can close the stream now.
      */
 
-     vfs_fclose(test_info->input_stream);
-     test_info->input_stream = NULL;
-
-
     _DEBUG("Stream encoded at %d Hz, %d bps, %d channels",
         test_info->stream.samplerate,
         test_info->stream.bits_per_sample,
@@ -235,13 +230,38 @@
 
     _DEBUG("Accepting file %s", filename);
 
-    reset_info(test_info);
+    reset_info(test_info, FALSE);
 
     _LEAVE TRUE;
 }
 
 /* --- */
 
+gboolean flac_is_our_file(gchar* filename) {
+
+    VFSFile* fd;
+    gboolean ret;
+
+    _ENTER;
+
+    _DEBUG("Testing file: %s", filename);
+    /*
+     * Open the file
+     */
+    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+        _ERROR("Could not open file for reading! (%s)", filename);
+        _LEAVE FALSE;
+    }
+
+    ret = flac_is_our_fd(filename, fd);
+
+    vfs_fclose(fd);
+
+    _LEAVE ret;
+}
+
+/* --- */
+
 void squeeze_audio(gint32* src, void* dst, guint count, guint src_res, guint dst_res) {
 
     /*
@@ -530,6 +550,7 @@
 
 void flac_play_file (InputPlayback* input) {
 
+    VFSFile* fd;
     gint l;
 
     _ENTER;
@@ -545,7 +566,15 @@
     input->playing = FALSE;
     xmms_usleep(20000);
 
-    if (FALSE == read_metadata(input->filename, main_decoder, main_info)) {
+    /*
+     * Open the file
+     */
+    if (NULL == (fd = vfs_fopen(input->filename, "rb"))) {
+        _ERROR("Could not open file for reading! (%s)", input->filename);
+        _LEAVE;
+    }
+
+    if (FALSE == read_metadata(fd, main_decoder, main_info)) {
         _ERROR("Could not prepare file for playing!");
         _LEAVE;
     }
@@ -634,13 +663,24 @@
 void flac_get_song_info(gchar* filename, gchar** title, gint* length) {
 
     gint l;
+    VFSFile* fd;
 
     _ENTER;
 
-    if (FALSE == read_metadata(filename, test_decoder, test_info)) {
+    _DEBUG("Testing file: %s", filename);
+    /*
+     * Open the file
+     */
+    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+        _ERROR("Could not open file for reading! (%s)", filename);
+        _LEAVE;
+    }
+
+    if (FALSE == read_metadata(fd, test_decoder, test_info)) {
         _ERROR("Could not read file info!");
         *length = -1;
         *title = g_strdup("");
+        reset_info(test_info, TRUE);
         _LEAVE;
     }
 
@@ -658,7 +698,7 @@
     *length = l;
     *title = get_title(filename, test_info);
 
-    reset_info(test_info);
+    reset_info(test_info, TRUE);
 
     _LEAVE;
 }
@@ -667,18 +707,29 @@
 
 TitleInput *flac_get_song_tuple(gchar* filename) {
 
+    VFSFile *fd;
     TitleInput *tuple;
 
     _ENTER;
 
-    if (FALSE == read_metadata(filename, test_decoder, test_info)) {
+    _DEBUG("Testing file: %s", filename);
+    /*
+     * Open the file
+     */
+    if (NULL == (fd = vfs_fopen(filename, "rb"))) {
+        _ERROR("Could not open file for reading! (%s)", filename);
+        _LEAVE NULL;
+    }
+
+    if (FALSE == read_metadata(fd, test_decoder, test_info)) {
         _ERROR("Could not read metadata tuple for file <%s>", filename);
+        reset_info(test_info, TRUE);
         _LEAVE NULL;
     }
 
     tuple = get_tuple(filename, test_info);
 
-    reset_info(test_info);
+    reset_info(test_info, TRUE);
 
     _LEAVE tuple;
 }
--- a/src/flacng/plugin.h	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/flacng/plugin.h	Thu Jul 19 00:50:01 2007 +0000
@@ -4,6 +4,7 @@
 void flac_init(void);
 void flac_aboutbox(void);
 gboolean flac_is_our_file(gchar* filename);
+gboolean flac_is_our_fd(gchar* filename, VFSFile* fd);
 void flac_play_file (InputPlayback* input);
 void flac_stop(InputPlayback* input);
 void flac_pause(InputPlayback* input, gshort p);
--- a/src/flacng/seekable_stream_callbacks.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/flacng/seekable_stream_callbacks.c	Thu Jul 19 00:50:01 2007 +0000
@@ -116,7 +116,7 @@
 
     if (-1 == (position = vfs_ftell(info->input_stream))) {
         _ERROR("Could not tell current position!");
-        return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
+        _LEAVE FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
     }
 
     _DEBUG("Current position: %ld", position);
@@ -138,6 +138,16 @@
     info = (callback_info*) client_data;
     _DEBUG("Using callback_info %s", info->name);
 
+    /*
+     * If we are testing a stream and use restricted reading,
+     * return EOF if we have exhausted our alotted reading
+     * quota
+     */
+    if (0 == info->read_max) {
+        _DEBUG("read_max exhausted, faking EOF");
+        _LEAVE TRUE;
+    }
+
     eof = vfs_feof(info->input_stream);
 
     _LEAVE eof;
--- a/src/flacng/tools.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/flacng/tools.c	Thu Jul 19 00:50:01 2007 +0000
@@ -64,7 +64,7 @@
     info->replaygain.track_peak = NULL;
     info->replaygain.album_gain = NULL;
     info->replaygain.album_peak = NULL;
-    reset_info(info);
+    reset_info(info, FALSE);
 
     _DEBUG("Playback buffer allocated for %d samples, %d bytes", BUFFER_SIZE_SAMP, BUFFER_SIZE_BYTE);
 
@@ -73,16 +73,17 @@
 
 /* --- */
 
-void reset_info(callback_info* info) {
+void reset_info(callback_info* info, gboolean close_fd) {
 
     _ENTER;
 
     _DEBUG("Using callback_info %s", info->name);
 
-    if (NULL != info->input_stream) {
+    if (close_fd && (NULL != info->input_stream)) {
+        _DEBUG("Closing fd");
         vfs_fclose(info->input_stream);
-        info->input_stream = NULL;
     }
+    info->input_stream = NULL;
 
     // memset(info->output_buffer, 0, BUFFER_SIZE * sizeof(int16_t));
     info->stream.samplerate = 0;
@@ -172,7 +173,7 @@
 
 /* --- */
 
-gboolean read_metadata(gchar* filename, FLAC__StreamDecoder* decoder, callback_info* info) {
+gboolean read_metadata(VFSFile* fd, FLAC__StreamDecoder* decoder, callback_info* info) {
 
     FLAC__StreamDecoderState ret;
 
@@ -180,7 +181,9 @@
 
     _DEBUG("Using callback_info %s", info->name);
 
-    _DEBUG("Opening file %s", filename);
+    reset_info(info, FALSE);
+
+    info->input_stream = fd;
 
     /*
      * Reset the decoder
@@ -190,8 +193,6 @@
         _LEAVE FALSE;
     }
 
-    reset_info(info);
-
     /*
      * Just scan the first 8k for the start of metadata
      */
@@ -205,21 +206,14 @@
     info->testing = TRUE;
 
     /*
-     * Open the file
-     */
-    if (NULL == (info->input_stream = vfs_fopen(filename, "rb"))) {
-        _ERROR("Could not open file for reading! (%s)", filename);
-        _LEAVE FALSE;
-    }
-
-    /*
      * Try to decode the metadata
      */
     if (false == FLAC__stream_decoder_process_until_end_of_metadata(decoder)) {
         ret = FLAC__stream_decoder_get_state(decoder);
         _DEBUG("Could not read the metadata: %s(%d)!",
                 FLAC__StreamDecoderStateString[ret], ret);
-        reset_info(info);
+        /* Do not close the filehandle, it was passed to us */
+        reset_info(info, FALSE);
         _LEAVE FALSE;
     }
 
--- a/src/flacng/tools.h	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/flacng/tools.h	Thu Jul 19 00:50:01 2007 +0000
@@ -25,10 +25,10 @@
 #include "flac_compat.h"
 
 callback_info* init_callback_info(gchar* name);
-void reset_info(callback_info* info);
+void reset_info(callback_info* info, gboolean close_fd);
 gchar* get_title(const gchar* filename, callback_info* info);
 TitleInput *get_tuple(const gchar *filename, callback_info* info);
 void add_comment(callback_info* info, gchar* key, gchar* value);
-gboolean read_metadata(gchar* filename, FLAC__StreamDecoder* decoder, callback_info* info);
+gboolean read_metadata(VFSFile* fd, FLAC__StreamDecoder* decoder, callback_info* info);
 
 #endif
--- a/src/m3u/m3u.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/m3u/m3u.c	Thu Jul 19 00:50:01 2007 +0000
@@ -85,10 +85,16 @@
     gint ext_len = -1;
     gboolean is_extm3u = FALSE;
     Playlist *playlist = playlist_get_active();
+    gchar *uri;
+    
+    uri = g_filename_to_uri(filename, NULL, NULL);
 
-    if ((file = vfs_fopen(filename, "rb")) == NULL)
+    if ((file = vfs_fopen(uri ? uri : filename, "rb")) == NULL)
         return;
 
+    if (uri)
+        g_free(uri);
+
     line = g_malloc(line_len);
     while (vfs_fgets(line, line_len, file)) {
         while (strlen(line) == line_len - 1 && line[strlen(line) - 1] != '\n') {
@@ -126,7 +132,11 @@
             ext_info = NULL;
         }
 
-        playlist_load_ins_file(playlist, line, filename, pos, ext_title, ext_len);
+        uri = g_filename_to_uri(line, NULL, NULL);
+        playlist_load_ins_file(playlist, uri ? uri : line, filename, pos, ext_title, ext_len);
+
+        if (uri)
+            g_free(uri);
 
         str_replace_in(&ext_title, NULL);
         ext_len = -1;
@@ -146,12 +156,14 @@
     gchar *outstr = NULL;
     VFSFile *file;
     Playlist *playlist = playlist_get_active();
+    gchar *fn = NULL;
 
     g_return_if_fail(filename != NULL);
     g_return_if_fail(playlist != NULL);
 
-    file = vfs_fopen(filename, "wb");
-
+    fn = g_filename_to_uri(filename, NULL, NULL);
+    file = vfs_fopen(fn ? fn : filename, "wb");
+    g_free(fn); fn = NULL;
     g_return_if_fail(file != NULL);
 
     if (cfg.use_pl_metadata)
@@ -180,7 +192,10 @@
             }
         }
 
-        vfs_fprintf(file, "%s\n", entry->filename);
+        fn = g_filename_from_uri(entry->filename, NULL, NULL);
+        vfs_fprintf(file, "%s\n", fn ? fn : entry->filename);
+
+        g_free(fn); fn = NULL;
     }
 
     PLAYLIST_UNLOCK(playlist->mutex);
--- a/src/madplug/fileinfo.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/madplug/fileinfo.c	Thu Jul 19 00:50:01 2007 +0000
@@ -590,6 +590,16 @@
     }
 
     tmp = g_filename_from_uri(fileurl, NULL, NULL);
+    if (tmp == NULL)
+    {
+#ifdef DEBUG
+        tmp = str_to_utf8(fileurl);
+        g_message("f: audmad_get_file_info: %s , g_filename_from_uri failed", tmp);
+        g_free(tmp);
+        tmp = NULL;
+#endif
+        return;
+    }
     utf_filename = str_to_utf8(tmp);
     g_free(tmp);
     tmp = NULL;
--- a/src/madplug/input.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/madplug/input.c	Thu Jul 19 00:50:01 2007 +0000
@@ -352,6 +352,7 @@
 static void input_read_tag(struct mad_info_t *info)
 {
     gchar *string = NULL;
+    gchar *realfn = NULL;
     TitleInput *title_input;
     glong curpos = 0;
 
@@ -425,9 +426,11 @@
         g_free(string);
         string = NULL;
     }
-
-    title_input->file_name = g_strdup(g_basename(info->filename));
-    title_input->file_path = g_path_get_dirname(info->filename);
+    
+    realfn = g_filename_from_uri(info->filename, NULL, NULL);
+    title_input->file_name = g_strdup(g_basename(realfn ? realfn : info->filename));
+    title_input->file_path = g_path_get_dirname(realfn ? realfn : info->filename);
+    g_free(realfn); realfn = NULL;
     if ((string = strrchr(title_input->file_name, '.'))) {
         title_input->file_ext = string + 1;
         *string = '\0';         // make filename end at dot.
--- a/src/madplug/plugin.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/madplug/plugin.c	Thu Jul 19 00:50:01 2007 +0000
@@ -601,6 +601,7 @@
 {
     TitleInput *tuple = NULL;
     gchar *string = NULL;
+    gchar *realfn = NULL;
 
     struct id3_file *id3file = NULL;
     struct id3_tag *tag = NULL;
@@ -635,9 +636,12 @@
             g_message("audmad_get_song_tuple: track_name = %s", tuple->track_name);
             g_message("audmad_get_song_tuple: stream_name = %s", tuple->album_name);
 #endif
-            tuple->file_name = g_path_get_basename(filename);
-            tuple->file_path = g_path_get_dirname(filename);
-            tuple->file_ext = extname(filename);
+            realfn = g_filename_from_uri(filename, NULL, NULL);
+            tuple->file_name = g_path_get_basename(realfn ? realfn : filename);
+            tuple->file_path = g_path_get_dirname(realfn ? realfn : filename);
+            tuple->file_ext = extname(realfn ? realfn : filename);
+            g_free(realfn); realfn = NULL;
+
             tuple->length = -1;
             tuple->mtime = 0; // this indicates streaming
 #ifdef DEBUG
@@ -676,10 +680,11 @@
                 g_free(string);
                 string = NULL;
             }
-
-            tuple->file_name = g_path_get_basename(filename);
-            tuple->file_path = g_path_get_dirname(filename);
-            tuple->file_ext = extname(filename);
+            realfn = g_filename_from_uri(filename, NULL, NULL);
+            tuple->file_name = g_path_get_basename(realfn ? realfn : filename);
+            tuple->file_path = g_path_get_dirname(realfn ? realfn : filename);
+            tuple->file_ext = extname(realfn ? realfn : filename);
+            g_free(realfn); realfn = NULL;
 
             // length
             tuple->length = -1;
@@ -720,9 +725,11 @@
         id3_file_close(id3file);
     }
     else { // no id3tag
-        tuple->file_name = g_path_get_basename(filename);
-        tuple->file_path = g_path_get_dirname(filename);
-        tuple->file_ext = extname(filename);
+        realfn = g_filename_from_uri(filename, NULL, NULL);
+        tuple->file_name = g_path_get_basename(realfn ? realfn : filename);
+        tuple->file_path = g_path_get_dirname(realfn ? realfn : filename);
+        tuple->file_ext = extname(realfn ? realfn : filename);
+        g_free(realfn); realfn = NULL;
         // length
         {
             char *dummy = NULL;
--- a/src/metronom/metronom.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/metronom/metronom.c	Thu Jul 19 00:50:01 2007 +0000
@@ -19,11 +19,12 @@
 
 #include <audacious/plugin.h>
 #include <audacious/util.h>
+#include <audacious/i18n.h>
 #include "../../config.h"
 #include <glib.h>
 #include <string.h>
 
-#define MIN_BPM 1 
+#define MIN_BPM 1
 #define MAX_BPM 512
 
 static InputPlugin metronom_ip;
@@ -77,8 +78,8 @@
 {
 	static GtkWidget *box;
 	box = xmms_show_message(
-		"About Metronom",
-		"A Tact Generator by Martin Strau? <mys@faveve.uni-stuttgart.de>\n\nTo use it, add a URL: tact://beats*num/den\ne.g. tact://77 to play 77 beats per minute\nor   tact://60*3/4 to play 60 bpm in 3/4 tacts", "Ok",
+		_("About Metronom"),
+		_("A Tact Generator by Martin Strauss <mys@faveve.uni-stuttgart.de>\n\nTo use it, add a URL: tact://beats*num/den\ne.g. tact://77 to play 77 beats per minute\nor   tact://60*3/4 to play 60 bpm in 3/4 tacts"), _("Ok"),
 		FALSE, NULL, NULL);
 	gtk_signal_connect(GTK_OBJECT(box), "destroy",
 			   GTK_SIGNAL_FUNC(gtk_widget_destroyed), &box);
@@ -101,14 +102,14 @@
 	InputPlayback *playback = arg;
 	metronom_t *pmetronom=(metronom_t *)playback->data;
 	gint i;
-	
+
 	gint16 t = 0,tact;
 	gint16 datagoal = 0;
 	gint16 datamiddle = 0;
 	gint16 datacurrent = datamiddle;
 	gint16 datalast = datamiddle;
 	gint16 data_form[tact_form_max];
-	gint num;	
+	gint num;
 
 	tact = 60*44100/pmetronom->bpm;
 	/* prepare weighted amplitudes */
@@ -132,8 +133,8 @@
 				/* circle through weighted amplitudes */
 				num++;
 				if(num==pmetronom->num)num=0;
-			} 
-			/* makes curve a little bit smoother  */ 
+			}
+			/* makes curve a little bit smoother  */
 			data[i]=(datalast+datacurrent+datagoal)/3;
 			datalast=datacurrent;
 			datacurrent=data[i];
@@ -156,7 +157,7 @@
 {
         char *filename = playback->filename;
 	gchar *name;
-	size_t count;	
+	size_t count;
 	metronom_t *pmetronom;
 	gint flag,id;
 
@@ -181,7 +182,7 @@
 		}
 		if(!flag)return;
 	}
-	
+
 	going = TRUE;
 	audio_error = FALSE;
 	if (playback->output->open_audio(FMT_S16_LE, 44100, 1) == 0)
@@ -191,9 +192,9 @@
 		return;
 	}
 	if(pmetronom->num==1 && pmetronom->den==1){
-		name = g_strdup_printf("Tact generator: %d bpm", pmetronom->bpm);
+		name = g_strdup_printf(_("Tact generator: %d bpm"), pmetronom->bpm);
 	} else {
-		name = g_strdup_printf("Tact generator: %d bpm %d/%d", pmetronom->bpm,pmetronom->num,pmetronom->den);
+		name = g_strdup_printf(_("Tact generator: %d bpm %d/%d"), pmetronom->bpm,pmetronom->num,pmetronom->den);
 	}
 	metronom_ip.set_info(name, -1, 16 * 44100, 44100, 1);
 	g_free(name);
@@ -253,15 +254,15 @@
 	}
 
 	if(pmetronom->num==1 && pmetronom->den==1){
-		*title = g_strdup_printf("Tact generator: %d bpm", pmetronom->bpm);
+		*title = g_strdup_printf(_("Tact generator: %d bpm"), pmetronom->bpm);
 	} else {
-		*title = g_strdup_printf("Tact generator: %d bpm %d/%d", pmetronom->bpm,pmetronom->num,pmetronom->den);
+		*title = g_strdup_printf(_("Tact generator: %d bpm %d/%d"), pmetronom->bpm,pmetronom->num,pmetronom->den);
 	}
 }
-		
-	
-	
-static InputPlugin metronom_ip = 
+
+
+
+static InputPlugin metronom_ip =
 {
 	NULL,
 	NULL,
--- a/src/paranormal/paranormal.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/paranormal/paranormal.c	Thu Jul 19 00:50:01 2007 +0000
@@ -13,7 +13,6 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
-#include <gdk/gdkx.h>
 
 #include "paranormal.h"
 #include "actuators.h"
--- a/src/scrobbler/gtkstuff.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/scrobbler/gtkstuff.c	Thu Jul 19 00:50:01 2007 +0000
@@ -17,10 +17,10 @@
 	if (aboutbox)
 		return;
 
-	tmp = g_strdup_printf("Audacious AudioScrobbler Plugin\n\n"
-				"Originally created by Audun Hove <audun@nlc.no> and Pipian <pipian@pipian.com>\n");
+	tmp = g_strdup_printf(_("Audacious AudioScrobbler Plugin\n\n"
+				"Originally created by Audun Hove <audun@nlc.no> and Pipian <pipian@pipian.com>\n"));
 	aboutbox = xmms_show_message(_("About Scrobbler Plugin"),
-			_(tmp),
+			tmp,
 			_("Ok"), FALSE, NULL, NULL);
 
 	g_free(tmp);
@@ -32,14 +32,14 @@
 {
 	gchar *tmp;
 
-	tmp = g_strdup_printf("There has been an error"
+	tmp = g_strdup_printf(_("There has been an error"
 			" that may require your attention.\n\n"
 			"Contents of server error:\n\n"
-			"%s\n",
+			"%s\n"),
 			errortxt);
 
-	xmms_show_message("Scrobbler Error",
+	xmms_show_message(_("Scrobbler Error"),
 			tmp,
-			"OK", FALSE, NULL, NULL);
+			_("OK"), FALSE, NULL, NULL);
 	g_free(tmp);
 }
--- a/src/tta/libtta.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/tta/libtta.c	Thu Jul 19 00:50:01 2007 +0000
@@ -235,11 +235,17 @@
 		    playback->output->flush (seek_position * SEEK_STEP);
 		    seek_position = -1;
 		}
+		if(!playing)
+			goto DONE;
 	    }
 
 	    playback->output->buffer_free ();
 	    playback->output->buffer_free ();
-	    xmms_usleep(10000);
+	    while (playback->output->buffer_playing()) {
+		    xmms_usleep(10000);
+		    if(!playing)
+			    goto DONE;
+	    }
 	}
 
 DONE:
--- a/src/vorbis/Makefile	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/vorbis/Makefile	Thu Jul 19 00:50:01 2007 +0000
@@ -1,7 +1,7 @@
 include ../../mk/rules.mk
 include ../../mk/init.mk
 
-OBJECTIVE_LIBS = libvorbis$(SHARED_SUFFIX)
+OBJECTIVE_LIBS = libvorbisplugin$(SHARED_SUFFIX)
 
 LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
 
--- a/src/vorbis/fileinfo.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/vorbis/fileinfo.c	Thu Jul 19 00:50:01 2007 +0000
@@ -1014,8 +1014,12 @@
     gtk_entry_set_text(GTK_ENTRY(location_entry),
                        get_comment(comment, "location"));
 #endif
-                       
-    filename_utf8 = filename_to_utf8(vte.filename);
+    {
+        gchar *realfn = NULL;
+        realfn = g_filename_from_uri(vte.filename, NULL, NULL);
+        filename_utf8 = filename_to_utf8(realfn ? realfn : vte.filename);
+        g_free(realfn); realfn = NULL;
+    }
 
     title = g_strdup_printf(_("%s - Audacious"), g_basename(filename_utf8));
     gtk_window_set_title(GTK_WINDOW(window), title);
@@ -1063,6 +1067,14 @@
                              save_button);
     g_signal_connect_swapped(GTK_COMBO(genre_combo)->entry, "changed",
                              G_CALLBACK(change_buttons), save_button);
+    g_signal_connect_swapped(rg_track_entry, "changed", change_buttons,
+                             save_button);
+    g_signal_connect_swapped(rg_track_peak_entry, "changed", change_buttons,
+                             save_button);
+    g_signal_connect_swapped(rg_album_entry, "changed", change_buttons,
+                             save_button);
+    g_signal_connect_swapped(rg_album_peak_entry, "changed", change_buttons,
+                             save_button);
 
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
     gtk_widget_show_all(window);
--- a/src/vorbis/vorbis.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/vorbis/vorbis.c	Thu Jul 19 00:50:01 2007 +0000
@@ -751,12 +751,14 @@
 {
     TitleInput *tuple = NULL;
     vorbis_comment *comment;
-
+    gchar *realfn = NULL;
     tuple = bmp_title_input_new();
 
-    tuple->file_name = g_path_get_basename(filename);
-    tuple->file_ext = get_extension(filename);
-    tuple->file_path = g_path_get_dirname(filename);
+    realfn = g_filename_from_uri(filename, NULL, NULL);
+    tuple->file_name = g_path_get_basename(realfn ? realfn : filename);
+    tuple->file_ext = get_extension(realfn ? realfn : filename);
+    tuple->file_path = g_path_get_dirname(realfn ? realfn : filename);
+    g_free(realfn); realfn = NULL;
 
     /* Retrieve the length */
     if (is_stream == FALSE)
--- a/src/wav/wav-sndfile.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/wav/wav-sndfile.c	Thu Jul 19 00:50:01 2007 +0000
@@ -95,9 +95,15 @@
 {
 	SNDFILE	*tmp_sndfile;
 	SF_INFO tmp_sfinfo;
+	gchar *realfn = NULL;
 
-	if (! (tmp_sndfile = sf_open (filename, SFM_READ, &tmp_sfinfo)))
+	realfn = g_filename_from_uri(filename, NULL, NULL);
+	tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo);
+	g_free(realfn); realfn = NULL;
+
+	if (!tmp_sndfile) {
 		return 0;
+	}
 
 	sf_close (tmp_sndfile);
 	tmp_sndfile = NULL;
@@ -111,7 +117,11 @@
 static gchar *get_title(char *filename)
 {
 	gchar *title;
-	title = g_path_get_basename(filename);
+	gchar *realfn = NULL;
+
+	realfn = g_filename_from_uri(filename, NULL, NULL);
+	title = g_path_get_basename(realfn ? realfn : filename);
+	g_free(realfn); realfn = NULL;
 	return title;
 }
 
@@ -132,22 +142,25 @@
 }
 
 static int
-is_our_file (char *fileuri)
+is_our_file (char *filename)
 {
 	SNDFILE	*tmp_sndfile;
 	SF_INFO tmp_sfinfo;
-	gchar *filename = g_filename_from_uri(fileuri, NULL, NULL);
+	gchar *realfn = NULL; 
+
+	realfn = g_filename_from_uri(filename, NULL, NULL);
 
 	/* Have to open the file to see if libsndfile can handle it. */
-	if (! (tmp_sndfile = sf_open (filename, SFM_READ, &tmp_sfinfo))) {
-		g_free(filename);
+	tmp_sndfile = sf_open (realfn ? realfn : filename, SFM_READ, &tmp_sfinfo);
+	g_free(realfn); realfn = NULL;
+
+	if (!tmp_sndfile) {
 		return FALSE;
-    }
+	}
 
 	/* It can so close file and return TRUE. */
 	sf_close (tmp_sndfile);
 	tmp_sndfile = NULL;
-	g_free(filename);
 
 	return TRUE;
 }
@@ -226,18 +239,21 @@
 static void
 play_start (InputPlayback *playback)
 {
-	gchar *filename = g_filename_from_uri(playback->filename, NULL, NULL);
+	gchar *realfn = NULL;
 	int pcmbitwidth;
 	gchar *song_title;
 
-	if (sndfile)
+	if (sndfile) /* already opened */
 		return;
 
 	pcmbitwidth = 32;
+	song_title = get_title(playback->filename);
 
-	song_title = get_title(filename);
+	realfn = g_filename_from_uri(playback->filename, NULL, NULL);
+	sndfile = sf_open (realfn ? realfn : playback->filename, SFM_READ, &sfinfo);
+	g_free(realfn); realfn = NULL;
 
-	if (! (sndfile = sf_open (filename, SFM_READ, &sfinfo)))
+	if (!sndfile)
 		return;
 
 	bit_rate = sfinfo.samplerate * pcmbitwidth;
@@ -307,12 +323,10 @@
 }
 
 static void
-get_song_info (char *fileuri, char **title, int *length)
+get_song_info (char *filename, char **title, int *length)
 {
-	gchar *filename = g_filename_from_uri(fileuri, NULL, NULL);
 	(*length) = get_song_length(filename);
 	(*title) = get_title(filename);
-	g_free(filename);
 }
 
 static void wav_about(void)
--- a/src/wavpack/Makefile	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/wavpack/Makefile	Thu Jul 19 00:50:01 2007 +0000
@@ -1,7 +1,7 @@
 include ../../mk/rules.mk
 include ../../mk/init.mk
 
-OBJECTIVE_LIBS = libwavpack$(SHARED_SUFFIX)
+OBJECTIVE_LIBS = libwavpackplugin$(SHARED_SUFFIX)
 
 LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
 
--- a/src/xspf/xspf.c	Fri Jul 13 02:00:46 2007 +0000
+++ b/src/xspf/xspf.c	Thu Jul 19 00:50:01 2007 +0000
@@ -58,6 +58,7 @@
         return FALSE;
 }
 
+#if 0
 static gboolean is_remote(gchar *uri)
 {
     if(strstr(uri, "file://"))
@@ -68,6 +69,7 @@
     else
         return FALSE;
 }
+#endif
 
 // this function is taken from libxml2-2.6.27.
 static xmlChar *audPathToURI(const xmlChar *path)
@@ -110,19 +112,16 @@
         if(nptr->type == XML_ELEMENT_NODE
            && !xmlStrcmp(nptr->name, (xmlChar *)"location")) {
             gchar *str = (gchar *)xmlNodeGetContent(nptr);
-            gchar *tmp;
+            gchar *tmp = NULL;
 
-            if(!is_remote(str)) {   /* local file */
-                tmp = (gchar *)xmlURIUnescapeString(str, -1, NULL);
-            }
-            else {              /* streaming */
-                tmp = g_strdup(str);
-            }
+            // tmp is escaped uri or a part of escaped uri.
+            tmp = g_strdup_printf("%s%s", base ? base : "", str);
+            location = g_filename_from_uri(tmp, NULL, NULL);
+            if(!location) // http:// or something.
+                location = g_strdup(tmp);
 
-            location = g_strdup_printf("%s%s", base ? base : "", tmp);
-
-            xmlFree(str);
-            g_free(tmp);
+            xmlFree(str); str = NULL;
+            g_free(tmp); tmp = NULL;
         }
         else if(nptr->type == XML_ELEMENT_NODE
                 && !xmlStrcmp(nptr->name, (xmlChar *)"title")) {
@@ -196,11 +195,19 @@
     }
 
     if(location) {
+        gchar *uri = NULL;
         tuple->file_name = g_path_get_basename(location);
         tuple->file_path = g_path_get_dirname(location);
+#ifdef DEBUG
+        printf("xspf: tuple->file_name = %s\n", tuple->file_name);
+        printf("xspf: tuple->file_path = %s\n", tuple->file_path);
+#endif
         tuple->file_ext = g_strdup(strrchr(location, '.'));
         // add file to playlist
-        playlist_load_ins_file_tuple(playlist, location, filename, pos, tuple);
+        uri = g_filename_to_uri(location, NULL, NULL);
+        // uri would be NULL if location is already uri. --yaz
+        playlist_load_ins_file_tuple(playlist, uri ? uri: location, filename, pos, tuple);
+        g_free(uri); uri = NULL;
         pos++;
     }
 
@@ -245,9 +252,12 @@
 {
     xmlDocPtr doc;
     xmlNode *nptr, *nptr2;
+    gchar *tmp = NULL;
 
     g_return_if_fail(filename != NULL);
-
+#ifdef DEBUG
+    printf("playlist_load_xspf: filename = %s\n", filename);
+#endif
     doc = xmlParseFile(filename);
     if(doc == NULL)
         return;
@@ -261,21 +271,21 @@
            && !xmlStrcmp(nptr->name, (xmlChar *)"playlist")) {
             base = (gchar *)xmlNodeGetBase(doc, nptr);
 #ifdef DEBUG
-            printf("load: base = %s\n", base);
+            printf("playlist_load_xspf: base @1 = %s\n", base);
 #endif
-            {
-                gchar *tmp = xmlURIUnescapeString(base, -1, NULL);
-                if(tmp) {
-                    g_free(base);
-                    base = tmp;
+            // if filename is specified as a base, ignore it.
+            tmp = xmlURIUnescapeString(base, -1, NULL);
+            if(tmp) {
+                if(!strcmp(tmp, filename)) {   
+                    xmlFree(base);
+                    base = NULL;
                 }
+                g_free(tmp);
+                tmp = NULL;
             }
-
-            if(!strcmp(base, filename)) {   // filename is specified as a base URI. ignore.
-                xmlFree(base);
-                base = NULL;
-            }
-
+#ifdef DEBUG
+            printf("playlist_load_xspf: base @2 = %s\n", base);
+#endif
             for(nptr2 = nptr->children; nptr2 != NULL; nptr2 = nptr2->next) {
 
                 if(nptr2->type == XML_ELEMENT_NODE
@@ -307,6 +317,9 @@
     gint baselen = 0;
     Playlist *playlist = playlist_get_active();
 
+#ifdef DEBUG
+    printf("playlist_save_xspf: filename = %s\n", filename);
+#endif
     xmlFree(base);
     base = NULL;
 
@@ -320,6 +333,8 @@
     xmlSetProp(rootnode, (xmlChar *)"xmlns", (xmlChar *)XSPF_XMLNS);
 
     PLAYLIST_LOCK(playlist->mutex);
+
+    /* relative */
     if(playlist->attribute & PLAYLIST_USE_RELATIVE) {
         /* prescan to determine base uri */
         for(node = playlist->entries; node != NULL; node = g_list_next(node)) {
@@ -328,14 +343,13 @@
             gchar *tmp;
             gint tmplen = 0;
 
-            if(!is_uri(entry->filename)) {
+            if(!is_uri(entry->filename)) { //obsolete
                 gchar *tmp2;
                 tmp2 = g_path_get_dirname(entry->filename);
                 tmp = g_strdup_printf("%s/", tmp2);
-                g_free(tmp2);
-                tmp2 = NULL;
+                g_free(tmp2); tmp2 = NULL;
             }
-            else {
+            else { //uri
                 tmp = g_strdup(entry->filename);
             }
 
@@ -376,9 +390,11 @@
                     base = tmp;
                 }
             }
-//            xmlNodeSetBase(rootnode, base); // it blindly escapes characters.
 
             if(!is_uri(base)) {
+#ifdef DEBUG
+                printf("base is not uri. something is wrong.\n");
+#endif
                 tmp = g_strdup_printf("file://%s", base);
                 xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)tmp);
                 g_free(tmp);
@@ -389,7 +405,7 @@
         }
     }                           /* USE_RELATIVE */
 
-
+    /* common */
     xmlDocSetRootElement(doc, rootnode);
 
     tmp = xmlNewNode(NULL, (xmlChar *)"creator");
@@ -413,8 +429,6 @@
     tracklist = xmlNewNode(NULL, (xmlChar *)"trackList");
     xmlAddChild(rootnode, tracklist);
 
-//  PLAYLIST_LOCK(playlist->mutex);
-
     for(node = playlist->entries; node != NULL; node = g_list_next(node)) {
         PlaylistEntry *entry = PLAYLIST_ENTRY(node->data);
         xmlNodePtr track, location;
@@ -423,31 +437,26 @@
         track = xmlNewNode(NULL, (xmlChar *)"track");
         location = xmlNewNode(NULL, (xmlChar *)"location");
 
-        if(is_uri(entry->filename)) {   /* remote uri */
-            gchar *tmp = NULL;
+        if(is_uri(entry->filename)) {   /* uri */
 #ifdef DEBUG
             printf("filename is uri\n");
 #endif
-            tmp = (gchar *)xmlURIEscape((xmlChar *)entry->filename);
-            filename = g_strdup(entry->filename + baselen);
-            g_free(tmp);
-            tmp = NULL;
+            filename = g_strdup(entry->filename + baselen); // entry->filename is always uri now.
         }
-        else {                  /* local file */
+        else {                  /* local file (obsolete) */
             gchar *tmp =
                 (gchar *)audPathToURI((const xmlChar *)entry->filename + baselen);
-            if(base) {
+            if(base) { /* relative */
                 filename = g_strdup_printf("%s", tmp);
             }
             else {
 #ifdef DEBUG
-                printf("absolule, local\n");
+                printf("absolute and local (obsolete)\n");
 #endif
-                filename = g_strdup_printf("file://%s", tmp);
+                filename = g_filename_to_uri(tmp, NULL, NULL);
             }
-            g_free(tmp);
-            tmp = NULL;
-        }
+            g_free(tmp); tmp = NULL;
+        } /* obsolete */
 
         if(!g_utf8_validate(filename, -1, NULL))
             continue;