cue

package module
v0.0.0-...-79dcb2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

README

NAME
    cue is a cue parser implementation go-package.

AUTHORS
    Viacheslav Chumushuk <voice@root.ua>

COPYING
    This programm is released under the GNU General Public License version 3 or later, which is
    distributed in the COPYING file. You should have received a copy of the GNU General Public License along with
    this program.  If not, see <http://www.gnu.org/licenses/>.

Documentation

Overview

Package cue implement CUE-SHEET files parser. For CUE documentation see: http://digitalx.org/cue-sheet/syntax/

Some helper functions collection.

Index

Constants

View Source
const (

	// Intel binary file (least significant byte first)
	FileTypeBinary FileType = iota
	// Motorola binary file (most significant byte first)
	FileTypeMotorola
	// Audio AIFF file
	FileTypeAiff
	// Audio WAVE file
	FileTypeWave
	// Audio MP3 file
	FileTypeMp3

	// AUDIO – Audio/Music (2352)
	DataTypeAudio = iota
	// CDG – Karaoke CD+G (2448)
	DataTypeCdg
	// MODE1/2048 – CDROM Mode1 Data (cooked)
	DataTypeMode1_2048
	// MODE1/2352 – CDROM Mode1 Data (raw)
	DataTypeMode1_2352
	// MODE2/2336 – CDROM-XA Mode2 Data
	DataTypeMode2_2336
	// MODE2/2352 – CDROM-XA Mode2 Data
	DataTypeMode2_2352
	// CDI/2336 – CDI Mode2 Data
	DataTypeCdi_2336
	// CDI/2352 – CDI Mode2 Data
	DataTypeCdi_2352

	// Digital copy permitted.
	TrackFlagDcp = iota
	// Four channel audio.
	TrackFlag4ch
	// Pre-emphasis enabled (audio tracks only).
	TrackFlagPre
	// Serial copy management system (not supported by all recorders).
	TrackFlagScms
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// Name (path) of the file.
	Name string
	// Type of the audio file.
	Type FileType
	// List of present tracks in the file.
	Tracks []*Track
	// Total duration in seconds
	Duration float64
}

Audio file representation structure.

type FileType

type FileType int

Type of the audio file.

type Index

type Index struct {
	// Index number.
	Number int
	// Index starting time.
	Time Time
}

Track index type

type Sheet

type Sheet struct {
	// Disc's media catalog number.
	Catalog string
	// Name of a perfomer for a CD-TEXT enhanced disc
	Performer string
	// Specify a title for a CD-TEXT enhanced disc.
	Title string
	// Specify songwriter for disc.
	Songwriter string
	// Comments in the CUE SHEET file.
	Comments []string
	// Name of the file that contains the encoded CD-TEXT information for the disc.
	CdTextFile string
	// Data/audio files descibed byt the cue-file.
	Files []*File
}

Cue sheet file representation.

func Parse

func Parse(reader io.Reader, durations ...float64) (sheet *Sheet, err error)

Parse parses cue-sheet data (file) and returns filled Sheet struct.

func (*Sheet) FileTrackCount

func (s *Sheet) FileTrackCount(fileName string) int

func (*Sheet) FileTracks

func (s *Sheet) FileTracks(fileName string) []*Track

func (*Sheet) TracksCount

func (s *Sheet) TracksCount() (c int)

type Time

type Time struct {
	// Minutes.
	Min int
	// Minutes.
	Sec int
	// Frames.
	Frames int
}

Time point description type.

func (Time) Seconds

func (time Time) Seconds() float64

Seconds returns length in seconds.

type Track

type Track struct {
	// Track number (1-99).
	Number int
	// Track datatype.
	DataType TrackDataType
	// Track title.
	Title string
	// Track preformer.
	Performer string
	// Songwriter.
	Songwriter string
	// Track decode flags.
	Flags []TrackFlag
	// Internetional Standaard Recording Code.
	Isrc string
	// Track indexes.
	Indexes []Index
	// Length of the track pregap.
	Pregap Time
	// Length of the track postgap.
	Postgap       Time
	StartPosition float64
	EndPosition   float64
}

func (*Track) Duration

func (t *Track) Duration() float64

func (*Track) StartTime

func (t *Track) StartTime() (time Time)

StartTime return track start time

type TrackDataType

type TrackDataType int

Track datatype.

type TrackFlag

type TrackFlag int

Additional decode information about track.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL