2020-04-22 00:30:55 +02:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using Microsoft.Xna.Framework.Media;
|
|
|
|
|
2020-09-16 23:39:01 +02:00
|
|
|
namespace MLEM.Data.Content {
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:30:55 +02:00
|
|
|
public class SongReader : RawContentReader<Song> {
|
|
|
|
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:30:55 +02:00
|
|
|
protected override Song Read(RawContentManager manager, string assetPath, Stream stream, Song existing) {
|
|
|
|
return Song.FromUri(Path.GetFileNameWithoutExtension(assetPath), new Uri(assetPath));
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:53:42 +02:00
|
|
|
/// <inheritdoc />
|
2020-04-22 00:30:55 +02:00
|
|
|
public override string[] GetFileExtensions() {
|
|
|
|
return new[] {"ogg", "wav", "mp3"};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|