Runs SwiftLint and adds back OpenGLES

This commit is contained in:
Joe Diragi 2022-04-30 19:34:11 -04:00
parent a6bcd668d5
commit b43abf1548
3 changed files with 562 additions and 567 deletions

View File

@ -16,7 +16,6 @@ let INADDR_BROADCAST = in_addr(s_addr: 0xFFFF_FFFF)
/// An object representing the UDP broadcast connection. Uses a dispatch source to handle the incoming traffic on the UDP socket. /// An object representing the UDP broadcast connection. Uses a dispatch source to handle the incoming traffic on the UDP socket.
open class UDPBroadcastConnection { open class UDPBroadcastConnection {
// MARK: Properties // MARK: Properties
/// The address of the UDP socket. /// The address of the UDP socket.
@ -80,7 +79,6 @@ open class UDPBroadcastConnection {
/// ///
/// - Throws: Throws a `ConnectionError` if an error occurs. /// - Throws: Throws a `ConnectionError` if an error occurs.
fileprivate func createSocket() throws { fileprivate func createSocket() throws {
// Create new socket // Create new socket
let newSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) let newSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
guard newSocket > 0 else { throw ConnectionError.createSocketFailed } guard newSocket > 0 else { throw ConnectionError.createSocketFailed }
@ -98,9 +96,9 @@ open class UDPBroadcastConnection {
if shouldBeBound { if shouldBeBound {
var saddr = sockaddr(sa_len: 0, sa_family: 0, var saddr = sockaddr(sa_len: 0, sa_family: 0,
sa_data: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) sa_data: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
self.address.sin_addr = INADDR_ANY address.sin_addr = INADDR_ANY
memcpy(&saddr, &self.address, MemoryLayout<sockaddr_in>.size) memcpy(&saddr, &address, MemoryLayout<sockaddr_in>.size)
self.address.sin_addr = INADDR_BROADCAST address.sin_addr = INADDR_BROADCAST
let isBound = bind(newSocket, &saddr, socklen_t(MemoryLayout<sockaddr_in>.size)) let isBound = bind(newSocket, &saddr, socklen_t(MemoryLayout<sockaddr_in>.size))
if isBound == -1 { if isBound == -1 {
debugPrint("Couldn't bind socket") debugPrint("Couldn't bind socket")
@ -226,7 +224,7 @@ open class UDPBroadcastConnection {
source.cancel() source.cancel()
responseSource = nil responseSource = nil
} }
if shouldBeBound && reopen { if shouldBeBound, reopen {
dispatchQueue.async { dispatchQueue.async {
do { do {
try self.createSocket() try self.createSocket()
@ -292,7 +290,6 @@ open class UDPBroadcastConnection {
// Copyright © 2019 Gunter Hager. All rights reserved. // Copyright © 2019 Gunter Hager. All rights reserved.
// //
public extension UDPBroadcastConnection { public extension UDPBroadcastConnection {
enum ConnectionError: Error { enum ConnectionError: Error {
// Creating socket // Creating socket
case createSocketFailed case createSocketFailed

View File

@ -11,7 +11,6 @@ import SwiftUI
// TODO: Needs replacement/reworking // TODO: Needs replacement/reworking
struct SmallMediaStreamSelectionView: View { struct SmallMediaStreamSelectionView: View {
enum Layer: Hashable { enum Layer: Hashable {
case subtitles case subtitles
case audio case audio
@ -68,11 +67,9 @@ struct SmallMediaStreamSelectionView: View {
.frame(height: 300) .frame(height: 300)
VStack { VStack {
Spacer() Spacer()
HStack { HStack {
// MARK: Subtitle Header // MARK: Subtitle Header
Button { Button {
@ -220,19 +217,19 @@ struct SmallMediaStreamSelectionView: View {
} }
} }
if updateFocusedLayer == .subtitles && lastFocusedLayer == .subtitles { if updateFocusedLayer == .subtitles, lastFocusedLayer == .subtitles {
// MARK: Subtitles // MARK: Subtitles
subtitleMenuView subtitleMenuView
} else if updateFocusedLayer == .audio && lastFocusedLayer == .audio { } else if updateFocusedLayer == .audio, lastFocusedLayer == .audio {
// MARK: Audio // MARK: Audio
audioMenuView audioMenuView
} else if updateFocusedLayer == .playbackSpeed && lastFocusedLayer == .playbackSpeed { } else if updateFocusedLayer == .playbackSpeed, lastFocusedLayer == .playbackSpeed {
// MARK: Playback Speed // MARK: Playback Speed
playbackSpeedMenuView playbackSpeedMenuView
} else if updateFocusedLayer == .chapters && lastFocusedLayer == .chapters { } else if updateFocusedLayer == .chapters, lastFocusedLayer == .chapters {
// MARK: Chapters // MARK: Chapters
chaptersMenuView chaptersMenuView
@ -336,7 +333,6 @@ struct SmallMediaStreamSelectionView: View {
.buttonStyle(CardButtonStyle()) .buttonStyle(CardButtonStyle())
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text(viewModel.chapters[chapterIndex].name ?? L10n.noTitle) Text(viewModel.chapters[chapterIndex].name ?? L10n.noTitle)
.font(.subheadline) .font(.subheadline)
.fontWeight(.semibold) .fontWeight(.semibold)

View File

@ -191,6 +191,7 @@
62666E2127E501E400EC0ECD /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2027E501E400EC0ECD /* CoreVideo.framework */; }; 62666E2127E501E400EC0ECD /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2027E501E400EC0ECD /* CoreVideo.framework */; };
62666E2327E501EB00EC0ECD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2227E501EB00EC0ECD /* Foundation.framework */; }; 62666E2327E501EB00EC0ECD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2227E501EB00EC0ECD /* Foundation.framework */; };
62666E2427E501F300EC0ECD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5362E4BC267D40D8000E2F71 /* Foundation.framework */; }; 62666E2427E501F300EC0ECD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5362E4BC267D40D8000E2F71 /* Foundation.framework */; };
62666E2A27E5020A00EC0ECD /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2927E5020A00EC0ECD /* OpenGLES.framework */; };
62666E2C27E5021000EC0ECD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2B27E5021000EC0ECD /* QuartzCore.framework */; }; 62666E2C27E5021000EC0ECD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2B27E5021000EC0ECD /* QuartzCore.framework */; };
62666E2E27E5021400EC0ECD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2D27E5021400EC0ECD /* Security.framework */; }; 62666E2E27E5021400EC0ECD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2D27E5021400EC0ECD /* Security.framework */; };
62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2F27E5021800EC0ECD /* VideoToolbox.framework */; }; 62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2F27E5021800EC0ECD /* VideoToolbox.framework */; };
@ -894,6 +895,7 @@
62666DFA27E5013700EC0ECD /* TVVLCKit.xcframework in Frameworks */, 62666DFA27E5013700EC0ECD /* TVVLCKit.xcframework in Frameworks */,
62666E3227E5021E00EC0ECD /* UIKit.framework in Frameworks */, 62666E3227E5021E00EC0ECD /* UIKit.framework in Frameworks */,
E1218C9E271A2CD600EA0737 /* CombineExt in Frameworks */, E1218C9E271A2CD600EA0737 /* CombineExt in Frameworks */,
62666E2A27E5020A00EC0ECD /* OpenGLES.framework in Frameworks */,
E1002B6B2793E36600E47059 /* Algorithms in Frameworks */, E1002B6B2793E36600E47059 /* Algorithms in Frameworks */,
62666E1D27E501DB00EC0ECD /* CoreMedia.framework in Frameworks */, 62666E1D27E501DB00EC0ECD /* CoreMedia.framework in Frameworks */,
62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */, 62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */,