-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index bb07882..78079dd 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -90,67 +90,48 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
90 | 90 | ||
91 | loadSkin(); | 91 | loadSkin(); |
92 | 92 | ||
93 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 93 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
94 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | 94 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); |
95 | 95 | ||
96 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 96 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
97 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 97 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
98 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 98 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
99 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 99 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
100 | 100 | ||
101 | // Intialise state | 101 | // Intialise state |
102 | setLength( mediaPlayerState.length() ); | 102 | setLength( mediaPlayerState.length() ); |
103 | setPosition( mediaPlayerState.position() ); | 103 | setPosition( mediaPlayerState.position() ); |
104 | setLooping( mediaPlayerState.isFullscreen() ); | 104 | setLooping( mediaPlayerState.isFullscreen() ); |
105 | // setPaused( mediaPlayerState->paused() ); | 105 | // setPaused( mediaPlayerState->paused() ); |
106 | setPlaying( mediaPlayerState.isPlaying() ); | 106 | setPlaying( mediaPlayerState.isPlaying() ); |
107 | } | 107 | } |
108 | 108 | ||
109 | AudioWidget::~AudioWidget() { | 109 | AudioWidget::~AudioWidget() { |
110 | 110 | ||
111 | // mediaPlayerState->setPlaying(false); | 111 | // mediaPlayerState->setPlaying(false); |
112 | } | 112 | } |
113 | 113 | ||
114 | namespace { | ||
115 | |||
116 | QPixmap combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | ||
117 | QPixmap pix( img.width(), img.height() ); | ||
118 | QPainter p( &pix ); | ||
119 | p.drawTiledPixmap( pix.rect(), bg, offset ); | ||
120 | p.drawImage( 0, 0, img ); | ||
121 | return pix; | ||
122 | } | ||
123 | |||
124 | |||
125 | QPixmap maskPixToMask( QPixmap pix, QBitmap mask ) { | ||
126 | QPixmap pixmap( pix ); | ||
127 | pixmap.setMask( mask ); | ||
128 | return pixmap; | ||
129 | } | ||
130 | |||
131 | }; | ||
132 | |||
133 | void AudioWidget::resizeEvent( QResizeEvent *e ) { | 114 | void AudioWidget::resizeEvent( QResizeEvent *e ) { |
134 | int h = height(); | 115 | int h = height(); |
135 | int w = width(); | 116 | int w = width(); |
136 | 117 | ||
137 | songInfo.setGeometry( QRect( 2, 2, w - 4, 20 ) ); | 118 | songInfo.setGeometry( QRect( 2, 2, w - 4, 20 ) ); |
138 | slider.setFixedWidth( w - 110 ); | 119 | slider.setFixedWidth( w - 110 ); |
139 | slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); | 120 | slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) ); |
140 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); | 121 | slider.setBackgroundOrigin( QWidget::ParentOrigin ); |
141 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); | 122 | time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); |
142 | 123 | ||
143 | upperLeftOfButtonMask.rx() = ( w - buttonUpImage.width() ) / 2; | 124 | upperLeftOfButtonMask.rx() = ( w - buttonUpImage.width() ) / 2; |
144 | upperLeftOfButtonMask.ry() = (( h - buttonUpImage.height() ) / 2) - 10; | 125 | upperLeftOfButtonMask.ry() = (( h - buttonUpImage.height() ) / 2) - 10; |
145 | 126 | ||
146 | MediaWidget::resizeEvent( e ); | 127 | MediaWidget::resizeEvent( e ); |
147 | } | 128 | } |
148 | 129 | ||
149 | void AudioWidget::sliderPressed() { | 130 | void AudioWidget::sliderPressed() { |
150 | audioSliderBeingMoved = TRUE; | 131 | audioSliderBeingMoved = TRUE; |
151 | } | 132 | } |
152 | 133 | ||
153 | 134 | ||
154 | void AudioWidget::sliderReleased() { | 135 | void AudioWidget::sliderReleased() { |
155 | audioSliderBeingMoved = FALSE; | 136 | audioSliderBeingMoved = FALSE; |
156 | if ( slider.width() == 0 ) | 137 | if ( slider.width() == 0 ) |