Skip to content

Commit 34154d1

Browse files
authored
Unmute initially muted channels only if -S/--solo is provided. (#73)
Fixes xmp-cli unmuting initially muted IT channels by default, causing incorrect sounds to play in various modules. Examples: channels 15-23 of Cyclone/almagest.it, channel 8 of Bombardment II (https://modarchive.org/index.php?request=view_by_moduleid&query=194589), and channel 4 of Zeux Champion (https://modarchive.org/index.php?request=view_by_moduleid&query=194586).
1 parent 237c6fd commit 34154d1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Stable versions
55
Changes by Alice Rowan
66
- Report pan value "---" for instruments/samples without
77
a default panning value (sub->pan < 0).
8+
- Don't unmute muted IT channels unless explicitly unmuted by
9+
the -S/--solo option.
810

911
4.2.0 (20230615):
1012
Changes by Özkan Sezer:

src/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ int main(int argc, char **argv)
283283
opt.dsp = XMP_DSP_LOWPASS;
284284
opt.player_mode = XMP_MODE_AUTO;
285285
opt.amplify = 1;
286+
for (i = 0; i < XMP_MAX_CHANNELS; i++) {
287+
opt.mute[i] = -1; /* Use module default mute/unmute state */
288+
}
286289

287290
/* read configuration file */
288291
if (!opt.norc) {
@@ -484,7 +487,12 @@ int main(int argc, char **argv)
484487
/* Mute channels */
485488

486489
for (i = 0; i < XMP_MAX_CHANNELS; i++) {
487-
xmp_channel_mute(xc, i, opt.mute[i]);
490+
/* Only mute/unmute if an option has been
491+
* provided explicitly (to avoid unmuting
492+
* disabled channels in IT et al.) */
493+
if (opt.mute[i] >= 0) {
494+
xmp_channel_mute(xc, i, opt.mute[i]);
495+
}
488496
}
489497

490498
/* Set player flags */

0 commit comments

Comments
 (0)