mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Sound.Channels as a number
This commit is contained in:
@@ -571,16 +571,23 @@ namespace SabreTools.Library.DatFiles
|
||||
break;
|
||||
|
||||
case "sound":
|
||||
datItems.Add(new Sound
|
||||
var sound = new Sound
|
||||
{
|
||||
Channels = reader.GetAttribute("channels"),
|
||||
|
||||
Source = new Source
|
||||
{
|
||||
Index = indexId,
|
||||
Name = filename,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// Set the channels
|
||||
if (reader.GetAttribute("channels") != null)
|
||||
{
|
||||
if (Int64.TryParse(reader.GetAttribute("channels"), out long channels))
|
||||
sound.Channels = channels;
|
||||
}
|
||||
|
||||
datItems.Add(sound);
|
||||
|
||||
reader.Read();
|
||||
break;
|
||||
@@ -1666,7 +1673,7 @@ namespace SabreTools.Library.DatFiles
|
||||
case ItemType.Sound:
|
||||
var sound = datItem as Sound;
|
||||
xtw.WriteStartElement("sound");
|
||||
xtw.WriteOptionalAttributeString("channels", sound.Channels);
|
||||
xtw.WriteOptionalAttributeString("channels", sound.Channels?.ToString());
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user