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 "Utils/Settings/SayonaraClass.h"
26 #include "Utils/Pimpl.h"
27 
28 #include <QObject>
29 
30 class MetaData;
31 
32 namespace StreamRecorder
33 {
39  public QObject,
40  public SayonaraClass
41  {
42  PIMPL(StreamRecorder)
43 
44  private:
45  // set metadata, add to session collector
46  bool save();
47 
48  void clear();
49 
50  // saves session collector into playlist, creates new session,
51  void new_session();
52 
53  // check and create session path
54  QString check_target_path(const QString& target_path);
55 
56 
57  public:
58  explicit StreamRecorder(QObject *parent=nullptr);
59  ~StreamRecorder();
60 
61  // change recording destination, create session path
62  // returns destination file
63  QString change_track(const MetaData& md);
64 
65  // start or end a session
66  void record(bool b);
67 
68  // is in a session currently
69  bool is_recording() const;
70 
71 
72  private slots:
73  void playstate_changed(PlayState state);
74  };
75 }
76 
77 #endif // STREAMRECORDER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
PlayState
The PlayState enum.
Definition: PlayState.h:28
The MetaData class.
Definition: MetaData.h:48
Definition: PipelineProbes.h:26