| Commit message (Collapse) | Author | Files | Lines |
|
All functions must receive UTF-8 file names. Delete all which still
work with locale strings, and remove the _utf8 suffix from the others.
|
|
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
|
|
|
|
Convert wrln_max_line_size and wrln_max_history_length to local
constants. They have no real use outside of wreadln.c.
|
|
There are no special cases left for my_wgetch() to handle. We can
remove it and use the original wgetch() instead.
|
|
Variables which store integer seconds should be declared as GTime.
This fixes a gcc warning.
|
|
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.
|
|
Repaint immediately instead of setting "painted=0".
|
|
Default is colors disabled. Those who love colorful terminals have
the option to enable it with --enable-colors.
|
|
Follow the same code style als MPD itself.
|
|
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.
|
|
gdb is for debugging. We don't need D() calls littered all over.
|
|
Provide an API for switching the currently displayed screen. Rename
switch_screen_mode() to screen_switch().
|
|
Static variables, pointers vs integers, void function returning, ...
|
|
Everything is now managed with a pointer to the screen_functions
struct.
|
|
Trying to get rid of the screen ids. A pointer to screen_functions is
better for identifying a screen.
|
|
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.
|
|
Move the hard-coded screen list and everything which works with this
array to screen_list.c.
|
|
Instead of evaluating macros from config.h in the disabled source,
don't start the compiler on it at all.
|
|
play_update() is the only update() implementation left, and it does
not use the screen pointer. Remove it from the method signature.
|
|
None of the paint() implementations actually use the screen pointer -
remove it from the method signature.
|
|
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.
|
|
Moved basic libncurses initialization to ncu.c and ncu.h. Keep
generic code out of screen.c.
|
|
"welcome-screen-list" shows the screen list in the top row shortly
after startup, and is enabled by default.
|
|
If visible-bitrate is enabled, then the current bitrate will be drawn next
to the song time in the status bar. By default it will not be displayed.
|
|
The "crop" command deletes all songs from the playlist, except the one
currently being played.
|
|
Why should an audio player display a large clock?
|
|
CMD_PLAY is mapped to the Enter key by default. Some screens
(mis-)use it for navigation, for entering a directory. The playlist
screen actually plays the file under the cursor. On all other
screens, pressing Enter may be confusing, since it is more of a
"confirmation" key instead of "play". We should probaby add
CMD_CONFIRM later, but for now, disable the general CMD_PLAY handler
in screen.c. This fixes bug 240.
|
|
Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an
atexit() handler.
|
|
This big patch replaces our custom main loop with the event based glib
main loop. This has several advantages: we can make all the tiny code
bits in the main loop independent from each others, we can add
additional file descriptors for polling (e.g. the mpdclient socket).
We don't need the ncurses timeout() anymore, because glib will poll
stdin for us.
|
|
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.
|
|
Move all command handlers which need a connection to the MPD server to
screen_client_cmd(). This will allow us to unify error handling
later.
|
|
Follow the same code style als MPD itself.
|
|
|
|
When the selected screen does not exist, return before calling
close().
|
|
Since the number of screens is known at compile time, define a macro
which calculates this, instead of having a sentinel element.
|
|
Screens which are not active have already been closed, or have never
been opened. Don't call close again on them.
|
|
There can only be onle screen struct instance at a time. Declare it
as a static struct, instead of a pointer to the struct. This
simplifies all accesses, and avoids the dynamic allocation.
|
|
|
|
At startup, mode_fn is initialized with &screen_playlist, and it will
never be reset to NULL. Remove all checks.
|
|
That seems to be a fn->paint was checked, then the code called
fn->update(). Fix this.
|
|
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.
|
|
Follow the same code style als MPD itself.
|