summaryrefslogtreecommitdiff
path: root/tools/editor/editor_audio_buses.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-23 23:12:08 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-23 23:12:41 -0300
commit3b019bf644f61aaa2eaf9276448d97fb6e6a868a (patch)
treed9ccb2ad27aedad99d9781be1d1030bd28baf661 /tools/editor/editor_audio_buses.h
parent2527566ca899e2ac9d8baa8b4e68a22bf7077f35 (diff)
Ability to delete, drag and drop audio buses!
Diffstat (limited to 'tools/editor/editor_audio_buses.h')
-rw-r--r--tools/editor/editor_audio_buses.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/editor/editor_audio_buses.h b/tools/editor/editor_audio_buses.h
index 8787101393..137c78de30 100644
--- a/tools/editor/editor_audio_buses.h
+++ b/tools/editor/editor_audio_buses.h
@@ -13,6 +13,7 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/tree.h"
#include "scene/gui/option_button.h"
+#include "scene/gui/panel.h"
class EditorAudioBuses;
@@ -33,6 +34,7 @@ class EditorAudioBus : public PanelContainer {
OptionButton *send;
PopupMenu *effect_options;
+ PopupMenu *delete_popup;
Button *solo;
Button *mute;
@@ -42,6 +44,9 @@ class EditorAudioBus : public PanelContainer {
bool updating_bus;
+ void _gui_input(const InputEvent& p_event);
+ void _delete_pressed(int p_option);
+
void _name_changed(const String& p_new_name);
void _name_focus_exit() { _name_changed(track_name->get_text()); }
void _volume_db_changed(float p_db);
@@ -53,6 +58,11 @@ class EditorAudioBus : public PanelContainer {
void _effect_add(int p_which);
void _effect_selected();
+ virtual Variant get_drag_data(const Point2& p_point);
+ virtual bool can_drop_data(const Point2& p_point,const Variant& p_data) const;
+ virtual void drop_data(const Point2& p_point,const Variant& p_data);
+
+
friend class EditorAudioBuses;
EditorAudioBuses *buses;
@@ -70,6 +80,20 @@ public:
};
+class EditorAudioBusDrop : public Panel {
+
+ GDCLASS(EditorAudioBusDrop,Panel);
+
+ virtual bool can_drop_data(const Point2& p_point,const Variant& p_data) const;
+ virtual void drop_data(const Point2& p_point,const Variant& p_data);
+protected:
+
+ static void _bind_methods();
+public:
+
+ EditorAudioBusDrop();
+};
+
class EditorAudioBuses : public VBoxContainer {
GDCLASS(EditorAudioBuses,VBoxContainer)
@@ -84,11 +108,17 @@ class EditorAudioBuses : public VBoxContainer {
ScrollContainer *group_scroll;
HBoxContainer *group_hb;
+ EditorAudioBusDrop *drop_end;
+
void _add_bus();
void _update_buses();
void _update_bus(int p_index);
void _update_sends();
+ void _delete_bus(Object* p_which);
+
+ void _request_drop_end();
+ void _drop_at_index(int p_bus,int p_index);
protected: