Compare commits
5 Commits
19d0caa0b7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| cb38a509b5 | |||
| ecadfb7033 | |||
| 90e85f5404 | |||
| 7bf53cfb95 | |||
| 778f43e597 |
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="Theme" load_steps=236 format=3 uid="uid://b8rk41gjual2b"]
|
||||
[gd_resource type="Theme" load_steps=238 format=3 uid="uid://b8rk41gjual2b"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://501bous51s3p" path="res://Assets/Fonts/Inter-Regular.ttf" id="1_a74l0"]
|
||||
[ext_resource type="Texture2D" uid="uid://blqywcg2e22in" path="res://Assets/Icons/checked.svg" id="2_jlkvh"]
|
||||
@@ -2489,6 +2489,28 @@ corner_detail = 4
|
||||
anti_aliasing = false
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jkmfx"]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 16.0
|
||||
content_margin_right = 16.0
|
||||
content_margin_bottom = 16.0
|
||||
bg_color = Color(0.19, 0.19, 0.19, 1)
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.223529, 0.223529, 0.223529, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c8ejd"]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 16.0
|
||||
content_margin_right = 16.0
|
||||
content_margin_bottom = 16.0
|
||||
bg_color = Color(0.14902, 0.14902, 0.14902, 1)
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.223529, 0.223529, 0.223529, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jmej4"]
|
||||
content_margin_left = 32.0
|
||||
content_margin_top = 32.0
|
||||
content_margin_right = 32.0
|
||||
content_margin_bottom = 32.0
|
||||
bg_color = Color(0.14902, 0.14902, 0.14902, 1)
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.223529, 0.223529, 0.223529, 1)
|
||||
@@ -4479,8 +4501,10 @@ TooltipLabel/colors/font_shadow_color = Color(0, 0, 0, 0)
|
||||
TooltipPanel/styles/panel = SubResource("StyleBoxFlat_qr21i")
|
||||
TopBarOptionButton/font_sizes/font_size = 14
|
||||
TopBarOptionButton/fonts/font = ExtResource("1_a74l0")
|
||||
Track/base_type = &"PanelContainer"
|
||||
Track/styles/panel = SubResource("StyleBoxFlat_jkmfx")
|
||||
Track/base_type = &"Button"
|
||||
Track/styles/focus = SubResource("StyleBoxFlat_jkmfx")
|
||||
Track/styles/hover = SubResource("StyleBoxFlat_c8ejd")
|
||||
Track/styles/normal = SubResource("StyleBoxFlat_jmej4")
|
||||
Transport/base_type = &"PanelContainer"
|
||||
Transport/styles/panel = SubResource("StyleBoxFlat_hry0s")
|
||||
Tree/colors/children_hl_line_color = Color(1, 1, 1, 0.0196078)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.3.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NAudio" Version="2.2.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -7,7 +7,7 @@
|
||||
modulate = Color(0.552956, 0.552956, 0.552956, 1)
|
||||
self_modulate = Color(1, 1, 1, 0.588235)
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(4, 64)
|
||||
custom_minimum_size = Vector2(4, 32)
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.104
|
||||
anchor_bottom = 0.059
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dlb5xpe1t8rrk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3kajrpp2ux7" path="res://Controls/Track.tscn" id="1_envsv"]
|
||||
[ext_resource type="Texture2D" uid="uid://doq1jqfntrjrc" path="res://Assets/Icons/audio_track_2.svg" id="2_g74u4"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc0dy71y8shcx" path="res://Assets/Icons/record.svg" id="2_iwhga"]
|
||||
[ext_resource type="Texture2D" uid="uid://c8napjmkltpr" path="res://Assets/Icons/slider_grabber.svg" id="3_y81l0"]
|
||||
|
||||
[sub_resource type="StyleBoxLine" id="StyleBoxLine_ixeae"]
|
||||
color = Color(0.1, 0.1, 0.1, 1)
|
||||
thickness = 8
|
||||
|
||||
[sub_resource type="StyleBoxLine" id="StyleBoxLine_vrgqc"]
|
||||
color = Color(0.5, 0.5, 0.5, 1)
|
||||
thickness = 8
|
||||
|
||||
[node name="Track" instance=ExtResource("1_envsv")]
|
||||
|
||||
[node name="HBoxContainer" parent="PanelContainer/HBoxContainer/Body" index="0"]
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="MuteSolo" type="VBoxContainer" parent="PanelContainer/HBoxContainer/Body/HBoxContainer" index="0"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 4
|
||||
alignment = 1
|
||||
|
||||
[node name="Mute" type="Button" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/MuteSolo" index="0"]
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
text = "M"
|
||||
|
||||
[node name="Solo" type="Button" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/MuteSolo" index="1"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
text = "S"
|
||||
|
||||
[node name="TrackIcon" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName" index="0"]
|
||||
texture = ExtResource("2_g74u4")
|
||||
|
||||
[node name="Record" type="Button" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName" index="2"]
|
||||
self_modulate = Color(1, 0.373852, 0.504338, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("2_iwhga")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="VolumeSlider" type="HSlider" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls" index="1"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/grabber = ExtResource("3_y81l0")
|
||||
theme_override_icons/grabber_highlight = ExtResource("3_y81l0")
|
||||
theme_override_styles/slider = SubResource("StyleBoxLine_ixeae")
|
||||
theme_override_styles/grabber_area = SubResource("StyleBoxLine_vrgqc")
|
||||
theme_override_styles/grabber_area_highlight = SubResource("StyleBoxLine_vrgqc")
|
||||
min_value = -80.0
|
||||
max_value = 0.0
|
||||
@@ -1,106 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://y1aeb1b7cgh3"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://b8rk41gjual2b" path="res://Assets/DefaultTheme.tres" id="1_7wbal"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwfbs4jxbia3o" path="res://Assets/Icons/microphone_track.svg" id="2_ek3ni"]
|
||||
[ext_resource type="Texture2D" uid="uid://cc0dy71y8shcx" path="res://Assets/Icons/record.svg" id="3_2mwx3"]
|
||||
|
||||
[node name="Track" type="Control"]
|
||||
clip_children = 1
|
||||
custom_minimum_size = Vector2(128, 74)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 382.0
|
||||
offset_bottom = 74.0
|
||||
theme = ExtResource("1_7wbal")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
|
||||
clip_children = 1
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Panel" type="Panel" parent="PanelContainer/HBoxContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(4, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="PanelContainer/HBoxContainer"]
|
||||
self_modulate = Color(0.699653, 0.699654, 0.699653, 1)
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(4, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/margin_left = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/HBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MuteSolo" type="VBoxContainer" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 4
|
||||
alignment = 1
|
||||
|
||||
[node name="Mute" type="Button" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/MuteSolo"]
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
text = "M"
|
||||
|
||||
[node name="Solo" type="Button" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/MuteSolo"]
|
||||
modulate = Color(1, 1, 0, 1)
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
text = "S"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer"]
|
||||
clip_children = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 4
|
||||
alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TrackIcon" type="TextureRect" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
|
||||
modulate = Color(0.43134, 0.43134, 0.43134, 1)
|
||||
custom_minimum_size = Vector2(16, 16)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
texture = ExtResource("2_ek3ni")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="TrackName" type="LineEdit" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Track Name"
|
||||
expand_to_text_length = true
|
||||
context_menu_enabled = false
|
||||
caret_blink = true
|
||||
|
||||
[node name="Record" type="Button" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
|
||||
self_modulate = Color(1, 0.373852, 0.504338, 1)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("3_2mwx3")
|
||||
icon_alignment = 1
|
||||
|
||||
[node name="VolumeSlider" type="HSlider" parent="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
min_value = -80.0
|
||||
max_value = 0.0
|
||||
|
||||
[connection signal="text_submitted" from="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/TrackName" to="PanelContainer/HBoxContainer/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/TrackName" method="release_focus" unbinds=1]
|
||||
@@ -1,9 +1,5 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bhe0fbxuxrgjk"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bir03dfqbxgmh"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c3kajrpp2ux7" path="res://Controls/Track.tscn" id="1_oloar"]
|
||||
[ext_resource type="Texture2D" uid="uid://c1m8c0h70mpa5" path="res://Assets/Icons/label_track.svg" id="2_v5n7i"]
|
||||
|
||||
[node name="LabelTrack" instance=ExtResource("1_oloar")]
|
||||
|
||||
[node name="TrackIcon" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName" index="0"]
|
||||
texture = ExtResource("2_v5n7i")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://c3kajrpp2ux7"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://b8rk41gjual2b" path="res://Assets/DefaultTheme.tres" id="1_tbi88"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwfbs4jxbia3o" path="res://Assets/Icons/microphone_track.svg" id="2_r2pin"]
|
||||
[ext_resource type="Script" uid="uid://nq2n8r8tq3nt" path="res://Scripts/Track.gd" id="2_rsf0h"]
|
||||
[ext_resource type="FontFile" uid="uid://ctw3g5gundhpj" path="res://Assets/Fonts/InterVariable.ttf" id="3_12y3l"]
|
||||
[ext_resource type="Script" uid="uid://dxqa86sq21uac" path="res://Scripts/TrackLineEdit.gd" id="4_2nwak"]
|
||||
|
||||
[sub_resource type="FontVariation" id="FontVariation_lbdn3"]
|
||||
base_font = ExtResource("3_12y3l")
|
||||
@@ -12,73 +12,85 @@ variation_opentype = {
|
||||
2003265652: 500
|
||||
}
|
||||
|
||||
[node name="Track" type="Control"]
|
||||
clip_children = 1
|
||||
custom_minimum_size = Vector2(128, 64)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 382.0
|
||||
offset_bottom = 64.0
|
||||
theme = ExtResource("1_tbi88")
|
||||
[node name="Track" type="Button"]
|
||||
clip_children = 2
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -1466.0
|
||||
offset_bottom = -1040.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_type_variation = &"Track"
|
||||
script = ExtResource("2_rsf0h")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
clip_children = 1
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_type_variation = &"Track"
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
|
||||
clip_children = 1
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ColorStrip" type="ColorRect" parent="PanelContainer/HBoxContainer"]
|
||||
[node name="ColorStrip" type="ColorRect" parent="HBoxContainer"]
|
||||
self_modulate = Color(0.699653, 0.699654, 0.699653, 1)
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(2, 0)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
color = Color(0.435294, 0.435294, 0.435294, 1)
|
||||
|
||||
[node name="Body" type="MarginContainer" parent="PanelContainer/HBoxContainer"]
|
||||
[node name="Body" type="MarginContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_left = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/HBoxContainer/Body"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/Body"]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="NameIconControls" type="VBoxContainer" parent="PanelContainer/HBoxContainer/Body/HBoxContainer"]
|
||||
[node name="NameIconControls" type="VBoxContainer" parent="HBoxContainer/Body/HBoxContainer"]
|
||||
clip_children = 1
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
theme_override_constants/separation = 4
|
||||
alignment = 1
|
||||
|
||||
[node name="IconAndName" type="HBoxContainer" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls"]
|
||||
[node name="IconAndName" type="HBoxContainer" parent="HBoxContainer/Body/HBoxContainer/NameIconControls"]
|
||||
custom_minimum_size = Vector2(0, 32)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="TrackIcon" type="TextureRect" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName"]
|
||||
[node name="TrackIcon" type="TextureRect" parent="HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName"]
|
||||
visible = false
|
||||
modulate = Color(0.43134, 0.43134, 0.43134, 1)
|
||||
custom_minimum_size = Vector2(16, 16)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("2_r2pin")
|
||||
expand_mode = 2
|
||||
|
||||
[node name="TrackName" type="LineEdit" parent="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName"]
|
||||
[node name="TrackName" type="LineEdit" parent="HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(256, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_fonts/font = SubResource("FontVariation_lbdn3")
|
||||
text = "Track Name"
|
||||
expand_to_text_length = true
|
||||
placeholder_text = "Empty Track"
|
||||
context_menu_enabled = false
|
||||
draw_control_chars = true
|
||||
caret_blink = true
|
||||
script = ExtResource("4_2nwak")
|
||||
|
||||
[connection signal="text_submitted" from="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName/TrackName" to="PanelContainer/HBoxContainer/Body/HBoxContainer/NameIconControls/IconAndName/TrackName" method="release_focus" unbinds=1]
|
||||
[node name="PopupMenu" type="PopupMenu" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -37,12 +37,6 @@ func format_time_ms_minutes(ms: float) -> String:
|
||||
var milliseconds = fmod(ms, 1000.0)
|
||||
return "%02d:%02d.%03d" % [minutes, seconds, milliseconds]
|
||||
|
||||
func _ready():
|
||||
await get_tree().process_frame
|
||||
queue_redraw()
|
||||
pass
|
||||
|
||||
|
||||
func get_track_idx_by_y(y: float):
|
||||
var idx = 0
|
||||
for track in track_list.get_children():
|
||||
@@ -53,6 +47,8 @@ func get_track_idx_by_y(y: float):
|
||||
return -1
|
||||
|
||||
func get_track_by_idx(idx: int) -> Control:
|
||||
if idx > track_list.get_child_count() - 1:
|
||||
return null
|
||||
return track_list.get_child(idx)
|
||||
|
||||
func get_pixels_per_unit() -> float:
|
||||
@@ -97,7 +93,7 @@ func _draw():
|
||||
draw_line(Vector2(x, 28.0), Vector2(x, timeline_y), secondary_color, line_thickness)
|
||||
pass
|
||||
|
||||
# track lines
|
||||
# track horizontal lines
|
||||
for t in track_list.get_children():
|
||||
draw_line(Vector2(0.0, t.global_position.y - global_position.y + t.size.y), Vector2(size.x, t.global_position.y - global_position.y + t.size.y), secondary_color, line_thickness)
|
||||
pass
|
||||
@@ -163,4 +159,4 @@ func add_audio_clip(path: String, clip_name: String, track_idx: int, clip_start_
|
||||
|
||||
clip_added.emit(audio_clip)
|
||||
queue_redraw()
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -1,7 +1,46 @@
|
||||
class_name Track
|
||||
extends Control
|
||||
extends Button
|
||||
|
||||
signal on_deleted(idx: int)
|
||||
signal on_renamed
|
||||
signal on_duplicated
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
var menu: PopupMenu = $PopupMenu
|
||||
menu.add_item("Rename", 0)
|
||||
menu.add_item("Duplicate", 2)
|
||||
menu.add_item("Delete", 1)
|
||||
|
||||
menu.add_separator()
|
||||
menu.add_item("Properties")
|
||||
|
||||
menu.id_pressed.connect(_on_menu_option)
|
||||
|
||||
func _on_menu_option(id: int):
|
||||
match id:
|
||||
0:
|
||||
rename()
|
||||
1:
|
||||
delete()
|
||||
2:
|
||||
duplicate_track()
|
||||
pass
|
||||
|
||||
func delete():
|
||||
on_deleted.emit(get_index())
|
||||
pass
|
||||
|
||||
func rename():
|
||||
%TrackName.grab_focus()
|
||||
pass
|
||||
|
||||
func duplicate_track():
|
||||
pass
|
||||
|
||||
func _gui_input(event):
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
|
||||
var popup = %PopupMenu
|
||||
#%PopupMenu.popup(get_global_mouse_position())
|
||||
var pos = get_global_mouse_position()
|
||||
var rect = Rect2i(pos, popup.get_contents_minimum_size())
|
||||
popup.popup(rect)
|
||||
|
||||
14
Scripts/TrackLineEdit.gd
Normal file
14
Scripts/TrackLineEdit.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends LineEdit
|
||||
|
||||
func _ready() -> void:
|
||||
text_submitted.connect(submit)
|
||||
|
||||
func submit(text: String):
|
||||
release_focus()
|
||||
var owner = get_owner()
|
||||
|
||||
if owner is Control:
|
||||
var c = owner as Control
|
||||
c.grab_focus()
|
||||
|
||||
pass
|
||||
1
Scripts/TrackLineEdit.gd.uid
Normal file
1
Scripts/TrackLineEdit.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dxqa86sq21uac
|
||||
44
Scripts/TrackView.gd
Normal file
44
Scripts/TrackView.gd
Normal file
@@ -0,0 +1,44 @@
|
||||
extends Control
|
||||
class_name TrackView
|
||||
|
||||
@export var controller: Node
|
||||
@export var track_scene: PackedScene
|
||||
@onready var track_list: VBoxContainer = %TrackList
|
||||
|
||||
signal track_added(idx: int)
|
||||
signal track_deleted(idx: int)
|
||||
signal tracks_updated()
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func add_track(idx: int):
|
||||
track_added.emit(idx)
|
||||
tracks_updated.emit()
|
||||
pass
|
||||
|
||||
func delete_track(idx: int):
|
||||
track_deleted.emit(idx)
|
||||
_track_deleted(idx)
|
||||
tracks_updated.emit()
|
||||
pass
|
||||
|
||||
func _track_added():
|
||||
var track = track_scene.instantiate() as Track
|
||||
track.on_deleted.connect(delete_track)
|
||||
track_list.add_child(track)
|
||||
pass
|
||||
|
||||
func _track_duplicated(idx: int):
|
||||
pass
|
||||
|
||||
func _track_renamed(idx: int):
|
||||
pass
|
||||
|
||||
func _track_deleted(idx: int):
|
||||
var track = track_list.get_child(idx)
|
||||
track.call_deferred("free")
|
||||
pass
|
||||
|
||||
func get_track_elements() -> Array[Node]:
|
||||
return track_list.get_children()
|
||||
1
Scripts/TrackView.gd.uid
Normal file
1
Scripts/TrackView.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://y5e28thwmx7e
|
||||
@@ -58,7 +58,6 @@ public partial class AudioFileAnalyzer : Node
|
||||
long sampleCount = reader.Length / reader.WaveFormat.BlockAlign;
|
||||
waveformInfo.Samples = new float[sampleCount];
|
||||
|
||||
// Render the waveform
|
||||
byte[] buffer = new byte[reader.WaveFormat.BlockAlign];
|
||||
for (int i = 0; i < sampleCount; i++)
|
||||
{
|
||||
@@ -68,8 +67,8 @@ public partial class AudioFileAnalyzer : Node
|
||||
// Read the raw bytes for the current sample
|
||||
reader.Read(buffer, 0, buffer.Length);
|
||||
|
||||
// Convert the byte array to a 16-bit sample (assuming 16-bit PCM)
|
||||
short sample = BitConverter.ToInt16(buffer, 0); // Assuming 16-bit signed samples
|
||||
// Convert the byte array to a 16-bit sample
|
||||
short sample = BitConverter.ToInt16(buffer, 0);
|
||||
|
||||
waveformInfo.Samples[sampleIndex++] = (float)sample / short.MaxValue;
|
||||
}
|
||||
|
||||
9
Source/Clip.cs
Normal file
9
Source/Clip.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace AudioEditor;
|
||||
|
||||
public class Clip
|
||||
{
|
||||
public TimeSpan StartTime { get; private set; }
|
||||
public TimeSpan EndTime { get; private set; }
|
||||
}
|
||||
1
Source/Clip.cs.uid
Normal file
1
Source/Clip.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b20juoqt3ac8x
|
||||
46
Source/Project.cs
Normal file
46
Source/Project.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AudioEditor;
|
||||
|
||||
public class Project
|
||||
{
|
||||
public int TrackCount => _tracks.Count;
|
||||
public void AddTrack()
|
||||
{
|
||||
var idx = _tracks.Count;
|
||||
_tracks.Add(new Track(idx, string.Empty));
|
||||
}
|
||||
|
||||
public void DuplicateTrack(int idx)
|
||||
{
|
||||
if (idx < 0 && idx > _tracks.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var track = _tracks[idx];
|
||||
var duplicate = track.Duplicate();
|
||||
|
||||
_tracks.Add(duplicate);
|
||||
}
|
||||
|
||||
public void RenameTrack(int idx, string name)
|
||||
{
|
||||
if (idx < 0 && idx > _tracks.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteTrack(int idx)
|
||||
{
|
||||
if (idx < 0 && idx > _tracks.Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_tracks.RemoveAt(idx);
|
||||
}
|
||||
|
||||
private List<Track> _tracks = new();
|
||||
}
|
||||
1
Source/Project.cs.uid
Normal file
1
Source/Project.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bvgn3tf07jspe
|
||||
@@ -7,12 +7,40 @@ namespace AudioEditor;
|
||||
public partial class ProjectController : Node
|
||||
{
|
||||
[Signal] public delegate void AudioClipDroppedEventHandler(Vector2 atPosition, string path, string clipName, double startTime, double endTime);
|
||||
[Signal] public delegate void OnTrackAddedEventHandler(int idx);
|
||||
[Signal] public delegate void OnTrackRenamedEventHandler(int idx, string name);
|
||||
[Signal] public delegate void OnTrackDuplicatedEventHandler(int idx);
|
||||
[Signal] public delegate void OnTrackDeletedEventHandler(int trackIdx);
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GetWindow().FilesDropped += FilesDropped;
|
||||
}
|
||||
|
||||
public void AddTrack(int idx = 0)
|
||||
{
|
||||
_project.AddTrack();
|
||||
EmitSignal(SignalName.OnTrackAdded, _project.TrackCount - 1);
|
||||
}
|
||||
|
||||
public void DuplicateTrack(int idx)
|
||||
{
|
||||
_project.DuplicateTrack(idx);
|
||||
EmitSignal(SignalName.OnTrackDuplicated, idx);
|
||||
}
|
||||
|
||||
public void RenameTrack(int idx, string name)
|
||||
{
|
||||
_project.RenameTrack(idx, name);
|
||||
EmitSignal(SignalName.OnTrackRenamed, idx, name);
|
||||
}
|
||||
|
||||
public void DeleteTrack(int idx)
|
||||
{
|
||||
_project.DeleteTrack(idx);
|
||||
EmitSignal(SignalName.OnTrackDeleted, idx);
|
||||
}
|
||||
|
||||
public void CreateAudioClipPreview(Control audioClip)
|
||||
{
|
||||
// GD.Print(audioClip.Clas());
|
||||
@@ -48,4 +76,6 @@ public partial class ProjectController : Node
|
||||
|
||||
EmitSignal(SignalName.AudioClipDropped, mousePosition, path, fileName, 0, waveformInfo.Length.TotalMilliseconds);
|
||||
}
|
||||
|
||||
private Project _project = new();
|
||||
}
|
||||
33
Source/Track.cs
Normal file
33
Source/Track.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace AudioEditor;
|
||||
|
||||
public class Track
|
||||
{
|
||||
public int Idx { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
public Track(int idx, string name)
|
||||
{
|
||||
Idx = idx;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public Track(int idx, string name, IEnumerable<Clip> clips)
|
||||
{
|
||||
Idx = idx;
|
||||
Name = name;
|
||||
_clips = clips.ToList();
|
||||
}
|
||||
|
||||
public bool TryAddClip(Clip clip)
|
||||
{
|
||||
_clips.Add(clip);
|
||||
return false;
|
||||
}
|
||||
|
||||
public Track Duplicate() => new(Idx, Name, _clips);
|
||||
|
||||
private List<Clip> _clips = new();
|
||||
}
|
||||
1
Source/Track.cs.uid
Normal file
1
Source/Track.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dtk58stvxxdyl
|
||||
@@ -140,6 +140,7 @@ size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="LeftDock" type="Container" parent="VBoxContainer/VSplitContainer/HSplitContainer"]
|
||||
z_index = 2
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
@@ -151,6 +152,7 @@ layout = SubResource("Resource_20kxa")
|
||||
|
||||
[node name="Tracks" parent="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock" instance=ExtResource("5_rgxdu")]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Timeline" parent="VBoxContainer/VSplitContainer/HSplitContainer" node_paths=PackedStringArray("track_list") instance=ExtResource("7_xu70y")]
|
||||
layout_mode = 2
|
||||
@@ -186,4 +188,8 @@ mouse_filter = 2
|
||||
[node name="ProjectController" type="Node" parent="."]
|
||||
script = ExtResource("11_gc3ui")
|
||||
|
||||
[connection signal="track_added" from="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks" to="ProjectController" method="AddTrack"]
|
||||
[connection signal="tracks_updated" from="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks" to="VBoxContainer/VSplitContainer/HSplitContainer/Timeline" method="queue_redraw"]
|
||||
[connection signal="clip_added" from="VBoxContainer/VSplitContainer/HSplitContainer/Timeline" to="ProjectController" method="CreateAudioClipPreview"]
|
||||
[connection signal="AudioClipDropped" from="ProjectController" to="VBoxContainer/VSplitContainer/HSplitContainer/Timeline" method="clip_dropped"]
|
||||
[connection signal="OnTrackAdded" from="ProjectController" to="VBoxContainer/VSplitContainer/HSplitContainer/LeftDock/Tracks" method="_track_added" unbinds=1]
|
||||
|
||||
@@ -1,57 +1,38 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bpd6g2b3s7tqa"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bpd6g2b3s7tqa"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dlb5xpe1t8rrk" path="res://Controls/AudioTrack.tscn" id="1_ueogm"]
|
||||
[ext_resource type="Script" uid="uid://y5e28thwmx7e" path="res://Scripts/TrackView.gd" id="1_8piyd"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3kajrpp2ux7" path="res://Controls/Track.tscn" id="1_qr47w"]
|
||||
[ext_resource type="Texture2D" uid="uid://b3mydiolrvqlr" path="res://Assets/Icons/add.svg" id="2_rekuu"]
|
||||
|
||||
[node name="Tracks" type="Control"]
|
||||
clip_children = 1
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
[node name="TrackView" type="Control"]
|
||||
clip_children = 2
|
||||
custom_minimum_size = Vector2(264, 0)
|
||||
layout_mode = 3
|
||||
anchors_preset = 9
|
||||
anchor_bottom = 1.0
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_8piyd")
|
||||
track_scene = ExtResource("1_qr47w")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
custom_minimum_size = Vector2(128, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="TrackList" type="VBoxContainer" parent="VBoxContainer"]
|
||||
custom_minimum_size = Vector2(128, 0)
|
||||
unique_name_in_owner = true
|
||||
clip_children = 1
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Track" parent="VBoxContainer/TrackList" instance=ExtResource("1_ueogm")]
|
||||
custom_minimum_size = Vector2(128, 74)
|
||||
layout_mode = 2
|
||||
script = null
|
||||
|
||||
[node name="Track2" parent="VBoxContainer/TrackList" instance=ExtResource("1_ueogm")]
|
||||
custom_minimum_size = Vector2(128, 74)
|
||||
layout_mode = 2
|
||||
script = null
|
||||
|
||||
[node name="Track3" parent="VBoxContainer/TrackList" instance=ExtResource("1_ueogm")]
|
||||
custom_minimum_size = Vector2(128, 74)
|
||||
layout_mode = 2
|
||||
script = null
|
||||
|
||||
[node name="Track4" parent="VBoxContainer/TrackList" instance=ExtResource("1_ueogm")]
|
||||
custom_minimum_size = Vector2(128, 74)
|
||||
layout_mode = 2
|
||||
script = null
|
||||
|
||||
[node name="AddTrack" type="MenuButton" parent="VBoxContainer"]
|
||||
[node name="AddTrack" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
icon = ExtResource("2_rekuu")
|
||||
flat = false
|
||||
icon_alignment = 1
|
||||
item_count = 2
|
||||
popup/item_0/text = "Audio Track"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Label Track"
|
||||
popup/item_1/id = 1
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/AddTrack" to="." method="add_track" binds= [-1]]
|
||||
|
||||
44
export_presets.cfg
Normal file
44
export_presets.cfg
Normal file
@@ -0,0 +1,44 @@
|
||||
[preset.0]
|
||||
|
||||
name="Linux"
|
||||
platform="Linux"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="../../Audio Editor Builds/AudioEditor.x86_64"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="#!/usr/bin/env bash
|
||||
export DISPLAY=:0
|
||||
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
||||
\"{temp_dir}/{exe_name}\" {cmd_args}"
|
||||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
dotnet/include_scripts_content=false
|
||||
dotnet/include_debug_symbols=true
|
||||
dotnet/embed_build_outputs=false
|
||||
@@ -14,6 +14,7 @@ config/name="AudioEditor"
|
||||
run/main_scene="res://Views/MainView.tscn"
|
||||
config/features=PackedStringArray("4.4", "C#", "GL Compatibility")
|
||||
run/low_processor_mode=true
|
||||
run/delta_smoothing=false
|
||||
boot_splash/show_image=false
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user