project-owner / Peppy

Peppy Player Repository
GNU General Public License v3.0
72 stars 14 forks source link

Removing items on lower menu #34

Closed maltejahn closed 1 year ago

maltejahn commented 1 year ago

Hi,

i would like to build a music player for my daughter. I can remove things from the home screen, but i havent found a way to remove entrys from the lower menu like "show root folder". Even folders icon like "Parent folder", "Info" Button or "Sorting" are way too much for her.

For now, there is only the "Audio Files" entry available for her

And... one more wish: Is it possible to add a seconf "Audio Files" entry. So with one button there would be "Music", with the other it would be "Audio books". Somehow I feel hat would be easier instead of explaining what a folder structure is

project-owner commented 1 year ago

Hi,

Unfortunately there are no such configuration parameters which could hide those UI components. It looks like there is a need to enable/disable components for each UI screen. I'll try to implement that in the next release. To do that right now you need to change several source files.

To disable the Order and Info popups make these two changes:

You can disable the file navigator buttons by commenting corresponding lines in this file: https://github.com/project-owner/Peppy/blob/0655be5202ecfef5de712ca4953353a47556b26b/ui/navigator/file.py#L35 For example to disable all buttons but Home and Player:

        # self.add_button(items, KEY_LIST, None, [listeners[KEY_LIST]])
        # self.add_button(items, KEY_USER_HOME, None, [listeners[GO_USER_HOME]])
        # self.add_button(items, KEY_ROOT, None, [listeners[GO_ROOT]])
        # self.add_button(items, KEY_PARENT, None, [listeners[GO_TO_PARENT]])

It's more complicated with additional Audio Files mode. The closest what you can do now is to prepare a playlist (/home/pi/Peppy/playlists/streams.m3u) with files and re-use the Stream mode. Though it will not show the time control. I need to think what could be the best way to do that in the future.

Best regards

maltejahn commented 1 year ago

Thanks,

that worked great. For my daughter i have only multiples folders in the main music folder. So there is no need for her to navigate through multiple folder levels. I will try to build m3u playlists an add them to folders. Then i hide all other file types.

As for now, i put "Audiobooks" (a bunch of small mp3 files, normally every file has a Chapter Name+Number) into a directory.

Why cant I use the Audiobook entry to browse local files? I even thought about hosting a local feed.xml and play it as a Podcast. But that seems horrible to manage

I also build a m4b single file. In VLC (desktop app) i see chapters. After adding m4b as a possible audio extension in peppy, i can play the file. But cant see the chapters (i selected vlc as peppy player). I think vlc can handle this filetype well, but chapter handling for m4b files isnt implemented in peppy right now?

I there also a way to only show the volume control slider?

Thanks for your support

Edit: i used AudioBookConverter: https://github.com/yermak/AudioBookConverter

project-owner commented 1 year ago

Hi,

Making playlists is probably the easiest way to handle your use case. I'm not sure what could be the best way to implement this kind of requirement. I was thinking about 'Sandbox' file player, where user could create multiple Sandbox players each of them could work only with specific folder. When you create such player you could define the folder and player names. Then in the Home menu you could see those players under the names which you defined. For example in the Home Menu you could see such Sandbox players as 'Music' (which would work only with folder '/home/pi/musuc' or any other defined during player creation) and 'Audiobooks' (/home/pi/audiobooks).

Right now 'Audiobooks' mode can stream only LibriVox audiobooks.

m4b is a specific Apple format. Peppy player currently doesn't handle m4b metadata. For now I'd recommend to use mp3 files and playlists. This is more generic approach. I'll check if it's possible to support m4b metadata in the player. Probably the 'mutagen' library used by the player can provide access to that metadata (chapters etc).

It needs too many changes to disable the time control in the file player. You can just make the volume control visible by default instead of the time control. To do that add these two lines:

        self.custom_button.draw_state(1)
        self.toggle_time_volume()

after this line: https://github.com/project-owner/Peppy/blob/0655be5202ecfef5de712ca4953353a47556b26b/ui/player/fileplayer.py#L79

Best regards

maltejahn commented 1 year ago

Hi,

i think thats good as it is right now. It just confuses here that she sees the "time icon" when she wants to change volume.

M4B -> was just a google hit. I keep going with m3u

Thanks for the help

project-owner commented 1 year ago

Sure