Add files via upload
[fluidsynth-winbin.git] / bin64 / fluidsynth-2.0.0 / usr / include / fluidsynth / log.h
blob00d802f50e3c7271ef31b31a85f46195e9dd6545
1 /* FluidSynth - A Software Synthesizer
3 * Copyright (C) 2003 Peter Hanappe and others.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 of
8 * the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA
21 #ifndef _FLUIDSYNTH_LOG_H
22 #define _FLUIDSYNTH_LOG_H
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
30 /**
31 * @file log.h
32 * @brief Logging interface
34 * The default logging function of the fluidsynth prints its messages
35 * to the stderr. The synthesizer uses five level of messages: #FLUID_PANIC,
36 * #FLUID_ERR, #FLUID_WARN, #FLUID_INFO, and #FLUID_DBG.
38 * A client application can install a new log function to handle the
39 * messages differently. In the following example, the application
40 * sets a callback function to display #FLUID_PANIC messages in a dialog,
41 * and ignores all other messages by setting the log function to
42 * NULL:
44 * @code
45 * fluid_set_log_function(FLUID_PANIC, show_dialog, (void*) root_window);
46 * fluid_set_log_function(FLUID_ERR, NULL, NULL);
47 * fluid_set_log_function(FLUID_WARN, NULL, NULL);
48 * fluid_set_log_function(FLUID_DBG, NULL, NULL);
49 * @endcode
52 /**
53 * FluidSynth log levels.
55 enum fluid_log_level
57 FLUID_PANIC, /**< The synth can't function correctly any more */
58 FLUID_ERR, /**< Serious error occurred */
59 FLUID_WARN, /**< Warning */
60 FLUID_INFO, /**< Verbose informational messages */
61 FLUID_DBG, /**< Debugging messages */
62 #ifndef __DOXYGEN__
63 LAST_LOG_LEVEL /**< @warning This symbol is not part of the public API and ABI stability guarantee and may change at any time! */
64 #endif
67 /**
68 * Log function handler callback type used by fluid_set_log_function().
69 * @param level Log level (#fluid_log_level)
70 * @param message Log message text
71 * @param data User data pointer supplied to fluid_set_log_function().
73 typedef void (*fluid_log_function_t)(int level, const char *message, void *data);
75 FLUIDSYNTH_API
76 fluid_log_function_t fluid_set_log_function(int level, fluid_log_function_t fun, void *data);
78 FLUIDSYNTH_API void fluid_default_log_function(int level, const char *message, void *data);
80 FLUIDSYNTH_API int fluid_log(int level, const char *fmt, ...);
83 #ifdef __cplusplus
85 #endif
87 #endif /* _FLUIDSYNTH_LOG_H */