Sayonara Player
StreamRecorder.h
1 /* StreamRecorder.h */
2 
3 /* Copyright (C) 2011-2017 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 STREAMRECORDER_H
22 #define STREAMRECORDER_H
23 
24 #include "Components/PlayManager/PlayState.h"
25 #include "Helper/Settings/SayonaraClass.h"
26 #include "Helper/Pimpl.h"
27 
28 #include <QObject>
29 
30 class MetaData;
31 
37  public QObject,
38  protected SayonaraClass
39 {
40  PIMPL(StreamRecorder)
41 
42 private:
43  // set metadata, add to session collector
44  bool save();
45 
46  void clear();
47 
48  // saves session collector into playlist, creates new session,
49  void new_session();
50 
51  // check and create session path
52  QString check_session_path(const QString& sr_path);
53 
54 
55 public:
56  explicit StreamRecorder(QObject *parent=nullptr);
57  ~StreamRecorder();
58 
59  // change recording destination, create session path
60  // returns destination file
61  QString change_track(const MetaData& md);
62 
63  // start or end a session
64  void record(bool b);
65 
66  // is in a session currently
67  bool is_recording() const;
68 
69 private slots:
70  void playstate_changed(PlayState state);
71 };
72 
73 #endif // STREAMRECORDER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
The MetaData class MetaDataHelper.
Definition: MetaData.h:55
The StreamRecorder class.
Definition: StreamRecorder.h:36
PlayState
The PlayState enum.
Definition: PlayState.h:30