Debian Codegraph @

gstreamer/gstreamermm/audiocdsrc.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_AUDIOCDSRC_H
3 #define _GSTREAMERMM_AUDIOCDSRC_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2016 The gstreamermm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28 #include <gst/audio/gstaudiocdsrc.h>
29 #include <gstreamermm/pushsrc.h>
30 #include <gstreamermm/taglist.h>
31 #include <glibmm/arrayhandle.h>
32
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 using GstAudioCdSrc = struct _GstAudioCdSrc;
36 using GstAudioCdSrcClass = struct _GstAudioCdSrcClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38
39
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 namespace Gst
42 { class AudioCdSrc_Class; } // namespace Gst
43 #endif //DOXYGEN_SHOULD_SKIP_THIS
44
45 namespace Gst
46 {
47
48 /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */
49
50 /**
51 * @var AudioCdSrcMode AUDIO_CD_SRC_MODE_NORMAL
52 * Each single track is a stream.
53 *
54 * @var AudioCdSrcMode AUDIO_CD_SRC_MODE_CONTINUOUS
55 * The entire disc is a single stream.
56 *
57 * @enum AudioCdSrcMode
58 *
59 * Mode in which the CD audio source operates. Influences timestamping,
60 * EOS handling and seeking.
61 *
62 * @ingroup gstreamermmEnums
63 */
64 enum AudioCdSrcMode
65 {
66 AUDIO_CD_SRC_MODE_NORMAL,
67 AUDIO_CD_SRC_MODE_CONTINUOUS
68 };
69
70 } // namespace Gst
71
72 #ifndef DOXYGEN_SHOULD_SKIP_THIS
73 namespace Glib
74 {
75
76 template <>
77 class Value<Gst::AudioCdSrcMode> : public Glib::Value_Enum<Gst::AudioCdSrcMode>
78 {
79 public:
80 static GType value_type() G_GNUC_CONST;
81 };
82
83 } // namespace Glib
84 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
85
86 namespace Gst
87 {
88
89
90 /** A base class for CD digital audio (CDDA) sources, which handles
91 * things like seeking, querying, discid calculation, tags, and buffer
92 * timestamping.
93 *
94 * Gst::AudioCdSrc registers two Gst::Formats of its own, namely the
95 * "track" format and the "sector" format. Applications will usually only find
96 * the "track" format interesting. You can retrieve that Gst::Format for use in
97 * seek events or queries with Gst::get_format("track").
98 *
99 * In order to query the number of tracks, for example, an application would
100 * set the CDDA source element to READY or PAUSED state and then query the the
101 * number of tracks via Gst::Element::query_duration() using the track format
102 * acquired above. Applications can query the currently playing track in the
103 * same way.
104 *
105 * Alternatively, applications may retrieve the currently playing track and the
106 * total number of tracks from the taglist that will be posted on the bus
107 * whenever the CD is opened or the currently playing track changes. The
108 * taglist will contain Gst::TAG_TRACK_NUMBER and Gst::TAG_TRACK_COUNT tags.
109 *
110 * Applications playing back CD audio using playbin and cdda://n URIs should
111 * issue a seek command in track format to change between tracks, rather than
112 * setting a new cdda://n+1 URI on playbin (as setting a new URI on playbin
113 * involves closing and re-opening the CD device, which is much much slower).
114 *
115 * CDDA sources will automatically emit a number of tags, details about which
116 * can be found in the libgsttag documentation. Those tags are:
117 * Gst::TAG_CDDA_CDDB_DISCID, Gst::TAG_CDDA_CDDB_DISCID_FULL,
118 * Gst::TAG_CDDA_MUSICBRAINZ_DISCID, Gst::TAG_CDDA_MUSICBRAINZ_DISCID_FULL,
119 * among others.
120 *
121 * Applications will be informed of the available tracks via a TOC message
122 * on the pipeline's Gst::Bus. The Gst::Toc will contain a Gst::TocEntry for
123 * each track, with information about each track. The duration for each
124 * track can be retrieved via the Gst::TAG_DURATION tag from each entry's
125 * tag list, or calculated via Gst::TocEntry::get_start_stop_times().
126 * The track entries in the TOC will be sorted by track number.
127 *
128 * Last reviewed on 2016-05-16 (1.8.0)
129 *
130 * @ingroup GstBaseClasses
131 */
132
133 class AudioCdSrc : public Gst::PushSrc
134 {
135
136 #ifndef DOXYGEN_SHOULD_SKIP_THIS
137
138 public:
139 using CppObjectType = AudioCdSrc;
140 using CppClassType = AudioCdSrc_Class;
141 using BaseObjectType = GstAudioCdSrc;
142 using BaseClassType = GstAudioCdSrcClass;
143
144 // noncopyable
145 AudioCdSrc(const AudioCdSrc&) = delete;
146 AudioCdSrc& operator=(const AudioCdSrc&) = delete;
147
148 private: friend class AudioCdSrc_Class;
149 static CppClassType audiocdsrc_class_;
150
151 protected:
152 explicit AudioCdSrc(const Glib::ConstructParams& construct_params);
153 explicit AudioCdSrc(GstAudioCdSrc* castitem);
154
155 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
156
157 public:
158
159 AudioCdSrc(AudioCdSrc&& src) noexcept;
160 AudioCdSrc& operator=(AudioCdSrc&& src) noexcept;
161
162 ~AudioCdSrc() noexcept override;
163
164 /** Get the GType for this class, for use with the underlying GObject type system.
165 */
166 static GType get_type() G_GNUC_CONST;
167
168 #ifndef DOXYGEN_SHOULD_SKIP_THIS
169
170
171 static GType get_base_type() G_GNUC_CONST;
172 #endif
173
174 ///Provides access to the underlying C GObject.
175 GstAudioCdSrc* gobj() { return reinterpret_cast<GstAudioCdSrc*>(gobject_); }
176
177 ///Provides access to the underlying C GObject.
178 const GstAudioCdSrc* gobj() const { return reinterpret_cast<GstAudioCdSrc*>(gobject_); }
179
180 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
181 GstAudioCdSrc* gobj_copy();
182
183 private:
184
185
186 public:
187 /** CDDA sources use this function from their start vfunc to announce the
188 * available data and audio tracks to the base source class.
189 *
190 * @param num Track number in TOC (usually starts from 1, but not always).
191 * @param start The first sector of the track (LBA).
192 * @param end The last sector of the track (LBA).
193 * @param is_audio Whether this is an audio track.
194 * @param tags Track-specific tags (e.g. from cd-text information).
195 * @return false on error, otherwise true.
196 */
197 bool add_track(guint num, guint start, guint end, bool is_audio = true,
198 const Gst::TagList& tags = Gst::TagList());
199
200
201 /** CD device location.
202 *
203 * @return A PropertyProxy that allows you to get or set the value of the property,
204 * or receive notification when the value of the property changes.
205 */
206 Glib::PropertyProxy< std::string > property_device() ;
207
208 /** CD device location.
209 *
210 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
211 * or receive notification when the value of the property changes.
212 */
213 Glib::PropertyProxy_ReadOnly< std::string > property_device() const;
214
215 /** Mode.
216 *
217 * @return A PropertyProxy that allows you to get or set the value of the property,
218 * or receive notification when the value of the property changes.
219 */
220 Glib::PropertyProxy< AudioCdSrcMode > property_mode() ;
221
222 /** Mode.
223 *
224 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
225 * or receive notification when the value of the property changes.
226 */
227 Glib::PropertyProxy_ReadOnly< AudioCdSrcMode > property_mode() const;
228
229 /** Track.
230 *
231 * @return A PropertyProxy that allows you to get or set the value of the property,
232 * or receive notification when the value of the property changes.
233 */
234 Glib::PropertyProxy< guint > property_track() ;
235
236 /** Track.
237 *
238 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
239 * or receive notification when the value of the property changes.
240 */
241 Glib::PropertyProxy_ReadOnly< guint > property_track() const;
242
243
244 /** Virtual function to open a CD device.
245 */
246 virtual bool open_vfunc(const std::string& device);
247
248
249 /** Virtual function to close the device.
250 */
251 virtual void close_vfunc();
252
253
254 /** Virtual function to read one sector (LBA).
255 */
256 virtual Glib::RefPtr<Gst::Buffer> read_sector_vfunc(gint sector);
257
258
259 public:
260
261 public:
262 //C++ methods used to invoke GTK+ virtual functions:
263
264 protected:
265 //GTK+ Virtual Functions (override these to change behaviour):
266
267 //Default Signal Handlers::
268
269
270 };
271
272 } // namespace Gst
273
274
275 namespace Glib
276 {
277 /** A Glib::wrap() method for this object.
278 *
279 * @param object The C instance.
280 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
281 * @result A C++ instance that wraps this C instance.
282 *
283 * @relates Gst::AudioCdSrc
284 */
285 Glib::RefPtr<Gst::AudioCdSrc> wrap(GstAudioCdSrc* object, bool take_copy = false);
286 }
287
288
289 #endif /* _GSTREAMERMM_AUDIOCDSRC_H */
290