summaryrefslogtreecommitdiff
path: root/editor/editor_audio_buses.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_audio_buses.cpp')
-rw-r--r--editor/editor_audio_buses.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 89dc106717..b6d7bbc45f 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -37,6 +37,7 @@
#include "editor/editor_file_dialog.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
+#include "editor/editor_settings.h"
#include "filesystem_dock.h"
#include "scene/resources/font.h"
#include "servers/audio_server.h"
@@ -1007,11 +1008,11 @@ void EditorAudioBuses::_update_buses() {
bool is_master = (i == 0);
EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master));
bus_hb->add_child(audio_bus);
- audio_bus->connect("delete_request", callable_mp(this, &EditorAudioBuses::_delete_bus), varray(audio_bus), CONNECT_DEFERRED);
- audio_bus->connect("duplicate_request", callable_mp(this, &EditorAudioBuses::_duplicate_bus), varray(), CONNECT_DEFERRED);
- audio_bus->connect("vol_reset_request", callable_mp(this, &EditorAudioBuses::_reset_bus_volume), varray(audio_bus), CONNECT_DEFERRED);
+ audio_bus->connect("delete_request", callable_mp(this, &EditorAudioBuses::_delete_bus).bind(audio_bus), CONNECT_DEFERRED);
+ audio_bus->connect("duplicate_request", callable_mp(this, &EditorAudioBuses::_duplicate_bus), CONNECT_DEFERRED);
+ audio_bus->connect("vol_reset_request", callable_mp(this, &EditorAudioBuses::_reset_bus_volume).bind(audio_bus), CONNECT_DEFERRED);
audio_bus->connect("drop_end_request", callable_mp(this, &EditorAudioBuses::_request_drop_end));
- audio_bus->connect("dropped", callable_mp(this, &EditorAudioBuses::_drop_at_index), varray(), CONNECT_DEFERRED);
+ audio_bus->connect("dropped", callable_mp(this, &EditorAudioBuses::_drop_at_index), CONNECT_DEFERRED);
}
}
@@ -1154,7 +1155,7 @@ void EditorAudioBuses::_request_drop_end() {
bus_hb->add_child(drop_end);
drop_end->set_custom_minimum_size(Object::cast_to<Control>(bus_hb->get_child(0))->get_size());
- drop_end->connect("dropped", callable_mp(this, &EditorAudioBuses::_drop_at_index), varray(), CONNECT_DEFERRED);
+ drop_end->connect("dropped", callable_mp(this, &EditorAudioBuses::_drop_at_index), CONNECT_DEFERRED);
}
}
@@ -1174,7 +1175,7 @@ void EditorAudioBuses::_drop_at_index(int p_bus, int p_index) {
void EditorAudioBuses::_server_save() {
Ref<AudioBusLayout> state = AudioServer::get_singleton()->generate_bus_layout();
- ResourceSaver::save(edited_path, state);
+ ResourceSaver::save(state, edited_path);
}
void EditorAudioBuses::_select_layout() {
@@ -1244,7 +1245,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
AudioServer::get_singleton()->set_bus_layout(empty_state);
}
- Error err = ResourceSaver::save(p_string, AudioServer::get_singleton()->generate_bus_layout());
+ Error err = ResourceSaver::save(AudioServer::get_singleton()->generate_bus_layout(), p_string);
if (err != OK) {
EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving file: %s"), p_string));
@@ -1332,7 +1333,7 @@ EditorAudioBuses::EditorAudioBuses() {
List<String> ext;
ResourceLoader::get_recognized_extensions_for_type("AudioBusLayout", &ext);
for (const String &E : ext) {
- file_dialog->add_filter(vformat("*.%s; %s", E, TTR("Audio Bus Layout")));
+ file_dialog->add_filter("*." + E, TTR("Audio Bus Layout"));
}
add_child(file_dialog);
file_dialog->connect("file_selected", callable_mp(this, &EditorAudioBuses::_file_dialog_callback));
@@ -1394,7 +1395,7 @@ Size2 EditorAudioMeterNotches::get_minimum_size() const {
for (int i = 0; i < notches.size(); i++) {
if (notches[i].render_db_value) {
- width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB", font_size).x);
+ width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x);
height += font_height;
}
}