forked from Leak_Technologies/VideoTools
Fix build: remove unused imports, drop playSess img refs, cleanup state init
This commit is contained in:
parent
c81d540b0f
commit
03b6804a9e
20
main.go
20
main.go
|
|
@ -4,15 +4,12 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"image/png"
|
||||
"io"
|
||||
"math"
|
||||
"net/url"
|
||||
"os"
|
||||
|
|
@ -42,7 +39,6 @@ import (
|
|||
"git.leaktechnologies.dev/stu/VT_Player/internal/queue"
|
||||
"git.leaktechnologies.dev/stu/VT_Player/internal/ui"
|
||||
"git.leaktechnologies.dev/stu/VT_Player/internal/utils"
|
||||
"github.com/hajimehoshi/oto"
|
||||
)
|
||||
|
||||
// Module describes a high level tool surface that gets a tile on the menu.
|
||||
|
|
@ -2034,7 +2030,6 @@ func runGUI() {
|
|||
a.Settings().SetTheme(&ui.MonoTheme{})
|
||||
logging.Debug(logging.CatUI, "created fyne app: %#v", a)
|
||||
w := a.NewWindow("VT Player")
|
||||
state.window = w
|
||||
if icon := utils.LoadAppIcon(); icon != nil {
|
||||
a.SetIcon(icon)
|
||||
w.SetIcon(icon)
|
||||
|
|
@ -3948,21 +3943,6 @@ func (s *appState) showFrameManual(path string, img *canvas.Image) {
|
|||
}
|
||||
|
||||
func (s *appState) captureCoverFromCurrent() (string, error) {
|
||||
// If we have a play session active, capture the current playing frame
|
||||
if s.playSess != nil && s.playSess.img != nil && s.playSess.img.Image != nil {
|
||||
dest := filepath.Join(os.TempDir(), fmt.Sprintf("videotools-cover-%d.png", time.Now().UnixNano()))
|
||||
f, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer f.Close()
|
||||
if err := png.Encode(f, s.playSess.img.Image); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return dest, nil
|
||||
}
|
||||
|
||||
// Otherwise use the current preview frame
|
||||
if s.currentFrame == "" {
|
||||
return "", fmt.Errorf("no frame available")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user