summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/mediaplayer.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index a236775..7e38fc7 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -107,97 +107,97 @@ void MediaPlayer::setPlaying( bool play ) {
time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
if( fileName.left(4) == "http" ) {
fileName = QFileInfo( fileName ).baseName();
if ( xineControl()->getMetaInfo().isEmpty() ) {
tickerText = tr( " File: " ) + fileName;
} else {
tickerText = xineControl()->getMetaInfo();
}
} else {
if ( xineControl()->getMetaInfo().isEmpty() ) {
tickerText = tr( " File: " ) + fileName + tr( ", Length: " ) + time + " ";
} else {
tickerText = xineControl()->getMetaInfo() + " Length: " + time + " ";
}
}
audioUI()->setTickerText( tickerText );
}
void MediaPlayer::prev() {
if( playList.currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist
if ( playList.prev() ) {
play();
} else if ( mediaPlayerState.isLooping() ) {
if ( playList.last() ) {
play();
}
} else {
mediaPlayerState.setList();
}
}
}
void MediaPlayer::next() {
if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist
if ( playList.next() ) {
play();
} else if ( mediaPlayerState.isLooping() ) {
if ( playList.first() ) {
play();
}
} else {
mediaPlayerState.setList();
}
} else { //if playing from file list, let's just stop
- qDebug("<<<<<<<<<<<<<<<<<stop for filelists");
+ odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl;
mediaPlayerState.setPlaying(false);
mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection );
if(l) mediaPlayerState.setLooping(l);
if(r) mediaPlayerState.setShuffled(r);
}
qApp->processEvents();
}
void MediaPlayer::startDecreasingVolume() {
volumeDirection = -1;
startTimer( 100 );
volControl->decVol(2);
}
void MediaPlayer::startIncreasingVolume() {
volumeDirection = +1;
startTimer( 100 );
volControl->incVol(2);
}
bool drawnOnScreenDisplay = FALSE;
unsigned int onScreenDisplayVolume = 0;
const int yoff = 110;
void MediaPlayer::stopChangingVolume() {
killTimers();
// Get rid of the on-screen display stuff
drawnOnScreenDisplay = FALSE;
onScreenDisplayVolume = 0;
int w=0;
int h=0;
if( !xineControl()->hasVideo() ) {
w = audioUI()->width();
h = audioUI()->height();
audioUI()->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE );
} else {
w = videoUI()->width();
h = videoUI()->height();
videoUI()->repaint( ( w - 200 ) / 2, h - yoff, 200 + 9, 70, FALSE );
}
}
void MediaPlayer::timerEvent( QTimerEvent * ) {
if ( volumeDirection == +1 ) {
@@ -240,141 +240,141 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
p.drawText( (w - 200) / 2, h - yoff + 20, tr("Volume") );
for ( unsigned int i = 0; i < 10; i++ ) {
if ( v > i ) {
p.drawRect( ( w - 200 ) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
} else {
p.drawRect( ( w - 200 ) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
}
}
} else {
w = videoUI()->width();
h = videoUI()->height();
if ( drawnOnScreenDisplay ) {
if ( onScreenDisplayVolume > v ) {
videoUI()->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, ( onScreenDisplayVolume - v ) * 20 + 9, 30, FALSE );
}
}
drawnOnScreenDisplay = TRUE;
onScreenDisplayVolume = v;
QPainter p( videoUI() );
p.setPen( QColor( 0x10, 0xD0, 0x10 ) );
p.setBrush( QColor( 0x10, 0xD0, 0x10 ) );
QFont f;
f.setPixelSize( 20 );
f.setBold( TRUE );
p.setFont( f );
p.drawText( (w - 200) / 2, h - yoff + 20, tr( "Volume" ) );
for ( unsigned int i = 0; i < 10; i++ ) {
if ( v > i ) {
p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 );
} else {
p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 );
}
}
}
}
void MediaPlayer::blank( bool b ) {
fd=open("/dev/fb0",O_RDWR);
#ifdef QT_QWS_SL5XXX
fl= open( "/dev/fl", O_RDWR );
#endif
if (fd != -1) {
if ( b ) {
- qDebug("do blanking");
+ odebug << "do blanking" << oendl;
#ifdef QT_QWS_SL5XXX
ioctl( fd, FBIOBLANK, 1 );
if(fl !=-1) {
ioctl( fl, 2 );
::close(fl);
}
#else
ioctl( fd, FBIOBLANK, 3 );
#endif
isBlanked = TRUE;
} else {
- qDebug("do unblanking");
+ odebug << "do unblanking" << oendl;
ioctl( fd, FBIOBLANK, 0);
#ifdef QT_QWS_SL5XXX
if(fl != -1) {
ioctl( fl, 1);
::close(fl);
}
#endif
isBlanked = FALSE;
}
close( fd );
} else {
- qDebug("<< /dev/fb0 could not be opened >>");
+ odebug << "<< /dev/fb0 could not be opened >>" << oendl;
}
}
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");
+ odebug << "Blank here" << oendl;
// mediaPlayerState->toggleBlank();
break;
case Key_F13: //mail
- qDebug("Blank here");
+ odebug << "Blank here" << oendl;
// 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() const
{
delete m_skinLoader;
delete m_xineControl;
delete m_audioUI;
delete m_videoUI;
m_audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" );
m_videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" );
connect( m_audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( m_audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( m_audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
connect( m_videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
connect( m_videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
connect( m_videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
if ( !xine )
xine = new XINE::Lib( XINE::Lib::InitializeImmediately );
m_xineControl = new XineControl( xine, m_videoUI->vidWidget(), mediaPlayerState );
xine = 0;
}
AudioWidget *MediaPlayer::audioUI() const
{
if ( !m_audioUI )
recreateAudioAndVideoWidgets();
return m_audioUI;
}