TOO SMALL: How to **hack** moc to accept small screen size

Forums:

Hi all,

I love moc, but then I installed tmux and then the problems began; I wanted to have a small pane on the right size of the screen playing my favorite songs.

When I was hit with the message of **terminal too small** I was rather disappointed.

I begin installing and trying at least other 7 console music players, but none satisfied my fond for "JUST PLAY FROM FILES, YOU IDIOT PLAYER!!!!" instead of loading files into a playlist, DAH..!!!!

I then began ponder the idea to look at the source code and maybe trying to hack it. Well, I finally cracked it, and now I can set my pane size to 30 columns, instead 60.

OK here are the instructions: (obviously cannot guaranteed it will work perfectly, it is hacking for crist happy christmas sake;-)

0 - Tried on Ubuntu 12.04 Precise Pangolin

1 - Download 2.5.0-beta1 version.

2 - make sure you install the following libraries from your linux box (some libs maybe missing or a lib listed could be redundant):

libmad0-dev
libid3tag0-dev
zlib1g-dev
libsndfile1-dev
libflac-dev
libogg-dev
libsamplerate0-dev
speex
libspeex-dev
libmpcdec-dev
libsidplay2-dev
libsidutils-dev
libresid-builder-dev
libwavpack-dev
libtagc0-dev
libcurl4-gnutls-dev
libavcodec-dev
libavformat-dev
libltdl3-dev
libtool
libmodplug-dev
automake1.9
autoconf
libjack-dev
libasound2-dev
mpg123
mpg123-alsa
libmp3lame-dev
libmpg123-dev
libdb5.1
libdb1-compat
libdb5.1-dev
ffmpeg
moc-ffmpeg-plugin
musepack-tools
libvorbis-dev
vorbis-tools
libogg-dev
flac
libflac-dev
modplug-tools

3 - unpack the sources

4 - We only need to modify the file interface_elements.c

a. change the following line in check_term_size function:

mw->too_small = iw->too_small = COLS < 59 || LINES < 5;

with:

mw->too_small = iw->too_small = COLS < 30 || LINES < 5;

b. With your text editor find all instances of "COLS - 37" and COLS - 38". Now change the number to 27 and 28 respectively.

5. Now we are ready to go:
./configure
make
(sudo) make install (with root/administrative privileges)

6. Now you can run mocp.

We may run into some errors, like plugin not loaded or problems with alsa. These are all library related problems.

The installation will install files into:
/usr/local/bin (EXECUTABLE)
/usr/local/lib/moc (PLUGINS)
/usr/local/man/moc (MAN PAGE)
/usr/local/share/moc (THEMES)

Once you successfully compile moc and want to run into other computers, ensure you copy the folders above.

HAPPY HACKING

Milarepa

/.configure
make
(sudo) make install (with administrative/root privilegies)

There are several forum topics about it, for example: http://moc.daper.net/node/358 http://moc.daper.net/node/464

BTW. I doubt that you need "moc-ffmpeg-plugin" in Ubuntu to compile MOC.