diff options
220 files changed, 15279 insertions, 9949 deletions
diff --git a/.editorconfig b/.editorconfig index 49517a5104..7743622e78 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,7 +17,8 @@ indent_size = 4 indent_style = space indent_size = 4 -[.travis.yml] +# YAML requires indentation with spaces instead of tabs. +[*.{yml,yaml}] indent_style = space indent_size = 2 diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 541dbfa212..c872ae2162 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -32,6 +32,7 @@ #include "core/core_bind.h" #include "core/core_string_names.h" +#include "core/input/input_map.h" #include "core/io/file_access_network.h" #include "core/io/file_access_pack.h" #include "core/io/marshalls.h" @@ -1057,17 +1058,35 @@ void ProjectSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("save_custom", "file"), &ProjectSettings::_save_custom_bnd); } +void ProjectSettings::_add_builtin_input_map() { + if (InputMap::get_singleton()) { + OrderedHashMap<String, List<Ref<InputEvent>>> builtins = InputMap::get_singleton()->get_builtins(); + + for (OrderedHashMap<String, List<Ref<InputEvent>>>::Element E = builtins.front(); E; E = E.next()) { + Array events; + + // Convert list of input events into array + for (List<Ref<InputEvent>>::Element *I = E.get().front(); I; I = I->next()) { + events.push_back(I->get()); + } + + Dictionary action; + action["deadzone"] = Variant(0.5f); + action["events"] = events; + + String action_name = "input/" + E.key(); + GLOBAL_DEF(action_name, action); + input_presets.push_back(action_name); + } + } +} + ProjectSettings::ProjectSettings() { // Initialization of engine variables should be done in the setup() method, // so that the values can be overridden from project.godot or project.binary. singleton = this; - Array events; - Dictionary action; - Ref<InputEventKey> key; - Ref<InputEventJoypadButton> joyb; - GLOBAL_DEF_BASIC("application/config/name", ""); GLOBAL_DEF_BASIC("application/config/description", ""); custom_prop_info["application/config/description"] = PropertyInfo(Variant::STRING, "application/config/description", PROPERTY_HINT_MULTILINE_TEXT); @@ -1094,163 +1113,7 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("editor/script/templates_search_path", "res://script_templates"); custom_prop_info["editor/script/templates_search_path"] = PropertyInfo(Variant::STRING, "editor/script/templates_search_path", PROPERTY_HINT_DIR); - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_ENTER); - events.push_back(key); - key.instance(); - key->set_keycode(KEY_KP_ENTER); - events.push_back(key); - key.instance(); - key->set_keycode(KEY_SPACE); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_A); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_accept", action); - input_presets.push_back("input/ui_accept"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_SPACE); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_Y); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_select", action); - input_presets.push_back("input/ui_select"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_ESCAPE); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_B); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_cancel", action); - input_presets.push_back("input/ui_cancel"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_TAB); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_focus_next", action); - input_presets.push_back("input/ui_focus_next"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_TAB); - key->set_shift(true); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_focus_prev", action); - input_presets.push_back("input/ui_focus_prev"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_LEFT); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_DPAD_LEFT); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_left", action); - input_presets.push_back("input/ui_left"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_RIGHT); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_DPAD_RIGHT); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_right", action); - input_presets.push_back("input/ui_right"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_UP); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_DPAD_UP); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_up", action); - input_presets.push_back("input/ui_up"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_DOWN); - events.push_back(key); - joyb.instance(); - joyb->set_button_index(JOY_BUTTON_DPAD_DOWN); - events.push_back(joyb); - action["events"] = events; - GLOBAL_DEF("input/ui_down", action); - input_presets.push_back("input/ui_down"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_PAGEUP); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_page_up", action); - input_presets.push_back("input/ui_page_up"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_PAGEDOWN); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_page_down", action); - input_presets.push_back("input/ui_page_down"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_HOME); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_home", action); - input_presets.push_back("input/ui_home"); - - action = Dictionary(); - action["deadzone"] = Variant(0.5f); - events = Array(); - key.instance(); - key->set_keycode(KEY_END); - events.push_back(key); - action["events"] = events; - GLOBAL_DEF("input/ui_end", action); - input_presets.push_back("input/ui_end"); + _add_builtin_input_map(); custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::STRING, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor"); custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded"); diff --git a/core/config/project_settings.h b/core/config/project_settings.h index 2b230e06f9..ed8fb19fa0 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -116,6 +116,9 @@ protected: Error _setup(const String &p_path, const String &p_main_pack, bool p_upwards = false); + void _add_builtin_input_map(); + +protected: static void _bind_methods(); public: diff --git a/core/core_bind.cpp b/core/core_bind.cpp index dd99c32fa8..0da6680a7b 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -135,7 +135,7 @@ void _ResourceLoader::_bind_methods() { ClassDB::bind_method(D_METHOD("load_threaded_get_status", "path", "progress"), &_ResourceLoader::load_threaded_get_status, DEFVAL(Array())); ClassDB::bind_method(D_METHOD("load_threaded_get", "path"), &_ResourceLoader::load_threaded_get); - ClassDB::bind_method(D_METHOD("load", "path", "type_hint", "no_cache"), &_ResourceLoader::load, DEFVAL(""), DEFVAL(CACHE_MODE_REUSE)); + ClassDB::bind_method(D_METHOD("load", "path", "type_hint", "cache_mode"), &_ResourceLoader::load, DEFVAL(""), DEFVAL(CACHE_MODE_REUSE)); ClassDB::bind_method(D_METHOD("get_recognized_extensions_for_type", "type"), &_ResourceLoader::get_recognized_extensions_for_type); ClassDB::bind_method(D_METHOD("set_abort_on_missing_resources", "abort"), &_ResourceLoader::set_abort_on_missing_resources); ClassDB::bind_method(D_METHOD("get_dependencies", "path"), &_ResourceLoader::get_dependencies); @@ -519,11 +519,19 @@ double _OS::get_unix_time() const { return OS::get_singleton()->get_unix_time(); } -void _OS::delay_usec(uint32_t p_usec) const { +/** This method uses a signed argument for better error reporting as it's used from the scripting API. */ +void _OS::delay_usec(int p_usec) const { + ERR_FAIL_COND_MSG( + p_usec < 0, + vformat("Can't sleep for %d microseconds. The delay provided must be greater than or equal to 0 microseconds.", p_usec)); OS::get_singleton()->delay_usec(p_usec); } -void _OS::delay_msec(uint32_t p_msec) const { +/** This method uses a signed argument for better error reporting as it's used from the scripting API. */ +void _OS::delay_msec(int p_msec) const { + ERR_FAIL_COND_MSG( + p_msec < 0, + vformat("Can't sleep for %d milliseconds. The delay provided must be greater than or equal to 0 milliseconds.", p_msec)); OS::get_singleton()->delay_usec(int64_t(p_msec) * 1000); } @@ -681,22 +689,6 @@ String _OS::get_unique_id() const { return OS::get_singleton()->get_unique_id(); } -int _OS::get_tablet_driver_count() const { - return OS::get_singleton()->get_tablet_driver_count(); -} - -String _OS::get_tablet_driver_name(int p_driver) const { - return OS::get_singleton()->get_tablet_driver_name(p_driver); -} - -String _OS::get_current_tablet_driver() const { - return OS::get_singleton()->get_current_tablet_driver(); -} - -void _OS::set_current_tablet_driver(const String &p_driver) { - OS::get_singleton()->set_current_tablet_driver(p_driver); -} - _OS *_OS::singleton = nullptr; void _OS::_bind_methods() { @@ -780,19 +772,12 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("request_permissions"), &_OS::request_permissions); ClassDB::bind_method(D_METHOD("get_granted_permissions"), &_OS::get_granted_permissions); - ClassDB::bind_method(D_METHOD("get_tablet_driver_count"), &_OS::get_tablet_driver_count); - ClassDB::bind_method(D_METHOD("get_tablet_driver_name", "idx"), &_OS::get_tablet_driver_name); - ClassDB::bind_method(D_METHOD("get_current_tablet_driver"), &_OS::get_current_tablet_driver); - ClassDB::bind_method(D_METHOD("set_current_tablet_driver", "name"), &_OS::set_current_tablet_driver); - ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "low_processor_usage_mode"), "set_low_processor_usage_mode", "is_in_low_processor_usage_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "low_processor_usage_mode_sleep_usec"), "set_low_processor_usage_mode_sleep_usec", "get_low_processor_usage_mode_sleep_usec"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "tablet_driver"), "set_current_tablet_driver", "get_current_tablet_driver"); // Those default values need to be specified for the docs generator, // to avoid using values from the documentation writer's own OS instance. - ADD_PROPERTY_DEFAULT("tablet_driver", ""); ADD_PROPERTY_DEFAULT("exit_code", 0); ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false); ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900); @@ -1990,7 +1975,7 @@ void _Thread::_start_func(void *ud) { } Error _Thread::start(Object *p_instance, const StringName &p_method, const Variant &p_userdata, Priority p_priority) { - ERR_FAIL_COND_V_MSG(active, ERR_ALREADY_IN_USE, "Thread already started."); + ERR_FAIL_COND_V_MSG(active.is_set(), ERR_ALREADY_IN_USE, "Thread already started."); ERR_FAIL_COND_V(!p_instance, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(p_method == StringName(), ERR_INVALID_PARAMETER); ERR_FAIL_INDEX_V(p_priority, PRIORITY_MAX, ERR_INVALID_PARAMETER); @@ -1999,7 +1984,7 @@ Error _Thread::start(Object *p_instance, const StringName &p_method, const Varia target_method = p_method; target_instance = p_instance; userdata = p_userdata; - active = true; + active.set(); Ref<_Thread> *ud = memnew(Ref<_Thread>(this)); @@ -2015,14 +2000,14 @@ String _Thread::get_id() const { } bool _Thread::is_active() const { - return active; + return active.is_set(); } Variant _Thread::wait_to_finish() { - ERR_FAIL_COND_V_MSG(!active, Variant(), "Thread must be active to wait for its completion."); + ERR_FAIL_COND_V_MSG(!active.is_set(), Variant(), "Thread must be active to wait for its completion."); thread.wait_to_finish(); Variant r = ret; - active = false; + active.clear(); target_method = StringName(); target_instance = nullptr; userdata = Variant(); diff --git a/core/core_bind.h b/core/core_bind.h index 7f945a9314..8a4885b82b 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -40,6 +40,7 @@ #include "core/os/os.h" #include "core/os/semaphore.h" #include "core/os/thread.h" +#include "core/templates/safe_refcount.h" class _ResourceLoader : public Object { GDCLASS(_ResourceLoader, Object); @@ -210,8 +211,8 @@ public: uint64_t get_static_memory_usage() const; uint64_t get_static_memory_peak_usage() const; - void delay_usec(uint32_t p_usec) const; - void delay_msec(uint32_t p_msec) const; + void delay_usec(int p_usec) const; + void delay_msec(int p_msec) const; uint32_t get_ticks_msec() const; uint64_t get_ticks_usec() const; @@ -247,11 +248,6 @@ public: bool request_permissions(); Vector<String> get_granted_permissions() const; - int get_tablet_driver_count() const; - String get_tablet_driver_name(int p_driver) const; - String get_current_tablet_driver() const; - void set_current_tablet_driver(const String &p_driver); - static _OS *get_singleton() { return singleton; } _OS() { singleton = this; } @@ -559,7 +555,7 @@ class _Thread : public Reference { protected: Variant ret; Variant userdata; - volatile bool active = false; + SafeFlag active; Object *target_instance = nullptr; StringName target_method; Thread thread; diff --git a/core/error/error_macros.h b/core/error/error_macros.h index 8eb6217ce8..f909a67d55 100644 --- a/core/error/error_macros.h +++ b/core/error/error_macros.h @@ -33,6 +33,8 @@ #include "core/typedefs.h" +#include "core/templates/safe_refcount.h" + class String; enum ErrorHandlerType { @@ -577,10 +579,10 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li */ #define WARN_DEPRECATED \ if (true) { \ - static volatile bool warning_shown = false; \ - if (!warning_shown) { \ + static SafeFlag warning_shown; \ + if (!warning_shown.is_set()) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future.", ERR_HANDLER_WARNING); \ - warning_shown = true; \ + warning_shown.set(); \ } \ } else \ ((void)0) @@ -590,10 +592,10 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li */ #define WARN_DEPRECATED_MSG(m_msg) \ if (true) { \ - static volatile bool warning_shown = false; \ - if (!warning_shown) { \ + static SafeFlag warning_shown; \ + if (!warning_shown.is_set()) { \ _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future.", DEBUG_STR(m_msg), ERR_HANDLER_WARNING); \ - warning_shown = true; \ + warning_shown.set(); \ } \ } else \ ((void)0) diff --git a/core/input/input.cpp b/core/input/input.cpp index 48e573626d..94a18b5b4f 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -97,11 +97,11 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("is_key_pressed", "keycode"), &Input::is_key_pressed); ClassDB::bind_method(D_METHOD("is_mouse_button_pressed", "button"), &Input::is_mouse_button_pressed); ClassDB::bind_method(D_METHOD("is_joy_button_pressed", "device", "button"), &Input::is_joy_button_pressed); - ClassDB::bind_method(D_METHOD("is_action_pressed", "action", "exact"), &Input::is_action_pressed, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("is_action_just_pressed", "action", "exact"), &Input::is_action_just_pressed, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("is_action_just_released", "action", "exact"), &Input::is_action_just_released, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("get_action_strength", "action", "exact"), &Input::get_action_strength, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("get_action_raw_strength", "action", "exact"), &Input::get_action_strength, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("is_action_pressed", "action", "exact_match"), &Input::is_action_pressed, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("is_action_just_pressed", "action", "exact_match"), &Input::is_action_just_pressed, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("is_action_just_released", "action", "exact_match"), &Input::is_action_just_released, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_action_strength", "action", "exact_match"), &Input::get_action_strength, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("get_action_raw_strength", "action", "exact_match"), &Input::get_action_strength, DEFVAL(false)); ClassDB::bind_method(D_METHOD("get_axis", "negative_action", "positive_action"), &Input::get_axis); ClassDB::bind_method(D_METHOD("get_vector", "negative_x", "positive_x", "negative_y", "positive_y", "deadzone"), &Input::get_vector, DEFVAL(-1.0f)); ClassDB::bind_method(D_METHOD("add_joy_mapping", "mapping", "update_existing"), &Input::add_joy_mapping, DEFVAL(false)); @@ -604,21 +604,21 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em } } - for (const Map<StringName, InputMap::Action>::Element *E = InputMap::get_singleton()->get_action_map().front(); E; E = E->next()) { - if (InputMap::get_singleton()->event_is_action(p_event, E->key())) { + for (OrderedHashMap<StringName, InputMap::Action>::ConstElement E = InputMap::get_singleton()->get_action_map().front(); E; E = E.next()) { + if (InputMap::get_singleton()->event_is_action(p_event, E.key())) { // If not echo and action pressed state has changed - if (!p_event->is_echo() && is_action_pressed(E->key(), false) != p_event->is_action_pressed(E->key())) { + if (!p_event->is_echo() && is_action_pressed(E.key(), false) != p_event->is_action_pressed(E.key())) { Action action; action.physics_frame = Engine::get_singleton()->get_physics_frames(); action.process_frame = Engine::get_singleton()->get_process_frames(); - action.pressed = p_event->is_action_pressed(E->key()); + action.pressed = p_event->is_action_pressed(E.key()); action.strength = 0.0f; action.raw_strength = 0.0f; - action.exact = InputMap::get_singleton()->event_is_action(p_event, E->key(), true); - action_state[E->key()] = action; + action.exact = InputMap::get_singleton()->event_is_action(p_event, E.key(), true); + action_state[E.key()] = action; } - action_state[E->key()].strength = p_event->get_action_strength(E->key()); - action_state[E->key()].raw_strength = p_event->get_action_raw_strength(E->key()); + action_state[E.key()].strength = p_event->get_action_strength(E.key()); + action_state[E.key()].raw_strength = p_event->get_action_raw_strength(E.key()); } } diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index b1c8f1ad66..c6910d2b1f 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -384,6 +384,31 @@ String InputEventKey::to_string() { return vformat("InputEventKey: keycode=%s mods=%s physical=%s pressed=%s echo=%s", kc, mods, physical, p, e); } +Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) { + Ref<InputEventKey> ie; + ie.instance(); + ie->set_keycode(p_keycode & KEY_CODE_MASK); + ie->set_unicode(p_keycode & KEY_CODE_MASK); + + if (p_keycode & KEY_MASK_SHIFT) { + ie->set_shift(true); + } + if (p_keycode & KEY_MASK_ALT) { + ie->set_alt(true); + } + if (p_keycode & KEY_MASK_CTRL) { + ie->set_control(true); + } + if (p_keycode & KEY_MASK_CMD) { + ie->set_command(true); + } + if (p_keycode & KEY_MASK_META) { + ie->set_metakey(true); + } + + return ie; +} + bool InputEventKey::action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const { Ref<InputEventKey> key = p_event; if (key.is_null()) { @@ -1011,6 +1036,14 @@ String InputEventJoypadButton::to_string() { return "InputEventJoypadButton : button_index=" + itos(button_index) + ", pressed=" + (pressed ? "true" : "false") + ", pressure=" + String(Variant(pressure)); } +Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) { + Ref<InputEventJoypadButton> ie; + ie.instance(); + ie->set_button_index(p_btn_index); + + return ie; +} + void InputEventJoypadButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_button_index", "button_index"), &InputEventJoypadButton::set_button_index); ClassDB::bind_method(D_METHOD("get_button_index"), &InputEventJoypadButton::get_button_index); diff --git a/core/input/input_event.h b/core/input/input_event.h index 1ce1fad9c2..df81b9fc75 100644 --- a/core/input/input_event.h +++ b/core/input/input_event.h @@ -260,6 +260,8 @@ public: virtual String as_text() const override; virtual String to_string() override; + static Ref<InputEventKey> create_reference(uint32_t p_keycode_with_modifier_masks); + InputEventKey() {} }; @@ -406,6 +408,8 @@ public: virtual String as_text() const override; virtual String to_string() override; + static Ref<InputEventJoypadButton> create_reference(int p_btn_index); + InputEventJoypadButton() {} }; diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index c03e64eaf4..b31c431ead 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -88,8 +88,8 @@ List<StringName> InputMap::get_actions() const { return actions; } - for (Map<StringName, Action>::Element *E = input_map.front(); E; E = E->next()) { - actions.push_back(E->key()); + for (OrderedHashMap<StringName, Action>::Element E = input_map.front(); E; E = E.next()) { + actions.push_back(E.key()); } return actions; @@ -179,12 +179,12 @@ Array InputMap::_action_get_events(const StringName &p_action) { } const List<Ref<InputEvent>> *InputMap::action_get_events(const StringName &p_action) { - const Map<StringName, Action>::Element *E = input_map.find(p_action); + const OrderedHashMap<StringName, Action>::Element E = input_map.find(p_action); if (!E) { return nullptr; } - return &E->get().inputs; + return &E.get().inputs; } bool InputMap::event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match) const { @@ -192,7 +192,7 @@ bool InputMap::event_is_action(const Ref<InputEvent> &p_event, const StringName } bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength) const { - Map<StringName, Action>::Element *E = input_map.find(p_action); + OrderedHashMap<StringName, Action>::Element E = input_map.find(p_action); ERR_FAIL_COND_V_MSG(!E, false, "Request for nonexistent InputMap action '" + String(p_action) + "'."); Ref<InputEventAction> input_event_action = p_event; @@ -209,7 +209,7 @@ bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const Str bool pressed; float strength; float raw_strength; - List<Ref<InputEvent>>::Element *event = _find_event(E->get(), p_event, p_exact_match, &pressed, &strength, &raw_strength); + List<Ref<InputEvent>>::Element *event = _find_event(E.get(), p_event, p_exact_match, &pressed, &strength, &raw_strength); if (event != nullptr) { if (p_pressed != nullptr) { *p_pressed = pressed; @@ -226,7 +226,7 @@ bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const Str } } -const Map<StringName, InputMap::Action> &InputMap::get_action_map() const { +const OrderedHashMap<StringName, InputMap::Action> &InputMap::get_action_map() const { return input_map; } @@ -260,84 +260,444 @@ void InputMap::load_from_project_settings() { } } +struct _BuiltinActionDisplayName { + const char *name; + const char *display_name; +}; + +static const _BuiltinActionDisplayName _builtin_action_display_names[] = { + /* clang-format off */ + { "ui_accept", TTRC("Accept") }, + { "ui_select", TTRC("Select") }, + { "ui_cancel", TTRC("Cancel") }, + { "ui_focus_next", TTRC("Focus Next") }, + { "ui_focus_prev", TTRC("Focus Prev") }, + { "ui_left", TTRC("Left") }, + { "ui_right", TTRC("Right") }, + { "ui_up", TTRC("Up") }, + { "ui_down", TTRC("Down") }, + { "ui_page_up", TTRC("Page Up") }, + { "ui_page_down", TTRC("Page Down") }, + { "ui_home", TTRC("Home") }, + { "ui_end", TTRC("End") }, + { "ui_cut", TTRC("Cut") }, + { "ui_copy", TTRC("Copy") }, + { "ui_paste", TTRC("Paste") }, + { "ui_undo", TTRC("Undo") }, + { "ui_redo", TTRC("Redo") }, + { "ui_text_completion_query", TTRC("Completion Query") }, + { "ui_text_newline", TTRC("New Line") }, + { "ui_text_newline_blank", TTRC("New Blank Line") }, + { "ui_text_newline_above", TTRC("New Line Above") }, + { "ui_text_indent", TTRC("Indent") }, + { "ui_text_dedent", TTRC("Dedent") }, + { "ui_text_backspace", TTRC("Backspace") }, + { "ui_text_backspace_word", TTRC("Backspace Word") }, + { "ui_text_backspace_word.OSX", TTRC("Backspace Word") }, + { "ui_text_backspace_all_to_left", TTRC("Backspace all to Left") }, + { "ui_text_backspace_all_to_left.OSX", TTRC("Backspace all to Left") }, + { "ui_text_delete", TTRC("Delete") }, + { "ui_text_delete_word", TTRC("Delete Word") }, + { "ui_text_delete_word.OSX", TTRC("Delete Word") }, + { "ui_text_delete_all_to_right", TTRC("Delete all to Right") }, + { "ui_text_delete_all_to_right.OSX", TTRC("Delete all to Right") }, + { "ui_text_caret_left", TTRC("Caret Left") }, + { "ui_text_caret_word_left", TTRC("Caret Word Left") }, + { "ui_text_caret_word_left.OSX", TTRC("Caret Word Left") }, + { "ui_text_caret_right", TTRC("Caret Right") }, + { "ui_text_caret_word_right", TTRC("Caret Word Right") }, + { "ui_text_caret_word_right.OSX", TTRC("Caret Word Right") }, + { "ui_text_caret_up", TTRC("Caret Up") }, + { "ui_text_caret_down", TTRC("Caret Down") }, + { "ui_text_caret_line_start", TTRC("Caret Line Start") }, + { "ui_text_caret_line_start.OSX", TTRC("Caret Line Start") }, + { "ui_text_caret_line_end", TTRC("Caret Line End") }, + { "ui_text_caret_line_end.OSX", TTRC("Caret Line End") }, + { "ui_text_caret_page_up", TTRC("Caret Page Up") }, + { "ui_text_caret_page_down", TTRC("Caret Page Down") }, + { "ui_text_caret_document_start", TTRC("Caret Document Start") }, + { "ui_text_caret_document_start.OSX", TTRC("Caret Document Start") }, + { "ui_text_caret_document_end", TTRC("Caret Document End") }, + { "ui_text_caret_document_end.OSX", TTRC("Caret Document End") }, + { "ui_text_scroll_up", TTRC("Scroll Up") }, + { "ui_text_scroll_up.OSX", TTRC("Scroll Up") }, + { "ui_text_scroll_down", TTRC("Scroll Down") }, + { "ui_text_scroll_down.OSX", TTRC("Scroll Down") }, + { "ui_text_select_all", TTRC("Select All") }, + { "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") }, + { "ui_graph_duplicate", TTRC("Duplicate Nodes") }, + { "ui_graph_delete", TTRC("Delete Nodes") }, + { "ui_filedialog_up_one_level", TTRC("Go Up One Level") }, + { "ui_filedialog_refresh", TTRC("Refresh") }, + { "ui_filedialog_show_hidden", TTRC("Show Hidden") }, + { "ui_swap_input_direction ", TTRC("Swap Input Direction") }, + { "", TTRC("")} + /* clang-format on */ +}; + +String InputMap::get_builtin_display_name(const String &p_name) const { + int len = sizeof(_builtin_action_display_names) / sizeof(_BuiltinActionDisplayName); + + for (int i = 0; i < len; i++) { + if (_builtin_action_display_names[i].name == p_name) { + return RTR(_builtin_action_display_names[i].display_name); + } + } + + return p_name; +} + +const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() { + // Return cache if it has already been built. + if (default_builtin_cache.size()) { + return default_builtin_cache; + } + + List<Ref<InputEvent>> inputs; + inputs.push_back(InputEventKey::create_reference(KEY_ENTER)); + inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER)); + inputs.push_back(InputEventKey::create_reference(KEY_SPACE)); + default_builtin_cache.insert("ui_accept", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventJoypadButton::create_reference(JOY_BUTTON_Y)); + inputs.push_back(InputEventKey::create_reference(KEY_SPACE)); + default_builtin_cache.insert("ui_select", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_ESCAPE)); + default_builtin_cache.insert("ui_cancel", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_TAB)); + default_builtin_cache.insert("ui_focus_next", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_TAB | KEY_MASK_SHIFT)); + default_builtin_cache.insert("ui_focus_prev", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_LEFT)); + inputs.push_back(InputEventJoypadButton::create_reference(JOY_BUTTON_DPAD_LEFT)); + default_builtin_cache.insert("ui_left", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_RIGHT)); + inputs.push_back(InputEventJoypadButton::create_reference(JOY_BUTTON_DPAD_RIGHT)); + default_builtin_cache.insert("ui_right", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_UP)); + inputs.push_back(InputEventJoypadButton::create_reference(JOY_BUTTON_DPAD_UP)); + default_builtin_cache.insert("ui_up", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DOWN)); + inputs.push_back(InputEventJoypadButton::create_reference(JOY_BUTTON_DPAD_DOWN)); + default_builtin_cache.insert("ui_down", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_PAGEUP)); + default_builtin_cache.insert("ui_page_up", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_PAGEDOWN)); + default_builtin_cache.insert("ui_page_down", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_HOME)); + default_builtin_cache.insert("ui_home", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_END)); + default_builtin_cache.insert("ui_end", inputs); + + // ///// UI basic Shortcuts ///// + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_X | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE | KEY_MASK_SHIFT)); + default_builtin_cache.insert("ui_cut", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_C | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_INSERT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_copy", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_V | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_INSERT | KEY_MASK_SHIFT)); + default_builtin_cache.insert("ui_paste", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_Z | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_undo", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_Y | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_Z | KEY_MASK_CMD | KEY_MASK_SHIFT)); + default_builtin_cache.insert("ui_redo", inputs); + + // ///// UI Text Input Shortcuts ///// + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_SPACE | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_completion_query", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_TAB)); + default_builtin_cache.insert("ui_text_completion_accept", inputs); + + // Newlines + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_ENTER)); + inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER)); + default_builtin_cache.insert("ui_text_newline", inputs); + + inputs = List<Ref<InputEvent>>(); + + inputs.push_back(InputEventKey::create_reference(KEY_ENTER | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_newline_blank", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_ENTER | KEY_MASK_SHIFT | KEY_MASK_CMD)); + inputs.push_back(InputEventKey::create_reference(KEY_KP_ENTER | KEY_MASK_SHIFT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_newline_above", inputs); + + // Indentation + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_TAB)); + default_builtin_cache.insert("ui_text_indent", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_TAB | KEY_MASK_SHIFT)); + default_builtin_cache.insert("ui_text_dedent", inputs); + + // Text Backspace and Delete + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_BACKSPACE)); + default_builtin_cache.insert("ui_text_backspace", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_BACKSPACE | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_backspace_word", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_BACKSPACE | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_backspace_word.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + default_builtin_cache.insert("ui_text_backspace_all_to_left", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_BACKSPACE | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_backspace_all_to_left.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE)); + default_builtin_cache.insert("ui_text_delete", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_delete_word", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_delete_word.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + default_builtin_cache.insert("ui_text_delete_all_to_right", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_delete_all_to_right.OSX", inputs); + + // Text Caret Movement Left/Right + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_LEFT)); + default_builtin_cache.insert("ui_text_caret_left", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_LEFT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_word_left", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_LEFT | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_caret_word_left.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_RIGHT)); + default_builtin_cache.insert("ui_text_caret_right", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_RIGHT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_word_right", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_RIGHT | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_caret_word_right.OSX", inputs); + + // Text Caret Movement Up/Down + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_UP)); + default_builtin_cache.insert("ui_text_caret_up", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DOWN)); + default_builtin_cache.insert("ui_text_caret_down", inputs); + + // Text Caret Movement Line Start/End + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_HOME)); + default_builtin_cache.insert("ui_text_caret_line_start", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_A | KEY_MASK_CTRL)); + inputs.push_back(InputEventKey::create_reference(KEY_LEFT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_line_start.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_END)); + default_builtin_cache.insert("ui_text_caret_line_end", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_E | KEY_MASK_CTRL)); + inputs.push_back(InputEventKey::create_reference(KEY_RIGHT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_line_end.OSX", inputs); + // Text Caret Movement Page Up/Down + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_PAGEUP)); + default_builtin_cache.insert("ui_text_caret_page_up", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_PAGEDOWN)); + default_builtin_cache.insert("ui_text_caret_page_down", inputs); + + // Text Caret Movement Document Start/End + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_HOME | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_document_start", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_UP | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_document_start.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_END | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_document_end", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DOWN | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_caret_document_end.OSX", inputs); + + // Text Scrolling + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_UP | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_scroll_up", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_UP | KEY_MASK_CMD | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_scroll_up.OSX", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DOWN | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_scroll_down", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DOWN | KEY_MASK_CMD | KEY_MASK_ALT)); + default_builtin_cache.insert("ui_text_scroll_down.OSX", inputs); + + // Text Misc + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_A | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_text_select_all", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_INSERT)); + default_builtin_cache.insert("ui_text_toggle_insert_mode", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_MENU)); + default_builtin_cache.insert("ui_menu", inputs); + + // ///// UI Graph Shortcuts ///// + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_D | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_graph_duplicate", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_DELETE)); + default_builtin_cache.insert("ui_graph_delete", inputs); + + // ///// UI File Dialog Shortcuts ///// + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_BACKSPACE)); + default_builtin_cache.insert("ui_filedialog_up_one_level", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_F5)); + default_builtin_cache.insert("ui_filedialog_refresh", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_H)); + default_builtin_cache.insert("ui_filedialog_show_hidden", inputs); + + inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(KEY_QUOTELEFT | KEY_MASK_CMD)); + default_builtin_cache.insert("ui_swap_input_direction", inputs); + + return default_builtin_cache; +} + void InputMap::load_default() { - Ref<InputEventKey> key; - - add_action("ui_accept"); - key.instance(); - key->set_keycode(KEY_ENTER); - action_add_event("ui_accept", key); - - key.instance(); - key->set_keycode(KEY_KP_ENTER); - action_add_event("ui_accept", key); - - key.instance(); - key->set_keycode(KEY_SPACE); - action_add_event("ui_accept", key); - - add_action("ui_select"); - key.instance(); - key->set_keycode(KEY_SPACE); - action_add_event("ui_select", key); - - add_action("ui_cancel"); - key.instance(); - key->set_keycode(KEY_ESCAPE); - action_add_event("ui_cancel", key); - - add_action("ui_focus_next"); - key.instance(); - key->set_keycode(KEY_TAB); - action_add_event("ui_focus_next", key); - - add_action("ui_focus_prev"); - key.instance(); - key->set_keycode(KEY_TAB); - key->set_shift(true); - action_add_event("ui_focus_prev", key); - - add_action("ui_left"); - key.instance(); - key->set_keycode(KEY_LEFT); - action_add_event("ui_left", key); - - add_action("ui_right"); - key.instance(); - key->set_keycode(KEY_RIGHT); - action_add_event("ui_right", key); - - add_action("ui_up"); - key.instance(); - key->set_keycode(KEY_UP); - action_add_event("ui_up", key); - - add_action("ui_down"); - key.instance(); - key->set_keycode(KEY_DOWN); - action_add_event("ui_down", key); - - add_action("ui_page_up"); - key.instance(); - key->set_keycode(KEY_PAGEUP); - action_add_event("ui_page_up", key); - - add_action("ui_page_down"); - key.instance(); - key->set_keycode(KEY_PAGEDOWN); - action_add_event("ui_page_down", key); - - add_action("ui_home"); - key.instance(); - key->set_keycode(KEY_HOME); - action_add_event("ui_home", key); - - add_action("ui_end"); - key.instance(); - key->set_keycode(KEY_END); - action_add_event("ui_end", key); - - //set("display/window/handheld/orientation", "landscape"); + OrderedHashMap<String, List<Ref<InputEvent>>> builtins = get_builtins(); + + // List of Builtins which have an override for OSX. + Vector<String> osx_builtins; + for (OrderedHashMap<String, List<Ref<InputEvent>>>::Element E = builtins.front(); E; E = E.next()) { + if (String(E.key()).ends_with(".OSX")) { + // Strip .OSX from name: some_input_name.OSX -> some_input_name + osx_builtins.push_back(String(E.key()).split(".")[0]); + } + } + + for (OrderedHashMap<String, List<Ref<InputEvent>>>::Element E = builtins.front(); E; E = E.next()) { + String fullname = E.key(); + String name = fullname.split(".")[0]; + String override_for = fullname.split(".").size() > 1 ? fullname.split(".")[1] : ""; + +#ifdef APPLE_STYLE_KEYS + if (osx_builtins.has(name) && override_for != "OSX") { + // Name has osx builtin but this particular one is for non-osx systems - so skip. + continue; + } +#else + if (override_for == "OSX") { + // Override for OSX - not needed on non-osx platforms. + continue; + } +#endif + + add_action(name); + + List<Ref<InputEvent>> inputs = E.get(); + for (List<Ref<InputEvent>>::Element *I = inputs.front(); I; I = I->next()) { + Ref<InputEventKey> iek = I->get(); + + // For the editor, only add keyboard actions. + if (iek.is_valid()) { + action_add_event(fullname, I->get()); + } + } + } } InputMap::InputMap() { diff --git a/core/input/input_map.h b/core/input/input_map.h index 28c692c7ba..99c71e1e53 100644 --- a/core/input/input_map.h +++ b/core/input/input_map.h @@ -33,6 +33,8 @@ #include "core/input/input_event.h" #include "core/object/class_db.h" +#include "core/object/object.h" +#include "core/templates/ordered_hash_map.h" class InputMap : public Object { GDCLASS(InputMap, Object); @@ -52,7 +54,8 @@ public: private: static InputMap *singleton; - mutable Map<StringName, Action> input_map; + mutable OrderedHashMap<StringName, Action> input_map; + OrderedHashMap<String, List<Ref<InputEvent>>> default_builtin_cache; List<Ref<InputEvent>>::Element *_find_event(Action &p_action, const Ref<InputEvent> &p_event, bool p_exact_match = false, bool *p_pressed = nullptr, float *p_strength = nullptr, float *p_raw_strength = nullptr) const; @@ -81,10 +84,14 @@ public: bool event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match = false) const; bool event_get_action_status(const Ref<InputEvent> &p_event, const StringName &p_action, bool p_exact_match = false, bool *p_pressed = nullptr, float *p_strength = nullptr, float *p_raw_strength = nullptr) const; - const Map<StringName, Action> &get_action_map() const; + const OrderedHashMap<StringName, Action> &get_action_map() const; void load_from_project_settings(); void load_default(); + String get_builtin_display_name(const String &p_name) const; + // Use an Ordered Map so insertion order is preserved. We want the elements to be 'grouped' somewhat. + const OrderedHashMap<String, List<Ref<InputEvent>>> &get_builtins(); + InputMap(); }; diff --git a/core/io/ip.cpp b/core/io/ip.cpp index df95785000..e1d9c19f10 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -40,13 +40,13 @@ VARIANT_ENUM_CAST(IP::ResolverStatus); struct _IP_ResolverPrivate { struct QueueItem { - volatile IP::ResolverStatus status; + SafeNumeric<IP::ResolverStatus> status; IP_Address response; String hostname; IP::Type type; void clear() { - status = IP::RESOLVER_STATUS_NONE; + status.set(IP::RESOLVER_STATUS_NONE); response = IP_Address(); type = IP::TYPE_NONE; hostname = ""; @@ -61,7 +61,7 @@ struct _IP_ResolverPrivate { IP::ResolverID find_empty_id() const { for (int i = 0; i < IP::RESOLVER_MAX_QUERIES; i++) { - if (queue[i].status == IP::RESOLVER_STATUS_NONE) { + if (queue[i].status.get() == IP::RESOLVER_STATUS_NONE) { return i; } } @@ -77,15 +77,15 @@ struct _IP_ResolverPrivate { void resolve_queues() { for (int i = 0; i < IP::RESOLVER_MAX_QUERIES; i++) { - if (queue[i].status != IP::RESOLVER_STATUS_WAITING) { + if (queue[i].status.get() != IP::RESOLVER_STATUS_WAITING) { continue; } queue[i].response = IP::get_singleton()->resolve_hostname(queue[i].hostname, queue[i].type); if (!queue[i].response.is_valid()) { - queue[i].status = IP::RESOLVER_STATUS_ERROR; + queue[i].status.set(IP::RESOLVER_STATUS_ERROR); } else { - queue[i].status = IP::RESOLVER_STATUS_DONE; + queue[i].status.set(IP::RESOLVER_STATUS_DONE); } } } @@ -137,10 +137,10 @@ IP::ResolverID IP::resolve_hostname_queue_item(const String &p_hostname, IP::Typ resolver->queue[id].type = p_type; if (resolver->cache.has(key) && resolver->cache[key].is_valid()) { resolver->queue[id].response = resolver->cache[key]; - resolver->queue[id].status = IP::RESOLVER_STATUS_DONE; + resolver->queue[id].status.set(IP::RESOLVER_STATUS_DONE); } else { resolver->queue[id].response = IP_Address(); - resolver->queue[id].status = IP::RESOLVER_STATUS_WAITING; + resolver->queue[id].status.set(IP::RESOLVER_STATUS_WAITING); if (resolver->thread.is_started()) { resolver->sem.post(); } else { @@ -156,12 +156,12 @@ IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const { MutexLock lock(resolver->mutex); - if (resolver->queue[p_id].status == IP::RESOLVER_STATUS_NONE) { + if (resolver->queue[p_id].status.get() == IP::RESOLVER_STATUS_NONE) { ERR_PRINT("Condition status == IP::RESOLVER_STATUS_NONE"); resolver->mutex.unlock(); return IP::RESOLVER_STATUS_NONE; } - return resolver->queue[p_id].status; + return resolver->queue[p_id].status.get(); } IP_Address IP::get_resolve_item_address(ResolverID p_id) const { @@ -169,7 +169,7 @@ IP_Address IP::get_resolve_item_address(ResolverID p_id) const { MutexLock lock(resolver->mutex); - if (resolver->queue[p_id].status != IP::RESOLVER_STATUS_DONE) { + if (resolver->queue[p_id].status.get() != IP::RESOLVER_STATUS_DONE) { ERR_PRINT("Resolve of '" + resolver->queue[p_id].hostname + "'' didn't complete yet."); resolver->mutex.unlock(); return IP_Address(); @@ -183,7 +183,7 @@ void IP::erase_resolve_item(ResolverID p_id) { MutexLock lock(resolver->mutex); - resolver->queue[p_id].status = IP::RESOLVER_STATUS_NONE; + resolver->queue[p_id].status.set(IP::RESOLVER_STATUS_NONE); } void IP::clear_cache(const String &p_hostname) { diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index b34a083f1e..cba9a47187 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -174,6 +174,10 @@ void ResourceFormatLoader::_bind_methods() { ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_resource_type", PropertyInfo(Variant::STRING, "path"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo("get_dependencies", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "add_types"))); ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "rename_dependencies", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "renames"))); + + BIND_ENUM_CONSTANT(CACHE_MODE_IGNORE); + BIND_ENUM_CONSTANT(CACHE_MODE_REUSE); + BIND_ENUM_CONSTANT(CACHE_MODE_REPLACE); } /////////////////////////////////// diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 38a756c52f..914d988caa 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -66,6 +66,8 @@ public: virtual ~ResourceFormatLoader() {} }; +VARIANT_ENUM_CAST(ResourceFormatLoader::CacheMode) + typedef void (*ResourceLoadErrorNotify)(void *p_ud, const String &p_text); typedef void (*DependencyErrorNotify)(void *p_ud, const String &p_loading, const String &p_which, const String &p_type); diff --git a/core/object/object.cpp b/core/object/object.cpp index 8f2eed3200..1a9cce49d8 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1727,7 +1727,7 @@ void *Object::get_script_instance_binding(int p_script_language_index) { if (!_script_instance_bindings[p_script_language_index]) { void *script_data = ScriptServer::get_language(p_script_language_index)->alloc_instance_binding_data(this); if (script_data) { - atomic_increment(&instance_binding_count); + instance_binding_count.increment(); _script_instance_bindings[p_script_language_index] = script_data; } } diff --git a/core/object/object.h b/core/object/object.h index 5021fa47a1..029478873d 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -37,6 +37,7 @@ #include "core/templates/hash_map.h" #include "core/templates/list.h" #include "core/templates/map.h" +#include "core/templates/safe_refcount.h" #include "core/templates/set.h" #include "core/templates/vmap.h" #include "core/variant/callable_bind.h" @@ -486,7 +487,7 @@ private: friend class Reference; bool type_is_reference = false; - uint32_t instance_binding_count = 0; + SafeNumeric<uint32_t> instance_binding_count; void *_script_instance_bindings[MAX_SCRIPT_INSTANCE_BINDINGS]; Object(bool p_reference); diff --git a/core/object/reference.cpp b/core/object/reference.cpp index 71a52a9ba5..22e4e8a336 100644 --- a/core/object/reference.cpp +++ b/core/object/reference.cpp @@ -62,7 +62,7 @@ bool Reference::reference() { if (get_script_instance()) { get_script_instance()->refcount_incremented(); } - if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) { + if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) { for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) { if (_script_instance_bindings[i]) { ScriptServer::get_language(i)->refcount_incremented_instance_binding(this); @@ -83,7 +83,7 @@ bool Reference::unreference() { bool script_ret = get_script_instance()->refcount_decremented(); die = die && script_ret; } - if (instance_binding_count > 0 && !ScriptServer::are_languages_finished()) { + if (instance_binding_count.get() > 0 && !ScriptServer::are_languages_finished()) { for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) { if (_script_instance_bindings[i]) { bool script_ret = ScriptServer::get_language(i)->refcount_decremented_instance_binding(this); diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index 3b1165b8f6..e8735e335c 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -532,7 +532,7 @@ void UndoRedo::_bind_methods() { ClassDB::bind_method(D_METHOD("get_history_count"), &UndoRedo::get_history_count); ClassDB::bind_method(D_METHOD("get_current_action"), &UndoRedo::get_current_action); - ClassDB::bind_method(D_METHOD("get_action_name"), &UndoRedo::get_action_name); + ClassDB::bind_method(D_METHOD("get_action_name", "id"), &UndoRedo::get_action_name); ClassDB::bind_method(D_METHOD("clear_history", "increase_version"), &UndoRedo::clear_history, DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_current_action_name"), &UndoRedo::get_current_action_name); diff --git a/core/os/memory.cpp b/core/os/memory.cpp index 14808c2ce6..5910cb0e7b 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -60,11 +60,11 @@ void operator delete(void *p_mem, void *p_pointer, size_t check, const char *p_d #endif #ifdef DEBUG_ENABLED -uint64_t Memory::mem_usage = 0; -uint64_t Memory::max_usage = 0; +SafeNumeric<uint64_t> Memory::mem_usage; +SafeNumeric<uint64_t> Memory::max_usage; #endif -uint64_t Memory::alloc_count = 0; +SafeNumeric<uint64_t> Memory::alloc_count; void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) { #ifdef DEBUG_ENABLED @@ -77,7 +77,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) { ERR_FAIL_COND_V(!mem, nullptr); - atomic_increment(&alloc_count); + alloc_count.increment(); if (prepad) { uint64_t *s = (uint64_t *)mem; @@ -86,8 +86,8 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) { uint8_t *s8 = (uint8_t *)mem; #ifdef DEBUG_ENABLED - atomic_add(&mem_usage, p_bytes); - atomic_exchange_if_greater(&max_usage, mem_usage); + uint64_t new_mem_usage = mem_usage.add(p_bytes); + max_usage.exchange_if_greater(new_mem_usage); #endif return s8 + PAD_ALIGN; } else { @@ -114,10 +114,10 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) { #ifdef DEBUG_ENABLED if (p_bytes > *s) { - atomic_add(&mem_usage, p_bytes - *s); - atomic_exchange_if_greater(&max_usage, mem_usage); + uint64_t new_mem_usage = mem_usage.add(p_bytes - *s); + max_usage.exchange_if_greater(new_mem_usage); } else { - atomic_sub(&mem_usage, *s - p_bytes); + mem_usage.sub(*s - p_bytes); } #endif @@ -156,14 +156,14 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) { bool prepad = p_pad_align; #endif - atomic_decrement(&alloc_count); + alloc_count.decrement(); if (prepad) { mem -= PAD_ALIGN; #ifdef DEBUG_ENABLED uint64_t *s = (uint64_t *)mem; - atomic_sub(&mem_usage, *s); + mem_usage.sub(*s); #endif free(mem); @@ -178,7 +178,7 @@ uint64_t Memory::get_mem_available() { uint64_t Memory::get_mem_usage() { #ifdef DEBUG_ENABLED - return mem_usage; + return mem_usage.get(); #else return 0; #endif @@ -186,7 +186,7 @@ uint64_t Memory::get_mem_usage() { uint64_t Memory::get_mem_max_usage() { #ifdef DEBUG_ENABLED - return max_usage; + return max_usage.get(); #else return 0; #endif diff --git a/core/os/memory.h b/core/os/memory.h index c2ae3f4ae7..10e678103d 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -43,11 +43,11 @@ class Memory { Memory(); #ifdef DEBUG_ENABLED - static uint64_t mem_usage; - static uint64_t max_usage; + static SafeNumeric<uint64_t> mem_usage; + static SafeNumeric<uint64_t> max_usage; #endif - static uint64_t alloc_count; + static SafeNumeric<uint64_t> alloc_count; public: static void *alloc_static(size_t p_bytes, bool p_pad_align = false); diff --git a/core/os/os.h b/core/os/os.h index e02ce7d5ec..77a54ba68a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -149,11 +149,6 @@ public: bool is_layered_allowed() const { return _allow_layered; } bool is_hidpi_allowed() const { return _allow_hidpi; } - virtual int get_tablet_driver_count() const { return 0; }; - virtual String get_tablet_driver_name(int p_driver) const { return ""; }; - virtual String get_current_tablet_driver() const { return ""; }; - virtual void set_current_tablet_driver(const String &p_driver){}; - void ensure_user_data_dir(); virtual MainLoop *get_main_loop() const = 0; diff --git a/core/os/thread.cpp b/core/os/thread.cpp index 936e5d5500..88744eed63 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -34,13 +34,15 @@ #if !defined(NO_THREADS) +#include "core/templates/safe_refcount.h" + Error (*Thread::set_name_func)(const String &) = nullptr; void (*Thread::set_priority_func)(Thread::Priority) = nullptr; void (*Thread::init_func)() = nullptr; void (*Thread::term_func)() = nullptr; Thread::ID Thread::main_thread_id = 1; -Thread::ID Thread::last_thread_id = 1; +SafeNumeric<Thread::ID> Thread::last_thread_id{ 1 }; thread_local Thread::ID Thread::caller_id = 1; void Thread::_set_platform_funcs( @@ -79,7 +81,7 @@ void Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_ std::thread empty_thread; thread.swap(empty_thread); } - id = atomic_increment(&last_thread_id); + id = last_thread_id.increment(); std::thread new_thread(&Thread::callback, this, p_settings, p_callback, p_user); thread.swap(new_thread); } diff --git a/core/os/thread.h b/core/os/thread.h index b5449d2ed6..76f5be182e 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -34,6 +34,7 @@ #include "core/typedefs.h" #if !defined(NO_THREADS) +#include "core/templates/safe_refcount.h" #include <thread> #endif @@ -61,7 +62,7 @@ private: friend class Main; static ID main_thread_id; - static ID last_thread_id; + static SafeNumeric<Thread::ID> last_thread_id; ID id = 0; static thread_local ID caller_id; diff --git a/core/os/threaded_array_processor.h b/core/os/threaded_array_processor.h index 9538ac5957..4f270001d3 100644 --- a/core/os/threaded_array_processor.h +++ b/core/os/threaded_array_processor.h @@ -40,7 +40,7 @@ template <class C, class U> struct ThreadArrayProcessData { uint32_t elements; - uint32_t index; + SafeNumeric<uint32_t> index; C *instance; U userdata; void (C::*method)(uint32_t, U); @@ -56,7 +56,7 @@ template <class T> void process_array_thread(void *ud) { T &data = *(T *)ud; while (true) { - uint32_t index = atomic_increment(&data.index); + uint32_t index = data.index.increment(); if (index >= data.elements) { break; } @@ -70,9 +70,9 @@ void thread_process_array(uint32_t p_elements, C *p_instance, M p_method, U p_us data.method = p_method; data.instance = p_instance; data.userdata = p_userdata; - data.index = 0; + data.index.set(0); data.elements = p_elements; - data.process(data.index); //process first, let threads increment for next + data.process(0); //process first, let threads increment for next int thread_count = OS::get_singleton()->get_processor_count(); Thread *threads = memnew_arr(Thread, thread_count); diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index 4becb1be59..525d9e77cb 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -45,6 +45,10 @@ class CharString; template <class T, class V> class VMap; +#if !defined(NO_THREADS) +SAFE_NUMERIC_TYPE_PUN_GUARANTEES(uint32_t) +#endif + template <class T> class CowData { template <class TV> @@ -60,12 +64,12 @@ private: // internal helpers - _FORCE_INLINE_ uint32_t *_get_refcount() const { + _FORCE_INLINE_ SafeNumeric<uint32_t> *_get_refcount() const { if (!_ptr) { return nullptr; } - return reinterpret_cast<uint32_t *>(_ptr) - 2; + return reinterpret_cast<SafeNumeric<uint32_t> *>(_ptr) - 2; } _FORCE_INLINE_ uint32_t *_get_size() const { @@ -111,7 +115,7 @@ private: void _unref(void *p_data); void _ref(const CowData *p_from); void _ref(const CowData &p_from); - void _copy_on_write(); + uint32_t _copy_on_write(); public: void operator=(const CowData<T> &p_from) { _ref(p_from); } @@ -192,9 +196,9 @@ void CowData<T>::_unref(void *p_data) { return; } - uint32_t *refc = _get_refcount(); + SafeNumeric<uint32_t> *refc = _get_refcount(); - if (atomic_decrement(refc) > 0) { + if (refc->decrement() > 0) { return; // still in use } // clean up @@ -214,20 +218,21 @@ void CowData<T>::_unref(void *p_data) { } template <class T> -void CowData<T>::_copy_on_write() { +uint32_t CowData<T>::_copy_on_write() { if (!_ptr) { - return; + return 0; } - uint32_t *refc = _get_refcount(); + SafeNumeric<uint32_t> *refc = _get_refcount(); - if (unlikely(*refc > 1)) { + uint32_t rc = refc->get(); + if (unlikely(rc > 1)) { /* in use by more than me */ uint32_t current_size = *_get_size(); uint32_t *mem_new = (uint32_t *)Memory::alloc_static(_get_alloc_size(current_size), true); - *(mem_new - 2) = 1; //refcount + new (mem_new - 2, sizeof(uint32_t), "") SafeNumeric<uint32_t>(1); //refcount *(mem_new - 1) = current_size; //size T *_data = (T *)(mem_new); @@ -244,7 +249,10 @@ void CowData<T>::_copy_on_write() { _unref(_ptr); _ptr = _data; + + rc = 1; } + return rc; } template <class T> @@ -265,7 +273,7 @@ Error CowData<T>::resize(int p_size) { } // possibly changing size, copy on write - _copy_on_write(); + uint32_t rc = _copy_on_write(); size_t current_alloc_size = _get_alloc_size(current_size); size_t alloc_size; @@ -278,13 +286,15 @@ Error CowData<T>::resize(int p_size) { uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true); ERR_FAIL_COND_V(!ptr, ERR_OUT_OF_MEMORY); *(ptr - 1) = 0; //size, currently none - *(ptr - 2) = 1; //refcount + new (ptr - 2, sizeof(uint32_t), "") SafeNumeric<uint32_t>(1); //refcount _ptr = (T *)ptr; } else { - void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true); + uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true); ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY); + new (_ptrnew - 2, sizeof(uint32_t), "") SafeNumeric<uint32_t>(rc); //refcount + _ptr = (T *)(_ptrnew); } } @@ -311,8 +321,9 @@ Error CowData<T>::resize(int p_size) { } if (alloc_size != current_alloc_size) { - void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true); + uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true); ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY); + new (_ptrnew - 2, sizeof(uint32_t), "") SafeNumeric<uint32_t>(rc); //refcount _ptr = (T *)(_ptrnew); } @@ -359,7 +370,7 @@ void CowData<T>::_ref(const CowData &p_from) { return; //nothing to do } - if (atomic_conditional_increment(p_from._get_refcount()) > 0) { // could reference + if (p_from._get_refcount()->conditional_increment() > 0) { // could reference _ptr = p_from._ptr; } } diff --git a/core/templates/rid_owner.cpp b/core/templates/rid_owner.cpp index f75a2eb9df..56f39ab779 100644 --- a/core/templates/rid_owner.cpp +++ b/core/templates/rid_owner.cpp @@ -30,4 +30,4 @@ #include "rid_owner.h" -volatile uint64_t RID_AllocBase::base_id = 1; +SafeNumeric<uint64_t> RID_AllocBase::base_id{ 1 }; diff --git a/core/templates/rid_owner.h b/core/templates/rid_owner.h index 3edc73b1a9..c4aa93c394 100644 --- a/core/templates/rid_owner.h +++ b/core/templates/rid_owner.h @@ -44,7 +44,7 @@ #include <typeinfo> class RID_AllocBase { - static volatile uint64_t base_id; + static SafeNumeric<uint64_t> base_id; protected: static RID _make_from_id(uint64_t p_id) { @@ -54,7 +54,7 @@ protected: } static uint64_t _gen_id() { - return atomic_increment(&base_id); + return base_id.increment(); } static RID _gen_rid() { diff --git a/core/templates/safe_refcount.cpp b/core/templates/safe_refcount.cpp deleted file mode 100644 index a915ee662f..0000000000 --- a/core/templates/safe_refcount.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/*************************************************************************/ -/* safe_refcount.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "safe_refcount.h" - -#if defined(_MSC_VER) - -/* Implementation for MSVC-Windows */ - -// don't pollute my namespace! -#include <windows.h> - -#define ATOMIC_CONDITIONAL_INCREMENT_BODY(m_pw, m_win_type, m_win_cmpxchg, m_cpp_type) \ - /* try to increment until it actually works */ \ - /* taken from boost */ \ - while (true) { \ - m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \ - if (tmp == 0) { \ - return 0; /* if zero, can't add to it anymore */ \ - } \ - if (m_win_cmpxchg((m_win_type volatile *)(m_pw), tmp + 1, tmp) == tmp) { \ - return tmp + 1; \ - } \ - } - -#define ATOMIC_EXCHANGE_IF_GREATER_BODY(m_pw, m_val, m_win_type, m_win_cmpxchg, m_cpp_type) \ - while (true) { \ - m_cpp_type tmp = static_cast<m_cpp_type const volatile &>(*(m_pw)); \ - if (tmp >= m_val) { \ - return tmp; /* already greater, or equal */ \ - } \ - if (m_win_cmpxchg((m_win_type volatile *)(m_pw), m_val, tmp) == tmp) { \ - return m_val; \ - } \ - } - -_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(volatile uint32_t *pw) { - ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t); -} - -_ALWAYS_INLINE_ uint32_t _atomic_decrement_impl(volatile uint32_t *pw) { - return InterlockedDecrement((LONG volatile *)pw); -} - -_ALWAYS_INLINE_ uint32_t _atomic_increment_impl(volatile uint32_t *pw) { - return InterlockedIncrement((LONG volatile *)pw); -} - -_ALWAYS_INLINE_ uint32_t _atomic_sub_impl(volatile uint32_t *pw, volatile uint32_t val) { - return InterlockedExchangeAdd((LONG volatile *)pw, -(int32_t)val) - val; -} - -_ALWAYS_INLINE_ uint32_t _atomic_add_impl(volatile uint32_t *pw, volatile uint32_t val) { - return InterlockedAdd((LONG volatile *)pw, val); -} - -_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(volatile uint32_t *pw, volatile uint32_t val) { - ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t); -} - -_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(volatile uint64_t *pw) { - ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t); -} - -_ALWAYS_INLINE_ uint64_t _atomic_decrement_impl(volatile uint64_t *pw) { - return InterlockedDecrement64((LONGLONG volatile *)pw); -} - -_ALWAYS_INLINE_ uint64_t _atomic_increment_impl(volatile uint64_t *pw) { - return InterlockedIncrement64((LONGLONG volatile *)pw); -} - -_ALWAYS_INLINE_ uint64_t _atomic_sub_impl(volatile uint64_t *pw, volatile uint64_t val) { - return InterlockedExchangeAdd64((LONGLONG volatile *)pw, -(int64_t)val) - val; -} - -_ALWAYS_INLINE_ uint64_t _atomic_add_impl(volatile uint64_t *pw, volatile uint64_t val) { - return InterlockedAdd64((LONGLONG volatile *)pw, val); -} - -_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(volatile uint64_t *pw, volatile uint64_t val) { - ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t); -} - -// The actual advertised functions; they'll call the right implementation - -uint32_t atomic_conditional_increment(volatile uint32_t *pw) { - return _atomic_conditional_increment_impl(pw); -} - -uint32_t atomic_decrement(volatile uint32_t *pw) { - return _atomic_decrement_impl(pw); -} - -uint32_t atomic_increment(volatile uint32_t *pw) { - return _atomic_increment_impl(pw); -} - -uint32_t atomic_sub(volatile uint32_t *pw, volatile uint32_t val) { - return _atomic_sub_impl(pw, val); -} - -uint32_t atomic_add(volatile uint32_t *pw, volatile uint32_t val) { - return _atomic_add_impl(pw, val); -} - -uint32_t atomic_exchange_if_greater(volatile uint32_t *pw, volatile uint32_t val) { - return _atomic_exchange_if_greater_impl(pw, val); -} - -uint64_t atomic_conditional_increment(volatile uint64_t *pw) { - return _atomic_conditional_increment_impl(pw); -} - -uint64_t atomic_decrement(volatile uint64_t *pw) { - return _atomic_decrement_impl(pw); -} - -uint64_t atomic_increment(volatile uint64_t *pw) { - return _atomic_increment_impl(pw); -} - -uint64_t atomic_sub(volatile uint64_t *pw, volatile uint64_t val) { - return _atomic_sub_impl(pw, val); -} - -uint64_t atomic_add(volatile uint64_t *pw, volatile uint64_t val) { - return _atomic_add_impl(pw, val); -} - -uint64_t atomic_exchange_if_greater(volatile uint64_t *pw, volatile uint64_t val) { - return _atomic_exchange_if_greater_impl(pw, val); -} -#endif diff --git a/core/templates/safe_refcount.h b/core/templates/safe_refcount.h index d94444fad6..cdc9908a5f 100644 --- a/core/templates/safe_refcount.h +++ b/core/templates/safe_refcount.h @@ -31,167 +31,291 @@ #ifndef SAFE_REFCOUNT_H #define SAFE_REFCOUNT_H -#include "core/os/mutex.h" #include "core/typedefs.h" -#include "platform_config.h" -// Atomic functions, these are used for multithread safe reference counters! +#if !defined(NO_THREADS) -#ifdef NO_THREADS +#include <atomic> -/* Bogus implementation unaware of multiprocessing */ +// Design goals for these classes: +// - No automatic conversions or arithmetic operators, +// to keep explicit the use of atomics everywhere. +// - Using acquire-release semantics, even to set the first value. +// The first value may be set relaxedly in many cases, but adding the distinction +// between relaxed and unrelaxed operation to the interface would make it needlessly +// flexible. There's negligible waste in having release semantics for the initial +// value and, as an important benefit, you can be sure the value is properly synchronized +// even with threads that are already running. + +// This is used in very specific areas of the engine where it's critical that these guarantees are held +#define SAFE_NUMERIC_TYPE_PUN_GUARANTEES(m_type) \ + static_assert(sizeof(SafeNumeric<m_type>) == sizeof(m_type)); \ + static_assert(alignof(SafeNumeric<m_type>) == alignof(m_type)); \ + static_assert(std::is_trivially_destructible<std::atomic<m_type>>::value); template <class T> -static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) { - if (*pw == 0) { - return 0; +class SafeNumeric { + std::atomic<T> value; + + static_assert(std::atomic<T>::is_always_lock_free); + +public: + _ALWAYS_INLINE_ void set(T p_value) { + value.store(p_value, std::memory_order_release); } - (*pw)++; + _ALWAYS_INLINE_ T get() const { + return value.load(std::memory_order_acquire); + } - return *pw; -} + _ALWAYS_INLINE_ T increment() { + return value.fetch_add(1, std::memory_order_acq_rel) + 1; + } -template <class T> -static _ALWAYS_INLINE_ T atomic_decrement(volatile T *pw) { - (*pw)--; + // Returns the original value instead of the new one + _ALWAYS_INLINE_ T postincrement() { + return value.fetch_add(1, std::memory_order_acq_rel); + } - return *pw; -} + _ALWAYS_INLINE_ T decrement() { + return value.fetch_sub(1, std::memory_order_acq_rel) - 1; + } -template <class T> -static _ALWAYS_INLINE_ T atomic_increment(volatile T *pw) { - (*pw)++; + // Returns the original value instead of the new one + _ALWAYS_INLINE_ T postdecrement() { + return value.fetch_sub(1, std::memory_order_acq_rel); + } - return *pw; -} + _ALWAYS_INLINE_ T add(T p_value) { + return value.fetch_add(p_value, std::memory_order_acq_rel) + p_value; + } -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_sub(volatile T *pw, volatile V val) { - (*pw) -= val; + // Returns the original value instead of the new one + _ALWAYS_INLINE_ T postadd(T p_value) { + return value.fetch_add(p_value, std::memory_order_acq_rel); + } - return *pw; -} + _ALWAYS_INLINE_ T sub(T p_value) { + return value.fetch_sub(p_value, std::memory_order_acq_rel) - p_value; + } -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_add(volatile T *pw, volatile V val) { - (*pw) += val; + // Returns the original value instead of the new one + _ALWAYS_INLINE_ T postsub(T p_value) { + return value.fetch_sub(p_value, std::memory_order_acq_rel); + } - return *pw; -} + _ALWAYS_INLINE_ T exchange_if_greater(T p_value) { + while (true) { + T tmp = value.load(std::memory_order_acquire); + if (tmp >= p_value) { + return tmp; // already greater, or equal + } + if (value.compare_exchange_weak(tmp, p_value, std::memory_order_release)) { + return p_value; + } + } + } -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_exchange_if_greater(volatile T *pw, volatile V val) { - if (val > *pw) { - *pw = val; + _ALWAYS_INLINE_ T conditional_increment() { + while (true) { + T c = value.load(std::memory_order_acquire); + if (c == 0) { + return 0; + } + if (value.compare_exchange_weak(c, c + 1, std::memory_order_release)) { + return c + 1; + } + } } - return *pw; -} + _ALWAYS_INLINE_ explicit SafeNumeric<T>(T p_value = static_cast<T>(0)) { + set(p_value); + } +}; -#elif defined(__GNUC__) +class SafeFlag { + std::atomic_bool flag; -/* Implementation for GCC & Clang */ + static_assert(std::atomic_bool::is_always_lock_free); -// GCC guarantees atomic intrinsics for sizes of 1, 2, 4 and 8 bytes. -// Clang states it supports GCC atomic builtins. +public: + _ALWAYS_INLINE_ bool is_set() const { + return flag.load(std::memory_order_acquire); + } -template <class T> -static _ALWAYS_INLINE_ T atomic_conditional_increment(volatile T *pw) { - while (true) { - T tmp = static_cast<T const volatile &>(*pw); - if (tmp == 0) { - return 0; // if zero, can't add to it anymore - } - if (__sync_val_compare_and_swap(pw, tmp, tmp + 1) == tmp) { - return tmp + 1; - } + _ALWAYS_INLINE_ void set() { + flag.store(true, std::memory_order_release); } -} -template <class T> -static _ALWAYS_INLINE_ T atomic_decrement(volatile T *pw) { - return __sync_sub_and_fetch(pw, 1); -} + _ALWAYS_INLINE_ void clear() { + flag.store(false, std::memory_order_release); + } + + _ALWAYS_INLINE_ void set_to(bool p_value) { + flag.store(p_value, std::memory_order_release); + } + + _ALWAYS_INLINE_ explicit SafeFlag(bool p_value = false) { + set_to(p_value); + } +}; + +class SafeRefCount { + SafeNumeric<uint32_t> count; + +public: + _ALWAYS_INLINE_ bool ref() { // true on success + return count.conditional_increment() != 0; + } + + _ALWAYS_INLINE_ uint32_t refval() { // none-zero on success + return count.conditional_increment(); + } + + _ALWAYS_INLINE_ bool unref() { // true if must be disposed of + return count.decrement() == 0; + } + + _ALWAYS_INLINE_ uint32_t unrefval() { // 0 if must be disposed of + return count.decrement(); + } + + _ALWAYS_INLINE_ uint32_t get() const { + return count.get(); + } + + _ALWAYS_INLINE_ void init(uint32_t p_value = 1) { + count.set(p_value); + } +}; + +#else template <class T> -static _ALWAYS_INLINE_ T atomic_increment(volatile T *pw) { - return __sync_add_and_fetch(pw, 1); -} - -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_sub(volatile T *pw, volatile V val) { - return __sync_sub_and_fetch(pw, val); -} - -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_add(volatile T *pw, volatile V val) { - return __sync_add_and_fetch(pw, val); -} - -template <class T, class V> -static _ALWAYS_INLINE_ T atomic_exchange_if_greater(volatile T *pw, volatile V val) { - while (true) { - T tmp = static_cast<T const volatile &>(*pw); - if (tmp >= val) { - return tmp; // already greater, or equal +class SafeNumeric { +protected: + T value; + +public: + _ALWAYS_INLINE_ void set(T p_value) { + value = p_value; + } + + _ALWAYS_INLINE_ T get() const { + return value; + } + + _ALWAYS_INLINE_ T increment() { + return ++value; + } + + _ALWAYS_INLINE_ T postincrement() { + return value++; + } + + _ALWAYS_INLINE_ T decrement() { + return --value; + } + + _ALWAYS_INLINE_ T postdecrement() { + return value--; + } + + _ALWAYS_INLINE_ T add(T p_value) { + return value += p_value; + } + + _ALWAYS_INLINE_ T postadd(T p_value) { + T old = value; + value += p_value; + return old; + } + + _ALWAYS_INLINE_ T sub(T p_value) { + return value -= p_value; + } + + _ALWAYS_INLINE_ T postsub(T p_value) { + T old = value; + value -= p_value; + return old; + } + + _ALWAYS_INLINE_ T exchange_if_greater(T p_value) { + if (value < p_value) { + value = p_value; } - if (__sync_val_compare_and_swap(pw, tmp, val) == tmp) { - return val; + return value; + } + + _ALWAYS_INLINE_ T conditional_increment() { + if (value != 0) { + return 0; + } else { + return ++value; } } -} - -#elif defined(_MSC_VER) -// For MSVC use a separate compilation unit to prevent windows.h from polluting -// the global namespace. -uint32_t atomic_conditional_increment(volatile uint32_t *pw); -uint32_t atomic_decrement(volatile uint32_t *pw); -uint32_t atomic_increment(volatile uint32_t *pw); -uint32_t atomic_sub(volatile uint32_t *pw, volatile uint32_t val); -uint32_t atomic_add(volatile uint32_t *pw, volatile uint32_t val); -uint32_t atomic_exchange_if_greater(volatile uint32_t *pw, volatile uint32_t val); - -uint64_t atomic_conditional_increment(volatile uint64_t *pw); -uint64_t atomic_decrement(volatile uint64_t *pw); -uint64_t atomic_increment(volatile uint64_t *pw); -uint64_t atomic_sub(volatile uint64_t *pw, volatile uint64_t val); -uint64_t atomic_add(volatile uint64_t *pw, volatile uint64_t val); -uint64_t atomic_exchange_if_greater(volatile uint64_t *pw, volatile uint64_t val); -#else -//no threads supported? -#error Must provide atomic functions for this platform or compiler! -#endif + _ALWAYS_INLINE_ explicit SafeNumeric<T>(T p_value = static_cast<T>(0)) : + value(p_value) { + } +}; -struct SafeRefCount { - uint32_t count = 0; +class SafeFlag { +protected: + bool flag; public: - // destroy() is called when weak_count_ drops to zero. - - _ALWAYS_INLINE_ bool ref() { // true on success + _ALWAYS_INLINE_ bool is_set() const { + return flag; + } - return atomic_conditional_increment(&count) != 0; + _ALWAYS_INLINE_ void set() { + flag = true; } - _ALWAYS_INLINE_ uint32_t refval() { // none-zero on success + _ALWAYS_INLINE_ void clear() { + flag = false; + } - return atomic_conditional_increment(&count); + _ALWAYS_INLINE_ void set_to(bool p_value) { + flag = p_value; } - _ALWAYS_INLINE_ bool unref() { // true if must be disposed of + _ALWAYS_INLINE_ explicit SafeFlag(bool p_value = false) : + flag(p_value) {} +}; + +class SafeRefCount { + uint32_t count = 0; - return atomic_decrement(&count) == 0; +public: + _ALWAYS_INLINE_ bool ref() { // true on success + if (count != 0) { + ++count; + return true; + } else { + return false; + } } - _ALWAYS_INLINE_ uint32_t unrefval() { // 0 if must be disposed of + _ALWAYS_INLINE_ uint32_t refval() { // none-zero on success + if (count != 0) { + return ++count; + } else { + return 0; + } + } - return atomic_decrement(&count); + _ALWAYS_INLINE_ bool unref() { // true if must be disposed of + return --count == 0; } - _ALWAYS_INLINE_ uint32_t get() const { // nothrow + _ALWAYS_INLINE_ uint32_t unrefval() { // 0 if must be disposed of + return --count; + } + _ALWAYS_INLINE_ uint32_t get() const { return count; } @@ -200,4 +324,6 @@ public: } }; +#endif + #endif // SAFE_REFCOUNT_H diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index bebff61671..e5ba1d58f7 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -254,7 +254,7 @@ <member name="playback_default_blend_time" type="float" setter="set_default_blend_time" getter="get_default_blend_time" default="0.0"> The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. </member> - <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationPlayer.AnimationProcessMode" default="1"> + <member name="playback_process_mode" type="int" setter="set_process_callback" getter="get_process_callback" enum="AnimationPlayer.AnimationProcessCallback" default="1"> The process notification in which to update animations. </member> <member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> @@ -299,13 +299,13 @@ </signal> </signals> <constants> - <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback"> Process animation during the physics process. This is especially useful when animating physics bodies. </constant> - <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback"> Process animation during the idle process. </constant> - <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback"> Do not process animation. Use [method advance] to process the animation manually. </constant> <constant name="ANIMATION_METHOD_CALL_DEFERRED" value="0" enum="AnimationMethodCallMode"> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index 262b5addb7..2517941133 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -45,8 +45,8 @@ <member name="anim_player" type="NodePath" setter="set_animation_player" getter="get_animation_player" default="NodePath("")"> The path to the [AnimationPlayer] used for animating. </member> - <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="AnimationTree.AnimationProcessMode" default="1"> - The process mode of this [AnimationTree]. See [enum AnimationProcessMode] for available modes. + <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="AnimationTree.AnimationProcessCallback" default="1"> + The process mode of this [AnimationTree]. See [enum AnimationProcessCallback] for available modes. </member> <member name="root_motion_track" type="NodePath" setter="set_root_motion_track" getter="get_root_motion_track" default="NodePath("")"> The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by [code]":"[/code]. For example, [code]"character/skeleton:ankle"[/code] or [code]"character/mesh:transform/local"[/code]. @@ -57,13 +57,13 @@ </member> </members> <constants> - <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback"> The animations will progress during the physics frame (i.e. [method Node._physics_process]). </constant> - <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_IDLE" value="1" enum="AnimationProcessCallback"> The animations will progress during the idle frame (i.e. [method Node._process]). </constant> - <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessMode"> + <constant name="ANIMATION_PROCESS_MANUAL" value="2" enum="AnimationProcessCallback"> The animations will only progress manually (see [method advance]). </constant> </constants> diff --git a/doc/classes/BakedLightmapData.xml b/doc/classes/BakedLightmapData.xml index 026477782a..904555c48e 100644 --- a/doc/classes/BakedLightmapData.xml +++ b/doc/classes/BakedLightmapData.xml @@ -12,11 +12,11 @@ </return> <argument index="0" name="path" type="NodePath"> </argument> - <argument index="1" name="lightmap" type="Rect2"> + <argument index="1" name="uv_scale" type="Rect2"> </argument> - <argument index="2" name="offset" type="int"> + <argument index="2" name="slice_index" type="int"> </argument> - <argument index="3" name="arg3" type="int"> + <argument index="3" name="sub_instance" type="int"> </argument> <description> </description> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 96ff5e0293..51c35b15ce 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -34,6 +34,7 @@ [/codeblocks] Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. See also [BaseButton] which contains common properties and methods associated with this node. + [b]Note:[/b] Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that trigger gameplay movement or actions, as [TouchScreenButton] supports multitouch. </description> <tutorials> <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 2a4e726d43..d40567bdcb 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -168,8 +168,8 @@ <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )"> The camera's offset, useful for looking around or camera shake animations. </member> - <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Camera2D.Camera2DProcessMode" default="1"> - The camera's process callback. See [enum Camera2DProcessMode]. + <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1"> + The camera's process callback. See [enum Camera2DProcessCallback]. </member> <member name="rotating" type="bool" setter="set_rotating" getter="is_rotating" default="false"> If [code]true[/code], the camera rotates with the target. @@ -191,10 +191,10 @@ <constant name="ANCHOR_MODE_DRAG_CENTER" value="1" enum="AnchorMode"> The camera's position takes into account vertical/horizontal offsets and the screen size. </constant> - <constant name="CAMERA2D_PROCESS_PHYSICS" value="0" enum="Camera2DProcessMode"> + <constant name="CAMERA2D_PROCESS_PHYSICS" value="0" enum="Camera2DProcessCallback"> The camera updates with the [code]_physics_process[/code] callback. </constant> - <constant name="CAMERA2D_PROCESS_IDLE" value="1" enum="Camera2DProcessMode"> + <constant name="CAMERA2D_PROCESS_IDLE" value="1" enum="Camera2DProcessCallback"> The camera updates with the [code]_process[/code] callback. </constant> </constants> diff --git a/doc/classes/CharFXTransform.xml b/doc/classes/CharFXTransform.xml index b4cb110337..850098f741 100644 --- a/doc/classes/CharFXTransform.xml +++ b/doc/classes/CharFXTransform.xml @@ -17,7 +17,7 @@ The color the character will be drawn with. </member> <member name="elapsed_time" type="float" setter="set_elapsed_time" getter="get_elapsed_time" default="0.0"> - The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the project is paused, unless the [RichTextLabel]'s [member Node.pause_mode] is set to [constant Node.PAUSE_MODE_PROCESS]. + The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the project is paused depending on the value of the [RichTextLabel]'s [member Node.process_mode]. [b]Note:[/b] Time still passes while the [RichTextLabel] is hidden. </member> <member name="env" type="Dictionary" setter="set_environment" getter="get_environment" default="{}"> diff --git a/doc/classes/ClippedCamera3D.xml b/doc/classes/ClippedCamera3D.xml index de90247536..9116af19c3 100644 --- a/doc/classes/ClippedCamera3D.xml +++ b/doc/classes/ClippedCamera3D.xml @@ -95,15 +95,15 @@ <member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.0"> The camera's collision margin. The camera can't get closer than this distance to a colliding object. </member> - <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="ClippedCamera3D.ProcessMode" default="0"> - The camera's process callback. See [enum ProcessMode]. + <member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="ClippedCamera3D.ClipProcessCallback" default="0"> + The camera's process callback. See [enum ClipProcessCallback]. </member> </members> <constants> - <constant name="CLIP_PROCESS_PHYSICS" value="0" enum="ProcessMode"> + <constant name="CLIP_PROCESS_PHYSICS" value="0" enum="ClipProcessCallback"> The camera updates with the [code]_physics_process[/code] callback. </constant> - <constant name="CLIP_PROCESS_IDLE" value="1" enum="ProcessMode"> + <constant name="CLIP_PROCESS_IDLE" value="1" enum="ClipProcessCallback"> The camera updates with the [code]_process[/code] callback. </constant> </constants> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index d91ea6528a..91e90d051d 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -492,7 +492,7 @@ </argument> <argument index="3" name="subtitle_track" type="String"> </argument> - <argument index="4" name="arg4" type="int"> + <argument index="4" name="screen" type="int"> </argument> <description> </description> @@ -635,6 +635,42 @@ <description> </description> </method> + <method name="tablet_get_current_driver" qualifiers="const"> + <return type="String"> + </return> + <description> + Returns current active tablet driver name. + [b]Note:[/b] This method is implemented on Windows. + </description> + </method> + <method name="tablet_get_driver_count" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the total number of available tablet drivers. + [b]Note:[/b] This method is implemented on Windows. + </description> + </method> + <method name="tablet_get_driver_name" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Returns the tablet driver name for the given index. + [b]Note:[/b] This method is implemented on Windows. + </description> + </method> + <method name="tablet_set_current_driver"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + Set active tablet driver name. + [b]Note:[/b] This method is implemented on Windows. + </description> + </method> <method name="virtual_keyboard_get_height" qualifiers="const"> <return type="int"> </return> diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 6f03165a97..d85f95baff 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -10,14 +10,6 @@ <tutorials> </tutorials> <methods> - <method name="refresh"> - <return type="void"> - </return> - <description> - Refreshes the inspector. - [b]Note:[/b] To save on CPU resources, calling this method will do nothing if the time specified in [code]docks/property_editor/auto_refresh_interval[/code] editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.) - </description> - </method> </methods> <members> <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false" /> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index be21ad65c5..a24e4bbdc5 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -169,6 +169,8 @@ <return type="bool"> </return> <description> + This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. + This method must return a boolean. If this method returns [code]false[/code], the project will not run. The run is aborted immediately, so this also prevents all other plugins' [method build] methods from running. </description> </method> <method name="clear" qualifiers="virtual"> @@ -675,6 +677,10 @@ Emitted when user changes the workspace ([b]2D[/b], [b]3D[/b], [b]Script[/b], [b]AssetLib[/b]). Also works with custom screens defined by plugins. </description> </signal> + <signal name="project_settings_changed"> + <description> + </description> + </signal> <signal name="resource_saved"> <argument index="0" name="resource" type="Resource"> </argument> diff --git a/doc/classes/EditorSceneImporterMesh.xml b/doc/classes/EditorSceneImporterMesh.xml index 1c903bd889..58b7104667 100644 --- a/doc/classes/EditorSceneImporterMesh.xml +++ b/doc/classes/EditorSceneImporterMesh.xml @@ -29,7 +29,7 @@ </argument> <argument index="4" name="material" type="Material" default="null"> </argument> - <argument index="5" name="arg5" type="String" default=""""> + <argument index="5" name="name" type="String" default=""""> </argument> <description> </description> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 6088ae7a43..016d0128eb 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -160,6 +160,16 @@ Returns the default value of the setting specified by [code]name[/code]. This is the value that would be applied when clicking the Revert button in the Editor Settings. </description> </method> + <method name="set_builtin_action_override"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="actions_list" type="Array"> + </argument> + <description> + </description> + </method> <method name="set_favorites"> <return type="void"> </return> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index a986ec35c6..821aa91d21 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -169,6 +169,8 @@ </member> <member name="reflected_light_source" type="int" setter="set_reflection_source" getter="get_reflection_source" enum="Environment.ReflectionSource" default="0"> </member> + <member name="sdfgi_bounce_feedback" type="float" setter="set_sdfgi_bounce_feedback" getter="get_sdfgi_bounce_feedback" default="0.0"> + </member> <member name="sdfgi_cascade0_distance" type="float" setter="set_sdfgi_cascade0_distance" getter="get_sdfgi_cascade0_distance" default="12.8"> </member> <member name="sdfgi_cascades" type="int" setter="set_sdfgi_cascades" getter="get_sdfgi_cascades" enum="Environment.SDFGICascades" default="1"> @@ -187,8 +189,6 @@ </member> <member name="sdfgi_read_sky_light" type="bool" setter="set_sdfgi_read_sky_light" getter="is_sdfgi_reading_sky_light" default="false"> </member> - <member name="sdfgi_use_multi_bounce" type="bool" setter="set_sdfgi_use_multi_bounce" getter="is_sdfgi_using_multi_bounce" default="false"> - </member> <member name="sdfgi_use_occlusion" type="bool" setter="set_sdfgi_use_occlusion" getter="is_sdfgi_using_occlusion" default="false"> </member> <member name="sdfgi_y_scale" type="int" setter="set_sdfgi_y_scale" getter="get_sdfgi_y_scale" enum="Environment.SDFGIYScale" default="0"> @@ -272,7 +272,7 @@ </members> <constants> <constant name="BG_CLEAR_COLOR" value="0" enum="BGMode"> - Clears the background using the clear color defined in [member ProjectSettings.rendering/environment/default_clear_color]. + Clears the background using the clear color defined in [member ProjectSettings.rendering/environment/defaults/default_clear_color]. </constant> <constant name="BG_COLOR" value="1" enum="BGMode"> Clears the background using a custom clear color. diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 52d3698201..dd51248fd9 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -5,7 +5,7 @@ </brief_description> <description> [GIProbe]s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. [GIProbe]s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked. - Having [GIProbe]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/quality/gi_probes/quality]. + Having [GIProbe]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/global_illumination/gi_probes/quality]. </description> <tutorials> <link title="GI probes">https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link> diff --git a/doc/classes/GLTFSkeleton.xml b/doc/classes/GLTFSkeleton.xml index e27c838648..9680c27705 100644 --- a/doc/classes/GLTFSkeleton.xml +++ b/doc/classes/GLTFSkeleton.xml @@ -10,7 +10,7 @@ <method name="get_bone_attachment"> <return type="BoneAttachment3D"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> diff --git a/doc/classes/GLTFState.xml b/doc/classes/GLTFState.xml index f7763efdb1..a8e96ec8a9 100644 --- a/doc/classes/GLTFState.xml +++ b/doc/classes/GLTFState.xml @@ -16,7 +16,7 @@ <method name="get_animation_player"> <return type="AnimationPlayer"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> @@ -24,7 +24,7 @@ <method name="get_animation_players_count"> <return type="int"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> @@ -80,7 +80,7 @@ <method name="get_scene_node"> <return type="Node"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="idx" type="int"> </argument> <description> </description> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 3a126d89e9..279c4c4c94 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -260,13 +260,6 @@ Emitted when the GraphNode is moved. </description> </signal> - <signal name="slot_updated"> - <argument index="0" name="idx" type="int"> - </argument> - <description> - Emitted when any GraphNode's slot is updated. - </description> - </signal> <signal name="raise_request"> <description> Emitted when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode. @@ -279,6 +272,13 @@ Emitted when the GraphNode is requested to be resized. Happens on dragging the resizer handle (see [member resizable]). </description> </signal> + <signal name="slot_updated"> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Emitted when any GraphNode's slot is updated. + </description> + </signal> </signals> <constants> <constant name="OVERLAY_DISABLED" value="0" enum="Overlay"> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 3dba5d13aa..bad8127c03 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -12,6 +12,18 @@ <link title="Importing images">https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_images.html</link> </tutorials> <methods> + <method name="adjust_bcs"> + <return type="void"> + </return> + <argument index="0" name="brightness" type="float"> + </argument> + <argument index="1" name="contrast" type="float"> + </argument> + <argument index="2" name="saturation" type="float"> + </argument> + <description> + </description> + </method> <method name="blend_rect"> <return type="void"> </return> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index cfb3e8d981..1f872db6c6 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -59,6 +59,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead. </description> @@ -68,6 +70,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. </description> @@ -214,6 +218,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] when the user starts pressing the action event, meaning it's [code]true[/code] only on the frame that the user pressed down the button. This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. @@ -224,6 +230,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] when the user stops pressing the action event, meaning it's [code]true[/code] only on the frame that the user released the button. </description> @@ -233,6 +241,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. </description> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 8c6063bd67..28c4773f51 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -35,6 +35,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion]. </description> @@ -44,6 +46,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] if this input event matches a pre-defined action of any type. </description> @@ -55,6 +59,8 @@ </argument> <argument index="1" name="allow_echo" type="bool" default="false"> </argument> + <argument index="2" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. </description> @@ -64,6 +70,8 @@ </return> <argument index="0" name="action" type="StringName"> </argument> + <argument index="1" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] if the given action is released (i.e. not pressed). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. </description> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 49d29b3a53..0fb18d8e81 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -100,6 +100,8 @@ </argument> <argument index="1" name="action" type="StringName"> </argument> + <argument index="2" name="exact_match" type="bool" default="false"> + </argument> <description> Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. </description> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index a6dcabb168..360f5c451e 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -392,8 +392,8 @@ <theme_item name="font_uneditable_color" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )"> Font color when editing is disabled. </theme_item> - <theme_item name="minimum_spaces" type="int" default="12"> - Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling). + <theme_item name="minimum_character_width" type="int" default="4"> + Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of 'M' characters (i.e. this amount of 'M' characters can be displayed without scrolling). </theme_item> <theme_item name="normal" type="StyleBox"> Default background for the [LineEdit]. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 5f0d6462e2..7ee6860dfc 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -179,7 +179,7 @@ <return type="bool"> </return> <description> - Returns [code]true[/code] if the node can process while the scene tree is paused (see [member pause_mode]). Always returns [code]true[/code] if the scene tree is not paused, and [code]false[/code] if the node is not in the tree. + Returns [code]true[/code] if the node can process while the scene tree is paused (see [member process_mode]). Always returns [code]true[/code] if the scene tree is not paused, and [code]false[/code] if the node is not in the tree. </description> </method> <method name="duplicate" qualifiers="const"> @@ -245,6 +245,12 @@ Returns an array of references to node's children. </description> </method> + <method name="get_editor_description" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_groups" qualifiers="const"> <return type="Array"> </return> @@ -757,6 +763,14 @@ Sets the folded state of the node in the Scene dock. </description> </method> + <method name="set_editor_description"> + <return type="void"> + </return> + <argument index="0" name="editor_description" type="String"> + </argument> + <description> + </description> + </method> <method name="set_network_master"> <return type="void"> </return> @@ -868,8 +882,8 @@ <member name="owner" type="Node" setter="set_owner" getter="get_owner"> The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using [PackedScene]), all the nodes it owns will be saved with it. This allows for the creation of complex [SceneTree]s, with instancing and subinstancing. </member> - <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" enum="Node.PauseMode" default="0"> - Pause mode. How the node will behave if the [SceneTree] is paused. + <member name="process_mode" type="int" setter="set_process_mode" getter="get_process_mode" enum="Node.ProcessMode" default="0"> + Can be used to pause or unpause the node, or make the node paused based on the [SceneTree], or make it inherit the process mode from its parent (default). </member> <member name="process_priority" type="int" setter="set_process_priority" getter="get_process_priority" default="0"> The node's priority in the execution order of the enabled processing callbacks (i.e. [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS] and their internal counterparts). Nodes whose process priority value is [i]lower[/i] will have their processing callbacks executed first. @@ -1017,14 +1031,20 @@ <constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018"> Notification received when text server is changed. </constant> - <constant name="PAUSE_MODE_INHERIT" value="0" enum="PauseMode"> - Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default. + <constant name="PROCESS_MODE_INHERIT" value="0" enum="ProcessMode"> + Inherits process mode from the node's parent. For the root node, it is equivalent to [constant PROCESS_MODE_PAUSABLE]. Default. + </constant> + <constant name="PROCESS_MODE_PAUSABLE" value="1" enum="ProcessMode"> + Stops processing when the [SceneTree] is paused (process when unpaused). This is the inverse of [constant PROCESS_MODE_WHEN_PAUSED]. + </constant> + <constant name="PROCESS_MODE_WHEN_PAUSED" value="2" enum="ProcessMode"> + Only process when the [SceneTree] is paused (don't process when unpaused). This is the inverse of [constant PROCESS_MODE_PAUSABLE]. </constant> - <constant name="PAUSE_MODE_STOP" value="1" enum="PauseMode"> - Stops processing when the [SceneTree] is paused. + <constant name="PROCESS_MODE_ALWAYS" value="3" enum="ProcessMode"> + Always process. Continue processing always, ignoring the [SceneTree]'s paused property. This is the inverse of [constant PROCESS_MODE_DISABLED]. </constant> - <constant name="PAUSE_MODE_PROCESS" value="2" enum="PauseMode"> - Continue to process regardless of the [SceneTree] pause state. + <constant name="PROCESS_MODE_DISABLED" value="4" enum="ProcessMode"> + Never process. Completely disables processing, ignoring the [SceneTree]'s paused property. This is the inverse of [constant PROCESS_MODE_ALWAYS]. </constant> <constant name="DUPLICATE_SIGNALS" value="1" enum="DuplicateFlags"> Duplicate the node's signals. diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 8b56050058..5c29c0d48f 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -103,7 +103,7 @@ </return> <argument index="0" name="target" type="Vector3"> </argument> - <argument index="1" name="up" type="Vector3"> + <argument index="1" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> </argument> <description> Rotates itself so that the local -Z axis points towards the [code]target[/code] position. @@ -118,7 +118,7 @@ </argument> <argument index="1" name="target" type="Vector3"> </argument> - <argument index="2" name="up" type="Vector3"> + <argument index="2" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> </argument> <description> Moves the node to the specified [code]position[/code], and then rotates itself to point toward the [code]target[/code] as per [method look_at]. Operations take place in global space. diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 8620de1378..f6602d5f4d 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -54,7 +54,7 @@ <argument index="0" name="msec" type="int"> </argument> <description> - Delay execution of the current thread by [code]msec[/code] milliseconds. + Delay execution of the current thread by [code]msec[/code] milliseconds. [code]usec[/code] must be greater than or equal to [code]0[/code]. Otherwise, [method delay_msec] will do nothing and will print an error message. </description> </method> <method name="delay_usec" qualifiers="const"> @@ -63,7 +63,7 @@ <argument index="0" name="usec" type="int"> </argument> <description> - Delay execution of the current thread by [code]usec[/code] microseconds. + Delay execution of the current thread by [code]usec[/code] microseconds. [code]usec[/code] must be greater than or equal to [code]0[/code]. Otherwise, [method delay_usec] will do nothing and will print an error message. </description> </method> <method name="dump_memory_to_file"> @@ -304,24 +304,6 @@ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. </description> </method> - <method name="get_tablet_driver_count" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the total number of available tablet drivers. - [b]Note:[/b] This method is implemented on Windows. - </description> - </method> - <method name="get_tablet_driver_name" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="idx" type="int"> - </argument> - <description> - Returns the tablet driver name for the given index. - [b]Note:[/b] This method is implemented on Windows. - </description> - </method> <method name="get_thread_caller_id" qualifiers="const"> <return type="int"> </return> @@ -563,9 +545,6 @@ <member name="low_processor_usage_mode_sleep_usec" type="int" setter="set_low_processor_usage_mode_sleep_usec" getter="get_low_processor_usage_mode_sleep_usec" default="6900"> The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. </member> - <member name="tablet_driver" type="String" setter="set_current_tablet_driver" getter="get_current_tablet_driver" default=""""> - The current tablet driver in use. - </member> </members> <constants> <constant name="VIDEO_DRIVER_GLES2" value="0" enum="VideoDriver"> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index f55b8597dd..ad3ce8e93e 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -533,11 +533,11 @@ If [code]reversed[/code] is [code]true[/code], [method _notification] is called first on the object's own class, and then up to its successive parent classes. If [code]reversed[/code] is [code]false[/code], [method _notification] is called first on the highest ancestor ([Object] itself), and then down to its successive inheriting classes. </description> </method> - <method name="property_list_changed_notify"> + <method name="notify_property_list_changed"> <return type="void"> </return> <description> - Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds. + Notify the editor that the property list has changed by emitting the [signal property_list_changed] signal, so that editor plugins can take the new values into account. </description> </method> <method name="remove_meta"> @@ -680,6 +680,10 @@ </method> </methods> <signals> + <signal name="property_list_changed"> + <description> + </description> + </signal> <signal name="script_changed"> <description> Emitted whenever the object's script is changed. diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 6a1508b0e3..1fa82adb7a 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -850,21 +850,6 @@ <description> </description> </method> - <method name="damped_spring_joint_create"> - <return type="RID"> - </return> - <argument index="0" name="anchor_a" type="Vector2"> - </argument> - <argument index="1" name="anchor_b" type="Vector2"> - </argument> - <argument index="2" name="body_a" type="RID"> - </argument> - <argument index="3" name="body_b" type="RID"> - </argument> - <description> - Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. - </description> - </method> <method name="damped_spring_joint_get_param" qualifiers="const"> <return type="float"> </return> @@ -907,21 +892,18 @@ Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for a list of available states. </description> </method> - <method name="groove_joint_create"> - <return type="RID"> + <method name="joint_clear"> + <return type="void"> </return> - <argument index="0" name="groove1_a" type="Vector2"> - </argument> - <argument index="1" name="groove2_a" type="Vector2"> - </argument> - <argument index="2" name="anchor_b" type="Vector2"> - </argument> - <argument index="3" name="body_a" type="RID"> - </argument> - <argument index="4" name="body_b" type="RID"> + <argument index="0" name="joint" type="RID"> </argument> <description> - Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself. + </description> + </method> + <method name="joint_create"> + <return type="RID"> + </return> + <description> </description> </method> <method name="joint_get_param" qualifiers="const"> @@ -944,36 +926,71 @@ Returns a joint's type (see [enum JointType]). </description> </method> - <method name="joint_set_param"> + <method name="joint_make_damped_spring"> <return type="void"> </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int" enum="PhysicsServer2D.JointParam"> + <argument index="1" name="anchor_a" type="Vector2"> </argument> - <argument index="2" name="value" type="float"> + <argument index="2" name="anchor_b" type="Vector2"> + </argument> + <argument index="3" name="body_a" type="RID"> + </argument> + <argument index="4" name="body_b" type="RID"> </argument> <description> - Sets a joint parameter. See [enum JointParam] for a list of available parameters. </description> </method> - <method name="line_shape_create"> - <return type="RID"> + <method name="joint_make_groove"> + <return type="void"> </return> + <argument index="0" name="joint" type="RID"> + </argument> + <argument index="1" name="groove1_a" type="Vector2"> + </argument> + <argument index="2" name="groove2_a" type="Vector2"> + </argument> + <argument index="3" name="anchor_b" type="Vector2"> + </argument> + <argument index="4" name="body_a" type="RID"> + </argument> + <argument index="5" name="body_b" type="RID"> + </argument> <description> </description> </method> - <method name="pin_joint_create"> - <return type="RID"> + <method name="joint_make_pin"> + <return type="void"> </return> - <argument index="0" name="anchor" type="Vector2"> + <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="body_a" type="RID"> + <argument index="1" name="anchor" type="Vector2"> </argument> - <argument index="2" name="body_b" type="RID"> + <argument index="2" name="body_a" type="RID"> + </argument> + <argument index="3" name="body_b" type="RID"> </argument> <description> - Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. + </description> + </method> + <method name="joint_set_param"> + <return type="void"> + </return> + <argument index="0" name="joint" type="RID"> + </argument> + <argument index="1" name="param" type="int" enum="PhysicsServer2D.JointParam"> + </argument> + <argument index="2" name="value" type="float"> + </argument> + <description> + Sets a joint parameter. See [enum JointParam] for a list of available parameters. + </description> + </method> + <method name="line_shape_create"> + <return type="RID"> + </return> + <description> </description> </method> <method name="ray_shape_create"> @@ -1233,15 +1250,18 @@ <constant name="BODY_STATE_CAN_SLEEP" value="4" enum="BodyState"> Constant to set/get whether the body can sleep. </constant> - <constant name="JOINT_PIN" value="0" enum="JointType"> + <constant name="JOINT_TYPE_PIN" value="0" enum="JointType"> Constant to create pin joints. </constant> - <constant name="JOINT_GROOVE" value="1" enum="JointType"> + <constant name="JOINT_TYPE_GROOVE" value="1" enum="JointType"> Constant to create groove joints. </constant> - <constant name="JOINT_DAMPED_SPRING" value="2" enum="JointType"> + <constant name="JOINT_TYPE_DAMPED_SPRING" value="2" enum="JointType"> Constant to create damped spring joints. </constant> + <constant name="JOINT_TYPE_MAX" value="3" enum="JointType"> + Represents the size of the [enum JointType] enum. + </constant> <constant name="JOINT_PARAM_BIAS" value="0" enum="JointParam"> </constant> <constant name="JOINT_PARAM_MAX_BIAS" value="1" enum="JointParam"> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 5fd3ef5db2..9a7926e937 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -129,15 +129,6 @@ Returns the transform matrix for an area. </description> </method> - <method name="area_is_ray_pickable" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="area" type="RID"> - </argument> - <description> - If [code]true[/code], area collides with rays. - </description> - </method> <method name="area_remove_shape"> <return type="void"> </return> @@ -421,12 +412,7 @@ <method name="body_create"> <return type="RID"> </return> - <argument index="0" name="mode" type="int" enum="PhysicsServer3D.BodyMode" default="2"> - </argument> - <argument index="1" name="init_sleeping" type="bool" default="false"> - </argument> <description> - Creates a physics body. The first parameter can be any value from [enum BodyMode] constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. </description> </method> <method name="body_get_collision_layer" qualifiers="const"> @@ -582,15 +568,6 @@ Returns whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). </description> </method> - <method name="body_is_ray_pickable" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="body" type="RID"> - </argument> - <description> - If [code]true[/code], the body can be detected by rays. - </description> - </method> <method name="body_remove_collision_exception"> <return type="void"> </return> @@ -815,6 +792,24 @@ Sets a body state (see [enum BodyState] constants). </description> </method> + <method name="box_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="capsule_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="concave_polygon_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> <method name="cone_twist_joint_get_param" qualifiers="const"> <return type="float"> </return> @@ -839,6 +834,24 @@ Sets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants). </description> </method> + <method name="convex_polygon_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="custom_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="cylinder_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> <method name="free_rid"> <return type="void"> </return> @@ -848,7 +861,7 @@ Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console. </description> </method> - <method name="generic_6dof_joint_get_flag"> + <method name="generic_6dof_joint_get_flag" qualifiers="const"> <return type="bool"> </return> <argument index="0" name="joint" type="RID"> @@ -861,7 +874,7 @@ Gets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants). </description> </method> - <method name="generic_6dof_joint_get_param"> + <method name="generic_6dof_joint_get_param" qualifiers="const"> <return type="float"> </return> <argument index="0" name="joint" type="RID"> @@ -913,6 +926,12 @@ Returns an Info defined by the [enum ProcessInfo] input given. </description> </method> + <method name="heightmap_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> <method name="hinge_joint_get_flag" qualifiers="const"> <return type="bool"> </return> @@ -961,97 +980,116 @@ Sets a hinge_joint parameter (see [enum HingeJointParam] constants). </description> </method> - <method name="joint_create_cone_twist"> - <return type="RID"> + <method name="joint_clear"> + <return type="void"> </return> - <argument index="0" name="body_A" type="RID"> - </argument> - <argument index="1" name="local_ref_A" type="Transform"> - </argument> - <argument index="2" name="body_B" type="RID"> - </argument> - <argument index="3" name="local_ref_B" type="Transform"> + <argument index="0" name="joint" type="RID"> </argument> <description> - Creates a [ConeTwistJoint3D]. </description> </method> - <method name="joint_create_generic_6dof"> + <method name="joint_create"> <return type="RID"> </return> - <argument index="0" name="body_A" type="RID"> - </argument> - <argument index="1" name="local_ref_A" type="Transform"> - </argument> - <argument index="2" name="body_B" type="RID"> + <description> + </description> + </method> + <method name="joint_get_solver_priority" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="joint" type="RID"> </argument> - <argument index="3" name="local_ref_B" type="Transform"> + <description> + Gets the priority value of the Joint3D. + </description> + </method> + <method name="joint_get_type" qualifiers="const"> + <return type="int" enum="PhysicsServer3D.JointType"> + </return> + <argument index="0" name="joint" type="RID"> </argument> <description> - Creates a [Generic6DOFJoint3D]. + Returns the type of the Joint3D. </description> </method> - <method name="joint_create_hinge"> - <return type="RID"> + <method name="joint_make_cone_twist"> + <return type="void"> </return> - <argument index="0" name="body_A" type="RID"> + <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="hinge_A" type="Transform"> + <argument index="1" name="body_A" type="RID"> </argument> - <argument index="2" name="body_B" type="RID"> + <argument index="2" name="local_ref_A" type="Transform"> </argument> - <argument index="3" name="hinge_B" type="Transform"> + <argument index="3" name="body_B" type="RID"> + </argument> + <argument index="4" name="local_ref_B" type="Transform"> </argument> <description> - Creates a [HingeJoint3D]. </description> </method> - <method name="joint_create_pin"> - <return type="RID"> + <method name="joint_make_generic_6dof"> + <return type="void"> </return> - <argument index="0" name="body_A" type="RID"> + <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="local_A" type="Vector3"> + <argument index="1" name="body_A" type="RID"> + </argument> + <argument index="2" name="local_ref_A" type="Transform"> </argument> - <argument index="2" name="body_B" type="RID"> + <argument index="3" name="body_B" type="RID"> </argument> - <argument index="3" name="local_B" type="Vector3"> + <argument index="4" name="local_ref_B" type="Transform"> </argument> <description> - Creates a [PinJoint3D]. </description> </method> - <method name="joint_create_slider"> - <return type="RID"> + <method name="joint_make_hinge"> + <return type="void"> </return> - <argument index="0" name="body_A" type="RID"> + <argument index="0" name="joint" type="RID"> + </argument> + <argument index="1" name="body_A" type="RID"> </argument> - <argument index="1" name="local_ref_A" type="Transform"> + <argument index="2" name="hinge_A" type="Transform"> </argument> - <argument index="2" name="body_B" type="RID"> + <argument index="3" name="body_B" type="RID"> </argument> - <argument index="3" name="local_ref_B" type="Transform"> + <argument index="4" name="hinge_B" type="Transform"> </argument> <description> - Creates a [SliderJoint3D]. </description> </method> - <method name="joint_get_solver_priority" qualifiers="const"> - <return type="int"> + <method name="joint_make_pin"> + <return type="void"> </return> <argument index="0" name="joint" type="RID"> </argument> + <argument index="1" name="body_A" type="RID"> + </argument> + <argument index="2" name="local_A" type="Vector3"> + </argument> + <argument index="3" name="body_B" type="RID"> + </argument> + <argument index="4" name="local_B" type="Vector3"> + </argument> <description> - Gets the priority value of the Joint3D. </description> </method> - <method name="joint_get_type" qualifiers="const"> - <return type="int" enum="PhysicsServer3D.JointType"> + <method name="joint_make_slider"> + <return type="void"> </return> <argument index="0" name="joint" type="RID"> </argument> + <argument index="1" name="body_A" type="RID"> + </argument> + <argument index="2" name="local_ref_A" type="Transform"> + </argument> + <argument index="3" name="body_B" type="RID"> + </argument> + <argument index="4" name="local_ref_B" type="Transform"> + </argument> <description> - Returns the type of the Joint3D. </description> </method> <method name="joint_set_solver_priority"> @@ -1129,22 +1167,25 @@ Sets a pin_joint parameter (see [enum PinJointParam] constants). </description> </method> - <method name="set_active"> - <return type="void"> + <method name="plane_shape_create"> + <return type="RID"> </return> - <argument index="0" name="active" type="bool"> - </argument> <description> - Activates or deactivates the 3D physics engine. </description> </method> - <method name="shape_create"> + <method name="ray_shape_create"> <return type="RID"> </return> - <argument index="0" name="type" type="int" enum="PhysicsServer3D.ShapeType"> + <description> + </description> + </method> + <method name="set_active"> + <return type="void"> + </return> + <argument index="0" name="active" type="bool"> </argument> <description> - Creates a shape of a type from [enum ShapeType]. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape]. + Activates or deactivates the 3D physics engine. </description> </method> <method name="shape_get_data" qualifiers="const"> @@ -1260,23 +1301,32 @@ Sets the value for a space parameter. A list of available parameters is on the [enum SpaceParameter] constants. </description> </method> + <method name="sphere_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> </methods> <constants> - <constant name="JOINT_PIN" value="0" enum="JointType"> + <constant name="JOINT_TYPE_PIN" value="0" enum="JointType"> The [Joint3D] is a [PinJoint3D]. </constant> - <constant name="JOINT_HINGE" value="1" enum="JointType"> + <constant name="JOINT_TYPE_HINGE" value="1" enum="JointType"> The [Joint3D] is a [HingeJoint3D]. </constant> - <constant name="JOINT_SLIDER" value="2" enum="JointType"> + <constant name="JOINT_TYPE_SLIDER" value="2" enum="JointType"> The [Joint3D] is a [SliderJoint3D]. </constant> - <constant name="JOINT_CONE_TWIST" value="3" enum="JointType"> + <constant name="JOINT_TYPE_CONE_TWIST" value="3" enum="JointType"> The [Joint3D] is a [ConeTwistJoint3D]. </constant> - <constant name="JOINT_6DOF" value="4" enum="JointType"> + <constant name="JOINT_TYPE_6DOF" value="4" enum="JointType"> The [Joint3D] is a [Generic6DOFJoint3D]. </constant> + <constant name="JOINT_TYPE_MAX" value="5" enum="JointType"> + Represents the size of the [enum JointType] enum. + </constant> <constant name="PIN_JOINT_BIAS" value="0" enum="PinJointParam"> The strength with which the pinned objects try to stay in positional relation to each other. The higher, the stronger. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index d810774b25..51ec509a14 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -744,6 +744,10 @@ <theme_item name="hseparation" type="int" default="4"> The horizontal space between the item's name and the shortcut text/submenu arrow. </theme_item> + <theme_item name="item_end_padding" type="int" default="2"> + </theme_item> + <theme_item name="item_start_padding" type="int" default="2"> + </theme_item> <theme_item name="labeled_separator_left" type="StyleBox"> [StyleBox] for the left side of labeled separator. See [method add_separator]. </theme_item> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index be72f83406..b056eff658 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -289,31 +289,31 @@ <member name="application/run/main_scene" type="String" setter="" getter="" default=""""> Path to the main scene file that will be loaded when the project runs. </member> - <member name="audio/channel_disable_threshold_db" type="float" setter="" getter="" default="-60.0"> + <member name="audio/buses/channel_disable_threshold_db" type="float" setter="" getter="" default="-60.0"> Audio buses will disable automatically when sound goes below a given dB threshold for a given time. This saves CPU as effects assigned to that bus will no longer do any processing. </member> - <member name="audio/channel_disable_time" type="float" setter="" getter="" default="2.0"> + <member name="audio/buses/channel_disable_time" type="float" setter="" getter="" default="2.0"> Audio buses will disable automatically when sound goes below a given dB threshold for a given time. This saves CPU as effects assigned to that bus will no longer do any processing. </member> - <member name="audio/default_bus_layout" type="String" setter="" getter="" default=""res://default_bus_layout.tres""> + <member name="audio/buses/default_bus_layout" type="String" setter="" getter="" default=""res://default_bus_layout.tres""> Default [AudioBusLayout] resource file to use in the project, unless overridden by the scene. </member> - <member name="audio/driver" type="String" setter="" getter=""> + <member name="audio/driver/driver" type="String" setter="" getter=""> Specifies the audio driver to use. This setting is platform-dependent as each platform supports different audio drivers. If left empty, the default audio driver will be used. </member> - <member name="audio/enable_audio_input" type="bool" setter="" getter="" default="false"> + <member name="audio/driver/enable_input" type="bool" setter="" getter="" default="false"> If [code]true[/code], microphone input will be allowed. This requires appropriate permissions to be set when exporting to Android or iOS. </member> - <member name="audio/mix_rate" type="int" setter="" getter="" default="44100"> + <member name="audio/driver/mix_rate" type="int" setter="" getter="" default="44100"> Mixing rate used for audio. In general, it's better to not touch this and leave it to the host operating system. </member> - <member name="audio/output_latency" type="int" setter="" getter="" default="15"> + <member name="audio/driver/output_latency" type="int" setter="" getter="" default="15"> Output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware. </member> - <member name="audio/output_latency.web" type="int" setter="" getter="" default="50"> - Safer override for [member audio/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. + <member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50"> + Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. </member> - <member name="audio/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> + <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. </member> <member name="compression/formats/gzip/compression_level" type="int" setter="" getter="" default="-1"> @@ -331,6 +331,18 @@ <member name="compression/formats/zstd/window_log_size" type="int" setter="" getter="" default="27"> Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing. </member> + <member name="debug/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false"> + If [code]true[/code], logs all output to files. + </member> + <member name="debug/file_logging/enable_file_logging.pc" type="bool" setter="" getter="" default="true"> + Desktop override for [member debug/file_logging/enable_file_logging], as log files are not readily accessible on mobile/Web platforms. + </member> + <member name="debug/file_logging/log_path" type="String" setter="" getter="" default=""user://logs/godot.log""> + Path to logs within the project. Using an [code]user://[/code] path is recommended. + </member> + <member name="debug/file_logging/max_log_files" type="int" setter="" getter="" default="5"> + Specifies the maximum amount of log files allowed (used for rotation). + </member> <member name="debug/gdscript/completion/autocomplete_setters_and_getters" type="bool" setter="" getter="" default="false"> If [code]true[/code], displays getters and setters in autocompletion results in the script editor. This setting is meant to be used when porting old projects (Godot 2), as using member variables is the preferred style from Godot 3 onwards. </member> @@ -475,9 +487,6 @@ <member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true"> If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms. </member> - <member name="display/window/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false"> - Force layout direction and text writing direction to RTL for all locales. - </member> <member name="display/window/handheld/orientation" type="String" setter="" getter="" default=""landscape""> Default orientation on mobile devices. </member> @@ -513,12 +522,6 @@ <member name="display/window/size/width" type="int" setter="" getter="" default="1024"> Sets the game's main viewport width. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled. </member> - <member name="display/window/tablet_driver" type="String" setter="" getter=""> - Specifies the tablet driver to use. If left empty, the default driver will be used. - </member> - <member name="display/window/text_name" type="String" setter="" getter="" default=""""> - Specifies the [TextServer] to use. If left empty, the default will be used. - </member> <member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5). </member> @@ -526,12 +529,18 @@ If [code]Use Vsync[/code] is enabled and this setting is [code]true[/code], enables vertical synchronization via the operating system's window compositor when in windowed mode and the compositor is enabled. This will prevent stutter in certain situations. (Windows only.) [b]Note:[/b] This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. </member> - <member name="editor/script_templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> - Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. + <member name="editor/node_naming/name_casing" type="int" setter="" getter="" default="0"> + When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. + </member> + <member name="editor/node_naming/name_num_separator" type="int" setter="" getter="" default="0"> + What to use to separate node name from number. This is mostly an editor setting. </member> - <member name="editor/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( "gd", "shader" )"> + <member name="editor/script/search_in_file_extensions" type="PackedStringArray" setter="" getter="" default="PackedStringArray( "gd", "shader" )"> Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files. </member> + <member name="editor/script/templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> + Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. + </member> <member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0"> Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. </member> @@ -566,6 +575,10 @@ Default [InputEventAction] to discard a modal or pending input. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_copy" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_cut" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_down" type="Dictionary" setter="" getter=""> Default [InputEventAction] to move down in the UI. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -574,6 +587,12 @@ Default [InputEventAction] to go to the end position of a [Control] (e.g. last item in an [ItemList] or a [Tree]), matching the behavior of [constant KEY_END] on typical desktop UI systems. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_filedialog_refresh" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_filedialog_show_hidden" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_filedialog_up_one_level" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_focus_next" type="Dictionary" setter="" getter=""> Default [InputEventAction] to focus the next [Control] in the scene. The focus behavior can be configured via [member Control.focus_next]. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -582,6 +601,10 @@ Default [InputEventAction] to focus the previous [Control] in the scene. The focus behavior can be configured via [member Control.focus_previous]. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_graph_delete" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_graph_duplicate" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_home" type="Dictionary" setter="" getter=""> Default [InputEventAction] to go to the start position of a [Control] (e.g. first item in an [ItemList] or a [Tree]), matching the behavior of [constant KEY_HOME] on typical desktop UI systems. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -590,6 +613,8 @@ Default [InputEventAction] to move left in the UI. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_menu" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_page_down" type="Dictionary" setter="" getter=""> Default [InputEventAction] to go down a page in a [Control] (e.g. in an [ItemList] or a [Tree]), matching the behavior of [constant KEY_PAGEDOWN] on typical desktop UI systems. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -598,6 +623,10 @@ Default [InputEventAction] to go up a page in a [Control] (e.g. in an [ItemList] or a [Tree]), matching the behavior of [constant KEY_PAGEUP] on typical desktop UI systems. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_paste" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_redo" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_right" type="Dictionary" setter="" getter=""> Default [InputEventAction] to move right in the UI. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. @@ -606,10 +635,102 @@ Default [InputEventAction] to select an item in a [Control] (e.g. in an [ItemList] or a [Tree]). [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input/ui_swap_input_direction" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_backspace" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_backspace_all_to_left" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_backspace_all_to_left.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_backspace_word" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_backspace_word.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_document_end" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_document_end.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_document_start" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_document_start.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_down" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_left" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_line_end" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_line_end.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_line_start" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_line_start.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_page_down" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_page_up" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_right" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_up" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_word_left" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_word_left.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_word_right" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_caret_word_right.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_completion_accept" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_completion_query" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_dedent" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_delete" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_delete_all_to_right" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_delete_all_to_right.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_delete_word" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_delete_word.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_indent" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_newline" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_newline_above" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_newline_blank" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_scroll_down" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_scroll_down.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_scroll_up" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_scroll_up.OSX" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_select_all" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_text_toggle_insert_mode" type="Dictionary" setter="" getter=""> + </member> + <member name="input/ui_undo" type="Dictionary" setter="" getter=""> + </member> <member name="input/ui_up" type="Dictionary" setter="" getter=""> Default [InputEventAction] to move up in the UI. [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified. </member> + <member name="input_devices/pen_tablet/driver" type="String" setter="" getter=""> + Specifies the tablet driver to use. If left empty, the default driver will be used. + </member> + <member name="input_devices/pen_tablet/driver.windows" type="String" setter="" getter=""> + Override for [member input_devices/pen_tablet/driver] on Windows. + </member> <member name="input_devices/pointing/emulate_mouse_from_touch" type="bool" setter="" getter="" default="true"> If [code]true[/code], sends mouse input events when tapping or swiping on the touchscreen. </member> @@ -619,6 +740,18 @@ <member name="input_devices/pointing/ios/touch_delay" type="float" setter="" getter="" default="0.15"> Default delay for touch events. This only affects iOS devices. </member> + <member name="internationalization/locale/fallback" type="String" setter="" getter="" default=""en""> + The locale to fall back to if a translation isn't available in a given language. If left empty, [code]en[/code] (English) will be used. + </member> + <member name="internationalization/locale/test" type="String" setter="" getter="" default=""""> + If non-empty, this locale will be used when running the project from the editor. + </member> + <member name="internationalization/rendering/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false"> + Force layout direction and text writing direction to RTL for all locales. + </member> + <member name="internationalization/rendering/text_driver" type="String" setter="" getter="" default=""""> + Specifies the [TextServer] to use. If left empty, the default will be used. + </member> <member name="layer_names/2d_physics/layer_0" type="String" setter="" getter="" default=""""> Optional name for the 2D physics layer 0. If left empty, the layer will display as "Layer 0". </member> @@ -859,24 +992,6 @@ <member name="layer_names/3d_render/layer_9" type="String" setter="" getter="" default=""""> Optional name for the 3D render layer 9. If left empty, the layer will display as "Layer 9". </member> - <member name="locale/fallback" type="String" setter="" getter="" default=""en""> - The locale to fall back to if a translation isn't available in a given language. If left empty, [code]en[/code] (English) will be used. - </member> - <member name="locale/test" type="String" setter="" getter="" default=""""> - If non-empty, this locale will be used when running the project from the editor. - </member> - <member name="logging/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false"> - If [code]true[/code], logs all output to files. - </member> - <member name="logging/file_logging/enable_file_logging.pc" type="bool" setter="" getter="" default="true"> - Desktop override for [member logging/file_logging/enable_file_logging], as log files are not readily accessible on mobile/Web platforms. - </member> - <member name="logging/file_logging/log_path" type="String" setter="" getter="" default=""user://logs/godot.log""> - Path to logs within the project. Using an [code]user://[/code] path is recommended. - </member> - <member name="logging/file_logging/max_log_files" type="int" setter="" getter="" default="5"> - Specifies the maximum amount of log files allowed (used for rotation). - </member> <member name="memory/limits/command_queue/multithreading_queue_size_kb" type="int" setter="" getter="" default="256"> </member> <member name="memory/limits/message_queue/max_size_kb" type="int" setter="" getter="" default="4096"> @@ -930,12 +1045,6 @@ The CA certificates bundle to use for SSL connections. If this is set to a non-empty value, this will [i]override[/i] Godot's default [url=https://github.com/godotengine/godot/blob/master/thirdparty/certs/ca-certificates.crt]Mozilla certificate bundle[/url]. If left empty, the default certificate bundle will be used. If in doubt, leave this setting empty. </member> - <member name="node/name_casing" type="int" setter="" getter="" default="0"> - When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. - </member> - <member name="node/name_num_separator" type="int" setter="" getter="" default="0"> - What to use to separate node name from number. This is mostly an editor setting. - </member> <member name="physics/2d/bp_hash_table_size" type="int" setter="" getter="" default="4096"> Size of the hash table used for the broad-phase 2D hash grid algorithm. </member> @@ -985,22 +1094,18 @@ Sets which physics engine to use for 2D physics. "DEFAULT" and "GodotPhysics2D" are the same, as there is currently no alternative 2D physics server implemented. </member> + <member name="physics/2d/run_on_thread" type="bool" setter="" getter="" default="false"> + Sets whether 2D physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. + </member> <member name="physics/2d/sleep_threshold_angular" type="float" setter="" getter="" default="0.139626"> Threshold angular velocity under which a 2D physics body will be considered inactive. See [constant PhysicsServer2D.SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD]. </member> <member name="physics/2d/sleep_threshold_linear" type="float" setter="" getter="" default="2.0"> Threshold linear velocity under which a 2D physics body will be considered inactive. See [constant PhysicsServer2D.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD]. </member> - <member name="physics/2d/thread_model" type="int" setter="" getter="" default="1"> - Sets whether physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. - [b]Warning:[/b] As of Godot 3.2, there are mixed reports about the use of a Multi-Threaded thread model for physics. Be sure to assess whether it does give you extra performance and no regressions when using it. - </member> <member name="physics/2d/time_before_sleep" type="float" setter="" getter="" default="0.5"> Time (in seconds) of inactivity before which a 2D physics body will put to sleep. See [constant PhysicsServer2D.SPACE_PARAM_BODY_TIME_TO_SLEEP]. </member> - <member name="physics/3d/active_soft_world" type="bool" setter="" getter="" default="true"> - Sets whether the 3D physics world will be created with support for [SoftBody3D] physics. Only applies to the Bullet physics engine. - </member> <member name="physics/3d/default_angular_damp" type="float" setter="" getter="" default="0.1"> The default angular damp in 3D. [b]Note:[/b] Good values are in the range [code]0[/code] to [code]1[/code]. At value [code]0[/code] objects will keep moving with the same velocity. Values greater than [code]1[/code] will aim to reduce the velocity to [code]0[/code] in less than a second e.g. a value of [code]2[/code] will aim to reduce the velocity to [code]0[/code] in half a second. A value equal to or greater than the physics frame rate ([member ProjectSettings.physics/common/physics_fps], [code]60[/code] by default) will bring the object to a stop in one iteration. @@ -1041,6 +1146,15 @@ Sets which physics engine to use for 3D physics. "DEFAULT" is currently the [url=https://bulletphysics.org]Bullet[/url] physics engine. The "GodotPhysics3D" engine is still supported as an alternative. </member> + <member name="physics/3d/run_on_thread" type="bool" setter="" getter="" default="false"> + Sets whether 3D physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. + </member> + <member name="physics/3d/sleep_threshold_angular" type="float" setter="" getter="" default="0.139626"> + </member> + <member name="physics/3d/sleep_threshold_linear" type="float" setter="" getter="" default="0.1"> + </member> + <member name="physics/3d/time_before_sleep" type="float" setter="" getter="" default="0.5"> + </member> <member name="physics/common/enable_object_picking" type="bool" setter="" getter="" default="true"> Enables [member Viewport.physics_object_picking] on the root viewport. </member> @@ -1052,276 +1166,269 @@ Fix to improve physics jitter, specially on monitors where refresh rate is different than the physics FPS. [b]Note:[/b] This property is only read when the project starts. To change the physics FPS at runtime, set [member Engine.physics_jitter_fix] instead. </member> - <member name="rendering/cluster_builder/max_clustered_elements" type="float" setter="" getter="" default="512"> + <member name="rendering/2d/sdf/oversize" type="int" setter="" getter="" default="1"> </member> - <member name="rendering/environment/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )"> - Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color]. - </member> - <member name="rendering/environment/default_environment" type="String" setter="" getter="" default=""""> - [Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here. + <member name="rendering/2d/sdf/scale" type="int" setter="" getter="" default="1"> </member> - <member name="rendering/forward_renderer/threaded_render_minimum_instances" type="int" setter="" getter="" default="500"> + <member name="rendering/2d/shadow_atlas/size" type="int" setter="" getter="" default="2048"> </member> - <member name="rendering/gpu_lightmapper/performance/max_rays_per_pass" type="int" setter="" getter="" default="32"> + <member name="rendering/2d/snap/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/gpu_lightmapper/performance/max_rays_per_probe_pass" type="int" setter="" getter="" default="64"> + <member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/gpu_lightmapper/performance/region_size" type="int" setter="" getter="" default="512"> - </member> - <member name="rendering/gpu_lightmapper/quality/high_quality_probe_ray_count" type="int" setter="" getter="" default="512"> + <member name="rendering/anti_aliasing/quality/msaa" type="int" setter="" getter="" default="0"> + Sets the number of MSAA samples to use (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. </member> - <member name="rendering/gpu_lightmapper/quality/high_quality_ray_count" type="int" setter="" getter="" default="256"> + <member name="rendering/anti_aliasing/quality/screen_space_aa" type="int" setter="" getter="" default="0"> + Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. + Another way to combat specular aliasing is to enable [member rendering/anti_aliasing/screen_space_roughness_limiter/enabled]. </member> - <member name="rendering/gpu_lightmapper/quality/low_quality_probe_ray_count" type="int" setter="" getter="" default="64"> + <member name="rendering/anti_aliasing/quality/use_debanding" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/gpu_lightmapper/quality/low_quality_ray_count" type="int" setter="" getter="" default="16"> + <member name="rendering/anti_aliasing/screen_space_roughness_limiter/amount" type="float" setter="" getter="" default="0.25"> </member> - <member name="rendering/gpu_lightmapper/quality/medium_quality_probe_ray_count" type="int" setter="" getter="" default="256"> + <member name="rendering/anti_aliasing/screen_space_roughness_limiter/enabled" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/gpu_lightmapper/quality/medium_quality_ray_count" type="int" setter="" getter="" default="64"> + <member name="rendering/anti_aliasing/screen_space_roughness_limiter/limit" type="float" setter="" getter="" default="0.18"> </member> - <member name="rendering/gpu_lightmapper/quality/ultra_quality_probe_ray_count" type="int" setter="" getter="" default="2048"> + <member name="rendering/camera/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2"> + Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. </member> - <member name="rendering/gpu_lightmapper/quality/ultra_quality_ray_count" type="int" setter="" getter="" default="1024"> + <member name="rendering/camera/depth_of_field/depth_of_field_bokeh_shape" type="int" setter="" getter="" default="1"> + Sets the depth of field shape. Can be Box, Hexagon, or Circle. Box is the fastest. Circle is the most realistic, but also the most expensive to compute. </member> - <member name="rendering/high_end/global_shader_variables_buffer_size" type="int" setter="" getter="" default="65536"> + <member name="rendering/camera/depth_of_field/depth_of_field_use_jitter" type="bool" setter="" getter="" default="false"> + If [code]true[/code], jitters DOF samples to make effect slightly blurrier and hide lines created from low sample rates. This can result in a slightly grainy appearance when used with a low number of samples. </member> - <member name="rendering/lightmapper/probe_capture_update_speed" type="float" setter="" getter="" default="15"> + <member name="rendering/driver/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default=""PowerVR,Mali,Adreno,Apple""> + Disables depth pre-pass for some GPU vendors (usually mobile), as their architecture already does this. </member> - <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> + <member name="rendering/driver/depth_prepass/enable" type="bool" setter="" getter="" default="true"> + If [code]true[/code], performs a previous depth pass before rendering materials. This increases performance in scenes with high overdraw, when complex materials and lighting are used. </member> - <member name="rendering/quality/2d/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false"> + <member name="rendering/driver/driver_name" type="String" setter="" getter="" default=""Vulkan""> + The video driver to use (currently only "Vulkan" is implemented). + [b]Note:[/b] The backend in use can be overridden at runtime via the [code]--rendering-driver[/code] command line argument. + [b]FIXME:[/b] No longer valid after DisplayServer split: + In such cases, this property is not updated, so use [code]OS.get_current_video_driver[/code] to query it at run-time. </member> - <member name="rendering/quality/2d/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> + <member name="rendering/driver/rd_renderer/use_low_end_renderer" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/quality/2d_sdf/oversize" type="int" setter="" getter="" default="1"> + <member name="rendering/driver/rd_renderer/use_low_end_renderer.mobile" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/quality/2d_sdf/scale" type="int" setter="" getter="" default="1"> + <member name="rendering/driver/threads/thread_model" type="int" setter="" getter="" default="1"> + Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. </member> - <member name="rendering/quality/2d_shadow_atlas/size" type="int" setter="" getter="" default="2048"> + <member name="rendering/environment/defaults/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )"> + Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color]. </member> - <member name="rendering/quality/depth_of_field/depth_of_field_bokeh_quality" type="int" setter="" getter="" default="2"> - Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. + <member name="rendering/environment/defaults/default_environment" type="String" setter="" getter="" default=""""> + [Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here. </member> - <member name="rendering/quality/depth_of_field/depth_of_field_bokeh_shape" type="int" setter="" getter="" default="1"> - Sets the depth of field shape. Can be Box, Hexagon, or Circle. Box is the fastest. Circle is the most realistic, but also the most expensive to compute. + <member name="rendering/environment/glow/upscale_mode" type="int" setter="" getter="" default="1"> + Sets how the glow effect is upscaled before being copied onto the screen. Linear is faster, but looks blocky. Bicubic is slower but looks smooth. </member> - <member name="rendering/quality/depth_of_field/depth_of_field_use_jitter" type="bool" setter="" getter="" default="false"> - If [code]true[/code], jitters DOF samples to make effect slightly blurrier and hide lines created from low sample rates. This can result in a slightly grainy appearance when used with a low number of samples. + <member name="rendering/environment/glow/upscale_mode.mobile" type="int" setter="" getter="" default="0"> + Lower-end override for [member rendering/environment/glow/upscale_mode] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default=""PowerVR,Mali,Adreno,Apple""> - Disables depth pre-pass for some GPU vendors (usually mobile), as their architecture already does this. + <member name="rendering/environment/glow/use_high_quality" type="bool" setter="" getter="" default="false"> + Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. </member> - <member name="rendering/quality/depth_prepass/enable" type="bool" setter="" getter="" default="true"> - If [code]true[/code], performs a previous depth pass before rendering materials. This increases performance in scenes with high overdraw, when complex materials and lighting are used. + <member name="rendering/environment/screen_space_reflection/roughness_quality" type="int" setter="" getter="" default="1"> + Sets the quality for rough screen-space reflections. Turning off will make all screen space reflections sharp, while higher values make rough reflections look better. </member> - <member name="rendering/quality/directional_shadow/16_bits" type="bool" setter="" getter="" default="true"> + <member name="rendering/environment/ssao/adaptive_target" type="float" setter="" getter="" default="0.5"> + Quality target to use when [member rendering/environment/ssao/quality] is set to [code]ULTRA[/code]. A value of [code]0.0[/code] provides a quality and speed similar to [code]MEDIUM[/code] while a value of [code]1.0[/code] provides much higher quality than any of the other settings at the cost of performance. </member> - <member name="rendering/quality/directional_shadow/size" type="int" setter="" getter="" default="4096"> - The directional shadow's size in pixels. Higher values will result in sharper shadows, at the cost of performance. The value will be rounded up to the nearest power of 2. + <member name="rendering/environment/ssao/blur_passes" type="int" setter="" getter="" default="2"> + Number of blur passes to use when computing screen-space ambient occlusion. A higher number will result in a smoother look, but will be slower to compute and will have less high-frequency detail. </member> - <member name="rendering/quality/directional_shadow/size.mobile" type="int" setter="" getter="" default="2048"> - Lower-end override for [member rendering/quality/directional_shadow/size] on mobile devices, due to performance concerns or driver support. + <member name="rendering/environment/ssao/fadeout_from" type="float" setter="" getter="" default="50.0"> + Distance at which the screen-space ambient occlusion effect starts to fade out. Use this hide ambient occlusion at great distances. </member> - <member name="rendering/quality/directional_shadow/soft_shadow_quality" type="int" setter="" getter="" default="2"> - Quality setting for shadows cast by [DirectionalLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. + <member name="rendering/environment/ssao/fadeout_to" type="float" setter="" getter="" default="300.0"> + Distance at which the screen-space ambient occlusion is fully faded out. Use this hide ambient occlusion at great distances. </member> - <member name="rendering/quality/directional_shadow/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> - Lower-end override for [member rendering/quality/directional_shadow/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. + <member name="rendering/environment/ssao/half_size" type="bool" setter="" getter="" default="false"> + If [code]true[/code], screen-space ambient occlusion will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details. </member> - <member name="rendering/quality/driver/driver_name" type="String" setter="" getter="" default=""Vulkan""> - The video driver to use ("GLES2" or "Vulkan"). - [b]Note:[/b] The backend in use can be overridden at runtime via the [code]--rendering-driver[/code] command line argument. - [b]FIXME:[/b] No longer valid after DisplayServer split: - In such cases, this property is not updated, so use [code]OS.get_current_video_driver[/code] to query it at run-time. + <member name="rendering/environment/ssao/half_size.mobile" type="bool" setter="" getter="" default="true"> + Lower-end override for [member rendering/environment/ssao/half_size] on mobile devices, due to performance concerns. </member> - <member name="rendering/quality/gi/use_half_resolution" type="bool" setter="" getter="" default="false"> + <member name="rendering/environment/ssao/quality" type="int" setter="" getter="" default="2"> + Sets the quality of the screen-space ambient occlusion effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]ULTRA[/code] will use the [member rendering/environment/ssao/adaptive_target] setting. </member> - <member name="rendering/quality/gi_probes/anisotropic" type="bool" setter="" getter="" default="false"> - If [code]true[/code], take additional samples when rendering objects affected by a [GIProbe] to reduce artifacts from only sampling in one direction. + <member name="rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale" type="float" setter="" getter="" default="0.01"> + Scales the depth over which the subsurface scattering effect is applied. A high value may allow light to scatter into a part of the mesh or another mesh that is close in screen space but far in depth. </member> - <member name="rendering/quality/gi_probes/quality" type="int" setter="" getter="" default="1"> - Sets the number of cone samples taken when rendering objects affected by [GIProbe]s. + <member name="rendering/environment/subsurface_scattering/subsurface_scattering_quality" type="int" setter="" getter="" default="1"> + Sets the quality of the subsurface scattering effect. Higher values are slower but look nicer. </member> - <member name="rendering/quality/glow/upscale_mode" type="int" setter="" getter="" default="1"> - Sets how the glow effect is upscaled before being copied onto the screen. Linear is faster, but looks blocky. Bicubic is slower but looks smooth. + <member name="rendering/environment/subsurface_scattering/subsurface_scattering_scale" type="float" setter="" getter="" default="0.05"> + Scales the distance over which samples are taken for subsurface scattering effect. Changing this does not impact performance, but higher values will result in significant artifacts as the samples will become obviously spread out. A lower value results in a smaller spread of scattered light. </member> - <member name="rendering/quality/glow/upscale_mode.mobile" type="int" setter="" getter="" default="0"> - Lower-end override for [member rendering/quality/glow/upscale_mode] on mobile devices, due to performance concerns or driver support. + <member name="rendering/environment/volumetric_fog/use_filter" type="int" setter="" getter="" default="1"> </member> - <member name="rendering/quality/glow/use_high_quality" type="bool" setter="" getter="" default="false"> - Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. + <member name="rendering/environment/volumetric_fog/volume_depth" type="int" setter="" getter="" default="128"> </member> - <member name="rendering/quality/intended_usage/framebuffer_allocation" type="int" setter="" getter="" default="2"> - Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects will not be available in the [Environment]. + <member name="rendering/environment/volumetric_fog/volume_size" type="int" setter="" getter="" default="64"> </member> - <member name="rendering/quality/intended_usage/framebuffer_allocation.mobile" type="int" setter="" getter="" default="3"> - Lower-end override for [member rendering/quality/intended_usage/framebuffer_allocation] on mobile devices, due to performance concerns or driver support. + <member name="rendering/global_illumination/gi/use_half_resolution" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/quality/mesh_lod/threshold_pixels" type="float" setter="" getter="" default="1.0"> + <member name="rendering/global_illumination/gi_probes/anisotropic" type="bool" setter="" getter="" default="false"> + If [code]true[/code], take additional samples when rendering objects affected by a [GIProbe] to reduce artifacts from only sampling in one direction. </member> - <member name="rendering/quality/rd_renderer/use_low_end_renderer" type="bool" setter="" getter="" default="false"> + <member name="rendering/global_illumination/gi_probes/quality" type="int" setter="" getter="" default="1"> + Sets the number of cone samples taken when rendering objects affected by [GIProbe]s. </member> - <member name="rendering/quality/rd_renderer/use_low_end_renderer.mobile" type="bool" setter="" getter="" default="true"> + <member name="rendering/global_illumination/sdfgi/frames_to_converge" type="int" setter="" getter="" default="4"> </member> - <member name="rendering/quality/reflection_atlas/reflection_count" type="int" setter="" getter="" default="64"> - Number of cubemaps to store in the reflection atlas. The number of [ReflectionProbe]s in a scene will be limited by this amount. A higher number requires more VRAM. + <member name="rendering/global_illumination/sdfgi/frames_to_update_lights" type="int" setter="" getter="" default="2"> </member> - <member name="rendering/quality/reflection_atlas/reflection_size" type="int" setter="" getter="" default="256"> - Size of cubemap faces for [ReflectionProbe]s. A higher number requires more VRAM and may make reflection probe updating slower. + <member name="rendering/global_illumination/sdfgi/probe_ray_count" type="int" setter="" getter="" default="1"> </member> - <member name="rendering/quality/reflection_atlas/reflection_size.mobile" type="int" setter="" getter="" default="128"> - Lower-end override for [member rendering/quality/reflection_atlas/reflection_size] on mobile devices, due to performance concerns or driver support. + <member name="rendering/lightmapping/bake_performance/max_rays_per_pass" type="int" setter="" getter="" default="32"> </member> - <member name="rendering/quality/reflections/fast_filter_high_quality" type="bool" setter="" getter="" default="false"> - Use a higher quality variant of the fast filtering algorithm. Significantly slower than using default quality, but results in smoother reflections. Should only be used when the scene is especially detailed. + <member name="rendering/lightmapping/bake_performance/max_rays_per_probe_pass" type="int" setter="" getter="" default="64"> </member> - <member name="rendering/quality/reflections/ggx_samples" type="int" setter="" getter="" default="1024"> - Sets the number of samples to take when using importance sampling for [Sky]s and [ReflectionProbe]s. A higher value will result in smoother, higher quality reflections, but increases time to calculate radiance maps. In general, fewer samples are needed for simpler, low dynamic range environments while more samples are needed for HDR environments and environments with a high level of detail. + <member name="rendering/lightmapping/bake_performance/region_size" type="int" setter="" getter="" default="512"> </member> - <member name="rendering/quality/reflections/ggx_samples.mobile" type="int" setter="" getter="" default="128"> - Lower-end override for [member rendering/quality/reflections/ggx_samples] on mobile devices, due to performance concerns or driver support. + <member name="rendering/lightmapping/bake_quality/high_quality_probe_ray_count" type="int" setter="" getter="" default="512"> </member> - <member name="rendering/quality/reflections/roughness_layers" type="int" setter="" getter="" default="8"> - Limits the number of layers to use in radiance maps when using importance sampling. A lower number will be slightly faster and take up less VRAM. + <member name="rendering/lightmapping/bake_quality/high_quality_ray_count" type="int" setter="" getter="" default="256"> </member> - <member name="rendering/quality/reflections/texture_array_reflections" type="bool" setter="" getter="" default="true"> - If [code]true[/code], uses texture arrays instead of mipmaps for reflection probes and panorama backgrounds (sky). This reduces jitter noise and upscaling artifacts on reflections, but is significantly slower to compute and uses [member rendering/quality/reflections/roughness_layers] times more memory. + <member name="rendering/lightmapping/bake_quality/low_quality_probe_ray_count" type="int" setter="" getter="" default="64"> </member> - <member name="rendering/quality/reflections/texture_array_reflections.mobile" type="bool" setter="" getter="" default="false"> - Lower-end override for [member rendering/quality/reflections/texture_array_reflections] on mobile devices, due to performance concerns or driver support. + <member name="rendering/lightmapping/bake_quality/low_quality_ray_count" type="int" setter="" getter="" default="16"> </member> - <member name="rendering/quality/screen_filters/msaa" type="int" setter="" getter="" default="0"> - Sets the number of MSAA samples to use (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. - [b]Note:[/b] MSAA is not available on HTML5 export using the GLES2 backend. + <member name="rendering/lightmapping/bake_quality/medium_quality_probe_ray_count" type="int" setter="" getter="" default="256"> </member> - <member name="rendering/quality/screen_filters/screen_space_aa" type="int" setter="" getter="" default="0"> - Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. - Another way to combat specular aliasing is to enable [member rendering/quality/screen_filters/screen_space_roughness_limiter_enabled]. + <member name="rendering/lightmapping/bake_quality/medium_quality_ray_count" type="int" setter="" getter="" default="64"> </member> - <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_amount" type="float" setter="" getter="" default="0.25"> + <member name="rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count" type="int" setter="" getter="" default="2048"> </member> - <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_enabled" type="bool" setter="" getter="" default="true"> + <member name="rendering/lightmapping/bake_quality/ultra_quality_ray_count" type="int" setter="" getter="" default="1024"> </member> - <member name="rendering/quality/screen_filters/screen_space_roughness_limiter_limit" type="float" setter="" getter="" default="0.18"> + <member name="rendering/lightmapping/probe_capture/update_speed" type="float" setter="" getter="" default="15"> </member> - <member name="rendering/quality/screen_filters/use_debanding" type="bool" setter="" getter="" default="false"> + <member name="rendering/limits/cluster_builder/max_clustered_elements" type="float" setter="" getter="" default="512"> </member> - <member name="rendering/quality/screen_space_reflection/roughness_quality" type="int" setter="" getter="" default="1"> - Sets the quality for rough screen-space reflections. Turning off will make all screen space reflections sharp, while higher values make rough reflections look better. + <member name="rendering/limits/forward_renderer/threaded_render_minimum_instances" type="int" setter="" getter="" default="500"> </member> - <member name="rendering/quality/shading/force_blinn_over_ggx" type="bool" setter="" getter="" default="false"> - If [code]true[/code], uses faster but lower-quality Blinn model to generate blurred reflections instead of the GGX model. + <member name="rendering/limits/global_shader_variables/buffer_size" type="int" setter="" getter="" default="65536"> </member> - <member name="rendering/quality/shading/force_blinn_over_ggx.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/quality/shading/force_blinn_over_ggx] on mobile devices, due to performance concerns or driver support. + <member name="rendering/limits/spatial_indexer/threaded_cull_minimum_instances" type="int" setter="" getter="" default="1000"> </member> - <member name="rendering/quality/shading/force_lambert_over_burley" type="bool" setter="" getter="" default="false"> - If [code]true[/code], uses faster but lower-quality Lambert material lighting model instead of Burley. + <member name="rendering/limits/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10"> </member> - <member name="rendering/quality/shading/force_lambert_over_burley.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/quality/shading/force_lambert_over_burley] on mobile devices, due to performance concerns or driver support. + <member name="rendering/limits/time/time_rollover_secs" type="float" setter="" getter="" default="3600"> </member> - <member name="rendering/quality/shading/force_vertex_shading" type="bool" setter="" getter="" default="false"> - If [code]true[/code], forces vertex shading for all rendering. This can increase performance a lot, but also reduces quality immensely. Can be used to optimize performance on low-end mobile devices. + <member name="rendering/mesh_lod/lod_change/threshold_pixels" type="float" setter="" getter="" default="1.0"> </member> - <member name="rendering/quality/shading/force_vertex_shading.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/quality/shading/force_vertex_shading] on mobile devices, due to performance concerns or driver support. + <member name="rendering/reflections/reflection_atlas/reflection_count" type="int" setter="" getter="" default="64"> + Number of cubemaps to store in the reflection atlas. The number of [ReflectionProbe]s in a scene will be limited by this amount. A higher number requires more VRAM. </member> - <member name="rendering/quality/shadow_atlas/16_bits" type="bool" setter="" getter="" default="true"> + <member name="rendering/reflections/reflection_atlas/reflection_size" type="int" setter="" getter="" default="256"> + Size of cubemap faces for [ReflectionProbe]s. A higher number requires more VRAM and may make reflection probe updating slower. </member> - <member name="rendering/quality/shadow_atlas/quadrant_0_subdiv" type="int" setter="" getter="" default="2"> - Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + <member name="rendering/reflections/reflection_atlas/reflection_size.mobile" type="int" setter="" getter="" default="128"> + Lower-end override for [member rendering/reflections/reflection_atlas/reflection_size] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/shadow_atlas/quadrant_1_subdiv" type="int" setter="" getter="" default="2"> - Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + <member name="rendering/reflections/sky_reflections/fast_filter_high_quality" type="bool" setter="" getter="" default="false"> + Use a higher quality variant of the fast filtering algorithm. Significantly slower than using default quality, but results in smoother reflections. Should only be used when the scene is especially detailed. </member> - <member name="rendering/quality/shadow_atlas/quadrant_2_subdiv" type="int" setter="" getter="" default="3"> - Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + <member name="rendering/reflections/sky_reflections/ggx_samples" type="int" setter="" getter="" default="1024"> + Sets the number of samples to take when using importance sampling for [Sky]s and [ReflectionProbe]s. A higher value will result in smoother, higher quality reflections, but increases time to calculate radiance maps. In general, fewer samples are needed for simpler, low dynamic range environments while more samples are needed for HDR environments and environments with a high level of detail. </member> - <member name="rendering/quality/shadow_atlas/quadrant_3_subdiv" type="int" setter="" getter="" default="4"> - Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + <member name="rendering/reflections/sky_reflections/ggx_samples.mobile" type="int" setter="" getter="" default="128"> + Lower-end override for [member rendering/reflections/sky_reflections/ggx_samples] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/shadow_atlas/size" type="int" setter="" getter="" default="4096"> - Size for shadow atlas (used for OmniLights and SpotLights). See documentation. + <member name="rendering/reflections/sky_reflections/roughness_layers" type="int" setter="" getter="" default="8"> + Limits the number of layers to use in radiance maps when using importance sampling. A lower number will be slightly faster and take up less VRAM. </member> - <member name="rendering/quality/shadow_atlas/size.mobile" type="int" setter="" getter="" default="2048"> - Lower-end override for [member rendering/quality/shadow_atlas/size] on mobile devices, due to performance concerns or driver support. + <member name="rendering/reflections/sky_reflections/texture_array_reflections" type="bool" setter="" getter="" default="true"> + If [code]true[/code], uses texture arrays instead of mipmaps for reflection probes and panorama backgrounds (sky). This reduces jitter noise and upscaling artifacts on reflections, but is significantly slower to compute and uses [member rendering/reflections/sky_reflections/roughness_layers] times more memory. </member> - <member name="rendering/quality/shadows/soft_shadow_quality" type="int" setter="" getter="" default="2"> - Quality setting for shadows cast by [OmniLight3D]s and [SpotLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. + <member name="rendering/reflections/sky_reflections/texture_array_reflections.mobile" type="bool" setter="" getter="" default="false"> + Lower-end override for [member rendering/reflections/sky_reflections/texture_array_reflections] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/shadows/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> - Lower-end override for [member rendering/quality/shadows/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. + <member name="rendering/shading/overrides/force_blinn_over_ggx" type="bool" setter="" getter="" default="false"> + If [code]true[/code], uses faster but lower-quality Blinn model to generate blurred reflections instead of the GGX model. </member> - <member name="rendering/quality/ssao/adaptive_target" type="float" setter="" getter="" default="0.5"> - Quality target to use when [member rendering/quality/ssao/quality] is set to [code]ULTRA[/code]. A value of [code]0.0[/code] provides a quality and speed similar to [code]MEDIUM[/code] while a value of [code]1.0[/code] provides much higher quality than any of the other settings at the cost of performance. + <member name="rendering/shading/overrides/force_blinn_over_ggx.mobile" type="bool" setter="" getter="" default="true"> + Lower-end override for [member rendering/shading/overrides/force_blinn_over_ggx] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/ssao/blur_passes" type="int" setter="" getter="" default="2"> - Number of blur passes to use when computing screen-space ambient occlusion. A higher number will result in a smoother look, but will be slower to compute and will have less high-frequency detail. + <member name="rendering/shading/overrides/force_lambert_over_burley" type="bool" setter="" getter="" default="false"> + If [code]true[/code], uses faster but lower-quality Lambert material lighting model instead of Burley. </member> - <member name="rendering/quality/ssao/fadeout_from" type="float" setter="" getter="" default="50.0"> - Distance at which the screen-space ambient occlusion effect starts to fade out. Use this hide ambient occlusion at great distances. + <member name="rendering/shading/overrides/force_lambert_over_burley.mobile" type="bool" setter="" getter="" default="true"> + Lower-end override for [member rendering/shading/overrides/force_lambert_over_burley] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/ssao/fadeout_to" type="float" setter="" getter="" default="300.0"> - Distance at which the screen-space ambient occlusion is fully faded out. Use this hide ambient occlusion at great distances. + <member name="rendering/shading/overrides/force_vertex_shading" type="bool" setter="" getter="" default="false"> + If [code]true[/code], forces vertex shading for all rendering. This can increase performance a lot, but also reduces quality immensely. Can be used to optimize performance on low-end mobile devices. </member> - <member name="rendering/quality/ssao/half_size" type="bool" setter="" getter="" default="false"> - If [code]true[/code], screen-space ambient occlusion will be rendered at half size and then upscaled before being added to the scene. This is significantly faster but may miss small details. + <member name="rendering/shading/overrides/force_vertex_shading.mobile" type="bool" setter="" getter="" default="true"> + Lower-end override for [member rendering/shading/overrides/force_vertex_shading] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/ssao/half_size.mobile" type="bool" setter="" getter="" default="true"> - Lower-end override for [member rendering/quality/ssao/half_size] on mobile devices, due to performance concerns. + <member name="rendering/shadows/directional_shadow/16_bits" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/quality/ssao/quality" type="int" setter="" getter="" default="2"> - Sets the quality of the screen-space ambient occlusion effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]ULTRA[/code] will use the [member rendering/quality/ssao/adaptive_target] setting. + <member name="rendering/shadows/directional_shadow/size" type="int" setter="" getter="" default="4096"> + The directional shadow's size in pixels. Higher values will result in sharper shadows, at the cost of performance. The value will be rounded up to the nearest power of 2. </member> - <member name="rendering/quality/subsurface_scattering/subsurface_scattering_depth_scale" type="float" setter="" getter="" default="0.01"> - Scales the depth over which the subsurface scattering effect is applied. A high value may allow light to scatter into a part of the mesh or another mesh that is close in screen space but far in depth. + <member name="rendering/shadows/directional_shadow/size.mobile" type="int" setter="" getter="" default="2048"> + Lower-end override for [member rendering/shadows/directional_shadow/size] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/subsurface_scattering/subsurface_scattering_quality" type="int" setter="" getter="" default="1"> - Sets the quality of the subsurface scattering effect. Higher values are slower but look nicer. + <member name="rendering/shadows/directional_shadow/soft_shadow_quality" type="int" setter="" getter="" default="2"> + Quality setting for shadows cast by [DirectionalLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. </member> - <member name="rendering/quality/subsurface_scattering/subsurface_scattering_scale" type="float" setter="" getter="" default="0.05"> - Scales the distance over which samples are taken for subsurface scattering effect. Changing this does not impact performance, but higher values will result in significant artifacts as the samples will become obviously spread out. A lower value results in a smaller spread of scattered light. + <member name="rendering/shadows/directional_shadow/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> + Lower-end override for [member rendering/shadows/directional_shadow/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/quality/texture_filters/anisotropic_filtering_level" type="int" setter="" getter="" default="2"> - Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of [code]0[/code] forcibly disables anisotropic filtering, even on materials where it is enabled. + <member name="rendering/shadows/shadow_atlas/16_bits" type="bool" setter="" getter="" default="true"> </member> - <member name="rendering/quality/texture_filters/use_nearest_mipmap_filter" type="bool" setter="" getter="" default="false"> - If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used. + <member name="rendering/shadows/shadow_atlas/quadrant_0_subdiv" type="int" setter="" getter="" default="2"> + Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/sdfgi/frames_to_converge" type="int" setter="" getter="" default="4"> + <member name="rendering/shadows/shadow_atlas/quadrant_1_subdiv" type="int" setter="" getter="" default="2"> + Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/sdfgi/frames_to_update_lights" type="int" setter="" getter="" default="2"> + <member name="rendering/shadows/shadow_atlas/quadrant_2_subdiv" type="int" setter="" getter="" default="3"> + Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/sdfgi/probe_ray_count" type="int" setter="" getter="" default="1"> + <member name="rendering/shadows/shadow_atlas/quadrant_3_subdiv" type="int" setter="" getter="" default="4"> + Subdivision quadrant size for shadow mapping. See shadow mapping documentation. </member> - <member name="rendering/spatial_indexer/threaded_cull_minimum_instances" type="int" setter="" getter="" default="1000"> + <member name="rendering/shadows/shadow_atlas/size" type="int" setter="" getter="" default="4096"> + Size for shadow atlas (used for OmniLights and SpotLights). See documentation. </member> - <member name="rendering/spatial_indexer/update_iterations_per_frame" type="int" setter="" getter="" default="10"> + <member name="rendering/shadows/shadow_atlas/size.mobile" type="int" setter="" getter="" default="2048"> + Lower-end override for [member rendering/shadows/shadow_atlas/size] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/threads/thread_model" type="int" setter="" getter="" default="1"> - Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. + <member name="rendering/shadows/shadows/soft_shadow_quality" type="int" setter="" getter="" default="2"> + Quality setting for shadows cast by [OmniLight3D]s and [SpotLight3D]s. Higher quality settings use more samples when reading from shadow maps and are thus slower. Low quality settings may result in shadows looking grainy. </member> - <member name="rendering/volumetric_fog/use_filter" type="int" setter="" getter="" default="1"> + <member name="rendering/shadows/shadows/soft_shadow_quality.mobile" type="int" setter="" getter="" default="0"> + Lower-end override for [member rendering/shadows/shadows/soft_shadow_quality] on mobile devices, due to performance concerns or driver support. </member> - <member name="rendering/volumetric_fog/volume_depth" type="int" setter="" getter="" default="128"> + <member name="rendering/textures/default_filters/anisotropic_filtering_level" type="int" setter="" getter="" default="2"> + Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of [code]0[/code] forcibly disables anisotropic filtering, even on materials where it is enabled. </member> - <member name="rendering/volumetric_fog/volume_size" type="int" setter="" getter="" default="64"> + <member name="rendering/textures/default_filters/use_nearest_mipmap_filter" type="bool" setter="" getter="" default="false"> + If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used. </member> - <member name="rendering/vram_compression/import_bptc" type="bool" setter="" getter="" default="false"> + <member name="rendering/textures/vram_compression/import_bptc" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the BPTC algorithm. This texture compression algorithm is only supported on desktop platforms, and only when using the Vulkan renderer. </member> - <member name="rendering/vram_compression/import_etc" type="bool" setter="" getter="" default="false"> + <member name="rendering/textures/vram_compression/import_etc" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression algorithm. This algorithm doesn't support alpha channels in textures. </member> - <member name="rendering/vram_compression/import_etc2" type="bool" setter="" getter="" default="true"> + <member name="rendering/textures/vram_compression/import_etc2" type="bool" setter="" getter="" default="true"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm. This texture compression algorithm is only supported when using the Vulkan renderer. </member> - <member name="rendering/vram_compression/import_pvrtc" type="bool" setter="" getter="" default="false"> + <member name="rendering/textures/vram_compression/import_pvrtc" type="bool" setter="" getter="" default="false"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the PowerVR Texture Compression algorithm. This texture compression algorithm is only supported on iOS. </member> - <member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true"> + <member name="rendering/textures/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true"> If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. </member> <member name="rendering/vulkan/descriptor_pools/max_descriptors_per_pool" type="int" setter="" getter="" default="64"> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index 84e307b852..841d2bde72 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -490,7 +490,7 @@ </argument> <argument index="2" name="data" type="PackedByteArray" default="PackedByteArray( )"> </argument> - <argument index="3" name="arg3" type="bool" default="false"> + <argument index="3" name="use_restart_indices" type="bool" default="false"> </argument> <description> </description> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index efc751bb94..dfd4a5c2d5 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1802,7 +1802,7 @@ Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh. </description> </method> - <method name="multimesh_allocate"> + <method name="multimesh_allocate_data"> <return type="void"> </return> <argument index="0" name="multimesh" type="RID"> @@ -2549,7 +2549,7 @@ Sets a shader's default texture. Overwrites the texture given by name. </description> </method> - <method name="skeleton_allocate"> + <method name="skeleton_allocate_data"> <return type="void"> </return> <argument index="0" name="skeleton" type="RID"> @@ -2559,7 +2559,6 @@ <argument index="2" name="is_2d_skeleton" type="bool" default="false"> </argument> <description> - Allocates the GPU buffers for this skeleton. </description> </method> <method name="skeleton_bone_get_transform" qualifiers="const"> @@ -3453,7 +3452,7 @@ <constant name="VIEWPORT_DEBUG_DRAW_GI_BUFFER" value="17" enum="ViewportDebugDraw"> </constant> <constant name="SKY_MODE_QUALITY" value="1" enum="SkyMode"> - Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant Sky.PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/quality/reflections/ggx_samples]. + Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant Sky.PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/reflections/sky_reflections/ggx_samples]. </constant> <constant name="SKY_MODE_REALTIME" value="3" enum="SkyMode"> Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index ad0c438f98..2683156ec5 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -57,8 +57,13 @@ </argument> <argument index="1" name="original_path" type="String"> </argument> + <argument index="2" name="use_sub_threads" type="bool"> + </argument> + <argument index="3" name="cache_mode" type="int"> + </argument> <description> Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [code]original_path[/code] will target the source file. Returns a [Resource] object on success, or an [enum Error] constant in case of failure. + The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. </description> </method> <method name="rename_dependencies" qualifiers="virtual"> @@ -75,5 +80,11 @@ </method> </methods> <constants> + <constant name="CACHE_MODE_IGNORE" value="0" enum="CacheMode"> + </constant> + <constant name="CACHE_MODE_REUSE" value="1" enum="CacheMode"> + </constant> + <constant name="CACHE_MODE_REPLACE" value="2" enum="CacheMode"> + </constant> </constants> </class> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index c55a51c7ae..c81b21333f 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -58,13 +58,13 @@ </argument> <argument index="1" name="type_hint" type="String" default=""""> </argument> - <argument index="2" name="no_cache" type="bool" default="false"> + <argument index="2" name="cache_mode" type="int" enum="ResourceLoader.CacheMode" default="1"> </argument> <description> Loads a resource at the given [code]path[/code], caching the result for further access. The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. - If [code]no_cache[/code] is [code]true[/code], the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists. + The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. Returns an empty resource if no [ResourceFormatLoader] could handle the file. GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios. </description> @@ -127,5 +127,11 @@ <constant name="THREAD_LOAD_LOADED" value="3" enum="ThreadLoadStatus"> The resource was loaded successfully and can be accessed via [method load_threaded_get]. </constant> + <constant name="CACHE_MODE_IGNORE" value="0" enum="CacheMode"> + </constant> + <constant name="CACHE_MODE_REUSE" value="1" enum="CacheMode"> + </constant> + <constant name="CACHE_MODE_REPLACE" value="2" enum="CacheMode"> + </constant> </constants> </class> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index cfe6e4f738..f65d013bfc 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -64,10 +64,10 @@ </return> <argument index="0" name="time_sec" type="float"> </argument> - <argument index="1" name="pause_mode_process" type="bool" default="true"> + <argument index="1" name="process_always" type="bool" default="true"> </argument> <description> - Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]pause_mode_process[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. + Returns a [SceneTreeTimer] which will [signal SceneTreeTimer.timeout] after the given time in seconds elapsed in this [SceneTree]. If [code]process_always[/code] is set to [code]false[/code], pausing the [SceneTree] will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: [codeblock] func some_function(): @@ -361,6 +361,11 @@ Emitted whenever the [SceneTree] hierarchy changed (children being moved or renamed, etc.). </description> </signal> + <signal name="tree_process_mode_changed"> + <description> + This signal is only emitted in the editor, it allows the editor to update the visibility of disabled nodes. Emitted whenever any node's [member Node.process_mode] is changed. + </description> + </signal> </signals> <constants> <constant name="GROUP_CALL_DEFAULT" value="0" enum="GroupCallFlags"> diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml index a77515b3e6..d9553a3be3 100644 --- a/doc/classes/Sky.xml +++ b/doc/classes/Sky.xml @@ -52,13 +52,13 @@ Automatically selects the appropriate process mode based on your sky shader. If your shader uses [code]TIME[/code] or [code]POSITION[/code], this will use [constant PROCESS_MODE_REALTIME]. If your shader uses any of the [code]LIGHT_*[/code] variables or any custom uniforms, this uses [constant PROCESS_MODE_INCREMENTAL]. Otherwise, this defaults to [constant PROCESS_MODE_QUALITY]. </constant> <constant name="PROCESS_MODE_QUALITY" value="1" enum="ProcessMode"> - Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/quality/reflections/ggx_samples]. + Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/reflections/sky_reflections/ggx_samples]. </constant> <constant name="PROCESS_MODE_INCREMENTAL" value="2" enum="ProcessMode"> - Uses the same high quality importance sampling to process the radiance map as [constant PROCESS_MODE_QUALITY], but updates over several frames. The number of frames is determined by [member ProjectSettings.rendering/quality/reflections/roughness_layers]. Use this when you need highest quality radiance maps, but have a sky that updates slowly. + Uses the same high quality importance sampling to process the radiance map as [constant PROCESS_MODE_QUALITY], but updates over several frames. The number of frames is determined by [member ProjectSettings.rendering/reflections/sky_reflections/roughness_layers]. Use this when you need highest quality radiance maps, but have a sky that updates slowly. </constant> <constant name="PROCESS_MODE_REALTIME" value="3" enum="ProcessMode"> - Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [member ProjectSettings.rendering/quality/reflections/fast_filter_high_quality]. + Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [member ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality]. [b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member radiance_size] must be set to [constant RADIANCE_SIZE_256]. </constant> </constants> diff --git a/doc/classes/SoftBody3D.xml b/doc/classes/SoftBody3D.xml index d3ab955570..04e201e1bd 100644 --- a/doc/classes/SoftBody3D.xml +++ b/doc/classes/SoftBody3D.xml @@ -77,7 +77,7 @@ </method> </methods> <members> - <member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5"> + <member name="angular_stiffness" type="float" setter="set_angular_stiffness" getter="get_angular_stiffness" default="0.0"> </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1"> The physics layers this SoftBody3D is in. @@ -87,11 +87,11 @@ <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1"> The physics layers this SoftBody3D scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. </member> - <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01"> + <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.0"> </member> <member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0"> </member> - <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5"> + <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.0"> </member> <member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath("")"> [NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping. @@ -103,13 +103,13 @@ <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true"> If [code]true[/code], the [SoftBody3D] will respond to [RayCast3D]s. </member> - <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5"> + <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="0"> Increasing this value will improve the resulting simulation, but can affect performance. Use with care. </member> - <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0"> + <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="0.0"> The SoftBody3D's mass. </member> - <member name="volume_stiffness" type="float" setter="set_volume_stiffness" getter="get_volume_stiffness" default="0.5"> + <member name="volume_stiffness" type="float" setter="set_volume_stiffness" getter="get_volume_stiffness" default="0.0"> </member> </members> <constants> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index e674ceb57e..a08d4f5b44 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -15,6 +15,7 @@ [/codeblock] The above code will create a [SpinBox], disable context menu on it and set the text alignment to right. See [Range] class for more options over the [SpinBox]. + [b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a [SpinBox]'s background, add theme items for [LineEdit] and customize them. </description> <tutorials> </tutorials> diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index 44b08408c1..078520a095 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -102,7 +102,7 @@ This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. </constant> <constant name="ALPHA_CUT_DISCARD" value="1" enum="AlphaCutMode"> - This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/quality/screen_filters/screen_space_aa]). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i]. + This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa]). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as [i]alpha testing[/i] or [i]1-bit transparency[/i]. </constant> <constant name="ALPHA_CUT_OPAQUE_PREPASS" value="2" enum="AlphaCutMode"> This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 413a77a0e9..79ab6e28e7 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -695,7 +695,7 @@ <method name="shaped_text_clear"> <return type="void"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="rid" type="RID"> </argument> <description> Clears text buffer (removes text and inline objects). diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index ab75e21ce8..5265e75429 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -47,8 +47,8 @@ <member name="paused" type="bool" setter="set_paused" getter="is_paused"> If [code]true[/code], the timer is paused and will not process until it is unpaused again, even if [method start] is called. </member> - <member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" enum="Timer.TimerProcessMode" default="1"> - Processing mode. See [enum TimerProcessMode]. + <member name="process_callback" type="int" setter="set_timer_process_callback" getter="get_timer_process_callback" enum="Timer.TimerProcessCallback" default="1"> + Processing callback. See [enum TimerProcessCallback]. </member> <member name="time_left" type="float" setter="" getter="get_time_left"> The timer's remaining time in seconds. Returns 0 if the timer is inactive. @@ -66,10 +66,10 @@ </signal> </signals> <constants> - <constant name="TIMER_PROCESS_PHYSICS" value="0" enum="TimerProcessMode"> + <constant name="TIMER_PROCESS_PHYSICS" value="0" enum="TimerProcessCallback"> Update the timer during the physics step at each frame (fixed framerate processing). </constant> - <constant name="TIMER_PROCESS_IDLE" value="1" enum="TimerProcessMode"> + <constant name="TIMER_PROCESS_IDLE" value="1" enum="TimerProcessCallback"> Update the timer during the idle time at each frame. </constant> </constants> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index 9833f0dc23..bb4c17c531 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -4,7 +4,7 @@ Button for touch screen devices for gameplay use. </brief_description> <description> - TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. + TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [Button], TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. </description> @@ -43,7 +43,7 @@ If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect. </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true"> - If [code]true[/code], the button's shape is visible. + If [code]true[/code], the button's shape is visible in the editor. </member> <member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" enum="TouchScreenButton.VisibilityMode" default="0"> The button's visibility mode. See [enum VisibilityMode] for possible values. diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index cda69f6a64..d75b81eece 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -97,7 +97,7 @@ </return> <argument index="0" name="target" type="Vector3"> </argument> - <argument index="1" name="up" type="Vector3"> + <argument index="1" name="up" type="Vector3" default="Vector3( 0, 1, 0 )"> </argument> <description> Returns a copy of the transform rotated such that its -Z axis points towards the [code]target[/code] position. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 59b72b1ed6..f1e799898d 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -230,6 +230,14 @@ To tell whether a column of an item is selected, use [method TreeItem.is_selected]. </description> </method> + <method name="scroll_to_item"> + <return type="void"> + </return> + <argument index="0" name="item" type="Object"> + </argument> + <description> + </description> + </method> <method name="set_column_expand"> <return type="void"> </return> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 0e4a76a1a9..e8124d0e6a 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -131,7 +131,7 @@ <method name="get_action_name"> <return type="String"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="id" type="int"> </argument> <description> Gets the action name from its index. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index fbe1e275a9..b99a251a11 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -276,7 +276,7 @@ <method name="set_ime_active"> <return type="void"> </return> - <argument index="0" name="arg0" type="bool"> + <argument index="0" name="active" type="bool"> </argument> <description> </description> @@ -284,7 +284,7 @@ <method name="set_ime_position"> <return type="void"> </return> - <argument index="0" name="arg0" type="Vector2i"> + <argument index="0" name="position" type="Vector2i"> </argument> <description> </description> diff --git a/doc/translations/README.md b/doc/translations/README.md new file mode 100644 index 0000000000..a941eeaf49 --- /dev/null +++ b/doc/translations/README.md @@ -0,0 +1 @@ +These `.po` and `.pot` files come from Weblate. Do not modify them manually. diff --git a/drivers/alsa/asound-so_wrap.c b/drivers/alsa/asound-so_wrap.c index 1821f683f6..0c759b75ca 100644 --- a/drivers/alsa/asound-so_wrap.c +++ b/drivers/alsa/asound-so_wrap.c @@ -1,8 +1,10 @@ // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:19:14 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:12 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/alsa/asoundlib.h --sys-include <alsa/asoundlib.h> --soname libasound.so.2 --init-name asound --output-header asound-so_wrap.h --output-implementation asound-so_wrap.c // +#include <stdint.h> + #define snd_asoundlib_version snd_asoundlib_version_dylibloader_orig_asound #define snd_dlpath snd_dlpath_dylibloader_orig_asound #define snd_dlopen snd_dlopen_dylibloader_orig_asound @@ -3855,7712 +3857,10280 @@ void (*snd_midi_event_no_status_dylibloader_wrapper_asound)( snd_midi_event_t*, long (*snd_midi_event_encode_dylibloader_wrapper_asound)( snd_midi_event_t*,const unsigned char*, long, snd_seq_event_t*); int (*snd_midi_event_encode_byte_dylibloader_wrapper_asound)( snd_midi_event_t*, int, snd_seq_event_t*); long (*snd_midi_event_decode_dylibloader_wrapper_asound)( snd_midi_event_t*, unsigned char*, long,const snd_seq_event_t*); -int initialize_asound() { +int initialize_asound(int verbose) { void *handle; char *error; handle = dlopen("libasound.so.2", RTLD_LAZY); if (!handle) { - fprintf(stderr, "%s\n", dlerror()); + if (verbose) { + fprintf(stderr, "%s\n", dlerror()); + } return(1); } dlerror(); // snd_asoundlib_version *(void **) (&snd_asoundlib_version_dylibloader_wrapper_asound) = dlsym(handle, "snd_asoundlib_version"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_dlpath *(void **) (&snd_dlpath_dylibloader_wrapper_asound) = dlsym(handle, "snd_dlpath"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_dlopen *(void **) (&snd_dlopen_dylibloader_wrapper_asound) = dlsym(handle, "snd_dlopen"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_dlsym *(void **) (&snd_dlsym_dylibloader_wrapper_asound) = dlsym(handle, "snd_dlsym"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_dlclose *(void **) (&snd_dlclose_dylibloader_wrapper_asound) = dlsym(handle, "snd_dlclose"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_add_handler *(void **) (&snd_async_add_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_add_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_del_handler *(void **) (&snd_async_del_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_del_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_fd *(void **) (&snd_async_handler_get_fd_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_fd"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_signo *(void **) (&snd_async_handler_get_signo_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_signo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_callback_private *(void **) (&snd_async_handler_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_shm_area_create *(void **) (&snd_shm_area_create_dylibloader_wrapper_asound) = dlsym(handle, "snd_shm_area_create"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_shm_area_share *(void **) (&snd_shm_area_share_dylibloader_wrapper_asound) = dlsym(handle, "snd_shm_area_share"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_shm_area_destroy *(void **) (&snd_shm_area_destroy_dylibloader_wrapper_asound) = dlsym(handle, "snd_shm_area_destroy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_user_file *(void **) (&snd_user_file_dylibloader_wrapper_asound) = dlsym(handle, "snd_user_file"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_stdio_open *(void **) (&snd_input_stdio_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_stdio_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_stdio_attach *(void **) (&snd_input_stdio_attach_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_stdio_attach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_buffer_open *(void **) (&snd_input_buffer_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_buffer_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_close *(void **) (&snd_input_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_scanf *(void **) (&snd_input_scanf_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_scanf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_gets *(void **) (&snd_input_gets_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_gets"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_getc *(void **) (&snd_input_getc_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_getc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_input_ungetc *(void **) (&snd_input_ungetc_dylibloader_wrapper_asound) = dlsym(handle, "snd_input_ungetc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_stdio_open *(void **) (&snd_output_stdio_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_stdio_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_stdio_attach *(void **) (&snd_output_stdio_attach_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_stdio_attach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_buffer_open *(void **) (&snd_output_buffer_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_buffer_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_buffer_string *(void **) (&snd_output_buffer_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_buffer_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_close *(void **) (&snd_output_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_printf *(void **) (&snd_output_printf_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_printf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_vprintf *(void **) (&snd_output_vprintf_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_vprintf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_puts *(void **) (&snd_output_puts_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_puts"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_putc *(void **) (&snd_output_putc_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_putc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_output_flush *(void **) (&snd_output_flush_dylibloader_wrapper_asound) = dlsym(handle, "snd_output_flush"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_strerror *(void **) (&snd_strerror_dylibloader_wrapper_asound) = dlsym(handle, "snd_strerror"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_lib_error_set_handler *(void **) (&snd_lib_error_set_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_lib_error_set_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_lib_error_set_local *(void **) (&snd_lib_error_set_local_dylibloader_wrapper_asound) = dlsym(handle, "snd_lib_error_set_local"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_topdir *(void **) (&snd_config_topdir_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_topdir"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_top *(void **) (&snd_config_top_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_top"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_load *(void **) (&snd_config_load_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_load_override *(void **) (&snd_config_load_override_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_load_override"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_save *(void **) (&snd_config_save_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_save"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_update *(void **) (&snd_config_update_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_update_r *(void **) (&snd_config_update_r_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_update_r"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_update_free *(void **) (&snd_config_update_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_update_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_update_free_global *(void **) (&snd_config_update_free_global_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_update_free_global"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_update_ref *(void **) (&snd_config_update_ref_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_update_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_ref *(void **) (&snd_config_ref_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_unref *(void **) (&snd_config_unref_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_search *(void **) (&snd_config_search_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_search"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_searchv *(void **) (&snd_config_searchv_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_searchv"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_search_definition *(void **) (&snd_config_search_definition_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_search_definition"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_expand *(void **) (&snd_config_expand_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_expand"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_evaluate *(void **) (&snd_config_evaluate_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_evaluate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_add *(void **) (&snd_config_add_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_add"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_add_before *(void **) (&snd_config_add_before_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_add_before"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_add_after *(void **) (&snd_config_add_after_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_add_after"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_remove *(void **) (&snd_config_remove_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_delete *(void **) (&snd_config_delete_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_delete"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_delete_compound_members *(void **) (&snd_config_delete_compound_members_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_delete_compound_members"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_copy *(void **) (&snd_config_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make *(void **) (&snd_config_make_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_integer *(void **) (&snd_config_make_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_integer64 *(void **) (&snd_config_make_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_real *(void **) (&snd_config_make_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_string *(void **) (&snd_config_make_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_pointer *(void **) (&snd_config_make_pointer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_pointer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_make_compound *(void **) (&snd_config_make_compound_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_make_compound"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_integer *(void **) (&snd_config_imake_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_integer64 *(void **) (&snd_config_imake_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_real *(void **) (&snd_config_imake_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_string *(void **) (&snd_config_imake_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_safe_string *(void **) (&snd_config_imake_safe_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_safe_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_imake_pointer *(void **) (&snd_config_imake_pointer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_imake_pointer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_type *(void **) (&snd_config_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_is_array *(void **) (&snd_config_is_array_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_is_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_id *(void **) (&snd_config_set_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_integer *(void **) (&snd_config_set_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_integer64 *(void **) (&snd_config_set_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_real *(void **) (&snd_config_set_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_string *(void **) (&snd_config_set_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_ascii *(void **) (&snd_config_set_ascii_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_ascii"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_set_pointer *(void **) (&snd_config_set_pointer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_set_pointer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_id *(void **) (&snd_config_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_integer *(void **) (&snd_config_get_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_integer64 *(void **) (&snd_config_get_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_real *(void **) (&snd_config_get_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_ireal *(void **) (&snd_config_get_ireal_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_ireal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_string *(void **) (&snd_config_get_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_ascii *(void **) (&snd_config_get_ascii_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_ascii"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_pointer *(void **) (&snd_config_get_pointer_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_pointer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_test_id *(void **) (&snd_config_test_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_test_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_iterator_first *(void **) (&snd_config_iterator_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_iterator_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_iterator_next *(void **) (&snd_config_iterator_next_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_iterator_next"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_iterator_end *(void **) (&snd_config_iterator_end_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_iterator_end"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_iterator_entry *(void **) (&snd_config_iterator_entry_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_iterator_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_bool_ascii *(void **) (&snd_config_get_bool_ascii_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_bool_ascii"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_bool *(void **) (&snd_config_get_bool_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_bool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_ctl_iface_ascii *(void **) (&snd_config_get_ctl_iface_ascii_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_ctl_iface_ascii"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_config_get_ctl_iface *(void **) (&snd_config_get_ctl_iface_dylibloader_wrapper_asound) = dlsym(handle, "snd_config_get_ctl_iface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_names_list *(void **) (&snd_names_list_dylibloader_wrapper_asound) = dlsym(handle, "snd_names_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_names_list_free *(void **) (&snd_names_list_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_names_list_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_open *(void **) (&snd_pcm_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_open_lconf *(void **) (&snd_pcm_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_open_fallback *(void **) (&snd_pcm_open_fallback_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_open_fallback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_close *(void **) (&snd_pcm_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_name *(void **) (&snd_pcm_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_type *(void **) (&snd_pcm_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_stream *(void **) (&snd_pcm_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_poll_descriptors_count *(void **) (&snd_pcm_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_poll_descriptors *(void **) (&snd_pcm_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_poll_descriptors_revents *(void **) (&snd_pcm_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_nonblock *(void **) (&snd_pcm_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_add_pcm_handler *(void **) (&snd_async_add_pcm_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_add_pcm_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_pcm *(void **) (&snd_async_handler_get_pcm_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_pcm"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info *(void **) (&snd_pcm_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_current *(void **) (&snd_pcm_hw_params_current_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_current"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params *(void **) (&snd_pcm_hw_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_free *(void **) (&snd_pcm_hw_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_current *(void **) (&snd_pcm_sw_params_current_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_current"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params *(void **) (&snd_pcm_sw_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_prepare *(void **) (&snd_pcm_prepare_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_prepare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_reset *(void **) (&snd_pcm_reset_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_reset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status *(void **) (&snd_pcm_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_start *(void **) (&snd_pcm_start_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_drop *(void **) (&snd_pcm_drop_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_drop"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_drain *(void **) (&snd_pcm_drain_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_drain"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_pause *(void **) (&snd_pcm_pause_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_pause"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_state *(void **) (&snd_pcm_state_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hwsync *(void **) (&snd_pcm_hwsync_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hwsync"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_delay *(void **) (&snd_pcm_delay_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_delay"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_resume *(void **) (&snd_pcm_resume_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_resume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_htimestamp *(void **) (&snd_pcm_htimestamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_htimestamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_avail *(void **) (&snd_pcm_avail_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_avail"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_avail_update *(void **) (&snd_pcm_avail_update_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_avail_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_avail_delay *(void **) (&snd_pcm_avail_delay_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_avail_delay"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_rewindable *(void **) (&snd_pcm_rewindable_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_rewindable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_rewind *(void **) (&snd_pcm_rewind_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_rewind"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_forwardable *(void **) (&snd_pcm_forwardable_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_forwardable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_forward *(void **) (&snd_pcm_forward_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_forward"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_writei *(void **) (&snd_pcm_writei_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_writei"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_readi *(void **) (&snd_pcm_readi_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_readi"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_writen *(void **) (&snd_pcm_writen_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_writen"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_readn *(void **) (&snd_pcm_readn_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_readn"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_wait *(void **) (&snd_pcm_wait_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_wait"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_link *(void **) (&snd_pcm_link_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_link"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_unlink *(void **) (&snd_pcm_unlink_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_unlink"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_query_chmaps *(void **) (&snd_pcm_query_chmaps_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_query_chmaps"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_query_chmaps_from_hw *(void **) (&snd_pcm_query_chmaps_from_hw_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_query_chmaps_from_hw"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_free_chmaps *(void **) (&snd_pcm_free_chmaps_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_free_chmaps"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_get_chmap *(void **) (&snd_pcm_get_chmap_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_get_chmap"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_set_chmap *(void **) (&snd_pcm_set_chmap_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_set_chmap"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_type_name *(void **) (&snd_pcm_chmap_type_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_type_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_name *(void **) (&snd_pcm_chmap_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_long_name *(void **) (&snd_pcm_chmap_long_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_long_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_print *(void **) (&snd_pcm_chmap_print_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_print"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_from_string *(void **) (&snd_pcm_chmap_from_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_from_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_chmap_parse_string *(void **) (&snd_pcm_chmap_parse_string_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_chmap_parse_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_recover *(void **) (&snd_pcm_recover_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_recover"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_set_params *(void **) (&snd_pcm_set_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_set_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_get_params *(void **) (&snd_pcm_get_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_get_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_sizeof *(void **) (&snd_pcm_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_malloc *(void **) (&snd_pcm_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_free *(void **) (&snd_pcm_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_copy *(void **) (&snd_pcm_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_device *(void **) (&snd_pcm_info_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_subdevice *(void **) (&snd_pcm_info_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_stream *(void **) (&snd_pcm_info_get_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_card *(void **) (&snd_pcm_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_id *(void **) (&snd_pcm_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_name *(void **) (&snd_pcm_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_subdevice_name *(void **) (&snd_pcm_info_get_subdevice_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_subdevice_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_class *(void **) (&snd_pcm_info_get_class_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_class"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_subclass *(void **) (&snd_pcm_info_get_subclass_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_subclass"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_subdevices_count *(void **) (&snd_pcm_info_get_subdevices_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_subdevices_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_subdevices_avail *(void **) (&snd_pcm_info_get_subdevices_avail_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_subdevices_avail"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_get_sync *(void **) (&snd_pcm_info_get_sync_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_get_sync"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_set_device *(void **) (&snd_pcm_info_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_set_subdevice *(void **) (&snd_pcm_info_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_info_set_stream *(void **) (&snd_pcm_info_set_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_info_set_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_any *(void **) (&snd_pcm_hw_params_any_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_any"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_mmap_sample_resolution *(void **) (&snd_pcm_hw_params_can_mmap_sample_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_mmap_sample_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_double *(void **) (&snd_pcm_hw_params_is_double_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_double"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_batch *(void **) (&snd_pcm_hw_params_is_batch_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_batch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_block_transfer *(void **) (&snd_pcm_hw_params_is_block_transfer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_block_transfer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_monotonic *(void **) (&snd_pcm_hw_params_is_monotonic_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_monotonic"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_overrange *(void **) (&snd_pcm_hw_params_can_overrange_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_overrange"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_pause *(void **) (&snd_pcm_hw_params_can_pause_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_pause"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_resume *(void **) (&snd_pcm_hw_params_can_resume_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_resume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_half_duplex *(void **) (&snd_pcm_hw_params_is_half_duplex_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_half_duplex"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_is_joint_duplex *(void **) (&snd_pcm_hw_params_is_joint_duplex_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_is_joint_duplex"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_sync_start *(void **) (&snd_pcm_hw_params_can_sync_start_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_sync_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_can_disable_period_wakeup *(void **) (&snd_pcm_hw_params_can_disable_period_wakeup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_can_disable_period_wakeup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_supports_audio_wallclock_ts *(void **) (&snd_pcm_hw_params_supports_audio_wallclock_ts_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_supports_audio_wallclock_ts"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_supports_audio_ts_type *(void **) (&snd_pcm_hw_params_supports_audio_ts_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_supports_audio_ts_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_rate_numden *(void **) (&snd_pcm_hw_params_get_rate_numden_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_rate_numden"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_sbits *(void **) (&snd_pcm_hw_params_get_sbits_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_sbits"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_fifo_size *(void **) (&snd_pcm_hw_params_get_fifo_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_fifo_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_sizeof *(void **) (&snd_pcm_hw_params_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_malloc *(void **) (&snd_pcm_hw_params_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_free *(void **) (&snd_pcm_hw_params_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_copy *(void **) (&snd_pcm_hw_params_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_access *(void **) (&snd_pcm_hw_params_get_access_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_access"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_access *(void **) (&snd_pcm_hw_params_test_access_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_access"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_access *(void **) (&snd_pcm_hw_params_set_access_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_access"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_access_first *(void **) (&snd_pcm_hw_params_set_access_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_access_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_access_last *(void **) (&snd_pcm_hw_params_set_access_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_access_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_access_mask *(void **) (&snd_pcm_hw_params_set_access_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_access_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_access_mask *(void **) (&snd_pcm_hw_params_get_access_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_access_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_format *(void **) (&snd_pcm_hw_params_get_format_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_format *(void **) (&snd_pcm_hw_params_test_format_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_format *(void **) (&snd_pcm_hw_params_set_format_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_format_first *(void **) (&snd_pcm_hw_params_set_format_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_format_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_format_last *(void **) (&snd_pcm_hw_params_set_format_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_format_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_format_mask *(void **) (&snd_pcm_hw_params_set_format_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_format_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_format_mask *(void **) (&snd_pcm_hw_params_get_format_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_format_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_subformat *(void **) (&snd_pcm_hw_params_get_subformat_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_subformat"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_subformat *(void **) (&snd_pcm_hw_params_test_subformat_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_subformat"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_subformat *(void **) (&snd_pcm_hw_params_set_subformat_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_subformat"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_subformat_first *(void **) (&snd_pcm_hw_params_set_subformat_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_subformat_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_subformat_last *(void **) (&snd_pcm_hw_params_set_subformat_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_subformat_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_subformat_mask *(void **) (&snd_pcm_hw_params_set_subformat_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_subformat_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_subformat_mask *(void **) (&snd_pcm_hw_params_get_subformat_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_subformat_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_channels *(void **) (&snd_pcm_hw_params_get_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_channels_min *(void **) (&snd_pcm_hw_params_get_channels_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_channels_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_channels_max *(void **) (&snd_pcm_hw_params_get_channels_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_channels_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_channels *(void **) (&snd_pcm_hw_params_test_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels *(void **) (&snd_pcm_hw_params_set_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_min *(void **) (&snd_pcm_hw_params_set_channels_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_max *(void **) (&snd_pcm_hw_params_set_channels_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_minmax *(void **) (&snd_pcm_hw_params_set_channels_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_near *(void **) (&snd_pcm_hw_params_set_channels_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_first *(void **) (&snd_pcm_hw_params_set_channels_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_channels_last *(void **) (&snd_pcm_hw_params_set_channels_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_channels_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_rate *(void **) (&snd_pcm_hw_params_get_rate_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_rate_min *(void **) (&snd_pcm_hw_params_get_rate_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_rate_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_rate_max *(void **) (&snd_pcm_hw_params_get_rate_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_rate_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_rate *(void **) (&snd_pcm_hw_params_test_rate_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate *(void **) (&snd_pcm_hw_params_set_rate_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_min *(void **) (&snd_pcm_hw_params_set_rate_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_max *(void **) (&snd_pcm_hw_params_set_rate_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_minmax *(void **) (&snd_pcm_hw_params_set_rate_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_near *(void **) (&snd_pcm_hw_params_set_rate_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_first *(void **) (&snd_pcm_hw_params_set_rate_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_last *(void **) (&snd_pcm_hw_params_set_rate_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_rate_resample *(void **) (&snd_pcm_hw_params_set_rate_resample_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_rate_resample"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_rate_resample *(void **) (&snd_pcm_hw_params_get_rate_resample_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_rate_resample"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_export_buffer *(void **) (&snd_pcm_hw_params_set_export_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_export_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_export_buffer *(void **) (&snd_pcm_hw_params_get_export_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_export_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_wakeup *(void **) (&snd_pcm_hw_params_set_period_wakeup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_wakeup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_wakeup *(void **) (&snd_pcm_hw_params_get_period_wakeup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_wakeup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_time *(void **) (&snd_pcm_hw_params_get_period_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_time_min *(void **) (&snd_pcm_hw_params_get_period_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_time_max *(void **) (&snd_pcm_hw_params_get_period_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_period_time *(void **) (&snd_pcm_hw_params_test_period_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_period_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time *(void **) (&snd_pcm_hw_params_set_period_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_min *(void **) (&snd_pcm_hw_params_set_period_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_max *(void **) (&snd_pcm_hw_params_set_period_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_minmax *(void **) (&snd_pcm_hw_params_set_period_time_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_near *(void **) (&snd_pcm_hw_params_set_period_time_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_first *(void **) (&snd_pcm_hw_params_set_period_time_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_time_last *(void **) (&snd_pcm_hw_params_set_period_time_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_time_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_size *(void **) (&snd_pcm_hw_params_get_period_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_size_min *(void **) (&snd_pcm_hw_params_get_period_size_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_size_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_period_size_max *(void **) (&snd_pcm_hw_params_get_period_size_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_period_size_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_period_size *(void **) (&snd_pcm_hw_params_test_period_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_period_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size *(void **) (&snd_pcm_hw_params_set_period_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_min *(void **) (&snd_pcm_hw_params_set_period_size_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_max *(void **) (&snd_pcm_hw_params_set_period_size_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_minmax *(void **) (&snd_pcm_hw_params_set_period_size_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_near *(void **) (&snd_pcm_hw_params_set_period_size_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_first *(void **) (&snd_pcm_hw_params_set_period_size_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_last *(void **) (&snd_pcm_hw_params_set_period_size_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_period_size_integer *(void **) (&snd_pcm_hw_params_set_period_size_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_period_size_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_periods *(void **) (&snd_pcm_hw_params_get_periods_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_periods"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_periods_min *(void **) (&snd_pcm_hw_params_get_periods_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_periods_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_periods_max *(void **) (&snd_pcm_hw_params_get_periods_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_periods_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_periods *(void **) (&snd_pcm_hw_params_test_periods_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_periods"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods *(void **) (&snd_pcm_hw_params_set_periods_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_min *(void **) (&snd_pcm_hw_params_set_periods_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_max *(void **) (&snd_pcm_hw_params_set_periods_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_minmax *(void **) (&snd_pcm_hw_params_set_periods_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_near *(void **) (&snd_pcm_hw_params_set_periods_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_first *(void **) (&snd_pcm_hw_params_set_periods_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_last *(void **) (&snd_pcm_hw_params_set_periods_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_periods_integer *(void **) (&snd_pcm_hw_params_set_periods_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_periods_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_time *(void **) (&snd_pcm_hw_params_get_buffer_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_time_min *(void **) (&snd_pcm_hw_params_get_buffer_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_time_max *(void **) (&snd_pcm_hw_params_get_buffer_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_buffer_time *(void **) (&snd_pcm_hw_params_test_buffer_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_buffer_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time *(void **) (&snd_pcm_hw_params_set_buffer_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_min *(void **) (&snd_pcm_hw_params_set_buffer_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_max *(void **) (&snd_pcm_hw_params_set_buffer_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_minmax *(void **) (&snd_pcm_hw_params_set_buffer_time_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_near *(void **) (&snd_pcm_hw_params_set_buffer_time_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_first *(void **) (&snd_pcm_hw_params_set_buffer_time_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_time_last *(void **) (&snd_pcm_hw_params_set_buffer_time_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_time_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_size *(void **) (&snd_pcm_hw_params_get_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_size_min *(void **) (&snd_pcm_hw_params_get_buffer_size_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_size_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_buffer_size_max *(void **) (&snd_pcm_hw_params_get_buffer_size_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_buffer_size_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_buffer_size *(void **) (&snd_pcm_hw_params_test_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size *(void **) (&snd_pcm_hw_params_set_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_min *(void **) (&snd_pcm_hw_params_set_buffer_size_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_max *(void **) (&snd_pcm_hw_params_set_buffer_size_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_minmax *(void **) (&snd_pcm_hw_params_set_buffer_size_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_near *(void **) (&snd_pcm_hw_params_set_buffer_size_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_first *(void **) (&snd_pcm_hw_params_set_buffer_size_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_buffer_size_last *(void **) (&snd_pcm_hw_params_set_buffer_size_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_buffer_size_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_min_align *(void **) (&snd_pcm_hw_params_get_min_align_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_min_align"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_sizeof *(void **) (&snd_pcm_sw_params_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_malloc *(void **) (&snd_pcm_sw_params_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_free *(void **) (&snd_pcm_sw_params_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_copy *(void **) (&snd_pcm_sw_params_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_boundary *(void **) (&snd_pcm_sw_params_get_boundary_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_boundary"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_tstamp_mode *(void **) (&snd_pcm_sw_params_set_tstamp_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_tstamp_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_tstamp_mode *(void **) (&snd_pcm_sw_params_get_tstamp_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_tstamp_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_tstamp_type *(void **) (&snd_pcm_sw_params_set_tstamp_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_tstamp_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_tstamp_type *(void **) (&snd_pcm_sw_params_get_tstamp_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_tstamp_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_avail_min *(void **) (&snd_pcm_sw_params_set_avail_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_avail_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_avail_min *(void **) (&snd_pcm_sw_params_get_avail_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_avail_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_period_event *(void **) (&snd_pcm_sw_params_set_period_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_period_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_period_event *(void **) (&snd_pcm_sw_params_get_period_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_period_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_start_threshold *(void **) (&snd_pcm_sw_params_set_start_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_start_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_start_threshold *(void **) (&snd_pcm_sw_params_get_start_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_start_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_stop_threshold *(void **) (&snd_pcm_sw_params_set_stop_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_stop_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_stop_threshold *(void **) (&snd_pcm_sw_params_get_stop_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_stop_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_silence_threshold *(void **) (&snd_pcm_sw_params_set_silence_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_silence_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_silence_threshold *(void **) (&snd_pcm_sw_params_get_silence_threshold_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_silence_threshold"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_silence_size *(void **) (&snd_pcm_sw_params_set_silence_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_silence_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_silence_size *(void **) (&snd_pcm_sw_params_get_silence_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_silence_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_sizeof *(void **) (&snd_pcm_access_mask_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_malloc *(void **) (&snd_pcm_access_mask_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_free *(void **) (&snd_pcm_access_mask_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_copy *(void **) (&snd_pcm_access_mask_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_none *(void **) (&snd_pcm_access_mask_none_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_none"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_any *(void **) (&snd_pcm_access_mask_any_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_any"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_test *(void **) (&snd_pcm_access_mask_test_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_test"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_empty *(void **) (&snd_pcm_access_mask_empty_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_empty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_set *(void **) (&snd_pcm_access_mask_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_mask_reset *(void **) (&snd_pcm_access_mask_reset_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_mask_reset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_sizeof *(void **) (&snd_pcm_format_mask_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_malloc *(void **) (&snd_pcm_format_mask_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_free *(void **) (&snd_pcm_format_mask_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_copy *(void **) (&snd_pcm_format_mask_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_none *(void **) (&snd_pcm_format_mask_none_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_none"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_any *(void **) (&snd_pcm_format_mask_any_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_any"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_test *(void **) (&snd_pcm_format_mask_test_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_test"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_empty *(void **) (&snd_pcm_format_mask_empty_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_empty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_set *(void **) (&snd_pcm_format_mask_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_mask_reset *(void **) (&snd_pcm_format_mask_reset_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_mask_reset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_sizeof *(void **) (&snd_pcm_subformat_mask_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_malloc *(void **) (&snd_pcm_subformat_mask_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_free *(void **) (&snd_pcm_subformat_mask_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_copy *(void **) (&snd_pcm_subformat_mask_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_none *(void **) (&snd_pcm_subformat_mask_none_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_none"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_any *(void **) (&snd_pcm_subformat_mask_any_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_any"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_test *(void **) (&snd_pcm_subformat_mask_test_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_test"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_empty *(void **) (&snd_pcm_subformat_mask_empty_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_empty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_set *(void **) (&snd_pcm_subformat_mask_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_mask_reset *(void **) (&snd_pcm_subformat_mask_reset_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_mask_reset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_sizeof *(void **) (&snd_pcm_status_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_malloc *(void **) (&snd_pcm_status_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_free *(void **) (&snd_pcm_status_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_copy *(void **) (&snd_pcm_status_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_state *(void **) (&snd_pcm_status_get_state_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_trigger_tstamp *(void **) (&snd_pcm_status_get_trigger_tstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_trigger_tstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_trigger_htstamp *(void **) (&snd_pcm_status_get_trigger_htstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_trigger_htstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_tstamp *(void **) (&snd_pcm_status_get_tstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_tstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_htstamp *(void **) (&snd_pcm_status_get_htstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_htstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_audio_htstamp *(void **) (&snd_pcm_status_get_audio_htstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_audio_htstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_driver_htstamp *(void **) (&snd_pcm_status_get_driver_htstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_driver_htstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_audio_htstamp_report *(void **) (&snd_pcm_status_get_audio_htstamp_report_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_audio_htstamp_report"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_set_audio_htstamp_config *(void **) (&snd_pcm_status_set_audio_htstamp_config_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_set_audio_htstamp_config"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_delay *(void **) (&snd_pcm_status_get_delay_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_delay"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_avail *(void **) (&snd_pcm_status_get_avail_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_avail"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_avail_max *(void **) (&snd_pcm_status_get_avail_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_avail_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_get_overrange *(void **) (&snd_pcm_status_get_overrange_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_get_overrange"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_type_name *(void **) (&snd_pcm_type_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_type_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_stream_name *(void **) (&snd_pcm_stream_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_stream_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_access_name *(void **) (&snd_pcm_access_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_access_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_name *(void **) (&snd_pcm_format_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_description *(void **) (&snd_pcm_format_description_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_description"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_name *(void **) (&snd_pcm_subformat_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_subformat_description *(void **) (&snd_pcm_subformat_description_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_subformat_description"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_value *(void **) (&snd_pcm_format_value_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_tstamp_mode_name *(void **) (&snd_pcm_tstamp_mode_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_tstamp_mode_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_state_name *(void **) (&snd_pcm_state_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_state_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_dump *(void **) (&snd_pcm_dump_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_dump"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_dump_hw_setup *(void **) (&snd_pcm_dump_hw_setup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_dump_hw_setup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_dump_sw_setup *(void **) (&snd_pcm_dump_sw_setup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_dump_sw_setup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_dump_setup *(void **) (&snd_pcm_dump_setup_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_dump_setup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_dump *(void **) (&snd_pcm_hw_params_dump_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_dump"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_dump *(void **) (&snd_pcm_sw_params_dump_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_dump"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_status_dump *(void **) (&snd_pcm_status_dump_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_status_dump"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_begin *(void **) (&snd_pcm_mmap_begin_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_begin"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_commit *(void **) (&snd_pcm_mmap_commit_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_commit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_writei *(void **) (&snd_pcm_mmap_writei_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_writei"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_readi *(void **) (&snd_pcm_mmap_readi_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_readi"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_writen *(void **) (&snd_pcm_mmap_writen_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_writen"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_mmap_readn *(void **) (&snd_pcm_mmap_readn_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_mmap_readn"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_signed *(void **) (&snd_pcm_format_signed_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_signed"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_unsigned *(void **) (&snd_pcm_format_unsigned_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_unsigned"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_linear *(void **) (&snd_pcm_format_linear_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_linear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_float *(void **) (&snd_pcm_format_float_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_float"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_little_endian *(void **) (&snd_pcm_format_little_endian_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_little_endian"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_big_endian *(void **) (&snd_pcm_format_big_endian_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_big_endian"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_cpu_endian *(void **) (&snd_pcm_format_cpu_endian_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_cpu_endian"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_width *(void **) (&snd_pcm_format_width_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_width"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_physical_width *(void **) (&snd_pcm_format_physical_width_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_physical_width"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_build_linear_format *(void **) (&snd_pcm_build_linear_format_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_build_linear_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_size *(void **) (&snd_pcm_format_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_silence *(void **) (&snd_pcm_format_silence_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_silence"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_silence_16 *(void **) (&snd_pcm_format_silence_16_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_silence_16"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_silence_32 *(void **) (&snd_pcm_format_silence_32_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_silence_32"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_silence_64 *(void **) (&snd_pcm_format_silence_64_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_silence_64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_format_set_silence *(void **) (&snd_pcm_format_set_silence_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_format_set_silence"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_bytes_to_frames *(void **) (&snd_pcm_bytes_to_frames_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_bytes_to_frames"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_frames_to_bytes *(void **) (&snd_pcm_frames_to_bytes_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_frames_to_bytes"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_bytes_to_samples *(void **) (&snd_pcm_bytes_to_samples_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_bytes_to_samples"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_samples_to_bytes *(void **) (&snd_pcm_samples_to_bytes_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_samples_to_bytes"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_area_silence *(void **) (&snd_pcm_area_silence_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_area_silence"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_areas_silence *(void **) (&snd_pcm_areas_silence_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_areas_silence"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_area_copy *(void **) (&snd_pcm_area_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_area_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_areas_copy *(void **) (&snd_pcm_areas_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_areas_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_areas_copy_wrap *(void **) (&snd_pcm_areas_copy_wrap_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_areas_copy_wrap"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hook_get_pcm *(void **) (&snd_pcm_hook_get_pcm_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hook_get_pcm"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hook_get_private *(void **) (&snd_pcm_hook_get_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hook_get_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hook_set_private *(void **) (&snd_pcm_hook_set_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hook_set_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hook_add *(void **) (&snd_pcm_hook_add_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hook_add"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hook_remove *(void **) (&snd_pcm_hook_remove_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hook_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_get_bufsize *(void **) (&snd_pcm_meter_get_bufsize_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_get_bufsize"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_get_channels *(void **) (&snd_pcm_meter_get_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_get_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_get_rate *(void **) (&snd_pcm_meter_get_rate_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_get_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_get_now *(void **) (&snd_pcm_meter_get_now_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_get_now"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_get_boundary *(void **) (&snd_pcm_meter_get_boundary_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_get_boundary"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_add_scope *(void **) (&snd_pcm_meter_add_scope_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_add_scope"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_meter_search_scope *(void **) (&snd_pcm_meter_search_scope_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_meter_search_scope"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_malloc *(void **) (&snd_pcm_scope_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_set_ops *(void **) (&snd_pcm_scope_set_ops_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_set_ops"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_set_name *(void **) (&snd_pcm_scope_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_get_name *(void **) (&snd_pcm_scope_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_get_callback_private *(void **) (&snd_pcm_scope_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_set_callback_private *(void **) (&snd_pcm_scope_set_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_set_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_s16_open *(void **) (&snd_pcm_scope_s16_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_s16_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_scope_s16_get_channel_buffer *(void **) (&snd_pcm_scope_s16_get_channel_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_scope_s16_get_channel_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_spcm_init *(void **) (&snd_spcm_init_dylibloader_wrapper_asound) = dlsym(handle, "snd_spcm_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_spcm_init_duplex *(void **) (&snd_spcm_init_duplex_dylibloader_wrapper_asound) = dlsym(handle, "snd_spcm_init_duplex"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_spcm_init_get_params *(void **) (&snd_spcm_init_get_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_spcm_init_get_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_start_mode_name *(void **) (&snd_pcm_start_mode_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_start_mode_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_xrun_mode_name *(void **) (&snd_pcm_xrun_mode_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_xrun_mode_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_start_mode *(void **) (&snd_pcm_sw_params_set_start_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_start_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_start_mode *(void **) (&snd_pcm_sw_params_get_start_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_start_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_xrun_mode *(void **) (&snd_pcm_sw_params_set_xrun_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_xrun_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_xrun_mode *(void **) (&snd_pcm_sw_params_get_xrun_mode_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_xrun_mode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_xfer_align *(void **) (&snd_pcm_sw_params_set_xfer_align_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_xfer_align"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_xfer_align *(void **) (&snd_pcm_sw_params_get_xfer_align_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_xfer_align"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_set_sleep_min *(void **) (&snd_pcm_sw_params_set_sleep_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_set_sleep_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_sw_params_get_sleep_min *(void **) (&snd_pcm_sw_params_get_sleep_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_sw_params_get_sleep_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_tick_time *(void **) (&snd_pcm_hw_params_get_tick_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_tick_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_tick_time_min *(void **) (&snd_pcm_hw_params_get_tick_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_tick_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_get_tick_time_max *(void **) (&snd_pcm_hw_params_get_tick_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_get_tick_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_test_tick_time *(void **) (&snd_pcm_hw_params_test_tick_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_test_tick_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time *(void **) (&snd_pcm_hw_params_set_tick_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_min *(void **) (&snd_pcm_hw_params_set_tick_time_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_max *(void **) (&snd_pcm_hw_params_set_tick_time_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_minmax *(void **) (&snd_pcm_hw_params_set_tick_time_minmax_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_minmax"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_near *(void **) (&snd_pcm_hw_params_set_tick_time_near_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_near"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_first *(void **) (&snd_pcm_hw_params_set_tick_time_first_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_first"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_pcm_hw_params_set_tick_time_last *(void **) (&snd_pcm_hw_params_set_tick_time_last_dylibloader_wrapper_asound) = dlsym(handle, "snd_pcm_hw_params_set_tick_time_last"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_open *(void **) (&snd_rawmidi_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_open_lconf *(void **) (&snd_rawmidi_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_close *(void **) (&snd_rawmidi_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_poll_descriptors_count *(void **) (&snd_rawmidi_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_poll_descriptors *(void **) (&snd_rawmidi_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_poll_descriptors_revents *(void **) (&snd_rawmidi_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_nonblock *(void **) (&snd_rawmidi_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_sizeof *(void **) (&snd_rawmidi_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_malloc *(void **) (&snd_rawmidi_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_free *(void **) (&snd_rawmidi_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_copy *(void **) (&snd_rawmidi_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_device *(void **) (&snd_rawmidi_info_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_subdevice *(void **) (&snd_rawmidi_info_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_stream *(void **) (&snd_rawmidi_info_get_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_card *(void **) (&snd_rawmidi_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_flags *(void **) (&snd_rawmidi_info_get_flags_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_flags"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_id *(void **) (&snd_rawmidi_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_name *(void **) (&snd_rawmidi_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_subdevice_name *(void **) (&snd_rawmidi_info_get_subdevice_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_subdevice_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_subdevices_count *(void **) (&snd_rawmidi_info_get_subdevices_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_subdevices_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_get_subdevices_avail *(void **) (&snd_rawmidi_info_get_subdevices_avail_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_get_subdevices_avail"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_set_device *(void **) (&snd_rawmidi_info_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_set_subdevice *(void **) (&snd_rawmidi_info_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info_set_stream *(void **) (&snd_rawmidi_info_set_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info_set_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_info *(void **) (&snd_rawmidi_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_sizeof *(void **) (&snd_rawmidi_params_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_malloc *(void **) (&snd_rawmidi_params_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_free *(void **) (&snd_rawmidi_params_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_copy *(void **) (&snd_rawmidi_params_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_set_buffer_size *(void **) (&snd_rawmidi_params_set_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_set_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_get_buffer_size *(void **) (&snd_rawmidi_params_get_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_get_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_set_avail_min *(void **) (&snd_rawmidi_params_set_avail_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_set_avail_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_get_avail_min *(void **) (&snd_rawmidi_params_get_avail_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_get_avail_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_set_no_active_sensing *(void **) (&snd_rawmidi_params_set_no_active_sensing_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_set_no_active_sensing"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_get_no_active_sensing *(void **) (&snd_rawmidi_params_get_no_active_sensing_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_get_no_active_sensing"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params *(void **) (&snd_rawmidi_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_params_current *(void **) (&snd_rawmidi_params_current_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_params_current"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_sizeof *(void **) (&snd_rawmidi_status_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_malloc *(void **) (&snd_rawmidi_status_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_free *(void **) (&snd_rawmidi_status_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_copy *(void **) (&snd_rawmidi_status_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_get_tstamp *(void **) (&snd_rawmidi_status_get_tstamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_get_tstamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_get_avail *(void **) (&snd_rawmidi_status_get_avail_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_get_avail"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status_get_xruns *(void **) (&snd_rawmidi_status_get_xruns_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status_get_xruns"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_status *(void **) (&snd_rawmidi_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_drain *(void **) (&snd_rawmidi_drain_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_drain"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_drop *(void **) (&snd_rawmidi_drop_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_drop"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_write *(void **) (&snd_rawmidi_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_read *(void **) (&snd_rawmidi_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_name *(void **) (&snd_rawmidi_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_type *(void **) (&snd_rawmidi_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_rawmidi_stream *(void **) (&snd_rawmidi_stream_dylibloader_wrapper_asound) = dlsym(handle, "snd_rawmidi_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_open *(void **) (&snd_timer_query_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_open_lconf *(void **) (&snd_timer_query_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_close *(void **) (&snd_timer_query_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_next_device *(void **) (&snd_timer_query_next_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_next_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_info *(void **) (&snd_timer_query_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_params *(void **) (&snd_timer_query_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_query_status *(void **) (&snd_timer_query_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_query_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_open *(void **) (&snd_timer_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_open_lconf *(void **) (&snd_timer_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_close *(void **) (&snd_timer_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_add_timer_handler *(void **) (&snd_async_add_timer_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_add_timer_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_timer *(void **) (&snd_async_handler_get_timer_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_timer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_poll_descriptors_count *(void **) (&snd_timer_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_poll_descriptors *(void **) (&snd_timer_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_poll_descriptors_revents *(void **) (&snd_timer_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info *(void **) (&snd_timer_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params *(void **) (&snd_timer_params_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status *(void **) (&snd_timer_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_start *(void **) (&snd_timer_start_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_stop *(void **) (&snd_timer_stop_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_stop"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_continue *(void **) (&snd_timer_continue_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_continue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_read *(void **) (&snd_timer_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_sizeof *(void **) (&snd_timer_id_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_malloc *(void **) (&snd_timer_id_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_free *(void **) (&snd_timer_id_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_copy *(void **) (&snd_timer_id_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_set_class *(void **) (&snd_timer_id_set_class_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_set_class"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_get_class *(void **) (&snd_timer_id_get_class_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_get_class"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_set_sclass *(void **) (&snd_timer_id_set_sclass_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_set_sclass"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_get_sclass *(void **) (&snd_timer_id_get_sclass_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_get_sclass"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_set_card *(void **) (&snd_timer_id_set_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_set_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_get_card *(void **) (&snd_timer_id_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_set_device *(void **) (&snd_timer_id_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_get_device *(void **) (&snd_timer_id_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_set_subdevice *(void **) (&snd_timer_id_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_id_get_subdevice *(void **) (&snd_timer_id_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_id_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_sizeof *(void **) (&snd_timer_ginfo_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_malloc *(void **) (&snd_timer_ginfo_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_free *(void **) (&snd_timer_ginfo_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_copy *(void **) (&snd_timer_ginfo_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_set_tid *(void **) (&snd_timer_ginfo_set_tid_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_set_tid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_tid *(void **) (&snd_timer_ginfo_get_tid_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_tid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_flags *(void **) (&snd_timer_ginfo_get_flags_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_flags"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_card *(void **) (&snd_timer_ginfo_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_id *(void **) (&snd_timer_ginfo_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_name *(void **) (&snd_timer_ginfo_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_resolution *(void **) (&snd_timer_ginfo_get_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_resolution_min *(void **) (&snd_timer_ginfo_get_resolution_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_resolution_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_resolution_max *(void **) (&snd_timer_ginfo_get_resolution_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_resolution_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_ginfo_get_clients *(void **) (&snd_timer_ginfo_get_clients_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_ginfo_get_clients"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_sizeof *(void **) (&snd_timer_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_malloc *(void **) (&snd_timer_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_free *(void **) (&snd_timer_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_copy *(void **) (&snd_timer_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_is_slave *(void **) (&snd_timer_info_is_slave_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_is_slave"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_get_card *(void **) (&snd_timer_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_get_id *(void **) (&snd_timer_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_get_name *(void **) (&snd_timer_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_get_resolution *(void **) (&snd_timer_info_get_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_get_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_sizeof *(void **) (&snd_timer_params_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_malloc *(void **) (&snd_timer_params_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_free *(void **) (&snd_timer_params_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_copy *(void **) (&snd_timer_params_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_auto_start *(void **) (&snd_timer_params_set_auto_start_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_auto_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_auto_start *(void **) (&snd_timer_params_get_auto_start_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_auto_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_exclusive *(void **) (&snd_timer_params_set_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_exclusive *(void **) (&snd_timer_params_get_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_early_event *(void **) (&snd_timer_params_set_early_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_early_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_early_event *(void **) (&snd_timer_params_get_early_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_early_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_ticks *(void **) (&snd_timer_params_set_ticks_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_ticks"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_ticks *(void **) (&snd_timer_params_get_ticks_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_ticks"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_queue_size *(void **) (&snd_timer_params_set_queue_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_queue_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_queue_size *(void **) (&snd_timer_params_get_queue_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_queue_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_set_filter *(void **) (&snd_timer_params_set_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_set_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_params_get_filter *(void **) (&snd_timer_params_get_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_params_get_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_sizeof *(void **) (&snd_timer_status_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_malloc *(void **) (&snd_timer_status_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_free *(void **) (&snd_timer_status_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_copy *(void **) (&snd_timer_status_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_get_timestamp *(void **) (&snd_timer_status_get_timestamp_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_get_timestamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_get_resolution *(void **) (&snd_timer_status_get_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_get_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_get_lost *(void **) (&snd_timer_status_get_lost_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_get_lost"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_get_overrun *(void **) (&snd_timer_status_get_overrun_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_get_overrun"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_status_get_queue *(void **) (&snd_timer_status_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_status_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_timer_info_get_ticks *(void **) (&snd_timer_info_get_ticks_dylibloader_wrapper_asound) = dlsym(handle, "snd_timer_info_get_ticks"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_open *(void **) (&snd_hwdep_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_close *(void **) (&snd_hwdep_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_poll_descriptors *(void **) (&snd_hwdep_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_poll_descriptors_count *(void **) (&snd_hwdep_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_poll_descriptors_revents *(void **) (&snd_hwdep_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_nonblock *(void **) (&snd_hwdep_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info *(void **) (&snd_hwdep_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status *(void **) (&snd_hwdep_dsp_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_load *(void **) (&snd_hwdep_dsp_load_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_ioctl *(void **) (&snd_hwdep_ioctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_ioctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_write *(void **) (&snd_hwdep_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_read *(void **) (&snd_hwdep_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_sizeof *(void **) (&snd_hwdep_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_malloc *(void **) (&snd_hwdep_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_free *(void **) (&snd_hwdep_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_copy *(void **) (&snd_hwdep_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_get_device *(void **) (&snd_hwdep_info_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_get_card *(void **) (&snd_hwdep_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_get_id *(void **) (&snd_hwdep_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_get_name *(void **) (&snd_hwdep_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_get_iface *(void **) (&snd_hwdep_info_get_iface_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_get_iface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_info_set_device *(void **) (&snd_hwdep_info_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_info_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_sizeof *(void **) (&snd_hwdep_dsp_status_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_malloc *(void **) (&snd_hwdep_dsp_status_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_free *(void **) (&snd_hwdep_dsp_status_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_copy *(void **) (&snd_hwdep_dsp_status_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_get_version *(void **) (&snd_hwdep_dsp_status_get_version_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_get_version"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_get_id *(void **) (&snd_hwdep_dsp_status_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_get_num_dsps *(void **) (&snd_hwdep_dsp_status_get_num_dsps_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_get_num_dsps"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_get_dsp_loaded *(void **) (&snd_hwdep_dsp_status_get_dsp_loaded_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_get_dsp_loaded"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_status_get_chip_ready *(void **) (&snd_hwdep_dsp_status_get_chip_ready_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_status_get_chip_ready"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_sizeof *(void **) (&snd_hwdep_dsp_image_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_malloc *(void **) (&snd_hwdep_dsp_image_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_free *(void **) (&snd_hwdep_dsp_image_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_copy *(void **) (&snd_hwdep_dsp_image_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_get_index *(void **) (&snd_hwdep_dsp_image_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_get_name *(void **) (&snd_hwdep_dsp_image_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_get_image *(void **) (&snd_hwdep_dsp_image_get_image_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_get_image"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_get_length *(void **) (&snd_hwdep_dsp_image_get_length_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_get_length"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_set_index *(void **) (&snd_hwdep_dsp_image_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_set_name *(void **) (&snd_hwdep_dsp_image_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_set_image *(void **) (&snd_hwdep_dsp_image_set_image_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_set_image"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hwdep_dsp_image_set_length *(void **) (&snd_hwdep_dsp_image_set_length_dylibloader_wrapper_asound) = dlsym(handle, "snd_hwdep_dsp_image_set_length"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_card_load *(void **) (&snd_card_load_dylibloader_wrapper_asound) = dlsym(handle, "snd_card_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_card_next *(void **) (&snd_card_next_dylibloader_wrapper_asound) = dlsym(handle, "snd_card_next"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_card_get_index *(void **) (&snd_card_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_card_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_card_get_name *(void **) (&snd_card_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_card_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_card_get_longname *(void **) (&snd_card_get_longname_dylibloader_wrapper_asound) = dlsym(handle, "snd_card_get_longname"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_device_name_hint *(void **) (&snd_device_name_hint_dylibloader_wrapper_asound) = dlsym(handle, "snd_device_name_hint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_device_name_free_hint *(void **) (&snd_device_name_free_hint_dylibloader_wrapper_asound) = dlsym(handle, "snd_device_name_free_hint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_device_name_get_hint *(void **) (&snd_device_name_get_hint_dylibloader_wrapper_asound) = dlsym(handle, "snd_device_name_get_hint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_open *(void **) (&snd_ctl_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_open_lconf *(void **) (&snd_ctl_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_open_fallback *(void **) (&snd_ctl_open_fallback_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_open_fallback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_close *(void **) (&snd_ctl_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_nonblock *(void **) (&snd_ctl_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_add_ctl_handler *(void **) (&snd_async_add_ctl_handler_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_add_ctl_handler"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_async_handler_get_ctl *(void **) (&snd_async_handler_get_ctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_async_handler_get_ctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_poll_descriptors_count *(void **) (&snd_ctl_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_poll_descriptors *(void **) (&snd_ctl_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_poll_descriptors_revents *(void **) (&snd_ctl_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_subscribe_events *(void **) (&snd_ctl_subscribe_events_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_subscribe_events"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info *(void **) (&snd_ctl_card_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list *(void **) (&snd_ctl_elem_list_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info *(void **) (&snd_ctl_elem_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_read *(void **) (&snd_ctl_elem_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_write *(void **) (&snd_ctl_elem_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_lock *(void **) (&snd_ctl_elem_lock_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_lock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_unlock *(void **) (&snd_ctl_elem_unlock_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_unlock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_tlv_read *(void **) (&snd_ctl_elem_tlv_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_tlv_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_tlv_write *(void **) (&snd_ctl_elem_tlv_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_tlv_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_tlv_command *(void **) (&snd_ctl_elem_tlv_command_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_tlv_command"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_hwdep_next_device *(void **) (&snd_ctl_hwdep_next_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_hwdep_next_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_hwdep_info *(void **) (&snd_ctl_hwdep_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_hwdep_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_pcm_next_device *(void **) (&snd_ctl_pcm_next_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_pcm_next_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_pcm_info *(void **) (&snd_ctl_pcm_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_pcm_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_pcm_prefer_subdevice *(void **) (&snd_ctl_pcm_prefer_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_pcm_prefer_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_rawmidi_next_device *(void **) (&snd_ctl_rawmidi_next_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_rawmidi_next_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_rawmidi_info *(void **) (&snd_ctl_rawmidi_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_rawmidi_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_rawmidi_prefer_subdevice *(void **) (&snd_ctl_rawmidi_prefer_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_rawmidi_prefer_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_set_power_state *(void **) (&snd_ctl_set_power_state_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_set_power_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_get_power_state *(void **) (&snd_ctl_get_power_state_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_get_power_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_read *(void **) (&snd_ctl_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_wait *(void **) (&snd_ctl_wait_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_wait"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_name *(void **) (&snd_ctl_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_type *(void **) (&snd_ctl_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_type_name *(void **) (&snd_ctl_elem_type_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_type_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_iface_name *(void **) (&snd_ctl_elem_iface_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_iface_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_type_name *(void **) (&snd_ctl_event_type_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_type_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_mask *(void **) (&snd_ctl_event_elem_get_mask_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_numid *(void **) (&snd_ctl_event_elem_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_id *(void **) (&snd_ctl_event_elem_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_interface *(void **) (&snd_ctl_event_elem_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_device *(void **) (&snd_ctl_event_elem_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_subdevice *(void **) (&snd_ctl_event_elem_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_name *(void **) (&snd_ctl_event_elem_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_elem_get_index *(void **) (&snd_ctl_event_elem_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_elem_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_alloc_space *(void **) (&snd_ctl_elem_list_alloc_space_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_alloc_space"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_free_space *(void **) (&snd_ctl_elem_list_free_space_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_free_space"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_ascii_elem_id_get *(void **) (&snd_ctl_ascii_elem_id_get_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_ascii_elem_id_get"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_ascii_elem_id_parse *(void **) (&snd_ctl_ascii_elem_id_parse_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_ascii_elem_id_parse"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_ascii_value_parse *(void **) (&snd_ctl_ascii_value_parse_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_ascii_value_parse"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_sizeof *(void **) (&snd_ctl_elem_id_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_malloc *(void **) (&snd_ctl_elem_id_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_free *(void **) (&snd_ctl_elem_id_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_clear *(void **) (&snd_ctl_elem_id_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_copy *(void **) (&snd_ctl_elem_id_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_numid *(void **) (&snd_ctl_elem_id_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_interface *(void **) (&snd_ctl_elem_id_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_device *(void **) (&snd_ctl_elem_id_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_subdevice *(void **) (&snd_ctl_elem_id_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_name *(void **) (&snd_ctl_elem_id_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_get_index *(void **) (&snd_ctl_elem_id_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_numid *(void **) (&snd_ctl_elem_id_set_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_interface *(void **) (&snd_ctl_elem_id_set_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_device *(void **) (&snd_ctl_elem_id_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_subdevice *(void **) (&snd_ctl_elem_id_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_name *(void **) (&snd_ctl_elem_id_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_id_set_index *(void **) (&snd_ctl_elem_id_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_id_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_sizeof *(void **) (&snd_ctl_card_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_malloc *(void **) (&snd_ctl_card_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_free *(void **) (&snd_ctl_card_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_clear *(void **) (&snd_ctl_card_info_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_copy *(void **) (&snd_ctl_card_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_card *(void **) (&snd_ctl_card_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_id *(void **) (&snd_ctl_card_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_driver *(void **) (&snd_ctl_card_info_get_driver_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_driver"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_name *(void **) (&snd_ctl_card_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_longname *(void **) (&snd_ctl_card_info_get_longname_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_longname"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_mixername *(void **) (&snd_ctl_card_info_get_mixername_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_mixername"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_card_info_get_components *(void **) (&snd_ctl_card_info_get_components_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_card_info_get_components"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_sizeof *(void **) (&snd_ctl_event_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_malloc *(void **) (&snd_ctl_event_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_free *(void **) (&snd_ctl_event_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_clear *(void **) (&snd_ctl_event_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_copy *(void **) (&snd_ctl_event_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_event_get_type *(void **) (&snd_ctl_event_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_event_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_sizeof *(void **) (&snd_ctl_elem_list_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_malloc *(void **) (&snd_ctl_elem_list_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_free *(void **) (&snd_ctl_elem_list_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_clear *(void **) (&snd_ctl_elem_list_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_copy *(void **) (&snd_ctl_elem_list_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_set_offset *(void **) (&snd_ctl_elem_list_set_offset_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_set_offset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_used *(void **) (&snd_ctl_elem_list_get_used_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_used"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_count *(void **) (&snd_ctl_elem_list_get_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_id *(void **) (&snd_ctl_elem_list_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_numid *(void **) (&snd_ctl_elem_list_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_interface *(void **) (&snd_ctl_elem_list_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_device *(void **) (&snd_ctl_elem_list_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_subdevice *(void **) (&snd_ctl_elem_list_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_name *(void **) (&snd_ctl_elem_list_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_list_get_index *(void **) (&snd_ctl_elem_list_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_list_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_sizeof *(void **) (&snd_ctl_elem_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_malloc *(void **) (&snd_ctl_elem_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_free *(void **) (&snd_ctl_elem_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_clear *(void **) (&snd_ctl_elem_info_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_copy *(void **) (&snd_ctl_elem_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_type *(void **) (&snd_ctl_elem_info_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_readable *(void **) (&snd_ctl_elem_info_is_readable_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_readable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_writable *(void **) (&snd_ctl_elem_info_is_writable_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_writable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_volatile *(void **) (&snd_ctl_elem_info_is_volatile_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_volatile"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_inactive *(void **) (&snd_ctl_elem_info_is_inactive_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_inactive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_locked *(void **) (&snd_ctl_elem_info_is_locked_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_locked"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_tlv_readable *(void **) (&snd_ctl_elem_info_is_tlv_readable_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_tlv_readable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_tlv_writable *(void **) (&snd_ctl_elem_info_is_tlv_writable_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_tlv_writable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_tlv_commandable *(void **) (&snd_ctl_elem_info_is_tlv_commandable_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_tlv_commandable"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_owner *(void **) (&snd_ctl_elem_info_is_owner_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_owner"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_is_user *(void **) (&snd_ctl_elem_info_is_user_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_is_user"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_owner *(void **) (&snd_ctl_elem_info_get_owner_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_owner"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_count *(void **) (&snd_ctl_elem_info_get_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_min *(void **) (&snd_ctl_elem_info_get_min_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_max *(void **) (&snd_ctl_elem_info_get_max_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_step *(void **) (&snd_ctl_elem_info_get_step_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_step"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_min64 *(void **) (&snd_ctl_elem_info_get_min64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_min64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_max64 *(void **) (&snd_ctl_elem_info_get_max64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_max64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_step64 *(void **) (&snd_ctl_elem_info_get_step64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_step64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_items *(void **) (&snd_ctl_elem_info_get_items_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_items"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_item *(void **) (&snd_ctl_elem_info_set_item_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_item"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_item_name *(void **) (&snd_ctl_elem_info_get_item_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_item_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_dimensions *(void **) (&snd_ctl_elem_info_get_dimensions_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_dimensions"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_dimension *(void **) (&snd_ctl_elem_info_get_dimension_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_dimension"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_dimension *(void **) (&snd_ctl_elem_info_set_dimension_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_dimension"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_id *(void **) (&snd_ctl_elem_info_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_numid *(void **) (&snd_ctl_elem_info_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_interface *(void **) (&snd_ctl_elem_info_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_device *(void **) (&snd_ctl_elem_info_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_subdevice *(void **) (&snd_ctl_elem_info_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_name *(void **) (&snd_ctl_elem_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_get_index *(void **) (&snd_ctl_elem_info_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_id *(void **) (&snd_ctl_elem_info_set_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_numid *(void **) (&snd_ctl_elem_info_set_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_interface *(void **) (&snd_ctl_elem_info_set_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_device *(void **) (&snd_ctl_elem_info_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_subdevice *(void **) (&snd_ctl_elem_info_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_name *(void **) (&snd_ctl_elem_info_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_info_set_index *(void **) (&snd_ctl_elem_info_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_info_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_add_integer_elem_set *(void **) (&snd_ctl_add_integer_elem_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_add_integer_elem_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_add_integer64_elem_set *(void **) (&snd_ctl_add_integer64_elem_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_add_integer64_elem_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_add_boolean_elem_set *(void **) (&snd_ctl_add_boolean_elem_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_add_boolean_elem_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_add_enumerated_elem_set *(void **) (&snd_ctl_add_enumerated_elem_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_add_enumerated_elem_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_add_bytes_elem_set *(void **) (&snd_ctl_add_bytes_elem_set_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_add_bytes_elem_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_add_integer *(void **) (&snd_ctl_elem_add_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_add_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_add_integer64 *(void **) (&snd_ctl_elem_add_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_add_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_add_boolean *(void **) (&snd_ctl_elem_add_boolean_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_add_boolean"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_add_enumerated *(void **) (&snd_ctl_elem_add_enumerated_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_add_enumerated"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_add_iec958 *(void **) (&snd_ctl_elem_add_iec958_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_add_iec958"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_remove *(void **) (&snd_ctl_elem_remove_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_sizeof *(void **) (&snd_ctl_elem_value_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_malloc *(void **) (&snd_ctl_elem_value_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_free *(void **) (&snd_ctl_elem_value_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_clear *(void **) (&snd_ctl_elem_value_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_copy *(void **) (&snd_ctl_elem_value_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_compare *(void **) (&snd_ctl_elem_value_compare_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_compare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_id *(void **) (&snd_ctl_elem_value_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_numid *(void **) (&snd_ctl_elem_value_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_interface *(void **) (&snd_ctl_elem_value_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_device *(void **) (&snd_ctl_elem_value_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_subdevice *(void **) (&snd_ctl_elem_value_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_name *(void **) (&snd_ctl_elem_value_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_index *(void **) (&snd_ctl_elem_value_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_id *(void **) (&snd_ctl_elem_value_set_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_numid *(void **) (&snd_ctl_elem_value_set_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_interface *(void **) (&snd_ctl_elem_value_set_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_device *(void **) (&snd_ctl_elem_value_set_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_subdevice *(void **) (&snd_ctl_elem_value_set_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_name *(void **) (&snd_ctl_elem_value_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_index *(void **) (&snd_ctl_elem_value_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_boolean *(void **) (&snd_ctl_elem_value_get_boolean_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_boolean"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_integer *(void **) (&snd_ctl_elem_value_get_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_integer64 *(void **) (&snd_ctl_elem_value_get_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_enumerated *(void **) (&snd_ctl_elem_value_get_enumerated_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_enumerated"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_byte *(void **) (&snd_ctl_elem_value_get_byte_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_byte"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_boolean *(void **) (&snd_ctl_elem_value_set_boolean_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_boolean"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_integer *(void **) (&snd_ctl_elem_value_set_integer_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_integer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_integer64 *(void **) (&snd_ctl_elem_value_set_integer64_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_integer64"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_enumerated *(void **) (&snd_ctl_elem_value_set_enumerated_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_enumerated"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_byte *(void **) (&snd_ctl_elem_value_set_byte_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_byte"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_set_bytes *(void **) (&snd_ctl_elem_set_bytes_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_set_bytes"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_bytes *(void **) (&snd_ctl_elem_value_get_bytes_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_bytes"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_get_iec958 *(void **) (&snd_ctl_elem_value_get_iec958_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_get_iec958"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_elem_value_set_iec958 *(void **) (&snd_ctl_elem_value_set_iec958_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_elem_value_set_iec958"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_tlv_parse_dB_info *(void **) (&snd_tlv_parse_dB_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_tlv_parse_dB_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_tlv_get_dB_range *(void **) (&snd_tlv_get_dB_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_tlv_get_dB_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_tlv_convert_to_dB *(void **) (&snd_tlv_convert_to_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_tlv_convert_to_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_tlv_convert_from_dB *(void **) (&snd_tlv_convert_from_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_tlv_convert_from_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_get_dB_range *(void **) (&snd_ctl_get_dB_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_get_dB_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_convert_to_dB *(void **) (&snd_ctl_convert_to_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_convert_to_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_ctl_convert_from_dB *(void **) (&snd_ctl_convert_from_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_ctl_convert_from_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_compare_fast *(void **) (&snd_hctl_compare_fast_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_compare_fast"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_open *(void **) (&snd_hctl_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_open_ctl *(void **) (&snd_hctl_open_ctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_open_ctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_close *(void **) (&snd_hctl_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_nonblock *(void **) (&snd_hctl_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_poll_descriptors_count *(void **) (&snd_hctl_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_poll_descriptors *(void **) (&snd_hctl_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_poll_descriptors_revents *(void **) (&snd_hctl_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_get_count *(void **) (&snd_hctl_get_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_get_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_set_compare *(void **) (&snd_hctl_set_compare_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_set_compare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_first_elem *(void **) (&snd_hctl_first_elem_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_first_elem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_last_elem *(void **) (&snd_hctl_last_elem_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_last_elem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_find_elem *(void **) (&snd_hctl_find_elem_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_find_elem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_set_callback *(void **) (&snd_hctl_set_callback_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_set_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_set_callback_private *(void **) (&snd_hctl_set_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_set_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_get_callback_private *(void **) (&snd_hctl_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_load *(void **) (&snd_hctl_load_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_free *(void **) (&snd_hctl_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_handle_events *(void **) (&snd_hctl_handle_events_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_handle_events"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_name *(void **) (&snd_hctl_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_wait *(void **) (&snd_hctl_wait_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_wait"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_ctl *(void **) (&snd_hctl_ctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_ctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_next *(void **) (&snd_hctl_elem_next_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_next"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_prev *(void **) (&snd_hctl_elem_prev_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_prev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_info *(void **) (&snd_hctl_elem_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_read *(void **) (&snd_hctl_elem_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_write *(void **) (&snd_hctl_elem_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_tlv_read *(void **) (&snd_hctl_elem_tlv_read_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_tlv_read"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_tlv_write *(void **) (&snd_hctl_elem_tlv_write_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_tlv_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_tlv_command *(void **) (&snd_hctl_elem_tlv_command_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_tlv_command"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_hctl *(void **) (&snd_hctl_elem_get_hctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_hctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_id *(void **) (&snd_hctl_elem_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_numid *(void **) (&snd_hctl_elem_get_numid_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_numid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_interface *(void **) (&snd_hctl_elem_get_interface_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_interface"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_device *(void **) (&snd_hctl_elem_get_device_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_subdevice *(void **) (&snd_hctl_elem_get_subdevice_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_subdevice"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_name *(void **) (&snd_hctl_elem_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_index *(void **) (&snd_hctl_elem_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_set_callback *(void **) (&snd_hctl_elem_set_callback_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_set_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_get_callback_private *(void **) (&snd_hctl_elem_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_hctl_elem_set_callback_private *(void **) (&snd_hctl_elem_set_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_hctl_elem_set_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_sctl_build *(void **) (&snd_sctl_build_dylibloader_wrapper_asound) = dlsym(handle, "snd_sctl_build"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_sctl_free *(void **) (&snd_sctl_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_sctl_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_sctl_install *(void **) (&snd_sctl_install_dylibloader_wrapper_asound) = dlsym(handle, "snd_sctl_install"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_sctl_remove *(void **) (&snd_sctl_remove_dylibloader_wrapper_asound) = dlsym(handle, "snd_sctl_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_open *(void **) (&snd_mixer_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_close *(void **) (&snd_mixer_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_first_elem *(void **) (&snd_mixer_first_elem_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_first_elem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_last_elem *(void **) (&snd_mixer_last_elem_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_last_elem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_handle_events *(void **) (&snd_mixer_handle_events_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_handle_events"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_attach *(void **) (&snd_mixer_attach_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_attach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_attach_hctl *(void **) (&snd_mixer_attach_hctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_attach_hctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_detach *(void **) (&snd_mixer_detach_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_detach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_detach_hctl *(void **) (&snd_mixer_detach_hctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_detach_hctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_get_hctl *(void **) (&snd_mixer_get_hctl_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_get_hctl"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_poll_descriptors_count *(void **) (&snd_mixer_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_poll_descriptors *(void **) (&snd_mixer_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_poll_descriptors_revents *(void **) (&snd_mixer_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_load *(void **) (&snd_mixer_load_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_free *(void **) (&snd_mixer_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_wait *(void **) (&snd_mixer_wait_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_wait"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_set_compare *(void **) (&snd_mixer_set_compare_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_set_compare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_set_callback *(void **) (&snd_mixer_set_callback_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_set_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_get_callback_private *(void **) (&snd_mixer_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_set_callback_private *(void **) (&snd_mixer_set_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_set_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_get_count *(void **) (&snd_mixer_get_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_get_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_unregister *(void **) (&snd_mixer_class_unregister_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_unregister"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_next *(void **) (&snd_mixer_elem_next_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_next"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_prev *(void **) (&snd_mixer_elem_prev_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_prev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_set_callback *(void **) (&snd_mixer_elem_set_callback_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_set_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_get_callback_private *(void **) (&snd_mixer_elem_get_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_get_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_set_callback_private *(void **) (&snd_mixer_elem_set_callback_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_set_callback_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_get_type *(void **) (&snd_mixer_elem_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_register *(void **) (&snd_mixer_class_register_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_register"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_new *(void **) (&snd_mixer_elem_new_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_add *(void **) (&snd_mixer_elem_add_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_add"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_remove *(void **) (&snd_mixer_elem_remove_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_free *(void **) (&snd_mixer_elem_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_info *(void **) (&snd_mixer_elem_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_value *(void **) (&snd_mixer_elem_value_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_attach *(void **) (&snd_mixer_elem_attach_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_attach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_detach *(void **) (&snd_mixer_elem_detach_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_detach"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_empty *(void **) (&snd_mixer_elem_empty_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_empty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_elem_get_private *(void **) (&snd_mixer_elem_get_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_elem_get_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_sizeof *(void **) (&snd_mixer_class_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_malloc *(void **) (&snd_mixer_class_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_free *(void **) (&snd_mixer_class_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_copy *(void **) (&snd_mixer_class_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_get_mixer *(void **) (&snd_mixer_class_get_mixer_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_get_mixer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_get_event *(void **) (&snd_mixer_class_get_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_get_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_get_private *(void **) (&snd_mixer_class_get_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_get_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_get_compare *(void **) (&snd_mixer_class_get_compare_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_get_compare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_set_event *(void **) (&snd_mixer_class_set_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_set_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_set_private *(void **) (&snd_mixer_class_set_private_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_set_private"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_set_private_free *(void **) (&snd_mixer_class_set_private_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_set_private_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_class_set_compare *(void **) (&snd_mixer_class_set_compare_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_class_set_compare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_channel_name *(void **) (&snd_mixer_selem_channel_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_channel_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_register *(void **) (&snd_mixer_selem_register_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_register"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_id *(void **) (&snd_mixer_selem_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_name *(void **) (&snd_mixer_selem_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_index *(void **) (&snd_mixer_selem_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_find_selem *(void **) (&snd_mixer_find_selem_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_find_selem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_active *(void **) (&snd_mixer_selem_is_active_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_active"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_playback_mono *(void **) (&snd_mixer_selem_is_playback_mono_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_playback_mono"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_playback_channel *(void **) (&snd_mixer_selem_has_playback_channel_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_playback_channel"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_capture_mono *(void **) (&snd_mixer_selem_is_capture_mono_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_capture_mono"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_channel *(void **) (&snd_mixer_selem_has_capture_channel_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_channel"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_group *(void **) (&snd_mixer_selem_get_capture_group_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_group"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_common_volume *(void **) (&snd_mixer_selem_has_common_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_common_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_playback_volume *(void **) (&snd_mixer_selem_has_playback_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_playback_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_playback_volume_joined *(void **) (&snd_mixer_selem_has_playback_volume_joined_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_playback_volume_joined"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_volume *(void **) (&snd_mixer_selem_has_capture_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_volume_joined *(void **) (&snd_mixer_selem_has_capture_volume_joined_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_volume_joined"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_common_switch *(void **) (&snd_mixer_selem_has_common_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_common_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_playback_switch *(void **) (&snd_mixer_selem_has_playback_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_playback_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_playback_switch_joined *(void **) (&snd_mixer_selem_has_playback_switch_joined_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_playback_switch_joined"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_switch *(void **) (&snd_mixer_selem_has_capture_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_switch_joined *(void **) (&snd_mixer_selem_has_capture_switch_joined_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_switch_joined"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_has_capture_switch_exclusive *(void **) (&snd_mixer_selem_has_capture_switch_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_has_capture_switch_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_ask_playback_vol_dB *(void **) (&snd_mixer_selem_ask_playback_vol_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_ask_playback_vol_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_ask_capture_vol_dB *(void **) (&snd_mixer_selem_ask_capture_vol_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_ask_capture_vol_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_ask_playback_dB_vol *(void **) (&snd_mixer_selem_ask_playback_dB_vol_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_ask_playback_dB_vol"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_ask_capture_dB_vol *(void **) (&snd_mixer_selem_ask_capture_dB_vol_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_ask_capture_dB_vol"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_playback_volume *(void **) (&snd_mixer_selem_get_playback_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_playback_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_volume *(void **) (&snd_mixer_selem_get_capture_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_playback_dB *(void **) (&snd_mixer_selem_get_playback_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_playback_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_dB *(void **) (&snd_mixer_selem_get_capture_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_playback_switch *(void **) (&snd_mixer_selem_get_playback_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_playback_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_switch *(void **) (&snd_mixer_selem_get_capture_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_volume *(void **) (&snd_mixer_selem_set_playback_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_volume *(void **) (&snd_mixer_selem_set_capture_volume_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_dB *(void **) (&snd_mixer_selem_set_playback_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_dB *(void **) (&snd_mixer_selem_set_capture_dB_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_volume_all *(void **) (&snd_mixer_selem_set_playback_volume_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_volume_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_volume_all *(void **) (&snd_mixer_selem_set_capture_volume_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_volume_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_dB_all *(void **) (&snd_mixer_selem_set_playback_dB_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_dB_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_dB_all *(void **) (&snd_mixer_selem_set_capture_dB_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_dB_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_switch *(void **) (&snd_mixer_selem_set_playback_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_switch *(void **) (&snd_mixer_selem_set_capture_switch_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_switch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_switch_all *(void **) (&snd_mixer_selem_set_playback_switch_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_switch_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_switch_all *(void **) (&snd_mixer_selem_set_capture_switch_all_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_switch_all"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_playback_volume_range *(void **) (&snd_mixer_selem_get_playback_volume_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_playback_volume_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_playback_dB_range *(void **) (&snd_mixer_selem_get_playback_dB_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_playback_dB_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_playback_volume_range *(void **) (&snd_mixer_selem_set_playback_volume_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_playback_volume_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_volume_range *(void **) (&snd_mixer_selem_get_capture_volume_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_volume_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_capture_dB_range *(void **) (&snd_mixer_selem_get_capture_dB_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_capture_dB_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_capture_volume_range *(void **) (&snd_mixer_selem_set_capture_volume_range_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_capture_volume_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_enumerated *(void **) (&snd_mixer_selem_is_enumerated_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_enumerated"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_enum_playback *(void **) (&snd_mixer_selem_is_enum_playback_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_enum_playback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_is_enum_capture *(void **) (&snd_mixer_selem_is_enum_capture_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_is_enum_capture"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_enum_items *(void **) (&snd_mixer_selem_get_enum_items_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_enum_items"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_enum_item_name *(void **) (&snd_mixer_selem_get_enum_item_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_enum_item_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_get_enum_item *(void **) (&snd_mixer_selem_get_enum_item_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_get_enum_item"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_set_enum_item *(void **) (&snd_mixer_selem_set_enum_item_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_set_enum_item"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_sizeof *(void **) (&snd_mixer_selem_id_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_malloc *(void **) (&snd_mixer_selem_id_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_free *(void **) (&snd_mixer_selem_id_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_copy *(void **) (&snd_mixer_selem_id_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_get_name *(void **) (&snd_mixer_selem_id_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_get_index *(void **) (&snd_mixer_selem_id_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_set_name *(void **) (&snd_mixer_selem_id_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_set_index *(void **) (&snd_mixer_selem_id_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_mixer_selem_id_parse *(void **) (&snd_mixer_selem_id_parse_dylibloader_wrapper_asound) = dlsym(handle, "snd_mixer_selem_id_parse"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_open *(void **) (&snd_seq_open_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_open"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_open_lconf *(void **) (&snd_seq_open_lconf_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_open_lconf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_name *(void **) (&snd_seq_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_type *(void **) (&snd_seq_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_close *(void **) (&snd_seq_close_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_close"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_poll_descriptors_count *(void **) (&snd_seq_poll_descriptors_count_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_poll_descriptors_count"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_poll_descriptors *(void **) (&snd_seq_poll_descriptors_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_poll_descriptors"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_poll_descriptors_revents *(void **) (&snd_seq_poll_descriptors_revents_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_poll_descriptors_revents"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_nonblock *(void **) (&snd_seq_nonblock_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_nonblock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_id *(void **) (&snd_seq_client_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_output_buffer_size *(void **) (&snd_seq_get_output_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_output_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_input_buffer_size *(void **) (&snd_seq_get_input_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_input_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_output_buffer_size *(void **) (&snd_seq_set_output_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_output_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_input_buffer_size *(void **) (&snd_seq_set_input_buffer_size_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_input_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_sizeof *(void **) (&snd_seq_system_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_malloc *(void **) (&snd_seq_system_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_free *(void **) (&snd_seq_system_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_copy *(void **) (&snd_seq_system_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_queues *(void **) (&snd_seq_system_info_get_queues_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_queues"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_clients *(void **) (&snd_seq_system_info_get_clients_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_clients"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_ports *(void **) (&snd_seq_system_info_get_ports_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_ports"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_channels *(void **) (&snd_seq_system_info_get_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_cur_clients *(void **) (&snd_seq_system_info_get_cur_clients_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_cur_clients"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info_get_cur_queues *(void **) (&snd_seq_system_info_get_cur_queues_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info_get_cur_queues"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_system_info *(void **) (&snd_seq_system_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_system_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_sizeof *(void **) (&snd_seq_client_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_malloc *(void **) (&snd_seq_client_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_free *(void **) (&snd_seq_client_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_copy *(void **) (&snd_seq_client_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_client *(void **) (&snd_seq_client_info_get_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_type *(void **) (&snd_seq_client_info_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_name *(void **) (&snd_seq_client_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_broadcast_filter *(void **) (&snd_seq_client_info_get_broadcast_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_broadcast_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_error_bounce *(void **) (&snd_seq_client_info_get_error_bounce_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_error_bounce"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_card *(void **) (&snd_seq_client_info_get_card_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_card"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_pid *(void **) (&snd_seq_client_info_get_pid_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_pid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_event_filter *(void **) (&snd_seq_client_info_get_event_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_event_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_num_ports *(void **) (&snd_seq_client_info_get_num_ports_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_num_ports"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_get_event_lost *(void **) (&snd_seq_client_info_get_event_lost_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_get_event_lost"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_set_client *(void **) (&snd_seq_client_info_set_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_set_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_set_name *(void **) (&snd_seq_client_info_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_set_broadcast_filter *(void **) (&snd_seq_client_info_set_broadcast_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_set_broadcast_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_set_error_bounce *(void **) (&snd_seq_client_info_set_error_bounce_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_set_error_bounce"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_set_event_filter *(void **) (&snd_seq_client_info_set_event_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_set_event_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_event_filter_clear *(void **) (&snd_seq_client_info_event_filter_clear_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_event_filter_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_event_filter_add *(void **) (&snd_seq_client_info_event_filter_add_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_event_filter_add"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_event_filter_del *(void **) (&snd_seq_client_info_event_filter_del_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_event_filter_del"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_info_event_filter_check *(void **) (&snd_seq_client_info_event_filter_check_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_info_event_filter_check"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_client_info *(void **) (&snd_seq_get_client_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_client_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_any_client_info *(void **) (&snd_seq_get_any_client_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_any_client_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_info *(void **) (&snd_seq_set_client_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_next_client *(void **) (&snd_seq_query_next_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_next_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_sizeof *(void **) (&snd_seq_client_pool_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_malloc *(void **) (&snd_seq_client_pool_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_free *(void **) (&snd_seq_client_pool_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_copy *(void **) (&snd_seq_client_pool_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_client *(void **) (&snd_seq_client_pool_get_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_output_pool *(void **) (&snd_seq_client_pool_get_output_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_output_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_input_pool *(void **) (&snd_seq_client_pool_get_input_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_input_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_output_room *(void **) (&snd_seq_client_pool_get_output_room_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_output_room"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_output_free *(void **) (&snd_seq_client_pool_get_output_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_output_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_get_input_free *(void **) (&snd_seq_client_pool_get_input_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_get_input_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_set_output_pool *(void **) (&snd_seq_client_pool_set_output_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_set_output_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_set_input_pool *(void **) (&snd_seq_client_pool_set_input_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_set_input_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_client_pool_set_output_room *(void **) (&snd_seq_client_pool_set_output_room_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_client_pool_set_output_room"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_client_pool *(void **) (&snd_seq_get_client_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_client_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_pool *(void **) (&snd_seq_set_client_pool_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_pool"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_sizeof *(void **) (&snd_seq_port_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_malloc *(void **) (&snd_seq_port_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_free *(void **) (&snd_seq_port_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_copy *(void **) (&snd_seq_port_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_client *(void **) (&snd_seq_port_info_get_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_port *(void **) (&snd_seq_port_info_get_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_addr *(void **) (&snd_seq_port_info_get_addr_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_addr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_name *(void **) (&snd_seq_port_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_capability *(void **) (&snd_seq_port_info_get_capability_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_capability"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_type *(void **) (&snd_seq_port_info_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_midi_channels *(void **) (&snd_seq_port_info_get_midi_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_midi_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_midi_voices *(void **) (&snd_seq_port_info_get_midi_voices_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_midi_voices"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_synth_voices *(void **) (&snd_seq_port_info_get_synth_voices_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_synth_voices"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_read_use *(void **) (&snd_seq_port_info_get_read_use_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_read_use"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_write_use *(void **) (&snd_seq_port_info_get_write_use_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_write_use"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_port_specified *(void **) (&snd_seq_port_info_get_port_specified_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_port_specified"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_timestamping *(void **) (&snd_seq_port_info_get_timestamping_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_timestamping"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_timestamp_real *(void **) (&snd_seq_port_info_get_timestamp_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_timestamp_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_get_timestamp_queue *(void **) (&snd_seq_port_info_get_timestamp_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_get_timestamp_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_client *(void **) (&snd_seq_port_info_set_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_port *(void **) (&snd_seq_port_info_set_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_addr *(void **) (&snd_seq_port_info_set_addr_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_addr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_name *(void **) (&snd_seq_port_info_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_capability *(void **) (&snd_seq_port_info_set_capability_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_capability"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_type *(void **) (&snd_seq_port_info_set_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_midi_channels *(void **) (&snd_seq_port_info_set_midi_channels_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_midi_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_midi_voices *(void **) (&snd_seq_port_info_set_midi_voices_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_midi_voices"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_synth_voices *(void **) (&snd_seq_port_info_set_synth_voices_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_synth_voices"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_port_specified *(void **) (&snd_seq_port_info_set_port_specified_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_port_specified"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_timestamping *(void **) (&snd_seq_port_info_set_timestamping_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_timestamping"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_timestamp_real *(void **) (&snd_seq_port_info_set_timestamp_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_timestamp_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_info_set_timestamp_queue *(void **) (&snd_seq_port_info_set_timestamp_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_info_set_timestamp_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_create_port *(void **) (&snd_seq_create_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_create_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_delete_port *(void **) (&snd_seq_delete_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_delete_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_port_info *(void **) (&snd_seq_get_port_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_port_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_any_port_info *(void **) (&snd_seq_get_any_port_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_any_port_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_port_info *(void **) (&snd_seq_set_port_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_port_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_next_port *(void **) (&snd_seq_query_next_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_next_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_sizeof *(void **) (&snd_seq_port_subscribe_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_malloc *(void **) (&snd_seq_port_subscribe_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_free *(void **) (&snd_seq_port_subscribe_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_copy *(void **) (&snd_seq_port_subscribe_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_sender *(void **) (&snd_seq_port_subscribe_get_sender_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_sender"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_dest *(void **) (&snd_seq_port_subscribe_get_dest_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_dest"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_queue *(void **) (&snd_seq_port_subscribe_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_exclusive *(void **) (&snd_seq_port_subscribe_get_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_time_update *(void **) (&snd_seq_port_subscribe_get_time_update_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_time_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_get_time_real *(void **) (&snd_seq_port_subscribe_get_time_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_get_time_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_sender *(void **) (&snd_seq_port_subscribe_set_sender_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_sender"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_dest *(void **) (&snd_seq_port_subscribe_set_dest_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_dest"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_queue *(void **) (&snd_seq_port_subscribe_set_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_exclusive *(void **) (&snd_seq_port_subscribe_set_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_time_update *(void **) (&snd_seq_port_subscribe_set_time_update_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_time_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_port_subscribe_set_time_real *(void **) (&snd_seq_port_subscribe_set_time_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_port_subscribe_set_time_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_port_subscription *(void **) (&snd_seq_get_port_subscription_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_port_subscription"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_subscribe_port *(void **) (&snd_seq_subscribe_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_subscribe_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_unsubscribe_port *(void **) (&snd_seq_unsubscribe_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_unsubscribe_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_sizeof *(void **) (&snd_seq_query_subscribe_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_malloc *(void **) (&snd_seq_query_subscribe_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_free *(void **) (&snd_seq_query_subscribe_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_copy *(void **) (&snd_seq_query_subscribe_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_client *(void **) (&snd_seq_query_subscribe_get_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_port *(void **) (&snd_seq_query_subscribe_get_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_root *(void **) (&snd_seq_query_subscribe_get_root_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_root"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_type *(void **) (&snd_seq_query_subscribe_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_index *(void **) (&snd_seq_query_subscribe_get_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_num_subs *(void **) (&snd_seq_query_subscribe_get_num_subs_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_num_subs"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_addr *(void **) (&snd_seq_query_subscribe_get_addr_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_addr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_queue *(void **) (&snd_seq_query_subscribe_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_exclusive *(void **) (&snd_seq_query_subscribe_get_exclusive_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_exclusive"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_time_update *(void **) (&snd_seq_query_subscribe_get_time_update_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_time_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_get_time_real *(void **) (&snd_seq_query_subscribe_get_time_real_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_get_time_real"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_set_client *(void **) (&snd_seq_query_subscribe_set_client_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_set_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_set_port *(void **) (&snd_seq_query_subscribe_set_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_set_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_set_root *(void **) (&snd_seq_query_subscribe_set_root_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_set_root"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_set_type *(void **) (&snd_seq_query_subscribe_set_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_set_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_subscribe_set_index *(void **) (&snd_seq_query_subscribe_set_index_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_subscribe_set_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_port_subscribers *(void **) (&snd_seq_query_port_subscribers_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_port_subscribers"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_sizeof *(void **) (&snd_seq_queue_info_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_malloc *(void **) (&snd_seq_queue_info_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_free *(void **) (&snd_seq_queue_info_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_copy *(void **) (&snd_seq_queue_info_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_get_queue *(void **) (&snd_seq_queue_info_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_get_name *(void **) (&snd_seq_queue_info_get_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_get_owner *(void **) (&snd_seq_queue_info_get_owner_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_get_owner"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_get_locked *(void **) (&snd_seq_queue_info_get_locked_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_get_locked"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_get_flags *(void **) (&snd_seq_queue_info_get_flags_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_get_flags"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_set_name *(void **) (&snd_seq_queue_info_set_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_set_owner *(void **) (&snd_seq_queue_info_set_owner_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_set_owner"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_set_locked *(void **) (&snd_seq_queue_info_set_locked_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_set_locked"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_info_set_flags *(void **) (&snd_seq_queue_info_set_flags_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_info_set_flags"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_create_queue *(void **) (&snd_seq_create_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_create_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_alloc_named_queue *(void **) (&snd_seq_alloc_named_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_alloc_named_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_alloc_queue *(void **) (&snd_seq_alloc_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_alloc_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_free_queue *(void **) (&snd_seq_free_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_free_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_queue_info *(void **) (&snd_seq_get_queue_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_queue_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_queue_info *(void **) (&snd_seq_set_queue_info_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_queue_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_query_named_queue *(void **) (&snd_seq_query_named_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_query_named_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_queue_usage *(void **) (&snd_seq_get_queue_usage_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_queue_usage"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_queue_usage *(void **) (&snd_seq_set_queue_usage_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_queue_usage"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_sizeof *(void **) (&snd_seq_queue_status_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_malloc *(void **) (&snd_seq_queue_status_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_free *(void **) (&snd_seq_queue_status_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_copy *(void **) (&snd_seq_queue_status_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_get_queue *(void **) (&snd_seq_queue_status_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_get_events *(void **) (&snd_seq_queue_status_get_events_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_get_events"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_get_tick_time *(void **) (&snd_seq_queue_status_get_tick_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_get_tick_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_get_real_time *(void **) (&snd_seq_queue_status_get_real_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_get_real_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_status_get_status *(void **) (&snd_seq_queue_status_get_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_status_get_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_queue_status *(void **) (&snd_seq_get_queue_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_queue_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_sizeof *(void **) (&snd_seq_queue_tempo_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_malloc *(void **) (&snd_seq_queue_tempo_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_free *(void **) (&snd_seq_queue_tempo_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_copy *(void **) (&snd_seq_queue_tempo_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_get_queue *(void **) (&snd_seq_queue_tempo_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_get_tempo *(void **) (&snd_seq_queue_tempo_get_tempo_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_get_tempo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_get_ppq *(void **) (&snd_seq_queue_tempo_get_ppq_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_get_ppq"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_get_skew *(void **) (&snd_seq_queue_tempo_get_skew_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_get_skew"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_get_skew_base *(void **) (&snd_seq_queue_tempo_get_skew_base_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_get_skew_base"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_set_tempo *(void **) (&snd_seq_queue_tempo_set_tempo_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_set_tempo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_set_ppq *(void **) (&snd_seq_queue_tempo_set_ppq_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_set_ppq"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_set_skew *(void **) (&snd_seq_queue_tempo_set_skew_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_set_skew"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_tempo_set_skew_base *(void **) (&snd_seq_queue_tempo_set_skew_base_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_tempo_set_skew_base"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_queue_tempo *(void **) (&snd_seq_get_queue_tempo_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_queue_tempo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_queue_tempo *(void **) (&snd_seq_set_queue_tempo_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_queue_tempo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_sizeof *(void **) (&snd_seq_queue_timer_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_malloc *(void **) (&snd_seq_queue_timer_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_free *(void **) (&snd_seq_queue_timer_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_copy *(void **) (&snd_seq_queue_timer_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_get_queue *(void **) (&snd_seq_queue_timer_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_get_type *(void **) (&snd_seq_queue_timer_get_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_get_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_get_id *(void **) (&snd_seq_queue_timer_get_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_get_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_get_resolution *(void **) (&snd_seq_queue_timer_get_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_get_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_set_type *(void **) (&snd_seq_queue_timer_set_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_set_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_set_id *(void **) (&snd_seq_queue_timer_set_id_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_set_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_queue_timer_set_resolution *(void **) (&snd_seq_queue_timer_set_resolution_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_queue_timer_set_resolution"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_queue_timer *(void **) (&snd_seq_get_queue_timer_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_queue_timer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_queue_timer *(void **) (&snd_seq_set_queue_timer_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_queue_timer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_free_event *(void **) (&snd_seq_free_event_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_free_event"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_length *(void **) (&snd_seq_event_length_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_length"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_output *(void **) (&snd_seq_event_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_output_buffer *(void **) (&snd_seq_event_output_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_output_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_output_direct *(void **) (&snd_seq_event_output_direct_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_output_direct"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_input *(void **) (&snd_seq_event_input_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_input"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_input_pending *(void **) (&snd_seq_event_input_pending_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_input_pending"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_drain_output *(void **) (&snd_seq_drain_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_drain_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_event_output_pending *(void **) (&snd_seq_event_output_pending_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_event_output_pending"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_extract_output *(void **) (&snd_seq_extract_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_extract_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_drop_output *(void **) (&snd_seq_drop_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_drop_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_drop_output_buffer *(void **) (&snd_seq_drop_output_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_drop_output_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_drop_input *(void **) (&snd_seq_drop_input_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_drop_input"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_drop_input_buffer *(void **) (&snd_seq_drop_input_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_drop_input_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_sizeof *(void **) (&snd_seq_remove_events_sizeof_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_sizeof"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_malloc *(void **) (&snd_seq_remove_events_malloc_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_malloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_free *(void **) (&snd_seq_remove_events_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_copy *(void **) (&snd_seq_remove_events_copy_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_condition *(void **) (&snd_seq_remove_events_get_condition_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_condition"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_queue *(void **) (&snd_seq_remove_events_get_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_time *(void **) (&snd_seq_remove_events_get_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_dest *(void **) (&snd_seq_remove_events_get_dest_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_dest"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_channel *(void **) (&snd_seq_remove_events_get_channel_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_channel"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_event_type *(void **) (&snd_seq_remove_events_get_event_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_event_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_get_tag *(void **) (&snd_seq_remove_events_get_tag_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_get_tag"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_condition *(void **) (&snd_seq_remove_events_set_condition_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_condition"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_queue *(void **) (&snd_seq_remove_events_set_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_time *(void **) (&snd_seq_remove_events_set_time_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_dest *(void **) (&snd_seq_remove_events_set_dest_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_dest"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_channel *(void **) (&snd_seq_remove_events_set_channel_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_channel"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_event_type *(void **) (&snd_seq_remove_events_set_event_type_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_event_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events_set_tag *(void **) (&snd_seq_remove_events_set_tag_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events_set_tag"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_remove_events *(void **) (&snd_seq_remove_events_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_remove_events"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_bit *(void **) (&snd_seq_set_bit_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_bit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_unset_bit *(void **) (&snd_seq_unset_bit_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_unset_bit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_change_bit *(void **) (&snd_seq_change_bit_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_change_bit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_get_bit *(void **) (&snd_seq_get_bit_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_get_bit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_control_queue *(void **) (&snd_seq_control_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_control_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_create_simple_port *(void **) (&snd_seq_create_simple_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_create_simple_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_delete_simple_port *(void **) (&snd_seq_delete_simple_port_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_delete_simple_port"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_connect_from *(void **) (&snd_seq_connect_from_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_connect_from"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_connect_to *(void **) (&snd_seq_connect_to_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_connect_to"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_disconnect_from *(void **) (&snd_seq_disconnect_from_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_disconnect_from"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_disconnect_to *(void **) (&snd_seq_disconnect_to_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_disconnect_to"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_name *(void **) (&snd_seq_set_client_name_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_event_filter *(void **) (&snd_seq_set_client_event_filter_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_event_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_pool_output *(void **) (&snd_seq_set_client_pool_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_pool_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_pool_output_room *(void **) (&snd_seq_set_client_pool_output_room_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_pool_output_room"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_set_client_pool_input *(void **) (&snd_seq_set_client_pool_input_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_set_client_pool_input"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_sync_output_queue *(void **) (&snd_seq_sync_output_queue_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_sync_output_queue"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_parse_address *(void **) (&snd_seq_parse_address_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_parse_address"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_reset_pool_output *(void **) (&snd_seq_reset_pool_output_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_reset_pool_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_seq_reset_pool_input *(void **) (&snd_seq_reset_pool_input_dylibloader_wrapper_asound) = dlsym(handle, "snd_seq_reset_pool_input"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_new *(void **) (&snd_midi_event_new_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_resize_buffer *(void **) (&snd_midi_event_resize_buffer_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_resize_buffer"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_free *(void **) (&snd_midi_event_free_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_init *(void **) (&snd_midi_event_init_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_reset_encode *(void **) (&snd_midi_event_reset_encode_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_reset_encode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_reset_decode *(void **) (&snd_midi_event_reset_decode_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_reset_decode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_no_status *(void **) (&snd_midi_event_no_status_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_no_status"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_encode *(void **) (&snd_midi_event_encode_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_encode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_encode_byte *(void **) (&snd_midi_event_encode_byte_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_encode_byte"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // snd_midi_event_decode *(void **) (&snd_midi_event_decode_dylibloader_wrapper_asound) = dlsym(handle, "snd_midi_event_decode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } return 0; } diff --git a/drivers/alsa/asound-so_wrap.h b/drivers/alsa/asound-so_wrap.h index 650c651b79..c9b8ae8aec 100644 --- a/drivers/alsa/asound-so_wrap.h +++ b/drivers/alsa/asound-so_wrap.h @@ -2,9 +2,11 @@ #define DYLIBLOAD_WRAPPER_ASOUND // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:19:14 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:12 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/alsa/asoundlib.h --sys-include <alsa/asoundlib.h> --soname libasound.so.2 --init-name asound --output-header asound-so_wrap.h --output-implementation asound-so_wrap.c // +#include <stdint.h> + #define snd_asoundlib_version snd_asoundlib_version_dylibloader_orig_asound #define snd_dlpath snd_dlpath_dylibloader_orig_asound #define snd_dlopen snd_dlopen_dylibloader_orig_asound @@ -5141,7 +5143,7 @@ extern void (*snd_midi_event_no_status_dylibloader_wrapper_asound)( snd_midi_eve extern long (*snd_midi_event_encode_dylibloader_wrapper_asound)( snd_midi_event_t*,const unsigned char*, long, snd_seq_event_t*); extern int (*snd_midi_event_encode_byte_dylibloader_wrapper_asound)( snd_midi_event_t*, int, snd_seq_event_t*); extern long (*snd_midi_event_decode_dylibloader_wrapper_asound)( snd_midi_event_t*, unsigned char*, long,const snd_seq_event_t*); -int initialize_asound(); +int initialize_asound(int verbose); #ifdef __cplusplus } #endif diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index bc6079f314..61475c74e7 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -39,7 +39,7 @@ #ifdef PULSEAUDIO_ENABLED extern "C" { -extern int initialize_pulse(); +extern int initialize_pulse(int verbose); } #endif @@ -153,13 +153,18 @@ Error AudioDriverALSA::init_device() { } Error AudioDriverALSA::init() { +#ifdef DEBUG_ENABLED + int dylibloader_verbose = 1; +#else + int dylibloader_verbose = 0; +#endif #ifdef PULSEAUDIO_ENABLED // On pulse enabled systems Alsa will silently use pulse. // It doesn't matter if this fails as that likely means there is no pulse - initialize_pulse(); + initialize_pulse(dylibloader_verbose); #endif - if (initialize_asound()) { + if (initialize_asound(dylibloader_verbose)) { return ERR_CANT_OPEN; } diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 01bed4e735..5e87bc019b 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -233,7 +233,12 @@ Error AudioDriverPulseAudio::init_device() { } Error AudioDriverPulseAudio::init() { - if (initialize_pulse()) { +#ifdef DEBUG_ENABLED + int dylibloader_verbose = 1; +#else + int dylibloader_verbose = 0; +#endif + if (initialize_pulse(dylibloader_verbose)) { return ERR_CANT_OPEN; } diff --git a/drivers/pulseaudio/pulse-so_wrap.c b/drivers/pulseaudio/pulse-so_wrap.c index fdb002a2e5..12bdcc704e 100644 --- a/drivers/pulseaudio/pulse-so_wrap.c +++ b/drivers/pulseaudio/pulse-so_wrap.c @@ -1,8 +1,10 @@ // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:19:07 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:31 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/pulse/pulseaudio.h --sys-include <pulse/pulseaudio.h> --soname libpulse.so.0 --omit-prefix _pa_ --init-name pulse --output-header pulse-so_wrap.h --output-implementation pulse-so_wrap.c // +#include <stdint.h> + #define pa_get_library_version pa_get_library_version_dylibloader_orig_pulse #define pa_bytes_per_second pa_bytes_per_second_dylibloader_orig_pulse #define pa_frame_size pa_frame_size_dylibloader_orig_pulse @@ -1077,2156 +1079,2872 @@ struct timeval* (*pa_timeval_sub_dylibloader_wrapper_pulse)(struct timeval*, pa_ struct timeval* (*pa_timeval_store_dylibloader_wrapper_pulse)(struct timeval*, pa_usec_t); pa_usec_t (*pa_timeval_load_dylibloader_wrapper_pulse)(struct timeval*); pa_usec_t (*pa_rtclock_now_dylibloader_wrapper_pulse)( void); -int initialize_pulse() { +int initialize_pulse(int verbose) { void *handle; char *error; handle = dlopen("libpulse.so.0", RTLD_LAZY); if (!handle) { - fprintf(stderr, "%s\n", dlerror()); + if (verbose) { + fprintf(stderr, "%s\n", dlerror()); + } return(1); } dlerror(); // pa_get_library_version *(void **) (&pa_get_library_version_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_library_version"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_bytes_per_second *(void **) (&pa_bytes_per_second_dylibloader_wrapper_pulse) = dlsym(handle, "pa_bytes_per_second"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_frame_size *(void **) (&pa_frame_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_frame_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_size *(void **) (&pa_sample_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_size_of_format *(void **) (&pa_sample_size_of_format_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_size_of_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_bytes_to_usec *(void **) (&pa_bytes_to_usec_dylibloader_wrapper_pulse) = dlsym(handle, "pa_bytes_to_usec"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_usec_to_bytes *(void **) (&pa_usec_to_bytes_dylibloader_wrapper_pulse) = dlsym(handle, "pa_usec_to_bytes"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_spec_init *(void **) (&pa_sample_spec_init_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_spec_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_format_valid *(void **) (&pa_sample_format_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_format_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_rate_valid *(void **) (&pa_sample_rate_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_rate_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channels_valid *(void **) (&pa_channels_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channels_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_spec_valid *(void **) (&pa_sample_spec_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_spec_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_spec_equal *(void **) (&pa_sample_spec_equal_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_spec_equal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_format_to_string *(void **) (&pa_sample_format_to_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_format_to_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_parse_sample_format *(void **) (&pa_parse_sample_format_dylibloader_wrapper_pulse) = dlsym(handle, "pa_parse_sample_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_spec_snprint *(void **) (&pa_sample_spec_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_spec_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_bytes_snprint *(void **) (&pa_bytes_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_bytes_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_format_is_le *(void **) (&pa_sample_format_is_le_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_format_is_le"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sample_format_is_be *(void **) (&pa_sample_format_is_be_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sample_format_is_be"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_direction_valid *(void **) (&pa_direction_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_direction_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_direction_to_string *(void **) (&pa_direction_to_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_direction_to_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_api_once *(void **) (&pa_mainloop_api_once_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_api_once"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_new *(void **) (&pa_proplist_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_free *(void **) (&pa_proplist_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_key_valid *(void **) (&pa_proplist_key_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_key_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_sets *(void **) (&pa_proplist_sets_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_sets"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_setp *(void **) (&pa_proplist_setp_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_setp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_setf *(void **) (&pa_proplist_setf_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_setf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_set *(void **) (&pa_proplist_set_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_gets *(void **) (&pa_proplist_gets_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_gets"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_get *(void **) (&pa_proplist_get_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_get"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_update *(void **) (&pa_proplist_update_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_unset *(void **) (&pa_proplist_unset_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_unset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_unset_many *(void **) (&pa_proplist_unset_many_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_unset_many"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_iterate *(void **) (&pa_proplist_iterate_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_iterate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_to_string *(void **) (&pa_proplist_to_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_to_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_to_string_sep *(void **) (&pa_proplist_to_string_sep_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_to_string_sep"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_from_string *(void **) (&pa_proplist_from_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_from_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_contains *(void **) (&pa_proplist_contains_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_contains"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_clear *(void **) (&pa_proplist_clear_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_clear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_copy *(void **) (&pa_proplist_copy_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_size *(void **) (&pa_proplist_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_isempty *(void **) (&pa_proplist_isempty_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_isempty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_proplist_equal *(void **) (&pa_proplist_equal_dylibloader_wrapper_pulse) = dlsym(handle, "pa_proplist_equal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_init *(void **) (&pa_channel_map_init_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_init_mono *(void **) (&pa_channel_map_init_mono_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_init_mono"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_init_stereo *(void **) (&pa_channel_map_init_stereo_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_init_stereo"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_init_auto *(void **) (&pa_channel_map_init_auto_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_init_auto"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_init_extend *(void **) (&pa_channel_map_init_extend_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_init_extend"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_position_to_string *(void **) (&pa_channel_position_to_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_position_to_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_position_from_string *(void **) (&pa_channel_position_from_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_position_from_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_position_to_pretty_string *(void **) (&pa_channel_position_to_pretty_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_position_to_pretty_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_snprint *(void **) (&pa_channel_map_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_parse *(void **) (&pa_channel_map_parse_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_parse"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_equal *(void **) (&pa_channel_map_equal_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_equal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_valid *(void **) (&pa_channel_map_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_compatible *(void **) (&pa_channel_map_compatible_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_compatible"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_superset *(void **) (&pa_channel_map_superset_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_superset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_can_balance *(void **) (&pa_channel_map_can_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_can_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_can_fade *(void **) (&pa_channel_map_can_fade_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_can_fade"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_can_lfe_balance *(void **) (&pa_channel_map_can_lfe_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_can_lfe_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_to_name *(void **) (&pa_channel_map_to_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_to_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_to_pretty_name *(void **) (&pa_channel_map_to_pretty_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_to_pretty_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_has_position *(void **) (&pa_channel_map_has_position_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_has_position"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_channel_map_mask *(void **) (&pa_channel_map_mask_dylibloader_wrapper_pulse) = dlsym(handle, "pa_channel_map_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_encoding_to_string *(void **) (&pa_encoding_to_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_encoding_to_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_encoding_from_string *(void **) (&pa_encoding_from_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_encoding_from_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_new *(void **) (&pa_format_info_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_copy *(void **) (&pa_format_info_copy_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_copy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_free *(void **) (&pa_format_info_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_valid *(void **) (&pa_format_info_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_is_pcm *(void **) (&pa_format_info_is_pcm_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_is_pcm"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_is_compatible *(void **) (&pa_format_info_is_compatible_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_is_compatible"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_snprint *(void **) (&pa_format_info_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_from_string *(void **) (&pa_format_info_from_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_from_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_from_sample_spec *(void **) (&pa_format_info_from_sample_spec_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_from_sample_spec"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_to_sample_spec *(void **) (&pa_format_info_to_sample_spec_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_to_sample_spec"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_type *(void **) (&pa_format_info_get_prop_type_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_type"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_int *(void **) (&pa_format_info_get_prop_int_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_int"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_int_range *(void **) (&pa_format_info_get_prop_int_range_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_int_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_int_array *(void **) (&pa_format_info_get_prop_int_array_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_int_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_string *(void **) (&pa_format_info_get_prop_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_prop_string_array *(void **) (&pa_format_info_get_prop_string_array_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_prop_string_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_free_string_array *(void **) (&pa_format_info_free_string_array_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_free_string_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_sample_format *(void **) (&pa_format_info_get_sample_format_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_sample_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_rate *(void **) (&pa_format_info_get_rate_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_channels *(void **) (&pa_format_info_get_channels_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_get_channel_map *(void **) (&pa_format_info_get_channel_map_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_get_channel_map"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_prop_int *(void **) (&pa_format_info_set_prop_int_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_prop_int"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_prop_int_array *(void **) (&pa_format_info_set_prop_int_array_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_prop_int_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_prop_int_range *(void **) (&pa_format_info_set_prop_int_range_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_prop_int_range"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_prop_string *(void **) (&pa_format_info_set_prop_string_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_prop_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_prop_string_array *(void **) (&pa_format_info_set_prop_string_array_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_prop_string_array"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_sample_format *(void **) (&pa_format_info_set_sample_format_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_sample_format"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_rate *(void **) (&pa_format_info_set_rate_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_channels *(void **) (&pa_format_info_set_channels_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_channels"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_format_info_set_channel_map *(void **) (&pa_format_info_set_channel_map_dylibloader_wrapper_pulse) = dlsym(handle, "pa_format_info_set_channel_map"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_operation_ref *(void **) (&pa_operation_ref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_operation_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_operation_unref *(void **) (&pa_operation_unref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_operation_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_operation_cancel *(void **) (&pa_operation_cancel_dylibloader_wrapper_pulse) = dlsym(handle, "pa_operation_cancel"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_operation_get_state *(void **) (&pa_operation_get_state_dylibloader_wrapper_pulse) = dlsym(handle, "pa_operation_get_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_operation_set_state_callback *(void **) (&pa_operation_set_state_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_operation_set_state_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_new *(void **) (&pa_context_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_new_with_proplist *(void **) (&pa_context_new_with_proplist_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_new_with_proplist"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_unref *(void **) (&pa_context_unref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_ref *(void **) (&pa_context_ref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_state_callback *(void **) (&pa_context_set_state_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_state_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_event_callback *(void **) (&pa_context_set_event_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_event_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_errno *(void **) (&pa_context_errno_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_errno"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_is_pending *(void **) (&pa_context_is_pending_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_is_pending"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_state *(void **) (&pa_context_get_state_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_connect *(void **) (&pa_context_connect_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_connect"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_disconnect *(void **) (&pa_context_disconnect_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_disconnect"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_drain *(void **) (&pa_context_drain_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_drain"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_exit_daemon *(void **) (&pa_context_exit_daemon_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_exit_daemon"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_default_sink *(void **) (&pa_context_set_default_sink_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_default_sink"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_default_source *(void **) (&pa_context_set_default_source_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_default_source"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_is_local *(void **) (&pa_context_is_local_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_is_local"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_name *(void **) (&pa_context_set_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_server *(void **) (&pa_context_get_server_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_server"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_protocol_version *(void **) (&pa_context_get_protocol_version_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_protocol_version"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_server_protocol_version *(void **) (&pa_context_get_server_protocol_version_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_server_protocol_version"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_proplist_update *(void **) (&pa_context_proplist_update_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_proplist_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_proplist_remove *(void **) (&pa_context_proplist_remove_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_proplist_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_index *(void **) (&pa_context_get_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_rttime_new *(void **) (&pa_context_rttime_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_rttime_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_rttime_restart *(void **) (&pa_context_rttime_restart_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_rttime_restart"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_tile_size *(void **) (&pa_context_get_tile_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_tile_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_load_cookie_from_file *(void **) (&pa_context_load_cookie_from_file_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_load_cookie_from_file"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_equal *(void **) (&pa_cvolume_equal_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_equal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_init *(void **) (&pa_cvolume_init_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_set *(void **) (&pa_cvolume_set_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_set"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_snprint *(void **) (&pa_cvolume_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_cvolume_snprint_dB *(void **) (&pa_sw_cvolume_snprint_dB_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_cvolume_snprint_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_snprint_verbose *(void **) (&pa_cvolume_snprint_verbose_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_snprint_verbose"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_volume_snprint *(void **) (&pa_volume_snprint_dylibloader_wrapper_pulse) = dlsym(handle, "pa_volume_snprint"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_snprint_dB *(void **) (&pa_sw_volume_snprint_dB_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_snprint_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_volume_snprint_verbose *(void **) (&pa_volume_snprint_verbose_dylibloader_wrapper_pulse) = dlsym(handle, "pa_volume_snprint_verbose"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_avg *(void **) (&pa_cvolume_avg_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_avg"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_avg_mask *(void **) (&pa_cvolume_avg_mask_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_avg_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_max *(void **) (&pa_cvolume_max_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_max"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_max_mask *(void **) (&pa_cvolume_max_mask_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_max_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_min *(void **) (&pa_cvolume_min_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_min"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_min_mask *(void **) (&pa_cvolume_min_mask_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_min_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_valid *(void **) (&pa_cvolume_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_channels_equal_to *(void **) (&pa_cvolume_channels_equal_to_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_channels_equal_to"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_multiply *(void **) (&pa_sw_volume_multiply_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_multiply"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_cvolume_multiply *(void **) (&pa_sw_cvolume_multiply_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_cvolume_multiply"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_cvolume_multiply_scalar *(void **) (&pa_sw_cvolume_multiply_scalar_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_cvolume_multiply_scalar"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_divide *(void **) (&pa_sw_volume_divide_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_divide"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_cvolume_divide *(void **) (&pa_sw_cvolume_divide_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_cvolume_divide"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_cvolume_divide_scalar *(void **) (&pa_sw_cvolume_divide_scalar_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_cvolume_divide_scalar"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_from_dB *(void **) (&pa_sw_volume_from_dB_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_from_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_to_dB *(void **) (&pa_sw_volume_to_dB_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_to_dB"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_from_linear *(void **) (&pa_sw_volume_from_linear_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_from_linear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_sw_volume_to_linear *(void **) (&pa_sw_volume_to_linear_dylibloader_wrapper_pulse) = dlsym(handle, "pa_sw_volume_to_linear"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_remap *(void **) (&pa_cvolume_remap_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_remap"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_compatible *(void **) (&pa_cvolume_compatible_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_compatible"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_compatible_with_channel_map *(void **) (&pa_cvolume_compatible_with_channel_map_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_compatible_with_channel_map"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_get_balance *(void **) (&pa_cvolume_get_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_get_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_set_balance *(void **) (&pa_cvolume_set_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_set_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_get_fade *(void **) (&pa_cvolume_get_fade_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_get_fade"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_set_fade *(void **) (&pa_cvolume_set_fade_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_set_fade"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_get_lfe_balance *(void **) (&pa_cvolume_get_lfe_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_get_lfe_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_set_lfe_balance *(void **) (&pa_cvolume_set_lfe_balance_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_set_lfe_balance"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_scale *(void **) (&pa_cvolume_scale_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_scale"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_scale_mask *(void **) (&pa_cvolume_scale_mask_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_scale_mask"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_set_position *(void **) (&pa_cvolume_set_position_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_set_position"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_get_position *(void **) (&pa_cvolume_get_position_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_get_position"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_merge *(void **) (&pa_cvolume_merge_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_merge"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_inc_clamp *(void **) (&pa_cvolume_inc_clamp_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_inc_clamp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_inc *(void **) (&pa_cvolume_inc_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_inc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_cvolume_dec *(void **) (&pa_cvolume_dec_dylibloader_wrapper_pulse) = dlsym(handle, "pa_cvolume_dec"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_new *(void **) (&pa_stream_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_new_with_proplist *(void **) (&pa_stream_new_with_proplist_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_new_with_proplist"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_new_extended *(void **) (&pa_stream_new_extended_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_new_extended"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_unref *(void **) (&pa_stream_unref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_ref *(void **) (&pa_stream_ref_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_state *(void **) (&pa_stream_get_state_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_state"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_context *(void **) (&pa_stream_get_context_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_context"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_index *(void **) (&pa_stream_get_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_device_index *(void **) (&pa_stream_get_device_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_device_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_device_name *(void **) (&pa_stream_get_device_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_device_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_is_suspended *(void **) (&pa_stream_is_suspended_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_is_suspended"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_is_corked *(void **) (&pa_stream_is_corked_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_is_corked"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_connect_playback *(void **) (&pa_stream_connect_playback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_connect_playback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_connect_record *(void **) (&pa_stream_connect_record_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_connect_record"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_disconnect *(void **) (&pa_stream_disconnect_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_disconnect"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_begin_write *(void **) (&pa_stream_begin_write_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_begin_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_cancel_write *(void **) (&pa_stream_cancel_write_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_cancel_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_write *(void **) (&pa_stream_write_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_write"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_write_ext_free *(void **) (&pa_stream_write_ext_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_write_ext_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_peek *(void **) (&pa_stream_peek_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_peek"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_drop *(void **) (&pa_stream_drop_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_drop"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_writable_size *(void **) (&pa_stream_writable_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_writable_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_readable_size *(void **) (&pa_stream_readable_size_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_readable_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_drain *(void **) (&pa_stream_drain_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_drain"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_update_timing_info *(void **) (&pa_stream_update_timing_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_update_timing_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_state_callback *(void **) (&pa_stream_set_state_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_state_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_write_callback *(void **) (&pa_stream_set_write_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_write_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_read_callback *(void **) (&pa_stream_set_read_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_read_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_overflow_callback *(void **) (&pa_stream_set_overflow_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_overflow_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_underflow_index *(void **) (&pa_stream_get_underflow_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_underflow_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_underflow_callback *(void **) (&pa_stream_set_underflow_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_underflow_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_started_callback *(void **) (&pa_stream_set_started_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_started_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_latency_update_callback *(void **) (&pa_stream_set_latency_update_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_latency_update_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_moved_callback *(void **) (&pa_stream_set_moved_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_moved_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_suspended_callback *(void **) (&pa_stream_set_suspended_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_suspended_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_event_callback *(void **) (&pa_stream_set_event_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_event_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_buffer_attr_callback *(void **) (&pa_stream_set_buffer_attr_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_buffer_attr_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_cork *(void **) (&pa_stream_cork_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_cork"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_flush *(void **) (&pa_stream_flush_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_flush"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_prebuf *(void **) (&pa_stream_prebuf_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_prebuf"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_trigger *(void **) (&pa_stream_trigger_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_trigger"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_name *(void **) (&pa_stream_set_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_time *(void **) (&pa_stream_get_time_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_time"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_latency *(void **) (&pa_stream_get_latency_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_latency"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_timing_info *(void **) (&pa_stream_get_timing_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_timing_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_sample_spec *(void **) (&pa_stream_get_sample_spec_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_sample_spec"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_channel_map *(void **) (&pa_stream_get_channel_map_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_channel_map"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_format_info *(void **) (&pa_stream_get_format_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_format_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_buffer_attr *(void **) (&pa_stream_get_buffer_attr_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_buffer_attr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_buffer_attr *(void **) (&pa_stream_set_buffer_attr_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_buffer_attr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_update_sample_rate *(void **) (&pa_stream_update_sample_rate_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_update_sample_rate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_proplist_update *(void **) (&pa_stream_proplist_update_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_proplist_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_proplist_remove *(void **) (&pa_stream_proplist_remove_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_proplist_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_set_monitor_stream *(void **) (&pa_stream_set_monitor_stream_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_set_monitor_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_get_monitor_stream *(void **) (&pa_stream_get_monitor_stream_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_get_monitor_stream"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sink_info_by_name *(void **) (&pa_context_get_sink_info_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sink_info_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sink_info_by_index *(void **) (&pa_context_get_sink_info_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sink_info_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sink_info_list *(void **) (&pa_context_get_sink_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sink_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_volume_by_index *(void **) (&pa_context_set_sink_volume_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_volume_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_volume_by_name *(void **) (&pa_context_set_sink_volume_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_volume_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_mute_by_index *(void **) (&pa_context_set_sink_mute_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_mute_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_mute_by_name *(void **) (&pa_context_set_sink_mute_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_mute_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_suspend_sink_by_name *(void **) (&pa_context_suspend_sink_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_suspend_sink_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_suspend_sink_by_index *(void **) (&pa_context_suspend_sink_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_suspend_sink_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_port_by_index *(void **) (&pa_context_set_sink_port_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_port_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_port_by_name *(void **) (&pa_context_set_sink_port_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_port_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_source_info_by_name *(void **) (&pa_context_get_source_info_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_source_info_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_source_info_by_index *(void **) (&pa_context_get_source_info_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_source_info_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_source_info_list *(void **) (&pa_context_get_source_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_source_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_volume_by_index *(void **) (&pa_context_set_source_volume_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_volume_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_volume_by_name *(void **) (&pa_context_set_source_volume_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_volume_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_mute_by_index *(void **) (&pa_context_set_source_mute_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_mute_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_mute_by_name *(void **) (&pa_context_set_source_mute_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_mute_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_suspend_source_by_name *(void **) (&pa_context_suspend_source_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_suspend_source_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_suspend_source_by_index *(void **) (&pa_context_suspend_source_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_suspend_source_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_port_by_index *(void **) (&pa_context_set_source_port_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_port_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_port_by_name *(void **) (&pa_context_set_source_port_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_port_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_server_info *(void **) (&pa_context_get_server_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_server_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_module_info *(void **) (&pa_context_get_module_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_module_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_module_info_list *(void **) (&pa_context_get_module_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_module_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_load_module *(void **) (&pa_context_load_module_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_load_module"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_unload_module *(void **) (&pa_context_unload_module_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_unload_module"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_client_info *(void **) (&pa_context_get_client_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_client_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_client_info_list *(void **) (&pa_context_get_client_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_client_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_kill_client *(void **) (&pa_context_kill_client_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_kill_client"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_card_info_by_index *(void **) (&pa_context_get_card_info_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_card_info_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_card_info_by_name *(void **) (&pa_context_get_card_info_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_card_info_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_card_info_list *(void **) (&pa_context_get_card_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_card_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_card_profile_by_index *(void **) (&pa_context_set_card_profile_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_card_profile_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_card_profile_by_name *(void **) (&pa_context_set_card_profile_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_card_profile_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_port_latency_offset *(void **) (&pa_context_set_port_latency_offset_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_port_latency_offset"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sink_input_info *(void **) (&pa_context_get_sink_input_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sink_input_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sink_input_info_list *(void **) (&pa_context_get_sink_input_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sink_input_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_move_sink_input_by_name *(void **) (&pa_context_move_sink_input_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_move_sink_input_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_move_sink_input_by_index *(void **) (&pa_context_move_sink_input_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_move_sink_input_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_input_volume *(void **) (&pa_context_set_sink_input_volume_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_input_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_sink_input_mute *(void **) (&pa_context_set_sink_input_mute_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_sink_input_mute"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_kill_sink_input *(void **) (&pa_context_kill_sink_input_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_kill_sink_input"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_source_output_info *(void **) (&pa_context_get_source_output_info_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_source_output_info"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_source_output_info_list *(void **) (&pa_context_get_source_output_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_source_output_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_move_source_output_by_name *(void **) (&pa_context_move_source_output_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_move_source_output_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_move_source_output_by_index *(void **) (&pa_context_move_source_output_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_move_source_output_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_output_volume *(void **) (&pa_context_set_source_output_volume_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_output_volume"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_source_output_mute *(void **) (&pa_context_set_source_output_mute_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_source_output_mute"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_kill_source_output *(void **) (&pa_context_kill_source_output_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_kill_source_output"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_stat *(void **) (&pa_context_stat_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_stat"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sample_info_by_name *(void **) (&pa_context_get_sample_info_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sample_info_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sample_info_by_index *(void **) (&pa_context_get_sample_info_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sample_info_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_sample_info_list *(void **) (&pa_context_get_sample_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_sample_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_autoload_info_by_name *(void **) (&pa_context_get_autoload_info_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_autoload_info_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_autoload_info_by_index *(void **) (&pa_context_get_autoload_info_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_autoload_info_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_get_autoload_info_list *(void **) (&pa_context_get_autoload_info_list_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_get_autoload_info_list"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_add_autoload *(void **) (&pa_context_add_autoload_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_add_autoload"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_remove_autoload_by_name *(void **) (&pa_context_remove_autoload_by_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_remove_autoload_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_remove_autoload_by_index *(void **) (&pa_context_remove_autoload_by_index_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_remove_autoload_by_index"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_subscribe *(void **) (&pa_context_subscribe_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_subscribe"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_set_subscribe_callback *(void **) (&pa_context_set_subscribe_callback_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_set_subscribe_callback"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_connect_upload *(void **) (&pa_stream_connect_upload_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_connect_upload"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_stream_finish_upload *(void **) (&pa_stream_finish_upload_dylibloader_wrapper_pulse) = dlsym(handle, "pa_stream_finish_upload"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_remove_sample *(void **) (&pa_context_remove_sample_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_remove_sample"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_play_sample *(void **) (&pa_context_play_sample_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_play_sample"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_context_play_sample_with_proplist *(void **) (&pa_context_play_sample_with_proplist_dylibloader_wrapper_pulse) = dlsym(handle, "pa_context_play_sample_with_proplist"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_strerror *(void **) (&pa_strerror_dylibloader_wrapper_pulse) = dlsym(handle, "pa_strerror"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xmalloc *(void **) (&pa_xmalloc_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xmalloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xmalloc0 *(void **) (&pa_xmalloc0_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xmalloc0"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xrealloc *(void **) (&pa_xrealloc_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xrealloc"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xfree *(void **) (&pa_xfree_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xfree"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xstrdup *(void **) (&pa_xstrdup_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xstrdup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xstrndup *(void **) (&pa_xstrndup_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xstrndup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_xmemdup *(void **) (&pa_xmemdup_dylibloader_wrapper_pulse) = dlsym(handle, "pa_xmemdup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_utf8_valid *(void **) (&pa_utf8_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_utf8_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_ascii_valid *(void **) (&pa_ascii_valid_dylibloader_wrapper_pulse) = dlsym(handle, "pa_ascii_valid"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_utf8_filter *(void **) (&pa_utf8_filter_dylibloader_wrapper_pulse) = dlsym(handle, "pa_utf8_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_ascii_filter *(void **) (&pa_ascii_filter_dylibloader_wrapper_pulse) = dlsym(handle, "pa_ascii_filter"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_utf8_to_locale *(void **) (&pa_utf8_to_locale_dylibloader_wrapper_pulse) = dlsym(handle, "pa_utf8_to_locale"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_locale_to_utf8 *(void **) (&pa_locale_to_utf8_dylibloader_wrapper_pulse) = dlsym(handle, "pa_locale_to_utf8"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_new *(void **) (&pa_threaded_mainloop_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_free *(void **) (&pa_threaded_mainloop_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_start *(void **) (&pa_threaded_mainloop_start_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_start"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_stop *(void **) (&pa_threaded_mainloop_stop_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_stop"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_lock *(void **) (&pa_threaded_mainloop_lock_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_lock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_unlock *(void **) (&pa_threaded_mainloop_unlock_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_unlock"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_wait *(void **) (&pa_threaded_mainloop_wait_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_wait"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_signal *(void **) (&pa_threaded_mainloop_signal_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_signal"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_accept *(void **) (&pa_threaded_mainloop_accept_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_accept"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_get_retval *(void **) (&pa_threaded_mainloop_get_retval_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_get_retval"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_get_api *(void **) (&pa_threaded_mainloop_get_api_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_get_api"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_in_thread *(void **) (&pa_threaded_mainloop_in_thread_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_in_thread"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_set_name *(void **) (&pa_threaded_mainloop_set_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_set_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_threaded_mainloop_once_unlocked *(void **) (&pa_threaded_mainloop_once_unlocked_dylibloader_wrapper_pulse) = dlsym(handle, "pa_threaded_mainloop_once_unlocked"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_new *(void **) (&pa_mainloop_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_free *(void **) (&pa_mainloop_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_prepare *(void **) (&pa_mainloop_prepare_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_prepare"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_poll *(void **) (&pa_mainloop_poll_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_poll"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_dispatch *(void **) (&pa_mainloop_dispatch_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_dispatch"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_get_retval *(void **) (&pa_mainloop_get_retval_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_get_retval"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_iterate *(void **) (&pa_mainloop_iterate_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_iterate"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_run *(void **) (&pa_mainloop_run_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_run"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_get_api *(void **) (&pa_mainloop_get_api_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_get_api"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_quit *(void **) (&pa_mainloop_quit_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_quit"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_wakeup *(void **) (&pa_mainloop_wakeup_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_wakeup"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_mainloop_set_poll_func *(void **) (&pa_mainloop_set_poll_func_dylibloader_wrapper_pulse) = dlsym(handle, "pa_mainloop_set_poll_func"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_signal_init *(void **) (&pa_signal_init_dylibloader_wrapper_pulse) = dlsym(handle, "pa_signal_init"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_signal_done *(void **) (&pa_signal_done_dylibloader_wrapper_pulse) = dlsym(handle, "pa_signal_done"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_signal_new *(void **) (&pa_signal_new_dylibloader_wrapper_pulse) = dlsym(handle, "pa_signal_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_signal_free *(void **) (&pa_signal_free_dylibloader_wrapper_pulse) = dlsym(handle, "pa_signal_free"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_signal_set_destroy *(void **) (&pa_signal_set_destroy_dylibloader_wrapper_pulse) = dlsym(handle, "pa_signal_set_destroy"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_get_user_name *(void **) (&pa_get_user_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_user_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_get_host_name *(void **) (&pa_get_host_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_host_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_get_fqdn *(void **) (&pa_get_fqdn_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_fqdn"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_get_home_dir *(void **) (&pa_get_home_dir_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_home_dir"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_get_binary_name *(void **) (&pa_get_binary_name_dylibloader_wrapper_pulse) = dlsym(handle, "pa_get_binary_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_path_get_filename *(void **) (&pa_path_get_filename_dylibloader_wrapper_pulse) = dlsym(handle, "pa_path_get_filename"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_msleep *(void **) (&pa_msleep_dylibloader_wrapper_pulse) = dlsym(handle, "pa_msleep"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_thread_make_realtime *(void **) (&pa_thread_make_realtime_dylibloader_wrapper_pulse) = dlsym(handle, "pa_thread_make_realtime"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_gettimeofday *(void **) (&pa_gettimeofday_dylibloader_wrapper_pulse) = dlsym(handle, "pa_gettimeofday"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_diff *(void **) (&pa_timeval_diff_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_diff"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_cmp *(void **) (&pa_timeval_cmp_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_cmp"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_age *(void **) (&pa_timeval_age_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_age"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_add *(void **) (&pa_timeval_add_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_add"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_sub *(void **) (&pa_timeval_sub_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_sub"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_store *(void **) (&pa_timeval_store_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_store"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_timeval_load *(void **) (&pa_timeval_load_dylibloader_wrapper_pulse) = dlsym(handle, "pa_timeval_load"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // pa_rtclock_now *(void **) (&pa_rtclock_now_dylibloader_wrapper_pulse) = dlsym(handle, "pa_rtclock_now"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } return 0; } diff --git a/drivers/pulseaudio/pulse-so_wrap.h b/drivers/pulseaudio/pulse-so_wrap.h index 3f50617f81..7f9a70fae1 100644 --- a/drivers/pulseaudio/pulse-so_wrap.h +++ b/drivers/pulseaudio/pulse-so_wrap.h @@ -2,9 +2,11 @@ #define DYLIBLOAD_WRAPPER_PULSE // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:19:07 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:31 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/pulse/pulseaudio.h --sys-include <pulse/pulseaudio.h> --soname libpulse.so.0 --omit-prefix _pa_ --init-name pulse --output-header pulse-so_wrap.h --output-implementation pulse-so_wrap.c // +#include <stdint.h> + #define pa_get_library_version pa_get_library_version_dylibloader_orig_pulse #define pa_bytes_per_second pa_bytes_per_second_dylibloader_orig_pulse #define pa_frame_size pa_frame_size_dylibloader_orig_pulse @@ -1437,7 +1439,7 @@ extern struct timeval* (*pa_timeval_sub_dylibloader_wrapper_pulse)(struct timeva extern struct timeval* (*pa_timeval_store_dylibloader_wrapper_pulse)(struct timeval*, pa_usec_t); extern pa_usec_t (*pa_timeval_load_dylibloader_wrapper_pulse)(struct timeval*); extern pa_usec_t (*pa_rtclock_now_dylibloader_wrapper_pulse)( void); -int initialize_pulse(); +int initialize_pulse(int verbose); #ifdef __cplusplus } #endif diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp new file mode 100644 index 0000000000..55640ca590 --- /dev/null +++ b/editor/action_map_editor.cpp @@ -0,0 +1,1167 @@ +/*************************************************************************/ +/* action_map_editor.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "action_map_editor.h" +#include "core/input/input_map.h" +#include "core/os/keyboard.h" +#include "editor/editor_scale.h" +#include "scene/gui/center_container.h" + +///////////////////////////////////////// + +// Maps to 2*axis if value is neg, or + 1 if value is pos. +static const char *_joy_axis_descriptions[JOY_AXIS_MAX * 2] = { + TTRC("Left Stick Left, Joystick 0 Left"), + TTRC("Left Stick Right, Joystick 0 Right"), + TTRC("Left Stick Up, Joystick 0 Up"), + TTRC("Left Stick Down, Joystick 0 Down"), + TTRC("Right Stick Left, Joystick 1 Left"), + TTRC("Right Stick Right, Joystick 1 Right"), + TTRC("Right Stick Up, Joystick 1 Up"), + TTRC("Right Stick Down, Joystick 1 Down"), + TTRC("Joystick 2 Left"), + TTRC("Left Trigger, Sony L2, Xbox LT, Joystick 2 Right"), + TTRC("Joystick 2 Up"), + TTRC("Right Trigger, Sony R2, Xbox RT, Joystick 2 Down"), + TTRC("Joystick 3 Left"), + TTRC("Joystick 3 Right"), + TTRC("Joystick 3 Up"), + TTRC("Joystick 3 Down"), + TTRC("Joystick 4 Left"), + TTRC("Joystick 4 Right"), + TTRC("Joystick 4 Up"), + TTRC("Joystick 4 Down"), +}; + +String InputEventConfigurationDialog::get_event_text(const Ref<InputEvent> &p_event) { + ERR_FAIL_COND_V_MSG(p_event.is_null(), String(), "Provided event is not a valid instance of InputEvent"); + + // Joypad motion events will display slighlty differently than what the event->as_text() provides. See #43660. + Ref<InputEventJoypadMotion> jpmotion = p_event; + if (jpmotion.is_valid()) { + String desc = TTR("Unknown Joypad Axis"); + if (jpmotion->get_axis() < JOY_AXIS_MAX) { + desc = RTR(_joy_axis_descriptions[2 * jpmotion->get_axis() + (jpmotion->get_axis_value() < 0 ? 0 : 1)]); + } + + return vformat("Joypad Axis %s %s (%s)", itos(jpmotion->get_axis()), jpmotion->get_axis_value() < 0 ? "-" : "+", desc); + } else { + return p_event->as_text(); + } +} + +void InputEventConfigurationDialog::_set_event(const Ref<InputEvent> &p_event) { + if (p_event.is_valid()) { + event = p_event; + + // Update Label + event_as_text->set_text(get_event_text(event)); + + Ref<InputEventKey> k = p_event; + Ref<InputEventMouseButton> mb = p_event; + Ref<InputEventJoypadButton> joyb = p_event; + Ref<InputEventJoypadMotion> joym = p_event; + Ref<InputEventWithModifiers> mod = p_event; + + // Update option values and visibility + bool show_mods = false; + bool show_device = false; + bool show_phys_key = false; + + if (mod.is_valid()) { + show_mods = true; + mod_checkboxes[MOD_ALT]->set_pressed(mod->get_alt()); + mod_checkboxes[MOD_SHIFT]->set_pressed(mod->get_shift()); + mod_checkboxes[MOD_COMMAND]->set_pressed(mod->get_command()); + mod_checkboxes[MOD_CONTROL]->set_pressed(mod->get_control()); + mod_checkboxes[MOD_META]->set_pressed(mod->get_metakey()); + + store_command_checkbox->set_pressed(mod->is_storing_command()); + } + + if (k.is_valid()) { + show_phys_key = true; + physical_key_checkbox->set_pressed(k->get_physical_keycode() != 0 && k->get_keycode() == 0); + + } else if (joyb.is_valid() || joym.is_valid() || mb.is_valid()) { + show_device = true; + _set_current_device(event->get_device()); + } + + mod_container->set_visible(show_mods); + device_container->set_visible(show_device); + physical_key_checkbox->set_visible(show_phys_key); + additional_options_container->show(); + + // Update selected item in input list for keys, joybuttons and joyaxis only (since the mouse cannot be "listened" for). + if (k.is_valid() || joyb.is_valid() || joym.is_valid()) { + TreeItem *category = input_list_tree->get_root()->get_children(); + while (category) { + TreeItem *input_item = category->get_children(); + + // has_type this should be always true, unless the tree structure has been misconfigured. + bool has_type = input_item->get_parent()->has_meta("__type"); + int input_type = input_item->get_parent()->get_meta("__type"); + if (!has_type) { + return; + } + + // If event type matches input types of this category. + if ((k.is_valid() && input_type == INPUT_KEY) || (joyb.is_valid() && input_type == INPUT_JOY_BUTTON) || (joym.is_valid() && input_type == INPUT_JOY_MOTION)) { + // Loop through all items of this category until one matches. + while (input_item) { + bool key_match = k.is_valid() && (Variant(k->get_keycode()) == input_item->get_meta("__keycode") || Variant(k->get_physical_keycode()) == input_item->get_meta("__keycode")); + bool joyb_match = joyb.is_valid() && Variant(joyb->get_button_index()) == input_item->get_meta("__index"); + bool joym_match = joym.is_valid() && Variant(joym->get_axis()) == input_item->get_meta("__axis") && joym->get_axis_value() == (float)input_item->get_meta("__value"); + if (key_match || joyb_match || joym_match) { + category->set_collapsed(false); + input_item->select(0); + input_list_tree->ensure_cursor_is_visible(); + return; + } + input_item = input_item->get_next(); + } + } + + category->set_collapsed(true); // Event not in this category, so collapse; + category = category->get_next(); + } + } + } else { + // Event is not valid, reset dialog + event = p_event; + Vector<String> strings; + + // Reset message, promp for input according to which input types are allowed. + String text = TTR("Perform an Input (%s)."); + + if (allowed_input_types & INPUT_KEY) { + strings.append(TTR("Key")); + } + // We don't check for INPUT_MOUSE_BUTTON since it is ignored in the "Listen Window Input" method. + + if (allowed_input_types & INPUT_JOY_BUTTON) { + strings.append(TTR("Joypad Button")); + } + if (allowed_input_types & INPUT_JOY_MOTION) { + strings.append(TTR("Joypad Axis")); + } + + if (strings.size() == 0) { + text = TTR("Input Event dialog has been misconfigured: No input types are allowed."); + event_as_text->set_text(text); + } else { + String insert_text = String(", ").join(strings); + event_as_text->set_text(vformat(text, insert_text)); + } + + additional_options_container->hide(); + input_list_tree->deselect_all(); + _update_input_list(); + } +} + +void InputEventConfigurationDialog::_tab_selected(int p_tab) { + Callable signal_method = callable_mp(this, &InputEventConfigurationDialog::_listen_window_input); + if (p_tab == 0) { + // Start Listening. + if (!is_connected("window_input", signal_method)) { + connect("window_input", signal_method); + } + } else { + // Stop Listening. + if (is_connected("window_input", signal_method)) { + disconnect("window_input", signal_method); + } + input_list_tree->call_deferred("ensure_cursor_is_visible"); + if (input_list_tree->get_selected() == nullptr) { + // If nothing selected, scroll to top. + input_list_tree->scroll_to_item(input_list_tree->get_root()); + } + } +} + +void InputEventConfigurationDialog::_listen_window_input(const Ref<InputEvent> &p_event) { + // Ignore if echo or not pressed + if (p_event->is_echo() || !p_event->is_pressed()) { + return; + } + + // Ignore mouse + Ref<InputEventMouse> m = p_event; + if (m.is_valid()) { + return; + } + + // Check what the type is and if it is allowed. + Ref<InputEventKey> k = p_event; + Ref<InputEventJoypadButton> joyb = p_event; + Ref<InputEventJoypadMotion> joym = p_event; + + int type = k.is_valid() ? INPUT_KEY : joyb.is_valid() ? INPUT_JOY_BUTTON : + joym.is_valid() ? INPUT_JOY_MOTION : + 0; + + if (!(allowed_input_types & type)) { + return; + } + + if (joym.is_valid()) { + float axis_value = joym->get_axis_value(); + if (ABS(axis_value) < 0.9) { + // Ignore motion below 0.9 magnitude to avoid accidental touches + return; + } else { + // Always make the value 1 or -1 for display consistency + joym->set_axis_value(SGN(axis_value)); + } + } + + if (k.is_valid()) { + k->set_pressed(false); // to avoid serialisation of 'pressed' property - doesn't matter for actions anyway. + // Maintain physical keycode option state + if (physical_key_checkbox->is_pressed()) { + k->set_physical_keycode(k->get_keycode()); + k->set_keycode(0); + } else { + k->set_keycode(k->get_physical_keycode()); + k->set_physical_keycode(0); + } + } + + Ref<InputEventWithModifiers> mod = p_event; + if (mod.is_valid()) { + // Maintain store command option state + mod->set_store_command(store_command_checkbox->is_pressed()); + + mod->set_window_id(0); + } + + _set_event(p_event); + set_input_as_handled(); +} + +void InputEventConfigurationDialog::_search_term_updated(const String &) { + _update_input_list(); +} + +void InputEventConfigurationDialog::_update_input_list() { + input_list_tree->clear(); + + TreeItem *root = input_list_tree->create_item(); + String search_term = input_list_search->get_text(); + + bool collapse = input_list_search->get_text().is_empty(); + + if (allowed_input_types & INPUT_KEY) { + TreeItem *kb_root = input_list_tree->create_item(root); + kb_root->set_text(0, TTR("Keyboard Keys")); + kb_root->set_icon(0, icon_cache.keyboard); + kb_root->set_collapsed(collapse); + kb_root->set_meta("__type", INPUT_KEY); + + for (int i = 0; i < keycode_get_count(); i++) { + String name = keycode_get_name_by_index(i); + + if (!search_term.is_empty() && name.findn(search_term) == -1) { + continue; + } + + TreeItem *item = input_list_tree->create_item(kb_root); + item->set_text(0, name); + item->set_meta("__keycode", keycode_get_value_by_index(i)); + } + } + + if (allowed_input_types & INPUT_MOUSE_BUTTON) { + TreeItem *mouse_root = input_list_tree->create_item(root); + mouse_root->set_text(0, TTR("Mouse Buttons")); + mouse_root->set_icon(0, icon_cache.mouse); + mouse_root->set_collapsed(collapse); + mouse_root->set_meta("__type", INPUT_MOUSE_BUTTON); + + int mouse_buttons[9] = { BUTTON_LEFT, BUTTON_RIGHT, BUTTON_MIDDLE, BUTTON_WHEEL_UP, BUTTON_WHEEL_DOWN, BUTTON_WHEEL_LEFT, BUTTON_WHEEL_RIGHT, BUTTON_XBUTTON1, BUTTON_XBUTTON2 }; + for (int i = 0; i < 9; i++) { + Ref<InputEventMouseButton> mb; + mb.instance(); + mb->set_button_index(mouse_buttons[i]); + String desc = get_event_text(mb); + + if (!search_term.is_empty() && desc.findn(search_term) == -1) { + continue; + } + + TreeItem *item = input_list_tree->create_item(mouse_root); + item->set_text(0, desc); + item->set_meta("__index", mouse_buttons[i]); + } + } + + if (allowed_input_types & INPUT_JOY_BUTTON) { + TreeItem *joyb_root = input_list_tree->create_item(root); + joyb_root->set_text(0, TTR("Joypad Buttons")); + joyb_root->set_icon(0, icon_cache.joypad_button); + joyb_root->set_collapsed(collapse); + joyb_root->set_meta("__type", INPUT_JOY_BUTTON); + + for (int i = 0; i < JOY_BUTTON_MAX; i++) { + Ref<InputEventJoypadButton> joyb; + joyb.instance(); + joyb->set_button_index(i); + String desc = get_event_text(joyb); + + if (!search_term.is_empty() && desc.findn(search_term) == -1) { + continue; + } + + TreeItem *item = input_list_tree->create_item(joyb_root); + item->set_text(0, desc); + item->set_meta("__index", i); + } + } + + if (allowed_input_types & INPUT_JOY_MOTION) { + TreeItem *joya_root = input_list_tree->create_item(root); + joya_root->set_text(0, TTR("Joypad Axes")); + joya_root->set_icon(0, icon_cache.joypad_axis); + joya_root->set_collapsed(collapse); + joya_root->set_meta("__type", INPUT_JOY_MOTION); + + for (int i = 0; i < JOY_AXIS_MAX * 2; i++) { + int axis = i / 2; + int direction = (i & 1) ? 1 : -1; + Ref<InputEventJoypadMotion> joym; + joym.instance(); + joym->set_axis(axis); + joym->set_axis_value(direction); + String desc = get_event_text(joym); + + if (!search_term.is_empty() && desc.findn(search_term) == -1) { + continue; + } + + TreeItem *item = input_list_tree->create_item(joya_root); + item->set_text(0, desc); + item->set_meta("__axis", i >> 1); + item->set_meta("__value", (i & 1) ? 1 : -1); + } + } +} + +void InputEventConfigurationDialog::_mod_toggled(bool p_checked, int p_index) { + Ref<InputEventWithModifiers> ie = event; + + // Not event with modifiers + if (ie.is_null()) { + return; + } + + if (p_index == 0) { + ie->set_alt(p_checked); + } else if (p_index == 1) { + ie->set_shift(p_checked); + } else if (p_index == 2) { + ie->set_command(p_checked); + } else if (p_index == 3) { + ie->set_control(p_checked); + } else if (p_index == 4) { + ie->set_metakey(p_checked); + } + + _set_event(ie); +} + +void InputEventConfigurationDialog::_store_command_toggled(bool p_checked) { + Ref<InputEventWithModifiers> ie = event; + if (ie.is_valid()) { + ie->set_store_command(p_checked); + _set_event(ie); + } + + if (p_checked) { + // If storing Command, show it's checkbox and hide Control (Win/Lin) or Meta (Mac) +#ifdef APPLE_STYLE_KEYS + mod_checkboxes[MOD_META]->hide(); + + mod_checkboxes[MOD_COMMAND]->show(); + mod_checkboxes[MOD_COMMAND]->set_text("Meta (Command)"); +#else + mod_checkboxes[MOD_CONTROL]->hide(); + + mod_checkboxes[MOD_COMMAND]->show(); + mod_checkboxes[MOD_COMMAND]->set_text("Control (Command)"); +#endif + } else { + // If not, hide Command, show Control and Meta. + mod_checkboxes[MOD_COMMAND]->hide(); + mod_checkboxes[MOD_CONTROL]->show(); + mod_checkboxes[MOD_META]->show(); + } +} + +void InputEventConfigurationDialog::_physical_keycode_toggled(bool p_checked) { + Ref<InputEventKey> k = event; + + if (k.is_null()) { + return; + } + + if (p_checked) { + k->set_physical_keycode(k->get_keycode()); + k->set_keycode(0); + } else { + k->set_keycode(k->get_physical_keycode()); + k->set_physical_keycode(0); + } + + _set_event(k); +} + +void InputEventConfigurationDialog::_input_list_item_selected() { + TreeItem *selected = input_list_tree->get_selected(); + + // Invalid tree selection - type only exists on the "category" items, which are not a valid selection. + if (selected->has_meta("__type")) { + return; + } + + int input_type = selected->get_parent()->get_meta("__type"); + + switch (input_type) { + case InputEventConfigurationDialog::INPUT_KEY: { + int kc = selected->get_meta("__keycode"); + Ref<InputEventKey> k; + k.instance(); + + if (physical_key_checkbox->is_pressed()) { + k->set_physical_keycode(kc); + k->set_keycode(0); + } else { + k->set_physical_keycode(0); + k->set_keycode(kc); + } + + // Maintain modifier state from checkboxes + k->set_alt(mod_checkboxes[MOD_ALT]->is_pressed()); + k->set_shift(mod_checkboxes[MOD_SHIFT]->is_pressed()); + k->set_command(mod_checkboxes[MOD_COMMAND]->is_pressed()); + k->set_control(mod_checkboxes[MOD_CONTROL]->is_pressed()); + k->set_metakey(mod_checkboxes[MOD_META]->is_pressed()); + k->set_store_command(store_command_checkbox->is_pressed()); + + _set_event(k); + } break; + case InputEventConfigurationDialog::INPUT_MOUSE_BUTTON: { + int idx = selected->get_meta("__index"); + Ref<InputEventMouseButton> mb; + mb.instance(); + mb->set_button_index(idx); + // Maintain modifier state from checkboxes + mb->set_alt(mod_checkboxes[MOD_ALT]->is_pressed()); + mb->set_shift(mod_checkboxes[MOD_SHIFT]->is_pressed()); + mb->set_command(mod_checkboxes[MOD_COMMAND]->is_pressed()); + mb->set_control(mod_checkboxes[MOD_CONTROL]->is_pressed()); + mb->set_metakey(mod_checkboxes[MOD_META]->is_pressed()); + mb->set_store_command(store_command_checkbox->is_pressed()); + + _set_event(mb); + } break; + case InputEventConfigurationDialog::INPUT_JOY_BUTTON: { + int idx = selected->get_meta("__index"); + Ref<InputEventJoypadButton> jb = InputEventJoypadButton::create_reference(idx); + _set_event(jb); + } break; + case InputEventConfigurationDialog::INPUT_JOY_MOTION: { + int axis = selected->get_meta("__axis"); + int value = selected->get_meta("__value"); + + Ref<InputEventJoypadMotion> jm; + jm.instance(); + jm->set_axis(axis); + jm->set_axis_value(value); + _set_event(jm); + } break; + default: + break; + } +} + +void InputEventConfigurationDialog::_set_current_device(int i_device) { + device_id_option->select(i_device + 1); +} + +int InputEventConfigurationDialog::_get_current_device() const { + return device_id_option->get_selected() - 1; +} + +String InputEventConfigurationDialog::_get_device_string(int i_device) const { + if (i_device == InputMap::ALL_DEVICES) { + return TTR("All Devices"); + } + return TTR("Device") + " " + itos(i_device); +} + +void InputEventConfigurationDialog::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + input_list_search->set_right_icon(input_list_search->get_theme_icon("Search", "EditorIcons")); + + physical_key_checkbox->set_icon(get_theme_icon("KeyboardPhysical", "EditorIcons")); + + icon_cache.keyboard = get_theme_icon("Keyboard", "EditorIcons"); + icon_cache.mouse = get_theme_icon("Mouse", "EditorIcons"); + icon_cache.joypad_button = get_theme_icon("JoyButton", "EditorIcons"); + icon_cache.joypad_axis = get_theme_icon("JoyAxis", "EditorIcons"); + + _update_input_list(); + } break; + default: + break; + } +} + +void InputEventConfigurationDialog::popup_and_configure(const Ref<InputEvent> &p_event) { + if (p_event.is_valid()) { + _set_event(p_event); + } else { + // Clear Event + _set_event(p_event); + + // Clear Checkbox Values + for (int i = 0; i < MOD_MAX; i++) { + mod_checkboxes[i]->set_pressed(false); + } + physical_key_checkbox->set_pressed(false); + store_command_checkbox->set_pressed(true); + _set_current_device(0); + + // Switch to "Listen" tab + tab_container->set_current_tab(0); + } + + popup_centered(); +} + +Ref<InputEvent> InputEventConfigurationDialog::get_event() const { + return event; +} + +void InputEventConfigurationDialog::set_allowed_input_types(int p_type_masks) { + allowed_input_types = p_type_masks; +} + +InputEventConfigurationDialog::InputEventConfigurationDialog() { + allowed_input_types = INPUT_KEY | INPUT_MOUSE_BUTTON | INPUT_JOY_BUTTON | INPUT_JOY_MOTION; + + set_title("Event Configuration"); + set_min_size(Size2i(550 * EDSCALE, 0)); // Min width + + VBoxContainer *main_vbox = memnew(VBoxContainer); + add_child(main_vbox); + + tab_container = memnew(TabContainer); + tab_container->set_tab_align(TabContainer::TabAlign::ALIGN_LEFT); + tab_container->set_use_hidden_tabs_for_min_size(true); + tab_container->set_v_size_flags(Control::SIZE_EXPAND_FILL); + tab_container->connect("tab_selected", callable_mp(this, &InputEventConfigurationDialog::_tab_selected)); + main_vbox->add_child(tab_container); + + CenterContainer *cc = memnew(CenterContainer); + cc->set_name("Listen for Input"); + event_as_text = memnew(Label); + event_as_text->set_align(Label::ALIGN_CENTER); + cc->add_child(event_as_text); + tab_container->add_child(cc); + + // List of all input options to manually select from. + + VBoxContainer *manual_vbox = memnew(VBoxContainer); + manual_vbox->set_name("Manual Selection"); + manual_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL); + tab_container->add_child(manual_vbox); + + input_list_search = memnew(LineEdit); + input_list_search->set_h_size_flags(Control::SIZE_EXPAND_FILL); + input_list_search->set_placeholder(TTR("Filter Inputs")); + input_list_search->set_clear_button_enabled(true); + input_list_search->connect("text_changed", callable_mp(this, &InputEventConfigurationDialog::_search_term_updated)); + manual_vbox->add_child(input_list_search); + + input_list_tree = memnew(Tree); + input_list_tree->set_custom_minimum_size(Size2(0, 100 * EDSCALE)); // Min height for tree + input_list_tree->connect("item_selected", callable_mp(this, &InputEventConfigurationDialog::_input_list_item_selected)); + input_list_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); + manual_vbox->add_child(input_list_tree); + + input_list_tree->set_hide_root(true); + input_list_tree->set_columns(1); + + _update_input_list(); + + // Additional Options + additional_options_container = memnew(VBoxContainer); + additional_options_container->hide(); + + Label *opts_label = memnew(Label); + opts_label->set_text("Additional Options"); + additional_options_container->add_child(opts_label); + + // Device Selection + device_container = memnew(HBoxContainer); + device_container->set_h_size_flags(Control::SIZE_EXPAND_FILL); + + Label *device_label = memnew(Label); + device_label->set_text("Device:"); + device_container->add_child(device_label); + + device_id_option = memnew(OptionButton); + device_id_option->set_h_size_flags(Control::SIZE_EXPAND_FILL); + device_container->add_child(device_id_option); + + for (int i = -1; i < 8; i++) { + device_id_option->add_item(_get_device_string(i)); + } + _set_current_device(0); + device_container->hide(); + additional_options_container->add_child(device_container); + + // Modifier Selection + mod_container = memnew(HBoxContainer); + for (int i = 0; i < MOD_MAX; i++) { + String name = mods[i]; + mod_checkboxes[i] = memnew(CheckBox); + mod_checkboxes[i]->connect("toggled", callable_mp(this, &InputEventConfigurationDialog::_mod_toggled), varray(i)); + mod_checkboxes[i]->set_text(name); + mod_container->add_child(mod_checkboxes[i]); + } + + mod_container->add_child(memnew(VSeparator)); + + store_command_checkbox = memnew(CheckBox); + store_command_checkbox->connect("toggled", callable_mp(this, &InputEventConfigurationDialog::_store_command_toggled)); + store_command_checkbox->set_pressed(true); + store_command_checkbox->set_text(TTR("Store Command")); +#ifdef APPLE_STYLE_KEYS + store_command_checkbox->set_tooltip(TTR("Toggles between serializing 'command' and 'meta'. Used for compatibility with Windows/Linux style keyboard.")); +#else + store_command_checkbox->set_tooltip(TTR("Toggles between serializing 'command' and 'control'. Used for compatibility with Apple Style keyboards.")); +#endif + mod_container->add_child(store_command_checkbox); + + mod_container->hide(); + additional_options_container->add_child(mod_container); + + // Physical Key Checkbox + + physical_key_checkbox = memnew(CheckBox); + physical_key_checkbox->set_text(TTR("Use Physical Keycode")); + physical_key_checkbox->set_tooltip(TTR("Stores the physical position of the key on the keyboard rather than the keys value. Used for compatibility with non-latin layouts.")); + physical_key_checkbox->connect("toggled", callable_mp(this, &InputEventConfigurationDialog::_physical_keycode_toggled)); + physical_key_checkbox->hide(); + additional_options_container->add_child(physical_key_checkbox); + + main_vbox->add_child(additional_options_container); + + // Default to first tab + tab_container->set_current_tab(0); +} + +///////////////////////////////////////// + +static bool _is_action_name_valid(const String &p_name) { + const char32_t *cstr = p_name.get_data(); + for (int i = 0; cstr[i]; i++) { + if (cstr[i] == '/' || cstr[i] == ':' || cstr[i] == '"' || + cstr[i] == '=' || cstr[i] == '\\' || cstr[i] < 32) { + return false; + } + } + return true; +} + +void ActionMapEditor::_event_config_confirmed() { + Ref<InputEvent> ev = event_config_dialog->get_event(); + + Dictionary new_action = current_action.duplicate(); + Array events = new_action["events"]; + + if (current_action_event_index == -1) { + // Add new event + events.push_back(ev); + } else { + // Edit existing event + events[current_action_event_index] = ev; + } + + new_action["events"] = events; + emit_signal("action_edited", current_action_name, new_action); +} + +void ActionMapEditor::_add_action_pressed() { + _add_action(add_edit->get_text()); +} + +void ActionMapEditor::_add_action(const String &p_name) { + if (!allow_editing_actions) { + return; + } + + if (p_name == "" || !_is_action_name_valid(p_name)) { + show_message(TTR("Invalid action name. it cannot be.is_empty()() nor contain '/', ':', '=', '\\' or '\"'")); + return; + } + + add_edit->clear(); + emit_signal("action_added", p_name); +} + +void ActionMapEditor::_action_edited() { + if (!allow_editing_actions) { + return; + } + + TreeItem *ti = action_tree->get_edited(); + if (!ti) { + return; + } + + if (action_tree->get_selected_column() == 0) { + // Name Edited + String new_name = ti->get_text(0); + String old_name = ti->get_meta("__name"); + + if (new_name == old_name) { + return; + } + + if (new_name == "" || !_is_action_name_valid(new_name)) { + ti->set_text(0, old_name); + show_message(TTR("Invalid action name. it cannot be.is_empty()() nor contain '/', ':', '=', '\\' or '\"'")); + return; + } + + emit_signal("action_renamed", old_name, new_name); + } else if (action_tree->get_selected_column() == 1) { + // Deadzone Edited + String name = ti->get_meta("__name"); + Dictionary old_action = ti->get_meta("__action"); + Dictionary new_action = old_action.duplicate(); + new_action["deadzone"] = ti->get_range(1); + + // Call deferred so that input can finish propagating through tree, allowing re-making of tree to occur. + call_deferred("emit_signal", "action_edited", name, new_action); + } +} + +void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_id) { + ItemButton option = (ItemButton)p_id; + + TreeItem *item = Object::cast_to<TreeItem>(p_item); + if (!item) { + return; + } + + switch (option) { + case ActionMapEditor::BUTTON_ADD_EVENT: { + current_action = item->get_meta("__action"); + current_action_name = item->get_meta("__name"); + current_action_event_index = -1; + + event_config_dialog->popup_and_configure(); + + } break; + case ActionMapEditor::BUTTON_EDIT_EVENT: { + // Action and Action name is located on the parent of the event. + current_action = item->get_parent()->get_meta("__action"); + current_action_name = item->get_parent()->get_meta("__name"); + + current_action_event_index = item->get_meta("__index"); + + Ref<InputEvent> ie = item->get_meta("__event"); + if (ie.is_valid()) { + event_config_dialog->popup_and_configure(ie); + } + + } break; + case ActionMapEditor::BUTTON_REMOVE_ACTION: { + if (!allow_editing_actions) { + break; + } + + // Send removed action name + String name = item->get_meta("__name"); + emit_signal("action_removed", name); + } break; + case ActionMapEditor::BUTTON_REMOVE_EVENT: { + // Remove event and send updated action + Dictionary action = item->get_parent()->get_meta("__action"); + String action_name = item->get_parent()->get_meta("__name"); + + int event_index = item->get_meta("__index"); + + Array events = action["events"]; + events.remove(event_index); + action["events"] = events; + + emit_signal("action_edited", action_name, action); + } break; + default: + break; + } +} + +void ActionMapEditor::_tree_item_activated() { + TreeItem *item = action_tree->get_selected(); + + if (!item || !item->has_meta("__event")) { + return; + } + + _tree_button_pressed(item, 2, BUTTON_EDIT_EVENT); +} + +void ActionMapEditor::set_show_uneditable(bool p_show) { + show_uneditable = p_show; + show_uneditable_actions_checkbox->set_pressed(p_show); + + // Prevent unnecessary updates of action list when cache is.is_empty()(). + if (!actions_cache.is_empty()) { + update_action_list(); + } +} + +void ActionMapEditor::_search_term_updated(const String &) { + update_action_list(); +} + +Variant ActionMapEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { + TreeItem *selected = action_tree->get_selected(); + if (!selected) { + return Variant(); + } + + String name = selected->get_text(0); + Label *label = memnew(Label(name)); + label->set_modulate(Color(1, 1, 1, 1.0f)); + action_tree->set_drag_preview(label); + + Dictionary drag_data; + + if (selected->has_meta("__action")) { + drag_data["input_type"] = "action"; + } + + if (selected->has_meta("__event")) { + drag_data["input_type"] = "event"; + } + + action_tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); + + return drag_data; +} + +bool ActionMapEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { + Dictionary d = p_data; + if (!d.has("input_type")) { + return false; + } + + TreeItem *selected = action_tree->get_selected(); + TreeItem *item = action_tree->get_item_at_position(p_point); + if (!selected || !item || item == selected) { + return false; + } + + // Don't allow moving an action in-between events. + if (d["input_type"] == "action" && item->has_meta("__event")) { + return false; + } + + // Don't allow moving an event to a different action. + if (d["input_type"] == "event" && item->get_parent() != selected->get_parent()) { + return false; + } + + return true; +} + +void ActionMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { + if (!can_drop_data_fw(p_point, p_data, p_from)) { + return; + } + + TreeItem *selected = action_tree->get_selected(); + TreeItem *target = action_tree->get_item_at_position(p_point); + bool drop_above = action_tree->get_drop_section_at_position(p_point) == -1; + + if (!target) { + return; + } + + Dictionary d = p_data; + if (d["input_type"] == "action") { + // Change action order. + String relative_to = target->get_meta("__name"); + String action_name = selected->get_meta("__name"); + emit_signal("action_reordered", action_name, relative_to, drop_above); + + } else if (d["input_type"] == "event") { + // Change event order + int current_index = selected->get_meta("__index"); + int target_index = target->get_meta("__index"); + + // Construct new events array. + Dictionary new_action = selected->get_parent()->get_meta("__action"); + + Array events = new_action["events"]; + Array new_events; + + // The following method was used to perform the array changes since `remove` followed by `insert` was not working properly at time of writing. + // Loop thought existing events + for (int i = 0; i < events.size(); i++) { + // If you come across the current index, just skip it, as it has been moved. + if (i == current_index) { + continue; + } else if (i == target_index) { + // We are at the target index. If drop above, add selected event there first, then target, so moved event goes on top. + if (drop_above) { + new_events.push_back(events[current_index]); + new_events.push_back(events[target_index]); + } else { + new_events.push_back(events[target_index]); + new_events.push_back(events[current_index]); + } + } else { + new_events.push_back(events[i]); + } + } + + new_action["events"] = new_events; + emit_signal("action_edited", selected->get_parent()->get_meta("__name"), new_action); + } +} + +void ActionMapEditor::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + action_list_search->set_right_icon(get_theme_icon("Search", "EditorIcons")); + } break; + default: + break; + } +} + +void ActionMapEditor::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ActionMapEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ActionMapEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &ActionMapEditor::drop_data_fw); + + ADD_SIGNAL(MethodInfo("action_added", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("action_edited", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::DICTIONARY, "new_action"))); + ADD_SIGNAL(MethodInfo("action_removed", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("action_renamed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name"))); + ADD_SIGNAL(MethodInfo("action_reordered", PropertyInfo(Variant::STRING, "action_name"), PropertyInfo(Variant::STRING, "relative_to"), PropertyInfo(Variant::BOOL, "before"))); +} + +LineEdit *ActionMapEditor::get_search_box() const { + return action_list_search; +} + +InputEventConfigurationDialog *ActionMapEditor::get_configuration_dialog() { + return event_config_dialog; +} + +void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_infos) { + if (!p_action_infos.is_empty()) { + actions_cache = p_action_infos; + } + + action_tree->clear(); + TreeItem *root = action_tree->create_item(); + + int uneditable_count = 0; + + for (int i = 0; i < actions_cache.size(); i++) { + ActionInfo action_info = actions_cache[i]; + + if (!action_info.editable) { + uneditable_count++; + } + + String search_term = action_list_search->get_text(); + if (!search_term.is_empty() && action_info.name.findn(search_term) == -1) { + continue; + } + + if (!action_info.editable && !show_uneditable) { + continue; + } + + const Array events = action_info.action["events"]; + const Variant deadzone = action_info.action["deadzone"]; + + // Update Tree... + + TreeItem *action_item = action_tree->create_item(root); + action_item->set_meta("__action", action_info.action); + action_item->set_meta("__name", action_info.name); + + // First Column - Action Name + action_item->set_text(0, action_info.name); + action_item->set_editable(0, action_info.editable); + action_item->set_icon(0, action_info.icon); + + // Second Column - Deadzone + action_item->set_editable(1, true); + action_item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); + action_item->set_range_config(1, 0.0, 1.0, 0.01); + action_item->set_range(1, deadzone); + + // Third column - buttons + action_item->add_button(2, action_tree->get_theme_icon("Add", "EditorIcons"), BUTTON_ADD_EVENT, false, TTR("Add Event")); + action_item->add_button(2, action_tree->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_ACTION, !action_info.editable, action_info.editable ? "Remove Action" : "Cannot Remove Action"); + + action_item->set_custom_bg_color(0, action_tree->get_theme_color("prop_subsection", "Editor")); + action_item->set_custom_bg_color(1, action_tree->get_theme_color("prop_subsection", "Editor")); + + for (int evnt_idx = 0; evnt_idx < events.size(); evnt_idx++) { + Ref<InputEvent> event = events[evnt_idx]; + if (event.is_null()) { + continue; + } + + TreeItem *event_item = action_tree->create_item(action_item); + + // First Column - Text + event_item->set_text(0, event_config_dialog->get_event_text(event)); // Need to us the special description for JoypadMotion here, so don't use as_text() directly. + event_item->set_meta("__event", event); + event_item->set_meta("__index", evnt_idx); + + // Third Column - Buttons + event_item->add_button(2, action_tree->get_theme_icon("Edit", "EditorIcons"), BUTTON_EDIT_EVENT, false, TTR("Edit Event")); + event_item->add_button(2, action_tree->get_theme_icon("Remove", "EditorIcons"), BUTTON_REMOVE_EVENT, false, TTR("Remove Event")); + event_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); + event_item->set_button_color(2, 1, Color(1, 1, 1, 0.75)); + } + } +} + +void ActionMapEditor::show_message(const String &p_message) { + message->set_text(p_message); + message->popup_centered(Size2(300, 100) * EDSCALE); +} + +void ActionMapEditor::set_allow_editing_actions(bool p_allow) { + allow_editing_actions = p_allow; + add_hbox->set_visible(p_allow); +} + +void ActionMapEditor::set_toggle_editable_label(const String &p_label) { + show_uneditable_actions_checkbox->set_text(p_label); +} + +void ActionMapEditor::use_external_search_box(LineEdit *p_searchbox) { + memdelete(action_list_search); + action_list_search = p_searchbox; + action_list_search->connect("text_changed", callable_mp(this, &ActionMapEditor::_search_term_updated)); +} + +ActionMapEditor::ActionMapEditor() { + allow_editing_actions = true; + show_uneditable = true; + + // Main Vbox Container + VBoxContainer *main_vbox = memnew(VBoxContainer); + main_vbox->set_anchors_and_offsets_preset(PRESET_WIDE); + add_child(main_vbox); + + HBoxContainer *top_hbox = memnew(HBoxContainer); + main_vbox->add_child(top_hbox); + + action_list_search = memnew(LineEdit); + action_list_search->set_h_size_flags(Control::SIZE_EXPAND_FILL); + action_list_search->set_placeholder(TTR("Filter Actions")); + action_list_search->set_clear_button_enabled(true); + action_list_search->connect("text_changed", callable_mp(this, &ActionMapEditor::_search_term_updated)); + top_hbox->add_child(action_list_search); + + show_uneditable_actions_checkbox = memnew(CheckBox); + show_uneditable_actions_checkbox->set_pressed(false); + show_uneditable_actions_checkbox->set_text(TTR("Show Uneditable Actions")); + show_uneditable_actions_checkbox->connect("toggled", callable_mp(this, &ActionMapEditor::set_show_uneditable)); + top_hbox->add_child(show_uneditable_actions_checkbox); + + // Adding Action line edit + button + add_hbox = memnew(HBoxContainer); + add_hbox->set_h_size_flags(Control::SIZE_EXPAND_FILL); + + add_edit = memnew(LineEdit); + add_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + add_edit->set_placeholder(TTR("Add New Action")); + add_edit->set_clear_button_enabled(true); + add_edit->connect("text_entered", callable_mp(this, &ActionMapEditor::_add_action)); + add_hbox->add_child(add_edit); + + Button *add_button = memnew(Button); + add_button->set_text("Add"); + add_button->connect("pressed", callable_mp(this, &ActionMapEditor::_add_action_pressed)); + add_hbox->add_child(add_button); + + main_vbox->add_child(add_hbox); + + // Action Editor Tree + action_tree = memnew(Tree); + action_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); + action_tree->set_columns(3); + action_tree->set_hide_root(true); + action_tree->set_column_titles_visible(true); + action_tree->set_column_title(0, TTR("Action")); + action_tree->set_column_title(1, TTR("Deadzone")); + action_tree->set_column_expand(1, false); + action_tree->set_column_min_width(1, 80 * EDSCALE); + action_tree->set_column_expand(2, false); + action_tree->set_column_min_width(2, 50 * EDSCALE); + action_tree->connect("item_edited", callable_mp(this, &ActionMapEditor::_action_edited)); + action_tree->connect("item_activated", callable_mp(this, &ActionMapEditor::_tree_item_activated)); + action_tree->connect("button_pressed", callable_mp(this, &ActionMapEditor::_tree_button_pressed)); + main_vbox->add_child(action_tree); + + action_tree->set_drag_forwarding(this); + + // Adding event dialog + event_config_dialog = memnew(InputEventConfigurationDialog); + event_config_dialog->connect("confirmed", callable_mp(this, &ActionMapEditor::_event_config_confirmed)); + add_child(event_config_dialog); + + message = memnew(AcceptDialog); + add_child(message); +} diff --git a/editor/action_map_editor.h b/editor/action_map_editor.h new file mode 100644 index 0000000000..f1f7bffef4 --- /dev/null +++ b/editor/action_map_editor.h @@ -0,0 +1,203 @@ +/*************************************************************************/ +/* action_map_editor.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef ACTION_MAP_EDITOR_H +#define ACTION_MAP_EDITOR_H + +#include "editor/editor_data.h" + +// Confirmation Dialog used when configuring an input event. +// Separate from ActionMapEditor for code cleanliness and separation of responsibilities. +class InputEventConfigurationDialog : public ConfirmationDialog { + GDCLASS(InputEventConfigurationDialog, ConfirmationDialog); + +public: + enum InputType { + INPUT_KEY = 1, + INPUT_MOUSE_BUTTON = 2, + INPUT_JOY_BUTTON = 4, + INPUT_JOY_MOTION = 8 + }; + +private: + struct IconCache { + Ref<Texture2D> keyboard; + Ref<Texture2D> mouse; + Ref<Texture2D> joypad_button; + Ref<Texture2D> joypad_axis; + } icon_cache; + + Ref<InputEvent> event = Ref<InputEvent>(); + + TabContainer *tab_container; + + // Listening for input + Label *event_as_text; + + // List of All Key/Mouse/Joypad input options. + int allowed_input_types; + Tree *input_list_tree; + LineEdit *input_list_search; + + // Additional Options, shown depending on event selected + VBoxContainer *additional_options_container; + + HBoxContainer *device_container; + OptionButton *device_id_option; + + HBoxContainer *mod_container; // Contains the subcontainer and the store command checkbox. + + enum ModCheckbox { + MOD_ALT, + MOD_SHIFT, + MOD_COMMAND, + MOD_CONTROL, + MOD_META, + MOD_MAX + }; + String mods[MOD_MAX] = { "Alt", "Shift", "Command", "Control", "Meta" }; + + CheckBox *mod_checkboxes[MOD_MAX]; + CheckBox *store_command_checkbox; + + CheckBox *physical_key_checkbox; + + void _set_event(const Ref<InputEvent> &p_event); + + void _tab_selected(int p_tab); + void _listen_window_input(const Ref<InputEvent> &p_event); + + void _search_term_updated(const String &p_term); + void _update_input_list(); + void _input_list_item_selected(); + + void _mod_toggled(bool p_checked, int p_index); + void _store_command_toggled(bool p_checked); + void _physical_keycode_toggled(bool p_checked); + + void _set_current_device(int i_device); + int _get_current_device() const; + String _get_device_string(int i_device) const; + +protected: + void _notification(int p_what); + +public: + // Pass an existing event to configure it. Alternatively, pass no event to start with a blank configuration. + void popup_and_configure(const Ref<InputEvent> &p_event = Ref<InputEvent>()); + Ref<InputEvent> get_event() const; + String get_event_text(const Ref<InputEvent> &p_event); + + void set_allowed_input_types(int p_type_masks); + + InputEventConfigurationDialog(); +}; + +class ActionMapEditor : public Control { + GDCLASS(ActionMapEditor, Control); + +public: + struct ActionInfo { + String name = String(); + Dictionary action = Dictionary(); + + Ref<Texture2D> icon = Ref<Texture2D>(); + bool editable = true; + }; + +private: + enum ItemButton { + BUTTON_ADD_EVENT, + BUTTON_EDIT_EVENT, + BUTTON_REMOVE_ACTION, + BUTTON_REMOVE_EVENT, + }; + + Vector<ActionInfo> actions_cache; + Tree *action_tree; + + // Storing which action/event is currently being edited in the InputEventConfigurationDialog. + + Dictionary current_action = Dictionary(); + String current_action_name = String(); + int current_action_event_index = -1; + + // Popups + + InputEventConfigurationDialog *event_config_dialog; + AcceptDialog *message; + + // Filtering and Adding actions + + bool show_uneditable; + CheckBox *show_uneditable_actions_checkbox; + LineEdit *action_list_search; + + bool allow_editing_actions; + HBoxContainer *add_hbox; + LineEdit *add_edit; + + void _event_config_confirmed(); + + void _add_action_pressed(); + void _add_action(const String &p_name); + void _action_edited(); + + void _tree_button_pressed(Object *p_item, int p_column, int p_id); + void _tree_item_activated(); + void _search_term_updated(const String &p_search_term); + + Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); + bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; + void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); + +protected: + void _notification(int p_what); + static void _bind_methods(); + +public: + LineEdit *get_search_box() const; + InputEventConfigurationDialog *get_configuration_dialog(); + + // Dictionary represents an Action with "events" (Array) and "deadzone" (float) items. Pass with no param to update list from cached action map. + void update_action_list(const Vector<ActionInfo> &p_action_infos = Vector<ActionInfo>()); + void show_message(const String &p_message); + + void set_show_uneditable(bool p_show); + void set_allow_editing_actions(bool p_allow); + + void set_toggle_editable_label(const String &p_label); + + void use_external_search_box(LineEdit *p_searchbox); + + ActionMapEditor(); +}; + +#endif diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index 8be8735f3e..539657afd7 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -155,7 +155,7 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) { preview->playback->stop(); - preview->generating = false; + preview->generating.clear(); } Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<AudioStream> &p_stream) { @@ -172,7 +172,7 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref< Preview *preview = &previews[p_stream->get_instance_id()]; preview->base_stream = p_stream; preview->playback = preview->base_stream->instance_playback(); - preview->generating = true; + preview->generating.set(); preview->id = p_stream->get_instance_id(); float len_s = preview->base_stream->get_length(); @@ -217,7 +217,7 @@ void AudioStreamPreviewGenerator::_notification(int p_what) { if (p_what == NOTIFICATION_PROCESS) { List<ObjectID> to_erase; for (Map<ObjectID, Preview>::Element *E = previews.front(); E; E = E->next()) { - if (!E->get().generating) { + if (!E->get().generating.is_set()) { if (E->get().thread) { E->get().thread->wait_to_finish(); memdelete(E->get().thread); diff --git a/editor/audio_stream_preview.h b/editor/audio_stream_preview.h index 21c9ea203e..accc7275c0 100644 --- a/editor/audio_stream_preview.h +++ b/editor/audio_stream_preview.h @@ -32,6 +32,7 @@ #define AUDIO_STREAM_PREVIEW_H #include "core/os/thread.h" +#include "core/templates/safe_refcount.h" #include "scene/main/node.h" #include "servers/audio/audio_stream.h" @@ -60,9 +61,20 @@ class AudioStreamPreviewGenerator : public Node { Ref<AudioStreamPreview> preview; Ref<AudioStream> base_stream; Ref<AudioStreamPlayback> playback; - volatile bool generating = false; + SafeFlag generating; ObjectID id; Thread *thread = nullptr; + + // Needed for the bookkeeping of the Map + Preview &operator=(const Preview &p_rhs) { + preview = p_rhs.preview; + base_stream = p_rhs.base_stream; + playback = p_rhs.playback; + generating.set_to(generating.is_set()); + id = p_rhs.id; + thread = p_rhs.thread; + return *this; + } }; Map<ObjectID, Preview> previews; diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 01aad0c41b..6d694358bf 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1150,7 +1150,6 @@ void EditorFileDialog::_update_drives() { void EditorFileDialog::_favorite_selected(int p_idx) { dir_access->change_dir(favorites->get_item_metadata(p_idx)); - file->set_text(""); update_dir(); invalidate(); _push_history(); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 093c6f4279..3c6649a66a 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1413,11 +1413,11 @@ void EditorFileSystem::_scan_script_classes(EditorFileSystemDirectory *p_dir) { } void EditorFileSystem::update_script_classes() { - if (!update_script_classes_queued) { + if (!update_script_classes_queued.is_set()) { return; } - update_script_classes_queued = false; + update_script_classes_queued.clear(); ScriptServer::global_classes_clear(); if (get_filesystem()) { _scan_script_classes(get_filesystem()); @@ -1436,11 +1436,11 @@ void EditorFileSystem::update_script_classes() { } void EditorFileSystem::_queue_update_script_classes() { - if (update_script_classes_queued) { + if (update_script_classes_queued.is_set()) { return; } - update_script_classes_queued = true; + update_script_classes_queued.set(); call_deferred("update_script_classes"); } @@ -2091,7 +2091,7 @@ EditorFileSystem::EditorFileSystem() { memdelete(da); scan_total = 0; - update_script_classes_queued = false; + update_script_classes_queued.clear(); first_scan = true; scan_changes_pending = false; revalidate_import_files = false; diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index fa0b89e667..dec2330256 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -34,6 +34,7 @@ #include "core/os/dir_access.h" #include "core/os/thread.h" #include "core/os/thread_safe.h" +#include "core/templates/safe_refcount.h" #include "core/templates/set.h" #include "scene/main/node.h" class FileAccess; @@ -220,7 +221,7 @@ class EditorFileSystem : public Node { }; void _scan_script_classes(EditorFileSystemDirectory *p_dir); - volatile bool update_script_classes_queued; + SafeFlag update_script_classes_queued; void _queue_update_script_classes(); String _get_global_script_class(const String &p_type, const String &p_path, String *r_extends, String *r_icon_path) const; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 60071f6263..74b874b54e 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1761,6 +1761,10 @@ void EditorInspector::update_tree() { continue; } + if (p.name == "script") { + category_vbox = nullptr; // script should go into its own category + } + if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && RS::get_singleton()->is_low_end()) { continue; //do not show this property in low end gfx } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index cdbc4a0de9..ec8430e645 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5555,7 +5555,8 @@ static void _execute_thread(void *p_ud) { eta->exitcode = err; } - eta->done = true; + eta->done.set(); + ; } int EditorNode::execute_and_show_output(const String &p_title, const String &p_path, const List<String> &p_arguments, bool p_close_on_ok, bool p_close_on_errors) { @@ -5569,13 +5570,12 @@ int EditorNode::execute_and_show_output(const String &p_title, const String &p_p eta.path = p_path; eta.args = p_arguments; eta.exitcode = 255; - eta.done = false; int prev_len = 0; eta.execute_output_thread.start(_execute_thread, &eta); - while (!eta.done) { + while (!eta.done.is_set()) { { MutexLock lock(eta.execute_output_mutex); if (prev_len != eta.output.length()) { @@ -6215,8 +6215,8 @@ EditorNode::EditorNode() { pm_export->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); p->add_separator(); - p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"), KEY_MASK_CMD + KEY_Z), EDIT_UNDO, true); - p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"), KEY_MASK_CMD + KEY_MASK_SHIFT + KEY_Z), EDIT_REDO, true); + p->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO, true); + p->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO, true); p->add_separator(); p->add_shortcut(ED_SHORTCUT("editor/reload_saved_scene", TTR("Reload Saved Scene")), EDIT_RELOAD_SAVED_SCENE); diff --git a/editor/editor_node.h b/editor/editor_node.h index 8740488d18..91d873d16f 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -31,6 +31,7 @@ #ifndef EDITOR_NODE_H #define EDITOR_NODE_H +#include "core/templates/safe_refcount.h" #include "editor/editor_data.h" #include "editor/editor_export.h" #include "editor/editor_folding.h" @@ -111,7 +112,7 @@ public: Thread execute_output_thread; Mutex execute_output_mutex; int exitcode = 0; - volatile bool done = false; + SafeFlag done; }; private: diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index a798344973..de688f2709 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -573,8 +573,7 @@ void EditorPropertyArray::_bind_methods() { EditorPropertyArray::EditorPropertyArray() { object.instance(); - page_idx = 0; - page_len = 10; + page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); edit = memnew(Button); edit->set_flat(true); edit->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1069,8 +1068,7 @@ void EditorPropertyDictionary::_bind_methods() { EditorPropertyDictionary::EditorPropertyDictionary() { object.instance(); - page_idx = 0; - page_len = 10; + page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); edit = memnew(Button); edit->set_flat(true); edit->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h index 0359f3d9bc..fa5adc788d 100644 --- a/editor/editor_properties_array_dict.h +++ b/editor/editor_properties_array_dict.h @@ -84,8 +84,8 @@ class EditorPropertyArray : public EditorProperty { bool dropping; Ref<EditorPropertyArrayObject> object; - int page_len; - int page_idx; + int page_len = 20; + int page_idx = 0; int changing_type_idx; Button *edit; VBoxContainer *vbox; @@ -129,8 +129,8 @@ class EditorPropertyDictionary : public EditorProperty { bool updating; Ref<EditorPropertyDictionaryObject> object; - int page_len; - int page_idx; + int page_len = 20; + int page_idx = 0; int changing_type_idx; Button *edit; VBoxContainer *vbox; diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 8056846f52..77288be614 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -206,8 +206,8 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< } void EditorResourcePreview::_thread() { - exited = false; - while (!exit) { + exited.clear(); + while (!exit.is_set()) { preview_sem.wait(); preview_mutex.lock(); @@ -326,7 +326,7 @@ void EditorResourcePreview::_thread() { preview_mutex.unlock(); } } - exited = true; + exited.set(); } void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata) { @@ -430,9 +430,9 @@ void EditorResourcePreview::start() { void EditorResourcePreview::stop() { if (thread.is_started()) { - exit = true; + exit.set(); preview_sem.post(); - while (!exited) { + while (!exited.is_set()) { OS::get_singleton()->delay_usec(10000); RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server } @@ -443,8 +443,6 @@ void EditorResourcePreview::stop() { EditorResourcePreview::EditorResourcePreview() { singleton = this; order = 0; - exit = false; - exited = false; } EditorResourcePreview::~EditorResourcePreview() { diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index 99c48967d8..c4e796dcf1 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -33,6 +33,7 @@ #include "core/os/semaphore.h" #include "core/os/thread.h" +#include "core/templates/safe_refcount.h" #include "scene/main/node.h" #include "scene/resources/texture.h" @@ -71,8 +72,8 @@ class EditorResourcePreview : public Node { Mutex preview_mutex; Semaphore preview_sem; Thread thread; - volatile bool exit; - volatile bool exited; + SafeFlag exit; + SafeFlag exited; struct Item { Ref<Texture2D> preview; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index c530058c80..ef1f8030fa 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -31,6 +31,7 @@ #include "editor_settings.h" #include "core/config/project_settings.h" +#include "core/input/input_map.h" #include "core/io/certs_compressed.gen.h" #include "core/io/compression.h" #include "core/io/config_file.h" @@ -70,7 +71,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) { bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) { _THREAD_SAFE_METHOD_ - if (p_name.operator String() == "shortcuts") { + if (p_name == "shortcuts") { Array arr = p_value; ERR_FAIL_COND_V(arr.size() && arr.size() & 1, true); for (int i = 0; i < arr.size(); i += 2) { @@ -84,6 +85,24 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) } return false; + } else if (p_name == "builtin_action_overrides") { + Array actions_arr = p_value; + for (int i = 0; i < actions_arr.size(); i++) { + Dictionary action_dict = actions_arr[i]; + + String name = action_dict["name"]; + Array events = action_dict["events"]; + + InputMap *im = InputMap::get_singleton(); + im->action_erase_events(name); + + builtin_action_overrides[name].clear(); + for (int ev_idx = 0; ev_idx < events.size(); ev_idx++) { + im->action_add_event(name, events[ev_idx]); + builtin_action_overrides[name].push_back(events[ev_idx]); + } + } + return false; } bool changed = false; @@ -118,11 +137,16 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { _THREAD_SAFE_METHOD_ - if (p_name.operator String() == "shortcuts") { + if (p_name == "shortcuts") { Array arr; for (const Map<String, Ref<Shortcut>>::Element *E = shortcuts.front(); E; E = E->next()) { Ref<Shortcut> sc = E->get(); + if (builtin_action_overrides.has(E->key())) { + // This shortcut was auto-generated from built in actions: don't save. + continue; + } + if (optimize_save) { if (!sc->has_meta("original")) { continue; //this came from settings but is not any longer used @@ -139,6 +163,27 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { } r_ret = arr; return true; + } else if (p_name == "builtin_action_overrides") { + Array actions_arr; + for (Map<String, List<Ref<InputEvent>>>::Element *E = builtin_action_overrides.front(); E; E = E->next()) { + List<Ref<InputEvent>> events = E->get(); + + // TODO: skip actions which are the same as the builtin. + Dictionary action_dict; + action_dict["name"] = E->key(); + + Array events_arr; + for (List<Ref<InputEvent>>::Element *I = events.front(); I; I = I->next()) { + events_arr.push_back(I->get()); + } + + action_dict["events"] = events_arr; + + actions_arr.push_back(action_dict); + } + + r_ret = actions_arr; + return true; } const VariantContainer *v = props.getptr(p_name); @@ -220,6 +265,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { } p_list->push_back(PropertyInfo(Variant::ARRAY, "shortcuts", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); //do not edit + p_list->push_back(PropertyInfo(Variant::ARRAY, "builtin_action_overrides", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL)); } void EditorSettings::_add_property_info_bind(const Dictionary &p_info) { @@ -385,6 +431,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("interface/editor/hide_console_window", false); _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression + // Inspector + _initial_set("interface/inspector/max_array_dictionary_items_per_page", 20); + hints["interface/inspector/max_array_dictionary_items_per_page"] = PropertyInfo(Variant::INT, "interface/inspector/max_array_dictionary_items_per_page", PROPERTY_HINT_RANGE, "10,100,1", PROPERTY_USAGE_DEFAULT); + // Theme _initial_set("interface/theme/preset", "Default"); hints["interface/theme/preset"] = PropertyInfo(Variant::STRING, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Alien,Arc,Godot 2,Grey,Light,Solarized (Dark),Solarized (Light),Custom", PROPERTY_USAGE_DEFAULT); @@ -1539,12 +1589,39 @@ bool EditorSettings::is_shortcut(const String &p_name, const Ref<InputEvent> &p_ } Ref<Shortcut> EditorSettings::get_shortcut(const String &p_name) const { - const Map<String, Ref<Shortcut>>::Element *E = shortcuts.find(p_name); - if (!E) { - return Ref<Shortcut>(); + const Map<String, Ref<Shortcut>>::Element *SC = shortcuts.find(p_name); + if (SC) { + return SC->get(); } - return E->get(); + // If no shortcut with the provided name is found in the list, check the built-in shortcuts. + // Use the first item in the action list for the shortcut event, since a shortcut can only have 1 linked event. + + Ref<Shortcut> sc; + const Map<String, List<Ref<InputEvent>>>::Element *builtin_override = builtin_action_overrides.find(p_name); + if (builtin_override) { + sc.instance(); + sc->set_shortcut(builtin_override->get().front()->get()); + sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name)); + } + + // If there was no override, check the default builtins to see if it has an InputEvent for the provided name. + if (sc.is_null()) { + const OrderedHashMap<String, List<Ref<InputEvent>>>::ConstElement builtin_default = InputMap::get_singleton()->get_builtins().find(p_name); + if (builtin_default) { + sc.instance(); + sc->set_shortcut(builtin_default.get().front()->get()); + sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name)); + } + } + + if (sc.is_valid()) { + // Add the shortcut to the list. + shortcuts[p_name] = sc; + return sc; + } + + return Ref<Shortcut>(); } void EditorSettings::get_shortcut_list(List<String> *r_shortcuts) { @@ -1610,6 +1687,66 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p return sc; } +void EditorSettings::set_builtin_action_override(const String &p_name, const Array &p_events) { + List<Ref<InputEvent>> event_list; + + // Override the whole list, since events may have their order changed or be added, removed or edited. + InputMap::get_singleton()->action_erase_events(p_name); + for (int i = 0; i < p_events.size(); i++) { + event_list.push_back(p_events[i]); + InputMap::get_singleton()->action_add_event(p_name, p_events[i]); + } + + // Check if the provided event array is same as built-in. If it is, it does not need to be added to the overrides. + // Note that event order must also be the same. + bool same_as_builtin = true; + OrderedHashMap<String, List<Ref<InputEvent>>>::ConstElement builtin_default = InputMap::get_singleton()->get_builtins().find(p_name); + if (builtin_default) { + List<Ref<InputEvent>> builtin_events = builtin_default.get(); + + if (p_events.size() == builtin_events.size()) { + int event_idx = 0; + + // Check equality of each event. + for (List<Ref<InputEvent>>::Element *E = builtin_events.front(); E; E = E->next()) { + if (!E->get()->shortcut_match(p_events[event_idx])) { + same_as_builtin = false; + break; + } + event_idx++; + } + } else { + same_as_builtin = false; + } + } + + if (same_as_builtin && builtin_action_overrides.has(p_name)) { + builtin_action_overrides.erase(p_name); + } else { + builtin_action_overrides[p_name] = event_list; + } + + // Update the shortcut (if it is used somewhere in the editor) to be the first event of the new list. + if (shortcuts.has(p_name)) { + shortcuts[p_name]->set_shortcut(event_list.front()->get()); + } +} + +const Array EditorSettings::get_builtin_action_overrides(const String &p_name) const { + const Map<String, List<Ref<InputEvent>>>::Element *AO = builtin_action_overrides.find(p_name); + if (AO) { + Array event_array; + + List<Ref<InputEvent>> events_list = AO->get(); + for (List<Ref<InputEvent>>::Element *E = events_list.front(); E; E = E->next()) { + event_array.push_back(E->get()); + } + return event_array; + } + + return Array(); +} + void EditorSettings::notify_changes() { _THREAD_SAFE_METHOD_ @@ -1648,6 +1785,8 @@ void EditorSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("set_recent_dirs", "dirs"), &EditorSettings::set_recent_dirs); ClassDB::bind_method(D_METHOD("get_recent_dirs"), &EditorSettings::get_recent_dirs); + ClassDB::bind_method(D_METHOD("set_builtin_action_override", "name", "actions_list"), &EditorSettings::set_builtin_action_override); + ADD_SIGNAL(MethodInfo("settings_changed")); BIND_CONSTANT(NOTIFICATION_EDITOR_SETTINGS_CHANGED); diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 616a938a86..e5f8527faf 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -84,7 +84,8 @@ private: int last_order; Ref<Resource> clipboard; - Map<String, Ref<Shortcut>> shortcuts; + mutable Map<String, Ref<Shortcut>> shortcuts; + Map<String, List<Ref<InputEvent>>> builtin_action_overrides; String resource_path; String settings_dir; @@ -186,6 +187,9 @@ public: Ref<Shortcut> get_shortcut(const String &p_name) const; void get_shortcut_list(List<String> *r_shortcuts); + void set_builtin_action_override(const String &p_name, const Array &p_events); + const Array get_builtin_action_overrides(const String &p_name) const; + void notify_changes(); EditorSettings(); diff --git a/editor/input_map_editor.cpp b/editor/input_map_editor.cpp deleted file mode 100644 index 9a5e7d164c..0000000000 --- a/editor/input_map_editor.cpp +++ /dev/null @@ -1,1033 +0,0 @@ -/*************************************************************************/ -/* input_map_editor.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "input_map_editor.h" - -#include "core/input/input_map.h" -#include "core/os/keyboard.h" -#include "editor/editor_node.h" -#include "editor/editor_scale.h" - -void InputMapEditor::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - action_add_error->add_theme_color_override("font_color", input_editor->get_theme_color("error_color", "Editor")); - popup_add->add_icon_item(input_editor->get_theme_icon("Keyboard", "EditorIcons"), TTR("Key"), INPUT_KEY); - popup_add->add_icon_item(input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons"), TTR("Physical Key"), INPUT_KEY_PHYSICAL); - popup_add->add_icon_item(input_editor->get_theme_icon("JoyButton", "EditorIcons"), TTR("Joy Button"), INPUT_JOY_BUTTON); - popup_add->add_icon_item(input_editor->get_theme_icon("JoyAxis", "EditorIcons"), TTR("Joy Axis"), INPUT_JOY_MOTION); - popup_add->add_icon_item(input_editor->get_theme_icon("Mouse", "EditorIcons"), TTR("Mouse Button"), INPUT_MOUSE_BUTTON); - _update_actions(); - } break; - case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - action_add_error->add_theme_color_override("font_color", input_editor->get_theme_color("error_color", "Editor")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY), input_editor->get_theme_icon("Keyboard", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_KEY_PHYSICAL), input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_BUTTON), input_editor->get_theme_icon("JoyButton", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_JOY_MOTION), input_editor->get_theme_icon("JoyAxis", "EditorIcons")); - popup_add->set_item_icon(popup_add->get_item_index(INPUT_MOUSE_BUTTON), input_editor->get_theme_icon("Mouse", "EditorIcons")); - _update_actions(); - } break; - } -} - -static bool _validate_action_name(const String &p_name) { - const char32_t *cstr = p_name.get_data(); - for (int i = 0; cstr[i]; i++) { - if (cstr[i] == '/' || cstr[i] == ':' || cstr[i] == '"' || - cstr[i] == '=' || cstr[i] == '\\' || cstr[i] < 32) { - return false; - } - } - return true; -} - -void InputMapEditor::_action_selected() { - TreeItem *ti = input_editor->get_selected(); - if (!ti || !ti->is_editable(0)) { - return; - } - - add_at = "input/" + ti->get_text(0); - edit_idx = -1; -} - -void InputMapEditor::_action_edited() { - TreeItem *ti = input_editor->get_selected(); - if (!ti) { - return; - } - - if (input_editor->get_selected_column() == 0) { - String new_name = ti->get_text(0); - String old_name = add_at.substr(add_at.find("/") + 1, add_at.length()); - - if (new_name == old_name) { - return; - } - - if (new_name == "" || !_validate_action_name(new_name)) { - ti->set_text(0, old_name); - add_at = "input/" + old_name; - - message->set_text(TTR("Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or '\"'")); - message->popup_centered(Size2(300, 100) * EDSCALE); - return; - } - - String action_prop = "input/" + new_name; - - if (ProjectSettings::get_singleton()->has_setting(action_prop)) { - ti->set_text(0, old_name); - add_at = "input/" + old_name; - - message->set_text(vformat(TTR("An action with the name '%s' already exists."), new_name)); - message->popup_centered(Size2(300, 100) * EDSCALE); - return; - } - - int order = ProjectSettings::get_singleton()->get_order(add_at); - Dictionary action = ProjectSettings::get_singleton()->get(add_at); - - setting = true; - undo_redo->create_action(TTR("Rename Input Action Event")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", add_at); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", action_prop, action); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", action_prop, order); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", action_prop); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", add_at, action); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", add_at, order); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - setting = false; - - add_at = action_prop; - } else if (input_editor->get_selected_column() == 1) { - String name = "input/" + ti->get_text(0); - Dictionary old_action = ProjectSettings::get_singleton()->get(name); - Dictionary new_action = old_action.duplicate(); - new_action["deadzone"] = ti->get_range(1); - - undo_redo->create_action(TTR("Change Action deadzone")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, new_action); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_action); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - } -} - -void InputMapEditor::_device_input_add() { - Ref<InputEvent> ie; - String name = add_at; - int idx = edit_idx; - Dictionary old_val = ProjectSettings::get_singleton()->get(name); - Dictionary action = old_val.duplicate(); - Array events = action["events"]; - - switch (add_type) { - case INPUT_MOUSE_BUTTON: { - Ref<InputEventMouseButton> mb; - mb.instance(); - mb->set_button_index(device_index->get_selected() + 1); - mb->set_device(_get_current_device()); - - for (int i = 0; i < events.size(); i++) { - Ref<InputEventMouseButton> aie = events[i]; - if (aie.is_null()) { - continue; - } - if (aie->get_device() == mb->get_device() && aie->get_button_index() == mb->get_button_index()) { - return; - } - } - - ie = mb; - - } break; - case INPUT_JOY_MOTION: { - Ref<InputEventJoypadMotion> jm; - jm.instance(); - jm->set_axis(device_index->get_selected() >> 1); - jm->set_axis_value((device_index->get_selected() & 1) ? 1 : -1); - jm->set_device(_get_current_device()); - - for (int i = 0; i < events.size(); i++) { - Ref<InputEventJoypadMotion> aie = events[i]; - if (aie.is_null()) { - continue; - } - - if (aie->get_device() == jm->get_device() && aie->get_axis() == jm->get_axis() && aie->get_axis_value() == jm->get_axis_value()) { - return; - } - } - - ie = jm; - - } break; - case INPUT_JOY_BUTTON: { - Ref<InputEventJoypadButton> jb; - jb.instance(); - - jb->set_button_index(device_index->get_selected()); - jb->set_device(_get_current_device()); - - for (int i = 0; i < events.size(); i++) { - Ref<InputEventJoypadButton> aie = events[i]; - if (aie.is_null()) { - continue; - } - if (aie->get_device() == jb->get_device() && aie->get_button_index() == jb->get_button_index()) { - return; - } - } - ie = jb; - - } break; - default: { - } - } - - if (idx < 0 || idx >= events.size()) { - events.push_back(ie); - } else { - events[idx] = ie; - } - action["events"] = events; - - undo_redo->create_action(TTR("Add Input Action Event")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, action); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - - _show_last_added(ie, name); -} - -void InputMapEditor::_set_current_device(int i_device) { - device_id->select(i_device + 1); -} - -int InputMapEditor::_get_current_device() { - return device_id->get_selected() - 1; -} - -String InputMapEditor::_get_device_string(int i_device) { - if (i_device == InputMap::ALL_DEVICES) { - return TTR("All Devices"); - } - return TTR("Device") + " " + itos(i_device); -} - -void InputMapEditor::_press_a_key_confirm() { - if (last_wait_for_key.is_null()) { - return; - } - - Ref<InputEventKey> ie; - ie.instance(); - if (press_a_key_physical) { - ie->set_physical_keycode(last_wait_for_key->get_physical_keycode()); - ie->set_keycode(0); - } else { - ie->set_physical_keycode(0); - ie->set_keycode(last_wait_for_key->get_keycode()); - } - ie->set_shift(last_wait_for_key->get_shift()); - ie->set_alt(last_wait_for_key->get_alt()); - ie->set_control(last_wait_for_key->get_control()); - ie->set_metakey(last_wait_for_key->get_metakey()); - - String name = add_at; - int idx = edit_idx; - - Dictionary old_val = ProjectSettings::get_singleton()->get(name); - Dictionary action = old_val.duplicate(); - Array events = action["events"]; - - for (int i = 0; i < events.size(); i++) { - Ref<InputEventKey> aie = events[i]; - if (aie.is_null()) { - continue; - } - if (!press_a_key_physical) { - if (aie->get_keycode_with_modifiers() == ie->get_keycode_with_modifiers()) { - return; - } - } else { - if (aie->get_physical_keycode_with_modifiers() == ie->get_physical_keycode_with_modifiers()) { - return; - } - } - } - - if (idx < 0 || idx >= events.size()) { - events.push_back(ie); - } else { - events[idx] = ie; - } - action["events"] = events; - - undo_redo->create_action(TTR("Add Input Action Event")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, action); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - - _show_last_added(ie, name); -} - -void InputMapEditor::_show_last_added(const Ref<InputEvent> &p_event, const String &p_name) { - TreeItem *r = input_editor->get_root(); - - String name = p_name; - name.erase(0, 6); - if (!r) { - return; - } - r = r->get_children(); - if (!r) { - return; - } - bool found = false; - while (r) { - if (r->get_text(0) != name) { - r = r->get_next(); - continue; - } - TreeItem *child = r->get_children(); - while (child) { - Variant input = child->get_meta("__input"); - if (p_event == input) { - r->set_collapsed(false); - child->select(0); - found = true; - break; - } - child = child->get_next(); - } - if (found) { - break; - } - r = r->get_next(); - } - - if (found) { - input_editor->ensure_cursor_is_visible(); - } -} - -// Maps to 2*axis if value is neg, or + 1 if value is pos. -static const char *_joy_axis_descriptions[JOY_AXIS_MAX * 2] = { - TTRC("Left Stick Left, Joystick 0 Left"), - TTRC("Left Stick Right, Joystick 0 Right"), - TTRC("Left Stick Up, Joystick 0 Up"), - TTRC("Left Stick Down, Joystick 0 Down"), - TTRC("Right Stick Left, Joystick 1 Left"), - TTRC("Right Stick Right, Joystick 1 Right"), - TTRC("Right Stick Up, Joystick 1 Up"), - TTRC("Right Stick Down, Joystick 1 Down"), - TTRC("Joystick 2 Left"), - TTRC("Left Trigger, Sony L2, Xbox LT, Joystick 2 Right"), - TTRC("Joystick 2 Up"), - TTRC("Right Trigger, Sony R2, Xbox RT, Joystick 2 Down"), - TTRC("Joystick 3 Left"), - TTRC("Joystick 3 Right"), - TTRC("Joystick 3 Up"), - TTRC("Joystick 3 Down"), - TTRC("Joystick 4 Left"), - TTRC("Joystick 4 Right"), - TTRC("Joystick 4 Up"), - TTRC("Joystick 4 Down"), -}; - -// Separate from `InputEvent::as_text()` since the descriptions need to be different for the input map editor. See #43660. -String InputMapEditor::_get_joypad_motion_event_text(const Ref<InputEventJoypadMotion> &p_event) { - ERR_FAIL_COND_V_MSG(p_event.is_null(), String(), "Provided event is not a valid instance of InputEventJoypadMotion"); - - String desc = TTR("Unknown Joypad Axis"); - if (p_event->get_axis() < JOY_AXIS_MAX) { - desc = RTR(_joy_axis_descriptions[2 * p_event->get_axis() + (p_event->get_axis_value() < 0 ? 0 : 1)]); - } - - return vformat("Joypad Axis %s %s (%s)", itos(p_event->get_axis()), p_event->get_axis_value() < 0 ? "-" : "+", desc); -} - -void InputMapEditor::_wait_for_key(const Ref<InputEvent> &p_event) { - Ref<InputEventKey> k = p_event; - - if (k.is_valid() && k->is_pressed() && k->get_keycode() != 0) { - last_wait_for_key = p_event; - const String str = (press_a_key_physical) ? keycode_get_string(k->get_physical_keycode_with_modifiers()) + TTR(" (Physical)") : keycode_get_string(k->get_keycode_with_modifiers()); - - press_a_key_label->set_text(str); - press_a_key->get_ok_button()->set_disabled(false); - press_a_key->set_input_as_handled(); - } -} - -void InputMapEditor::_edit_item(Ref<InputEvent> p_exiting_event) { - InputType ie_type; - - if ((Ref<InputEventKey>(p_exiting_event)).is_valid()) { - if ((Ref<InputEventKey>(p_exiting_event))->get_keycode() != 0) { - ie_type = INPUT_KEY; - } else { - ie_type = INPUT_KEY_PHYSICAL; - } - } else if ((Ref<InputEventJoypadButton>(p_exiting_event)).is_valid()) { - ie_type = INPUT_JOY_BUTTON; - } else if ((Ref<InputEventMouseButton>(p_exiting_event)).is_valid()) { - ie_type = INPUT_MOUSE_BUTTON; - } else if ((Ref<InputEventJoypadMotion>(p_exiting_event)).is_valid()) { - ie_type = INPUT_JOY_MOTION; - } else { - return; - } - - _add_item(ie_type, p_exiting_event); -} - -void InputMapEditor::_add_item(int p_item, Ref<InputEvent> p_exiting_event) { - add_type = InputType(p_item); - - switch (add_type) { - case INPUT_KEY: { - press_a_key_physical = false; - press_a_key_label->set_text(TTR("Press a Key...")); - press_a_key->get_ok_button()->set_disabled(true); - last_wait_for_key = Ref<InputEvent>(); - press_a_key->popup_centered(Size2(250, 80) * EDSCALE); - //press_a_key->grab_focus(); - - } break; - case INPUT_KEY_PHYSICAL: { - press_a_key_physical = true; - press_a_key_label->set_text(TTR("Press a Key...")); - - last_wait_for_key = Ref<InputEvent>(); - press_a_key->popup_centered(Size2(250, 80) * EDSCALE); - press_a_key->grab_focus(); - - } break; - case INPUT_MOUSE_BUTTON: { - device_index_label->set_text(TTR("Mouse Button Index:")); - device_index->clear(); - device_index->add_item(TTR("Left Button")); - device_index->add_item(TTR("Right Button")); - device_index->add_item(TTR("Middle Button")); - device_index->add_item(TTR("Wheel Up Button")); - device_index->add_item(TTR("Wheel Down Button")); - device_index->add_item(TTR("Wheel Left Button")); - device_index->add_item(TTR("Wheel Right Button")); - device_index->add_item(TTR("X Button 1")); - device_index->add_item(TTR("X Button 2")); - device_input->popup_centered(Size2(350, 95) * EDSCALE); - - Ref<InputEventMouseButton> mb = p_exiting_event; - if (mb.is_valid()) { - device_index->select(mb->get_button_index() - 1); - _set_current_device(mb->get_device()); - device_input->get_ok_button()->set_text(TTR("Change")); - } else { - _set_current_device(0); - device_input->get_ok_button()->set_text(TTR("Add")); - } - - } break; - case INPUT_JOY_MOTION: { - device_index_label->set_text(TTR("Joypad Axis Index:")); - device_index->clear(); - for (int i = 0; i < JOY_AXIS_MAX * 2; i++) { - Ref<InputEventJoypadMotion> jm; - jm.instance(); - jm->set_axis(i / 2); - jm->set_axis_value((i & 1) ? 1 : -1); - device_index->add_item(_get_joypad_motion_event_text(jm)); - } - device_input->popup_centered(Size2(350, 95) * EDSCALE); - - Ref<InputEventJoypadMotion> jm = p_exiting_event; - if (jm.is_valid()) { - device_index->select(jm->get_axis() * 2 + (jm->get_axis_value() > 0 ? 1 : 0)); - _set_current_device(jm->get_device()); - device_input->get_ok_button()->set_text(TTR("Change")); - } else { - _set_current_device(0); - device_input->get_ok_button()->set_text(TTR("Add")); - } - - } break; - case INPUT_JOY_BUTTON: { - device_index_label->set_text(TTR("Joypad Button Index:")); - device_index->clear(); - for (int i = 0; i < JOY_BUTTON_MAX; i++) { - Ref<InputEventJoypadButton> jb; - jb.instance(); - jb->set_button_index(i); - device_index->add_item(jb->as_text()); - } - device_input->popup_centered(Size2(350, 95) * EDSCALE); - - Ref<InputEventJoypadButton> jb = p_exiting_event; - if (jb.is_valid()) { - device_index->select(jb->get_button_index()); - _set_current_device(jb->get_device()); - device_input->get_ok_button()->set_text(TTR("Change")); - } else { - _set_current_device(0); - device_input->get_ok_button()->set_text(TTR("Add")); - } - - } break; - default: { - } - } -} - -void InputMapEditor::_action_activated() { - TreeItem *ti = input_editor->get_selected(); - - if (!ti || ti->get_parent() == input_editor->get_root()) { - return; - } - - String name = "input/" + ti->get_parent()->get_text(0); - Dictionary action = ProjectSettings::get_singleton()->get(name); - Array events = action["events"]; - int idx = ti->get_metadata(0); - - ERR_FAIL_INDEX(idx, events.size()); - Ref<InputEvent> event = events[idx]; - if (event.is_null()) { - return; - } - - add_at = name; - edit_idx = idx; - _edit_item(event); -} - -void InputMapEditor::_action_button_pressed(Object *p_obj, int p_column, int p_id) { - TreeItem *ti = Object::cast_to<TreeItem>(p_obj); - - ERR_FAIL_COND(!ti); - - if (p_id == 1) { - // Add action event - Point2 ofs = input_editor->get_global_position(); - Rect2 ir = input_editor->get_item_rect(ti); - ir.position.y -= input_editor->get_scroll().y; - ofs += ir.position + ir.size; - ofs.x -= 100; - popup_add->set_position(ofs); - popup_add->popup(); - add_at = "input/" + ti->get_text(0); - edit_idx = -1; - - } else if (p_id == 2) { - // Remove - - if (ti->get_parent() == input_editor->get_root()) { - // Remove action - String name = "input/" + ti->get_text(0); - Dictionary old_val = ProjectSettings::get_singleton()->get(name); - int order = ProjectSettings::get_singleton()->get_order(name); - - undo_redo->create_action(TTR("Erase Input Action")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", name); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", name, order); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - - } else { - // Remove action event - String name = "input/" + ti->get_parent()->get_text(0); - Dictionary old_val = ProjectSettings::get_singleton()->get(name); - Dictionary action = old_val.duplicate(); - int idx = ti->get_metadata(0); - - Array events = action["events"]; - ERR_FAIL_INDEX(idx, events.size()); - events.remove(idx); - action["events"] = events; - - undo_redo->create_action(TTR("Erase Input Action Event")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, action); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, old_val); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - } - } else if (p_id == 3) { - // Edit - - if (ti->get_parent() == input_editor->get_root()) { - // Edit action name - ti->set_as_cursor(0); - input_editor->edit_selected(); - - } else { - // Edit action event - String name = "input/" + ti->get_parent()->get_text(0); - int idx = ti->get_metadata(0); - Dictionary action = ProjectSettings::get_singleton()->get(name); - - Array events = action["events"]; - ERR_FAIL_INDEX(idx, events.size()); - - Ref<InputEvent> event = events[idx]; - - if (event.is_null()) { - return; - } - - ti->set_as_cursor(0); - add_at = name; - edit_idx = idx; - _edit_item(event); - } - } -} - -void InputMapEditor::_update_actions() { - if (setting) { - return; - } - - Map<String, bool> collapsed; - - if (input_editor->get_root() && input_editor->get_root()->get_children()) { - for (TreeItem *item = input_editor->get_root()->get_children(); item; item = item->get_next()) { - collapsed[item->get_text(0)] = item->is_collapsed(); - } - } - - input_editor->clear(); - TreeItem *root = input_editor->create_item(); - input_editor->set_hide_root(true); - - List<PropertyInfo> props; - ProjectSettings::get_singleton()->get_property_list(&props); - for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { - const String property_name = E->get().name; - - if (!property_name.begins_with("input/")) { - continue; - } - - const String name = property_name.get_slice("/", 1); - - TreeItem *item = input_editor->create_item(root); - item->set_text(0, name); - item->set_custom_bg_color(0, input_editor->get_theme_color("prop_subsection", "Editor")); - if (collapsed.has(name)) { - item->set_collapsed(collapsed[name]); - } - - item->set_editable(1, true); - item->set_cell_mode(1, TreeItem::CELL_MODE_RANGE); - item->set_range_config(1, 0.0, 1.0, 0.01); - - item->set_custom_bg_color(1, input_editor->get_theme_color("prop_subsection", "Editor")); - - const bool is_builtin_input = ProjectSettings::get_singleton()->get_input_presets().find(property_name) != nullptr; - const String tooltip_remove = is_builtin_input ? TTR("Built-in actions can't be removed as they're used for UI navigation.") : TTR("Remove"); - item->add_button(2, input_editor->get_theme_icon("Add", "EditorIcons"), 1, false, TTR("Add Event")); - item->add_button(2, input_editor->get_theme_icon("Remove", "EditorIcons"), 2, false, tooltip_remove); - - if (is_builtin_input) { - item->set_button_disabled(2, 1, true); - } else { - item->set_editable(0, true); - } - - Dictionary action = ProjectSettings::get_singleton()->get(property_name); - Array events = action["events"]; - item->set_range(1, action["deadzone"]); - - for (int i = 0; i < events.size(); i++) { - Ref<InputEvent> event = events[i]; - if (event.is_null()) { - continue; - } - - TreeItem *action2 = input_editor->create_item(item); - - Ref<InputEventKey> k = event; - if (k.is_valid()) { - if (k->get_keycode() != 0) { - action2->set_text(0, keycode_get_string(k->get_keycode_with_modifiers())); - action2->set_icon(0, input_editor->get_theme_icon("Keyboard", "EditorIcons")); - } else { - action2->set_text(0, keycode_get_string(k->get_physical_keycode_with_modifiers()) + TTR(" (Physical)")); - action2->set_icon(0, input_editor->get_theme_icon("KeyboardPhysical", "EditorIcons")); - } - } - - Ref<InputEventJoypadButton> jb = event; - if (jb.is_valid()) { - action2->set_text(0, jb->as_text()); - action2->set_icon(0, input_editor->get_theme_icon("JoyButton", "EditorIcons")); - } - - Ref<InputEventMouseButton> mb = event; - if (mb.is_valid()) { - String str = _get_device_string(mb->get_device()) + ", "; - switch (mb->get_button_index()) { - case BUTTON_LEFT: - str += TTR("Left Button"); - break; - case BUTTON_RIGHT: - str += TTR("Right Button"); - break; - case BUTTON_MIDDLE: - str += TTR("Middle Button"); - break; - case BUTTON_WHEEL_UP: - str += TTR("Wheel Up"); - break; - case BUTTON_WHEEL_DOWN: - str += TTR("Wheel Down"); - break; - default: - str += vformat(TTR("%d Button"), mb->get_button_index()); - } - - action2->set_text(0, str); - action2->set_icon(0, input_editor->get_theme_icon("Mouse", "EditorIcons")); - } - - Ref<InputEventJoypadMotion> jm = event; - if (jm.is_valid()) { - device_index->add_item(_get_joypad_motion_event_text(jm)); - action2->set_text(0, jm->as_text()); - action2->set_icon(0, input_editor->get_theme_icon("JoyAxis", "EditorIcons")); - } - action2->set_metadata(0, i); - action2->set_meta("__input", event); - - action2->add_button(2, input_editor->get_theme_icon("Edit", "EditorIcons"), 3, false, TTR("Edit")); - action2->add_button(2, input_editor->get_theme_icon("Remove", "EditorIcons"), 2, false, TTR("Remove")); - // Fade out the individual event buttons slightly to make the - // Add/Remove buttons stand out more. - action2->set_button_color(2, 0, Color(1, 1, 1, 0.75)); - action2->set_button_color(2, 1, Color(1, 1, 1, 0.75)); - } - } - - _action_check(action_name->get_text()); -} - -void InputMapEditor::_action_check(String p_action) { - if (p_action == "") { - action_add->set_disabled(true); - } else { - if (!_validate_action_name(p_action)) { - action_add_error->set_text(TTR("Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\' or '\"'.")); - action_add_error->show(); - action_add->set_disabled(true); - return; - } - if (ProjectSettings::get_singleton()->has_setting("input/" + p_action)) { - action_add_error->set_text(vformat(TTR("An action with the name '%s' already exists."), p_action)); - action_add_error->show(); - action_add->set_disabled(true); - return; - } - - action_add->set_disabled(false); - } - - action_add_error->hide(); -} - -void InputMapEditor::_action_adds(String) { - if (!action_add->is_disabled()) { - _action_add(); - } -} - -void InputMapEditor::_action_add() { - Dictionary action; - action["events"] = Array(); - action["deadzone"] = 0.5f; - String name = "input/" + action_name->get_text(); - undo_redo->create_action(TTR("Add Input Action")); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, action); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name); - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); - - TreeItem *r = input_editor->get_root(); - - if (!r) { - return; - } - r = r->get_children(); - if (!r) { - return; - } - while (r->get_next()) { - r = r->get_next(); - } - - r->select(0); - input_editor->ensure_cursor_is_visible(); - action_add_error->hide(); - action_name->clear(); -} - -Variant InputMapEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { - TreeItem *selected = input_editor->get_selected(); - if (!selected || selected->get_parent() != input_editor->get_root()) { - return Variant(); - } - - String name = selected->get_text(0); - VBoxContainer *vb = memnew(VBoxContainer); - HBoxContainer *hb = memnew(HBoxContainer); - Label *label = memnew(Label(name)); - hb->set_modulate(Color(1, 1, 1, 1.0f)); - hb->add_child(label); - vb->add_child(hb); - input_editor->set_drag_preview(vb); - - Dictionary drag_data; - drag_data["type"] = "nodes"; - - input_editor->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN); - - return drag_data; -} - -bool InputMapEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { - Dictionary d = p_data; - if (!d.has("type") || d["type"] != "nodes") { - return false; - } - - TreeItem *selected = input_editor->get_selected(); - TreeItem *item = input_editor->get_item_at_position(p_point); - if (!selected || !item || item == selected || item->get_parent() == selected) { - return false; - } - - return true; -} - -void InputMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { - if (!can_drop_data_fw(p_point, p_data, p_from)) { - return; - } - - TreeItem *selected = input_editor->get_selected(); - TreeItem *item = input_editor->get_item_at_position(p_point); - if (!item) { - return; - } - TreeItem *target = item->get_parent() == input_editor->get_root() ? item : item->get_parent(); - - String selected_name = "input/" + selected->get_text(0); - int old_order = ProjectSettings::get_singleton()->get_order(selected_name); - String target_name = "input/" + target->get_text(0); - int target_order = ProjectSettings::get_singleton()->get_order(target_name); - - int order = old_order; - bool is_below = target_order > old_order; - TreeItem *iterator = is_below ? selected->get_next() : selected->get_prev(); - - undo_redo->create_action(TTR("Moved Input Action Event")); - while (iterator != target) { - String iterator_name = "input/" + iterator->get_text(0); - int iterator_order = ProjectSettings::get_singleton()->get_order(iterator_name); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", iterator_name, order); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", iterator_name, iterator_order); - order = iterator_order; - iterator = is_below ? iterator->get_next() : iterator->get_prev(); - } - - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", target_name, order); - undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", selected_name, target_order); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", target_name, target_order); - undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", selected_name, old_order); - - undo_redo->add_do_method(this, "_update_actions"); - undo_redo->add_undo_method(this, "_update_actions"); - undo_redo->add_do_method(this, "emit_signal", inputmap_changed); - undo_redo->add_undo_method(this, "emit_signal", inputmap_changed); - undo_redo->commit_action(); -} - -void InputMapEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_actions"), &InputMapEditor::_update_actions); - - ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &InputMapEditor::get_drag_data_fw); - ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &InputMapEditor::can_drop_data_fw); - ClassDB::bind_method(D_METHOD("drop_data_fw"), &InputMapEditor::drop_data_fw); - - ADD_SIGNAL(MethodInfo("inputmap_changed")); -} - -InputMapEditor::InputMapEditor() { - undo_redo = EditorNode::get_undo_redo(); - press_a_key_physical = false; - inputmap_changed = "inputmap_changed"; - - VBoxContainer *vbc = memnew(VBoxContainer); - vbc->set_anchor_and_offset(SIDE_TOP, Control::ANCHOR_BEGIN, 0); - vbc->set_anchor_and_offset(SIDE_BOTTOM, Control::ANCHOR_END, 0); - vbc->set_anchor_and_offset(SIDE_LEFT, Control::ANCHOR_BEGIN, 0); - vbc->set_anchor_and_offset(SIDE_RIGHT, Control::ANCHOR_END, 0); - add_child(vbc); - - HBoxContainer *hbc = memnew(HBoxContainer); - vbc->add_child(hbc); - - Label *l = memnew(Label); - l->set_text(TTR("Action:")); - hbc->add_child(l); - - action_name = memnew(LineEdit); - action_name->set_h_size_flags(Control::SIZE_EXPAND_FILL); - action_name->connect("text_entered", callable_mp(this, &InputMapEditor::_action_adds)); - action_name->connect("text_changed", callable_mp(this, &InputMapEditor::_action_check)); - hbc->add_child(action_name); - - action_add_error = memnew(Label); - action_add_error->hide(); - hbc->add_child(action_add_error); - - Button *add = memnew(Button); - add->set_text(TTR("Add")); - add->set_disabled(true); - add->connect("pressed", callable_mp(this, &InputMapEditor::_action_add)); - hbc->add_child(add); - action_add = add; - - input_editor = memnew(Tree); - input_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); - input_editor->set_columns(3); - input_editor->set_column_titles_visible(true); - input_editor->set_column_title(0, TTR("Action")); - input_editor->set_column_title(1, TTR("Deadzone")); - input_editor->set_column_expand(1, false); - input_editor->set_column_min_width(1, 80 * EDSCALE); - input_editor->set_column_expand(2, false); - input_editor->set_column_min_width(2, 50 * EDSCALE); - input_editor->connect("item_edited", callable_mp(this, &InputMapEditor::_action_edited)); - input_editor->connect("item_activated", callable_mp(this, &InputMapEditor::_action_activated)); - input_editor->connect("cell_selected", callable_mp(this, &InputMapEditor::_action_selected)); - input_editor->connect("button_pressed", callable_mp(this, &InputMapEditor::_action_button_pressed)); -#ifndef _MSC_VER -#warning need to make drag data forwarding to non controls happen -#endif - //input_editor->set_drag_forwarding(this); - vbc->add_child(input_editor); - - // Popups - - popup_add = memnew(PopupMenu); - popup_add->connect("id_pressed", callable_mp(this, &InputMapEditor::_add_item), make_binds(Ref<InputEvent>())); - add_child(popup_add); - - press_a_key = memnew(ConfirmationDialog); - press_a_key->get_ok_button()->set_disabled(true); - //press_a_key->set_focus_mode(Control::FOCUS_ALL); - press_a_key->connect("window_input", callable_mp(this, &InputMapEditor::_wait_for_key)); - press_a_key->connect("confirmed", callable_mp(this, &InputMapEditor::_press_a_key_confirm)); - add_child(press_a_key); - - l = memnew(Label); - l->set_text(TTR("Press a Key...")); - l->set_anchors_and_offsets_preset(Control::PRESET_WIDE); - l->set_align(Label::ALIGN_CENTER); - l->set_offset(SIDE_TOP, 20); - l->set_anchor_and_offset(SIDE_BOTTOM, Control::ANCHOR_BEGIN, 30); - press_a_key->add_child(l); - press_a_key_label = l; - - device_input = memnew(ConfirmationDialog); - device_input->get_ok_button()->set_text(TTR("Add")); - device_input->connect("confirmed", callable_mp(this, &InputMapEditor::_device_input_add)); - add_child(device_input); - - hbc = memnew(HBoxContainer); - device_input->add_child(hbc); - - VBoxContainer *vbc_left = memnew(VBoxContainer); - hbc->add_child(vbc_left); - - l = memnew(Label); - l->set_text(TTR("Device:")); - vbc_left->add_child(l); - - device_id = memnew(OptionButton); - for (int i = -1; i < 8; i++) { - device_id->add_item(_get_device_string(i)); - } - _set_current_device(0); - vbc_left->add_child(device_id); - - VBoxContainer *vbc_right = memnew(VBoxContainer); - vbc_right->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->add_child(vbc_right); - - l = memnew(Label); - l->set_text(TTR("Index:")); - vbc_right->add_child(l); - - device_index_label = l; - device_index = memnew(OptionButton); - device_index->set_clip_text(true); - vbc_right->add_child(device_index); - - message = memnew(AcceptDialog); - add_child(message); -} diff --git a/editor/input_map_editor.h b/editor/input_map_editor.h deleted file mode 100644 index cc6ac1660d..0000000000 --- a/editor/input_map_editor.h +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************/ -/* input_map_editor.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef INPUT_MAP_EDITOR_H -#define INPUT_MAP_EDITOR_H - -#include "core/object/undo_redo.h" -#include "editor/editor_data.h" - -class InputMapEditor : public Control { - GDCLASS(InputMapEditor, Control); - - enum InputType { - INPUT_KEY, - INPUT_KEY_PHYSICAL, - INPUT_JOY_BUTTON, - INPUT_JOY_MOTION, - INPUT_MOUSE_BUTTON - }; - - Tree *input_editor; - LineEdit *action_name; - Button *action_add; - Label *action_add_error; - - InputType add_type; - String add_at; - int edit_idx; - - PopupMenu *popup_add; - ConfirmationDialog *press_a_key; - bool press_a_key_physical; - Label *press_a_key_label; - ConfirmationDialog *device_input; - OptionButton *device_id; - OptionButton *device_index; - Label *device_index_label; - MenuButton *popup_copy_to_feature; - - Ref<InputEventKey> last_wait_for_key; - - AcceptDialog *message; - UndoRedo *undo_redo; - String inputmap_changed; - bool setting = false; - - void _update_actions(); - void _add_item(int p_item, Ref<InputEvent> p_exiting_event = Ref<InputEvent>()); - void _edit_item(Ref<InputEvent> p_exiting_event); - - void _action_check(String p_action); - void _action_adds(String); - void _action_add(); - void _device_input_add(); - - void _action_selected(); - void _action_edited(); - void _action_activated(); - void _action_button_pressed(Object *p_obj, int p_column, int p_id); - void _wait_for_key(const Ref<InputEvent> &p_event); - void _press_a_key_confirm(); - void _show_last_added(const Ref<InputEvent> &p_event, const String &p_name); - - String _get_joypad_motion_event_text(const Ref<InputEventJoypadMotion> &p_event); - - Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); - bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; - void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); - -protected: - int _get_current_device(); - void _set_current_device(int i_device); - String _get_device_string(int i_device); - - void _notification(int p_what); - static void _bind_methods(); - -public: - InputMapEditor(); -}; - -#endif // INPUT_MAP_EDITOR_H diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index d92837b68d..6fa3c923eb 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -629,9 +629,9 @@ void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_Sel Node *node = r_items[i].item; // Make sure the selected node is in the current scene, or editable - while (node && node != get_tree()->get_edited_scene_root() && node->get_owner() != scene && !scene->is_editable_instance(node->get_owner())) { - node = node->get_parent(); - }; + if (node && node != get_tree()->get_edited_scene_root()) { + node = scene->get_deepest_editable_node(node); + } CanvasItem *canvas_item = Object::cast_to<CanvasItem>(node); if (!p_allow_locked) { @@ -762,7 +762,7 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node); Node *scene = editor->get_edited_scene(); - bool editable = p_node == scene || p_node->get_owner() == scene || scene->is_editable_instance(p_node->get_owner()); + bool editable = p_node == scene || p_node->get_owner() == scene || p_node == scene->get_deepest_editable_node(p_node); bool lock_children = p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_"); bool locked = _is_node_locked(p_node); @@ -3867,7 +3867,7 @@ bool CanvasItemEditor::_build_bones_list(Node *p_node) { CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node); Node *scene = editor->get_edited_scene(); - if (!canvas_item || !canvas_item->is_visible() || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner()))) { + if (!canvas_item || !canvas_item->is_visible() || (canvas_item != scene && canvas_item->get_owner() != scene && canvas_item != scene->get_deepest_editable_node(canvas_item))) { return false; } diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 63bb785c5e..eb3c06fba1 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -301,7 +301,7 @@ EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() { ////////////////////////////////////////////////////////////////// void EditorMaterialPreviewPlugin::_preview_done(const Variant &p_udata) { - preview_done = true; + preview_done.set(); } void EditorMaterialPreviewPlugin::_bind_methods() { @@ -325,10 +325,10 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture - preview_done = false; + preview_done.clear(); RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant()); - while (!preview_done) { + while (!preview_done.is_set()) { OS::get_singleton()->delay_usec(10); } @@ -677,7 +677,7 @@ EditorAudioStreamPreviewPlugin::EditorAudioStreamPreviewPlugin() { /////////////////////////////////////////////////////////////////////////// void EditorMeshPreviewPlugin::_preview_done(const Variant &p_udata) { - preview_done = true; + preview_done.set(); } void EditorMeshPreviewPlugin::_bind_methods() { @@ -714,10 +714,10 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2 RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture - preview_done = false; + preview_done.clear(); RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant()); - while (!preview_done) { + while (!preview_done.is_set()) { OS::get_singleton()->delay_usec(10); } @@ -792,7 +792,7 @@ EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() { /////////////////////////////////////////////////////////////////////////// void EditorFontPreviewPlugin::_preview_done(const Variant &p_udata) { - preview_done = true; + preview_done.set(); } void EditorFontPreviewPlugin::_bind_methods() { @@ -883,11 +883,11 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, font->draw_string(canvas_item, pos, sample, HALIGN_LEFT, -1.f, 50, Color(1, 1, 1)); - preview_done = false; + preview_done.clear(); RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant()); - while (!preview_done) { + while (!preview_done.is_set()) { OS::get_singleton()->delay_usec(10); } diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h index 57e2911c89..6e8b9a34cf 100644 --- a/editor/plugins/editor_preview_plugins.h +++ b/editor/plugins/editor_preview_plugins.h @@ -33,6 +33,8 @@ #include "editor/editor_resource_preview.h" +#include "core/templates/safe_refcount.h" + void post_process_preview(Ref<Image> p_image); class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator { @@ -90,7 +92,7 @@ class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator { RID light2; RID light_instance2; RID camera; - mutable volatile bool preview_done = false; + mutable SafeFlag preview_done; void _preview_done(const Variant &p_udata); @@ -134,7 +136,7 @@ class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator { RID light2; RID light_instance2; RID camera; - mutable volatile bool preview_done = false; + mutable SafeFlag preview_done; void _preview_done(const Variant &p_udata); @@ -156,7 +158,7 @@ class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator { RID viewport_texture; RID canvas; RID canvas_item; - mutable volatile bool preview_done = false; + mutable SafeFlag preview_done; void _preview_done(const Variant &p_udata); diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index 1aaa98d02e..b447304a3f 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -81,7 +81,7 @@ void GPUParticles2DEditorPlugin::_menu_callback(int p_idx) { cpu_particles->set_name(particles->get_name()); cpu_particles->set_transform(particles->get_transform()); cpu_particles->set_visible(particles->is_visible()); - cpu_particles->set_pause_mode(particles->get_pause_mode()); + cpu_particles->set_process_mode(particles->get_process_mode()); cpu_particles->set_z_index(particles->get_z_index()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index 5b840ddbcf..433a5ae51c 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -263,7 +263,7 @@ void GPUParticles3DEditor::_menu_option(int p_option) { cpu_particles->set_name(node->get_name()); cpu_particles->set_transform(node->get_transform()); cpu_particles->set_visible(node->is_visible()); - cpu_particles->set_pause_mode(node->get_pause_mode()); + cpu_particles->set_process_mode(node->get_process_mode()); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); ur->create_action(TTR("Convert to CPUParticles3D")); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 610ef0c601..713837df44 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -534,10 +534,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b } if (dist < closest_dist) { - item = Object::cast_to<Node>(spat); - while (item->get_owner() && item->get_owner() != edited_scene && !edited_scene->is_editable_instance(item->get_owner())) { - item = item->get_owner(); - } + item = edited_scene->get_deepest_editable_node(Object::cast_to<Node>(spat)); closest = item->get_instance_id(); closest_dist = dist; @@ -696,10 +693,7 @@ void Node3DEditorViewport::_select_region() { continue; } - Node *item = Object::cast_to<Node>(sp); - while (item->get_owner() && item->get_owner() != edited_scene && !edited_scene->is_editable_instance(item->get_owner())) { - item = item->get_owner(); - } + Node *item = edited_scene->get_deepest_editable_node(Object::cast_to<Node>(sp)); // Replace the node by the group if grouped if (item->is_class("Node3D")) { @@ -1027,7 +1021,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) { for (int i = 0; i < selection_results.size(); i++) { Node3D *item = selection_results[i].item; - if (item != scene && item->get_owner() != scene && !scene->is_editable_instance(item->get_owner())) { + if (item != scene && item->get_owner() != scene && item != scene->get_deepest_editable_node(item)) { //invalid result selection_results.remove(i); i--; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 71b18497b0..b6df66b8af 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1066,7 +1066,7 @@ void ScriptTextEditor::_edit_option(int p_op) { return; } - tx->indent_left(); + tx->indent_selected_lines_left(); } break; case EDIT_INDENT_RIGHT: { Ref<Script> scr = script; @@ -1074,7 +1074,7 @@ void ScriptTextEditor::_edit_option(int p_op) { return; } - tx->indent_right(); + tx->indent_selected_lines_right(); } break; case EDIT_DELETE_LINE: { code_editor->delete_lines(); @@ -1632,16 +1632,16 @@ void ScriptTextEditor::_color_changed(const Color &p_color) { void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color, bool p_foldable, bool p_open_docs, bool p_goto_definition, Vector2 p_pos) { context_menu->clear(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO); context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); @@ -1743,14 +1743,14 @@ void ScriptTextEditor::_enable_code_editor() { search_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptTextEditor::_edit_option)); edit_hb->add_child(edit_menu); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_up"), EDIT_MOVE_LINE_UP); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_down"), EDIT_MOVE_LINE_DOWN); @@ -1763,7 +1763,7 @@ void ScriptTextEditor::_enable_code_editor() { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/unfold_all_lines"), EDIT_UNFOLD_ALL_LINES); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_completion_query"), EDIT_COMPLETE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/evaluate_selection"), EDIT_EVALUATE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_spaces"), EDIT_CONVERT_INDENT_TO_SPACES); @@ -1915,12 +1915,6 @@ static ScriptEditorBase *create_editor(const RES &p_resource) { } void ScriptTextEditor::register_editor() { - ED_SHORTCUT("script_text_editor/undo", TTR("Undo"), KEY_MASK_CMD | KEY_Z); - ED_SHORTCUT("script_text_editor/redo", TTR("Redo"), KEY_MASK_CMD | KEY_Y); - ED_SHORTCUT("script_text_editor/cut", TTR("Cut"), KEY_MASK_CMD | KEY_X); - ED_SHORTCUT("script_text_editor/copy", TTR("Copy"), KEY_MASK_CMD | KEY_C); - ED_SHORTCUT("script_text_editor/paste", TTR("Paste"), KEY_MASK_CMD | KEY_V); - ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD | KEY_A); ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT | KEY_UP); ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT | KEY_DOWN); ED_SHORTCUT("script_text_editor/delete_line", TTR("Delete Line"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_K); @@ -1936,10 +1930,8 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/unfold_all_lines", TTR("Unfold All Lines"), 0); #ifdef OSX_ENABLED ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_SHIFT | KEY_MASK_CMD | KEY_C); - ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CTRL | KEY_SPACE); #else ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD | KEY_D); - ED_SHORTCUT("script_text_editor/complete_symbol", TTR("Complete Symbol"), KEY_MASK_CMD | KEY_SPACE); #endif ED_SHORTCUT("script_text_editor/evaluate_selection", TTR("Evaluate Selection"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_E); ED_SHORTCUT("script_text_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_T); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 8be82628cb..c8a46715ad 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -282,7 +282,7 @@ void ShaderEditor::_menu_option(int p_option) { } CodeEdit *tx = shader_editor->get_text_editor(); - tx->indent_left(); + tx->indent_selected_lines_left(); } break; case EDIT_INDENT_RIGHT: { @@ -291,7 +291,7 @@ void ShaderEditor::_menu_option(int p_option) { } CodeEdit *tx = shader_editor->get_text_editor(); - tx->indent_right(); + tx->indent_selected_lines_right(); } break; case EDIT_DELETE_LINE: { @@ -533,15 +533,15 @@ void ShaderEditor::_bookmark_item_pressed(int p_idx) { void ShaderEditor::_make_context_menu(bool p_selection, Vector2 p_position) { context_menu->clear(); if (p_selection) { - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); } - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO); context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); @@ -585,14 +585,14 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_up"), EDIT_MOVE_LINE_UP); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_down"), EDIT_MOVE_LINE_DOWN); @@ -602,7 +602,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_completion_query"), EDIT_COMPLETE); edit_menu->get_popup()->connect("id_pressed", callable_mp(this, &ShaderEditor::_menu_option)); search_menu = memnew(MenuButton); diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index d45011c8aa..b88f1c91e6 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -363,10 +363,10 @@ void TextEditor::_edit_option(int p_op) { code_editor->move_lines_down(); } break; case EDIT_INDENT_LEFT: { - tx->indent_left(); + tx->indent_selected_lines_left(); } break; case EDIT_INDENT_RIGHT: { - tx->indent_right(); + tx->indent_selected_lines_right(); } break; case EDIT_DELETE_LINE: { code_editor->delete_lines(); @@ -514,15 +514,15 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { void TextEditor::_make_context_menu(bool p_selection, bool p_can_fold, bool p_is_folded, Vector2 p_position) { context_menu->clear(); if (p_selection) { - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); } - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("ui_redo"), EDIT_REDO); context_menu->add_separator(); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); @@ -584,14 +584,14 @@ TextEditor::TextEditor() { edit_menu->set_switch_on_hover(true); edit_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option)); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_undo"), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("un_redo"), EDIT_REDO); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_text_select_all"), EDIT_SELECT_ALL); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_up"), EDIT_MOVE_LINE_UP); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_down"), EDIT_MOVE_LINE_DOWN); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 4aadb4295f..6e2cd72796 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -269,6 +269,206 @@ void ProjectSettingsEditor::_editor_restart_close() { restart_container->hide(); } +void ProjectSettingsEditor::_action_added(const String &p_name) { + String name = "input/" + p_name; + + if (ProjectSettings::get_singleton()->has_setting(name)) { + action_map->show_message(vformat(TTR("An action with the name '%s' already exists."), name)); + return; + } + + Dictionary action; + action["events"] = Array(); + action["deadzone"] = 0.5f; + + undo_redo->create_action(TTR("Add Input Action")); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, action); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name); + + undo_redo->add_do_method(this, "_update_action_map_editor"); + undo_redo->add_undo_method(this, "_update_action_map_editor"); + undo_redo->add_do_method(this, "queue_save"); + undo_redo->add_undo_method(this, "queue_save"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_action_edited(const String &p_name, const Dictionary &p_action) { + const String property_name = "input/" + p_name; + Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + + if (old_val["deadzone"] != p_action["deadzone"]) { + // Deadzone Changed + undo_redo->create_action(TTR("Change Action deadzone")); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", property_name, p_action); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property_name, old_val); + + } else { + // Events changed + int event_count = ((Array)p_action["events"]).size(); + int old_event_count = ((Array)old_val["events"]).size(); + + if (event_count == old_event_count) { + undo_redo->create_action(TTR("Edit Input Action Event")); + } else if (event_count > old_event_count) { + undo_redo->create_action(TTR("Add Input Action Event")); + } else if (event_count < old_event_count) { + undo_redo->create_action(TTR("Remove Input Action Event")); + } + + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", property_name, p_action); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property_name, old_val); + } + + undo_redo->add_do_method(this, "_update_action_map_editor"); + undo_redo->add_undo_method(this, "_update_action_map_editor"); + undo_redo->add_do_method(this, "queue_save"); + undo_redo->add_undo_method(this, "queue_save"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_action_removed(const String &p_name) { + const String property_name = "input/" + p_name; + + Dictionary old_val = ProjectSettings::get_singleton()->get(property_name); + int order = ProjectSettings::get_singleton()->get_order(property_name); + + undo_redo->create_action(TTR("Erase Input Action")); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", property_name); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", property_name, old_val); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", property_name, order); + + undo_redo->add_do_method(this, "_update_action_map_editor"); + undo_redo->add_undo_method(this, "_update_action_map_editor"); + undo_redo->add_do_method(this, "queue_save"); + undo_redo->add_undo_method(this, "queue_save"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_action_renamed(const String &p_old_name, const String &p_new_name) { + const String old_property_name = "input/" + p_old_name; + const String new_property_name = "input/" + p_new_name; + + if (ProjectSettings::get_singleton()->has_setting(new_property_name)) { + action_map->show_message(vformat(TTR("An action with the name '%s' already exists."), new_property_name)); + return; + } + + int order = ProjectSettings::get_singleton()->get_order(old_property_name); + Dictionary action = ProjectSettings::get_singleton()->get(old_property_name); + + undo_redo->create_action(TTR("Rename Input Action Event")); + // Do: clear old, set new + undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", old_property_name); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", new_property_name, action); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", new_property_name, order); + // Undo: clear new, set old + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", new_property_name); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", old_property_name, action); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", old_property_name, order); + + undo_redo->add_do_method(this, "_update_action_map_editor"); + undo_redo->add_undo_method(this, "_update_action_map_editor"); + undo_redo->add_do_method(this, "queue_save"); + undo_redo->add_undo_method(this, "queue_save"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before) { + const String action_name = "input/" + p_action_name; + const String target_name = "input/" + p_relative_to; + + // It is much easier to rebuild the custom "input" properties rather than messing around with the "order" values of them. + Variant action_value = ps->get(action_name); + Variant target_value = ps->get(target_name); + + List<PropertyInfo> props; + OrderedHashMap<String, Variant> action_values; + ProjectSettings::get_singleton()->get_property_list(&props); + + undo_redo->create_action(TTR("Update Input Action Order")); + + for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { + PropertyInfo prop = E->get(); + // Skip builtins and non-inputs + if (ProjectSettings::get_singleton()->is_builtin_setting(prop.name) || !prop.name.begins_with("input/")) { + continue; + } + + action_values.insert(prop.name, ps->get(prop.name)); + + undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", prop.name); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", prop.name); + } + + for (OrderedHashMap<String, Variant>::Element E = action_values.front(); E; E = E.next()) { + String name = E.key(); + Variant value = E.get(); + + if (name == target_name) { + if (p_before) { + // Insert before target + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", action_name, action_value); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", target_name, target_value); + + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", target_name, target_value); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", action_name, action_value); + } else { + // Insert after target + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", target_name, target_value); + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", action_name, action_value); + + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", action_name, action_value); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", target_name, target_value); + } + + } else if (name != action_name) { + undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, value); + undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set", name, value); + } + } + + undo_redo->add_do_method(this, "_update_action_map_editor"); + undo_redo->add_undo_method(this, "_update_action_map_editor"); + undo_redo->add_do_method(this, "queue_save"); + undo_redo->add_undo_method(this, "queue_save"); + undo_redo->commit_action(); +} + +void ProjectSettingsEditor::_update_action_map_editor() { + Vector<ActionMapEditor::ActionInfo> actions; + + List<PropertyInfo> props; + ProjectSettings::get_singleton()->get_property_list(&props); + + const Ref<Texture2D> builtin_icon = get_theme_icon("PinPressed", "EditorIcons"); + for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { + const String property_name = E->get().name; + + if (!property_name.begins_with("input/")) { + continue; + } + + // Strip the "input/" from the left. + String display_name = property_name.substr(String("input/").size() - 1); + Dictionary action = ProjectSettings::get_singleton()->get(property_name); + + ActionMapEditor::ActionInfo action_info; + action_info.action = action; + action_info.editable = true; + action_info.name = display_name; + + const bool is_builtin_input = ProjectSettings::get_singleton()->get_input_presets().find(property_name) != nullptr; + if (is_builtin_input) { + action_info.editable = false; + action_info.icon = builtin_icon; + } + + actions.push_back(action_info); + } + + action_map->update_action_list(actions); +} + void ProjectSettingsEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_VISIBILITY_CHANGED: { @@ -289,6 +489,8 @@ void ProjectSettingsEditor::_notification(int p_what) { restart_container->add_theme_style_override("panel", get_theme_stylebox("bg", "Tree")); restart_icon->set_texture(get_theme_icon("StatusWarning", "EditorIcons")); restart_label->add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")); + + _update_action_map_editor(); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { search_box->set_right_icon(get_theme_icon("Search", "EditorIcons")); @@ -299,6 +501,8 @@ void ProjectSettingsEditor::_notification(int p_what) { void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("queue_save"), &ProjectSettingsEditor::queue_save); + + ClassDB::bind_method(D_METHOD("_update_action_map_editor"), &ProjectSettingsEditor::_update_action_map_editor); } ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { @@ -437,10 +641,16 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { restart_close_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_editor_restart_close)); restart_hb->add_child(restart_close_button); - inputmap_editor = memnew(InputMapEditor); - inputmap_editor->set_name(TTR("Input Map")); - inputmap_editor->connect("inputmap_changed", callable_mp(this, &ProjectSettingsEditor::queue_save)); - tab_container->add_child(inputmap_editor); + action_map = memnew(ActionMapEditor); + action_map->set_name(TTR("Input Map")); + action_map->connect("action_added", callable_mp(this, &ProjectSettingsEditor::_action_added)); + action_map->connect("action_edited", callable_mp(this, &ProjectSettingsEditor::_action_edited)); + action_map->connect("action_removed", callable_mp(this, &ProjectSettingsEditor::_action_removed)); + action_map->connect("action_renamed", callable_mp(this, &ProjectSettingsEditor::_action_renamed)); + action_map->connect("action_reordered", callable_mp(this, &ProjectSettingsEditor::_action_reordered)); + action_map->set_toggle_editable_label(TTR("Show built-in Actions")); + action_map->set_show_uneditable(false); + tab_container->add_child(action_map); localization_editor = memnew(LocalizationEditor); localization_editor->set_name(TTR("Localization")); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index a43adecc4e..c28785bb27 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -32,10 +32,10 @@ #define PROJECT_SETTINGS_EDITOR_H #include "core/object/undo_redo.h" +#include "editor/action_map_editor.h" #include "editor/editor_data.h" #include "editor/editor_plugin_settings.h" #include "editor/editor_sectioned_inspector.h" -#include "editor/input_map_editor.h" #include "editor/localization_editor.h" #include "editor/shader_globals_editor.h" #include "editor_autoload_settings.h" @@ -44,26 +44,18 @@ class ProjectSettingsEditor : public AcceptDialog { GDCLASS(ProjectSettingsEditor, AcceptDialog); - enum InputType { - INPUT_KEY, - INPUT_KEY_PHYSICAL, - INPUT_JOY_BUTTON, - INPUT_JOY_MOTION, - INPUT_MOUSE_BUTTON - }; - static ProjectSettingsEditor *singleton; ProjectSettings *ps; Timer *timer; TabContainer *tab_container; SectionedInspector *inspector; - InputMapEditor *inputmap_editor; LocalizationEditor *localization_editor; EditorAutoloadSettings *autoload_settings; ShaderGlobalsEditor *shaders_global_variables_editor; EditorPluginSettings *plugin_settings; + ActionMapEditor *action_map; HBoxContainer *search_bar; LineEdit *search_box; CheckButton *advanced; @@ -102,6 +94,14 @@ class ProjectSettingsEditor : public AcceptDialog { void _editor_restart_close(); void _add_feature_overrides(); + + void _action_added(const String &p_name); + void _action_edited(const String &p_name, const Dictionary &p_action); + void _action_removed(const String &p_name); + void _action_renamed(const String &p_old_name, const String &p_new_name); + void _action_reordered(const String &p_action_name, const String &p_relative_to, bool p_before); + void _update_action_map_editor(); + ProjectSettingsEditor(); protected: diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index b9a3e2a801..b6347d3b46 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -236,6 +236,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll item->set_text(0, node_name); item->set_selectable(0, marked_selectable); item->set_custom_color(0, get_theme_color("accent_color", "Editor")); + } else if (!p_node->can_process()) { + item->set_custom_color(0, get_theme_color("disabled_font_color", "Editor")); } else if (!marked_selectable && !marked_children_selectable) { Node *node = p_node; while (node) { @@ -585,6 +587,11 @@ void SceneTreeEditor::_test_update_tree() { tree_dirty = true; } +void SceneTreeEditor::_tree_process_mode_changed() { + MessageQueue::get_singleton()->push_call(this, "_update_tree"); + tree_dirty = true; +} + void SceneTreeEditor::_tree_changed() { if (EditorNode::get_singleton()->is_exiting()) { return; //speed up exit @@ -655,6 +662,7 @@ void SceneTreeEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { get_tree()->connect("tree_changed", callable_mp(this, &SceneTreeEditor::_tree_changed)); + get_tree()->connect("tree_process_mode_changed", callable_mp(this, &SceneTreeEditor::_tree_process_mode_changed)); get_tree()->connect("node_removed", callable_mp(this, &SceneTreeEditor::_node_removed)); get_tree()->connect("node_renamed", callable_mp(this, &SceneTreeEditor::_node_renamed)); get_tree()->connect("node_configuration_warning_changed", callable_mp(this, &SceneTreeEditor::_warning_changed)); @@ -665,6 +673,7 @@ void SceneTreeEditor::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { get_tree()->disconnect("tree_changed", callable_mp(this, &SceneTreeEditor::_tree_changed)); + get_tree()->disconnect("tree_process_mode_changed", callable_mp(this, &SceneTreeEditor::_tree_process_mode_changed)); get_tree()->disconnect("node_removed", callable_mp(this, &SceneTreeEditor::_node_removed)); get_tree()->disconnect("node_renamed", callable_mp(this, &SceneTreeEditor::_node_renamed)); tree->disconnect("item_collapsed", callable_mp(this, &SceneTreeEditor::_cell_collapsed)); @@ -1194,7 +1203,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope blocked = 0; update_timer = memnew(Timer); - update_timer->connect("timeout", callable_mp(this, &SceneTreeEditor::_update_tree)); + update_timer->connect("timeout", callable_mp(this, &SceneTreeEditor::_update_tree), varray(false)); update_timer->set_one_shot(true); update_timer->set_wait_time(0.5); add_child(update_timer); diff --git a/editor/scene_tree_editor.h b/editor/scene_tree_editor.h index 7d3419516d..6b505a6784 100644 --- a/editor/scene_tree_editor.h +++ b/editor/scene_tree_editor.h @@ -75,6 +75,7 @@ class SceneTreeEditor : public Control { void _test_update_tree(); void _update_tree(bool p_scroll_to_selected = false); void _tree_changed(); + void _tree_process_mode_changed(); void _node_removed(Node *p_node); void _node_renamed(Node *p_node); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 1dad3c091d..3852c389c7 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -31,6 +31,7 @@ #include "settings_config_dialog.h" #include "core/config/project_settings.h" +#include "core/input/input_map.h" #include "core/os/keyboard.h" #include "editor/debugger/editor_debugger_node.h" #include "editor_file_system.h" @@ -143,7 +144,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { if (k.is_valid() && k->is_pressed()) { bool handled = false; - if (ED_IS_SHORTCUT("editor/undo", p_event)) { + if (ED_IS_SHORTCUT("ui_undo", p_event)) { String action = undo_redo->get_current_action_name(); if (action != "") { EditorNode::get_log()->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); @@ -152,7 +153,7 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) { handled = true; } - if (ED_IS_SHORTCUT("editor/redo", p_event)) { + if (ED_IS_SHORTCUT("ui_redo", p_event)) { undo_redo->redo(); String action = undo_redo->get_current_action_name(); if (action != "") { @@ -184,7 +185,52 @@ void EditorSettingsDialog::_update_icons() { restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color("warning_color", "Editor")); } +void EditorSettingsDialog::_event_config_confirmed() { + Ref<InputEventKey> k = shortcut_editor->get_event(); + if (k.is_null()) { + return; + } + + if (editing_action) { + if (current_action_event_index == -1) { + // Add new event + current_action_events.push_back(k); + } else { + // Edit existing event + current_action_events[current_action_event_index] = k; + } + + _update_builtin_action(current_action, current_action_events); + } else { + k = k->duplicate(); + Ref<Shortcut> current_sc = EditorSettings::get_singleton()->get_shortcut(shortcut_being_edited); + + undo_redo->create_action(TTR("Change Shortcut") + " '" + shortcut_being_edited + "'"); + undo_redo->add_do_method(current_sc.ptr(), "set_shortcut", k); + undo_redo->add_undo_method(current_sc.ptr(), "set_shortcut", current_sc->get_shortcut()); + undo_redo->add_do_method(this, "_update_shortcuts"); + undo_redo->add_undo_method(this, "_update_shortcuts"); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); + } +} + +void EditorSettingsDialog::_update_builtin_action(const String &p_name, const Array &p_events) { + Array old_input_array = EditorSettings::get_singleton()->get_builtin_action_overrides(current_action); + + undo_redo->create_action(TTR("Edit Built-in Action")); + undo_redo->add_do_method(EditorSettings::get_singleton(), "set_builtin_action_override", p_name, p_events); + undo_redo->add_undo_method(EditorSettings::get_singleton(), "set_builtin_action_override", p_name, old_input_array); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); + + _update_shortcuts(); +} + void EditorSettingsDialog::_update_shortcuts() { + // Before clearing the tree, take note of which categories are collapsed so that this state can be maintained when the tree is repopulated. Map<String, bool> collapsed; if (shortcuts->get_root() && shortcuts->get_root()->get_children()) { @@ -192,15 +238,93 @@ void EditorSettingsDialog::_update_shortcuts() { collapsed[item->get_text(0)] = item->is_collapsed(); } } - shortcuts->clear(); - List<String> slist; - EditorSettings::get_singleton()->get_shortcut_list(&slist); TreeItem *root = shortcuts->create_item(); - Map<String, TreeItem *> sections; + // Set up section for Common/Built-in actions + TreeItem *common_section = shortcuts->create_item(root); + + sections["Common"] = common_section; + common_section->set_text(0, TTR("Common")); + if (collapsed.has("Common")) { + common_section->set_collapsed(collapsed["Common"]); + } + common_section->set_custom_bg_color(0, shortcuts->get_theme_color("prop_subsection", "Editor")); + common_section->set_custom_bg_color(1, shortcuts->get_theme_color("prop_subsection", "Editor")); + + // Get the action map for the editor, and add each item to the "Common" section. + OrderedHashMap<StringName, InputMap::Action> action_map = InputMap::get_singleton()->get_action_map(); + for (OrderedHashMap<StringName, InputMap::Action>::Element E = action_map.front(); E; E = E.next()) { + String action_name = E.key(); + + if (!shortcut_filter.is_subsequence_ofi(action_name)) { + continue; + } + + InputMap::Action action = E.get(); + + Array events; // Need to get the list of events into an array so it can be set as metadata on the item. + Vector<String> event_strings; + + List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins().find(action_name).value(); + // Remove all non-key events from the defaults. + for (List<Ref<InputEvent>>::Element *I = defaults.front(); I; I = I->next()) { + Ref<InputEventKey> k = I->get(); + if (k.is_null()) { + I->erase(); + } + } + + bool same_as_defaults = defaults.size() == action.inputs.size(); // Initially this is set to just whether the arrays are equal. Later we check the events if needed. + + int count = 0; + for (List<Ref<InputEvent>>::Element *I = action.inputs.front(); I; I = I->next()) { + // Add event and event text to respective arrays. + events.push_back(I->get()); + event_strings.push_back(I->get()->as_text()); + + // Only check if the events have been the same so far - once one fails, we don't need to check any more. + if (same_as_defaults) { + Ref<InputEventKey> k = defaults[count]; + // Only check keys, since we are in the editor. + if (k.is_valid() && !defaults[count]->shortcut_match(I->get())) { + same_as_defaults = false; + } + } + count++; + } + + // Join the text of the events with a delimiter so they can all be displayed in one cell. + String events_display_string = event_strings.is_empty() ? "None" : String("; ").join(event_strings); + + TreeItem *item = shortcuts->create_item(common_section); + item->set_text(0, action_name); + item->set_text(1, events_display_string); + + if (!same_as_defaults) { + item->add_button(1, shortcuts->get_theme_icon("Reload", "EditorIcons"), 2); + } + + if (events_display_string == "None") { + // Fade out unassigned shortcut labels for easier visual grepping. + item->set_custom_color(1, shortcuts->get_theme_color("font_color", "Label") * Color(1, 1, 1, 0.5)); + } + + item->add_button(1, shortcuts->get_theme_icon("Edit", "EditorIcons"), 0); + item->add_button(1, shortcuts->get_theme_icon("Close", "EditorIcons"), 1); + item->set_tooltip(0, action_name); + item->set_tooltip(1, events_display_string); + item->set_metadata(0, "Common"); + item->set_metadata(1, events); + } + + // Editor Shortcuts + + List<String> slist; + EditorSettings::get_singleton()->get_shortcut_list(&slist); + for (List<String>::Element *E = slist.front(); E; E = E->next()) { Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(E->get()); if (!sc->has_meta("original")) { @@ -267,84 +391,119 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column TreeItem *ti = Object::cast_to<TreeItem>(p_item); ERR_FAIL_COND(!ti); - String item = ti->get_metadata(0); - Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(item); - - if (p_idx == 0) { - press_a_key_label->set_text(TTR("Press a Key...")); - last_wait_for_key = Ref<InputEventKey>(); - press_a_key->popup_centered(Size2(250, 80) * EDSCALE); - //press_a_key->grab_focus(); - press_a_key->get_ok_button()->set_focus_mode(Control::FOCUS_NONE); - press_a_key->get_cancel_button()->set_focus_mode(Control::FOCUS_NONE); - shortcut_configured = item; - - } else if (p_idx == 1) { //erase - if (!sc.is_valid()) { - return; //pointless, there is nothing + if (ti->get_metadata(0) == "Common") { + // Editing a Built-in action, which can have multiple bindings. + button_idx = p_idx; + editing_action = true; + current_action = ti->get_text(0); + + switch (button_idx) { + case SHORTCUT_REVERT: { + Array events; + List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins()[current_action]; + + // Convert the list to an array, and only keep key events as this is for the editor. + for (List<Ref<InputEvent>>::Element *E = defaults.front(); E; E = E->next()) { + Ref<InputEventKey> k = E->get(); + if (k.is_valid()) { + events.append(E->get()); + } + } + + _update_builtin_action(current_action, events); + } break; + case SHORTCUT_EDIT: + case SHORTCUT_ERASE: { + // For Edit end Delete, we will show a popup which displays each event so the user can select which one to edit/delete. + current_action_events = ti->get_metadata(1); + action_popup->clear(); + + for (int i = 0; i < current_action_events.size(); i++) { + Ref<InputEvent> ie = current_action_events[i]; + action_popup->add_item(ie->as_text()); + action_popup->set_item_metadata(i, ie); + } + + if (button_idx == SHORTCUT_EDIT) { + // If editing, add a button which can be used to add an additional event. + action_popup->add_icon_item(get_theme_icon("Add", "EditorIcons"), TTR("Add")); + } + + action_popup->set_position(get_position() + get_mouse_position()); + action_popup->take_mouse_focus(); + action_popup->popup(); + action_popup->set_as_minsize(); + } break; + default: + break; } - - undo_redo->create_action(TTR("Erase Shortcut")); - undo_redo->add_do_method(sc.ptr(), "set_shortcut", Ref<InputEvent>()); - undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut()); - undo_redo->add_do_method(this, "_update_shortcuts"); - undo_redo->add_undo_method(this, "_update_shortcuts"); - undo_redo->add_do_method(this, "_settings_changed"); - undo_redo->add_undo_method(this, "_settings_changed"); - undo_redo->commit_action(); - } else if (p_idx == 2) { //revert to original - if (!sc.is_valid()) { - return; //pointless, there is nothing + } else { + // Editing an Editor Shortcut, which can only have 1 binding. + String item = ti->get_metadata(0); + Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(item); + editing_action = false; + + switch (button_idx) { + case EditorSettingsDialog::SHORTCUT_EDIT: + shortcut_editor->popup_and_configure(sc->get_shortcut()); + shortcut_being_edited = item; + break; + case EditorSettingsDialog::SHORTCUT_ERASE: { + if (!sc.is_valid()) { + return; //pointless, there is nothing + } + + undo_redo->create_action(TTR("Erase Shortcut")); + undo_redo->add_do_method(sc.ptr(), "set_shortcut", Ref<InputEvent>()); + undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut()); + undo_redo->add_do_method(this, "_update_shortcuts"); + undo_redo->add_undo_method(this, "_update_shortcuts"); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); + } break; + case EditorSettingsDialog::SHORTCUT_REVERT: { + if (!sc.is_valid()) { + return; //pointless, there is nothing + } + + Ref<InputEvent> original = sc->get_meta("original"); + + undo_redo->create_action(TTR("Restore Shortcut")); + undo_redo->add_do_method(sc.ptr(), "set_shortcut", original); + undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut()); + undo_redo->add_do_method(this, "_update_shortcuts"); + undo_redo->add_undo_method(this, "_update_shortcuts"); + undo_redo->add_do_method(this, "_settings_changed"); + undo_redo->add_undo_method(this, "_settings_changed"); + undo_redo->commit_action(); + } break; + default: + break; } - - Ref<InputEvent> original = sc->get_meta("original"); - - undo_redo->create_action(TTR("Restore Shortcut")); - undo_redo->add_do_method(sc.ptr(), "set_shortcut", original); - undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut()); - undo_redo->add_do_method(this, "_update_shortcuts"); - undo_redo->add_undo_method(this, "_update_shortcuts"); - undo_redo->add_do_method(this, "_settings_changed"); - undo_redo->add_undo_method(this, "_settings_changed"); - undo_redo->commit_action(); } } -void EditorSettingsDialog::_wait_for_key(const Ref<InputEvent> &p_event) { - Ref<InputEventKey> k = p_event; - - if (k.is_valid() && k->is_pressed() && k->get_keycode() != 0) { - last_wait_for_key = k; - const String str = keycode_get_string(k->get_keycode_with_modifiers()); - - press_a_key_label->set_text(str); - press_a_key->set_input_as_handled(); - } -} - -void EditorSettingsDialog::_press_a_key_confirm() { - if (last_wait_for_key.is_null()) { - return; +void EditorSettingsDialog::_builtin_action_popup_index_pressed(int p_index) { + switch (button_idx) { + case SHORTCUT_EDIT: { + if (p_index == action_popup->get_item_count() - 1) { + // Selected last item in list (Add button), therefore add new + current_action_event_index = -1; + shortcut_editor->popup_and_configure(); + } else { + // Configure existing + current_action_event_index = p_index; + shortcut_editor->popup_and_configure(action_popup->get_item_metadata(p_index)); + } + } break; + case SHORTCUT_ERASE: { + current_action_events.remove(p_index); + _update_builtin_action(current_action, current_action_events); + } break; + default: + break; } - - Ref<InputEventKey> ie; - ie.instance(); - ie->set_keycode(last_wait_for_key->get_keycode()); - ie->set_shift(last_wait_for_key->get_shift()); - ie->set_control(last_wait_for_key->get_control()); - ie->set_alt(last_wait_for_key->get_alt()); - ie->set_metakey(last_wait_for_key->get_metakey()); - - Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(shortcut_configured); - - undo_redo->create_action(TTR("Change Shortcut") + " '" + shortcut_configured + "'"); - undo_redo->add_do_method(sc.ptr(), "set_shortcut", ie); - undo_redo->add_undo_method(sc.ptr(), "set_shortcut", sc->get_shortcut()); - undo_redo->add_do_method(this, "_update_shortcuts"); - undo_redo->add_undo_method(this, "_update_shortcuts"); - undo_redo->add_do_method(this, "_settings_changed"); - undo_redo->add_undo_method(this, "_settings_changed"); - undo_redo->commit_action(); } void EditorSettingsDialog::_tabs_tab_changed(int p_tab) { @@ -382,9 +541,14 @@ void EditorSettingsDialog::_editor_restart_close() { void EditorSettingsDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("_unhandled_input"), &EditorSettingsDialog::_unhandled_input); ClassDB::bind_method(D_METHOD("_update_shortcuts"), &EditorSettingsDialog::_update_shortcuts); + ClassDB::bind_method(D_METHOD("_settings_changed"), &EditorSettingsDialog::_settings_changed); } EditorSettingsDialog::EditorSettingsDialog() { + action_popup = memnew(PopupMenu); + action_popup->connect("index_pressed", callable_mp(this, &EditorSettingsDialog::_builtin_action_popup_index_pressed)); + add_child(action_popup); + set_title(TTR("Editor Settings")); undo_redo = memnew(UndoRedo); @@ -442,21 +606,17 @@ EditorSettingsDialog::EditorSettingsDialog() { // Shortcuts Tab tab_shortcuts = memnew(VBoxContainer); + tabs->add_child(tab_shortcuts); tab_shortcuts->set_name(TTR("Shortcuts")); - hbc = memnew(HBoxContainer); - hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); - tab_shortcuts->add_child(hbc); - shortcut_search_box = memnew(LineEdit); shortcut_search_box->set_placeholder(TTR("Search")); shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->add_child(shortcut_search_box); + tab_shortcuts->add_child(shortcut_search_box); shortcut_search_box->connect("text_changed", callable_mp(this, &EditorSettingsDialog::_filter_shortcuts)); shortcuts = memnew(Tree); - tab_shortcuts->add_child(shortcuts, true); shortcuts->set_v_size_flags(Control::SIZE_EXPAND_FILL); shortcuts->set_columns(2); shortcuts->set_hide_root(true); @@ -464,21 +624,13 @@ EditorSettingsDialog::EditorSettingsDialog() { shortcuts->set_column_title(0, TTR("Name")); shortcuts->set_column_title(1, TTR("Binding")); shortcuts->connect("button_pressed", callable_mp(this, &EditorSettingsDialog::_shortcut_button_pressed)); + tab_shortcuts->add_child(shortcuts); - press_a_key = memnew(ConfirmationDialog); - //press_a_key->set_focus_mode(Control::FOCUS_ALL); - add_child(press_a_key); - - Label *l = memnew(Label); - l->set_text(TTR("Press a Key...")); - l->set_anchors_and_offsets_preset(Control::PRESET_WIDE); - l->set_align(Label::ALIGN_CENTER); - l->set_offset(SIDE_TOP, 20); - l->set_anchor_and_offset(SIDE_BOTTOM, Control::ANCHOR_BEGIN, 30); - press_a_key_label = l; - press_a_key->add_child(l); - press_a_key->connect("window_input", callable_mp(this, &EditorSettingsDialog::_wait_for_key)); - press_a_key->connect("confirmed", callable_mp(this, &EditorSettingsDialog::_press_a_key_confirm)); + // Adding event dialog + shortcut_editor = memnew(InputEventConfigurationDialog); + shortcut_editor->connect("confirmed", callable_mp(this, &EditorSettingsDialog::_event_config_confirmed)); + shortcut_editor->set_allowed_input_types(InputEventConfigurationDialog::InputType::INPUT_KEY); + add_child(shortcut_editor); set_hide_on_ok(true); diff --git a/editor/settings_config_dialog.h b/editor/settings_config_dialog.h index b1ee58ae8f..c38fceedf1 100644 --- a/editor/settings_config_dialog.h +++ b/editor/settings_config_dialog.h @@ -31,6 +31,7 @@ #ifndef SETTINGS_CONFIG_DIALOG_H #define SETTINGS_CONFIG_DIALOG_H +#include "editor/action_map_editor.h" #include "editor/editor_sectioned_inspector.h" #include "editor_inspector.h" #include "scene/gui/dialogs.h" @@ -52,16 +53,28 @@ class EditorSettingsDialog : public AcceptDialog { LineEdit *shortcut_search_box; SectionedInspector *inspector; + enum ShortcutButton { + SHORTCUT_EDIT, + SHORTCUT_ERASE, + SHORTCUT_REVERT + }; + + int button_idx; + int current_action_event_index = -1; + bool editing_action = false; + String current_action; + Array current_action_events; + PopupMenu *action_popup; + Timer *timer; UndoRedo *undo_redo; - Tree *shortcuts; - ConfirmationDialog *press_a_key; - Label *press_a_key_label; - Ref<InputEventKey> last_wait_for_key; - String shortcut_configured; + // Shortcuts String shortcut_filter; + Tree *shortcuts; + InputEventConfigurationDialog *shortcut_editor; + String shortcut_being_edited; virtual void cancel_pressed() override; virtual void ok_pressed() override; @@ -74,20 +87,20 @@ class EditorSettingsDialog : public AcceptDialog { void _notification(int p_what); void _update_icons(); - void _press_a_key_confirm(); - void _wait_for_key(const Ref<InputEvent> &p_event); + void _event_config_confirmed(); + + void _update_builtin_action(const String &p_name, const Array &p_events); void _tabs_tab_changed(int p_tab); void _focus_current_search_box(); - void _clear_shortcut_search_box(); - void _clear_search_box(); - void _filter_shortcuts(const String &p_filter); void _update_shortcuts(); void _shortcut_button_pressed(Object *p_item, int p_column, int p_idx); + void _builtin_action_popup_index_pressed(int p_index); + static void _undo_redo_callback(void *p_self, const String &p_name); Label *restart_label; diff --git a/main/main.cpp b/main/main.cpp index f068c39b58..41f97b2e3b 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -123,7 +123,9 @@ static bool _start_success = false; // Drivers +String tablet_driver = ""; String text_driver = ""; + static int text_driver_idx = -1; static int display_driver_idx = -1; static int audio_driver_idx = -1; @@ -329,13 +331,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --enable-vsync-via-compositor When vsync is enabled, vsync via the OS' window compositor (Windows only).\n"); OS::get_singleton()->print(" --disable-vsync-via-compositor Disable vsync via the OS' window compositor (Windows only).\n"); OS::get_singleton()->print(" --single-window Use a single window (no separate subwindows).\n"); - OS::get_singleton()->print(" --tablet-driver Tablet input driver ("); - for (int i = 0; i < OS::get_singleton()->get_tablet_driver_count(); i++) { - if (i != 0) - OS::get_singleton()->print(", "); - OS::get_singleton()->print("'%s'", OS::get_singleton()->get_tablet_driver_name(i).utf8().get_data()); - } - OS::get_singleton()->print(") (Windows only).\n"); + OS::get_singleton()->print(" --tablet-driver Pen tablet input driver.\n"); OS::get_singleton()->print("\n"); #endif @@ -515,8 +511,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph MAIN_PRINT("Main: Initialize Globals"); - globals = memnew(ProjectSettings); input_map = memnew(InputMap); + globals = memnew(ProjectSettings); register_core_settings(); //here globals is present @@ -556,7 +552,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String display_driver = ""; String audio_driver = ""; - String tablet_driver = ""; String project_path = "."; bool upwards = false; String debug_uri = ""; @@ -725,19 +720,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "--tablet-driver") { if (I->next()) { tablet_driver = I->next()->get(); - bool found = false; - for (int i = 0; i < OS::get_singleton()->get_tablet_driver_count(); i++) { - if (tablet_driver == OS::get_singleton()->get_tablet_driver_name(i)) { - found = true; - } - } - - if (!found) { - OS::get_singleton()->print("Unknown tablet driver '%s', aborting.\n", - tablet_driver.utf8().get_data()); - goto error; - } - N = I->next()->next(); } else { OS::get_singleton()->print("Missing tablet driver argument, aborting.\n"); @@ -1267,29 +1249,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph OS::get_singleton()->_vsync_via_compositor = window_vsync_via_compositor; - { - GLOBAL_DEF_RST_NOVAL("input_devices/tablet/driver", ""); - GLOBAL_DEF_RST_NOVAL("input_devices/tablet/driver.windows", ""); - ProjectSettings::get_singleton()->set_custom_property_info("input_devices/tablet/driver.windows", PropertyInfo(Variant::STRING, "input_devices/tablet/driver.windows", PROPERTY_HINT_ENUM, "wintab,winink")); - } - if (tablet_driver == "") { // specified in project.godot - tablet_driver = GLOBAL_GET("input_devices/tablet/driver"); - if (tablet_driver == "") { - tablet_driver = OS::get_singleton()->get_tablet_driver_name(0); - } - } - - for (int i = 0; i < OS::get_singleton()->get_tablet_driver_count(); i++) { - if (tablet_driver == OS::get_singleton()->get_tablet_driver_name(i)) { - OS::get_singleton()->set_current_tablet_driver(OS::get_singleton()->get_tablet_driver_name(i)); - break; - } - } - - if (tablet_driver == "") { - OS::get_singleton()->set_current_tablet_driver(OS::get_singleton()->get_tablet_driver_name(0)); - } - /* todo restore OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false); video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false); @@ -1511,7 +1470,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { } } } - printf("Using %s text server...\n", TextServerManager::get_interface_name(text_driver_idx).utf8().get_data()); + print_verbose("Using \"" + TextServerManager::get_interface_name(text_driver_idx) + "\" text server..."); /* Initialize Text Server */ @@ -1571,6 +1530,34 @@ Error Main::setup2(Thread::ID p_main_tid_override) { display_server->screen_set_orientation(window_orientation); } + /* Initialize Pen Table Driver */ + + { + GLOBAL_DEF_RST_NOVAL("input_devices/pen_tablet/driver", ""); + GLOBAL_DEF_RST_NOVAL("input_devices/pen_tablet/driver.windows", ""); + ProjectSettings::get_singleton()->set_custom_property_info("input_devices/pen_tablet/driver.windows", PropertyInfo(Variant::STRING, "input_devices/pen_tablet/driver.windows", PROPERTY_HINT_ENUM, "wintab,winink")); + } + + if (tablet_driver == "") { // specified in project.godot + tablet_driver = GLOBAL_GET("input_devices/pen_tablet/driver"); + if (tablet_driver == "") { + tablet_driver = DisplayServer::get_singleton()->tablet_get_driver_name(0); + } + } + + for (int i = 0; i < DisplayServer::get_singleton()->tablet_get_driver_count(); i++) { + if (tablet_driver == DisplayServer::get_singleton()->tablet_get_driver_name(i)) { + DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(i)); + break; + } + } + + if (DisplayServer::get_singleton()->tablet_get_current_driver() == "") { + DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(0)); + } + + print_verbose("Using \"" + tablet_driver + "\" pen tablet driver..."); + /* Initialize Visual Server */ rendering_server = memnew(RenderingServerDefault(OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD)); diff --git a/modules/cvtt/image_compress_cvtt.cpp b/modules/cvtt/image_compress_cvtt.cpp index dbd6d9e9f9..3beca3d12a 100644 --- a/modules/cvtt/image_compress_cvtt.cpp +++ b/modules/cvtt/image_compress_cvtt.cpp @@ -33,6 +33,7 @@ #include "core/os/os.h" #include "core/os/thread.h" #include "core/string/print_string.h" +#include "core/templates/safe_refcount.h" #include <ConvectionKernels.h> @@ -56,7 +57,7 @@ struct CVTTCompressionJobQueue { CVTTCompressionJobParams job_params; const CVTTCompressionRowTask *job_tasks; uint32_t num_tasks = 0; - uint32_t current_task = 0; + SafeNumeric<uint32_t> current_task; }; static void _digest_row_task(const CVTTCompressionJobParams &p_job_params, const CVTTCompressionRowTask &p_row_task) { @@ -131,7 +132,7 @@ static void _digest_row_task(const CVTTCompressionJobParams &p_job_params, const static void _digest_job_queue(void *p_job_queue) { CVTTCompressionJobQueue *job_queue = static_cast<CVTTCompressionJobQueue *>(p_job_queue); - for (uint32_t next_task = atomic_increment(&job_queue->current_task); next_task <= job_queue->num_tasks; next_task = atomic_increment(&job_queue->current_task)) { + for (uint32_t next_task = job_queue->current_task.increment(); next_task <= job_queue->num_tasks; next_task = job_queue->current_task.increment()) { _digest_row_task(job_queue->job_params, job_queue->job_tasks[next_task - 1]); } } @@ -263,7 +264,7 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::UsedChann const CVTTCompressionRowTask *tasks_rb = tasks.ptr(); job_queue.job_tasks = &tasks_rb[0]; - job_queue.current_task = 0; + job_queue.current_task.set(0); job_queue.num_tasks = static_cast<uint32_t>(tasks.size()); for (int i = 0; i < num_job_threads; i++) { diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 64fb8ee9c7..1bdbb0b03b 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1670,7 +1670,7 @@ void NativeScriptLanguage::defer_init_library(Ref<GDNativeLibrary> lib, NativeSc MutexLock lock(mutex); libs_to_init.insert(lib); scripts_to_register.insert(script); - has_objects_to_register = true; + has_objects_to_register.set(); } #endif @@ -1759,7 +1759,7 @@ void NativeScriptLanguage::call_libraries_cb(const StringName &name) { void NativeScriptLanguage::frame() { #ifndef NO_THREADS - if (has_objects_to_register) { + if (has_objects_to_register.is_set()) { MutexLock lock(mutex); for (Set<Ref<GDNativeLibrary>>::Element *L = libs_to_init.front(); L; L = L->next()) { init_library(L->get()); @@ -1769,7 +1769,7 @@ void NativeScriptLanguage::frame() { register_script(S->get()); } scripts_to_register.clear(); - has_objects_to_register = false; + has_objects_to_register.clear(); } #endif diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 81a158d09b..d6ba2bbec1 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -40,6 +40,7 @@ #include "core/os/thread_safe.h" #include "core/templates/oa_hash_map.h" #include "core/templates/ordered_hash_map.h" +#include "core/templates/safe_refcount.h" #include "core/templates/self_list.h" #include "scene/main/node.h" @@ -262,7 +263,7 @@ private: #ifndef NO_THREADS Set<Ref<GDNativeLibrary>> libs_to_init; Set<NativeScript *> scripts_to_register; - volatile bool has_objects_to_register = false; // so that we don't lock mutex every frame - it's rarely needed + SafeFlag has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed void defer_init_library(Ref<GDNativeLibrary> lib, NativeScript *script); #endif diff --git a/modules/gltf/gltf_skeleton.cpp b/modules/gltf/gltf_skeleton.cpp index 739779d3bd..d6c7a25eaf 100644 --- a/modules/gltf/gltf_skeleton.cpp +++ b/modules/gltf/gltf_skeleton.cpp @@ -41,7 +41,7 @@ void GLTFSkeleton::_bind_methods() { ClassDB::bind_method(D_METHOD("get_godot_bone_node"), &GLTFSkeleton::get_godot_bone_node); ClassDB::bind_method(D_METHOD("set_godot_bone_node", "godot_bone_node"), &GLTFSkeleton::set_godot_bone_node); ClassDB::bind_method(D_METHOD("get_bone_attachment_count"), &GLTFSkeleton::get_bone_attachment_count); - ClassDB::bind_method(D_METHOD("get_bone_attachment"), &GLTFSkeleton::get_bone_attachment); + ClassDB::bind_method(D_METHOD("get_bone_attachment", "idx"), &GLTFSkeleton::get_bone_attachment); ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "joints"), "set_joints", "get_joints"); // Vector<GLTFNodeIndex> ADD_PROPERTY(PropertyInfo(Variant::PACKED_INT32_ARRAY, "roots"), "set_roots", "get_roots"); // Vector<GLTFNodeIndex> diff --git a/modules/gltf/gltf_state.cpp b/modules/gltf/gltf_state.cpp index eedc743330..86f8f44612 100644 --- a/modules/gltf/gltf_state.cpp +++ b/modules/gltf/gltf_state.cpp @@ -51,8 +51,8 @@ void GLTFState::_bind_methods() { ClassDB::bind_method(D_METHOD("set_accessors", "accessors"), &GLTFState::set_accessors); ClassDB::bind_method(D_METHOD("get_meshes"), &GLTFState::get_meshes); ClassDB::bind_method(D_METHOD("set_meshes", "meshes"), &GLTFState::set_meshes); - ClassDB::bind_method(D_METHOD("get_animation_players_count"), &GLTFState::get_animation_players_count); - ClassDB::bind_method(D_METHOD("get_animation_player"), &GLTFState::get_animation_player); + ClassDB::bind_method(D_METHOD("get_animation_players_count", "idx"), &GLTFState::get_animation_players_count); + ClassDB::bind_method(D_METHOD("get_animation_player", "idx"), &GLTFState::get_animation_player); ClassDB::bind_method(D_METHOD("get_materials"), &GLTFState::get_materials); ClassDB::bind_method(D_METHOD("set_materials", "materials"), &GLTFState::set_materials); ClassDB::bind_method(D_METHOD("get_scene_name"), &GLTFState::get_scene_name); @@ -77,7 +77,7 @@ void GLTFState::_bind_methods() { ClassDB::bind_method(D_METHOD("set_skeleton_to_node", "skeleton_to_node"), &GLTFState::set_skeleton_to_node); ClassDB::bind_method(D_METHOD("get_animations"), &GLTFState::get_animations); ClassDB::bind_method(D_METHOD("set_animations", "animations"), &GLTFState::set_animations); - ClassDB::bind_method(D_METHOD("get_scene_node"), &GLTFState::get_scene_node); + ClassDB::bind_method(D_METHOD("get_scene_node", "idx"), &GLTFState::get_scene_node); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "json"), "set_json", "get_json"); // Dictionary ADD_PROPERTY(PropertyInfo(Variant::INT, "major_version"), "set_major_version", "get_major_version"); // int diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index ea1a2053df..167e9d75a1 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -783,6 +783,72 @@ void BindingsGenerator::_generate_method_icalls(const TypeInterface &p_itype) { } } +void BindingsGenerator::_generate_array_extensions(StringBuilder &p_output) { + p_output.append("using System;\n\n"); + p_output.append("namespace " BINDINGS_NAMESPACE "\n" OPEN_BLOCK); + // The class where we put the extensions doesn't matter, so just use "GD". + p_output.append(INDENT1 "public static partial class " BINDINGS_GLOBAL_SCOPE_CLASS "\n" INDENT1 "{"); + +#define ARRAY_IS_EMPTY(m_type) \ + p_output.append("\n" INDENT2 "/// <summary>\n"); \ + p_output.append(INDENT2 "/// Returns true if this " #m_type " array is empty or doesn't exist.\n"); \ + p_output.append(INDENT2 "/// </summary>\n"); \ + p_output.append(INDENT2 "/// <param name=\"instance\">The " #m_type " array check.</param>\n"); \ + p_output.append(INDENT2 "/// <returns>Whether or not the array is empty.</returns>\n"); \ + p_output.append(INDENT2 "public static bool IsEmpty(this " #m_type "[] instance)\n"); \ + p_output.append(INDENT2 OPEN_BLOCK); \ + p_output.append(INDENT3 "return instance == null || instance.Length == 0;\n"); \ + p_output.append(INDENT2 CLOSE_BLOCK); + +#define ARRAY_JOIN(m_type) \ + p_output.append("\n" INDENT2 "/// <summary>\n"); \ + p_output.append(INDENT2 "/// Converts this " #m_type " array to a string delimited by the given string.\n"); \ + p_output.append(INDENT2 "/// </summary>\n"); \ + p_output.append(INDENT2 "/// <param name=\"instance\">The " #m_type " array to convert.</param>\n"); \ + p_output.append(INDENT2 "/// <param name=\"delimiter\">The delimiter to use between items.</param>\n"); \ + p_output.append(INDENT2 "/// <returns>A single string with all items.</returns>\n"); \ + p_output.append(INDENT2 "public static string Join(this " #m_type "[] instance, string delimiter = \", \")\n"); \ + p_output.append(INDENT2 OPEN_BLOCK); \ + p_output.append(INDENT3 "return String.Join(delimiter, instance);\n"); \ + p_output.append(INDENT2 CLOSE_BLOCK); + +#define ARRAY_STRINGIFY(m_type) \ + p_output.append("\n" INDENT2 "/// <summary>\n"); \ + p_output.append(INDENT2 "/// Converts this " #m_type " array to a string with brackets.\n"); \ + p_output.append(INDENT2 "/// </summary>\n"); \ + p_output.append(INDENT2 "/// <param name=\"instance\">The " #m_type " array to convert.</param>\n"); \ + p_output.append(INDENT2 "/// <returns>A single string with all items.</returns>\n"); \ + p_output.append(INDENT2 "public static string Stringify(this " #m_type "[] instance)\n"); \ + p_output.append(INDENT2 OPEN_BLOCK); \ + p_output.append(INDENT3 "return \"[\" + instance.Join() + \"]\";\n"); \ + p_output.append(INDENT2 CLOSE_BLOCK); + +#define ARRAY_ALL(m_type) \ + ARRAY_IS_EMPTY(m_type) \ + ARRAY_JOIN(m_type) \ + ARRAY_STRINGIFY(m_type) + + ARRAY_ALL(byte); + ARRAY_ALL(int); + ARRAY_ALL(long); + ARRAY_ALL(float); + ARRAY_ALL(double); + ARRAY_ALL(string); + ARRAY_ALL(Color); + ARRAY_ALL(Vector2); + ARRAY_ALL(Vector2i); + ARRAY_ALL(Vector3); + ARRAY_ALL(Vector3i); + +#undef ARRAY_ALL +#undef ARRAY_IS_EMPTY +#undef ARRAY_JOIN +#undef ARRAY_STRINGIFY + + p_output.append(INDENT1 CLOSE_BLOCK); // End of GD class. + p_output.append(CLOSE_BLOCK); // End of namespace. +} + void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { // Constants (in partial GD class) @@ -926,6 +992,19 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { compile_items.push_back(output_file); } + // Generate source file for array extensions + { + StringBuilder extensions_source; + _generate_array_extensions(extensions_source); + String output_file = path::join(base_gen_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_extensions.cs"); + Error save_err = _save_file(output_file, extensions_source); + if (save_err != OK) { + return save_err; + } + + compile_items.push_back(output_file); + } + for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { const TypeInterface &itype = E.get(); diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index b18dfb0ec4..876046176b 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -661,6 +661,7 @@ class BindingsGenerator { Error _generate_cs_method(const TypeInterface &p_itype, const MethodInterface &p_imethod, int &p_method_bind_count, StringBuilder &p_output); Error _generate_cs_signal(const BindingsGenerator::TypeInterface &p_itype, const BindingsGenerator::SignalInterface &p_isignal, StringBuilder &p_output); + void _generate_array_extensions(StringBuilder &p_output); void _generate_global_constants(StringBuilder &p_output); Error _generate_glue_method(const TypeInterface &p_itype, const MethodInterface &p_imethod, StringBuilder &p_output); diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub index 3589c8546d..b4067d41c2 100644 --- a/modules/text_server_adv/SCsub +++ b/modules/text_server_adv/SCsub @@ -38,6 +38,7 @@ def make_icu_data(target, source, env): # Thirdparty source files thirdparty_obj = [] +freetype_enabled = env.module_check_dependencies("text_server_adv", ["freetype"]) if env["builtin_harfbuzz"]: env_harfbuzz = env_modules.Clone() @@ -57,11 +58,9 @@ if env["builtin_harfbuzz"]: "src/hb-face.cc", "src/hb-fallback-shape.cc", "src/hb-font.cc", - "src/hb-ft.cc", #'src/hb-gdi.cc', #'src/hb-glib.cc', #'src/hb-gobject-structs.cc', - "src/hb-graphite2.cc", "src/hb-icu.cc", "src/hb-map.cc", "src/hb-number.cc", @@ -109,17 +108,29 @@ if env["builtin_harfbuzz"]: "src/hb-unicode.cc", #'src/hb-uniscribe.cc' ] + + if freetype_enabled: + thirdparty_sources += [ + "src/hb-ft.cc", + "src/hb-graphite2.cc", + ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_harfbuzz.Append( CPPPATH=[ "#thirdparty/harfbuzz/src", - "#thirdparty/freetype/include", - "#thirdparty/graphite/include", "#thirdparty/icu4c/common/", ] ) + if freetype_enabled: + env_harfbuzz.Append( + CPPPATH=[ + "#thirdparty/freetype/include", + "#thirdparty/graphite/include", + ] + ) + if env["platform"] == "android" or env["platform"] == "linuxbsd" or env["platform"] == "server": env_harfbuzz.Append(CCFLAGS=["-DHAVE_PTHREAD"]) @@ -133,12 +144,18 @@ if env["builtin_harfbuzz"]: CCFLAGS=[ "-DHAVE_ICU_BUILTIN", "-DHAVE_ICU", - "-DHAVE_FREETYPE", - "-DHAVE_GRAPHITE2", - "-DGRAPHITE2_STATIC", ] ) + if freetype_enabled: + env_harfbuzz.Append( + CCFLAGS=[ + "-DHAVE_FREETYPE", + "-DHAVE_GRAPHITE2", + "-DGRAPHITE2_STATIC", + ] + ) + lib = env_harfbuzz.add_library("harfbuzz_builtin", thirdparty_sources) thirdparty_obj += lib @@ -156,7 +173,7 @@ if env["builtin_harfbuzz"]: env.Append(LIBS=[lib]) -if env["builtin_graphite"]: +if env["builtin_graphite"] and freetype_enabled: env_graphite = env_modules.Clone() env_graphite.disable_warnings() @@ -488,12 +505,18 @@ if env_text_server_adv["tools"]: env_text_server_adv.Append( CPPPATH=[ "#thirdparty/harfbuzz/src", - "#thirdparty/freetype/include", - "#thirdparty/graphite/include", "#thirdparty/icu4c/common/", ] ) +if freetype_enabled: + env_text_server_adv.Append( + CPPPATH=[ + "#thirdparty/freetype/include", + "#thirdparty/graphite/include", + ] + ) + env_text_server_adv.add_source_files(module_obj, "*.cpp") env.modules_sources += module_obj diff --git a/modules/text_server_adv/config.py b/modules/text_server_adv/config.py index 22482fce24..d22f9454ed 100644 --- a/modules/text_server_adv/config.py +++ b/modules/text_server_adv/config.py @@ -1,5 +1,5 @@ def can_build(env, platform): - return env.module_check_dependencies("text_server_adv", ["freetype"]) + return True def configure(env): diff --git a/modules/text_server_adv/dynamic_font_adv.cpp b/modules/text_server_adv/dynamic_font_adv.cpp index fd47f58480..b60b9ddaec 100644 --- a/modules/text_server_adv/dynamic_font_adv.cpp +++ b/modules/text_server_adv/dynamic_font_adv.cpp @@ -30,6 +30,8 @@ #include "dynamic_font_adv.h" +#ifdef MODULE_FREETYPE_ENABLED + #include FT_STROKER_H #include FT_ADVANCES_H #include FT_MULTIPLE_MASTERS_H @@ -1001,3 +1003,5 @@ DynamicFontDataAdvanced::~DynamicFontDataAdvanced() { FT_Done_FreeType(library); } } + +#endif // MODULE_FREETYPE_ENABLED diff --git a/modules/text_server_adv/dynamic_font_adv.h b/modules/text_server_adv/dynamic_font_adv.h index cd538cb8e1..d69a30b321 100644 --- a/modules/text_server_adv/dynamic_font_adv.h +++ b/modules/text_server_adv/dynamic_font_adv.h @@ -33,6 +33,10 @@ #include "font_adv.h" +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_FREETYPE_ENABLED + #include <ft2build.h> #include FT_FREETYPE_H #include FT_TRUETYPE_TABLES_H @@ -185,4 +189,6 @@ public: virtual ~DynamicFontDataAdvanced() override; }; +#endif // MODULE_FREETYPE_ENABLED + #endif // DYNAMIC_FONT_ADV_H diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 1e015db210..2af31f4043 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -529,10 +529,12 @@ RID TextServerAdvanced::create_font_system(const String &p_name, int p_base_size RID TextServerAdvanced::create_font_resource(const String &p_filename, int p_base_size) { _THREAD_SAFE_METHOD_ FontDataAdvanced *fd = nullptr; - if (p_filename.get_extension() == "ttf" || p_filename.get_extension() == "otf" || p_filename.get_extension() == "woff") { - fd = memnew(DynamicFontDataAdvanced); - } else if (p_filename.get_extension() == "fnt" || p_filename.get_extension() == "font") { + if (p_filename.get_extension() == "fnt" || p_filename.get_extension() == "font") { fd = memnew(BitmapFontDataAdvanced); +#ifdef MODULE_FREETYPE_ENABLED + } else if (p_filename.get_extension() == "ttf" || p_filename.get_extension() == "otf" || p_filename.get_extension() == "woff") { + fd = memnew(DynamicFontDataAdvanced); +#endif } else { return RID(); } @@ -549,10 +551,12 @@ RID TextServerAdvanced::create_font_resource(const String &p_filename, int p_bas RID TextServerAdvanced::create_font_memory(const uint8_t *p_data, size_t p_size, const String &p_type, int p_base_size) { _THREAD_SAFE_METHOD_ FontDataAdvanced *fd = nullptr; - if (p_type == "ttf" || p_type == "otf" || p_type == "woff") { - fd = memnew(DynamicFontDataAdvanced); - } else if (p_type == "fnt" || p_type == "font") { + if (p_type == "fnt" || p_type == "font") { fd = memnew(BitmapFontDataAdvanced); +#ifdef MODULE_FREETYPE_ENABLED + } else if (p_type == "ttf" || p_type == "otf" || p_type == "woff") { + fd = memnew(DynamicFontDataAdvanced); +#endif } else { return RID(); } diff --git a/modules/text_server_fb/config.py b/modules/text_server_fb/config.py index 491377a369..7a73080ae9 100644 --- a/modules/text_server_fb/config.py +++ b/modules/text_server_fb/config.py @@ -1,5 +1,5 @@ def can_build(env, platform): - return env.module_check_dependencies("text_server_fb", ["freetype"]) + return True def configure(env): diff --git a/modules/text_server_fb/dynamic_font_fb.cpp b/modules/text_server_fb/dynamic_font_fb.cpp index 6836d2b9e2..66d36bc885 100644 --- a/modules/text_server_fb/dynamic_font_fb.cpp +++ b/modules/text_server_fb/dynamic_font_fb.cpp @@ -30,6 +30,8 @@ #include "dynamic_font_fb.h" +#ifdef MODULE_FREETYPE_ENABLED + #include FT_STROKER_H #include FT_ADVANCES_H @@ -684,3 +686,5 @@ DynamicFontDataFallback::~DynamicFontDataFallback() { FT_Done_FreeType(library); } } + +#endif // MODULE_FREETYPE_ENABLED diff --git a/modules/text_server_fb/dynamic_font_fb.h b/modules/text_server_fb/dynamic_font_fb.h index 81b18f6af3..eb70f46666 100644 --- a/modules/text_server_fb/dynamic_font_fb.h +++ b/modules/text_server_fb/dynamic_font_fb.h @@ -33,6 +33,10 @@ #include "font_fb.h" +#include "modules/modules_enabled.gen.h" + +#ifdef MODULE_FREETYPE_ENABLED + #include <ft2build.h> #include FT_FREETYPE_H @@ -163,4 +167,6 @@ public: virtual ~DynamicFontDataFallback() override; }; +#endif // MODULE_FREETYPE_ENABLED + #endif // DYNAMIC_FONT_FALLBACK_H diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 5cbe0f8277..a732c6184c 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -107,10 +107,12 @@ RID TextServerFallback::create_font_system(const String &p_name, int p_base_size RID TextServerFallback::create_font_resource(const String &p_filename, int p_base_size) { _THREAD_SAFE_METHOD_ FontDataFallback *fd = nullptr; - if (p_filename.get_extension() == "ttf" || p_filename.get_extension() == "otf" || p_filename.get_extension() == "woff") { - fd = memnew(DynamicFontDataFallback); - } else if (p_filename.get_extension() == "fnt" || p_filename.get_extension() == "font") { + if (p_filename.get_extension() == "fnt" || p_filename.get_extension() == "font") { fd = memnew(BitmapFontDataFallback); +#ifdef MODULE_FREETYPE_ENABLED + } else if (p_filename.get_extension() == "ttf" || p_filename.get_extension() == "otf" || p_filename.get_extension() == "woff") { + fd = memnew(DynamicFontDataFallback); +#endif } else { return RID(); } @@ -127,10 +129,12 @@ RID TextServerFallback::create_font_resource(const String &p_filename, int p_bas RID TextServerFallback::create_font_memory(const uint8_t *p_data, size_t p_size, const String &p_type, int p_base_size) { _THREAD_SAFE_METHOD_ FontDataFallback *fd = nullptr; - if (p_type == "ttf" || p_type == "otf" || p_type == "woff") { - fd = memnew(DynamicFontDataFallback); - } else if (p_type == "fnt" || p_type == "font") { + if (p_type == "fnt" || p_type == "font") { fd = memnew(BitmapFontDataFallback); +#ifdef MODULE_FREETYPE_ENABLED + } else if (p_type == "ttf" || p_type == "otf" || p_type == "woff") { + fd = memnew(DynamicFontDataFallback); +#endif } else { return RID(); } diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index f92fe2340e..2685a8a013 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -36,6 +36,7 @@ #include "core/os/semaphore.h" #include "core/os/thread.h" #include "core/templates/ring_buffer.h" +#include "core/templates/safe_refcount.h" #include "scene/resources/video_stream.h" #include "servers/audio_server.h" @@ -113,7 +114,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { bool thread_eof = false; Semaphore *thread_sem; Thread thread; - volatile bool thread_exit = false; + SafeFlag thread_exit; static void _streaming_thread(void *ud); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 39726a4a58..fcd55b3049 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -4274,13 +4274,13 @@ VisualScriptEditor::VisualScriptEditor() { edit_menu->set_shortcut_context(this); edit_menu->set_text(TTR("Edit")); edit_menu->set_switch_on_hover(true); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/delete_selected"), EDIT_DELETE_NODES); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_graph_delete"), EDIT_DELETE_NODES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/toggle_breakpoint"), EDIT_TOGGLE_BREAKPOINT); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/find_node_type"), EDIT_FIND_NODE_TYPE); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/copy_nodes"), EDIT_COPY_NODES); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/cut_nodes"), EDIT_CUT_NODES); - edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/paste_nodes"), EDIT_PASTE_NODES); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_copy"), EDIT_COPY_NODES); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_cut"), EDIT_CUT_NODES); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("ui_paste"), EDIT_PASTE_NODES); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/create_function"), EDIT_CREATE_FUNCTION); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/refresh_nodes"), REFRESH_GRAPH); @@ -4520,12 +4520,8 @@ void VisualScriptEditor::free_clipboard() { static void register_editor_callback() { ScriptEditor::register_create_script_editor_function(create_editor); - ED_SHORTCUT("visual_script_editor/delete_selected", TTR("Delete Selected"), KEY_DELETE); ED_SHORTCUT("visual_script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9); ED_SHORTCUT("visual_script_editor/find_node_type", TTR("Find Node Type"), KEY_MASK_CMD + KEY_F); - ED_SHORTCUT("visual_script_editor/copy_nodes", TTR("Copy Nodes"), KEY_MASK_CMD + KEY_C); - ED_SHORTCUT("visual_script_editor/cut_nodes", TTR("Cut Nodes"), KEY_MASK_CMD + KEY_X); - ED_SHORTCUT("visual_script_editor/paste_nodes", TTR("Paste Nodes"), KEY_MASK_CMD + KEY_V); ED_SHORTCUT("visual_script_editor/create_function", TTR("Make Function"), KEY_MASK_CMD + KEY_G); ED_SHORTCUT("visual_script_editor/refresh_nodes", TTR("Refresh Graph"), KEY_MASK_CMD + KEY_R); ED_SHORTCUT("visual_script_editor/edit_member", TTR("Edit Member"), KEY_MASK_CMD + KEY_E); diff --git a/modules/webxr/native/webxr.externs.js b/modules/webxr/native/webxr.externs.js index 03dc05bc83..9ea105aa93 100644 --- a/modules/webxr/native/webxr.externs.js +++ b/modules/webxr/native/webxr.externs.js @@ -33,7 +33,7 @@ XR.prototype.ondevicechanged; * * @return {!Promise<boolean>} */ -XR.prototype.isSessionSupported = function(mode) {} +XR.prototype.isSessionSupported = function(mode) {}; /** * @param {string} mode @@ -41,7 +41,7 @@ XR.prototype.isSessionSupported = function(mode) {} * * @return {!Promise<XRSession>} */ -XR.prototype.requestSession = function(mode, options) {} +XR.prototype.requestSession = function(mode, options) {}; /** * @constructor diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index d5eff9823f..888b1546e4 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -37,6 +37,7 @@ #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" +#include "core/templates/safe_refcount.h" #include "core/version.h" #include "drivers/png/png_driver_common.h" #include "editor/editor_export.h" @@ -277,38 +278,38 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { Vector<PluginConfigAndroid> plugins; String last_plugin_names; uint64_t last_custom_build_time = 0; - volatile bool plugins_changed; + SafeFlag plugins_changed; Mutex plugins_lock; Vector<Device> devices; - volatile bool devices_changed; + SafeFlag devices_changed; Mutex device_lock; Thread check_for_changes_thread; - volatile bool quit_request; + SafeFlag quit_request; static void _check_for_changes_poll_thread(void *ud) { EditorExportPlatformAndroid *ea = (EditorExportPlatformAndroid *)ud; - while (!ea->quit_request) { + while (!ea->quit_request.is_set()) { // Check for plugins updates { // Nothing to do if we already know the plugins have changed. - if (!ea->plugins_changed) { + if (!ea->plugins_changed.is_set()) { Vector<PluginConfigAndroid> loaded_plugins = get_plugins(); MutexLock lock(ea->plugins_lock); if (ea->plugins.size() != loaded_plugins.size()) { - ea->plugins_changed = true; + ea->plugins_changed.set(); } else { for (int i = 0; i < ea->plugins.size(); i++) { if (ea->plugins[i].name != loaded_plugins[i].name) { - ea->plugins_changed = true; + ea->plugins_changed.set(); break; } } } - if (ea->plugins_changed) { + if (ea->plugins_changed.is_set()) { ea->plugins = loaded_plugins; } } @@ -422,7 +423,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { } ea->devices = ndevices; - ea->devices_changed = true; + ea->devices_changed.set(); } } @@ -431,7 +432,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { uint64_t time = OS::get_singleton()->get_ticks_usec(); while (OS::get_singleton()->get_ticks_usec() - time < wait) { OS::get_singleton()->delay_usec(1000 * sleep); - if (ea->quit_request) { + if (ea->quit_request.is_set()) { break; } } @@ -1667,7 +1668,7 @@ public: print_verbose("Found Android plugin " + plugins_configs[i].name); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "plugins/" + plugins_configs[i].name), false)); } - plugins_changed = false; + plugins_changed.clear(); Vector<String> abis = get_abis(); for (int i = 0; i < abis.size(); ++i) { @@ -1737,19 +1738,19 @@ public: } virtual bool should_update_export_options() override { - bool export_options_changed = plugins_changed; + bool export_options_changed = plugins_changed.is_set(); if (export_options_changed) { // don't clear unless we're reporting true, to avoid race - plugins_changed = false; + plugins_changed.clear(); } return export_options_changed; } virtual bool poll_export() override { - bool dc = devices_changed; + bool dc = devices_changed.is_set(); if (dc) { // don't clear unless we're reporting true, to avoid race - devices_changed = false; + devices_changed.clear(); } return dc; } @@ -2938,14 +2939,13 @@ public: run_icon.instance(); run_icon->create_from_image(img); - devices_changed = true; - plugins_changed = true; - quit_request = false; + devices_changed.set(); + plugins_changed.set(); check_for_changes_thread.start(_check_for_changes_poll_thread, this); } ~EditorExportPlatformAndroid() { - quit_request = true; + quit_request.set(); check_for_changes_thread.wait_to_finish(); } }; diff --git a/platform/android/java_godot_io_wrapper.cpp b/platform/android/java_godot_io_wrapper.cpp index 4ee4427aa0..41201db32b 100644 --- a/platform/android/java_godot_io_wrapper.cpp +++ b/platform/android/java_godot_io_wrapper.cpp @@ -187,14 +187,14 @@ String GodotIOJavaWrapper::get_system_dir(int p_dir) { } } -// volatile because it can be changed from non-main thread and we need to +// SafeNumeric because it can be changed from non-main thread and we need to // ensure the change is immediately visible to other threads. -static volatile int virtual_keyboard_height; +static SafeNumeric<int> virtual_keyboard_height; int GodotIOJavaWrapper::get_vk_height() { - return virtual_keyboard_height; + return virtual_keyboard_height.get(); } void GodotIOJavaWrapper::set_vk_height(int p_height) { - virtual_keyboard_height = p_height; + virtual_keyboard_height.set(p_height); } diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index fe38482a00..c585c2afbe 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -37,6 +37,7 @@ #include "core/io/zip_io.h" #include "core/os/file_access.h" #include "core/os/os.h" +#include "core/templates/safe_refcount.h" #include "core/version.h" #include "editor/editor_export.h" #include "editor/editor_node.h" @@ -56,9 +57,9 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Ref<ImageTexture> logo; // Plugins - volatile bool plugins_changed; + SafeFlag plugins_changed; Thread check_for_changes_thread; - volatile bool quit_request; + SafeFlag quit_request; Mutex plugins_lock; Vector<PluginConfigIOS> plugins; @@ -141,19 +142,19 @@ class EditorExportPlatformIOS : public EditorExportPlatform { static void _check_for_changes_poll_thread(void *ud) { EditorExportPlatformIOS *ea = (EditorExportPlatformIOS *)ud; - while (!ea->quit_request) { + while (!ea->quit_request.is_set()) { // Nothing to do if we already know the plugins have changed. - if (!ea->plugins_changed) { + if (!ea->plugins_changed.is_set()) { MutexLock lock(ea->plugins_lock); Vector<PluginConfigIOS> loaded_plugins = get_plugins(); if (ea->plugins.size() != loaded_plugins.size()) { - ea->plugins_changed = true; + ea->plugins_changed.set(); } else { for (int i = 0; i < ea->plugins.size(); i++) { if (ea->plugins[i].name != loaded_plugins[i].name || ea->plugins[i].last_updated != loaded_plugins[i].last_updated) { - ea->plugins_changed = true; + ea->plugins_changed.set(); break; } } @@ -165,7 +166,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform { while (OS::get_singleton()->get_ticks_usec() - time < wait) { OS::get_singleton()->delay_usec(300000); - if (ea->quit_request) { + if (ea->quit_request.is_set()) { break; } } @@ -182,10 +183,10 @@ public: virtual Ref<Texture2D> get_logo() const override { return logo; } virtual bool should_update_export_options() override { - bool export_options_changed = plugins_changed; + bool export_options_changed = plugins_changed.is_set(); if (export_options_changed) { // don't clear unless we're reporting true, to avoid race - plugins_changed = false; + plugins_changed.clear(); } return export_options_changed; } @@ -364,7 +365,7 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) for (int i = 0; i < found_plugins.size(); i++) { r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "plugins/" + found_plugins[i].name), false)); } - plugins_changed = false; + plugins_changed.clear(); plugins = found_plugins; r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/access_wifi"), false)); @@ -1967,14 +1968,13 @@ EditorExportPlatformIOS::EditorExportPlatformIOS() { logo.instance(); logo->create_from_image(img); - plugins_changed = true; - quit_request = false; + plugins_changed.set(); check_for_changes_thread.start(_check_for_changes_poll_thread, this); } EditorExportPlatformIOS::~EditorExportPlatformIOS() { - quit_request = true; + quit_request.set(); check_for_changes_thread.wait_to_finish(); } diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index f87e9cf886..ff521e4e7f 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -127,6 +127,7 @@ def configure(env): env["CC"] = "clang" env["CXX"] = "clang++" env.extra_suffix = ".llvm" + env.extra_suffix + env.Append(LIBS=["atomic"]) if env["use_lld"]: if env["use_llvm"]: diff --git a/platform/linuxbsd/detect_prime_x11.cpp b/platform/linuxbsd/detect_prime_x11.cpp index 0f8d108dff..da1c95a593 100644 --- a/platform/linuxbsd/detect_prime_x11.cpp +++ b/platform/linuxbsd/detect_prime_x11.cpp @@ -61,6 +61,7 @@ struct vendor { vendor vendormap[] = { { "Advanced Micro Devices, Inc.", 30 }, + { "AMD", 30 }, { "NVIDIA Corporation", 30 }, { "X.Org", 30 }, { "Intel Open Source Technology Center", 20 }, @@ -128,7 +129,7 @@ void create_context() { int detect_prime() { pid_t p; - int priorities[2]; + int priorities[2] = {}; String vendors[2]; String renderers[2]; diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 53baf17858..fceeb82325 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -2697,7 +2697,7 @@ bool DisplayServerX11::_wait_for_events() const { } void DisplayServerX11::_poll_events() { - while (!events_thread_done) { + while (!events_thread_done.is_set()) { _wait_for_events(); // Process events from the queue. @@ -4279,7 +4279,7 @@ DisplayServerX11::~DisplayServerX11() { _clipboard_transfer_ownership(XA_PRIMARY, x11_main_window); _clipboard_transfer_ownership(XInternAtom(x11_display, "CLIPBOARD", 0), x11_main_window); - events_thread_done = true; + events_thread_done.set(); events_thread.wait_to_finish(); //destroy all windows diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index 906710f933..10686d8424 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -253,7 +253,7 @@ class DisplayServerX11 : public DisplayServer { mutable Mutex events_mutex; Thread events_thread; - bool events_thread_done = false; + SafeFlag events_thread_done; LocalVector<XEvent> polled_events; static void _poll_events_thread(void *ud); bool _wait_for_events() const; diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 9d2a768fb3..471259e50f 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -73,7 +73,12 @@ void JoypadLinux::Joypad::reset() { JoypadLinux::JoypadLinux(Input *in) { #ifdef UDEV_ENABLED - use_udev = initialize_libudev() == 0; +#ifdef DEBUG_ENABLED + int dylibloader_verbose = 1; +#else + int dylibloader_verbose = 0; +#endif + use_udev = initialize_libudev(dylibloader_verbose) == 0; if (use_udev) { print_verbose("JoypadLinux: udev enabled and loaded successfully."); } else { @@ -87,7 +92,7 @@ JoypadLinux::JoypadLinux(Input *in) { } JoypadLinux::~JoypadLinux() { - exit_monitor = true; + exit_monitor.set(); joy_thread.wait_to_finish(); close_joypad(); } @@ -155,7 +160,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { udev_monitor_enable_receiving(mon); int fd = udev_monitor_get_fd(mon); - while (!exit_monitor) { + while (!exit_monitor.is_set()) { fd_set fds; struct timeval tv; int ret; @@ -197,7 +202,7 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { #endif void JoypadLinux::monitor_joypads() { - while (!exit_monitor) { + while (!exit_monitor.is_set()) { { MutexLock lock(joy_mutex); diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h index 2cca0700d6..b0d0db047b 100644 --- a/platform/linuxbsd/joypad_linux.h +++ b/platform/linuxbsd/joypad_linux.h @@ -73,7 +73,7 @@ private: #ifdef UDEV_ENABLED bool use_udev = false; #endif - bool exit_monitor = false; + SafeFlag exit_monitor; Mutex joy_mutex; Thread joy_thread; Input *input = nullptr; diff --git a/platform/linuxbsd/libudev-so_wrap.c b/platform/linuxbsd/libudev-so_wrap.c index 07f368d7c5..a9fa4a494a 100644 --- a/platform/linuxbsd/libudev-so_wrap.c +++ b/platform/linuxbsd/libudev-so_wrap.c @@ -1,8 +1,10 @@ // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:18:56 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:59 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/libudev.h --sys-include <libudev.h> --soname libudev.so.1 --init-name libudev --omit-prefix gnu_ --output-header libudev-so_wrap.h --output-implementation libudev-so_wrap.c // +#include <stdint.h> + #define udev_ref udev_ref_dylibloader_orig_libudev #define udev_unref udev_unref_dylibloader_orig_libudev #define udev_new udev_new_dylibloader_orig_libudev @@ -276,554 +278,736 @@ struct udev_hwdb* (*udev_hwdb_ref_dylibloader_wrapper_libudev)(struct udev_hwdb* struct udev_hwdb* (*udev_hwdb_unref_dylibloader_wrapper_libudev)(struct udev_hwdb*); struct udev_list_entry* (*udev_hwdb_get_properties_list_entry_dylibloader_wrapper_libudev)(struct udev_hwdb*,const char*, unsigned); int (*udev_util_encode_string_dylibloader_wrapper_libudev)(const char*, char*, size_t); -int initialize_libudev() { +int initialize_libudev(int verbose) { void *handle; char *error; handle = dlopen("libudev.so.1", RTLD_LAZY); if (!handle) { - fprintf(stderr, "%s\n", dlerror()); + if (verbose) { + fprintf(stderr, "%s\n", dlerror()); + } return(1); } dlerror(); // udev_ref *(void **) (&udev_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_unref *(void **) (&udev_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_new *(void **) (&udev_new_dylibloader_wrapper_libudev) = dlsym(handle, "udev_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_set_log_fn *(void **) (&udev_set_log_fn_dylibloader_wrapper_libudev) = dlsym(handle, "udev_set_log_fn"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_get_log_priority *(void **) (&udev_get_log_priority_dylibloader_wrapper_libudev) = dlsym(handle, "udev_get_log_priority"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_set_log_priority *(void **) (&udev_set_log_priority_dylibloader_wrapper_libudev) = dlsym(handle, "udev_set_log_priority"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_get_userdata *(void **) (&udev_get_userdata_dylibloader_wrapper_libudev) = dlsym(handle, "udev_get_userdata"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_set_userdata *(void **) (&udev_set_userdata_dylibloader_wrapper_libudev) = dlsym(handle, "udev_set_userdata"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_list_entry_get_next *(void **) (&udev_list_entry_get_next_dylibloader_wrapper_libudev) = dlsym(handle, "udev_list_entry_get_next"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_list_entry_get_by_name *(void **) (&udev_list_entry_get_by_name_dylibloader_wrapper_libudev) = dlsym(handle, "udev_list_entry_get_by_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_list_entry_get_name *(void **) (&udev_list_entry_get_name_dylibloader_wrapper_libudev) = dlsym(handle, "udev_list_entry_get_name"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_list_entry_get_value *(void **) (&udev_list_entry_get_value_dylibloader_wrapper_libudev) = dlsym(handle, "udev_list_entry_get_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_ref *(void **) (&udev_device_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_unref *(void **) (&udev_device_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_udev *(void **) (&udev_device_get_udev_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_udev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_new_from_syspath *(void **) (&udev_device_new_from_syspath_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_new_from_syspath"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_new_from_devnum *(void **) (&udev_device_new_from_devnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_new_from_devnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_new_from_subsystem_sysname *(void **) (&udev_device_new_from_subsystem_sysname_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_new_from_subsystem_sysname"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_new_from_device_id *(void **) (&udev_device_new_from_device_id_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_new_from_device_id"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_new_from_environment *(void **) (&udev_device_new_from_environment_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_new_from_environment"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_parent *(void **) (&udev_device_get_parent_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_parent"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_parent_with_subsystem_devtype *(void **) (&udev_device_get_parent_with_subsystem_devtype_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_parent_with_subsystem_devtype"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_devpath *(void **) (&udev_device_get_devpath_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_devpath"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_subsystem *(void **) (&udev_device_get_subsystem_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_subsystem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_devtype *(void **) (&udev_device_get_devtype_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_devtype"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_syspath *(void **) (&udev_device_get_syspath_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_syspath"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_sysname *(void **) (&udev_device_get_sysname_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_sysname"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_sysnum *(void **) (&udev_device_get_sysnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_sysnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_devnode *(void **) (&udev_device_get_devnode_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_devnode"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_is_initialized *(void **) (&udev_device_get_is_initialized_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_is_initialized"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_devlinks_list_entry *(void **) (&udev_device_get_devlinks_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_devlinks_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_properties_list_entry *(void **) (&udev_device_get_properties_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_properties_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_tags_list_entry *(void **) (&udev_device_get_tags_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_tags_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_sysattr_list_entry *(void **) (&udev_device_get_sysattr_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_sysattr_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_property_value *(void **) (&udev_device_get_property_value_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_property_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_driver *(void **) (&udev_device_get_driver_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_driver"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_devnum *(void **) (&udev_device_get_devnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_devnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_action *(void **) (&udev_device_get_action_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_action"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_seqnum *(void **) (&udev_device_get_seqnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_seqnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_usec_since_initialized *(void **) (&udev_device_get_usec_since_initialized_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_usec_since_initialized"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_get_sysattr_value *(void **) (&udev_device_get_sysattr_value_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_get_sysattr_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_set_sysattr_value *(void **) (&udev_device_set_sysattr_value_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_set_sysattr_value"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_device_has_tag *(void **) (&udev_device_has_tag_dylibloader_wrapper_libudev) = dlsym(handle, "udev_device_has_tag"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_ref *(void **) (&udev_monitor_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_unref *(void **) (&udev_monitor_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_get_udev *(void **) (&udev_monitor_get_udev_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_get_udev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_new_from_netlink *(void **) (&udev_monitor_new_from_netlink_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_new_from_netlink"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_enable_receiving *(void **) (&udev_monitor_enable_receiving_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_enable_receiving"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_set_receive_buffer_size *(void **) (&udev_monitor_set_receive_buffer_size_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_set_receive_buffer_size"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_get_fd *(void **) (&udev_monitor_get_fd_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_get_fd"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_receive_device *(void **) (&udev_monitor_receive_device_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_receive_device"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_filter_add_match_subsystem_devtype *(void **) (&udev_monitor_filter_add_match_subsystem_devtype_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_filter_add_match_subsystem_devtype"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_filter_add_match_tag *(void **) (&udev_monitor_filter_add_match_tag_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_filter_add_match_tag"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_filter_update *(void **) (&udev_monitor_filter_update_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_filter_update"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_monitor_filter_remove *(void **) (&udev_monitor_filter_remove_dylibloader_wrapper_libudev) = dlsym(handle, "udev_monitor_filter_remove"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_ref *(void **) (&udev_enumerate_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_unref *(void **) (&udev_enumerate_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_get_udev *(void **) (&udev_enumerate_get_udev_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_get_udev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_new *(void **) (&udev_enumerate_new_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_subsystem *(void **) (&udev_enumerate_add_match_subsystem_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_subsystem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_nomatch_subsystem *(void **) (&udev_enumerate_add_nomatch_subsystem_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_nomatch_subsystem"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_sysattr *(void **) (&udev_enumerate_add_match_sysattr_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_sysattr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_nomatch_sysattr *(void **) (&udev_enumerate_add_nomatch_sysattr_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_nomatch_sysattr"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_property *(void **) (&udev_enumerate_add_match_property_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_property"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_sysname *(void **) (&udev_enumerate_add_match_sysname_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_sysname"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_tag *(void **) (&udev_enumerate_add_match_tag_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_tag"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_parent *(void **) (&udev_enumerate_add_match_parent_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_parent"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_match_is_initialized *(void **) (&udev_enumerate_add_match_is_initialized_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_match_is_initialized"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_add_syspath *(void **) (&udev_enumerate_add_syspath_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_add_syspath"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_scan_devices *(void **) (&udev_enumerate_scan_devices_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_scan_devices"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_scan_subsystems *(void **) (&udev_enumerate_scan_subsystems_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_scan_subsystems"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_enumerate_get_list_entry *(void **) (&udev_enumerate_get_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_enumerate_get_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_ref *(void **) (&udev_queue_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_unref *(void **) (&udev_queue_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_udev *(void **) (&udev_queue_get_udev_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_udev"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_new *(void **) (&udev_queue_new_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_kernel_seqnum *(void **) (&udev_queue_get_kernel_seqnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_kernel_seqnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_udev_seqnum *(void **) (&udev_queue_get_udev_seqnum_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_udev_seqnum"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_udev_is_active *(void **) (&udev_queue_get_udev_is_active_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_udev_is_active"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_queue_is_empty *(void **) (&udev_queue_get_queue_is_empty_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_queue_is_empty"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_seqnum_is_finished *(void **) (&udev_queue_get_seqnum_is_finished_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_seqnum_is_finished"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_seqnum_sequence_is_finished *(void **) (&udev_queue_get_seqnum_sequence_is_finished_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_seqnum_sequence_is_finished"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_fd *(void **) (&udev_queue_get_fd_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_fd"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_flush *(void **) (&udev_queue_flush_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_flush"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_queue_get_queued_list_entry *(void **) (&udev_queue_get_queued_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_queue_get_queued_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_hwdb_new *(void **) (&udev_hwdb_new_dylibloader_wrapper_libudev) = dlsym(handle, "udev_hwdb_new"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_hwdb_ref *(void **) (&udev_hwdb_ref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_hwdb_ref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_hwdb_unref *(void **) (&udev_hwdb_unref_dylibloader_wrapper_libudev) = dlsym(handle, "udev_hwdb_unref"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_hwdb_get_properties_list_entry *(void **) (&udev_hwdb_get_properties_list_entry_dylibloader_wrapper_libudev) = dlsym(handle, "udev_hwdb_get_properties_list_entry"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } // udev_util_encode_string *(void **) (&udev_util_encode_string_dylibloader_wrapper_libudev) = dlsym(handle, "udev_util_encode_string"); - error = dlerror(); - if (error != NULL) { - fprintf(stderr, "%s\n", error); + if (verbose) { + error = dlerror(); + if (error != NULL) { + fprintf(stderr, "%s\n", error); + } } return 0; } diff --git a/platform/linuxbsd/libudev-so_wrap.h b/platform/linuxbsd/libudev-so_wrap.h index f6d949fa4a..dd43fd1191 100644 --- a/platform/linuxbsd/libudev-so_wrap.h +++ b/platform/linuxbsd/libudev-so_wrap.h @@ -2,9 +2,11 @@ #define DYLIBLOAD_WRAPPER_LIBUDEV // This file is generated. Do not edit! // see https://github.com/hpvb/dynload-wrapper for details -// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.2 on 2021-02-18 00:18:56 +// generated by /home/hp/Projects/godot/pulse/generate-wrapper.py 0.3 on 2021-02-20 00:08:59 // flags: /home/hp/Projects/godot/pulse/generate-wrapper.py --include /usr/include/libudev.h --sys-include <libudev.h> --soname libudev.so.1 --init-name libudev --omit-prefix gnu_ --output-header libudev-so_wrap.h --output-implementation libudev-so_wrap.c // +#include <stdint.h> + #define udev_ref udev_ref_dylibloader_orig_libudev #define udev_unref udev_unref_dylibloader_orig_libudev #define udev_new udev_new_dylibloader_orig_libudev @@ -369,7 +371,7 @@ extern struct udev_hwdb* (*udev_hwdb_ref_dylibloader_wrapper_libudev)(struct ude extern struct udev_hwdb* (*udev_hwdb_unref_dylibloader_wrapper_libudev)(struct udev_hwdb*); extern struct udev_list_entry* (*udev_hwdb_get_properties_list_entry_dylibloader_wrapper_libudev)(struct udev_hwdb*,const char*, unsigned); extern int (*udev_util_encode_string_dylibloader_wrapper_libudev)(const char*, char*, size_t); -int initialize_libudev(); +int initialize_libudev(int verbose); #ifdef __cplusplus } #endif diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 21dfc4ae2c..b9b78f7bd4 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -535,7 +535,7 @@ void DisplayServerWindows::delete_sub_window(WindowID p_window) { } #endif - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available && windows[p_window].wtctx) { + if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[p_window].wtctx) { wintab_WTClose(windows[p_window].wtctx); windows[p_window].wtctx = 0; } @@ -2021,7 +2021,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } break; case WT_CSRCHANGE: case WT_PROXIMITY: { - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { + if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { AXIS pressure; if (wintab_WTInfo(WTI_DEVICES + windows[window_id].wtlc.lcDevice, DVC_NPRESSURE, &pressure)) { windows[window_id].min_pressure = int(pressure.axMin); @@ -2035,7 +2035,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } } break; case WT_PACKET: { - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { + if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { PACKET packet; if (wintab_WTPacket(windows[window_id].wtctx, wParam, &packet)) { float pressure = float(packet.pkNormalPressure - windows[window_id].min_pressure) / float(windows[window_id].max_pressure - windows[window_id].min_pressure); @@ -2114,7 +2114,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA break; } - if ((OS::get_singleton()->get_current_tablet_driver() != "winink") || !winink_available) { + if ((tablet_get_current_driver() != "winink") || !winink_available) { break; } @@ -2140,7 +2140,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA break; } - if ((OS::get_singleton()->get_current_tablet_driver() != "winink") || !winink_available) { + if ((tablet_get_current_driver() != "winink") || !winink_available) { break; } @@ -2304,7 +2304,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA mm->set_shift((wParam & MK_SHIFT) != 0); mm->set_alt(alt_mem); - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { + if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[window_id].wtctx) { // Note: WinTab sends both WT_PACKET and WM_xBUTTONDOWN/UP/MOUSEMOVE events, use mouse 1/0 pressure only when last_pressure was not update recently. if (windows[window_id].last_pressure_update < 10) { windows[window_id].last_pressure_update++; @@ -2799,7 +2799,7 @@ void DisplayServerWindows::_process_activate_event(WindowID p_window_id, WPARAM alt_mem = false; } - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available && windows[p_window_id].wtctx) { + if ((tablet_get_current_driver() == "wintab") && wintab_available && windows[p_window_id].wtctx) { wintab_WTEnable(windows[p_window_id].wtctx, GET_WM_ACTIVATE_STATE(wParam, lParam)); } } @@ -3037,7 +3037,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, DragAcceptFiles(wd.hWnd, true); - if ((OS::get_singleton()->get_current_tablet_driver() == "wintab") && wintab_available) { + if ((tablet_get_current_driver() == "wintab") && wintab_available) { wintab_WTInfo(WTI_DEFSYSCTX, 0, &wd.wtlc); wd.wtlc.lcOptions |= CXO_MESSAGES; wd.wtlc.lcPktData = PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION; @@ -3104,6 +3104,40 @@ typedef enum _SHC_PROCESS_DPI_AWARENESS { SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2 } SHC_PROCESS_DPI_AWARENESS; +int DisplayServerWindows::tablet_get_driver_count() const { + return tablet_drivers.size(); +} + +String DisplayServerWindows::tablet_get_driver_name(int p_driver) const { + if (p_driver < 0 || p_driver >= tablet_drivers.size()) { + return ""; + } else { + return tablet_drivers[p_driver]; + } +} + +String DisplayServerWindows::tablet_get_current_driver() const { + return tablet_driver; +} + +void DisplayServerWindows::tablet_set_current_driver(const String &p_driver) { + if (tablet_get_driver_count() == 0) { + return; + } + bool found = false; + for (int i = 0; i < tablet_get_driver_count(); i++) { + if (p_driver == tablet_get_driver_name(i)) { + found = true; + } + } + if (found) { + _update_tablet_ctx(tablet_driver, p_driver); + tablet_driver = p_driver; + } else { + ERR_PRINT("Unknown tablet driver " + p_driver + "."); + } +} + DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, WindowMode p_mode, uint32_t p_flags, const Vector2i &p_resolution, Error &r_error) { drop_events = false; key_event_pos = 0; @@ -3122,6 +3156,35 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win outside = true; + //Note: Wacom WinTab driver API for pen input, for devices incompatible with Windows Ink. + HMODULE wintab_lib = LoadLibraryW(L"wintab32.dll"); + if (wintab_lib) { + wintab_WTOpen = (WTOpenPtr)GetProcAddress(wintab_lib, "WTOpenW"); + wintab_WTClose = (WTClosePtr)GetProcAddress(wintab_lib, "WTClose"); + wintab_WTInfo = (WTInfoPtr)GetProcAddress(wintab_lib, "WTInfoW"); + wintab_WTPacket = (WTPacketPtr)GetProcAddress(wintab_lib, "WTPacket"); + wintab_WTEnable = (WTEnablePtr)GetProcAddress(wintab_lib, "WTEnable"); + + wintab_available = wintab_WTOpen && wintab_WTClose && wintab_WTInfo && wintab_WTPacket && wintab_WTEnable; + } + + if (wintab_available) { + tablet_drivers.push_back("wintab"); + } + + //Note: Windows Ink API for pen input, available on Windows 8+ only. + HMODULE user32_lib = LoadLibraryW(L"user32.dll"); + if (user32_lib) { + win8p_GetPointerType = (GetPointerTypePtr)GetProcAddress(user32_lib, "GetPointerType"); + win8p_GetPointerPenInfo = (GetPointerPenInfoPtr)GetProcAddress(user32_lib, "GetPointerPenInfo"); + + winink_available = win8p_GetPointerType && win8p_GetPointerPenInfo; + } + + if (winink_available) { + tablet_drivers.push_back("winink"); + } + if (OS::get_singleton()->is_hidpi_allowed()) { HMODULE Shcore = LoadLibraryW(L"Shcore.dll"); diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index c8c6a75bf5..a734077e59 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -264,7 +264,6 @@ class DisplayServerWindows : public DisplayServer { _THREAD_SAFE_CLASS_ -public: // WinTab API static bool wintab_available; static WTOpenPtr wintab_WTOpen; @@ -279,8 +278,9 @@ public: static GetPointerPenInfoPtr win8p_GetPointerPenInfo; void _update_tablet_ctx(const String &p_old_driver, const String &p_new_driver); + String tablet_driver; + Vector<String> tablet_drivers; -private: void GetMaskBitmaps(HBITMAP hSourceBitmap, COLORREF clrTransparent, OUT HBITMAP &hAndMaskBitmap, OUT HBITMAP &hXorMaskBitmap); enum { @@ -542,6 +542,11 @@ public: virtual String keyboard_get_layout_language(int p_index) const; virtual String keyboard_get_layout_name(int p_index) const; + virtual int tablet_get_driver_count() const; + virtual String tablet_get_driver_name(int p_driver) const; + virtual String tablet_get_current_driver() const; + virtual void tablet_set_current_driver(const String &p_driver); + virtual void process_events(); virtual void force_process_and_drop_events(); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 2dd9ed4bd1..3280a36e9b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -765,77 +765,12 @@ Error OS_Windows::move_to_trash(const String &p_path) { return OK; } -int OS_Windows::get_tablet_driver_count() const { - return tablet_drivers.size(); -} - -String OS_Windows::get_tablet_driver_name(int p_driver) const { - if (p_driver < 0 || p_driver >= tablet_drivers.size()) { - return ""; - } else { - return tablet_drivers[p_driver]; - } -} - -String OS_Windows::get_current_tablet_driver() const { - return tablet_driver; -} - -void OS_Windows::set_current_tablet_driver(const String &p_driver) { - if (get_tablet_driver_count() == 0) { - return; - } - bool found = false; - for (int i = 0; i < get_tablet_driver_count(); i++) { - if (p_driver == get_tablet_driver_name(i)) { - found = true; - } - } - if (found) { - if (DisplayServerWindows::get_singleton()) { - ((DisplayServerWindows *)DisplayServerWindows::get_singleton())->_update_tablet_ctx(tablet_driver, p_driver); - } - tablet_driver = p_driver; - } else { - ERR_PRINT("Unknown tablet driver " + p_driver + "."); - } -} - OS_Windows::OS_Windows(HINSTANCE _hInstance) { ticks_per_second = 0; ticks_start = 0; main_loop = nullptr; process_map = nullptr; - //Note: Wacom WinTab driver API for pen input, for devices incompatible with Windows Ink. - HMODULE wintab_lib = LoadLibraryW(L"wintab32.dll"); - if (wintab_lib) { - DisplayServerWindows::wintab_WTOpen = (WTOpenPtr)GetProcAddress(wintab_lib, "WTOpenW"); - DisplayServerWindows::wintab_WTClose = (WTClosePtr)GetProcAddress(wintab_lib, "WTClose"); - DisplayServerWindows::wintab_WTInfo = (WTInfoPtr)GetProcAddress(wintab_lib, "WTInfoW"); - DisplayServerWindows::wintab_WTPacket = (WTPacketPtr)GetProcAddress(wintab_lib, "WTPacket"); - DisplayServerWindows::wintab_WTEnable = (WTEnablePtr)GetProcAddress(wintab_lib, "WTEnable"); - - DisplayServerWindows::wintab_available = DisplayServerWindows::wintab_WTOpen && DisplayServerWindows::wintab_WTClose && DisplayServerWindows::wintab_WTInfo && DisplayServerWindows::wintab_WTPacket && DisplayServerWindows::wintab_WTEnable; - } - - if (DisplayServerWindows::wintab_available) { - tablet_drivers.push_back("wintab"); - } - - //Note: Windows Ink API for pen input, available on Windows 8+ only. - HMODULE user32_lib = LoadLibraryW(L"user32.dll"); - if (user32_lib) { - DisplayServerWindows::win8p_GetPointerType = (GetPointerTypePtr)GetProcAddress(user32_lib, "GetPointerType"); - DisplayServerWindows::win8p_GetPointerPenInfo = (GetPointerPenInfoPtr)GetProcAddress(user32_lib, "GetPointerPenInfo"); - - DisplayServerWindows::winink_available = DisplayServerWindows::win8p_GetPointerType && DisplayServerWindows::win8p_GetPointerPenInfo; - } - - if (DisplayServerWindows::winink_available) { - tablet_drivers.push_back("winink"); - } - force_quit = false; hInstance = _hInstance; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 1a8791196b..8f9ef254f1 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -73,9 +73,6 @@ class OS_Windows : public OS { HINSTANCE hInstance; MainLoop *main_loop; - String tablet_driver; - Vector<String> tablet_drivers; - #ifdef WASAPI_ENABLED AudioDriverWASAPI driver_wasapi; #endif @@ -119,11 +116,6 @@ public: virtual String get_name() const override; - virtual int get_tablet_driver_count() const override; - virtual String get_tablet_driver_name(int p_driver) const override; - virtual String get_current_tablet_driver() const override; - virtual void set_current_tablet_driver(const String &p_driver) override; - virtual void initialize_joypads() override {} virtual Date get_date(bool utc) const override; diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 79624bf3bf..6d8d6058eb 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -35,14 +35,14 @@ #include "scene/main/window.h" void AudioStreamPlayer2D::_mix_audio() { - if (!stream_playback.is_valid() || !active || + if (!stream_playback.is_valid() || !active.is_set() || (stream_paused && !stream_paused_fade_out)) { return; } - if (setseek >= 0.0) { - stream_playback->start(setseek); - setseek = -1.0; //reset seek + if (setseek.get() >= 0.0) { + stream_playback->start(setseek.get()); + setseek.set(-1.0); //reset seek } //get data @@ -57,7 +57,8 @@ void AudioStreamPlayer2D::_mix_audio() { stream_playback->mix(buffer, pitch_scale, buffer_size); //write all outputs - for (int i = 0; i < output_count; i++) { + int oc = output_count.get(); + for (int i = 0; i < oc; i++) { Output current = outputs[i]; //see if current output exists, to keep volume ramp @@ -130,14 +131,14 @@ void AudioStreamPlayer2D::_mix_audio() { prev_outputs[i] = current; } - prev_output_count = output_count; + prev_output_count = oc; //stream is no longer active, disable this. if (!stream_playback->is_playing()) { - active = false; + active.clear(); } - output_ready = false; + output_ready.clear(); stream_paused_fade_in = false; stream_paused_fade_out = false; } @@ -168,7 +169,7 @@ void AudioStreamPlayer2D::_notification(int p_what) { if (p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS) { //update anything related to position first, if possible of course - if (!output_ready) { + if (!output_ready.is_set()) { List<Viewport *> viewports; Ref<World2D> world_2d = get_world_2d(); ERR_FAIL_COND(world_2d.is_null()); @@ -240,19 +241,19 @@ void AudioStreamPlayer2D::_notification(int p_what) { } } - output_count = new_output_count; - output_ready = true; + output_count.set(new_output_count); + output_ready.set(); } //start playing if requested - if (setplay >= 0.0) { - setseek = setplay; - active = true; - setplay = -1; + if (setplay.get() >= 0.0) { + setseek.set(setplay.get()); + active.set(); + setplay.set(-1); } //stop playing if no longer active - if (!active) { + if (!active.is_set()) { set_physics_process_internal(false); emit_signal("finished"); } @@ -267,8 +268,8 @@ void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) { if (stream_playback.is_valid()) { stream_playback.unref(); stream.unref(); - active = false; - setseek = -1; + active.clear(); + setseek.set(-1); } if (p_stream.is_valid()) { @@ -311,29 +312,29 @@ void AudioStreamPlayer2D::play(float p_from_pos) { } if (stream_playback.is_valid()) { - setplay = p_from_pos; - output_ready = false; + setplay.set(p_from_pos); + output_ready.clear(); set_physics_process_internal(true); } } void AudioStreamPlayer2D::seek(float p_seconds) { if (stream_playback.is_valid()) { - setseek = p_seconds; + setseek.set(p_seconds); } } void AudioStreamPlayer2D::stop() { if (stream_playback.is_valid()) { - active = false; + active.clear(); set_physics_process_internal(false); - setplay = -1; + setplay.set(-1); } } bool AudioStreamPlayer2D::is_playing() const { if (stream_playback.is_valid()) { - return active || setplay >= 0; + return active.is_set() || setplay.get() >= 0; } return false; @@ -341,8 +342,9 @@ bool AudioStreamPlayer2D::is_playing() const { float AudioStreamPlayer2D::get_playback_position() { if (stream_playback.is_valid()) { - if (setseek >= 0.0) { - return setseek; + float ss = setseek.get(); + if (ss >= 0.0) { + return ss; } return stream_playback->get_playback_position(); } @@ -383,7 +385,7 @@ void AudioStreamPlayer2D::_set_playing(bool p_enable) { } bool AudioStreamPlayer2D::_is_active() const { - return active; + return active.is_set(); } void AudioStreamPlayer2D::_validate_property(PropertyInfo &property) const { diff --git a/scene/2d/audio_stream_player_2d.h b/scene/2d/audio_stream_player_2d.h index 6fb8cc414c..21f524c703 100644 --- a/scene/2d/audio_stream_player_2d.h +++ b/scene/2d/audio_stream_player_2d.h @@ -31,6 +31,7 @@ #ifndef AUDIO_STREAM_PLAYER_2D_H #define AUDIO_STREAM_PLAYER_2D_H +#include "core/templates/safe_refcount.h" #include "scene/2d/node_2d.h" #include "servers/audio/audio_stream.h" #include "servers/audio_server.h" @@ -52,8 +53,8 @@ private: }; Output outputs[MAX_OUTPUTS]; - volatile int output_count = 0; - volatile bool output_ready = false; + SafeNumeric<int> output_count; + SafeFlag output_ready; //these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks) Output prev_outputs[MAX_OUTPUTS]; @@ -63,9 +64,9 @@ private: Ref<AudioStream> stream; Vector<AudioFrame> mix_buffer; - volatile float setseek = -1.0; - volatile bool active = false; - volatile float setplay = -1.0; + SafeNumeric<float> setseek{ -1.0 }; + SafeFlag active; + SafeNumeric<float> setplay{ -1.0 }; float volume_db = 0.0; float pitch_scale = 1.0; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 853e92780b..b4de12b113 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -63,11 +63,11 @@ void Camera2D::_update_scroll() { }; } -void Camera2D::_update_process_mode() { +void Camera2D::_update_process_callback() { if (Engine::get_singleton()->is_editor_hint()) { set_process_internal(false); set_physics_process_internal(false); - } else if (process_mode == CAMERA2D_PROCESS_IDLE) { + } else if (process_callback == CAMERA2D_PROCESS_IDLE) { set_process_internal(true); set_physics_process_internal(false); } else { @@ -157,7 +157,7 @@ Transform2D Camera2D::get_camera_transform() { } if (smoothing_enabled && !Engine::get_singleton()->is_editor_hint()) { - float c = smoothing * (process_mode == CAMERA2D_PROCESS_PHYSICS ? get_physics_process_delta_time() : get_process_delta_time()); + float c = smoothing * (process_callback == CAMERA2D_PROCESS_PHYSICS ? get_physics_process_delta_time() : get_process_delta_time()); smoothed_camera_pos = ((camera_pos - smoothed_camera_pos) * c) + smoothed_camera_pos; ret_camera_pos = smoothed_camera_pos; //camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; @@ -247,7 +247,7 @@ void Camera2D::_notification(int p_what) { add_to_group(group_name); add_to_group(canvas_group_name); - _update_process_mode(); + _update_process_callback(); _update_scroll(); first = true; @@ -375,17 +375,17 @@ bool Camera2D::is_rotating() const { return rotating; } -void Camera2D::set_process_mode(Camera2DProcessMode p_mode) { - if (process_mode == p_mode) { +void Camera2D::set_process_callback(Camera2DProcessCallback p_mode) { + if (process_callback == p_mode) { return; } - process_mode = p_mode; - _update_process_mode(); + process_callback = p_mode; + _update_process_callback(); } -Camera2D::Camera2DProcessMode Camera2D::get_process_mode() const { - return process_mode; +Camera2D::Camera2DProcessCallback Camera2D::get_process_callback() const { + return process_callback; } void Camera2D::_make_current(Object *p_which) { @@ -651,8 +651,8 @@ void Camera2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_scroll"), &Camera2D::_update_scroll); - ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &Camera2D::set_process_mode); - ClassDB::bind_method(D_METHOD("get_process_mode"), &Camera2D::get_process_mode); + ClassDB::bind_method(D_METHOD("set_process_callback", "mode"), &Camera2D::set_process_callback); + ClassDB::bind_method(D_METHOD("get_process_callback"), &Camera2D::get_process_callback); ClassDB::bind_method(D_METHOD("_set_current", "current"), &Camera2D::_set_current); ClassDB::bind_method(D_METHOD("is_current"), &Camera2D::is_current); @@ -714,7 +714,7 @@ void Camera2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "current"), "_set_current", "is_current"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "zoom"), "set_zoom", "get_zoom"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_viewport", PROPERTY_HINT_RESOURCE_TYPE, "Viewport", 0), "set_custom_viewport", "get_custom_viewport"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_callback", "get_process_callback"); ADD_GROUP("Limit", "limit_"); ADD_PROPERTYI(PropertyInfo(Variant::INT, "limit_left"), "set_limit", "get_limit", SIDE_LEFT); diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index 3a7d01901d..252d2686fc 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -43,7 +43,7 @@ public: ANCHOR_MODE_DRAG_CENTER }; - enum Camera2DProcessMode { + enum Camera2DProcessCallback { CAMERA2D_PROCESS_PHYSICS, CAMERA2D_PROCESS_IDLE }; @@ -79,7 +79,7 @@ protected: bool drag_vertical_offset_changed = false; Point2 camera_screen_center; - void _update_process_mode(); + void _update_process_callback(); void _update_scroll(); void _make_current(Object *p_which); @@ -91,7 +91,7 @@ protected: bool limit_drawing_enabled = false; bool margin_drawing_enabled = false; - Camera2DProcessMode process_mode = CAMERA2D_PROCESS_IDLE; + Camera2DProcessCallback process_callback = CAMERA2D_PROCESS_IDLE; Size2 _get_camera_screen_size() const; @@ -137,8 +137,8 @@ public: void set_follow_smoothing(float p_speed); float get_follow_smoothing() const; - void set_process_mode(Camera2DProcessMode p_mode); - Camera2DProcessMode get_process_mode() const; + void set_process_callback(Camera2DProcessCallback p_mode); + Camera2DProcessCallback get_process_callback() const; void make_current(); void clear_current(); @@ -170,6 +170,6 @@ public: }; VARIANT_ENUM_CAST(Camera2D::AnchorMode); -VARIANT_ENUM_CAST(Camera2D::Camera2DProcessMode); +VARIANT_ENUM_CAST(Camera2D::Camera2DProcessCallback); #endif // CAMERA_2D_H diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 4d1d274542..93949f741b 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -110,6 +110,7 @@ void CollisionShape2D::_notification(int p_what) { draw_col.r = g; draw_col.g = g; draw_col.b = g; + draw_col.a *= 0.5; } shape->draw(get_canvas_item(), draw_col); diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 2959ea1a36..37eb45c21d 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -116,6 +116,7 @@ Vector<Vector2> Line2D::get_points() const { } void Line2D::set_point_position(int i, Vector2 p_pos) { + ERR_FAIL_INDEX(i, _points.size()); _points.set(i, p_pos); update(); } diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index fccf126dad..9d6868a1b2 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -129,8 +129,11 @@ void TouchScreenButton::_notification(int p_what) { if (shape.is_valid()) { Color draw_col = get_tree()->get_debug_collisions_color(); - Vector2 size = texture.is_null() ? shape->get_rect().size : texture->get_size(); - Vector2 pos = shape_centered ? size * 0.5f : Vector2(); + Vector2 pos; + if (shape_centered && texture.is_valid()) { + pos = texture->get_size() * 0.5; + } + draw_set_transform_matrix(get_canvas_transform().translated(pos)); shape->draw(get_canvas_item(), draw_col); } @@ -251,9 +254,12 @@ bool TouchScreenButton::_is_point_inside(const Point2 &p_point) { if (shape.is_valid()) { check_rect = false; - Vector2 size = texture.is_null() ? shape->get_rect().size : texture->get_size(); - Transform2D xform = shape_centered ? Transform2D().translated(size * 0.5f) : Transform2D(); - touched = shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5, 0.5))); + Vector2 pos; + if (shape_centered && texture.is_valid()) { + pos = texture->get_size() * 0.5; + } + + touched = shape->collide(Transform2D().translated(pos), unit_rect, Transform2D(0, coord + Vector2(0.5, 0.5))); } if (bitmask.is_valid()) { diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index dd77221a3f..72392be5bd 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -138,15 +138,15 @@ void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tig } void AudioStreamPlayer3D::_mix_audio() { - if (!stream_playback.is_valid() || !active || + if (!stream_playback.is_valid() || !active.is_set() || (stream_paused && !stream_paused_fade_out)) { return; } bool started = false; - if (setseek >= 0.0) { - stream_playback->start(setseek); - setseek = -1.0; //reset seek + if (setseek.get() >= 0.0) { + stream_playback->start(setseek.get()); + setseek.set(-1.0); //reset seek started = true; } @@ -160,14 +160,14 @@ void AudioStreamPlayer3D::_mix_audio() { } // Mix if we're not paused or we're fading out - if ((output_count > 0 || out_of_range_mode == OUT_OF_RANGE_MIX)) { + if ((output_count.get() > 0 || out_of_range_mode == OUT_OF_RANGE_MIX)) { float output_pitch_scale = 0.0; - if (output_count) { + if (output_count.get()) { //used for doppler, not realistic but good enough - for (int i = 0; i < output_count; i++) { + for (int i = 0; i < output_count.get(); i++) { output_pitch_scale += outputs[i].pitch_scale; } - output_pitch_scale /= float(output_count); + output_pitch_scale /= float(output_count.get()); } else { output_pitch_scale = 1.0; } @@ -176,7 +176,7 @@ void AudioStreamPlayer3D::_mix_audio() { } //write all outputs - for (int i = 0; i < output_count; i++) { + for (int i = 0; i < output_count.get(); i++) { Output current = outputs[i]; //see if current output exists, to keep volume ramp @@ -285,14 +285,14 @@ void AudioStreamPlayer3D::_mix_audio() { prev_outputs[i] = current; } - prev_output_count = output_count; + prev_output_count = output_count.get(); //stream is no longer active, disable this. if (!stream_playback->is_playing()) { - active = false; + active.clear(); } - output_ready = false; + output_ready.clear(); stream_paused_fade_in = false; stream_paused_fade_out = false; } @@ -360,7 +360,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { if (p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS) { //update anything related to position first, if possible of course - if (!output_ready) { + if (!output_ready.is_set()) { Vector3 linear_velocity; //compute linear velocity for doppler @@ -596,19 +596,19 @@ void AudioStreamPlayer3D::_notification(int p_what) { } } - output_count = new_output_count; - output_ready = true; + output_count.set(new_output_count); + output_ready.set(); } //start playing if requested - if (setplay >= 0.0) { - setseek = setplay; - active = true; - setplay = -1; + if (setplay.get() >= 0.0) { + setseek.set(setplay.get()); + active.set(); + setplay.set(-1); } //stop playing if no longer active - if (!active) { + if (!active.is_set()) { set_physics_process_internal(false); emit_signal("finished"); } @@ -623,8 +623,8 @@ void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { if (stream_playback.is_valid()) { stream_playback.unref(); stream.unref(); - active = false; - setseek = -1; + active.clear(); + setseek.set(-1); } if (p_stream.is_valid()) { @@ -683,29 +683,29 @@ void AudioStreamPlayer3D::play(float p_from_pos) { } if (stream_playback.is_valid()) { - setplay = p_from_pos; - output_ready = false; + setplay.set(p_from_pos); + output_ready.clear(); set_physics_process_internal(true); } } void AudioStreamPlayer3D::seek(float p_seconds) { if (stream_playback.is_valid()) { - setseek = p_seconds; + setseek.set(p_seconds); } } void AudioStreamPlayer3D::stop() { if (stream_playback.is_valid()) { - active = false; + active.clear(); set_physics_process_internal(false); - setplay = -1; + setplay.set(-1); } } bool AudioStreamPlayer3D::is_playing() const { if (stream_playback.is_valid()) { - return active || setplay >= 0; + return active.is_set() || setplay.get() >= 0; } return false; @@ -713,8 +713,9 @@ bool AudioStreamPlayer3D::is_playing() const { float AudioStreamPlayer3D::get_playback_position() { if (stream_playback.is_valid()) { - if (setseek >= 0.0) { - return setseek; + float ss = setseek.get(); + if (ss >= 0.0) { + return ss; } return stream_playback->get_playback_position(); } @@ -755,7 +756,7 @@ void AudioStreamPlayer3D::_set_playing(bool p_enable) { } bool AudioStreamPlayer3D::_is_active() const { - return active; + return active.is_set(); } void AudioStreamPlayer3D::_validate_property(PropertyInfo &property) const { diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index 33ed758749..70c535bd89 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -31,6 +31,7 @@ #ifndef AUDIO_STREAM_PLAYER_3D_H #define AUDIO_STREAM_PLAYER_3D_H +#include "core/templates/safe_refcount.h" #include "scene/3d/node_3d.h" #include "scene/3d/velocity_tracker_3d.h" #include "servers/audio/audio_filter_sw.h" @@ -80,8 +81,8 @@ private: }; Output outputs[MAX_OUTPUTS]; - volatile int output_count = 0; - volatile bool output_ready = false; + SafeNumeric<int> output_count; + SafeFlag output_ready; //these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks) Output prev_outputs[MAX_OUTPUTS]; @@ -91,9 +92,9 @@ private: Ref<AudioStream> stream; Vector<AudioFrame> mix_buffer; - volatile float setseek = -1.0; - volatile bool active = false; - volatile float setplay = -1.0; + SafeNumeric<float> setseek{ -1.0 }; + SafeFlag active; + SafeNumeric<float> setplay{ -1.0 }; AttenuationModel attenuation_model = ATTENUATION_INVERSE_DISTANCE; float unit_db = 0.0; diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index 75907d4a84..578ea823f0 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -195,7 +195,7 @@ void BakedLightmapData::_bind_methods() { ClassDB::bind_method(D_METHOD("set_uses_spherical_harmonics", "uses_spherical_harmonics"), &BakedLightmapData::set_uses_spherical_harmonics); ClassDB::bind_method(D_METHOD("is_using_spherical_harmonics"), &BakedLightmapData::is_using_spherical_harmonics); - ClassDB::bind_method(D_METHOD("add_user", "path", "lightmap", "offset"), &BakedLightmapData::add_user); + ClassDB::bind_method(D_METHOD("add_user", "path", "uv_scale", "slice_index", "sub_instance"), &BakedLightmapData::add_user); ClassDB::bind_method(D_METHOD("get_user_count"), &BakedLightmapData::get_user_count); ClassDB::bind_method(D_METHOD("get_user_path", "user_idx"), &BakedLightmapData::get_user_path); ClassDB::bind_method(D_METHOD("clear_users"), &BakedLightmapData::clear_users); diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index e9e93884a5..f0623c625e 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -673,17 +673,17 @@ float ClippedCamera3D::get_margin() const { return margin; } -void ClippedCamera3D::set_process_mode(ProcessMode p_mode) { - if (process_mode == p_mode) { +void ClippedCamera3D::set_process_callback(ClipProcessCallback p_mode) { + if (process_callback == p_mode) { return; } - process_mode = p_mode; - set_process_internal(process_mode == CLIP_PROCESS_IDLE); - set_physics_process_internal(process_mode == CLIP_PROCESS_PHYSICS); + process_callback = p_mode; + set_process_internal(process_callback == CLIP_PROCESS_IDLE); + set_physics_process_internal(process_callback == CLIP_PROCESS_PHYSICS); } -ClippedCamera3D::ProcessMode ClippedCamera3D::get_process_mode() const { - return process_mode; +ClippedCamera3D::ClipProcessCallback ClippedCamera3D::get_process_callback() const { + return process_callback; } Transform ClippedCamera3D::get_camera_transform() const { @@ -828,8 +828,8 @@ void ClippedCamera3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_margin", "margin"), &ClippedCamera3D::set_margin); ClassDB::bind_method(D_METHOD("get_margin"), &ClippedCamera3D::get_margin); - ClassDB::bind_method(D_METHOD("set_process_mode", "process_mode"), &ClippedCamera3D::set_process_mode); - ClassDB::bind_method(D_METHOD("get_process_mode"), &ClippedCamera3D::get_process_mode); + ClassDB::bind_method(D_METHOD("set_process_callback", "process_callback"), &ClippedCamera3D::set_process_callback); + ClassDB::bind_method(D_METHOD("get_process_callback"), &ClippedCamera3D::get_process_callback); ClassDB::bind_method(D_METHOD("set_collision_mask", "mask"), &ClippedCamera3D::set_collision_mask); ClassDB::bind_method(D_METHOD("get_collision_mask"), &ClippedCamera3D::get_collision_mask); @@ -854,7 +854,7 @@ void ClippedCamera3D::_bind_methods() { ClassDB::bind_method(D_METHOD("clear_exceptions"), &ClippedCamera3D::clear_exceptions); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_margin", "get_margin"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_mode", "get_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_process_callback", "get_process_callback"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); ADD_GROUP("Clip To", "clip_to"); diff --git a/scene/3d/camera_3d.h b/scene/3d/camera_3d.h index 06bb55e23c..cea61e4db8 100644 --- a/scene/3d/camera_3d.h +++ b/scene/3d/camera_3d.h @@ -186,13 +186,13 @@ class ClippedCamera3D : public Camera3D { GDCLASS(ClippedCamera3D, Camera3D); public: - enum ProcessMode { + enum ClipProcessCallback { CLIP_PROCESS_PHYSICS, CLIP_PROCESS_IDLE, }; private: - ProcessMode process_mode = CLIP_PROCESS_PHYSICS; + ClipProcessCallback process_callback = CLIP_PROCESS_PHYSICS; RID pyramid_shape; float margin = 0.0; float clip_offset = 0.0; @@ -219,8 +219,8 @@ public: void set_margin(float p_margin); float get_margin() const; - void set_process_mode(ProcessMode p_mode); - ProcessMode get_process_mode() const; + void set_process_callback(ClipProcessCallback p_mode); + ClipProcessCallback get_process_callback() const; void set_collision_mask(uint32_t p_mask); uint32_t get_collision_mask() const; @@ -240,5 +240,5 @@ public: ~ClippedCamera3D(); }; -VARIANT_ENUM_CAST(ClippedCamera3D::ProcessMode); +VARIANT_ENUM_CAST(ClippedCamera3D::ClipProcessCallback); #endif diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 979c6424b8..d22d7ff3ab 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -1074,7 +1074,7 @@ void CPUParticles3D::_update_particle_data_buffer() { ptr += 20; } - can_update = true; + can_update.set(); } void CPUParticles3D::_set_redraw(bool p_redraw) { @@ -1103,9 +1103,9 @@ void CPUParticles3D::_set_redraw(bool p_redraw) { void CPUParticles3D::_update_render_thread() { MutexLock lock(update_mutex); - if (can_update) { + if (can_update.is_set()) { RS::get_singleton()->multimesh_set_buffer(multimesh, particle_data); - can_update = false; //wait for next time + can_update.clear(); //wait for next time } } @@ -1167,7 +1167,7 @@ void CPUParticles3D::_notification(int p_what) { ptr += 20; } - can_update = true; + can_update.set(); } } } @@ -1468,6 +1468,21 @@ CPUParticles3D::CPUParticles3D() { set_param(PARAM_HUE_VARIATION, 0); set_param(PARAM_ANIM_SPEED, 0); set_param(PARAM_ANIM_OFFSET, 0); + set_emission_shape(EMISSION_SHAPE_POINT); + set_emission_sphere_radius(1); + set_emission_box_extents(Vector3(1, 1, 1)); + + set_gravity(Vector3(0, -9.8, 0)); + + for (int i = 0; i < PARAM_MAX; i++) { + set_param_randomness(Parameter(i), 0); + } + + for (int i = 0; i < PARTICLE_FLAG_MAX; i++) { + particle_flags[i] = false; + } + + set_color(Color(1, 1, 1, 1)); } CPUParticles3D::~CPUParticles3D() { diff --git a/scene/3d/cpu_particles_3d.h b/scene/3d/cpu_particles_3d.h index 4af959a7bf..10ac32622d 100644 --- a/scene/3d/cpu_particles_3d.h +++ b/scene/3d/cpu_particles_3d.h @@ -32,6 +32,7 @@ #define CPU_PARTICLES_H #include "core/templates/rid.h" +#include "core/templates/safe_refcount.h" #include "scene/3d/visual_instance_3d.h" class CPUParticles3D : public GeometryInstance3D { @@ -142,7 +143,7 @@ private: Transform inv_emission_transform; - volatile bool can_update = false; + SafeFlag can_update; DrawOrder draw_order = DRAW_ORDER_INDEX; diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 71de3635f9..d46f24752e 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -317,7 +317,7 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *p_st // stopped, invalid state String node_name = start_request; start_request = StringName(); //clear start request - ERR_FAIL_V_MSG(0, "Can't travel to '" + node_name + "' if state machine is not playing."); + ERR_FAIL_V_MSG(0, "Can't travel to '" + node_name + "' if state machine is not playing. Maybe you need to enable Autoplay on Load for one of the nodes in your state machine or call .start() first?"); } } else { if (!_travel(p_state_machine, start_request)) { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index c6fa55b76e..2c19307c52 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -206,7 +206,7 @@ void AnimationPlayer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (animation_process_mode == ANIMATION_PROCESS_PHYSICS) { + if (process_callback == ANIMATION_PROCESS_PHYSICS) { break; } @@ -215,7 +215,7 @@ void AnimationPlayer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { - if (animation_process_mode == ANIMATION_PROCESS_IDLE) { + if (process_callback == ANIMATION_PROCESS_IDLE) { break; } @@ -1403,8 +1403,8 @@ bool AnimationPlayer::is_reset_on_save_enabled() const { return reset_on_save; } -void AnimationPlayer::set_animation_process_mode(AnimationProcessMode p_mode) { - if (animation_process_mode == p_mode) { +void AnimationPlayer::set_process_callback(AnimationProcessCallback p_mode) { + if (process_callback == p_mode) { return; } @@ -1412,14 +1412,14 @@ void AnimationPlayer::set_animation_process_mode(AnimationProcessMode p_mode) { if (pr) { _set_process(false); } - animation_process_mode = p_mode; + process_callback = p_mode; if (pr) { _set_process(true); } } -AnimationPlayer::AnimationProcessMode AnimationPlayer::get_animation_process_mode() const { - return animation_process_mode; +AnimationPlayer::AnimationProcessCallback AnimationPlayer::get_process_callback() const { + return process_callback; } void AnimationPlayer::set_method_call_mode(AnimationMethodCallMode p_mode) { @@ -1435,7 +1435,7 @@ void AnimationPlayer::_set_process(bool p_process, bool p_force) { return; } - switch (animation_process_mode) { + switch (process_callback) { case ANIMATION_PROCESS_PHYSICS: set_physics_process_internal(p_process && active); break; @@ -1637,8 +1637,8 @@ void AnimationPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("clear_caches"), &AnimationPlayer::clear_caches); - ClassDB::bind_method(D_METHOD("set_animation_process_mode", "mode"), &AnimationPlayer::set_animation_process_mode); - ClassDB::bind_method(D_METHOD("get_animation_process_mode"), &AnimationPlayer::get_animation_process_mode); + ClassDB::bind_method(D_METHOD("set_process_callback", "mode"), &AnimationPlayer::set_process_callback); + ClassDB::bind_method(D_METHOD("get_process_callback"), &AnimationPlayer::get_process_callback); ClassDB::bind_method(D_METHOD("set_method_call_mode", "mode"), &AnimationPlayer::set_method_call_mode); ClassDB::bind_method(D_METHOD("get_method_call_mode"), &AnimationPlayer::get_method_call_mode); @@ -1658,7 +1658,7 @@ void AnimationPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "current_animation_position", PROPERTY_HINT_NONE, "", 0), "", "get_current_animation_position"); ADD_GROUP("Playback Options", "playback_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_animation_process_mode", "get_animation_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_process_callback", "get_process_callback"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), "set_default_blend_time", "get_default_blend_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playback_active", PROPERTY_HINT_NONE, "", 0), "set_active", "is_active"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index f2774cb395..2a1821c215 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -64,7 +64,7 @@ class AnimationPlayer : public Node { OBJ_CATEGORY("Animation Nodes"); public: - enum AnimationProcessMode { + enum AnimationProcessCallback { ANIMATION_PROCESS_PHYSICS, ANIMATION_PROCESS_IDLE, ANIMATION_PROCESS_MANUAL, @@ -206,7 +206,7 @@ private: String autoplay; bool reset_on_save = true; - AnimationProcessMode animation_process_mode = ANIMATION_PROCESS_IDLE; + AnimationProcessCallback process_callback = ANIMATION_PROCESS_IDLE; AnimationMethodCallMode method_call_mode = ANIMATION_METHOD_CALL_DEFERRED; bool processing = false; bool active = true; @@ -298,8 +298,8 @@ public: void set_reset_on_save_enabled(bool p_enabled); bool is_reset_on_save_enabled() const; - void set_animation_process_mode(AnimationProcessMode p_mode); - AnimationProcessMode get_animation_process_mode() const; + void set_process_callback(AnimationProcessCallback p_mode); + AnimationProcessCallback get_process_callback() const; void set_method_call_mode(AnimationMethodCallMode p_mode); AnimationMethodCallMode get_method_call_mode() const; @@ -328,7 +328,7 @@ public: ~AnimationPlayer(); }; -VARIANT_ENUM_CAST(AnimationPlayer::AnimationProcessMode); +VARIANT_ENUM_CAST(AnimationPlayer::AnimationProcessCallback); VARIANT_ENUM_CAST(AnimationPlayer::AnimationMethodCallMode); #endif diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index c0da35d803..26a13f33c9 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -473,7 +473,7 @@ void AnimationTree::set_active(bool p_active) { active = p_active; started = active; - if (process_mode == ANIMATION_PROCESS_IDLE) { + if (process_callback == ANIMATION_PROCESS_IDLE) { set_process_internal(active); } else { set_physics_process_internal(active); @@ -494,8 +494,8 @@ bool AnimationTree::is_active() const { return active; } -void AnimationTree::set_process_mode(AnimationProcessMode p_mode) { - if (process_mode == p_mode) { +void AnimationTree::set_process_callback(AnimationProcessCallback p_mode) { + if (process_callback == p_mode) { return; } @@ -504,15 +504,15 @@ void AnimationTree::set_process_mode(AnimationProcessMode p_mode) { set_active(false); } - process_mode = p_mode; + process_callback = p_mode; if (was_active) { set_active(true); } } -AnimationTree::AnimationProcessMode AnimationTree::get_process_mode() const { - return process_mode; +AnimationTree::AnimationProcessCallback AnimationTree::get_process_callback() const { + return process_callback; } void AnimationTree::_node_removed(Node *p_node) { @@ -1234,11 +1234,11 @@ void AnimationTree::advance(float p_time) { } void AnimationTree::_notification(int p_what) { - if (active && p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS && process_mode == ANIMATION_PROCESS_PHYSICS) { + if (active && p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS && process_callback == ANIMATION_PROCESS_PHYSICS) { _process_graph(get_physics_process_delta_time()); } - if (active && p_what == NOTIFICATION_INTERNAL_PROCESS && process_mode == ANIMATION_PROCESS_IDLE) { + if (active && p_what == NOTIFICATION_INTERNAL_PROCESS && process_callback == ANIMATION_PROCESS_IDLE) { _process_graph(get_process_delta_time()); } @@ -1471,8 +1471,8 @@ void AnimationTree::_bind_methods() { ClassDB::bind_method(D_METHOD("set_tree_root", "root"), &AnimationTree::set_tree_root); ClassDB::bind_method(D_METHOD("get_tree_root"), &AnimationTree::get_tree_root); - ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &AnimationTree::set_process_mode); - ClassDB::bind_method(D_METHOD("get_process_mode"), &AnimationTree::get_process_mode); + ClassDB::bind_method(D_METHOD("set_process_callback", "mode"), &AnimationTree::set_process_callback); + ClassDB::bind_method(D_METHOD("get_process_callback"), &AnimationTree::get_process_callback); ClassDB::bind_method(D_METHOD("set_animation_player", "root"), &AnimationTree::set_animation_player); ClassDB::bind_method(D_METHOD("get_animation_player"), &AnimationTree::get_animation_player); @@ -1491,7 +1491,7 @@ void AnimationTree::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tree_root", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode"), "set_tree_root", "get_tree_root"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "anim_player", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "AnimationPlayer"), "set_animation_player", "get_animation_player"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "is_active"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_process_mode", "get_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle,Manual"), "set_process_callback", "get_process_callback"); ADD_GROUP("Root Motion", "root_motion_"); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_motion_track"), "set_root_motion_track", "get_root_motion_track"); diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h index 0f78b1f0e2..1c5aec26ab 100644 --- a/scene/animation/animation_tree.h +++ b/scene/animation/animation_tree.h @@ -163,7 +163,7 @@ class AnimationTree : public Node { GDCLASS(AnimationTree, Node); public: - enum AnimationProcessMode { + enum AnimationProcessCallback { ANIMATION_PROCESS_PHYSICS, ANIMATION_PROCESS_IDLE, ANIMATION_PROCESS_MANUAL, @@ -238,7 +238,7 @@ private: Ref<AnimationNode> root; - AnimationProcessMode process_mode = ANIMATION_PROCESS_IDLE; + AnimationProcessCallback process_callback = ANIMATION_PROCESS_IDLE; bool active = false; NodePath animation_player; @@ -294,8 +294,8 @@ public: void set_active(bool p_active); bool is_active() const; - void set_process_mode(AnimationProcessMode p_mode); - AnimationProcessMode get_process_mode() const; + void set_process_callback(AnimationProcessCallback p_mode); + AnimationProcessCallback get_process_callback() const; void set_animation_player(const NodePath &p_player); NodePath get_animation_player() const; @@ -320,6 +320,6 @@ public: ~AnimationTree(); }; -VARIANT_ENUM_CAST(AnimationTree::AnimationProcessMode) +VARIANT_ENUM_CAST(AnimationTree::AnimationProcessCallback) #endif // ANIMATION_GRAPH_PLAYER_H diff --git a/scene/animation/root_motion_view.cpp b/scene/animation/root_motion_view.cpp index a4a1b02a4c..9ee1f32581 100644 --- a/scene/animation/root_motion_view.cpp +++ b/scene/animation/root_motion_view.cpp @@ -89,12 +89,12 @@ void RootMotionView::_notification(int p_what) { AnimationTree *tree = Object::cast_to<AnimationTree>(node); if (tree && tree->is_active() && tree->get_root_motion_track() != NodePath()) { - if (is_processing_internal() && tree->get_process_mode() == AnimationTree::ANIMATION_PROCESS_PHYSICS) { + if (is_processing_internal() && tree->get_process_callback() == AnimationTree::ANIMATION_PROCESS_PHYSICS) { set_process_internal(false); set_physics_process_internal(true); } - if (is_physics_processing_internal() && tree->get_process_mode() == AnimationTree::ANIMATION_PROCESS_IDLE) { + if (is_physics_processing_internal() && tree->get_process_callback() == AnimationTree::ANIMATION_PROCESS_IDLE) { set_process_internal(true); set_physics_process_internal(false); } diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index ec0a4b8696..2853a8b9d9 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -99,37 +99,37 @@ void AudioStreamPlayer::_mix_audio() { use_fadeout = false; } - if (!stream_playback.is_valid() || !active || + if (!stream_playback.is_valid() || !active.is_set() || (stream_paused && !stream_paused_fade)) { return; } if (stream_paused) { - if (stream_paused_fade) { + if (stream_paused_fade && stream_playback->is_playing()) { _mix_internal(true); stream_paused_fade = false; } return; } - if (setstop) { + if (setstop.is_set()) { _mix_internal(true); stream_playback->stop(); - setstop = false; + setstop.clear(); } - if (setseek >= 0.0 && !stop_has_priority) { + if (setseek.get() >= 0.0 && !stop_has_priority.is_set()) { if (stream_playback->is_playing()) { //fade out to avoid pops _mix_internal(true); } - stream_playback->start(setseek); - setseek = -1.0; //reset seek + stream_playback->start(setseek.get()); + setseek.set(-1.0); //reset seek mix_volume_db = volume_db; //reset ramp } - stop_has_priority = false; + stop_has_priority.clear(); _mix_internal(false); } @@ -143,8 +143,8 @@ void AudioStreamPlayer::_notification(int p_what) { } if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (!active || (setseek < 0 && !stream_playback->is_playing())) { - active = false; + if (!active.is_set() || (setseek.get() < 0 && !stream_playback->is_playing())) { + active.clear(); set_process_internal(false); emit_signal("finished"); } @@ -169,7 +169,7 @@ void AudioStreamPlayer::_notification(int p_what) { void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { AudioServer::get_singleton()->lock(); - if (active && stream_playback.is_valid() && !stream_paused) { + if (active.is_set() && stream_playback.is_valid() && !stream_paused) { //changing streams out of the blue is not a great idea, but at least //lets try to somehow avoid a click @@ -196,9 +196,9 @@ void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { if (stream_playback.is_valid()) { stream_playback.unref(); stream.unref(); - active = false; - setseek = -1; - setstop = false; + active.clear(); + setseek.set(-1); + setstop.clear(); } if (p_stream.is_valid()) { @@ -237,29 +237,29 @@ float AudioStreamPlayer::get_pitch_scale() const { void AudioStreamPlayer::play(float p_from_pos) { if (stream_playback.is_valid()) { //mix_volume_db = volume_db; do not reset volume ramp here, can cause clicks - setseek = p_from_pos; - stop_has_priority = false; - active = true; + setseek.set(p_from_pos); + stop_has_priority.clear(); + active.set(); set_process_internal(true); } } void AudioStreamPlayer::seek(float p_seconds) { if (stream_playback.is_valid()) { - setseek = p_seconds; + setseek.set(p_seconds); } } void AudioStreamPlayer::stop() { - if (stream_playback.is_valid() && active) { - setstop = true; - stop_has_priority = true; + if (stream_playback.is_valid() && active.is_set()) { + setstop.set(); + stop_has_priority.set(); } } bool AudioStreamPlayer::is_playing() const { if (stream_playback.is_valid()) { - return active && !setstop; //&& stream_playback->is_playing(); + return active.is_set() && !setstop.is_set(); //&& stream_playback->is_playing(); } return false; @@ -267,8 +267,9 @@ bool AudioStreamPlayer::is_playing() const { float AudioStreamPlayer::get_playback_position() { if (stream_playback.is_valid()) { - if (setseek >= 0.0) { - return setseek; + float ss = setseek.get(); + if (ss >= 0.0) { + return ss; } return stream_playback->get_playback_position(); } @@ -317,7 +318,7 @@ void AudioStreamPlayer::_set_playing(bool p_enable) { } bool AudioStreamPlayer::_is_active() const { - return active; + return active.is_set(); } void AudioStreamPlayer::set_stream_paused(bool p_pause) { diff --git a/scene/audio/audio_stream_player.h b/scene/audio/audio_stream_player.h index ab98d41302..aa8d088be5 100644 --- a/scene/audio/audio_stream_player.h +++ b/scene/audio/audio_stream_player.h @@ -31,6 +31,7 @@ #ifndef AUDIO_STREAM_PLAYER_H #define AUDIO_STREAM_PLAYER_H +#include "core/templates/safe_refcount.h" #include "scene/main/node.h" #include "servers/audio/audio_stream.h" @@ -51,10 +52,10 @@ private: Vector<AudioFrame> fadeout_buffer; bool use_fadeout = false; - volatile float setseek = -1.0; - volatile bool active = false; - volatile bool setstop = false; - volatile bool stop_has_priority = false; + SafeNumeric<float> setseek{ -1.0 }; + SafeFlag active; + SafeFlag setstop; + SafeFlag stop_has_priority; float mix_volume_db = 0.0; float pitch_scale = 1.0; diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index b82c078a2d..e8586b72e9 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -166,10 +166,13 @@ void ColorPicker::_value_changed(double) { } if (hsv_mode_enabled) { - color.set_hsv(scroll[0]->get_value() / 360.0, - scroll[1]->get_value() / 100.0, - scroll[2]->get_value() / 100.0, - scroll[3]->get_value() / 255.0); + h = scroll[0]->get_value() / 360.0; + s = scroll[1]->get_value() / 100.0; + v = scroll[2]->get_value() / 100.0; + color.set_hsv(h, s, v, scroll[3]->get_value() / 255.0); + + last_hsv = color; + } else { for (int i = 0; i < 4; i++) { color.components[i] = scroll[i]->get_value() / (raw_mode_enabled ? 1.0 : 255.0); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 0e28c942f1..0c104bf318 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -456,6 +456,10 @@ bool Control::is_layout_rtl() const { } } +void Control::_clear_size_warning() { + data.size_warning = false; +} + //moved theme configuration here, so controls can set up even if still not inside active scene void Control::add_child_notify(Node *p_child) { @@ -503,7 +507,9 @@ void Control::_notification(int p_notification) { } break; case NOTIFICATION_EXIT_TREE: { get_viewport()->_gui_remove_control(this); - + } break; + case NOTIFICATION_READY: { + connect("ready", callable_mp(this, &Control::_clear_size_warning), varray(), CONNECT_DEFERRED | CONNECT_ONESHOT); } break; case NOTIFICATION_ENTER_CANVAS: { @@ -1702,6 +1708,11 @@ void Control::set_rect(const Rect2 &p_rect) { } void Control::_set_size(const Size2 &p_size) { +#ifdef DEBUG_ENABLED + if (data.size_warning) { + WARN_PRINT("Adjusting the size of Control nodes before they are fully initialized is unreliable. Consider deferring it with set_deferred()."); + } +#endif set_size(p_size); } diff --git a/scene/gui/control.h b/scene/gui/control.h index 8b24781287..8981e05872 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -182,6 +182,7 @@ private: float rotation = 0.0; Vector2 scale = Vector2(1, 1); Vector2 pivot_offset; + bool size_warning = true; int h_size_flags = SIZE_FILL; int v_size_flags = SIZE_FILL; @@ -235,6 +236,7 @@ private: void _update_minimum_size(); + void _clear_size_warning(); void _update_scroll(); void _compute_offsets(Rect2 p_rect, const float p_anchors[4], float (&r_offsets)[4]); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 6e61950f10..70015bcf88 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1330,25 +1330,17 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { } } - Ref<InputEventKey> k = p_ev; - - if (k.is_valid()) { - if (k->get_keycode() == KEY_D && k->is_pressed() && k->get_command()) { + if (p_ev->is_pressed()) { + if (p_ev->is_action("ui_graph_duplicate")) { emit_signal("duplicate_nodes_request"); accept_event(); - } - - if (k->get_keycode() == KEY_C && k->is_pressed() && k->get_command()) { + } else if (p_ev->is_action("ui_copy")) { emit_signal("copy_nodes_request"); accept_event(); - } - - if (k->get_keycode() == KEY_V && k->is_pressed() && k->get_command()) { + } else if (p_ev->is_action("ui_paste")) { emit_signal("paste_nodes_request"); accept_event(); - } - - if (k->get_keycode() == KEY_DELETE && k->is_pressed()) { + } else if (p_ev->is_action("ui_graph_delete")) { emit_signal("delete_nodes_request"); accept_event(); } diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 2997a6ebe9..b98caf3562 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -566,6 +566,7 @@ float Label::get_percent_visible() const { } void Label::set_lines_skipped(int p_lines) { + ERR_FAIL_COND(p_lines < 0); lines_skipped = p_lines; _update_visible(); update(); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 5bd9259a64..ba08aae8e3 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -30,6 +30,7 @@ #include "line_edit.h" +#include "core/input/input_map.h" #include "core/object/message_queue.h" #include "core/os/keyboard.h" #include "core/os/os.h" @@ -44,6 +45,175 @@ #endif #include "scene/main/window.h" +void LineEdit::_swap_current_input_direction() { + if (input_direction == TEXT_DIRECTION_LTR) { + input_direction = TEXT_DIRECTION_RTL; + } else { + input_direction = TEXT_DIRECTION_LTR; + } + set_cursor_position(get_cursor_position()); + update(); +} + +void LineEdit::_move_cursor_left(bool p_select, bool p_move_by_word) { + if (selection.enabled && !p_select) { + set_cursor_position(selection.begin); + deselect(); + return; + } + + shift_selection_check_pre(p_select); + + if (p_move_by_word) { + int cc = cursor_pos; + + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); + for (int i = words.size() - 1; i >= 0; i--) { + if (words[i].x < cc) { + cc = words[i].x; + break; + } + } + + set_cursor_position(cc); + } else { + if (mid_grapheme_caret_enabled) { + set_cursor_position(get_cursor_position() - 1); + } else { + set_cursor_position(TS->shaped_text_prev_grapheme_pos(text_rid, get_cursor_position())); + } + } + + shift_selection_check_post(p_select); +} + +void LineEdit::_move_cursor_right(bool p_select, bool p_move_by_word) { + if (selection.enabled && !p_select) { + set_cursor_position(selection.end); + deselect(); + return; + } + + shift_selection_check_pre(p_select); + + if (p_move_by_word) { + int cc = cursor_pos; + + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); + for (int i = 0; i < words.size(); i++) { + if (words[i].y > cc) { + cc = words[i].y; + break; + } + } + + set_cursor_position(cc); + } else { + if (mid_grapheme_caret_enabled) { + set_cursor_position(get_cursor_position() + 1); + } else { + set_cursor_position(TS->shaped_text_next_grapheme_pos(text_rid, get_cursor_position())); + } + } + + shift_selection_check_post(p_select); +} + +void LineEdit::_move_cursor_start(bool p_select) { + shift_selection_check_pre(p_select); + set_cursor_position(0); + shift_selection_check_post(p_select); +} + +void LineEdit::_move_cursor_end(bool p_select) { + shift_selection_check_pre(p_select); + set_cursor_position(text.length()); + shift_selection_check_post(p_select); +} + +void LineEdit::_backspace(bool p_word, bool p_all_to_left) { + if (!editable) { + return; + } + + if (p_all_to_left) { + deselect(); + text = text.substr(0, cursor_pos); + _text_changed(); + return; + } + + if (selection.enabled) { + selection_delete(); + return; + } + + if (p_word) { + int cc = cursor_pos; + + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); + for (int i = words.size() - 1; i >= 0; i--) { + if (words[i].x < cc) { + cc = words[i].x; + } + } + + delete_text(cc, cursor_pos); + + set_cursor_position(cc); + } else { + delete_char(); + } +} + +void LineEdit::_delete(bool p_word, bool p_all_to_right) { + if (!editable) { + return; + } + + if (p_all_to_right) { + deselect(); + text = text.substr(cursor_pos, text.length() - cursor_pos); + _shape(); + set_cursor_position(0); + _text_changed(); + return; + } + + if (selection.enabled) { + selection_delete(); + return; + } + + int text_len = text.length(); + + if (cursor_pos == text_len) { + return; // Nothing to do. + } + + if (p_word) { + int cc = cursor_pos; + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); + for (int i = 0; i < words.size(); i++) { + if (words[i].y > cc) { + cc = words[i].y; + break; + } + } + + delete_text(cursor_pos, cc); + } else { + if (mid_grapheme_caret_enabled) { + set_cursor_position(cursor_pos + 1); + delete_char(); + } else { + int cc = cursor_pos; + set_cursor_position(TS->shaped_text_next_grapheme_pos(text_rid, cursor_pos)); + delete_text(cc, cursor_pos); + } + } +} + void LineEdit::_gui_input(Ref<InputEvent> p_event) { Ref<InputEventMouseButton> b = p_event; @@ -55,7 +225,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { if (b->is_pressed() && b->get_button_index() == BUTTON_RIGHT && context_menu_enabled) { menu->set_position(get_screen_transform().xform(get_local_mouse_position())); menu->set_size(Vector2(1, 1)); - //menu->set_scale(get_global_transform().get_scale()); + _generate_context_menu(); menu->popup(); grab_focus(); accept_event(); @@ -153,453 +323,163 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { return; } -#ifdef APPLE_STYLE_KEYS - if (k->get_control() && !k->get_shift() && !k->get_alt() && !k->get_command()) { - uint32_t remap_key = KEY_UNKNOWN; - switch (k->get_keycode()) { - case KEY_F: { - remap_key = KEY_RIGHT; - } break; - case KEY_B: { - remap_key = KEY_LEFT; - } break; - case KEY_P: { - remap_key = KEY_UP; - } break; - case KEY_N: { - remap_key = KEY_DOWN; - } break; - case KEY_D: { - remap_key = KEY_DELETE; - } break; - case KEY_H: { - remap_key = KEY_BACKSPACE; - } break; - case KEY_A: { - remap_key = KEY_HOME; - } break; - case KEY_E: { - remap_key = KEY_END; - } break; + if (context_menu_enabled) { + if (k->is_action("ui_menu", true)) { + Point2 pos = Point2(get_cursor_pixel_pos().x, (get_size().y + get_theme_font("font")->get_height(get_theme_font_size("font_size"))) / 2); + menu->set_position(get_global_transform().xform(pos)); + menu->set_size(Vector2(1, 1)); + _generate_context_menu(); + menu->popup(); + menu->grab_focus(); } + } - if (remap_key != KEY_UNKNOWN) { - k->set_keycode(remap_key); - k->set_control(false); + // Default is ENTER, KP_ENTER. Cannot use ui_accept as default includes SPACE + if (k->is_action("ui_text_newline", true)) { + emit_signal("text_entered", text); + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) { + DisplayServer::get_singleton()->virtual_keyboard_hide(); } } -#endif - - unsigned int code = k->get_keycode(); - - if (k->get_command() && is_shortcut_keys_enabled()) { - bool handled = true; - - switch (code) { - case (KEY_QUOTELEFT): { // Swap current input direction (primary cursor) - - if (input_direction == TEXT_DIRECTION_LTR) { - input_direction = TEXT_DIRECTION_RTL; - } else { - input_direction = TEXT_DIRECTION_LTR; - } - set_cursor_position(get_cursor_position()); - update(); - - } break; - - case (KEY_X): { // CUT. - - if (editable) { - cut_text(); - } - - } break; - - case (KEY_C): { // COPY. - - copy_text(); - - } break; - - case (KEY_Y): // PASTE (Yank for unix users). - case (KEY_V): { // PASTE. - - if (editable) { - paste_text(); - } - - } break; - - case (KEY_Z): { // Undo/redo. - if (editable) { - if (k->get_shift()) { - redo(); - } else { - undo(); - } - } - } break; - - case (KEY_U): { // Delete from start to cursor. - - if (editable) { - deselect(); - text = text.substr(cursor_pos, text.length() - cursor_pos); - _shape(); - set_cursor_position(0); - _text_changed(); - } - } break; - - case (KEY_K): { // Delete from cursor_pos to end. - - if (editable) { - deselect(); - text = text.substr(0, cursor_pos); - _text_changed(); - } + if (is_shortcut_keys_enabled()) { + if (k->is_action("ui_copy", true)) { + copy_text(); + accept_event(); + return; + } - } break; - case (KEY_A): { // Select all. - select(); + if (k->is_action("ui_text_select_all", true)) { + select(); + accept_event(); + return; + } - } break; -#ifdef APPLE_STYLE_KEYS - case (KEY_LEFT): { // Go to start of text - like HOME key. - shift_selection_check_pre(k->get_shift()); - set_cursor_position(0); - shift_selection_check_post(k->get_shift()); - } break; - case (KEY_RIGHT): { // Go to end of text - like END key. - shift_selection_check_pre(k->get_shift()); - set_cursor_position(text.length()); - shift_selection_check_post(k->get_shift()); - } break; - case (KEY_BACKSPACE): { - if (!editable) - break; + // Cut / Paste + if (k->is_action("ui_cut", true)) { + cut_text(); + accept_event(); + return; + } - // If selected, delete the selection - if (selection.enabled) { - selection_delete(); - break; - } + if (k->is_action("ui_paste", true)) { + paste_text(); + accept_event(); + return; + } - // Otherwise delete from cursor to beginning of text edit - int current_pos = get_cursor_position(); - if (current_pos != 0) { - delete_text(0, current_pos); - } - } break; -#endif - default: { - handled = false; - } + // Undo / Redo + if (k->is_action("ui_undo", true)) { + undo(); + accept_event(); + return; } - if (handled) { + if (k->is_action("ui_redo", true)) { + redo(); accept_event(); return; } } - _reset_caret_blink_timer(); - if (!k->get_metakey()) { - bool handled = true; - switch (code) { - case KEY_KP_ENTER: - case KEY_ENTER: { - emit_signal("text_entered", text); - if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) { - DisplayServer::get_singleton()->virtual_keyboard_hide(); - } - - } break; - - case KEY_BACKSPACE: { - if (!editable) { - break; - } - - if (selection.enabled) { - selection_delete(); - break; - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_alt()) { -#else - if (k->get_alt()) { - handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor_pos; - - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); - for (int i = words.size() - 1; i >= 0; i--) { - if (words[i].x < cc) { - cc = words[i].x; - break; - } - } - - delete_text(cc, cursor_pos); - - set_cursor_position(cc); - - } else { - delete_char(); - } - - } break; - case KEY_KP_4: { - if (k->get_unicode() != 0) { - handled = false; - break; - } - [[fallthrough]]; - } - case KEY_LEFT: { -#ifndef APPLE_STYLE_KEYS - if (!k->get_alt()) { -#endif - if (selection.enabled && !k->get_shift()) { - set_cursor_position(selection.begin); - deselect(); - handled = true; - break; - } - - shift_selection_check_pre(k->get_shift()); -#ifndef APPLE_STYLE_KEYS - } -#endif - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - set_cursor_position(0); - } else if (k->get_alt()) { -#else - if (k->get_alt()) { - handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor_pos; - - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); - for (int i = words.size() - 1; i >= 0; i--) { - if (words[i].x < cc) { - cc = words[i].x; - break; - } - } - - set_cursor_position(cc); - - } else { - if (mid_grapheme_caret_enabled) { - set_cursor_position(get_cursor_position() - 1); - } else { - set_cursor_position(TS->shaped_text_prev_grapheme_pos(text_rid, get_cursor_position())); - } - } - - shift_selection_check_post(k->get_shift()); - - } break; - case KEY_KP_6: { - if (k->get_unicode() != 0) { - handled = false; - break; - } - [[fallthrough]]; - } - case KEY_RIGHT: { -#ifndef APPLE_STYLE_KEYS - if (!k->get_alt()) { -#endif - if (selection.enabled && !k->get_shift()) { - set_cursor_position(selection.end); - deselect(); - handled = true; - break; - } - - shift_selection_check_pre(k->get_shift()); -#ifndef APPLE_STYLE_KEYS - } -#endif - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - set_cursor_position(text.length()); - } else if (k->get_alt()) { -#else - if (k->get_alt()) { - handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor_pos; - - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); - for (int i = 0; i < words.size(); i++) { - if (words[i].y > cc) { - cc = words[i].y; - break; - } - } - - set_cursor_position(cc); - - } else { - if (mid_grapheme_caret_enabled) { - set_cursor_position(get_cursor_position() + 1); - } else { - set_cursor_position(TS->shaped_text_next_grapheme_pos(text_rid, get_cursor_position())); - } - } - - shift_selection_check_post(k->get_shift()); - - } break; - case KEY_UP: { - shift_selection_check_pre(k->get_shift()); - if (get_cursor_position() == 0) { - handled = false; - } - set_cursor_position(0); - shift_selection_check_post(k->get_shift()); - } break; - case KEY_DOWN: { - shift_selection_check_pre(k->get_shift()); - if (get_cursor_position() == text.length()) { - handled = false; - } - set_cursor_position(text.length()); - shift_selection_check_post(k->get_shift()); - } break; - case KEY_DELETE: { - if (!editable) { - break; - } - - if (k->get_shift() && !k->get_command() && !k->get_alt()) { - cut_text(); - break; - } - - if (selection.enabled) { - selection_delete(); - break; - } - - int text_len = text.length(); + // BACKSPACE + if (k->is_action("ui_text_backspace_all_to_left", true)) { + _backspace(false, true); + accept_event(); + return; + } + if (k->is_action("ui_text_backspace_word", true)) { + _backspace(true); + accept_event(); + return; + } + if (k->is_action("ui_text_backspace", true)) { + _backspace(); + accept_event(); + return; + } - if (cursor_pos == text_len) { - break; // Nothing to do. - } + // DELETE + if (k->is_action("ui_text_delete_all_to_right", true)) { + _delete(false, true); + accept_event(); + return; + } + if (k->is_action("ui_text_delete_word", true)) { + _delete(true); + accept_event(); + return; + } + if (k->is_action("ui_text_delete", true)) { + _delete(); + accept_event(); + return; + } -#ifdef APPLE_STYLE_KEYS - if (k->get_alt()) { -#else - if (k->get_alt()) { - handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor_pos; + // Cursor Movement - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text_rid); - for (int i = 0; i < words.size(); i++) { - if (words[i].y > cc) { - cc = words[i].y; - break; - } - } + k = k->duplicate(); + bool shift_pressed = k->get_shift(); + // Remove shift or else actions will not match. Use above variable for selection. + k->set_shift(false); - delete_text(cursor_pos, cc); + if (k->is_action("ui_text_caret_word_left", true)) { + _move_cursor_left(shift_pressed, true); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_left", true)) { + _move_cursor_left(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_word_right", true)) { + _move_cursor_right(shift_pressed, true); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_right", true)) { + _move_cursor_right(shift_pressed, false); + accept_event(); + return; + } - } else { - if (mid_grapheme_caret_enabled) { - set_cursor_position(cursor_pos + 1); - delete_char(); - } else { - int cc = cursor_pos; - set_cursor_position(TS->shaped_text_next_grapheme_pos(text_rid, cursor_pos)); - delete_text(cc, cursor_pos); - } - } + // Up = Home, Down = End + if (k->is_action("ui_text_caret_up", true) || k->is_action("ui_text_caret_line_start", true) || k->is_action("ui_text_caret_page_up", true)) { + _move_cursor_start(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_down", true) || k->is_action("ui_text_caret_line_end", true) || k->is_action("ui_text_caret_page_down", true)) { + _move_cursor_end(shift_pressed); + accept_event(); + return; + } - } break; - case KEY_KP_7: { - if (k->get_unicode() != 0) { - handled = false; - break; - } - [[fallthrough]]; - } - case KEY_HOME: { - shift_selection_check_pre(k->get_shift()); - set_cursor_position(0); - shift_selection_check_post(k->get_shift()); - } break; - case KEY_KP_1: { - if (k->get_unicode() != 0) { - handled = false; - break; - } - [[fallthrough]]; - } - case KEY_END: { - shift_selection_check_pre(k->get_shift()); - set_cursor_position(text.length()); - shift_selection_check_post(k->get_shift()); - } break; - case KEY_MENU: { - if (context_menu_enabled) { - Point2 pos = Point2(get_cursor_pixel_pos().x, (get_size().y + get_theme_font("font")->get_height(get_theme_font_size("font_size"))) / 2); - menu->set_position(get_global_transform().xform(pos)); - menu->set_size(Vector2(1, 1)); - //menu->set_scale(get_global_transform().get_scale()); - menu->popup(); - menu->grab_focus(); - } - } break; + // Misc + if (k->is_action("ui_swap_input_direction", true)) { + _swap_current_input_direction(); + accept_event(); + return; + } - default: { - handled = false; - } break; - } + _reset_caret_blink_timer(); - if (handled) { - accept_event(); - } else if (!k->get_command()) { - if (k->get_unicode() >= 32 && k->get_keycode() != KEY_DELETE) { - if (editable) { - selection_delete(); - char32_t ucodestr[2] = { (char32_t)k->get_unicode(), 0 }; - int prev_len = text.length(); - append_at_cursor(ucodestr); - if (text.length() != prev_len) { - _text_changed(); - } - accept_event(); - } + // Allow unicode handling if: + // * No Modifiers are pressed (except shift) + bool allow_unicode_handling = !(k->get_command() || k->get_control() || k->get_alt() || k->get_metakey()); - } else { - return; - } + if (allow_unicode_handling && editable && k->get_unicode() >= 32) { + // Handle Unicode (if no modifiers active) + selection_delete(); + char32_t ucodestr[2] = { (char32_t)k->get_unicode(), 0 }; + int prev_len = text.length(); + append_at_cursor(ucodestr); + if (text.length() != prev_len) { + _text_changed(); } - - update(); + accept_event(); } - - return; } } @@ -1013,13 +893,17 @@ void LineEdit::copy_text() { } void LineEdit::cut_text() { - if (selection.enabled && !pass) { + if (editable && selection.enabled && !pass) { DisplayServer::get_singleton()->clipboard_set(text.substr(selection.begin, selection.end - selection.begin)); selection_delete(); } } void LineEdit::paste_text() { + if (!editable) { + return; + } + // Strip escape characters like \n and \t as they can't be displayed on LineEdit. String paste_buffer = DisplayServer::get_singleton()->clipboard_get().strip_escapes(); @@ -1040,6 +924,10 @@ void LineEdit::paste_text() { } void LineEdit::undo() { + if (!editable) { + return; + } + if (undo_stack_pos == nullptr) { if (undo_stack.size() <= 1) { return; @@ -1059,6 +947,10 @@ void LineEdit::undo() { } void LineEdit::redo() { + if (!editable) { + return; + } + if (undo_stack_pos == nullptr) { return; } @@ -2060,25 +1952,50 @@ void LineEdit::_create_undo_state() { undo_stack.push_back(op); } +int LineEdit::_get_menu_action_accelerator(const String &p_action) { + const List<Ref<InputEvent>> *events = InputMap::get_singleton()->action_get_events(p_action); + if (!events) { + return 0; + } + + // Use first event in the list for the accelerator. + const List<Ref<InputEvent>>::Element *first_event = events->front(); + if (!first_event) { + return 0; + } + + const Ref<InputEventKey> event = first_event->get(); + if (event.is_null()) { + return 0; + } + + // Use physical keycode if non-zero + if (event->get_physical_keycode() != 0) { + return event->get_physical_keycode_with_modifiers(); + } else { + return event->get_keycode_with_modifiers(); + } +} + void LineEdit::_generate_context_menu() { // Reorganize context menu. menu->clear(); if (editable) { - menu->add_item(RTR("Cut"), MENU_CUT, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_X : 0); + menu->add_item(RTR("Cut"), MENU_CUT, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_cut") : 0); } - menu->add_item(RTR("Copy"), MENU_COPY, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_C : 0); + menu->add_item(RTR("Copy"), MENU_COPY, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_copy") : 0); if (editable) { - menu->add_item(RTR("Paste"), MENU_PASTE, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_V : 0); + menu->add_item(RTR("Paste"), MENU_PASTE, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_paste") : 0); } menu->add_separator(); if (is_selecting_enabled()) { - menu->add_item(RTR("Select All"), MENU_SELECT_ALL, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_A : 0); + menu->add_item(RTR("Select All"), MENU_SELECT_ALL, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_text_select_all") : 0); } if (editable) { menu->add_item(RTR("Clear"), MENU_CLEAR); menu->add_separator(); - menu->add_item(RTR("Undo"), MENU_UNDO, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_Z : 0); - menu->add_item(RTR("Redo"), MENU_REDO, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z : 0); + menu->add_item(RTR("Undo"), MENU_UNDO, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_undo") : 0); + menu->add_item(RTR("Redo"), MENU_REDO, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_redo") : 0); } menu->add_separator(); menu->add_submenu_item(RTR("Text writing direction"), "DirMenu"); diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 457a709f5b..cbadf818cd 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -163,6 +163,7 @@ private: void _clear_redo(); void _create_undo_state(); + int _get_menu_action_accelerator(const String &p_action); void _generate_context_menu(); void _shape(); @@ -188,6 +189,14 @@ private: void _editor_settings_changed(); + void _swap_current_input_direction(); + void _move_cursor_left(bool p_select, bool p_move_by_word = false); + void _move_cursor_right(bool p_select, bool p_move_by_word = false); + void _move_cursor_start(bool p_select); + void _move_cursor_end(bool p_select); + void _backspace(bool p_word = false, bool p_all_to_left = false); + void _delete(bool p_word = false, bool p_all_to_right = false); + void _gui_input(Ref<InputEvent> p_event); void _notification(int p_what); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 6a1cc291a6..a79c633502 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1575,53 +1575,36 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) { Ref<InputEventKey> k = p_event; if (k.is_valid()) { - if (k->is_pressed() && !k->get_alt() && !k->get_shift()) { + if (k->is_pressed()) { bool handled = false; - switch (k->get_keycode()) { - case KEY_PAGEUP: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(vscroll->get_value() - vscroll->get_page()); - handled = true; - } - } break; - case KEY_PAGEDOWN: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(vscroll->get_value() + vscroll->get_page()); - handled = true; - } - } break; - case KEY_UP: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(vscroll->get_value() - get_theme_font("normal_font")->get_height(get_theme_font_size("normal_font_size"))); - handled = true; - } - } break; - case KEY_DOWN: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(vscroll->get_value() + get_theme_font("normal_font")->get_height(get_theme_font_size("normal_font_size"))); - handled = true; - } - } break; - case KEY_HOME: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(0); - handled = true; - } - } break; - case KEY_END: { - if (vscroll->is_visible_in_tree()) { - vscroll->set_value(vscroll->get_max()); - handled = true; - } - } break; - case KEY_INSERT: - case KEY_C: { - if (k->get_command()) { - selection_copy(); - handled = true; - } - } break; + if (k->is_action("ui_pageup") && vscroll->is_visible_in_tree()) { + vscroll->set_value(vscroll->get_value() - vscroll->get_page()); + handled = true; + } + if (k->is_action("ui_pagedown") && vscroll->is_visible_in_tree()) { + vscroll->set_value(vscroll->get_value() + vscroll->get_page()); + handled = true; + } + if (k->is_action("ui_up") && vscroll->is_visible_in_tree()) { + vscroll->set_value(vscroll->get_value() - get_theme_font("normal_font")->get_height(get_theme_font_size("normal_font_size"))); + handled = true; + } + if (k->is_action("ui_down") && vscroll->is_visible_in_tree()) { + vscroll->set_value(vscroll->get_value() + get_theme_font("normal_font")->get_height(get_theme_font_size("normal_font_size"))); + handled = true; + } + if (k->is_action("ui_home") && vscroll->is_visible_in_tree()) { + vscroll->set_value(0); + handled = true; + } + if (k->is_action("ui_end") && vscroll->is_visible_in_tree()) { + vscroll->set_value(vscroll->get_max()); + handled = true; + } + if (k->is_action("ui_copy")) { + selection_copy(); + handled = true; } if (handled) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 880e66eb6a..36aa18417d 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -32,6 +32,7 @@ #include "core/config/project_settings.h" #include "core/input/input.h" +#include "core/input/input_map.h" #include "core/object/message_queue.h" #include "core/object/script_language.h" #include "core/os/keyboard.h" @@ -1985,7 +1986,7 @@ void TextEdit::backspace_at_cursor() { cursor_set_column(prev_column); } -void TextEdit::indent_right() { +void TextEdit::indent_selected_lines_right() { int start_line; int end_line; @@ -2037,7 +2038,7 @@ void TextEdit::indent_right() { update(); } -void TextEdit::indent_left() { +void TextEdit::indent_selected_lines_left() { int start_line; int end_line; @@ -2108,6 +2109,618 @@ int TextEdit::_calculate_spaces_till_next_right_indent(int column) { return indent_size - column % indent_size; } +void TextEdit::_swap_current_input_direction() { + if (input_direction == TEXT_DIRECTION_LTR) { + input_direction = TEXT_DIRECTION_RTL; + } else { + input_direction = TEXT_DIRECTION_LTR; + } + cursor_set_column(cursor.column); + update(); +} + +void TextEdit::_new_line(bool p_split_current_line, bool p_above) { + if (readonly) { + return; + } + + String ins = "\n"; + + // Keep indentation. + int space_count = 0; + for (int i = 0; i < cursor.column; i++) { + if (text[cursor.line][i] == '\t') { + if (indent_using_spaces) { + ins += space_indent; + } else { + ins += "\t"; + } + space_count = 0; + } else if (text[cursor.line][i] == ' ') { + space_count++; + + if (space_count == indent_size) { + if (indent_using_spaces) { + ins += space_indent; + } else { + ins += "\t"; + } + space_count = 0; + } + } else { + break; + } + } + + if (is_folded(cursor.line)) { + unfold_line(cursor.line); + } + + bool brace_indent = false; + + // No need to indent if we are going upwards. + if (auto_indent && !p_above) { + // Indent once again if previous line will end with ':','{','[','(' and the line is not a comment + // (i.e. colon/brace precedes current cursor position). + if (cursor.column > 0) { + bool indent_char_found = false; + bool should_indent = false; + char indent_char = ':'; + char c = text[cursor.line][cursor.column]; + + for (int i = 0; i < cursor.column; i++) { + c = text[cursor.line][i]; + switch (c) { + case ':': + case '{': + case '[': + case '(': + indent_char_found = true; + should_indent = true; + indent_char = c; + continue; + } + + if (indent_char_found && is_line_comment(cursor.line)) { + should_indent = true; + break; + } else if (indent_char_found && !_is_whitespace(c)) { + should_indent = false; + indent_char_found = false; + } + } + + if (!is_line_comment(cursor.line) && should_indent) { + if (indent_using_spaces) { + ins += space_indent; + } else { + ins += "\t"; + } + + // No need to move the brace below if we are not taking the text with us. + char32_t closing_char = _get_right_pair_symbol(indent_char); + if ((closing_char != 0) && (closing_char == text[cursor.line][cursor.column]) && !p_split_current_line) { + brace_indent = true; + ins += "\n" + ins.substr(1, ins.length() - 2); + } + } + } + } + begin_complex_operation(); + bool first_line = false; + if (!p_split_current_line) { + if (p_above) { + if (cursor.line > 0) { + cursor_set_line(cursor.line - 1); + cursor_set_column(text[cursor.line].length()); + } else { + cursor_set_column(0); + first_line = true; + } + } else { + cursor_set_column(text[cursor.line].length()); + } + } + + insert_text_at_cursor(ins); + + if (first_line) { + cursor_set_line(0); + } else if (brace_indent) { + cursor_set_line(cursor.line - 1); + cursor_set_column(text[cursor.line].length()); + } + end_complex_operation(); +} + +void TextEdit::_indent_right() { + if (readonly) { + return; + } + + if (is_selection_active()) { + indent_selected_lines_right(); + } else { + // Simple indent. + if (indent_using_spaces) { + // Insert only as much spaces as needed till next indentation level. + int spaces_to_add = _calculate_spaces_till_next_right_indent(cursor.column); + String indent_to_insert = String(); + for (int i = 0; i < spaces_to_add; i++) { + indent_to_insert = ' ' + indent_to_insert; + } + _insert_text_at_cursor(indent_to_insert); + } else { + _insert_text_at_cursor("\t"); + } + } +} + +void TextEdit::_indent_left() { + if (readonly) { + return; + } + + if (is_selection_active()) { + indent_selected_lines_left(); + } else { + // Simple unindent. + int cc = cursor.column; + const String &line = text[cursor.line]; + + int left = _find_first_non_whitespace_column_of_line(line); + cc = MIN(cc, left); + + while (cc < indent_size && cc < left && line[cc] == ' ') { + cc++; + } + + if (cc > 0 && cc <= text[cursor.line].length()) { + if (text[cursor.line][cc - 1] == '\t') { + // Tabs unindentation. + _remove_text(cursor.line, cc - 1, cursor.line, cc); + if (cursor.column >= left) { + cursor_set_column(MAX(0, cursor.column - 1)); + } + update(); + } else { + // Spaces unindentation. + int spaces_to_remove = _calculate_spaces_till_next_left_indent(cc); + if (spaces_to_remove > 0) { + _remove_text(cursor.line, cc - spaces_to_remove, cursor.line, cc); + if (cursor.column > left - spaces_to_remove) { // Inside text? + cursor_set_column(MAX(0, cursor.column - spaces_to_remove)); + } + update(); + } + } + } else if (cc == 0 && line.length() > 0 && line[0] == '\t') { + _remove_text(cursor.line, 0, cursor.line, 1); + update(); + } + } +} + +void TextEdit::_move_cursor_left(bool p_select, bool p_move_by_word) { + // Handle selection + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + if (p_move_by_word) { + int cc = cursor.column; + + if (cc == 0 && cursor.line > 0) { + cursor_set_line(cursor.line - 1); + cursor_set_column(text[cursor.line].length()); + } else { + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(cursor.line)->get_rid()); + for (int i = words.size() - 1; i >= 0; i--) { + if (words[i].x < cc) { + cc = words[i].x; + break; + } + } + cursor_set_column(cc); + } + } else { + // If the cursor is at the start of the line, and not on the first line, move it up to the end of the previous line. + if (cursor.column == 0) { + if (cursor.line > 0) { + cursor_set_line(cursor.line - num_lines_from(CLAMP(cursor.line - 1, 0, text.size() - 1), -1)); + cursor_set_column(text[cursor.line].length()); + } + } else { + if (mid_grapheme_caret_enabled) { + cursor_set_column(cursor_get_column() - 1); + } else { + cursor_set_column(TS->shaped_text_prev_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), cursor_get_column())); + } + } + } + + if (p_select) { + _post_shift_selection(); + } +} + +void TextEdit::_move_cursor_right(bool p_select, bool p_move_by_word) { + // Handle selection + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + if (p_move_by_word) { + int cc = cursor.column; + + if (cc == text[cursor.line].length() && cursor.line < text.size() - 1) { + cursor_set_line(cursor.line + 1); + cursor_set_column(0); + } else { + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(cursor.line)->get_rid()); + for (int i = 0; i < words.size(); i++) { + if (words[i].y > cc) { + cc = words[i].y; + break; + } + } + cursor_set_column(cc); + } + } else { + // If we are at the end of the line, move the caret to the next line down. + if (cursor.column == text[cursor.line].length()) { + if (cursor.line < text.size() - 1) { + cursor_set_line(cursor_get_line() + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1), true, false); + cursor_set_column(0); + } + } else { + if (mid_grapheme_caret_enabled) { + cursor_set_column(cursor_get_column() + 1); + } else { + cursor_set_column(TS->shaped_text_next_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), cursor_get_column())); + } + } + } + + if (p_select) { + _post_shift_selection(); + } +} + +void TextEdit::_move_cursor_up(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + int cur_wrap_index = get_cursor_wrap_index(); + if (cur_wrap_index > 0) { + cursor_set_line(cursor.line, true, false, cur_wrap_index - 1); + } else if (cursor.line == 0) { + cursor_set_column(0); + } else { + int new_line = cursor.line - num_lines_from(cursor.line - 1, -1); + if (line_wraps(new_line)) { + cursor_set_line(new_line, true, false, times_line_wraps(new_line)); + } else { + cursor_set_line(new_line, true, false); + } + } + + if (p_select) { + _post_shift_selection(); + } + + _cancel_code_hint(); +} + +void TextEdit::_move_cursor_down(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + int cur_wrap_index = get_cursor_wrap_index(); + if (cur_wrap_index < times_line_wraps(cursor.line)) { + cursor_set_line(cursor.line, true, false, cur_wrap_index + 1); + } else if (cursor.line == get_last_unhidden_line()) { + cursor_set_column(text[cursor.line].length()); + } else { + int new_line = cursor.line + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1); + cursor_set_line(new_line, true, false, 0); + } + + if (p_select) { + _post_shift_selection(); + } + + _cancel_code_hint(); +} + +void TextEdit::_move_cursor_to_line_start(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + // Move cursor column to start of wrapped row and then to start of text. + Vector<String> rows = get_wrap_rows_text(cursor.line); + int wi = get_cursor_wrap_index(); + int row_start_col = 0; + for (int i = 0; i < wi; i++) { + row_start_col += rows[i].length(); + } + if (cursor.column == row_start_col || wi == 0) { + // Compute whitespace symbols seq length. + int current_line_whitespace_len = 0; + while (current_line_whitespace_len < text[cursor.line].length()) { + char32_t c = text[cursor.line][current_line_whitespace_len]; + if (c != '\t' && c != ' ') { + break; + } + current_line_whitespace_len++; + } + + if (cursor_get_column() == current_line_whitespace_len) { + cursor_set_column(0); + } else { + cursor_set_column(current_line_whitespace_len); + } + } else { + cursor_set_column(row_start_col); + } + + if (p_select) { + _post_shift_selection(); + } + + _cancel_completion(); + completion_hint = ""; +} + +void TextEdit::_move_cursor_to_line_end(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + // Move cursor column to end of wrapped row and then to end of text. + Vector<String> rows = get_wrap_rows_text(cursor.line); + int wi = get_cursor_wrap_index(); + int row_end_col = -1; + for (int i = 0; i < wi + 1; i++) { + row_end_col += rows[i].length(); + } + if (wi == rows.size() - 1 || cursor.column == row_end_col) { + cursor_set_column(text[cursor.line].length()); + } else { + cursor_set_column(row_end_col); + } + + if (p_select) { + _post_shift_selection(); + } + _cancel_completion(); + completion_hint = ""; +} + +void TextEdit::_move_cursor_page_up(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + int wi; + int n_line = cursor.line - num_lines_from_rows(cursor.line, get_cursor_wrap_index(), -get_visible_rows(), wi) + 1; + cursor_set_line(n_line, true, false, wi); + + if (p_select) { + _post_shift_selection(); + } + + _cancel_completion(); + completion_hint = ""; +} + +void TextEdit::_move_cursor_page_down(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + int wi; + int n_line = cursor.line + num_lines_from_rows(cursor.line, get_cursor_wrap_index(), get_visible_rows(), wi) - 1; + cursor_set_line(n_line, true, false, wi); + + if (p_select) { + _post_shift_selection(); + } + + _cancel_completion(); + completion_hint = ""; +} + +void TextEdit::_backspace(bool p_word, bool p_all_to_left) { + if (readonly) { + return; + } + + if (is_selection_active()) { + _delete_selection(); + return; + } + if (p_all_to_left) { + int cursor_current_column = cursor.column; + cursor.column = 0; + _remove_text(cursor.line, 0, cursor.line, cursor_current_column); + } else if (p_word) { + int line = cursor.line; + int column = cursor.column; + + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(line)->get_rid()); + for (int i = words.size() - 1; i >= 0; i--) { + if (words[i].x < column) { + column = words[i].x; + break; + } + } + + _remove_text(line, column, cursor.line, cursor.column); + + cursor_set_line(line); + cursor_set_column(column); + } else { + // One character. + if (cursor.line > 0 && is_line_hidden(cursor.line - 1)) { + unfold_line(cursor.line - 1); + } + backspace_at_cursor(); + } +} + +void TextEdit::_delete(bool p_word, bool p_all_to_right) { + if (readonly) { + return; + } + + if (is_selection_active()) { + _delete_selection(); + return; + } + int curline_len = text[cursor.line].length(); + + if (cursor.line == text.size() - 1 && cursor.column == curline_len) { + return; // Last line, last column: Nothing to do. + } + + int next_line = cursor.column < curline_len ? cursor.line : cursor.line + 1; + int next_column; + + if (p_all_to_right) { + // Delete everything to right of cursor + next_column = curline_len; + next_line = cursor.line; + } else if (p_word && cursor.column < curline_len - 1) { + // Delete next word to right of cursor + int line = cursor.line; + int column = cursor.column; + + Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(line)->get_rid()); + for (int i = 0; i < words.size(); i++) { + if (words[i].y > column) { + column = words[i].y; + break; + } + } + + next_line = line; + next_column = column; + } else { + // Delete one character + next_column = cursor.column < curline_len ? (cursor.column + 1) : 0; + if (mid_grapheme_caret_enabled) { + next_column = cursor.column < curline_len ? (cursor.column + 1) : 0; + } else { + next_column = cursor.column < curline_len ? TS->shaped_text_next_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), (cursor.column)) : 0; + } + } + + _remove_text(cursor.line, cursor.column, next_line, next_column); + update(); +} + +void TextEdit::_delete_selection() { + if (is_selection_active()) { + selection.active = false; + update(); + _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); + cursor_set_line(selection.from_line, true, false); + cursor_set_column(selection.from_column); + update(); + } +} + +void TextEdit::_move_cursor_document_start(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + cursor_set_line(0); + cursor_set_column(0); + + if (p_select) { + _post_shift_selection(); + } +} + +void TextEdit::_move_cursor_document_end(bool p_select) { + if (p_select) { + _pre_shift_selection(); + } else { + deselect(); + } + + cursor_set_line(get_last_unhidden_line(), true, false, 9999); + cursor_set_column(text[cursor.line].length()); + + if (p_select) { + _post_shift_selection(); + } +} + +void TextEdit::_handle_unicode_character(uint32_t unicode, bool p_had_selection, bool p_update_auto_complete) { + if (p_update_auto_complete) { + _reset_caret_blink_timer(); + } + + if (p_had_selection) { + _delete_selection(); + } + + // Remove the old character if in insert mode and no selection. + if (insert_mode && !p_had_selection) { + begin_complex_operation(); + + // Make sure we don't try and remove empty space. + if (cursor.column < get_line(cursor.line).length()) { + _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); + } + } + + const char32_t chr[2] = { (char32_t)unicode, 0 }; + + // Clear completion hint when function closed + if (completion_hint != "" && unicode == ')') { + completion_hint = ""; + } + + if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) { + _consume_pair_symbol(chr[0]); + } else { + _insert_text_at_cursor(chr); + } + + if ((insert_mode && !p_had_selection) || (selection.active != p_had_selection)) { + end_complex_operation(); + } + + if (p_update_auto_complete) { + _update_completion_candidates(); + } +} + void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) const { float rows = p_mouse.y; rows -= cache.style_normal->get_margin(SIDE_TOP); @@ -2138,6 +2751,18 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co } else { int colx = p_mouse.x - (cache.style_normal->get_margin(SIDE_LEFT) + gutters_width + gutter_padding); colx += cursor.x_ofs; + col = get_char_pos_for_line(colx, row, wrap_index); + if (is_wrap_enabled() && wrap_index < times_line_wraps(row)) { + // Move back one if we are at the end of the row. + Vector<String> rows2 = get_wrap_rows_text(row); + int row_end_col = 0; + for (int i = 0; i < wrap_index + 1; i++) { + row_end_col += rows2[i].length(); + } + if (col >= row_end_col) { + col -= 1; + } + } RID text_rid = text.get_line_data(row)->get_line_rid(wrap_index); if (is_layout_rtl()) { @@ -2390,7 +3015,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { update(); } - } else { selection.active = false; selection.selecting_mode = SelectionMode::SELECTION_MODE_POINTER; @@ -2439,7 +3063,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { menu->set_position(get_screen_transform().xform(mpos)); menu->set_size(Vector2(1, 1)); - // menu->set_scale(get_global_transform().get_scale()); + _generate_context_menu(); menu->popup(); grab_focus(); } @@ -2533,13 +3157,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { Ref<InputEventKey> k = p_gui_input; if (k.is_valid()) { - k = k->duplicate(); // It will be modified later on. - + // Ctrl + Hover symbols #ifdef OSX_ENABLED if (k->get_keycode() == KEY_META) { #else if (k->get_keycode() == KEY_CONTROL) { - #endif if (select_identifiers_enabled) { if (k->is_pressed() && !dragging_minimap && !dragging_selection) { @@ -2549,1191 +3171,347 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { set_highlighted_word(String()); } } + return; } if (!k->is_pressed()) { return; } - if (completion_active) { - if (readonly) { - return; - } - - bool valid = true; - if (k->get_command() || k->get_metakey()) { - valid = false; - } - - if (valid) { - if (!k->get_alt()) { - if (k->get_keycode() == KEY_UP) { - if (completion_index > 0) { - completion_index--; - } else { - completion_index = completion_options.size() - 1; - } - completion_current = completion_options[completion_index]; - update(); - - accept_event(); - return; - } - - if (k->get_keycode() == KEY_DOWN) { - if (completion_index < completion_options.size() - 1) { - completion_index++; - } else { - completion_index = 0; - } - completion_current = completion_options[completion_index]; - update(); - - accept_event(); - return; - } - - if (k->get_keycode() == KEY_PAGEUP) { - completion_index -= get_theme_constant("completion_lines"); - if (completion_index < 0) { - completion_index = 0; - } - completion_current = completion_options[completion_index]; - update(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_PAGEDOWN) { - completion_index += get_theme_constant("completion_lines"); - if (completion_index >= completion_options.size()) { - completion_index = completion_options.size() - 1; - } - completion_current = completion_options[completion_index]; - update(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_HOME && completion_index > 0) { - completion_index = 0; - completion_current = completion_options[completion_index]; - update(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_END && completion_index < completion_options.size() - 1) { - completion_index = completion_options.size() - 1; - completion_current = completion_options[completion_index]; - update(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_KP_ENTER || k->get_keycode() == KEY_ENTER || k->get_keycode() == KEY_TAB) { - _confirm_completion(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_BACKSPACE) { - _reset_caret_blink_timer(); - - backspace_at_cursor(); - _update_completion_candidates(); - accept_event(); - return; - } - - if (k->get_keycode() == KEY_SHIFT) { - accept_event(); - return; - } - } - - if (k->get_unicode() > 32) { - _reset_caret_blink_timer(); - - const char32_t chr[2] = { (char32_t)k->get_unicode(), 0 }; - if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) { - _consume_pair_symbol(chr[0]); - } else { - // Remove the old character if in insert mode. - if (insert_mode) { - begin_complex_operation(); - - // Make sure we don't try and remove empty space. - if (cursor.column < get_line(cursor.line).length()) { - _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); - } - } - - _insert_text_at_cursor(chr); - - if (insert_mode) { - end_complex_operation(); - } - } - _update_completion_candidates(); - accept_event(); - - return; - } - } - - _cancel_completion(); + // If a modifier has been pressed, and nothing else, return. + if (k->get_keycode() == KEY_CONTROL || k->get_keycode() == KEY_ALT || k->get_keycode() == KEY_SHIFT || k->get_keycode() == KEY_META) { + return; } - /* TEST CONTROL FIRST! */ - - // Some remaps for duplicate functions. - if (k->get_command() && !k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_keycode() == KEY_INSERT) { - k->set_keycode(KEY_C); - } - if (!k->get_command() && k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_keycode() == KEY_INSERT) { - k->set_keycode(KEY_V); - k->set_command(true); - k->set_shift(false); - } -#ifdef APPLE_STYLE_KEYS - if (k->get_control() && !k->get_shift() && !k->get_alt() && !k->get_command()) { - uint32_t remap_key = KEY_UNKNOWN; - switch (k->get_keycode()) { - case KEY_F: { - remap_key = KEY_RIGHT; - } break; - case KEY_B: { - remap_key = KEY_LEFT; - } break; - case KEY_P: { - remap_key = KEY_UP; - } break; - case KEY_N: { - remap_key = KEY_DOWN; - } break; - case KEY_D: { - remap_key = KEY_DELETE; - } break; - case KEY_H: { - remap_key = KEY_BACKSPACE; - } break; - } - - if (remap_key != KEY_UNKNOWN) { - k->set_keycode(remap_key); - k->set_control(false); - } - } -#endif - _reset_caret_blink_timer(); + // Allow unicode handling if: + // * No Modifiers are pressed (except shift) + bool allow_unicode_handling = !(k->get_command() || k->get_control() || k->get_alt() || k->get_metakey()); + // Save here for insert mode, just in case it is cleared in the following section. bool had_selection = selection.active; - // Stuff to do when selection is active. - if (!readonly && selection.active) { - bool clear = false; - bool unselect = false; - bool dobreak = false; - - switch (k->get_keycode()) { - case KEY_TAB: { - if (k->get_shift()) { - indent_left(); - } else { - indent_right(); - } - dobreak = true; - accept_event(); - } break; - case KEY_X: - case KEY_C: - // Special keys often used with control, wait. - clear = (!k->get_command() || k->get_shift() || k->get_alt()); - break; - case KEY_DELETE: - if (!k->get_shift()) { - accept_event(); - clear = true; - dobreak = true; - } else if (k->get_command() || k->get_alt()) { - dobreak = true; - } - break; - case KEY_BACKSPACE: - accept_event(); - clear = true; - dobreak = true; - break; - case KEY_LEFT: - case KEY_RIGHT: - case KEY_UP: - case KEY_DOWN: - case KEY_PAGEUP: - case KEY_PAGEDOWN: - case KEY_HOME: - case KEY_END: - // Ignore arrows if any modifiers are held (shift = selecting, others may be used for editor hotkeys). - if (k->get_command() || k->get_shift() || k->get_alt()) { - break; - } - unselect = true; - break; - - default: - if (k->get_unicode() >= 32 && !k->get_command() && !k->get_alt() && !k->get_metakey()) { - clear = true; - } - if (auto_brace_completion_enabled && _is_pair_left_symbol(k->get_unicode())) { - clear = false; - } - } - - if (unselect) { - selection.active = false; - selection.selecting_mode = SelectionMode::SELECTION_MODE_NONE; - update(); - } - if (clear) { - if (!dobreak) { - begin_complex_operation(); - } - selection.active = false; - update(); - _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); - cursor_set_line(selection.from_line, true, false); - cursor_set_column(selection.from_column); - update(); - } - if (dobreak) { - return; - } - } - selection.selecting_text = false; - bool keycode_handled = true; - - // Special keycode test. - - switch (k->get_keycode()) { - case KEY_KP_ENTER: - case KEY_ENTER: { - if (readonly) { - break; - } - - String ins = "\n"; - - // Keep indentation. - int space_count = 0; - for (int i = 0; i < cursor.column; i++) { - if (text[cursor.line][i] == '\t') { - if (indent_using_spaces) { - ins += space_indent; - } else { - ins += "\t"; - } - space_count = 0; - } else if (text[cursor.line][i] == ' ') { - space_count++; - - if (space_count == indent_size) { - if (indent_using_spaces) { - ins += space_indent; - } else { - ins += "\t"; - } - space_count = 0; - } - } else { - break; - } - } - - if (is_folded(cursor.line)) { - unfold_line(cursor.line); - } - - bool brace_indent = false; - - // No need to indent if we are going upwards. - if (auto_indent && !(k->get_command() && k->get_shift())) { - // Indent once again if previous line will end with ':','{','[','(' and the line is not a comment - // (i.e. colon/brace precedes current cursor position). - if (cursor.column > 0) { - bool indent_char_found = false; - bool should_indent = false; - char indent_char = ':'; - char c = text[cursor.line][cursor.column]; - - for (int i = 0; i < cursor.column; i++) { - c = text[cursor.line][i]; - switch (c) { - case ':': - case '{': - case '[': - case '(': - indent_char_found = true; - should_indent = true; - indent_char = c; - continue; - } - - if (indent_char_found && is_line_comment(cursor.line)) { - should_indent = true; - break; - } else if (indent_char_found && !_is_whitespace(c)) { - should_indent = false; - indent_char_found = false; - } - } - - if (!is_line_comment(cursor.line) && should_indent) { - if (indent_using_spaces) { - ins += space_indent; - } else { - ins += "\t"; - } + // Check and handle all built in shortcuts. - // No need to move the brace below if we are not taking the text with us. - char32_t closing_char = _get_right_pair_symbol(indent_char); - if ((closing_char != 0) && (closing_char == text[cursor.line][cursor.column]) && !k->get_command()) { - brace_indent = true; - ins += "\n" + ins.substr(1, ins.length() - 2); - } - } - } - } - begin_complex_operation(); - bool first_line = false; - if (k->get_command()) { - if (k->get_shift()) { - if (cursor.line > 0) { - cursor_set_line(cursor.line - 1); - cursor_set_column(text[cursor.line].length()); - } else { - cursor_set_column(0); - first_line = true; - } - } else { - cursor_set_column(text[cursor.line].length()); - } - } + // AUTO-COMPLETE - insert_text_at_cursor(ins); - - if (first_line) { - cursor_set_line(0); - } else if (brace_indent) { - cursor_set_line(cursor.line - 1); - cursor_set_column(text[cursor.line].length()); - } - end_complex_operation(); - } break; - case KEY_ESCAPE: { - if (completion_hint != "") { - completion_hint = ""; - update(); - } else { - keycode_handled = false; - } - } break; - case KEY_TAB: { - if (k->get_command()) { - break; // Avoid tab when command. - } - - if (readonly) { - break; - } - - if (is_selection_active()) { - if (k->get_shift()) { - indent_left(); - } else { - indent_right(); - } - } else { - if (k->get_shift()) { - // Simple unindent. - int cc = cursor.column; - const String &line = text[cursor.line]; - - int left = _find_first_non_whitespace_column_of_line(line); - cc = MIN(cc, left); - - while (cc < indent_size && cc < left && line[cc] == ' ') { - cc++; - } - - if (cc > 0 && cc <= text[cursor.line].length()) { - if (text[cursor.line][cc - 1] == '\t') { - // Tabs unindentation. - _remove_text(cursor.line, cc - 1, cursor.line, cc); - if (cursor.column >= left) { - cursor_set_column(MAX(0, cursor.column - 1)); - } - update(); - } else { - // Spaces unindentation. - int spaces_to_remove = _calculate_spaces_till_next_left_indent(cc); - if (spaces_to_remove > 0) { - _remove_text(cursor.line, cc - spaces_to_remove, cursor.line, cc); - if (cursor.column > left - spaces_to_remove) { // Inside text? - cursor_set_column(MAX(0, cursor.column - spaces_to_remove)); - } - update(); - } - } - } else if (cc == 0 && line.length() > 0 && line[0] == '\t') { - _remove_text(cursor.line, 0, cursor.line, 1); - update(); - } - } else { - // Simple indent. - if (indent_using_spaces) { - // Insert only as much spaces as needed till next indentation level. - int spaces_to_add = _calculate_spaces_till_next_right_indent(cursor.column); - String indent_to_insert = String(); - for (int i = 0; i < spaces_to_add; i++) { - indent_to_insert = ' ' + indent_to_insert; - } - _insert_text_at_cursor(indent_to_insert); - } else { - _insert_text_at_cursor("\t"); - } - } - } - - } break; - case KEY_BACKSPACE: { - if (readonly) { - break; - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_alt() && cursor.column > 1) { -#else - if (k->get_alt()) { - keycode_handled = false; - break; - } else if (k->get_command() && cursor.column > 1) { -#endif - int line = cursor.line; - int column = cursor.column; - - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(line)->get_rid()); - for (int i = words.size() - 1; i >= 0; i--) { - if (words[i].x < column) { - column = words[i].x; - break; - } - } - - _remove_text(line, column, cursor.line, cursor.column); - - cursor_set_line(line); - cursor_set_column(column); - -#ifdef APPLE_STYLE_KEYS - } else if (k->get_command()) { - int cursor_current_column = cursor.column; - cursor.column = 0; - _remove_text(cursor.line, 0, cursor.line, cursor_current_column); -#endif - } else { - if (cursor.line > 0 && is_line_hidden(cursor.line - 1)) { - unfold_line(cursor.line - 1); - } - backspace_at_cursor(); - } - - } break; - case KEY_KP_4: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; - } - [[fallthrough]]; - } - case KEY_LEFT: { - if (k->get_shift()) { - _pre_shift_selection(); -#ifdef APPLE_STYLE_KEYS - } else { -#else - } else if (!k->get_alt()) { -#endif - deselect(); - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - // Start at first column (it's slightly faster that way) and look for the first non-whitespace character. - int new_cursor_pos = 0; - for (int i = 0; i < text[cursor.line].length(); ++i) { - if (!_is_whitespace(text[cursor.line][i])) { - new_cursor_pos = i; - break; - } - } - if (new_cursor_pos == cursor.column) { - // We're already at the first text character, so move to the very beginning of the line. - cursor_set_column(0); - } else { - // We're somewhere to the right of the first text character; move to the first one. - cursor_set_column(new_cursor_pos); - } - } else if (k->get_alt()) { -#else - if (k->get_alt()) { - keycode_handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor.column; - - if (cc == 0 && cursor.line > 0) { - cursor_set_line(cursor.line - 1); - cursor_set_column(text[cursor.line].length()); - } else { - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(cursor.line)->get_rid()); - for (int i = words.size() - 1; i >= 0; i--) { - if (words[i].x < cc) { - cc = words[i].x; - break; - } - } - cursor_set_column(cc); - } + if (k->is_action("ui_text_completion_query", true)) { + query_code_comple(); + accept_event(); + return; + } - } else if (cursor.column == 0) { - if (cursor.line > 0) { - cursor_set_line(cursor.line - num_lines_from(CLAMP(cursor.line - 1, 0, text.size() - 1), -1)); - cursor_set_column(text[cursor.line].length()); - } + if (completion_active) { + if (k->is_action("ui_up", true)) { + if (completion_index > 0) { + completion_index--; } else { - if (mid_grapheme_caret_enabled) { - cursor_set_column(cursor_get_column() - 1); - } else { - cursor_set_column(TS->shaped_text_prev_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), cursor_get_column())); - } - } - - if (k->get_shift()) { - _post_shift_selection(); - } - - } break; - case KEY_KP_6: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; + completion_index = completion_options.size() - 1; } - [[fallthrough]]; + completion_current = completion_options[completion_index]; + update(); + accept_event(); + return; } - case KEY_RIGHT: { - if (k->get_shift()) { - _pre_shift_selection(); -#ifdef APPLE_STYLE_KEYS - } else { -#else - } else if (!k->get_alt()) { -#endif - deselect(); - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - cursor_set_column(text[cursor.line].length()); - } else if (k->get_alt()) { -#else - if (k->get_alt()) { - keycode_handled = false; - break; - } else if (k->get_command()) { -#endif - int cc = cursor.column; - - if (cc == text[cursor.line].length() && cursor.line < text.size() - 1) { - cursor_set_line(cursor.line + 1); - cursor_set_column(0); - } else { - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(cursor.line)->get_rid()); - for (int i = 0; i < words.size(); i++) { - if (words[i].y > cc) { - cc = words[i].y; - break; - } - } - cursor_set_column(cc); - } - - } else if (cursor.column == text[cursor.line].length()) { - if (cursor.line < text.size() - 1) { - cursor_set_line(cursor_get_line() + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1), true, false); - cursor_set_column(0); - } + if (k->is_action("ui_down", true)) { + if (completion_index < completion_options.size() - 1) { + completion_index++; } else { - if (mid_grapheme_caret_enabled) { - cursor_set_column(cursor_get_column() + 1); - } else { - cursor_set_column(TS->shaped_text_next_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), cursor_get_column())); - } - } - - if (k->get_shift()) { - _post_shift_selection(); - } - - } break; - case KEY_KP_8: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; + completion_index = 0; } - [[fallthrough]]; + completion_current = completion_options[completion_index]; + update(); + accept_event(); + return; } - case KEY_UP: { - if (k->get_alt()) { - keycode_handled = false; - break; + if (k->is_action("ui_page_up", true)) { + completion_index -= get_theme_constant("completion_lines"); + if (completion_index < 0) { + completion_index = 0; } -#ifndef APPLE_STYLE_KEYS - if (k->get_command()) { -#else - if (k->get_command() && k->get_alt()) { -#endif - _scroll_lines_up(); - break; - } - - if (k->get_shift()) { - _pre_shift_selection(); - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - cursor_set_line(0); - } else -#endif - { - int cur_wrap_index = get_cursor_wrap_index(); - if (cur_wrap_index > 0) { - cursor_set_line(cursor.line, true, false, cur_wrap_index - 1); - } else if (cursor.line == 0) { - cursor_set_column(0); - } else { - int new_line = cursor.line - num_lines_from(cursor.line - 1, -1); - if (line_wraps(new_line)) { - cursor_set_line(new_line, true, false, times_line_wraps(new_line)); - } else { - cursor_set_line(new_line, true, false); - } - } - } - - if (k->get_shift()) { - _post_shift_selection(); - } - _cancel_code_hint(); - - } break; - case KEY_KP_2: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; - } - [[fallthrough]]; + completion_current = completion_options[completion_index]; + update(); + accept_event(); + return; } - case KEY_DOWN: { - if (k->get_alt()) { - keycode_handled = false; - break; + if (k->is_action("ui_page_down", true)) { + completion_index += get_theme_constant("completion_lines"); + if (completion_index >= completion_options.size()) { + completion_index = completion_options.size() - 1; } -#ifndef APPLE_STYLE_KEYS - if (k->get_command()) { -#else - if (k->get_command() && k->get_alt()) { -#endif - _scroll_lines_down(); - break; - } - - if (k->get_shift()) { - _pre_shift_selection(); - } - -#ifdef APPLE_STYLE_KEYS - if (k->get_command()) { - cursor_set_line(get_last_unhidden_line(), true, false, 9999); - } else -#endif - { - int cur_wrap_index = get_cursor_wrap_index(); - if (cur_wrap_index < times_line_wraps(cursor.line)) { - cursor_set_line(cursor.line, true, false, cur_wrap_index + 1); - } else if (cursor.line == get_last_unhidden_line()) { - cursor_set_column(text[cursor.line].length()); - } else { - int new_line = cursor.line + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1); - cursor_set_line(new_line, true, false, 0); - } - } - - if (k->get_shift()) { - _post_shift_selection(); - } - _cancel_code_hint(); - - } break; - case KEY_DELETE: { - if (readonly) { - break; - } - - if (k->get_shift() && !k->get_command() && !k->get_alt() && is_shortcut_keys_enabled()) { - cut(); - break; - } - - int curline_len = text[cursor.line].length(); - - if (cursor.line == text.size() - 1 && cursor.column == curline_len) { - break; // Nothing to do. - } - - int next_line = cursor.column < curline_len ? cursor.line : cursor.line + 1; - int next_column; - -#ifdef APPLE_STYLE_KEYS - if (k->get_alt() && cursor.column < curline_len - 1) { -#else - if (k->get_alt()) { - keycode_handled = false; - break; - } else if (k->get_command() && cursor.column < curline_len - 1) { -#endif - - int line = cursor.line; - int column = cursor.column; - - Vector<Vector2i> words = TS->shaped_text_get_word_breaks(text.get_line_data(line)->get_rid()); - for (int i = 0; i < words.size(); i++) { - if (words[i].y > column) { - column = words[i].y; - break; - } - } - - next_line = line; - next_column = column; -#ifdef APPLE_STYLE_KEYS - } else if (k->get_command()) { - next_column = curline_len; - next_line = cursor.line; -#endif - } else { - if (mid_grapheme_caret_enabled) { - next_column = cursor.column < curline_len ? (cursor.column + 1) : 0; - } else { - next_column = cursor.column < curline_len ? TS->shaped_text_next_grapheme_pos(text.get_line_data(cursor.line)->get_rid(), (cursor.column)) : 0; - } - } - - _remove_text(cursor.line, cursor.column, next_line, next_column); + completion_current = completion_options[completion_index]; update(); - - } break; - case KEY_KP_7: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; - } - [[fallthrough]]; + accept_event(); + return; } - case KEY_HOME: { -#ifdef APPLE_STYLE_KEYS - if (k->get_shift()) - _pre_shift_selection(); - - cursor_set_line(0); - - if (k->get_shift()) - _post_shift_selection(); - else if (k->get_command() || k->get_control()) - deselect(); -#else - if (k->get_shift()) { - _pre_shift_selection(); - } - - if (k->get_command()) { - cursor_set_line(0); - cursor_set_column(0); - } else { - // Move cursor column to start of wrapped row and then to start of text. - Vector<String> rows = get_wrap_rows_text(cursor.line); - int wi = get_cursor_wrap_index(); - int row_start_col = 0; - for (int i = 0; i < wi; i++) { - row_start_col += rows[i].length(); - } - if (cursor.column == row_start_col || wi == 0) { - // Compute whitespace symbols seq length. - int current_line_whitespace_len = 0; - while (current_line_whitespace_len < text[cursor.line].length()) { - char32_t c = text[cursor.line][current_line_whitespace_len]; - if (c != '\t' && c != ' ') { - break; - } - current_line_whitespace_len++; - } - - if (cursor_get_column() == current_line_whitespace_len) { - cursor_set_column(0); - } else { - cursor_set_column(current_line_whitespace_len); - } - } else { - cursor_set_column(row_start_col); - } - } - - if (k->get_shift()) { - _post_shift_selection(); - } else if (k->get_command() || k->get_control()) { - deselect(); - } - _cancel_completion(); - completion_hint = ""; -#endif - } break; - case KEY_KP_1: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; + if (k->is_action("ui_home", true)) { + if (completion_index > 0) { + completion_index = 0; + completion_current = completion_options[completion_index]; + update(); } - [[fallthrough]]; + accept_event(); + return; } - case KEY_END: { -#ifdef APPLE_STYLE_KEYS - if (k->get_shift()) - _pre_shift_selection(); - - cursor_set_line(get_last_unhidden_line(), true, false, 9999); - - if (k->get_shift()) - _post_shift_selection(); - else if (k->get_command() || k->get_control()) - deselect(); -#else - if (k->get_shift()) { - _pre_shift_selection(); - } - - if (k->get_command()) { - cursor_set_line(get_last_unhidden_line(), true, false, 9999); - } - - // Move cursor column to end of wrapped row and then to end of text. - Vector<String> rows = get_wrap_rows_text(cursor.line); - int wi = get_cursor_wrap_index(); - int row_end_col = -1; - for (int i = 0; i < wi + 1; i++) { - row_end_col += rows[i].length(); - } - if (wi == rows.size() - 1 || cursor.column == row_end_col) { - cursor_set_column(text[cursor.line].length()); - } else { - cursor_set_column(row_end_col); - } - - if (k->get_shift()) { - _post_shift_selection(); - } else if (k->get_command() || k->get_control()) { - deselect(); - } - - _cancel_completion(); - completion_hint = ""; -#endif - } break; - case KEY_KP_9: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; + if (k->is_action("ui_end", true)) { + if (completion_index < completion_options.size() - 1) { + completion_index = completion_options.size() - 1; + completion_current = completion_options[completion_index]; + update(); } - [[fallthrough]]; + accept_event(); + return; } - case KEY_PAGEUP: { - if (k->get_shift()) { - _pre_shift_selection(); - } - - int wi; - int n_line = cursor.line - num_lines_from_rows(cursor.line, get_cursor_wrap_index(), -get_visible_rows(), wi) + 1; - cursor_set_line(n_line, true, false, wi); - - if (k->get_shift()) { - _post_shift_selection(); - } - + if (k->is_action("ui_accept", true) || k->is_action("ui_text_completion_accept", true)) { + _confirm_completion(); + accept_event(); + return; + } + if (k->is_action("ui_cancel", true)) { _cancel_completion(); - completion_hint = ""; + accept_event(); + return; + } - } break; - case KEY_KP_3: { - if (k->get_unicode() != 0) { - keycode_handled = false; - break; + // Handle Unicode here (if no modifiers active) and update autocomplete. + if (k->get_unicode() >= 32) { + if (allow_unicode_handling && !readonly) { + _handle_unicode_character(k->get_unicode(), had_selection, true); + accept_event(); + return; } - [[fallthrough]]; } - case KEY_PAGEDOWN: { - if (k->get_shift()) { - _pre_shift_selection(); - } - - int wi; - int n_line = cursor.line + num_lines_from_rows(cursor.line, get_cursor_wrap_index(), get_visible_rows(), wi) - 1; - cursor_set_line(n_line, true, false, wi); + } - if (k->get_shift()) { - _post_shift_selection(); - } + // NEWLINES. + if (k->is_action("ui_text_newline_above", true)) { + _new_line(false, true); + accept_event(); + return; + } + if (k->is_action("ui_text_newline_blank", true)) { + _new_line(false); + accept_event(); + return; + } + if (k->is_action("ui_text_newline", true)) { + _new_line(); + accept_event(); + return; + } - _cancel_completion(); - completion_hint = ""; + // INDENTATION. + if (k->is_action("ui_text_dedent", true)) { + _indent_left(); + accept_event(); + return; + } + if (k->is_action("ui_text_indent", true)) { + _indent_right(); + accept_event(); + return; + } - } break; - case KEY_A: { -#ifndef APPLE_STYLE_KEYS - if (!k->get_control() || k->get_shift() || k->get_alt()) { - keycode_handled = false; - break; - } - if (is_shortcut_keys_enabled()) { - select_all(); - } -#else - if ((!k->get_command() && !k->get_control())) { - keycode_handled = false; - break; - } - if (!k->get_shift() && k->get_command() && is_shortcut_keys_enabled()) - select_all(); - else if (k->get_control()) { - if (k->get_shift()) - _pre_shift_selection(); - - int current_line_whitespace_len = 0; - while (current_line_whitespace_len < text[cursor.line].length()) { - char32_t c = text[cursor.line][current_line_whitespace_len]; - if (c != '\t' && c != ' ') - break; - current_line_whitespace_len++; - } + // BACKSPACE AND DELETE. + if (k->is_action("ui_text_backspace_all_to_left", true)) { + _backspace(false, true); + accept_event(); + return; + } + if (k->is_action("ui_text_backspace_word", true)) { + _backspace(true); + accept_event(); + return; + } + if (k->is_action("ui_text_backspace", true)) { + _backspace(); + if (completion_active) { + _update_completion_candidates(); + } + accept_event(); + return; + } + if (k->is_action("ui_text_delete_all_to_right", true)) { + _delete(false, true); + accept_event(); + return; + } + if (k->is_action("ui_text_delete_word", true)) { + _delete(true); + accept_event(); + return; + } + if (k->is_action("ui_text_delete", true)) { + _delete(); + accept_event(); + return; + } - if (cursor_get_column() == current_line_whitespace_len) - cursor_set_column(0); - else - cursor_set_column(current_line_whitespace_len); + // SCROLLING. + if (k->is_action("ui_text_scroll_up", true)) { + _scroll_lines_up(); + accept_event(); + return; + } + if (k->is_action("ui_text_scroll_down", true)) { + _scroll_lines_down(); + accept_event(); + return; + } - if (k->get_shift()) - _post_shift_selection(); - else if (k->get_command() || k->get_control()) - deselect(); - } - } break; - case KEY_E: { - if (!k->get_control() || k->get_command() || k->get_alt()) { - keycode_handled = false; - break; - } + // SELECT ALL, CUT, COPY, PASTE. - if (k->get_shift()) - _pre_shift_selection(); + if (k->is_action("ui_text_select_all", true)) { + select_all(); + accept_event(); + return; + } + if (k->is_action("ui_cut", true)) { + cut(); + accept_event(); + return; + } + if (k->is_action("ui_copy", true)) { + copy(); + accept_event(); + return; + } + if (k->is_action("ui_paste", true)) { + paste(); + accept_event(); + return; + } - if (k->get_command()) - cursor_set_line(text.size() - 1, true, false); - cursor_set_column(text[cursor.line].length()); + // UNDO/REDO. + if (k->is_action("ui_undo", true)) { + undo(); + accept_event(); + return; + } + if (k->is_action("ui_redo", true)) { + redo(); + accept_event(); + return; + } - if (k->get_shift()) - _post_shift_selection(); - else if (k->get_command() || k->get_control()) - deselect(); + // MISC. - _cancel_completion(); + if (k->is_action("ui_menu", true)) { + if (context_menu_enabled) { + menu->set_position(get_screen_transform().xform(_get_cursor_pixel_pos())); + menu->set_size(Vector2(1, 1)); + _generate_context_menu(); + menu->popup(); + menu->grab_focus(); + } + accept_event(); + return; + } + if (k->is_action("ui_text_toggle_insert_mode", true)) { + set_insert_mode(!insert_mode); + accept_event(); + return; + } + if (k->is_action("ui_cancel", true)) { + if (completion_hint != "") { completion_hint = ""; -#endif - } break; - case (KEY_QUOTELEFT): { // Swap current input direction (primary cursor) - if (!k->get_command()) { - keycode_handled = false; - break; - } - - if (input_direction == TEXT_DIRECTION_LTR) { - input_direction = TEXT_DIRECTION_RTL; - } else { - input_direction = TEXT_DIRECTION_LTR; - } - cursor_set_column(cursor.column); update(); - } break; - case KEY_X: { - if (readonly) { - break; - } - if (!k->get_command() || k->get_shift() || k->get_alt()) { - keycode_handled = false; - break; - } - if (is_shortcut_keys_enabled()) { - cut(); - } - - } break; - case KEY_C: { - if (!k->get_command() || k->get_shift() || k->get_alt()) { - keycode_handled = false; - break; - } - - if (is_shortcut_keys_enabled()) { - copy(); - } - - } break; - case KEY_Z: { - if (readonly) { - break; - } - - if (!k->get_command()) { - keycode_handled = false; - break; - } - - if (is_shortcut_keys_enabled()) { - if (k->get_shift()) { - redo(); - } else { - undo(); - } - } - } break; - case KEY_Y: { - if (readonly) { - break; - } - - if (!k->get_command()) { - keycode_handled = false; - break; - } - - if (is_shortcut_keys_enabled()) { - redo(); - } - } break; - case KEY_V: { - if (readonly) { - break; - } - if (!k->get_command() || k->get_shift() || k->get_alt()) { - keycode_handled = false; - break; - } - - if (is_shortcut_keys_enabled()) { - paste(); - } - - } break; - case KEY_SPACE: { -#ifdef OSX_ENABLED - if (completion_enabled && k->get_metakey()) { // cmd-space is spotlight shortcut in OSX -#else - if (completion_enabled && k->get_command()) { -#endif - - query_code_comple(); - keycode_handled = true; - } else { - keycode_handled = false; - } + } + accept_event(); + return; + } + if (k->is_action("ui_swap_input_direction", true)) { + _swap_current_input_direction(); + accept_event(); + return; + } - } break; + // CURSOR MOVEMENT - case KEY_MENU: { - if (context_menu_enabled) { - menu->set_position(get_screen_transform().xform(_get_cursor_pixel_pos())); - menu->set_size(Vector2(1, 1)); - menu->popup(); - menu->grab_focus(); - } - } break; + k = k->duplicate(); + bool shift_pressed = k->get_shift(); + // Remove shift or else actions will not match. Use above variable for selection. + k->set_shift(false); - default: { - keycode_handled = false; - } break; + // CURSOR MOVEMENT - LEFT, RIGHT. + if (k->is_action("ui_text_caret_word_left", true)) { + _move_cursor_left(shift_pressed, true); + accept_event(); + return; } - - if (keycode_handled) { + if (k->is_action("ui_text_caret_left", true)) { + _move_cursor_left(shift_pressed, false); accept_event(); + return; } - - if (k->get_keycode() == KEY_INSERT) { - set_insert_mode(!insert_mode); + if (k->is_action("ui_text_caret_word_right", true)) { + _move_cursor_right(shift_pressed, true); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_right", true)) { + _move_cursor_right(shift_pressed, false); accept_event(); return; } - if (!keycode_handled && !k->get_command()) { // For German keyboards. - - if (k->get_unicode() >= 32) { - if (readonly) { - return; - } - - // Remove the old character if in insert mode and no selection. - if (insert_mode && !had_selection) { - begin_complex_operation(); - - // Make sure we don't try and remove empty space. - if (cursor.column < get_line(cursor.line).length()) { - _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); - } - } - - const char32_t chr[2] = { (char32_t)k->get_unicode(), 0 }; + // CURSOR MOVEMENT - UP, DOWN. + if (k->is_action("ui_text_caret_up", true)) { + _move_cursor_up(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_down", true)) { + _move_cursor_down(shift_pressed); + accept_event(); + return; + } - if (completion_hint != "" && k->get_unicode() == ')') { - completion_hint = ""; - } - if (auto_brace_completion_enabled && _is_pair_symbol(chr[0])) { - _consume_pair_symbol(chr[0]); - } else { - _insert_text_at_cursor(chr); - } + // CURSOR MOVEMENT - DOCUMENT START/END. + if (k->is_action("ui_text_caret_document_start", true)) { // && shift_pressed) { + _move_cursor_document_start(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_document_end", true)) { // && shift_pressed) { + _move_cursor_document_end(shift_pressed); + accept_event(); + return; + } - if (insert_mode && !had_selection) { - end_complex_operation(); - } + // CURSOR MOVEMENT - LINE START/END. + if (k->is_action("ui_text_caret_line_start", true)) { + _move_cursor_to_line_start(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_line_end", true)) { + _move_cursor_to_line_end(shift_pressed); + accept_event(); + return; + } - if (selection.active != had_selection) { - end_complex_operation(); - } - accept_event(); - } + // CURSOR MOVEMENT - PAGE UP/DOWN. + if (k->is_action("ui_text_caret_page_up", true)) { + _move_cursor_page_up(shift_pressed); + accept_event(); + return; + } + if (k->is_action("ui_text_caret_page_down", true)) { + _move_cursor_page_down(shift_pressed); + accept_event(); + return; } - return; + if (allow_unicode_handling && !readonly && k->get_unicode() >= 32) { + // Handle Unicode (if no modifiers active). + _handle_unicode_character(k->get_unicode(), had_selection, false); + accept_event(); + return; + } } } @@ -4109,25 +3887,50 @@ int TextEdit::_get_control_height() const { return control_height; } +int TextEdit::_get_menu_action_accelerator(const String &p_action) { + const List<Ref<InputEvent>> *events = InputMap::get_singleton()->action_get_events(p_action); + if (!events) { + return 0; + } + + // Use first event in the list for the accelerator. + const List<Ref<InputEvent>>::Element *first_event = events->front(); + if (!first_event) { + return 0; + } + + const Ref<InputEventKey> event = first_event->get(); + if (event.is_null()) { + return 0; + } + + // Use physical keycode if non-zero + if (event->get_physical_keycode() != 0) { + return event->get_physical_keycode_with_modifiers(); + } else { + return event->get_keycode_with_modifiers(); + } +} + void TextEdit::_generate_context_menu() { // Reorganize context menu. menu->clear(); if (!readonly) { - menu->add_item(RTR("Cut"), MENU_CUT, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_X : 0); + menu->add_item(RTR("Cut"), MENU_CUT, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_cut") : 0); } - menu->add_item(RTR("Copy"), MENU_COPY, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_C : 0); + menu->add_item(RTR("Copy"), MENU_COPY, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_copy") : 0); if (!readonly) { - menu->add_item(RTR("Paste"), MENU_PASTE, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_V : 0); + menu->add_item(RTR("Paste"), MENU_PASTE, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_paste") : 0); } menu->add_separator(); if (is_selecting_enabled()) { - menu->add_item(RTR("Select All"), MENU_SELECT_ALL, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_A : 0); + menu->add_item(RTR("Select All"), MENU_SELECT_ALL, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_text_select_all") : 0); } if (!readonly) { menu->add_item(RTR("Clear"), MENU_CLEAR); menu->add_separator(); - menu->add_item(RTR("Undo"), MENU_UNDO, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_Z : 0); - menu->add_item(RTR("Redo"), MENU_REDO, is_shortcut_keys_enabled() ? KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z : 0); + menu->add_item(RTR("Undo"), MENU_UNDO, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_undo") : 0); + menu->add_item(RTR("Redo"), MENU_REDO, is_shortcut_keys_enabled() ? _get_menu_action_accelerator("ui_redo") : 0); } menu->add_separator(); menu->add_submenu_item(RTR("Text writing direction"), "DirMenu"); @@ -5217,6 +5020,10 @@ void TextEdit::set_auto_indent(bool p_auto_indent) { } void TextEdit::cut() { + if (readonly) { + return; + } + if (!selection.active) { String clipboard = text[cursor.line]; DisplayServer::get_singleton()->clipboard_set(clipboard); @@ -5264,6 +5071,10 @@ void TextEdit::copy() { } void TextEdit::paste() { + if (readonly) { + return; + } + String clipboard = DisplayServer::get_singleton()->clipboard_get(); begin_complex_operation(); @@ -5967,6 +5778,10 @@ void TextEdit::_clear_redo() { } void TextEdit::undo() { + if (readonly) { + return; + } + _push_current_op(); if (undo_stack_pos == nullptr) { @@ -6017,6 +5832,9 @@ void TextEdit::undo() { } void TextEdit::redo() { + if (readonly) { + return; + } _push_current_op(); if (undo_stack_pos == nullptr) { diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index f50585d9e9..b0c7314c65 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -408,6 +408,7 @@ private: int _get_control_height() const; Point2 _get_local_mouse_pos() const; + int _get_menu_action_accelerator(const String &p_action); void _reset_caret_blink_timer(); void _toggle_draw_caret(); @@ -441,6 +442,26 @@ private: int _calculate_spaces_till_next_left_indent(int column); int _calculate_spaces_till_next_right_indent(int column); + // Methods used in shortcuts + void _swap_current_input_direction(); + void _new_line(bool p_split_current = true, bool p_above = false); + void _indent_right(); + void _indent_left(); + void _move_cursor_left(bool p_select, bool p_move_by_word = false); + void _move_cursor_right(bool p_select, bool p_move_by_word = false); + void _move_cursor_up(bool p_select); + void _move_cursor_down(bool p_select); + void _move_cursor_to_line_start(bool p_select); + void _move_cursor_to_line_end(bool p_select); + void _move_cursor_page_up(bool p_select); + void _move_cursor_page_down(bool p_select); + void _backspace(bool p_word = false, bool p_all_to_left = false); + void _delete(bool p_word = false, bool p_all_to_right = false); + void _delete_selection(); + void _move_cursor_document_start(bool p_select); + void _move_cursor_document_end(bool p_select); + void _handle_unicode_character(uint32_t unicode, bool p_had_selection, bool p_update_auto_complete); + protected: struct Cache { Ref<Texture2D> tab_icon; @@ -639,8 +660,8 @@ public: int get_row_height() const; void backspace_at_cursor(); - void indent_left(); - void indent_right(); + void indent_selected_lines_left(); + void indent_selected_lines_right(); int get_indent_level(int p_line) const; bool is_line_comment(int p_line) const; diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 384e7d2652..ce7d6ef13c 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -49,7 +49,7 @@ Error HTTPRequest::_parse_url(const String &p_url) { got_response = false; body_len = -1; body.resize(0); - downloaded = 0; + downloaded.set(0); redirections = 0; String url_lower = url.to_lower(); @@ -159,9 +159,9 @@ Error HTTPRequest::request_raw(const String &p_url, const Vector<String> &p_cust requesting = true; - if (use_threads) { - thread_done = false; - thread_request_quit = false; + if (use_threads.is_set()) { + thread_done.clear(); + thread_request_quit.clear(); client->set_blocking_mode(true); thread.start(_thread_func, this); } else { @@ -186,7 +186,7 @@ void HTTPRequest::_thread_func(void *p_userdata) { if (err != OK) { hr->call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); } else { - while (!hr->thread_request_quit) { + while (!hr->thread_request_quit.is_set()) { bool exit = hr->_update_connection(); if (exit) { break; @@ -195,7 +195,7 @@ void HTTPRequest::_thread_func(void *p_userdata) { } } - hr->thread_done = true; + hr->thread_done.set(); } void HTTPRequest::cancel_request() { @@ -205,10 +205,10 @@ void HTTPRequest::cancel_request() { return; } - if (!use_threads) { + if (!use_threads.is_set()) { set_process_internal(false); } else { - thread_request_quit = true; + thread_request_quit.set(); thread.wait_to_finish(); } @@ -236,7 +236,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { List<String> rheaders; client->get_response_headers(&rheaders); response_headers.resize(0); - downloaded = 0; + downloaded.set(0); for (List<String>::Element *E = rheaders.front(); E; E = E->next()) { response_headers.push_back(E->get()); } @@ -276,7 +276,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { got_response = false; body_len = -1; body.resize(0); - downloaded = 0; + downloaded.set(0); redirections = new_redirs; *ret_value = false; return true; @@ -389,7 +389,7 @@ bool HTTPRequest::_update_connection() { client->poll(); PackedByteArray chunk = client->read_response_body_chunk(); - downloaded += chunk.size(); + downloaded.add(chunk.size()); if (file) { const uint8_t *r = chunk.ptr(); @@ -402,13 +402,13 @@ bool HTTPRequest::_update_connection() { body.append_array(chunk); } - if (body_size_limit >= 0 && downloaded > body_size_limit) { + if (body_size_limit >= 0 && downloaded.get() > body_size_limit) { call_deferred("_request_done", RESULT_BODY_SIZE_LIMIT_EXCEEDED, response_code, response_headers, PackedByteArray()); return true; } if (body_len >= 0) { - if (downloaded == body_len) { + if (downloaded.get() == body_len) { call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, body); return true; } @@ -478,7 +478,7 @@ void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArra void HTTPRequest::_notification(int p_what) { if (p_what == NOTIFICATION_INTERNAL_PROCESS) { - if (use_threads) { + if (use_threads.is_set()) { return; } bool done = _update_connection(); @@ -497,11 +497,11 @@ void HTTPRequest::_notification(int p_what) { void HTTPRequest::set_use_threads(bool p_use) { ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED); - use_threads = p_use; + use_threads.set_to(p_use); } bool HTTPRequest::is_using_threads() const { - return use_threads; + return use_threads.is_set(); } void HTTPRequest::set_accept_gzip(bool p_gzip) { @@ -555,7 +555,7 @@ int HTTPRequest::get_max_redirects() const { } int HTTPRequest::get_downloaded_bytes() const { - return downloaded; + return downloaded.get(); } int HTTPRequest::get_body_size() const { diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 5525ea7912..92b0ff28e9 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -34,6 +34,7 @@ #include "core/io/http_client.h" #include "core/os/file_access.h" #include "core/os/thread.h" +#include "core/templates/safe_refcount.h" #include "node.h" #include "scene/main/timer.h" @@ -74,7 +75,7 @@ private: bool request_sent = false; Ref<HTTPClient> client; PackedByteArray body; - volatile bool use_threads = false; + SafeFlag use_threads; bool accept_gzip = true; bool got_response = false; @@ -86,7 +87,7 @@ private: FileAccess *file = nullptr; int body_len = -1; - volatile int downloaded = 0; + SafeNumeric<int> downloaded; int body_size_limit = -1; int redirections = 0; @@ -107,8 +108,8 @@ private: bool has_header(const PackedStringArray &p_headers, const String &p_header_name); String get_header_value(const PackedStringArray &p_headers, const String &header_name); - volatile bool thread_done = false; - volatile bool thread_request_quit = false; + SafeFlag thread_done; + SafeFlag thread_request_quit; Thread thread; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index ff46c06128..f0c562260f 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -46,7 +46,7 @@ #include <stdint.h> -VARIANT_ENUM_CAST(Node::PauseMode); +VARIANT_ENUM_CAST(Node::ProcessMode); int Node::orphan_node_count = 0; @@ -69,14 +69,14 @@ void Node::_notification(int p_notification) { ERR_FAIL_COND(!get_viewport()); ERR_FAIL_COND(!get_tree()); - if (data.pause_mode == PAUSE_MODE_INHERIT) { + if (data.process_mode == PROCESS_MODE_INHERIT) { if (data.parent) { - data.pause_owner = data.parent->data.pause_owner; + data.process_owner = data.parent->data.process_owner; } else { - data.pause_owner = nullptr; + data.process_owner = nullptr; } } else { - data.pause_owner = this; + data.process_owner = this; } if (data.input) { @@ -110,7 +110,7 @@ void Node::_notification(int p_notification) { remove_from_group("_vp_unhandled_key_input" + itos(get_viewport()->get_instance_id())); } - data.pause_owner = nullptr; + data.process_owner = nullptr; if (data.path_cache) { memdelete(data.path_cache); data.path_cache = nullptr; @@ -391,44 +391,81 @@ bool Node::is_physics_processing_internal() const { return data.physics_process_internal; } -void Node::set_pause_mode(PauseMode p_mode) { - if (data.pause_mode == p_mode) { +void Node::set_process_mode(ProcessMode p_mode) { + if (data.process_mode == p_mode) { return; } - bool prev_inherits = data.pause_mode == PAUSE_MODE_INHERIT; - data.pause_mode = p_mode; if (!is_inside_tree()) { - return; //pointless - } - if ((data.pause_mode == PAUSE_MODE_INHERIT) == prev_inherits) { - return; ///nothing changed + data.process_mode = p_mode; + return; } - Node *owner = nullptr; + bool prev_can_process = can_process(); - if (data.pause_mode == PAUSE_MODE_INHERIT) { + data.process_mode = p_mode; + + if (data.process_mode == PROCESS_MODE_INHERIT) { if (data.parent) { - owner = data.parent->data.pause_owner; + data.process_owner = data.parent->data.owner; + } else { + data.process_owner = nullptr; } } else { - owner = this; + data.process_owner = this; + } + + bool next_can_process = can_process(); + + int pause_notification = 0; + + if (prev_can_process && !next_can_process) { + pause_notification = NOTIFICATION_PAUSED; + } else if (!prev_can_process && next_can_process) { + pause_notification = NOTIFICATION_UNPAUSED; + } + + _propagate_process_owner(data.process_owner, pause_notification); +#ifdef TOOLS_ENABLED + // This is required for the editor to update the visibility of disabled nodes + // Its very expensive during runtime to change, so editor-only + if (Engine::get_singleton()->is_editor_hint()) { + get_tree()->emit_signal("tree_process_mode_changed"); + } +#endif +} + +void Node::_propagate_pause_notification(bool p_enable) { + bool prev_can_process = _can_process(!p_enable); + bool next_can_process = _can_process(p_enable); + + if (prev_can_process && !next_can_process) { + notification(NOTIFICATION_PAUSED); + } else if (!prev_can_process && next_can_process) { + notification(NOTIFICATION_UNPAUSED); } - _propagate_pause_owner(owner); + for (int i = 0; i < data.children.size(); i++) { + data.children[i]->_propagate_pause_notification(p_enable); + } } -Node::PauseMode Node::get_pause_mode() const { - return data.pause_mode; +Node::ProcessMode Node::get_process_mode() const { + return data.process_mode; } -void Node::_propagate_pause_owner(Node *p_owner) { - if (this != p_owner && data.pause_mode != PAUSE_MODE_INHERIT) { - return; +void Node::_propagate_process_owner(Node *p_owner, int p_notification) { + data.process_owner = p_owner; + + if (p_notification != 0) { + notification(p_notification); } - data.pause_owner = p_owner; + for (int i = 0; i < data.children.size(); i++) { - data.children[i]->_propagate_pause_owner(p_owner); + Node *c = data.children[i]; + if (c->data.process_mode == PROCESS_MODE_INHERIT) { + c->_propagate_process_owner(p_owner, p_notification); + } } } @@ -805,30 +842,33 @@ bool Node::can_process_notification(int p_what) const { bool Node::can_process() const { ERR_FAIL_COND_V(!is_inside_tree(), false); + return _can_process(get_tree()->is_paused()); +} - if (get_tree()->is_paused()) { - if (data.pause_mode == PAUSE_MODE_STOP) { - return false; - } - if (data.pause_mode == PAUSE_MODE_PROCESS) { - return true; - } - if (data.pause_mode == PAUSE_MODE_INHERIT) { - if (!data.pause_owner) { - return false; //clearly no pause owner by default - } - - if (data.pause_owner->data.pause_mode == PAUSE_MODE_PROCESS) { - return true; - } +bool Node::_can_process(bool p_paused) const { + ProcessMode process_mode; - if (data.pause_owner->data.pause_mode == PAUSE_MODE_STOP) { - return false; - } + if (data.process_mode == PROCESS_MODE_INHERIT) { + if (!data.process_owner) { + process_mode = PROCESS_MODE_PAUSABLE; + } else { + process_mode = data.process_owner->data.process_mode; } + } else { + process_mode = data.process_mode; } - return true; + if (process_mode == PROCESS_MODE_DISABLED) { + return false; + } else if (process_mode == PROCESS_MODE_ALWAYS) { + return true; + } + + if (p_paused) { + return process_mode == PROCESS_MODE_WHEN_PAUSED; + } else { + return process_mode == PROCESS_MODE_PAUSABLE; + } } float Node::get_physics_process_delta_time() const { @@ -1898,15 +1938,11 @@ String Node::get_filename() const { } void Node::set_editor_description(const String &p_editor_description) { - set_meta("_editor_description_", p_editor_description); + data.editor_description = p_editor_description; } String Node::get_editor_description() const { - if (has_meta("_editor_description_")) { - return get_meta("_editor_description_"); - } else { - return ""; - } + return data.editor_description; } void Node::set_editable_instance(Node *p_node, bool p_editable) { @@ -1930,6 +1966,23 @@ bool Node::is_editable_instance(const Node *p_node) const { return p_node->data.editable_instance; } +Node *Node::get_deepest_editable_node(Node *p_start_node) const { + ERR_FAIL_NULL_V(p_start_node, nullptr); + ERR_FAIL_COND_V(!is_a_parent_of(p_start_node), nullptr); + + Node const *iterated_item = p_start_node; + Node *node = p_start_node; + + while (iterated_item->get_owner() && iterated_item->get_owner() != this) { + if (!is_editable_instance(iterated_item->get_owner())) + node = iterated_item->get_owner(); + + iterated_item = iterated_item->get_owner(); + } + + return node; +} + void Node::set_scene_instance_state(const Ref<SceneState> &p_state) { data.instance_state = p_state; } @@ -2783,8 +2836,8 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("is_processing_unhandled_input"), &Node::is_processing_unhandled_input); ClassDB::bind_method(D_METHOD("set_process_unhandled_key_input", "enable"), &Node::set_process_unhandled_key_input); ClassDB::bind_method(D_METHOD("is_processing_unhandled_key_input"), &Node::is_processing_unhandled_key_input); - ClassDB::bind_method(D_METHOD("set_pause_mode", "mode"), &Node::set_pause_mode); - ClassDB::bind_method(D_METHOD("get_pause_mode"), &Node::get_pause_mode); + ClassDB::bind_method(D_METHOD("set_process_mode", "mode"), &Node::set_process_mode); + ClassDB::bind_method(D_METHOD("get_process_mode"), &Node::get_process_mode); ClassDB::bind_method(D_METHOD("can_process"), &Node::can_process); ClassDB::bind_method(D_METHOD("print_stray_nodes"), &Node::_print_stray_nodes); @@ -2822,12 +2875,12 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("rpc_config", "method", "mode"), &Node::rpc_config); ClassDB::bind_method(D_METHOD("rset_config", "property", "mode"), &Node::rset_config); - ClassDB::bind_method(D_METHOD("_set_editor_description", "editor_description"), &Node::set_editor_description); - ClassDB::bind_method(D_METHOD("_get_editor_description"), &Node::get_editor_description); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "editor_description", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "_set_editor_description", "_get_editor_description"); + ClassDB::bind_method(D_METHOD("set_editor_description", "editor_description"), &Node::set_editor_description); + ClassDB::bind_method(D_METHOD("get_editor_description"), &Node::get_editor_description); ClassDB::bind_method(D_METHOD("_set_import_path", "import_path"), &Node::set_import_path); ClassDB::bind_method(D_METHOD("_get_import_path"), &Node::get_import_path); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "_import_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_import_path", "_get_import_path"); { @@ -2891,9 +2944,11 @@ void Node::_bind_methods() { BIND_CONSTANT(NOTIFICATION_APPLICATION_FOCUS_OUT); BIND_CONSTANT(NOTIFICATION_TEXT_SERVER_CHANGED); - BIND_ENUM_CONSTANT(PAUSE_MODE_INHERIT); - BIND_ENUM_CONSTANT(PAUSE_MODE_STOP); - BIND_ENUM_CONSTANT(PAUSE_MODE_PROCESS); + BIND_ENUM_CONSTANT(PROCESS_MODE_INHERIT); + BIND_ENUM_CONSTANT(PROCESS_MODE_PAUSABLE); + BIND_ENUM_CONSTANT(PROCESS_MODE_WHEN_PAUSED); + BIND_ENUM_CONSTANT(PROCESS_MODE_ALWAYS); + BIND_ENUM_CONSTANT(PROCESS_MODE_DISABLED); BIND_ENUM_CONSTANT(DUPLICATE_SIGNALS); BIND_ENUM_CONSTANT(DUPLICATE_GROUPS); @@ -2906,15 +2961,19 @@ void Node::_bind_methods() { ADD_SIGNAL(MethodInfo("tree_exiting")); ADD_SIGNAL(MethodInfo("tree_exited")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "pause_mode", PROPERTY_HINT_ENUM, "Inherit,Stop,Process"), "set_pause_mode", "get_pause_mode"); - ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", 0), "set_filename", "get_filename"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer"); + + ADD_GROUP("Process", "process_"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Inherit,Pausable,WhenPaused,Always,Disabled"), "set_process_mode", "get_process_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "process_priority"), "set_process_priority", "get_process_priority"); + ADD_GROUP("Editor Description", "editor_"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "editor_description", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_INTERNAL), "set_editor_description", "get_editor_description"); + BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::FLOAT, "delta"))); BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::FLOAT, "delta"))); BIND_VMETHOD(MethodInfo("_enter_tree")); diff --git a/scene/main/node.h b/scene/main/node.h index 66104b5cf5..249a0ff86e 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -46,10 +46,12 @@ class Node : public Object { OBJ_CATEGORY("Nodes"); public: - enum PauseMode { - PAUSE_MODE_INHERIT, - PAUSE_MODE_STOP, - PAUSE_MODE_PROCESS + enum ProcessMode { + PROCESS_MODE_INHERIT, // same as parent node + PROCESS_MODE_PAUSABLE, // process only if not paused + PROCESS_MODE_WHEN_PAUSED, // process only if paused + PROCESS_MODE_ALWAYS, // process always + PROCESS_MODE_DISABLED, // never process }; enum DuplicateFlags { @@ -102,6 +104,7 @@ private: #ifdef TOOLS_ENABLED NodePath import_path; // Path used when imported, used by scene editors to keep tracking. #endif + String editor_description; Viewport *viewport = nullptr; @@ -109,8 +112,8 @@ private: List<Node *>::Element *OW = nullptr; // Owned element. List<Node *> owned; - PauseMode pause_mode = PAUSE_MODE_INHERIT; - Node *pause_owner = nullptr; + ProcessMode process_mode = PROCESS_MODE_INHERIT; + Node *process_owner = nullptr; int network_master = 1; // Server by default. Vector<NetData> rpc_methods; @@ -166,7 +169,7 @@ private: void _propagate_after_exit_tree(); void _propagate_validate_owner(); void _print_stray_nodes(); - void _propagate_pause_owner(Node *p_owner); + void _propagate_process_owner(Node *p_owner, int p_notification); Array _get_node_and_resource(const NodePath &p_path); void _duplicate_signals(const Node *p_original, Node *p_copy) const; @@ -184,6 +187,9 @@ private: friend class SceneTree; void _set_tree(SceneTree *p_tree); + void _propagate_pause_notification(bool p_enable); + + _FORCE_INLINE_ bool _can_process(bool p_paused) const; #ifdef TOOLS_ENABLED friend class SceneTreeEditor; @@ -324,6 +330,7 @@ public: void set_editable_instance(Node *p_node, bool p_editable); bool is_editable_instance(const Node *p_node) const; + Node *get_deepest_editable_node(Node *p_start_node) const; /* NOTIFICATIONS */ @@ -381,8 +388,8 @@ public: void replace_by(Node *p_node, bool p_keep_data = false); - void set_pause_mode(PauseMode p_mode); - PauseMode get_pause_mode() const; + void set_process_mode(ProcessMode p_mode); + ProcessMode get_process_mode() const; bool can_process() const; bool can_process_notification(int p_what) const; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 806ae9280d..9f32c65f7b 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -72,12 +72,12 @@ float SceneTreeTimer::get_time_left() const { return time_left; } -void SceneTreeTimer::set_pause_mode_process(bool p_pause_mode_process) { - process_pause = p_pause_mode_process; +void SceneTreeTimer::set_process_always(bool p_process_always) { + process_always = p_process_always; } -bool SceneTreeTimer::is_pause_mode_process() { - return process_pause; +bool SceneTreeTimer::is_process_always() { + return process_always; } void SceneTreeTimer::release_connections() { @@ -455,7 +455,7 @@ bool SceneTree::process(float p_time) { for (List<Ref<SceneTreeTimer>>::Element *E = timers.front(); E;) { List<Ref<SceneTreeTimer>>::Element *N = E->next(); - if (pause && !E->get()->is_pause_mode_process()) { + if (paused && !E->get()->is_process_always()) { if (E == L) { break; //break on last, so if new timers were added during list traversal, ignore them. } @@ -759,20 +759,20 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() { } void SceneTree::set_pause(bool p_enabled) { - if (p_enabled == pause) { + if (p_enabled == paused) { return; } - pause = p_enabled; + paused = p_enabled; NavigationServer3D::get_singleton()->set_active(!p_enabled); PhysicsServer3D::get_singleton()->set_active(!p_enabled); PhysicsServer2D::get_singleton()->set_active(!p_enabled); if (get_root()) { - get_root()->propagate_notification(p_enabled ? Node::NOTIFICATION_PAUSED : Node::NOTIFICATION_UNPAUSED); + get_root()->_propagate_pause_notification(p_enabled); } } bool SceneTree::is_paused() const { - return pause; + return paused; } void SceneTree::_notify_group_pause(const StringName &p_group, int p_notification) { @@ -1070,10 +1070,10 @@ void SceneTree::add_current_scene(Node *p_current) { root->add_child(p_current); } -Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_pause) { +Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_always) { Ref<SceneTreeTimer> stt; stt.instance(); - stt->set_pause_mode_process(p_process_pause); + stt->set_process_always(p_process_always); stt->set_time_left(p_delay_sec); timers.push_back(stt); return stt; @@ -1186,7 +1186,7 @@ void SceneTree::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pause", "enable"), &SceneTree::set_pause); ClassDB::bind_method(D_METHOD("is_paused"), &SceneTree::is_paused); - ClassDB::bind_method(D_METHOD("create_timer", "time_sec", "pause_mode_process"), &SceneTree::create_timer, DEFVAL(true)); + ClassDB::bind_method(D_METHOD("create_timer", "time_sec", "process_always"), &SceneTree::create_timer, DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_node_count"), &SceneTree::get_node_count); ClassDB::bind_method(D_METHOD("get_frame"), &SceneTree::get_frame); @@ -1254,6 +1254,7 @@ void SceneTree::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "multiplayer_poll"), "set_multiplayer_poll_enabled", "is_multiplayer_poll_enabled"); ADD_SIGNAL(MethodInfo("tree_changed")); + ADD_SIGNAL(MethodInfo("tree_process_mode_changed")); //editor only signal, but due to API hash it cant be removed in run-time ADD_SIGNAL(MethodInfo("node_added", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); ADD_SIGNAL(MethodInfo("node_removed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); ADD_SIGNAL(MethodInfo("node_renamed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node"))); @@ -1326,7 +1327,7 @@ SceneTree::SceneTree() { if (singleton == nullptr) { singleton = this; } - debug_collisions_color = GLOBAL_DEF("debug/shapes/collision/shape_color", Color(0.0, 0.6, 0.7, 0.5)); + debug_collisions_color = GLOBAL_DEF("debug/shapes/collision/shape_color", Color(0.0, 0.6, 0.7, 0.42)); debug_collision_contact_color = GLOBAL_DEF("debug/shapes/collision/contact_color", Color(1.0, 0.2, 0.1, 0.8)); debug_navigation_color = GLOBAL_DEF("debug/shapes/navigation/geometry_color", Color(0.1, 1.0, 0.7, 0.4)); debug_navigation_disabled_color = GLOBAL_DEF("debug/shapes/navigation/disabled_geometry_color", Color(1.0, 0.7, 0.1, 0.4)); diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 35622c2031..f39780831f 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -52,7 +52,7 @@ class SceneTreeTimer : public Reference { GDCLASS(SceneTreeTimer, Reference); float time_left = 0.0; - bool process_pause = true; + bool process_always = true; protected: static void _bind_methods(); @@ -61,8 +61,8 @@ public: void set_time_left(float p_time); float get_time_left() const; - void set_pause_mode_process(bool p_pause_mode_process); - bool is_pause_mode_process(); + void set_process_always(bool p_process_always); + bool is_process_always(); void release_connections(); @@ -95,7 +95,7 @@ private: bool debug_collisions_hint = false; bool debug_navigation_hint = false; #endif - bool pause = false; + bool paused = false; int root_lock = 0; Map<StringName, Group> group_map; @@ -316,7 +316,7 @@ public: Error change_scene_to(const Ref<PackedScene> &p_scene); Error reload_current_scene(); - Ref<SceneTreeTimer> create_timer(float p_delay_sec, bool p_process_pause = true); + Ref<SceneTreeTimer> create_timer(float p_delay_sec, bool p_process_always = true); //used by Main::start, don't use otherwise void add_current_scene(Node *p_current); diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 3661b6c394..4bc159f6aa 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -46,7 +46,7 @@ void Timer::_notification(int p_what) { } } break; case NOTIFICATION_INTERNAL_PROCESS: { - if (!processing || timer_process_mode == TIMER_PROCESS_PHYSICS || !is_processing_internal()) { + if (!processing || timer_process_callback == TIMER_PROCESS_PHYSICS || !is_processing_internal()) { return; } time_left -= get_process_delta_time(); @@ -63,7 +63,7 @@ void Timer::_notification(int p_what) { } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { - if (!processing || timer_process_mode == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) { + if (!processing || timer_process_callback == TIMER_PROCESS_IDLE || !is_physics_processing_internal()) { return; } time_left -= get_physics_process_delta_time(); @@ -143,12 +143,12 @@ float Timer::get_time_left() const { return time_left > 0 ? time_left : 0; } -void Timer::set_timer_process_mode(TimerProcessMode p_mode) { - if (timer_process_mode == p_mode) { +void Timer::set_timer_process_callback(TimerProcessCallback p_callback) { + if (timer_process_callback == p_callback) { return; } - switch (timer_process_mode) { + switch (timer_process_callback) { case TIMER_PROCESS_PHYSICS: if (is_physics_processing_internal()) { set_physics_process_internal(false); @@ -162,15 +162,15 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) { } break; } - timer_process_mode = p_mode; + timer_process_callback = p_callback; } -Timer::TimerProcessMode Timer::get_timer_process_mode() const { - return timer_process_mode; +Timer::TimerProcessCallback Timer::get_timer_process_callback() const { + return timer_process_callback; } void Timer::_set_process(bool p_process, bool p_force) { - switch (timer_process_mode) { + switch (timer_process_callback) { case TIMER_PROCESS_PHYSICS: set_physics_process_internal(p_process && !paused); break; @@ -201,12 +201,12 @@ void Timer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_time_left"), &Timer::get_time_left); - ClassDB::bind_method(D_METHOD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); - ClassDB::bind_method(D_METHOD("get_timer_process_mode"), &Timer::get_timer_process_mode); + ClassDB::bind_method(D_METHOD("set_timer_process_callback", "callback"), &Timer::set_timer_process_callback); + ClassDB::bind_method(D_METHOD("get_timer_process_callback"), &Timer::get_timer_process_callback); ADD_SIGNAL(MethodInfo("timeout")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "process_mode", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_mode", "get_timer_process_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "process_callback", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_timer_process_callback", "get_timer_process_callback"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "wait_time", PROPERTY_HINT_EXP_RANGE, "0.001,4096,0.001,or_greater"), "set_wait_time", "get_wait_time"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart"); diff --git a/scene/main/timer.h b/scene/main/timer.h index 672290cf50..3d9e21d7fc 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -49,7 +49,7 @@ protected: static void _bind_methods(); public: - enum TimerProcessMode { + enum TimerProcessCallback { TIMER_PROCESS_PHYSICS, TIMER_PROCESS_IDLE, }; @@ -73,15 +73,15 @@ public: float get_time_left() const; - void set_timer_process_mode(TimerProcessMode p_mode); - TimerProcessMode get_timer_process_mode() const; + void set_timer_process_callback(TimerProcessCallback p_callback); + TimerProcessCallback get_timer_process_callback() const; Timer(); private: - TimerProcessMode timer_process_mode = TIMER_PROCESS_IDLE; + TimerProcessCallback timer_process_callback = TIMER_PROCESS_IDLE; void _set_process(bool p_process, bool p_force = false); }; -VARIANT_ENUM_CAST(Timer::TimerProcessMode); +VARIANT_ENUM_CAST(Timer::TimerProcessCallback); #endif // TIMER_H diff --git a/scene/main/window.cpp b/scene/main/window.cpp index fc9bbeab94..8198fa41c5 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -881,10 +881,6 @@ bool Window::_can_consume_input_events() const { } void Window::_window_input(const Ref<InputEvent> &p_ev) { - if (Engine::get_singleton()->is_editor_hint() && (Object::cast_to<InputEventJoypadButton>(p_ev.ptr()) || Object::cast_to<InputEventJoypadMotion>(*p_ev))) { - return; //avoid joy input on editor - } - if (EngineDebugger::is_active()) { //quit from game window using F8 Ref<InputEventKey> k = p_ev; @@ -1349,8 +1345,8 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("has_focus"), &Window::has_focus); ClassDB::bind_method(D_METHOD("grab_focus"), &Window::grab_focus); - ClassDB::bind_method(D_METHOD("set_ime_active"), &Window::set_ime_active); - ClassDB::bind_method(D_METHOD("set_ime_position"), &Window::set_ime_position); + ClassDB::bind_method(D_METHOD("set_ime_active", "active"), &Window::set_ime_active); + ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &Window::set_ime_position); ClassDB::bind_method(D_METHOD("is_embedded"), &Window::is_embedded); diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 3725d855f4..acf7319339 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -85,6 +85,9 @@ void CapsuleShape2D::draw(const RID &p_to_rid, const Color &p_color) { Vector<Color> col; col.push_back(p_color); RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col); + RenderingServer::get_singleton()->canvas_item_add_polyline(p_to_rid, points, col); + // Draw the last segment as it's not drawn by `canvas_item_add_polyline()`. + RenderingServer::get_singleton()->canvas_item_add_line(p_to_rid, points[points.size() - 1], points[0], p_color); } Rect2 CapsuleShape2D::get_rect() const { diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 735bf47482..a8a9c42fbd 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -79,6 +79,9 @@ void CircleShape2D::draw(const RID &p_to_rid, const Color &p_color) { Vector<Color> col; col.push_back(p_color); RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col); + RenderingServer::get_singleton()->canvas_item_add_polyline(p_to_rid, points, col); + // Draw the last segment as it's not drawn by `canvas_item_add_polyline()`. + RenderingServer::get_singleton()->canvas_item_add_line(p_to_rid, points[points.size() - 1], points[0], p_color); } CircleShape2D::CircleShape2D() : diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index b4b200a7ff..7271614995 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -75,6 +75,9 @@ void ConvexPolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) { Vector<Color> col; col.push_back(p_color); RenderingServer::get_singleton()->canvas_item_add_polygon(p_to_rid, points, col); + RenderingServer::get_singleton()->canvas_item_add_polyline(p_to_rid, points, col); + // Draw the last segment as it's not drawn by `canvas_item_add_polyline()`. + RenderingServer::get_singleton()->canvas_item_add_line(p_to_rid, points[points.size() - 1], points[0], p_color); } Rect2 ConvexPolygonShape2D::get_rect() const { diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index beb365d44e..5d351f51f7 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -469,6 +469,11 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map p_node->get_property_list(&plist); StringName type = p_node->get_class(); + Ref<Script> script = p_node->get_script(); + if (script.is_valid()) { + script->update_exports(); + } + for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) { if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) { continue; @@ -484,7 +489,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value)); } - Ref<Script> script = p_node->get_script(); if (!isdefault && script.is_valid() && script->get_property_default_value(name, default_value)) { isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value)); } diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index a5b909c9a7..0fd65d8c72 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -33,7 +33,7 @@ #include "servers/physics_server_2d.h" #include "servers/rendering_server.h" void RectangleShape2D::_update_shape() { - PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), size / 2); + PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), size * 0.5); emit_changed(); } @@ -47,11 +47,27 @@ Vector2 RectangleShape2D::get_size() const { } void RectangleShape2D::draw(const RID &p_to_rid, const Color &p_color) { - RenderingServer::get_singleton()->canvas_item_add_rect(p_to_rid, Rect2(-size / 2, size), p_color); + // Draw an outlined rectangle to make individual shapes easier to distinguish. + Vector<Vector2> stroke_points; + stroke_points.resize(5); + stroke_points.write[0] = -size * 0.5; + stroke_points.write[1] = Vector2(size.x, -size.y) * 0.5; + stroke_points.write[2] = size * 0.5; + stroke_points.write[3] = Vector2(-size.x, size.y) * 0.5; + stroke_points.write[4] = -size * 0.5; + + Vector<Color> stroke_colors; + stroke_colors.resize(5); + for (int i = 0; i < 5; i++) { + stroke_colors.write[i] = (p_color); + } + + RenderingServer::get_singleton()->canvas_item_add_rect(p_to_rid, Rect2(-size * 0.5, size), p_color); + RenderingServer::get_singleton()->canvas_item_add_polyline(p_to_rid, stroke_points, stroke_colors); } Rect2 RectangleShape2D::get_rect() const { - return Rect2(-size / 2, size); + return Rect2(-size * 0.5, size); } real_t RectangleShape2D::get_enclosing_radius() const { diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 5ce3532d42..47933bd69a 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -299,6 +299,7 @@ void SurfaceTool::add_triangle_fan(const Vector<Vector3> &p_vertices, const Vect void SurfaceTool::add_index(int p_index) { ERR_FAIL_COND(!begun); + ERR_FAIL_COND(p_index < 0); format |= Mesh::ARRAY_FORMAT_INDEX; index_array.push_back(p_index); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index a296156bf5..859546694f 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -585,6 +585,12 @@ bool VisualShader::is_port_types_compatible(int p_a, int p_b) const { void VisualShader::connect_nodes_forced(Type p_type, int p_from_node, int p_from_port, int p_to_node, int p_to_port) { ERR_FAIL_INDEX(p_type, TYPE_MAX); Graph *g = &graph[p_type]; + + ERR_FAIL_COND(!g->nodes.has(p_from_node)); + ERR_FAIL_INDEX(p_from_port, g->nodes[p_from_node].node->get_output_port_count()); + ERR_FAIL_COND(!g->nodes.has(p_to_node)); + ERR_FAIL_INDEX(p_to_port, g->nodes[p_to_node].node->get_input_port_count()); + Connection c; c.from_node = p_from_node; c.from_port = p_from_port; @@ -1400,11 +1406,11 @@ bool VisualShader::has_func_name(RenderingServer::ShaderMode p_mode, const Strin } void VisualShader::_update_shader() const { - if (!dirty) { + if (!dirty.is_set()) { return; } - dirty = false; + dirty.clear(); StringBuilder global_code; StringBuilder global_code_per_node; @@ -1590,11 +1596,11 @@ void VisualShader::_update_shader() const { } void VisualShader::_queue_update() { - if (dirty) { + if (dirty.is_set()) { return; } - dirty = true; + dirty.set(); call_deferred("_update_shader"); } @@ -1614,7 +1620,7 @@ void VisualShader::_input_type_changed(Type p_type, int p_id) { } void VisualShader::rebuild() { - dirty = true; + dirty.set(); _update_shader(); } @@ -1668,6 +1674,7 @@ void VisualShader::_bind_methods() { } VisualShader::VisualShader() { + dirty.set(); for (int i = 0; i < TYPE_MAX; i++) { Ref<VisualShaderNodeOutput> output; output.instance(); diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index f3f3caf15e..ef724c7650 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -32,6 +32,7 @@ #define VISUAL_SHADER_H #include "core/string/string_builder.h" +#include "core/templates/safe_refcount.h" #include "scene/gui/control.h" #include "scene/resources/shader.h" @@ -99,7 +100,7 @@ private: static RenderModeEnums render_mode_enums[]; - volatile mutable bool dirty = true; + mutable SafeFlag dirty; void _queue_update(); union ConnectionKey { diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp index efdcb916ed..3c8a1469cd 100644 --- a/servers/audio/audio_rb_resampler.cpp +++ b/servers/audio/audio_rb_resampler.cpp @@ -131,7 +131,7 @@ bool AudioRBResampler::mix(AudioFrame *p_dest, int p_frames) { src_read = read_space; } - rb_read_pos = (rb_read_pos + src_read) & rb_mask; + rb_read_pos.set((rb_read_pos.get() + src_read) & rb_mask); // Create fadeout effect for the end of stream (note that it can be because of slow writer) if (p_frames - target_todo > 0) { @@ -183,8 +183,8 @@ Error AudioRBResampler::setup(int p_channels, int p_src_mix_rate, int p_target_m src_mix_rate = p_src_mix_rate; target_mix_rate = p_target_mix_rate; offset = 0; - rb_read_pos = 0; - rb_write_pos = 0; + rb_read_pos.set(0); + rb_write_pos.set(0); //avoid maybe strange noises upon load for (unsigned int i = 0; i < (rb_len * channels); i++) { @@ -205,8 +205,8 @@ void AudioRBResampler::clear() { memdelete_arr(read_buf); rb = nullptr; offset = 0; - rb_read_pos = 0; - rb_write_pos = 0; + rb_read_pos.set(0); + rb_write_pos.set(0); read_buf = nullptr; } @@ -214,8 +214,8 @@ AudioRBResampler::AudioRBResampler() { rb = nullptr; offset = 0; read_buf = nullptr; - rb_read_pos = 0; - rb_write_pos = 0; + rb_read_pos.set(0); + rb_write_pos.set(0); rb_bits = 0; rb_len = 0; diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h index 7b74e3a2a1..c0f981704b 100644 --- a/servers/audio/audio_rb_resampler.h +++ b/servers/audio/audio_rb_resampler.h @@ -32,6 +32,7 @@ #define AUDIO_RB_RESAMPLER_H #include "core/os/memory.h" +#include "core/templates/safe_refcount.h" #include "core/typedefs.h" #include "servers/audio_server.h" @@ -44,8 +45,8 @@ struct AudioRBResampler { uint32_t src_mix_rate; uint32_t target_mix_rate; - volatile int rb_read_pos; - volatile int rb_write_pos; + SafeNumeric<int> rb_read_pos; + SafeNumeric<int> rb_write_pos; int32_t offset; //contains the fractional remainder of the resampler enum { @@ -62,8 +63,8 @@ struct AudioRBResampler { public: _FORCE_INLINE_ void flush() { - rb_read_pos = 0; - rb_write_pos = 0; + rb_read_pos.set(0); + rb_write_pos.set(0); offset = 0; } @@ -78,8 +79,8 @@ public: _FORCE_INLINE_ int get_writer_space() const { int space, r, w; - r = rb_read_pos; - w = rb_write_pos; + r = rb_read_pos.get(); + w = rb_write_pos.get(); if (r == w) { space = rb_len - 1; @@ -95,8 +96,8 @@ public: _FORCE_INLINE_ int get_reader_space() const { int space, r, w; - r = rb_read_pos; - w = rb_write_pos; + r = rb_read_pos.get(); + w = rb_write_pos.get(); if (r == w) { space = 0; @@ -110,48 +111,52 @@ public: } _FORCE_INLINE_ bool has_data() const { - return rb && rb_read_pos != rb_write_pos; + return rb && rb_read_pos.get() != rb_write_pos.get(); } _FORCE_INLINE_ float *get_write_buffer() { return read_buf; } _FORCE_INLINE_ void write(uint32_t p_frames) { ERR_FAIL_COND(p_frames >= rb_len); + int wp = rb_write_pos.get(); + switch (channels) { case 1: { for (uint32_t i = 0; i < p_frames; i++) { - rb[rb_write_pos] = read_buf[i]; - rb_write_pos = (rb_write_pos + 1) & rb_mask; + rb[wp] = read_buf[i]; + wp = (wp + 1) & rb_mask; } } break; case 2: { for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos << 1) + 0] = read_buf[(i << 1) + 0]; - rb[(rb_write_pos << 1) + 1] = read_buf[(i << 1) + 1]; - rb_write_pos = (rb_write_pos + 1) & rb_mask; + rb[(wp << 1) + 0] = read_buf[(i << 1) + 0]; + rb[(wp << 1) + 1] = read_buf[(i << 1) + 1]; + wp = (wp + 1) & rb_mask; } } break; case 4: { for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos << 2) + 0] = read_buf[(i << 2) + 0]; - rb[(rb_write_pos << 2) + 1] = read_buf[(i << 2) + 1]; - rb[(rb_write_pos << 2) + 2] = read_buf[(i << 2) + 2]; - rb[(rb_write_pos << 2) + 3] = read_buf[(i << 2) + 3]; - rb_write_pos = (rb_write_pos + 1) & rb_mask; + rb[(wp << 2) + 0] = read_buf[(i << 2) + 0]; + rb[(wp << 2) + 1] = read_buf[(i << 2) + 1]; + rb[(wp << 2) + 2] = read_buf[(i << 2) + 2]; + rb[(wp << 2) + 3] = read_buf[(i << 2) + 3]; + wp = (wp + 1) & rb_mask; } } break; case 6: { for (uint32_t i = 0; i < p_frames; i++) { - rb[(rb_write_pos * 6) + 0] = read_buf[(i * 6) + 0]; - rb[(rb_write_pos * 6) + 1] = read_buf[(i * 6) + 1]; - rb[(rb_write_pos * 6) + 2] = read_buf[(i * 6) + 2]; - rb[(rb_write_pos * 6) + 3] = read_buf[(i * 6) + 3]; - rb[(rb_write_pos * 6) + 4] = read_buf[(i * 6) + 4]; - rb[(rb_write_pos * 6) + 5] = read_buf[(i * 6) + 5]; - rb_write_pos = (rb_write_pos + 1) & rb_mask; + rb[(wp * 6) + 0] = read_buf[(i * 6) + 0]; + rb[(wp * 6) + 1] = read_buf[(i * 6) + 1]; + rb[(wp * 6) + 2] = read_buf[(i * 6) + 2]; + rb[(wp * 6) + 3] = read_buf[(i * 6) + 3]; + rb[(wp * 6) + 4] = read_buf[(i * 6) + 4]; + rb[(wp * 6) + 5] = read_buf[(i * 6) + 5]; + wp = (wp + 1) & rb_mask; } } break; } + + rb_write_pos.set(wp); } int get_channel_count() const; diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 49ac78fad8..ae07f999ed 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -54,21 +54,21 @@ void AudioStreamPlaybackResampled::mix(AudioFrame *p_buffer, float p_rate_scale, for (int i = 0; i < p_frames; i++) { uint32_t idx = CUBIC_INTERP_HISTORY + uint32_t(mix_offset >> FP_BITS); - //standard cubic interpolation (great quality/performance ratio) - //this used to be moved to a LUT for greater performance, but nowadays CPU speed is generally faster than memory. + // 4 point, 4th order optimal resampling algorithm from: http://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf float mu = (mix_offset & FP_MASK) / float(FP_LEN); AudioFrame y0 = internal_buffer[idx - 3]; AudioFrame y1 = internal_buffer[idx - 2]; AudioFrame y2 = internal_buffer[idx - 1]; AudioFrame y3 = internal_buffer[idx - 0]; - float mu2 = mu * mu; - AudioFrame a0 = y3 - y2 - y0 + y1; - AudioFrame a1 = y0 - y1 - a0; - AudioFrame a2 = y2 - y0; - AudioFrame a3 = y1; - - p_buffer[i] = (a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3); + AudioFrame even1 = y2 + y1, odd1 = y2 - y1; + AudioFrame even2 = y3 + y0, odd2 = y3 - y0; + AudioFrame c0 = even1 * 0.46835497211269561 + even2 * 0.03164502784253309; + AudioFrame c1 = odd1 * 0.56001293337091440 + odd2 * 0.14666238593949288; + AudioFrame c2 = even1 * -0.250038759826233691 + even2 * 0.25003876124297131; + AudioFrame c3 = odd1 * -0.49949850957839148 + odd2 * 0.16649935475113800; + AudioFrame c4 = even1 * 0.00016095224137360 + even2 * -0.00016095810460478; + p_buffer[i] = (((c4 * mu + c3) * mu + c2) * mu + c1) * mu + c0; mix_offset += mix_increment; diff --git a/servers/audio/effects/audio_effect_capture.cpp b/servers/audio/effects/audio_effect_capture.cpp index f37938eec8..37e4122e50 100644 --- a/servers/audio/effects/audio_effect_capture.cpp +++ b/servers/audio/effects/audio_effect_capture.cpp @@ -106,7 +106,7 @@ int AudioEffectCapture::get_frames_available() const { } int64_t AudioEffectCapture::get_discarded_frames() const { - return discarded_frames; + return discarded_frames.get(); } int AudioEffectCapture::get_buffer_length_frames() const { @@ -115,7 +115,7 @@ int AudioEffectCapture::get_buffer_length_frames() const { } int64_t AudioEffectCapture::get_pushed_frames() const { - return pushed_frames; + return pushed_frames.get(); } void AudioEffectCaptureInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) { @@ -129,9 +129,9 @@ void AudioEffectCaptureInstance::process(const AudioFrame *p_src_frames, AudioFr // Add incoming audio frames to the IO ring buffer int32_t ret = buffer.write(p_src_frames, p_frame_count); ERR_FAIL_COND_MSG(ret != p_frame_count, "Failed to add data to effect capture ring buffer despite sufficient space."); - atomic_add(&base->pushed_frames, p_frame_count); + base->pushed_frames.add(p_frame_count); } else { - atomic_add(&base->discarded_frames, p_frame_count); + base->discarded_frames.add(p_frame_count); } } diff --git a/servers/audio/effects/audio_effect_capture.h b/servers/audio/effects/audio_effect_capture.h index b154be85de..81d4ed6b0f 100644 --- a/servers/audio/effects/audio_effect_capture.h +++ b/servers/audio/effects/audio_effect_capture.h @@ -55,8 +55,8 @@ class AudioEffectCapture : public AudioEffect { friend class AudioEffectCaptureInstance; RingBuffer<AudioFrame> buffer; - uint64_t discarded_frames = 0; - uint64_t pushed_frames = 0; + SafeNumeric<uint64_t> discarded_frames; + SafeNumeric<uint64_t> pushed_frames; float buffer_length_seconds = 0.1f; bool buffer_initialized = false; diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index b79434e7c2..06d51776a3 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -58,7 +58,8 @@ void AudioEffectDistortionInstance::process(const AudioFrame *p_src_frames, Audi switch (base->mode) { case AudioEffectDistortion::MODE_CLIP: { - a = powf(a, 1.0001 - drive_f); + float a_sign = a < 0 ? -1.0f : 1.0f; + a = powf(abs(a), 1.0001 - drive_f) * a_sign; if (a > 1.0) { a = 1.0; } else if (a < (-1.0)) { diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 29c1c9fc60..2fa333cc05 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -477,7 +477,7 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("enable_for_stealing_focus", "process_id"), &DisplayServer::enable_for_stealing_focus); - ClassDB::bind_method(D_METHOD("native_video_play", "path", "volume", "audio_track", "subtitle_track"), &DisplayServer::native_video_play); + ClassDB::bind_method(D_METHOD("native_video_play", "path", "volume", "audio_track", "subtitle_track", "screen"), &DisplayServer::native_video_play); ClassDB::bind_method(D_METHOD("native_video_is_playing"), &DisplayServer::native_video_is_playing); ClassDB::bind_method(D_METHOD("native_video_stop"), &DisplayServer::native_video_stop); ClassDB::bind_method(D_METHOD("native_video_pause"), &DisplayServer::native_video_pause); @@ -504,6 +504,11 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_native_icon", "filename"), &DisplayServer::set_native_icon); ClassDB::bind_method(D_METHOD("set_icon", "image"), &DisplayServer::set_icon); + ClassDB::bind_method(D_METHOD("tablet_get_driver_count"), &DisplayServer::tablet_get_driver_count); + ClassDB::bind_method(D_METHOD("tablet_get_driver_name", "idx"), &DisplayServer::tablet_get_driver_name); + ClassDB::bind_method(D_METHOD("tablet_get_current_driver"), &DisplayServer::tablet_get_current_driver); + ClassDB::bind_method(D_METHOD("tablet_set_current_driver", "name"), &DisplayServer::tablet_set_current_driver); + BIND_ENUM_CONSTANT(FEATURE_GLOBAL_MENU); BIND_ENUM_CONSTANT(FEATURE_SUBWINDOWS); BIND_ENUM_CONSTANT(FEATURE_TOUCHSCREEN); diff --git a/servers/display_server.h b/servers/display_server.h index 59f59531ec..3aab572120 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -340,6 +340,11 @@ public: virtual String keyboard_get_layout_language(int p_index) const; virtual String keyboard_get_layout_name(int p_index) const; + virtual int tablet_get_driver_count() const { return 1; }; + virtual String tablet_get_driver_name(int p_driver) const { return "default"; }; + virtual String tablet_get_current_driver() const { return "default"; }; + virtual void tablet_set_current_driver(const String &p_driver){}; + virtual void process_events() = 0; virtual void force_process_and_drop_events(); diff --git a/servers/physics_2d/physics_server_2d_wrap_mt.cpp b/servers/physics_2d/physics_server_2d_wrap_mt.cpp index c2557d8f7f..790c87cc44 100644 --- a/servers/physics_2d/physics_server_2d_wrap_mt.cpp +++ b/servers/physics_2d/physics_server_2d_wrap_mt.cpp @@ -33,7 +33,7 @@ #include "core/os/os.h" void PhysicsServer2DWrapMT::thread_exit() { - exit = true; + exit.set(); } void PhysicsServer2DWrapMT::thread_step(real_t p_delta) { @@ -52,9 +52,9 @@ void PhysicsServer2DWrapMT::thread_loop() { physics_2d_server->init(); - exit = false; - step_thread_up = true; - while (!exit) { + exit.clear(); + step_thread_up.set(); + while (!exit.is_set()) { // flush commands one by one, until exit is requested command_queue.wait_and_flush_one(); } @@ -98,7 +98,7 @@ void PhysicsServer2DWrapMT::init() { if (create_thread) { //OS::get_singleton()->release_rendering_thread(); thread.start(_thread_callback, this); - while (!step_thread_up) { + while (!step_thread_up.is_set()) { OS::get_singleton()->delay_usec(1000); } } else { @@ -120,7 +120,6 @@ PhysicsServer2DWrapMT::PhysicsServer2DWrapMT(PhysicsServer2D *p_contained, bool physics_2d_server = p_contained; create_thread = p_create_thread; step_pending = 0; - step_thread_up = false; pool_max_size = GLOBAL_GET("memory/limits/multithreaded_server/rid_pool_prealloc"); diff --git a/servers/physics_2d/physics_server_2d_wrap_mt.h b/servers/physics_2d/physics_server_2d_wrap_mt.h index a6f0b1d4f1..3577f706de 100644 --- a/servers/physics_2d/physics_server_2d_wrap_mt.h +++ b/servers/physics_2d/physics_server_2d_wrap_mt.h @@ -34,6 +34,7 @@ #include "core/config/project_settings.h" #include "core/os/thread.h" #include "core/templates/command_queue_mt.h" +#include "core/templates/safe_refcount.h" #include "servers/physics_server_2d.h" #ifdef DEBUG_SYNC @@ -52,9 +53,9 @@ class PhysicsServer2DWrapMT : public PhysicsServer2D { Thread::ID server_thread; Thread::ID main_thread; - volatile bool exit; + SafeFlag exit; Thread thread; - volatile bool step_thread_up; + SafeFlag step_thread_up; bool create_thread; Semaphore step_sem; diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 8fd0ddbfef..af25029f04 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -602,7 +602,7 @@ void PhysicsServer3D::_bind_methods() { ClassDB::bind_method(D_METHOD("hinge_joint_set_flag", "joint", "flag", "enabled"), &PhysicsServer3D::hinge_joint_set_flag); ClassDB::bind_method(D_METHOD("hinge_joint_get_flag", "joint", "flag"), &PhysicsServer3D::hinge_joint_get_flag); - ClassDB::bind_method(D_METHOD("joint_make_slider", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer3D::joint_make_slider); + ClassDB::bind_method(D_METHOD("joint_make_slider", "joint", "body_A", "local_ref_A", "body_B", "local_ref_B"), &PhysicsServer3D::joint_make_slider); ClassDB::bind_method(D_METHOD("slider_joint_set_param", "joint", "param", "value"), &PhysicsServer3D::slider_joint_set_param); ClassDB::bind_method(D_METHOD("slider_joint_get_param", "joint", "param"), &PhysicsServer3D::slider_joint_get_param); diff --git a/servers/rendering/renderer_rd/shaders/scene_forward.glsl b/servers/rendering/renderer_rd/shaders/scene_forward.glsl index adccf1e712..1cea9bf8db 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward.glsl @@ -799,13 +799,11 @@ LIGHT_SHADER_CODE #ifndef USE_NO_SHADOWS -// Produces cheap white noise, optimized for window-space -// Comes from: https://www.shadertoy.com/view/4djSRW -// Copyright: Dave Hoskins, MIT License +// Interleaved Gradient Noise +// http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare float quick_hash(vec2 pos) { - vec3 p3 = fract(vec3(pos.xyx) * .1031); - p3 += dot(p3, p3.yzx + 33.33); - return fract((p3.x + p3.y) * p3.z); + const vec3 magic = vec3(0.06711056f, 0.00583715f, 52.9829189f); + return fract(magic.z * fract(dot(pos, magic.xy))); } float sample_directional_pcf_shadow(texture2D shadow, vec2 shadow_pixel_size, vec4 coord) { diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 4b0eafe369..27a9353e4e 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -269,7 +269,7 @@ void RenderingDevice::_bind_methods() { ClassDB::bind_method(D_METHOD("vertex_buffer_create", "size_bytes", "data", "use_as_storage"), &RenderingDevice::vertex_buffer_create, DEFVAL(Vector<uint8_t>()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("vertex_format_create", "vertex_descriptions"), &RenderingDevice::_vertex_format_create); - ClassDB::bind_method(D_METHOD("index_buffer_create", "size_indices", "format", "data"), &RenderingDevice::index_buffer_create, DEFVAL(Vector<uint8_t>()), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("index_buffer_create", "size_indices", "format", "data", "use_restart_indices"), &RenderingDevice::index_buffer_create, DEFVAL(Vector<uint8_t>()), DEFVAL(false)); ClassDB::bind_method(D_METHOD("index_array_create", "index_buffer", "index_offset", "index_count"), &RenderingDevice::index_array_create); ClassDB::bind_method(D_METHOD("shader_compile_from_source", "shader_source", "allow_cache"), &RenderingDevice::_shader_compile_from_source, DEFVAL(true)); diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 2e8f60d879..61d1efaf22 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -237,7 +237,7 @@ void RenderingServerDefault::init() { thread.start(_thread_callback, this); print_verbose("RenderingServerWrapMT: Starting render thread"); } - while (!draw_thread_up) { + while (!draw_thread_up.is_set()) { OS::get_singleton()->delay_usec(1000); } print_verbose("RenderingServerWrapMT: Finished render thread"); @@ -329,17 +329,17 @@ bool RenderingServerDefault::is_low_end() const { } void RenderingServerDefault::_thread_exit() { - exit = true; + exit.set(); } void RenderingServerDefault::_thread_draw(bool p_swap_buffers, double frame_step) { - if (!atomic_decrement(&draw_pending)) { + if (!draw_pending.decrement()) { _draw(p_swap_buffers, frame_step); } } void RenderingServerDefault::_thread_flush() { - atomic_decrement(&draw_pending); + draw_pending.decrement(); } void RenderingServerDefault::_thread_callback(void *_instance) { @@ -355,9 +355,8 @@ void RenderingServerDefault::_thread_loop() { _init(); - exit = false; - draw_thread_up = true; - while (!exit) { + draw_thread_up.set(); + while (!exit.is_set()) { // flush commands one by one, until exit is requested command_queue.wait_and_flush_one(); } @@ -371,7 +370,7 @@ void RenderingServerDefault::_thread_loop() { void RenderingServerDefault::sync() { if (create_thread) { - atomic_increment(&draw_pending); + draw_pending.increment(); command_queue.push_and_sync(this, &RenderingServerDefault::_thread_flush); } else { command_queue.flush_all(); //flush all pending from other threads @@ -380,7 +379,7 @@ void RenderingServerDefault::sync() { void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) { if (create_thread) { - atomic_increment(&draw_pending); + draw_pending.increment(); command_queue.push(this, &RenderingServerDefault::_thread_draw, p_swap_buffers, frame_step); } else { _draw(p_swap_buffers, frame_step); @@ -390,8 +389,6 @@ void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) { RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : command_queue(p_create_thread) { create_thread = p_create_thread; - draw_pending = 0; - draw_thread_up = false; if (!p_create_thread) { server_thread = Thread::get_caller_id(); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index effa555ec4..73b463f6e7 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -89,12 +89,12 @@ class RenderingServerDefault : public RenderingServer { void _thread_loop(); Thread::ID server_thread; - volatile bool exit; + SafeFlag exit; Thread thread; - volatile bool draw_thread_up; + SafeFlag draw_thread_up; bool create_thread; - uint64_t draw_pending; + SafeNumeric<uint64_t> draw_pending; void _thread_draw(bool p_swap_buffers, double frame_step); void _thread_flush(); diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index e52d97e4d9..cb98a71e86 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -5861,6 +5861,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun return ERR_BUG; } + String return_struct_name = String(b->parent_function->return_struct_name); + ControlFlowNode *flow = alloc_node<ControlFlowNode>(); flow->flow_op = FLOW_OP_RETURN; @@ -5869,7 +5871,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun if (tk.type == TK_SEMICOLON) { //all is good if (b->parent_function->return_type != TYPE_VOID) { - _set_error("Expected return with expression of type '" + get_datatype_name(b->parent_function->return_type) + "'"); + _set_error("Expected return with an expression of type '" + (return_struct_name != "" ? return_struct_name : get_datatype_name(b->parent_function->return_type)) + "'"); return ERR_PARSE_ERROR; } } else { @@ -5879,8 +5881,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun return ERR_PARSE_ERROR; } - if (b->parent_function->return_type != expr->get_datatype()) { - _set_error("Expected return expression of type '" + get_datatype_name(b->parent_function->return_type) + "'"); + if (b->parent_function->return_type != expr->get_datatype() || return_struct_name != expr->get_datatype_name()) { + _set_error("Expected return with an expression of type '" + (return_struct_name != "" ? return_struct_name : get_datatype_name(b->parent_function->return_type)) + "'"); return ERR_PARSE_ERROR; } @@ -6133,6 +6135,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct tk = _get_token(); if (tk.type == TK_IDENTIFIER) { st.name = tk.text; + if (shader->structs.has(st.name)) { + _set_error("Redefinition of '" + String(st.name) + "'"); + return ERR_PARSE_ERROR; + } tk = _get_token(); if (tk.type != TK_CURLY_BRACKET_OPEN) { _set_error("Expected '{'"); diff --git a/servers/text_server.cpp b/servers/text_server.cpp index 755a17f86a..27fdd090f1 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -290,7 +290,7 @@ void TextServer::_bind_methods() { ClassDB::bind_method(D_METHOD("create_shaped_text", "direction", "orientation"), &TextServer::create_shaped_text, DEFVAL(DIRECTION_AUTO), DEFVAL(ORIENTATION_HORIZONTAL)); - ClassDB::bind_method(D_METHOD("shaped_text_clear"), &TextServer::shaped_text_clear); + ClassDB::bind_method(D_METHOD("shaped_text_clear", "rid"), &TextServer::shaped_text_clear); ClassDB::bind_method(D_METHOD("shaped_text_set_direction", "shaped", "direction"), &TextServer::shaped_text_set_direction, DEFVAL(DIRECTION_AUTO)); ClassDB::bind_method(D_METHOD("shaped_text_get_direction", "shaped"), &TextServer::shaped_text_get_direction); diff --git a/tests/test_array.h b/tests/test_array.h new file mode 100644 index 0000000000..52da256860 --- /dev/null +++ b/tests/test_array.h @@ -0,0 +1,186 @@ +/*************************************************************************/ +/* test_array.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef TEST_ARRAY_H +#define TEST_ARRAY_H + +#include "core/object/class_db.h" +#include "core/object/script_language.h" +#include "core/templates/hashfuncs.h" +#include "core/templates/vector.h" +#include "core/variant/array.h" +#include "core/variant/container_type_validate.h" +#include "core/variant/variant.h" +#include "tests/test_macros.h" + +namespace TestArray { + +TEST_CASE("[Array] size(), clear(), and is_empty()") { + Array arr; + CHECK(arr.size() == 0); + CHECK(arr.is_empty()); + arr.push_back(1); + CHECK(arr.size() == 1); + arr.clear(); + CHECK(arr.is_empty()); + CHECK(arr.size() == 0); +} + +TEST_CASE("[Array] Assignment and comparison operators") { + Array arr1; + Array arr2; + arr1.push_back(1); + CHECK(arr1 != arr2); + CHECK(arr1 > arr2); + CHECK(arr1 >= arr2); + arr2.push_back(2); + CHECK(arr1 != arr2); + CHECK(arr1 < arr2); + CHECK(arr1 <= arr2); + CHECK(arr2 > arr1); + CHECK(arr2 >= arr1); + Array arr3 = arr2; + CHECK(arr3 == arr2); +} + +TEST_CASE("[Array] append_array()") { + Array arr1; + Array arr2; + arr1.push_back(1); + arr1.append_array(arr2); + CHECK(arr1.size() == 1); + arr2.push_back(2); + arr1.append_array(arr2); + CHECK(arr1.size() == 2); + CHECK(int(arr1[0]) == 1); + CHECK(int(arr1[1]) == 2); +} + +TEST_CASE("[Array] resize(), insert(), and erase()") { + Array arr; + arr.resize(2); + CHECK(arr.size() == 2); + arr.insert(0, 1); + CHECK(int(arr[0]) == 1); + arr.insert(0, 2); + CHECK(int(arr[0]) == 2); + arr.erase(2); + CHECK(int(arr[0]) == 1); +} + +TEST_CASE("[Array] front() and back()") { + Array arr; + arr.push_back(1); + CHECK(int(arr.front()) == 1); + CHECK(int(arr.back()) == 1); + arr.push_back(3); + CHECK(int(arr.front()) == 1); + CHECK(int(arr.back()) == 3); +} + +TEST_CASE("[Array] has() and count()") { + Array arr; + arr.push_back(1); + arr.push_back(1); + CHECK(arr.has(1)); + CHECK(!arr.has(2)); + CHECK(arr.count(1) == 2); + CHECK(arr.count(2) == 0); +} + +TEST_CASE("[Array] remove()") { + Array arr; + arr.push_back(1); + arr.push_back(2); + arr.remove(0); + CHECK(arr.size() == 1); + CHECK(int(arr[0]) == 2); + arr.remove(0); + CHECK(arr.size() == 0); + + // The array is now empty; try to use `remove()` again. + // Normally, this prints an error message so we silence it. + ERR_PRINT_OFF; + arr.remove(0); + ERR_PRINT_ON; + + CHECK(arr.size() == 0); +} + +TEST_CASE("[Array] get()") { + Array arr; + arr.push_back(1); + CHECK(int(arr.get(0)) == 1); +} + +TEST_CASE("[Array] sort()") { + Array arr; + + arr.push_back(3); + arr.push_back(4); + arr.push_back(2); + arr.push_back(1); + arr.sort(); + int val = 1; + for (int i = 0; i < arr.size(); i++) { + CHECK(int(arr[i]) == val); + val++; + } +} + +TEST_CASE("[Array] push_front(), pop_front(), pop_back()") { + Array arr; + arr.push_front(1); + arr.push_front(2); + CHECK(int(arr[0]) == 2); + arr.pop_front(); + CHECK(int(arr[0]) == 1); + CHECK(arr.size() == 1); + arr.push_front(2); + arr.push_front(3); + arr.pop_back(); + CHECK(int(arr[1]) == 2); + CHECK(arr.size() == 2); +} + +TEST_CASE("[Array] max() and min()") { + Array arr; + arr.push_back(3); + arr.push_front(4); + arr.push_back(5); + arr.push_back(2); + int max = int(arr.max()); + int min = int(arr.min()); + CHECK(max == 5); + CHECK(min == 2); +} +} // namespace TestArray + +#endif // TEST_ARRAY_H diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 2697eb6399..df43b7424f 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -33,6 +33,7 @@ #include "core/templates/list.h" #include "test_aabb.h" +#include "test_array.h" #include "test_astar.h" #include "test_basis.h" #include "test_class_db.h" @@ -65,6 +66,7 @@ #include "test_random_number_generator.h" #include "test_rect2.h" #include "test_render.h" +#include "test_resource.h" #include "test_shader_lang.h" #include "test_string.h" #include "test_text_server.h" diff --git a/tests/test_path_follow_2d.h b/tests/test_path_follow_2d.h new file mode 100644 index 0000000000..28b62de5bb --- /dev/null +++ b/tests/test_path_follow_2d.h @@ -0,0 +1,229 @@ +/*************************************************************************/ +/* test_path_follow_2d.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef TEST_PATH_FOLLOW_2D_H +#define TEST_PATH_FOLLOW_2D_H + +#include "scene/2d/path_2d.h" +#include "scene/resources/curve.h" + +#include "tests/test_macros.h" + +namespace TestPathFollow2D { + +TEST_CASE("[PathFollow2D] Sampling with unit offset") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + curve->add_point(Vector2(100, 100)); + curve->add_point(Vector2(0, 100)); + curve->add_point(Vector2(0, 0)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_unit_offset(0); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 0))); + + path_follow_2d->set_unit_offset(0.125); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 0))); + + path_follow_2d->set_unit_offset(0.25); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 0))); + + path_follow_2d->set_unit_offset(0.375); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 50))); + + path_follow_2d->set_unit_offset(0.5); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 100))); + + path_follow_2d->set_unit_offset(0.625); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 100))); + + path_follow_2d->set_unit_offset(0.75); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 100))); + + path_follow_2d->set_unit_offset(0.875); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 50))); + + path_follow_2d->set_unit_offset(1); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 0))); +} + +TEST_CASE("[PathFollow2D] Sampling with offset") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + curve->add_point(Vector2(100, 100)); + curve->add_point(Vector2(0, 100)); + curve->add_point(Vector2(0, 0)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_offset(0); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 0))); + + path_follow_2d->set_offset(50); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 0))); + + path_follow_2d->set_offset(100); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 0))); + + path_follow_2d->set_offset(150); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 50))); + + path_follow_2d->set_offset(200); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 100))); + + path_follow_2d->set_offset(250); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 100))); + + path_follow_2d->set_offset(300); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 100))); + + path_follow_2d->set_offset(350); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 50))); + + path_follow_2d->set_offset(400); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(0, 0))); +} + +TEST_CASE("[PathFollow2D] Removal of a point in curve") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + curve->add_point(Vector2(100, 100)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_unit_offset(0.5); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(100, 0))); + + curve->remove_point(1); + + CHECK_MESSAGE( + path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 50)), + "Path follow's position should be updated after removing a point from the curve"); +} + +TEST_CASE("[PathFollow2D] Setting h_offset and v_offset") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_unit_offset(0.5); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(50, 0))); + + path_follow_2d->set_h_offset(25); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(75, 0))); + + path_follow_2d->set_v_offset(25); + CHECK(path_follow_2d->get_transform().get_origin().is_equal_approx(Vector2(75, 25))); +} + +TEST_CASE("[PathFollow2D] Unit offset out of range") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_loop(true); + + path_follow_2d->set_unit_offset(-0.3); + CHECK_MESSAGE( + path_follow_2d->get_unit_offset() == 0.7, + "Unit Offset should loop back from the end in the opposite direction"); + + path_follow_2d->set_unit_offset(1.3); + CHECK_MESSAGE( + path_follow_2d->get_unit_offset() == 0.3, + "Unit Offset should loop back from the end in the opposite direction"); + + path_follow_2d->set_loop(false); + + path_follow_2d->set_unit_offset(-0.3); + CHECK_MESSAGE( + path_follow_2d->get_unit_offset() == 0, + "Unit Offset should be clamped at 0"); + + path_follow_2d->set_unit_offset(1.3); + CHECK_MESSAGE( + path_follow_2d->get_unit_offset() == 1, + "Unit Offset should be clamped at 1"); +} + +TEST_CASE("[PathFollow2D] Offset out of range") { + const Ref<Curve2D> &curve = memnew(Curve2D()); + curve->add_point(Vector2(0, 0)); + curve->add_point(Vector2(100, 0)); + const Ref<Path2D> &path = memnew(Path2D()); + path->set_curve(curve); + const Ref<PathFollow2D> &path_follow_2d = memnew(PathFollow2D()); + path->add_child(path_follow_2d); + + path_follow_2d->set_loop(true); + + path_follow_2d->set_offset(-50); + CHECK_MESSAGE( + path_follow_2d->get_offset() == 50, + "Offset should loop back from the end in the opposite direction"); + + path_follow_2d->set_offset(150); + CHECK_MESSAGE( + path_follow_2d->get_offset() == 50, + "Offset should loop back from the end in the opposite direction"); + + path_follow_2d->set_loop(false); + + path_follow_2d->set_offset(-50); + CHECK_MESSAGE( + path_follow_2d->get_offset() == 0, + "Offset should be clamped at 0"); + + path_follow_2d->set_offset(150); + CHECK_MESSAGE( + path_follow_2d->get_offset() == 100, + "Offset should be clamped at 1"); +} +} // namespace TestPathFollow2D + +#endif // TEST_PATH_FOLLOW_2D_H diff --git a/tests/test_resource.h b/tests/test_resource.h new file mode 100644 index 0000000000..cee3281995 --- /dev/null +++ b/tests/test_resource.h @@ -0,0 +1,114 @@ +/*************************************************************************/ +/* test_resource.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef TEST_RESOURCE +#define TEST_RESOURCE + +#include "core/io/resource.h" +#include "core/io/resource_loader.h" +#include "core/io/resource_saver.h" +#include "core/os/os.h" + +#include "thirdparty/doctest/doctest.h" + +namespace TestResource { + +TEST_CASE("[Resource] Duplication") { + Ref<Resource> resource = memnew(Resource); + resource->set_name("Hello world"); + Ref<Resource> child_resource = memnew(Resource); + child_resource->set_name("I'm a child resource"); + resource->set_meta("other_resource", child_resource); + + Ref<Resource> resource_dupe = resource->duplicate(); + const Ref<Resource> &resource_dupe_reference = resource_dupe; + resource_dupe->set_name("Changed name"); + child_resource->set_name("My name was changed too"); + + CHECK_MESSAGE( + resource_dupe->get_name() == "Changed name", + "Duplicated resource should have the new name."); + CHECK_MESSAGE( + resource_dupe_reference->get_name() == "Changed name", + "Reference to the duplicated resource should have the new name."); + CHECK_MESSAGE( + resource->get_name() == "Hello world", + "Original resource name should not be affected after editing the duplicate's name."); + CHECK_MESSAGE( + Ref<Resource>(resource_dupe->get_meta("other_resource"))->get_name() == "My name was changed too", + "Duplicated resource should share its child resource with the original."); +} + +TEST_CASE("[Resource] Saving and loading") { + Ref<Resource> resource = memnew(Resource); + resource->set_name("Hello world"); + resource->set_meta(" ExampleMetadata ", Vector2i(40, 80)); + resource->set_meta("string", "The\nstring\nwith\nunnecessary\nline\n\t\\\nbreaks"); + Ref<Resource> child_resource = memnew(Resource); + child_resource->set_name("I'm a child resource"); + resource->set_meta("other_resource", child_resource); + const String save_path_binary = OS::get_singleton()->get_cache_path().plus_file("resource.res"); + const String save_path_text = OS::get_singleton()->get_cache_path().plus_file("resource.tres"); + ResourceSaver::save(save_path_binary, resource); + ResourceSaver::save(save_path_text, resource); + + const Ref<Resource> &loaded_resource_binary = ResourceLoader::load(save_path_binary); + CHECK_MESSAGE( + loaded_resource_binary->get_name() == "Hello world", + "The loaded resource name should be equal to the expected value."); + CHECK_MESSAGE( + loaded_resource_binary->get_meta(" ExampleMetadata ") == Vector2i(40, 80), + "The loaded resource metadata should be equal to the expected value."); + CHECK_MESSAGE( + loaded_resource_binary->get_meta("string") == "The\nstring\nwith\nunnecessary\nline\n\t\\\nbreaks", + "The loaded resource metadata should be equal to the expected value."); + const Ref<Resource> &loaded_child_resource_binary = loaded_resource_binary->get_meta("other_resource"); + CHECK_MESSAGE( + loaded_child_resource_binary->get_name() == "I'm a child resource", + "The loaded child resource name should be equal to the expected value."); + + const Ref<Resource> &loaded_resource_text = ResourceLoader::load(save_path_text); + CHECK_MESSAGE( + loaded_resource_text->get_name() == "Hello world", + "The loaded resource name should be equal to the expected value."); + CHECK_MESSAGE( + loaded_resource_text->get_meta(" ExampleMetadata ") == Vector2i(40, 80), + "The loaded resource metadata should be equal to the expected value."); + CHECK_MESSAGE( + loaded_resource_text->get_meta("string") == "The\nstring\nwith\nunnecessary\nline\n\t\\\nbreaks", + "The loaded resource metadata should be equal to the expected value."); + const Ref<Resource> &loaded_child_resource_text = loaded_resource_text->get_meta("other_resource"); + CHECK_MESSAGE( + loaded_child_resource_text->get_name() == "I'm a child resource", + "The loaded child resource name should be equal to the expected value."); +} +} // namespace TestResource + +#endif // TEST_RESOURCE |