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.Format;
26 
27 private import glib.Str;
28 private import gobject.ObjectG;
29 private import gstreamer.Iterator;
30 private import gstreamerc.gstreamer;
31 public  import gstreamerc.gstreamertypes;
32 
33 
34 /** */
35 public struct Format
36 {
37 
38 	/**
39 	 * Return the format registered with the given nick.
40 	 *
41 	 * Params:
42 	 *     nick = The nick of the format
43 	 *
44 	 * Return: The format with @nick or GST_FORMAT_UNDEFINED
45 	 *     if the format was not registered.
46 	 */
47 	public static GstFormat getByNick(string nick)
48 	{
49 		return gst_format_get_by_nick(Str.toStringz(nick));
50 	}
51 
52 	/**
53 	 * Get details about the given format.
54 	 *
55 	 * Params:
56 	 *     format = The format to get details of
57 	 *
58 	 * Return: The #GstFormatDefinition for @format or %NULL
59 	 *     on failure.
60 	 *
61 	 *     MT safe.
62 	 */
63 	public static GstFormatDefinition* getDetails(GstFormat format)
64 	{
65 		return gst_format_get_details(format);
66 	}
67 
68 	/**
69 	 * Get a printable name for the given format. Do not modify or free.
70 	 *
71 	 * Params:
72 	 *     format = a #GstFormat
73 	 *
74 	 * Return: a reference to the static name of the format
75 	 *     or %NULL if the format is unknown.
76 	 */
77 	public static string getName(GstFormat format)
78 	{
79 		return Str.toString(gst_format_get_name(format));
80 	}
81 
82 	/**
83 	 * Iterate all the registered formats. The format definition is read
84 	 * only.
85 	 *
86 	 * Return: a GstIterator of #GstFormatDefinition.
87 	 */
88 	public static Iterator iterateDefinitions()
89 	{
90 		auto p = gst_format_iterate_definitions();
91 		
92 		if(p is null)
93 		{
94 			return null;
95 		}
96 		
97 		return ObjectG.getDObject!(Iterator)(cast(GstIterator*) p, true);
98 	}
99 
100 	/**
101 	 * Create a new GstFormat based on the nick or return an
102 	 * already registered format with that nick.
103 	 *
104 	 * Params:
105 	 *     nick = The nick of the new format
106 	 *     description = The description of the new format
107 	 *
108 	 * Return: A new GstFormat or an already registered format
109 	 *     with the same nick.
110 	 *
111 	 *     MT safe.
112 	 */
113 	public static GstFormat register(string nick, string description)
114 	{
115 		return gst_format_register(Str.toStringz(nick), Str.toStringz(description));
116 	}
117 
118 	/**
119 	 * Get the unique quark for the given format.
120 	 *
121 	 * Params:
122 	 *     format = a #GstFormat
123 	 *
124 	 * Return: the quark associated with the format or 0 if the format
125 	 *     is unknown.
126 	 */
127 	public static GQuark toQuark(GstFormat format)
128 	{
129 		return gst_format_to_quark(format);
130 	}
131 
132 	/**
133 	 * See if the given format is inside the format array.
134 	 *
135 	 * Params:
136 	 *     formats = The format array to search
137 	 *     format = the format to find
138 	 *
139 	 * Return: %TRUE if the format is found inside the array
140 	 */
141 	public static bool contains(GstFormat[] formats, GstFormat format)
142 	{
143 		return gst_formats_contains(formats.ptr, format) != 0;
144 	}
145 }