add dummy audio manager for non windows platforms
This commit is contained in:
@@ -2,14 +2,22 @@
|
||||
#include <QQuickWindow>
|
||||
#include <QApplication>
|
||||
#include "../overlaycontroller.h"
|
||||
#include "audiomanager/AudioManagerWindows.h"
|
||||
#ifdef _WIN32
|
||||
#include "audiomanager/AudioManagerWindows.h"
|
||||
#else
|
||||
#include "audiomanager/AudioManagerDummy.h"
|
||||
#endif
|
||||
|
||||
// application namespace
|
||||
namespace advsettings {
|
||||
|
||||
void AudioTabController::initStage1() {
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
#ifdef _WIN32
|
||||
audioManager.reset(new AudioManagerWindows());
|
||||
#else
|
||||
audioManager.reset(new AudioManagerDummy());
|
||||
#endif
|
||||
audioManager->init(this);
|
||||
m_playbackDevices = audioManager->getPlaybackDevices();
|
||||
m_recordingDevices = audioManager->getRecordingDevices();
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
#include "AudioManagerDummy.h"
|
||||
|
||||
// application namespace
|
||||
namespace advsettings {
|
||||
|
||||
void AudioManagerDummy::init(AudioTabController *controller)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void AudioManagerDummy::setPlaybackDevice(const std::string &id, bool notify)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getPlaybackDevName()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getPlaybackDevId()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
void AudioManagerDummy::setMirrorDevice(const std::string &id, bool notify)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::isMirrorValid()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getMirrorDevName()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getMirrorDevId()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
float AudioManagerDummy::getMirrorVolume()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::setMirrorVolume(float value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::getMirrorMuted()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::setMirrorMuted(bool value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::isMicValid()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void AudioManagerDummy::setMicDevice(const std::string &id, bool notify)
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getMicDevName()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
std::string AudioManagerDummy::getMicDevId()
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
float AudioManagerDummy::getMicVolume()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::setMicVolume(float value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::getMicMuted()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioManagerDummy::setMicMuted(bool value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string> > AudioManagerDummy::getRecordingDevices()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string> > AudioManagerDummy::getPlaybackDevices()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef AUDIOMANAGERLINUX_H
|
||||
#define AUDIOMANAGERLINUX_H
|
||||
|
||||
#include "../AudioManager.h"
|
||||
|
||||
// application namespace
|
||||
namespace advsettings {
|
||||
|
||||
class AudioManagerDummy : public AudioManager
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void init(AudioTabController* controller) override;
|
||||
|
||||
virtual void setPlaybackDevice(const std::string& id, bool notify = true) override;
|
||||
virtual std::string getPlaybackDevName() override;
|
||||
virtual std::string getPlaybackDevId() override;
|
||||
|
||||
virtual void setMirrorDevice(const std::string& id, bool notify = true) override;
|
||||
virtual bool isMirrorValid() override;
|
||||
virtual std::string getMirrorDevName() override;
|
||||
virtual std::string getMirrorDevId() override;
|
||||
virtual float getMirrorVolume() override;
|
||||
virtual bool setMirrorVolume(float value) override;
|
||||
virtual bool getMirrorMuted() override;
|
||||
virtual bool setMirrorMuted(bool value) override;
|
||||
|
||||
virtual bool isMicValid() override;
|
||||
virtual void setMicDevice(const std::string& id, bool notify = true) override;
|
||||
virtual std::string getMicDevName() override;
|
||||
virtual std::string getMicDevId() override;
|
||||
virtual float getMicVolume() override;
|
||||
virtual bool setMicVolume(float value) override;
|
||||
virtual bool getMicMuted() override;
|
||||
virtual bool setMicMuted(bool value) override;
|
||||
|
||||
virtual std::vector<std::pair<std::string, std::string>> getRecordingDevices() override;
|
||||
virtual std::vector<std::pair<std::string, std::string>> getPlaybackDevices() override;
|
||||
};
|
||||
|
||||
}
|
||||
#endif // AUDIOMANAGERLINUX_H
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../audiomanager.h"
|
||||
#include "../AudioManager.h"
|
||||
|
||||
#include <Mmdeviceapi.h>
|
||||
#include <Functiondiscoverykeys_devpkey.h>
|
||||
|
||||
Reference in New Issue
Block a user