Audio files download on application start. Home screen shows status message

This commit is contained in:
NeilClack
2026-06-18 21:52:29 -05:00
parent 7ecb90b63b
commit 2af1aae885
5 changed files with 146 additions and 76 deletions
+27 -5
View File
@@ -12,6 +12,7 @@ import (
"github.com/veandco/go-sdl2/ttf"
"gorm.io/gorm"
"rhemawavetech.com/rhemawave/internal/db"
"rhemawavetech.com/rhemawave/internal/download"
"rhemawavetech.com/rhemawave/internal/fontManager"
"rhemawavetech.com/rhemawave/internal/graphics"
"rhemawavetech.com/rhemawave/internal/keybinds"
@@ -153,18 +154,39 @@ func Run() {
app.initializeManagers()
app.initializeAudio()
downloadProgressChan := make(chan download.DownloadStatus)
app.PageRouter = page.NewRouter(page.PageCtx{
CfgPtr: app.Config.Load(),
DbPtr: app.DB,
W: w,
H: h,
RefreshConfig: app.refreshCache,
CfgPtr: app.Config.Load(),
DbPtr: app.DB,
W: w,
H: h,
MessageChannel: downloadProgressChan,
RefreshConfig: app.refreshCache,
})
// Sync the proclamations from the API to the Database
sync.SyncProclamations(DB)
sync.SyncCategories(DB)
sync.SyncFrequencies(DB)
audioFileNames := []string{
"OriginalAudio.wav",
"174Hz.wav",
"396Hz.wav",
"417Hz.wav",
"432Hz.wav",
"639Hz.wav",
"741Hz.wav",
"852Hz.wav",
"963Hz.wav",
"1111Hz.wav",
"14Hz_Binaural.wav",
"40Hz_Binaural.wav",
"AlphaWaves.wav",
"PinealGland.wav",
}
go download.DownloadAudioFiles(app.PageRouter.Context.MessageChannel, audioFileNames, filepath.Join(app.PageRouter.Context.CfgPtr.AssetsDir, "audio"))
app.runEventLoop()
}