Commit Graph

3668 Commits

Author SHA1 Message Date
Romain Bignon 855466df40 playlist_edit: improved range checks in shufflePlaylist() 2009-02-13 11:12:31 +01:00
Romain Bignon 9fe459f625 added the shufflerange command
This command shuffles a range of songs.
2009-02-13 10:43:30 +01:00
Max Kellermann beaf860a17 doc: use $(DESTDIR)
Forgot the $(DESTDIR) prefix in the install-data-local target.
2009-02-13 09:50:42 +01:00
Max Kellermann ef64449cb6 doc: generate API documentation with doxygen
When configured with --enable-documentation, use doxygen.
2009-02-13 09:11:22 +01:00
Max Kellermann df9245c2aa update: free deleted subdirectories
Use delete_directory() for removing sub directories instead of
dirvec_clear().  This ensures that all memory occupied by
subdirectories of deleted directories is freed.
2009-02-12 19:12:32 +01:00
Max Kellermann 16bab6019b update: recursively purge deleted directories
When a directory is deleted, MPD deleted only the directory from the
database; it did not bother to walk the full tree to free all memory
and to remove deleted songs from the playlist.  Replace a
dirvec_delete() with delete_directory().
2009-02-12 19:12:25 +01:00
Max Kellermann a06e281421 aac: fix stream metadata
Pass the input_stream object to decoder_data().  Without it, the MPD
core does not see stream tags.
2009-02-12 18:39:19 +01:00
Max Kellermann d55f6b5304 database: don't load database after charset was reconfigured
When you change the filesystem charset, discard the old database file
and create a new one.  The old database file will most likely contain
stale or invalid information.
2009-02-12 18:31:00 +01:00
Max Kellermann a2ce6e5b82 wildmidi: added seeking support
Use WildMidi_SampledSeek() for seeking in a MIDI file.
2009-02-12 18:19:13 +01:00
Max Kellermann f6c8dd4961 configure.ac: always check for C++ compiler
Currently, only the sidplay decoder plugin requires C++, and in all
other cases, MPD could build well without a C++ compiler.
Unfortunately, autoconf/automake are confused when we have a
conditional AC_PROG_CXX check.  We could add lots of workarounds for
individual problems, but let's just always require a C++ compiler, and
forget about this autotools limitation.
2009-02-12 18:14:14 +01:00
Max Kellermann 321eb1077a wildmidi: provide and current total song time
The _WM_Info struct provides all we need, it is obtained by
WildMidi_GetInfo().
2009-02-12 16:47:48 +01:00
Max Kellermann 1492339463 wildmidi: new decoder plugin for MIDI files 2009-02-12 16:43:18 +01:00
Max Kellermann e56a90f3b3 fluidsynth: new decoder plugin for MIDI files
There are a few problems left in this plugin:

- fluidsynth decodes in real time, while MPD prefers to buffer as
  quickly as possible; as a workaround, this plugin uses a timer
  object to synchronize with real-time playback

- I don't know yet how fluidsynth tells me when the song has ended

- the "soundfont" configuration setting is not yet documented, and it
  will likely change soon (in favor of a per-decoder configuration
  block)
2009-02-12 08:43:26 +01:00
Max Kellermann de2e13cafe configure.ac: define conditional am__fastdepCXX
When the sidplay plugin is disabled, "./configure" does not look for
the C++ compiler.  This creates an odd situation: automake requires
the am__fastdepCXX conditional, although configure did not generate
it.  Work around this autotools limitation by manually disabling
am__fastdepCXX.
2009-02-11 22:05:46 +01:00
Max Kellermann 1136f6fb7a sidplay: new decoder plugin for playing C64 SID files 2009-02-11 20:31:17 +01:00
Max Kellermann 82fee1390c configure.ac: removed misplaced comma 2009-02-11 19:58:53 +01:00
Max Kellermann b6b181ca87 decoder_thread: re-enable file decoders
By accident, I committed a debug flag, which disallowed the decoder
thread to play files locally.  Undo this hunk.
2009-02-11 19:58:50 +01:00
Max Kellermann 550b9c3f23 ffmpeg: added TTA support
The ffmpeg library supports the "True Audio Codec".  The entry in
ffmpeg_suffixes was missing.
2009-02-11 18:27:11 +01:00
Max Kellermann 58a5d30826 playlist: don't preserve "current" song after "random" toggle
When MPD is not playing, it may still remember which is the "current"
song.  When you switch to "random" mode, MPD will always start playing
exactly this song.  This defies the goal of "random" mode a little.
Clear the "current" song when MPD is not playing during the "random"
mode switch.
2009-02-11 18:02:50 +01:00
Max Kellermann 9d447dda1d audio: moved code to output_command.c
The output_command library provides a command interface to the audio
outputs.  It assumes the input comes from an untrusted source
(i.e. the client) and verifies all parameters.
2009-02-11 18:02:45 +01:00
Max Kellermann 3bc4224bfd audio_format: added validation functions
In addition to audio_format_valid(), provide functions which validate
only one attribute of an audio_format.  These functions are reused by
audio_format_parse().
2009-02-11 18:00:48 +01:00
Max Kellermann 5090cf6484 audio: replaced parseAudioConfig() with audio_format_parse()
Added audio_format_parse() in a separate library, with a modern
interface: return a GError instead of logging errors.  This allows the
caller to deal with the error.
2009-02-11 18:00:41 +01:00
Qball Cow 5484aaee5f Set boundPort to the current portnumber, so zeroconf announces the right port number 2009-02-11 14:45:04 +01:00
Max Kellermann b21e8ad4a5 output_all: immediately reopen output on play
When MPD explicitly starts playing, ignore the "REOPEN_AFTER" timeout.
This timeout was useful when MPD attempted to reopen a failed device
over and over, but it confuses users when they explicitly tell MPD to
start playing, while MPD insists to wait for the 10 seconds to pass.
2009-02-10 22:15:42 +01:00
Max Kellermann e8aee4d992 output_thread: moved code to ao_close()
Merge some duplicate code into one function.
2009-02-10 22:09:07 +01:00
Max Kellermann a96993f655 output_thread: leave the pause loop on failure
When the pause() method fails, leave the pause loop, because calling
pause() on a closed device is not allowed.
2009-02-10 22:08:05 +01:00
Max Kellermann bd8ecba449 output_thread: consistently (de)initialize pcm_convert_state
Fix a memory leak: it was not guaranteed that pcm_convert_deinit() was
called for each pcm_convert_init().  This patch always (de)initializes
the pcm_convert library when the audio_output.open flag is flipped.
2009-02-10 22:07:59 +01:00
Max Kellermann 61e3075981 output_api: no CamelCase in struct audio_output
Renamed audio_output struct members.
2009-02-10 21:50:51 +01:00
Max Kellermann 744702f266 shout_mp3: use audio_format_frame_size()
Use audio_format_frame_size() instead of
channels*audio_format_sample_size().
2009-02-10 21:30:28 +01:00
Max Kellermann b27d9e055b shout: pass void pointer to the encoder
Pass the music chunk as a "const void *" to the encoder, instead of a
"const char *".  Actually, both encoders currently expect 16 bit
samples, passing a 8-bit character is rather pointless.
2009-02-10 21:28:25 +01:00
Max Kellermann 12756c1b55 shout_ogg: moved PCM conversion to a separate function
For simplification, moved the PCM conversion code to
pcm16_to_ogg_buffer().  Work with a int16_t pointer instead of a char
pointer.
2009-02-10 21:25:45 +01:00
Max Kellermann 54982f755f ao: declare AoData.writeSize as size_t
writeSize is a memory size and its type should thus be size_t.  This
allows us to remove two explicit casts.
2009-02-10 21:24:35 +01:00
Max Kellermann fe142647a5 osx: removed disabled debug messages
Nobody needs these debug messages anymore.
2009-02-10 20:57:21 +01:00
Max Kellermann 86d4cf0dbd output_all: added API documentation 2009-02-10 18:51:59 +01:00
Max Kellermann facf146cfd output_all: moved code to audio_output_all_finished()
audio_output_all_finished() returns bool, not int.
2009-02-10 18:51:53 +01:00
Max Kellermann 4493a96425 output_all: no CamelCase
Renamed functions and variables.
2009-02-10 18:51:51 +01:00
Max Kellermann a3a6eefcfe audio: moved code to output_all.c
Moved code which deals with all audio outputs at once into a separate
library.
2009-02-10 18:51:49 +01:00
Max Kellermann e7505381eb audio: moved protocol code to output_print.c 2009-02-10 18:51:42 +01:00
Max Kellermann 49ff2aceb5 audio: moved state file code to output_state.c 2009-02-10 18:51:39 +01:00
Max Kellermann f141d90533 audio: removed isCurrentAudioFormat()
This function isn't used anymore.
2009-02-10 18:51:38 +01:00
Max Kellermann 2a388c2aa7 crossfade: don't use isCurrentAudioFormat()
The crossfading code shouldn't depend on the audio output code.  Pass
the current audio format to cross_fade_calc() and let it compare
directly, instead of using isCurrentAudioFormat().
2009-02-10 18:51:29 +01:00
Max Kellermann 34244398d0 playlist: fix assertion when last/current song is deleted
When MPD is stopped, but the last song is still the "current song",
and you delete it, playlist->current is not updated, and becomes an
invalid value.  Fix this by catching "!playlist->playing &&
playlist->current == (int)songOrder".
2009-02-10 17:55:08 +01:00
Max Kellermann e8787ac4a4 audio: added output enumeration functions
Added audio_output_get(), audio_output_find().
2009-02-10 17:21:19 +01:00
Max Kellermann 3e87033145 audio: added audio_output_config_count()
audio_output_config_count() returns the number of audio outputs in the
configuration file.  It is only used by initAudioDriver().  The public
function audio_output_count() now returns audioOutputArraySize.
2009-02-10 17:21:10 +01:00
Max Kellermann ff09a41807 output_internal: added missing output_api.h include
output_api.h is required for enum audio_output_command.
2009-02-10 17:21:08 +01:00
Max Kellermann c2bbf876fb player: added some more assertions
Assertions on pc.command and pc.next_song.
2009-02-10 08:18:28 +01:00
Max Kellermann 799d1c9dc2 player_thread: reset pc.next_song only if queued
When we reset pc.next_song if there is no song queued, this might
cause a race condition: the next song to be played is cleared, while
pc.command was already set.  Clear the "next_song" only if there is a
song queued for the current do_play() invocation.
2009-02-10 08:18:01 +01:00
Max Kellermann 40393ae64f playlist: update queued song after seeking
If a new song is queued before calling playerSeek(), then the player
and the playlist enter an inconsistent state, because the player
discards the playlist's "queued" song in favor of the seeked song.

Call playlist_update_queued_song() after playerSeek().
2009-02-10 00:17:46 +01:00
Max Kellermann 2274434e53 player_thread: reset pc.next_song
After a player command (successful or not), reset pc.next_song,
because the queue is supposed to be empty then.  Otherwise,
playlist.queued and pc.next_song may disagree, which triggers an
assertion failure.
2009-02-10 00:17:34 +01:00
Max Kellermann 710b3275ea queue: update order array after song move
Commit f78cddb4 introduced a regression: after a song was moved, the
order array was not updated (in random mode).  This caused MPD to
think the "current" song has changed when you moved something to the
position of the current song.
2009-02-09 22:47:23 +01:00