changeset 2760:c2613269f913 trunk

[svn] - auddrct: more calls implemented (part 6)
author giacomo
date Sat, 12 May 2007 05:20:40 -0700
parents 0c9bb15a4321
children 7ddfc7b76b90
files ChangeLog src/audacious/auddrct.c src/audacious/auddrct.h src/audacious/build_stamp.c
diffstat 4 files changed, 108 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 11 21:57:25 2007 -0700
+++ b/ChangeLog	Sat May 12 05:20:40 2007 -0700
@@ -1,3 +1,11 @@
+2007-05-12 04:57:25 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [4544]
+  - encode songtitle in utf8 before passing to XChat.
+  
+  trunk/contrib/xchat-audacious.py |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2007-05-12 04:48:49 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4542]
   - fix /NEXT.
--- a/src/audacious/auddrct.c	Fri May 11 21:57:25 2007 -0700
+++ b/src/audacious/auddrct.c	Sat May 12 05:20:40 2007 -0700
@@ -28,6 +28,7 @@
 #include "ui_playlist.h"
 #include "ui_equalizer.h"
 #include "ui_jumptotrack.h"
+#include "auddrct.h"
 
 
 /* player */
@@ -178,14 +179,14 @@
 }
 
 void
-audacious_drct_get_volume( gint *vl, gint *vr )
+audacious_drct_get_volume ( gint *vl, gint *vr )
 {
   input_get_volume(vl, vr);
   return;
 }
 
 void
-audacious_drct_set_volume( gint vl, gint vr )
+audacious_drct_set_volume ( gint vl, gint vr )
 {
   if (vl > 100)
     vl = 100;
@@ -195,6 +196,75 @@
   return;
 }
 
+void
+audacious_drct_get_volume_main( gint *v )
+{
+  gint vl, vr;
+  audacious_drct_get_volume(&vl, &vr);
+  *v = (vl > vr) ? vl : vr;
+  return;
+}
+
+void
+audacious_drct_set_volume_main ( gint v )
+{
+  gint b, vl, vr;
+  audacious_drct_get_volume_balance(&b);
+  if (b < 0) {
+    vl = v;
+    vr = (v * (100 - abs(b))) / 100;
+  }
+  else if (b > 0) {
+    vl = (v * (100 - b)) / 100;
+    vr = v;
+  }
+  else
+    vl = vr = v;
+  audacious_drct_set_volume(vl, vr);
+}
+
+void
+audacious_drct_get_volume_balance ( gint *b )
+{
+  gint vl, vr;
+  input_get_volume(&vl, &vr);
+  if (vl < 0 || vr < 0)
+    *b = 0;
+  else if (vl > vr)
+    *b = -100 + ((vr * 100) / vl);
+  else if (vr > vl)
+    *b = 100 - ((vl * 100) / vr);
+  else
+    *b = 0;
+  return;
+}
+
+void
+audacious_drct_set_volume_balance ( gint b )
+{
+  gint v, vl, vr;
+  if (b < -100)
+    b = -100;
+  if (b > 100)
+    b = 100;
+  audacious_drct_get_volume_main(&v);
+  if (b < 0) {
+    vl = v;
+    vr = (v * (100 - abs(b))) / 100;
+  }
+  else if (b > 0) {
+    vl = (v * (100 - b)) / 100;
+    vr = v;
+  }
+  else
+  {
+    vl = v;
+    vr = v;
+  }
+  audacious_drct_set_volume(vl, vr);
+  return;
+}
+
 
 /* playlist */
 
@@ -261,3 +331,24 @@
 {
     return playlist_get_filename(playlist_get_active(), pos);
 }
+
+void
+audacious_drct_pl_add ( GList * list )
+{
+  GList *node = list;
+  while ( node != NULL )
+  {
+    playlist_add_url(playlist_get_active(), (gchar*)node->data);
+    node = g_list_next(node);
+  }
+  return;
+}
+
+void
+audacious_drct_pl_clear ( void )
+{
+  playlist_clear(playlist_get_active());
+  mainwin_clear_song_info();
+  mainwin_set_info_text();
+  return;
+}
--- a/src/audacious/auddrct.h	Fri May 11 21:57:25 2007 -0700
+++ b/src/audacious/auddrct.h	Sat May 12 05:20:40 2007 -0700
@@ -45,6 +45,10 @@
 void audacious_drct_seek ( guint pos );
 void audacious_drct_get_volume( gint *vl, gint *vr );
 void audacious_drct_set_volume( gint vl, gint vr );
+void audacious_drct_get_volume_main( gint *v );
+void audacious_drct_set_volume_main( gint v );
+void audacious_drct_get_volume_balance( gint *b );
+void audacious_drct_set_volume_balance( gint b );
 
 /* playlist */
 void audacious_drct_pl_next( void );
@@ -57,3 +61,5 @@
 gint audacious_drct_pl_get_time( gint pos );
 gint audacious_drct_pl_get_pos( void );
 gchar *audacious_drct_pl_get_file( gint pos );
+void audacious_drct_pl_add ( GList * list );
+void audacious_drct_pl_clear ( void );
--- a/src/audacious/build_stamp.c	Fri May 11 21:57:25 2007 -0700
+++ b/src/audacious/build_stamp.c	Sat May 12 05:20:40 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070512-4542";
+const gchar *svn_stamp = "20070512-4544";