Code

ncmpc.git
12 years agocommand: make Ctrl-X/Alt-X/F1 etc. translatable
Jonathan Neuschäfer [Wed, 21 Dec 2011 20:40:51 +0000 (21:40 +0100)]
command: make Ctrl-X/Alt-X/F1 etc. translatable

12 years agoscreen_lyrics: new key to edit lyrics
Jonathan Neuschäfer [Sun, 11 Dec 2011 11:50:02 +0000 (12:50 +0100)]
screen_lyrics: new key to edit lyrics

Thanks for the idea and an initial patch go to Jitka Novotna <jitka@ucw.cz>

12 years agoscreen_lyrics: put code for reloading in a function
Jonathan Neuschäfer [Sat, 17 Dec 2011 14:54:47 +0000 (15:54 +0100)]
screen_lyrics: put code for reloading in a function

12 years agoAdd option "text-editor"
Jonathan Neuschäfer [Sat, 17 Dec 2011 16:08:36 +0000 (17:08 +0100)]
Add option "text-editor"

The lyrics screen is going to spawn a text editor to edit lyrics.
Put the infrastructure in place to make it configurable.

12 years agoMerge remote branches 'jn/cosmetics', 'jn/doxygen' and 'jn/renames'
Max Kellermann [Fri, 2 Dec 2011 11:10:46 +0000 (12:10 +0100)]
Merge remote branches 'jn/cosmetics', 'jn/doxygen' and 'jn/renames'

12 years agoscreen_song: make Path a proper label
Jonathan Neuschäfer [Tue, 22 Nov 2011 22:33:01 +0000 (23:33 +0100)]
screen_song: make Path a proper label

12 years agocommand.c: use for instead of while in check_key_bindings
Jonathan Neuschäfer [Tue, 22 Nov 2011 22:09:35 +0000 (23:09 +0100)]
command.c: use for instead of while in check_key_bindings

12 years agocommand.c: put curly braces around a single large statement
Jonathan Neuschäfer [Tue, 22 Nov 2011 22:03:05 +0000 (23:03 +0100)]
command.c: put curly braces around a single large statement

12 years agomain: don't show "connecting to (null)"
Jonathan Neuschäfer [Sat, 19 Nov 2011 23:52:15 +0000 (00:52 +0100)]
main: don't show "connecting to (null)"

This patch is a follow-up to commit b774eac8d9 ("main: don't show
(null) as the server name").

12 years agoscreen_song: don't show unknown kbit rates
Jonathan Neuschäfer [Sat, 19 Nov 2011 01:33:43 +0000 (02:33 +0100)]
screen_song: don't show unknown kbit rates

(calling mpd_status_get_kbit_rate twice in a row shouldn't impact
performance, it's declared as "pure")

13 years agorename screen_message to screen_status
Jonathan Neuschäfer [Tue, 22 Nov 2011 21:54:55 +0000 (22:54 +0100)]
rename screen_message to screen_status

Its two functions are screen_status_message and screen_status_printf
so this just seems logical to me.

13 years agodoxygen: don't sort functions in the file documentation
Jonathan Neuschäfer [Thu, 3 Nov 2011 23:02:51 +0000 (00:02 +0100)]
doxygen: don't sort functions in the file documentation

13 years agoadd doc/doxygen.conf and doc/api/ to .gitignore
Jonathan Neuschäfer [Fri, 14 Oct 2011 20:24:39 +0000 (22:24 +0200)]
add doc/doxygen.conf and doc/api/ to .gitignore

13 years agomention doxygen support in NEWS
Jonathan Neuschäfer [Fri, 4 Nov 2011 20:54:08 +0000 (21:54 +0100)]
mention doxygen support in NEWS

13 years agoadd doxygen support
Jonathan Neuschäfer [Fri, 14 Oct 2011 20:21:22 +0000 (22:21 +0200)]
add doxygen support

13 years agouse mpdclient_finish_command at the obvious places
Jonathan Neuschäfer [Thu, 3 Nov 2011 23:20:45 +0000 (00:20 +0100)]
use mpdclient_finish_command at the obvious places

13 years agompdclient: export mpdclient_finish_command
Jonathan Neuschäfer [Mon, 31 Oct 2011 00:23:15 +0000 (01:23 +0100)]
mpdclient: export mpdclient_finish_command

(and include mpdclient.h in mpdclient.c, so it can be used there)

13 years agooptions.c: rewrite two #ifndefs as one #if
Jonathan Neuschäfer [Mon, 14 Nov 2011 05:49:52 +0000 (06:49 +0100)]
options.c: rewrite two #ifndefs as one #if

13 years agoconfigure.ac: (default: enabled) -> [default=yes]
Jonathan Neuschäfer [Sat, 5 Nov 2011 22:49:40 +0000 (23:49 +0100)]
configure.ac: (default: enabled) -> [default=yes]

13 years agoapply whitespace cosmetics to the license comments
Jonathan Neuschäfer [Sat, 5 Nov 2011 10:10:25 +0000 (11:10 +0100)]
apply whitespace cosmetics to the license comments

13 years agoncmpc.h: document sigstop
Jonathan Neuschäfer [Thu, 3 Nov 2011 22:47:28 +0000 (23:47 +0100)]
ncmpc.h: document sigstop

13 years agoMakefile.am: Add @CURSES_LIB@ to link the test program
Avuton Olrich [Sat, 12 Nov 2011 14:29:33 +0000 (06:29 -0800)]
Makefile.am: Add @CURSES_LIB@ to link the test program

13 years agompdclient: define MPD_IDLE_ALL
Jonathan Neuschäfer [Fri, 4 Nov 2011 00:01:37 +0000 (01:01 +0100)]
mpdclient: define MPD_IDLE_ALL

13 years agoconfigure.ac: Remove duplicate output screen merge error.
Avuton Olrich [Fri, 4 Nov 2011 01:09:01 +0000 (18:09 -0700)]
configure.ac: Remove duplicate output screen merge error.

13 years agoconfigure.ac: Change to the more correct variable for wide support.
Avuton Olrich [Fri, 4 Nov 2011 01:05:09 +0000 (18:05 -0700)]
configure.ac: Change to the more correct variable for wide support.

13 years agoscreen_list: use G_N_ELEMENTS()
Jonathan Neuschäfer [Tue, 11 Oct 2011 21:14:40 +0000 (23:14 +0200)]
screen_list: use G_N_ELEMENTS()

13 years agoMerge remote branches 'avuton/master' and 'jn/dev'
Max Kellermann [Thu, 3 Nov 2011 16:42:07 +0000 (17:42 +0100)]
Merge remote branches 'avuton/master' and 'jn/dev'

13 years agom4: Add robust curses detection and support
Avuton Olrich [Thu, 3 Nov 2011 09:20:51 +0000 (02:20 -0700)]
m4: Add robust curses detection and support

This commit adds the ax_with_curses.m4 macro from the autoconf-archive
project. This also adds support for more plain curses, proper color detection
and compartmentalizes the curses autoconf stuff.

13 years agoscreen.c: Add pdcurses mouse support
Avuton Olrich [Sun, 30 Oct 2011 04:30:12 +0000 (21:30 -0700)]
screen.c: Add pdcurses mouse support

13 years agoconfigure.ac: Add proper CFLAG checking and appending
Avuton Olrich [Thu, 3 Nov 2011 02:42:04 +0000 (19:42 -0700)]
configure.ac: Add proper CFLAG checking and appending

Add proper CFLAG checking and appending using standard autoconf macros. This
fixes the warnings generated during autoconf.

13 years agowreadln.c: Win32 doesn't support polling, so disable this for now
Avuton Olrich [Sun, 30 Oct 2011 02:36:39 +0000 (19:36 -0700)]
wreadln.c: Win32 doesn't support polling, so disable this for now

Win32 doesn't support polling, disabling it for now. Not exactly sure
what this breaks, but win32 appears to run fine with this code disabled.

13 years agomain.c: Don't try to compile signal support on win32
Avuton Olrich [Sun, 30 Oct 2011 02:34:57 +0000 (19:34 -0700)]
main.c: Don't try to compile signal support on win32

13 years agoconf.c: When on win32, mkdir() doesn't use permissions
Avuton Olrich [Sun, 30 Oct 2011 01:23:30 +0000 (18:23 -0700)]
conf.c: When on win32, mkdir() doesn't use permissions

13 years agoscreen.c: If compiling with PDCURSES, use resize_term() to resize
Avuton Olrich [Sun, 30 Oct 2011 01:21:44 +0000 (18:21 -0700)]
screen.c: If compiling with PDCURSES, use resize_term() to resize

13 years agogidle.c: Removed unused header
Avuton Olrich [Sun, 30 Oct 2011 01:12:12 +0000 (18:12 -0700)]
gidle.c: Removed unused header

13 years agoconfigure.ac: Link to winsock when compiling on win32
Avuton Olrich [Thu, 3 Nov 2011 02:13:21 +0000 (19:13 -0700)]
configure.ac: Link to winsock when compiling on win32

13 years agoconfigure.ac: Replace AM_CONFIG_HEADER deprecated macro
Avuton Olrich [Sat, 29 Oct 2011 13:18:00 +0000 (06:18 -0700)]
configure.ac: Replace AM_CONFIG_HEADER deprecated macro

13 years agoconfigure.ac: Remove disabled browse screen options
Avuton Olrich [Thu, 3 Nov 2011 02:08:47 +0000 (19:08 -0700)]
configure.ac: Remove disabled browse screen options

13 years agoconfigure.ac: Add AC_MSG_RESULT for outputs screen
Avuton Olrich [Sat, 29 Oct 2011 12:53:45 +0000 (05:53 -0700)]
configure.ac: Add AC_MSG_RESULT for outputs screen

13 years agoconfigure.ac: Amend -Werror using the cflag framework
Avuton Olrich [Sat, 29 Oct 2011 12:50:42 +0000 (05:50 -0700)]
configure.ac: Amend -Werror using the cflag framework

13 years agom4: Update nls.m4
Avuton Olrich [Wed, 26 Oct 2011 02:46:41 +0000 (19:46 -0700)]
m4: Update nls.m4

13 years agoconfigure.ac: AC_HELP_STRING depreciated, move to AS_HELP_STRING
Avuton Olrich [Thu, 3 Nov 2011 01:54:24 +0000 (18:54 -0700)]
configure.ac: AC_HELP_STRING depreciated, move to AS_HELP_STRING

13 years agolist_window: scroll down exactly one page at PGDN
Jonathan Neuschäfer [Tue, 1 Nov 2011 21:40:13 +0000 (22:40 +0100)]
list_window: scroll down exactly one page at PGDN

13 years agomain: use mpdclient_is_connected in assert
Jonathan Neuschäfer [Sat, 29 Oct 2011 12:49:26 +0000 (14:49 +0200)]
main: use mpdclient_is_connected in assert

13 years agoscreen: restore newline character
Jonathan Neuschäfer [Sat, 29 Oct 2011 13:10:20 +0000 (15:10 +0200)]
screen: restore newline character

It was removed in commit 389a1ad8:
- fprintf(stderr, _("Error: Screen to small\n"));
+ fprintf(stderr, "%s", _("Error: Screen too small"));
exit(EXIT_FAILURE);

13 years agompdclient: handle mpd_send_add's return value
Jonathan Neuschäfer [Sat, 29 Oct 2011 13:19:02 +0000 (15:19 +0200)]
mpdclient: handle mpd_send_add's return value

13 years agoconfigure.ac: add missing AC_MSG_RESULT
Jonathan Neuschäfer [Thu, 27 Oct 2011 00:02:49 +0000 (02:02 +0200)]
configure.ac: add missing AC_MSG_RESULT

13 years agompdclient_connect: fix parenthesis style
Jonathan Neuschäfer [Mon, 24 Oct 2011 13:04:00 +0000 (15:04 +0200)]
mpdclient_connect: fix parenthesis style

13 years agoscreen_outputs.c: fix indentation
Jonathan Neuschäfer [Sun, 23 Oct 2011 23:04:13 +0000 (01:04 +0200)]
screen_outputs.c: fix indentation

13 years agotitle_bar.c: include config.h directly
Jonathan Neuschäfer [Tue, 11 Oct 2011 22:18:57 +0000 (00:18 +0200)]
title_bar.c: include config.h directly

13 years agooptions: remove double-semicolon
Jonathan Neuschäfer [Sat, 3 Sep 2011 12:42:09 +0000 (14:42 +0200)]
options: remove double-semicolon

13 years agoNEWS: screen_queue: follow songs being moved
Jonathan Neuschäfer [Wed, 12 Oct 2011 22:02:32 +0000 (00:02 +0200)]
NEWS: screen_queue: follow songs being moved

Done in commit d71be00d7bbd135c1cd7ec2cfe38774a8a0b373f.

13 years agoconvert NEWS to UTF-8
Jonathan Neuschäfer [Wed, 12 Oct 2011 21:57:59 +0000 (23:57 +0200)]
convert NEWS to UTF-8

13 years agoresolve.c: Only include netdb.h when not on WIN32
Avuton Olrich [Sun, 23 Oct 2011 01:10:34 +0000 (18:10 -0700)]
resolve.c: Only include netdb.h when not on WIN32

13 years agoscreen.c: re-enable the leaveok optimization
Jonathan Neuschäfer [Wed, 19 Oct 2011 20:53:06 +0000 (22:53 +0200)]
screen.c: re-enable the leaveok optimization

Of course only if we don't need the cursor.

13 years agoscreen_lyrics: fix lyrics_title on small screens
Jonathan Neuschäfer [Wed, 19 Oct 2011 20:27:47 +0000 (22:27 +0200)]
screen_lyrics: fix lyrics_title on small screens

It turns out snprintf returns the length of the resulting string, not
the actual number of bytes copied into the buffer, e.g. the following
call will return 33, and not 7 (or 8):

   snprintf(buffer, 8, "this string is 33 characters long");

This patch also adds empty lines around the code dealing with the
plugin name to help readabiliy.

13 years agoremove unused typedef screen_functions_t
Jonathan Neuschäfer [Wed, 12 Oct 2011 20:15:57 +0000 (22:15 +0200)]
remove unused typedef screen_functions_t

<@cirrus> legacy, I think.

13 years agoscreen.c: don't disable CMD_SCREEN_SWAP on !OUTPUTS_SCREEN
Jonathan Neuschäfer [Wed, 12 Oct 2011 19:53:47 +0000 (21:53 +0200)]
screen.c: don't disable CMD_SCREEN_SWAP on !OUTPUTS_SCREEN

13 years agoMakefile.am: fix a typo ("smalles")
Jonathan Neuschäfer [Tue, 11 Oct 2011 21:54:57 +0000 (23:54 +0200)]
Makefile.am: fix a typo ("smalles")

13 years agoscreen_queue: fix a typo: "revceived"
Jonathan Neuschäfer [Tue, 27 Sep 2011 18:26:58 +0000 (20:26 +0200)]
screen_queue: fix a typo: "revceived"

13 years agofilelist: simplify some code
Jonathan Neuschäfer [Tue, 27 Sep 2011 17:13:43 +0000 (19:13 +0200)]
filelist: simplify some code

clang --analyze pointed me to this code:
src/filelist.c:146:3: warning: Value stored to 'iter' is never read

13 years agodocument screen_find, make it return bool
Jonathan Neuschäfer [Sun, 25 Sep 2011 22:02:40 +0000 (00:02 +0200)]
document screen_find, make it return bool

13 years agopo: update Ukrainian translation
Oleksandr Kovalenko [Wed, 21 Sep 2011 15:23:01 +0000 (17:23 +0200)]
po: update Ukrainian translation

13 years agoMinor grammar errors and inconsistent punctuation in the ncmpc man page
Isabell Long [Fri, 16 Sep 2011 19:25:17 +0000 (21:25 +0200)]
Minor grammar errors and inconsistent punctuation in the ncmpc man page

13 years agoMerge branch 'regr' of git://git.musicpd.org/jn/ncmpc
Max Kellermann [Wed, 21 Sep 2011 15:28:04 +0000 (17:28 +0200)]
Merge branch 'regr' of git://git.musicpd.org/jn/ncmpc

13 years agoscreen_queue: fix CMD_LIST_MOVE_*
Jonathan Neuschäfer [Sat, 17 Sep 2011 20:16:50 +0000 (22:16 +0200)]
screen_queue: fix CMD_LIST_MOVE_*

The code now tries to keep as much as possible of the selection being
moved visible.

13 years agolist_window: export scroll-after-cursor code
Jonathan Neuschäfer [Sat, 17 Sep 2011 20:11:04 +0000 (22:11 +0200)]
list_window: export scroll-after-cursor code

This moves the list_window_check_origin code into a new, more generic
function, which is exported.

13 years agooptions: fix the --key-file help text
Jonathan Neuschäfer [Sat, 3 Sep 2011 12:27:24 +0000 (14:27 +0200)]
options: fix the --key-file help text

13 years agoRevert "screen_queue: use list_window_move_cursor"
Jonathan Neuschäfer [Sat, 10 Sep 2011 22:02:27 +0000 (00:02 +0200)]
Revert "screen_queue: use list_window_move_cursor"

I hadn't quite understood what list_window_move_cursor does, and didn't
test the change.

This reverts commit aba25b543d7a34ce46964a7f22e495cdc3b57852.

13 years agoconfigure.ac: update comment "Check for glib-2.4"
Jonathan Neuschäfer [Fri, 16 Sep 2011 18:10:56 +0000 (20:10 +0200)]
configure.ac: update comment "Check for glib-2.4"

13 years agomain: avoid gcc warning for LOCALE && !NLS
Jonathan Neuschäfer [Thu, 15 Sep 2011 17:14:53 +0000 (19:14 +0200)]
main: avoid gcc warning for LOCALE && !NLS

Mark charset as G_GNUC_UNUSED if ncmpc hasn't been configured with NLS.

13 years agodoc/ncmpc.lirc: fix a typo ("ncmcp")
Jonathan Neuschäfer [Sun, 11 Sep 2011 08:43:43 +0000 (10:43 +0200)]
doc/ncmpc.lirc: fix a typo ("ncmcp")

13 years agooptions: remove misleading MAX_LONGOPT_LENGTH
Jonathan Neuschäfer [Sat, 3 Sep 2011 22:43:06 +0000 (00:43 +0200)]
options: remove misleading MAX_LONGOPT_LENGTH

13 years agolist_window: "if ( x)" -> "if (x)"
Jonathan Neuschäfer [Sat, 3 Sep 2011 22:26:04 +0000 (00:26 +0200)]
list_window: "if ( x)" -> "if (x)"

13 years agomanpage: update the search-mode documentation
Jonathan Neuschäfer [Thu, 25 Aug 2011 22:55:52 +0000 (00:55 +0200)]
manpage: update the search-mode documentation

13 years agoMerge remote branches 'jn/doc', 'jn/stuff' and 'jn/stuff1'
Max Kellermann [Wed, 31 Aug 2011 13:59:47 +0000 (15:59 +0200)]
Merge remote branches 'jn/doc', 'jn/stuff' and 'jn/stuff1'

13 years agoscreen_queue: use list_window_move_cursor
Jonathan Neuschäfer [Wed, 31 Aug 2011 12:27:52 +0000 (14:27 +0200)]
screen_queue: use list_window_move_cursor

It ensures the cursor stays visible.

13 years agolist_window: document list_window_center
Jonathan Neuschäfer [Wed, 31 Aug 2011 11:20:31 +0000 (13:20 +0200)]
list_window: document list_window_center

13 years agofix a typo ("connectiond")
Jonathan Neuschäfer [Wed, 31 Aug 2011 10:41:19 +0000 (12:41 +0200)]
fix a typo ("connectiond")

13 years agoplugin: fix plugin_callback_t documentation
Jonathan Neuschäfer [Sun, 21 Aug 2011 22:19:14 +0000 (00:19 +0200)]
plugin: fix plugin_callback_t documentation

13 years agoscreen_lyrics: clarify some code
Jonathan Neuschäfer [Sun, 21 Aug 2011 21:40:53 +0000 (23:40 +0200)]
screen_lyrics: clarify some code

13 years agolist_window.h: "non-zero" -> "true", we use bool
Jonathan Neuschäfer [Mon, 29 Aug 2011 19:47:23 +0000 (21:47 +0200)]
list_window.h: "non-zero" -> "true", we use bool

13 years agocommand: use RET instead of 13 for '\r'
Jonathan Neuschäfer [Sat, 27 Aug 2011 12:37:16 +0000 (14:37 +0200)]
command: use RET instead of 13 for '\r'

13 years agocommand: use KEY_CTL
Jonathan Neuschäfer [Sat, 27 Aug 2011 01:46:34 +0000 (03:46 +0200)]
command: use KEY_CTL

And add the convenience macro C().

13 years agocommand: add macro KEY_CTL()
Jonathan Neuschäfer [Sat, 27 Aug 2011 01:16:49 +0000 (03:16 +0200)]
command: add macro KEY_CTL()

I copied it from tig[1], which is licensed under the GPLv2+, so we
may use the code.

[1] http://jonas.nitro.dk/tig/

13 years agocommand: white space cosmetics
Jonathan Neuschäfer [Sat, 27 Aug 2011 01:09:19 +0000 (03:09 +0200)]
command: white space cosmetics

Restore the old idention style of the key code macros, it was
destoyed by commit f81333d (code style, indent with tabs XI).
(That's a long time ago, I know.)

13 years agoscreen_artist: document add_query (some more)
Jonathan Neuschäfer [Sat, 27 Aug 2011 00:28:28 +0000 (02:28 +0200)]
screen_artist: document add_query (some more)

13 years agoscreen_artist: don't use artist directly in add_query
Jonathan Neuschäfer [Sat, 27 Aug 2011 00:19:02 +0000 (02:19 +0200)]
screen_artist: don't use artist directly in add_query

13 years agoscreen_artist: add_query: add a "const"
Jonathan Neuschäfer [Fri, 26 Aug 2011 23:46:17 +0000 (01:46 +0200)]
screen_artist: add_query: add a "const"

13 years agoscreen_search: make SEARCH_ARTIST_TITLE part of an enum
Jonathan Neuschäfer [Fri, 26 Aug 2011 01:10:30 +0000 (03:10 +0200)]
screen_search: make SEARCH_ARTIST_TITLE part of an enum

13 years agoconf.c: unbreak two short lines, remove parentheses
Jonathan Neuschäfer [Thu, 25 Aug 2011 22:34:06 +0000 (00:34 +0200)]
conf.c: unbreak two short lines, remove parentheses

13 years agoincrease connection timeout to 5 seconds
Max Kellermann [Tue, 23 Aug 2011 16:08:51 +0000 (18:08 +0200)]
increase connection timeout to 5 seconds

1.5 seconds was not long enough for some MPD operations.  The
disadvantage is that the user may have to wait up to 5 seconds without
screen updates, because ncmpc doesn't do full asynchronous I/O yet.

13 years agompdclient: pass integer timeout to mpdclient_connect()
Max Kellermann [Tue, 23 Aug 2011 16:07:33 +0000 (18:07 +0200)]
mpdclient: pass integer timeout to mpdclient_connect()

Use milliseconds instead of float seconds.  Reduces overhead.

13 years agoscreen_lyrics: prevent a double free/use after free
Jonathan Neuschäfer [Mon, 22 Aug 2011 08:11:06 +0000 (10:11 +0200)]
screen_lyrics: prevent a double free/use after free

And a memory leak.

13 years agoimplement the "lyrics-timeout" config option
Jonathan Neuschäfer [Sat, 20 Aug 2011 20:40:50 +0000 (22:40 +0200)]
implement the "lyrics-timeout" config option

13 years agoscreen_lyrics: optionally show the plugin used
Jonathan Neuschäfer [Wed, 27 Jul 2011 18:58:18 +0000 (20:58 +0200)]
screen_lyrics: optionally show the plugin used

This feature is disabled by default, because I guess that most users
won't want to use it.

13 years agoplugin: pass the plugin name to the callback
Jonathan Neuschäfer [Wed, 27 Jul 2011 15:26:40 +0000 (17:26 +0200)]
plugin: pass the plugin name to the callback

13 years agolyricwiki: allow ampersands in artist/song names
Jonathan Neuschäfer [Mon, 8 Aug 2011 22:47:36 +0000 (00:47 +0200)]
lyricwiki: allow ampersands in artist/song names

13 years agooptions.c: use a for loop in options_parse
Jonathan Neuschäfer [Tue, 26 Jul 2011 12:49:19 +0000 (14:49 +0200)]
options.c: use a for loop in options_parse

It just looks cleaner.

13 years agoremove the rest of the splash screen
Jonathan Neuschäfer [Tue, 26 Jul 2011 11:04:12 +0000 (13:04 +0200)]
remove the rest of the splash screen

See http://musicpd.org/mantis/view.php?id=2981