Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PackageVersion string = "default version"
PackageVersion contains the package version
Functions ¶
This section is empty.
Types ¶
type Carrier ¶
type Carrier struct { XMLName xml.Name `xml:"https://www.inurbanus.nl/NS/speeldoos/1.0 Carrier"` Name string // A catalog number, or some other unique identifier within the collection ID string `xml:",omitempty"` // The SHA256 hash of the corresponding .zip bundle for this carrier. Hash string `xml:"hash,attr,omitempty"` // An indication of how this carrier ended up in this library. // Suggested values: // * "WEB" (digital download) // * "CD" (ripped cd) Source string `xml:"source,attr,omitempty"` // The performances on this carrier Performances []Performance `xml:"Performances>Performance"` }
A Carrier can represent either a physical medium or a packaged download. An "album," in layman's terms.
func ImportCarrier ¶
ImportCarrier reads a serialized Carrier from a file
type Composer ¶
type Composer struct { Name string // A composer's ID is the page ID for their Wikipedia page ID string `xml:"id,attr,omitempty"` }
A Composer represents a composer
type Library ¶
type Library struct { LibraryDir string WAVConf wavreader.Config Carriers []ParsedCarrier // contains filtered or unexported fields }
A Library consists of a collection of Carriers
func NewLibrary ¶
NewLibrary instantiates a new Library with the specified base directory
func (*Library) AllCarriers ¶
func (l *Library) AllCarriers() []ParsedCarrier
AllCarriers filters all Carriers in the library, and returns those that are error-free
func (*Library) GetWAV ¶
func (l *Library) GetWAV(pf Performance) (wavreader.Reader, error)
GetWAV opens one performance in the library and return its raw audio data
func (*Library) NewScheduler ¶ added in v0.5.0
func (l *Library) NewScheduler(wc chunker.WAVChunkConfig) (*Scheduler, error)
type OpusNumber ¶
type OpusNumber struct { Number string `xml:",chardata"` // Some composers use a different index (e.g. 'BWV', 'KV', 'Wq', etc.) IndexName string `xml:",attr,omitempty"` }
An OpusNumber represents an opus number for a composition. Opus numbers, together with the composer, ideally uniquely identify a work
func (OpusNumber) String ¶
func (o OpusNumber) String() string
type ParsedCarrier ¶
type ParsedCarrier struct { // The full path to the xml file Filename string // The parsed Carrier, if successful Carrier *Carrier // The parse error, if applicable Error error }
A ParsedCarrier wraps a Carrier object together with the file name it came from
type Performance ¶
type Performance struct { Work Work // The year in which the performance took place Year int `xml:",omitempty"` Performers []Performer `xml:"Performers>Performer"` SourceFiles []SourceFile `xml:"SourceFiles>File"` }
A Performance represents one (recording of a) performance of a Work.
type Performer ¶
type Performer struct { Name string `xml:",chardata"` // The type of performer. Suggested values: // * "performer" // * "soloist" // * "orchestra" // * "ensemble" // * "conductor" Role string `xml:"role,attr,omitempty"` }
A Performer in one particular recording of a Work. An 'artist', if you will.
type Scheduler ¶ added in v0.5.0
func (*Scheduler) NextPerformance ¶ added in v0.5.0
func (s *Scheduler) NextPerformance() Performance
type SourceFile ¶
type SourceFile struct { Filename string `xml:",chardata"` // The disc number, if applicable. Disc int `xml:"disc,attr,omitempty"` }
A SourceFile wraps the path to a file containing the recording of that particular performance
func (SourceFile) String ¶
func (s SourceFile) String() string
type Work ¶
type Work struct { Composer Composer // A work may have more than one title in different languages. Title []Title // The opus number(s) for this composition. There may be more than one index // for identifying works by this particular composer. Or none at all. Or // this work may just not appear on any of them. OpusNumber []OpusNumber // The parts that comprise this work, if any. Parts []Part `xml:"Parts>Part,omitempty"` // The year this composition was completed. Year int }
A Work represents a musical composition.