summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-09 14:10:58 (UTC)
committer simon <simon>2002-12-09 14:10:58 (UTC)
commitfffd954b4ea3c124a37cab9af99b248986029436 (patch) (side-by-side diff)
treef5ae7f123b7e50957c7682cbb8b3c7144aadf71b
parent17f319bb44feb947a26be333a4c7e6fef7020c87 (diff)
downloadopie-fffd954b4ea3c124a37cab9af99b248986029436.zip
opie-fffd954b4ea3c124a37cab9af99b248986029436.tar.gz
opie-fffd954b4ea3c124a37cab9af99b248986029436.tar.bz2
- oops, buttonType is a bad name for a variable, given its redundancy
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h6
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 3b33209..6e9c14a 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -67,49 +67,49 @@ const MediaWidget::SkinButtonInfo skinInfo[] =
{ MediaWidget::Loop, "loop", MediaWidget::ToggleButton },
{ MediaWidget::PlayList, "playlist", MediaWidget::NormalButton },
{ MediaWidget::Forward, "forward", MediaWidget::NormalButton },
{ MediaWidget::Back, "back", MediaWidget::NormalButton }
};
const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] );
void changeTextColor( QWidget * w) {
QPalette p = w->palette();
p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
w->setPalette( p );
}
}
AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) :
MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ),
audioSliderBeingMoved( false )
{
for ( uint i = 0; i < buttonCount; ++i ) {
Button button;
- button.buttonType = skinInfo[ i ].buttonType;
+ button.type = skinInfo[ i ].type;
buttons.push_back( button );
}
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
//skin = "scaleTest";
// color of background, frame, degree of transparency
QString skinPath = "opieplayer2/skins/" + skin;
pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 );
buttonMask.fill( 0 );
masks.reserve( buttonCount );
for ( uint i = 0; i < masks.capacity(); i++ ) {
QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" );
masks.push_back( QBitmap( filename ) );
@@ -366,49 +366,49 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( isOnButton && !buttons[i].isHeld ) {
buttons[i].isHeld = TRUE;
toggleButton(i);
switch (i) {
case VolumeUp:
emit moreClicked();
return;
case VolumeDown:
emit lessClicked();
return;
case Forward:
emit forwardClicked();
return;
case Back:
emit backClicked();
return;
}
} else if ( !isOnButton && buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
toggleButton(i);
}
} else {
if ( buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
- if ( buttons[i].buttonType != ToggleButton ) {
+ if ( buttons[i].type != ToggleButton ) {
setToggleButton( i, FALSE );
}
qDebug("mouseEvent %d", i);
handleCommand( static_cast<Command>( i ), buttons[ i ].isDown );
}
}
}
}
void AudioWidget::mousePressEvent( QMouseEvent *event ) {
mouseMoveEvent( event );
}
void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) {
mouseMoveEvent( event );
}
void AudioWidget::showEvent( QShowEvent* ) {
QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
mouseMoveEvent( &event );
}
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index e0f2cf1..9fb3499 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -18,61 +18,61 @@
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 MEDIAWIDGET_H
#define MEDIAWIDGET_H
#include <qwidget.h>
#include "mediaplayerstate.h"
#include "playlistwidget.h"
#include <vector>
class MediaWidget : public QWidget
{
Q_OBJECT
public:
enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back };
enum ButtonType { NormalButton, ToggleButton };
struct Button
{
- Button() : buttonType( NormalButton ), isHeld( false ), isDown( false ) {}
+ Button() : type( NormalButton ), isHeld( false ), isDown( false ) {}
- ButtonType buttonType : 1;
+ ButtonType type : 1;
bool isHeld : 1;
bool isDown : 1;
};
typedef std::vector<Button> ButtonVector;
struct SkinButtonInfo
{
Command command;
const char *fileName;
- ButtonType buttonType;
+ ButtonType type;
};
MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 );
virtual ~MediaWidget();
public slots:
virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0;
virtual void setLength( long length ) = 0;
virtual void setPlaying( bool playing ) = 0;
signals:
void moreReleased();
void lessReleased();
void forwardReleased();
void backReleased();
protected:
virtual void closeEvent( QCloseEvent * );
void handleCommand( Command command, bool buttonDown );
bool isOverButton( const QPoint &position, int buttonId ) const;
void paintButton( int buttonId );
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 23acfa3..380c703 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -51,49 +51,49 @@
# include <qdirectpainter_qws.h>
# include <qgfxraster_qws.h>
#endif
namespace
{
const int xo = 2; // movable x offset
const int yo = 0; // movable y offset
const char * const skinV_mask_file_names[7] = {
"play","stop","fwd","back","up","down","full"
};
}
VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name )
: MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 )
{
setCaption( tr("OpiePlayer - Video") );
Button defaultButton;
Button toggleButton = defaultButton;
- toggleButton.buttonType = ToggleButton;
+ toggleButton.type = ToggleButton;
buttons.reserve( 7 );
buttons.push_back( toggleButton ); // play
buttons.push_back( defaultButton ); // stop
buttons.push_back( defaultButton ); // next
buttons.push_back( defaultButton ); // previous
buttons.push_back( defaultButton ); // volUp
buttons.push_back( defaultButton ); // volDown
buttons.push_back( toggleButton ); //fullscreen
videoFrame = new XineVideoWidget ( this, "Video frame" );
connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
QString skinPath = "opieplayer2/skins/" + skin;
pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
@@ -275,49 +275,49 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i );
if ( isOnButton && !buttons[i].isHeld ) {
buttons[i].isHeld = TRUE;
toggleButton(i);
switch (i) {
case VideoVolUp:
emit moreClicked();
return;
case VideoVolDown:
emit lessClicked();
return;
}
} else if ( !isOnButton && buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
toggleButton(i);
}
} else {
if ( buttons[i].isHeld ) {
buttons[i].isHeld = FALSE;
- if ( buttons[i].buttonType != ToggleButton ) {
+ if ( buttons[i].type != ToggleButton ) {
setToggleButton( i, FALSE );
}
switch(i) {
case VideoPlay: {
if( mediaPlayerState.isPaused() ) {
setToggleButton( i, FALSE );
mediaPlayerState.setPaused( FALSE );
return;
} else if( !mediaPlayerState.isPaused() ) {
setToggleButton( i, TRUE );
mediaPlayerState.setPaused( TRUE );
return;
} else {
return;
}
}
case VideoStop: mediaPlayerState.setPlaying( FALSE ); return;
case VideoNext: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return;
case VideoPrevious: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return;
case VideoVolUp: emit moreReleased(); return;
case VideoVolDown: emit lessReleased(); return;