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()
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.