aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* make several functions return voidMax Kellermann2008-09-1710-41/+32
|
* playlist: use playlist_get() instead of playlist_get_song()Max Kellermann2008-09-172-6/+9
|
* list_window: don't reset *highlight to 0Max Kellermann2008-09-174-4/+0
| | | | | 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.
* lyrics: don't check current.lines==NULLMax Kellermann2008-09-171-2/+2
| | | | | current.lines is always initialized, and cannot be NULL, no need to check it.
* help: return early from list_callback()Max Kellermann2008-09-171-25/+25
|
* help: converted help_text_rows to a macroMax Kellermann2008-09-171-10/+3
| | | | | Why bother counting the elements of help_text[] (with sentinel) at runtime, when the compiler can do it at compile time?
* lyrics: removed lyrics_text_rows, use current.lines->len insteadMax Kellermann2008-09-171-2/+1
| | | | | lyrics_text_rows wasn't set anyway, I somehow removed the code in a patch some time ago.
* list_window: added list_window_center()Max Kellermann2008-09-175-27/+25
| | | | | Merge code which used to be duplicated in the screens "play", "help", "lyrics".
* list_window: added list_window_scroll_cmd()Max Kellermann2008-09-174-69/+62
| | | | | | It is similar to list_window_cmd(), but it scrolls the window instead of moving the selection. It is used by the "lyrics" and the "help" screen.
* list_window: set repaint at the end of list_window_cmd()Max Kellermann2008-09-171-6/+1
|
* 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-178-53/+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-1710-208/+134
| | | | | | 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-173-112/+104
| | | | Follow the same code style als MPD itself.
* mpdclient: call playlist_clear() in mpdclient_playlist_update()Max Kellermann2008-09-171-2/+1
| | | | | | Instead of freeing the playlist with mpdclient_playlist_free(), call playlist_clear() to empty the song list. This fixes a segmentation fault which occured when you cleared the playlist.
* 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-167-91/+95
| | | | | Let us declare struct names in addition to typedef names, so we can forward-declare them.
* use a C99 compilerMax Kellermann2008-09-161-1/+1
|
* lyrics: converted in-process plugins to external programsMax Kellermann2008-09-1620-1224/+589
| | | | | | | | | | | | | In-process plugins are very problematic. It is much easier and flexible to move the lyrics plugins to external programs, with a trivial protocol. This is work in progress, among the things missing: - protocol specification, including exit codes - plugin installation - plugin search directory - run-time configuration (currently hard coded) - automatic polling (using glib's main loop?) - better and more robust error handling
* use GPtrArray instead of GArray for playlist songsMax Kellermann2008-09-162-13/+10
|
* playlist: hide direct accesses in inline functionsMax Kellermann2008-09-163-37/+92
| | | | | | Added functions like playlist_length(), playlist_get(), playlist_replace(), playlist_remove(). Don't access the mpdclient_playlist struct directly.
* mpdclient: added mpdclient_playlist_init(), mpdclient_playlist_clear()Max Kellermann2008-09-163-6/+34
| | | | | | Moved code from mpdclient_new() and mpdclient_playlist_free(). In mpdclient_disconnect(), call mpdclient_playlist_clear() instead of mpdclient_playlist_free() (which is now called in mpdclient_free()).
* mpdclient: moved code to playlist.cMax Kellermann2008-09-165-111/+174
| | | | | | | | | | Move everything which manipulates the mpdclient_playlist struct to playlist.c. Many of the functions get a mpdclient pointer instead of a playlist; this will be changed later. The functions mpdclient_playlist_update() and mpdclient_playlist_update_changes() stay in mpdclient.c for now, since they are tightly connected to the client code.
* song: allocate mpd_song from glib slicesMax Kellermann2008-09-161-0/+15
| | | | | | Since we compile ncmpc with glib, we can use its slice allocator for efficient song allocation. I have added a way to disable this with a macro.
* song: use struct mpd_songMax Kellermann2008-09-164-44/+44
| | | | | Use a forward declared struct mpd_song instead of the typedef mpd_Song.
* libmpdclient: moved code to song.cMax Kellermann2008-09-165-133/+231
| | | | | Move everything which manipulates the mpd_Song struct to song.c. Thousands of lines of too much for libmpdclient.c!
* mpdclient: add struct names, for forward declarationsMax Kellermann2008-09-161-4/+4
| | | | | | | To relax the include dependencies, give all structs real names, in addition to the typedef names. This way, other headers can forward-declare them, and do not need to include mpdclient.h. In the future, the typedefs will be removed.
* libmpdclient: const pointersMax Kellermann2008-09-162-2/+2
| | | | Pass const pointers whenever possible.
* code style, indent with tabs IIMax Kellermann2008-09-165-142/+128
| | | | Follow the same code style als MPD itself.
* list_window: update variables without loopingMax Kellermann2008-09-161-10/+14
| | | | | Apparently, somebody was too lazy to derive the formulas for cursor movement, and wrote lots of while loops.
* include cleanupMax Kellermann2008-09-162-5/+5
| | | | Include only headers which are really used.
* don't use libncursesw if libncurses was selectedMax Kellermann2008-09-161-15/+0
| | | | | | No idea what this code was intended for, but if the user chooses libncurses, ncmpc shouldn't override this manual choice if it finds libncursesw.
* added myself to AUTHORSMax Kellermann2008-09-161-0/+1
|
* set version to 0.12~gitMax Kellermann2008-09-161-1/+1
| | | | | We are on git now, and since we are doing major changes, increase the version number.
* easy_download: fixed the type of write_data()Max Kellermann2008-09-151-1/+3
| | | | Fix the type of write_data() to fit curl_write_callback.
* use GArray for playlist instead of GListMax Kellermann2008-09-153-101/+76
| | | | | | 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.
* free info entity while iteratingMax Kellermann2008-09-151-0/+2
| | | | | | Memory leak: the function mpdclient_playlist_update_changes() did not free the entity which was returned by mpd_getNextInfoEntity(). Add a mpd_freeInfoEntity() call at the end of each iteration.
* manage tag string allocations in a poolMax Kellermann2008-09-154-44/+200
| | | | | | There are many duplicated strings in the tag database, e.g. many songs having the same artist. Don't allocate such strings twice, manage all strings in a pool.
* added support for unix domain socketsMax Kellermann2008-09-151-1/+58
| | | | | | If a host name starts with a slash, it is assumed to be a unix domain socket path. The port is ignored. This code is disabled on WIN32, until someone tests it.
* lyrics: missing "break"Max Kellermann2008-09-151-1/+2
| | | | If get_text_line() fails, we should break from the loop.
* lyrics: converted global variables to staticMax Kellermann2008-09-152-6/+3
| | | | | | The variables "lyrics_text_rows" and "lw" were declared in src_lyrics.h as static, but they were only actually used in screen_lyrics.c. Move both there.
* fix unused parameter warningsMax Kellermann2008-09-158-47/+59
| | | | | Add the "unused" attribute to all function parameters which are indeed going to be ignored.
* imported gcc.h from mpdMax Kellermann2008-09-152-1/+71
| | | | gcc.h contains a useful set of macros for setting attributes.
* don't declare local variable "options"Max Kellermann2008-09-153-13/+15
| | | | | | | | | In main.c, the global variable "options" is used all over, except in main(), which contains a shadowing declaration of it. Remove this local variable, and use the global "options" instead. Also don't pollute conf.c's namespace with the global variable with a CPP hack (to be removed when we have fixed more of ncmpc's namespace pollution).