library

package
v0.0.0-...-615ffff Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MP3_ASTR = "Recommended \"Album\" dB change: "
	MP3_TSTR = "Recommended \"Track\" dB change: "
)

Variables

View Source
var ErrUnknownFormat = errors.New("unknown audio format")
View Source
var ErrUnknownGainType = errors.New("unknown gain type")

Functions

func SongsUntagGain

func SongsUntagGain(list []*Song, songUpdateReceiver func(*Song)) error

Types

type Album

type Album struct {
	// contains filtered or unexported fields
}

func (*Album) GetSongs

func (v *Album) GetSongs() []*Song

func (*Album) GetTrack

func (v *Album) GetTrack(trackNo int) *Song

func (*Album) String

func (v *Album) String() string

func (*Album) TagGain

func (v *Album) TagGain(songUpdateReceiver func(*Song)) error

type AudioFormat

type AudioFormat int

TODO locks for gain

const (
	UNKNOWN AudioFormat = iota
	MP3
	OGG_VORBIS
	FLAC
)

func GetPathAudioFormat

func GetPathAudioFormat(path string) AudioFormat

GetPathAudioFormat() returns the audio format of the audio file located at path.

func (AudioFormat) String

func (v AudioFormat) String() string

type GainType

type GainType int
const (
	GAIN_TRACK GainType = iota
	GAIN_ALBUM
)

type Library

type Library struct {
	// contains filtered or unexported fields
}

func New

func New() *Library

New() returns an initialised instance of Library.

func (*Library) Albums

func (l *Library) Albums() []*Album

func (*Library) GetAlbum

func (l *Library) GetAlbum(name string) *Album

func (*Library) ImportFromDir

func (l *Library) ImportFromDir(dir string)

ImportFromDir() imports all songs in a directory, recursively.

func (*Library) ImportSong

func (l *Library) ImportSong(path string)

ImportSong() imports a single song into the library.

func (*Library) SetLoadFinishReceiver

func (l *Library) SetLoadFinishReceiver(rec func())

func (*Library) SetSongLoadReceiver

func (l *Library) SetSongLoadReceiver(rec func(s *Song))

func (*Library) String

func (l *Library) String() string

func (*Library) TaggedSongs

func (l *Library) TaggedSongs() []*Song

func (*Library) UntaggedAlbums

func (l *Library) UntaggedAlbums() []*Album

type Song

type Song struct {
	// contains filtered or unexported fields
}

func (*Song) AlbumName

func (s *Song) AlbumName() string

func (*Song) Gain

func (s *Song) Gain(t GainType) (ret string)

MT safe

func (*Song) LoadGain

func (s *Song) LoadGain(t GainType) (string, error)

func (*Song) Path

func (s *Song) Path() string

func (*Song) SetGain

func (s *Song) SetGain(g string, t GainType)

MT safe

func (*Song) String

func (s *Song) String() string

func (*Song) Title

func (s *Song) Title() string

func (*Song) Track

func (s *Song) Track() int

func (*Song) UntagGain

func (s *Song) UntagGain(songUpdateReceiver func(*Song)) error

Jump to

Keyboard shortcuts

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