Files
gdmp/playlist.h

104 lines
2.1 KiB
C
Raw Normal View History

2025-09-25 16:56:53 +08:00
/*
* @file playlist.h
* @date 2018/01/07 11:12
*
* @author itisyang
* @Contact itisyang@gmail.com
*
* @brief
* @note
*/
#ifndef PLAYLIST_H
#define PLAYLIST_H
#include <QWidget>
#include <QListWidgetItem>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>
namespace Ui {
class Playlist;
}
class Playlist : public QWidget
{
Q_OBJECT
public:
explicit Playlist(QWidget *parent = 0);
~Playlist();
bool Init();
/**
* @brief
*
* @return true false
* @note
*/
bool GetPlaylistStatus();
int GetCurrentIndex();
std::string GetCurrentUrl();
// 获取前一个url并将前一个url设置为选中状态
std::string GetPrevUrlAndSelect();
// 获取下一个url并将下一个url设置为选中状态
std::string GetNextUrlAndSelect();
public:
void AddNetworkUrl(QString network_url);
/**
* @brief
*
* @param strFileName
* @note
*/
void OnAddFile(QString strFileName);
void OnAddFileAndPlay(QString strFileName);
void OnBackwardPlay();
void OnForwardPlay();
void OnRequestPlayCurrentFile();
/* 在这里定义dock的初始大小 */
QSize sizeHint() const
{
return QSize(150, 900);
}
protected:
/**
* @brief
*
* @param event
* @note
*/
void dropEvent(QDropEvent *event);
/**
* @brief
*
* @param event
* @note
*/
void dragEnterEvent(QDragEnterEvent *event);
signals:
void SigUpdateUi(); //< 界面排布更新
void SigPlay(std::string url); //< 播放文件
private:
bool InitUi();
bool ConnectSignalSlots();
void savePlayList();
private slots:
// 双击事件响应
void on_List_itemDoubleClicked(QListWidgetItem *item);
void on_List_itemSelectionChanged();
private:
Ui::Playlist *ui;
int m_nCurrentPlayListIndex = 0;
};
#endif // PLAYLIST_H