Skip to content

Commit

Permalink
Allow adjusting volume in app
Browse files Browse the repository at this point in the history
Closes #525
  • Loading branch information
streetpea committed Jan 14, 2025
1 parent 941c4dd commit 5c7d8f6
Show file tree
Hide file tree
Showing 15 changed files with 446 additions and 219 deletions.
1 change: 1 addition & 0 deletions gui/include/qmlbackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class QmlBackend : public QObject
void updateDiscoveryHosts();
void updatePsnHosts();
void updatePsnHostsThread();
void updateAudioVolume();
QString getExecutable();

Settings *settings = {};
Expand Down
5 changes: 5 additions & 0 deletions gui/include/qmlsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class QmlSettings : public QObject
Q_PROPERTY(int codecLocalPS5 READ codecLocalPS5 WRITE setCodecLocalPS5 NOTIFY codecLocalPS5Changed)
Q_PROPERTY(int codecRemotePS5 READ codecRemotePS5 WRITE setCodecRemotePS5 NOTIFY codecRemotePS5Changed)
Q_PROPERTY(int audioBufferSize READ audioBufferSize WRITE setAudioBufferSize NOTIFY audioBufferSizeChanged)
Q_PROPERTY(int audioVolume READ audioVolume WRITE setAudioVolume NOTIFY audioVolumeChanged)
Q_PROPERTY(QString audioInDevice READ audioInDevice WRITE setAudioInDevice NOTIFY audioInDeviceChanged)
Q_PROPERTY(QString audioOutDevice READ audioOutDevice WRITE setAudioOutDevice NOTIFY audioOutDeviceChanged)
Q_PROPERTY(QString decoder READ decoder WRITE setDecoder NOTIFY decoderChanged)
Expand Down Expand Up @@ -233,6 +234,9 @@ class QmlSettings : public QObject
int audioBufferSize() const;
void setAudioBufferSize(int size);

int audioVolume() const;
void setAudioVolume(int volume);

QString audioInDevice() const;
void setAudioInDevice(const QString &device);

Expand Down Expand Up @@ -547,6 +551,7 @@ class QmlSettings : public QObject
void displayTargetPrimChanged();
void displayTargetTrcChanged();
void audioBufferSizeChanged();
void audioVolumeChanged();
void audioOutDeviceChanged();
void audioInDeviceChanged();
void wifiDroppedNotifChanged();
Expand Down
3 changes: 3 additions & 0 deletions gui/include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ class Settings : public QObject
RegisteredHost GetAutoConnectHost() const;
void SetAutoConnectHost(const QByteArray &mac);

int GetAudioVolume() const;
void SetAudioVolume(int volume);

unsigned int GetAudioBufferSizeDefault() const;

/**
Expand Down
3 changes: 3 additions & 0 deletions gui/include/streamsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct StreamSessionConnectInfo
ChiakiConnectVideoProfile video_profile;
double packet_loss_max;
unsigned int audio_buffer_size;
int audio_volume;
bool fullscreen;
bool zoom;
bool stretch;
Expand Down Expand Up @@ -157,6 +158,7 @@ class StreamSession : public QObject
bool allow_unmute;
int input_block;
QString host;
int audio_volume;
double measured_bitrate = 0;
double average_packet_loss = 0;
QList<double> packet_loss_history;
Expand Down Expand Up @@ -287,6 +289,7 @@ class StreamSession : public QObject
double GetAveragePacketLoss() { return average_packet_loss; }
bool GetMuted() { return muted; }
void SetMuted(bool enable) { if (enable != muted) ToggleMute(); }
void SetAudioVolume(int volume) { audio_volume = volume; }
bool GetCantDisplay() { return cant_display; }
ChiakiErrorCode ConnectPsnConnection(QString duid, bool ps5);
void CancelPsnConnection(bool stop_thread);
Expand Down
Loading

0 comments on commit 5c7d8f6

Please sign in to comment.