Demo stream settings

This commit is contained in:
Ali
2021-02-27 00:39:47 +04:00
parent 64d5e51934
commit e33eb8db32
4 changed files with 31 additions and 23 deletions

View File

@@ -15,6 +15,7 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
public var disableVideoAspectScaling: Bool
public var enableVoipTcp: Bool
public var snapPinListToTop: Bool
public var demoAudioStream: Bool
public static var defaultSettings: ExperimentalUISettings {
return ExperimentalUISettings(
@@ -29,7 +30,8 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
preferredVideoCodec: nil,
disableVideoAspectScaling: false,
enableVoipTcp: false,
snapPinListToTop: false
snapPinListToTop: false,
demoAudioStream: false
)
}
@@ -45,7 +47,8 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
preferredVideoCodec: String?,
disableVideoAspectScaling: Bool,
enableVoipTcp: Bool,
snapPinListToTop: Bool
snapPinListToTop: Bool,
demoAudioStream: Bool
) {
self.keepChatNavigationStack = keepChatNavigationStack
self.skipReadHistory = skipReadHistory
@@ -59,6 +62,7 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
self.disableVideoAspectScaling = disableVideoAspectScaling
self.enableVoipTcp = enableVoipTcp
self.snapPinListToTop = snapPinListToTop
self.demoAudioStream = demoAudioStream
}
public init(decoder: PostboxDecoder) {
@@ -74,6 +78,7 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
self.disableVideoAspectScaling = decoder.decodeInt32ForKey("disableVideoAspectScaling", orElse: 0) != 0
self.enableVoipTcp = decoder.decodeInt32ForKey("enableVoipTcp", orElse: 0) != 0
self.snapPinListToTop = decoder.decodeInt32ForKey("snapPinListToTop", orElse: 0) != 0
self.demoAudioStream = decoder.decodeInt32ForKey("demoAudioStream", orElse: 0) != 0
}
public func encode(_ encoder: PostboxEncoder) {
@@ -91,6 +96,7 @@ public struct ExperimentalUISettings: Equatable, PreferencesEntry {
encoder.encodeInt32(self.disableVideoAspectScaling ? 1 : 0, forKey: "disableVideoAspectScaling")
encoder.encodeInt32(self.enableVoipTcp ? 1 : 0, forKey: "enableVoipTcp")
encoder.encodeInt32(self.snapPinListToTop ? 1 : 0, forKey: "snapPinListToTop")
encoder.encodeInt32(self.demoAudioStream ? 1 : 0, forKey: "demoAudioStream")
}
public func isEqual(to: PreferencesEntry) -> Bool {