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.DebugCategory;
26 
27 private import glib.Str;
28 private import gstreamerc.gstreamer;
29 public  import gstreamerc.gstreamertypes;
30 
31 
32 /**
33  * This is the struct that describes the categories. Once initialized with
34  * #GST_DEBUG_CATEGORY_INIT, its values can't be changed anymore.
35  */
36 public class DebugCategory
37 {
38 	/** the main Gtk struct */
39 	protected GstDebugCategory* gstDebugCategory;
40 
41 	/** Get the main Gtk struct */
42 	public GstDebugCategory* getDebugCategoryStruct()
43 	{
44 		return gstDebugCategory;
45 	}
46 
47 	/** the main Gtk struct as a void* */
48 	protected void* getStruct()
49 	{
50 		return cast(void*)gstDebugCategory;
51 	}
52 
53 	/**
54 	 * Sets our main struct and passes it to the parent class.
55 	 */
56 	public this (GstDebugCategory* gstDebugCategory)
57 	{
58 		this.gstDebugCategory = gstDebugCategory;
59 	}
60 
61 	/**
62 	 */
63 
64 	/**
65 	 * Removes and frees the category and all associated resources.
66 	 */
67 	public void free()
68 	{
69 		gst_debug_category_free(gstDebugCategory);
70 	}
71 
72 	/**
73 	 * Returns the color of a debug category used when printing output in this
74 	 * category.
75 	 *
76 	 * Return: the color of the category.
77 	 */
78 	public uint getColor()
79 	{
80 		return gst_debug_category_get_color(gstDebugCategory);
81 	}
82 
83 	/**
84 	 * Returns the description of a debug category.
85 	 *
86 	 * Return: the description of the category.
87 	 */
88 	public string getDescription()
89 	{
90 		return Str.toString(gst_debug_category_get_description(gstDebugCategory));
91 	}
92 
93 	/**
94 	 * Returns the name of a debug category.
95 	 *
96 	 * Return: the name of the category.
97 	 */
98 	public string getName()
99 	{
100 		return Str.toString(gst_debug_category_get_name(gstDebugCategory));
101 	}
102 
103 	/**
104 	 * Returns the threshold of a #GstDebugCategory.
105 	 *
106 	 * Return: the #GstDebugLevel that is used as threshold.
107 	 */
108 	public GstDebugLevel getThreshold()
109 	{
110 		return gst_debug_category_get_threshold(gstDebugCategory);
111 	}
112 
113 	/**
114 	 * Resets the threshold of the category to the default level. Debug information
115 	 * will only be output if the threshold is lower or equal to the level of the
116 	 * debugging message.
117 	 * Use this function to set the threshold back to where it was after using
118 	 * gst_debug_category_set_threshold().
119 	 */
120 	public void resetThreshold()
121 	{
122 		gst_debug_category_reset_threshold(gstDebugCategory);
123 	}
124 
125 	/**
126 	 * Sets the threshold of the category to the given level. Debug information will
127 	 * only be output if the threshold is lower or equal to the level of the
128 	 * debugging message.
129 	 * <note><para>
130 	 * Do not use this function in production code, because other functions may
131 	 * change the threshold of categories as side effect. It is however a nice
132 	 * function to use when debugging (even from gdb).
133 	 * </para></note>
134 	 *
135 	 * Params:
136 	 *     level = the #GstDebugLevel threshold to set.
137 	 */
138 	public void setThreshold(GstDebugLevel level)
139 	{
140 		gst_debug_category_set_threshold(gstDebugCategory, level);
141 	}
142 }