Compare commits

..

5 Commits

Author SHA1 Message Date
Louis Dalibard
9babdba06f
Update README.md 2024-10-21 14:36:36 +02:00
Louis Dalibard
61ab70dd2b fix: ring buffer race condition issues 2024-10-21 13:57:37 +02:00
Louis Dalibard
da6f9141da add: windows build script 2024-10-21 13:57:06 +02:00
Louis Dalibard
7f8f57728a fix: ring buffer race condition issues 2024-10-21 13:56:50 +02:00
Louis Dalibard
76bccc8a90 add: comm ring buffer reset 2024-10-21 12:18:55 +02:00
5 changed files with 11 additions and 4 deletions

View File

@ -1,2 +1,3 @@
# xyosc # xyosc
A simple XY-oscilloscope written in Go. A simple XY-oscilloscope written in Go.
![Screenshot_20241021_143354-xyosc](https://github.com/user-attachments/assets/225dd213-5a26-4e99-ac2a-f2c69f1485e1)

View File

@ -16,7 +16,7 @@ var SampleSizeInBytes uint32
const format = malgo.FormatF32 const format = malgo.FormatF32
func Init() { func Init() {
SampleRingBuffer = ringbuffer.New(int(config.Config.RingBufferSize)) SampleRingBuffer = ringbuffer.New(int(config.Config.RingBufferSize)).SetBlocking(true)
SampleSizeInBytes = uint32(malgo.SampleSizeInBytes(format)) SampleSizeInBytes = uint32(malgo.SampleSizeInBytes(format))
} }

View File

@ -37,8 +37,8 @@ var DefaultConfig = ConfigS{
WindowOpacity: 0.8, WindowOpacity: 0.8,
CaptureDeviceIndex: 0, CaptureDeviceIndex: 0,
SampleRate: 48000, SampleRate: 48000,
RingBufferSize: 192000, RingBufferSize: 4800,
ReadBufferSize: 192000, ReadBufferSize: 4800,
Gain: 1, Gain: 1,
LineOpacity: 50, LineOpacity: 50,
LineThickness: 2, LineThickness: 2,

View File

@ -48,8 +48,9 @@ func main() {
AX = BX AX = BX
AY = BY AY = BY
} }
//audio.SampleRingBuffer.Reset()
if config.Config.FPSCounter { if config.Config.FPSCounter {
rl.DrawFPS(16, config.Config.WindowHeight) rl.DrawFPS(16, config.Config.WindowHeight-32)
} }
rl.DrawTextEx(fonts.FontIosevka32, media.PlayingMediaInfo.Artist+" - "+media.PlayingMediaInfo.Title, rl.NewVector2(16, 16), 32, 2, config.AccentColor) rl.DrawTextEx(fonts.FontIosevka32, media.PlayingMediaInfo.Artist+" - "+media.PlayingMediaInfo.Title, rl.NewVector2(16, 16), 32, 2, config.AccentColor)
rl.DrawTextEx(fonts.FontIosevka16, media.PlayingMediaInfo.Album, rl.NewVector2(16, 48), 16, 1, config.ThirdColor) rl.DrawTextEx(fonts.FontIosevka16, media.PlayingMediaInfo.Album, rl.NewVector2(16, 48), 16, 1, config.ThirdColor)

5
wslbuild.sh Executable file
View File

@ -0,0 +1,5 @@
sudo apt-get install gcc-multilib
sudo apt-get install gcc-mingw-w64
sudo apt-get install golang
GOOS=windows GOARCH=386 CGO_ENABLED=1 CXX=i686-w64-mingw32-g++ CC=i686-w64-mingw32-gcc go build -tags noaudio