changeset 1163:ff71f891265b trunk

[svn] - Allow to do format detection on demand; instead of immediately on add
author nenolod
date Sat, 10 Jun 2006 21:02:24 -0700
parents 0e5e176379e9
children ea95c89c92ee
files audacious/glade/prefswin.glade audacious/main.c audacious/main.h audacious/playlist.c audacious/prefswin.c
diffstat 5 files changed, 64 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/audacious/glade/prefswin.glade	Sat Jun 10 18:47:51 2006 -0700
+++ b/audacious/glade/prefswin.glade	Sat Jun 10 21:02:24 2006 -0700
@@ -2081,7 +2081,7 @@
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Always refresh the file dialog (this will slow opening the dialog on large directories, and Gnome VFS should handle automatically).</property>
 			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Always refresh directory when opening file dialog, should be unneeded with Gnome VFS.</property>
+			      <property name="label" translatable="yes">Always refresh directory when opening file dialog</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
 			      <property name="focus_on_click">True</property>
@@ -2115,7 +2115,7 @@
 			  <child>
 			    <widget class="GtkLabel" id="label60">
 			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">&lt;b&gt;Song display&lt;/b&gt;</property>
+			      <property name="label" translatable="yes">&lt;b&gt;Song Display&lt;/b&gt;</property>
 			      <property name="use_underline">False</property>
 			      <property name="use_markup">True</property>
 			      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2294,8 +2294,8 @@
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
 			</packing>
 		      </child>
 		    </widget>
@@ -3617,7 +3617,7 @@
 		      <child>
 			<widget class="GtkLabel" id="label83">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">&lt;b&gt;Audio Quality&lt;/b&gt;</property>
+			  <property name="label" translatable="yes">&lt;b&gt;Format Detection&lt;/b&gt;</property>
 			  <property name="use_underline">False</property>
 			  <property name="use_markup">True</property>
 			  <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -3642,7 +3642,39 @@
 		  </child>
 
 		  <child>
-		    <placeholder/>
+		    <widget class="GtkAlignment" id="alignment84">
+		      <property name="visible">True</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xscale">1</property>
+		      <property name="yscale">1</property>
+		      <property name="top_padding">0</property>
+		      <property name="bottom_padding">0</property>
+		      <property name="left_padding">12</property>
+		      <property name="right_padding">0</property>
+
+		      <child>
+			<widget class="GtkCheckButton" id="audio_format_det_cb">
+			  <property name="visible">True</property>
+			  <property name="tooltip" translatable="yes">When checked, Audacious will detect file formats on demand. This can result in a messier playlist, but delivers a major speed benefit.</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">Detect file formats on demand, instead of immediately.</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
+			  <signal name="realize" handler="on_audio_format_det_cb_realize" last_modification_time="Sun, 11 Jun 2006 03:09:01 GMT"/>
+			  <signal name="toggled" handler="on_audio_format_det_cb_toggled" last_modification_time="Sun, 11 Jun 2006 04:21:11 GMT"/>
+			</widget>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
 		  </child>
 
 		  <child>
--- a/audacious/main.c	Sat Jun 10 18:47:51 2006 -0700
+++ b/audacious/main.c	Sat Jun 10 21:02:24 2006 -0700
@@ -198,7 +198,8 @@
     TRUE,			/* show seperators in pl */
     NULL,
     NULL,
-    3000,
+    3000,			/* audio buffer size */
+    TRUE,			/* whether or not to do format detection on initial add */
 };
 
 typedef struct bmp_cfg_boolent_t {
@@ -289,6 +290,7 @@
     {"close_dialog_open", &cfg.close_dialog_open, TRUE},
     {"close_dialog_add", &cfg.close_dialog_add, TRUE},
     {"resume_playback_on_startup", &cfg.resume_playback_on_startup, TRUE},
+    {"playlist_detect", &cfg.playlist_detect, TRUE},
 };
 
 static gint ncfgbent = G_N_ELEMENTS(bmp_boolents);
--- a/audacious/main.h	Sat Jun 10 18:47:51 2006 -0700
+++ b/audacious/main.h	Sat Jun 10 21:02:24 2006 -0700
@@ -110,6 +110,7 @@
     gchar *chardet_detector;
     gchar *chardet_fallback;
     gint output_buffer_size;
+    gboolean playlist_detect;
 };
 
 typedef struct _BmpConfig BmpConfig;
--- a/audacious/playlist.c	Sat Jun 10 18:47:51 2006 -0700
+++ b/audacious/playlist.c	Sat Jun 10 21:02:24 2006 -0700
@@ -508,12 +508,12 @@
         return TRUE;
     }
 
-    if (loading_playlist == TRUE)
+    if (loading_playlist == TRUE || cfg.playlist_detect == FALSE)
 	dec = NULL;
     else
 	dec = input_check_file(filename, TRUE);
 
-    if (loading_playlist == TRUE || (loading_playlist == FALSE && dec != NULL))
+    if (cfg.playlist_detect == FALSE || loading_playlist == TRUE || (loading_playlist == FALSE && dec != NULL))
     {
 	__playlist_ins(filename, pos, dec);
 	playlist_generate_shuffle_list();
@@ -1375,7 +1375,7 @@
         if ((tmp = strrchr(path, '/')))
             *tmp = '\0';
         else {
-	    if (loading_playlist != TRUE)
+	    if (loading_playlist != TRUE || cfg.playlist_detect == FALSE)
 	        dec = input_check_file(filename, FALSE);
 	    else
 		dec = NULL;
@@ -1385,7 +1385,7 @@
         }
         tmp = g_build_filename(path, filename, NULL);
 
-	if (loading_playlist != TRUE)
+	if (loading_playlist != TRUE || cfg.playlist_detect == FALSE)
 	    dec = input_check_file(tmp, FALSE);
 	else
 	    dec = NULL;
@@ -1396,7 +1396,7 @@
     }
     else
     {
-	if (loading_playlist != TRUE)
+	if (loading_playlist != TRUE || cfg.playlist_detect == FALSE)
 	    dec = input_check_file(filename, FALSE);
 	else
 	    dec = NULL;
--- a/audacious/prefswin.c	Sat Jun 10 18:47:51 2006 -0700
+++ b/audacious/prefswin.c	Sat Jun 10 21:02:24 2006 -0700
@@ -972,6 +972,21 @@
     draw_playlist_window(TRUE);
 }
 
+/* format detection */
+static void
+on_audio_format_det_cb_toggled(GtkToggleButton * button,
+                                    gpointer data)
+{
+    cfg.playlist_detect = gtk_toggle_button_get_active(button);
+}
+
+static void
+on_audio_format_det_cb_realize(GtkToggleButton * button,
+                                    gpointer data)
+{
+    gtk_toggle_button_set_active(button, cfg.playlist_detect);
+}
+
 /* proxy */
 static void
 on_proxy_use_realize(GtkToggleButton * button,
@@ -2023,6 +2038,8 @@
     FUNC_MAP_ENTRY(on_chardet_fallback_changed)
     FUNC_MAP_ENTRY(on_output_plugin_bufsize_realize)
     FUNC_MAP_ENTRY(on_output_plugin_bufsize_value_changed)
+    FUNC_MAP_ENTRY(on_audio_format_det_cb_toggled)
+    FUNC_MAP_ENTRY(on_audio_format_det_cb_realize)
 FUNC_MAP_END
 
 void