Leave only one track type, WIP: track deletion.
This commit is contained in:
@@ -40,8 +40,19 @@ func format_time_ms_minutes(ms: float) -> String:
|
||||
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
|
||||
@@ -97,7 +108,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 +174,4 @@ func add_audio_clip(path: String, clip_name: String, track_idx: int, clip_start_
|
||||
|
||||
clip_added.emit(audio_clip)
|
||||
queue_redraw()
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user