mpdclient: removed the deprecated !ENABLE_SONG_ID code
The ENABLE_SONG_ID option has been enabled for ages.
The ENABLE_SONG_ID option has been enabled for ages.
mpdclient: merged error_cb() into mpdclient_handle_error()
Let mpd_connection_clear_error() decide if the error was fatal.
Let mpd_connection_clear_error() decide if the error was fatal.
mpdclient: abort ncmpc if out of memory
When mpd_connection_new() returns NULL, there's not much we can do.
When mpd_connection_new() returns NULL, there's not much we can do.
main: don't skip "{}" in server error message
libmpdclient2 discards the command name from the error message, we
don't need to do it again.
libmpdclient2 discards the command name from the error message, we
don't need to do it again.
mpdclient: added mpdclient_is_connected()
This allows us to remove the global "connected" variable from main.c.
This allows us to remove the global "connected" variable from main.c.
main: changed "connected" check to assertion
timer_reconnect() must not be called when ncmpc is already connected.
timer_reconnect() must not be called when ncmpc is already connected.
screen_search: clear return value on error
search_advanced_query() has a redundant "fl!=NULL" check, and it does
not clear the "fl" variable after freeing the object.
search_advanced_query() has a redundant "fl!=NULL" check, and it does
not clear the "fl" variable after freeing the object.
screen_play: repaint hscrolling only if selected item is wide
When the "scroll" option is active, ncmpc repainted the whole screen
with each tick, even if the selected item is not wider than the
screen. This wasted a lot of CPU cycles.
When the "scroll" option is active, ncmpc repainted the whole screen
with each tick, even if the selected item is not wider than the
screen. This wasted a lot of CPU cycles.
moved the idle timer to player_command.c
Create it only on demand, while seeking.
Create it only on demand, while seeking.
player_command: handle_player_command() returns bool
screen: moved screen_client_cmd() to player_command.c
mpdclient: removed the mpdclient_t typedef
Use forward-declared struct instead. This also removes the typedefs
mpdclient_filelist_t, mpdclient_filelist_entry_t,
mpdclient_playlist_t.
Use forward-declared struct instead. This also removes the typedefs
mpdclient_filelist_t, mpdclient_filelist_entry_t,
mpdclient_playlist_t.
po: updated Chinese translation
po: updated German translation
po: updated French translation
use libmpdclient2
screen_search: pass const string to search_get_tag_id()
Modify version string to post-release version 0.16~git
ncmpc version 0.15
po: updated Danish, Swedish and Norwegian translations
po: updated Ukrainian translation
po: regenerated ncmpc.pot and *.po
Only line number changes.
Only line number changes.
test.sh: fix the ncmpc-tiny target path
screen_play: fix "unused" warning on NCMPC_MINI
format_duration() is not used.
format_duration() is not used.
screen_lyrics, screen_song: duplicate "next_song"
The screen_X_switch() function calls screen_switch. As a side effect
of the previous screen being closed, the next_song pointer may become
invalid, which causes memory corruption. Let's duplicate the song
when assigning it to next_song.
The screen_X_switch() function calls screen_switch. As a side effect
of the previous screen being closed, the next_song pointer may become
invalid, which causes memory corruption. Let's duplicate the song
when assigning it to next_song.
screen_play: another missing second_column NULL check
screen_play's list_callback could segfault, when second_column pointed
to a NULL pointer.
screen_play's list_callback could segfault, when second_column pointed
to a NULL pointer.
screen_file: splitted file_change_directory()
Split it into three operations: change to a specific absolute
directory, change to parent directory, and change to directory
referred by a filelist_entry_t.
Split it into three operations: change to a specific absolute
directory, change to parent directory, and change to directory
referred by a filelist_entry_t.
screen_browser: browser_get_selected_X() returns const object
No caller modifies these objects. It's safe to return const.
No caller modifies these objects. It's safe to return const.
mpdclient: clear the "connection" variable on error
This also adds several "connection==NULL" checks, and thus fixes a
NULL pointer dereference, which could occur when you pressed "tab" too
early, before the connection was established (Debian bug #540415).
This also adds several "connection==NULL" checks, and thus fixes a
NULL pointer dereference, which could occur when you pressed "tab" too
early, before the connection was established (Debian bug #540415).
screen_search, screen_outputs: added connection==NULL checks
Don't attempt to call MPD when there is no connection.
Don't attempt to call MPD when there is no connection.
screen_browser: added filelist==NULL checks
If ncmpc could not get a list of files, browser->filelist may be
NULL. This patch adds two missing checks.
If ncmpc could not get a list of files, browser->filelist may be
NULL. This patch adds two missing checks.
screen_play: fix segfault during search
second_column may be NULL (e.g. during search), check before dereferencing it.
second_column may be NULL (e.g. during search), check before dereferencing it.
filelist: removed "path" attribute
Callers should track their current path manually, instead of relying
on an the filelist object.
Callers should track their current path manually, instead of relying
on an the filelist object.
screen_browser: browser_change_directory() to screen_file.c
This is completely specific to screen_file, and should live there.
This is completely specific to screen_file, and should live there.
screen_browser: export browser_get_selected_entry()
Rename browser_get_selected() to browser_get_selected_entry() first.
Rename browser_get_selected() to browser_get_selected_entry() first.
screen_browser: added function browser_get_selected_song()
Shortcut for several command handlers.
Shortcut for several command handlers.
screen_browser: pass mpd_PlaylistFile object to load_playlist()
screen_browser: moved range selection check to browser_get_selected()
browser_get_selected() should not return an item when multiple items
are selected (range selection).
browser_get_selected() should not return an item when multiple items
are selected (range selection).
plugin: show plugin error messages on the screen
Due to a typo, stdout was redirected twice to the pipe, and stderr was
forgotten.
Due to a typo, stdout was redirected twice to the pipe, and stderr was
forgotten.
update lyricwiki plugin to lyric.wikia.com
Lyricwiki was integrated into wikia.com. This changed the URL and once
again the API.
Lyricwiki was integrated into wikia.com. This changed the URL and once
again the API.
update lyrics screen when a new song starts
When a new song starts and the lyrics screen is displayed, fetch the lyrics
for the new song and display them. Don't switch to the new song's lyrics if
the lyrics screen was opened for a specific song.
When a new song starts and the lyrics screen is displayed, fetch the lyrics
for the new song and display them. Don't switch to the new song's lyrics if
the lyrics screen was opened for a specific song.
mpdclient: moved code to mpdclient_handle_error()
Merge branch 'master' of git://git.musicpd.org/patrick/ncmpc
automatically save lyrics
Added the option "lyrics-autosave" to save lyrics automatically after
receiving them. By default, the option is off. If the option is enabled,
lyrics are only saved if no such file exists, so we don't accidentally
overwrite lyrics.
Added the option "lyrics-autosave" to save lyrics automatically after
receiving them. By default, the option is off. If the option is enabled,
lyrics are only saved if no such file exists, so we don't accidentally
overwrite lyrics.
updated lyricwiki plugin
Lyricwiki doesn't provide lyrics directly through it's API anymore. Instead, a
link to the lyrics is returned if they were found. Follow that link to get the
real thing.
Lyricwiki doesn't provide lyrics directly through it's API anymore. Instead, a
link to the lyrics is returned if they were found. Follow that link to get the
real thing.
screen_play: Fixed the scrolling in the playlist screen.
Since commit 850ad87b588dd6cbb96e5558ee671f2c95cc839d, which introduced
a second column with the length of the song in the playlist screen, scrolling
of the entries would sometimes not work, if the entry was smaller than the
screen, but bigger than the first column.
This easy patch fixes this by using the real size of the first column to decide
whether to start scrolling.
Since commit 850ad87b588dd6cbb96e5558ee671f2c95cc839d, which introduced
a second column with the length of the song in the playlist screen, scrolling
of the entries would sometimes not work, if the entry was smaller than the
screen, but bigger than the first column.
This easy patch fixes this by using the real size of the first column to decide
whether to start scrolling.
screen_song: Added the length of the song to the song screen.
po: removed superfluous "<" character from Hebrew
Broken by the previous commit :(
Broken by the previous commit :(
po: added missing %s in Hebrew format string
po: added Hebrew translation
mpdclient: pass const song object to mpdclient_cmd_add()
Fixed rogue character after volume change
Volume changes that result in a shorter string length did not clean up the
now unused characters. We check the expected (relative) string length before
updating the screen and do a full repaint in that case.
Volume changes that result in a shorter string length did not clean up the
now unused characters. We check the expected (relative) string length before
updating the screen and do a full repaint in that case.
mpdclient: pass const strings
The mpdclient library doesn't modify the parameter strings, let's make
them const.
The mpdclient library doesn't modify the parameter strings, let's make
them const.
added valgrind.suppressions
screen_song: free mpd_stats object
Fix a memory leak.
Fix a memory leak.
main: free timers on exit
Make valgrind happier.
Make valgrind happier.
ncu: free the SCREEN on exit
Make valgrind happier.
Make valgrind happier.
options: added options_deinit()
Clean up before exiting, make valgrind happy.
Clean up before exiting, make valgrind happy.
options: removed NULL checks before g_free()
g_free() handles NULL parameters well.
g_free() handles NULL parameters well.
screen: free ncurses windows with delwin()
Clean up before exiting, make valgrind happy.
Clean up before exiting, make valgrind happy.
playlist: addded playlist_get_index_from_same_song()
playlist: pass const pointers when possible
screen_play: use "idx" instead of "song->pos"
The attribute song->pos may be unreliable. Since the list_window.c
code already passed the current position to us (parameter "idx"),
let's use it instead.
The attribute song->pos may be unreliable. Since the list_window.c
code already passed the current position to us (parameter "idx"),
let's use it instead.
screen_play: fix duration "0:-1"
If the song duration is not known (MPD_SONG_NO_TIME), don't attempt to
print -1 in the second column.
If the song duration is not known (MPD_SONG_NO_TIME), don't attempt to
print -1 in the second column.
screen_play: moved g_strdup_printf() call to format_duration()
file: moved strcmp() call to inline function same_song()
list_window: added the "hardware_cursor" option
This option makes ncurses look a little bit ugly, but it is important
for blind ncmpc users who depend on a braille display. The braille
display shows the position of the hardware cursor, but is unable to
display the "inverse colors" of the traditional ncmpc cursor.
This option makes ncurses look a little bit ugly, but it is important
for blind ncmpc users who depend on a braille display. The braille
display shows the position of the hardware cursor, but is unable to
display the "inverse colors" of the traditional ncmpc cursor.
updated NEWS
display songs time in playlist
Add the way to display a second column in a list window, and use it to
display the songs time in playlist.
It isn't displayed with NCMPC_MINI.
[mk: unbreak wide-cursor=no]
Add the way to display a second column in a list window, and use it to
display the songs time in playlist.
It isn't displayed with NCMPC_MINI.
[mk: unbreak wide-cursor=no]
mpdclient: added mpdclient_cmd_volume_up(), mpdclient_cmd_volume_down()
mpdclient: moved browse callback invocation from screen.c
The screen code shouldn't bother to do any callbacks, because screen.c
should only care about the GUI. Move that invocation to the mpdclient
library.
The screen code shouldn't bother to do any callbacks, because screen.c
should only care about the GUI. Move that invocation to the mpdclient
library.
mpdclient: tweak updatingdb in mpdclient.c
The mpdclient library should care about setting the new (temporary)
MPD update status.
The mpdclient library should care about setting the new (temporary)
MPD update status.
screen_search: removed unused macros
Removed SEARCH_TITLE, ...
Removed SEARCH_TITLE, ...
screen: added local "state" variable
Don't check "status != NULL" each time we need the MPD state.
Don't check "status != NULL" each time we need the MPD state.
screen: moved code to get_volume()
screen: removed spaces from the "Volume" strings
Don't let translators bother with whitespace.
Don't let translators bother with whitespace.
po: regenerated ncmpc.pot
po: updated Swedish translation
po: updated Norwegian translation
mpdclient: return from mpdclient_cmd_crop() on error
When the playlist is too small for crop, or when MPD is not playing,
"return" from mpdclient_cmd_crop() instead of stepping over the
command list block. This patch also simplifies the command list, and
frees the mpd_Status object before all checks are done.
When the playlist is too small for crop, or when MPD is not playing,
"return" from mpdclient_cmd_crop() instead of stepping over the
command list block. This patch also simplifies the command list, and
frees the mpd_Status object before all checks are done.
mpdclient: finish the "status" command in mpdclient_cmd_crop()
The crop function calls mpd_getStatus(), but never finishes that
command. There's a mpdclient_finish_command() call at the end of the
function, but that is supposed to finish the delete command list.
The crop function calls mpd_getStatus(), but never finishes that
command. There's a mpdclient_finish_command() call at the end of the
function, but that is supposed to finish the delete command list.
mpdclient: convert MPD_ERROR() to an inline function
mpdclient: include utils.h
Don't import string_list_free() manually.
Don't import string_list_free() manually.
mpdclient: pass const message to error callback
Makefile.am: run sparse once
Makefile.am: install lyrics plugins with automake
Set $(lyrics_SCRIPTS) instead of manually installing those plugins.
This is more consistent with automake, and automake gives us
uninstall.
Set $(lyrics_SCRIPTS) instead of manually installing those plugins.
This is more consistent with automake, and automake gives us
uninstall.
Makefile.am: no recursive Makefile
po: updated Danish translation
screen_play: added CMD_SELECT_PLAYING
This command immediately selects (but doesn't center) the currently
playing song. It is mapped by default to 'l' - there aren't many single
characters left, and this one is at least similar to ctrl-l, which
centers the currently playing song.
This command immediately selects (but doesn't center) the currently
playing song. It is mapped by default to 'l' - there aren't many single
characters left, and this one is at least similar to ctrl-l, which
centers the currently playing song.
Modify version string to post-release version 0.15~git
ncmpc version 0.14
po: updated Danish and Swedish translation
po: updated German translation
po: updated Korean translation
.gitignore: added ncmpc-tiny
screen_play: make center_playing_item aware of scroll offset
When moving the cursor to make sure it is visible after recentering,
move it to the offset position from the edge of the screen.
(Previously, it was placed at the edge, causing the offset to force the
screen to scroll.)
When moving the cursor to make sure it is visible after recentering,
move it to the offset position from the edge of the screen.
(Previously, it was placed at the edge, causing the offset to force the
screen to scroll.)
po: updated Spanish and Galician translation
po: updated Russian translation
po: updated Simplified Chinese translation
screen_help: added translator comment for CMD_INTERRUPT