 
     private var audioController: AudioController!
 
+    private var isPlaying: Bool = false
+    private var currentPlaybackAttempt: Int = 0
+
     private var togglePlaybackMenuItemTitle: String?
     private var togglePlaybackMenuItemIsEnabled: Bool?
+
+    // MARK: -
 
     override func viewDidLoad() {
         super.viewDidLoad()

        return AudioController(url: url, delegate: self, delegateQueue: DispatchQueue.main, makeSession: makeSession)
    }

    // MARK: Actions

    @IBAction func play(_ sender: NSButton) {
        log.info("User pressed play")
        toggle()
    }

    @IBAction func click(_ sender: NSGestureRecognizer) {
        log.info("User clicked inside the window")
        toggle()
    }

    @IBAction func togglePlayback(_ sender: NSMenuItem) {
        log.info("User invoked menu toggle")
        toggle()
    }

    // MARK: Action Implementations

    func toggle() {
        indicateUnavailability()
        audioController.playPause()
    }

    // MARK: Menu Items

    override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
        if menuItem.action == #selector(togglePlayback(_:)) {

        return super.validateMenuItem(menuItem)
    }

}
