diff --git a/VERSION b/VERSION index 809f5d30..ea701a2f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.91 +7.92 diff --git a/build/windows/palette_win_setup.iss b/build/windows/palette_win_setup.iss index c8dc223c..b6c37994 100644 --- a/build/windows/palette_win_setup.iss +++ b/build/windows/palette_win_setup.iss @@ -7,6 +7,7 @@ #define MyAppVersion "SUBSTITUTE_VERSION_HERE" #define MyAppPublisher "Nosuch Media" #define MyAppURL "https://github.com/vizicist/palette" +#define DataPath "{commoncf64}/Palette/data" [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. @@ -51,10 +52,8 @@ Source: "ship\ffgl\*"; DestDir: "{app}\ffgl"; Flags: ignoreversion recursesubdir ; Source: "ship\keykit\*"; DestDir: "{app}\keykit"; Flags: ignoreversion recursesubdirs createallsubdirs ; NOTE - all data_* files go in CommonProgramFiles\Palette -Source: "ship\data\*"; DestDir: "{commoncf64}\{#MyAppName}\data"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs -; Source: "ship\data_surge\*"; DestDir: "{commoncf64}\{#MyAppName}\data_surge"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs -; Source: "ship\data_moldover\*"; DestDir: "{commoncf64}\{#MyAppName}\data_moldover"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs -Source: "logs_readme.txt"; DestDir: "{commoncf64}\{#MyAppName}\data\logs"; DestName: "readme.txt"; Flags: ignoreversion +Source: "ship\data\*"; DestDir: "{#DataPath}"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs +Source: "logs_readme.txt"; DestDir: "{#DataPath}\logs"; DestName: "readme.txt"; Flags: ignoreversion ; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; This specifies the Visual C++ Windows Runtime Redistributable to install, it's put in {app}\bin to help debug things. @@ -71,11 +70,12 @@ Filename: taskkill.exe; Parameters: "/F /IM palette_gui.exe"; StatusMsg: "Making Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" Name: "{group}\Start Palette"; Filename: "{app}\bin\palette.exe"; Parameters: "start"; Flags: runminimized Name: "{group}\Stop Palette"; Filename: "{app}\bin\palette.exe"; Parameters: "stop"; Flags: runminimized -Name: "{group}\Config Directory"; Filename: "{win}\explorer.exe"; Parameters: "{commoncf64}\{#MyAppName}" [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ - ValueType: expandsz; ValueName: "PALETTE"; ValueData: "{app}" + ValueType: expandsz; ValueName: "PALETTE"; ValueData: "{app}"; Flags: preservestringtype +Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ + ValueType: expandsz; ValueName: "PALETTE_DATA_PATH"; ValueData: "{commoncf64}\Palette\data"; Flags: preservestringtype [Code] procedure CurStepChanged(CurStep: TSetupStep); diff --git a/cmd/palette_remote/palette_remote.go b/cmd/palette_remote/palette_remote.go index 686fc233..cacaa4ea 100644 --- a/cmd/palette_remote/palette_remote.go +++ b/cmd/palette_remote/palette_remote.go @@ -4,27 +4,87 @@ import ( "fyne.io/fyne/v2" // Import the base Fyne package "fyne.io/fyne/v2/app" // Import the Fyne app package "fyne.io/fyne/v2/container" // Import the Fyne container package for layouts - "fyne.io/fyne/v2/widget" // Import the Fyne widget package for widgets + "fyne.io/fyne/v2/widget" // Import the Fyne widget package for widgets + + "github.com/vizicist/palette/kit" ) +var Categories = []string{"global", "quad", "patch", "sound", "visual", "effect"} +var TopButton = map[string]*widget.Button{} +var TopLabel *widget.Label +var SelectGrid *fyne.Container + +func SelectSaved(category string, saved string) { + kit.LogInfo("GRID button", "category", category, "saved", saved) + TopLabel.SetText("category=" + category + " file=" + saved) +} + +func SelectCategory(category string) { + TopLabel.SetText("category = " + category) + list, err := kit.SavedFileList(category) + if err != nil { + kit.LogError(err) + } else { + SelectGrid.RemoveAll() + for _, savedName := range list { + s := savedName + c := category + SelectGrid.Add(widget.NewButton(s, func() { + SelectSaved(c, s) + })) + } + } +} + func main() { - myApp := app.New() // Create a new app - myWindow := myApp.NewWindow("Hello") // Create a new window - myWindow.Resize(fyne.NewSize(300, 200)) // Resize the window + kit.InitLog("remote") + kit.LogInfo("Creating app") + kit.InitMisc() + + type FileList []string + saved := map[string]FileList{} + + for _, s := range Categories { + list, err := kit.SavedFileList(s) + if err != nil { + kit.LogError(err) + } else { + saved[s] = list + } + } + + myApp := app.New() // Create a new app + myWindow := myApp.NewWindow("Palette Remote") // Create a new window + + appSize := fyne.Size{Width: 300, Height: 600} + gridsize := fyne.Size{ + Width: 200, + Height: 40, + } + + myWindow.Resize(fyne.NewSize(appSize.Width, appSize.Height)) // Resize the window // Create a label (widget) with initial text - label := widget.NewLabel("Hello, Fyne!") + TopLabel = widget.NewLabel("Palette Remote 2024") + + SelectGrid = container.NewGridWrap(gridsize) - // Create a button (widget) - button := widget.NewButton("Click me!", func() { - label.SetText("Button clicked!") // Change the label text when the button is clicked - }) + // Create the buttons along the top + container_topbuttons := container.NewHBox() + for _, category := range Categories { + c := category + TopButton[c] = widget.NewButton(c, func() { + SelectCategory(c) + }) + container_topbuttons.Add(TopButton[c]) + } // Use a container to arrange the label and button vertically content := container.NewVBox( - label, - button, + container.NewCenter(TopLabel), + container_topbuttons, + SelectGrid, ) myWindow.SetContent(content) // Set the window content to be the container diff --git a/kit/engine.go b/kit/engine.go index f0f9d4cd..7e86ac5c 100644 --- a/kit/engine.go +++ b/kit/engine.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "io" - "math/rand" "net/http" "os" "path/filepath" @@ -39,25 +38,6 @@ type Engine struct { var TheEngine *Engine var engineSysex sync.Mutex -var TheRand *rand.Rand - -func InitMisc() { - - InitParams() - - // We first load the current values, but don't actually execute anything that they trigger - err := LoadGlobalParams() - if err != nil { - LogIfError(err) - } - - TheProcessManager = NewProcessManager() - TheProcessManager.AddBuiltins() - - // Fixed rand sequence, better for testing - TheRand = rand.New(rand.NewSource(1)) - TheNats = NewNats() -} func InitEngine() { diff --git a/kit/misc.go b/kit/misc.go index 726a21c2..f946819b 100644 --- a/kit/misc.go +++ b/kit/misc.go @@ -9,6 +9,7 @@ import ( "image" "image/draw" "io" + "math/rand" "net/http" "os" "path/filepath" @@ -27,6 +28,26 @@ var OscPort = 3333 var EventClientPort = 6666 var GuiPort = 3943 var LocalAddress = "127.0.0.1" +var TheRand *rand.Rand + +func InitMisc() { + + InitParams() + + // We first load the current values, but don't actually execute anything that they trigger + err := LoadGlobalParams() + if err != nil { + LogIfError(err) + } + + TheProcessManager = NewProcessManager() + TheProcessManager.AddBuiltins() + + // Fixed rand sequence, better for testing + TheRand = rand.New(rand.NewSource(1)) + TheNats = NewNats() +} + // fileExists checks if a file exists func fileExists(filename string) bool { diff --git a/release/palette_7.92_win_setup.exe b/release/palette_7.92_win_setup.exe new file mode 100644 index 00000000..4e7f1a61 Binary files /dev/null and b/release/palette_7.92_win_setup.exe differ