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
11 changes: 2 additions & 9 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@

O **Console Mode** usa as ferramentas abaixo. Algumas são baixadas automaticamente no build; outras devem ser instaladas pelo usuário.

## NirSoft
## NirSoft (até a 1.5)

| Ferramenta | Site | Uso no projeto |
|------------|------|----------------|
| [MultiMonitorTool](https://www.nirsoft.net/utils/multi_monitor_tool.html) | nirsoft.net | Monitores: ativar/desativar, primário, layout, mover janelas |
| [SoundVolumeView](https://www.nirsoft.net/utils/sound_volume_view.html) | nirsoft.net | Listar e trocar saída de áudio padrão |

O script `build/Get-NirSoftTools.ps1` baixa as ferramentas na hora do build e o `Publish-ConsoleMode.ps1` embute os `.exe` no `ConsoleMode.exe` portátil. Na primeira execução elas são extraídas para `ConsoleMode_Data/tools/`.

Consulte os termos de uso e a licença de cada ferramenta no site do autor (Nir Sofer / NirSoft).
Até a versão 1.5, o Console Mode embutia o [MultiMonitorTool](https://www.nirsoft.net/utils/multi_monitor_tool.html) e o [SoundVolumeView](https://www.nirsoft.net/utils/sound_volume_view.html), da NirSoft, para controlar monitores e áudio. A partir da 1.6 isso é feito com as APIs do próprio Windows e nenhuma ferramenta da NirSoft é distribuída (issue #91).

## Limite de FPS (opcional)

Expand Down
68 changes: 0 additions & 68 deletions build/Get-NirSoftTools.ps1

This file was deleted.

1 change: 0 additions & 1 deletion build/Publish-ConsoleMode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Write-Host "Versao: $Version"
New-Item -ItemType Directory -Path $embedDir, $distDir -Force | Out-Null

if (-not $SkipTools) {
& (Join-Path $PSScriptRoot "Get-NirSoftTools.ps1") -TargetDir $embedDir
& (Join-Path $PSScriptRoot "Get-RtssCli.ps1") -TargetDir $embedDir
}

Expand Down
3 changes: 1 addition & 2 deletions docs/GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Cap the global frame rate while console mode runs (helpful on a 60 Hz TV). Requi

- Multi-monitor layouts vary; on some setups restore may need a second try from the tray
- Xbox mode does not detect when fullscreen ends — restore manually
- Monitor and audio switching rely on bundled [NirSoft](https://www.nirsoft.net/) tools
- The FPS limit is global (RTSS limitation), not per display
- The WinUI 3 build currently requires Windows to compile (`net8.0-windows`)

Expand All @@ -68,7 +67,7 @@ Confirm that the focus monitor supports the feature and that HDR is enabled in W
Requires [Visual Studio 2022](https://visualstudio.microsoft.com/) with the **Windows application development** workload, or the .NET 8 SDK plus the Windows App SDK.

```powershell
# Downloads MultiMonitorTool / SoundVolumeView / rtss-cli, then builds both packages
# Downloads rtss-cli, then builds both packages
.\build\Publish-ConsoleMode.ps1 -Version 1.4.0
```

Expand Down
3 changes: 1 addition & 2 deletions docs/GUIDE.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Limita a taxa de quadros global durante o modo console (útil em TV 60 Hz). Exig

- Layouts multi-monitor variam; em alguns setups a restauração pode precisar de uma nova tentativa pela bandeja
- O Modo Xbox não detecta o fim do fullscreen — restaure manualmente
- Monitores e áudio dependem das ferramentas [NirSoft](https://www.nirsoft.net/) incluídas no pacote
- O limite de FPS é global (limitação do RTSS), não por tela
- O build WinUI 3 precisa ser compilado no Windows (`net8.0-windows`)

Expand All @@ -68,7 +67,7 @@ Confirme se o monitor de foco é compatível com o recurso e se o HDR está ativ
Precisa do [Visual Studio 2022](https://visualstudio.microsoft.com/) com a workload **Desenvolvimento de aplicativos da Windows**, ou do SDK do .NET 8 + Windows App SDK.

```powershell
# Baixa MultiMonitorTool / SoundVolumeView / rtss-cli e compila os dois pacotes
# Baixa o rtss-cli e compila os dois pacotes
.\build\Publish-ConsoleMode.ps1 -Version 1.4.0
```

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

## Áudio nativo, sem SoundVolumeView (issue #91)

Pré-condições: app **fechado**; em `config.json` (na pasta de dados) acrescente `"NativeAudio": true` e abra o app. O log (`consolemode.log`) deve mostrar `audio=native` na linha `Startup:`. Para voltar ao SoundVolumeView, troque para `false`.
Pré-condições: a partir da 1.6 o áudio nativo já vem ligado (`"NativeAudio": true` em `config.json`) e o SoundVolumeView não é mais embutido. O log (`consolemode.log`) deve mostrar `audio=native` na linha `Startup:`. Para comparar com o SoundVolumeView, coloque o `SoundVolumeView.exe` na pasta `tools` e troque para `false`.

- [ ] Ajustes → Saída de áudio lista as mesmas saídas que com o SoundVolumeView, 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 (o ID salvo é o mesmo). Resultado: ______
Expand All @@ -129,7 +129,7 @@ Pré-condições: app **fechado**; em `config.json` (na pasta de dados) acrescen

## Telas nativas, sem MultiMonitorTool (issue #91)

Pré-condições: app **fechado**; em `config.json` acrescente `"NativeDisplays": true` e abra o app. A linha `Startup:` do log deve mostrar `displays=native`. Para voltar ao MultiMonitorTool, troque para `false`. Faça primeiro uma rodada com `false` e anote o que aparece, para comparar.
Pré-condições: a partir da 1.6 as telas nativas já vêm ligadas (`"NativeDisplays": true` em `config.json`) e o MultiMonitorTool não é mais embutido. A linha `Startup:` do log deve mostrar `displays=native`. Para comparar com o MultiMonitorTool, coloque o `MultiMonitorTool.exe` na pasta `tools` e troque para `false` (ou use a 1.5.0).

### Lista e identidade

Expand Down
8 changes: 4 additions & 4 deletions src/ConsoleMode/Models/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public sealed class AppConfig
public string AudioDeviceId { get; set; } = "";
public string AudioDeviceName { get; set; } = "";
public bool AudioAutoSwitch { get; set; }
/// <summary>Use Core Audio instead of SoundVolumeView (issue #91); off until verified on hardware.</summary>
public bool NativeAudio { get; set; }
/// <summary>Use Windows' display APIs instead of MultiMonitorTool (issue #91); off until verified on hardware.</summary>
public bool NativeDisplays { get; set; }
/// <summary>Core Audio instead of SoundVolumeView (issue #91). On since 1.6; false needs SoundVolumeView.exe in tools.</summary>
public bool NativeAudio { get; set; } = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing users keep nativeAudio: false after upgrading because their saved config.json already contains the old serialized false value; the initializer is only used when the property is absent. The same applies to nativeDisplays, so these users continue selecting the NirSoft fallback rather than receiving the advertised native defaults.

Technical details
# Migrate persisted backend defaults

## Affected sites
- `src/ConsoleMode/Models/Models.cs:23` — the initializer does not override values explicitly loaded from existing config files.
- `src/ConsoleMode/Models/Models.cs:25` — the same persisted-false behavior applies to native display selection.
- `src/ConsoleMode/Services/ConfigService.cs:14` — deserialization preserves the existing false values.

## Required outcome
- Existing configs from releases where both flags defaulted to false should use the new native backends after upgrade, while retaining a supported way for users to opt into the NirSoft fallback.

## Suggested approach
- Add a config-version migration that can distinguish pre-native-default configs and update the backend flags when loading them.

/// <summary>Windows' display APIs instead of MultiMonitorTool (issue #91). On since 1.6; false needs MultiMonitorTool.exe in tools.</summary>
public bool NativeDisplays { get; set; } = true;
public int FpsLimit { get; set; }
public Dictionary<string, SavedDisplayMode> MonitorModes { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public bool HdrEnable { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/ConsoleMode/Services/AudioService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public sealed class AudioService
private Dictionary<string, string> _endpointIds = new(StringComparer.OrdinalIgnoreCase);

/// <summary>
/// Core Audio instead of SoundVolumeView (issue #91). Off by default while it's verified on real
/// hardware: set <c>"NativeAudio": true</c> in config.json and restart the app.
/// Core Audio instead of SoundVolumeView (issue #91). On by default since 1.6; <c>"NativeAudio": false</c>
/// in config.json goes back to SoundVolumeView, which is no longer bundled (put it in the tools folder).
/// </summary>
public static bool UseNative => _useNative ??= LoadNativeFlag();

Expand Down
2 changes: 1 addition & 1 deletion src/ConsoleMode/Services/EmbeddedFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public static class EmbeddedFiles
public static void ExtractTools(string toolsDir)
{
Directory.CreateDirectory(toolsDir);
foreach (var name in new[] { "MultiMonitorTool.exe", "SoundVolumeView.exe", "rtss-cli.exe" })
foreach (var name in new[] { "rtss-cli.exe" })
{
Extract($"ConsoleMode.Tools.{name}", Path.Combine(toolsDir, name));
}
Expand Down
4 changes: 2 additions & 2 deletions src/ConsoleMode/Services/MonitorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public void ClearCache()
}

/// <summary>
/// Windows' own display APIs instead of MultiMonitorTool (issue #91). Off by default while it's
/// verified on real hardware: set <c>"NativeDisplays": true</c> in config.json and restart the app.
/// Windows' own display APIs instead of MultiMonitorTool (issue #91). On by default since 1.6;
/// <c>"NativeDisplays": false</c> goes back to MultiMonitorTool, which is no longer bundled.
/// </summary>
public static bool UseNative => _useNative ??= LoadNativeFlag();

Expand Down
Loading