author | simon <simon> | 2002-12-13 22:40:57 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-13 22:40:57 (UTC) |
commit | d178168d0980e62d6ce1acb92b6b62c07b64ea34 (patch) (unidiff) | |
tree | 666c8db2a8351d64d9e3e9d16ca202be6a31a16b | |
parent | 24a30625ec822a7c55e4d4175c5fe40ba05c883e (diff) | |
download | opie-d178168d0980e62d6ce1acb92b6b62c07b64ea34.zip opie-d178168d0980e62d6ce1acb92b6b62c07b64ea34.tar.gz opie-d178168d0980e62d6ce1acb92b6b62c07b64ea34.tar.bz2 |
- prepare the API for threaded initialization, step one
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 13 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 |
3 files changed, 26 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 1e0dc21..6431de7 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -70,7 +70,7 @@ extern "C" { | |||
70 | 70 | ||
71 | using namespace XINE; | 71 | using namespace XINE; |
72 | 72 | ||
73 | Lib::Lib( XineVideoWidget* widget ) | 73 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) |
74 | { | 74 | { |
75 | m_video = false; | 75 | m_video = false; |
76 | m_wid = widget; | 76 | m_wid = widget; |
@@ -87,8 +87,22 @@ Lib::Lib( XineVideoWidget* widget ) | |||
87 | f.close(); | 87 | f.close(); |
88 | } | 88 | } |
89 | 89 | ||
90 | if ( initMode == InitializeImmediately ) | ||
91 | initialize(); | ||
92 | else | ||
93 | assert( false ); | ||
94 | } | ||
95 | |||
96 | void Lib::run() | ||
97 | { | ||
98 | assert( false ); | ||
99 | } | ||
100 | |||
101 | void Lib::initialize() | ||
102 | { | ||
90 | m_xine = xine_new( ); | 103 | m_xine = xine_new( ); |
91 | 104 | ||
105 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | ||
92 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); | 106 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); |
93 | 107 | ||
94 | xine_init( m_xine ); | 108 | xine_init( m_xine ); |
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index aba2ec9..6363918 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -55,18 +55,21 @@ namespace XINE { | |||
55 | * stooping, seeking. | 55 | * stooping, seeking. |
56 | */ | 56 | */ |
57 | class Frame; | 57 | class Frame; |
58 | class Lib : public ThreadUtil::Channel | 58 | class Lib : public ThreadUtil::Channel, private ThreadUtil::Thread |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | public: | 61 | public: |
62 | Lib(XineVideoWidget* = 0); | 62 | enum InitializationMode { InitializeImmediately, InitializeInThread }; |
63 | |||
64 | Lib( InitializationMode initMode, XineVideoWidget* = 0); | ||
65 | |||
63 | ~Lib(); | 66 | ~Lib(); |
64 | static int majorVersion(); | 67 | static int majorVersion(); |
65 | static int minorVersion(); | 68 | static int minorVersion(); |
66 | static int subVersion(); | 69 | static int subVersion(); |
67 | 70 | ||
68 | 71 | ||
69 | void resize ( const QSize &s ); | 72 | void resize ( const QSize &s ); |
70 | 73 | ||
71 | int play( const QString& fileName, | 74 | int play( const QString& fileName, |
72 | int startPos = 0, | 75 | int startPos = 0, |
@@ -183,7 +186,11 @@ namespace XINE { | |||
183 | protected: | 186 | protected: |
184 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); | 187 | virtual void receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ); |
185 | 188 | ||
189 | virtual void run(); | ||
190 | |||
186 | private: | 191 | private: |
192 | void initialize(); | ||
193 | |||
187 | int m_bytes_per_pixel; | 194 | int m_bytes_per_pixel; |
188 | bool m_video:1; | 195 | bool m_video:1; |
189 | XineVideoWidget *m_wid; | 196 | XineVideoWidget *m_wid; |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index efa9934..1aa3daa 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -46,7 +46,7 @@ XineControl::XineControl( XineVideoWidget *xineWidget, | |||
46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
47 | { | 47 | { |
48 | 48 | ||
49 | libXine = new XINE::Lib( xineWidget ); | 49 | libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); |
50 | 50 | ||
51 | init(); | 51 | init(); |
52 | } | 52 | } |