changeset 4573:11f7874f3a95

add audacious_drct_get_length
author Tomasz Mon <desowin@gmail.com>
date Wed, 21 May 2008 13:12:39 +0200
parents a01120279caf
children 744953f257fb 92952061147d
files src/audacious/auddrct.c src/audacious/auddrct.h src/audacious/plugin.h src/audacious/pluginenum.c
diffstat 4 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/auddrct.c	Wed May 21 13:53:20 2008 +0300
+++ b/src/audacious/auddrct.c	Wed May 21 13:12:39 2008 +0200
@@ -157,6 +157,15 @@
     return time;
 }
 
+gint
+drct_get_length ( void )
+{
+    if (playback_get_playing())
+        return playback_get_length();
+    else
+        return -1;
+}
+
 void
 drct_seek ( guint pos )
 {
--- a/src/audacious/auddrct.h	Wed May 21 13:53:20 2008 +0300
+++ b/src/audacious/auddrct.h	Wed May 21 13:12:39 2008 +0200
@@ -47,6 +47,7 @@
 gboolean drct_get_stopped ( void );
 void drct_get_info( gint *rate, gint *freq, gint *nch);
 gint drct_get_time ( void );
+gint drct_get_length ( void );
 void drct_seek ( guint pos );
 void drct_get_volume( gint *vl, gint *vr );
 void drct_set_volume( gint vl, gint vr );
--- a/src/audacious/plugin.h	Wed May 21 13:53:20 2008 +0300
+++ b/src/audacious/plugin.h	Wed May 21 13:12:39 2008 +0200
@@ -555,6 +555,7 @@
     gboolean (*drct_get_stopped)( void );
     void (*drct_get_info)( gint *rate, gint *freq, gint *nch);
     gint (*drct_get_time )( void );
+    gint (*drct_get_length )( void );
     void (*drct_seek) ( guint pos );
     void (*drct_get_volume)( gint *vl, gint *vr );
     void (*drct_set_volume)( gint vl, gint vr );
@@ -911,6 +912,7 @@
 #define audacious_drct_get_stopped		_audvt->drct_get_stopped
 #define audacious_drct_get_info			_audvt->drct_get_info
 #define audacious_drct_get_time			_audvt->drct_get_time
+#define audacious_drct_get_length               _audvt->drct_get_length
 #define audacious_drct_seek			_audvt->drct_seek
 #define audacious_drct_get_volume		_audvt->drct_get_volume
 #define audacious_drct_set_volume		_audvt->drct_set_volume
--- a/src/audacious/pluginenum.c	Wed May 21 13:53:20 2008 +0300
+++ b/src/audacious/pluginenum.c	Wed May 21 13:12:39 2008 +0200
@@ -317,6 +317,7 @@
     .drct_get_stopped = drct_get_stopped,
     .drct_get_info = drct_get_info,
     .drct_get_time = drct_get_time,
+    .drct_get_length = drct_get_length,
     .drct_seek = drct_seek,
     .drct_get_volume = drct_get_volume,
     .drct_set_volume = drct_set_volume,