Skip to content

Commit

Permalink
修复播放/暂停按钮在拖动进度条后、歌曲播放结束后的图标错误
Browse files Browse the repository at this point in the history
  • Loading branch information
pzhlkj6612 committed Apr 23, 2019
1 parent 218bd32 commit 24ef977
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions BottomWidgets/BottomWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ void BottomWidget::initConnection()
connect(musicPlayer, SIGNAL(durationChanged(qint64)),this,SLOT(durationChanged(qint64)));
connect(musicPlayer, SIGNAL(errorOccur(int,QString)),this,SLOT(onErrorOccurs(int,QString)));

connect(musicPlayer, SIGNAL(audioFinish(bool)),this,SLOT(onAudioFinished(bool)));

sliderSound->setValue(SettingManager::GetInstance().data().volume);
nVolumeBeforeMute = sliderSound->value();
bSliderSoundPress = false;
Expand Down Expand Up @@ -322,6 +324,8 @@ void BottomWidget::onSliderSongReleased()

AdjustingPos = false;
musicPlayer->seek(posAdjust);
qDebug()<<"musicPlayer->state(): "<<musicPlayer->state();
setStyleSheet("QPushButton#btnPlayAndPause{border-image:url(\":/resource/image/btn_pause.png\");}");
}

void BottomWidget::onSoundToggle(bool mute)
Expand Down Expand Up @@ -395,4 +399,9 @@ void BottomWidget::onErrorOccurs(int code, QString strErr)
tr("播放音频时发生错误,请尝试使用别的音频文件")+ "\n\n" + tr("出错细节:")+ strErr);
}

void BottomWidget::onAudioFinished(bool isEndWithForce)
{
setStyleSheet("QPushButton#btnPlayAndPause{border-image:url(\":/resource/image/btn_play.png\");}");
}


3 changes: 3 additions & 0 deletions BottomWidgets/BottomWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ private slots:

void onErrorOccurs(int code,QString strErr);

//
void onAudioFinished(bool isEndWithForce);

private:
bool bInMakingMode; //标记是否在制作模式中

Expand Down

0 comments on commit 24ef977

Please sign in to comment.