screen_play: remember the id of the selected song
When the playlist changes, restore the song selection.
When the playlist changes, restore the song selection.
screen_play: added helper function playlist_selected_song()
screen_play: fixed list_window.range_selection usage
It's a bool.
It's a bool.
mpdclient.h: include mpd/client.h instead of mpd/tag.h
mpd/tag.h is not part of the libmpdclient2 API.
mpd/tag.h is not part of the libmpdclient2 API.
mpdclient: renamed "updatingdb" to "update_id"
Adopt libmpdclient's name.
Adopt libmpdclient's name.
player_command: use libmpdclient2 directly
Don't use mpdclient_cmd_X().
Don't use mpdclient_cmd_X().
screen: moved code to status_bar.c
screen_utils: don't pass WINDOW to screen_readln()
Callers shouldn't care which window will be used; we're going to use
the global variable screen.status_window.
Callers shouldn't care which window will be used; we're going to use
the global variable screen.status_window.
screen_utils: removed unused function screen_getstr()
screen_browser: repair the "mini" version
Added missing "}".
Added missing "}".
mpdclient: initialize "retval" in mpdclient_update()
screen: moved code to title_bar.c
screen: moved more (de)initialization code to progress_bar.c
mpdclient, screen: don't use MPD_STATUS_NO_VOLUME
It was removed from libmpdclient.
It was removed from libmpdclient.
progress_bar: do first paint manually
screen: moved refresh() to ncu_init()
The ncurses initialization code should do the refresh() to clear the
terminal, while screen_init() should reveal the empty controls
(progress bar currently).
The ncurses initialization code should do the refresh() to clear the
terminal, while screen_init() should reveal the empty controls
(progress bar currently).
screen: moved code to progress_bar.c
This class repaints only if the bar width has really changed. It uses
integer division instead of floating point.
This class repaints only if the bar width has really changed. It uses
integer division instead of floating point.
screen: moved struct window to window.h
mpdclient: handle password errors properly in mpdclient_connect()
Abort the connection when the configured password fails.
Abort the connection when the configured password fails.
screen_play: repaint on playlist change
When the playlist version changes, repaint the playlist screen. This
fixes a regression from the patch "repaint hscrolling only if selected
item is wide".
When the playlist version changes, repaint the playlist screen. This
fixes a regression from the patch "repaint hscrolling only if selected
item is wide".
screen_play: simplified function playlist_save()
mpdclient: mpdclient_update() returns bool
As a side effect, this patch adds the missing
mpdclient_finish_command() call to
mpdclient_playlist_update_changes().
As a side effect, this patch adds the missing
mpdclient_finish_command() call to
mpdclient_playlist_update_changes().
mpdclient: mpdclient_connect() returns bool
.. and disable recovery with mpdclient_handle_error().
.. and disable recovery with mpdclient_handle_error().
mpdclient: mpdclient_disconnect() returns void
There is no useful return value.
There is no useful return value.
screen_browser: optimize "add+play song" with addid/playid
Use the "addid"/"playid" commands in enqueue_and_play(). This
requires MPD 0.12.
Use the "addid"/"playid" commands in enqueue_and_play(). This
requires MPD 0.12.
require MPD 0.12
We will take advantage of the "addid" command, which was introduced in
MPD 0.12. Hey, who's still running 0.11 these days?
We will take advantage of the "addid" command, which was introduced in
MPD 0.12. Hey, who's still running 0.11 these days?
playlist: make functions const
And return const mpd_song objects.
And return const mpd_song objects.
playlist: pass struct mpdclient_playlist to functions
Passing a mpdclient object doesn't make sense in this library.
Passing a mpdclient object doesn't make sense in this library.
playlist: don't check mpd_song_get_uri()!=NULL
libmpdclient2 guarantees that each mpd_song object has an URI.
libmpdclient2 guarantees that each mpd_song object has an URI.
mpdclient: reactivate incremental playlist changes
A while ago, I broke "plchanges" calls because I forgot to add a "!"
before playlist_is_empty().
A while ago, I broke "plchanges" calls because I forgot to add a "!"
before playlist_is_empty().
screen_client: allow multiple queued database updates
MPD supports having multiple update paths in the queue. Let's just
invoke the "update" command and see what MPD responds.
MPD supports having multiple update paths in the queue. Let's just
invoke the "update" command and see what MPD responds.
screen_outputs: finish response in fill_outputs_list()
mpdclient: don't export mpdclient_finish_command()
Use plain libmpdclient2 functions plus mpdclient_handle_error()
instead.
Use plain libmpdclient2 functions plus mpdclient_handle_error()
instead.
mpdclient: export mpdclient_handle_error()
This function will allow callers to use libmpdclient2 directly.
This function will allow callers to use libmpdclient2 directly.
screen_file: moved update code to screen_client.c
Moved code from screen_file.c and player_command.c.
Moved code from screen_file.c and player_command.c.
screen_client: screen_auth() returns bool
true for success, false for error.
true for success, false for error.
screen_client: don't update twice in screen_auth()
One mpdclient_update() call is in _screen_auth(), and the second is in
screen_auth(). screen_auth() does not check whether _screen_auth()
was successful prior to that.
One mpdclient_update() call is in _screen_auth(), and the second is in
screen_auth(). screen_auth() does not check whether _screen_auth()
was successful prior to that.
screen_client: removed curs_set() call from screen_auth()
screen_read_password() is responsible for hiding the cursor when
finished.
screen_read_password() is responsible for hiding the cursor when
finished.
screen_utils: moved screen_auth() to screen_client.c
screen_client.c is a new library for MPD specific screen functions.
screen_client.c is a new library for MPD specific screen functions.
mpdclient: removed the "need_update" flag
It's set, but never read.
It's set, but never read.
mpdclient: removed the deprecated !ENABLE_PLCHANGES code
The ENABLE_PLCHANGES option has been enabled for ages.
The ENABLE_PLCHANGES option has been enabled for ages.
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.