Skip to content

Commit 03082d0

Browse files
committed
win-asio: Enable monitoring track for output
This enables a monitoring track for output. Signed-off-by: pkv <[email protected]>
1 parent 95f0bce commit 03082d0

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

plugins/win-asio/data/locale/en-US.ini

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Reset.Device="Reload driver"
55
Reset.Device.Hint="Reloads manually the driver. This is useful in case of driver settings being modified (sample rate, buffer, ...)"
66

77
Asio.Input.Capture="ASIO input"
8+
ASIO.Output="ASIO Output"
9+
ASIO.Output.Hint="Any channel from the 6 audio tracks can be selected.\nAn additional monitoring track is provided which mixes all sources which are not set to 'Monitor Off'.\n"
810

911
OBS.Channels.0="OBS Channel 1"
1012
OBS.Channels.1="OBS Channel 2"
@@ -95,4 +97,12 @@ Track5.3=" Track 6 Channel 4"
9597
Track5.4=" Track 6 Channel 5"
9698
Track5.5=" Track 6 Channel 6"
9799
Track5.6=" Track 6 Channel 7"
98-
Track5.7=" Track 6 Channel 8"
100+
Track5.7=" Track 6 Channel 8"
101+
Track6.0=" Monitoring Track Channel 1"
102+
Track6.1=" Monitoring Track Channel 2"
103+
Track6.2=" Monitoring Track Channel 3"
104+
Track6.3=" Monitoring Track Channel 4"
105+
Track6.4=" Monitoring Track Channel 5"
106+
Track6.5=" Monitoring Track Channel 6"
107+
Track6.6=" Monitoring Track Channel 7"
108+
Track6.7=" Monitoring Track Channel 8"

plugins/win-asio/win-asio.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static void asio_output_update(void *vptr, obs_data_t *settings)
489489
data->asio_device->obs_track[i] = -1; // device does not use track i
490490
data->asio_device->obs_track_channel[i] = -1; // device does not use any channel from track i
491491
if (data->out_mix_channels[i] >= 0) {
492-
for (int j = 0; j < MAX_AUDIO_MIXES; j++) {
492+
for (int j = 0; j < MAX_AUDIO_MIXES_NEW; j++) {
493493
for (int k = 0; k < data->obs_track_channels; k++) {
494494
int64_t idx = (int64_t)k + (1LL << (j + 4));
495495
if (data->out_mix_channels[i] == idx) {
@@ -523,8 +523,8 @@ static void *asio_output_create(obs_data_t *settings, obs_output_t *output)
523523
for (int i = 0; i < MAX_DEVICE_CHANNELS; i++)
524524
data->out_mix_channels[i] = -1;
525525

526-
// allow all tracks for asio output
527-
obs_output_set_mixers(output, (1 << 6) - 1);
526+
// allow all tracks for asio output + extra monitoring track
527+
obs_output_set_mixers(output, (1 << 7) - 1);
528528

529529
os_atomic_set_bool(&data->active, true);
530530
os_atomic_set_bool(&data->stopping, false);
@@ -662,7 +662,7 @@ static bool on_asio_output_device_changed(void *priv, obs_properties_t *props, o
662662
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
663663
obs_property_set_long_description(p, obs_module_text("ASIO.Output.Hint"));
664664
obs_property_list_add_int(p, obs_module_text("Mute"), -1);
665-
for (int j = 0; j < MAX_AUDIO_MIXES; j++) {
665+
for (int j = 0; j < MAX_AUDIO_MIXES_NEW; j++) {
666666
for (int k = 0; k < global_output_asio_data->obs_track_channels; k++) {
667667
long long idx = k + (1ULL << (j + 4));
668668
char label[32];
@@ -720,7 +720,7 @@ static obs_properties_t *asio_output_properties(void *vptr)
720720
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT);
721721
obs_property_list_add_int(p, obs_module_text("Mute"), -1);
722722
obs_property_set_long_description(p, obs_module_text("ASIO.Output.Hint"));
723-
for (int j = 0; j < MAX_AUDIO_MIXES; j++) {
723+
for (int j = 0; j < MAX_AUDIO_MIXES_NEW; j++) {
724724
for (int k = 0; k < global_output_asio_data->obs_track_channels; k++) {
725725
long long idx = k + (1ULL << (j + 4));
726726
char label[32];
@@ -729,7 +729,6 @@ static obs_properties_t *asio_output_properties(void *vptr)
729729
}
730730
}
731731
}
732-
733732
return props;
734733
}
735734

0 commit comments

Comments
 (0)