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