Skip to content

Commit

Permalink
fix build on M1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed May 1, 2023
1 parent cf528c6 commit 9693a08
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 97 deletions.
3 changes: 1 addition & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# binary "https://code.videolan.org/videolan/VLCKit/raw/master/Packaging/VLCKit.json" ~> 3.3.0
binary "./VLCKit.json" ~> 3.3.0
binary "https://code.videolan.org/videolan/VLCKit/raw/master/Packaging/VLCKit.json" == 3.4.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
binary "./VLCKit.json" "3.3.18"
binary "https://code.videolan.org/videolan/VLCKit/raw/master/Packaging/VLCKit.json" "3.4.0"
8 changes: 4 additions & 4 deletions MoeStreamer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,15 @@
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
"$(PROJECT_DIR)/Carthage/Build/",
);
INFOPLIST_FILE = "$(SRCROOT)/MoeStreamer/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.12;
MARKETING_VERSION = 0.17.13;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
Expand All @@ -700,15 +700,15 @@
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
"$(PROJECT_DIR)/Carthage/Build/",
);
INFOPLIST_FILE = "$(SRCROOT)/MoeStreamer/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.12;
MARKETING_VERSION = 0.17.13;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,79 +1,77 @@
{
"object": {
"pins": [
{
"package": "Socket",
"repositoryURL": "https://github.com/Kitura/BlueSocket",
"state": {
"branch": null,
"revision": "c9894fd117457f1d006575fbfb2fdfd6f79eac03",
"version": "1.0.200"
}
},
{
"package": "Deque",
"repositoryURL": "https://github.com/attaswift/Deque.git",
"state": {
"branch": null,
"revision": "0ad91ef4c8cb7e86f5bd3e8518a61080515120dc",
"version": "3.1.1"
}
},
{
"package": "Just",
"repositoryURL": "https://github.com/dduan/Just.git",
"state": {
"branch": null,
"revision": "1824bf84cf52d11d69ae20cfb89f0ce5bffa5650",
"version": "0.8.0"
}
},
{
"package": "KeychainSwift",
"repositoryURL": "https://github.com/evgenyneu/keychain-swift.git",
"state": {
"branch": null,
"revision": "96fb84f45a96630e7583903bd7e08cf095c7a7ef",
"version": "19.0.0"
}
},
{
"package": "Starscream",
"repositoryURL": "https://github.com/daltoniam/Starscream.git",
"state": {
"branch": null,
"revision": "e6b65c6d9077ea48b4a7bdda8994a1d3c6969c8d",
"version": "3.1.1"
}
},
{
"package": "swift-nio-zlib-support",
"repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git",
"state": {
"branch": null,
"revision": "37760e9a52030bb9011972c5213c3350fa9d41fd",
"version": "1.0.0"
}
},
{
"package": "Introspect",
"repositoryURL": "https://github.com/siteline/SwiftUI-Introspect.git",
"state": {
"branch": null,
"revision": "de5c32c15ae169cfcb27397ffb2734dcd0e1e6d5",
"version": "0.1.0"
}
},
{
"package": "SwiftyJSON",
"repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state": {
"branch": null,
"revision": "2b6054efa051565954e1d2b9da831680026cd768",
"version": "5.0.0"
}
"pins" : [
{
"identity" : "bluesocket",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Kitura/BlueSocket",
"state" : {
"revision" : "c9894fd117457f1d006575fbfb2fdfd6f79eac03",
"version" : "1.0.200"
}
]
},
"version": 1
},
{
"identity" : "deque",
"kind" : "remoteSourceControl",
"location" : "https://github.com/attaswift/Deque.git",
"state" : {
"revision" : "0ad91ef4c8cb7e86f5bd3e8518a61080515120dc",
"version" : "3.1.1"
}
},
{
"identity" : "just",
"kind" : "remoteSourceControl",
"location" : "https://github.com/dduan/Just.git",
"state" : {
"revision" : "1824bf84cf52d11d69ae20cfb89f0ce5bffa5650",
"version" : "0.8.0"
}
},
{
"identity" : "keychain-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"state" : {
"revision" : "96fb84f45a96630e7583903bd7e08cf095c7a7ef",
"version" : "19.0.0"
}
},
{
"identity" : "starscream",
"kind" : "remoteSourceControl",
"location" : "https://github.com/daltoniam/Starscream.git",
"state" : {
"revision" : "e6b65c6d9077ea48b4a7bdda8994a1d3c6969c8d",
"version" : "3.1.1"
}
},
{
"identity" : "swift-nio-zlib-support",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-zlib-support.git",
"state" : {
"revision" : "37760e9a52030bb9011972c5213c3350fa9d41fd",
"version" : "1.0.0"
}
},
{
"identity" : "swiftui-introspect",
"kind" : "remoteSourceControl",
"location" : "https://github.com/siteline/SwiftUI-Introspect.git",
"state" : {
"revision" : "de5c32c15ae169cfcb27397ffb2734dcd0e1e6d5",
"version" : "0.1.0"
}
},
{
"identity" : "swiftyjson",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state" : {
"revision" : "2b6054efa051565954e1d2b9da831680026cd768",
"version" : "5.0.0"
}
}
],
"version" : 2
}
10 changes: 5 additions & 5 deletions MoeStreamer/src/audio/StreamAudioController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class StreamAudioController : NSObject, AudioController, VLCMediaPlayerDelegate
private func reset()
{
self.vlcMP.media = VLCMedia(url: self.streamUrl)
self.vlcMP.media.addOptions([ "network-caching": self.streamBuffer ])
self.vlcMP.media?.addOptions([ "network-caching": self.streamBuffer ])

let vol: Int = Settings.get(.audioVolume())
self.vlcMP.audio.volume = self.muted ? 0 : Int32(vol)
self.vlcMP.audio?.volume = self.muted ? 0 : Int32(vol)

self.stopped = false
}
Expand All @@ -51,7 +51,7 @@ class StreamAudioController : NSObject, AudioController, VLCMediaPlayerDelegate

if !self.muted {
// only actually change the volume if we aren't muted.
self.vlcMP.audio.volume = Int32(scaledVol)
self.vlcMP.audio?.volume = Int32(scaledVol)
}
}

Expand All @@ -68,7 +68,7 @@ class StreamAudioController : NSObject, AudioController, VLCMediaPlayerDelegate
func mute()
{
self.muted = true
self.vlcMP.audio.volume = 0
self.vlcMP.audio?.volume = 0

Settings.set(.audioMuted(), value: true)
}
Expand Down Expand Up @@ -108,7 +108,7 @@ class StreamAudioController : NSObject, AudioController, VLCMediaPlayerDelegate



func mediaPlayerStateChanged(_ notif: Notification!)
func mediaPlayerStateChanged(_ notif: Notification)
{
switch self.vlcMP.state
{
Expand Down
12 changes: 6 additions & 6 deletions MoeStreamer/src/discord/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class DiscordRPC
}

// handshake.
if !socket.send(opcode: .Handshake, json: JSON([ "v": DiscordRPC.rpcVersion, "client_id": self.clientId ])) {
if !socket.send(opcode: .Handshake, json: JSON([ "v": DiscordRPC.rpcVersion, "client_id": self.clientId ] as [String: Any])) {
Logger.log("discord", msg: "handshake failed")
return false
}
Expand Down Expand Up @@ -299,12 +299,12 @@ class DiscordRPC
"assets": [
"large_image": (asset != nil) ? "album-art-\(asset!.hash)" : "default-cover",
"large_text": song.title
],
] as [String: Any],
"timestamps": ts == -1 ? [String: Any]() : [
"end": ts
]
]
]
] as [String: Any]
] as [String: Any]
] as [String: Any]
]
}

Expand Down Expand Up @@ -357,7 +357,7 @@ class DiscordRPC
"image": base64,
"name": "album-art-\(albumHash.hexString)",
"type": 1
], headers: ["Authorization": token])
] as [String: Any], headers: ["Authorization": token])

guard let status = resp.statusCode, let body = resp.text, (200...299).contains(status) else {
Logger.log("discord", msg: "failed to upload art; error: \(resp.text ?? "none")")
Expand Down
3 changes: 0 additions & 3 deletions VLCKit.json

This file was deleted.

0 comments on commit 9693a08

Please sign in to comment.