Restructured the source code in the Playdate bindings target.

This commit is contained in:
2026-07-25 12:40:14 +02:00
parent 2e7ee12ec1
commit b435a6e8bd
106 changed files with 3754 additions and 3746 deletions
@@ -0,0 +1,20 @@
internal import CPlaydate
extension Sound {
/// The format of sample data.
public enum Format: UInt32, Sendable {
case mono8bit = 0
case stereo8bit = 1
case mono16bit = 2
case stereo16bit = 3
case monoADPCM = 4
case stereoADPCM = 5
init(_ format: SoundFormat) { self = Format(rawValue: UInt32(format.rawValue)) ?? .mono16bit }
var cValue: SoundFormat { SoundFormat(SoundFormat.RawValue(rawValue)) }
public var isStereo: Bool { rawValue & 1 != 0 }
public var is16bit: Bool { rawValue >= 2 && rawValue < 4 }
public var bytesPerFrame: Int { Int(SoundFormat_bytesPerFrame(cValue)) }
}
}
@@ -0,0 +1,8 @@
extension Sound {
/// The microphone used when recording.
public enum MicSource: UInt32, Sendable {
case autodetect = 0
case internalMic = 1
case headset = 2
}
}