diff --git a/internal/server/server.go b/internal/server/server.go index e030cfd..df62fc5 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -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() diff --git a/internal/viz/capture.go b/internal/viz/capture.go index 98efb61..d7c2fcd 100644 --- a/internal/viz/capture.go +++ b/internal/viz/capture.go @@ -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 } diff --git a/internal/winamp/winamp.go b/internal/winamp/winamp.go index e23d121..06c2aa2 100644 --- a/internal/winamp/winamp.go +++ b/internal/winamp/winamp.go @@ -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