Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor

### Behind the scenes
- Publishing a stable release now also opens the update PR on winget (`winget install lippdev.ConsoleMode`). Test versions are skipped. (#106)
- The code no longer mentions MultiMonitorTool or SoundVolumeView, and the cleanup of their old files in the `tools` folder is gone: anyone updating straight from 1.5 keeps those two files until they delete them by hand. (#119)
- The package embeds only rtss-cli; leftover MultiMonitorTool/SoundVolumeView files no longer end up in the executable. (#110)

## [1.6.0-alpha.2]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH

### Por trás dos panos
- Publicar uma versão estável agora também abre o PR de atualização no winget (`winget install lippdev.ConsoleMode`). Versões de teste ficam de fora. (#106)
- O código não cita mais o MultiMonitorTool nem o SoundVolumeView, e a limpeza dos arquivos antigos deles na pasta `tools` saiu: quem atualiza direto da 1.5 mantém esses dois arquivos até apagá-los à mão. (#119)
- O pacote embute só o rtss-cli; sobras de MultiMonitorTool/SoundVolumeView não entram mais no executável. (#110)

## [1.6.0-alpha.2]
Expand Down
7 changes: 3 additions & 4 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,20 @@ Pré-condições: Ajustes → Interface = **Automático** (padrão).

## Áudio com código próprio (issue #91)

Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (saída de áudio escolhida). A 1.6 não usa mais o SoundVolumeView; o arquivo antigo em `tools` é apagado ao abrir o app.
Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (saída de áudio escolhida).

- [ ] Ajustes → Saída de áudio lista as mesmas saídas que na 1.5, com os mesmos nomes, e as desativadas aparecem com o sufixo "[Desabilitado]". Resultado: ______
- [ ] A saída que já estava escolhida com o SoundVolumeView continua selecionada depois de atualizar da 1.5 (o ID salvo é o mesmo). Resultado: ______
- [ ] A saída que já estava escolhida na 1.5 continua selecionada depois de atualizar (o ID salvo é o mesmo). Resultado: ______
- [ ] Entrar no modo console com uma saída fixa (ex.: HDMI da TV): o som passa para ela, inclusive em apps de chamada (papel "comunicações"). O log mostra `Áudio: saída padrão = …`. Resultado: ______
- [ ] Se a troca de saída falhar (ex.: o dispositivo some no meio), a sessão continua e o log mostra `Áudio: não foi possível trocar para …`; a mesa não é desfeita. Resultado: ______
- [ ] "A que aparecer ao conectar (TV)" com a TV começando **desligada**: quando a TV liga, o som vai para o HDMI dela. Resultado: ______
- [ ] Uma saída **desabilitada** em Configurações → Som: escolhê-la liga a saída e o som vai para ela. Resultado: ______
- [ ] Menu da sessão (Select + Y): o volume inicial é o do Windows; ◀/▶ muda de 5 em 5 e tira o mudo; A alterna o mudo. Resultado: ______
- [ ] Ao restaurar a mesa, o som volta para a saída de antes do modo console. Resultado: ______
- [ ] A pasta `tools` não tem mais `SoundVolumeView.exe` nem `MultiMonitorTool.exe` depois de abrir o app. Resultado: ______

## Telas com código próprio (issue #91)

Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (tela de jogo e telas a esconder escolhidas). Anote antes, na 1.5, como o mapa de telas aparece, para comparar. A 1.6 não usa mais o MultiMonitorTool; o arquivo antigo em `tools` é apagado ao abrir o app.
Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (tela de jogo e telas a esconder escolhidas). Anote antes, na 1.5, como o mapa de telas aparece, para comparar.

### Lista e identidade

Expand Down
6 changes: 3 additions & 3 deletions src/ConsoleMode/Native/CoreAudio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace ConsoleMode.Native;

/// <summary>
/// Windows Core Audio (MMDevice API) for the output devices: list, switch the default, enable a
/// disabled one, volume and mute. Replaces SoundVolumeView (issue #91).
/// disabled one, volume and mute (issue #91).
/// Switching the default output uses IPolicyConfig, which Windows doesn't document but has kept
/// stable since Windows 7; the Control Panel, SoundVolumeView, EarTrumpet and AudioSwitcher use it.
/// stable since Windows 7; the Control Panel, EarTrumpet and AudioSwitcher use it.
/// </summary>
internal static class CoreAudio
{
Expand All @@ -24,7 +24,7 @@ public sealed record Endpoint(string Id, string Name, string AdapterName, bool I
// PKEY_DeviceInterface_FriendlyName: the adapter ("Realtek(R) Audio", "NVIDIA High Definition Audio").
private static readonly PropertyKey InterfaceFriendlyNameKey = new(new Guid("026e516e-b814-414b-83cd-856d6fef4822"), 2);

/// <summary>Active, disabled and unplugged outputs (the same set SoundVolumeView listed).</summary>
/// <summary>Active, disabled and unplugged outputs.</summary>
public static List<Endpoint> ListRenderEndpoints()
{
var result = new List<Endpoint>();
Expand Down
4 changes: 2 additions & 2 deletions src/ConsoleMode/Native/NativeDisplays.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
namespace ConsoleMode.Native;

/// <summary>
/// Displays through Windows' own APIs (CCD, ChangeDisplaySettingsEx, DDC/CI via dxva2), replacing
/// MultiMonitorTool (issue #91). Monitors are named by their GDI source (\\.\DISPLAYn) like before.
/// Displays through Windows' own APIs (CCD, ChangeDisplaySettingsEx, DDC/CI via dxva2) (issue #91).
/// Monitors are named by their GDI source (\\.\DISPLAYn), the same names 1.5 saved.
/// </summary>
internal static class NativeDisplays
{
Expand Down
6 changes: 0 additions & 6 deletions src/ConsoleMode/Services/AppPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ public static void Initialize()
try { File.Copy(rtssBeside, rtssDest, true); } catch { /* ignore */ }
}

// Up to 1.5 the NirSoft tools were extracted here; 1.6 is all our own code (issue #91).
foreach (var name in new[] { "MultiMonitorTool.exe", "SoundVolumeView.exe" })
{
try { File.Delete(Path.Combine(ToolsDir, name)); } catch { /* in use or read-only: harmless */ }
}

RtssCliPath = FirstExisting(Path.Combine(ToolsDir, "rtss-cli.exe"), Path.Combine(ExeDir, "rtss-cli.exe"));

ConfigPath = Path.Combine(DataDir, "config.json");
Expand Down
6 changes: 3 additions & 3 deletions src/ConsoleMode/Services/AudioNaming.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace ConsoleMode.Services;

/// <summary>
/// Names and IDs of audio outputs, shared by the SoundVolumeView and the native (Core Audio)
/// backends so the saved setting (<c>AudioDeviceId</c>) and the restore backup work with either.
/// Names and IDs of audio outputs. The format is the one 1.5 saved (<c>AudioDeviceId</c> in
/// config.json and the restore backup), so both keep working after an update.
/// Pure, so it's tested.
/// </summary>
public static class AudioNaming
{
/// <summary>
/// SoundVolumeView's "Command-Line Friendly ID" for an output:
/// The "friendly ID" of an output, as saved since 1.5:
/// <c>{adapter}\Device\{endpoint}\Render</c>, e.g. <c>Realtek(R) Audio\Device\Speakers\Render</c>.
/// </summary>
public static string FriendlyId(string adapterName, string endpointName) =>
Expand Down
5 changes: 2 additions & 3 deletions src/ConsoleMode/Services/ConsoleEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,8 @@ private void UpdatePendingTarget()
}

/// <summary>
/// Switching the output is best effort, as it was with SoundVolumeView (its failures were ignored):
/// a Core Audio error is logged and the session goes on, instead of rolling back the whole start
/// after the screens were already switched.
/// Switching the output is best effort: a Core Audio error is logged and the session goes on,
/// instead of rolling back the whole start after the screens were already switched.
/// </summary>
private bool TrySetOutput(string friendlyId)
{
Expand Down
6 changes: 3 additions & 3 deletions src/ConsoleMode/Services/DisplayIdentity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ConsoleMode.Services;

/// <summary>
/// One monitor in the layout backup (MultiMonitorTool's .cfg format, kept for compatibility).
/// One monitor in the layout backup (the .cfg format 1.5 wrote, kept so its backups can be restored).
/// <c>Orientation</c> is DEVMODE.dmDisplayOrientation: 0 landscape, 1 = 90°, 2 = 180°, 3 = 270°.
/// </summary>
public sealed record LayoutEntry(string Name, string MonitorId, string Serial, int BitsPerPixel,
Expand All @@ -15,7 +15,7 @@ public sealed record EdidInfo(string Name, string Serial, int PreferredWidth, in

/// <summary>
/// Monitor identity and layout-file helpers for the native display backend (issue #91). They
/// produce the same values MultiMonitorTool did, so saved settings and backups keep working.
/// produce the same values 1.5 saved, so saved settings and backups keep working.
/// Pure, so it's tested.
/// </summary>
public static class DisplayIdentity
Expand All @@ -37,7 +37,7 @@ public static bool TryParseDevicePath(string? devicePath, out string hardwareId,
}

/// <summary>
/// MultiMonitorTool's "Monitor ID" (the device ID Windows gives the monitor), e.g.
/// The monitor ID saved since 1.5 (the device ID Windows gives the monitor), e.g.
/// <c>MONITOR\GSM5B7F\{4d36e96e-e325-11ce-bfc1-08002be10318}\0004</c>; the last part is the
/// monitor's driver key. It's what <c>MonitorInfo.StableId</c> saves in config.json.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion tests/ConsoleMode.Tests/AudioNamingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public sealed class AudioNamingTests
[Theory]
[InlineData("Realtek(R) Audio", "Speakers", @"Realtek(R) Audio\Device\Speakers\Render")]
[InlineData("NVIDIA High Definition Audio", "LG TV SSCR2", @"NVIDIA High Definition Audio\Device\LG TV SSCR2\Render")]
public void Friendly_id_matches_the_one_saved_by_SoundVolumeView(string adapter, string endpoint, string expected) =>
public void Friendly_id_matches_the_one_saved_by_1_5(string adapter, string endpoint, string expected) =>
Assert.Equal(expected, AudioNaming.FriendlyId(adapter, endpoint));

[Theory]
Expand Down
4 changes: 2 additions & 2 deletions tests/ConsoleMode.Tests/DisplayIdentityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Device_path_gives_the_hardware_id_and_the_device_instance()
}

[Fact]
public void Monitor_id_has_MultiMonitorTools_format()
public void Monitor_id_has_the_format_saved_by_1_5()
{
Assert.Equal(@"MONITOR\GSM5B7F\{4d36e96e-e325-11ce-bfc1-08002be10318}\0004",
DisplayIdentity.MonitorId("GSM5B7F", @"{4d36e96e-e325-11ce-bfc1-08002be10318}\0004"));
Expand Down Expand Up @@ -115,7 +115,7 @@ public void Layout_file_writes_landscape_when_no_orientation_is_given()
[Fact]
public void A_backup_made_by_1_5_is_written_back_unchanged()
{
// The shape of a real 1.5 backup (MultiMonitorTool): a portrait side monitor and a TV that was off.
// The shape of a real 1.5 backup: a portrait side monitor and a TV that was off.
string[] original =
[
"[Monitor0]", @"Name=\\.\DISPLAY1", @"MonitorID=MONITOR\TCL1003\{4d36e96e-e325-11ce-bfc1-08002be10318}\0003",
Expand Down
Loading