GithubHelp home page GithubHelp logo

your-diary / ympd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from notandy/ympd

2.0 2.0 1.0 2.16 MB

A customized `ympd` with many new features like dark mode and cover art display.

License: GNU General Public License v2.0

CMake 0.93% CSS 0.81% JavaScript 33.17% C 58.82% HTML 4.24% Shell 1.23% Roff 0.32% Perl 0.40% Dockerfile 0.08%

ympd's Introduction

ympd++

This project is a fork of the original ympd. It seems the original has been abandoned; the last commit dates back to 2018 and numerous pull requests are ignored.

comparison
Fig: Comparison between the original ympd (left) and this ympd++ (right).

Development

Branches

We use customized branch as the main branch and keep master branch untouched.

References

Build

Without Installation

This builds the project and starts ympd in the foreground.

$ ./build.sh

With Installation

This builds the project and installs ympd.

$ ./build.sh --install

Requirements

See README_original.md.

Tested Environments

Build Environments

  • Raspbian Buster on Raspberry Pi 3

Server Environments

  • Raspbian Buster on Raspberry Pi 3

Client Environments

  • Firefox on Arch Linux

  • Firefox on Android

New Features

0. Index

  • Backward-Incompatible Changes

  • Keyboard Seek

  • Dark Mode

  • Informative Page Title

  • Cover Art Display

1. Backward-Incompatible Changes

  • and were used to go to the previous/next song, but now the keyboard bindings are changed to h and l respectively.

2. Keyboard Seek

You can seek the current song for seek_length seconds

  • with and keys

  • or by clicking / buttons (see the figure below).

The default value of seek_length is 5 and it can be increased/decreased

  • with and keys

  • or by clicking the button in which the value of seek_length is displayed (see the figure below).

seek buttons
Fig: Buttons for seeking. The numbered buttons are newly added.

3. Dark Mode

Dark mode is implemented and is enabled by default. You can toggle it by pressing D (i.e. Shift + d).

non dark mode dark mode
Fig. Non dark mode. Fig. Dark mode.

4. Informative Page Title

Now the page title is dynamically updated to the information of the current song. This is related to Issue 128.

informative page title
Fig: Page title with song information.

5. Cover Art Display

5.1. Explanation of This Feature

If cover_ympd.jpg file exists under the same directory in which the current song resides, it is displayed as a cover art. When you move to a different song, of course, the cover art display is automatically updated. See the figure below.

5.2. Requirements

  • The feature is disabled by default since it isn't very stable now. To enable it, change the value of SHOULD_ENABLE_COVER_ART macro to 1 in src/mpd_client.c.

  • The mpd's music_directory, which is normally set in /etc/mpd.conf, shall be /media/MUSIC/. If you'd like to use another directory, change the value of the macro __MPD_MUSIC_DIRECTORY in src/mpd_client.h and rebuild. This limitation comes from the fact that mpd_song_get_uri() returns a path relative to music_directory.

  • As described above, the name of cover arts shall be cover_ympd.jpg. And it is recommended they are small in size (e.g. <= 1MB) for a speedy operation. We supply helper_scripts/create_cover_art.sh script to recursively create cover_ympd.jpg files from cover.jpg and cover.png in the specified directory. Note it needs imagemagick. Usage:

$ cd helper_scripts && ./create_cover_art.sh <directory>

5.3. Implementation Details

ympd server communicates with a browser using WebSockets. To update information such as a song's title, the artist's name, etc., they are sent as a JSON string. We extend this implementation to incorporate a base64-encoded image file into the string.

cover art 1 dark mode
Fig. Cover art display. Fig. Another example of cover art display.

Known Bugs

  • Cover art display is unstable when ympd is accessed from multiple browsers at the same time. We cannot identify the cause yet. Current workaround: just reload the page.

ympd's People

Contributors

ajs124 avatar azrdev avatar benjaminhae avatar embhd avatar felixjogris avatar ffontaine avatar florianheinemann avatar govertbuijs avatar iwanders avatar jpleau avatar kamikazow avatar kernald avatar kingcody avatar kurt-vd avatar lesderid avatar mgax avatar nighoo avatar nofre avatar notandy avatar othmar52 avatar phmongeau avatar superbfg7 avatar thereverend403 avatar unknownloner avatar warhog avatar znetstar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

cakebread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.