Sayonara Player
PlaybackPipeline.h
1 /* PlaybackPipeline.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 GSTPLAYBACKPIPELINE_H_
22 #define GSTPLAYBACKPIPELINE_H_
23 
24 #include "ChangeablePipeline.h"
25 #include "Crossfader.h"
26 #include "Components/Engine/AbstractPipeline.h"
27 #include "Utils/Pimpl.h"
28 
29 namespace Pipeline
30 {
35  class Playback :
36  public Base,
37  public CrossFader,
38  public Changeable
39  {
40  Q_OBJECT
41  PIMPL(Playback)
42 
43  public:
44  explicit Playback(Engine::Base* engine, QObject *parent=nullptr);
45  virtual ~Playback();
46 
47  bool init(GstState state=GST_STATE_NULL) override;
48  bool set_uri(gchar* uri) override;
49 
50  void set_n_sound_receiver(int num_sound_receiver);
51 
52  void set_current_volume(double volume) override;
53  double get_current_volume() const override;
54 
55  GstElement* get_source() const override;
56  GstElement* get_pipeline() const override;
57 
58  void force_about_to_finish();
59 
60 
61  public slots:
62  void play() override;
63  void stop() override;
64 
65  void set_eq_band(int band_name, int val);
66  void set_streamrecorder_path(const QString& session_path);
67 
68  int64_t seek_rel(double percent, int64_t ref_ns);
69  int64_t seek_abs(int64_t ns );
70 
71  private:
72  void init_equalizer();
73  bool create_elements() override;
74  GstElement* create_audio_sink(const QString& name);
75  bool add_and_link_elements() override;
76  bool configure_elements() override;
77  uint64_t get_about_to_finish_time() const override;
78 
79  protected slots:
80  void s_vol_changed();
81  void s_show_level_changed();
82  void s_show_spectrum_changed();
83  void s_mute_changed();
84  void s_speed_active_changed();
85  void s_speed_changed();
86  void s_sink_changed();
87  };
88 }
89 
90 #endif
double get_current_volume() const override
get current volume of pipeline
The PlaybackPipeline class.
Definition: PlaybackPipeline.h:35
The AbstractPipeline class.
Definition: AbstractPipeline.h:61
The Engine class.
Definition: AbstractEngine.h:51
The CrossFader class.
Definition: Crossfader.h:35
void set_current_volume(double volume) override
set current volume of pipeline
Definition: AbstractPipeline.h:39
The ChangeablePipeline class.
Definition: ChangeablePipeline.h:32