Files
2026-02-21 16:45:37 +08:00

49 lines
1.8 KiB
C#

using System;
using System.Text;
using Crosstales.Radio.Model.Enum;
using Crosstales.Radio.Util;
using UnityEngine;
namespace Crosstales.Radio.Model.Entry
{
[Serializable]
public class RadioEntryResource : BaseRadioEntry
{
[Tooltip("Text-, M3U-, PLS- or ShoutcastID-file with the radios.")]
[Header("Source Settings")]
public TextAsset Resource;
[Tooltip("Data format of the resource with the radios (default: DataFormatResource.Text).")]
public DataFormatResource DataFormat;
[Tooltip("Reads only the given number of radio stations (default: : 0 (= all))")]
public int ReadNumberOfStations;
public RadioEntryResource(BaseRadioEntry entry, TextAsset resource, DataFormatResource dataFormat = DataFormatResource.Text, int readNumberOfStations = 0)
: base(entry.Name, entry.ForceName, entry.EnableSource, entry.Station, entry.Genres, entry.Rating, entry.Description, entry.Icon, entry.Format, entry.Bitrate, entry.ChunkSize, entry.BufferSize, entry.ExcludedCodec)
{
Resource = resource;
DataFormat = dataFormat;
ReadNumberOfStations = readNumberOfStations;
}
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder(base.ToString());
stringBuilder.Append(GetType().Name);
stringBuilder.Append(Constants.TEXT_TOSTRING_START);
stringBuilder.Append("Resource='");
stringBuilder.Append(Resource);
stringBuilder.Append(Constants.TEXT_TOSTRING_DELIMITER);
stringBuilder.Append("DataFormat='");
stringBuilder.Append(DataFormat);
stringBuilder.Append(Constants.TEXT_TOSTRING_DELIMITER);
stringBuilder.Append("ReadNumberOfStations='");
stringBuilder.Append(ReadNumberOfStations);
stringBuilder.Append(Constants.TEXT_TOSTRING_DELIMITER_END);
stringBuilder.Append(Constants.TEXT_TOSTRING_END);
return stringBuilder.ToString();
}
}
}