зеркало из https://github.com/mono/njb-sharp.git
2006-05-08 Aaron Bockover <aaron@abock.org>
* src/Song.cs: Make GetFrameString, GetFrameShort, and GetFrameInt perform conversions to respective return type if frame type is not of the expected data type; fixes an issue with a Nomad Jukebox 1 device reported and originally fixed by Bertrand Lorentz (BGO #341030) * src/NjbTest.cs: Updated to generate a standalone FDI file svn path=/trunk/njb-sharp/; revision=60411
This commit is contained in:
Родитель
eba708967e
Коммит
826491a6ed
|
@ -1,3 +1,12 @@
|
|||
2006-05-08 Aaron Bockover <aaron@abock.org>
|
||||
|
||||
* src/Song.cs: Make GetFrameString, GetFrameShort, and GetFrameInt
|
||||
perform conversions to respective return type if frame type is not of
|
||||
the expected data type; fixes an issue with a Nomad Jukebox 1 device
|
||||
reported and originally fixed by Bertrand Lorentz (BGO #341030)
|
||||
|
||||
* src/NjbTest.cs: Updated to generate a standalone FDI file
|
||||
|
||||
2006-04-17 Aaron Bockover <aaron@abock.org>
|
||||
|
||||
0.3.0 Release
|
||||
|
|
|
@ -33,8 +33,12 @@ public class Test
|
|||
{
|
||||
public static void HalFdiDump()
|
||||
{
|
||||
Console.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
Console.WriteLine("<deviceinfo version=\"0.2\">");
|
||||
Console.WriteLine(" <device>");
|
||||
Console.WriteLine(" <match key=\"info.bus\" string=\"usb\">\n\n");
|
||||
Console.WriteLine(" <!-- Begin NJB devices (generated by njb-sharp for libnjb compatible devices) -->\n");
|
||||
|
||||
foreach(DeviceId device in DeviceId.ListAll) {
|
||||
Console.WriteLine(" <!-- {0} -->", device.Name);
|
||||
Console.WriteLine(" <match key=\"usb.vendor_id\" int=\"0x{0:x4}\">", device.VendorId);
|
||||
|
@ -57,8 +61,9 @@ public class Test
|
|||
}
|
||||
|
||||
Console.WriteLine(" <!-- End NJB devices -->");
|
||||
|
||||
Console.WriteLine("\n\n </match>");
|
||||
Console.WriteLine(" </device>");
|
||||
Console.WriteLine("</deviceinfo>");
|
||||
}
|
||||
|
||||
public static void Assert(bool assert, string msg)
|
||||
|
|
21
src/Song.cs
21
src/Song.cs
|
@ -133,8 +133,15 @@ namespace Njb
|
|||
return null;
|
||||
}
|
||||
|
||||
switch(frame.FrameType) {
|
||||
case SongFrameType.UInt16:
|
||||
return Convert.ToString(frame.DataShort);
|
||||
case SongFrameType.UInt32:
|
||||
return Convert.ToString(frame.DataInt);
|
||||
default:
|
||||
return frame.DataString;
|
||||
}
|
||||
}
|
||||
|
||||
private ushort GetFrameShort(string label)
|
||||
{
|
||||
|
@ -143,8 +150,15 @@ namespace Njb
|
|||
return 0;
|
||||
}
|
||||
|
||||
switch(frame.FrameType) {
|
||||
case SongFrameType.String:
|
||||
return Convert.ToUInt16(frame.DataString);
|
||||
case SongFrameType.UInt32:
|
||||
return (ushort)frame.DataInt;
|
||||
default:
|
||||
return frame.DataShort;
|
||||
}
|
||||
}
|
||||
|
||||
private uint GetFrameInt(string label)
|
||||
{
|
||||
|
@ -153,8 +167,15 @@ namespace Njb
|
|||
return 0;
|
||||
}
|
||||
|
||||
switch(frame.FrameType) {
|
||||
case SongFrameType.String:
|
||||
return Convert.ToUInt32(frame.DataString);
|
||||
case SongFrameType.UInt16:
|
||||
return (uint)frame.DataShort;
|
||||
default:
|
||||
return frame.DataInt;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddFrame(SongFrame frame)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче