moe icon indicating copy to clipboard operation
moe copied to clipboard

Music player mode

Open tobimensch opened this issue 3 years ago • 0 comments

This will be my final proposal/feature request for the day. And for a while probably.

And it's the most non-necessary low priority one of the bunch.

But a cool one in my opinion, basically I think it would be awesome if moe was not just another vim, and instead provided some nice integration features that you'll never find in standard vim.

I used to use cmus for playing music from the command line with great success, I even used it through a openwrt router that was connected to my stereo. It worked flawlessly and actually I don't really understand why I stopped using it.

But I think it would be rather easy to reimplement in moe, because we already have filer mode, and it'd be very similar in many ways.

But instead of of directories you would have genres, artists and album names. And there would be a deep search for all the music on the current system. The most challenging part is keeping an index of all the music available on the current system, but this is also not that hard actually.

Ideas to make this work:

  • Use unix file tool to detect if a file is a music file or not
  • Detect music files by their file extension like mp3, ogg, wav, ...
  • Use unix find tool for searching through system quickly
  • Detect and use either one of vlc/mplayer/... to play the music files
  • use vim like navigation
  • use y to add file to the end of the playlist
  • use d in the playlist (similar to filer mode) to remove a file from the playlist
  • show artist name - album name (if such metadata exists, or else fall back to filename) instead of the filename
  • show duration in the playlist
  • one search function that searches the whole index (all music files that were found on your system)
  • one search function that works on the playlist and works with the ,/,n,N typical vim keys
  • using d on the playlist removes the file, but also yanks it, so you can insert it somewhere else with p
  • ctrl+u/ctrl+d/pgup/pgdown and so forth should work in the playlist and the index search alike
  • playback should be able to be stopped/resumed while editing text files as usual, :play :pause or possible commands that could be used for that.
  • playback should also be able to be stopped/resumed from outside, so either/or/both provide dbus interface/command line moe --play moe --pause.

This is a fun feature, but I assume that some of the lessons learned when implementing it would probably also help in some other areas of moe.

The obvious command for opening the music player would be: :music

In cmus there's a split window and the system wide index is in the left pane, while the playlist is in the right pane. This model works very well for cmus, so I suggest copying it wholeheartedly for moe's music mode, if there ever will be one.

Oh, and the music player should be application wide, meaning there shouldn't be one music player per moe instance, because obviously you can only listen to one song at a time, and you always want to pause/play the same playlist, no matter which moe editor instance you are running, no matter in which terminal you currently are. I mean, that should be obvious, but still I wanted to make it clear. The music player must be synchronized between all moe instances. When you open the playlist, it should always be the same one.

tobimensch avatar Jul 07 '20 20:07 tobimensch