aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpplistwindow.hpp
blob: 8ccbf23ecbc9dc28ab4af67ac908cd0649160cee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef QMPPLISTWINDOW_H
#define QMPPLISTWINDOW_H

#include <QWidget>
#include <QShowEvent>
#include <QCloseEvent>
#include <QMoveEvent>
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QListWidgetItem>
#include "qmpcorepublic.hpp"

namespace Ui
{
class qmpPlistWindow;
}

class qmpPlistWindow;
class qmpSettings;

class qmpPlistFunc: public qmpFuncBaseIntf
{
private:
    qmpPlistWindow *p;
public:
    qmpPlistFunc(qmpPlistWindow *par);
    void show();
    void close();
};

class qmpPlistWindow: public QWidget
{
    Q_OBJECT

public:
    explicit qmpPlistWindow(QWidget *parent = 0);
    ~qmpPlistWindow();
    void showEvent(QShowEvent *event);
    void closeEvent(QCloseEvent *event);
    void dropEvent(QDropEvent *event);
    void dragEnterEvent(QDragEnterEvent *event);
    int getRepeat();
    QString getFirstItem(bool a = false);
    QString getLastItem(bool a = false);
    QString getNextItem();
    QString getPrevItem();
    QString getCurrentItem();
    void setCurrentItem(QString item);
    void setCurrentItem(QListWidgetItem *item);
    void emptyList();
    void insertItem(QString i);
    void insertItems(QStringList il);
signals:
    void selectionChanging();

public slots:
    int on_pbAdd_clicked();
private slots:
    void on_pbAddFolder_clicked();
    void on_pbRemove_clicked();
    void on_pbClear_clicked();
    void on_pbRepeat_clicked();
    void on_pbShuffle_clicked();
    void on_lwFiles_itemDoubleClicked(QListWidgetItem *item);
    void on_pbSave_clicked();
    void on_pbLoad_clicked();

private:
    qmpPlistFunc *plistf;
    Ui::qmpPlistWindow *ui;
    int shuffle, repeat; //rep 0=off 1=one 2=all
    qmpSettings *settings;

    int getCurrentItemIndex();
};

#endif // QMPPLISTWINDOW_H