Skip to content

Commit

Permalink
additional AppleScript removal
Browse files Browse the repository at this point in the history
refer to #74
  • Loading branch information
vincentneo committed Mar 28, 2023
1 parent a95d968 commit 783b5f1
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions Quality/OutputDevices.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,6 @@ class OutputDevices: ObservableObject {
return nil
}

let appleScriptQueue = DispatchQueue(label: "AppleScriptQueue")

func getSampleRateFromAppleScript(_ completion: @escaping (Double?) -> ()) {
let scriptContents = "tell application \"Music\" to get sample rate of current track"
var error: NSDictionary?

self.appleScriptQueue.async {
if let script = NSAppleScript(source: scriptContents) {
let output = script.executeAndReturnError(&error).stringValue
var dOutput: Double?

defer {
completion(dOutput)
}

if let error = error {
print("[APPLESCRIPT] - \(error)")
}
guard let output = output else { return }

if output == "missing value" {
return
}
else {
dOutput = Double(output)
}
}
}
}

func getAllStats() -> [CMPlayerStats] {
var allStats = [CMPlayerStats]()

Expand Down

0 comments on commit 783b5f1

Please sign in to comment.