1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00
persephone/Persephone/MPDClient/MPDClient.swift
Dan Barber 11be238788
Address PR feedback
* Use the OperationQueue's `operationCount` function instead of keeping
count ourselves. This is reliable now each command is entirely self
contained.

* Rename `queueCommand` to `enqueueCommand`

* Move the command Enum into its own model file

* Move the `enqueueCommand` function into MPDClient+Command
2019-03-20 20:06:24 -04:00

28 lines
548 B
Swift

//
// MPDClient.swift
// Persephone
//
// Created by Daniel Barber on 2019/1/25.
// Copyright © 2019 Dan Barber. All rights reserved.
//
import Foundation
import mpdclient
class MPDClient {
var delegate: MPDClientDelegate?
var connection: OpaquePointer?
var isConnected: Bool = false
var isIdle: Bool = false
var status: Status?
var queue: [Song] = []
let commandQueue = OperationQueue()
init(withDelegate delegate: MPDClientDelegate?) {
commandQueue.maxConcurrentOperationCount = 1
self.delegate = delegate
}
}