GithubHelp home page GithubHelp logo

kimtore / pms Goto Github PK

View Code? Open in Web Editor NEW
249.0 11.0 23.0 3.27 MB

Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.

Home Page: https://ambientsound.github.io/pms/

License: MIT License

Makefile 0.35% Go 99.55% Shell 0.10%
mpd vim-like bleve golang console-application music-player-daemon interactive mpd-client

pms's Introduction

Practical Music Search

Build Status Go Report Card codecov License

Practical Music Search is an interactive console client for the Music Player Daemon, written in Go. Its interface is similar to Vim, and aims to be fast, configurable, and practical.

PMS has many features that involve sorting, searching, and navigating. It’s designed to let you navigate your music collection in an effective way. Some of the currently implemented features are:

  • Vim-style look and feel!
  • Can be configured to consume a very small amount of screen space.
  • MPD player controls: play, add, pause, stop, next, prev, volume.
  • Highly customizable top bar, tag headers, text styles, colors, and keyboard bindings.
  • Fast library search, featuring UTF-8 normalization, fuzzy search, and scoring.
  • Selecting songs, by visual mode, manual selection, and specific tags.
  • Many forms of tracklist manipulation, such as cut, copy, paste, filter, and sort.
  • Config files, tab completion, history, and much more!

Documentation

Documentation is available in the project repository.

Project status

NEWS: Development of PMS has resumed! We continue to appreciate contributions and strive to make PMS an ever better and continuously evolving MPD client.

This software was previously written in C++. The master branch now contains a rewrite, currently implemented in Go. The current goal of the Go implementation is to implement most of the features found in the 0.42 branch.

This functionality is present in the 0.42.x branch, but missing in master:

  • Automatically add songs to the queue when it is nearing end.
  • Remote playlist management.
  • ...and probably more.

Getting started

You’re assumed to have a working Go development environment. Building PMS requires Go version 1.13 or higher.

Assuming you have the go binary in your path, you can install PMS using:

git clone https://github.com/ambientsound/pms
cd pms
make install

This will put the binary in $GOBIN/pms, usually at ~/go/bin/pms. You need to run PMS in a regular terminal with a TTY.

If PMS crashes, and you want to report a bug, please include the debug log:

pms --debug /tmp/pms.log 2>>/tmp/pms.log

Requirements

PMS wants to build a search index from MPD's database. To be truly practical, PMS must support fuzzy matching, scoring, and sub-millisecond full-text searches. This is accomplished by using Bleve, a full-text search and indexing library.

A full-text search index takes up both space and memory. For a library of about 30 000 songs, you should expect using about 500 MB of disk space and around 1 GB of RAM.

PMS is multithreaded and benefits from multicore CPUs.

Contributing

See how to contribute to PMS.

Authors

Copyright (c) 2006-2022 Kim Tore Jensen <[email protected]>.

The source code and latest version can be found at Github: https://github.com/ambientsound/pms.

pms's People

Contributors

codesoap avatar dependabot[bot] avatar doughdemon avatar dvdmuckle avatar ephemeralriggs avatar hummer12007 avatar kimtore avatar lluixhi avatar mpereira avatar orangeturtle739 avatar simao avatar susnux avatar tremby avatar xaizek avatar xamebax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pms's Issues

Display/Sorting Issues

Updated over to the latest git head of both pms and libmpdclient. After the update, pms started to behave very interestingly: the tags it displays are wrong, for instance the track number is not displayed properly but in its stead some sort tag is shown. Moreover, the sorting seems wonky, too.

The picture below should illustrate these issues.
desktop

Latest master's build segfaulting on OS X 10.6.8 (Darwin 10.8.0)

This is happening with the code built on this head: @ace2b26e2b30e4a742e006c3e4e4cc80cfc19771

Starting program: /Users/murilo/git/pms/pms
Reading symbols for shared libraries ++++. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xfffffffffffffff8
0x00007fff862e1405 in std::string::_Rep::_M_dispose ()
(gdb) backtrace
#0  0x00007fff862e1405 in std::string::_Rep::_M_dispose ()
#1  0x00007fff862e2124 in std::string::assign ()
#2  0x000000010003a27e in Topbar::set ()
#3  0x0000000100007cba in Config::load_default_config ()
#4  0x0000000100007de2 in Config::Config ()
#5  0x000000010000380a in __static_initialization_and_destruction_0 ()
#6  0x00000001000038a3 in global constructors keyed to fieldtypes ()
#7  0x00007fff5fc0d510 in __dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE ()
#8  0x00007fff5fc0bcfc in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#9  0x00007fff5fc0bdb6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#10 0x00007fff5fc0211a in __dyld__ZN4dyld24initializeMainExecutableEv ()
#11 0x00007fff5fc06996 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ ()
#12 0x00007fff5fc016de in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl ()
#13 0x00007fff5fc01052 in __dyld__dyld_start ()

Songs get added to playlist when cycling through windows

  1. Go to the playlist window and clear it
  2. Press 't' to go to the library window
  3. Press 'T' to return to the playlist window

You should see that the first song of your library was added to the playlist. If you repeat steps 2 and 3 the second song of your library will be also added to the playlist. If you remove the first song and repeat the process the third song of your library will be added after the second, and so on.

Building PMS

Hi,

I'm using Slackware current x86_64 and experienced a couple of small issues with building PMS.

  1. CMake couldn't find ncurses

    [~/repos/pms]$ cmake .
    -- The CXX compiler identification is GNU
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Could NOT find Curses (missing:  CURSES_LIBRARY) 
    CMake Error at CMakeLists.txt:17 (message):
    PMS requires NCurses >= 5.0.
    

    Setting LD_LIBRARY_PATH didn't helped, so I had to specify path to the library explicitly:
    cmake -DCURSES_LIBRARY=/usr/lib64/libncurses.a .

  2. Linking error

    Linking CXX executable pms
    /usr/lib64/gcc/x86_64-slackware-linux/4.6.2/../../../../lib64/libncurses.a(lib_mouse.o): In function `load_gpm_library':
    lib_mouse.c:(.text+0x50a): undefined reference to `dlopen'
    lib_mouse.c:(.text+0x534): undefined reference to `dlsym'
    lib_mouse.c:(.text+0x55c): undefined reference to `dlsym'
    ...
    

    To solve this I modified the last line of CMakeLists.txt:
    target_link_libraries(pms ${CURSES_LIBRARIES} dl)

It's strange that CMake fails to find needed libraries, maybe CMakeLists.txt should be improved somehow. Anyway, I just wanted to ease building for other people, who wants to try development version.

Sorting Fallbacks

Hey,

Is it possible to add some sort of sorting fallbacks, e.g. if a track does not have "albumartistsort" tag, it will treat "artistsort" or "artist" tag as one. The version I used (some really old version from the SourceForge git repository that has now been removed) did this, I think. Currently, the default options mess up the sorting if there is no "albumartistsort" tag. I have tried tinkering around with different sort options but each of them naturally presented their own problems (e.g. sorting only by artists does not sort properly albums with multiple artists.)

On a different note, nice to see some action on this one. I've been using this exclusively for I don't even know how many years. Still remember joining the IRC channel back in the day to ask for the "add-all" option!:D

'add-to' becomes 'add'

If one doesn’t select a playlist when using add-to, and instead change to the playlist or library window, the next time add-to is being used it acts like add
I came over this when I didn’t want to add the song to an playlist after all. What about an “Cancel”-option above or under the list of playlists?

move-home doesn't jump to top of list

Expected behaviour: move-home jumps to topmost title in list.
Observed behavior: move-home jumps to currently playing (highlighted title).

move-end does behave as expected, i.e. it jumps to the bottom of the list.

Cursor high/middle/low

It'd be nice to have commands to send the cursor high/middle/low, like H, M, L in vim (i.e. top, middle, and bottom of current viewport).

The add command sometimes gets stuck always adding the same song

Steps to reproduce:

  1. Start PMS
  2. Switch to library view
  3. Add a song with :add or a binding
  4. Move cursor to a different song
  5. Add this song
  6. Switch to playlist view, see that the last two songs are the first song you attempted to add, twice

I noticed that selecting a song with toggle-select and then add gets around the bug, and the next song added with add after that will add the correct song too, but then the next after that will be stuck on the previously-added song again.

Support password in MPD_HOST environment variable

Various MPD clients currently use MPD_HOST for both password and host store. Although I personally agree that MPD_HOST + MPD_PASSWORD is better, it might be best to IF MPD_HOST contains an @ character, it follows the <password>@<host> format. This allows users to use either format. It's also a safe assumption as the host should not contain @ in the name

Binding shift doesn't work

bind <S-left> seek -5 doesn't work. I.e. Shift <- to seek backwards.
The debug-log doesn't show anything out of the ordinary.

CLI access

Feature request: Send commands to pms from shell. E.g. 'pms add-random '

Add command to run a console command

I liked this feature in the C++ version. Any interest in having it in the new version, or not?

For example, I had ^W run a python script which grabbed and displayed the lyrics for the currently-playing song. I had ^T run Transcribe with the song under the cursor's path/filename as an argument.

It might be nice to allow placeholders for tags of the current or highlighted song.

Command line --host option doesn't work

The --host=<hostname> option doesn't seem to work. Didn't try the other options. Could it be that the environment variable I have set overrides it? I think it ought to be the other way around if so (command line switch should override the environment variable).

Dynamic playlists

It would be nice to save a search as a playlist which will dynamically update itself every time the library is updated.

When restarting currently played track, timer isn't reset

I'm in the playlist view and I have the currently-played track highlighted. It's at some non-zero time. I press enter to restart it. The track restarts but the timer continues counting from where it was.

If I then seek, it jumps to the time displayed on the clock plus or minus the seek amount.

aclocal problems

Trying to install PMS as a client on my iMac to access a Raspberry Pi server with MPD.

I am trying to run the ./rebuild.sh command to build the environment but I received an 'aclocal: command not found' error. I used Homebrew to install automake, which contains the aclocal command. Now, when running the rebuild file I am given:
"You should update your 'aclocal.m4' by running aclocal."
...

Running aclocl I receive:

configure.ac:41: warning: macro 'AM_GNU_GETTEXT' not found in library
configure.ac:40: warning: AM_NLS is m4_require'd but not m4_defun'd
/usr/local/share/aclocal/intltool.m4:160: IT_PROG_INTLTOOL is expanded from...
configure.ac:40: the top level
configure.ac:40: warning: AM_NLS is m4_require'd but not m4_defun'd
m4/intltool.m4:160: IT_PROG_INTLTOOL is expanded from...
configure.ac:40: the top level

Also my ./configure && make will not work either:
configure: error: cannot find install-sh or install.sh in . ./.. ./../..

(if this matters) In addition to automake, I have libtool, gettext, and autoconf installed - how come my ./configure cannot find the install-sh or install.sh files?

Sorry if this sounds irrelevant to PMS (I am new to this).

Cursor half-page down or up

I don't see a command to move the cursor half a page down or up, like ^D and ^U in vim. Would be nice to have.

Multiple Segfaults

summary

building from master, i've been encountering multiple situations leading to segfaults

system: Arch Linux 64bit
library stats:

Artists:    996
Albums:    1278
Songs:    14139

rc: empty file (cut everything for debugging purposes and it had no effect)
valgrind logs: https://gist.github.com/shmibs/82a624a32872f33166bb

startup crash

when pms starts, if mpd is playing and repeat, random, single, and consume are all off, it crashes before anything is displayed. i've narrowed this down to this line:

https://github.com/ambientsound/pms/blob/master/src/pms.cpp#L1267

building with that line removed avoids the segfault

pressing shift+j

i previously had shift+j mapped to goto-current (don't remember if this was default or not) and so got in a habit of using it. even without any rc, as described above, hitting shift+j at any time triggers a segfault

pressing tab

similarly, hitting tab at any time causes a crash

feature request: fuzzy search

When searching large libraries, it would be helpful if one could use fuzzy search.
This would especially helpful when unsure about the correct spelling of an artist/album name.
Something along the lines of fzf.

syntax error near unexpected token `noext,'

trying to build the latest version on a Raspberry Pi2, running Rasbian. I am getting the following:

./rebuild.sh
autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force autoreconf: configure.ac: tracing autoreconf: configure.ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION autoreconf: configure.ac: not using Libtool autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing autoreconf: Leaving directory.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
./configure: line 2868: AX_CHECK_ENABLE_DEBUG: command not found
checking for gawk... (cached) mawk
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
./configure: line 4323: AX_WITH_CURSES: command not found
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for glib... yes
checking for libmpdclient... yes
checking for pandoc... no
configure: WARNING: The manual page will not be built.
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for gethostbyname... yes
checking for memmove... yes
checking for memset... yes
checking for select... yes
checking for setlocale... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strstr... yes
checking for strtol... yes
checking whether NLS is requested... yes
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.14.2
checking for XML::Parser... ok
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for msgmerge... (cached) /usr/bin/msgmerge
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
./configure: line 7967: syntax error near unexpected token noext,' ./configure: line 7967: yes) AX_CXX_COMPILE_STDCXX_11(noext, mandatory)'

Nil pointer dereference when starting PMS in certain terminals

PMS runs fine for me in urxvt, but in st (both 0.4.1, which is packaged in my distro's repo, and the latest master) I get the following error:

Practical Music Search undefined
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x825d02]

goroutine 1 [running]:
github.com/ambientsound/pms/widgets.(*UI).Start(0x0)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/widgets/ui.go:107 +0x22
github.com/ambientsound/pms/pms.(*PMS).setupUI(0xc42015ba00)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/pms/setup.go:74 +0xb3
github.com/ambientsound/pms/pms.New(0x952563)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/pms/setup.go:42 +0x92c
main.main()
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/main.go:66 +0x2f1

Reordering songs in playlist

In some older version, it was possible to move selected song up (down) by just holding a K (J) key. Now when you press K, the selected song is swapped with the above, but the focus remains on the same row, so holding the K key swaps always the same two songs. Is this a bug or feature?

Also, I would appreciate a way to apply different ordering for playlist and the library when adding entire albums, or to apply specific ordering to the existing playlist. The use case is adding a multi-artist album from a library sorted by artist and sorting it by track number in the playlist. I apologize if this is already possible and I haven't figured it out...

Implement album cover widget

I love album covers because they look beautiful and make it easy to differentiate songs.
I have yet to set up mpd, and I want to know if pms supports showing album cover images.

Assertion fail - PMS stops

When launching a freshly built PMS I get this error:

Stopped. 2017-04-20 00:51:41 /status/ Stopped.
2017-04-20 00:51:41 /debug/ --> Main loop iteration, clock = 28912.497969553
2017-04-20 00:51:41 /debug/ Retrieving MPD status from server.
2017-04-20 00:51:41 /debug/ Updating playlist from version -1 to 4
pms: /home/z3bu/ambientsound-pms-pre-merge-window-refactor-88-ga774fca/ambientsound-pms-a774fca/src/songlist.cpp:86: Song* Songlist::song(uint32_t): Assertion `position < size()' failed.
Aborted (core dumped)

Allow using color numbers

The color names are kind of limited for customization, it would be nice to be able to use the 256 color palette plus a bold modifier.

Wrong column widths in playlist

The algorithm for adjusting width of columns in the playlist does not take into account the data to be displayed. If the song title is too long, its column will span most of the screen, leaving only a few characters for the artist column in some cases, regardless of the actual length of the artist text. And the track number column displays only one digit.

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.