@raphiiko/wavelink-cli 0.0.3 → 0.0.5

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 CHANGED
@@ -50,6 +50,7 @@ wavelink-cli output set-volume <output-id> <volume>
50
50
  # Mute/Unmute
51
51
  wavelink-cli output mute <output-id>
52
52
  wavelink-cli output unmute <output-id>
53
+ wavelink-cli output toggle-mute <output-id>
53
54
  ```
54
55
 
55
56
  ### Mixes
@@ -92,6 +93,10 @@ wavelink-cli channel set-mix-volume <channel-id> <mix-id-or-name> <volume>
92
93
  # Mute/Unmute in a specific mix
93
94
  wavelink-cli channel mute-in-mix <channel-id> <mix-id-or-name>
94
95
  wavelink-cli channel unmute-in-mix <channel-id> <mix-id-or-name>
96
+ wavelink-cli channel toggle-mute-in-mix <channel-id> <mix-id-or-name>
97
+
98
+ # Isolate a channel in a mix (mute all others)
99
+ wavelink-cli channel isolate <channel-id> <mix-id-or-name>
95
100
 
96
101
 
97
102
  ```
@@ -109,6 +114,7 @@ wavelink-cli input set-gain <input-id> <gain>
109
114
  # Mute/Unmute
110
115
  wavelink-cli input mute <input-id>
111
116
  wavelink-cli input unmute <input-id>
117
+ wavelink-cli input toggle-mute <input-id>
112
118
  ```
113
119
 
114
120
  ### General
package/dist/index.js CHANGED
@@ -5699,6 +5699,10 @@ outputCmd.command("set-volume").description("Set output device volume").addArgum
5699
5699
  });
5700
5700
  outputCmd.command("mute").description("Mute an output device").addArgument(new Argument("<output-id>", "ID of the output device")).action((outputId) => withClient((client) => setOutputMute(client, outputId, true)));
5701
5701
  outputCmd.command("unmute").description("Unmute an output device").addArgument(new Argument("<output-id>", "ID of the output device")).action((outputId) => withClient((client) => setOutputMute(client, outputId, false)));
5702
+ outputCmd.command("toggle-mute").description("Toggle output device mute state").addArgument(new Argument("<output-id>", "ID of the output device")).action((outputId) => withClient(async (client) => {
5703
+ const output = await requireOutput(client, outputId);
5704
+ await setOutputMute(client, outputId, !output.isMuted);
5705
+ }));
5702
5706
  var mixCmd = program2.command("mix").description("Manage mixes");
5703
5707
  mixCmd.command("list").description("List all mixes with their IDs and names").action(() => withClient(listMixes));
5704
5708
  mixCmd.command("set-output").description("Set a device as the ONLY output for a mix (removes all other outputs from that mix)").addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)")).addArgument(new Argument("<output-id>", "ID of the output device")).action((mixId, outputId) => withClient((client) => setSingleOutputForMix(client, outputId, mixId)));
@@ -5771,6 +5775,50 @@ channelCmd.command("unmute-in-mix").description("Unmute a channel in a specific
5771
5775
  await client.setChannelMixMute(channel.id, mix.id, false);
5772
5776
  console.log(`Successfully unmuted channel '${channel.name}' in mix '${mix.name}'`);
5773
5777
  }));
5778
+ 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) => {
5779
+ const mix = await requireMix(client, mixId);
5780
+ const { channels } = await client.getChannels();
5781
+ const channel = channels.find((c) => c.id === channelId);
5782
+ if (!channel)
5783
+ exitWithError(`Channel '${channelId}' not found`);
5784
+ const mixAssignment = channel.mixes?.find((m) => m.id === mix.id);
5785
+ if (!mixAssignment) {
5786
+ exitWithError(`Channel '${channelId}' is not available in mix '${mix.name}'`);
5787
+ }
5788
+ const newMuted = !mixAssignment.isMuted;
5789
+ await client.setChannelMixMute(channel.id, mix.id, newMuted);
5790
+ console.log(`Successfully toggled mute for channel '${channel.image?.name ?? channel.id}' in mix '${mix.name}'`);
5791
+ }));
5792
+ 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) => {
5793
+ const mix = await requireMix(client, mixId);
5794
+ const targetChannel = await requireChannel(client, channelId);
5795
+ const { channels } = await client.getChannels();
5796
+ let mutedCount = 0;
5797
+ let alreadyMutedCount = 0;
5798
+ for (const channel of channels) {
5799
+ const assignment = channel.mixes?.find((m) => m.id === mix.id);
5800
+ if (!assignment)
5801
+ continue;
5802
+ if (channel.id === targetChannel.id) {
5803
+ if (assignment.isMuted) {
5804
+ await client.setChannelMixMute(channel.id, mix.id, false);
5805
+ console.log(`Unmuted target channel '${channel.image?.name ?? channel.id}'`);
5806
+ } else {
5807
+ console.log(`Target channel '${channel.image?.name ?? channel.id}' is already unmuted`);
5808
+ }
5809
+ } else {
5810
+ if (!assignment.isMuted) {
5811
+ await client.setChannelMixMute(channel.id, mix.id, true);
5812
+ mutedCount++;
5813
+ } else {
5814
+ alreadyMutedCount++;
5815
+ }
5816
+ }
5817
+ }
5818
+ console.log(`SUCCESS: Isolated '${targetChannel.id}' in mix '${mix.name}'.
5819
+ ` + ` - Muted ${mutedCount} other channels.
5820
+ ` + ` - ${alreadyMutedCount} channels were already muted.`);
5821
+ }));
5774
5822
  var inputCmd = program2.command("input").description("Manage input devices");
5775
5823
  inputCmd.command("list").description("List all input devices with their IDs").action(() => withClient(listInputs));
5776
5824
  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) => {
@@ -5779,4 +5827,8 @@ inputCmd.command("set-gain").description("Set input device gain").addArgument(ne
5779
5827
  });
5780
5828
  inputCmd.command("mute").description("Mute an input device").addArgument(new Argument("<input-id>", "ID of the input device")).action((inputId) => withClient((client) => setInputMute(client, inputId, true)));
5781
5829
  inputCmd.command("unmute").description("Unmute an input device").addArgument(new Argument("<input-id>", "ID of the input device")).action((inputId) => withClient((client) => setInputMute(client, inputId, false)));
5830
+ inputCmd.command("toggle-mute").description("Toggle input device mute state").addArgument(new Argument("<input-id>", "ID of the input device")).action((inputId) => withClient(async (client) => {
5831
+ const input = await requireInput(client, inputId);
5832
+ await setInputMute(client, inputId, !input.isMuted);
5833
+ }));
5782
5834
  await program2.parseAsync();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raphiiko/wavelink-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Command line interface for Elgato Wave Link 3.0",
5
5
  "author": "Raphiiko",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -457,6 +457,17 @@ outputCmd
457
457
  .addArgument(new Argument("<output-id>", "ID of the output device"))
458
458
  .action((outputId: string) => withClient((client) => setOutputMute(client, outputId, false)));
459
459
 
460
+ outputCmd
461
+ .command("toggle-mute")
462
+ .description("Toggle output device mute state")
463
+ .addArgument(new Argument("<output-id>", "ID of the output device"))
464
+ .action((outputId: string) =>
465
+ withClient(async (client) => {
466
+ const output = await requireOutput(client, outputId);
467
+ await setOutputMute(client, outputId, !output.isMuted);
468
+ })
469
+ );
470
+
460
471
  // Mix commands
461
472
  const mixCmd = program.command("mix").description("Manage mixes");
462
473
 
@@ -630,6 +641,83 @@ channelCmd
630
641
  })
631
642
  );
632
643
 
644
+ channelCmd
645
+ .command("toggle-mute-in-mix")
646
+ .description("Toggle channel mute state in a specific mix")
647
+ .addArgument(new Argument("<channel-id>", "ID of the channel"))
648
+ .addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)"))
649
+ .action((channelId: string, mixId: string) =>
650
+ withClient(async (client) => {
651
+ const mix = await requireMix(client, mixId);
652
+ const { channels } = await client.getChannels();
653
+ const channel = channels.find((c) => c.id === channelId);
654
+
655
+ if (!channel) exitWithError(`Channel '${channelId}' not found`);
656
+
657
+ const mixAssignment = channel.mixes?.find((m) => m.id === mix.id);
658
+
659
+ if (!mixAssignment) {
660
+ exitWithError(`Channel '${channelId}' is not available in mix '${mix.name}'`);
661
+ }
662
+
663
+ const newMuted = !mixAssignment.isMuted;
664
+ await client.setChannelMixMute(channel.id, mix.id, newMuted);
665
+ console.log(
666
+ `Successfully toggled mute for channel '${channel.image?.name ?? channel.id}' in mix '${
667
+ mix.name
668
+ }'`
669
+ );
670
+ })
671
+ );
672
+
673
+ channelCmd
674
+ .command("isolate")
675
+ .description("Mute all channels in a mix except for the specified one")
676
+ .addArgument(new Argument("<channel-id>", "ID of the channel to isolate"))
677
+ .addArgument(new Argument("<mix-id-or-name>", "ID or name of the mix (case-insensitive)"))
678
+ .action((channelId: string, mixId: string) =>
679
+ withClient(async (client) => {
680
+ const mix = await requireMix(client, mixId);
681
+ const targetChannel = await requireChannel(client, channelId);
682
+ const { channels } = await client.getChannels();
683
+
684
+ let mutedCount = 0;
685
+ let alreadyMutedCount = 0;
686
+
687
+ for (const channel of channels) {
688
+ // Find the channel's assignment for this mix
689
+ const assignment = channel.mixes?.find((m) => m.id === mix.id);
690
+
691
+ // If the channel isn't in this mix (unexpected for Wave Link, but possible in API types), skip
692
+ if (!assignment) continue;
693
+
694
+ if (channel.id === targetChannel.id) {
695
+ // This is the chosen channel: Unmute it
696
+ if (assignment.isMuted) {
697
+ await client.setChannelMixMute(channel.id, mix.id, false);
698
+ console.log(`Unmuted target channel '${channel.image?.name ?? channel.id}'`);
699
+ } else {
700
+ console.log(`Target channel '${channel.image?.name ?? channel.id}' is already unmuted`);
701
+ }
702
+ } else {
703
+ // This is NOT the chosen channel: Mute it
704
+ if (!assignment.isMuted) {
705
+ await client.setChannelMixMute(channel.id, mix.id, true);
706
+ mutedCount++;
707
+ } else {
708
+ alreadyMutedCount++;
709
+ }
710
+ }
711
+ }
712
+
713
+ console.log(
714
+ `SUCCESS: Isolated '${targetChannel.id}' in mix '${mix.name}'.\n` +
715
+ ` - Muted ${mutedCount} other channels.\n` +
716
+ ` - ${alreadyMutedCount} channels were already muted.`
717
+ );
718
+ })
719
+ );
720
+
633
721
  // Input commands
634
722
  const inputCmd = program.command("input").description("Manage input devices");
635
723
 
@@ -660,4 +748,15 @@ inputCmd
660
748
  .addArgument(new Argument("<input-id>", "ID of the input device"))
661
749
  .action((inputId: string) => withClient((client) => setInputMute(client, inputId, false)));
662
750
 
751
+ inputCmd
752
+ .command("toggle-mute")
753
+ .description("Toggle input device mute state")
754
+ .addArgument(new Argument("<input-id>", "ID of the input device"))
755
+ .action((inputId: string) =>
756
+ withClient(async (client) => {
757
+ const input = await requireInput(client, inputId);
758
+ await setInputMute(client, inputId, !input.isMuted);
759
+ })
760
+ );
761
+
663
762
  await program.parseAsync();