mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-25 14:00:21 +00:00
Automatically clear the playlist for the audio player to prevent dupes
This commit is contained in:
parent
68f5bfc20d
commit
4ba79980c9
1 changed files with 8 additions and 4 deletions
|
@ -66,10 +66,13 @@ namespace Toolbox.Library.Forms
|
|||
|
||||
}
|
||||
|
||||
public void LoadFile(IWaveSource source, IFileFormat fileFormat, bool ClearPlaylist = false, object AudioStruct = null)
|
||||
public void LoadFile(IWaveSource source, IFileFormat fileFormat, bool ClearPlaylist = true, object AudioStruct = null)
|
||||
{
|
||||
if (ClearPlaylist)
|
||||
{
|
||||
audioListView.Items.Clear();
|
||||
AudioFileFormats.Clear();
|
||||
}
|
||||
|
||||
AudioFile file = new AudioFile();
|
||||
file.Title = fileFormat.FileName;
|
||||
|
@ -83,8 +86,6 @@ namespace Toolbox.Library.Forms
|
|||
}
|
||||
|
||||
AudioFileFormats.Add(fileFormat);
|
||||
|
||||
|
||||
audioListView.AddObject(file);
|
||||
|
||||
AudioChannel audioChannel = new AudioChannel();
|
||||
|
@ -105,10 +106,13 @@ namespace Toolbox.Library.Forms
|
|||
|
||||
}
|
||||
|
||||
public void LoadFile(AudioData audioData, IFileFormat fileFormat, bool ClearPlaylist = false)
|
||||
public void LoadFile(AudioData audioData, IFileFormat fileFormat, bool ClearPlaylist = true)
|
||||
{
|
||||
if (ClearPlaylist)
|
||||
{
|
||||
audioListView.Items.Clear();
|
||||
AudioFileFormats.Clear();
|
||||
}
|
||||
|
||||
AudioFileFormats.Add(fileFormat);
|
||||
|
||||
|
|
Loading…
Reference in a new issue