aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorsam-anthony <samanthony6@protonmail.com>2022-04-09 12:05:19 -0230
committersam-anthony <samanthony6@protonmail.com>2022-04-09 12:05:19 -0230
commit4f654973e5139f14d6fa63357a274ad0e3cbb202 (patch)
tree45bbc6716382eb2cee8cf5fef77a55cb4e143015 /main.go
parent4cbd64e7ab6d976496c5e36c1ebae7526eceb375 (diff)
downloadvolute-4f654973e5139f14d6fa63357a274ad0e3cbb202.zip
selecteable compressor and add BW K03
Diffstat (limited to 'main.go')
-rw-r--r--main.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/main.go b/main.go
index 49ff70f..228d611 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "fmt"
g "github.com/AllenDang/giu"
"image"
"image/draw"
@@ -103,6 +104,7 @@ func loop() {
Columns(
columns()...,
),
+ selectCompressor(),
g.Custom(compressorWidget),
)
}
@@ -113,10 +115,8 @@ var (
selectedCompressor compressor.Compressor
)
-func init() {
- selectedCompressor = compressor.GarrettG25660()
-
- f, err := os.Open(selectedCompressor.FileName)
+func setCompressor(c compressor.Compressor) {
+ f, err := os.Open(c.FileName)
util.Check(err)
defer f.Close()
@@ -127,7 +127,20 @@ func init() {
m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy()))
draw.Draw(m, m.Bounds(), j, b.Min, draw.Src)
+ selectedCompressor = c
compressorImage = m
+
+ go updateCompImg()
+}
+
+func init() {
+ c, ok := compressor.Compressors()["Garrett"]["G"]["25-660"]
+ if !ok {
+ fmt.Println("Garrett G25-660 not in compressor.Compressors().")
+ os.Exit(1)
+ }
+
+ setCompressor(c)
}
func main() {