audio profiles no logic re-org

This commit is contained in:
ykeara
2018-12-20 23:42:53 -06:00
parent 78f411e9df
commit 25e24c04af
5 changed files with 168 additions and 177 deletions
+35 -2
View File
@@ -3,7 +3,7 @@
#include "AudioManager.h"
#include "PttController.h"
#include "AudioProfileController.h"
//#include "AudioProfileController.h"
#include <memory>
class QQuickWindow;
@@ -13,8 +13,21 @@ namespace advsettings {
// forward declaration
class OverlayController;
struct AudioProfile {
std::string profileName;
std::string playbackName;
std::string mirrorName;
std::string micName;
float mirrorVol = 0.0;
float micVol = 0.0;
bool micMute = false;
bool mirrorMute = false;
//TODO all the settings!!! huehue
//bool showNotification = false;
};
class AudioTabController : public AudioProfileController {
class AudioTabController : public PttController {
Q_OBJECT
Q_PROPERTY(int playbackDeviceIndex READ playbackDeviceIndex WRITE setPlaybackDeviceIndex NOTIFY playbackDeviceIndexChanged)
Q_PROPERTY(int mirrorDeviceIndex READ mirrorDeviceIndex WRITE setMirrorDeviceIndex NOTIFY mirrorDeviceIndexChanged)
@@ -68,7 +81,14 @@ namespace advsettings {
void findMirrorDeviceIndex(std::string id, bool notify = true);
void findMicDeviceIndex(std::string id, bool notify = true);
void setPlaybackDeviceControl(int index, bool notify = true);
std::vector<AudioProfile> audioProfiles;
//std::recursive_mutex eventLoopMutexAudio;
public:
void initStage1();
void initStage2(OverlayController* parent, QQuickWindow* widget);
@@ -89,12 +109,19 @@ namespace advsettings {
bool micProximitySensorCanMute() const;
bool micReversePtt() const;
void reloadAudioProfiles();
void saveAudioProfiles();
Q_INVOKABLE int getPlaybackDeviceCount();
Q_INVOKABLE QString getPlaybackDeviceName(int index);
Q_INVOKABLE int getRecordingDeviceCount();
Q_INVOKABLE QString getRecordingDeviceName(int index);
//TODO check if needed?
Q_INVOKABLE unsigned getAudioProfileCount();
Q_INVOKABLE QString getAudioProfileName(unsigned index);
void onNewRecordingDevice();
void onNewPlaybackDevice();
void onNewMirrorDevice();
@@ -113,6 +140,10 @@ namespace advsettings {
void setMirrorDeviceIndex(int value, bool notify = true);
void setMicDeviceIndex(int value, bool notify = true);
void addAudioProfile(QString name);
void applyAudioProfile(unsigned index);
void deleteAudioProfile(unsigned index);
signals:
void playbackDeviceIndexChanged(int index);
@@ -128,6 +159,8 @@ namespace advsettings {
void playbackDeviceListChanged();
void recordingDeviceListChanged();
void audioProfilesUpdated();
};
} // namespace advsettings