2010-03-24 00:11:46 +01:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-03-24 00:11:46 +01:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-03-08 19:05:41 +01:00
|
|
|
#ifndef PLAYLISTSEQUENCE_H
|
|
|
|
#define PLAYLISTSEQUENCE_H
|
2010-03-08 15:08:54 +01:00
|
|
|
|
|
|
|
#include <QWidget>
|
2020-09-18 16:15:19 +02:00
|
|
|
#include <memory>
|
2010-03-08 15:08:54 +01:00
|
|
|
|
2010-05-10 23:50:31 +02:00
|
|
|
#include "core/settingsprovider.h"
|
2010-03-08 15:08:54 +01:00
|
|
|
|
2010-03-08 18:55:40 +01:00
|
|
|
class QMenu;
|
|
|
|
|
2010-05-10 23:50:31 +02:00
|
|
|
class Ui_PlaylistSequence;
|
|
|
|
|
2010-03-08 19:05:41 +01:00
|
|
|
class PlaylistSequence : public QWidget {
|
2010-03-08 15:08:54 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2014-02-10 16:03:54 +01:00
|
|
|
PlaylistSequence(QWidget* parent = nullptr, SettingsProvider* settings = 0);
|
2010-05-10 23:50:31 +02:00
|
|
|
~PlaylistSequence();
|
2010-03-08 15:08:54 +01:00
|
|
|
|
|
|
|
enum RepeatMode {
|
|
|
|
Repeat_Off = 0,
|
|
|
|
Repeat_Track = 1,
|
|
|
|
Repeat_Album = 2,
|
|
|
|
Repeat_Playlist = 3,
|
2015-05-22 15:11:58 +02:00
|
|
|
Repeat_OneByOne = 4,
|
2015-06-15 22:27:40 +02:00
|
|
|
Repeat_Intro = 5,
|
2010-03-08 15:08:54 +01:00
|
|
|
};
|
|
|
|
enum ShuffleMode {
|
|
|
|
Shuffle_Off = 0,
|
|
|
|
Shuffle_All = 1,
|
2011-11-27 16:01:10 +01:00
|
|
|
Shuffle_InsideAlbum = 2,
|
|
|
|
Shuffle_Albums = 3,
|
2010-03-08 15:08:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
2010-11-20 19:49:54 +01:00
|
|
|
RepeatMode repeat_mode() const;
|
|
|
|
ShuffleMode shuffle_mode() const;
|
2010-03-08 15:08:54 +01:00
|
|
|
|
2010-03-12 02:03:43 +01:00
|
|
|
QMenu* repeat_menu() const { return repeat_menu_; }
|
|
|
|
QMenu* shuffle_menu() const { return shuffle_menu_; }
|
|
|
|
|
2010-03-08 15:08:54 +01:00
|
|
|
public slots:
|
2010-03-08 19:05:41 +01:00
|
|
|
void SetRepeatMode(PlaylistSequence::RepeatMode mode);
|
|
|
|
void SetShuffleMode(PlaylistSequence::ShuffleMode mode);
|
2011-03-17 09:21:05 +01:00
|
|
|
void CycleShuffleMode();
|
|
|
|
void CycleRepeatMode();
|
2010-11-20 19:49:54 +01:00
|
|
|
void SetUsingDynamicPlaylist(bool dynamic);
|
2010-03-08 15:08:54 +01:00
|
|
|
|
2020-09-18 16:15:19 +02:00
|
|
|
signals:
|
2010-03-08 19:05:41 +01:00
|
|
|
void RepeatModeChanged(PlaylistSequence::RepeatMode mode);
|
|
|
|
void ShuffleModeChanged(PlaylistSequence::ShuffleMode mode);
|
2010-03-08 15:08:54 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void RepeatActionTriggered(QAction*);
|
|
|
|
void ShuffleActionTriggered(QAction*);
|
|
|
|
|
2010-03-08 18:55:40 +01:00
|
|
|
private:
|
|
|
|
void Load();
|
|
|
|
void Save();
|
2010-05-19 17:45:29 +02:00
|
|
|
static QIcon AddDesaturatedIcon(const QIcon& icon);
|
|
|
|
static QPixmap DesaturatedPixmap(const QPixmap& pixmap);
|
2010-03-08 18:55:40 +01:00
|
|
|
|
2010-03-08 15:08:54 +01:00
|
|
|
private:
|
2010-05-10 23:50:31 +02:00
|
|
|
Ui_PlaylistSequence* ui_;
|
2014-02-06 14:48:00 +01:00
|
|
|
std::unique_ptr<SettingsProvider> settings_;
|
2010-03-08 15:08:54 +01:00
|
|
|
|
|
|
|
QMenu* repeat_menu_;
|
|
|
|
QMenu* shuffle_menu_;
|
|
|
|
|
|
|
|
bool loading_;
|
|
|
|
RepeatMode repeat_mode_;
|
|
|
|
ShuffleMode shuffle_mode_;
|
2010-11-20 19:49:54 +01:00
|
|
|
bool dynamic_;
|
2010-03-08 15:08:54 +01:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // PLAYLISTSEQUENCE_H
|