瀏覽代碼

style: gofmt all Go files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
Jan Svabenik 1 月之前
父節點
當前提交
f88870626f
共有 3 個檔案被更改,包括 24 行新增20 行删除
  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 查看文件

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


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


+ 7
- 7
internal/viz/capture.go 查看文件

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


// WASAPI // 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 // Wave format tags
waveFormatPCM = 1
waveFormatFloat = 3
waveFormatPCM = 1
waveFormatFloat = 3
waveFormatExtensibleTag = 0xFFFE waveFormatExtensibleTag = 0xFFFE
) )


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


+ 10
- 10
internal/winamp/winamp.go 查看文件

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


// Winamp WM_USER lParam IDs // 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 // OpenProcess access right
processVMRead = 0x0010 processVMRead = 0x0010


Loading…
取消
儲存