diff --git a/CueSheets/CueFile.cs b/CueSheets/CueFile.cs new file mode 100644 index 0000000..e9d0d87 --- /dev/null +++ b/CueSheets/CueFile.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; + +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents a single FILE in a cuesheet + /// + public class CueFile + { + /// + /// filename + /// +#if NET48 + public string FileName { get; set; } +#else + public string? FileName { get; set; } +#endif + + /// + /// filetype + /// + public CueFileType FileType { get; set; } + + /// + /// List of TRACK in FILE + /// +#if NET48 + public CueTrack[] Tracks { get; set; } +#else + public CueTrack?[]? Tracks { get; set; } +#endif + } +} diff --git a/CueSheets/CueIndex.cs b/CueSheets/CueIndex.cs new file mode 100644 index 0000000..19ebbb7 --- /dev/null +++ b/CueSheets/CueIndex.cs @@ -0,0 +1,33 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents a single INDEX in a TRACK + /// + public class CueIndex + { + /// + /// INDEX number, between 0 and 99 + /// + public int Index { get; set; } + + /// + /// Starting time of INDEX in minutes + /// + public int Minutes { get; set; } + + /// + /// Starting time of INDEX in seconds + /// + /// There are 60 seconds in a minute + public int Seconds { get; set; } + + /// + /// Starting time of INDEX in frames. + /// + /// There are 75 frames per second + public int Frames { get; set; } + } +} diff --git a/CueSheets/CueSheet.cs b/CueSheets/CueSheet.cs new file mode 100644 index 0000000..6a4bc4f --- /dev/null +++ b/CueSheets/CueSheet.cs @@ -0,0 +1,65 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents a single cuesheet + /// + public class CueSheet + { + /// + /// CATALOG + /// +#if NET48 + public string Catalog { get; set; } +#else + public string? Catalog { get; set; } +#endif + + /// + /// CDTEXTFILE + /// +#if NET48 + public string CdTextFile { get; set; } +#else + public string? CdTextFile { get; set; } +#endif + + /// + /// PERFORMER + /// +#if NET48 + public string Performer { get; set; } +#else + public string? Performer { get; set; } +#endif + + /// + /// SONGWRITER + /// +#if NET48 + public string Songwriter { get; set; } +#else + public string? Songwriter { get; set; } +#endif + + /// + /// TITLE + /// +#if NET48 + public string Title { get; set; } +#else + public string? Title { get; set; } +#endif + + /// + /// List of FILE in cuesheet + /// +#if NET48 + public CueFile[] Files { get; set; } +#else + public CueFile?[]? Files { get; set; } +#endif + } +} diff --git a/CueSheets/CueTrack.cs b/CueSheets/CueTrack.cs new file mode 100644 index 0000000..1d85760 --- /dev/null +++ b/CueSheets/CueTrack.cs @@ -0,0 +1,91 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents a single TRACK in a FILE + /// + public class CueTrack + { + /// + /// Track number. The range is 1 to 99. + /// + public int Number { get; set; } + + /// + /// Track datatype + /// + public CueTrackDataType DataType { get; set; } + + /// + /// FLAGS + /// + public CueTrackFlag Flags { get; set; } + + /// + /// ISRC + /// + /// 12 characters in length +#if NET48 + public string ISRC { get; set; } +#else + public string? ISRC { get; set; } +#endif + + /// + /// PERFORMER + /// +#if NET48 + public string Performer { get; set; } +#else + public string? Performer { get; set; } +#endif + + /// + /// SONGWRITER + /// +#if NET48 + public string Songwriter { get; set; } +#else + public string? Songwriter { get; set; } +#endif + + /// + /// TITLE + /// +#if NET48 + public string Title { get; set; } +#else + public string? Title { get; set; } +#endif + + /// + /// PREGAP + /// +#if NET48 + public PreGap PreGap { get; set; } +#else + public PreGap? PreGap { get; set; } +#endif + + /// + /// List of INDEX in TRACK + /// + /// Must start with 0 or 1 and then sequential +#if NET48 + public CueIndex[] Indices { get; set; } +#else + public CueIndex?[]? Indices { get; set; } +#endif + + /// + /// POSTGAP + /// +#if NET48 + public PostGap PostGap { get; set; } +#else + public PostGap? PostGap { get; set; } +#endif + } +} diff --git a/CueSheets/Enums.cs b/CueSheets/Enums.cs new file mode 100644 index 0000000..c330ce2 --- /dev/null +++ b/CueSheets/Enums.cs @@ -0,0 +1,116 @@ +using System; + +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// The audio or data file’s filetype + /// + public enum CueFileType + { + /// + /// Intel binary file (least significant byte first). Use for data files. + /// + BINARY, + + /// + /// Motorola binary file (most significant byte first). Use for data files. + /// + MOTOROLA, + + /// + /// Audio AIFF file (44.1KHz 16-bit stereo) + /// + AIFF, + + /// + /// Audio WAVE file (44.1KHz 16-bit stereo) + /// + WAVE, + + /// + /// Audio MP3 file (44.1KHz 16-bit stereo) + /// + MP3, + } + + /// + /// Track datatype + /// + public enum CueTrackDataType + { + /// + /// AUDIO, Audio/Music (2352) + /// + AUDIO, + + /// + /// CDG, Karaoke CD+G (2448) + /// + CDG, + + /// + /// MODE1/2048, CD-ROM Mode1 Data (cooked) + /// + MODE1_2048, + + /// + /// MODE1/2352 CD-ROM Mode1 Data (raw) + /// + MODE1_2352, + + /// + /// MODE2/2336, CD-ROM XA Mode2 Data + /// + MODE2_2336, + + /// + /// MODE2/2352, CD-ROM XA Mode2 Data + /// + MODE2_2352, + + /// + /// CDI/2336, CD-I Mode2 Data + /// + CDI_2336, + + /// + /// CDI/2352, CD-I Mode2 Data + /// + CDI_2352, + } + + /// + /// Special subcode flags within a track + /// + [Flags] + public enum CueTrackFlag + { + /// + /// DCP, Digital copy permitted + /// + DCP = 1 << 0, + + /// + /// 4CH, Four channel audio + /// + FourCH = 1 << 1, + + /// + /// PRE, Pre-emphasis enabled (audio tracks only) + /// + PRE = 1 << 2, + + /// + /// SCMS, Serial Copy Management System (not supported by all recorders) + /// + SCMS = 1 << 3, + + /// + /// DATA, set for data files. This flag is set automatically based on the track’s filetype + /// + DATA = 1 << 4, + } +} diff --git a/CueSheets/PostGap.cs b/CueSheets/PostGap.cs new file mode 100644 index 0000000..88046bc --- /dev/null +++ b/CueSheets/PostGap.cs @@ -0,0 +1,28 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents POSTGAP information of a track + /// + public class PostGap + { + /// + /// Length of POSTGAP in minutes + /// + public int Minutes { get; set; } + + /// + /// Length of POSTGAP in seconds + /// + /// There are 60 seconds in a minute + public int Seconds { get; set; } + + /// + /// Length of POSTGAP in frames. + /// + /// There are 75 frames per second + public int Frames { get; set; } + } +} diff --git a/CueSheets/PreGap.cs b/CueSheets/PreGap.cs new file mode 100644 index 0000000..206376c --- /dev/null +++ b/CueSheets/PreGap.cs @@ -0,0 +1,28 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace SabreTools.Models.CueSheets +{ + /// + /// Represents PREGAP information of a track + /// + public class PreGap + { + /// + /// Length of PREGAP in minutes + /// + public int Minutes { get; set; } + + /// + /// Length of PREGAP in seconds + /// + /// There are 60 seconds in a minute + public int Seconds { get; set; } + + /// + /// Length of PREGAP in frames. + /// + /// There are 75 frames per second + public int Frames { get; set; } + } +}