aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* screen: moved input_timestamp to screen_play.cMax Kellermann2008-09-221-2/+0
| | | | Since the input_timestamp is only used by screen_play, move it there.
* screen: moved list_window mouse code to list_window.cMax Kellermann2008-09-221-21/+1
| | | | | | 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.
* screen: moved code to ncu.cMax Kellermann2008-09-221-31/+2
| | | | | Moved basic libncurses initialization to ncu.c and ncu.h. Keep generic code out of screen.c.
* added option "welcome-screen-list"David Shakaryan2008-09-221-1/+2
| | | | | "welcome-screen-list" shows the screen list in the top row shortly after startup, and is enabled by default.
* added optional bitrate display to status barJ. Alexander Treuman2008-09-211-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.
* Adding crop feature in ncmpcYannick LM2008-09-211-0/+3
| | | | | The "crop" command deletes all songs from the playlist, except the one currently being played.
* removed the clock screenMax Kellermann2008-09-181-10/+0
| | | | Why should an audio player display a large clock?
* screen: don't handle CMD_PLAYMax Kellermann2008-09-181-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.
* quit with g_main_loop_quit()Max Kellermann2008-09-181-2/+0
| | | | | Call g_main_loop_quit() on CMD_QUIT, instead of exit() with an atexit() handler.
* use the glib main event loopMax Kellermann2008-09-181-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.
* screen: check MPD status only if connectedMax Kellermann2008-09-181-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.
* screen: moved code to screen_client_cmd()Max Kellermann2008-09-181-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.
* code style, indent with tabs IVMax Kellermann2008-09-171-16/+15
| | | | Follow the same code style als MPD itself.
* make several functions return voidMax Kellermann2008-09-171-6/+2
|
* screen: return early in switch_screen_mode() on errorMax Kellermann2008-09-171-7/+7
| | | | | When the selected screen does not exist, return before calling close().
* screen: added macro NUM_SCREENSMax Kellermann2008-09-171-25/+16
| | | | | Since the number of screens is known at compile time, define a macro which calculates this, instead of having a sentinel element.
* screen: close only current screen in screen_exit()Max Kellermann2008-09-171-2/+3
| | | | | Screens which are not active have already been closed, or have never been opened. Don't call close again on them.
* screen: don't store "screen" as a pointerMax Kellermann2008-09-171-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.
* screen: moved code to find_configured_screen()Max Kellermann2008-09-171-10/+13
|
* screen: mode_fn cannot be NULL, removed checksMax Kellermann2008-09-171-17/+9
| | | | | At startup, mode_fn is initialized with &screen_playlist, and it will never be reset to NULL. Remove all checks.
* screen: before calling update(), check if it is definedMax Kellermann2008-09-171-1/+1
| | | | | That seems to be a fn->paint was checked, then the code called fn->update(). Fix this.
* screen: removed screen_functions.get_lw()Max Kellermann2008-09-171-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.
* replaced get_screen_X() with static screen_functions variableMax Kellermann2008-09-171-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.
* code style, indent with tabs IIIMax Kellermann2008-09-171-9/+8
| | | | Follow the same code style als MPD itself.
* initial draw without delayMax Kellermann2008-09-161-0/+2
| | | | | Due to a missing refresh() call, ncmpc painted the screen after one second. Add refresh(), make ncmpc display immediately.
* screen: added struct namesMax Kellermann2008-09-161-20/+17
| | | | | Let us declare struct names in addition to typedef names, so we can forward-declare them.
* code style, indent with tabs IIMax Kellermann2008-09-161-5/+3
| | | | Follow the same code style als MPD itself.
* use size_t and unsigned integersMax Kellermann2008-09-151-3/+3
|
* fix shadow warningsMax Kellermann2008-09-151-16/+16
| | | | | Rename local variables and function parameters, so they don't shadow global variables.
* include cleanupMax Kellermann2008-09-151-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.
* fix function prototypesMax Kellermann2008-09-151-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.
* const pointersMax Kellermann2008-09-151-8/+8
| | | | | Convert pointers to const whenever it is possible. Fixes all those -Wconst warnings.
* screen: moved code to paint_top_window2()Max Kellermann2008-09-151-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.
* code style, indent with tabsMax Kellermann2008-09-151-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.
* remove unused static functionsMax Kellermann2008-09-151-1/+0
| | | | Also remove some commented code and unused function parameters.
* way too much stuff to describe hereAndreas Obergrusberger2007-02-161-22/+26
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@5346 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* multi liner ;) fixed segfaultAndreas Obergrusberger2006-09-081-6/+5
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4749 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* due to bensonk's demand i added a splash screen.Andreas Obergrusberger2006-09-071-5/+10
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* the updated sourcesAndreas Obergrusberger2006-08-041-4/+18
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* typoKalle Wallin2006-03-281-1/+1
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3962 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* unicode fixes from Dmitry Baryshkov/René van BevernKalle Wallin2006-03-281-7/+8
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3960 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* included patch from Jonathan ForsKalle Wallin2006-01-161-4/+18
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3832 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* New configuraton option: screen-listKalle Wallin2005-06-151-9/+50
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3358 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added an experimental artist (browser) screenKalle Wallin2005-06-061-0/+15
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* seek-time can now be defined in the conf fileKalle Wallin2005-06-031-2/+2
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3308 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added a search screenKalle Wallin2004-11-151-1/+16
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@2668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Added debug code for #291Kalle Wallin2004-07-211-3/+9
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1891 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Initialize dummy/last mode id to G_MAXINTKalle Wallin2004-07-211-1/+1
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1890 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use glib's functions (g_strlcat, g_strlcpy, g_snprintf, g_strdup_vprintf)Kalle Wallin2004-07-131-50/+25
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1867 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Crossfade time can now be definied in the rc file (crossfade-time)Kalle Wallin2004-07-131-91/+92
| | | | git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1865 09075e82-0dd4-0310-85a5-a0d7c8717e4f