Sayonara Player
PlaylistMode.h
1 /* PlaylistMode.h */
2 
3 /* Copyright (C) 2011 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 {
36 
37 
42  class Mode :
43  public SettingConvertible
44  {
45  PIMPL(Mode)
46 
47  public:
48  enum State
49  {
50  Off = 0,
51  On = 1,
52  Disabled = 2 // this has to be because of consistence
53  };
54 
55  public:
56  Mode();
57  ~Mode();
58  Mode(const Mode& other);
59  Mode& operator=(const Mode& other);
60 
61  PlaylistMode::State rep1() const;
62  PlaylistMode::State repAll() const;
63  PlaylistMode::State append() const;
64  PlaylistMode::State shuffle() const;
65  PlaylistMode::State dynamic() const;
66  PlaylistMode::State gapless() const;
67 
68  void setRep1(PlaylistMode::State state);
69  void setRepAll(PlaylistMode::State state);
70  void setAppend(PlaylistMode::State state);
71  void setShuffle(PlaylistMode::State state);
72  void setDynamic(PlaylistMode::State state);
73  void setGapless(PlaylistMode::State state);
74 
75  void setRep1(bool on, bool enabled=true);
76  void setRepAll(bool on, bool enabled=true);
77  void setAppend(bool on, bool enabled=true);
78  void setShuffle(bool on, bool enabled=true);
79  void setDynamic(bool on, bool enabled=true);
80  void setGapless(bool on, bool enabled=true);
81 
82  static bool isActive(PlaylistMode::State pl);
83  static bool isEnabled(PlaylistMode::State pl);
84  static bool isActiveAndEnabled(PlaylistMode::State pl);
85 
86  void print();
87 
88  QString toString() const override;
89  bool loadFromString(const QString& str) override;
90 
91  bool operator==(const PlaylistMode& pm) const;
92  };
93 }
94 
95 #endif
The Mode class.
Definition: PlaylistMode.h:42
Definition: SettingConvertible.h:28
Definition: Playlist.h:32