diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-06-15 13:58:30 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-15 13:58:30 +0300 |
| commit | 77e4b066cb8d506b4bc944ab4eb2d6e4679e2202 (patch) | |
| tree | 1d549eca619ed36cb881e487cb054c4643ac8376 /pkg/messages/types/svcSounds.go | |
| parent | change project name to sdp.go (diff) | |
| download | sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.tar.gz sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.tar.bz2 sdp.go-77e4b066cb8d506b4bc944ab4eb2d6e4679e2202.zip | |
enable multithreading with goroutines (#20)
Diffstat (limited to 'pkg/messages/types/svcSounds.go')
| -rw-r--r-- | pkg/messages/types/svcSounds.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/messages/types/svcSounds.go b/pkg/messages/types/svcSounds.go index 5391af1..cc155e5 100644 --- a/pkg/messages/types/svcSounds.go +++ b/pkg/messages/types/svcSounds.go | |||
| @@ -2,17 +2,17 @@ package messages | |||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "github.com/pektezol/bitreader" | 4 | "github.com/pektezol/bitreader" |
| 5 | "github.com/pektezol/sdp.go/pkg/writer" | 5 | "github.com/pektezol/sdp.go/pkg/types" |
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | type SvcSounds struct { | 8 | type SvcSounds struct { |
| 9 | ReliableSound bool | 9 | ReliableSound bool `json:"reliable_sound"` |
| 10 | SoundCount uint8 | 10 | SoundCount uint8 `json:"sound_count"` |
| 11 | Length uint16 | 11 | Length uint16 `json:"length"` |
| 12 | Data []byte | 12 | Data []byte `json:"data"` |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | func ParseSvcSounds(reader *bitreader.Reader) SvcSounds { | 15 | func ParseSvcSounds(reader *bitreader.Reader, demo *types.Demo) SvcSounds { |
| 16 | svcSounds := SvcSounds{ | 16 | svcSounds := SvcSounds{ |
| 17 | ReliableSound: reader.TryReadBool(), | 17 | ReliableSound: reader.TryReadBool(), |
| 18 | } | 18 | } |
| @@ -24,8 +24,8 @@ func ParseSvcSounds(reader *bitreader.Reader) SvcSounds { | |||
| 24 | svcSounds.Length = reader.TryReadUInt16() | 24 | svcSounds.Length = reader.TryReadUInt16() |
| 25 | } | 25 | } |
| 26 | svcSounds.Data = reader.TryReadBitsToSlice(uint64(svcSounds.Length)) | 26 | svcSounds.Data = reader.TryReadBitsToSlice(uint64(svcSounds.Length)) |
| 27 | writer.TempAppendLine("\t\tReliable Sound: %t", svcSounds.ReliableSound) | 27 | demo.Writer.TempAppendLine("\t\tReliable Sound: %t", svcSounds.ReliableSound) |
| 28 | writer.TempAppendLine("\t\tSound Count: %d", svcSounds.SoundCount) | 28 | demo.Writer.TempAppendLine("\t\tSound Count: %d", svcSounds.SoundCount) |
| 29 | writer.TempAppendLine("\t\tData: %v", svcSounds.Data) | 29 | demo.Writer.TempAppendLine("\t\tData: %v", svcSounds.Data) |
| 30 | return svcSounds | 30 | return svcSounds |
| 31 | } | 31 | } |