WIP: track creation and deletion both in frontend and backend.
This commit is contained in:
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();
|
||||
}
|
||||
Reference in New Issue
Block a user