ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
audio-playlist.hpp
Go to the documentation of this file.
1#ifndef AUDIO_PLAYLIST_HPP
2#define AUDIO_PLAYLIST_HPP
3
4#include <QDialog>
5#include <QString>
6
7class QLabel;
8class QListWidget;
9class QPushButton;
10
11/**
12 * @brief Editor for creating and modifying ordered M3U audio playlists.
13 */
14class AudioPlaylistDialog : public QDialog {
15 Q_OBJECT
16
17 public:
18 explicit AudioPlaylistDialog(const QString &playlistPath = QString(), QWidget *parent = nullptr);
19
20 /// @brief Return the playlist most recently opened or saved.
21 QString playlistPath() const;
22
23 private slots:
24 void addTracks();
25 void removeSelected();
26 void moveUp();
27 void moveDown();
28 void sortTracks();
29 void shuffleTracks();
30 void clearTracks();
31 void openPlaylist();
32 void savePlaylist();
33 void savePlaylistAs();
34 void finishEditing();
35
36 protected:
37 void reject() override;
38
39 private:
40 void setupUi();
41 bool loadPlaylist(const QString &path);
42 bool writePlaylist(const QString &path);
44 void updateWindowState();
45 QString itemPath(int row) const;
46 void setDirty(bool dirty = true);
47
48 QListWidget *trackList = nullptr;
49 QLabel *pathLabel = nullptr;
50 QPushButton *removeButton = nullptr;
51 QPushButton *upButton = nullptr;
52 QPushButton *downButton = nullptr;
53 QPushButton *sortButton = nullptr;
54 QPushButton *shuffleButton = nullptr;
55 QPushButton *clearButton = nullptr;
56 QPushButton *saveButton = nullptr;
58 bool dirty = false;
59};
60
61#endif
QPushButton * downButton
QPushButton * removeButton
QPushButton * sortButton
void reject() override
bool writePlaylist(const QString &path)
QString playlistPath() const
Return the playlist most recently opened or saved.
bool loadPlaylist(const QString &path)
QPushButton * clearButton
QPushButton * shuffleButton
QListWidget * trackList
QString itemPath(int row) const
QPushButton * saveButton
void setDirty(bool dirty=true)
AudioPlaylistDialog(const QString &playlistPath=QString(), QWidget *parent=nullptr)