author | alwin <alwin> | 2005-04-10 11:03:22 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-10 11:03:22 (UTC) |
commit | 713db174943e9184bfa68fa430123c52ad3c3b2b (patch) (unidiff) | |
tree | 6f19a3127d0b0d142db2520611fa66245124b862 /noncore/multimedia/opieplayer2/lib.cpp | |
parent | 8729cfb1a96057fb2d46188aa091c4086ae6ae61 (diff) | |
download | opie-713db174943e9184bfa68fa430123c52ad3c3b2b.zip opie-713db174943e9184bfa68fa430123c52ad3c3b2b.tar.gz opie-713db174943e9184bfa68fa430123c52ad3c3b2b.tar.bz2 |
- replaced the origin videopaint with a more simple one (this high-sophisticated stuff
isn't needed) in xinevideo
- replaced an assert in lib.cpp with a "if" construct
- may set a file without start playing it (for getting information and so on)
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index e3289bc..9f7a9c5 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -1,33 +1,33 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 LJP <> | 5 | Copyright (c) 2002 LJP <> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
@@ -186,12 +186,23 @@ int Lib::minorVersion() { | |||
186 | int Lib::subVersion() { | 186 | int Lib::subVersion() { |
187 | int major, minor, sub; | 187 | int major, minor, sub; |
188 | xine_get_version ( &major, &minor, &sub ); | 188 | xine_get_version ( &major, &minor, &sub ); |
189 | return sub; | 189 | return sub; |
190 | } | 190 | } |
191 | 191 | ||
192 | int Lib::setfile(const QString& fileName) | ||
193 | { | ||
194 | QString str = fileName.stripWhiteSpace(); | ||
195 | |||
196 | |||
197 | if ( !xine_open( m_stream, str.utf8().data() ) ) { | ||
198 | return 0; | ||
199 | } | ||
200 | return 1; | ||
201 | } | ||
202 | |||
192 | int Lib::play( const QString& fileName, int startPos, int start_time ) { | 203 | int Lib::play( const QString& fileName, int startPos, int start_time ) { |
193 | assert( m_initialized ); | 204 | assert( m_initialized ); |
194 | 205 | ||
195 | QString str = fileName.stripWhiteSpace(); | 206 | QString str = fileName.stripWhiteSpace(); |
196 | 207 | ||
197 | 208 | ||
@@ -328,15 +339,16 @@ void Lib::ensureInitialized() | |||
328 | odebug << "initialization thread finished!" << oendl; | 339 | odebug << "initialization thread finished!" << oendl; |
329 | } | 340 | } |
330 | 341 | ||
331 | void Lib::setWidget( XineVideoWidget *widget ) | 342 | void Lib::setWidget( XineVideoWidget *widget ) |
332 | { | 343 | { |
333 | m_wid = widget; | 344 | m_wid = widget; |
345 | if (m_wid) { | ||
334 | resize ( m_wid-> size ( ) ); | 346 | resize ( m_wid-> size ( ) ); |
335 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 347 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
336 | m_wid->repaint(); | 348 | } |
337 | } | 349 | } |
338 | 350 | ||
339 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) | 351 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) |
340 | { | 352 | { |
341 | assert( sendType == ThreadUtil::Channel::OneWay ); | 353 | assert( sendType == ThreadUtil::Channel::OneWay ); |
342 | handleXineEvent( msg->type(), msg->data(), msg->msg() ); | 354 | handleXineEvent( msg->type(), msg->data(), msg->msg() ); |
@@ -428,10 +440,10 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | |||
428 | assert( m_initialized ); | 440 | assert( m_initialized ); |
429 | 441 | ||
430 | if ( !m_video ) { | 442 | if ( !m_video ) { |
431 | return; | 443 | return; |
432 | } | 444 | } |
433 | 445 | ||
434 | assert( m_wid ); | 446 | // assert( m_wid ); |
435 | 447 | ||
436 | m_wid-> setVideoFrame ( frame, width, height, bytes ); | 448 | if (m_wid) m_wid-> setVideoFrame ( frame, width, height, bytes ); |
437 | } | 449 | } |