You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include "editor/editor_settings.h"
|
||||
|
||||
void AudioStreamEditor::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", this, "_preview_changed");
|
||||
}
|
||||
@@ -75,7 +74,6 @@ void AudioStreamEditor::_draw_preview() {
|
||||
lines.resize(size.width * 2);
|
||||
|
||||
for (int i = 0; i < size.width; i++) {
|
||||
|
||||
float ofs = i * preview_len / size.width;
|
||||
float ofs_n = (i + 1) * preview_len / size.width;
|
||||
float max = preview->get_max(ofs, ofs_n) * 0.5 + 0.5;
|
||||
@@ -93,21 +91,18 @@ void AudioStreamEditor::_draw_preview() {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_preview_changed(ObjectID p_which) {
|
||||
|
||||
if (stream.is_valid() && stream->get_instance_id() == p_which) {
|
||||
_preview->update();
|
||||
}
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_changed_callback(Object *p_changed, const char *p_prop) {
|
||||
|
||||
if (!is_visible())
|
||||
return;
|
||||
update();
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_play() {
|
||||
|
||||
if (_player->is_playing()) {
|
||||
// '_pausing' variable indicates that we want to pause the audio player, not stop it. See '_on_finished()'.
|
||||
_pausing = true;
|
||||
@@ -122,7 +117,6 @@ void AudioStreamEditor::_play() {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_stop() {
|
||||
|
||||
_player->stop();
|
||||
_play_button->set_icon(get_icon("MainPlay", "EditorIcons"));
|
||||
_current = 0;
|
||||
@@ -131,7 +125,6 @@ void AudioStreamEditor::_stop() {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_on_finished() {
|
||||
|
||||
_play_button->set_icon(get_icon("MainPlay", "EditorIcons"));
|
||||
if (!_pausing) {
|
||||
_current = 0;
|
||||
@@ -143,7 +136,6 @@ void AudioStreamEditor::_on_finished() {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_draw_indicator() {
|
||||
|
||||
if (!stream.is_valid()) {
|
||||
return;
|
||||
}
|
||||
@@ -183,7 +175,6 @@ void AudioStreamEditor::_seek_to(real_t p_x) {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::edit(Ref<AudioStream> p_stream) {
|
||||
|
||||
if (!stream.is_null())
|
||||
stream->remove_change_receptor(this);
|
||||
|
||||
@@ -202,7 +193,6 @@ void AudioStreamEditor::edit(Ref<AudioStream> p_stream) {
|
||||
}
|
||||
|
||||
void AudioStreamEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_preview_changed"), &AudioStreamEditor::_preview_changed);
|
||||
ClassDB::bind_method(D_METHOD("_play"), &AudioStreamEditor::_play);
|
||||
ClassDB::bind_method(D_METHOD("_stop"), &AudioStreamEditor::_stop);
|
||||
@@ -213,7 +203,6 @@ void AudioStreamEditor::_bind_methods() {
|
||||
}
|
||||
|
||||
AudioStreamEditor::AudioStreamEditor() {
|
||||
|
||||
set_custom_minimum_size(Size2(1, 100) * EDSCALE);
|
||||
|
||||
_player = memnew(AudioStreamPlayer);
|
||||
@@ -262,7 +251,6 @@ AudioStreamEditor::AudioStreamEditor() {
|
||||
}
|
||||
|
||||
void AudioStreamEditorPlugin::edit(Object *p_object) {
|
||||
|
||||
AudioStream *s = Object::cast_to<AudioStream>(p_object);
|
||||
if (!s)
|
||||
return;
|
||||
@@ -271,17 +259,14 @@ void AudioStreamEditorPlugin::edit(Object *p_object) {
|
||||
}
|
||||
|
||||
bool AudioStreamEditorPlugin::handles(Object *p_object) const {
|
||||
|
||||
return p_object->is_class("AudioStream");
|
||||
}
|
||||
|
||||
void AudioStreamEditorPlugin::make_visible(bool p_visible) {
|
||||
|
||||
audio_editor->set_visible(p_visible);
|
||||
}
|
||||
|
||||
AudioStreamEditorPlugin::AudioStreamEditorPlugin(EditorNode *p_node) {
|
||||
|
||||
editor = p_node;
|
||||
audio_editor = memnew(AudioStreamEditor);
|
||||
add_control_to_container(CONTAINER_PROPERTY_EDITOR_BOTTOM, audio_editor);
|
||||
|
||||
Reference in New Issue
Block a user