author | sandman <sandman> | 2002-08-03 23:58:20 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-08-03 23:58:20 (UTC) |
commit | 0cecd08dba036f39e414e34a2b7c070008ee3884 (patch) (unidiff) | |
tree | c187c9308f0553b1d5d9cd59093bcc3c11740665 /noncore/multimedia/opieplayer2/lib.cpp | |
parent | 8fb605fdfbbcbc654f567efcb59f02ec0d26228a (diff) | |
download | opie-0cecd08dba036f39e414e34a2b7c070008ee3884.zip opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.gz opie-0cecd08dba036f39e414e34a2b7c070008ee3884.tar.bz2 |
Added support for fullscreen playback
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index eb57b67..00c534a 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -72,12 +72,7 @@ Lib::Lib(XineVideoWidget* widget) { | |||
72 | if (m_wid != 0 ) { | 72 | if (m_wid != 0 ) { |
73 | printf("!0\n" ); | 73 | printf("!0\n" ); |
74 | ::null_set_gui_width( m_videoOutput, m_wid->image()->width() ); | 74 | resize ( m_wid-> size ( )); |
75 | ::null_set_gui_height(m_videoOutput, m_wid->image()->height() ); | ||
76 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 75 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
77 | m_bytes_per_pixel = ( qt_screen->depth() + 7 ) / 8; | 76 | m_wid-> setImage ( new QImage ( Resource::loadImage(""))); |
78 | QImage image = Resource::loadImage(""); | ||
79 | image = image.smoothScale( m_wid->width(), m_wid->height() ); | ||
80 | QImage* img = new QImage( image ); | ||
81 | m_wid->setImage( img ); | ||
82 | m_wid->repaint(); | 77 | m_wid->repaint(); |
83 | } | 78 | } |
@@ -101,4 +96,12 @@ Lib::~Lib() { | |||
101 | } | 96 | } |
102 | 97 | ||
98 | void Lib::resize ( const QSize &s ) | ||
99 | { | ||
100 | if ( s. width ( ) && s. height ( )) { | ||
101 | ::null_set_gui_width( m_videoOutput, s. width() ); | ||
102 | ::null_set_gui_height(m_videoOutput, s. height() ); | ||
103 | } | ||
104 | } | ||
105 | |||
103 | QCString Lib::version() { | 106 | QCString Lib::version() { |
104 | QCString str( xine_get_str_version() ); | 107 | QCString str( xine_get_str_version() ); |
@@ -188,7 +191,6 @@ void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { | |||
188 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, | 191 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, |
189 | int width, int height, int bytes ) { | 192 | int width, int height, int bytes ) { |
190 | // printf("display x frame"); | 193 | |
191 | ((Lib*)user_data)->drawFrame( frame, width, height, bytes ); | 194 | ((Lib*)user_data)->drawFrame( frame, width, height, bytes ); |
192 | // printf("displayed x frame\n"); | ||
193 | } | 195 | } |
194 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 196 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
@@ -199,10 +201,5 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | |||
199 | // qWarning("called draw frame %d %d", width, height); | 201 | // qWarning("called draw frame %d %d", width, height); |
200 | 202 | ||
201 | QSize size = m_wid->size(); | 203 | m_wid->setImage( frame, width, height, bytes ); |
202 | int xoffset = (size.width() - width) / 2; | ||
203 | int yoffset = (size.height() - height) / 2; | ||
204 | int linestep = qt_screen->linestep(); | ||
205 | |||
206 | m_wid->setImage( frame, yoffset, xoffset, width, height, linestep, bytes, m_bytes_per_pixel ); | ||
207 | // m_wid->repaint(false); | 204 | // m_wid->repaint(false); |
208 | 205 | ||