alternative to assert
[gtkD.git] / gtkD / srcgstreamer / gstreamer / GError.d
blobb69fa3608373f6a155906e5390b810b2e08f570d
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gstreamer-GstGError.html
26 * outPack = gstreamer
27 * outFile = GError
28 * strct =
29 * realStrct=
30 * ctorStrct=
31 * clss =
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gst_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * module aliases:
47 * local aliases:
50 module gstreamer.GError;
52 private import gstreamerc.gstreamertypes;
54 private import gstreamerc.gstreamer;
56 private import glib.Str;
60 /**
61 * Description
62 * GStreamer elements can throw non-fatal warnings and fatal errors.
63 * Higher-level elements and applications can programatically filter
64 * the ones they are interested in or can recover from,
65 * and have a default handler handle the rest of them.
66 * The rest of this section will use the term error
67 * to mean both (non-fatal) warnings and (fatal) errors; they are treated
68 * similarly.
69 * Errors from elements are the combination of a GError and a debug string.
70 * The GError contains:
71 * - a domain type: CORE, LIBRARY, RESOURCE or STREAM
72 * - a code: an enum value specific to the domain
73 * - a translated, human-readable message
74 * - a non-translated additional debug string, which also contains
75 * - file and line information
76 * Elements do not have the context required to decide what to do with
77 * errors. As such, they should only inform about errors, and stop their
78 * processing. In short, an element doesn't know what it is being used for.
79 * It is the application or compound element using the given element that
80 * has more context about the use of the element. Errors can be received by
81 * listening to the GstBus of the element/pipeline for GstMessage objects with
82 * the type GST_MESSAGE_ERROR or GST_MESSAGE_WARNING. The thrown errors should
83 * be inspected, and filtered if appropriate.
84 * An application is expected to, by default, present the user with a
85 * dialog box (or an equivalent) showing the error message. The dialog
86 * should also allow a way to get at the additional debug information,
87 * so the user can provide bug reporting information.
88 * A compound element is expected to forward errors by default higher up
89 * the hierarchy; this is done by default in the same way as for other types
90 * of GstMessage.
91 * When applications or compound elements trigger errors that they can
92 * recover from, they can filter out these errors and take appropriate action.
93 * For example, an application that gets an error from xvimagesink
94 * that indicates all XVideo ports are taken, the application can attempt
95 * to use another sink instead.
96 * Elements throw errors using the GST_ELEMENT_ERROR convenience macro:
97 * Example7.Throwing an error
98 * GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
99 * (_("No file name specified for reading.")), (NULL));
100 * Things to keep in mind:
101 * Don't go off inventing new error codes. The ones
102 * currently provided should be enough. If you find your type of error
103 * does not fit the current codes, you should use FAILED.
104 * Don't provide a message if the default one suffices.
105 * this keeps messages more uniform. Use (NULL) - not forgetting the
106 * parentheses.
107 * If you do supply a custom message, it should be
108 * marked for translation. The message should start with a capital
109 * and end with a period. The message should describe the error in short,
110 * in a human-readable form, and without any complex technical terms.
111 * A user interface will present this message as the first thing a user
112 * sees. Details, technical info, ... should go in the debug string.
113 * The debug string can be as you like. Again, use (NULL)
114 * if there's nothing to add - file and line number will still be
115 * passed. GST_ERROR_SYSTEM can be used as a shortcut to give
116 * debug information on a system call error.
117 * Last reviewed on 2006-09-15 (0.10.10)
133 * Get a string describing the error message in the current locale.
134 * domain:
135 * the GStreamer error domain this error belongs to.
136 * code:
137 * the error code belonging to the domain.
138 * Returns:
139 * a newly allocated string describing the error message in the
140 * current locale.
141 * See Also
142 * GstMessage
144 public static char[] errorGetMessage(GQuark domain, int code)
146 // gchar* gst_error_get_message (GQuark domain, gint code);
147 return Str.toString(gst_error_get_message(domain, code) );