jhe2 / gmu

The Gmu Music Player
GNU General Public License v2.0
23 stars 16 forks source link

[Feature Request] FileBrowserPlayFileOrChDir in keymap #14

Closed schmurtzm closed 9 months ago

schmurtzm commented 9 months ago

Describe the bug Hi, in file browser it's not possible to map the same key for playing a file and navigate in folders. It is often useful when you want to play just one track which is in a sub directory. Switching between 2 different buttons to open a folder and launching the playing of a file doesn't seems intuitive for this king of use (without using the playlist). So having a new option FileBrowserPlayFileOrChDir (similar to the existing FileBrowserAddFileToPlaylistOrChDir) could be really useful.

To Reproduce Steps to reproduce the behavior:

  1. Go in FileBrowser and try to run a mp3 file located in a subfolder
  2. You'll need to press one button to open the folder and another one to open the file.

Expected behavior Be able to open a folder with the same button as to play a file. Which means that there could be potentially 2 buttons which allows to open folders if we use these 2 options :

FileBrowserAddFileToPlaylistOrChDir=X
FileBrowserPlayFileOrChDir=A

Additional context Thanks for this great software !

jhe2 commented 9 months ago

I can see how this could be useful. I'll implement that soon.

schmurtzm commented 9 months ago

It's more than "soon", you're fast ! I'll try that tonight, thank you !

schmurtzm commented 9 months ago

@jhe2 Doesn't seems to work on my side, FileBrowserPlayFileOrChDir has no action 🤔

jhe2 commented 9 months ago

@jhe2 Doesn't seems to work on my side, FileBrowserPlayFileOrChDir has no action 🤔

Interesting. If you run Gmu with FileBrowserPlayFileOrChDir enabled in your keymap file, did you remove or comment out FileBrowserPlayFile at the same time? While this shouldn't break functionality it would possibly hide the information about that keymapping in Gmu's file browser UI. If so, do you see the keymapping being mentioned at the bottom of the screen in the file browser (e.g. A:Play file/Ch.dir)?

Since I made this option the default in Gmu's default configuration, it works fine for me if I check out a new copy of the source and build it with everything at default…

schmurtzm commented 9 months ago

It was my fault : I didn't catch the modularity of GMU : sdl.so must be updated to support the new keymap option. It's working as it should, thanks a lot for the fast modification !