1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00
persephone/Shared/MPDClient/MPDClient.swift
Dan Barber ff88aa8f5e Move the handle idle command into the command queue
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).
2021-12-05 19:10:12 -06:00

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
}
}