mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
My theory is that it's ok to send the `noidle` synchronously but the subsequent handling of the idle response should be on the command queue. My hope is that this fixes issues with less than perfect network connections (and also very occasionally seen on good networks).
30 lines
598 B
Swift
30 lines
598 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 connectionOperation: BlockOperation!
|
|
|
|
var delegate: MPDClientDelegate?
|
|
|
|
var connection: OpaquePointer?
|
|
var isConnected: Bool = false
|
|
var isIdle: Bool = false
|
|
var status: MPDStatus?
|
|
var queue: [MPDSong] = []
|
|
|
|
let commandQueue = OperationQueue()
|
|
|
|
init(withDelegate delegate: MPDClientDelegate?) {
|
|
commandQueue.maxConcurrentOperationCount = 1
|
|
self.delegate = delegate
|
|
}
|
|
}
|