aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-09-22added option "welcome-screen-list"David Shakaryan1-1/+2
"welcome-screen-list" shows the screen list in the top row shortly after startup, and is enabled by default.
2008-09-21added optional bitrate display to status barJ. Alexander Treuman1-4/+14
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.
2008-09-21Adding crop feature in ncmpcYannick LM1-0/+3
The "crop" command deletes all songs from the playlist, except the one currently being played.
2008-09-18removed the clock screenMax Kellermann1-10/+0
Why should an audio player display a large clock?
2008-09-18screen: don't handle CMD_PLAYMax Kellermann1-0/+2
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.
2008-09-18quit with g_main_loop_quit()Max Kellermann1-2/+0
Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an atexit() handler.
2008-09-18use the glib main event loopMax Kellermann1-2/+0
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.
2008-09-18screen: check MPD status only if connectedMax Kellermann1-38/+51
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.
2008-09-18screen: moved code to screen_client_cmd()Max Kellermann1-9/+24
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.
2008-09-17code style, indent with tabs IVMax Kellermann1-16/+15
Follow the same code style als MPD itself.
2008-09-17make several functions return voidMax Kellermann1-6/+2
2008-09-17screen: return early in switch_screen_mode() on errorMax Kellermann1-7/+7
When the selected screen does not exist, return before calling close().
2008-09-17screen: added macro NUM_SCREENSMax Kellermann1-25/+16
Since the number of screens is known at compile time, define a macro which calculates this, instead of having a sentinel element.
2008-09-17screen: close only current screen in screen_exit()Max Kellermann1-2/+3
Screens which are not active have already been closed, or have never been opened. Don't call close again on them.
2008-09-17screen: don't store "screen" as a pointerMax Kellermann1-140/+135
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.
2008-09-17screen: moved code to find_configured_screen()Max Kellermann1-10/+13
2008-09-17screen: mode_fn cannot be NULL, removed checksMax Kellermann1-17/+9
At startup, mode_fn is initialized with &screen_playlist, and it will never be reset to NULL. Remove all checks.
2008-09-17screen: before calling update(), check if it is definedMax Kellermann1-1/+1
That seems to be a fn->paint was checked, then the code called fn->update(). Fix this.
2008-09-17screen: removed screen_functions.get_lw()Max Kellermann1-9/+2
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.
2008-09-17replaced get_screen_X() with static screen_functions variableMax Kellermann1-32/+40
Compile time initialization saves resources, compared to run-time initialization. Declare all screen_function structs as global variables, and remove all get functions.
2008-09-17code style, indent with tabs IIIMax Kellermann1-9/+8
Follow the same code style als MPD itself.
2008-09-16initial draw without delayMax Kellermann1-0/+2
Due to a missing refresh() call, ncmpc painted the screen after one second. Add refresh(), make ncmpc display immediately.
2008-09-16screen: added struct namesMax Kellermann1-20/+17
Let us declare struct names in addition to typedef names, so we can forward-declare them.
2008-09-16code style, indent with tabs IIMax Kellermann1-5/+3
Follow the same code style als MPD itself.
2008-09-15use size_t and unsigned integersMax Kellermann1-3/+3
2008-09-15fix shadow warningsMax Kellermann1-16/+16
Rename local variables and function parameters, so they don't shadow global variables.
2008-09-15include cleanupMax Kellermann1-11/+8
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.
2008-09-15fix function prototypesMax Kellermann1-2/+3
Add missing prototypes, and fix wrong prototypes. Convert lots of functions to "static" when they are only used within the current source file.
2008-09-15const pointersMax Kellermann1-8/+8
Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
2008-09-15screen: moved code to paint_top_window2()Max Kellermann1-68/+74
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.
2008-09-15code style, indent with tabsMax Kellermann1-792/+753
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.
2008-09-15remove unused static functionsMax Kellermann1-1/+0
Also remove some commented code and unused function parameters.
2007-02-16way too much stuff to describe hereAndreas Obergrusberger1-22/+26
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-09-08multi liner ;) fixed segfaultAndreas Obergrusberger1-6/+5
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4749 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-09-07due to bensonk's demand i added a splash screen.Andreas Obergrusberger1-5/+10
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-04the updated sourcesAndreas Obergrusberger1-4/+18
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-28typoKalle Wallin1-1/+1
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3962 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-03-28unicode fixes from Dmitry Baryshkov/René van BevernKalle Wallin1-7/+8
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3960 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-01-16included patch from Jonathan ForsKalle Wallin1-4/+18
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3832 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-15New configuraton option: screen-listKalle Wallin1-9/+50
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3358 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-06Added an experimental artist (browser) screenKalle Wallin1-0/+15
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2005-06-03seek-time can now be defined in the conf fileKalle Wallin1-2/+2
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3308 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-11-15Added a search screenKalle Wallin1-1/+16
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-21Added debug code for #291Kalle Wallin1-3/+9
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1891 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-21Initialize dummy/last mode id to G_MAXINTKalle Wallin1-1/+1
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1890 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-13Use glib's functions (g_strlcat, g_strlcpy, g_snprintf, g_strdup_vprintf)Kalle Wallin1-50/+25
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1867 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-13Crossfade time can now be definied in the rc file (crossfade-time)Kalle Wallin1-91/+92
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1865 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-13Use my_wgetch() instead of wgetch(), added --[no-]mouse optionKalle Wallin1-2/+2
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1864 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-12Mouse support is now optional (enable-mouse)Kalle Wallin1-1/+2
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1861 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2004-07-12Added configure option --disable-raw-modeKalle Wallin1-0/+2
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1855 09075e82-0dd4-0310-85a5-a0d7c8717e4f