General discussion

Here you can discuss everything related to MOC which doesn't fit other subforum.

Crash caused by lyric feature

Noticed a bug in the code today which kept causing moc to crash in strange ways. (SVN revision 2161)

Turns out it was becaused of the strncpy in lyrics.c. The code has a const FILENAME_SIZE (set at 200), and uses this to allocate the lyrics_filename buffer, but then in the lyrics_remove_prefix function, the strncpy uses the strlen of the filename. This means if the filename is > 200 characters, then the strncpy will overwrite the memory after the buffer and cause a nasty crash.

I would suggest simply changing the xmalloc at line 64 from:

lyrics_filename = xmalloc (sizeof(char) * FILENAME_SIZE);

to:

lyrics_filename = xmalloc (sizeof(char) * (strlen(filename) + 1));

Its either that, or add some strlen(filename) > FILENAME_SIZE check in the lyrics_remove_prefix function, but the first
method should be more flexible.

I've also never used lyrics, so I havent come accross any issues - but there seems to be a similar issue where the lyri
cs array at the top of the file is pre-allocated using a fixed constant, but then on line 71 when the lyrics file is re
ad in, a while(fgets()) is used, with no bounds checking for the array. Again, this means a lyrics file with more than
128 lines would cause moc to crash.

Event listening

I think it would be cool to have something like --info in an endless loop, producing output as things change. Calling 'mocp --info' every second is inaccurate and needs too much system resources.

How much effort would it take to implement something like xprop's -spy option, which prints out things that have changed? Just printing the --info screen would also be great.

Efficient scripting would be easy in any language.

PLay symbolic link

My music library is organise with symbolic links which points to mp3 files, is there anyway that moc could recognize a link and play the corresponding file?

Thank you

MOC 2.5.0-alpha3 Equalizer patch

Hello. Is it correct to use patch from here http://moc.daper.net/node/397 to add equalizer in MOC 2.5.0-alpha3 or I need to find something special? I've tried moc-equalizer_r2099.patch, but it crashed during compilation with error:

interface.c: In function 'menu_key':
interface.c:3173: error: 'KEY_CMD_TOGGLE_EQUALIZER' undeclared (first use in this function)
interface.c:3177: error: 'KEY_CMD_EQUALIZER_REFRESH' undeclared (first use in this function)
interface.c:3181: error: 'KEY_CMD_EQUALIZER_PREV' undeclared (first use in this function)
interface.c:3185: error: 'KEY_CMD_EQUALIZER_NEXT' undeclared (first use in this function)
interface.c:3189: error: 'KEY_CMD_TOGGLE_MAKE_MONO' undeclared (first use in this function)
make[3]: *** [interface.o] Error 1
make[3]: Leaving directory `/moc-2.5.0~alpha3+svn20080629'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/moc-2.5.0~alpha3+svn20080629'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/moc-2.5.0~alpha3+svn20080629'
make: *** [build-arch-stamp] Error 2
dpkg-buildpackage: fakeroot debian/rules binary returned Error 2
debuild: fatal error at line 1319:
dpkg-buildpackage -rfakeroot -D -us -uc failed

Please explain what I'am doing wrong? Is it problem of Debian buildpackage tool or problem with patch?
Thanks for your answers.

FormatString and Themes

Probably the one with the FormatString is a bug but it could be a missing feature, anyway I wanted to make a nested check on a property, something like: "%(A: \(%A%(a: - %a:)\):)" but moc just crashes and obviously ruins the term. So well, just asking if I'm failing somewhere and if I'm not noticing you that there's this bug :)

The Theme bug is pretty weird, I wanted to change the color of the [time|type] thingy but in the default themes there wasn't anything that did it, so I checked the sources and found:


{ "selected_info", CLR_MENU_ITEM_INFO_SELECTED },
{ "marked_info", CLR_MENU_ITEM_INFO_MARKED },
{ "marked_selected_info", CLR_MENU_ITEM_INFO_MARKED_SELECTED },

I tryed to use them but:

{ "empty_mixer_bar", CLR_MIXER_BAR_EMPTY },
{ "filled_mixer_bar", CLR_MIXER_BAR_FILL },
{ "empty_time_bar", CLR_TIME_BAR_EMPTY },
{ "filled_time_bar", CLR_TIME_BAR_FILL },

Disappeared (as in the elements in the interface went trasparent (or completely black)), am I still failing somewhere or is it a bug?

Thank you, bye.

Global Hotkeys

I found about MOC on Full Circle Magazine and immediately installed it to try out. Have been loving it since and takes less than 10% memory of rythmbox. Cool! There is just one feature that I am missing and that is global hotkeys. I am used to moving to next song in the playlist (while say browsing on Firefox) using global keyboard shortcuts in other music players. Is this feature available in MOC. Thanks.

HOWTO Prevent MOC from changing GNU screen title

I am running MOC in a screen session and want to disable moc changing the title of the screen window to the current song. Is this something I can turn off in the moc or screen config file?

I've already tried setting "SetXtermTitle = no" and that doesn't work.

cRaig

Working with ftp

Good day!
What about adding a new feature in mocp: browsing folders on ftp-servers and adding ones(folders and it's items) into playlist by "a"/"A"? :)

Thank you. Scit.

Pages

Subscribe to RSS - General discussion