diff options
author | Ken Moore <ken@pcbsd.org> | 2015-01-16 18:00:31 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-01-16 18:00:31 -0500 |
commit | 0c91fd6dc5a8ed7e0571335d2ce6dd9b76e76dc9 (patch) | |
tree | 40f0b31c62440abd6ce501e5fae4325a7ee8ef45 /lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h | |
parent | Have the user button automatically perform the long application listings in t... (diff) | |
download | lumina-0c91fd6dc5a8ed7e0571335d2ce6dd9b76e76dc9.tar.gz lumina-0c91fd6dc5a8ed7e0571335d2ce6dd9b76e76dc9.tar.bz2 lumina-0c91fd6dc5a8ed7e0571335d2ce6dd9b76e76dc9.zip |
Add a new desktop plugin: audioplayer
Diffstat (limited to 'lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h')
-rw-r--r-- | lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h b/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h new file mode 100644 index 00000000..d50f8c26 --- /dev/null +++ b/lumina-desktop/desktop-plugins/audioplayer/PlayerWidget.h @@ -0,0 +1,79 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This plugin is a simple audio player on the desktop +//=========================================== +#ifndef _LUMINA_DESKTOP_PLUGIN_AUDIO_PLAYER_WIDGET_H +#define _LUMINA_DESKTOP_PLUGIN_AUDIO_PLAYER_WIDGET_H + +#include <QMediaPlaylist> +#include <QMediaPlayer> +#include <QTimer> +#include <QWidget> +#include <QMenu> + +#include "../LDPlugin.h" + +namespace Ui{ + class PlayerWidget; +}; + +class PlayerWidget : public QWidget{ + Q_OBJECT +public: + PlayerWidget(QWidget *parent = 0); + ~PlayerWidget(); + +public slots: + void LoadIcons(); + +private: + Ui::PlayerWidget *ui; + QMediaPlaylist *PLAYLIST; + QMediaPlayer *PLAYER; + //QTimer *infoTimer; + QMenu *configMenu, *addMenu; + bool updatinglists; + +private slots: + void playClicked(); + void pauseClicked(); + void stopClicked(); + void nextClicked(); + void prevClicked(); + + void AddFilesToPlaylist(); + void AddDirToPlaylist(); + void AddURLToPlaylist(); + void ClearPlaylist(); + void ShufflePlaylist(); + void userlistSelectionChanged(); //front-end combobox was changed by the user + void playerStateChanged(); + void playlistChanged(); //list of items changed + void currentSongChanged(); + //void rotateTrackInfo(); //on a timer to rotate the visible information about the track +}; + +// Wrapper class to put this into a desktop plugin container +class AudioPlayerPlugin : public LDPlugin{ + Q_OBJECT +public: + AudioPlayerPlugin(QWidget* parent, QString ID); + ~AudioPlayerPlugin(); + +private: + PlayerWidget *player; + +public slots: + void LocaleChange(){ + QTimer::singleShot(0,player, SLOT(LoadIcons())); + } + void ThemeChange(){ + QTimer::singleShot(0,player, SLOT(LoadIcons())); + } +}; + +#endif |