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 gstreamer.c.functions;
30 public  import gstreamer.c.types;
31 
32 
33 /**
34  * A fundamental type that describes an ordered list of #GValue
35  */
36 public class ValueArray
37 {
38 	/** the main Gtk struct */
39 	protected GstValueArray* gstValueArray;
40 	protected bool ownedRef;
41 
42 	/** Get the main Gtk struct */
43 	public GstValueArray* getValueArrayStruct(bool transferOwnership = false)
44 	{
45 		if (transferOwnership)
46 			ownedRef = false;
47 		return gstValueArray;
48 	}
49 
50 	/** the main Gtk struct as a void* */
51 	protected void* getStruct()
52 	{
53 		return cast(void*)gstValueArray;
54 	}
55 
56 	/**
57 	 * Sets our main struct and passes it to the parent class.
58 	 */
59 	public this (GstValueArray* gstValueArray, bool ownedRef = false)
60 	{
61 		this.gstValueArray = gstValueArray;
62 		this.ownedRef = ownedRef;
63 	}
64 
65 
66 	/** */
67 	public static GType getType()
68 	{
69 		return gst_value_array_get_type();
70 	}
71 
72 	/**
73 	 * Appends @append_value to the GstValueArray in @value.
74 	 *
75 	 * Params:
76 	 *     value = a #GValue of type #GST_TYPE_ARRAY
77 	 *     appendValue = the value to append
78 	 *
79 	 * Since: 1.2
80 	 */
81 	public static void appendAndTakeValue(Value value, Value appendValue)
82 	{
83 		gst_value_array_append_and_take_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
84 	}
85 
86 	/**
87 	 * Appends @append_value to the GstValueArray in @value.
88 	 *
89 	 * Params:
90 	 *     value = a #GValue of type #GST_TYPE_ARRAY
91 	 *     appendValue = the value to append
92 	 */
93 	public static void appendValue(Value value, Value appendValue)
94 	{
95 		gst_value_array_append_value((value is null) ? null : value.getValueStruct(), (appendValue is null) ? null : appendValue.getValueStruct());
96 	}
97 
98 	/**
99 	 * Gets the number of values contained in @value.
100 	 *
101 	 * Params:
102 	 *     value = a #GValue of type #GST_TYPE_ARRAY
103 	 *
104 	 * Returns: the number of values
105 	 */
106 	public static uint getSize(Value value)
107 	{
108 		return gst_value_array_get_size((value is null) ? null : value.getValueStruct());
109 	}
110 
111 	/**
112 	 * Gets the value that is a member of the array contained in @value and
113 	 * has the index @index.
114 	 *
115 	 * Params:
116 	 *     value = a #GValue of type #GST_TYPE_ARRAY
117 	 *     index = index of value to get from the array
118 	 *
119 	 * Returns: the value at the given index
120 	 */
121 	public static Value getValue(Value value, uint index)
122 	{
123 		auto __p = gst_value_array_get_value((value is null) ? null : value.getValueStruct(), index);
124 
125 		if(__p is null)
126 		{
127 			return null;
128 		}
129 
130 		return ObjectG.getDObject!(Value)(cast(GValue*) __p);
131 	}
132 
133 	/**
134 	 * Initializes and pre-allocates a #GValue of type #GST_VALUE_ARRAY.
135 	 *
136 	 * Params:
137 	 *     value = A zero-filled (uninitialized) #GValue structure
138 	 *     prealloc = The number of entries to pre-allocate in the array
139 	 *
140 	 * Returns: The #GValue structure that has been passed in
141 	 *
142 	 * Since: 1.18
143 	 */
144 	public static Value init(Value value, uint prealloc)
145 	{
146 		auto __p = gst_value_array_init((value is null) ? null : value.getValueStruct(), prealloc);
147 
148 		if(__p is null)
149 		{
150 			return null;
151 		}
152 
153 		return ObjectG.getDObject!(Value)(cast(GValue*) __p);
154 	}
155 
156 	/**
157 	 * Prepends @prepend_value to the GstValueArray in @value.
158 	 *
159 	 * Params:
160 	 *     value = a #GValue of type #GST_TYPE_ARRAY
161 	 *     prependValue = the value to prepend
162 	 */
163 	public static void prependValue(Value value, Value prependValue)
164 	{
165 		gst_value_array_prepend_value((value is null) ? null : value.getValueStruct(), (prependValue is null) ? null : prependValue.getValueStruct());
166 	}
167 }