gillesdemey / Cumulus

☁️ A SoundCloud player that lives in your menubar.
http://gillesdemey.github.io/Cumulus
MIT License
1.43k stars 123 forks source link

Show Cumulus window at current sound when clicking OSX notification #44

Closed andersfischernielsen closed 2 years ago

andersfischernielsen commented 8 years ago

It'd be awesome if the Cumulus window would appear displaying the current sound playing when the user clicks the "sound changed" OS notification (I don't know if Windows shows a similar notification).

screen shot 2016-01-21 at 10 26 04

The feature could, as far as I can see, be implemented by displaying the Cumulus window as-is, since the currently playing sound is already in focus there.

andersfischernielsen commented 8 years ago

It seems like the app uses default Electron notifications.

//Found in "currentTrackStore.js"

function _showNotification(track) {
  if (document.visibilityState !== 'hidden') return
  new window.Notification(track.user.username, {
    body : track.title,
    icon : track.artwork_url,
  })
}

OnClick-events are supported by using:

var myNotification = new Notification('Title', {
  body: 'Lorem Ipsum Dolor Sit Amet'
});

myNotification.onclick = function () {
  console.log('Notification clicked')
}

https://github.com/atom/electron/blob/master/docs/tutorial/desktop-environment-integration.md#notifications-windows-linux-os-x 
rnarian commented 8 years ago

The problem remains if you skip a few tracks (via the media keys) and open up the app again. Wouldn't it make more sense if the app automatically scrolls to the current playing track whenever I focus the app window. This should solve @andersfischernielsens issue as well?