objects

package
v0.0.0-...-9e11140 Latest Latest
Warning

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

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

Documentation

Overview

Package objects provides the major data types representing the objects the application deals with - folders, programs, and files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	ID         int64
	ProgramID  int64
	FolderID   int64
	Path       string
	Title      string
	URL        string
	Ord        []int64
	Position   int64
	LastPlayed time.Time
}

File represents an audio file

func (*File) Clone

func (f *File) Clone() *File

Clone returns an identical copy of the receiver.

func (*File) DisplayTitle

func (f *File) DisplayTitle() string

DisplayTitle returns a - somewhat - presentable string to represent the file.

func (*File) Duration

func (f *File) Duration() (time.Duration, error)

Duration returns the duration of a File.

func (*File) GetParentFolder

func (f *File) GetParentFolder() string

GetParentFolder returns the name of the Folder the file lives in, i.e. basename(dirname(path))

func (*File) PathURL

func (f *File) PathURL() string

PathURL returns the File's path as a file:// URL. Intended for use with DBus interfaces

type Folder

type Folder struct {
	ID       int64
	Path     string
	LastScan time.Time
}

Folder represents the root of a directory tree where audio files are stored.

func (*Folder) Clone

func (f *Folder) Clone() *Folder

Clone return a pointer to a freshly-allocated memberwise copy of the receiver.

func (*Folder) SinceLastScan

func (f *Folder) SinceLastScan() time.Duration

SinceLastScan returns the amount of time that has passed since the Folder was last scanned.

type Program

type Program struct {
	ID      int64
	CurFile int64
	Title   string
	Creator string
	URL     *url.URL
}

Program is a rather generic term for any sequence of one or more audio files that one might enjoy listening to, be it an audio book, a podcast, or whatever.

func (*Program) Clone

func (p *Program) Clone() *Program

Clone return a pointer to a freshly-allocated memberwise copy of the receiver.

func (*Program) URLString

func (p *Program) URLString() string

URLString returns the Program's associated URL as a string.

Jump to

Keyboard shortcuts

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