| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | |
| 3 | |
| 4 | #include <glibmm.h> |
| 5 | |
| 6 | #include <gstreamermm/toc.h> |
| 7 | #include <gstreamermm/private/toc_p.h> |
| 8 | |
| 9 | |
| 10 | /* |
| 11 | * toc.ccg |
| 12 | * |
| 13 | * Created on: Sep 25, 2013 |
| 14 | * Author: m.kolny |
| 15 | */ |
| 16 | /* gstreamermm - a C++ wrapper for gstreamer |
| 17 | * |
| 18 | * Copyright 2008-2013 The gstreamermm Development Team |
| 19 | * |
| 20 | * This library is free software; you can redistribute it and/or |
| 21 | * modify it under the terms of the GNU Lesser General Public |
| 22 | * License as published by the Free Software Foundation; either |
| 23 | * version 2.1 of the License, or (at your option) any later version. |
| 24 | * |
| 25 | * This library is distributed in the hope that it will be useful, |
| 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 28 | * Lesser General Public License for more details. |
| 29 | * |
| 30 | * You should have received a copy of the GNU Lesser General Public |
| 31 | * License along with this library; if not, write to the Free |
| 32 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 33 | */ |
| 34 | |
| 35 | |
| 36 | namespace |
| 37 | { |
| 38 | } // anonymous namespace |
| 39 | |
| 40 | // static |
| 41 | GType Glib::Value<Gst::TocScope>::value_type() |
| 42 | { |
| 43 | return gst_toc_scope_get_type(); |
| 44 | } |
| 45 | |
| 46 | // static |
| 47 | GType Glib::Value<Gst::TocEntryType>::value_type() |
| 48 | { |
| 49 | return gst_toc_entry_type_get_type(); |
| 50 | } |
| 51 | |
| 52 | // static |
| 53 | GType Glib::Value<Gst::TocLoopType>::value_type() |
| 54 | { |
| 55 | return gst_toc_loop_type_get_type(); |
| 56 | } |
| 57 | |
| 58 | |
| 59 | /* Why reinterpret_cast<Toc*>(gobject) is needed: |
| 60 | * |
| 61 | * A Toc instance is in fact always a GstToc instance. |
| 62 | * Unfortunately, GstToc cannot be a member of Toc, |
| 63 | * because it is an opaque struct. Also, the C interface does not provide |
| 64 | * any hooks to install a destroy notification handler, thus we cannot |
| 65 | * wrap it dynamically either. |
| 66 | * |
| 67 | * The cast works because Toc does not have any member data, and |
| 68 | * it is impossible to derive from it. This is ensured by using final on the |
| 69 | * class and by using = delete on the default constructor. |
| 70 | */ |
| 71 | |
| 72 | namespace Glib |
| 73 | { |
| 74 | |
| 75 | Glib::RefPtr<Gst::Toc> wrap(GstToc* object, bool take_copy) |
| 76 | { |
| 77 | if(take_copy && object) |
| 78 | gst_toc_ref(object); |
| 79 | |
| 80 | // See the comment at the top of this file, if you want to know why the cast works. |
| 81 | return Glib::RefPtr<Gst::Toc>(reinterpret_cast<Gst::Toc*>(object)); |
| 82 | } |
| 83 | |
| 84 | } // namespace Glib |
| 85 | |
| 86 | |
| 87 | namespace Gst |
| 88 | { |
| 89 | |
| 90 | |
| 91 | void Toc::reference() const |
| 92 | { |
| 93 | // See the comment at the top of this file, if you want to know why the cast works. |
| 94 | gst_toc_ref(reinterpret_cast<GstToc*>(const_cast<Toc*>(this))); |
| 95 | } |
| 96 | |
| 97 | void Toc::unreference() const |
| 98 | { |
| 99 | // See the comment at the top of this file, if you want to know why the cast works. |
| 100 | gst_toc_unref(reinterpret_cast<GstToc*>(const_cast<Toc*>(this))); |
| 101 | } |
| 102 | |
| 103 | GstToc* Toc::gobj() |
| 104 | { |
| 105 | // See the comment at the top of this file, if you want to know why the cast works. |
| 106 | return reinterpret_cast<GstToc*>(this); |
| 107 | } |
| 108 | |
| 109 | const GstToc* Toc::gobj() const |
| 110 | { |
| 111 | // See the comment at the top of this file, if you want to know why the cast works. |
| 112 | return reinterpret_cast<const GstToc*>(this); |
| 113 | } |
| 114 | |
| 115 | GstToc* Toc::gobj_copy() const |
| 116 | { |
| 117 | // See the comment at the top of this file, if you want to know why the cast works. |
| 118 | const auto gobject = reinterpret_cast<GstToc*>(const_cast<Toc*>(this)); |
| 119 | gst_toc_ref(gobject); |
| 120 | return gobject; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | void Toc::append_entry(Glib::RefPtr<Gst::TocEntry> entry) |
| 125 | { |
| 126 | gst_toc_append_entry(gobj(), Glib::unwrap(entry)); |
| 127 | } |
| 128 | |
| 129 | void Toc::dump() |
| 130 | { |
| 131 | gst_toc_dump(gobj()); |
| 132 | } |
| 133 | |
| 134 | void Toc::dump() const |
| 135 | { |
| 136 | return const_cast<Toc*>(this)->dump(); |
| 137 | } |
| 138 | |
| 139 | void Toc::set_tags(const Gst::TagList& tags) |
| 140 | { |
| 141 | gst_toc_set_tags(gobj(), const_cast<GstTagList*>(tags.gobj())); |
| 142 | } |
| 143 | |
| 144 | Gst::TagList Toc::get_tags() const |
| 145 | { |
| 146 | return Glib::wrap_taglist(const_cast<GstTagList*>(gst_toc_get_tags(const_cast<GstToc*>(gobj()))), true); |
| 147 | } |
| 148 | |
| 149 | Gst::TocScope Toc::get_scope() const |
| 150 | { |
| 151 | return ((Gst::TocScope)(gst_toc_get_scope(const_cast<GstToc*>(gobj())))); |
| 152 | } |
| 153 | |
| 154 | Glib::RefPtr<Gst::TocEntry> Toc::find_entry(const Glib::ustring& uid) const |
| 155 | { |
| 156 | return Glib::wrap(gst_toc_find_entry(const_cast<GstToc*>(gobj()), uid.c_str())); |
| 157 | } |
| 158 | |
| 159 | |
| 160 | } // namespace Gst |
| 161 | |
| 162 | |
| 163 | /* Why reinterpret_cast<TocEntry*>(gobject) is needed: |
| 164 | * |
| 165 | * A TocEntry instance is in fact always a GstTocEntry instance. |
| 166 | * Unfortunately, GstTocEntry cannot be a member of TocEntry, |
| 167 | * because it is an opaque struct. Also, the C interface does not provide |
| 168 | * any hooks to install a destroy notification handler, thus we cannot |
| 169 | * wrap it dynamically either. |
| 170 | * |
| 171 | * The cast works because TocEntry does not have any member data, and |
| 172 | * it is impossible to derive from it. This is ensured by using final on the |
| 173 | * class and by using = delete on the default constructor. |
| 174 | */ |
| 175 | |
| 176 | namespace Glib |
| 177 | { |
| 178 | |
| 179 | Glib::RefPtr<Gst::TocEntry> wrap(GstTocEntry* object, bool take_copy) |
| 180 | { |
| 181 | if(take_copy && object) |
| 182 | gst_toc_entry_ref(object); |
| 183 | |
| 184 | // See the comment at the top of this file, if you want to know why the cast works. |
| 185 | return Glib::RefPtr<Gst::TocEntry>(reinterpret_cast<Gst::TocEntry*>(object)); |
| 186 | } |
| 187 | |
| 188 | } // namespace Glib |
| 189 | |
| 190 | |
| 191 | namespace Gst |
| 192 | { |
| 193 | |
| 194 | |
| 195 | void TocEntry::reference() const |
| 196 | { |
| 197 | // See the comment at the top of this file, if you want to know why the cast works. |
| 198 | gst_toc_entry_ref(reinterpret_cast<GstTocEntry*>(const_cast<TocEntry*>(this))); |
| 199 | } |
| 200 | |
| 201 | void TocEntry::unreference() const |
| 202 | { |
| 203 | // See the comment at the top of this file, if you want to know why the cast works. |
| 204 | gst_toc_entry_unref(reinterpret_cast<GstTocEntry*>(const_cast<TocEntry*>(this))); |
| 205 | } |
| 206 | |
| 207 | GstTocEntry* TocEntry::gobj() |
| 208 | { |
| 209 | // See the comment at the top of this file, if you want to know why the cast works. |
| 210 | return reinterpret_cast<GstTocEntry*>(this); |
| 211 | } |
| 212 | |
| 213 | const GstTocEntry* TocEntry::gobj() const |
| 214 | { |
| 215 | // See the comment at the top of this file, if you want to know why the cast works. |
| 216 | return reinterpret_cast<const GstTocEntry*>(this); |
| 217 | } |
| 218 | |
| 219 | GstTocEntry* TocEntry::gobj_copy() const |
| 220 | { |
| 221 | // See the comment at the top of this file, if you want to know why the cast works. |
| 222 | const auto gobject = reinterpret_cast<GstTocEntry*>(const_cast<TocEntry*>(this)); |
| 223 | gst_toc_entry_ref(gobject); |
| 224 | return gobject; |
| 225 | } |
| 226 | |
| 227 | TocEntryType TocEntry::get_entry_type() |
| 228 | { |
| 229 | return ((TocEntryType)(gst_toc_entry_get_entry_type(gobj()))); |
| 230 | } |
| 231 | |
| 232 | Glib::ustring TocEntry::get_uid() |
| 233 | { |
| 234 | return Glib::convert_const_gchar_ptr_to_ustring(gst_toc_entry_get_uid(gobj())); |
| 235 | } |
| 236 | |
| 237 | void TocEntry::append_sub_entry(Glib::RefPtr<Gst::TocEntry> entry) |
| 238 | { |
| 239 | gst_toc_entry_append_sub_entry(gobj(), Glib::unwrap(entry)); |
| 240 | } |
| 241 | |
| 242 | bool TocEntry::is_alternative() |
| 243 | { |
| 244 | return gst_toc_entry_is_alternative(gobj()); |
| 245 | } |
| 246 | |
| 247 | bool TocEntry::is_alternative() const |
| 248 | { |
| 249 | return const_cast<TocEntry*>(this)->is_alternative(); |
| 250 | } |
| 251 | |
| 252 | bool TocEntry::is_sequence() |
| 253 | { |
| 254 | return gst_toc_entry_is_sequence(gobj()); |
| 255 | } |
| 256 | |
| 257 | bool TocEntry::is_sequence() const |
| 258 | { |
| 259 | return const_cast<TocEntry*>(this)->is_sequence(); |
| 260 | } |
| 261 | |
| 262 | Glib::RefPtr<Gst::TocEntry> TocEntry::get_parent() |
| 263 | { |
| 264 | return Glib::wrap(gst_toc_entry_get_parent(gobj())); |
| 265 | } |
| 266 | |
| 267 | void TocEntry::set_start_stop_times(gint64 start, gint64 stop) |
| 268 | { |
| 269 | gst_toc_entry_set_start_stop_times(gobj(), start, stop); |
| 270 | } |
| 271 | |
| 272 | bool TocEntry::get_start_stop_times(gint64& start, gint64& stop) |
| 273 | { |
| 274 | return gst_toc_entry_get_start_stop_times(gobj(), &(start), &(stop)); |
| 275 | } |
| 276 | |
| 277 | bool TocEntry::get_start_stop_times(gint64& start, gint64& stop) const |
| 278 | { |
| 279 | return const_cast<TocEntry*>(this)->get_start_stop_times(start, stop); |
| 280 | } |
| 281 | |
| 282 | bool TocEntry::get_loop(Gst::TocLoopType& loop_type, gint& repeat_count) const |
| 283 | { |
| 284 | return gst_toc_entry_get_loop(const_cast<GstTocEntry*>(gobj()), reinterpret_cast<GstTocLoopType*>(&(loop_type)), &(repeat_count)); |
| 285 | } |
| 286 | |
| 287 | void TocEntry::set_loop(Gst::TocLoopType loop_type, gint repeat_count) |
| 288 | { |
| 289 | gst_toc_entry_set_loop(gobj(), ((GstTocLoopType)(loop_type)), repeat_count); |
| 290 | } |
| 291 | |
| 292 | Glib::RefPtr<Gst::Toc> TocEntry::get_toc() const |
| 293 | { |
| 294 | return Glib::wrap(gst_toc_entry_get_toc(const_cast<GstTocEntry*>(gobj()))); |
| 295 | } |
| 296 | |
| 297 | |
| 298 | } // namespace Gst |
| 299 | |
| 300 |