Wrote the README_GIT file to be a proper tutorial on git, repo.or.cz and gtkD.
[gtkD.git] / gtkD / srcgstreamer / gstreamer / GError.d
blob18ef3637a5dc78c57d40e537bc32a705328827e0
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 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gstreamerc.gstreamertypes;
62 private import gstreamerc.gstreamer;
65 private import glib.Str;
70 /**
71 * Description
72 * GStreamer elements can throw non-fatal warnings and fatal errors.
73 * Higher-level elements and applications can programatically filter
74 * the ones they are interested in or can recover from,
75 * and have a default handler handle the rest of them.
76 * The rest of this section will use the term error
77 * to mean both (non-fatal) warnings and (fatal) errors; they are treated
78 * similarly.
79 * Errors from elements are the combination of a GError and a debug string.
80 * The GError contains:
81 * - a domain type: CORE, LIBRARY, RESOURCE or STREAM
82 * - a code: an enum value specific to the domain
83 * - a translated, human-readable message
84 * - a non-translated additional debug string, which also contains
85 * - file and line information
86 * Elements do not have the context required to decide what to do with
87 * errors. As such, they should only inform about errors, and stop their
88 * processing. In short, an element doesn't know what it is being used for.
89 * It is the application or compound element using the given element that
90 * has more context about the use of the element. Errors can be received by
91 * listening to the GstBus of the element/pipeline for GstMessage objects with
92 * the type GST_MESSAGE_ERROR or GST_MESSAGE_WARNING. The thrown errors should
93 * be inspected, and filtered if appropriate.
94 * An application is expected to, by default, present the user with a
95 * dialog box (or an equivalent) showing the error message. The dialog
96 * should also allow a way to get at the additional debug information,
97 * so the user can provide bug reporting information.
98 * A compound element is expected to forward errors by default higher up
99 * the hierarchy; this is done by default in the same way as for other types
100 * of GstMessage.
101 * When applications or compound elements trigger errors that they can
102 * recover from, they can filter out these errors and take appropriate action.
103 * For example, an application that gets an error from xvimagesink
104 * that indicates all XVideo ports are taken, the application can attempt
105 * to use another sink instead.
106 * Elements throw errors using the GST_ELEMENT_ERROR convenience macro:
107 * Example7.Throwing an error
108 * GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
109 * (_("No file name specified for reading.")), (NULL));
110 * Things to keep in mind:
111 * Don't go off inventing new error codes. The ones
112 * currently provided should be enough. If you find your type of error
113 * does not fit the current codes, you should use FAILED.
114 * Don't provide a message if the default one suffices.
115 * this keeps messages more uniform. Use (NULL) - not forgetting the
116 * parentheses.
117 * If you do supply a custom message, it should be
118 * marked for translation. The message should start with a capital
119 * and end with a period. The message should describe the error in short,
120 * in a human-readable form, and without any complex technical terms.
121 * A user interface will present this message as the first thing a user
122 * sees. Details, technical info, ... should go in the debug string.
123 * The debug string can be as you like. Again, use (NULL)
124 * if there's nothing to add - file and line number will still be
125 * passed. GST_ERROR_SYSTEM can be used as a shortcut to give
126 * debug information on a system call error.
127 * Last reviewed on 2006-09-15 (0.10.10)
143 * Get a string describing the error message in the current locale.
144 * domain:
145 * the GStreamer error domain this error belongs to.
146 * code:
147 * the error code belonging to the domain.
148 * Returns:
149 * a newly allocated string describing the error message in the
150 * current locale.
151 * See Also
152 * GstMessage
154 public static char[] errorGetMessage(GQuark domain, int code)
156 // gchar* gst_error_get_message (GQuark domain, gint code);
157 return Str.toString(gst_error_get_message(domain, code) );