changeset 1784:641ee4092aea trunk

[svn] - allow the menurow to be set invisible - add mimetype to np.sh - revert js's change
author nenolod
date Wed, 04 Oct 2006 15:27:00 -0700
parents 9ed09a2c878e
children e360fad09415
files ChangeLog audacious/mainwin.c audacious/widgets/skin.c audacious/widgets/skin.h audtool/examples/np.sh
diffstat 5 files changed, 35 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 04 12:47:37 2006 -0700
+++ b/ChangeLog	Wed Oct 04 15:27:00 2006 -0700
@@ -1,3 +1,13 @@
+2006-10-04 19:47:37 +0000  Jonathan Schleifer <js@h3c.de>
+  revision [2523]
+  The default values for old skins were wrong. But since changing from
+  the new skin to an old doesn't work anyway, we can set these to 0 so
+  that the old skins at least work when Audacious is restarted.
+  
+  trunk/audacious/widgets/skin.c |   14 ++++++++++----
+  1 file changed, 10 insertions(+), 4 deletions(-)
+
+
 2006-10-04 11:17:35 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2521]
   - 1.2 skin, EARLY VERSION OF IT. I am *sure* nhjm449 will tweak it a lot.
--- a/audacious/mainwin.c	Wed Oct 04 12:47:37 2006 -0700
+++ b/audacious/mainwin.c	Wed Oct 04 15:27:00 2006 -0700
@@ -830,6 +830,7 @@
 	widget_hide(WIDGET(mainwin_othertext));
     }
 
+    /* positioning and size attributes */
     if (bmp_active_skin->properties.mainwin_vis_x && bmp_active_skin->properties.mainwin_vis_y)
 	widget_move(WIDGET(mainwin_vis), bmp_active_skin->properties.mainwin_vis_x,
 		bmp_active_skin->properties.mainwin_vis_y);
@@ -873,6 +874,12 @@
     if (bmp_active_skin->properties.mainwin_playstatus_x && bmp_active_skin->properties.mainwin_playstatus_y)
 	widget_move(WIDGET(mainwin_playstatus), bmp_active_skin->properties.mainwin_playstatus_x,
 		bmp_active_skin->properties.mainwin_playstatus_y);
+
+    /* visibility attributes */
+    if (bmp_active_skin->properties.mainwin_menurow_visible)
+        widget_show(WIDGET(mainwin_menurow));
+    else
+        widget_hide(WIDGET(mainwin_menurow));
 }
 
 void
--- a/audacious/widgets/skin.c	Wed Oct 04 12:47:37 2006 -0700
+++ b/audacious/widgets/skin.c	Wed Oct 04 15:27:00 2006 -0700
@@ -530,16 +530,12 @@
 
     path_p = path_p ? path_p : skin->path;
 
-    /*
-     * Changing from the new skin to an old skin doesn't work yet, so we can
-     * as well set these defaults to 0 so that old skins at least work when
-     * Audacious is restarted. The values commented out are the wrong values
-     * which were here before.
-     */
-    skin->properties.mainwin_othertext = 0;	/*  0 */
-    skin->properties.mainwin_vis_x = 0;		/* 24 */
-    skin->properties.mainwin_vis_y = 0;		/* 43 */
-    skin->properties.mainwin_vis_width = 0;	/* 76 */
+    skin->properties.mainwin_othertext = FALSE;
+    skin->properties.mainwin_vis_x = 24;
+    skin->properties.mainwin_vis_y = 43;
+    skin->properties.mainwin_vis_width = 76;
+
+    skin->properties.mainwin_menurow_visible = TRUE;
 
     filename = find_file_recursively(path_p, "skin.hints");
 
@@ -718,6 +714,14 @@
         g_free(tmp);
     }
 
+    tmp = read_ini_string(filename, "skin", "mainwinMenurowVisible");
+
+    if (tmp != NULL)
+    {
+        skin->properties.mainwin_menurow_visible = atoi(tmp);
+        g_free(tmp);
+    }
+
     g_free(filename);
 }
 
--- a/audacious/widgets/skin.h	Wed Oct 04 12:47:37 2006 -0700
+++ b/audacious/widgets/skin.h	Wed Oct 04 15:27:00 2006 -0700
@@ -99,6 +99,8 @@
 
 	gint mainwin_playstatus_x;
 	gint mainwin_playstatus_y;
+
+	gboolean mainwin_menurow_visible;
 } SkinProperties;
 
 #define SKIN_PIXMAP(x)  ((SkinPixmap *)(x))
--- a/audtool/examples/np.sh	Wed Oct 04 12:47:37 2006 -0700
+++ b/audtool/examples/np.sh	Wed Oct 04 15:27:00 2006 -0700
@@ -2,5 +2,6 @@
 SONGTITLE=$(audtool current-song)
 SONGELAPSED=$(audtool current-song-output-length)
 SONGLEN=$(audtool current-song-length)
+MIME=$(file -ib "`audtool current-song-filename`")
 
-echo "np: $SONGTITLE ($SONGELAPSED/$SONGLEN)"
+echo "np: $SONGTITLE [$MIME] ($SONGELAPSED/$SONGLEN)"