2009-03-13 18:43:16 +01:00
|
|
|
/*
|
2013-01-04 09:46:41 +01:00
|
|
|
* Copyright (C) 2003-2013 The Music Player Daemon Project
|
2009-03-13 18:43:16 +01:00
|
|
|
* http://www.musicpd.org
|
2008-09-09 10:02:34 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2009-03-13 18:43:16 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-09-09 10:02:34 +02:00
|
|
|
*/
|
|
|
|
|
2013-01-04 09:46:41 +01:00
|
|
|
#ifndef MPD_OUTPUT_CONTROL_HXX
|
|
|
|
#define MPD_OUTPUT_CONTROL_HXX
|
2008-09-09 10:02:34 +02:00
|
|
|
|
2013-10-02 12:22:12 +02:00
|
|
|
#include "ReplayGainInfo.hxx"
|
2013-01-05 00:05:57 +01:00
|
|
|
|
2008-10-08 10:49:29 +02:00
|
|
|
#include <stddef.h>
|
2008-09-09 10:02:34 +02:00
|
|
|
|
|
|
|
struct audio_output;
|
2013-08-03 21:00:50 +02:00
|
|
|
struct AudioFormat;
|
2009-01-18 19:48:31 +01:00
|
|
|
struct config_param;
|
2013-09-26 21:51:45 +02:00
|
|
|
class MusicPipe;
|
2009-11-03 21:08:48 +01:00
|
|
|
struct player_control;
|
2008-09-09 10:02:34 +02:00
|
|
|
|
2013-01-05 00:05:57 +01:00
|
|
|
void
|
|
|
|
audio_output_set_replay_gain_mode(struct audio_output *ao,
|
|
|
|
enum replay_gain_mode mode);
|
|
|
|
|
2009-10-23 10:55:52 +02:00
|
|
|
/**
|
|
|
|
* Enables the device.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
audio_output_enable(struct audio_output *ao);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disables the device.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
audio_output_disable(struct audio_output *ao);
|
|
|
|
|
2008-10-29 22:17:44 +01:00
|
|
|
/**
|
|
|
|
* Opens or closes the device, depending on the "enabled" flag.
|
2009-03-07 19:55:57 +01:00
|
|
|
*
|
|
|
|
* @return true if the device is open
|
2008-10-29 22:17:44 +01:00
|
|
|
*/
|
2009-03-07 19:55:57 +01:00
|
|
|
bool
|
2008-10-29 22:17:44 +01:00
|
|
|
audio_output_update(struct audio_output *ao,
|
2013-08-03 21:00:50 +02:00
|
|
|
AudioFormat audio_format,
|
2013-09-26 21:51:45 +02:00
|
|
|
const MusicPipe &mp);
|
2008-10-29 22:17:44 +01:00
|
|
|
|
2009-02-16 00:43:06 +01:00
|
|
|
void
|
2009-03-09 19:25:26 +01:00
|
|
|
audio_output_play(struct audio_output *ao);
|
2008-09-29 16:43:55 +02:00
|
|
|
|
2009-02-16 00:43:06 +01:00
|
|
|
void audio_output_pause(struct audio_output *ao);
|
2008-09-29 16:43:55 +02:00
|
|
|
|
2009-11-09 22:16:26 +01:00
|
|
|
void
|
|
|
|
audio_output_drain_async(struct audio_output *ao);
|
|
|
|
|
2011-09-01 07:13:21 +02:00
|
|
|
/**
|
|
|
|
* Clear the "allow_play" flag and send the "CANCEL" command
|
2011-09-01 07:53:42 +02:00
|
|
|
* asynchronously. To finish the operation, the caller has to call
|
|
|
|
* audio_output_allow_play().
|
2011-09-01 07:13:21 +02:00
|
|
|
*/
|
2009-02-16 00:43:06 +01:00
|
|
|
void audio_output_cancel(struct audio_output *ao);
|
2010-03-03 20:29:33 +01:00
|
|
|
|
2011-09-01 07:53:42 +02:00
|
|
|
/**
|
|
|
|
* Set the "allow_play" and signal the thread.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
audio_output_allow_play(struct audio_output *ao);
|
|
|
|
|
2009-02-16 00:43:06 +01:00
|
|
|
void audio_output_close(struct audio_output *ao);
|
2010-03-03 20:29:33 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the audio output, but if the "always_on" flag is set, put it
|
|
|
|
* into pause mode instead.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
audio_output_release(struct audio_output *ao);
|
|
|
|
|
2009-02-16 00:43:06 +01:00
|
|
|
void audio_output_finish(struct audio_output *ao);
|
2008-09-09 10:02:34 +02:00
|
|
|
|
|
|
|
#endif
|