From 71bb82285659a159d87276d461b92e8f3fb9b25c Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 16 Sep 2020 11:22:33 -0700 Subject: [PATCH] Add cuesheet structures --- DICUI.Library/CueSheets/CueFile.cs | 60 ++++++++++++ DICUI.Library/CueSheets/CueIndex.cs | 33 +++++++ DICUI.Library/CueSheets/CueSheet.cs | 47 +++++++++ DICUI.Library/CueSheets/CueTrack.cs | 144 ++++++++++++++++++++++++++++ DICUI.Library/CueSheets/PostGap.cs | 28 ++++++ DICUI.Library/CueSheets/PreGap.cs | 28 ++++++ 6 files changed, 340 insertions(+) create mode 100644 DICUI.Library/CueSheets/CueFile.cs create mode 100644 DICUI.Library/CueSheets/CueIndex.cs create mode 100644 DICUI.Library/CueSheets/CueSheet.cs create mode 100644 DICUI.Library/CueSheets/CueTrack.cs create mode 100644 DICUI.Library/CueSheets/PostGap.cs create mode 100644 DICUI.Library/CueSheets/PreGap.cs diff --git a/DICUI.Library/CueSheets/CueFile.cs b/DICUI.Library/CueSheets/CueFile.cs new file mode 100644 index 00000000..be543476 --- /dev/null +++ b/DICUI.Library/CueSheets/CueFile.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; + +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.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, + } + + /// + /// Represents a single FILE in a cuesheet + /// + public class CueFile + { + /// + /// filename + /// + public string Name { get; set; } + + /// + /// filetype + /// + public CueFileType FileType { get; set; } + + /// + /// List of TRACK in FILE + /// + public List Tracks { get; set; } + } +} diff --git a/DICUI.Library/CueSheets/CueIndex.cs b/DICUI.Library/CueSheets/CueIndex.cs new file mode 100644 index 00000000..3a418da6 --- /dev/null +++ b/DICUI.Library/CueSheets/CueIndex.cs @@ -0,0 +1,33 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.CueSheets +{ + /// + /// Represents a single INDEX in a TRACK + /// + public class CueIndex + { + /// + /// 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/DICUI.Library/CueSheets/CueSheet.cs b/DICUI.Library/CueSheets/CueSheet.cs new file mode 100644 index 00000000..09ba08fe --- /dev/null +++ b/DICUI.Library/CueSheets/CueSheet.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.CueSheets +{ + /// + /// Represents a single cuesheet + /// + public class CueSheet + { + /// + /// CATALOG + /// + public string Catalog { get; set; } + + /// + /// CDTEXTFILE + /// + public string CdTextFile { get; set; } + + /// + /// PERFORMER + /// + public string Performer { get; set; } + + /// + /// SONGWRITER + /// + public string Songwriter { get; set; } + + /// + /// TITLE + /// + public string Title { get; set; } + + /// + /// List of FILE in cuesheet + /// + public List Files { get; set; } + } +} diff --git a/DICUI.Library/CueSheets/CueTrack.cs b/DICUI.Library/CueSheets/CueTrack.cs new file mode 100644 index 00000000..2cc8d949 --- /dev/null +++ b/DICUI.Library/CueSheets/CueTrack.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; + +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.CueSheets +{ + /// + /// 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, + } + + /// + /// 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 + public string ISRC { get; set; } + + /// + /// PERFORMER + /// + public string Performer { get; set; } + + /// + /// SONGWRITER + /// + public string Songwriter { get; set; } + + /// + /// TITLE + /// + public string Title { get; set; } + + /// + /// PREGAP + /// + public PreGap PreGap { get; set; } + + /// + /// List of INDEX in TRACK + /// + /// Must start with 0 or 1 and then sequential + public List Indices { get; set; } + + /// + /// POSTGAP + /// + public PostGap PostGap { get; set; } + } +} diff --git a/DICUI.Library/CueSheets/PostGap.cs b/DICUI.Library/CueSheets/PostGap.cs new file mode 100644 index 00000000..07663cfa --- /dev/null +++ b/DICUI.Library/CueSheets/PostGap.cs @@ -0,0 +1,28 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.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/DICUI.Library/CueSheets/PreGap.cs b/DICUI.Library/CueSheets/PreGap.cs new file mode 100644 index 00000000..219fee53 --- /dev/null +++ b/DICUI.Library/CueSheets/PreGap.cs @@ -0,0 +1,28 @@ +/// +/// Information sourced from http://web.archive.org/web/20070221154246/http://www.goldenhawk.com/download/cdrwin.pdf +/// +namespace DICUI.Library.CueSheets +{ + /// + /// Represents pregap information of a track + /// + public class PreGap + { + /// + /// 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; } + } +}