summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/main.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp39
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h9
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h3
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.h6
7 files changed, 56 insertions, 31 deletions
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp
index 7d11ca0..7fc7b94 100644
--- a/noncore/multimedia/opieplayer2/main.cpp
+++ b/noncore/multimedia/opieplayer2/main.cpp
@@ -1,32 +1,25 @@
#include <qpe/qpeapplication.h>
#include "mediaplayerstate.h"
#include "playlistwidget.h"
-#include "audiowidget.h"
-#include "videowidget.h"
#include "mediaplayer.h"
PlayListWidget *playList;
-AudioWidget *audioUI;
-VideoWidget *videoUI;
int main(int argc, char **argv) {
QPEApplication a(argc,argv);
MediaPlayerState st( 0, "mediaPlayerState" );
PlayListWidget pl( st, 0, "playList" );
playList = &pl;
pl.showMaximized();
- AudioWidget aw( st, 0, "audioUI" );
- audioUI = &aw;
- VideoWidget vw( st, 0, "videoUI" );
- videoUI = &vw;
- a.processEvents();
MediaPlayer mp( st, 0, "mediaPlayer" );
+ QObject::connect( &pl, SIGNAL( skinSelected() ),
+ &mp, SLOT( recreateAudioAndVideoWidgets() ) );
a.showMainDocumentWidget(&pl);
return a.exec();
}
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index eccb5d9..a9c74c4 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -1,111 +1,104 @@
#include <qpe/qpeapplication.h>
#include <qpe/qlibrary.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qfileinfo.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qwidgetstack.h>
#include <qfile.h>
#include "mediaplayer.h"
#include "playlistwidget.h"
#include "audiowidget.h"
#include "videowidget.h"
#include "volumecontrol.h"
#include "mediaplayerstate.h"
// for setBacklight()
#include <linux/fb.h>
#include <sys/file.h>
#include <sys/ioctl.h>
-extern AudioWidget *audioUI;
extern VideoWidget *videoUI;
extern PlayListWidget *playList;
#define FBIOBLANK 0x4611
MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
: QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) {
+ audioUI = 0;
+ videoUI = 0;
+ xineControl = 0;
+ recreateAudioAndVideoWidgets();
+
fd=-1;fl=-1;
playList->setCaption( tr( "OpiePlayer: Initializating" ) );
qApp->processEvents();
// QPEApplication::grabKeyboard(); // EVIL
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
- connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
- connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
- connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
- connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
-
- connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
- connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
- connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
- connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
-
volControl = new VolumeControl;
- xineControl = new XineControl( mediaPlayerState );
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() );
}
MediaPlayer::~MediaPlayer() {
delete xineControl;
delete volControl;
}
void MediaPlayer::pauseCheck( bool b ) {
if ( b && !mediaPlayerState.isPlaying() ) {
mediaPlayerState.setPaused( FALSE );
}
}
void MediaPlayer::play() {
mediaPlayerState.setPlaying( FALSE );
mediaPlayerState.setPlaying( TRUE );
}
void MediaPlayer::setPlaying( bool play ) {
if ( !play ) {
return;
}
if ( mediaPlayerState.isPaused() ) {
mediaPlayerState.setPaused( FALSE );
return;
}
QString tickerText, time, fileName;
if ( playList->currentTab() != PlayListWidget::CurrentPlayList ) {
//if playing in file list.. play in a different way
// random and looping settings enabled causes problems here,
// since there is no selected file in the playlist, but a selected file in the file list,
// so we remember and shutoff
l = mediaPlayerState.isLooping();
if(l) {
mediaPlayerState.setLooping( false );
}
r = mediaPlayerState.isShuffled();
mediaPlayerState.setShuffled( false );
}
PlayListWidget::Entry playListEntry = playList->currentEntry();
fileName = playListEntry.name;
@@ -306,48 +299,70 @@ void MediaPlayer::blank( bool b ) {
isBlanked = TRUE;
} else {
qDebug("do unblanking");
ioctl( fd, FBIOBLANK, 0);
#ifdef QT_QWS_EBX
if(fl != -1) {
ioctl( fl, 1);
::close(fl);
}
#endif
isBlanked = FALSE;
}
close( fd );
} else {
qDebug("<< /dev/fb0 could not be opened >>");
}
}
void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity
break;
case Key_F10: //contacts
break;
case Key_F11: //menu
break;
case Key_F12: //home
qDebug("Blank here");
// mediaPlayerState->toggleBlank();
break;
case Key_F13: //mail
qDebug("Blank here");
// mediaPlayerState->toggleBlank();
break;
}
}
void MediaPlayer::cleanUp() {// this happens on closing
Config cfg( "OpiePlayer" );
mediaPlayerState.writeConfig( cfg );
playList->writeDefaultPlaylist( );
// QPEApplication::grabKeyboard();
// QPEApplication::ungrabKeyboard();
}
+
+void MediaPlayer::recreateAudioAndVideoWidgets()
+{
+ delete xineControl;
+ delete audioUI;
+ delete videoUI;
+ audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" );
+ videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" );
+
+ connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
+ connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
+ connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
+ connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
+
+ connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
+ connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
+ connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
+ connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
+
+ xineControl = new XineControl( videoUI, mediaPlayerState );
+}
+
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h
index 6aeac7c..0d6f722 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.h
+++ b/noncore/multimedia/opieplayer2/mediaplayer.h
@@ -1,77 +1,86 @@
/*
                This file is part of the Opie Project
              Copyright (c) 2002 Max Reiss <harlekin@handhelds.org>
Copyright (c) 2002 LJP <>
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
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library 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.
*/
#ifndef MEDIA_PLAYER_H
#define MEDIA_PLAYER_H
#include <qmainwindow.h>
#include <qframe.h>
#include "xinecontrol.h"
class DocLnk;
class VolumeControl;
class MediaPlayerState;
+class AudioWidget;
+class VideoWidget;
class MediaPlayer : public QObject {
Q_OBJECT
public:
MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name );
~MediaPlayer();
+
+public slots:
+ void recreateAudioAndVideoWidgets();
+
private slots:
void setPlaying( bool );
void pauseCheck( bool );
void play();
void next();
void prev();
void startIncreasingVolume();
void startDecreasingVolume();
void stopChangingVolume();
void cleanUp();
void blank( bool );
protected:
void timerEvent( QTimerEvent *e );
void keyReleaseEvent( QKeyEvent *e);
private:
+
bool isBlanked, l, r;
int fd, fl;
int volumeDirection;
XineControl *xineControl;
VolumeControl *volControl;
MediaPlayerState &mediaPlayerState;
+ AudioWidget *audioUI;
+ VideoWidget *videoUI;
};
#endif // MEDIA_PLAYER_H
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 7ba342b..6bda71e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -1050,79 +1050,81 @@ void PlayListWidget::pmViewActivated(int index) {
case -16:
{
mediaPlayerState.toggleFullscreen();
bool b=mediaPlayerState.isFullscreen();
pmView->setItemChecked( index, b);
Config cfg( "OpiePlayer" );
cfg.writeEntry( "FullScreen", b );
}
break;
};
}
void PlayListWidget::populateSkinsMenu() {
int item = 0;
defaultSkinIndex = 0;
QString skinName;
Config cfg( "OpiePlayer" );
cfg.setGroup("Options" );
QString skin = cfg.readEntry( "Skin", "default" );
QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" );
skinsDir.setFilter( QDir::Dirs );
skinsDir.setSorting(QDir::Name );
const QFileInfoList *skinslist = skinsDir.entryInfoList();
QFileInfoListIterator it( *skinslist );
QFileInfo *fi;
while ( ( fi = it.current() ) ) {
skinName = fi->fileName();
// qDebug( fi->fileName() );
if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
item = skinsMenu->insertItem( fi->fileName() ) ;
}
if( skinName == "default" ) {
defaultSkinIndex = item;
}
if( skinName == skin ) {
skinsMenu->setItemChecked( item, TRUE );
}
++it;
}
}
void PlayListWidget::skinsMenuActivated( int item ) {
for(unsigned int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) {
skinsMenu->setItemChecked( i, FALSE );
}
skinsMenu->setItemChecked( item, TRUE );
- Config cfg( "OpiePlayer" );
- cfg.setGroup("Options");
- cfg.writeEntry("Skin", skinsMenu->text( item ) );
- QMessageBox::warning( this, tr( "OpiePlayer" ),
- tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) );
-}
+ {
+ Config cfg( "OpiePlayer" );
+ cfg.setGroup("Options");
+ cfg.writeEntry("Skin", skinsMenu->text( item ) );
+ }
+
+ emit skinSelected();
+}
PlayListWidget::TabType PlayListWidget::currentTab() const
{
static const TabType indexToTabType[ TabTypeCount ] =
{ CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
int index = tabWidget->currentPageIndex();
assert( index < TabTypeCount && index >= 0 );
return indexToTabType[ index ];
}
PlayListWidget::Entry PlayListWidget::currentEntry() const
{
if ( currentTab() == CurrentPlayList ) {
const DocLnk *lnk = current();
return Entry( lnk->name(), lnk->file() );
}
return Entry( currentFileListPathName() );
}
QString PlayListWidget::currentFileListPathName() const {
return currentFileListView()->currentItem()->text( 3 );
}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 3f52e63..ad5c9a3 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -49,93 +49,96 @@ class Config;
class QListViewItem;
class QListView;
class QPoint;
class QAction;
class QLabel;
class PlayListWidget : public PlayListWidgetGui {
Q_OBJECT
public:
enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
enum { TabTypeCount = 4 };
struct Entry
{
Entry( const QString &_name, const QString &_fileName )
: name( _name ), file( _fileName ) {}
Entry( const QString &_fileName )
: name( _fileName ), file( _fileName ) {}
QString name;
QString file;
};
PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 );
~PlayListWidget();
DocLnkSet files;
DocLnkSet vFiles;
bool fromSetDocument;
bool insanityBool;
QString setDocFileRef, currentPlayList;
// retrieve the current playlist entry (media file link)
const DocLnk *current() const;
void useSelectedDocument();
int selected;
TabType currentTab() const;
Entry currentEntry() const;
public slots:
bool first();
bool last();
bool next();
bool prev();
void writeDefaultPlaylist( );
QString currentFileListPathName() const;
protected:
void keyReleaseEvent( QKeyEvent *e);
+signals:
+ void skinSelected();
+
private:
int defaultSkinIndex;
bool audioScan, videoScan, audioPopulated, videoPopulated;
void readm3u(const QString &);
void readPls(const QString &);
void initializeStates();
void populateAudioView();
void populateVideoView();
QListView *currentFileListView() const;
bool inFileListMode() const;
private slots:
void populateSkinsMenu();
void skinsMenuActivated(int);
void pmViewActivated(int);
void writem3u();
void writeCurrentM3u();
void scanForAudio();
void scanForVideo();
void openFile();
void setDocument( const QString& fileref );
void addToSelection( const DocLnk& ); // Add a media file to the playlist
void addToSelection( QListViewItem* ); // Add a media file to the playlist
void clearList();
void addAllToList();
void addAllMusicToList();
void addAllVideoToList();
void saveList(); // Save the playlist
void loadList( const DocLnk &); // Load a playlist
void playIt( QListViewItem *);
void btnPlay(bool);
void deletePlaylist();
void addSelected();
void removeSelected();
void tabChanged(QWidget*);
void viewPressed( int, QListViewItem *, const QPoint&, int);
void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
void playSelected();
};
#endif // PLAY_LIST_WIDGET_H
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 071ef7c..b4ae783 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -1,93 +1,92 @@
/*
                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 <qtimer.h>
#include <qmessagebox.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include "xinecontrol.h"
#include "mediaplayerstate.h"
#include "videowidget.h"
-extern VideoWidget *videoUI;
-XineControl::XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
- : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) {
+XineControl::XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
+ : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), videoUI( videoWidget ) {
libXine = new XINE::Lib( videoUI->vidWidget() );
connect ( videoUI, SIGNAL( videoResized( const QSize & )), this, SLOT( videoResized ( const QSize & ) ) );
connect( &mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pause( bool ) ) );
connect( this, SIGNAL( positionChanged( long ) ), &mediaPlayerState, SLOT( updatePosition( long ) ) );
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;
}
XineControl::~XineControl() {
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
if ( disabledSuspendScreenSaver ) {
disabledSuspendScreenSaver = FALSE;
// Re-enable the suspend mode
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
}
#endif
delete libXine;
}
void XineControl::play( const QString& fileName ) {
hasVideoChannel = FALSE;
hasAudioChannel = FALSE;
m_fileName = fileName;
qDebug("<<FILENAME: " + fileName + ">>>>");
if ( !libXine->play( fileName, 0, 0 ) ) {
QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
// toggle stop so the the play button is reset
mediaPlayerState.setPlaying( false );
return;
}
mediaPlayerState.setPlaying( true );
MediaPlayerState::DisplayType displayType;
// qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
if ( !libXine->hasVideo() ) {
displayType = MediaPlayerState::Audio;
qDebug("HAS AUDIO");
libXine->setShowVideo( false );
hasAudioChannel = TRUE;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h
index 00486f2..24e966b 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.h
+++ b/noncore/multimedia/opieplayer2/xinecontrol.h
@@ -1,119 +1,123 @@
/*
                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.
*/
#ifndef XINECONTROL_H
#define XINECONTROL_H
#include "lib.h"
#include <qobject.h>
#include "mediaplayerstate.h"
+class VideoWidget;
+
class XineControl : public QObject {
Q_OBJECT
public:
- XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 );
+ XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 );
~XineControl();
bool hasVideo() const { return hasVideoChannel; }
bool hasAudio() const { return hasAudioChannel; }
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();
/**
* Get as much info about the stream from xine as possible
*/
QString getMetaInfo();
/**
* get the error code and "translate" it for the user
*
*/
QString getErrorCode();
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;
long m_currentTime;
long m_position;
int m_length;
QString m_fileName;
bool disabledSuspendScreenSaver : 1;
bool hasVideoChannel : 1;
bool hasAudioChannel : 1;
MediaPlayerState &mediaPlayerState;
signals:
void positionChanged( long );
+private:
+ VideoWidget *videoUI;
};
#endif