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.ValueArray;
26 
27 private import gobject.ObjectG;
28 private import gobject.Value;
29 private import gstreamerc.gstreamer;
30 public  import gstreamerc.gstreamertypes;
31 
32 
33 /** */
34 public class ValueArray
35 {
36 	/** the main Gtk struct */
37 	protected GstValueArray* gstValueArray;
38 	protected bool ownedRef;
39 
40 	/** Get the main Gtk struct */
41 	public GstValueArray* getValueArrayStruct()
42 	{
43 		return gstValueArray;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected void* getStruct()
48 	{
49 		return cast(void*)gstValueArray;
50 	}
51 
52 	/**
53 	 * Sets our main struct and passes it to the parent class.
54 	 */
55 	public this (GstValueArray* gstValueArray, bool ownedRef = false)
56 	{
57 		this.gstValueArray = gstValueArray;
58 		this.ownedRef = ownedRef;
59 	}
60 
61 
62 	/** */
63 	public static GType getType()
64 	{
65 		return gst_value_array_get_type();
66 	}
67 
68 	/**
69 	 * Appends @append_value to the GstValueArray in @value.
70 	 *
71 	 * Params:
72 	 *     value = a #GValue of type #GST_TYPE_ARRAY
73 	 *     appendValue = the value to append
74 	 *
75 	 * Since: 1.2
76 	 */
77 	public static void appendAndTakeValue(Value value, Value appendValue)
78 	{
79 		gst_value_array_append_and_take_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
80 	}
81 
82 	/**
83 	 * Appends @append_value to the GstValueArray in @value.
84 	 *
85 	 * Params:
86 	 *     value = a #GValue of type #GST_TYPE_ARRAY
87 	 *     appendValue = the value to append
88 	 */
89 	public static void appendValue(Value value, Value appendValue)
90 	{
91 		gst_value_array_append_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
92 	}
93 
94 	/**
95 	 * Gets the number of values contained in @value.
96 	 *
97 	 * Params:
98 	 *     value = a #GValue of type #GST_TYPE_ARRAY
99 	 *
100 	 * Return: the number of values
101 	 */
102 	public static uint getSize(Value value)
103 	{
104 		return gst_value_array_get_size((value is null) ? null : value.getValueStruct());
105 	}
106 
107 	/**
108 	 * Gets the value that is a member of the array contained in @value and
109 	 * has the index @index.
110 	 *
111 	 * Params:
112 	 *     value = a #GValue of type #GST_TYPE_ARRAY
113 	 *     index = index of value to get from the array
114 	 *
115 	 * Return: the value at the given index
116 	 */
117 	public static Value getValue(Value value, uint index)
118 	{
119 		auto p = gst_value_array_get_value((value is null) ? null : value.getValueStruct(), index);
120 		
121 		if(p is null)
122 		{
123 			return null;
124 		}
125 		
126 		return ObjectG.getDObject!(Value)(cast(GValue*) p);
127 	}
128 
129 	/**
130 	 * Prepends @prepend_value to the GstValueArray in @value.
131 	 *
132 	 * Params:
133 	 *     value = a #GValue of type #GST_TYPE_ARRAY
134 	 *     prependValue = the value to prepend
135 	 */
136 	public static void prependValue(Value value, Value prependValue)
137 	{
138 		gst_value_array_prepend_value((value is null) ? null : value.getValueStruct(), (prependValue is null) ? null : prependValue.getValueStruct());
139 	}
140 }