• 801阅读
  • 2回复

啦啦啦,MusicPlayer!!! [复制链接]

上一主题 下一主题
离线mind
 

只看楼主 倒序阅读 楼主  发表于: 06-02
  1. #ifndef MUSICPLAYER_H
  2. #define MUSICPLAYER_H
  3. #include <QWidget>
  4. #include <QMouseEvent>
  5. #include <QMediaPlayer>
  6. #include <QMediaPlaylist>
  7. namespace Ui {
  8. class MusicPlayer;
  9. }
  10. class MusicPlayer : public QWidget
  11. {
  12.     Q_OBJECT
  13. public:
  14.     explicit MusicPlayer(QWidget *parent = 0);
  15.     ~MusicPlayer();
  16. protected:
  17.     void mousePressEvent(QMouseEvent *ev);
  18.     void mouseMoveEvent(QMouseEvent *ev);
  19. private slots:
  20.     ///歌曲切换槽
  21.     void slotCurrentIndexChanged(int position);
  22.     ///歌曲播放进度自定义槽
  23.     void slotPositionChanged(qint64 position);
  24.     ///当前歌曲总时长自定义槽
  25.     void slotDurationChanged(qint64 duration);
  26.     void on_pb_min_clicked();
  27.     void on_pb_max_clicked();
  28.     void on_pb_close_clicked();
  29.     void on_pb_player_clicked();
  30.     void on_hs_position_sliderMoved(int position);
  31.     void on_hs_volume_sliderMoved(int position);
  32.     void on_lw_songNameList_clicked(const QModelIndex &index);
  33.     void on_pb_prev_clicked();
  34.     void on_pb_next_clicked();
  35.     void on_pb_playMode_clicked();
  36. private:
  37.     Ui::MusicPlayer *ui;
  38.     ///获取歌词
  39.     QString m_lyricPath;
  40.     QMap<quint64, quint64> m_mapLyricIndex; //time, index
  41.     QStringList m_lyricList;
  42.     void getCurrentLyric(void);
  43.     ///初始化播放列表
  44.     int m_playMode;
  45.     int m_playIndex; //当前播放索引
  46.     QString m_songPath;
  47.     QStringList m_songNameList;
  48.     QMediaPlaylist *m_playlist;
  49.     void initPlayList(void);
  50.     ///初始化播放器
  51.     QString m_songName;
  52.     qint64 m_totalPlayerTime;
  53.     qint64 m_currentPlayerTime;
  54.     QString m_playPosition;
  55.     QMediaPlayer *m_player;
  56.     void initPlayer(void);
  57.     ///初始化界面部件
  58.     QPoint m_widgetMove;
  59.     void initWidgetUnits(void);
  60. };
  61. #endif // MUSICPLAYER_H


离线z278930050

只看该作者 1楼 发表于: 06-04
然而。。
离线liuchangyin

只看该作者 2楼 发表于: 06-05
快速回复
限100 字节
 
上一个 下一个