Sayonara Player
PlaylistMode.h
1 /* PlaylistMode.h */
2 
3 /* Copyright (C) 2011 Michael Lugmair (Lucio Carreras)
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef PLAYLISTMODE_H_
22 #define PLAYLISTMODE_H_
23 
24 #include "Utils/Pimpl.h"
25 #include "Utils/Settings/SettingConvertible.h"
26 
27 namespace Playlist
28 {
29  class Mode;
30 }
31 
33 
34 namespace Playlist
35 {
40  class Mode :
41  public SettingConvertible
42  {
43  PIMPL(Mode)
44 
45  public:
46  enum State
47  {
48  Off = 0,
49  On = 1,
50  Disabled = 2 // this has to be because of consistence
51  };
52 
53  public:
54  Mode();
55  ~Mode() override;
56  Mode(const Mode& other);
57  Mode& operator=(const Mode& other);
58 
59  PlaylistMode::State rep1() const;
60  PlaylistMode::State repAll() const;
61  PlaylistMode::State append() const;
62  PlaylistMode::State shuffle() const;
63  PlaylistMode::State dynamic() const;
64  PlaylistMode::State gapless() const;
65 
66  void setRep1(PlaylistMode::State state);
67  void setRepAll(PlaylistMode::State state);
68  void setAppend(PlaylistMode::State state);
69  void setShuffle(PlaylistMode::State state);
70  void setDynamic(PlaylistMode::State state);
71  void setGapless(PlaylistMode::State state);
72 
73  void setRep1(bool on, bool enabled=true);
74  void setRepAll(bool on, bool enabled=true);
75  void setAppend(bool on, bool enabled=true);
76  void setShuffle(bool on, bool enabled=true);
77  void setDynamic(bool on, bool enabled=true);
78  void setGapless(bool on, bool enabled=true);
79 
80  static bool isActive(PlaylistMode::State pl);
81  static bool isEnabled(PlaylistMode::State pl);
82  static bool isActiveAndEnabled(PlaylistMode::State pl);
83 
84  void print();
85 
86  QString toString() const override;
87  bool loadFromString(const QString& str) override;
88 
89  bool operator==(const PlaylistMode& pm) const;
90  };
91 }
92 
93 #endif
SettingConvertible
Definition: SettingConvertible.h:29
Playlist::Mode
The Mode class.
Definition: PlaylistMode.h:42