aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlayerControl.hxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-01-13copyright year 2014Max Kellermann1-1/+1
2014-01-09DetachedSong: fork of struct SongMax Kellermann1-18/+18
From now on, struct Song will be used by the database only, and DetachedSong will be used by everybody else. DetachedSong is easier to use, but Song has lower overhead.
2013-10-30*: update copyright year to 2013Max Kellermann1-1/+1
2013-10-29PlayerControl: move attributes to struct CrossFadeSettingsMax Kellermann1-6/+7
2013-10-28player_control: rename to PlayerControlMax Kellermann1-7/+7
2013-10-22Playlist: copy stream tags from the PlayerThreadMax Kellermann1-1/+42
Finally restores an important feature that has been broken for several months when the PlayerThread started working with Song copies instead of pointers to the Queue's Song instances (commit e96779d).
2013-10-17PlayerControl: GetError() returns an Error, not a char*Max Kellermann1-5/+23
2013-10-17Thread/Thread: replacement library for GThreadMax Kellermann1-8/+8
2013-09-27PlayerControl: use strictly typed enumsMax Kellermann1-38/+37
2013-09-27PlayerControl: convert functions to methodsMax Kellermann1-0/+55
2013-09-27PlayerThread: move code to player_control::CommandFinished()Max Kellermann1-0/+14
2013-09-04util/Error: new error passing libraryMax Kellermann1-4/+4
Replaces GLib's GError.
2013-08-03audio_format: convert to C++Max Kellermann1-3/+3
2013-07-28song: convert header to C++Max Kellermann1-4/+5
2013-01-25PlayerControl: add second Cond objectMax Kellermann1-0/+32
This fixes a deadlock bug introduced by 18076ac9. After all, the second Cond was necessary. The problem: two threads can wait for a signal at the same time. The player thread waits for the output thread to finish playback. The main thread waits for the player thread to complete a command. The output thread finishes playback, and sends a signal, which unfortunately does not wake up the player thread, but the main thread. The main thread sees that the command is still not finished, and waits again. The signal is lost forever, and MPD is deadlocked.
2013-01-20PlayerControl: move functions into the classMax Kellermann1-167/+121
2013-01-10PlayerControl: switch to the Mutex/Cond classesMax Kellermann1-6/+8
2013-01-04PlayerControl: add constructor and destructorMax Kellermann1-6/+4
2013-01-04player_control.h: convert header to C++Max Kellermann1-0/+0
2012-08-25player_thread: disable cross-fading in "single" modeMax Kellermann1-0/+15
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/+18
Make sure the player "owns" the next_song object, so nobody else can free it.
2012-08-08player_control: add GError attributeMax Kellermann1-9/+21
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-3/+5
2012-08-08player_control: rename player_error enum valuesMax Kellermann1-3/+11
2012-08-08player_control: remove unused enum player_error valuesMax Kellermann1-3/+0
2012-08-08player_control: inline trivial functionsMax Kellermann1-10/+25
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10include cleanupMax Kellermann1-1/+2
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-39/+40
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-03-21Add support for MixRamp tagsTim Phipps1-0/+14
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-09player_control: removed the "volatile" attributeMax Kellermann1-2/+2
Our use of the "volatile" keyword was wrong from the start, and now that we have proper locking, we can safely remove all of them.
2009-11-03decoder_control: make the song objects constMax Kellermann1-1/+1
They are just informational.
2009-10-31decoder_control: removed the global variable "dc"Max Kellermann1-1/+3
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-4/+74
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/+9
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/+6
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-1/+0
Sending PLAYER_COMMAND_STOP followed by PLAYER_COMMAND_QUEUE does the same. PLAYER_COMMAND_PLAY is redundant.
2009-10-08player_control: no CamelCaseMax Kellermann1-15/+24
2009-10-08player_control: bundle "get" functions in pc_get_status()Max Kellermann1-11/+10
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-0/+5
This lets us eliminate the static fixed-size buffer.
2009-07-06output: use the software mixer pluginMax Kellermann1-3/+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: renamed playerSeek(), return boolMax Kellermann1-2/+8
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-3/+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/+3
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-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.
2009-01-16player_control: fix shadow warning with older gccMax Kellermann1-1/+1
Older gcc versions complained about shadowed parameters in prototypes.
2008-12-17playlist: clear pc.errored_song on deleteMax Kellermann1-0/+8
When a (remote) song is deleted from the playlist, there may still be a reference to it in pc.errored_song. Clear this reference.
2008-11-03player: converted PLAYER_ERROR_* to enumMax Kellermann1-8/+10