aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerControl.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-01-10PlayerControl: switch to the Mutex/Cond classesMax Kellermann1-6/+1
2013-01-10PlayerThread: use pc.cond instead of main_condMax Kellermann1-1/+1
The main_cond variable was completely unnecessary. The pc.cond object can be used for both main->pc and pc->main.
2013-01-10DecoderControl: take ownership of client_condMax Kellermann1-3/+3
Don't let the "client" pass its own GCond. This was not used consistently.
2013-01-09idle: convert to C++Max Kellermann1-5/+1
2013-01-07replay_gain_info, ...: use cmath instead of math.h in C++ modeMax Kellermann1-2/+3
Fixes build problems with mingw32.
2013-01-04PlayerControl: initialize all attributesMax Kellermann1-1/+5
2013-01-04PlayerControl: add constructor and destructorMax Kellermann1-25/+17
2013-01-04player_control.h: convert header to C++Max Kellermann1-1/+1
2013-01-04decoder_*: convert to C++Max Kellermann1-7/+7
2012-09-28main: use C++ compilerMax Kellermann1-1/+1
2012-08-25player_thread: disable cross-fading in "single" modeMax Kellermann1-0/+8
This commit reimplements the core of the "single" mode. Instead of doing the detection in the playlist code from the outside, it is moved to the player thread, which gets a new option called "border_pause". It will now pause playback exactly at the beginning of the new song, making the feature more reliable. Now that the player thread knows what will happen, it can suppress cross-fading. Fixes mantis tickets 0003055 and 0003166.
2012-08-15player_control: duplicate the song objectMax Kellermann1-0/+7
Make sure the player "owns" the next_song object, so nobody else can free it.
2012-08-08player_control: add GError attributeMax Kellermann1-36/+27
Rewrite of the pc_get_error_message() function, now using a GError object instead of the complicated "errored_song" attribute.
2012-08-08player_control: rename attribute "error" to "error_type"Max Kellermann1-4/+4
2012-08-08player_control: rename player_error enum valuesMax Kellermann1-6/+6
2012-08-08player_control: remove unused enum player_error valuesMax Kellermann1-15/+0
2012-08-08player_control: inline trivial functionsMax Kellermann1-30/+0
2011-10-06player_control: auto-start playback when seeking is requestedMax Kellermann1-3/+0
Now that the player thread can handle SEEK commands while not (yet) playing, we can remove the "pc.state" check from pc_seek().
2011-03-31fix common misspellingsJonathan Neuschäfer1-1/+1
These fixes were mostly generated with `codespell' [0] and manually reviewed. [0] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10decoder_control: store GCond object, not a player_controlMax Kellermann1-1/+1
Remove the decoder dependency on player_control. All player_control was needed for is to signal the player thread, and we can do that with a simple GCond as well.
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-128/+138
Allocate a player_control object where needed, and pass it around. Each "client" object is associated with a "player_control" instance. This prepares multi-player support.
2010-06-19player_control: hold mutex in pc_play(), pc_pause()Max Kellermann1-9/+42
Race condition fix.
2010-03-21Add support for MixRamp tagsTim Phipps1-0/+31
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-11-12player_control: hold lock while reading statusMax Kellermann1-1/+4
2009-11-12include config.h in all sourcesMax Kellermann1-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.
2009-11-03player_control: moved pc.next_song assertion into lockMax Kellermann1-1/+2
The assertion shouldn't access player_control.next_song without locking it.
2009-11-02{decoder,player}_control: removed duplicate wakeupsMax Kellermann1-3/+2
Don't wake up the target thread in every iteration of the wait() loop. Waking it up once, right after the command has been set, must be enough.
2009-11-02player_control: lock player before setting seek parametersMax Kellermann1-2/+6
These parameters must be protected with a mutex, too. Wrap everything inside player_lock()/player_unlock(), and use player_command_locked() instead of player_command().
2009-10-31decoder_control: removed the global variable "dc"Max Kellermann1-2/+2
Allocate a decoder_control object where needed, and pass it around. This will allow more than one decoder thread one day.
2009-10-31player_control: protect command, state, error with a mutexMax Kellermann1-7/+35
Use GMutex/GCond instead of the notify library. Manually lock the player_control object before accessing the protected attributes. Use the GCond object to notify the player thread and the main thread.
2009-10-23output_plugin: added methods enable() and disable()Max Kellermann1-0/+6
With these methods, an output plugin can allocate some global resources only if it is actually enabled. The method enable() is called after daemonization, which allows for more sophisticated resource allocation during that method.
2009-10-08player_thread: get "elapsed" from audio outputsMax Kellermann1-0/+2
Tracking the "elapsed" time from the chunks which we have sent to the output pipe is very imprecise: since we have implemented the music pipe, we're sending large number of chunks at once, giving the "elapsed" time stamp a resolution of usually more than a second. This patch changes the source of this information to the outputs. If a chunk has been played by all outputs, the "elapsed" time stamp is updated. The new command PLAYER_COMMAND_REFRESH makes the player thread update its status information: it tells the outputs to update the chunk time stamp. After that, player_control.elapsed_time is current.
2009-10-08player_control: eliminate PLAYER_COMMAND_PLAYMax Kellermann1-2/+1
Sending PLAYER_COMMAND_STOP followed by PLAYER_COMMAND_QUEUE does the same. PLAYER_COMMAND_PLAY is redundant.
2009-10-08player_control: added several assertions on pc.next_song==NULLMax Kellermann1-0/+6
After some of the commands, the player thread must have reset the pc.next_song attribute.
2009-10-08player_control: no CamelCaseMax Kellermann1-18/+30
2009-10-08player_control: clear errored_song in clearPlayerError()Max Kellermann1-1/+2
Without the player error code, it errored_song variable is not used, and should be cleared, to avoid invalid access in pc_song_deleted().
2009-10-08player_control: bundle "get" functions in pc_get_status()Max Kellermann1-11/+9
The new player_status struct replaces a bunch of playerGetX() functions. When we add proper locking to the player_control struct, we will only need to lock once for the "status" command.
2009-10-08player_control: allocate getPlayerErrorStr() resultMax Kellermann1-19/+13
This lets us eliminate the static fixed-size buffer.
2009-07-06output: use the software mixer pluginMax Kellermann1-11/+0
Do all the software volume stuff inside each output thread, not in the player thread. This allows one software mixer per output device, and also allows the user to configure the mixer type (hardware or software) for each audio output. This moves the global "mixer_type" setting into the "audio_output" section, deprecating the "mixer_enabled" flag.
2009-05-06player_control: assert that pc.next_song is NULL after seekingMax Kellermann1-0/+2
The player thread must reset pc.next_song after seeking, even if that operation has failed. This patch adds an assertion.
2009-05-06player_control: removed pc.error check from pc_seek()Max Kellermann1-6/+3
The only pc_seek() caller clears the error, rendering the check useless. Even if the previous PLAY command resulted in a player error, this check is not very useful.
2009-05-06player_control: renamed playerSeek(), return boolMax Kellermann1-4/+4
Renamed playerSeek() to pc_seek() to get rid of CamelCase. Convert the return value to bool.
2009-03-30player_control: remove unused function playerCurrentDecodeSong().Avuton Olrich1-7/+0
2009-03-13all: Update copyright header.Avuton Olrich1-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.
2009-03-06pipe: added music_buffer, rewrite music_pipeMax Kellermann1-1/+2
Turn the music_pipe into a simple music_chunk queue. The music_chunk allocation code is moved to music_buffer, and is now managed with a linked list instead of a ring buffer. Two separate music_pipe objects are used by the decoder for the "current" and the "next" song, which greatly simplifies the cross-fading code.
2009-02-10player: added some more assertionsMax Kellermann1-0/+2
Assertions on pc.command and pc.next_song.
2009-01-29player_control: reset pc.error if pc.errored_song is clearedMax Kellermann1-1/+3
When the playlist is cleared, pc.errored_song is also cleared. This causes pc_errored_song_uri() to crash, because it assumes that pc.errored_song is set. Reset pc.error to fix that assumption.
2009-01-25player_control: added player_control.threadMax Kellermann1-0/+4
player_control.thread contains the handle of the player thread, or NULL if the player thread isn't running.