aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* song: added support for selecting a time rangeMax Kellermann2009-12-271-1/+5
| | | | | | 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/+9
|
* include config.h in all sourcesMax Kellermann2009-11-121-0/+1
| | | | | | After we've been hit by Large File Support problems several times in the past week (which only occur on 32 bit platforms, which I don't have), this is yet another attempt to fix the issue.
* song: renamed attribute "url" to "uri"Max Kellermann2009-10-131-12/+12
|
* song: moved code to song_update.cMax Kellermann2009-10-121-147/+0
| | | | | Moved all the code which depends on the decoder plugins to a separate source. That allows leaner test programs.
* song: initialize mtime in song_alloc()Max Kellermann2009-07-061-0/+1
|
* 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.
* tag: moved APE code to tag_ape.cMax Kellermann2009-02-281-0/+1
|
* ls: moved generic URI utilities to uri.cMax Kellermann2009-02-251-1/+1
| | | | | "ls" is a bad name for a library which parses URIs. We'll move the rest of the "ls" library later.
* decoder_api: moved struct decoder_plugin to decoder_plugin.hMax Kellermann2009-02-151-1/+3
| | | | | | The decoder_plugin struct is used by both the MPD core and the decoder plugin implementations. Move it to a shared header file, to minimize header dependencies.
* song: include cleanupMax Kellermann2009-01-231-2/+0
| | | | Removed unused includes.
* song: skip archive check for non-musicdir filesMax Kellermann2009-01-171-1/+1
| | | | | | If a song is not within the music directory ("file:///..."), it has no "parent directory". The archive code nonetheless dereferences the parent pointer, causing a segmentation fault. Check parent!=NULL.
* moved fallback APE/ID3 tag loader to song.cMax Kellermann2009-01-171-0/+36
| | | | | | Some plugins used the APE or ID3 tag loader as a fallback when their own methods of loading tags did not work. Move this code out of all decoder plugins, into song_file_update().
* song: allocate the result of song_get_url()Max Kellermann2009-01-041-6/+4
|
* directory: added directory_is_root()Max Kellermann2009-01-041-1/+1
| | | | | directory_is_root() is cheaper than isRootDirectory(directory_get_path()).
* ls: renamed functions, no CamelCaseMax Kellermann2009-01-041-2/+2
|
* ls: removed hasMusicSuffix() and get_archive_by_suffix()Max Kellermann2009-01-041-16/+31
| | | | | | | | Determine the suffix manually, and use decoder_plugin_from_suffix() and archive_plugin_from_suffix() instead. This way, song_file_update_inarchive() can be optimized: it does not have to translate its path.
* song: removed duplicate '\n' checkMax Kellermann2009-01-041-5/+2
| | | | Newline characters are already checked in skip_path() (update.c).
* song: use GLib instead of utils.h/log.hMax Kellermann2009-01-031-5/+5
|
* mapper: allocate the result of map_directory_child_fs(), map_song_fs()Max Kellermann2009-01-021-7/+9
| | | | Don't use fixed stack buffers.
* removed os_compat.hMax Kellermann2008-12-291-0/+5
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* song: adding support for songs in archivesViliam Mateicka2008-12-161-1/+34
|
* decoder: return const decoder_plugin structsMax Kellermann2008-11-011-1/+1
| | | | | The decoder_plugin structs must never change. Don't work with non-const pointers.
* update: check return valuesMax Kellermann2008-10-311-5/+8
| | | | | Nearly all mapper functions can fail and will then return NULL. Add checks to all callers.
* song: check file type in song_file_update()Max Kellermann2008-10-151-1/+1
| | | | Don't load non-regular files.
* playlist: added support for adding songs not in the music databaseMax Kellermann2008-10-151-2/+2
| | | | | Clients which have authenticated via unix socket may add local files to the MPD playlist, provided that they own the file.
* mapper: new song-to-filesystem mapper libraryMax Kellermann2008-10-141-3/+2
| | | | | | The mapper library maps directory and song objects to file system paths. With this central library, the code mixture in path.c should be cleaned up, and we will be able to add neat features like aliasing.
* 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: stat file in song_file_update(), don't use isMusic()Max Kellermann2008-10-131-5/+8
| | | | | | | isMusic() used to be a very inefficient function: with every invocation, it did another stat() on the specified file. There is only one caller, do the stat() there manually and use hasMusicSuffix() instead of isMusic().
* song: song_get_url: fix "/" prefix for songs in music_rootEric Wong2008-10-131-1/+1
|
* directory: eliminate CamelCaseMax Kellermann2008-10-081-2/+2
| | | | CamelCase is ugly, rename the functions.
* song: don't allow calling song_get_url(NULL)Max Kellermann2008-10-081-3/+1
| | | | | | The runtime check suggests that the author has somehow thought song_get_url(NULL) might be valid. It should not be. Replace it with an assertion.
* song: use song_file_update() in song_file_load()Max Kellermann2008-10-081-10/+3
| | | | Eliminate duplicated code.
* song: song_file_update() returns boolMax Kellermann2008-10-081-3/+3
| | | | | | 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: don't check song_is_file() in song_file_update()Max Kellermann2008-10-081-17/+16
| | | | | This function was never used on remote songs. Replace the runtime check with an assertion.
* song: removed CamelCaseMax Kellermann2008-10-081-10/+10
| | | | CamelCase is ugly... rename all functions.
* song: replaced all song constructorsMax Kellermann2008-10-081-21/+32
| | | | | | 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.
* don't include os_compat.hMax Kellermann2008-10-081-2/+0
| | | | | When there are standardized headers, use these instead of the bloated os_compat.h.
* song: converted typedef Song to struct songMax Kellermann2008-10-081-7/+11
| | | | Again, a data type which can be forward-declared.
* directory: converted typedef Directory to struct directoryMax Kellermann2008-10-081-2/+2
| | | | | The struct can be forward-declared by other headers, which relaxes the header dependencies.
* directory: serialize song deletes from playlist during updateEric Wong2008-10-071-6/+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.
* Assert if we don't have song or song->url setEric Wong2008-10-071-2/+8
| | | | song objects cannot exist without a path or URL
* song: stop storing song_typeEric Wong2008-10-061-8/+5
| | | | | | | 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-7/+15
| | | | | | 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-13/+2
| | | | | It didn't save us any lines of code nor did it do anything useful since we would overwrite everything anyways.
* song: call freeJustSong if newSong failsEric Wong2008-10-061-1/+1
| | | | | There's no reason to scan the playlist for a song we just allocated.
* decoder: renamed plugin methodsMax Kellermann2008-09-291-2/+2
| | | | | Why have a "_func" prefix on all method names? Also don't typedef the methods, there is no advantage in that.
* song: converted "type" to enumMax Kellermann2008-09-291-1/+1
| | | | | | 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.
* song: removed type SongListMax Kellermann2008-09-261-36/+0
| | | | SongList has been superseded by struct songvec.