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()
53 	{
54 		return cast(GstTocSetter*)getStruct();
55 	}
56 
57 
58 	/**
59 	 * Return current TOC the setter uses. The TOC should not be
60 	 * modified without making it writable first.
61 	 *
62 	 * Return: TOC set, or %NULL. Unref with
63 	 *     gst_toc_unref() when no longer needed
64 	 */
65 	public Toc getToc()
66 	{
67 		auto p = gst_toc_setter_get_toc(getTocSetterStruct());
68 		
69 		if(p is null)
70 		{
71 			return null;
72 		}
73 		
74 		return ObjectG.getDObject!(Toc)(cast(GstToc*) p, true);
75 	}
76 
77 	/**
78 	 * Reset the internal TOC. Elements should call this from within the
79 	 * state-change handler.
80 	 */
81 	public void reset()
82 	{
83 		gst_toc_setter_reset(getTocSetterStruct());
84 	}
85 
86 	/**
87 	 * Set the given TOC on the setter. Previously set TOC will be
88 	 * unreffed before setting a new one.
89 	 *
90 	 * Params:
91 	 *     toc = a #GstToc to set.
92 	 */
93 	public void setToc(Toc toc)
94 	{
95 		gst_toc_setter_set_toc(getTocSetterStruct(), (toc is null) ? null : toc.getTocStruct());
96 	}
97 }