Some code changed with Clang-Tidy
This commit is contained in:
@@ -288,7 +288,7 @@ void EditorAudioBus::_name_changed(const String &p_new_name) {
|
||||
}
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
|
||||
StringName current = AudioServer::get_singleton()->get_bus_name(get_index());
|
||||
ur->create_action(TTR("Rename Audio Bus"));
|
||||
@@ -323,7 +323,7 @@ void EditorAudioBus::_volume_changed(float p_normalized) {
|
||||
|
||||
float p_db = this->_normalized_volume_to_scaled_db(p_normalized);
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Change Audio Bus Volume"), UndoRedo::MERGE_ENDS);
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", get_index(), p_db);
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_volume_db", get_index(), AudioServer::get_singleton()->get_bus_volume_db(get_index()));
|
||||
@@ -400,7 +400,7 @@ void EditorAudioBus::_solo_toggled() {
|
||||
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Toggle Audio Bus Solo"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), solo->is_pressed());
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), AudioServer::get_singleton()->is_bus_solo(get_index()));
|
||||
@@ -414,7 +414,7 @@ void EditorAudioBus::_mute_toggled() {
|
||||
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Toggle Audio Bus Mute"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), mute->is_pressed());
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), AudioServer::get_singleton()->is_bus_mute(get_index()));
|
||||
@@ -428,7 +428,7 @@ void EditorAudioBus::_bypass_toggled() {
|
||||
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Toggle Audio Bus Bypass Effects"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), bypass->is_pressed());
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), AudioServer::get_singleton()->is_bus_bypassing_effects(get_index()));
|
||||
@@ -443,7 +443,7 @@ void EditorAudioBus::_send_selected(int p_which) {
|
||||
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Select Audio Bus Send"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_send", get_index(), send->get_item_text(p_which));
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_send", get_index(), AudioServer::get_singleton()->get_bus_send(get_index()));
|
||||
@@ -492,7 +492,7 @@ void EditorAudioBus::_effect_edited() {
|
||||
int index = effect->get_metadata(0);
|
||||
updating_bus = true;
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Select Audio Bus Send"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, effect->is_checked(0));
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, AudioServer::get_singleton()->is_bus_effect_enabled(get_index(), index));
|
||||
@@ -519,7 +519,7 @@ void EditorAudioBus::_effect_add(int p_which) {
|
||||
|
||||
afxr->set_name(effect_options->get_item_text(p_which));
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Add Audio Bus Effect"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), afxr, -1);
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect_count(get_index()));
|
||||
@@ -671,7 +671,7 @@ void EditorAudioBus::drop_data_fw(const Point2 &p_point, const Variant &p_data,
|
||||
|
||||
bool enabled = AudioServer::get_singleton()->is_bus_effect_enabled(bus, effect);
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Move Bus Effect"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", bus, effect);
|
||||
ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(bus, effect), paste_at);
|
||||
@@ -712,7 +712,7 @@ void EditorAudioBus::_delete_effect_pressed(int p_option) {
|
||||
|
||||
int index = item->get_metadata(0);
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Delete Bus Effect"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), index);
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(get_index(), index), index);
|
||||
@@ -980,11 +980,7 @@ void EditorAudioBusDrop::_notification(int p_what) {
|
||||
bool EditorAudioBusDrop::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
|
||||
|
||||
Dictionary d = p_data;
|
||||
if (d.has("type") && String(d["type"]) == "move_audio_bus") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return (d.has("type") && String(d["type"]) == "move_audio_bus");
|
||||
}
|
||||
|
||||
void EditorAudioBusDrop::drop_data(const Point2 &p_point, const Variant &p_data) {
|
||||
@@ -1013,7 +1009,7 @@ void EditorAudioBuses::_update_buses() {
|
||||
|
||||
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
|
||||
|
||||
bool is_master = i == 0 ? true : false;
|
||||
bool is_master = (i == 0);
|
||||
EditorAudioBus *audio_bus = memnew(EditorAudioBus(this, is_master));
|
||||
bus_hb->add_child(audio_bus);
|
||||
audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED);
|
||||
@@ -1075,7 +1071,7 @@ void EditorAudioBuses::_notification(int p_what) {
|
||||
|
||||
void EditorAudioBuses::_add_bus() {
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
|
||||
ur->create_action(TTR("Add Audio Bus"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_count", AudioServer::get_singleton()->get_bus_count() + 1);
|
||||
@@ -1109,7 +1105,7 @@ void EditorAudioBuses::_delete_bus(Object *p_which) {
|
||||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
|
||||
ur->create_action(TTR("Delete Audio Bus"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "remove_bus", index);
|
||||
@@ -1133,7 +1129,7 @@ void EditorAudioBuses::_delete_bus(Object *p_which) {
|
||||
void EditorAudioBuses::_duplicate_bus(int p_which) {
|
||||
|
||||
int add_at_pos = p_which + 1;
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Duplicate Audio Bus"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "add_bus", add_at_pos);
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_name", add_at_pos, AudioServer::get_singleton()->get_bus_name(p_which) + " Copy");
|
||||
@@ -1158,7 +1154,7 @@ void EditorAudioBuses::_reset_bus_volume(Object *p_which) {
|
||||
EditorAudioBus *bus = Object::cast_to<EditorAudioBus>(p_which);
|
||||
int index = bus->get_index();
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Reset Bus Volume"));
|
||||
ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", index, 0.f);
|
||||
ur->add_undo_method(AudioServer::get_singleton(), "set_bus_volume_db", index, AudioServer::get_singleton()->get_bus_volume_db(index));
|
||||
@@ -1180,7 +1176,7 @@ void EditorAudioBuses::_request_drop_end() {
|
||||
|
||||
void EditorAudioBuses::_drop_at_index(int p_bus, int p_index) {
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
UndoRedo *ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Move Audio Bus"));
|
||||
|
||||
ur->add_do_method(AudioServer::get_singleton(), "move_bus", p_bus, p_index);
|
||||
|
||||
Reference in New Issue
Block a user