| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
We do not need to save a stack of list window states. When we return
to a parent directory, we just have to find the directory which we
come from in the parent list. Note that this patch resets the cursor
when going to the root directory, but I think it's not that important,
and I will deal with that later.
|
|
|
|
|
| |
The function filelist_find_directory() will be useful for the
following patch.
|
|
|
|
|
|
|
| |
The variable "album" was set to _("All tracks") when it was empty.
When reloading the songs, ncmpc was trying to find an album named "All
tracks", which didn't seem to work. Leave "album" in its canonical
form and generate the title text on demand.
|
|
|
|
|
| |
The GTK charset functions accept "-1" if the parameter is null
terminated.
|
| |
|
|
|
|
|
| |
g_basename() is always available, no need to implement a fallback.
Also use g_path_get_dirname(), g_path_get_basename().
|
|
|
|
| |
Don't duplicate code which is already provided by glib.
|
|
|
|
| |
Don't duplicate code which is already provided by glib.
|
| |
|
|
|
|
|
| |
Moved the format string for playlist files to the constant
"playlist_format".
|
|
|
|
|
| |
The code did not compile when HAVE_LOCALE_H was not set. Also don't
compile all that code in charset.c, when there is no locale.h.
|
|
|
|
|
| |
Convert the lyrics to the current character set before displaying
them.
|
|
|
|
|
| |
Use g_convert_with_fallback() for charset conversion, and don't print
a status bar message on error.
|
|
|
|
|
| |
Don't pass "noconvert" to charset_init(). Let charset_init()
determine that with g_get_charset() and return its name.
|
|
|
|
|
|
| |
my_strlen() is a bad name for the function, since the return value is
not a length, but a visible width on the screen. Rename it to
utf8_width() and change its return type to "unsigned".
|
|
|
|
|
| |
Move everything which deals with UTF-8 strings and character set
conversion to charset.c, header charset.h.
|
|
|
|
|
| |
Moved constants which are only used in one source file. Remove
several unused macros.
|
|
|
|
|
| |
Use options.list_format and options.status_format directly instead of
these two macros.
|
|
|
|
|
| |
Don't make everybody include ncmpc.h just to have generic features.
Move generic i18n macros to a separate header.
|
|
|
|
|
| |
Use the standard "bool" type instead of glib's "gboolean". This way,
options.h doesn't have to include the fat glib.h.
|
|
|
|
| |
This library isn't being used anymore, delete it.
|
|
|
|
|
| |
These macros are only used by options.c and conf.c. Move them to a
common internal header.
|
|
|
|
|
|
| |
Instead of checking whether options.list_format is set in the
LIST_FORMAT macro, initialize it once with options.list_format. Same
for options.status_format / STATUS_FORMAT.
|
|
|
|
| |
gdb is for debugging. We don't need D() calls littered all over.
|
|
|
|
|
|
| |
When we created created browser_cmd(), several functions of the
screen_browser API weren't used by other sources anymore. We can now
unexport them.
|
|
|
|
|
|
| |
screen_lyrics_switch() opens the lyrics screen and displays the lyrics
of the specified song. This way, the user may view the lyrics of any
song in the database browser.
|
|
|
|
|
| |
Provide an API for switching the currently displayed screen. Rename
switch_screen_mode() to screen_switch().
|
|
|
|
|
| |
Since the method types are used only once, we do not need typedefs for
that. Declare the method types within struct screen_functions.
|
|
|
|
| |
Merge a lot of code from the 3 browser screen into browser_cmd().
|
|
|
|
|
| |
By calling artist_lw_cmd() after the big switch, we can override
behaviour, and we can modify the command.
|
|
|
|
|
| |
artist_repaint() calls wrefresh(), don't call it again after
that.
|
|
|
|
| |
Pass constant pointers to strfsong() and screen_lyrics_load().
|
|
|
|
| |
Since screen.h checks the macros from config.h, we have to include it.
|
|
|
|
| |
The function "addprefix" is a GNU extension, don't use it.
|
|
|
|
|
| |
The variable $(lyrics_plugin_dir) was already declared in
configure.ac, don't declare it again in Makefile.am.
|
|
|
|
|
| |
Everybody who uses the ENABLE_ macros has to include ncmpc.h. We're
better off defining those in config.h via configure.ac.
|
|
|
|
|
| |
Due to a missing sync_highlights() call, highlights were gone when the
user pressed the "update" hot key.
|
|
|
|
|
|
| |
"metalist" can have different meanings, depending on the mode.
Replace it with two separate variables "artist_list" and "album_list".
This way, we can optimize screen updates later.
|
|
|
|
|
| |
Replaced update_metalist() with three specialized functions for mode
switching.
|
|
|
|
|
|
| |
Some callers of update_metalist() want to reload the list contents.
Add an optimized function reload_lists() which does not modify the
global variables "mode", "artist", "album".
|
|
|
|
|
| |
Moved special cases for loading artist, album, song lists to separate
functions.
|
|
|
|
|
|
|
|
|
| |
A linked list is quite uncomfortable here because there is a lot of
indexed access to the list. Use a GPtrArray of strings instead.
Note that mpdclient_get_artists_utf8() and mpdclient_get_albums_utf8()
return a linked list, and sorting is also performed on the linked
list. This will be optimized later.
|
|
|
|
| |
Generate these special list entries on the fly.
|
|
|
|
|
| |
To unify the code, wrap list_window_cmd() in artist_lw_cmd(), which
properly checks the current mode.
|
|
|
|
|
|
| |
"prev_song_id" and "current_song_id" had value 0 if MPD was not
playing at all. This way, ncmpc cannot see the difference between
"song 0 playing" and "not playing". Change "not playing" to -1.
|
|
|
|
|
| |
When deciding whether to repaint the current highlight, test if MPD is
actually playing. If MPD starts playing, repaint.
|
|
|
|
|
|
|
|
| |
The play_update() function was reduced too much: it didn't repaint the
screen when the current song changed. Add check for that.
Don't repaint the screen in center_playing_item(), make the caller do
it.
|
|
|
|
| |
Ignore SIGPIPE, and handle errno==EPIPE instead.
|
|
|
|
|
| |
If the lyrics screen is disabled at compile time, don't initialize the
lyrics library in main().
|
|
|
|
|
| |
CMD_ADD ('a') appends a song to the playlist, no matter if it is
already there, i.e. unlike CMD_SELECT, it does not toggle the song.
|