Ui improvements
This commit is contained in:
parent
5fcb6a4149
commit
56660fe0b5
4 changed files with 122 additions and 7 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include <QString>
|
||||
#include <QMediaDevices>
|
||||
#include <QAudioDevice>
|
||||
#include <QTimer>
|
||||
|
||||
class AudioPlayer : public QObject
|
||||
{
|
||||
|
|
@ -17,7 +18,10 @@ public:
|
|||
~AudioPlayer();
|
||||
|
||||
void play(const QString &filePath);
|
||||
void play();
|
||||
void stop();
|
||||
void pause();
|
||||
void setPosition(int position);
|
||||
bool isPlaying() const;
|
||||
int duration() const;
|
||||
int position() const;
|
||||
|
|
@ -26,6 +30,8 @@ signals:
|
|||
void playbackStarted();
|
||||
void playbackFinished();
|
||||
void playbackError(const QString &error);
|
||||
void positionChanged(int position);
|
||||
void durationChanged(int duration);
|
||||
|
||||
private slots:
|
||||
void handlePlaybackStateChanged(QMediaPlayer::PlaybackState state);
|
||||
|
|
@ -34,6 +40,7 @@ private slots:
|
|||
private:
|
||||
QMediaPlayer *mediaPlayer;
|
||||
QAudioOutput *audioOutput;
|
||||
QTimer *positionTimer;
|
||||
};
|
||||
|
||||
#endif // AUDIOPLAYER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue