default audio profile and view added
Update logging dependency from 9.84 to 9.89 This is the newest version that doesn't lead to compile errors. It has also reduced the amount of "-Wexpansion-to-defined" errors on clang-msvc by about 80 (from ~400 to 320). Update easylogging license file Originally came as LICENCE.txt (notice C instead of S in LICENSE), renamed to better fit into the git history. Move logging defines to QMAKE instead of logging.h Defines done outside of easylogging++.h does not work according to official documentation (https://github.com/zuhd-org/easyloggingpp/blob/master/README.md#configuration-macros) "NOTE: All the macros can be defined in one of the following ways: 1. Define macros using -D option of compiler, for example in case of g++ you will do g++ source.cpp ... -DELPP_SYSLOG -DELPP_THREAD_SAFE ... (recommended way) 2. Define macros inside "easylogging++.h" (defining macros in other files won't work)" Linking to this issue: https://github.com/zuhd-org/easyloggingpp/issues/590#issuecomment-346753951 We are using the developer recommended way of defining them by command line. What is assumed to be the intention of enabling debug logs before including easylogging++ never actually did anything, hence this define is dropped. Newer versions of easylogging++ uses the macro ELPP_DISABLE_DEBUG_LOGS to _disable_ debug logs. Leaving that macro undefined satisfies the original intent. Move easylogging++ include into necessary files logging.h previously had logic to enable debug logging even on release builds. This logic was moved to the QMAKE file, hence the logging.h file is no longer necessary. Update easylogging++ to 9.96.7, turn on /WX for clang-msvc Updating from easylogging++ 9.89 to 9.96.7 turns it from a header only library to one requiring a source file. It has been added to sources near the other third party includes in the QMAKE to signify that it isn't a first party file. Updating easylogging++ also means that clang-msvc can compile without any warnings, hence turning on warnings as errors for that compiler as well, to avoid any regressions. updated to current fixed formatting fixed ptt add bug/compilerwarnings/c++14 target cleaned up .pro file fixed casting back to c++ style added default profile and ptt profile view fixed c++ casts fixed logic error on getDevice functions
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// easylogging includes
|
||||
#ifndef _DEBUG
|
||||
# define _DEBUG
|
||||
# define ELPP_THREAD_SAFE
|
||||
# define ELPP_QT_LOGGING
|
||||
# define ELPP_NO_DEFAULT_LOG_FILE
|
||||
# include <easylogging++.h>
|
||||
# undef _DEBUG
|
||||
#else
|
||||
# define ELPP_THREAD_SAFE
|
||||
# define ELPP_QT_LOGGING
|
||||
# define ELPP_NO_DEFAULT_LOG_FILE
|
||||
# include <easylogging++.h>
|
||||
#endif
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
#include <QStandardPaths>
|
||||
#include <openvr.h>
|
||||
#include <iostream>
|
||||
#include "logging.h"
|
||||
#include <easylogging++.h>
|
||||
|
||||
INITIALIZE_EASYLOGGINGPP
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <openvr.h>
|
||||
#include "logging.h"
|
||||
#include <easylogging++.h>
|
||||
#include "utils/Matrix.h"
|
||||
|
||||
// application namespace
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <QQuickRenderControl>
|
||||
#include <QSoundEffect>
|
||||
#include <memory>
|
||||
#include "logging.h"
|
||||
#include <easylogging++.h>
|
||||
#include "utils/ChaperoneUtils.h"
|
||||
|
||||
#include "tabcontrollers/SteamVRTabController.h"
|
||||
|
||||
@@ -663,7 +663,7 @@ MyStackViewPage {
|
||||
//audioProfileComboBox.currentIndex = AudioTabController.audioProfileDefaultIndex+1
|
||||
}
|
||||
onPttProfileAdded:{
|
||||
pttProfileComboBox.currentIndex = AudioTabController.getpttProfileCount()
|
||||
pttProfileComboBox.currentIndex = AudioTabController.getPttProfileCount()
|
||||
}
|
||||
|
||||
//onAudioProfileDefaultIndexChanged: {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,192 +3,186 @@
|
||||
|
||||
#include "AudioManager.h"
|
||||
#include "PttController.h"
|
||||
//#include "AudioProfileController.h"
|
||||
#include <memory>
|
||||
|
||||
class QQuickWindow;
|
||||
// application namespace
|
||||
namespace advsettings {
|
||||
namespace advsettings
|
||||
{
|
||||
// forward declaration
|
||||
class OverlayController;
|
||||
|
||||
// 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;
|
||||
bool defaultProfile = false;
|
||||
};
|
||||
|
||||
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;
|
||||
bool defaultProfile = false;
|
||||
};
|
||||
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 )
|
||||
Q_PROPERTY( float mirrorVolume READ mirrorVolume WRITE setMirrorVolume
|
||||
NOTIFY mirrorVolumeChanged )
|
||||
Q_PROPERTY( bool mirrorMuted READ mirrorMuted WRITE setMirrorMuted NOTIFY
|
||||
mirrorMutedChanged )
|
||||
Q_PROPERTY( int micDeviceIndex READ micDeviceIndex WRITE setMicDeviceIndex
|
||||
NOTIFY micDeviceIndexChanged )
|
||||
Q_PROPERTY( float micVolume READ micVolume WRITE setMicVolume NOTIFY
|
||||
micVolumeChanged )
|
||||
Q_PROPERTY(
|
||||
bool micMuted READ micMuted WRITE setMicMuted NOTIFY micMutedChanged )
|
||||
Q_PROPERTY( bool micProximitySensorCanMute READ micProximitySensorCanMute
|
||||
WRITE setMicProximitySensorCanMute NOTIFY
|
||||
micProximitySensorCanMuteChanged )
|
||||
Q_PROPERTY( bool micReversePtt READ micReversePtt WRITE setMicReversePtt
|
||||
NOTIFY micReversePttChanged )
|
||||
Q_PROPERTY( bool audioProfileDefault READ audioProfileDefault WRITE
|
||||
setAudioProfileDefault NOTIFY audioProfileDefaultChanged )
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
QQuickWindow* widget;
|
||||
|
||||
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)
|
||||
//Q_PROPERTY(bool mirrorPresent READ mirrorPresent NOTIFY mirrorPresentChanged)
|
||||
//Q_PROPERTY(QString mirrorDevName READ mirrorDevName NOTIFY mirrorDevNameChanged)
|
||||
Q_PROPERTY(float mirrorVolume READ mirrorVolume WRITE setMirrorVolume NOTIFY mirrorVolumeChanged)
|
||||
Q_PROPERTY(bool mirrorMuted READ mirrorMuted WRITE setMirrorMuted NOTIFY mirrorMutedChanged)
|
||||
Q_PROPERTY(int micDeviceIndex READ micDeviceIndex WRITE setMicDeviceIndex NOTIFY micDeviceIndexChanged)
|
||||
//Q_PROPERTY(bool micPresent READ micPresent NOTIFY micPresentChanged)
|
||||
//Q_PROPERTY(QString micDevName READ micDevName NOTIFY micDevNameChanged)
|
||||
Q_PROPERTY(float micVolume READ micVolume WRITE setMicVolume NOTIFY micVolumeChanged)
|
||||
Q_PROPERTY(bool micMuted READ micMuted WRITE setMicMuted NOTIFY micMutedChanged)
|
||||
Q_PROPERTY(bool micProximitySensorCanMute READ micProximitySensorCanMute WRITE setMicProximitySensorCanMute NOTIFY micProximitySensorCanMuteChanged)
|
||||
Q_PROPERTY(bool micReversePtt READ micReversePtt WRITE setMicReversePtt NOTIFY micReversePttChanged)
|
||||
vr::VROverlayHandle_t m_ulNotificationOverlayHandle
|
||||
= vr::k_ulOverlayHandleInvalid;
|
||||
|
||||
Q_PROPERTY(bool audioProfileDefault READ audioProfileDefault WRITE setAudioProfileDefault NOTIFY audioProfileDefaultChanged)
|
||||
int m_playbackDeviceIndex = -1;
|
||||
|
||||
//To display default profile
|
||||
//Q_PROPERTY(bool audioProfileDefaultIndex READ audioProfileDefaultIndex NOTIFY audioProfileDefaultIndexChanged)
|
||||
|
||||
int m_mirrorDeviceIndex = -1;
|
||||
float m_mirrorVolume = 1.0;
|
||||
bool m_mirrorMuted = false;
|
||||
|
||||
int m_recordingDeviceIndex = -1;
|
||||
float m_micVolume = 1.0;
|
||||
bool m_micMuted = false;
|
||||
bool m_micProximitySensorCanMute = false;
|
||||
bool m_micReversePtt = false;
|
||||
bool m_isDefaultAudioProfile = false;
|
||||
// int m_defaultAudioProfileIndex = 2;
|
||||
std::string m_defaultProfileName;
|
||||
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
|
||||
private:
|
||||
OverlayController* parent;
|
||||
QQuickWindow* widget;
|
||||
std::unique_ptr<AudioManager> audioManager;
|
||||
std::vector<std::pair<std::string, std::string>> m_recordingDevices;
|
||||
std::vector<std::pair<std::string, std::string>> m_playbackDevices;
|
||||
std::string lastMirrorDevId;
|
||||
|
||||
vr::VROverlayHandle_t m_ulNotificationOverlayHandle = vr::k_ulOverlayHandleInvalid;
|
||||
QString getSettingsName() override
|
||||
{
|
||||
return "audioSettings";
|
||||
}
|
||||
void onPttStart() override;
|
||||
void onPttStop() override;
|
||||
void onPttEnabled() override;
|
||||
void onPttDisabled() override;
|
||||
bool pttChangeValid() override;
|
||||
virtual vr::VROverlayHandle_t getNotificationOverlayHandle() override
|
||||
{
|
||||
return m_ulNotificationOverlayHandle;
|
||||
}
|
||||
|
||||
int m_playbackDeviceIndex = -1;
|
||||
void findPlaybackDeviceIndex( std::string id, bool notify = true );
|
||||
void findMirrorDeviceIndex( std::string id, bool notify = true );
|
||||
void findMicDeviceIndex( std::string id, bool notify = true );
|
||||
|
||||
int m_mirrorDeviceIndex = -1;
|
||||
float m_mirrorVolume = 1.0;
|
||||
bool m_mirrorMuted = false;
|
||||
int getPlaybackIndex( std::string str );
|
||||
int getRecordingIndex( std::string str );
|
||||
int getMirrorIndex( std::string str );
|
||||
|
||||
int m_recordingDeviceIndex = -1;
|
||||
float m_micVolume = 1.0;
|
||||
bool m_micMuted = false;
|
||||
bool m_micProximitySensorCanMute = false;
|
||||
bool m_micReversePtt = false;
|
||||
bool m_isDefaultAudioProfile = false;
|
||||
//int m_defaultAudioProfileIndex = 2;
|
||||
std::string m_defaultProfileName;
|
||||
void removeDefaultProfile( QString name );
|
||||
|
||||
unsigned settingsUpdateCounter = 0;
|
||||
std::vector<AudioProfile> audioProfiles;
|
||||
|
||||
std::unique_ptr<AudioManager> audioManager;
|
||||
std::vector<std::pair<std::string, std::string>> m_recordingDevices;
|
||||
std::vector<std::pair<std::string, std::string>> m_playbackDevices;
|
||||
std::string lastMirrorDevId;
|
||||
public:
|
||||
void initStage1();
|
||||
void initStage2( OverlayController* parent1, QQuickWindow* widget1 );
|
||||
|
||||
QString getSettingsName() override { return "audioSettings"; }
|
||||
//QString getSettingsNameAudio() override { return "audioSettingsTest"; }
|
||||
void onPttStart() override;
|
||||
void onPttStop() override;
|
||||
void onPttEnabled() override;
|
||||
void onPttDisabled() override;
|
||||
bool pttChangeValid() override;
|
||||
virtual vr::VROverlayHandle_t getNotificationOverlayHandle() override { return m_ulNotificationOverlayHandle; }
|
||||
void reloadAudioSettings();
|
||||
void saveAudioSettings();
|
||||
|
||||
void findPlaybackDeviceIndex(std::string id, bool notify = true);
|
||||
void findMirrorDeviceIndex(std::string id, bool notify = true);
|
||||
void findMicDeviceIndex(std::string id, bool notify = true);
|
||||
void eventLoopTick();
|
||||
|
||||
int getPlaybackIndex(std::string str);
|
||||
int getRecordingIndex(std::string str);
|
||||
int getMirrorIndex(std::string str);
|
||||
//void setPlaybackDeviceControl(int index, bool notify = true);
|
||||
int playbackDeviceIndex() const;
|
||||
|
||||
void removeDefaultProfile(QString name);
|
||||
//void setAudioProfileDefaultIndex(int index);
|
||||
//void setDefaultAudioProfileName(int index);
|
||||
int mirrorDeviceIndex() const;
|
||||
float mirrorVolume() const;
|
||||
bool mirrorMuted() const;
|
||||
|
||||
std::vector<AudioProfile> audioProfiles;
|
||||
//std::recursive_mutex eventLoopMutexAudio;
|
||||
int micDeviceIndex() const;
|
||||
float micVolume() const;
|
||||
bool micMuted() const;
|
||||
bool micProximitySensorCanMute() const;
|
||||
bool micReversePtt() const;
|
||||
bool audioProfileDefault() const;
|
||||
// int audioProfileDefaultIndex() const;
|
||||
|
||||
public:
|
||||
void reloadAudioProfiles();
|
||||
void saveAudioProfiles();
|
||||
Q_INVOKABLE void applyDefaultProfile();
|
||||
|
||||
Q_INVOKABLE int getPlaybackDeviceCount();
|
||||
Q_INVOKABLE QString getPlaybackDeviceName( int index );
|
||||
|
||||
void initStage1();
|
||||
void initStage2(OverlayController* parent, QQuickWindow* widget);
|
||||
Q_INVOKABLE int getRecordingDeviceCount();
|
||||
Q_INVOKABLE QString getRecordingDeviceName( int index );
|
||||
|
||||
void reloadAudioSettings();
|
||||
void saveAudioSettings();
|
||||
Q_INVOKABLE unsigned getAudioProfileCount();
|
||||
Q_INVOKABLE QString getAudioProfileName( unsigned index );
|
||||
|
||||
void eventLoopTick();
|
||||
void onNewRecordingDevice();
|
||||
void onNewPlaybackDevice();
|
||||
void onNewMirrorDevice();
|
||||
void onDeviceStateChanged();
|
||||
|
||||
int playbackDeviceIndex() const;
|
||||
public slots:
|
||||
void setMirrorVolume( float value, bool notify = true );
|
||||
void setMirrorMuted( bool value, bool notify = true );
|
||||
|
||||
int mirrorDeviceIndex() const;
|
||||
float mirrorVolume() const;
|
||||
bool mirrorMuted() const;
|
||||
void setMicVolume( float value, bool notify = true );
|
||||
void setMicMuted( bool value, bool notify = true );
|
||||
void setMicProximitySensorCanMute( bool value, bool notify = true );
|
||||
void setMicReversePtt( bool value, bool notify = true );
|
||||
|
||||
int micDeviceIndex() const;
|
||||
float micVolume() const;
|
||||
bool micMuted() const;
|
||||
bool micProximitySensorCanMute() const;
|
||||
bool micReversePtt() const;
|
||||
bool audioProfileDefault() const;
|
||||
//int audioProfileDefaultIndex() const;
|
||||
void setPlaybackDeviceIndex( int value, bool notify = true );
|
||||
void setMirrorDeviceIndex( int value, bool notify = true );
|
||||
void setMicDeviceIndex( int value, bool notify = true );
|
||||
|
||||
void reloadAudioProfiles();
|
||||
void saveAudioProfiles();
|
||||
Q_INVOKABLE void applyDefaultProfile();
|
||||
void addAudioProfile( QString name );
|
||||
void applyAudioProfile( unsigned index );
|
||||
void deleteAudioProfile( unsigned index );
|
||||
|
||||
Q_INVOKABLE int getPlaybackDeviceCount();
|
||||
Q_INVOKABLE QString getPlaybackDeviceName(int index);
|
||||
void setAudioProfileDefault( bool value, bool notify = true );
|
||||
|
||||
Q_INVOKABLE int getRecordingDeviceCount();
|
||||
Q_INVOKABLE QString getRecordingDeviceName(int index);
|
||||
signals:
|
||||
void playbackDeviceIndexChanged( int index );
|
||||
|
||||
//TODO check if needed?
|
||||
Q_INVOKABLE unsigned getAudioProfileCount();
|
||||
Q_INVOKABLE QString getAudioProfileName(unsigned index);
|
||||
void mirrorDeviceIndexChanged( int index );
|
||||
void mirrorVolumeChanged( float value );
|
||||
void mirrorMutedChanged( bool value );
|
||||
|
||||
void micDeviceIndexChanged( int index );
|
||||
void micVolumeChanged( float value );
|
||||
void micMutedChanged( bool value );
|
||||
void micProximitySensorCanMuteChanged( bool value );
|
||||
void micReversePttChanged( bool value );
|
||||
|
||||
void onNewRecordingDevice();
|
||||
void onNewPlaybackDevice();
|
||||
void onNewMirrorDevice();
|
||||
void onDeviceStateChanged();
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
void setMirrorVolume(float value, bool notify = true);
|
||||
void setMirrorMuted(bool value, bool notify = true);
|
||||
|
||||
void setMicVolume(float value, bool notify = true);
|
||||
void setMicMuted(bool value, bool notify = true);
|
||||
void setMicProximitySensorCanMute(bool value, bool notify = true);
|
||||
void setMicReversePtt(bool value, bool notify = true);
|
||||
|
||||
void setPlaybackDeviceIndex(int value, bool notify = true);
|
||||
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);
|
||||
|
||||
void setAudioProfileDefault(bool value, bool notify = true);
|
||||
|
||||
signals:
|
||||
void playbackDeviceIndexChanged(int index);
|
||||
|
||||
void mirrorDeviceIndexChanged(int index);
|
||||
void mirrorVolumeChanged(float value);
|
||||
void mirrorMutedChanged(bool value);
|
||||
|
||||
void micDeviceIndexChanged(int index);
|
||||
void micVolumeChanged(float value);
|
||||
void micMutedChanged(bool value);
|
||||
void micProximitySensorCanMuteChanged(bool value);
|
||||
void micReversePttChanged(bool value);
|
||||
|
||||
void playbackDeviceListChanged();
|
||||
void recordingDeviceListChanged();
|
||||
|
||||
void audioProfilesUpdated();
|
||||
void audioProfileAdded();
|
||||
//void defaultAudioProfileApplied();
|
||||
//void audioProfileDefaultIndexChanged();
|
||||
void audioProfileDefaultChanged(bool value);
|
||||
};
|
||||
void playbackDeviceListChanged();
|
||||
void recordingDeviceListChanged();
|
||||
|
||||
void audioProfilesUpdated();
|
||||
void audioProfileAdded();
|
||||
void audioProfileDefaultChanged( bool value );
|
||||
};
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -407,43 +407,58 @@ void PttController::addPttProfile( QString name )
|
||||
savePttProfiles();
|
||||
OverlayController::appSettings()->sync();
|
||||
emit pttProfilesUpdated();
|
||||
emit pttProfileAdded();
|
||||
}
|
||||
emit pttProfileAdded();
|
||||
}
|
||||
|
||||
void PttController::applyPttProfile(unsigned index) {
|
||||
std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
|
||||
if (index < pttProfiles.size()) {
|
||||
auto& profile = pttProfiles[index];
|
||||
setPttShowNotification(profile.showNotification);
|
||||
setPttLeftControllerEnabled(profile.leftControllerEnabled);
|
||||
setPttRightControllerEnabled(profile.rightControllerEnabled);
|
||||
m_pttControllerConfigs[0].digitalButtons = profile.controllerConfigs[0].digitalButtons;
|
||||
m_pttControllerConfigs[0].digitalButtonMask = profile.controllerConfigs[0].digitalButtonMask;
|
||||
m_pttControllerConfigs[0].triggerMode = profile.controllerConfigs[0].triggerMode;
|
||||
m_pttControllerConfigs[0].touchpadMode = profile.controllerConfigs[0].touchpadMode;
|
||||
m_pttControllerConfigs[0].touchpadAreas = profile.controllerConfigs[0].touchpadAreas;
|
||||
m_pttControllerConfigs[1].digitalButtons = profile.controllerConfigs[1].digitalButtons;
|
||||
m_pttControllerConfigs[1].digitalButtonMask = profile.controllerConfigs[1].digitalButtonMask;
|
||||
m_pttControllerConfigs[1].triggerMode = profile.controllerConfigs[1].triggerMode;
|
||||
m_pttControllerConfigs[1].touchpadMode = profile.controllerConfigs[1].touchpadMode;
|
||||
m_pttControllerConfigs[1].touchpadAreas = profile.controllerConfigs[1].touchpadAreas;
|
||||
void PttController::applyPttProfile( unsigned index )
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock( eventLoopMutex );
|
||||
if ( index < pttProfiles.size() )
|
||||
{
|
||||
auto& profile = pttProfiles[index];
|
||||
setPttShowNotification( profile.showNotification );
|
||||
setPttLeftControllerEnabled( profile.leftControllerEnabled );
|
||||
setPttRightControllerEnabled( profile.rightControllerEnabled );
|
||||
m_pttControllerConfigs[0].digitalButtons
|
||||
= profile.controllerConfigs[0].digitalButtons;
|
||||
m_pttControllerConfigs[0].digitalButtonMask
|
||||
= profile.controllerConfigs[0].digitalButtonMask;
|
||||
m_pttControllerConfigs[0].triggerMode
|
||||
= profile.controllerConfigs[0].triggerMode;
|
||||
m_pttControllerConfigs[0].touchpadMode
|
||||
= profile.controllerConfigs[0].touchpadMode;
|
||||
m_pttControllerConfigs[0].touchpadAreas
|
||||
= profile.controllerConfigs[0].touchpadAreas;
|
||||
m_pttControllerConfigs[1].digitalButtons
|
||||
= profile.controllerConfigs[1].digitalButtons;
|
||||
m_pttControllerConfigs[1].digitalButtonMask
|
||||
= profile.controllerConfigs[1].digitalButtonMask;
|
||||
m_pttControllerConfigs[1].triggerMode
|
||||
= profile.controllerConfigs[1].triggerMode;
|
||||
m_pttControllerConfigs[1].touchpadMode
|
||||
= profile.controllerConfigs[1].touchpadMode;
|
||||
m_pttControllerConfigs[1].touchpadAreas
|
||||
= profile.controllerConfigs[1].touchpadAreas;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PttController::deletePttProfile(unsigned index) {
|
||||
if (index < pttProfiles.size()) {
|
||||
auto pos = pttProfiles.begin() + index;
|
||||
pttProfiles.erase(pos);
|
||||
savePttProfiles();
|
||||
OverlayController::appSettings()->sync();
|
||||
emit pttProfilesUpdated();
|
||||
void PttController::deletePttProfile( unsigned index )
|
||||
{
|
||||
if ( index < pttProfiles.size() )
|
||||
{
|
||||
auto pos = pttProfiles.begin() + index;
|
||||
pttProfiles.erase( pos );
|
||||
savePttProfiles();
|
||||
OverlayController::appSettings()->sync();
|
||||
emit pttProfilesUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
QVariantList PttController::pttDigitalButtons(unsigned controller) {
|
||||
if (controller < 2) {
|
||||
return m_pttControllerConfigs[controller].digitalButtons;
|
||||
}
|
||||
|
||||
QVariantList PttController::pttDigitalButtons( unsigned controller )
|
||||
{
|
||||
if ( controller < 2 )
|
||||
{
|
||||
return m_pttControllerConfigs[controller].digitalButtons;
|
||||
}
|
||||
return QVariantList();
|
||||
}
|
||||
@@ -496,138 +511,6 @@ QString PttController::getPttProfileName( unsigned index )
|
||||
return QString::fromStdString( pttProfiles[index].profileName );
|
||||
}
|
||||
return "";
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
void PttController::setPttEnabled(bool value, bool notify, bool save) {
|
||||
std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
|
||||
if (value != m_pttEnabled) {
|
||||
m_pttEnabled = value;
|
||||
if (value) {
|
||||
onPttEnabled();
|
||||
} else {
|
||||
onPttDisabled();
|
||||
}
|
||||
if (notify) {
|
||||
emit pttEnabledChanged(value);
|
||||
}
|
||||
if (save) {
|
||||
savePttConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PttController::setPttShowNotification(bool value, bool notify, bool save) {
|
||||
std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
|
||||
if (value != m_pttShowNotification) {
|
||||
m_pttShowNotification = value;
|
||||
if (notify) {
|
||||
emit pttShowNotificationChanged(value);
|
||||
}
|
||||
if (save) {
|
||||
savePttConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PttController::setPttLeftControllerEnabled(bool value, bool notify, bool save) {
|
||||
std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
|
||||
if (value != m_pttLeftControllerEnabled) {
|
||||
m_pttLeftControllerEnabled = value;
|
||||
if (notify) {
|
||||
emit pttLeftControllerEnabledChanged(value);
|
||||
}
|
||||
if (save) {
|
||||
savePttConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PttController::setPttRightControllerEnabled(bool value, bool notify, bool save) {
|
||||
std::lock_guard<std::recursive_mutex> lock(eventLoopMutex);
|
||||
if (value != m_pttRightControllerEnabled) {
|
||||
m_pttRightControllerEnabled = value;
|
||||
if (notify) {
|
||||
emit pttRightControllerEnabledChanged(value);
|
||||
}
|
||||
if (save) {
|
||||
savePttConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void logControllerState(const vr::VRControllerState_t& state, const std::string& prefix) {
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_ApplicationMenu)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_ApplicationMenu) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_ApplicationMenu)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_ApplicationMenu) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_Grip)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Grip) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_Grip)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Grip) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_DPad_Left)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Left) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_DPad_Left)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Left) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_DPad_Up)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Up) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_DPad_Up)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Up) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_DPad_Right)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Right) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_DPad_Right)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Right) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_DPad_Down)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Down) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_DPad_Down)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_DPad_Down) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_A)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_A) << " pressed";
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_A)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_A) << " touched";
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_Axis0)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis0) << " pressed";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis0) << " x: " << state.rAxis[0].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_Axis0)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis0) << " touched";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis0) << " x: " << state.rAxis[0].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_Axis1)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis1) << " pressed";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis1) << " x: " << state.rAxis[1].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_Axis1)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis1) << " touched";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis1) << " x: " << state.rAxis[1].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_Axis2)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis2) << " pressed";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis2) << " x: " << state.rAxis[2].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonTouched & vr::ButtonMaskFromId(vr::k_EButton_Axis2)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis2) << " touched";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis2) << " x: " << state.rAxis[2].x << " y: " << state.rAxis[0].y;
|
||||
}
|
||||
if (state.ulButtonPressed & vr::ButtonMaskFromId(vr::k_EButton_Axis3)) {
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis3) << " pressed";
|
||||
LOG(INFO) << prefix << vr::VRSystem()->GetButtonIdNameFromEnum(vr::k_EButton_Axis3) << " x: " << state.rAxis[3].x << " y: " << state.rAxis[0].y;
|
||||
=======
|
||||
}
|
||||
|
||||
void PttController::setPttEnabled( bool value, bool notify, bool save )
|
||||
@@ -652,7 +535,6 @@ void PttController::setPttEnabled( bool value, bool notify, bool save )
|
||||
{
|
||||
savePttConfig();
|
||||
}
|
||||
>>>>>>> cfde8ada6350ef771b110ba9f12b8b54daa7e07b
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ signals:
|
||||
void pttRightControllerEnabledChanged( bool value );
|
||||
|
||||
void pttProfilesUpdated();
|
||||
void pttProfileAdded();
|
||||
};
|
||||
void pttProfileAdded();
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "audiomanagerwindows.h"
|
||||
#include "AudioManagerWindows.h"
|
||||
#include <exception>
|
||||
#include "../../logging.h"
|
||||
#include "easylogging++.h"
|
||||
#include "../AudioTabController.h"
|
||||
|
||||
#include <locale>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "KeyboardInputWindows.h"
|
||||
#include <Windows.h>
|
||||
#include "../../logging.h"
|
||||
#include "easylogging++.h"
|
||||
|
||||
namespace advsettings
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user