From cac8c85dece1220b3db311daaebe384a5f5b73ed Mon Sep 17 00:00:00 2001 From: dnesov Date: Sun, 16 Feb 2025 19:42:58 +0100 Subject: [PATCH] WIP: clip drag and drop --- Assets/DefaultTheme.tres | 16 ++++++++-------- Controls/AudioClip.tscn | 3 ++- Scripts/AudioClip.gd | 1 + Scripts/Timeline.gd | 27 ++++++++++++++++++++++++++- Source/ProjectController.cs | 26 ++++++++++++++++++++++++++ Views/MainView.tscn | 20 ++++++-------------- Views/Timeline.tscn | 1 + default_bus_layout.tres | 3 +++ project.godot | 4 ++++ 9 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 Source/ProjectController.cs create mode 100644 default_bus_layout.tres diff --git a/Assets/DefaultTheme.tres b/Assets/DefaultTheme.tres index ddc8806..36c8589 100644 --- a/Assets/DefaultTheme.tres +++ b/Assets/DefaultTheme.tres @@ -1700,7 +1700,7 @@ corner_radius_bottom_left = 3 corner_detail = 3 anti_aliasing = false -[sub_resource type="Image" id="Image_8w8ju"] +[sub_resource type="Image" id="Image_t5di3"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 3, 255, 255, 255, 41, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 40, 255, 255, 255, 3, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 41, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 40, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 67, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 67, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 67, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 67, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 40, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 255, 255, 40, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 3, 255, 255, 255, 40, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 40, 255, 255, 255, 3, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -1710,7 +1710,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_bk0hb"] -image = SubResource("Image_8w8ju") +image = SubResource("Image_t5di3") [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_0hke8"] content_margin_left = 7.0 @@ -1723,7 +1723,7 @@ texture_margin_top = 6.0 texture_margin_right = 6.0 texture_margin_bottom = 6.0 -[sub_resource type="Image" id="Image_tx7cq"] +[sub_resource type="Image" id="Image_sbqmm"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 6, 248, 248, 248, 102, 249, 249, 249, 168, 249, 249, 249, 168, 248, 248, 248, 101, 213, 213, 213, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 248, 248, 248, 102, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 248, 248, 248, 101, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 249, 249, 249, 168, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 168, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 249, 249, 249, 168, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 248, 248, 248, 168, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 248, 248, 248, 101, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 249, 249, 249, 186, 250, 250, 250, 99, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 213, 213, 213, 6, 248, 248, 248, 101, 249, 249, 249, 168, 248, 248, 248, 168, 250, 250, 250, 99, 213, 213, 213, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -1733,7 +1733,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_uc42h"] -image = SubResource("Image_tx7cq") +image = SubResource("Image_sbqmm") [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_asndq"] content_margin_left = 6.0 @@ -1746,7 +1746,7 @@ texture_margin_top = 5.0 texture_margin_right = 5.0 texture_margin_bottom = 5.0 -[sub_resource type="Image" id="Image_8almr"] +[sub_resource type="Image" id="Image_mj1m7"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 213, 213, 213, 6, 180, 180, 180, 102, 181, 181, 181, 168, 181, 181, 181, 168, 179, 179, 179, 101, 170, 170, 170, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 180, 180, 180, 102, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 179, 179, 179, 101, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 181, 181, 181, 168, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 181, 181, 181, 168, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 181, 181, 181, 168, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 179, 179, 179, 168, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 179, 179, 179, 101, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 180, 180, 180, 186, 181, 181, 181, 99, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 170, 170, 170, 6, 179, 179, 179, 101, 181, 181, 181, 168, 179, 179, 179, 168, 181, 181, 181, 99, 170, 170, 170, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -1756,7 +1756,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_y6fi8"] -image = SubResource("Image_8almr") +image = SubResource("Image_mj1m7") [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7amsq"] content_margin_left = 7.0 @@ -1769,7 +1769,7 @@ texture_margin_top = 6.0 texture_margin_right = 6.0 texture_margin_bottom = 6.0 -[sub_resource type="Image" id="Image_kfbnc"] +[sub_resource type="Image" id="Image_5ft7l"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 7, 255, 255, 255, 19, 255, 255, 255, 19, 255, 255, 255, 7, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 7, 255, 255, 255, 19, 255, 255, 255, 19, 255, 255, 255, 6, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -1779,7 +1779,7 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_lfhcu"] -image = SubResource("Image_kfbnc") +image = SubResource("Image_5ft7l") [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tef5f"] content_margin_left = 0.0 diff --git a/Controls/AudioClip.tscn b/Controls/AudioClip.tscn index 85a188f..92fd31d 100644 --- a/Controls/AudioClip.tscn +++ b/Controls/AudioClip.tscn @@ -31,7 +31,8 @@ anchor_bottom = 0.312 offset_bottom = 0.0319996 grow_horizontal = 2 -[node name="Label" type="Label" parent="Panel"] +[node name="ClipName" type="Label" parent="Panel"] +unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 diff --git a/Scripts/AudioClip.gd b/Scripts/AudioClip.gd index ef14cec..a91919e 100644 --- a/Scripts/AudioClip.gd +++ b/Scripts/AudioClip.gd @@ -17,6 +17,7 @@ var selected: bool func _ready(): timeline = get_parent() + %ClipName.text = clip_name func _input(event): var rect = get_global_rect() diff --git a/Scripts/Timeline.gd b/Scripts/Timeline.gd index d444505..bdf94a2 100644 --- a/Scripts/Timeline.gd +++ b/Scripts/Timeline.gd @@ -1,4 +1,3 @@ -@tool class_name Timeline extends Container @@ -19,6 +18,8 @@ extends Container @export var min_zoom: float = 0.1 +@export var audio_clip_scene: PackedScene + func format_time_ms_hours(ms: float) -> String: var total_seconds = ms / 1000 var hours = int(total_seconds / 3600) @@ -130,3 +131,27 @@ func _gui_input(event): zoom = max(min_zoom, zoom) time_offset = max(0.0, time_offset) + +func local_x_to_timeline(x: float) -> float: + return (x / get_pixels_per_unit()) * time_interval + time_offset + + +func clip_dropped(at_position: Vector2, clip_name: String, clip_start_time: float, clip_end_time: float): + var local_position = at_position - global_position + var timeline_position = local_x_to_timeline(local_position.x) + print(timeline_position) + print(time_offset) + var track_idx = get_track_idx_by_y(at_position.y) + add_audio_clip(clip_name, track_idx, timeline_position + clip_start_time, timeline_position + clip_end_time) + pass + +func add_audio_clip(clip_name: String, track_idx: int, clip_start_time: float, clip_end_time: float): + var audio_clip = audio_clip_scene.instantiate() as AudioClip + audio_clip.clip_name = clip_name + audio_clip.track_idx = track_idx + audio_clip.start_time = clip_start_time + audio_clip.end_time = clip_end_time + + add_child(audio_clip) + queue_redraw() + pass \ No newline at end of file diff --git a/Source/ProjectController.cs b/Source/ProjectController.cs new file mode 100644 index 0000000..4a65fc4 --- /dev/null +++ b/Source/ProjectController.cs @@ -0,0 +1,26 @@ +using System.IO; +using Godot; + +namespace AudioEditor; + +[GlobalClass] +public partial class ProjectController : Node +{ + [Signal] public delegate void AudioClipDroppedEventHandler(Vector2 atPosition, string clipName, double startTime, double endTime); + + public override void _Ready() + { + GetWindow().FilesDropped += FilesDropped; + } + + private void FilesDropped(string[] files) + { + var mousePosition = GetViewport().GetMousePosition(); + + var fileName = Path.GetFileName(files[0]); + + GD.Print(fileName); + + EmitSignal(SignalName.AudioClipDropped, mousePosition, fileName, 0, 10 * 1000); + } +} \ No newline at end of file diff --git a/Views/MainView.tscn b/Views/MainView.tscn index cb75ee2..eef06f8 100644 --- a/Views/MainView.tscn +++ b/Views/MainView.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://cr2f68sbsegai"] +[gd_scene load_steps=17 format=3 uid="uid://cr2f68sbsegai"] [ext_resource type="Theme" uid="uid://b8rk41gjual2b" path="res://Assets/DefaultTheme.tres" id="1_s6hk6"] [ext_resource type="Script" path="res://addons/dockable_container/dockable_container.gd" id="2_7b0h5"] @@ -10,6 +10,7 @@ [ext_resource type="PackedScene" uid="uid://bgh1og6p43lsp" path="res://Controls/Transport.tscn" id="5_aq6v8"] [ext_resource type="PackedScene" uid="uid://bpd6g2b3s7tqa" path="res://Views/TrackView.tscn" id="5_rgxdu"] [ext_resource type="PackedScene" uid="uid://v4oljx3qrk5q" path="res://Views/Timeline.tscn" id="7_xu70y"] +[ext_resource type="Script" path="res://Source/ProjectController.cs" id="11_gc3ui"] [sub_resource type="Resource" id="Resource_pfnfv"] resource_name = "Tabs" @@ -147,18 +148,6 @@ layout = SubResource("Resource_20kxa") [node name="Tracks" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock" instance=ExtResource("5_rgxdu")] layout_mode = 2 -[node name="Track" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks/VBoxContainer/TrackList" index="0"] -script = null - -[node name="Track2" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks/VBoxContainer/TrackList" index="1"] -script = null - -[node name="Track3" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks/VBoxContainer/TrackList" index="2"] -script = null - -[node name="Track4" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks/VBoxContainer/TrackList" index="3"] -script = null - [node name="Timeline" parent="VBoxContainer/VSplitContainer/HSplitContainer" node_paths=PackedStringArray("track_list") instance=ExtResource("7_xu70y")] layout_mode = 2 track_list = NodePath("../LeftDock/Tracks/VBoxContainer/TrackList") @@ -191,4 +180,7 @@ grow_vertical = 2 mouse_filter = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_3f3qp") -[editable path="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks"] +[node name="ProjectController" type="Node" parent="."] +script = ExtResource("11_gc3ui") + +[connection signal="AudioClipDropped" from="ProjectController" to="VBoxContainer/VSplitContainer/HSplitContainer/Timeline" method="clip_dropped"] diff --git a/Views/Timeline.tscn b/Views/Timeline.tscn index 94502ac..b0cd6da 100644 --- a/Views/Timeline.tscn +++ b/Views/Timeline.tscn @@ -15,6 +15,7 @@ size_flags_vertical = 3 script = ExtResource("1_h2mev") line_thickness = 1 end_time = 4000.0 +audio_clip_scene = ExtResource("2_an2hv") [node name="ScrollBar" type="HScrollBar" parent="."] visible = false diff --git a/default_bus_layout.tres b/default_bus_layout.tres new file mode 100644 index 0000000..132628b --- /dev/null +++ b/default_bus_layout.tres @@ -0,0 +1,3 @@ +[gd_resource type="AudioBusLayout" format=3 uid="uid://sgfaybyy2lvn"] + +[resource] diff --git a/project.godot b/project.godot index 28ce86b..97f81be 100644 --- a/project.godot +++ b/project.godot @@ -17,6 +17,10 @@ run/low_processor_mode=true boot_splash/show_image=false config/icon="res://icon.svg" +[audio] + +driver/driver="Dummy" + [display] window/size/viewport_width=1920