WIP: track creation and deletion both in frontend and backend.

This commit is contained in:
2025-07-28 01:03:40 +02:00
parent ecadfb7033
commit cb38a509b5
15 changed files with 192 additions and 49 deletions

View File

@@ -37,23 +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()
for c in track_list.get_children():
if c is Track:
var track = c as Track
track.on_deleted.connect(_track_deleted)
pass
pass
func _track_deleted(idx: int):
print("track deleted")
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():
@@ -64,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: