From 77593d250cb7da1fd061edf72d4e9e7d07da0078 Mon Sep 17 00:00:00 2001 From: raul Date: Fri, 17 May 2024 09:43:43 +0200 Subject: [PATCH] Configure basic file picking logic --- cmd/tune.go | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/cmd/tune.go b/cmd/tune.go index 50efb94..ab4fcf7 100644 --- a/cmd/tune.go +++ b/cmd/tune.go @@ -2,14 +2,45 @@ package cmd import ( "fmt" + "path/filepath" "github.com/spf13/viper" //"github.com/ebitengine/oto/v3" ) -func tune() { - fmt.Println("tune called") +var ( + playIndividualFile bool = false + filePath string = "" + songToPlay Song + songList []Song +) + +type Song struct { + Title string + Path string +} + +func (s *Song) Play() { + +} + +func NewSong(p string) Song { + newS := Song{} + newS.Title = filepath.Base(p) + newS.Path = p + return newS +} + +func findFiles() { + +} + +func tune() { title := viper.Get("title") fmt.Println(title) + if playIndividualFile == true { + songToPlay = NewSong(filePath) + } + tui() }