]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.h
Don't ignore-config on the webplugin
[vlc] / projects / mozilla / vlcplugin.h
index 39e84b892338f3cfe9bfeaba5a89a4b679cda94f..517530e50287fad956f559148155e22b2bd3fb0d 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,8 @@ public:
     {
         if( !libvlc_media_player )
         {
-             libvlc_exception_raise(ex,"null mediaplayer");
+             libvlc_exception_raise(ex);
+             libvlc_printerr("no mediaplayer");
         }
         return libvlc_media_player;
     }
@@ -107,10 +108,6 @@ public:
     NPClass*            getScriptClass()
                             { return p_scriptClass; };
 
-    void                setLog(libvlc_log_t *log)
-                            { libvlc_log = log; };
-    libvlc_log_t*       getLog()
-                            { return libvlc_log; };
 #if XP_WIN
     WNDPROC             getWindowProc()
                             { return pf_wndproc; };
@@ -145,32 +142,63 @@ public:
     int      b_stream;
     int      b_autoplay;
     int      b_toolbar;
+    char *   psz_text;
     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 * );
     int  get_fullscreen( libvlc_exception_t * );
 
-    int  player_has_vout( libvlc_exception_t * );
+    bool  player_has_vout( libvlc_exception_t * );
 
 private:
+    bool playlist_select(int,libvlc_exception_t *);
     void set_player_window( libvlc_exception_t * );
 
     /* VLC reference */
@@ -178,7 +206,6 @@ private:
     libvlc_instance_t   *libvlc_instance;
     libvlc_media_list_t *libvlc_media_list;
     libvlc_media_player_t *libvlc_media_player;
-    libvlc_log_t        *libvlc_log;
     NPClass             *p_scriptClass;
 
     /* browser reference */
@@ -270,6 +297,4 @@ private:
     /* XSPF */ \
     "application/xspf+xml:xspf:Playlist xspf;"
 
-
-
 #endif