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

46
Source/Project.cs Normal file
View 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();
}