]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.h
Separate libvlccore and libvlc flags, fix pthread linking on Debian Sid
[vlc] / projects / mozilla / vlcplugin.h
index 39e84b892338f3cfe9bfeaba5a89a4b679cda94f..ed109ae4ecbd124bacbf913f2ee5e11750bc6973 100644 (file)
@@ -1,12 +1,12 @@
 /*****************************************************************************
  * vlcplugin.h: a VLC plugin for Mozilla
  *****************************************************************************
- * Copyright (C) 2002-2008 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Damien Fouilleul <damienf@videolan.org>
- *         Jean-Paul Saman <jpsaman@videolan.org>
+ *          Jean-Paul Saman <jpsaman@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -92,7 +92,7 @@ public:
     {
         if( !libvlc_media_player )
         {
-             libvlc_exception_raise(ex,"null mediaplayer");
+             libvlc_exception_raise(ex,"no mediaplayer");
         }
         return libvlc_media_player;
     }
@@ -147,22 +147,51 @@ public:
     int      b_toolbar;
     char *   psz_target;
 
-    bool playlist_select(int,libvlc_exception_t *);
+    void playlist_play(libvlc_exception_t *ex)
+    {
+        if( libvlc_media_player||playlist_select(0,ex) )
+            libvlc_media_player_play(libvlc_media_player,ex);
+    }
+    void playlist_play_item(int idx,libvlc_exception_t *ex)
+    {
+        if( playlist_select(idx,ex) )
+            libvlc_media_player_play(libvlc_media_player,ex);
+    }
+    void playlist_stop(libvlc_exception_t *ex)
+    {
+        if( libvlc_media_player )
+            libvlc_media_player_stop(libvlc_media_player,ex);
+    }
+    void playlist_next(libvlc_exception_t *ex)
+    {
+        if( playlist_select(playlist_index+1,ex) )
+            libvlc_media_player_play(libvlc_media_player,ex);
+    }
+    void playlist_prev(libvlc_exception_t *ex)
+    {
+        if( playlist_select(playlist_index-1,ex) )
+            libvlc_media_player_play(libvlc_media_player,ex);
+    }
+    void playlist_pause(libvlc_exception_t *ex)
+    {
+        if( libvlc_media_player )
+            libvlc_media_player_pause(libvlc_media_player,ex);
+    }
+    int playlist_isplaying(libvlc_exception_t *ex)
+    {
+        int is_playing = 0;
+        if( libvlc_media_player )
+            is_playing = libvlc_media_player_is_playing(
+                                libvlc_media_player, ex );
+        return is_playing;
+    }
 
     int playlist_add( const char *, libvlc_exception_t * );
     int playlist_add_extended_untrusted( const char *, const char *, int,
                                 const char **, libvlc_exception_t * );
-    void playlist_play( libvlc_exception_t * );
-    void playlist_play_item( int, libvlc_exception_t * );
-    void playlist_stop( libvlc_exception_t * );
-    void playlist_next( libvlc_exception_t * );
-    void playlist_prev( libvlc_exception_t * );
-    void playlist_pause( libvlc_exception_t * );
     void playlist_delete_item( int, libvlc_exception_t * );
-
     void playlist_clear( libvlc_exception_t * );
-    int playlist_count( libvlc_exception_t * );
-    int playlist_isplaying( libvlc_exception_t * );
+    int  playlist_count( libvlc_exception_t * );
 
     void toggle_fullscreen( libvlc_exception_t * );
     void set_fullscreen( int, libvlc_exception_t * );
@@ -171,6 +200,7 @@ public:
     int  player_has_vout( libvlc_exception_t * );
 
 private:
+    bool playlist_select(int,libvlc_exception_t *);
     void set_player_window( libvlc_exception_t * );
 
     /* VLC reference */
@@ -270,6 +300,4 @@ private:
     /* XSPF */ \
     "application/xspf+xml:xspf:Playlist xspf;"
 
-
-
 #endif