beebium 0.1.2__py3-none-any.whl

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.
Files changed (143) hide show
  1. beebium/client/__init__.py +173 -0
  2. beebium/client/_proto/__init__.py +28 -0
  3. beebium/client/_proto/audio_pb2.py +62 -0
  4. beebium/client/_proto/audio_pb2.pyi +244 -0
  5. beebium/client/_proto/audio_pb2_grpc.py +160 -0
  6. beebium/client/_proto/audio_pb2_grpc.pyi +88 -0
  7. beebium/client/_proto/debugger_pb2.py +190 -0
  8. beebium/client/_proto/debugger_pb2.pyi +2116 -0
  9. beebium/client/_proto/debugger_pb2_grpc.py +2689 -0
  10. beebium/client/_proto/debugger_pb2_grpc.pyi +669 -0
  11. beebium/client/_proto/disc_pb2.py +94 -0
  12. beebium/client/_proto/disc_pb2.pyi +666 -0
  13. beebium/client/_proto/disc_pb2_grpc.py +480 -0
  14. beebium/client/_proto/disc_pb2_grpc.pyi +202 -0
  15. beebium/client/_proto/econet_pb2.py +78 -0
  16. beebium/client/_proto/econet_pb2.pyi +586 -0
  17. beebium/client/_proto/econet_pb2_grpc.py +347 -0
  18. beebium/client/_proto/econet_pb2_grpc.pyi +163 -0
  19. beebium/client/_proto/econet_transport_pb2.py +58 -0
  20. beebium/client/_proto/econet_transport_pb2.pyi +171 -0
  21. beebium/client/_proto/econet_transport_pb2_grpc.py +188 -0
  22. beebium/client/_proto/econet_transport_pb2_grpc.pyi +136 -0
  23. beebium/client/_proto/extension_rpc_pb2.py +56 -0
  24. beebium/client/_proto/extension_rpc_pb2.pyi +114 -0
  25. beebium/client/_proto/extension_rpc_pb2_grpc.py +182 -0
  26. beebium/client/_proto/extension_rpc_pb2_grpc.pyi +114 -0
  27. beebium/client/_proto/extension_ui_pb2.py +84 -0
  28. beebium/client/_proto/extension_ui_pb2.pyi +688 -0
  29. beebium/client/_proto/extension_ui_pb2_grpc.py +196 -0
  30. beebium/client/_proto/extension_ui_pb2_grpc.pyi +148 -0
  31. beebium/client/_proto/indicator_pb2.py +74 -0
  32. beebium/client/_proto/indicator_pb2.pyi +268 -0
  33. beebium/client/_proto/indicator_pb2_grpc.py +217 -0
  34. beebium/client/_proto/indicator_pb2_grpc.pyi +118 -0
  35. beebium/client/_proto/keyboard_pb2.py +118 -0
  36. beebium/client/_proto/keyboard_pb2.pyi +776 -0
  37. beebium/client/_proto/keyboard_pb2_grpc.py +943 -0
  38. beebium/client/_proto/keyboard_pb2_grpc.pyi +418 -0
  39. beebium/client/_proto/peripheral_extension_pb2.py +64 -0
  40. beebium/client/_proto/peripheral_extension_pb2.pyi +293 -0
  41. beebium/client/_proto/peripheral_extension_pb2_grpc.py +119 -0
  42. beebium/client/_proto/peripheral_extension_pb2_grpc.pyi +79 -0
  43. beebium/client/_proto/protocol_fingerprint.py +15 -0
  44. beebium/client/_proto/serial_pb2.py +54 -0
  45. beebium/client/_proto/serial_pb2.pyi +154 -0
  46. beebium/client/_proto/serial_pb2_grpc.py +173 -0
  47. beebium/client/_proto/serial_pb2_grpc.pyi +112 -0
  48. beebium/client/_proto/sideways_pb2.py +78 -0
  49. beebium/client/_proto/sideways_pb2.pyi +555 -0
  50. beebium/client/_proto/sideways_pb2_grpc.py +257 -0
  51. beebium/client/_proto/sideways_pb2_grpc.pyi +121 -0
  52. beebium/client/_proto/system_pb2.py +96 -0
  53. beebium/client/_proto/system_pb2.pyi +779 -0
  54. beebium/client/_proto/system_pb2_grpc.py +473 -0
  55. beebium/client/_proto/system_pb2_grpc.pyi +193 -0
  56. beebium/client/_proto/tube_pb2.py +68 -0
  57. beebium/client/_proto/tube_pb2.pyi +291 -0
  58. beebium/client/_proto/tube_pb2_grpc.py +301 -0
  59. beebium/client/_proto/tube_pb2_grpc.pyi +133 -0
  60. beebium/client/_proto/video_pb2.py +102 -0
  61. beebium/client/_proto/video_pb2.pyi +978 -0
  62. beebium/client/_proto/video_pb2_grpc.py +404 -0
  63. beebium/client/_proto/video_pb2_grpc.pyi +238 -0
  64. beebium/client/_version.py +15 -0
  65. beebium/client/audio.py +164 -0
  66. beebium/client/basic.py +259 -0
  67. beebium/client/client.py +660 -0
  68. beebium/client/connection.py +266 -0
  69. beebium/client/cpu.py +278 -0
  70. beebium/client/crtc.py +219 -0
  71. beebium/client/debugger.py +869 -0
  72. beebium/client/disassemble.py +291 -0
  73. beebium/client/disc.py +581 -0
  74. beebium/client/discovery.py +444 -0
  75. beebium/client/econet.py +408 -0
  76. beebium/client/econet_transport.py +179 -0
  77. beebium/client/exceptions.py +134 -0
  78. beebium/client/extension.py +258 -0
  79. beebium/client/extension_rpc.py +70 -0
  80. beebium/client/extension_ui.py +359 -0
  81. beebium/client/extensions.py +278 -0
  82. beebium/client/host.py +153 -0
  83. beebium/client/indicators.py +112 -0
  84. beebium/client/keyboard.py +857 -0
  85. beebium/client/keyboard_map.py +173 -0
  86. beebium/client/latch.py +108 -0
  87. beebium/client/memory.py +769 -0
  88. beebium/client/py.typed +0 -0
  89. beebium/client/pytest_plugin.py +298 -0
  90. beebium/client/screen.py +303 -0
  91. beebium/client/serial.py +119 -0
  92. beebium/client/server.py +462 -0
  93. beebium/client/sideways.py +366 -0
  94. beebium/client/sound.py +173 -0
  95. beebium/client/strings.py +158 -0
  96. beebium/client/system.py +590 -0
  97. beebium/client/tube.py +86 -0
  98. beebium/client/tube_system.py +181 -0
  99. beebium/client/tube_ula.py +345 -0
  100. beebium/client/via.py +216 -0
  101. beebium/client/video.py +728 -0
  102. beebium/client/video_ula.py +133 -0
  103. beebium/ext/econet/aun/__init__.py +185 -0
  104. beebium/ext/econet/aun/_proto/__init__.py +11 -0
  105. beebium/ext/econet/aun/_proto/aun_pb2.py +72 -0
  106. beebium/ext/econet/aun/_proto/aun_pb2.pyi +344 -0
  107. beebium/ext/econet/aun/_proto/aun_pb2_grpc.py +314 -0
  108. beebium/ext/econet/aun/_proto/aun_pb2_grpc.pyi +151 -0
  109. beebium/ext/econet/piconet/__init__.py +86 -0
  110. beebium/ext/econet/piconet/_proto/__init__.py +11 -0
  111. beebium/ext/econet/piconet/_proto/piconet_service_pb2.py +52 -0
  112. beebium/ext/econet/piconet/_proto/piconet_service_pb2.pyi +85 -0
  113. beebium/ext/econet/piconet/_proto/piconet_service_pb2_grpc.py +156 -0
  114. beebium/ext/econet/piconet/_proto/piconet_service_pb2_grpc.pyi +118 -0
  115. beebium/ext/peripheral/acorn_rtc/__init__.py +125 -0
  116. beebium/ext/peripheral/acorn_rtc/_proto/__init__.py +11 -0
  117. beebium/ext/peripheral/acorn_rtc/_proto/acorn_rtc_pb2.py +70 -0
  118. beebium/ext/peripheral/acorn_rtc/_proto/acorn_rtc_pb2.pyi +262 -0
  119. beebium/ext/peripheral/acorn_rtc/_proto/acorn_rtc_pb2_grpc.py +293 -0
  120. beebium/ext/peripheral/acorn_rtc/_proto/acorn_rtc_pb2_grpc.pyi +139 -0
  121. beebium/ext/peripheral/acorn_scsi/__init__.py +114 -0
  122. beebium/ext/peripheral/acorn_scsi/_proto/__init__.py +11 -0
  123. beebium/ext/peripheral/acorn_scsi/_proto/scsi_host_adapter_pb2.py +74 -0
  124. beebium/ext/peripheral/acorn_scsi/_proto/scsi_host_adapter_pb2.pyi +415 -0
  125. beebium/ext/peripheral/acorn_scsi/_proto/scsi_host_adapter_pb2_grpc.py +203 -0
  126. beebium/ext/peripheral/acorn_scsi/_proto/scsi_host_adapter_pb2_grpc.pyi +103 -0
  127. beebium/ext/peripheral/host_serial/__init__.py +99 -0
  128. beebium/ext/peripheral/host_serial/_proto/__init__.py +11 -0
  129. beebium/ext/peripheral/host_serial/_proto/host_serial_pb2.py +54 -0
  130. beebium/ext/peripheral/host_serial/_proto/host_serial_pb2.pyi +126 -0
  131. beebium/ext/peripheral/host_serial/_proto/host_serial_pb2_grpc.py +176 -0
  132. beebium/ext/peripheral/host_serial/_proto/host_serial_pb2_grpc.pyi +115 -0
  133. beebium/ext/peripheral/rpc_serial/__init__.py +82 -0
  134. beebium/ext/peripheral/rpc_serial/_proto/__init__.py +11 -0
  135. beebium/ext/peripheral/rpc_serial/_proto/rpc_serial_pb2.py +60 -0
  136. beebium/ext/peripheral/rpc_serial/_proto/rpc_serial_pb2.pyi +149 -0
  137. beebium/ext/peripheral/rpc_serial/_proto/rpc_serial_pb2_grpc.py +210 -0
  138. beebium/ext/peripheral/rpc_serial/_proto/rpc_serial_pb2_grpc.pyi +106 -0
  139. beebium-0.1.2.dist-info/METADATA +436 -0
  140. beebium-0.1.2.dist-info/RECORD +143 -0
  141. beebium-0.1.2.dist-info/WHEEL +4 -0
  142. beebium-0.1.2.dist-info/entry_points.txt +12 -0
  143. beebium-0.1.2.dist-info/licenses/COPYING.txt +674 -0
@@ -0,0 +1,173 @@
1
+ # Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
2
+ #
3
+ # This file is part of Beebium.
4
+ #
5
+ # Beebium is free software: you can redistribute it and/or modify it under the terms of the
6
+ # GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
+ # License, or (at your option) any later version. Beebium is distributed in the hope that it will
8
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ # You should have received a copy of the GNU General Public License along with Beebium.
11
+ # If not, see <https://www.gnu.org/licenses/>.
12
+
13
+ """
14
+ Beebium - Python client for the Beebium BBC Micro emulator.
15
+
16
+ Usage:
17
+ from beebium.client import Beebium
18
+
19
+ # Connect to an existing server
20
+ with Beebium.connect() as bbc:
21
+ bbc.debugger.stop()
22
+ print(f"PC = ${bbc.cpu.pc:04X}")
23
+
24
+ # Launch and manage a server
25
+ with Beebium.launch(mos_filepath="acorn-mos_1_20.rom") as bbc:
26
+ bbc.keyboard.type("PRINT 42")
27
+ bbc.keyboard.press_return()
28
+ """
29
+
30
+ from beebium.client._proto.protocol_fingerprint import PROTOCOL_FINGERPRINT
31
+ from beebium.client._version import __version__
32
+ from beebium.client.audio import (
33
+ AudioChunk,
34
+ AudioFormat,
35
+ AudioSource,
36
+ ChannelGroup,
37
+ SourceEncoding,
38
+ )
39
+ from beebium.client.client import Beebium
40
+ from beebium.client.econet import (
41
+ AdlcStatus,
42
+ EconetEvent,
43
+ EconetFrameInfo,
44
+ EconetStatus,
45
+ HandshakeStatus,
46
+ )
47
+ from beebium.client.econet_transport import TransportInfo
48
+ from beebium.client.exceptions import (
49
+ BeebiumError,
50
+ ConnectionError,
51
+ DebuggerError,
52
+ DiscError,
53
+ EconetError,
54
+ ExtensionAdapterNotInstalledError,
55
+ ExtensionAmbiguousError,
56
+ ExtensionError,
57
+ ExtensionNotLoadedError,
58
+ InvalidConditionError,
59
+ MemoryAccessError,
60
+ ProtocolMismatchError,
61
+ ServerNotFoundError,
62
+ ServerStartupError,
63
+ TimeoutError,
64
+ )
65
+ from beebium.client.extension import (
66
+ EconetTransportAdapter,
67
+ ExtensionAdapter,
68
+ PeripheralExtensionAdapter,
69
+ )
70
+ from beebium.client.extension_ui import (
71
+ Button,
72
+ Choice,
73
+ Control,
74
+ ControlKind,
75
+ DispatchResult,
76
+ Group,
77
+ Indicator,
78
+ IndicatorState,
79
+ Label,
80
+ SubscriptionHandle,
81
+ TextInput,
82
+ Toggle,
83
+ View,
84
+ )
85
+ from beebium.client.extensions import (
86
+ ExtensionInfo,
87
+ Extensions,
88
+ ParameterSchemaInfo,
89
+ StorageDevice,
90
+ StorageKind,
91
+ )
92
+ from beebium.client.host import (
93
+ host_identifier,
94
+ is_local_host,
95
+ local_host_fingerprint,
96
+ )
97
+ from beebium.client.system import (
98
+ AdvertisementState,
99
+ MachineIdentity,
100
+ Provenance,
101
+ ServerStatus,
102
+ ServerStatusEvent,
103
+ ShutdownConditionStatus,
104
+ ShutdownMode,
105
+ ShutdownResponse,
106
+ )
107
+
108
+ # Default gRPC port for beebium servers (0xBEEB = 48875)
109
+ DEFAULT_GRPC_PORT = 0xBEEB
110
+
111
+ __all__ = [
112
+ "AdlcStatus",
113
+ "AdvertisementState",
114
+ "AudioChunk",
115
+ "AudioFormat",
116
+ "AudioSource",
117
+ "Beebium",
118
+ "BeebiumError",
119
+ "Button",
120
+ "ChannelGroup",
121
+ "Choice",
122
+ "ConnectionError",
123
+ "Control",
124
+ "ExtensionInfo",
125
+ "Extensions",
126
+ "host_identifier",
127
+ "PROTOCOL_FINGERPRINT",
128
+ "is_local_host",
129
+ "local_host_fingerprint",
130
+ "ProtocolMismatchError",
131
+ "ControlKind",
132
+ "DebuggerError",
133
+ "DEFAULT_GRPC_PORT",
134
+ "DiscError",
135
+ "DispatchResult",
136
+ "EconetError",
137
+ "EconetEvent",
138
+ "EconetFrameInfo",
139
+ "EconetStatus",
140
+ "EconetTransportAdapter",
141
+ "ExtensionAdapter",
142
+ "PeripheralExtensionAdapter",
143
+ "ExtensionAdapterNotInstalledError",
144
+ "ExtensionAmbiguousError",
145
+ "ExtensionError",
146
+ "ExtensionNotLoadedError",
147
+ "Group",
148
+ "HandshakeStatus",
149
+ "Indicator",
150
+ "IndicatorState",
151
+ "Label",
152
+ "MachineIdentity",
153
+ "MemoryAccessError",
154
+ "ParameterSchemaInfo",
155
+ "Provenance",
156
+ "ServerNotFoundError",
157
+ "ServerStartupError",
158
+ "ServerStatus",
159
+ "ServerStatusEvent",
160
+ "ShutdownConditionStatus",
161
+ "ShutdownMode",
162
+ "ShutdownResponse",
163
+ "SourceEncoding",
164
+ "StorageDevice",
165
+ "StorageKind",
166
+ "SubscriptionHandle",
167
+ "TextInput",
168
+ "TimeoutError",
169
+ "Toggle",
170
+ "TransportInfo",
171
+ "View",
172
+ "__version__",
173
+ ]
@@ -0,0 +1,28 @@
1
+ # Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
2
+ #
3
+ # This file is part of Beebium.
4
+ #
5
+ # Beebium is free software: you can redistribute it and/or modify it under the terms of the
6
+ # GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
+ # License, or (at your option) any later version. Beebium is distributed in the hope that it will
8
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ # You should have received a copy of the GNU General Public License along with Beebium.
11
+ # If not, see <https://www.gnu.org/licenses/>.
12
+
13
+ """Generated protocol buffer modules.
14
+
15
+ Run scripts/generate_proto.sh to regenerate these files from the .proto definitions.
16
+ """
17
+
18
+ # These imports will be available after running generate_proto.sh
19
+ try:
20
+ from beebium.client._proto import video_pb2, video_pb2_grpc
21
+ from beebium.client._proto import keyboard_pb2, keyboard_pb2_grpc
22
+ from beebium.client._proto import debugger_pb2, debugger_pb2_grpc
23
+ from beebium.client._proto import system_pb2, system_pb2_grpc
24
+ from beebium.client._proto import disc_pb2, disc_pb2_grpc
25
+ from beebium.client._proto import econet_pb2, econet_pb2_grpc
26
+ except ImportError:
27
+ # Proto files not yet generated
28
+ pass
@@ -0,0 +1,62 @@
1
+ # Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
2
+ #
3
+ # This file is part of Beebium.
4
+ #
5
+ # Beebium is free software: you can redistribute it and/or modify it under the terms of the
6
+ # GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
+ # License, or (at your option) any later version. Beebium is distributed in the hope that it will
8
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ # You should have received a copy of the GNU General Public License along with Beebium.
11
+ # If not, see <https://www.gnu.org/licenses/>.
12
+
13
+ # -*- coding: utf-8 -*-
14
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
15
+ # NO CHECKED-IN PROTOBUF GENCODE
16
+ # source: audio.proto
17
+ # Protobuf Python Version: 6.31.1
18
+ """Generated protocol buffer code."""
19
+ from google.protobuf import descriptor as _descriptor
20
+ from google.protobuf import descriptor_pool as _descriptor_pool
21
+ from google.protobuf import runtime_version as _runtime_version
22
+ from google.protobuf import symbol_database as _symbol_database
23
+ from google.protobuf.internal import builder as _builder
24
+ _runtime_version.ValidateProtobufRuntimeVersion(
25
+ _runtime_version.Domain.PUBLIC,
26
+ 6,
27
+ 31,
28
+ 1,
29
+ '',
30
+ 'audio.proto'
31
+ )
32
+ # @@protoc_insertion_point(imports)
33
+
34
+ _sym_db = _symbol_database.Default()
35
+
36
+
37
+
38
+
39
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x61udio.proto\x12\x07\x62\x65\x65\x62ium\"+\n\x15SubscribeAudioRequest\x12\x12\n\nchunk_size\x18\x01 \x01(\r\"Z\n\nAudioChunk\x12\x10\n\x08sequence\x18\x01 \x01(\x04\x12\x14\n\x0csample_count\x18\x02 \x01(\r\x12\x13\n\x0b\x63ycle_count\x18\x03 \x01(\x04\x12\x0f\n\x07samples\x18\x04 \x01(\x0c\"\x8c\x01\n\x0b\x41udioSource\x12\x14\n\x0csource_index\x18\x01 \x01(\r\x12\x13\n\x0bsource_name\x18\x02 \x01(\t\x12)\n\x08\x65ncoding\x18\x03 \x01(\x0e\x32\x17.beebium.SourceEncoding\x12\x15\n\rchannel_names\x18\x04 \x03(\t\x12\x10\n\x08group_id\x18\x05 \x01(\r\"X\n\x0c\x43hannelGroup\x12\x10\n\x08group_id\x18\x01 \x01(\r\x12\x12\n\ngroup_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05\x63olor\x18\x04 \x01(\t\"\x17\n\x15GetAudioFormatRequest\"\x86\x01\n\x0b\x41udioFormat\x12\x13\n\x0bsample_rate\x18\x01 \x01(\r\x12\x14\n\x0csource_count\x18\x02 \x01(\r\x12%\n\x07sources\x18\x03 \x03(\x0b\x32\x14.beebium.AudioSource\x12%\n\x06groups\x18\x04 \x03(\x0b\x32\x15.beebium.ChannelGroup*\x9a\x01\n\x0eSourceEncoding\x12\x1a\n\x16\x45NCODING_4X8BIT_SIGNED\x10\x00\x12\x1b\n\x17\x45NCODING_2X16BIT_SIGNED\x10\x01\x12\x1b\n\x17\x45NCODING_1X32BIT_SIGNED\x10\x02\x12\x14\n\x10\x45NCODING_SILENCE\x10\x03\x12\x1c\n\x18\x45NCODING_4X8BIT_UNSIGNED\x10\x04\x32\x9f\x01\n\x0c\x41udioService\x12G\n\x0eSubscribeAudio\x12\x1e.beebium.SubscribeAudioRequest\x1a\x13.beebium.AudioChunk0\x01\x12\x46\n\x0eGetAudioFormat\x12\x1e.beebium.GetAudioFormatRequest\x1a\x14.beebium.AudioFormatb\x06proto3')
40
+
41
+ _globals = globals()
42
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
43
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'audio_pb2', _globals)
44
+ if not _descriptor._USE_C_DESCRIPTORS:
45
+ DESCRIPTOR._loaded_options = None
46
+ _globals['_SOURCEENCODING']._serialized_start=557
47
+ _globals['_SOURCEENCODING']._serialized_end=711
48
+ _globals['_SUBSCRIBEAUDIOREQUEST']._serialized_start=24
49
+ _globals['_SUBSCRIBEAUDIOREQUEST']._serialized_end=67
50
+ _globals['_AUDIOCHUNK']._serialized_start=69
51
+ _globals['_AUDIOCHUNK']._serialized_end=159
52
+ _globals['_AUDIOSOURCE']._serialized_start=162
53
+ _globals['_AUDIOSOURCE']._serialized_end=302
54
+ _globals['_CHANNELGROUP']._serialized_start=304
55
+ _globals['_CHANNELGROUP']._serialized_end=392
56
+ _globals['_GETAUDIOFORMATREQUEST']._serialized_start=394
57
+ _globals['_GETAUDIOFORMATREQUEST']._serialized_end=417
58
+ _globals['_AUDIOFORMAT']._serialized_start=420
59
+ _globals['_AUDIOFORMAT']._serialized_end=554
60
+ _globals['_AUDIOSERVICE']._serialized_start=714
61
+ _globals['_AUDIOSERVICE']._serialized_end=873
62
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,244 @@
1
+ # Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
2
+ #
3
+ # This file is part of Beebium.
4
+ #
5
+ # Beebium is free software: you can redistribute it and/or modify it under the terms of the
6
+ # GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
+ # License, or (at your option) any later version. Beebium is distributed in the hope that it will
8
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ # You should have received a copy of the GNU General Public License along with Beebium.
11
+ # If not, see <https://www.gnu.org/licenses/>.
12
+
13
+ """
14
+ @generated by mypy-protobuf. Do not edit manually!
15
+ isort:skip_file
16
+ """
17
+
18
+ from collections import abc as _abc
19
+ from google.protobuf import descriptor as _descriptor
20
+ from google.protobuf import message as _message
21
+ from google.protobuf.internal import containers as _containers
22
+ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
23
+ import builtins as _builtins
24
+ import sys
25
+ import typing as _typing
26
+
27
+ if sys.version_info >= (3, 11):
28
+ from typing import TypeAlias as _TypeAlias, Never as _Never
29
+ else:
30
+ from typing_extensions import TypeAlias as _TypeAlias, Never as _Never
31
+
32
+ DESCRIPTOR: _descriptor.FileDescriptor
33
+
34
+ class _SourceEncoding:
35
+ ValueType = _typing.NewType("ValueType", _builtins.int)
36
+ V: _TypeAlias = ValueType # noqa: Y015
37
+
38
+ class _SourceEncodingEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_SourceEncoding.ValueType], _builtins.type):
39
+ DESCRIPTOR: _descriptor.EnumDescriptor
40
+ ENCODING_4X8BIT_SIGNED: _SourceEncoding.ValueType # 0
41
+ """4 × int8 channels, zero-centered (legacy)"""
42
+ ENCODING_2X16BIT_SIGNED: _SourceEncoding.ValueType # 1
43
+ """2 × int16 channels (e.g., Music 5000 stereo)"""
44
+ ENCODING_1X32BIT_SIGNED: _SourceEncoding.ValueType # 2
45
+ """1 × int32 channel (high-quality)"""
46
+ ENCODING_SILENCE: _SourceEncoding.ValueType # 3
47
+ """Unused/silent source"""
48
+ ENCODING_4X8BIT_UNSIGNED: _SourceEncoding.ValueType # 4
49
+ """4 × uint8 channels, DC bias pre-applied (SN76489)"""
50
+
51
+ class SourceEncoding(_SourceEncoding, metaclass=_SourceEncodingEnumTypeWrapper):
52
+ """Describes how to interpret a 32-bit source field"""
53
+
54
+ ENCODING_4X8BIT_SIGNED: SourceEncoding.ValueType # 0
55
+ """4 × int8 channels, zero-centered (legacy)"""
56
+ ENCODING_2X16BIT_SIGNED: SourceEncoding.ValueType # 1
57
+ """2 × int16 channels (e.g., Music 5000 stereo)"""
58
+ ENCODING_1X32BIT_SIGNED: SourceEncoding.ValueType # 2
59
+ """1 × int32 channel (high-quality)"""
60
+ ENCODING_SILENCE: SourceEncoding.ValueType # 3
61
+ """Unused/silent source"""
62
+ ENCODING_4X8BIT_UNSIGNED: SourceEncoding.ValueType # 4
63
+ """4 × uint8 channels, DC bias pre-applied (SN76489)"""
64
+ Global___SourceEncoding: _TypeAlias = SourceEncoding # noqa: Y015
65
+
66
+ @_typing.final
67
+ class SubscribeAudioRequest(_message.Message):
68
+ DESCRIPTOR: _descriptor.Descriptor
69
+
70
+ CHUNK_SIZE_FIELD_NUMBER: _builtins.int
71
+ chunk_size: _builtins.int
72
+ """Samples per chunk (default: 1024)"""
73
+ def __init__(
74
+ self,
75
+ *,
76
+ chunk_size: _builtins.int = ...,
77
+ ) -> None: ...
78
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
79
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
80
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["chunk_size", b"chunk_size"] # noqa: Y015
81
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
82
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
83
+
84
+ Global___SubscribeAudioRequest: _TypeAlias = SubscribeAudioRequest # noqa: Y015
85
+
86
+ @_typing.final
87
+ class AudioChunk(_message.Message):
88
+ DESCRIPTOR: _descriptor.Descriptor
89
+
90
+ SEQUENCE_FIELD_NUMBER: _builtins.int
91
+ SAMPLE_COUNT_FIELD_NUMBER: _builtins.int
92
+ CYCLE_COUNT_FIELD_NUMBER: _builtins.int
93
+ SAMPLES_FIELD_NUMBER: _builtins.int
94
+ sequence: _builtins.int
95
+ """Chunk sequence number (for drop detection)"""
96
+ sample_count: _builtins.int
97
+ """Number of samples in this chunk"""
98
+ cycle_count: _builtins.int
99
+ """Emulation cycle at start of chunk (reserved)"""
100
+ samples: _builtins.bytes
101
+ """Packed sample data: sample_count × source_count × 4 bytes
102
+ Each sample is N × 32-bit fields, where N = source_count from AudioFormat
103
+ Use GetAudioFormat to determine how to interpret each 32-bit field
104
+ """
105
+ def __init__(
106
+ self,
107
+ *,
108
+ sequence: _builtins.int = ...,
109
+ sample_count: _builtins.int = ...,
110
+ cycle_count: _builtins.int = ...,
111
+ samples: _builtins.bytes = ...,
112
+ ) -> None: ...
113
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
114
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
115
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["cycle_count", b"cycle_count", "sample_count", b"sample_count", "samples", b"samples", "sequence", b"sequence"] # noqa: Y015
116
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
117
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
118
+
119
+ Global___AudioChunk: _TypeAlias = AudioChunk # noqa: Y015
120
+
121
+ @_typing.final
122
+ class AudioSource(_message.Message):
123
+ DESCRIPTOR: _descriptor.Descriptor
124
+
125
+ SOURCE_INDEX_FIELD_NUMBER: _builtins.int
126
+ SOURCE_NAME_FIELD_NUMBER: _builtins.int
127
+ ENCODING_FIELD_NUMBER: _builtins.int
128
+ CHANNEL_NAMES_FIELD_NUMBER: _builtins.int
129
+ GROUP_ID_FIELD_NUMBER: _builtins.int
130
+ source_index: _builtins.int
131
+ """Index into sample sources array"""
132
+ source_name: _builtins.str
133
+ """E.g., "SN76489", "Speech", "Music5000" """
134
+ encoding: Global___SourceEncoding.ValueType
135
+ """How the 32-bit field is subdivided"""
136
+ group_id: _builtins.int
137
+ """Channel group ID (0 = ungrouped)"""
138
+ @_builtins.property
139
+ def channel_names(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]:
140
+ """Sub-channel labels using MOS SOUND channel numbering:
141
+ "0" (noise), "1", "2", "3" (tones) - matches BBC BASIC SOUND command
142
+ """
143
+
144
+ def __init__(
145
+ self,
146
+ *,
147
+ source_index: _builtins.int = ...,
148
+ source_name: _builtins.str = ...,
149
+ encoding: Global___SourceEncoding.ValueType = ...,
150
+ channel_names: _abc.Iterable[_builtins.str] | None = ...,
151
+ group_id: _builtins.int = ...,
152
+ ) -> None: ...
153
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
154
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
155
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["channel_names", b"channel_names", "encoding", b"encoding", "group_id", b"group_id", "source_index", b"source_index", "source_name", b"source_name"] # noqa: Y015
156
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
157
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
158
+
159
+ Global___AudioSource: _TypeAlias = AudioSource # noqa: Y015
160
+
161
+ @_typing.final
162
+ class ChannelGroup(_message.Message):
163
+ """Channel group for organizing related audio sources in UI"""
164
+
165
+ DESCRIPTOR: _descriptor.Descriptor
166
+
167
+ GROUP_ID_FIELD_NUMBER: _builtins.int
168
+ GROUP_NAME_FIELD_NUMBER: _builtins.int
169
+ DESCRIPTION_FIELD_NUMBER: _builtins.int
170
+ COLOR_FIELD_NUMBER: _builtins.int
171
+ group_id: _builtins.int
172
+ """Unique group identifier"""
173
+ group_name: _builtins.str
174
+ """E.g., "Internal Sound", "Music 5000" """
175
+ description: _builtins.str
176
+ """Optional description"""
177
+ color: _builtins.str
178
+ """Optional UI hint (e.g., "#FF5733")"""
179
+ def __init__(
180
+ self,
181
+ *,
182
+ group_id: _builtins.int = ...,
183
+ group_name: _builtins.str = ...,
184
+ description: _builtins.str = ...,
185
+ color: _builtins.str = ...,
186
+ ) -> None: ...
187
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
188
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
189
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["color", b"color", "description", b"description", "group_id", b"group_id", "group_name", b"group_name"] # noqa: Y015
190
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
191
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
192
+
193
+ Global___ChannelGroup: _TypeAlias = ChannelGroup # noqa: Y015
194
+
195
+ @_typing.final
196
+ class GetAudioFormatRequest(_message.Message):
197
+ DESCRIPTOR: _descriptor.Descriptor
198
+
199
+ def __init__(
200
+ self,
201
+ ) -> None: ...
202
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
203
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
204
+ _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015
205
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
206
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
207
+
208
+ Global___GetAudioFormatRequest: _TypeAlias = GetAudioFormatRequest # noqa: Y015
209
+
210
+ @_typing.final
211
+ class AudioFormat(_message.Message):
212
+ DESCRIPTOR: _descriptor.Descriptor
213
+
214
+ SAMPLE_RATE_FIELD_NUMBER: _builtins.int
215
+ SOURCE_COUNT_FIELD_NUMBER: _builtins.int
216
+ SOURCES_FIELD_NUMBER: _builtins.int
217
+ GROUPS_FIELD_NUMBER: _builtins.int
218
+ sample_rate: _builtins.int
219
+ """Output sample rate (48000 Hz)"""
220
+ source_count: _builtins.int
221
+ """Number of 32-bit fields per sample"""
222
+ @_builtins.property
223
+ def sources(self) -> _containers.RepeatedCompositeFieldContainer[Global___AudioSource]:
224
+ """Metadata for each active source"""
225
+
226
+ @_builtins.property
227
+ def groups(self) -> _containers.RepeatedCompositeFieldContainer[Global___ChannelGroup]:
228
+ """Channel group definitions"""
229
+
230
+ def __init__(
231
+ self,
232
+ *,
233
+ sample_rate: _builtins.int = ...,
234
+ source_count: _builtins.int = ...,
235
+ sources: _abc.Iterable[Global___AudioSource] | None = ...,
236
+ groups: _abc.Iterable[Global___ChannelGroup] | None = ...,
237
+ ) -> None: ...
238
+ _HasFieldArgType: _TypeAlias = _Never # noqa: Y015
239
+ def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
240
+ _ClearFieldArgType: _TypeAlias = _typing.Literal["groups", b"groups", "sample_rate", b"sample_rate", "source_count", b"source_count", "sources", b"sources"] # noqa: Y015
241
+ def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
242
+ def WhichOneof(self, oneof_group: _Never) -> None: ...
243
+
244
+ Global___AudioFormat: _TypeAlias = AudioFormat # noqa: Y015
@@ -0,0 +1,160 @@
1
+ # Copyright 2026 Robert Smallshire <robert@smallshire.org.uk>
2
+ #
3
+ # This file is part of Beebium.
4
+ #
5
+ # Beebium is free software: you can redistribute it and/or modify it under the terms of the
6
+ # GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
+ # License, or (at your option) any later version. Beebium is distributed in the hope that it will
8
+ # be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ # You should have received a copy of the GNU General Public License along with Beebium.
11
+ # If not, see <https://www.gnu.org/licenses/>.
12
+
13
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
14
+ """Client and server classes corresponding to protobuf-defined services."""
15
+ import grpc
16
+ import warnings
17
+
18
+ from . import audio_pb2 as audio__pb2
19
+
20
+ GRPC_GENERATED_VERSION = '1.76.0'
21
+ GRPC_VERSION = grpc.__version__
22
+ _version_not_supported = False
23
+
24
+ try:
25
+ from grpc._utilities import first_version_is_lower
26
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
27
+ except ImportError:
28
+ _version_not_supported = True
29
+
30
+ if _version_not_supported:
31
+ raise RuntimeError(
32
+ f'The grpc package installed is at version {GRPC_VERSION},'
33
+ + ' but the generated code in audio_pb2_grpc.py depends on'
34
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
35
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
36
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
37
+ )
38
+
39
+
40
+ class AudioServiceStub(object):
41
+ """Audio streaming service
42
+ Note: Sound chip state introspection moved to DebuggerControl.GetSoundChipState
43
+ """
44
+
45
+ def __init__(self, channel):
46
+ """Constructor.
47
+
48
+ Args:
49
+ channel: A grpc.Channel.
50
+ """
51
+ self.SubscribeAudio = channel.unary_stream(
52
+ '/beebium.AudioService/SubscribeAudio',
53
+ request_serializer=audio__pb2.SubscribeAudioRequest.SerializeToString,
54
+ response_deserializer=audio__pb2.AudioChunk.FromString,
55
+ _registered_method=True)
56
+ self.GetAudioFormat = channel.unary_unary(
57
+ '/beebium.AudioService/GetAudioFormat',
58
+ request_serializer=audio__pb2.GetAudioFormatRequest.SerializeToString,
59
+ response_deserializer=audio__pb2.AudioFormat.FromString,
60
+ _registered_method=True)
61
+
62
+
63
+ class AudioServiceServicer(object):
64
+ """Audio streaming service
65
+ Note: Sound chip state introspection moved to DebuggerControl.GetSoundChipState
66
+ """
67
+
68
+ def SubscribeAudio(self, request, context):
69
+ """Stream audio samples as they're generated
70
+ """
71
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
72
+ context.set_details('Method not implemented!')
73
+ raise NotImplementedError('Method not implemented!')
74
+
75
+ def GetAudioFormat(self, request, context):
76
+ """Get audio format metadata (how to interpret sample data)
77
+ """
78
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
79
+ context.set_details('Method not implemented!')
80
+ raise NotImplementedError('Method not implemented!')
81
+
82
+
83
+ def add_AudioServiceServicer_to_server(servicer, server):
84
+ rpc_method_handlers = {
85
+ 'SubscribeAudio': grpc.unary_stream_rpc_method_handler(
86
+ servicer.SubscribeAudio,
87
+ request_deserializer=audio__pb2.SubscribeAudioRequest.FromString,
88
+ response_serializer=audio__pb2.AudioChunk.SerializeToString,
89
+ ),
90
+ 'GetAudioFormat': grpc.unary_unary_rpc_method_handler(
91
+ servicer.GetAudioFormat,
92
+ request_deserializer=audio__pb2.GetAudioFormatRequest.FromString,
93
+ response_serializer=audio__pb2.AudioFormat.SerializeToString,
94
+ ),
95
+ }
96
+ generic_handler = grpc.method_handlers_generic_handler(
97
+ 'beebium.AudioService', rpc_method_handlers)
98
+ server.add_generic_rpc_handlers((generic_handler,))
99
+ server.add_registered_method_handlers('beebium.AudioService', rpc_method_handlers)
100
+
101
+
102
+ # This class is part of an EXPERIMENTAL API.
103
+ class AudioService(object):
104
+ """Audio streaming service
105
+ Note: Sound chip state introspection moved to DebuggerControl.GetSoundChipState
106
+ """
107
+
108
+ @staticmethod
109
+ def SubscribeAudio(request,
110
+ target,
111
+ options=(),
112
+ channel_credentials=None,
113
+ call_credentials=None,
114
+ insecure=False,
115
+ compression=None,
116
+ wait_for_ready=None,
117
+ timeout=None,
118
+ metadata=None):
119
+ return grpc.experimental.unary_stream(
120
+ request,
121
+ target,
122
+ '/beebium.AudioService/SubscribeAudio',
123
+ audio__pb2.SubscribeAudioRequest.SerializeToString,
124
+ audio__pb2.AudioChunk.FromString,
125
+ options,
126
+ channel_credentials,
127
+ insecure,
128
+ call_credentials,
129
+ compression,
130
+ wait_for_ready,
131
+ timeout,
132
+ metadata,
133
+ _registered_method=True)
134
+
135
+ @staticmethod
136
+ def GetAudioFormat(request,
137
+ target,
138
+ options=(),
139
+ channel_credentials=None,
140
+ call_credentials=None,
141
+ insecure=False,
142
+ compression=None,
143
+ wait_for_ready=None,
144
+ timeout=None,
145
+ metadata=None):
146
+ return grpc.experimental.unary_unary(
147
+ request,
148
+ target,
149
+ '/beebium.AudioService/GetAudioFormat',
150
+ audio__pb2.GetAudioFormatRequest.SerializeToString,
151
+ audio__pb2.AudioFormat.FromString,
152
+ options,
153
+ channel_credentials,
154
+ insecure,
155
+ call_credentials,
156
+ compression,
157
+ wait_for_ready,
158
+ timeout,
159
+ metadata,
160
+ _registered_method=True)