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  * Conversion parameters:
26  * inFile  = GstTagSetter.html
27  * outPack = gstreamer
28  * outFile = TagSetterT
29  * strct   = GstTagSetter
30  * realStrct=
31  * ctorStrct=
32  * clss    = TagSetterT
33  * interf  = TagSetterIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gst_tag_setter_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- gobject.Value
49  * 	- gstreamer.TagList
50  * structWrap:
51  * 	- GValue* -> Value
52  * 	- GstTagList* -> TagList
53  * module aliases:
54  * local aliases:
55  * overrides:
56  */
57 
58 module gstreamer.TagSetterT;
59 
60 public  import gstreamerc.gstreamertypes;
61 
62 public import gstreamerc.gstreamer;
63 public import glib.ConstructionException;
64 public import gobject.ObjectG;
65 
66 public import glib.Str;
67 public import gobject.Value;
68 public import gstreamer.TagList;
69 
70 
71 
72 /**
73  * Element interface that allows setting of media metadata.
74  *
75  * Elements that support changing a stream's metadata will implement this
76  * interface. Examples of such elements are 'vorbisenc', 'theoraenc' and
77  * 'id3v2mux'.
78  *
79  * If you just want to retrieve metadata in your application then all you
80  * need to do is watch for tag messages on your pipeline's bus. This
81  * interface is only for setting metadata, not for extracting it. To set tags
82  * from the application, find tagsetter elements and set tags using e.g.
83  * gst_tag_setter_merge_tags() or gst_tag_setter_add_tags(). Also consider
84  * setting the GstTagMergeMode that is used for tag events that arrive at the
85  * tagsetter element (default mode is to keep existing tags).
86  * The application should do that before the element goes to GST_STATE_PAUSED.
87  *
88  * Elements implementing the GstTagSetter interface often have to merge
89  * any tags received from upstream and the tags set by the application via
90  * the interface. This can be done like this:
91  *
92  * $(DDOC_COMMENT example)
93  *
94  * Last reviewed on 2006-05-18 (0.10.6)
95  */
96 public template TagSetterT(TStruct)
97 {
98 	
99 	/** the main Gtk struct */
100 	protected GstTagSetter* gstTagSetter;
101 	
102 	
103 	/** Get the main Gtk struct */
104 	public GstTagSetter* getTagSetterTStruct()
105 	{
106 		return cast(GstTagSetter*)getStruct();
107 	}
108 	
109 	
110 	/**
111 	 */
112 	
113 	/**
114 	 * Reset the internal taglist. Elements should call this from within the
115 	 * state-change handler.
116 	 */
117 	public void resetTags()
118 	{
119 		// void gst_tag_setter_reset_tags (GstTagSetter *setter);
120 		gst_tag_setter_reset_tags(getTagSetterTStruct());
121 	}
122 	
123 	/**
124 	 * Merges the given list into the setter's list using the given mode.
125 	 * Params:
126 	 * list = a tag list to merge from
127 	 * mode = the mode to merge with
128 	 */
129 	public void mergeTags(TagList list, GstTagMergeMode mode)
130 	{
131 		// void gst_tag_setter_merge_tags (GstTagSetter *setter,  const GstTagList *list,  GstTagMergeMode mode);
132 		gst_tag_setter_merge_tags(getTagSetterTStruct(), (list is null) ? null : list.getTagListStruct(), mode);
133 	}
134 	
135 	/**
136 	 * Adds the given tag / GValue pair on the setter using the given merge mode.
137 	 * Params:
138 	 * mode = the mode to use
139 	 * tag = tag to set
140 	 * value = GValue to set for the tag
141 	 */
142 	public void addTagValue(GstTagMergeMode mode, string tag, Value value)
143 	{
144 		// void gst_tag_setter_add_tag_value (GstTagSetter *setter,  GstTagMergeMode mode,  const gchar *tag,  const GValue *value);
145 		gst_tag_setter_add_tag_value(getTagSetterTStruct(), mode, Str.toStringz(tag), (value is null) ? null : value.getValueStruct());
146 	}
147 	
148 	/**
149 	 * Adds the given tag / value pairs on the setter using the given merge mode.
150 	 * The list must be terminated with NULL.
151 	 * Params:
152 	 * mode = the mode to use
153 	 * tag = tag to set
154 	 * varArgs = tag / value pairs to set
155 	 */
156 	public void addTagValist(GstTagMergeMode mode, string tag, void* varArgs)
157 	{
158 		// void gst_tag_setter_add_tag_valist (GstTagSetter *setter,  GstTagMergeMode mode,  const gchar *tag,  va_list var_args);
159 		gst_tag_setter_add_tag_valist(getTagSetterTStruct(), mode, Str.toStringz(tag), varArgs);
160 	}
161 	
162 	/**
163 	 * Adds the given tag / GValue pairs on the setter using the given merge mode.
164 	 * The list must be terminated with NULL.
165 	 * Params:
166 	 * mode = the mode to use
167 	 * tag = tag to set
168 	 * varArgs = tag / GValue pairs to set
169 	 */
170 	public void addTagValistValues(GstTagMergeMode mode, string tag, void* varArgs)
171 	{
172 		// void gst_tag_setter_add_tag_valist_values  (GstTagSetter *setter,  GstTagMergeMode mode,  const gchar *tag,  va_list var_args);
173 		gst_tag_setter_add_tag_valist_values(getTagSetterTStruct(), mode, Str.toStringz(tag), varArgs);
174 	}
175 	
176 	/**
177 	 * Returns the current list of tags the setter uses. The list should not be
178 	 * modified or freed.
179 	 * This function is not thread-safe.
180 	 * Returns: a current snapshot of the taglist used in the setter or NULL if none is used. [transfer none]
181 	 */
182 	public TagList getTagList()
183 	{
184 		// const GstTagList * gst_tag_setter_get_tag_list (GstTagSetter *setter);
185 		auto p = gst_tag_setter_get_tag_list(getTagSetterTStruct());
186 		
187 		if(p is null)
188 		{
189 			return null;
190 		}
191 		
192 		return ObjectG.getDObject!(TagList)(cast(GstTagList*) p);
193 	}
194 	
195 	/**
196 	 * Sets the given merge mode that is used for adding tags from events to tags
197 	 * specified by this interface. The default is GST_TAG_MERGE_KEEP, which keeps
198 	 * the tags set with this interface and discards tags from events.
199 	 * Params:
200 	 * mode = The mode with which tags are added
201 	 */
202 	public void setTagMergeMode(GstTagMergeMode mode)
203 	{
204 		// void gst_tag_setter_set_tag_merge_mode (GstTagSetter *setter,  GstTagMergeMode mode);
205 		gst_tag_setter_set_tag_merge_mode(getTagSetterTStruct(), mode);
206 	}
207 	
208 	/**
209 	 * Queries the mode by which tags inside the setter are overwritten by tags
210 	 * from events
211 	 * Returns: the merge mode used inside the element.
212 	 */
213 	public GstTagMergeMode getTagMergeMode()
214 	{
215 		// GstTagMergeMode gst_tag_setter_get_tag_merge_mode (GstTagSetter *setter);
216 		return gst_tag_setter_get_tag_merge_mode(getTagSetterTStruct());
217 	}
218 }