aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* song: use C++ compilerMax Kellermann2012-08-081-0/+4
|
* song: add function song_replace_uri()Max Kellermann2012-02-121-0/+9
|
* directory: replace songvec with doubly linked listMax Kellermann2012-01-241-0/+12
|
* copyright year 2011Max Kellermann2011-01-291-1/+1
|
* Update copyright notices.Avuton Olrich2009-12-311-1/+1
|
* song: added support for selecting a time rangeMax Kellermann2009-12-271-0/+12
| | | | | | Added attributes start_ms, end_ms. This allows us to address a portion of a song file (important for CUE support). There is no support yet for storing these attributes in the state file.
* song: added function song_get_duration()Max Kellermann2009-12-261-0/+3
|
* song_save: load one song at a timeMax Kellermann2009-11-011-3/+0
| | | | | Changed songvec_load() to song_load(). Added start and end markers for each song. Removed the "key" line, it's redundant.
* song: renamed attribute "url" to "uri"Max Kellermann2009-10-131-3/+3
|
* all: Update copyright header.Avuton Olrich2009-03-131-6/+7
| | | | | | | | This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
* song: allocate the result of song_get_url()Max Kellermann2009-01-041-6/+7
|
* song: adding support for songs in archivesViliam Mateicka2008-12-161-0/+3
|
* added prefix to header macrosMax Kellermann2008-10-311-2/+2
| | | | | | | "LOG_H" is a macro which is also used by ffmpeg/log.h. This is ffmpeg's fault, because short macros should be reserved for applications, but since it's always a good idea to choose prefixed macro names, even for applications, we are going to do that in MPD.
* playlist: added support for adding songs not in the music databaseMax Kellermann2008-10-151-1/+1
| | | | | Clients which have authenticated via unix socket may add local files to the MPD playlist, provided that they own the file.
* song: added song_in_database()Max Kellermann2008-10-151-1/+7
| | | | | | | Some functions assume that a song is not in the database when it is a remote song. Based on that, they decide whether they are responsible for freeing the song struct. Add a special function which checks whether a song is in the database (currently equal to song_is_file()).
* song: pass const song pointer to song_get_url()Max Kellermann2008-10-141-1/+1
| | | | song_get_url() doesn't modify the song object.
* song: song_file_update() returns boolMax Kellermann2008-10-081-1/+1
| | | | | | Instead of returning 0 or -1, return true on success and false on failure. This seems more natural, and when the C library was designed, there was no "bool" data type.
* song: removed CamelCaseMax Kellermann2008-10-081-6/+6
| | | | CamelCase is ugly... rename all functions.
* song: replaced all song constructorsMax Kellermann2008-10-081-2/+12
| | | | | | Provide separate constructors for creating a remote song, a local song, and one for loading data from a song file. This way, we can add more assertions.
* use the "bool" data type instead of "int"Max Kellermann2008-10-081-2/+4
| | | | "bool" should be used in C99 programs for boolean values.
* don't include os_compat.hMax Kellermann2008-10-081-2/+2
| | | | | When there are standardized headers, use these instead of the bloated os_compat.h.
* CPP include cleanupMax Kellermann2008-10-081-3/+0
| | | | Include only headers which are really used.
* song: converted typedef Song to struct songMax Kellermann2008-10-081-8/+13
| | | | Again, a data type which can be forward-declared.
* directory: converted typedef Directory to struct directoryMax Kellermann2008-10-081-3/+3
| | | | | The struct can be forward-declared by other headers, which relaxes the header dependencies.
* song: really make the song struct non-packedMax Kellermann2008-10-071-1/+1
| | | | Somehow I must have missed this in commit 22e40b61.
* directory: serialize song deletes from playlist during updateEric Wong2008-10-071-2/+0
| | | | | | | | | | | | | | | | This makes the update code thread-safe and doesn't penalize the playlist code by complicating it with complicated and error-prone locks (and the associated overhead, not everybody has a thread-implementation as good as NPTL). The update task blocks during the delete; but the update task is a slow task anyways so we can block w/o people caring too much. This was also our only freeSong call site, so remove that function. Note that deleting entire directories is not fully thread-safe, yet; as their traversals are not yet locked.
* song: stop storing song_typeEric Wong2008-10-061-9/+7
| | | | | | | We already know if a song is a URL or not based on whether it has parentDir defined or not. Hopefully one day in the future we can drop HTTP support from MPD entirely when an HTTP filesystem comes along and we can access streams via open(2).
* song: don't make the struct packedMax Kellermann2008-10-061-1/+1
| | | | | | The "packed" attribute may have negative side effects on performance. Remove the "packed" attribute, and increase the size of "song.url" to a multiple of the machine word size.
* song: use flex arrays to store song->urlEric Wong2008-10-061-2/+6
| | | | | | Reduce the number of allocations we make, so there's less pressure on the allocator and less overhead to keep track of the allocations in.
* song: get rid of newNullSong()Eric Wong2008-10-061-2/+0
| | | | | It didn't save us any lines of code nor did it do anything useful since we would overwrite everything anyways.
* assume stdint.h and stddef.h are availableMax Kellermann2008-09-291-1/+0
| | | | | | Since we use a C99 compiler now, we can assert that the C99 standard headers are available, no need for complicated compile time checks. Kill mpd_types.h.
* song: converted "type" to enumMax Kellermann2008-09-291-4/+7
| | | | | | Having an enum type is much nicer than an anonymous integer plus CPP macros. Note that the old code didn't save any space by declaring the variable 8 bit, due to padding.
* switch to C99 types, part IIMax Kellermann2008-09-291-1/+1
| | | | | Do full C99 integer type conversion in all modules which were not touched by Eric's merged patch.
* song: removed type SongListMax Kellermann2008-09-261-10/+0
| | | | SongList has been superseded by struct songvec.
* pass "struct client" to dbUtils.c, song.c, tag_print.cMax Kellermann2008-09-071-0/+2
| | | | | | Don't pass the raw file descriptor around. This migration patch is rather large, because all of the sources have inter dependencies - we have to change all of them at the same time.
* song: moved code to song_print.c, song_save.cMax Kellermann2008-09-071-11/+2
| | | | | | | Move everything which dumps song information (via tag_print.c) to a separate source file. song_print.c gets code which writes song data to the client; song_save.c is responsible for serializing songs from the tag cache.
* include cleanupMax Kellermann2008-09-061-3/+2
| | | | As usual, include only headers which are really needed.
* song: don't export newNullSong()Max Kellermann2008-08-291-2/+0
| | | | The function newNullSong() is only used internally in song.c.
* tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_itemMax Kellermann2008-08-291-1/+1
| | | | | Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
* song: document get_song_url()Eric Wong2008-04-121-0/+6
| | | | | [merged r7184 from branches/ew] git-svn-id: https://svn.musicpd.org/mpd/trunk@7242 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix -Wconst warningsMax Kellermann2008-02-051-2/+2
| | | | | | [ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup #includes of standard system headers and put them in one placeEric Wong2008-01-031-4/+1
| | | | | | | | | | | | | This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Merge branches/ew r7104Eric Wong2007-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread-safety work in preparation for rewrite to use pthreads Expect no regressions against trunk (r7078), possibly minor performance improvements in update (due to fewer heap allocations), but increased stack usage. Applied the following patches: * maxpath_str for reentrancy (temporary fix, reverted) * path: start working on thread-safe variants of these methods * Re-entrancy work on path/character-set conversions * directory.c: exploreDirectory() use reentrant functions here * directory/update: more use of reentrant functions + cleanups * string_toupper: a strdup-less version of strDupToUpper * get_song_url: a static-variable-free version of getSongUrl() * Use reentrant/thread-safe get_song_url everywhere * replace rmp2amp with the reentrant version, rmp2amp_r * Get rid of the non-reentrant/non-thread-safe rpp2app, too. * buffer2array: assert strdup() returns a usable value in unit tests * replace utf8ToFsCharset and fsCharsetToUtf8 with thread-safe variants * fix storing playlists w/o absolute paths * parent_path(), a reentrant version of parentPath() * parentPath => parent_path for reentrancy and thread-safety * allow "make test" to automatically run embedded unit tests * remove convStrDup() and maxpath_str() * use MPD_PATH_MAX everywhere instead of MAXPATHLEN * path: get rid of appendSlash, pfx_path and just use pfx_dir * get_song_url: fix the ability to play songs in the top-level music_directory git-svn-id: https://svn.musicpd.org/mpd/trunk@7106 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* The massive copyright updateAvuton Olrich2007-04-051-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add support for: list fileWarren Dukes2006-10-271-0/+3
| | | | | This behaves the same as: list filename git-svn-id: https://svn.musicpd.org/mpd/trunk@4952 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix warnings for -Wmissing-prototypesAvuton Olrich2006-08-201-2/+2
| | | | | | Add -Wmissing-prototypes if compiling with gcc Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface/connection malloc reductions from mpd-keEric Wong2006-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-201-11/+11
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] Remove unused codeAvuton Olrich2006-07-151-2/+0
| | | | | Cleanup whitespace->tabs git-svn-id: https://svn.musicpd.org/mpd/trunk@4347 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f