| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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.
|
|
|
|
|
| |
Due to a missing refresh() call, ncmpc painted the screen after one
second. Add refresh(), make ncmpc display immediately.
|
|
|
|
|
| |
Let us declare struct names in addition to typedef names, so we can
forward-declare them.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Nearly all of the code in paint_top_window() is on indent level 2,
just because it depends on a condition. Make this more readable and
move to indent level 1 by moving this code to a separate function.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4749 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3962 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3960 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3832 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3358 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3308 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1891 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1890 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1867 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1865 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|