@pulsefield/protocol 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,807 @@
1
+ // DO NOT EDIT.
2
+ // swift-format-ignore-file
3
+ // swiftlint:disable all
4
+ //
5
+ // Generated by the Swift generator plugin for the protocol buffer compiler.
6
+ // Source: pulsefield/protocol/v1/envelope.proto
7
+ //
8
+ // For information on using the generated types, please see the documentation:
9
+ // https://github.com/apple/swift-protobuf/
10
+
11
+ import SwiftProtobuf
12
+
13
+ // If the compiler emits an error on this type, it is because this file
14
+ // was generated by a version of the `protoc` Swift plug-in that is
15
+ // incompatible with the version of SwiftProtobuf to which you are linking.
16
+ // Please ensure that you are building against the same version of the API
17
+ // that was used to generate this file.
18
+ fileprivate nonisolated struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
19
+ struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
20
+ typealias Version = _2
21
+ }
22
+
23
+ public nonisolated enum Pulsefield_Protocol_V1_MusicSource: SwiftProtobuf.Enum, Swift.CaseIterable {
24
+ public typealias RawValue = Int
25
+ case unspecified // = 0
26
+ case background // = 1
27
+ case systemAudio // = 2
28
+ case UNRECOGNIZED(Int)
29
+
30
+ public init() {
31
+ self = .unspecified
32
+ }
33
+
34
+ public init?(rawValue: Int) {
35
+ switch rawValue {
36
+ case 0: self = .unspecified
37
+ case 1: self = .background
38
+ case 2: self = .systemAudio
39
+ default: self = .UNRECOGNIZED(rawValue)
40
+ }
41
+ }
42
+
43
+ public var rawValue: Int {
44
+ switch self {
45
+ case .unspecified: return 0
46
+ case .background: return 1
47
+ case .systemAudio: return 2
48
+ case .UNRECOGNIZED(let i): return i
49
+ }
50
+ }
51
+
52
+ // The compiler won't synthesize support with the UNRECOGNIZED case.
53
+ public static let allCases: [Pulsefield_Protocol_V1_MusicSource] = [
54
+ .unspecified,
55
+ .background,
56
+ .systemAudio,
57
+ ]
58
+
59
+ }
60
+
61
+ public nonisolated enum Pulsefield_Protocol_V1_InferenceRoute: SwiftProtobuf.Enum, Swift.CaseIterable {
62
+ public typealias RawValue = Int
63
+ case unspecified // = 0
64
+ case mapper // = 1
65
+ case timingMock // = 2
66
+ case UNRECOGNIZED(Int)
67
+
68
+ public init() {
69
+ self = .unspecified
70
+ }
71
+
72
+ public init?(rawValue: Int) {
73
+ switch rawValue {
74
+ case 0: self = .unspecified
75
+ case 1: self = .mapper
76
+ case 2: self = .timingMock
77
+ default: self = .UNRECOGNIZED(rawValue)
78
+ }
79
+ }
80
+
81
+ public var rawValue: Int {
82
+ switch self {
83
+ case .unspecified: return 0
84
+ case .mapper: return 1
85
+ case .timingMock: return 2
86
+ case .UNRECOGNIZED(let i): return i
87
+ }
88
+ }
89
+
90
+ // The compiler won't synthesize support with the UNRECOGNIZED case.
91
+ public static let allCases: [Pulsefield_Protocol_V1_InferenceRoute] = [
92
+ .unspecified,
93
+ .mapper,
94
+ .timingMock,
95
+ ]
96
+
97
+ }
98
+
99
+ public nonisolated enum Pulsefield_Protocol_V1_EndpointStatus: SwiftProtobuf.Enum, Swift.CaseIterable {
100
+ public typealias RawValue = Int
101
+ case unspecified // = 0
102
+ case ready // = 1
103
+ case audioPreparing // = 2
104
+ case audioReady // = 3
105
+ case streaming // = 4
106
+ case stopped // = 5
107
+ case UNRECOGNIZED(Int)
108
+
109
+ public init() {
110
+ self = .unspecified
111
+ }
112
+
113
+ public init?(rawValue: Int) {
114
+ switch rawValue {
115
+ case 0: self = .unspecified
116
+ case 1: self = .ready
117
+ case 2: self = .audioPreparing
118
+ case 3: self = .audioReady
119
+ case 4: self = .streaming
120
+ case 5: self = .stopped
121
+ default: self = .UNRECOGNIZED(rawValue)
122
+ }
123
+ }
124
+
125
+ public var rawValue: Int {
126
+ switch self {
127
+ case .unspecified: return 0
128
+ case .ready: return 1
129
+ case .audioPreparing: return 2
130
+ case .audioReady: return 3
131
+ case .streaming: return 4
132
+ case .stopped: return 5
133
+ case .UNRECOGNIZED(let i): return i
134
+ }
135
+ }
136
+
137
+ // The compiler won't synthesize support with the UNRECOGNIZED case.
138
+ public static let allCases: [Pulsefield_Protocol_V1_EndpointStatus] = [
139
+ .unspecified,
140
+ .ready,
141
+ .audioPreparing,
142
+ .audioReady,
143
+ .streaming,
144
+ .stopped,
145
+ ]
146
+
147
+ }
148
+
149
+ public nonisolated struct Pulsefield_Protocol_V1_Envelope: Sendable {
150
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
151
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
152
+ // methods supported on all messages.
153
+
154
+ public var sessionID: String = String()
155
+
156
+ public var sequence: UInt64 = 0
157
+
158
+ public var sentAtUnixMs: Int64 = 0
159
+
160
+ public var payload: Pulsefield_Protocol_V1_Envelope.OneOf_Payload? = nil
161
+
162
+ public var ready: Pulsefield_Protocol_V1_ReadyRequest {
163
+ get {
164
+ if case .ready(let v)? = payload {return v}
165
+ return Pulsefield_Protocol_V1_ReadyRequest()
166
+ }
167
+ set {payload = .ready(newValue)}
168
+ }
169
+
170
+ public var audio: Pulsefield_Protocol_V1_AudioRequest {
171
+ get {
172
+ if case .audio(let v)? = payload {return v}
173
+ return Pulsefield_Protocol_V1_AudioRequest()
174
+ }
175
+ set {payload = .audio(newValue)}
176
+ }
177
+
178
+ public var referenceTime: Pulsefield_Protocol_V1_ReferenceTimeRequest {
179
+ get {
180
+ if case .referenceTime(let v)? = payload {return v}
181
+ return Pulsefield_Protocol_V1_ReferenceTimeRequest()
182
+ }
183
+ set {payload = .referenceTime(newValue)}
184
+ }
185
+
186
+ public var stopSession: Pulsefield_Protocol_V1_StopSessionRequest {
187
+ get {
188
+ if case .stopSession(let v)? = payload {return v}
189
+ return Pulsefield_Protocol_V1_StopSessionRequest()
190
+ }
191
+ set {payload = .stopSession(newValue)}
192
+ }
193
+
194
+ public var hitObjectToken: Pulsefield_Protocol_V1_HitObjectTokenEvent {
195
+ get {
196
+ if case .hitObjectToken(let v)? = payload {return v}
197
+ return Pulsefield_Protocol_V1_HitObjectTokenEvent()
198
+ }
199
+ set {payload = .hitObjectToken(newValue)}
200
+ }
201
+
202
+ public var error: Pulsefield_Protocol_V1_ErrorEvent {
203
+ get {
204
+ if case .error(let v)? = payload {return v}
205
+ return Pulsefield_Protocol_V1_ErrorEvent()
206
+ }
207
+ set {payload = .error(newValue)}
208
+ }
209
+
210
+ public var status: Pulsefield_Protocol_V1_StatusEvent {
211
+ get {
212
+ if case .status(let v)? = payload {return v}
213
+ return Pulsefield_Protocol_V1_StatusEvent()
214
+ }
215
+ set {payload = .status(newValue)}
216
+ }
217
+
218
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
219
+
220
+ public nonisolated enum OneOf_Payload: Equatable, Sendable {
221
+ case ready(Pulsefield_Protocol_V1_ReadyRequest)
222
+ case audio(Pulsefield_Protocol_V1_AudioRequest)
223
+ case referenceTime(Pulsefield_Protocol_V1_ReferenceTimeRequest)
224
+ case stopSession(Pulsefield_Protocol_V1_StopSessionRequest)
225
+ case hitObjectToken(Pulsefield_Protocol_V1_HitObjectTokenEvent)
226
+ case error(Pulsefield_Protocol_V1_ErrorEvent)
227
+ case status(Pulsefield_Protocol_V1_StatusEvent)
228
+
229
+ }
230
+
231
+ public init() {}
232
+ }
233
+
234
+ public nonisolated struct Pulsefield_Protocol_V1_ReadyRequest: Sendable {
235
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
236
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
237
+ // methods supported on all messages.
238
+
239
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
240
+
241
+ public init() {}
242
+ }
243
+
244
+ public nonisolated struct Pulsefield_Protocol_V1_AudioRequest: Sendable {
245
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
246
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
247
+ // methods supported on all messages.
248
+
249
+ public var audioPath: String = String()
250
+
251
+ public var audioLengthMs: UInt32 {
252
+ get {_audioLengthMs ?? 0}
253
+ set {_audioLengthMs = newValue}
254
+ }
255
+ /// Returns true if `audioLengthMs` has been explicitly set.
256
+ public var hasAudioLengthMs: Bool {self._audioLengthMs != nil}
257
+ /// Clears the value of `audioLengthMs`. Subsequent reads from it will return its default value.
258
+ public mutating func clearAudioLengthMs() {self._audioLengthMs = nil}
259
+
260
+ public var musicSource: Pulsefield_Protocol_V1_MusicSource = .unspecified
261
+
262
+ public var difficulty: Double {
263
+ get {_difficulty ?? 0}
264
+ set {_difficulty = newValue}
265
+ }
266
+ /// Returns true if `difficulty` has been explicitly set.
267
+ public var hasDifficulty: Bool {self._difficulty != nil}
268
+ /// Clears the value of `difficulty`. Subsequent reads from it will return its default value.
269
+ public mutating func clearDifficulty() {self._difficulty = nil}
270
+
271
+ public var route: Pulsefield_Protocol_V1_InferenceRoute = .unspecified
272
+
273
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
274
+
275
+ public init() {}
276
+
277
+ fileprivate var _audioLengthMs: UInt32? = nil
278
+ fileprivate var _difficulty: Double? = nil
279
+ }
280
+
281
+ public nonisolated struct Pulsefield_Protocol_V1_ReferenceTimeRequest: Sendable {
282
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
283
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
284
+ // methods supported on all messages.
285
+
286
+ public var refTimeMs: UInt32 = 0
287
+
288
+ public var localHostTimeSendMs: Double = 0
289
+
290
+ public var audioLengthMs: UInt32 {
291
+ get {_audioLengthMs ?? 0}
292
+ set {_audioLengthMs = newValue}
293
+ }
294
+ /// Returns true if `audioLengthMs` has been explicitly set.
295
+ public var hasAudioLengthMs: Bool {self._audioLengthMs != nil}
296
+ /// Clears the value of `audioLengthMs`. Subsequent reads from it will return its default value.
297
+ public mutating func clearAudioLengthMs() {self._audioLengthMs = nil}
298
+
299
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
300
+
301
+ public init() {}
302
+
303
+ fileprivate var _audioLengthMs: UInt32? = nil
304
+ }
305
+
306
+ public nonisolated struct Pulsefield_Protocol_V1_StopSessionRequest: Sendable {
307
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
308
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
309
+ // methods supported on all messages.
310
+
311
+ public var reason: String = String()
312
+
313
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
314
+
315
+ public init() {}
316
+ }
317
+
318
+ public nonisolated struct Pulsefield_Protocol_V1_HitObjectTokenEvent: Sendable {
319
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
320
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
321
+ // methods supported on all messages.
322
+
323
+ public var tokenID: UInt32 = 0
324
+
325
+ public var msInRefAudio: UInt32 = 0
326
+
327
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
328
+
329
+ public init() {}
330
+ }
331
+
332
+ public nonisolated struct Pulsefield_Protocol_V1_ErrorEvent: Sendable {
333
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
334
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
335
+ // methods supported on all messages.
336
+
337
+ public var code: String = String()
338
+
339
+ public var message: String = String()
340
+
341
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
342
+
343
+ public init() {}
344
+ }
345
+
346
+ public nonisolated struct Pulsefield_Protocol_V1_StatusEvent: Sendable {
347
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
348
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
349
+ // methods supported on all messages.
350
+
351
+ public var status: Pulsefield_Protocol_V1_EndpointStatus = .unspecified
352
+
353
+ public var message: String = String()
354
+
355
+ public var refTimeMs: UInt32 = 0
356
+
357
+ public var localHostTimeMs: Double = 0
358
+
359
+ public var unknownFields = SwiftProtobuf.UnknownStorage()
360
+
361
+ public init() {}
362
+ }
363
+
364
+ // MARK: - Code below here is support for the SwiftProtobuf runtime.
365
+
366
+ fileprivate nonisolated let _protobuf_package = "pulsefield.protocol.v1"
367
+
368
+ nonisolated extension Pulsefield_Protocol_V1_MusicSource: SwiftProtobuf._ProtoNameProviding {
369
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0MUSIC_SOURCE_UNSPECIFIED\0\u{1}MUSIC_SOURCE_BACKGROUND\0\u{1}MUSIC_SOURCE_SYSTEM_AUDIO\0")
370
+ }
371
+
372
+ nonisolated extension Pulsefield_Protocol_V1_InferenceRoute: SwiftProtobuf._ProtoNameProviding {
373
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0INFERENCE_ROUTE_UNSPECIFIED\0\u{1}INFERENCE_ROUTE_MAPPER\0\u{1}INFERENCE_ROUTE_TIMING_MOCK\0")
374
+ }
375
+
376
+ nonisolated extension Pulsefield_Protocol_V1_EndpointStatus: SwiftProtobuf._ProtoNameProviding {
377
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0ENDPOINT_STATUS_UNSPECIFIED\0\u{1}ENDPOINT_STATUS_READY\0\u{1}ENDPOINT_STATUS_AUDIO_PREPARING\0\u{1}ENDPOINT_STATUS_AUDIO_READY\0\u{1}ENDPOINT_STATUS_STREAMING\0\u{1}ENDPOINT_STATUS_STOPPED\0")
378
+ }
379
+
380
+ nonisolated extension Pulsefield_Protocol_V1_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
381
+ public static let protoMessageName: String = _protobuf_package + ".Envelope"
382
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}session_id\0\u{1}sequence\0\u{3}sent_at_unix_ms\0\u{2}\u{7}ready\0\u{1}audio\0\u{3}reference_time\0\u{3}stop_session\0\u{4}\u{7}hit_object_token\0\u{1}error\0\u{1}status\0")
383
+
384
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
385
+ while let fieldNumber = try decoder.nextFieldNumber() {
386
+ // The use of inline closures is to circumvent an issue where the compiler
387
+ // allocates stack space for every case branch when no optimizations are
388
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
389
+ switch fieldNumber {
390
+ case 1: try { try decoder.decodeSingularStringField(value: &self.sessionID) }()
391
+ case 2: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }()
392
+ case 3: try { try decoder.decodeSingularInt64Field(value: &self.sentAtUnixMs) }()
393
+ case 10: try {
394
+ var v: Pulsefield_Protocol_V1_ReadyRequest?
395
+ var hadOneofValue = false
396
+ if let current = self.payload {
397
+ hadOneofValue = true
398
+ if case .ready(let m) = current {v = m}
399
+ }
400
+ try decoder.decodeSingularMessageField(value: &v)
401
+ if let v = v {
402
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
403
+ self.payload = .ready(v)
404
+ }
405
+ }()
406
+ case 11: try {
407
+ var v: Pulsefield_Protocol_V1_AudioRequest?
408
+ var hadOneofValue = false
409
+ if let current = self.payload {
410
+ hadOneofValue = true
411
+ if case .audio(let m) = current {v = m}
412
+ }
413
+ try decoder.decodeSingularMessageField(value: &v)
414
+ if let v = v {
415
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
416
+ self.payload = .audio(v)
417
+ }
418
+ }()
419
+ case 12: try {
420
+ var v: Pulsefield_Protocol_V1_ReferenceTimeRequest?
421
+ var hadOneofValue = false
422
+ if let current = self.payload {
423
+ hadOneofValue = true
424
+ if case .referenceTime(let m) = current {v = m}
425
+ }
426
+ try decoder.decodeSingularMessageField(value: &v)
427
+ if let v = v {
428
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
429
+ self.payload = .referenceTime(v)
430
+ }
431
+ }()
432
+ case 13: try {
433
+ var v: Pulsefield_Protocol_V1_StopSessionRequest?
434
+ var hadOneofValue = false
435
+ if let current = self.payload {
436
+ hadOneofValue = true
437
+ if case .stopSession(let m) = current {v = m}
438
+ }
439
+ try decoder.decodeSingularMessageField(value: &v)
440
+ if let v = v {
441
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
442
+ self.payload = .stopSession(v)
443
+ }
444
+ }()
445
+ case 20: try {
446
+ var v: Pulsefield_Protocol_V1_HitObjectTokenEvent?
447
+ var hadOneofValue = false
448
+ if let current = self.payload {
449
+ hadOneofValue = true
450
+ if case .hitObjectToken(let m) = current {v = m}
451
+ }
452
+ try decoder.decodeSingularMessageField(value: &v)
453
+ if let v = v {
454
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
455
+ self.payload = .hitObjectToken(v)
456
+ }
457
+ }()
458
+ case 21: try {
459
+ var v: Pulsefield_Protocol_V1_ErrorEvent?
460
+ var hadOneofValue = false
461
+ if let current = self.payload {
462
+ hadOneofValue = true
463
+ if case .error(let m) = current {v = m}
464
+ }
465
+ try decoder.decodeSingularMessageField(value: &v)
466
+ if let v = v {
467
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
468
+ self.payload = .error(v)
469
+ }
470
+ }()
471
+ case 22: try {
472
+ var v: Pulsefield_Protocol_V1_StatusEvent?
473
+ var hadOneofValue = false
474
+ if let current = self.payload {
475
+ hadOneofValue = true
476
+ if case .status(let m) = current {v = m}
477
+ }
478
+ try decoder.decodeSingularMessageField(value: &v)
479
+ if let v = v {
480
+ if hadOneofValue {try decoder.handleConflictingOneOf()}
481
+ self.payload = .status(v)
482
+ }
483
+ }()
484
+ default: break
485
+ }
486
+ }
487
+ }
488
+
489
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
490
+ // The use of inline closures is to circumvent an issue where the compiler
491
+ // allocates stack space for every if/case branch local when no optimizations
492
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
493
+ // https://github.com/apple/swift-protobuf/issues/1182
494
+ if !self.sessionID.isEmpty {
495
+ try visitor.visitSingularStringField(value: self.sessionID, fieldNumber: 1)
496
+ }
497
+ if self.sequence != 0 {
498
+ try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 2)
499
+ }
500
+ if self.sentAtUnixMs != 0 {
501
+ try visitor.visitSingularInt64Field(value: self.sentAtUnixMs, fieldNumber: 3)
502
+ }
503
+ switch self.payload {
504
+ case .ready?: try {
505
+ guard case .ready(let v)? = self.payload else { preconditionFailure() }
506
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
507
+ }()
508
+ case .audio?: try {
509
+ guard case .audio(let v)? = self.payload else { preconditionFailure() }
510
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 11)
511
+ }()
512
+ case .referenceTime?: try {
513
+ guard case .referenceTime(let v)? = self.payload else { preconditionFailure() }
514
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 12)
515
+ }()
516
+ case .stopSession?: try {
517
+ guard case .stopSession(let v)? = self.payload else { preconditionFailure() }
518
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 13)
519
+ }()
520
+ case .hitObjectToken?: try {
521
+ guard case .hitObjectToken(let v)? = self.payload else { preconditionFailure() }
522
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
523
+ }()
524
+ case .error?: try {
525
+ guard case .error(let v)? = self.payload else { preconditionFailure() }
526
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 21)
527
+ }()
528
+ case .status?: try {
529
+ guard case .status(let v)? = self.payload else { preconditionFailure() }
530
+ try visitor.visitSingularMessageField(value: v, fieldNumber: 22)
531
+ }()
532
+ case nil: break
533
+ }
534
+ try unknownFields.traverse(visitor: &visitor)
535
+ }
536
+
537
+ public static func ==(lhs: Pulsefield_Protocol_V1_Envelope, rhs: Pulsefield_Protocol_V1_Envelope) -> Bool {
538
+ if lhs.sessionID != rhs.sessionID {return false}
539
+ if lhs.sequence != rhs.sequence {return false}
540
+ if lhs.sentAtUnixMs != rhs.sentAtUnixMs {return false}
541
+ if lhs.payload != rhs.payload {return false}
542
+ if lhs.unknownFields != rhs.unknownFields {return false}
543
+ return true
544
+ }
545
+ }
546
+
547
+ nonisolated extension Pulsefield_Protocol_V1_ReadyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
548
+ public static let protoMessageName: String = _protobuf_package + ".ReadyRequest"
549
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap()
550
+
551
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
552
+ // Load everything into unknown fields
553
+ while try decoder.nextFieldNumber() != nil {}
554
+ }
555
+
556
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
557
+ try unknownFields.traverse(visitor: &visitor)
558
+ }
559
+
560
+ public static func ==(lhs: Pulsefield_Protocol_V1_ReadyRequest, rhs: Pulsefield_Protocol_V1_ReadyRequest) -> Bool {
561
+ if lhs.unknownFields != rhs.unknownFields {return false}
562
+ return true
563
+ }
564
+ }
565
+
566
+ nonisolated extension Pulsefield_Protocol_V1_AudioRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
567
+ public static let protoMessageName: String = _protobuf_package + ".AudioRequest"
568
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}audio_path\0\u{3}audio_length_ms\0\u{3}music_source\0\u{1}difficulty\0\u{1}route\0")
569
+
570
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
571
+ while let fieldNumber = try decoder.nextFieldNumber() {
572
+ // The use of inline closures is to circumvent an issue where the compiler
573
+ // allocates stack space for every case branch when no optimizations are
574
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
575
+ switch fieldNumber {
576
+ case 1: try { try decoder.decodeSingularStringField(value: &self.audioPath) }()
577
+ case 2: try { try decoder.decodeSingularUInt32Field(value: &self._audioLengthMs) }()
578
+ case 3: try { try decoder.decodeSingularEnumField(value: &self.musicSource) }()
579
+ case 4: try { try decoder.decodeSingularDoubleField(value: &self._difficulty) }()
580
+ case 5: try { try decoder.decodeSingularEnumField(value: &self.route) }()
581
+ default: break
582
+ }
583
+ }
584
+ }
585
+
586
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
587
+ // The use of inline closures is to circumvent an issue where the compiler
588
+ // allocates stack space for every if/case branch local when no optimizations
589
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
590
+ // https://github.com/apple/swift-protobuf/issues/1182
591
+ if !self.audioPath.isEmpty {
592
+ try visitor.visitSingularStringField(value: self.audioPath, fieldNumber: 1)
593
+ }
594
+ try { if let v = self._audioLengthMs {
595
+ try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2)
596
+ } }()
597
+ if self.musicSource != .unspecified {
598
+ try visitor.visitSingularEnumField(value: self.musicSource, fieldNumber: 3)
599
+ }
600
+ try { if let v = self._difficulty {
601
+ try visitor.visitSingularDoubleField(value: v, fieldNumber: 4)
602
+ } }()
603
+ if self.route != .unspecified {
604
+ try visitor.visitSingularEnumField(value: self.route, fieldNumber: 5)
605
+ }
606
+ try unknownFields.traverse(visitor: &visitor)
607
+ }
608
+
609
+ public static func ==(lhs: Pulsefield_Protocol_V1_AudioRequest, rhs: Pulsefield_Protocol_V1_AudioRequest) -> Bool {
610
+ if lhs.audioPath != rhs.audioPath {return false}
611
+ if lhs._audioLengthMs != rhs._audioLengthMs {return false}
612
+ if lhs.musicSource != rhs.musicSource {return false}
613
+ if lhs._difficulty != rhs._difficulty {return false}
614
+ if lhs.route != rhs.route {return false}
615
+ if lhs.unknownFields != rhs.unknownFields {return false}
616
+ return true
617
+ }
618
+ }
619
+
620
+ nonisolated extension Pulsefield_Protocol_V1_ReferenceTimeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
621
+ public static let protoMessageName: String = _protobuf_package + ".ReferenceTimeRequest"
622
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}ref_time_ms\0\u{3}local_host_time_send_ms\0\u{3}audio_length_ms\0")
623
+
624
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
625
+ while let fieldNumber = try decoder.nextFieldNumber() {
626
+ // The use of inline closures is to circumvent an issue where the compiler
627
+ // allocates stack space for every case branch when no optimizations are
628
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
629
+ switch fieldNumber {
630
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.refTimeMs) }()
631
+ case 2: try { try decoder.decodeSingularDoubleField(value: &self.localHostTimeSendMs) }()
632
+ case 3: try { try decoder.decodeSingularUInt32Field(value: &self._audioLengthMs) }()
633
+ default: break
634
+ }
635
+ }
636
+ }
637
+
638
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
639
+ // The use of inline closures is to circumvent an issue where the compiler
640
+ // allocates stack space for every if/case branch local when no optimizations
641
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
642
+ // https://github.com/apple/swift-protobuf/issues/1182
643
+ if self.refTimeMs != 0 {
644
+ try visitor.visitSingularUInt32Field(value: self.refTimeMs, fieldNumber: 1)
645
+ }
646
+ if self.localHostTimeSendMs.bitPattern != 0 {
647
+ try visitor.visitSingularDoubleField(value: self.localHostTimeSendMs, fieldNumber: 2)
648
+ }
649
+ try { if let v = self._audioLengthMs {
650
+ try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3)
651
+ } }()
652
+ try unknownFields.traverse(visitor: &visitor)
653
+ }
654
+
655
+ public static func ==(lhs: Pulsefield_Protocol_V1_ReferenceTimeRequest, rhs: Pulsefield_Protocol_V1_ReferenceTimeRequest) -> Bool {
656
+ if lhs.refTimeMs != rhs.refTimeMs {return false}
657
+ if lhs.localHostTimeSendMs != rhs.localHostTimeSendMs {return false}
658
+ if lhs._audioLengthMs != rhs._audioLengthMs {return false}
659
+ if lhs.unknownFields != rhs.unknownFields {return false}
660
+ return true
661
+ }
662
+ }
663
+
664
+ nonisolated extension Pulsefield_Protocol_V1_StopSessionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
665
+ public static let protoMessageName: String = _protobuf_package + ".StopSessionRequest"
666
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}reason\0")
667
+
668
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
669
+ while let fieldNumber = try decoder.nextFieldNumber() {
670
+ // The use of inline closures is to circumvent an issue where the compiler
671
+ // allocates stack space for every case branch when no optimizations are
672
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
673
+ switch fieldNumber {
674
+ case 1: try { try decoder.decodeSingularStringField(value: &self.reason) }()
675
+ default: break
676
+ }
677
+ }
678
+ }
679
+
680
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
681
+ if !self.reason.isEmpty {
682
+ try visitor.visitSingularStringField(value: self.reason, fieldNumber: 1)
683
+ }
684
+ try unknownFields.traverse(visitor: &visitor)
685
+ }
686
+
687
+ public static func ==(lhs: Pulsefield_Protocol_V1_StopSessionRequest, rhs: Pulsefield_Protocol_V1_StopSessionRequest) -> Bool {
688
+ if lhs.reason != rhs.reason {return false}
689
+ if lhs.unknownFields != rhs.unknownFields {return false}
690
+ return true
691
+ }
692
+ }
693
+
694
+ nonisolated extension Pulsefield_Protocol_V1_HitObjectTokenEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
695
+ public static let protoMessageName: String = _protobuf_package + ".HitObjectTokenEvent"
696
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}token_id\0\u{3}ms_in_ref_audio\0")
697
+
698
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
699
+ while let fieldNumber = try decoder.nextFieldNumber() {
700
+ // The use of inline closures is to circumvent an issue where the compiler
701
+ // allocates stack space for every case branch when no optimizations are
702
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
703
+ switch fieldNumber {
704
+ case 1: try { try decoder.decodeSingularUInt32Field(value: &self.tokenID) }()
705
+ case 2: try { try decoder.decodeSingularUInt32Field(value: &self.msInRefAudio) }()
706
+ default: break
707
+ }
708
+ }
709
+ }
710
+
711
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
712
+ if self.tokenID != 0 {
713
+ try visitor.visitSingularUInt32Field(value: self.tokenID, fieldNumber: 1)
714
+ }
715
+ if self.msInRefAudio != 0 {
716
+ try visitor.visitSingularUInt32Field(value: self.msInRefAudio, fieldNumber: 2)
717
+ }
718
+ try unknownFields.traverse(visitor: &visitor)
719
+ }
720
+
721
+ public static func ==(lhs: Pulsefield_Protocol_V1_HitObjectTokenEvent, rhs: Pulsefield_Protocol_V1_HitObjectTokenEvent) -> Bool {
722
+ if lhs.tokenID != rhs.tokenID {return false}
723
+ if lhs.msInRefAudio != rhs.msInRefAudio {return false}
724
+ if lhs.unknownFields != rhs.unknownFields {return false}
725
+ return true
726
+ }
727
+ }
728
+
729
+ nonisolated extension Pulsefield_Protocol_V1_ErrorEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
730
+ public static let protoMessageName: String = _protobuf_package + ".ErrorEvent"
731
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{1}message\0")
732
+
733
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
734
+ while let fieldNumber = try decoder.nextFieldNumber() {
735
+ // The use of inline closures is to circumvent an issue where the compiler
736
+ // allocates stack space for every case branch when no optimizations are
737
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
738
+ switch fieldNumber {
739
+ case 1: try { try decoder.decodeSingularStringField(value: &self.code) }()
740
+ case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
741
+ default: break
742
+ }
743
+ }
744
+ }
745
+
746
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
747
+ if !self.code.isEmpty {
748
+ try visitor.visitSingularStringField(value: self.code, fieldNumber: 1)
749
+ }
750
+ if !self.message.isEmpty {
751
+ try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
752
+ }
753
+ try unknownFields.traverse(visitor: &visitor)
754
+ }
755
+
756
+ public static func ==(lhs: Pulsefield_Protocol_V1_ErrorEvent, rhs: Pulsefield_Protocol_V1_ErrorEvent) -> Bool {
757
+ if lhs.code != rhs.code {return false}
758
+ if lhs.message != rhs.message {return false}
759
+ if lhs.unknownFields != rhs.unknownFields {return false}
760
+ return true
761
+ }
762
+ }
763
+
764
+ nonisolated extension Pulsefield_Protocol_V1_StatusEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
765
+ public static let protoMessageName: String = _protobuf_package + ".StatusEvent"
766
+ public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}status\0\u{1}message\0\u{3}ref_time_ms\0\u{3}local_host_time_ms\0")
767
+
768
+ public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
769
+ while let fieldNumber = try decoder.nextFieldNumber() {
770
+ // The use of inline closures is to circumvent an issue where the compiler
771
+ // allocates stack space for every case branch when no optimizations are
772
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
773
+ switch fieldNumber {
774
+ case 1: try { try decoder.decodeSingularEnumField(value: &self.status) }()
775
+ case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
776
+ case 3: try { try decoder.decodeSingularUInt32Field(value: &self.refTimeMs) }()
777
+ case 4: try { try decoder.decodeSingularDoubleField(value: &self.localHostTimeMs) }()
778
+ default: break
779
+ }
780
+ }
781
+ }
782
+
783
+ public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
784
+ if self.status != .unspecified {
785
+ try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1)
786
+ }
787
+ if !self.message.isEmpty {
788
+ try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
789
+ }
790
+ if self.refTimeMs != 0 {
791
+ try visitor.visitSingularUInt32Field(value: self.refTimeMs, fieldNumber: 3)
792
+ }
793
+ if self.localHostTimeMs.bitPattern != 0 {
794
+ try visitor.visitSingularDoubleField(value: self.localHostTimeMs, fieldNumber: 4)
795
+ }
796
+ try unknownFields.traverse(visitor: &visitor)
797
+ }
798
+
799
+ public static func ==(lhs: Pulsefield_Protocol_V1_StatusEvent, rhs: Pulsefield_Protocol_V1_StatusEvent) -> Bool {
800
+ if lhs.status != rhs.status {return false}
801
+ if lhs.message != rhs.message {return false}
802
+ if lhs.refTimeMs != rhs.refTimeMs {return false}
803
+ if lhs.localHostTimeMs != rhs.localHostTimeMs {return false}
804
+ if lhs.unknownFields != rhs.unknownFields {return false}
805
+ return true
806
+ }
807
+ }