stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
  liftIO $ stopPlayingSong pb
  return (updateAppStatus app Stop playPos) { playback = Nothing }
  where
    stopPlayingSong (Playback _ playProc _ _ threadId) = do
      AP.stop playProc
      killThread threadId


-- | Fetches song info, plays it, and starts a thread to advance the playhead.
stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
  liftIO $ stopPlayingSong pb
  return (updateAppStatus app Stop playPos) { playback = Nothing }
  where
    stopPlayingSong (Playback _ playProc _ _ threadId) = do
      AP.stop playProc
      killThread threadId


-- | Fetches song info, plays it, and starts a thread to advance the playhead.
stop app@(PlayerApp _ _ _ (Just pb@(Playback playPos _ _ _ _))) = do
  liftIO $ stopPlayingSong pb
  return (updateAppStatus app Stop playPos) { playback = Nothing }
  where
    stopPlayingSong (Playback _ playProc _ _ threadId) = do
      AP.stop playProc
      killThread threadId


-- | Fetches song info, plays it, and starts a thread to advance the playhead.