Sayonara Player
ConvertPipeline.h
1 /* ConvertPipeline.h */
2 
3 /* Copyright 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 ConvertPipeline_H
22 #define ConvertPipeline_H
23 
24 #include "LameBitrate.h"
25 #include "Components/Engine/AbstractPipeline.h"
26 
28  public AbstractPipeline
29 {
30  Q_OBJECT
31 public:
32  explicit ConvertPipeline(Engine* engine, QObject *parent=nullptr);
33  ~ConvertPipeline();
34 
35  bool set_uri(gchar* uri) override;
36  bool init(GstState state=GST_STATE_NULL) override;
37  GstElement* get_source() const override;
38 
39  bool set_target_uri(gchar* uri);
40 
41 
42 public slots:
43  void play() override;
44  void pause() override;
45  void stop() override;
46 
47  void set_quality(LameBitrate quality);
48 
49 private:
50  GstElement* _audio_src=nullptr;
51  GstElement* _lame=nullptr;
52  GstElement* _decoder=nullptr;
53  GstElement* _audio_convert=nullptr;
54  GstElement* _audio_sink=nullptr;
55  GstElement* _resampler=nullptr;
56  GstElement* _xingheader=nullptr;
57 
58 
59 protected:
60  bool create_elements() override;
61  bool add_and_link_elements() override;
62  bool configure_elements() override;
63 };
64 
65 #endif // ConvertPipeline_H
Definition: ConvertPipeline.h:27
The Engine class.
Definition: AbstractEngine.h:49
The AbstractPipeline class.
Definition: AbstractPipeline.h:54