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

View File

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

View File

@ -191,6 +191,7 @@
62666E2127E501E400EC0ECD /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2027E501E400EC0ECD /* CoreVideo.framework */; };
62666E2327E501EB00EC0ECD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2227E501EB00EC0ECD /* 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 */; };
62666E2E27E5021400EC0ECD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2D27E5021400EC0ECD /* Security.framework */; };
62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62666E2F27E5021800EC0ECD /* VideoToolbox.framework */; };
@ -894,6 +895,7 @@
62666DFA27E5013700EC0ECD /* TVVLCKit.xcframework in Frameworks */,
62666E3227E5021E00EC0ECD /* UIKit.framework in Frameworks */,
E1218C9E271A2CD600EA0737 /* CombineExt in Frameworks */,
62666E2A27E5020A00EC0ECD /* OpenGLES.framework in Frameworks */,
E1002B6B2793E36600E47059 /* Algorithms in Frameworks */,
62666E1D27E501DB00EC0ECD /* CoreMedia.framework in Frameworks */,
62666E3027E5021800EC0ECD /* VideoToolbox.framework in Frameworks */,