Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 870b4f3..f3eafab 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -34,97 +34,97 @@ | |||
34 | 34 | ||
35 | #include "audiowidget.h" | 35 | #include "audiowidget.h" |
36 | #include "mediaplayerstate.h" | 36 | #include "mediaplayerstate.h" |
37 | #include "playlistwidget.h" | 37 | #include "playlistwidget.h" |
38 | 38 | ||
39 | #include <qpe/qpeapplication.h> | 39 | #include <qpe/qpeapplication.h> |
40 | 40 | ||
41 | namespace | 41 | namespace |
42 | { | 42 | { |
43 | 43 | ||
44 | const int xo = -2; // movable x offset | 44 | const int xo = -2; // movable x offset |
45 | const int yo = 22; // movable y offset | 45 | const int yo = 22; // movable y offset |
46 | 46 | ||
47 | const MediaWidget::SkinButtonInfo skinInfo[] = | 47 | const MediaWidget::SkinButtonInfo skinInfo[] = |
48 | { | 48 | { |
49 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, | 49 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, |
50 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, | 50 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, |
51 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, | 51 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, |
52 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, | 52 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, |
53 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, | 53 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, |
54 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, | 54 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, |
55 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, | 55 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, |
56 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, | 56 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, |
57 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, | 57 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, |
58 | { MediaWidget::Back, "back", MediaWidget::NormalButton } | 58 | { MediaWidget::Back, "back", MediaWidget::NormalButton } |
59 | }; | 59 | }; |
60 | 60 | ||
61 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 61 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
62 | 62 | ||
63 | void changeTextColor( QWidget * w) { | 63 | void changeTextColor( QWidget * w) { |
64 | QPalette p = w->palette(); | 64 | QPalette p = w->palette(); |
65 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 65 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
66 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 66 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
67 | w->setPalette( p ); | 67 | w->setPalette( p ); |
68 | } | 68 | } |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 72 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
73 | 73 | ||
74 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), | 74 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), |
75 | audioSliderBeingMoved( false ) | 75 | audioSliderBeingMoved( false ) |
76 | { | 76 | { |
77 | setCaption( tr("OpiePlayer") ); | 77 | setCaption( tr("OpiePlayer") ); |
78 | 78 | ||
79 | loadSkin(); | 79 | loadSkin(); |
80 | 80 | ||
81 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 81 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
82 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | 82 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) ); |
83 | 83 | ||
84 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 84 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
85 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 85 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
86 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 86 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
87 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 87 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
88 | 88 | ||
89 | // Intialise state | 89 | // Intialise state |
90 | setLength( mediaPlayerState.length() ); | 90 | setLength( mediaPlayerState.length() ); |
91 | setPosition( mediaPlayerState.position() ); | 91 | setPosition( mediaPlayerState.position() ); |
92 | setLooping( mediaPlayerState.isFullscreen() ); | 92 | setLooping( mediaPlayerState.isFullscreen() ); |
93 | // setPaused( mediaPlayerState->paused() ); | 93 | // setPaused( mediaPlayerState->paused() ); |
94 | setPlaying( mediaPlayerState.isPlaying() ); | 94 | setPlaying( mediaPlayerState.isPlaying() ); |
95 | } | 95 | } |
96 | 96 | ||
97 | AudioWidget::~AudioWidget() { | 97 | AudioWidget::~AudioWidget() { |
98 | 98 | ||
99 | // mediaPlayerState->setPlaying(false); | 99 | // mediaPlayerState->setPlaying(false); |
100 | } | 100 | } |
101 | 101 | ||
102 | MediaWidget::GUIInfo AudioWidget::guiInfo() | 102 | MediaWidget::GUIInfo AudioWidget::guiInfo() |
103 | { | 103 | { |
104 | return GUIInfo( QString::null /* infix */, ::skinInfo, ::buttonCount ); | 104 | return GUIInfo( QString::null /* infix */, ::skinInfo, ::buttonCount ); |
105 | } | 105 | } |
106 | 106 | ||
107 | void AudioWidget::resizeEvent( QResizeEvent *e ) { | 107 | void AudioWidget::resizeEvent( QResizeEvent *e ) { |
108 | int h = height(); | 108 | int h = height(); |
109 | int w = width(); | 109 | int w = width(); |
110 | 110 | ||
111 | songInfo.setGeometry( QRect( 2, 2, w - 4, 20 ) ); | 111 | songInfo.setGeometry( QRect( 2, 2, w - 4, 20 ) ); |
112 | slider.setFixedWidth( w - 110 ); | 112 | slider.setFixedWidth( w - 110 ); |
113 | slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); | 113 | slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); |
114 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); | 114 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); |
115 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); | 115 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); |
116 | 116 | ||
117 | upperLeftOfButtonMask.rx() = ( w - buttonUpImage.width() ) / 2; | 117 | upperLeftOfButtonMask.rx() = ( w - buttonUpImage.width() ) / 2; |
118 | upperLeftOfButtonMask.ry() = (( h - buttonUpImage.height() ) / 2) - 10; | 118 | upperLeftOfButtonMask.ry() = (( h - buttonUpImage.height() ) / 2) - 10; |
119 | 119 | ||
120 | MediaWidget::resizeEvent( e ); | 120 | MediaWidget::resizeEvent( e ); |
121 | } | 121 | } |
122 | 122 | ||
123 | void AudioWidget::sliderPressed() { | 123 | void AudioWidget::sliderPressed() { |
124 | audioSliderBeingMoved = TRUE; | 124 | audioSliderBeingMoved = TRUE; |
125 | } | 125 | } |
126 | 126 | ||
127 | 127 | ||
128 | void AudioWidget::sliderReleased() { | 128 | void AudioWidget::sliderReleased() { |
129 | audioSliderBeingMoved = FALSE; | 129 | audioSliderBeingMoved = FALSE; |
130 | if ( slider.width() == 0 ) | 130 | if ( slider.width() == 0 ) |