]> git.sesse.net Git - vlc/commitdiff
aout: remove old aout_(Volume|Mute)(Get|Set)() functions
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 1 Nov 2012 17:18:02 +0000 (19:18 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 1 Nov 2012 17:25:28 +0000 (19:25 +0200)
And remove the other instance of find-input-callback.

include/vlc_aout.h
include/vlc_aout_intf.h [deleted file]
lib/audio.c
lib/media_player.c
po/POTFILES.in
src/Makefile.am
src/audio_output/aout_internal.h
src/audio_output/intf.c [deleted file]
src/audio_output/output.c
src/playlist/aout.c

index 6bdd4f865f70b0f2a95804eb1796871d903c7fdb..046f3421b08bf7580fdbf4db1527f9fcdec98517 100644 (file)
@@ -224,6 +224,11 @@ VLC_API void aout_FormatPrint(vlc_object_t *, const char *,
 #define aout_FormatPrint(o, t, f) aout_FormatPrint(VLC_OBJECT(o), t, f)
 VLC_API const char * aout_FormatPrintChannels( const audio_sample_format_t * ) VLC_USED;
 
+VLC_API float aout_VolumeGet (audio_output_t *);
+VLC_API int aout_VolumeSet (audio_output_t *, float);
+VLC_API int aout_MuteGet (audio_output_t *);
+VLC_API int aout_MuteSet (audio_output_t *, bool);
+
 /**
  * Report change of configured audio volume to the core and UI.
  */
diff --git a/include/vlc_aout_intf.h b/include/vlc_aout_intf.h
deleted file mode 100644 (file)
index 204f8bc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*****************************************************************************
- * vlc_aout_intf.h : audio output control
- *****************************************************************************
- * Copyright (C) 2002-2011 VLC authors and VideoLAN
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser 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.
- *****************************************************************************/
-
-#ifndef VLC_AOUT_INTF_H
-#define VLC_AOUT_INTF_H 1
-
-/**
- * \file
- * This file defines functions, structures and macros for audio output object
- */
-
-#define AOUT_VOLUME_DEFAULT             256
-#define AOUT_VOLUME_MAX                 512
-
-VLC_API float aout_VolumeGet( vlc_object_t * );
-#define aout_VolumeGet(a) aout_VolumeGet(VLC_OBJECT(a))
-VLC_API int aout_VolumeSet( vlc_object_t *, float );
-#define aout_VolumeSet(a, b) aout_VolumeSet(VLC_OBJECT(a), b)
-VLC_API int aout_MuteSet( vlc_object_t *, bool );
-#define aout_MuteSet(a, b) aout_MuteSet(VLC_OBJECT(a), b)
-VLC_API int aout_MuteGet( vlc_object_t * );
-#define aout_MuteGet(a) aout_MuteGet(VLC_OBJECT(a))
-
-#endif /* _VLC_AOUT_H */
index 3183ad94329f22a8ea069bcf9bc8a655622cb159..0d3fcce92ef2cdda29abc73c756bbe0812fd70b4 100644 (file)
@@ -35,7 +35,6 @@
 
 #include <vlc_common.h>
 #include <vlc_input.h>
-#include <vlc_aout_intf.h>
 #include <vlc_aout.h>
 #include <vlc_modules.h>
 
@@ -256,18 +255,39 @@ void libvlc_audio_toggle_mute( libvlc_media_player_t *mp )
 
 int libvlc_audio_get_mute( libvlc_media_player_t *mp )
 {
-    return aout_MuteGet( mp );
+    int mute = -1;
+
+    audio_output_t *aout = GetAOut( mp );
+    if( aout != NULL )
+    {
+        mute = aout_MuteGet( aout );
+        vlc_object_release( aout );
+    }
+    return mute;
 }
 
 void libvlc_audio_set_mute( libvlc_media_player_t *mp, int mute )
 {
-    aout_MuteSet( VLC_OBJECT(mp), mute != 0 );
+    audio_output_t *aout = GetAOut( mp );
+    if( aout != NULL )
+    {
+        mute = aout_MuteSet( aout, mute );
+        vlc_object_release( aout );
+    }
 }
 
 int libvlc_audio_get_volume( libvlc_media_player_t *mp )
 {
-    float vol = aout_VolumeGet( mp );
-    return ( vol >= 0.f ) ? lroundf( vol * 100.f ) : -1;
+    int volume = -1;
+
+    audio_output_t *aout = GetAOut( mp );
+    if( aout != NULL )
+    {
+        float vol = aout_VolumeGet( aout );
+        vlc_object_release( aout );
+        volume = lroundf( vol * 100.f );
+    }
+    return volume;
 }
 
 int libvlc_audio_set_volume( libvlc_media_player_t *mp, int volume )
@@ -278,8 +298,15 @@ int libvlc_audio_set_volume( libvlc_media_player_t *mp, int volume )
         libvlc_printerr( "Volume out of range" );
         return -1;
     }
-    aout_VolumeSet (mp, vol);
-    return 0;
+
+    int ret = -1;
+    audio_output_t *aout = GetAOut( mp );
+    if( aout != NULL )
+    {
+        ret = aout_VolumeSet( aout, vol );
+        vlc_object_release( aout );
+    }
+    return ret;
 }
 
 /*****************************************************************************
index 57e7e9d61e8869430edf3d5d6abf20da8dfd6cc1..2eb524d853251ce66abab0b5287c64788084c0ca 100644 (file)
@@ -357,13 +357,6 @@ static int snapshot_was_taken(vlc_object_t *p_this, char const *psz_cmd,
     return VLC_SUCCESS;
 }
 
-static input_thread_t *find_input (vlc_object_t *obj)
-{
-    libvlc_media_player_t *mp = (libvlc_media_player_t *)obj;
-
-    return libvlc_get_input_thread (mp);
-}
-
 /* */
 static void libvlc_media_player_destroy( libvlc_media_player_t * );
 
@@ -466,8 +459,6 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "aout", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
     var_Create (mp, "mute", VLC_VAR_BOOL);
     var_Create (mp, "volume", VLC_VAR_FLOAT);
-    var_Create (mp, "find-input-callback", VLC_VAR_ADDRESS);
-    var_SetAddress (mp, "find-input-callback", find_input);
     var_Create (mp, "corks", VLC_VAR_INTEGER);
     var_Create (mp, "amem-data", VLC_VAR_ADDRESS);
     var_Create (mp, "amem-setup", VLC_VAR_ADDRESS);
index f12b605f7d8f995c274f9681fa4c0d23025aa0da..703d0cd1b98a24ad3e82e43e30755696b1117e4e 100644 (file)
@@ -67,7 +67,6 @@ src/audio_output/common.c
 src/audio_output/dec.c
 src/audio_output/filters.c
 src/audio_output/input.c
-src/audio_output/intf.c
 src/audio_output/output.c
 src/config/chain.c
 src/config/cmdline.c
index 6d5915fb0b540c357efc2aaa072a8432430b8484..663351e8392101dd108d93a4ac8e93148333fd83 100644 (file)
@@ -24,7 +24,6 @@ pluginsincludedir = $(pkgincludedir)/plugins
 pluginsinclude_HEADERS = \
        ../include/vlc_access.h \
        ../include/vlc_aout.h \
-       ../include/vlc_aout_intf.h \
        ../include/vlc_aout_volume.h \
        ../include/vlc_arrays.h \
        ../include/vlc_art_finder.h \
@@ -412,7 +411,6 @@ SOURCES_libvlc_common = \
        audio_output/input.c \
        audio_output/output.c \
        audio_output/volume.c \
-       audio_output/intf.c \
        osd/osd.c \
        osd/osd_text.c \
        network/getaddrinfo.c \
index b947348911e09f8c388f1e69bf2793fb4fe32914..ac6a9b6360fca318efc397f506c4e7d80ebe8385 100644 (file)
@@ -139,10 +139,6 @@ void aout_volume_Delete(aout_volume_t *);
 audio_output_t *aout_New (vlc_object_t *);
 #define aout_New(a) aout_New(VLC_OBJECT(a))
 void aout_Destroy (audio_output_t *);
-float aout_OutputVolumeGet (audio_output_t *);
-int aout_OutputVolumeSet (audio_output_t *, float);
-int aout_OutputMuteGet (audio_output_t *);
-int aout_OutputMuteSet (audio_output_t *, bool);
 
 int aout_OutputNew( audio_output_t * p_aout,
                     const audio_sample_format_t * p_format );
diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
deleted file mode 100644 (file)
index 94702fb..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*****************************************************************************
- * intf.c : audio output API towards the interface modules
- *****************************************************************************
- * Copyright (C) 2002-2007 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Christophe Massiot <massiot@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser 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.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_aout_intf.h>
-
-#include <stdio.h>
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
-#include <string.h>
-#include <math.h>
-
-#include <vlc_aout.h>
-#include "aout_internal.h"
-
-#include <vlc_playlist.h>
-
-static audio_output_t *findAout (vlc_object_t *obj)
-{
-    input_thread_t *(*pf_find_input) (vlc_object_t *);
-
-    pf_find_input = var_GetAddress (obj, "find-input-callback");
-    if (unlikely(pf_find_input == NULL))
-        return NULL;
-
-    input_thread_t *p_input = pf_find_input (obj);
-    if (p_input == NULL)
-       return NULL;
-
-    audio_output_t *p_aout = input_GetAout (p_input);
-    vlc_object_release (p_input);
-    return p_aout;
-}
-#define findAout(o) findAout(VLC_OBJECT(o))
-
-#undef aout_VolumeGet
-/**
- * Gets the volume of the output device (independent of mute).
- * \return Current audio volume (0 = silent, 1 = nominal),
- * or a strictly negative value if undefined.
- */
-float aout_VolumeGet (vlc_object_t *obj)
-{
-    audio_output_t *aout = findAout (obj);
-    if (aout == NULL)
-        return -1.f;
-
-    float volume = aout_OutputVolumeGet (aout);
-    vlc_object_release (aout);
-    return volume;
-}
-
-#undef aout_VolumeSet
-/**
- * Sets the volume of the output device.
- * \note The mute status is not changed.
- */
-int aout_VolumeSet (vlc_object_t *obj, float vol)
-{
-    int ret = -1;
-
-    audio_output_t *aout = findAout (obj);
-    if (aout != NULL)
-    {
-        ret = aout_OutputVolumeSet (aout, vol);
-        vlc_object_release (aout);
-    }
-    return ret;
-}
-
-#undef aout_MuteGet
-/**
- * Gets the output mute status.
- * \return 0 if not muted, 1 if muted, -1 if undefined.
- */
-int aout_MuteGet (vlc_object_t *obj)
-{
-    audio_output_t *aout = findAout (obj);
-    if (aout == NULL)
-        return -1.f;
-
-    bool mute = aout_OutputMuteGet (aout);
-    vlc_object_release (aout);
-    return mute;
-}
-
-#undef aout_MuteSet
-/**
- * Sets mute status.
- */
-int aout_MuteSet (vlc_object_t *obj, bool mute)
-{
-    int ret = -1;
-
-    audio_output_t *aout = findAout (obj);
-    if (aout != NULL)
-    {
-        ret = aout_OutputMuteSet (aout, mute);
-        vlc_object_release (aout);
-        if (ret == 0)
-            var_SetBool (obj, "mute", mute);
-    }
-    return ret;
-}
-
-
-
index 30e236c9452d92ec2270aa7c5edb1dd023ae5082..925a4a25452952140df6586cde5a1386b81a52cb 100644 (file)
@@ -255,7 +255,7 @@ static void aout_Destructor (vlc_object_t *obj)
  * \return Current audio volume (0. = silent, 1. = nominal),
  * or a strictly negative value if undefined.
  */
-float aout_OutputVolumeGet (audio_output_t *aout)
+float aout_VolumeGet (audio_output_t *aout)
 {
     return var_GetFloat (aout, "volume");
 }
@@ -265,7 +265,7 @@ float aout_OutputVolumeGet (audio_output_t *aout)
  * \note The mute status is not changed.
  * \return 0 on success, -1 on failure.
  */
-int aout_OutputVolumeSet (audio_output_t *aout, float vol)
+int aout_VolumeSet (audio_output_t *aout, float vol)
 {
     int ret = -1;
 
@@ -280,7 +280,7 @@ int aout_OutputVolumeSet (audio_output_t *aout, float vol)
  * Gets the audio output stream mute flag.
  * \return 0 if not muted, 1 if muted, -1 if undefined.
  */
-int aout_OutputMuteGet (audio_output_t *aout)
+int aout_MuteGet (audio_output_t *aout)
 {
     return var_InheritBool (aout, "mute");
 }
@@ -289,7 +289,7 @@ int aout_OutputMuteGet (audio_output_t *aout)
  * Sets the audio output stream mute flag.
  * \return 0 on success, -1 on failure.
  */
-int aout_OutputMuteSet (audio_output_t *aout, bool mute)
+int aout_MuteSet (audio_output_t *aout, bool mute)
 {
     int ret = -1;
 
index 74a0cbb14406ade92a836a134c4b84fcfbb91bba..2203d2de3f17c5d69cf28b47b7b34d33c8dc1770 100644 (file)
@@ -47,7 +47,7 @@ float playlist_VolumeGet (playlist_t *pl)
     audio_output_t *aout = findAout (pl);
     if (aout != NULL)
     {
-        volume = aout_OutputVolumeGet (aout);
+        volume = aout_VolumeGet (aout);
         vlc_object_release (aout);
     }
     return volume;
@@ -60,7 +60,7 @@ int playlist_VolumeSet (playlist_t *pl, float vol)
     audio_output_t *aout = findAout (pl);
     if (aout != NULL)
     {
-        ret = aout_OutputVolumeSet (aout, vol);
+        ret = aout_VolumeSet (aout, vol);
         vlc_object_release (aout);
     }
     return ret;
@@ -80,7 +80,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
     audio_output_t *aout = findAout (pl);
     if (aout != NULL)
     {
-        float vol = aout_OutputVolumeGet (aout);
+        float vol = aout_VolumeGet (aout);
         if (vol >= 0.)
         {
             vol += value / (float)AOUT_VOLUME_DEFAULT;
@@ -90,7 +90,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
                 vol = 2.;
             if (volp != NULL)
                 *volp = vol;
-            ret = aout_OutputVolumeSet (aout, vol);
+            ret = aout_VolumeSet (aout, vol);
         }
         vlc_object_release (aout);
     }
@@ -104,7 +104,7 @@ int playlist_MuteGet (playlist_t *pl)
     audio_output_t *aout = findAout (pl);
     if (aout != NULL)
     {
-        mute = aout_OutputMuteGet (aout);
+        mute = aout_MuteGet (aout);
         vlc_object_release (aout);
     }
     return mute;
@@ -117,7 +117,7 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
     audio_output_t *aout = findAout (pl);
     if (aout != NULL)
     {
-        ret = aout_OutputMuteSet (aout, mute);
+        ret = aout_MuteSet (aout, mute);
         vlc_object_release (aout);
         if (ret == 0)
             var_SetBool (pl, "mute", mute);