- Notifications
You must be signed in to change notification settings - Fork36
jonsafari/mocp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
MOC (music on console) is a console audio player for Linux/Unix designed to bepowerful and easy to use.
This is an unofficial mirror, with a few small aesthetic tweaks. It syncs withthe subversion upstream every few weeks.MOC makes it easy to use multimedia keys on your keyboard, which is discussed below.
On Debian/Ubuntu systems, you minimally need the following packages:
sudo apt-get install gcc autoconf libtool gettext libdb-dev libpopt-dev libncursesw5-dev
I recommend the following packages as well:
sudo apt-get install libasound2-dev libcurl4-openssl-dev libogg-dev libvorbis-dev libflac-dev libopus-dev libid3tag0-dev libsndfile1-dev libfaad-dev libavcodec-dev libsamplerate0-dev librcc-dev
Optional: FFmpeg adds many, many more file formats, including AAC, Opus, MP4, and WMA. You may need to first addwww.deb-multimedia.org to your apt-get sources. Then get FFmpeg:
sudo apt-get install libavformat-dev
autoreconf -if./configuremake -j 2sudo make install
For Xfce, go toSettings -> Keyboard -> Application Shortcuts
, then add shortcuts withcommands likemocp --next
and others listed inmocp --help
. I find that the mostuseful keyboard shortcuts are for the following:
mocp --toggle-pause
- Play/pausemocp --toggle shuffle
- Enable/disable shufflemocp --next
- Skip to the next songmocp --previous
- Go to the previous songmocp --seek +5
- Jump 5 seconds forwardmocp --seek -5
- Jump 5 seconds back
In Fluxbox you can add the following to your.fluxbox/keys
file (after usingxev
to discover key numbers):
# Play/pause179 :Exec mocp --toggle-pause# Skip to next song225 :Exec mocp --next# Go to previous songMod1 225 :Exec mocp --previous# Move forward a few seconds: ALT + >Mod1 60 :Exec mocp --seek +5# Move backward a few seconds: ALT + <Mod1 59 :Exec mocp --seek -5# Go to MOCP tab (should be first tab)128 :Tab 1# Toggle shuffle152 :Exec mocp --toggle shuffle
It's really easy to use a remote control with MOC. You can use any remote that appears to your computer as a keyboard, likethis one or similar ones. Then setup keyboard shortcuts as described above for each button you want to use to control MOC.
The rest of the upstream README is as follows:
You just need to select a file from some directory using the menu similar toMidnight Commander, and MOC will start playing all files in this directorybeginning from the chosen file. There is no need to create playlists as inother players.
If you want to combine some files from one or more directories in one playlist,you can do this. The playlist will be remembered between runs or you can saveit as an m3u file to load it whenever you want.
Need the console where MOC is running for more important things? Need to closethe X terminal emulator? You don't have to stop playing - just press q and theinterface will be detached leaving the server running. You can attach it later,or you can attach one interface in the console, and another in the X terminalemulator, no need to switch just to play another file.
MOC plays smoothly, regardless of system or I/O load because it uses the outputbuffer in a separate thread. The transition between files is gapless, becausethe next file to be played is precached while the current file is playing.
Supported file formats are: MP3, Ogg Vorbis, FLAC, Musepack (mpc), Speex, Opus,WAVE, those supported by FFmpeg/LibAV (e.g., WMA, RealAudio, AAC, MP4), AIFF,AU, SVX, Sphere Nist WAV, IRCAM SF, Creative VOC, SID, wavpack, MIDI andmodplug.
Other features:
- Simple mixer
- Color themes
- Menu searching (playlist or directory) like M-s in Midnight Commander
- The way MOC creates titles from tags is configurable
- Optional character set conversion for file tags using iconv()
- OSS, ALSA, SNDIO and JACK output
- User defined keys
- Cache for files' tags
This file is only a brief description of MOC, for more information isavailable on the home page (http://moc.daper.net/documentation).
You can also find a discussion forum on the MOC home page.
To build MOC from the distribution tarball you will need:
- A POSIX.1-2001 compatible UNIX system with POSIX threads(e.g., Linux or OSX)
- A C compiler which is C99 capable and a C++ compiler (MOC is writtenin C, but libtool and some decoder plugins require a C++ compiler)
- ncurses (probably already installed in your system)
- POPT (libpopt) (probably already installed in your system)
- Berkeley DB (libdb) version 4.1 (unless configured with --disable-cache)
- GnuPG (gpg) if you are going to verify the tarball (and you should)
If you are building from the SVN repository you will also need:
- Subversion or git-svn (to checkout the source directory tree)
- Autoconf version 2.64 and the associated Automake and Libtool
You should choose which of the following audio formats you wish to play andprovide the libraries needed to support them:
- AAC - libfaad2 version 2.7 (http://www.audiocoding.com/), andlibid3tag (http://www.underbit.com/products/mad/)
- FLAC - libFLAC version 1.1.3 (http://flac.sourceforge.net/)
- MIDI - libtimidity version 0.1 (http://timidity.sourceforge.net/)
- modplug - libmodplug version 0.7 (http://modplug-xmms.sourceforge.net/)
- MP3 - libmad with libid3tag (ftp://ftp.mars.org/pub/mpeg/)
- Musepack (mpc)
- libmpcdec (http://www.musepack.net/), and
- taglib version 1.3.1 (http://developer.kde.org/~wheeler/taglib.html)
- Ogg Vorbis
- libvorbis, libogg and libvorbisfile (all version 1.0) (http://www.xiph.org/ogg/), or
- libvorbisidec and libogg (both version 1.0) (http://svn.xiph.org/trunk/Tremor)
- SID - libsidplay2 version 2.1.1 and libsidutils version 1.0.4(http://sidplay2.sourceforge.net/)
- Speex
- libspeex version 1.0 (http://www.speex.org/), and
- libogg version 1.0 (http://www.xiph.org/ogg/)
- WMA, RealAudio (.ra), MP4
- FFmpeg version 0.7 (http://www.ffmpeg.org/), or
- LibAV version 0.7 (http://www.libav.org/)
- WAVE, AU, AIFF, SVX, SPH, IRC, VOC - libsndfile version 1.0 (http://www.mega-nerd.com/libsndfile/)
- wavpack - libwavpack version 4.31 (http://www.wavpack.com/)
For interfacing to the sound sub-system, you will need libraries for one ormore of the following:
- ALSA - alsa-lib version 1.0.11 (http://www.alsa-project.org/)
- OSS - the OSS libraries (http://www.opensound.com/)
- BSD's SNDIO - SNDIO libraries
- JACK low-latency audio server - JACK version 0.4 (http://jackit.sourceforge.net/)
For network streams:
- libcurl version 7.15.1 (http://curl.haxx.se/)
For resampling (playing files with sample rate not supported by yourhardware):
- libresamplerate version 0.1.2 (http://www.mega-nerd.com/SRC/)
For librcc (fixes encoding in broken mp3 tags):
Note that for Debian-based distributions, you will also require any '-dev'suffixed versions of the packages above if building from source.
The versions given above are minimum versions and later versions should alsowork. However, MOC may not yet have caught up with the very latest changesto library interfaces and these may cause problems if they break backwardscompatibility.
MOC is developed and tested on GNU/Linux.
MOC is now C99 and POSIX.1-2001 compliant and so should build and run onany system which has a C99 capable compiler and is POSIX.1-2001 compatible.However, there may still be cases where MOC breaks this compliance and anyreports of such breakage are welcome.
There is no intention to support MOC on MS-Windows (so please don't ask).
If you downloaded the official MOC distribution you should have thefollowing files:
moc-2.6-alpha2.tar.ascmoc-2.6-alpha2.tar.md5moc-2.6-alpha2.tar.xz
would check the integrity of the download:
md5sum -c moc-2.6-alpha2.tar.md5
and then verify the tarball thusly:
xzcat moc-2.6-alpha2.tar.xz | gpg --verify moc-2.6-alpha2.tar.asc -
The signature file (*.asc) was made against the uncompressed tarball,so if the tarball you have has been recompressed using a tool otherthan XZ then uncompress it using the appropriate tool then verify that:
gunzip moc-2.6-alpha2.tar.gzgpg --verify moc-2.6-alpha2.tar.asc
If the tool can output to stdout (and most can) then you can also verifyverify it in a single step similar to the way in which the XZ tarballwas verified above.
Of course, you'll also need the MOC Release Signing Key:
gpg --recv-key 0x2885A7AA
for which the fingerprint is:
5935 9B80 406D 9E73 E805 99BE F312 1E4F 2885 A7AA
Generic installation instruction is included in the INSTALL file.
In short, if you are building from an SVN checkout of MOC (but not if youare building from a downloaded tarball) then you will first need to run:
autoreconf -if
and then proceed as shown below for a tarball. (If you are using thetarball but have applied additional patches then you may also need to runautoreconf.)
To build MOC from a downloaded tarball just type:
./configuremake
And as root:
make install
Under FreeBSD and NetBSD (and possibly other systems) it is necessary torun the configure script this way:
./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
In addition to the standard configure options documented in the INSTALLfile, there are some MOC-specific options:
--enable-cache=[yes|no] Specifying 'no' will disable the tags cache support. If your intent is to remove the Berkeley DB dependancy (rather than simply removing the on-disk cache) then you should also either build MOC without RCC support or use a librcc built with BDB disabled.--enable-debug=[yes|no|gdb] Using 'gdb' will cause MOC to be built with options tailored to use with GDB. (Note that in release 2.6 this option will be split into separate debugging and logging options.)--with-oss=[yes|no|DIR] Where DIR is the location of the OSS include directory (and defaults to '/usr/lib/oss').--with-vorbis=[yes|no|tremor] Using 'tremor' will cause MOC to build against the integer-only implementation of the Vorbis library (libvorbisidec).
You can install MOC into its own source directory tree and run it from thereso you do not have to install it permanently on your system. If you're justwanting to try it out or test some patches, then this is something you maywish to do:
./configure --prefix="$PWD" --without-timiditymakemake installbin/mocp -M .moc
Run program with the 'mocp' command. The usage is simple; if you need help,press 'h' and/or read mocp manpage. There is no complicated command line orcryptic commands. Using MOC is as easy as using basic functions of MidnightCommander.
You can use a configuration file placed in ~/.moc/config, but it's not required.See config.example provided with MOC.
Yes, there are themes, because people wanted them. :)
Themes can change all colors and only colors. An example theme file with aexhaustive description is included (themes/example_theme) and is thedefault MOC appearance.
Theme files should be placed in ~/.moc/themes/ or $(datadir)/moc/themes/(e.g., /usr/local/share/moc/themes) directory, and can be selected withthe Theme configuration options or the -T command line option (see themanpage and the example configuration file).
Feel free to share the themes you have created.
You can redefine standard keys. See the instructions in the keymap.example file.
Not every release is extensively tested on every system, so the particularconfiguration of software, libraries, versions and hardware on your systemmight expose a problem.
If you find any problems then you should search the MOC Forum for a solution;your problem may not be unique. If you do find an existing topic whichmatches your problem but does not offer a solution, or the solution offereddoes not work for you and the topic appears still active, then please add yourexperience to it; it may be that additional information you can provide willcontain the clue needed to resolve the problem.
If you don't find an answer there and you installed MOC from your Linuxdistribution's repository then you should report it via your distribution'susual reporting channels in the first instance. If the problem is ultimatelyidentified as actually being in MOC itself, it should then be reported to theMOC Maintainer (preferably by the distribution's MOC package maintainer).
If you built MOC from source yourself or you get no resolution from yourdistribution then start a new topic on the MOC Forum for your problem orcontact the MOC Maintainer.
Before reporting a problem, you should first read this Forum post:
Linkname: How to Report Bugs EffectivelyURL:http://moc.daper.net/node/1035
and the essay it references:
Linkname: How to Report Bugs EffectivelyURL:http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
There are two things you must do if at all possible:
- Make sure you are using the current stable MOC release or, even better,can reproduce it on the latest development release or SVN HEAD, and
- Make sure you include the version and revision information (which youcan obtain by running 'mocp --version').
If you do not do those two things (and don't offer a good explanation as towhy you didn't) your problem report is likely to be ignored until such timeas you do.
Want to modify MOC? You're welcome to do so, and patch contributions arealso welcome.
MOC is written in C, so you must at least know this language to make simplechanges. It is multi-threaded program, but there are places where you don'tneed to worry about that (the interface is only a single thread process). Ituses autoconf, automake and libtool chain to generate configuration/compilationstuff, so you must know how to use it, for example, if you need to link to anadditional library.
The documentation for some parts of the internal API for creating decoderplugins (file format support) and sound output drivers can be generated usingDoxygen (http://www.doxygen.org/). Just run the doxygen command from the MOCsource directory.
Before you change anything it is a good idea to check for the latest developmentversion (check out from the Subversion repository is the best). Your changesmight conflict with changes already made to the source or your feature might bealready implemented. See also the TODO file as it is updated regularly andcontains quite detailed information on future plans.
If you need help, just contact MOC's Maintainer via e-mail. And if you areplanning anything non-trivial it's a good idea to discuss your intentionswith the MOC Maintainer once you've clarified your ideas but before spendingtoo much time implementing them; it will be more productive if your work fitswith MOC's future direction.
- Original author is Damian Pietras
- Current maintainer is John Fitzgerald
- For comments and questions see the official forum:http://moc.daper.net/forum
- Need to report a bug? You can reach the maintainer(s) at:mocmaint@daper.net