changeset 2775:7adb736cb824 trunk

[svn] - auddrct: more calls implemented (part 7) - almost all of playlist and playqueue functions are implemented. be careful in using new functions, these are not tested yet.
author yaz
date Wed, 16 May 2007 22:50:52 -0700
parents 57363f3ded79
children 63fbbe9775a6
files ChangeLog src/audacious/auddrct.c src/audacious/auddrct.h src/audacious/build_stamp.c
diffstat 4 files changed, 130 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 16 00:46:17 2007 -0700
+++ b/ChangeLog	Wed May 16 22:50:52 2007 -0700
@@ -1,3 +1,13 @@
+2007-05-16 07:46:17 +0000  Stephen Sokolow <deitarion@gmail.com>
+  revision [4574]
+  xchat-audacious.py:
+  - One final clean-up.
+  - Bump the version number (like I should have done two revisions ago when I fixed that bug)
+  
+  trunk/contrib/xchat-audacious.py |   47 +++++++++++++++------------------------
+  1 file changed, 19 insertions(+), 28 deletions(-)
+
+
 2007-05-16 07:24:43 +0000  Stephen Sokolow <deitarion@gmail.com>
   revision [4572]
   A few more xchat-audacious.py corrections:
--- a/src/audacious/auddrct.c	Wed May 16 00:46:17 2007 -0700
+++ b/src/audacious/auddrct.c	Wed May 16 22:50:52 2007 -0700
@@ -29,6 +29,7 @@
 #include "ui_equalizer.h"
 #include "ui_jumptotrack.h"
 #include "auddrct.h"
+#include "playlist.h"
 
 
 /* player */
@@ -352,3 +353,100 @@
   mainwin_set_info_text();
   return;
 }
+
+
+/* following functions are not tested yet. be careful. --yaz */
+void
+audacious_drct_pl_delete ( gint pos )
+{
+    GDK_THREADS_ENTER();
+    playlist_delete_index(playlist_get_active(), pos);
+    GDK_THREADS_LEAVE();
+}
+
+void
+audacious_drct_pl_set_pos( gint pos )
+{
+    Playlist *playlist = playlist_get_active();
+    if (pos < (guint)playlist_get_length(playlist))
+        playlist_set_position(playlist, pos);
+}
+
+gint
+audacious_drct_pl_get_length( void )
+{
+    return playlist_get_length(playlist_get_active());
+}
+
+void
+audacious_drct_pl_ins_url_string( gchar * string, gint pos )
+{
+    playlist_ins_url(playlist_get_active(), string, pos);
+}
+
+void
+audacious_drct_pl_add_url_string( gchar * string )
+{
+    GDK_THREADS_ENTER();
+    playlist_add_url(playlist_get_active(), string);
+    GDK_THREADS_LEAVE();
+}
+
+void
+audacious_drct_pl_enqueue_to_temp( gchar * string )
+{
+    Playlist *new_pl = playlist_new();
+
+    GDK_THREADS_ENTER();
+    playlist_select_playlist(new_pl);
+    playlist_add_url(new_pl, string);
+    GDK_THREADS_LEAVE();
+}
+
+
+/* playqueue */
+gint
+audacious_drct_pq_get_length( void )
+{
+    return playlist_queue_get_length(playlist_get_active());
+}
+
+void
+audacious_drct_pq_add( gint pos )
+{
+    Playlist *playlist = playlist_get_active();
+    if (pos < (guint)playlist_get_length(playlist))
+        playlist_queue_position(playlist, pos);
+}
+
+void
+audacious_drct_pq_remove( gint pos )
+{
+    Playlist *playlist = playlist_get_active();
+    if (pos < (guint)playlist_get_length(playlist))
+        playlist_queue_remove(playlist_get_active(), pos);
+}
+
+void
+audacious_drct_pq_clear( void )
+{
+    playlist_clear_queue(playlist_get_active());
+}
+
+gboolean
+audacious_drct_pq_is_queued( gint pos )
+{
+    return playlist_is_position_queued(playlist_get_active(), pos);
+}
+
+gint
+audacious_drct_pq_get_position( gint pos )
+{
+    return playlist_get_queue_position_number(playlist_get_active(), pos);
+}
+
+gint
+audaciuos_drct_pq_get_queue_position( gint pos )
+{
+    return playlist_get_queue_position_number(playlist_get_active(), pos);
+}
--- a/src/audacious/auddrct.h	Wed May 16 00:46:17 2007 -0700
+++ b/src/audacious/auddrct.h	Wed May 16 22:50:52 2007 -0700
@@ -20,6 +20,9 @@
 /* audacious_drct_* provides a handy interface for player
    plugins, originally intended for migration from xmms_remote_* calls */
 
+#ifndef AUDDRCT_H
+#define AUDDRCT_H
+
 #include <glib.h>
 
 /* player */
@@ -63,3 +66,21 @@
 gchar *audacious_drct_pl_get_file( gint pos );
 void audacious_drct_pl_add ( GList * list );
 void audacious_drct_pl_clear ( void );
+gint audacious_drct_pl_get_length( void );
+void audacious_drct_pl_delete ( gint pos );
+void audacious_drct_pl_set_pos( gint pos );
+gint audacious_drct_pl_get_length( void );
+void audacious_drct_pl_ins_url_string( gchar * string, gint pos );
+void audacious_drct_pl_add_url_string( gchar * string );
+void audacious_drct_pl_enqueue_to_temp( gchar * string );
+
+/* playqueue */
+gint audacious_drct_pq_get_length( void );
+void audacious_drct_pq_add( gint pos );
+void audacious_drct_pq_remove( gint pos );
+void audacious_drct_pq_clear( void );
+gboolean audacious_drct_pq_is_queued( gint pos );
+gint audacious_drct_pq_get_position( gint pos );
+gint audaciuos_drct_pq_get_queue_position( gint pos );
+
+#endif
--- a/src/audacious/build_stamp.c	Wed May 16 00:46:17 2007 -0700
+++ b/src/audacious/build_stamp.c	Wed May 16 22:50:52 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070516-4572";
+const gchar *svn_stamp = "20070516-4574";