author | harlekin <harlekin> | 2002-09-02 17:18:30 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-02 17:18:30 (UTC) |
commit | 99b610f06af444e2636d1afe93d3de89a524ee8a (patch) (side-by-side diff) | |
tree | a664829bd5149686b906253f71d4cc01eeb9b059 | |
parent | bf0f423d8aed59da90db9e9748a53fdd5e1efab0 (diff) | |
download | opie-99b610f06af444e2636d1afe93d3de89a524ee8a.zip opie-99b610f06af444e2636d1afe93d3de89a524ee8a.tar.gz opie-99b610f06af444e2636d1afe93d3de89a524ee8a.tar.bz2 |
first parts of gamma correction, fullscreen on arm need some more work
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 48 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 43 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 23 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.h | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 31 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 0 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/yuv2rgb.c | 1 |
13 files changed, 178 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index b2143a0..748ae1f 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -60,6 +60,7 @@ extern "C" { void null_set_gui_width( vo_driver_t* self, int width ); void null_set_gui_height( vo_driver_t* self, int height ); void null_set_mode( vo_driver_t* self, int depth, int rgb ); + void null_set_videoGamma( vo_driver_t* self , int value ); void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data); } @@ -203,6 +204,12 @@ bool Lib::isVideoFullScreen() { void Lib::setScaling( bool scale ) { ::null_set_scaling( m_videoOutput, scale ); } + +void Lib::setGamma( int value ) { + //qDebug( QString( "%1").arg(value) ); + ::null_set_videoGamma( m_videoOutput, value ); +} + bool Lib::isScaling() { return ::null_is_scaling( m_videoOutput ); } diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index abd8c65..b9d0a8a 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h @@ -112,6 +112,13 @@ namespace XINE { * */ void setScaling( bool ); + + /** + * Set the Gamma value for video output + * @param int the value between -100 and 100, 0 is original + */ + void setGamma( int ); + /** * test */ diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index d984022..4ec5989 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -1,3 +1,38 @@ +/* + This file is part of the Opie Project + + Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> + Copyright (c) 2002 L. Potter <ljp@llornkcor.com> + Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +// this file is based on work by trolltech + #include <qpe/qpeapplication.h> #include <qpe/qlibrary.h> #include <qpe/config.h> @@ -21,9 +56,6 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) MediaPlayerState::~MediaPlayerState() { -// Config cfg( "OpiePlayer" ); -// writeConfig( cfg ); - } @@ -34,6 +66,7 @@ void MediaPlayerState::readConfig( Config& cfg ) { isLooping = cfg.readBoolEntry( "Looping" ); isShuffled = cfg.readBoolEntry( "Shuffle" ); usePlaylist = cfg.readBoolEntry( "UsePlayList" ); + videoGamma = cfg.readNumEntry( "VideoGamma" ); usePlaylist = TRUE; isPlaying = FALSE; isStreaming = FALSE; @@ -51,6 +84,7 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.writeEntry("Looping", isLooping ); cfg.writeEntry("Shuffle", isShuffled ); cfg.writeEntry("UsePlayList", usePlaylist ); + cfg.writeEntry( "VideoGamma", videoGamma ); } @@ -209,6 +243,14 @@ void MediaPlayerState::updatePosition( long p ){ emit positionUpdated(p); } +void MediaPlayerState::setVideoGamma( int v ){ + if ( videoGamma == v ) { + return; + } + videoGamma = v; + emit videoGammaChanged( v ); +} + void MediaPlayerState::setLength( long l ) { if ( curLength == l ) { return; diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 215a2a8..4fef8e0 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -31,6 +31,8 @@ */ +// this file is based on work by trolltech + #ifndef MEDIA_PLAYER_STATE_H #define MEDIA_PLAYER_STATE_H @@ -79,6 +81,7 @@ public slots: void setLength( long l ); void setView( char v ); void setBlanked( bool b ); + void setVideoGamma( int v ); void setPrev(); void setNext(); @@ -111,6 +114,7 @@ signals: void lengthChanged( long ); void viewChanged( char ); void blankToggled( bool ); + void videoGammaChanged( int ); void prev(); void next(); @@ -125,7 +129,7 @@ private: long curPosition; long curLength; char curView; - + int videoGamma; void readConfig( Config& cfg ); }; diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index bd52869..ceda333 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c @@ -1,3 +1,35 @@ +/* + This file is part of the Opie Project + + Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> + Copyright (c) 2002 L. Potter <ljp@llornkcor.com> + Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ /*#include <xine.h>*/ #include <stdlib.h> @@ -31,7 +63,7 @@ struct null_driver_s { int depth, bpp, bytes_per_pixel; int yuv2rgb_mode; int yuv2rgb_swap; - int zuv2rgb_gamma; + int yuv2rgb_gamma; uint8_t *yuv2rgb_cmap; yuv2rgb_factory_t *yuv2rgb_factory; vo_overlay_t *overlay; @@ -605,6 +637,12 @@ void null_set_fullscreen( vo_driver_t* self, int screen ){ int null_is_scaling( vo_driver_t* self ){ return ((null_driver_t*)self)->m_is_scaling; } + +void null_set_videoGamma( vo_driver_t* self , int value ) { + ((null_driver_t*) self) ->yuv2rgb_gamma = value; + ((null_driver_t*) self) ->yuv2rgb_factory->set_gamma( ((null_driver_t*) self) ->yuv2rgb_factory, value ); +} + void null_set_scaling( vo_driver_t* self, int scale ){ ((null_driver_t*)self)->m_is_scaling = scale; } @@ -615,6 +653,8 @@ void null_set_gui_width( vo_driver_t* self, int width ){ void null_set_gui_height( vo_driver_t* self, int height ){ ((null_driver_t*)self)->gui_height = height; } + + void null_set_mode( vo_driver_t* self, int depth, int rgb ){ null_driver_t* this = (null_driver_t*)self; @@ -670,3 +710,4 @@ void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_ this->caller = user_data; this->frameDis = t; } + diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 6c4d07f..3bd04bc 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -118,6 +118,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); + connect ( gammaSlider, SIGNAL( valueChanged( int ) ), mediaPlayerState, SLOT( setVideoGamma( int ) ) ); readConfig( cfg ); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" ); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 2742252..dcfdd48 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 6ecd016..250833c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -99,6 +99,25 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags pmView->insertItem( tr( "Skins" ), skinsMenu ); skinsMenu->isCheckable(); + gammaMenu = new QPopupMenu( this ); + pmView->insertItem( tr( "Gamma" ), gammaMenu ); + gammaMenu->setMinimumHeight( 50 ); + + gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); + gammaSlider->setRange( -100, 100 ); + gammaSlider->setTickmarks( QSlider::Left ); + gammaSlider->setTickInterval( 20 ); + gammaSlider->setFocusPolicy( QWidget::NoFocus ); + gammaSlider->setValue( 0 ); + gammaSlider->setMinimumHeight( 50 ); + + gammaLCD = new QLCDNumber( 3, gammaMenu ); + + gammaMenu->insertItem( gammaSlider ); + gammaMenu->insertItem( gammaLCD ); + + connect( gammaSlider, SIGNAL( valueChanged( int ) ), gammaLCD, SLOT( display( int ) ) ); + vbox5 = new QVBox( this ); QVBox *vbox4 = new QVBox( vbox5 ); QHBox *hbox6 = new QHBox( vbox4 ); diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index 4c8d737..61fd40d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -44,7 +44,8 @@ #include <qpushbutton.h> #include <qpopupmenu.h> #include <qaction.h> - +#include <qslider.h> +#include <qlcdnumber.h> class PlayListWidgetPrivate; class PlayListSelection; @@ -104,6 +105,9 @@ protected: QListView *audioView, *videoView, *playlistView; QLabel *libString; QPopupMenu *pmView ; + QPopupMenu *gammaMenu; + QSlider *gammaSlider; + QLCDNumber *gammaLCD; bool fromSetDocument; bool insanityBool; QString setDocFileRef; diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 12d80ba..d18fde5 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -51,6 +51,7 @@ XineControl::XineControl( QObject *parent, const char *name ) connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); + connect( mediaPlayerState, SIGNAL( videoGammaChanged( int ) ), this, SLOT( setGamma( int ) ) ); connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); disabledSuspendScreenSaver = FALSE; @@ -72,7 +73,7 @@ void XineControl::play( const QString& fileName ) { hasAudioChannel=FALSE; m_fileName = fileName; - qDebug("<<FILENAME: " + fileName + ">>>>"); + //qDebug("<<FILENAME: " + fileName + ">>>>"); libXine->play( fileName ); mediaPlayerState->setPlaying( true ); @@ -114,6 +115,10 @@ void XineControl::nextMedia() { mediaPlayerState->setNext(); } +void XineControl::setGamma( int value ) { + libXine->setGamma( value ); +} + void XineControl::stop( bool isSet ) { if ( !isSet) { libXine->stop( ); diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 4263b36..1de610b 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h @@ -19,11 +19,11 @@ : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more +..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with + -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, @@ -50,16 +50,42 @@ public: public slots: void play( const QString& fileName ); void stop( bool ); + + /** + * Pause the media stream + * @param if pause or not + */ void pause( bool ); + + /** + * Set videos fullscreen + * @param yes or no + */ void setFullscreen( bool ); + + /** + * + */ long currentTime(); void seekTo( long ); // get length of media file and set it void length(); long position(); + + /** + * Proceed to the next media file in playlist + */ void nextMedia(); + void videoResized ( const QSize &s ); + /** + * Set the gamma value of the video output + * @param int value between -100 and 100, 0 is original + */ + void setGamma( int ); + + private: XINE::Lib *libXine; MediaDetect mdetect; @@ -70,6 +96,7 @@ private: bool disabledSuspendScreenSaver : 1; bool hasVideoChannel : 1; bool hasAudioChannel : 1; + signals: void positionChanged( long ); diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index bc95d86..d06d62a 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp diff --git a/noncore/multimedia/opieplayer2/yuv2rgb.c b/noncore/multimedia/opieplayer2/yuv2rgb.c index 22bb4cb..e8e86e6 100644 --- a/noncore/multimedia/opieplayer2/yuv2rgb.c +++ b/noncore/multimedia/opieplayer2/yuv2rgb.c @@ -3063,7 +3063,6 @@ yuv2rgb_t *yuv2rgb_create_converter (yuv2rgb_factory_t *factory) { /* * factory functions */ - void yuv2rgb_set_gamma (yuv2rgb_factory_t *this, int gamma) { int i; |