Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "core/moonlight-common-c"]
path = core/moonlight-common-c
url = https://github.com/moonlight-stream/moonlight-common-c.git
url = https://github.com/logabell/moonlight-common-c-mic.git
[submodule "third_party/lvgl"]
path = third_party/lvgl
url = https://github.com/mariotaku/lvgl.git
Expand Down
13 changes: 12 additions & 1 deletion src/app/app_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ void settings_initialize(app_settings_t *config, char *conf_dir) {
set_string(&config->audio_backend, "auto");
set_string(&config->decoder, "auto");
config->audio_device = NULL;
set_string(&config->microphone_device, "");
config->sops = true;
config->localaudio = false;
config->enable_microphone = false;
config->fullscreen = true;
if (!config->fullscreen) {
config->window_state.w = 1280;
Expand Down Expand Up @@ -139,6 +141,10 @@ bool settings_save(app_settings_t *config) {
if (config->audio_device && config->audio_device[0]) {
ini_write_string(fp, "device", config->audio_device);
}
ini_write_bool(fp, "microphone", config->enable_microphone);
if (config->microphone_device && config->microphone_device[0]) {
ini_write_string(fp, "microphone_device", config->microphone_device);
}
ini_write_string(fp, "surround", serialize_audio_config(config->stream.audioConfiguration));

if (!config->fullscreen) {
Expand All @@ -156,6 +162,7 @@ void settings_clear(app_settings_t *config) {
free_nullable(config->decoder);
free_nullable(config->audio_backend);
free_nullable(config->audio_device);
free_nullable(config->microphone_device);
free_nullable(config->language);
free_nullable(config->ini_path);
free_nullable(config->condb_path);
Expand Down Expand Up @@ -271,6 +278,10 @@ static int settings_parse(app_settings_t *config, const char *section, const cha
set_string(&config->audio_backend, value);
} else if (INI_FULL_MATCH("audio", "device")) {
set_string(&config->audio_device, value);
} else if (INI_FULL_MATCH("audio", "microphone")) {
config->enable_microphone = INI_IS_TRUE(value);
} else if (INI_FULL_MATCH("audio", "microphone_device")) {
set_string(&config->microphone_device, value);
} else if (INI_NAME_MATCH("language")) {
set_string(&config->language, value);
} else if (INI_NAME_MATCH("fullscreen")) {
Expand Down Expand Up @@ -310,4 +321,4 @@ static void set_int(int *field, const char *value) {
return;
}
*field = val;
}
}
4 changes: 3 additions & 1 deletion src/app/app_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ typedef struct app_settings_t {
char *decoder;
char *audio_backend;
char *audio_device;
char *microphone_device;
char *language;
bool sops;
bool localaudio;
bool enable_microphone;
bool fullscreen;
window_state_t window_state;
int rotate;
Expand Down Expand Up @@ -94,4 +96,4 @@ void settings_clear(app_settings_t *config);

int settings_optimal_bitrate(const SS4S_VideoCapabilities *capabilities, int w, int h, int fps);

bool audio_config_valid(int config);
bool audio_config_valid(int config);
2 changes: 1 addition & 1 deletion src/app/stream/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
target_sources(moonlight-lib PRIVATE session_audio.c)
target_sources(moonlight-lib PRIVATE session_audio.c microphone_capture.c)
Loading