| Commit message (Collapse) | Author | Files | Lines |
|
|
|
This new screen views all information available on a song: its
location, file name, and tags.
|
|
Return true/false instead of 1/0.
|
|
Pressing 'l' switches to the file browser (screen_file) and locates
the previously selected song in the server's database.
|
|
No wreadln() caller cares about an empty string. Simplify the callers
by returning NULL instead of an allocated empty string. This fixes
several memory leaks.
|
|
Don't convert the character set of strings to and from the current
locale. This library cannot know what the strings are going to be
used for, so it should not mess with them.
|
|
|
|
Disable lots of smaller features which don't have a separate configure
option:
- xterm title
- screen list
- horizontal scrolling
- MPD version number check
- key binding checks
- character set conversion
- bitrate display
- highlighting in the file browser
- completion / history
|
|
When compiling with libncursesw, include <ncursesw/ncurses.h> instead
of <ncurses.h> (if available).
|
|
screen_t is a singleton. We do not have to pass it around
everywhere. Export the one global variable.
|
|
None of the paint() implementations acutally uses the mpdclient
pointer. Remove it from the method signature.
|
|
Remove the last paint() dependency on the mpdclient pointer: remember
a pointer to the playlist object, and don't take it from mpdclient
every time we paint. Also add the variable "current_song_id" which is
calculated in update().
|
|
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.
|
|
gdb is for debugging. We don't need D() calls littered all over.
|
|
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.
|
|
"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.
|
|
Screen code shouldn't know anything about the screen ids (which will
be eliminated completely later). Instead of comparing ids, compare
the screen_functions pointer.
|
|
play_update() is the only update() implementation left, and it does
not use the screen pointer. Remove it from the method signature.
|
|
Instead of hiding the cursor in the update() callback, hide it with a
glib main loop timeout.
|
|
Repaint the playlist window on demand. Don't repaint it
unconditionally in play_update().
|
|
None of the paint() implementations actually use the screen pointer -
remove it from the method signature.
|
|
screen_paint() and screen_update() are responsible for refreshing the
screen. We can remove all wrefresh() and wnoutrefresh() invocations
from all paint() and update() method implementations.
|
|
Without clearing previous screen contents, there may be corruptions,
make this mandatory and optimize screen clearing.
|
|
Follow the same code style als MPD itself.
|
|
Instead of manually adjusting the selection, let list_window.c do it.
|
|
Since screen.c has default code for CMD_SCREEN_UPDATE, return 0 from
the command handlers and let screen.c do the rest.
|
|
Several screens ignore the attribute list_window->repaint. Don't set
it there. It will be replaced with a more intelligent repaint
algorithm later.
|
|
Since the input_timestamp is only used by screen_play, move it there.
|
|
Move the portion of screen_get_mouse_event() which handles list_window
clicks to list_window.c. The code contained a NULL pointer
dereference, which is now fixed.
|
|
The caller may check the playlist.id instead of checking the old
"updated" flag.
|
|
Fix several segmentation faults: when the connection to the MPD server
is lost, there were NULL pointer dereferences because
client->status==NULL. Check before accessing it.
|
|
Since the screen's initialization is guaranteed, we can remove the
NULL check in center_playing_item().
|
|
|
|
|
|
Since the list_window code sets highlight to 0 before it calls the
list_callback, the callback itself doesn't have to reset the flag.
|
|
Merge code which used to be duplicated in the screens "play", "help",
"lyrics".
|
|
If it is really important to set the curser, we should think of a
better way, instead of exporting one non-generic method. For now,
just set the cursor to the origin.
|
|
Compile time initialization saves resources, compared to run-time
initialization. Declare all screen_function structs as global
variables, and remove all get functions.
|
|
Using a doubly linked list for the local playlist copy is a huge waste
of both memory and CPU cycles. Use GArray instead of GList, which is
much faster in this case.
|
|
Add the "unused" attribute to all function parameters which are indeed
going to be ignored.
|
|
|
|
Rename local variables and function parameters, so they don't shadow
global variables.
|
|
A header should include all headers which he needs. Move local
includes on top, and let foo.c include foo.h in the first line, to
automatically test its dependencies.
|
|
Add missing prototypes, and fix wrong prototypes. Convert lots of
functions to "static" when they are only used within the current
source file.
|
|
Convert pointers to const whenever it is possible. Fixes all those
-Wconst warnings.
|
|
Follow the same code style als MPD itself. This patch only fixes
parts of the code which are going to be touched in the following bunch
of patches, i.e. there will be more "code style" patches in the
future.
|
|
Also remove some commented code and unused function parameters.
|