From 0d336f310b310ba18af70185eed58be6e07c26d8 Mon Sep 17 00:00:00 2001 From: harlekin Date: Mon, 19 Aug 2002 21:11:10 +0000 Subject: fixes --- diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 40e20e1..a718826 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -165,8 +165,8 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : } for ( int i = 0; i < 10; i++ ) { - buttonPixUp[i] = NULL; - buttonPixDown[i] = NULL; + buttonPixUp[i] = 0l; + buttonPixDown[i] = 0l; } setBackgroundPixmap( *pixBg ); @@ -227,6 +227,8 @@ AudioWidget::~AudioWidget() { } } +namespace { + QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { QPixmap pix( img.width(), img.height() ); QPainter p( &pix ); @@ -242,7 +244,7 @@ QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { return pixmap; } - +}; void AudioWidget::resizeEvent( QResizeEvent * ) { int h = height(); diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 626004a..c544882 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -46,6 +46,8 @@ class QPixmap; +namespace { + enum AudioButtons { AudioPlay=0, AudioStop, @@ -58,7 +60,7 @@ enum AudioButtons { AudioForward, AudioBack }; - +}; class Ticker : public QFrame { Q_OBJECT @@ -140,6 +142,7 @@ private: QSlider slider; QLineEdit time; int xoff, yoff; + bool isStreaming : 1; }; diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index c13ea63..9edb1d3 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp @@ -26,12 +26,16 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); } - +/* + * return the current text(input) + */ +QString InputDialog::text() const { + return LineEdit1->text(); +} /* * Destroys the object and frees any allocated resources */ InputDialog::~InputDialog() { - inputText= LineEdit1->text(); } void InputDialog::browse() { diff --git a/noncore/multimedia/opieplayer2/inputDialog.h b/noncore/multimedia/opieplayer2/inputDialog.h index d4f5e12..0f36ea4 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.h +++ b/noncore/multimedia/opieplayer2/inputDialog.h @@ -13,8 +13,11 @@ class InputDialog : public QDialog { public: InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~InputDialog(); - QString inputText; + QString text()const; + +private: QLineEdit* LineEdit1; + protected slots: void browse(); }; diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 18caaad..0f8242b 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -180,8 +180,8 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { // TODO FIXME - unsigned int v; - v = volControl->getVolume(); + unsigned int v= 0; + v = volControl->volume(); v = v / 10; if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 8366ab4..eaedaa5 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -16,7 +16,7 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) : QObject( parent, name ) { Config cfg( "OpiePlayer" ); readConfig( cfg ); - + isStreaming = false; } diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 10f1792..251c2e5 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -589,7 +589,7 @@ void PlayListWidget::saveList() { if( fileDlg->result() == 1 ) { if ( d->current ) delete d->current; - filename = fileDlg->LineEdit1->text();//+".playlist"; + filename = fileDlg->text();//+".playlist"; // qDebug("saving playlist "+filename+".playlist"); Config cfg( filename +".playlist"); writeConfig( cfg ); @@ -948,7 +948,7 @@ void PlayListWidget::openFile() { fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { - filename = fileDlg->LineEdit1->text(); + filename = fileDlg->text(); qDebug("Selected filename is "+filename); if(filename.right(3) == "m3u") { @@ -1123,7 +1123,7 @@ void PlayListWidget::writem3u() { fileDlg->exec(); QString filename,list; if( fileDlg->result() == 1 ) { - filename = fileDlg->LineEdit1->text(); + filename = fileDlg->text(); qDebug(filename); int noOfFiles = 0; d->selectedFiles->first(); diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index a795f3b..271b84e 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp @@ -6,13 +6,12 @@ #include "volumecontrol.h" -int VolumeControl::getVolume() { - int volumePerc; +int VolumeControl::volume() { Config cfg( "qpe" ); cfg. setGroup( "Volume" ); - volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); - m_volumePerc = volumePerc; - return volumePerc; + m_volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); + + return m_volumePerc; } @@ -35,18 +34,18 @@ void VolumeControl::setVolume( int volumePerc ) { void VolumeControl::incVol( int ammount ) { - int oldVol = getVolume(); + int oldVol = volume(); setVolume( oldVol + ammount); } void VolumeControl::decVol( int ammount ) { - int oldVol = getVolume(); + int oldVol = volume(); setVolume( oldVol - ammount); } VolumeControl::VolumeControl( ) { - getVolume(); + volume(); } VolumeControl::~VolumeControl() { diff --git a/noncore/multimedia/opieplayer2/volumecontrol.h b/noncore/multimedia/opieplayer2/volumecontrol.h index d0d34a2..040f978 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.h +++ b/noncore/multimedia/opieplayer2/volumecontrol.h @@ -25,7 +25,7 @@ public: * Get the volume in percent * @return volume percentage */ - int getVolume(); + int volume(); public slots: diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 766ece2..12d80ba 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -71,7 +71,9 @@ void XineControl::play( const QString& fileName ) { hasVideoChannel=FALSE; hasAudioChannel=FALSE; m_fileName = fileName; + qDebug("<>>>"); + libXine->play( fileName ); mediaPlayerState->setPlaying( true ); // default to audio view until we know how to handle video diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 88458be..4263b36 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h @@ -43,7 +43,6 @@ class XineControl : public QObject { public: XineControl( QObject *parent = 0, const char *name =0 ); ~XineControl(); - int m_length; bool hasVideo() const { return hasVideoChannel; } bool hasAudio() const { return hasAudioChannel; } @@ -64,12 +63,13 @@ public slots: private: XINE::Lib *libXine; MediaDetect mdetect; - long m_currentTime; + long m_currentTime; long m_position; + int m_length; QString m_fileName; - bool disabledSuspendScreenSaver; - bool hasVideoChannel; - bool hasAudioChannel; + 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 3e28e54..bc95d86 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp @@ -141,6 +141,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) case 1: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ) ); break; case 2: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ) ); break; case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; + default: break; } uint leftfill = 0; @@ -169,6 +170,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; + default: break; } } if ( rightfill ) @@ -182,6 +184,7 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) case 1: src -= m_bytes_per_pixel; break; case 2: src -= m_bytes_per_line_frame; break; case 3: src += m_bytes_per_pixel; break; + default: break; } } } @@ -244,7 +247,7 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * ) } -void XineVideoWidget::mousePressEvent ( QMouseEvent *me ) +void XineVideoWidget::mousePressEvent ( QMouseEvent * /*me*/ ) { QWidget *p = parentWidget ( ); @@ -256,7 +259,7 @@ void XineVideoWidget::mousePressEvent ( QMouseEvent *me ) } } -void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me ) +void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) { QWidget *p = parentWidget ( ); -- cgit v0.9.0.2