diff --git a/Aaru.CommonTypes.csproj b/Aaru.CommonTypes.csproj index a3f96dd..b990c3c 100644 --- a/Aaru.CommonTypes.csproj +++ b/Aaru.CommonTypes.csproj @@ -33,8 +33,8 @@ CS1591;CS1574 - - + + $(Version)+{chash:8} @@ -42,12 +42,12 @@ true - - - - - - + + + + + + @@ -55,9 +55,9 @@ - - - + + + diff --git a/Interfaces/IFluxImage.cs b/Interfaces/IFluxImage.cs new file mode 100644 index 0000000..772af85 --- /dev/null +++ b/Interfaces/IFluxImage.cs @@ -0,0 +1,56 @@ +using Aaru.CommonTypes.Enums; + +namespace Aaru.CommonTypes.Interfaces; + +/// +/// Abstract class to implement flux reading plugins. +public interface IFluxImage : IBaseImage +{ + /// + /// An image may have more than one capture for a specific head/track/sub-track combination. This returns + /// the amount of captures in the image for the specified head/track/sub-track combination. + /// + /// The number of captures + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + uint CapturesLength(uint head, ushort track, byte subTrack); + + /// Reads the resolution (sample rate) of a flux capture in picoseconds + /// The resolution of a capture in picoseconds + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + ulong ReadFluxResolution(uint head, ushort track, byte subTrack, uint captureIndex); + + /// Reads the entire flux capture with index and data streams, as well as its resolution + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// The capture's resolution (sample rate) in picoseconds + /// Buffer to store the index stream in + /// Buffer to store the data stream in + ErrorNumber ReadFluxCapture(uint head, ushort track, byte subTrack, uint captureIndex, out ulong resolution, + out byte[] indexBuffer, out byte[] dataBuffer); + + /// Reads a capture's index stream + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// Buffer to store the data in + ErrorNumber ReadFluxIndexCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer); + + /// Reads a capture's data stream + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// Buffer to store the data in + ErrorNumber ReadFluxDataCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer); +} \ No newline at end of file diff --git a/Interfaces/IWritableFluxImage.cs b/Interfaces/IWritableFluxImage.cs new file mode 100644 index 0000000..e252d36 --- /dev/null +++ b/Interfaces/IWritableFluxImage.cs @@ -0,0 +1,22 @@ +using Aaru.CommonTypes.Enums; + +namespace Aaru.CommonTypes.Interfaces; + +/// +/// Abstract class to implement flux writing plugins. +public interface IWritableFluxImage : IFluxImage, IWritableImage +{ + /// + /// Writes a flux capture. + /// + /// The capture's resolution (sample rate) in picoseconds + /// Flux representation of the index signal + /// Flux representation of the data signal + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture slot to write to. See also + /// Error number + ErrorNumber WriteFluxCapture(ulong resolution, byte[] index, byte[] data, uint head, ushort track, byte subTrack, + uint captureIndex); +} \ No newline at end of file