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 gstreamerc.gstreamer; 30 public import gstreamerc.gstreamertypes; 31 32 33 /** 34 * Element interface that allows setting of the TOC. 35 * 36 * Elements that support some kind of chapters or editions (or tracks like in 37 * the FLAC cue sheet) will implement this interface. 38 * 39 * If you just want to retrieve the TOC in your application then all you 40 * need to do is watch for TOC messages on your pipeline's bus (or you can 41 * perform TOC query). This interface is only for setting TOC data, not for 42 * extracting it. To set TOC from the application, find proper tocsetter element 43 * and set TOC using gst_toc_setter_set_toc(). 44 * 45 * Elements implementing the #GstTocSetter interface can extend existing TOC 46 * by getting extend UID for that (you can use gst_toc_find_entry() to retrieve it) 47 * with any TOC entries received from downstream. 48 */ 49 public template TocSetterT(TStruct) 50 { 51 /** Get the main Gtk struct */ 52 public GstTocSetter* getTocSetterStruct(bool transferOwnership = false) 53 { 54 if (transferOwnership) 55 ownedRef = false; 56 return cast(GstTocSetter*)getStruct(); 57 } 58 59 60 /** 61 * Return current TOC the setter uses. The TOC should not be 62 * modified without making it writable first. 63 * 64 * Returns: TOC set, or %NULL. Unref with 65 * gst_toc_unref() when no longer needed 66 */ 67 public Toc getToc() 68 { 69 auto p = gst_toc_setter_get_toc(getTocSetterStruct()); 70 71 if(p is null) 72 { 73 return null; 74 } 75 76 return ObjectG.getDObject!(Toc)(cast(GstToc*) p, true); 77 } 78 79 /** 80 * Reset the internal TOC. Elements should call this from within the 81 * state-change handler. 82 */ 83 public void reset() 84 { 85 gst_toc_setter_reset(getTocSetterStruct()); 86 } 87 88 /** 89 * Set the given TOC on the setter. Previously set TOC will be 90 * unreffed before setting a new one. 91 * 92 * Params: 93 * toc = a #GstToc to set. 94 */ 95 public void setToc(Toc toc) 96 { 97 gst_toc_setter_set_toc(getTocSetterStruct(), (toc is null) ? null : toc.getTocStruct()); 98 } 99 }