@raphiiko/wavelink-cli 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.js +44 -0
- package/package.json +1 -1
- package/src/index.ts +77 -0
package/README.md
CHANGED
|
@@ -92,6 +92,10 @@ wavelink-cli channel set-mix-volume <channel-id> <mix-id-or-name> <volume>
|
|
|
92
92
|
# Mute/Unmute in a specific mix
|
|
93
93
|
wavelink-cli channel mute-in-mix <channel-id> <mix-id-or-name>
|
|
94
94
|
wavelink-cli channel unmute-in-mix <channel-id> <mix-id-or-name>
|
|
95
|
+
wavelink-cli channel toggle-mute-in-mix <channel-id> <mix-id-or-name>
|
|
96
|
+
|
|
97
|
+
# Isolate a channel in a mix (mute all others)
|
|
98
|
+
wavelink-cli channel isolate <channel-id> <mix-id-or-name>
|
|
95
99
|
|
|
96
100
|
|
|
97
101
|
```
|
package/dist/index.js
CHANGED
|
@@ -5771,6 +5771,50 @@ channelCmd.command("unmute-in-mix").description("Unmute a channel in a specific
|
|
|
5771
5771
|
await client.setChannelMixMute(channel.id, mix.id, false);
|
|
5772
5772
|
console.log(`Successfully unmuted channel '${channel.name}' in mix '${mix.name}'`);
|
|
5773
5773
|
}));
|
|
5774
|
+
channelCmd.command("toggle-mute-in-mix").description("Toggle channel mute state in a specific mix").addArgument(new Argument("<channel-id>", "ID of the channel")).addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)")).action((channelId, mixId) => withClient(async (client) => {
|
|
5775
|
+
const mix = await requireMix(client, mixId);
|
|
5776
|
+
const { channels } = await client.getChannels();
|
|
5777
|
+
const channel = channels.find((c) => c.id === channelId);
|
|
5778
|
+
if (!channel)
|
|
5779
|
+
exitWithError(`Channel '${channelId}' not found`);
|
|
5780
|
+
const mixAssignment = channel.mixes?.find((m) => m.id === mix.id);
|
|
5781
|
+
if (!mixAssignment) {
|
|
5782
|
+
exitWithError(`Channel '${channelId}' is not available in mix '${mix.name}'`);
|
|
5783
|
+
}
|
|
5784
|
+
const newMuted = !mixAssignment.isMuted;
|
|
5785
|
+
await client.setChannelMixMute(channel.id, mix.id, newMuted);
|
|
5786
|
+
console.log(`Successfully toggled mute for channel '${channel.image?.name ?? channel.id}' in mix '${mix.name}'`);
|
|
5787
|
+
}));
|
|
5788
|
+
channelCmd.command("isolate").description("Mute all channels in a mix except for the specified one").addArgument(new Argument("<channel-id>", "ID of the channel to isolate")).addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)")).action((channelId, mixId) => withClient(async (client) => {
|
|
5789
|
+
const mix = await requireMix(client, mixId);
|
|
5790
|
+
const targetChannel = await requireChannel(client, channelId);
|
|
5791
|
+
const { channels } = await client.getChannels();
|
|
5792
|
+
let mutedCount = 0;
|
|
5793
|
+
let alreadyMutedCount = 0;
|
|
5794
|
+
for (const channel of channels) {
|
|
5795
|
+
const assignment = channel.mixes?.find((m) => m.id === mix.id);
|
|
5796
|
+
if (!assignment)
|
|
5797
|
+
continue;
|
|
5798
|
+
if (channel.id === targetChannel.id) {
|
|
5799
|
+
if (assignment.isMuted) {
|
|
5800
|
+
await client.setChannelMixMute(channel.id, mix.id, false);
|
|
5801
|
+
console.log(`Unmuted target channel '${channel.image?.name ?? channel.id}'`);
|
|
5802
|
+
} else {
|
|
5803
|
+
console.log(`Target channel '${channel.image?.name ?? channel.id}' is already unmuted`);
|
|
5804
|
+
}
|
|
5805
|
+
} else {
|
|
5806
|
+
if (!assignment.isMuted) {
|
|
5807
|
+
await client.setChannelMixMute(channel.id, mix.id, true);
|
|
5808
|
+
mutedCount++;
|
|
5809
|
+
} else {
|
|
5810
|
+
alreadyMutedCount++;
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5814
|
+
console.log(`SUCCESS: Isolated '${targetChannel.id}' in mix '${mix.name}'.
|
|
5815
|
+
` + ` - Muted ${mutedCount} other channels.
|
|
5816
|
+
` + ` - ${alreadyMutedCount} channels were already muted.`);
|
|
5817
|
+
}));
|
|
5774
5818
|
var inputCmd = program2.command("input").description("Manage input devices");
|
|
5775
5819
|
inputCmd.command("list").description("List all input devices with their IDs").action(() => withClient(listInputs));
|
|
5776
5820
|
inputCmd.command("set-gain").description("Set input device gain").addArgument(new Argument("<input-id>", "ID of the input device")).addArgument(new Argument("<gain>", "Gain level (0-100)")).action((inputId, gain) => {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -630,6 +630,83 @@ channelCmd
|
|
|
630
630
|
})
|
|
631
631
|
);
|
|
632
632
|
|
|
633
|
+
channelCmd
|
|
634
|
+
.command("toggle-mute-in-mix")
|
|
635
|
+
.description("Toggle channel mute state in a specific mix")
|
|
636
|
+
.addArgument(new Argument("<channel-id>", "ID of the channel"))
|
|
637
|
+
.addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)"))
|
|
638
|
+
.action((channelId: string, mixId: string) =>
|
|
639
|
+
withClient(async (client) => {
|
|
640
|
+
const mix = await requireMix(client, mixId);
|
|
641
|
+
const { channels } = await client.getChannels();
|
|
642
|
+
const channel = channels.find((c) => c.id === channelId);
|
|
643
|
+
|
|
644
|
+
if (!channel) exitWithError(`Channel '${channelId}' not found`);
|
|
645
|
+
|
|
646
|
+
const mixAssignment = channel.mixes?.find((m) => m.id === mix.id);
|
|
647
|
+
|
|
648
|
+
if (!mixAssignment) {
|
|
649
|
+
exitWithError(`Channel '${channelId}' is not available in mix '${mix.name}'`);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const newMuted = !mixAssignment.isMuted;
|
|
653
|
+
await client.setChannelMixMute(channel.id, mix.id, newMuted);
|
|
654
|
+
console.log(
|
|
655
|
+
`Successfully toggled mute for channel '${channel.image?.name ?? channel.id}' in mix '${
|
|
656
|
+
mix.name
|
|
657
|
+
}'`
|
|
658
|
+
);
|
|
659
|
+
})
|
|
660
|
+
);
|
|
661
|
+
|
|
662
|
+
channelCmd
|
|
663
|
+
.command("isolate")
|
|
664
|
+
.description("Mute all channels in a mix except for the specified one")
|
|
665
|
+
.addArgument(new Argument("<channel-id>", "ID of the channel to isolate"))
|
|
666
|
+
.addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)"))
|
|
667
|
+
.action((channelId: string, mixId: string) =>
|
|
668
|
+
withClient(async (client) => {
|
|
669
|
+
const mix = await requireMix(client, mixId);
|
|
670
|
+
const targetChannel = await requireChannel(client, channelId);
|
|
671
|
+
const { channels } = await client.getChannels();
|
|
672
|
+
|
|
673
|
+
let mutedCount = 0;
|
|
674
|
+
let alreadyMutedCount = 0;
|
|
675
|
+
|
|
676
|
+
for (const channel of channels) {
|
|
677
|
+
// Find the channel's assignment for this mix
|
|
678
|
+
const assignment = channel.mixes?.find((m) => m.id === mix.id);
|
|
679
|
+
|
|
680
|
+
// If the channel isn't in this mix (unexpected for Wave Link, but possible in API types), skip
|
|
681
|
+
if (!assignment) continue;
|
|
682
|
+
|
|
683
|
+
if (channel.id === targetChannel.id) {
|
|
684
|
+
// This is the chosen channel: Unmute it
|
|
685
|
+
if (assignment.isMuted) {
|
|
686
|
+
await client.setChannelMixMute(channel.id, mix.id, false);
|
|
687
|
+
console.log(`Unmuted target channel '${channel.image?.name ?? channel.id}'`);
|
|
688
|
+
} else {
|
|
689
|
+
console.log(`Target channel '${channel.image?.name ?? channel.id}' is already unmuted`);
|
|
690
|
+
}
|
|
691
|
+
} else {
|
|
692
|
+
// This is NOT the chosen channel: Mute it
|
|
693
|
+
if (!assignment.isMuted) {
|
|
694
|
+
await client.setChannelMixMute(channel.id, mix.id, true);
|
|
695
|
+
mutedCount++;
|
|
696
|
+
} else {
|
|
697
|
+
alreadyMutedCount++;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
console.log(
|
|
703
|
+
`SUCCESS: Isolated '${targetChannel.id}' in mix '${mix.name}'.\n` +
|
|
704
|
+
` - Muted ${mutedCount} other channels.\n` +
|
|
705
|
+
` - ${alreadyMutedCount} channels were already muted.`
|
|
706
|
+
);
|
|
707
|
+
})
|
|
708
|
+
);
|
|
709
|
+
|
|
633
710
|
// Input commands
|
|
634
711
|
const inputCmd = program.command("input").description("Manage input devices");
|
|
635
712
|
|