screen: disable the welcome screen list with a GLib timer
main: added functions dis/enable_update_timer()
playlist: removed unused macros
Removed ENABLE_PLCHANGES and MPD_ERROR.
Removed ENABLE_PLCHANGES and MPD_ERROR.
screen_search: eliminate duplicate results
Merge branch 'master' of git://git.musicpd.org/mithi/ncmpc
screen_search: moved code to screen_search_reload()
This function creates an empty list when the search query has failed.
It is now used on CMD_SCREEN_UPDATE.
This function creates an empty list when the search query has failed.
It is now used on CMD_SCREEN_UPDATE.
screen_search: check for SEARCH_URI in search_simple_query()
Call mpd_search_add_uri_constraint() in this case.
Call mpd_search_add_uri_constraint() in this case.
lyricwiki plugin: updated to their latest layout
hd plugin: fix exit code
mpdclient: removed mpdclient_filelist_get()
Not used anymore.
Not used anymore.
utils: don't use mpdclient_filelist_get() in gcmp_list_from_path()
Use libmpdclient's mpd_send_list_meta() instead. This way, we can
stream MPD's response into the GList, and we don't need to read the
full filelist response.
Use libmpdclient's mpd_send_list_meta() instead. This way, we can
stream MPD's response into the GList, and we don't need to read the
full filelist response.
filelist: removed filelist_prepend()
This hack isn't used anymore.
This hack isn't used anymore.
screen_file: don't use mpdclient_filelist_get()
Use libmpdclient's mpd_send_list_meta() instead. This way, we don't
have to use filelist_prepend() to the first NULL entry.
Use libmpdclient's mpd_send_list_meta() instead. This way, we don't
have to use filelist_prepend() to the first NULL entry.
mpdclient: moved compare_filelistentry() to filelist.c
utils: simplify gcmp_list_from_path() with "continue"
"continue" the loop when one condition fails. This simplifies the
"if" conditions.
"continue" the loop when one condition fails. This simplifies the
"if" conditions.
utils: removed filelist_get()!=NULL check
A filelist object can never have NULL objects (but an entry's entity
object may be NULL).
A filelist object can never have NULL objects (but an entry's entity
object may be NULL).
screen_artist: don't use filelist_prepend()
filelist_prepend() is quite expensive. Let's insert the NULL entry
first, and append all entries while they are received.
filelist_prepend() is quite expensive. Let's insert the NULL entry
first, and append all entries while they are received.
mpdclient: removed mpdclient_filelist_search()
It's unused.
It's unused.
screen_artist: check cursor position in cmd() method
Fix segmentation faults when the list is empty.
Fix segmentation faults when the list is empty.
screen_artist: removed superfluous braces
screen_artist: don't use mpdclient_filelist_search()
Use libmpdclient directly. Side effect is that the listing of an
album includes the artist filter, too. Same album name of different
artists doesn't mix anymore.
Use libmpdclient directly. Side effect is that the listing of an
album includes the artist filter, too. Same album name of different
artists doesn't mix anymore.
screen_browser: select next item after select/add
Commit d08e14fa broke this: previously, the assignment
"cmd=CMD_LIST_NEXT" was passed to list_window_cmd(). With this patch,
list_window_cmd() was called before. Thanks to Thomas Jansen for
finding this one.
Commit d08e14fa broke this: previously, the assignment
"cmd=CMD_LIST_NEXT" was passed to list_window_cmd(). With this patch,
list_window_cmd() was called before. Thanks to Thomas Jansen for
finding this one.
plugin: handle stderr messages of lyrics plugins
Use a second pipe to capture error messages generated by lyrics plugins. If
one plugin succeeds to retrieve some lyrics, we display them and discard the
error messages. If no plugin succeeds, we show the error messages of all
plugins that failed with an exit code other than 69 (EX_UNAVAILABLE,
sysexits.h).
All plugins use exit code 0 to indicate success (i.e. they are able to provide
lyrics on stdout). Exit code 69 indicates failure to retrieve lyrics, but
otherwise normal operation of the plugin. A plugin returning exit code 69 is
not listed as a failed plugin. Other exit codes indicate an internal error in
the plugin. Those plugins are listed as failed along with the output they
provide on stderr.
Use a second pipe to capture error messages generated by lyrics plugins. If
one plugin succeeds to retrieve some lyrics, we display them and discard the
error messages. If no plugin succeeds, we show the error messages of all
plugins that failed with an exit code other than 69 (EX_UNAVAILABLE,
sysexits.h).
All plugins use exit code 0 to indicate success (i.e. they are able to provide
lyrics on stdout). Exit code 69 indicates failure to retrieve lyrics, but
otherwise normal operation of the plugin. A plugin returning exit code 69 is
not listed as a failed plugin. Other exit codes indicate an internal error in
the plugin. Those plugins are listed as failed along with the output they
provide on stderr.
mpdclient: don't check mpd_song_get_uri()!=NULL
libmpdclient guarantees that this function always returns non-NULL.
libmpdclient guarantees that this function always returns non-NULL.
screen_search: pass libmpdclient object to search_simple_query()
Pass mpd_connection instead of mpdclient. Let the caller handle
errors.
Pass mpd_connection instead of mpdclient. Let the caller handle
errors.
filelist: added constructor filelist_new_recv()
This receives a filelist from a mpd_connection. This code has existed
before, and this patch merges those.
This receives a filelist from a mpd_connection. This code has existed
before, and this patch merges those.
screen_search: pass libmpdclient object to search_advanced_query()
Let the caller handle the errors.
Let the caller handle the errors.
screen_search: return NULL if advanced search is not used
After parsing the query, return NULL immediately if no valid advanced
search query could be parsed. Our caller do_search() will then fall
back to the simple search.
After parsing the query, return NULL immediately if no valid advanced
search query could be parsed. Our caller do_search() will then fall
back to the simple search.
screen_search: use strchr() instead of strrstr()
strrstr() is more expensive, and we're just interested in whether
there is a colon, not where.
strrstr() is more expensive, and we're just interested in whether
there is a colon, not where.
screen_search: removed pointless loop in search_advanced_query()
screen_search: renamed filelist_search() to search_simple_query()
screen_search: call do_search() on CMD_SCREEN_UPDATE
The old code just called filelist_search(), which is the simple
search. This could not reload the "advanced" search result.
The old code just called filelist_search(), which is the simple
search. This could not reload the "advanced" search result.
screen_search: moved search calls to do_search()
screen_search: removed check for MPD >= 0.12
Redundant, this is checked in main.c right after connection was
established.
Redundant, this is checked in main.c right after connection was
established.
screen_client: recover from UPDATE_ALREADY error
If mpd_connection_clear_error() fails, revert to
mpdclient_handle_error().
If mpd_connection_clear_error() fails, revert to
mpdclient_handle_error().
use mpdclient_is_connected()
.. instead of accessing mpdclient.connection directly.
.. instead of accessing mpdclient.connection directly.
screen_song: pass mpd_connection to screen_song_add_stats()
Caller must handle the error.
Caller must handle the error.
screen_song: moved code to format_duration_short()
New function in utils.c. Use that same function in screen_play.c,
status_bar.c and strfsong.c.
New function in utils.c. Use that same function in screen_play.c,
status_bar.c and strfsong.c.
utils: pass preallocated buffer to format_duration_long()
utils: renamed time_seconds_to_durationstr()
Rename time_seconds_to_durationstr() to format_duration_long().
Rename time_seconds_to_durationstr() to format_duration_long().
status_bar: initialize the "buffer" variable with --enable-mini
Move one #endif.
Move one #endif.
screen_utils: moved screen_find() to screen_find.c
screen_browser: check connection in screen_file_cmd()
screen_file: check connection in screen_file_cmd()
screen_play: check connection in screen_playlist_cmd()
screen_play: fixed function prefix
Prefix must be "screen_playlist_".
Prefix must be "screen_playlist_".
screen_play: check the result of mpd_connection_clear_error()
mpdclient: convert all functions to return "bool"
No libmpdclient error codes.
No libmpdclient error codes.
mpdclient: removed several functions
Make the code use libmpdclient directly.
Make the code use libmpdclient directly.
screen: moved status message functions to screen_message.c
screen: removed unused macro MAX_SONGNAME_LENGTH
screen: eliminated state macros
Better do it manually.
Better do it manually.
screen: removed obsolete screen_error() prototype
screen: removed obsolete screen_get_id() prototype
screen: moved screen_interface externs to each screen header
Make a header for each screen implementation.
Make a header for each screen implementation.
screen: removed unused function volume_length()
screen_lyrics: don't use strfsong() to obtain tags
Use mpd_song_get_tag(). This guarantees that the tags are encoded in
UTF-8.
Use mpd_song_get_tag(). This guarantees that the tags are encoded in
UTF-8.
status_bar: use a GLib timer to remove the message
mpdclient: rewrite the "fancy swap" code
This is a trick to keep playlist swaps cheap: ncmpc tries to predict
the new playlist.
This is a trick to keep playlist swaps cheap: ncmpc tries to predict
the new playlist.
screen_play: use mpd_cmd_delete_range()
mpdclient: added mpdclient_cmd_delete_range()
MPD 0.16 supports "delete" with a range argument.
MPD 0.16 supports "delete" with a range argument.
mpdclient: rewrite the "fancy delete" code
This is a trick to keep playlist deletes cheap: ncmpc tries to predict
the new playlist.
This is a trick to keep playlist deletes cheap: ncmpc tries to predict
the new playlist.
mpdclient: rewrite the "fancy add" code
This is a trick to keep playlist adds cheap: ncmpc tries to predict
the new playlist.
This is a trick to keep playlist adds cheap: ncmpc tries to predict
the new playlist.
removed obsolete Makefile.am
playlist: renamed "id" to "version"
mpdclient: check to assertion in mpdclient_cmd_add()
It's illegal to pass song=NULL.
It's illegal to pass song=NULL.
screen_browser: add "const" to several variables
screen_browser: pass playlist object to sync_highlights()
And add the screen_browser_ prefix to the function name.
And add the screen_browser_ prefix to the function name.
updated .gitignore
screen_outputs: toggle_output() returns bool
screen_outputs: implemented the SCREEN_UPDATE command
This reloads the output list from MPD.
This reloads the output list from MPD.
screen_outputs: added update() method
Automatically queue the "output" idle event when the user
enables/disables an output.
Automatically queue the "output" idle event when the user
enables/disables an output.
moved struct screen_functions to screen_interface.h
mpdclient: added function mpdclient_get_current_song()
screen_play: query status.id instead of song.id
screen_search: renamed internal functions
Use the "screen_search_" prefix.
Use the "screen_search_" prefix.
screen_artist: renamed internal functions
Use the "screen_artist_" prefix.
Use the "screen_artist_" prefix.
screen_file: renamed internal functions
Use the "screen_file_" prefix.
Use the "screen_file_" prefix.
moved screen_file_goto_song() prototype to screen_file.h
mpdclient: removed all callbacks
All users have switched to mpdclient.events.
All users have switched to mpdclient.events.
screen: use idle events in screen_update()
screen_browser: removed browser_playlist_changed()
This function is unused, since we have switched to idle events.
This function is unused, since we have switched to idle events.
screen_search: use idle events instead of playlist/browse callback
screen_artist: use idle events instead of playlist/browse callback
screen_file: use idle events instead of playlist/browse callback
screen_play: use idle events instead of playlist_callback
mpdclient: added property "events", emulate idle
mpdclient_update() sets the "events" property after it has detected
changes. This helps us eliminate the callback functions, and is a
good preparation for the real "idle" commandd.
mpdclient_update() sets the "events" property after it has detected
changes. This helps us eliminate the callback functions, and is a
good preparation for the real "idle" commandd.
mpdclient: replaced error_callback with imported function
Instead of having a GList of callback functions, call
mpdclient_ui_error(), which is exported by screen_client.c.
Instead of having a GList of callback functions, call
mpdclient_ui_error(), which is exported by screen_client.c.
mpdclient: mpdclient_filelist_get() returns NULL on error
Don't artificially return an empty list when an error occurs.
Also don't insert the dummy ".." entry in mpdclient_filelist_get(),
screen_file.c should do this.
Don't artificially return an empty list when an error occurs.
Also don't insert the dummy ".." entry in mpdclient_filelist_get(),
screen_file.c should do this.
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()