Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lib.h

Go to the documentation of this file.
00001 /*
00002                     This file is part of the Opie Project
00003 
00004                       Copyright (c)  2002 Max Reiss <harlekin@handhelds.org>
00005                              Copyright (c)  2002 LJP <>
00006                              Copyright (c)  2002 Holger Freyther <zecke@handhelds.org>
00007               =.
00008             .=l.
00009      .>+-=
00010 _;:,   .>  :=|.         This program is free software; you can
00011 .> <`_,  > .  <=          redistribute it and/or  modify it under
00012 :`=1 )Y*s>-.--  :           the terms of the GNU General Public
00013 .="- .-=="i,   .._         License as published by the Free Software
00014 - .  .-<_>   .<>         Foundation; either version 2 of the License,
00015   ._= =}    :          or (at your option) any later version.
00016   .%`+i>    _;_.
00017   .i_,=:_.   -<s.       This program is distributed in the hope that
00018   + . -:.    =       it will be useful,  but WITHOUT ANY WARRANTY;
00019   : ..  .:,   . . .    without even the implied warranty of
00020   =_    +   =;=|`    MERCHANTABILITY or FITNESS FOR A
00021  _.=:.    :  :=>`:     PARTICULAR PURPOSE. See the GNU
00022 ..}^=.=    =    ;      Library General Public License for more
00023 ++=  -.   .`   .:       details.
00024 :   = ...= . :.=-
00025 -.  .:....=;==+<;          You should have received a copy of the GNU
00026  -_. . .  )=. =           Library General Public License along with
00027   --    :-=`           this library; see the file COPYING.LIB.
00028                              If not, write to the Free Software Foundation,
00029                              Inc., 59 Temple Place - Suite 330,
00030                              Boston, MA 02111-1307, USA.
00031 
00032 */
00033 
00034 #ifndef XINE_VIDEO_LIB_H
00035 #define XINE_VIDEO_LIB_H
00036 
00037 #include <xine.h>
00038 
00039 #include "threadutil.h"
00040 
00041 class XineVideoWidget;
00042 
00043 namespace XINE {
00044 
00052     class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread
00053     {
00054         Q_OBJECT
00055     public:
00056         enum InitializationMode { InitializeImmediately, InitializeInThread };
00057 
00058         Lib( InitializationMode initMode, XineVideoWidget* = 0);
00059 
00060         ~Lib();
00061         static int majorVersion();
00062         static int minorVersion();
00063         static int subVersion();
00064 
00065 
00066         void resize ( const QSize &s );
00067 
00068         int setfile(const QString& fileName);
00069         int play( const QString& fileName,
00070                   int startPos = 0,
00071                   int start_time = 0 );
00072         void stop();
00073         void pause( bool toggle );
00074 
00075         int speed() const;
00076 
00086         void setSpeed( int speed = XINE_SPEED_PAUSE );
00087 
00088         int status() const;
00089 
00090         int currentPosition()const;
00091         //in seconds
00092         int currentTime()const;
00093 
00094         int length() const;
00095 
00096         bool isSeekable()const;
00097 
00101         void setShowVideo(bool video);
00102 
00106         bool isShowingVideo() const;
00107 
00111         void showVideoFullScreen( bool fullScreen );
00112 
00116         bool isVideoFullScreen() const;
00117 
00118 
00132         QString metaInfo( int number ) const;
00133 
00137         bool isScaling() const;
00138 
00142         void seekTo( int time );
00143 
00148         bool hasVideo() const;
00149 
00153         void setScaling( bool );
00154 
00159         void setGamma( int );
00160 
00168         int error() const;
00169 
00170         void ensureInitialized();
00171 
00172         void setWidget( XineVideoWidget *widget );
00173 
00174         QSize videoSize()const;
00175         int audioBitrate()const;
00176         int videoBitrate()const;
00177 
00178     signals:
00179 
00180         void stopped();
00181 
00182         void initialized();
00183 
00184     protected:
00185         virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType );
00186 
00187         virtual void run();
00188 
00189     private:
00190         void initialize();
00191 
00192         int m_bytes_per_pixel;
00193         bool m_initialized:1;
00194         bool m_duringInitialization:1;
00195         bool m_video:1;
00196         XineVideoWidget *m_wid;
00197         QSize m_videoSize;
00198         xine_t *m_xine;
00199         xine_stream_t *m_stream;
00200         xine_cfg_entry_t *m_config;
00201         xine_vo_driver_t *m_videoOutput;
00202         xine_ao_driver_t* m_audioOutput;
00203         xine_event_queue_t *m_queue;
00204 
00205         void handleXineEvent( const xine_event_t* t );
00206         void handleXineEvent( int type, int data, const char* name );
00207         void drawFrame( uint8_t* frame, int width, int height, int bytes );
00208         // C -> C++ bridge for the event system
00209         static void xine_event_handler( void* user_data, const xine_event_t* t);
00210         static void xine_display_frame( void* user_data, uint8_t* frame ,
00211                                         int width, int height, int bytes );
00212         static void xine_vo_scale_cb(void *, int, int, double,
00213                                      int*,int*,int*,int*,double*,int*,int*);
00214         static void xine_dest_cb(void*,int,int,double,int*,int*,double*);
00215     };
00216 };
00217 
00218 
00219 #endif

Generated on Sat Nov 5 16:17:31 2005 for OPIE by  doxygen 1.4.2