From 0f40cfbc8e2ce03b42ce2cf732388b9e8cf50e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Mon, 26 Mar 2007 11:48:00 +0000 Subject: Send an event when the amp value or amp mute change. Patch by reinhard Nissl. Also bump the libtool version info. CVS patchset: 8749 CVS date: 2007/03/26 11:48:00 --- ChangeLog | 5 +++-- configure.ac | 4 ++-- include/xine.h.in | 3 ++- src/xine-engine/xine_interface.c | 34 +++++++++++++++++++++++++++++----- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad50e1755..71dfb6997 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,8 +33,8 @@ xine-lib (1.1.5) (Unreleased) by default (it can, and probably should) be different from the Win32 codecs path. * Avoid a possible floating-point exception when starting stream playback. - * Now xine can play correctly media on HTTP servers reporting status codes but - no status message. + * Now xine can play correctly media on HTTP servers reporting status codes + but no status message. * Wave files with 24-bit integer PCM streams now should play correctly (downplayed to 16-bit). * Added centre-cutout (4:3 in 16:9) to the expand plugin. @@ -47,6 +47,7 @@ xine-lib (1.1.5) (Unreleased) * Create at least a 1×1 shared image when the first frame is skipped (and thus reported as 0×0), to avoid disabling shared memory for all others. Patch by Reinhard Nissl. + * Send an event when the amp level is modified. Patch by Reinhard Nissl. xine-lib (1.1.4) * Mark string-type configuration items according to whether they're plain diff --git a/configure.ac b/configure.ac index 8dc2e6cda..8d6b7c53b 100644 --- a/configure.ac +++ b/configure.ac @@ -49,9 +49,9 @@ dnl are platform dependent dnl * in Linux, the library will be named dnl libname.so.(XINE_LT_CURRENT - XINE_LT_AGE).XINE_LT_AGE.XINE_LT_REVISION -XINE_LT_CURRENT=17 +XINE_LT_CURRENT=18 XINE_LT_REVISION=0 -XINE_LT_AGE=16 +XINE_LT_AGE=17 dnl for a release tarball do "rm .cvsversion" before "make dist" if test -f "${src_dir}/.cvsversion"; then diff --git a/include/xine.h.in b/include/xine.h.in index 858908b14..e4210d314 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine.h.in,v 1.167 2007/02/22 15:49:16 dgp85 Exp $ + * $Id: xine.h.in,v 1.168 2007/03/26 11:48:01 dgp85 Exp $ * * public xine-lib (libxine) interface and documentation * @@ -1582,6 +1582,7 @@ void xine_config_reset (xine_t *self) XINE_PROTECTED; #define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */ #define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */ #define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */ +#define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */ /* input events coming from frontend */ diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 1861df7c0..e58d9ed61 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_interface.c,v 1.103 2007/02/22 16:04:45 dgp85 Exp $ + * $Id: xine_interface.c,v 1.104 2007/03/26 11:48:01 dgp85 Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -341,6 +341,24 @@ int xine_port_send_gui_data (xine_video_port_t *vo, type, data); } +static void send_audio_amp_event_internal(xine_stream_t *stream) +{ + xine_event_t event; + xine_audio_level_data_t data; + + data.left + = data.right + = stream->audio_out->get_property (stream->audio_out, AO_PROP_AMP); + data.mute + = stream->audio_out->get_property (stream->audio_out, AO_PROP_AMP_MUTE); + + event.type = XINE_EVENT_AUDIO_AMP_LEVEL; + event.data = &data; + event.data_length = sizeof (data); + + xine_event_send(stream, &event); +} + void xine_set_param (xine_stream_t *stream, int param, int value) { /* Avoid crashing */ if ( ! stream ) { @@ -412,15 +430,21 @@ void xine_set_param (xine_stream_t *stream, int param, int value) { case XINE_PARAM_AUDIO_AMP_LEVEL: stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0); - if (stream->audio_out) - stream->audio_out->set_property (stream->audio_out, AO_PROP_AMP, value); + if (stream->audio_out) { + int old_value = stream->audio_out->get_property (stream->audio_out, AO_PROP_AMP); + if (old_value != stream->audio_out->set_property (stream->audio_out, AO_PROP_AMP, value)) + send_audio_amp_event_internal(stream); + } stream->xine->port_ticket->release(stream->xine->port_ticket, 0); break; case XINE_PARAM_AUDIO_AMP_MUTE: stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0); - if (stream->audio_out) - stream->audio_out->set_property (stream->audio_out, AO_PROP_AMP_MUTE, value); + if (stream->audio_out) { + int old_value = stream->audio_out->get_property (stream->audio_out, AO_PROP_AMP_MUTE); + if (old_value != stream->audio_out->set_property (stream->audio_out, AO_PROP_AMP_MUTE, value)) + send_audio_amp_event_internal(stream); + } stream->xine->port_ticket->release(stream->xine->port_ticket, 0); break; -- cgit v1.2.3