-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.hpp
71 lines (65 loc) · 1.97 KB
/
mainwindow.hpp
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
#ifndef MAINWINDOW_HPP
#define MAINWINDOW_HPP
#include <map>
#include <QColor>
#include <QMainWindow>
#include <QTimer>
#include <raylib.h>
#include "playlist.hpp"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
Ui::MainWindow *ui;
QTimer m_musicTimer;
QTimer m_sliderTimer;
QTimer m_statusTimer;
Music m_music;
QStringList m_filenames;
std::map<QString, QString> m_splittedSongs;
QString m_musicPlaying;
/* Hack to set the last music that were playing when the user opens more songs */
QString m_lastMusicPlaying;
float m_lastTimePlayed;
unsigned int m_musicCount;
bool m_firstTime;
float m_streamLength;
Playlist *m_playlist;
void resetControllers(bool resetLength = true, bool resetPlayingEdit = true);
void setStatusText(QString text, QColor color = Qt::white);
void setMusic(unsigned int number);
void playMusic();
void stopMusic(bool resetLength = true, bool resetPlayingEdit = true);
int setTimePlayedText(int value);
void splitSongs();
void putSongsTogether();
void setMusicNamesToListWidget();
void setMusicNameToEdit();
QString getCurrentSongName();
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void onListWidgetClicked(const QModelIndex &index);
void onListWidgetActionClicked([[maybe_unused]] bool triggered);
void onOpenPlaylistButtonClicked();
void onRemovePlaylistsButtonClicked();
void onSavePlaylistButtonClicked();
void onReturnAtEditPressed();
void onOpenFileButtonClicked();
void onClosePlaylistButtonClicked();
void onPlayPauseButtonClicked();
void onStopButtonClicked();
void onPreviousButtonClicked();
void onNextButtonClicked();
void onRepeatCheckBoxClicked(bool checked);
void onMusicTimeout();
void onSliderTimeout();
void onSliderReleased();
void onStatusTimeout();
};
#endif // MAINWINDOW_HPP