1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gstreamer.TocSetterT; 26 27 public import gobject.ObjectG; 28 public import gstreamer.Toc; 29 public import gstreamer.c.functions; 30 public import gstreamer.c.types; 31 public import gstreamerc.gstreamertypes; 32 33 34 /** 35 * Element interface that allows setting of the TOC. 36 * 37 * Elements that support some kind of chapters or editions (or tracks like in 38 * the FLAC cue sheet) will implement this interface. 39 * 40 * If you just want to retrieve the TOC in your application then all you 41 * need to do is watch for TOC messages on your pipeline's bus (or you can 42 * perform TOC query). This interface is only for setting TOC data, not for 43 * extracting it. To set TOC from the application, find proper tocsetter element 44 * and set TOC using gst_toc_setter_set_toc(). 45 * 46 * Elements implementing the #GstTocSetter interface can extend existing TOC 47 * by getting extend UID for that (you can use gst_toc_find_entry() to retrieve it) 48 * with any TOC entries received from downstream. 49 */ 50 public template TocSetterT(TStruct) 51 { 52 /** Get the main Gtk struct */ 53 public GstTocSetter* getTocSetterStruct(bool transferOwnership = false) 54 { 55 if (transferOwnership) 56 ownedRef = false; 57 return cast(GstTocSetter*)getStruct(); 58 } 59 60 61 /** 62 * Return current TOC the setter uses. The TOC should not be 63 * modified without making it writable first. 64 * 65 * Returns: TOC set, or %NULL. Unref with 66 * gst_toc_unref() when no longer needed 67 */ 68 public Toc getToc() 69 { 70 auto p = gst_toc_setter_get_toc(getTocSetterStruct()); 71 72 if(p is null) 73 { 74 return null; 75 } 76 77 return ObjectG.getDObject!(Toc)(cast(GstToc*) p, true); 78 } 79 80 /** 81 * Reset the internal TOC. Elements should call this from within the 82 * state-change handler. 83 */ 84 public void reset() 85 { 86 gst_toc_setter_reset(getTocSetterStruct()); 87 } 88 89 /** 90 * Set the given TOC on the setter. Previously set TOC will be 91 * unreffed before setting a new one. 92 * 93 * Params: 94 * toc = a #GstToc to set. 95 */ 96 public void setToc(Toc toc) 97 { 98 gst_toc_setter_set_toc(getTocSetterStruct(), (toc is null) ? null : toc.getTocStruct()); 99 } 100 }