rockbox

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package rockbox provides functionality to parse Rockbox database files

Index

Constants

View Source
const (
	// TagCacheDir is the directory containing Rockbox database files
	TagCacheDir = ".rockbox"
	// DatabaseFile is the main database index file
	DatabaseFile = "database_idx.tcd"
	// TagCacheMagic is the magic number for TagCache files
	TagCacheMagic = 0x54434801 // "TCH\x01"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct{}

DefaultLogger provides a simple console logger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string, args ...interface{})

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string, args ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string, args ...interface{})

type Logger

type Logger interface {
	Info(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Debug(msg string, args ...interface{})
}

Logger interface for logging parse operations

type NumericTagData

type NumericTagData struct {
	Year        int
	DiscNumber  int
	TrackNumber int
	Bitrate     int
	Length      int
	PlayCount   int
	Rating      int
	LastPlayed  int64
}

NumericTagData holds numeric tag values for a song

type Parser

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

Parser handles parsing of Rockbox database files

func NewParser

func NewParser(rockboxPath string, logger Logger) *Parser

NewParser creates a new Rockbox database parser

func (*Parser) EnsurePlaylistDir

func (p *Parser) EnsurePlaylistDir() error

EnsurePlaylistDir ensures the playlist directory exists

func (*Parser) GetPath

func (p *Parser) GetPath() string

GetPath returns the current Rockbox path

func (*Parser) GetPlaylistPath

func (p *Parser) GetPlaylistPath() string

GetPlaylistPath returns the path for playlists in the Rockbox device

func (*Parser) GetStatus

func (p *Parser) GetStatus() *models.ParseStatus

GetStatus returns the current parse status

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context) ([]*models.Song, error)

Parse parses the Rockbox database and returns all songs

func (*Parser) SetPath

func (p *Parser) SetPath(path string)

SetPath sets the Rockbox path

func (*Parser) ValidatePath

func (p *Parser) ValidatePath() error

ValidatePath checks if the Rockbox path is valid

type TagType

type TagType int

TagType represents the type of a tag in the Rockbox database

const (
	TagArtist TagType = iota
	TagAlbum
	TagGenre
	TagTitle
	TagFilename
	TagComposer
	TagComment
	TagAlbumArtist
	TagGrouping
	TagYear
	TagDiscNumber
	TagTrackNumber
	TagBitrate
	TagLength
	TagPlayCount
	TagRating
	TagPlayTime
	TagLastPlayed
	TagCommitID
	TagMTime
	TagLastElapsed
	TagLastOffset
	TagTagCount
)

Jump to

Keyboard shortcuts

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