mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
api: implement getSupportedAudioManagers() in the library
Change-Id: Ia59a7af9bccbf2b56acce6fb7ca8c41fcb8cdae5
This commit is contained in:
@ -18,16 +18,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "dbusconfigurationmanager.h"
|
||||
#include "configurationmanager_interface.h"
|
||||
#include "datatransfer_interface.h"
|
||||
|
||||
#include "media/audio/audiolayer.h"
|
||||
|
||||
DBusConfigurationManager::DBusConfigurationManager(DBus::Connection& connection)
|
||||
: DBus::ObjectAdaptor(connection, "/cx/ring/Ring/ConfigurationManager")
|
||||
{}
|
||||
@ -403,20 +397,10 @@ DBusConfigurationManager::setAudioManager(const std::string& api) -> decltype(DR
|
||||
return DRing::setAudioManager(api);
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
DBusConfigurationManager::getSupportedAudioManagers()
|
||||
auto
|
||||
DBusConfigurationManager::getSupportedAudioManagers() -> decltype(DRing::getSupportedAudioManagers())
|
||||
{
|
||||
return {
|
||||
#if HAVE_ALSA
|
||||
ALSA_API_STR,
|
||||
#endif
|
||||
#if HAVE_PULSE
|
||||
PULSEAUDIO_API_STR,
|
||||
#endif
|
||||
#if HAVE_JACK
|
||||
JACK_API_STR,
|
||||
#endif
|
||||
};
|
||||
return DRing::getSupportedAudioManagers();
|
||||
}
|
||||
|
||||
auto
|
||||
|
@ -780,6 +780,12 @@ setRingingTimeout(int32_t timeout)
|
||||
jami::Manager::instance().setRingingTimeout(timeout);
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
getSupportedAudioManagers()
|
||||
{
|
||||
return jami::AudioPreference::getSupportedAudioManagers();
|
||||
}
|
||||
|
||||
bool
|
||||
setAudioManager(const std::string& api)
|
||||
{
|
||||
|
@ -123,6 +123,7 @@ DRING_PUBLIC void mutePlayback(bool mute);
|
||||
DRING_PUBLIC bool isRingtoneMuted();
|
||||
DRING_PUBLIC void muteRingtone(bool mute);
|
||||
|
||||
DRING_PUBLIC std::vector<std::string> getSupportedAudioManagers();
|
||||
DRING_PUBLIC std::string getAudioManager();
|
||||
DRING_PUBLIC bool setAudioManager(const std::string& api);
|
||||
|
||||
|
@ -44,6 +44,7 @@ typedef struct SpeexEchoState_ SpeexEchoState;
|
||||
*/
|
||||
|
||||
// Define the audio api
|
||||
#define OPENSL_API_STR "opensl"
|
||||
#define PULSEAUDIO_API_STR "pulseaudio"
|
||||
#define ALSA_API_STR "alsa"
|
||||
#define JACK_API_STR "jack"
|
||||
|
@ -438,6 +438,31 @@ AudioPreference::createAudioLayer()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<std::string>
|
||||
AudioPreference::getSupportedAudioManagers()
|
||||
{
|
||||
return {
|
||||
#if HAVE_OPENSL
|
||||
OPENSL_API_STR,
|
||||
#endif
|
||||
#if HAVE_ALSA
|
||||
ALSA_API_STR,
|
||||
#endif
|
||||
#if HAVE_PULSE
|
||||
PULSEAUDIO_API_STR,
|
||||
#endif
|
||||
#if HAVE_JACK
|
||||
JACK_API_STR,
|
||||
#endif
|
||||
#if HAVE_COREAUDIO
|
||||
COREAUDIO_API_STR,
|
||||
#endif
|
||||
#if HAVE_PORTAUDIO
|
||||
PORTAUDIO_API_STR,
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
void AudioPreference::serialize(YAML::Emitter &out) const
|
||||
{
|
||||
out << YAML::Key << CONFIG_LABEL << YAML::Value << YAML::BeginMap;
|
||||
|
@ -238,6 +238,8 @@ class AudioPreference : public Serializable {
|
||||
AudioLayer *createAudioLayer();
|
||||
AudioLayer *switchAndCreateAudioLayer();
|
||||
|
||||
static std::vector<std::string> getSupportedAudioManagers();
|
||||
|
||||
std::string getAudioApi() const {
|
||||
return audioApi_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user