Ver código fonte

style: gofmt all Go files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
Jan Svabenik 1 mês atrás
pai
commit
f88870626f
3 arquivos alterados com 24 adições e 20 exclusões
  1. +7
    -3
      internal/server/server.go
  2. +7
    -7
      internal/viz/capture.go
  3. +10
    -10
      internal/winamp/winamp.go

+ 7
- 3
internal/server/server.go Ver arquivo

@@ -18,8 +18,8 @@ import (

"git.svabi.ch/jan/roadamp/internal/killist"
"git.svabi.ch/jan/roadamp/internal/resume"
"git.svabi.ch/jan/roadamp/internal/volume"
"git.svabi.ch/jan/roadamp/internal/viz"
"git.svabi.ch/jan/roadamp/internal/volume"
"git.svabi.ch/jan/roadamp/internal/winamp"
"github.com/gorilla/websocket"
"gopkg.in/yaml.v3"
@@ -278,8 +278,12 @@ func (s *Server) statusMsg() ([]byte, error) {
// Winamp returns 0xFFFFFFFF when stopped/no track — clamp to 0.
pos := s.wa.GetPosition()
length := s.wa.GetLength()
if pos > 86400 { pos = 0 } // > 24h → garbage value
if length > 86400 { length = 0 }
if pos > 86400 {
pos = 0
} // > 24h → garbage value
if length > 86400 {
length = 0
}
msg.Position = pos
msg.Length = length
msg.PlaylistPos = s.wa.GetPlaylistPosition()


+ 7
- 7
internal/viz/capture.go Ver arquivo

@@ -24,14 +24,14 @@ const (
fftN = 2048 // FFT window size (power of 2)

// WASAPI
audclntShareModeShared = 0
audclntStreamFlagsLoopback = 0x00020000
audclntBufferFlagsSilent = 0x2
bufDuration = 1_000_000 // 100 ms in 100-ns units
audclntShareModeShared = 0
audclntStreamFlagsLoopback = 0x00020000
audclntBufferFlagsSilent = 0x2
bufDuration = 1_000_000 // 100 ms in 100-ns units

// Wave format tags
waveFormatPCM = 1
waveFormatFloat = 3
waveFormatPCM = 1
waveFormatFloat = 3
waveFormatExtensibleTag = 0xFFFE
)

@@ -84,7 +84,7 @@ type waveFormatExtensibleEx struct {
BlockAlign uint16
BitsPerSample uint16
Size uint16
Samples uint16 // wValidBitsPerSample / wSamplesPerBlock
Samples uint16 // wValidBitsPerSample / wSamplesPerBlock
ChannelMask uint32
SubFormat windows.GUID // 16 bytes → total 40 bytes, matches C layout
}


+ 10
- 10
internal/winamp/winamp.go Ver arquivo

@@ -42,16 +42,16 @@ const (
cmdVolumeDown = 40059

// Winamp WM_USER lParam IDs
userGetVersion = 0
userGetPlayState = 104
userGetPosition = 105
userSeek = 106
userSetVolume = 122
userGetPlaylistPos = 125
userGetPlaylistLen = 124
userSetPlaylistPos = 121
userGetPlaylistTitle = 212
userRestart = 135
userGetVersion = 0
userGetPlayState = 104
userGetPosition = 105
userSeek = 106
userSetVolume = 122
userGetPlaylistPos = 125
userGetPlaylistLen = 124
userSetPlaylistPos = 121
userGetPlaylistTitle = 212
userRestart = 135

// OpenProcess access right
processVMRead = 0x0010


Carregando…
Cancelar
Salvar