From fa3033312dafdc579105f49947a7f09cc06ab880 Mon Sep 17 00:00:00 2001 From: Severino Ammirati Date: Wed, 25 Nov 2026 14:58:23 +0100 Subject: [PATCH 1/7] Add Italian language and point the fork at its own releases (#1) Italian catalog, installer language, tests and docs; version 1.7.2. Update checks and release notes now use 1r0n51uv/consolemode. Co-authored-by: Claude Sonnet 5.5 --- .github/workflows/release.yml | 2 +- AGENTS.md | 2 +- CHANGELOG.en-US.md | 4 + CHANGELOG.md | 4 + README.md | 2 +- README.pt-BR.md | 2 +- build/ConsoleMode.iss | 11 +- docs/TESTING.md | 1 + docs/TRANSLATING.md | 2 +- src/ConsoleMode/ConsoleMode.csproj | 9 +- src/ConsoleMode/Resources/Strings.it-IT.json | 451 ++++++++++++++++++ .../Services/LocalizationService.cs | 2 + src/ConsoleMode/Services/UpdateService.cs | 2 +- .../ConsoleMode.Tests.csproj | 1 + tests/ConsoleMode.Tests/LocalizationTests.cs | 1 + 15 files changed, 483 insertions(+), 13 deletions(-) create mode 100644 src/ConsoleMode/Resources/Strings.it-IT.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 55d834a0..b6095659 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -241,7 +241,7 @@ jobs: "" "---" "" - "🇧🇷 Notas em português: [CHANGELOG.md](https://github.com/lippdev/consolemode/blob/$tag/CHANGELOG.md)" + "🇧🇷 Notas em português: [CHANGELOG.md](https://github.com/1r0n51uv/consolemode/blob/$tag/CHANGELOG.md)" ) if ($summaries.Count -gt 0) { $releaseNotes += @("") + $summaries } $releaseNotes = $releaseNotes -join "`n" diff --git a/AGENTS.md b/AGENTS.md index b7bad2e9..1c69b155 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,7 @@ Xbox mode, and restores the desk setup afterwards. ## Conventions - **Every user-facing string** goes in every catalog in `src/ConsoleMode/Resources/` - (`Strings.pt-BR.json`, `en-US`, `es-ES`, `de-DE`, `fr-FR`, `ru-RU`), translated. + (`Strings.pt-BR.json`, `en-US`, `es-ES`, `de-DE`, `fr-FR`, `it-IT`, `ru-RU`), translated. The localization tests fail when keys or `{0}` placeholders don't match, or when a sentence is left in English. - **Changelog**: add user-visible changes under `## [Unreleased]` in both diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index c67e9bbe..3bcc58c2 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -4,6 +4,10 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Befor ## [Unreleased] +## [1.7.2] +### What's new +- Italian language: the app and the installer are now available in Italian. + ## [1.7.1] ### What's new - Network control for Google TV and Android TV is back. A session can turn the TV on and switch to the PC input. On return, it can run a command to open the Home screen or switch inputs before putting the TV in standby. (#208, #213) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5350b9..9ff1ffeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CH ## [Unreleased] +## [1.7.2] +### Novidades +- Idioma italiano: o app e o instalador agora estão disponíveis em italiano. + ## [1.7.1] ### Novidades - O controle de TVs Google TV e Android TV pela rede voltou. A sessão pode ligar a TV e trocar para a entrada do PC. Na volta, ela pode executar um comando para abrir a tela inicial ou outra entrada antes de entrar em espera. (#208, #213) diff --git a/README.md b/README.md index 984f8581..a8ac55c8 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ You pick the controller shortcuts yourself: none is on at first, the tour the ap - **Per-game profiles** for Steam games (resolution, HDR, FPS limit and audio) and the controller's battery on screen - Puts the **desktop icons** and the **mouse pointer** back where they were, can let the controller **wake the PC**, and restores the desk on the next start if a session was cut short - Automation with `consolemode://start` / `stop` / `menu` links (Stream Deck, scripts) and a [local control API](docs/GUIDE.md#local-control-api) -- English, Portuguese, Spanish, German, French and Russian +- English, Portuguese, Spanish, German, French, Italian and Russian ## What's new in 1.7.1 diff --git a/README.pt-BR.md b/README.pt-BR.md index 7efce2f6..c4798b65 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -55,7 +55,7 @@ Os atalhos do controle são você quem escolhe: nenhum vem ligado, o tour da pri - **Perfis por jogo** para os jogos da Steam (resolução, HDR, limite de FPS e áudio) e a bateria do controle na tela - Devolve os **ícones da área de trabalho** e o **ponteiro do mouse** ao lugar, pode deixar o controle **acordar o PC** e restaura a mesa na próxima abertura se uma sessão for interrompida - Automação com os links `consolemode://start` / `stop` / `menu` (Stream Deck, scripts) e uma [API de controle local](docs/GUIDE.pt-BR.md#api-de-controle-local) -- Português, inglês, espanhol, alemão, francês e russo +- Português, inglês, espanhol, alemão, francês, italiano e russo ## Novidades da 1.7.1 diff --git a/build/ConsoleMode.iss b/build/ConsoleMode.iss index 96e37a57..a18fbaf6 100644 --- a/build/ConsoleMode.iss +++ b/build/ConsoleMode.iss @@ -24,9 +24,9 @@ AppName={#AppName} AppVersion={#AppVersion} AppVerName={#AppName} {#AppVersion} AppPublisher=lippdev -AppPublisherURL=https://github.com/lippdev/consolemode -AppSupportURL=https://github.com/lippdev/consolemode/issues -AppUpdatesURL=https://github.com/lippdev/consolemode/releases +AppPublisherURL=https://github.com/1r0n51uv/consolemode +AppSupportURL=https://github.com/1r0n51uv/consolemode/issues +AppUpdatesURL=https://github.com/1r0n51uv/consolemode/releases DefaultDirName={localappdata}\Programs\{#AppName} DefaultGroupName={#AppName} DisableProgramGroupPage=yes @@ -57,6 +57,7 @@ Name: "en"; MessagesFile: "compiler:Default.isl" Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl" Name: "de"; MessagesFile: "compiler:Languages\German.isl" Name: "fr"; MessagesFile: "compiler:Languages\French.isl" +Name: "it"; MessagesFile: "compiler:Languages\Italian.isl" Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] @@ -75,6 +76,9 @@ de.LaunchApp=Console Mode öffnen fr.OneClickShortcut=Raccourci « Console Mode 1 Click » sur le Bureau (passe en mode console en un clic) fr.StartWithWindows=Démarrer avec Windows (reste dans la zone de notification) fr.LaunchApp=Ouvrir Console Mode +it.OneClickShortcut=Collegamento "Console Mode 1 Click" sul desktop (entra in modalità console con un clic) +it.StartWithWindows=Avvia con Windows (resta nell'area di notifica) +it.LaunchApp=Apri Console Mode ru.OneClickShortcut=Ярлык «Console Mode 1 Click» на рабочем столе (режим консоли в один клик) ru.StartWithWindows=Запускать вместе с Windows (в области уведомлений) ru.LaunchApp=Открыть Console Mode @@ -103,6 +107,7 @@ Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Langu Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Language"; ValueData: "es-ES"; Languages: es; Flags: uninsdeletekeyifempty uninsdeletevalue Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Language"; ValueData: "de-DE"; Languages: de; Flags: uninsdeletekeyifempty uninsdeletevalue Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Language"; ValueData: "fr-FR"; Languages: fr; Flags: uninsdeletekeyifempty uninsdeletevalue +Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Language"; ValueData: "it-IT"; Languages: it; Flags: uninsdeletekeyifempty uninsdeletevalue Root: HKCU; Subkey: "Software\ConsoleMode"; ValueType: string; ValueName: "Language"; ValueData: "ru-RU"; Languages: ru; Flags: uninsdeletekeyifempty uninsdeletevalue ; consolemode://start|stop|show links (ProtocolService registers the same keys at startup). Root: HKCU; Subkey: "Software\Classes\consolemode"; ValueType: string; ValueData: "URL:Console Mode"; Flags: uninsdeletekey diff --git a/docs/TESTING.md b/docs/TESTING.md index 88b896c9..f6f772f8 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -294,6 +294,7 @@ Pré-condições: Ajustes → Interface = **Automático** (padrão). - [ ] Trocar o idioma em Ajustes e voltar para Console: todos os textos, incluindo os cartões, trocam. Resultado: ______ - [ ] Em alemão, francês e russo (textos mais longos), percorrer Home, Ajustes, menu da sessão e tutorial nas duas interfaces: nenhum botão, cartão ou linha do menu corta o texto ou sobrepõe outro elemento. Resultado: ______ - [ ] Instalador em alemão, francês e russo: o diálogo de idioma lista os três, as opções de atalho e de iniciar com o Windows aparecem sem caracteres quebrados, e o app abre no idioma escolhido. Resultado: ______ +- [ ] Instalador e app em italiano: o diálogo de idioma lista Italiano, as opções de atalho e de iniciar com o Windows aparecem sem caracteres quebrados, e o app abre em italiano. Percorrer Início, Sessão, Sistema, o menu da sessão e o tutorial, nas interfaces Desktop e Console, procurando textos cortados ou sobrepostos. Resultado: ______ ### Navegação por controle (Xbox **e** PlayStation; a janela precisa estar em primeiro plano) - [ ] **Interface Desktop:** D-pad move o foco entre tiles, o seletor de papel, os cards de Ajustes e os ComboBoxes; A abre um ComboBox, D-pad percorre, A escolhe, B fecha; Start abre e fecha Ajustes; Y vai para a interface Console; no tutorial, A avança e B pula. Resultado: ______ diff --git a/docs/TRANSLATING.md b/docs/TRANSLATING.md index c918709b..4cfa4443 100644 --- a/docs/TRANSLATING.md +++ b/docs/TRANSLATING.md @@ -1,6 +1,6 @@ # Translating Console Mode -Console Mode speaks English, Português (Brasil), Español, Deutsch, Français and Русский. Thanks for helping it speak yours, or for fixing a line that reads wrong in your language. +Console Mode speaks English, Português (Brasil), Español, Deutsch, Français, Italiano and Русский. Thanks for helping it speak yours, or for fixing a line that reads wrong in your language. You don't need Windows or a build environment: every text the app shows lives in one JSON file per language, and the tests that check it run on any OS. diff --git a/src/ConsoleMode/ConsoleMode.csproj b/src/ConsoleMode/ConsoleMode.csproj index fb61c564..95631c35 100644 --- a/src/ConsoleMode/ConsoleMode.csproj +++ b/src/ConsoleMode/ConsoleMode.csproj @@ -17,10 +17,10 @@ true latest x64 - 1.7.1 - 1.7.1.0 - 1.7.1.0 - 1.7.1 + 1.7.2 + 1.7.2.0 + 1.7.2.0 + 1.7.2 Console Mode Console Mode lippdev @@ -46,6 +46,7 @@ + diff --git a/src/ConsoleMode/Resources/Strings.it-IT.json b/src/ConsoleMode/Resources/Strings.it-IT.json new file mode 100644 index 00000000..6c46748c --- /dev/null +++ b/src/ConsoleMode/Resources/Strings.it-IT.json @@ -0,0 +1,451 @@ +{ + "Brand": "Console Mode", + "Back": "Indietro", + "IgnoreUpdate": "Salta questa versione", + "RolePlayHere": "Gioca qui", + "RoleTurnOff": "Spegni", + "RoleKeepOn": "Lascia acceso", + "Settings": "Impostazioni", + "SendFeedback": "Invia un feedback", + "Next": "Avanti", + "SkipTour": "Salta il tutorial", + "CreateDesktopShortcut": "Crea un collegamento sul desktop", + "ActiveTitle": "La modalità console è attiva", + "GameScreenSection": "Schermo da gioco", + "ResolutionRefreshCard": "Risoluzione e frequenza di aggiornamento", + "HideOtherScreensCard": "Come spegnere gli altri schermi", + "HideOtherScreensDescription": "Scollegare è il metodo più rapido. Lo schermo nero mantiene la disposizione invariata; DDC/CI spegne il pannello tramite il suo hardware.", + "EnteringConsoleSection": "All'ingresso in modalità console", + "LaunchCard": "Apri", + "AudioOutputCard": "Uscita audio", + "OptionalExtrasSection": "Extra opzionali", + "HdrCard": "HDR sullo schermo da gioco", + "HdrDescription": "Attivato all'ingresso e ripristinato allo stato precedente all'uscita.", + "VrrCard": "Frequenza di aggiornamento variabile (VRR)", + "VrrDescription": "Attiva l'impostazione di Windows. Attivala anche nel pannello di controllo NVIDIA/AMD.", + "FpsCard": "Limite di FPS", + "FpsPlaceholder": "FPS", + "AppSection": "App", + "BackgroundCard": "Sfondo", + "BackgroundDescription": "Lo sfondo di Console Mode, le copertine dei tuoi giochi Steam installati sotto una sfumatura, solo la sfumatura o un'immagine a tua scelta.", + "BackgroundAuto": "Aurora", + "BackgroundCovers": "Copertine di Steam", + "BackgroundGradient": "Solo sfumatura", + "BackgroundImage": "La mia immagine", + "BackgroundImageCard": "Scegli un'immagine…", + "HomeSetupHeading": "Configurazione attuale", + "TabHome": "Home", + "TabSession": "Sessione", + "TabSystem": "Sistema", + "HintTabs": "Schede", + "SoundsCard": "Suoni dell'interfaccia", + "SoundsDescription": "Suoni delicati quando ti muovi, scegli e torni indietro nell'interfaccia console.", + "SessionMenuTitle": "Menu della sessione", + "BackToGame": "Torna al gioco", + "VolumeRow": "Volume", + "Muted": "Muto", + "SessionMenuHint": "La scorciatoia del menu della sessione apre questo menu in qualsiasi momento.", + "SessionHintTitle": "Menu di Console Mode", + "SessionHintBody": "Tieni premuto {0} per aprire il pannello sopra il gioco.", + "ExitConsoleMode": "Esci da Console Mode", + "HintVolume": "Volume", + "SessionElapsed": "In gioco da {0}", + "SessionMenuCard": "Scorciatoia del menu della sessione", + "SessionMenuDescription": "Durante una sessione, tieni premuta questa scorciatoia per aprire un menu sopra il gioco: volume, risoluzione, audio, FPS, HDR, ritorno al PC o uscita. Non funziona sui giochi a schermo intero esclusivo.", + "ConsoleScreensHeading": "Schermi", + "ConsoleQuickHeading": "Impostazioni rapide", + "FullSettings": "Tutte le impostazioni", + "HintSelect": "Seleziona", + "HintChange": "Cambia", + "ConsoleSettingsHint": "Premi A su una riga per cambiarne il valore. Tutto viene salvato subito.", + "BackToPc": "Torna al PC", + "CloseMenu": "Chiudi il menu", + "ControlFsCard": "Gestione file (ControlFS)", + "ControlFsOpen": "Sfoglia i tuoi file con il controller", + "ControlFsMissing": "Non installato · premi per scaricare e installare", + "ControlFsDownloading": "Download in corso… {0}%", + "ControlFsInstalling": "Installazione in corso…", + "ControlFsInstallFailed": "Installazione non riuscita · premi per aprire la pagina di download", + "ControlFsInstalled": "Installato · premi per aprire", + "JoyChromiumCard": "Browser (JoyChromium)", + "JoyChromiumOpen": "Naviga sul web con il controller", + "ControlFsMissingNote": "ControlFS non è installato. Apro la pagina di download nel browser.", + "SessionWindowsCard": "Finestre", + "SessionWindowsCount": "{0} aperte", + "SwitcherEmpty": "Nessuna finestra aperta", + "SwitcherOpen": "Apri", + "SwitcherCloseWindow": "Chiudi la finestra", + "SwitcherCloseConfirmTitle": "Chiudere questa finestra?", + "SwitcherCloseConfirmBody": "Se ci sono modifiche non salvate, l'app potrebbe comunque chiederti di salvarle.", + "SwitcherCloseConfirmAction": "Chiudi la finestra", + "SessionPreviewBadge": "Fuori da una sessione", + "ConsoleActiveHint": "Oppure tieni premuto {0} sul controller per 1 secondo.", + "ChooseRoleFor": "Che cosa fa lo schermo {0}?", + "HomeButtonCard": "Scorciatoia del controller per aprire Console Mode", + "HomeButtonDescription": "Con l'app nell'area di notifica, tieni premuta questa scorciatoia per 1 secondo per entrare in modalità console (basta una pressione se attivi la pressione breve qui sotto). Funziona con i controller Xbox e PlayStation.", + "ExitShortcutCard": "Scorciatoia del controller per tornare al PC", + "TaskViewShortcutCard": "Scorciatoia del controller per la Visualizzazione attività", + "TaskViewShortcutDescription": "Apre la Visualizzazione attività di Windows (Win + Tab) con tutte le finestre aperte, in sessione o no. Finché è aperta, la croce direzionale o lo stick scelgono una finestra, A la apre e B chiude la visualizzazione; anche la scorciatoia premuta di nuovo la chiude.", + "TaskViewHint": "Croce direzionale o stick scelgono una finestra · {0} la apre · {1} chiude", + "TaskViewPlayStationCard": "Muoviti nella Visualizzazione attività con un controller PlayStation", + "TaskViewPlayStationDescription": "Windows si muove già nella Visualizzazione attività con un controller Xbox. Se attivo, Console Mode fa lo stesso con un controller PlayStation, che Windows non riconosce in quel contesto. Disattivalo se uno strumento fa passare il tuo controller per uno Xbox (DS4Windows, Steam) e i movimenti si ripetono.", + "ExitShortcutDescription": "Durante una sessione, tieni premuta questa scorciatoia per 1 secondo per ripristinare la tua postazione e tornare al PC.", + "ShortcutHome": "Apri Console Mode", + "ControllerSection": "Controller", + "ControllerLayoutCard": "Disposizione dei pulsanti", + "ControllerLayoutDescription": "Automatica segue il controller collegato. Puoi anche fissare i simboli Xbox o PlayStation.", + "ControllerLayoutAuto": "Automatica", + "ControllerLayoutXbox": "Xbox (A, B, X, Y)", + "ControllerLayoutPlaystation": "PlayStation (✕, ○, □, △)", + "ShortcutMenu": "Menu della sessione", + "ShortcutExit": "Torna al PC", + "ShortcutTaskView": "Visualizzazione attività", + "ShortcutNotSet": "Non impostata", + "ShortcutSet": "Impostata", + "ShortcutChange": "Cambia", + "ShortcutClear": "Rimuovi", + "ShortcutCancel": "Annulla", + "ShortcutPressButtons": "Tieni premuti i pulsanti, poi rilasciali…", + "ShortcutCaptureHint": "Rilascia per salvare. Premi {0} da solo per annullare.", + "ShortcutNotAllowed": "Usa due o più pulsanti insieme (come Select + Y) oppure il pulsante Home da solo. Un singolo pulsante scatterebbe nel mezzo di una partita.", + "ShortcutInUse": "{0} è già la scorciatoia per \"{1}\". Scegli un'altra combinazione.", + "CloseSteamCard": "Manda Steam nell'area di notifica quando torni al PC", + "CloseSteamDescription": "Quando esci da Big Picture, Steam riceve una normale richiesta di chiusura della finestra, così può passare nell'area di notifica senza terminare il processo. Se un gioco è in esecuzione o non è possibile verificarne lo stato, la finestra resta com'è.", + "RestoreIconsCard": "Rimetti le icone del desktop al loro posto", + "RestoreIconsDescription": "Salva la posizione delle icone del desktop prima della sessione e le rimette a posto quando torni al PC, nel caso Windows le riordini mentre cambia lo schermo principale. Non fa nulla se la disposizione automatica è attiva.", + "HideIconsCard": "Nascondi le icone del desktop durante la sessione", + "HideIconsDescription": "Nasconde le icone del desktop mentre la sessione è attiva, così la TV appare pulita come una console, e le mostra di nuovo quando torni al PC. Se erano già nascoste, restano tali.", + "ParkPointerCard": "Sposta il puntatore del mouse fuori dalla vista", + "ParkPointerDescription": "Quando il launcher compare sulla TV, sposta il puntatore nell'angolo in basso a destra dello schermo da gioco così non resta in mezzo all'immagine. Tornando al PC, il puntatore torna dov'era.", + "GameProfilesCard": "Profili per gioco", + "GameProfilesDescription": "Risoluzione, HDR, limite di FPS e uscita audio specifici di ogni gioco Steam. Per crearne uno, apri il menu della sessione mentre il gioco è in esecuzione e scegli Profilo del gioco → Salva le impostazioni attuali. Il profilo si applica all'avvio del gioco e viene annullato alla chiusura.", + "GameProfilesEmpty": "Nessun profilo salvato", + "GameProfilesCount": "{0} salvati", + "GameProfilesPickerTitle": "Scegli il profilo da eliminare", + "GameProfileRow": "Profilo del gioco", + "GameProfileNoGame": "Nessun gioco Steam in esecuzione", + "GameProfileNone": "{0}: nessun profilo", + "GameProfileActive": "{0}: profilo salvato", + "GameProfileSave": "Salva le impostazioni attuali per {0}", + "GameProfileRemove": "Elimina il profilo di {0}", + "GameProfileDelete": "Elimina", + "GameProfileHdrOn": "HDR attivo", + "GameProfileHdrOff": "HDR disattivo", + "GameProfileNothing": "Non cambia nulla", + "HideCursorCard": "Nascondi il puntatore del mouse", + "HideCursorDescription": "Resta nascosto finché non disattivi questa opzione; riappare da solo all'inizio o alla fine di una sessione e quando Console Mode si chiude. Comodo per gli emulatori e i giochi che lo lasciano in mezzo allo schermo.", + "ControllerMouseRow": "Controlla il mouse con il controller", + "ControllerMouseHint": "Lo stick sinistro muove · {0} clicca · {0} due volte: clic destro · lo stick destro scorre", + "AutoStartControllerCard": "Entra quando si collega un controller", + "AutoStartControllerDescription": "Con l'app nell'area di notifica, accendere o collegare un controller attiva la modalità console. Ignora i primi 15 s dopo l'apertura e i 30 s dopo il ripristino.", + "ControllerWakeCard": "Riattiva il PC con il controller", + "ControllerWakeDescription": "Permette all'adattatore wireless Xbox, al Bluetooth o a un controller cablato di riattivare il PC dalla sospensione quando premi il pulsante centrale del controller. Windows chiede l'autorizzazione di amministratore. Non può riattivare un PC spento o in ibernazione, e alcuni PC tolgono l'alimentazione al Bluetooth durante la sospensione. Con Entra quando si collega un controller attivo, il PC si riattiva direttamente in modalità console.", + "ControllerWakeButton": "Attiva", + "ControllerWakeChecking": "Controllo dei dispositivi…", + "ControllerWakeReady": "Pronto: {0} può riattivare il PC.", + "ControllerWakeOff": "Non può ancora riattivare il PC: {0}.", + "ControllerWakeNone": "Nessun adattatore per controller né Bluetooth di questo PC può riattivarlo. Collega l'adattatore o il controller e riprova.", + "ControllerWakeUnknown": "Impossibile controllare i dispositivi.", + "ControllerWakeEnabled": "Fatto. Metti il PC in sospensione e premi il pulsante centrale del controller per provare.", + "ControllerWakeCanceled": "Windows non ha ottenuto l'autorizzazione; non è cambiato nulla.", + "ControllerWakeFailed": "Impossibile attivarlo. I dettagli sono nel log.", + "ControllerWakeGone": "Il dispositivo non era presente durante l'attivazione (è stato scollegato?). Ricollegalo e riprova.", + "ControllerWakeUnavailable": "Non disponibile", + "HomeButtonShortPressCard": "Pressione breve del pulsante Xbox", + "HomeButtonShortPressDescription": "Basta premerlo, senza tenerlo premuto. Disattiva la scorciatoia del controller per la Xbox Game Bar in Windows (Win+G continua a funzionare).", + "HomeButtonSteamHint": "Steam è aperto e usa anch'esso il pulsante Xbox. In Steam, disattiva \"Il pulsante Guida porta Steam in primo piano\" perché la pressione breve funzioni.", + "GameBarSettingError": "Impossibile cambiare l'impostazione della Game Bar: {0}", + "StartupCard": "Avvia con Windows", + "StartupDescription": "Si apre nell'area di notifica all'avvio del PC, pronto per il collegamento con un clic.", + "MinimizeToTrayCard": "Riduci nell'area di notifica", + "MinimizeToTrayDescription": "Riducendo a icona, la finestra scompare dalla barra delle applicazioni e Console Mode resta tra le icone nascoste. Clicca l'icona per riaprirlo.", + "MenuOutsideSessionCard": "Menu della sessione fuori dalla modalità console", + "MenuOutsideSessionDescription": "La scorciatoia del menu apre il menu della sessione anche quando non sei in modalità console, con le finestre aperte, il volume, lo schermo e il controller come mouse, purché Console Mode sia aperto (anche solo nell'area di notifica). Disattivala se la scorciatoia dà fastidio in un gioco.", + "CheckNow": "Controlla ora", + "NotifyUpdatesCard": "Avvisami quando c'è una nuova versione", + "NotifyUpdatesDescription": "Controlla le release di GitHub all'avvio dell'app.", + "BetaUpdatesCard": "Ricevi le versioni di prova (beta)", + "BetaUpdatesDescription": "Ricevi le versioni in anteprima prima di tutti per aiutare a provarle. Possono contenere bug. Disattivando questa opzione non si torna alla versione stabile: riceverai la prossima stabile quando uscirà.", + "BetaUpdatesWarning": "Le versioni di prova possono dare problemi su alcune configurazioni. Se qualcosa non va, scarica la versione stabile dalla pagina delle release e segnalacelo con il pulsante del feedback.", + "HelpDataSection": "Scorciatoia, aiuto e dati", + "OtherAppsSection": "Altre app dello sviluppatore", + "TvConfirmationCard": "Conferma sulla TV", + "TvConfirmationDescription": "La prima volta che usi un nuovo schermo da gioco, la TV ti chiede di confermare che vedi l'immagine. Rispondi con mouse, tastiera o controller (Xbox: A/B · PlayStation: ✕/○). Provalo qui senza modificare i tuoi schermi.", + "TvSection": "TV", + "TvControlCard": "Accendi la TV e cambia ingresso", + "TvProviderNone": "Non controllarla", + "TvProviderAndroid": "Google TV / Android TV (rete)", + "TvNoneDescription": "Quando parte la modalità console, l'app accende la TV e la porta sull'ingresso del PC; al ripristino può metterla in standby.", + "TvAndroidDescription": "Tramite la rete, senza installare nulla. Sulla TV: Impostazioni → Sistema → Opzioni sviluppatore → attiva \"Debug USB\" (o \"Debug di rete\"). La prima volta, accetta \"Consenti debug\" sulla TV.", + "TvHostCard": "Indirizzo della TV", + "TvHostDescription": "L'IP della TV nella tua rete (Impostazioni → Rete). Suggerimento: riservalo nel router così non cambia.", + "TvMacCard": "Indirizzo MAC (facoltativo)", + "TvMacDescription": "Per riattivare la TV dallo standby profondo (Wake-on-LAN). Lascialo vuoto se la TV risponde da spenta.", + "TvHdmiCard": "Ingresso del PC", + "TvHdmiDescription": "La porta HDMI della TV a cui è collegato il PC.", + "TvInputCommandCard": "Comando per l'ingresso (avanzato)", + "TvInputCommandDescription": "Solo se la TV ignora il tasto HDMI: un comando shell Android che passa all'ingresso del PC. Vuoto = il tasto HDMI scelto sopra.", + "TvRestoreCommandCard": "Comando al ritorno al PC (avanzato)", + "TvTurnOffCard": "Metti la TV in standby al ripristino", + "TvTurnOffDescription": "Dopo che gli schermi della postazione sono tornati.", + "TvTestCard": "Prova la TV", + "TvTestDescription": "Accende la TV e passa subito all'ingresso del PC, senza toccare gli schermi. La prima volta si associa alla TV.", + "TvTesting": "Comunico con la TV… Se te lo chiede, accetta sullo schermo della TV.", + "TvTestSuccess": "La TV ha risposto: ora dovrebbe essere accesa, sull'ingresso del PC.", + "TvTestFailure": "Impossibile comunicare con la TV: {0}", + "TvTestTimedOut": "La TV non ha finito di rispondere entro 90 secondi. Riprova.", + "TvNotConfigured": "Scegli come controllare la TV.", + "TvHostMissing": "Inserisci l'indirizzo IP della TV.", + "TvUnreachable": "La TV all'indirizzo {0} non ha risposto. Controlla l'IP, che la TV sia sulla stessa rete e che il debug sia attivo.", + "TvAdbNotAllowed": "La TV non ha autorizzato questo PC. Premi di nuovo Prova e scegli \"Consenti sempre\" + \"Consenti\" sulla TV.", + "TvAdbTlsUnsupported": "La TV accetta solo il \"Debug wireless\" (associazione con un codice). Attiva \"Debug USB\" / \"Debug di rete\" nelle Opzioni sviluppatore.", + "ControllerTestCard": "Prova il controller", + "ControllerTestDescription": "Mostra in tempo reale ciò che Windows riceve da ogni controller: origine, pulsanti per indice, croce direzionale e stick. Usalo quando un controller compare ma non fa nulla.", + "ControllerTestSteamHint": "Se Steam è in esecuzione con il supporto PlayStation, cattura il controller e l'app non riceve nulla. Chiudi Steam (o disattiva il supporto PlayStation in Steam Input) e riprova.", + "CopyDiagnostics": "Copia la diagnostica", + "ControllerDevicesHeading": "Dispositivi", + "ControllerSampleHeading": "Lettura in tempo reale (premi i pulsanti)", + "DiagnosticsCopied": "Diagnostica copiata. Incollala nella segnalazione o nel modulo di feedback.", + "DiagnosticsCard": "Diagnostica", + "DiagnosticsDescription": "Versioni, schermi, audio, controller, programmi trovati e la fine del log, da allegare a una segnalazione di bug. I percorsi con il tuo nome utente e le chiavi vengono nascosti.", + "CopyReport": "Copia il rapporto", + "TutorialCard": "Tutorial", + "TutorialDescription": "Mostra di nuovo il giro guidato dell'interfaccia.", + "OneClickCard": "Collegamento con un clic", + "OneClickDescription": "Crea \"Console Mode 1 Click\" sul desktop, accanto al normale collegamento dell'app. Entra direttamente in modalità console senza aprire questa finestra.", + "CreateShortcut": "Crea il collegamento", + "DataFolderCard": "Cartella dei dati", + "DataFolderDescription": "Impostazioni, backup degli schermi e il file di log (consolemode.log).", + "LanguageCard": "Lingua", + "LanguageDescription": "Scegli la lingua usata in Console Mode.", + "ConfirmTitle": "Riesci a vedere questa schermata?", + "ConfirmDescription": "Questo è lo schermo da gioco. Conferma con mouse, tastiera o controller. Se nessuno risponde, i tuoi schermi verranno ripristinati automaticamente.", + "Revert": "Ripristina", + "Continue": "Sì, continua", + "Countdown": "Ritorno alla normalità tra {0} s", + "AudioHint": "Applicato all'ingresso e ripristinato all'uscita. \"Quando è collegato\" cambia automaticamente quando compare la TV.", + "StartEntering": "Avvio in corso…", + "StartNow": "Gioca ora", + "LaunchPlayniteDescription": "Apre Playnite a schermo intero. I tuoi schermi vengono ripristinati automaticamente quando lo chiudi.", + "LaunchXboxDescription": "Sperimentale: invia Win+F11. Per ripristinare i tuoi schermi, usa l'app o il menu dell'area di notifica.", + "LaunchSteamDescription": "Apre Steam Big Picture. I tuoi schermi vengono ripristinati automaticamente quando lo chiudi.", + "FocusChoose": "Scegli uno schermo da gioco nella schermata iniziale.", + "FocusApplied": "Applicato a {0} all'ingresso e annullato all'uscita.", + "StrategyDisconnect": "Scollega in Windows", + "StrategyBlack": "Copri con una schermata nera", + "StrategyTurnOff": "Spegni il pannello (DDC/CI)", + "LaunchSteam": "Steam Big Picture", + "LaunchPlaynite": "Playnite (a schermo intero)", + "PlaynitePathCard": "Cartella di Playnite", + "PlaynitePathClear": "Cancella", + "PlaynitePathDetected": "Trovato automaticamente in {0}. Scegli Playnite.FullscreenApp.exe se usi la versione portatile.", + "PlaynitePathMissing": "Playnite non trovato. Scegli Playnite.FullscreenApp.exe (per esempio la versione portatile).", + "PlaynitePathInvalid": "Impossibile trovare Playnite.FullscreenApp.exe in {0}.", + "PlaynitePathPickError": "Impossibile aprire la selezione dei file: {0}", + "LaunchXbox": "Modalità Xbox (sperimentale)", + "LaunchCustomApp": "App personalizzata", + "LaunchCustomAppDescription": "Apre il programma che scegli (un emulatore, un altro launcher…). I tuoi schermi vengono ripristinati automaticamente quando lo chiudi.", + "CustomAppPathCard": "App da aprire", + "CustomAppArgumentsCard": "Argomenti", + "CustomAppArgumentsDescription": "Facoltativo. Passati all'app all'avvio, per esempio per aprirla a schermo intero.", + "CustomAppWatchCard": "Processo da monitorare", + "CustomAppWatchDescription": "Facoltativo. Quando l'app si limita ad avviare un altro programma e poi si chiude, scrivi il nome del processo di quel programma. I tuoi schermi vengono ripristinati quando si chiude.", + "CustomAppMissing": "Scegli l'app da aprire (un file .exe).", + "CustomAppNotExe": "{0} non è un file .exe. Scegli l'app da aprire.", + "CustomAppNotFound": "Impossibile trovare {0}. Scegli di nuovo l'app.", + "FpsOverlayCard": "Contatore FPS", + "FpsOverlayExternal": "Afterburner (lascia così)", + "FpsOverlayOff": "Disattivato (nascondi tutto)", + "FpsOverlayCustom": "Personalizzato", + "FpsOverlayDescription": "Mostra gli FPS sopra il gioco durante una sessione, tramite RTSS. Tranne su \"Afterburner\", l'OSD di MSI Afterburner viene nascosto mentre la modalità console è attiva.", + "FpsOverlayItems": "Elementi del gioco", + "FpsOverlayShowApi": "API (D3D/Vulkan)", + "FpsOverlayShowFps": "FPS", + "FpsOverlayShowFrameTime": "Tempo di frame (ms)", + "FpsOverlaySingleLine": "Tutto su una riga", + "FpsOverlayColor": "Colore dei numeri", + "FpsOverlayColorWhite": "Bianco", + "FpsOverlayColorBlue": "Blu", + "FpsOverlayColorGreen": "Verde", + "FpsOverlayColorYellow": "Giallo", + "FpsOverlayColorOrange": "Arancione", + "FpsOverlayCompact": "Compatto", + "FpsOverlayCompactHint": "FPS, CPU, GPU e RAM", + "FpsOverlayDetailed": "Dettagliato", + "FpsOverlayDetailedHint": "frequenze, temperatura e memoria", + "FpsOverlayFpsOnly": "Solo FPS", + "FpsOverlayPcItems": "Elementi del PC", + "FpsOverlayPcItemsDescription": "Letti da Windows e dal driver grafico, senza installare nulla. La temperatura e la frequenza della GPU compaiono solo se il driver le riporta.", + "FpsOverlayShowCpu": "Utilizzo della CPU", + "FpsOverlayShowCpuClock": "Frequenza della CPU", + "FpsOverlayShowGpu": "Utilizzo della GPU", + "FpsOverlayShowGpuClock": "Frequenza della GPU", + "FpsOverlayShowGpuTemp": "Temperatura della GPU", + "FpsOverlayShowVram": "VRAM", + "FpsOverlayShowRam": "RAM", + "FpsOverlaySize": "Dimensione", + "FpsOverlaySizeSmall": "Piccola", + "FpsOverlaySizeMedium": "Media", + "FpsOverlaySizeLarge": "Grande", + "FpsOverlayStyle": "Stile", + "FpsOverlayPosition": "Posizione", + "FpsOverlayPositionRtss": "Quella di RTSS", + "FpsOverlayPositionTopLeft": "Angolo in alto a sinistra", + "FpsOverlayPositionTopRight": "Angolo in alto a destra", + "FpsOverlayPositionBottomLeft": "Angolo in basso a sinistra", + "FpsOverlayPositionBottomRight": "Angolo in basso a destra", + "FpsOverlayCardBackground": "Sfondo della scheda", + "FpsOverlayCardBackgroundDescription": "Una scheda scura con gli angoli arrotondati dietro i numeri, così si leggono bene su qualsiasi scena.", + "FpsNoLimit": "Nessun limite", + "FpsCustom": "Personalizzato", + "FpsAvailable": "Si applica a tutti i giochi mentre la modalità console è attiva. Usa RTSS.", + "FpsUnavailable": "Facoltativo. Installa RivaTuner Statistics Server (RTSS) per usare questa funzione.", + "NoGameDisplayConfigured": "Nessuno schermo da gioco configurato; impossibile entrare in modalità console.", + "NoDisplayTryRefresh": "Nessuno schermo trovato. Prova ad aggiornare.", + "ListDisplaysError": "Impossibile elencare gli schermi: {0}", + "DisplayNoChange": "Non cambiare", + "AudioNoChange": "Non cambiare", + "AudioOnConnect": "Quello che compare al collegamento (TV)", + "ShortcutCreated": "Creato il collegamento \"Console Mode 1 Click\" sul desktop.", + "ShortcutCreateError": "Impossibile creare il collegamento: {0}", + "OpenFolderError": "Impossibile aprire la cartella: {0}", + "ChooseGameScreen": "Scegli lo schermo su cui vuoi giocare.", + "UnconfirmedSetup": "I tuoi schermi sono stati ripristinati perché lo schermo da gioco non è stato confermato. Controlla la tua scelta e riprova.", + "StartFailure": "Impossibile entrare in modalità console: {0}", + "ControllerXbox": "Controller Xbox rilevato", + "ControllerPlaystation": "Controller PlayStation rilevato", + "ControllerOther": "Controller rilevato", + "ControllerNone": "Nessun controller rilevato", + "ConfirmationResult": "Prova: {0} da {1} ({2}).", + "ConfirmationAccepted": "confermato", + "ConfirmationWillRevert": "sarebbe stato ripristinato", + "SourceController": "controller", + "SourceKeyboard": "tastiera", + "SourceMouseKeyboard": "mouse/tastiera", + "SourceTimeout": "tempo scaduto", + "ListConjunction": " e ", + "ListSeparator": ", ", + "ShortcutName": "Console Mode 1 Click", + "ShortcutDescription": "Entra in modalità console con un clic", + "ShortcutUnavailable": "WScript.Shell non è disponibile in questa versione di Windows.", + "UnknownExecutablePath": "Il percorso dell'eseguibile è sconosciuto.", + "ProcessTimeout": "{0}: tempo scaduto: {1}", + "ProcessFailure": "{0}: operazione non riuscita ({1}): {2}", + "CachedModeSuffix": " (in cache)", + "EstimatedModeSuffix": " (stimato)", + "UpdateAssetMissing": "Questa release non ha un file verificabile per questo tipo di installazione.", + "UpdateHashMismatch": "Lo SHA-256 del file scaricato non corrisponde all'impronta pubblicata da GitHub.", + "RestoreSuccess": "I tuoi schermi sono tornati alla normalità.", + "SessionRecovered": "L'ultima sessione non si è conclusa correttamente (l'app si è chiusa o il PC si è spento a metà). I tuoi schermi, l'audio, le icone e il puntatore sono stati ripristinati.", + "SessionJournalFailed": "Impossibile scrivere il registro della sessione nella cartella dei dati ({0}). Senza di esso non ci sarebbe modo di tornare indietro dopo un arresto anomalo, quindi non è stato cambiato nulla.", + "RestoreFailure": "Impossibile ripristinare gli schermi: {0}", + "ConfigSaveFailure": "Impossibile salvare le impostazioni: {0}", + "SummaryChooseScreen": "Scegli lo schermo su cui vuoi giocare", + "SummaryFocusOnly": "Gioca su {0}", + "SummaryFocusAndHide": "Gioca su {0} e spegni {1}", + "SummaryAudio": "Audio: {0}", + "SummaryAudioOnConnect": "Audio al collegamento", + "SummaryFps": "{0} FPS", + "MonitorOff": "spento", + "DisplayOffNow": "attualmente spento", + "CurrentModeSuffix": " (attuale)", + "AudioDisabledSuffix": " [Disattivato]", + "AlreadyConsoleActive": "La modalità console è già attiva.", + "GameScreenNotConfirmed": "Lo schermo da gioco non è stato confermato.", + "GameScreenDidNotTurnOn": "Lo schermo da gioco non si è acceso. Controlla che la TV sia accesa e sull'ingresso HDMI giusto, poi riprova.", + "ActivePlaynite": "Chiudi Playnite per ripristinare automaticamente i tuoi schermi.", + "ActiveXbox": "Nella modalità Xbox il ripristino è manuale: usa Ripristina ora o il menu dell'area di notifica.", + "ActiveSteam": "Chiudi Big Picture per ripristinare automaticamente i tuoi schermi.", + "ActiveCustomApp": "Chiudi {0} per ripristinare automaticamente i tuoi schermi.", + "InstallKindInstalled": "Versione {0} · installata", + "InstallKindPortable": "Versione {0} · portatile", + "Download": "Scarica", + "UpdateNow": "Aggiorna ora", + "StartupSettingError": "Impossibile cambiare l'impostazione di avvio di Windows: {0}", + "SearchingUpdates": "Ricerca di aggiornamenti…", + "LatestVersionStatus": "{0} · sei aggiornato", + "AppUpToDate": "Console Mode è aggiornato.", + "UpdateAvailableStatus": "{0} · {1} disponibile", + "UpdateAvailableTitle": "Console Mode {0} è disponibile{1}", + "BetaSuffix": " (beta)", + "NewVersionOnGithub": "Una nuova versione è disponibile su GitHub.", + "UpdateCheckFailedStatus": "{0} · impossibile cercare aggiornamenti", + "UpdateSearchFailure": "Impossibile cercare aggiornamenti: {0}", + "ExitConsoleBeforeUpdate": "Esci dalla modalità console prima di aggiornare.", + "UpdateFailure": "Impossibile aggiornare: {0}", + "BrowserOpenFailure": "Impossibile aprire il browser: {0}", + "ShowWindow": "Mostra la finestra", + "TrayEnterConsole": "Entra in modalità console", + "RestoreSetup": "Ripristina la configurazione", + "Exit": "Esci", + "ToggleOn": "Sì", + "ToggleOff": "No", + "SessionTourInviteTitle": "Prima volta in questo menu?", + "SessionTourInviteBody": "Un breve giro mostra cosa fa ogni opzione, compresa la differenza tra Torna al PC ed Esci da Console Mode. Per rivederlo più tardi, premi {0} qui nel menu.", + "SessionTourStart": "Fai il giro", + "SessionTourNotNow": "Non ora", + "SessionTourProgress": "{0} di {1}", + "SessionTourHint": "Giro", + "SessionTourBackToGameBody": "Chiude questo menu e restituisce il controller al gioco, esattamente com'era. {0} fa lo stesso da qualsiasi punto del menu.", + "SessionTourControlFsBody": "Apre ControlFS, un gestore di file pensato per il controller, a schermo intero. Se non è ancora installato, la prima pressione lo scarica e lo installa. Subito sotto, JoyChromium fa lo stesso con un browser per la TV: si apre sopra il gioco e, quando torni al PC, resta aperto come finestra.", + "SessionTourVolumeBody": "Premi {0} per regolare il volume dell'uscita audio: ◀ ▶ lo cambiano a passi di 5, {1} lo silenzia e {0} o {2} terminano.", + "SessionTourDisplayTitle": "Schermo e audio", + "SessionTourDisplayBody": "Risoluzione, frequenza di aggiornamento, uscita audio e HDR dello schermo da gioco. Ciò che cambi qui dura solo per questa sessione: tornato al PC, tutto torna com'era.", + "SessionTourDisplayPreviewBody": "Risoluzione, frequenza di aggiornamento, uscita audio e HDR dello schermo da gioco. Fuori da una sessione, come adesso, ciò che cambi qui resta finché non lo cambi di nuovo.", + "SessionTourFpsTitle": "FPS", + "SessionTourFpsBody": "Il limite di FPS blocca la frequenza dei fotogrammi dei tuoi giochi e il contatore mostra gli FPS in un angolo dello schermo, entrambi tramite RivaTuner. Tornato al PC, entrambi vengono annullati.", + "SessionTourWindowsBody": "I programmi aperti, come un Alt + Tab sempre visibile sullo schermo. {0} porta una finestra in primo piano; {1} le chiede di chiudersi, dopo la tua conferma.", + "SessionTourBackToPcBody": "Termina la sessione: schermi, risoluzione, HDR, audio e limite di FPS tornano com'erano, Big Picture si chiude e la TV si spegne se l'hai impostato. Console Mode resta aperto nell'area di notifica, pronto per la prossima volta.", + "SessionTourCloseMenuBody": "Fuori da una sessione non c'è nulla da ripristinare, quindi questo pulsante chiude solo il menu. Durante una sessione diventa Torna al PC e rimette schermi, audio e risoluzione com'erano.", + "SessionTourExitBody": "Fa tutto ciò che fa Torna al PC e chiude anche Console Mode: esce dall'area di notifica e le scorciatoie del controller smettono di funzionare finché non lo riapri.", + "SessionTourExitPreviewBody": "Chiude completamente Console Mode: esce dall'area di notifica e le scorciatoie del controller smettono di funzionare finché non lo riapri.", + "SessionTourCard": "Giro del menu della sessione", + "SessionTourDescription": "Spiega ogni opzione del menu sopra il gioco. Apre il menu in anteprima, senza avviare una sessione.", + "ShowTour": "Mostra il giro", + "ControllerBattery": "Batteria del controller: {0}", + "ControllerBatteryCharging": "Batteria del controller: {0}, in carica", + "LowBatteryTitle": "Batteria del controller scarica", + "LowBatteryBody": "Resta il {0}. Collega il cavo o ricarica il controller.", + "ConsoleTourWelcomeTitle": "Benvenuto in Console Mode", + "ConsoleTourWelcomeBody": "Trasforma il tuo PC in una console: porta il gioco sulla TV (o sullo schermo che scegli), spegne gli altri schermi e apre Steam Big Picture, Playnite o la modalità Xbox. Quando torni, la tua postazione è esattamente com'era. Questo giro mostra dove si trova ogni cosa; usa il controller, il mouse o la tastiera.", + "ConsoleTourTabsTitle": "Tre schede", + "ConsoleTourTabsBody": "Home, Sessione e Sistema. Cambia scheda con {0} e {1} sul controller, Pag↑ e Pag↓ sulla tastiera, oppure cliccando sul nome di una scheda.", + "ConsoleTourLaunchersTitle": "Cosa si apre", + "ConsoleTourLaunchersBody": "Ogni riquadro è un launcher: Steam Big Picture, Playnite, la modalità Xbox o un'app tua. {0} su quello che vuoi (o un clic) lo seleziona: è quello che si apre quando giochi. Passarci sopra lo indica soltanto. Su un'app tua, {1} o un clic destro la toglie dalla Home.", + "ConsoleTourPlayTitle": "Gioca", + "ConsoleTourPlayBody": "{0} qui, oppure {1} da qualsiasi punto della Home, entra in modalità console: lo schermo da gioco diventa quello principale, gli altri si spengono e il launcher si apre su di esso. Il nome e la riga sotto mostrano cosa si apre, dove giocherai e cosa cambia.", + "ConsoleTourScreensTitle": "I tuoi schermi", + "ConsoleTourScreensBody": "La scheda Sessione elenca gli schermi di questo PC. {0} su uno schermo ne sceglie il ruolo durante la sessione: giocare su di esso, spegnerlo o lasciarlo acceso.", + "ConsoleTourQuickSettingsTitle": "Impostazioni rapide", + "ConsoleTourQuickSettingsBody": "Uscita audio, risoluzione, HDR e limite di FPS per la prossima sessione, a una pressione di distanza. Quando torni al PC, tutto torna com'era.", + "ConsoleTourSystemTitle": "Tutte le impostazioni", + "ConsoleTourSystemBody": "La scheda Sistema contiene tutte le impostazioni, per categoria: schermo da gioco, cosa succede all'ingresso, controller, TV, extra e app. {0} apre e chiude questa scheda da qualsiasi punto.", + "ConsoleTourShortcutsTitle": "Scorciatoie del controller", + "ConsoleTourShortcutsBody": "Scegli qui le scorciatoie che funzionano anche a finestra chiusa: una per entrare in modalità console, una per aprire il menu della sessione sopra il gioco e una per tornare al PC. Una scorciatoia senza combinazione non fa nulla.", + "ConsoleTourDoneTitle": "Tutto pronto", + "ConsoleTourDoneBody": "Controlla lo schermo da gioco nella scheda Sessione e premi Gioca ora. Per rivedere questo giro: Sistema → {0} → {1}.", + "ConsoleTourFinish": "Iniziamo", + "IntroSoundCard": "Suono di apertura", + "IntroSoundDescription": "Riproduce un suono d'ingresso con l'apertura.", + "IntroStyleCard": "Stile di apertura", + "IntroStyleDescription": "Quello di Console Mode è l'ufficiale e, di tanto in tanto, l'app si apre con uno ispirato a Xbox 360 o PS4 come sorpresa. Scegliere uno stile qui mantiene quello stile e pone fine alle sorprese.", + "IntroStyleConsole": "Console Mode", + "IntroStyleX360": "Ispirato a Xbox 360", + "IntroStylePs4": "Ispirato a PS4", + "IntroStyleNone": "Nessuno (si apre subito)", + "IntroPreviewCard": "Guarda l'apertura", + "IntroPreviewDescription": "Mostra subito l'apertura scelta, con il suo suono.", + "AddCustomAppTile": "Aggiungi app", + "AddCustomAppCard": "Aggiungi un'app personalizzata", + "AddCustomAppDescription": "Scegli un .exe: diventa un riquadro nella Home, con l'icona e il nome del programma.", + "RemoveCustomAppCard": "Rimuovi questa app", + "RemoveCustomAppDescription": "Toglie il riquadro di questa app dalla Home; si apre invece Steam Big Picture.", + "RemoveFromHome": "Rimuovi dalla Home", + "Cancel": "Annulla", + "OtherAppsControlFsDescription": "Un gestore di file pensato prima di tutto per il controller, con un estrattore ZIP sicuro.", + "OtherAppsTakoDescription": "La tua libreria di giochi in un launcher fatto per la TV e il controller.", + "OtherAppsJoyChromiumDescription": "Un browser web per la TV, da usare con il controller dal divano.", + "OtherAppsStageAlpha": "Alpha", + "OtherAppsStageClosedAlpha": "Alpha chiusa", + "OtherAppsStageBeta": "Beta" +} diff --git a/src/ConsoleMode/Services/LocalizationService.cs b/src/ConsoleMode/Services/LocalizationService.cs index 65fc5ac6..f7df11e2 100644 --- a/src/ConsoleMode/Services/LocalizationService.cs +++ b/src/ConsoleMode/Services/LocalizationService.cs @@ -13,6 +13,7 @@ public static class LocalizationService public const string SpanishSpain = "es-ES"; public const string GermanGermany = "de-DE"; public const string FrenchFrance = "fr-FR"; + public const string ItalianItaly = "it-IT"; public const string RussianRussia = "ru-RU"; /// A UI language: its culture code and how it names itself in the language picker. @@ -30,6 +31,7 @@ public sealed record LanguageInfo(string Code, string NativeName); new(SpanishSpain, "Español"), new(GermanGermany, "Deutsch"), new(FrenchFrance, "Français"), + new(ItalianItaly, "Italiano"), new(RussianRussia, "Русский") ]; diff --git a/src/ConsoleMode/Services/UpdateService.cs b/src/ConsoleMode/Services/UpdateService.cs index 50b9a13d..10d2c3c0 100644 --- a/src/ConsoleMode/Services/UpdateService.cs +++ b/src/ConsoleMode/Services/UpdateService.cs @@ -14,7 +14,7 @@ public sealed record UpdateInfo(string Version, string Name, string Notes, strin /// public static partial class UpdateService { - public const string Repository = "lippdev/consolemode"; + public const string Repository = "1r0n51uv/consolemode"; public const string SetupAssetPrefix = "ConsoleMode-Setup"; public const string PortableAssetPrefix = "ConsoleMode-Portable"; diff --git a/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj b/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj index f1c7c245..c0e89a40 100644 --- a/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj +++ b/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj @@ -70,6 +70,7 @@ + diff --git a/tests/ConsoleMode.Tests/LocalizationTests.cs b/tests/ConsoleMode.Tests/LocalizationTests.cs index 19835194..0db42a91 100644 --- a/tests/ConsoleMode.Tests/LocalizationTests.cs +++ b/tests/ConsoleMode.Tests/LocalizationTests.cs @@ -167,6 +167,7 @@ public void App_language_config_is_empty_until_chosen_and_roundtrips() [InlineData(null, null, "ja-JP", "en-US")] // unknown languages read English [InlineData(null, null, "de-CH", "de-DE")] [InlineData(null, null, "fr-CA", "fr-FR")] + [InlineData(null, null, "it-CH", "it-IT")] [InlineData(null, null, "ru-KZ", "ru-RU")] [InlineData(null, null, "es-MX", "es-ES")] [InlineData("es-ES", null, "pt-BR", "es-ES")] From 2df87287c421fc274f54fff12fb02692d75d90da Mon Sep 17 00:00:00 2001 From: Severino Ammirati Date: Wed, 25 Nov 2026 15:15:32 +0100 Subject: [PATCH 2/7] Add Italian README (#2) * Add Italian README Co-Authored-By: Claude Sonnet 5.5 * Link the Italian README from the French and Russian ones Co-Authored-By: Claude Sonnet 5.5 --------- Co-authored-by: Claude Sonnet 5.5 --- README.de-DE.md | 2 +- README.es-ES.md | 2 +- README.fr-FR.md | 2 +- README.it-IT.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- README.pt-BR.md | 2 +- README.ru-RU.md | 2 +- 7 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 README.it-IT.md diff --git a/README.de-DE.md b/README.de-DE.md index d788c793..21e61034 100644 --- a/README.de-DE.md +++ b/README.de-DE.md @@ -2,7 +2,7 @@ Mach deinen Windows-PC mit einem Klick zur **Spielkonsole**: Der Fernseher wird zum Hauptbildschirm, die anderen Bildschirme gehen aus, der Ton wechselt und deine Spieleoberfläche startet. Beende das Spiel und dein Schreibtisch-Setup kommt von selbst zurück. -[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · Deutsch · [Français](README.fr-FR.md) · [Русский](README.ru-RU.md) +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · Deutsch · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=Version&color=brightgreen) diff --git a/README.es-ES.md b/README.es-ES.md index 2d079cb0..173946ce 100644 --- a/README.es-ES.md +++ b/README.es-ES.md @@ -2,7 +2,7 @@ Convierte tu PC con Windows en una **consola** con un clic: enfoca la TV, apaga las demás pantallas, cambia el audio y abre la interfaz de tus juegos. Al salir del juego, tu escritorio vuelve solo. -[English](README.md) · [Português (Brasil)](README.pt-BR.md) · Español · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Русский](README.ru-RU.md) +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · Español · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Versión](https://img.shields.io/github/v/release/lippdev/consolemode?label=versi%C3%B3n&color=brightgreen) diff --git a/README.fr-FR.md b/README.fr-FR.md index edff1d78..263bbc33 100644 --- a/README.fr-FR.md +++ b/README.fr-FR.md @@ -2,7 +2,7 @@ Transformez votre PC Windows en **console de jeu** en un clic : la TV passe au premier plan, les autres écrans s'éteignent, le son bascule et votre interface de jeu se lance. Quittez le jeu et votre bureau revient tout seul. -[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · Français · [Русский](README.ru-RU.md) +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · Français · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=version&color=brightgreen) diff --git a/README.it-IT.md b/README.it-IT.md new file mode 100644 index 00000000..8d570081 --- /dev/null +++ b/README.it-IT.md @@ -0,0 +1,65 @@ +# Console Mode + +Trasforma il tuo PC Windows in una **console** con un clic: mette a fuoco la TV, spegne gli altri schermi, cambia l'audio e apre l'interfaccia dei tuoi giochi. Quando esci dal gioco, la tua scrivania torna com'era. + +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · Italiano · [Русский](README.ru-RU.md) + +![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) +![Versione](https://img.shields.io/github/v/release/1r0n51uv/consolemode?label=versione&color=brightgreen) +![Licenza](https://img.shields.io/github/license/1r0n51uv/consolemode) + +https://github.com/user-attachments/assets/9f244c06-76e5-4ccb-ab66-e637eae900ec + +## Download + +Scarica l'ultima versione stabile dalla **[pagina delle release](https://github.com/1r0n51uv/consolemode/releases/latest)**: + +- **`ConsoleMode-Setup-x64.exe`** (consigliato): installazione per utente, senza permessi di amministratore, si aggiorna da sola. +- **`ConsoleMode-Portable-x64.exe`**: un solo exe che salva i suoi dati accanto a sé. + +Vuoi provare per primo ciò che sta per arrivare? Attiva Sistema → App → "Ricevi le versioni di prova (beta)". + +Windows 10 o 11, più [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) o l'app Xbox. [RTSS](https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html) è facoltativo, per il limite di FPS e il contatore di FPS. + +## Come funziona + +1. Apri l'app e scegli lo schermo su cui giochi. Gli altri si spengono. +2. Premi **Gioca ora**, oppure usa il collegamento con un clic sul desktop. La prima volta su uno schermo nuovo, la TV chiede "Riesci a vedere questa schermata?" e, se nessuno risponde, tutto torna indietro da solo. +3. Esci da Big Picture o da Playnite e ogni cosa torna al suo posto: schermi, audio e risoluzione. + +Preferisci il divano? Con l'app nell'area di notifica, tieni premuta la scorciatoia del controller e parti da lì. + +Le scorciatoie del controller le scegli tu: all'inizio non ce n'è nessuna attiva, il giro della prima volta ti mostra dove sceglierle (Sistema → Controller). Uno stesso pulsante non può servire per due azioni. + +| Scorciatoia del controller | Cosa fa | Suggerita | +|---|---|---| +| Tieni premuta la scorciatoia per **aprire** | Entra in modalità console dall'area di notifica | **Home** (Xbox / PS) | +| Tieni premuta la scorciatoia del **menu** | Menu sopra il gioco: finestre aperte, gestione file, volume, risoluzione, audio, FPS, HDR, uscita | **Select + Y** (Create + △) | +| Tieni premuta la scorciatoia per **tornare al PC** | Torna al PC | **Start + Select** (Options + Create) | + +## Funzioni + +- Nasconde gli altri schermi **scollegandoli**, con **schermate nere** o tramite **DDC/CI**, tutto con le API di Windows: non include nessuno strumento di terze parti per schermo o audio +- **Risoluzione e frequenza di aggiornamento** per schermo, **HDR**, **VRR** e **limite di FPS** (RTSS) mentre giochi +- **Contatore di FPS** sopra il gioco (RTSS) in una scheda con tre dimensioni: solo FPS, compatto (uso di CPU, GPU e RAM), dettagliato (frequenze, temperatura e memoria della GPU) o una disposizione tutta tua +- L'audio va alla TV (o a qualsiasi uscita) e poi torna com'era +- [Accende la TV e la porta sull'ingresso del PC](docs/GUIDE.md#tv-control) (Google TV / Android TV via rete) e può eseguire un comando prima di metterla in standby quando torni al PC +- Nasconde le **icone del desktop** durante la sessione, se attivi l'opzione, e ripristina la visibilità precedente quando torni al PC +- Apre **Steam Big Picture**, **Playnite a schermo intero** o la **modalità Xbox**, e manda Steam nell'area di notifica quando torni al PC +- **Menu della sessione** sopra il gioco: cambia o chiudi le finestre aperte, regola volume, risoluzione, audio, FPS e HDR, nascondi il puntatore del mouse o muovilo con il controller, ed esplora i tuoi file con [ControlFS](https://github.com/nextestudios/ControlFS) e il web con [JoyChromium](https://github.com/lippdev/joychromium) +- Un'interfaccia in stile console, pensata per la TV, che funziona anche con mouse e tastiera (schermo intero, controller Xbox e PlayStation, schede con LB/RB, uno sfondo tuo o le copertine di Steam come sfondo), con un giro guidato la prima volta che la apri +- Automazione con i collegamenti `consolemode://start` / `stop` / `menu` (Stream Deck, script) e una [API di controllo locale](docs/GUIDE.md#local-control-api) +- Inglese, portoghese, spagnolo, tedesco, francese, italiano e russo + +Le novità di ogni versione sono nel [CHANGELOG.en-US.md](CHANGELOG.en-US.md) (in inglese). + +## Altro + +- [Guida](docs/GUIDE.md) (in inglese): modalità e ripristino, API di controllo, HDR/VRR/FPS, risoluzione dei problemi +- **Feedback:** il pulsante accanto a Impostazioni nell'app, oppure [questo modulo](https://github.com/1r0n51uv/consolemode/issues/new?template=feedback.yml). Una ⭐ aiuta altri giocatori da divano a trovare il progetto. +- Le versioni non sono ancora firmate digitalmente, quindi Windows SmartScreen o un antivirus possono segnalare il download; tutto il codice sorgente è qui. +- Vuoi aiutare con le traduzioni? Vedi [docs/TRANSLATING.md](docs/TRANSLATING.md). + +[GNU Affero General Public License v3.0 only](LICENSE) · [Avvisi di terze parti](THIRD_PARTY_NOTICES.md) · [Politica di firma del codice](docs/CODE_SIGNING.md) + +*Questa pagina è una traduzione del README in inglese. In caso di differenze, fa fede la versione inglese.* diff --git a/README.md b/README.md index a8ac55c8..af11b759 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Turn your Windows PC into a **game console** with one click: focus the TV, turn off the other screens, switch the audio and launch your game UI. Quit the game and your desk comes back on its own. -English · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Русский](README.ru-RU.md) +English · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=version&color=brightgreen) diff --git a/README.pt-BR.md b/README.pt-BR.md index c4798b65..b6dce902 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -2,7 +2,7 @@ Transforme seu PC Windows em um **console de jogos** com um clique: foque na TV, desligue as outras telas, mude o áudio e abra a interface de jogos. Saiu do jogo, a mesa volta sozinha. -[English](README.md) · Português (Brasil) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Русский](README.ru-RU.md) +[English](README.md) · Português (Brasil) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=vers%C3%A3o&color=brightgreen) diff --git a/README.ru-RU.md b/README.ru-RU.md index 64674582..924bfb8e 100644 --- a/README.ru-RU.md +++ b/README.ru-RU.md @@ -2,7 +2,7 @@ Превратите ПК с Windows в **игровую консоль** одним щелчком: фокус на телевизор, остальные экраны отключаются, звук переключается, и запускается ваш игровой интерфейс. Выйдите из игры, и рабочий стол вернётся сам. -[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · Русский +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · Русский ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=%D0%B2%D0%B5%D1%80%D1%81%D0%B8%D1%8F&color=brightgreen) From b2c2acb37dbd713b4721805be2700ed7ff7f1f70 Mon Sep 17 00:00:00 2001 From: Severino Ammirati Date: Wed, 25 Nov 2026 15:38:09 +0100 Subject: [PATCH 3/7] Fork sync: automatic merge and release of clean upstream syncs (#3) fork-sync.yml decides after the CI of a sync/vX PR: a clean sync (no conflicts, only Italian catalog, changelogs and version lines changed on top) is merged and released; anything else gets needs-review. FORK.md tells the keeper agent what the fork changed. Co-authored-by: Claude Sonnet 5.5 --- .github/scripts/fork-sync.sh | 85 +++++++++++++++++++++++++++++++++ .github/workflows/fork-sync.yml | 56 ++++++++++++++++++++++ FORK.md | 35 ++++++++++++++ 3 files changed, 176 insertions(+) create mode 100755 .github/scripts/fork-sync.sh create mode 100644 .github/workflows/fork-sync.yml create mode 100644 FORK.md diff --git a/.github/scripts/fork-sync.sh b/.github/scripts/fork-sync.sh new file mode 100755 index 00000000..579626c2 --- /dev/null +++ b/.github/scripts/fork-sync.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# Decides whether a sync PR (branch sync/vX, opened by the dojo's keeper agent) can be merged without +# a person, and if so merges it and starts the release. Clean means: +# - the CI passed on the PR's latest commit; +# - the upstream tag merges into main without conflicts (git merge-tree); +# - what the agent changed on top of that clean merge stays inside ALLOWED_FILES, or inside +# LINE_RULES files on lines matching their regex (versions, translation entries). +# Anything else gets the needs-review label and a comment, and waits for the owner. +# Configured by the calling workflow: UPSTREAM, ALLOWED_FILES, LINE_RULES, VERSION_FILE, +# VERSION_PATTERN, RELEASE_WORKFLOW, RELEASE_INPUTS, plus BRANCH, HEAD_SHA, CONCLUSION. +set -euo pipefail + +tag=${BRANCH#sync/} +pr=$(gh pr list --head "$BRANCH" --state open --json number,headRefOid,labels \ + --jq '.[0] | select(.) | "\(.number) \(.headRefOid) \([.labels[].name] | join(","))"') +if [[ -z $pr ]]; then + echo "No open PR for $BRANCH." + exit 0 +fi +read -r num head labels <<<"$pr" +if [[ ,$labels, == *,needs-review,* ]]; then + echo "PR #$num is waiting for a review: nothing to do." + exit 0 +fi +if [[ $head != "$HEAD_SHA" ]]; then + echo "The CI ran on $HEAD_SHA, the PR is at $head: the next CI run decides." + exit 0 +fi +if [[ $CONCLUSION != success ]]; then + echo "CI $CONCLUSION on PR #$num: the agent or the owner fixes it, the next green run decides." + exit 0 +fi + +review() { + gh label create needs-review --color D93F0B --description "Sync PR that needs a person" 2>/dev/null || true + gh pr edit "$num" --add-label needs-review + gh pr comment "$num" --body "Fork sync: not merged automatically. $1" + echo "$1" + exit 0 +} + +git fetch -q origin main "$BRANCH" +git fetch -q --no-tags "https://github.com/$UPSTREAM.git" "refs/tags/$tag:refs/tags/$tag" +head_ref=origin/$BRANCH + +git merge-base --is-ancestor "$tag" "$head_ref" || review "The branch does not contain upstream \`$tag\`." +if ! git merge-base --is-ancestor origin/main "$head_ref"; then + gh pr comment "$num" --body "Fork sync: \`main\` moved after this branch was created. Merge \`main\` into it; the next green CI decides." + exit 0 +fi +if ! out=$(git merge-tree --write-tree origin/main "$tag"); then + review "Upstream \`$tag\` conflicts with \`main\`: the agent resolved code by hand." +fi +clean=$(head -1 <<<"$out") + +declare -A rules=() +while IFS= read -r line; do + [[ -n $line ]] || continue + rules[${line%% :: *}]=${line#* :: } +done <<<"$LINE_RULES" + +while IFS= read -r file; do + [[ -n $file ]] || continue + if grep -qxF -- "$file" <<<"$ALLOWED_FILES"; then + continue + fi + if [[ -n ${rules[$file]:-} ]]; then + other=$(git diff -U0 "$clean" "$head_ref" -- "$file" | grep -E '^[+-]' | grep -Ev '^(\+\+\+|---) ' | cut -c2- | + grep -Evx -- "${rules[$file]}" || true) + [[ -z $other ]] || review "\`$file\` changes lines other than the allowed ones:"$'\n\n```\n'"$other"$'\n```' + continue + fi + review "\`$file\` is not among the files the agent may change on its own." +done < <(git diff --name-only "$clean" "$head_ref") + +gh pr merge "$num" --merge --match-head-commit "$HEAD_SHA" +git fetch -q origin main +version=$(git show "origin/main:$VERSION_FILE" | perl -ne 'if (/$ENV{VERSION_PATTERN}/) { print $1; exit }') +[[ -n $version ]] || { echo "Version not found in $VERSION_FILE" >&2; exit 1; } +args=() +while IFS= read -r input; do + [[ -n $input ]] && args+=(-f "${input//\{version\}/$version}") +done <<<"$RELEASE_INPUTS" +gh workflow run "$RELEASE_WORKFLOW" --ref main "${args[@]}" +echo "Merged PR #$num and started the $version release." diff --git a/.github/workflows/fork-sync.yml b/.github/workflows/fork-sync.yml new file mode 100644 index 00000000..12281955 --- /dev/null +++ b/.github/workflows/fork-sync.yml @@ -0,0 +1,56 @@ +name: Fork sync + +# This repo is a fork of lippdev/consolemode (see FORK.md). The dojo's keeper agent opens a PR from +# sync/vX when upstream publishes vX. When the CI of that PR finishes, this decides with fixed rules, +# no AI: a clean sync is merged and released (Release workflow, "publish" ticked); anything else +# gets the needs-review label and waits for the owner. The rules live in .github/scripts/fork-sync.sh. +on: + workflow_run: + workflows: [CI] + types: [completed] + +permissions: + contents: write + pull-requests: write + # Starts the Release workflow. + actions: write + +concurrency: + group: fork-sync + cancel-in-progress: false + +jobs: + merge: + if: github.event.workflow_run.event == 'pull_request' && startsWith(github.event.workflow_run.head_branch, 'sync/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + ref: main + fetch-depth: 0 + + - name: Merge and release a clean sync + env: + GH_TOKEN: ${{ github.token }} + BRANCH: ${{ github.event.workflow_run.head_branch }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} + CONCLUSION: ${{ github.event.workflow_run.conclusion }} + UPSTREAM: lippdev/consolemode + # What the agent may change on top of the clean merge: the Italian catalog and docs, and the + # changelogs the release reads its notes from. + ALLOWED_FILES: | + src/ConsoleMode/Resources/Strings.it-IT.json + README.it-IT.md + CHANGELOG.md + CHANGELOG.en-US.md + # file :: regex every changed line of that file must match (whole line). + LINE_RULES: | + src/ConsoleMode/ConsoleMode.csproj :: \s*<(Version|AssemblyVersion|FileVersion|InformationalVersion)>[0-9.]+\s* + VERSION_FILE: src/ConsoleMode/ConsoleMode.csproj + VERSION_PATTERN: ([^<]+) + RELEASE_WORKFLOW: release.yml + RELEASE_INPUTS: | + version={version} + publish=true + run: .github/scripts/fork-sync.sh diff --git a/FORK.md b/FORK.md new file mode 100644 index 00000000..298113ec --- /dev/null +++ b/FORK.md @@ -0,0 +1,35 @@ +# Fork notes + +This is a fork of [lippdev/consolemode](https://github.com/lippdev/consolemode). The dojo's +`keeper` agent (see `1r0n51uv/ron1n-dojo`, FLOW-013) reads this file every time upstream publishes a +release, merges it here and opens a PR from `sync/vX`. Keep it current: it is what the agent knows +about what we changed. + +## What we changed + +- **Italian**: `src/ConsoleMode/Resources/Strings.it-IT.json` (a catalog with every key of + `Strings.en-US.json`), its wiring (`ConsoleMode.csproj`, `Tests.csproj`, `LocalizationService.cs`, + `LocalizationTests.cs`, `build/ConsoleMode.iss`), `README.it-IT.md`, the language line of the other + READMEs, `docs/TESTING.md` and `docs/TRANSLATING.md`. +- **Updates and links point at the fork**: `UpdateService.Repository`, the changelog link in + `release.yml`, the installer URLs in `build/ConsoleMode.iss`. Never take upstream's value here. +- **Fork automation**: `.github/workflows/fork-sync.yml`, `.github/scripts/fork-sync.sh`, this file. + `winget.yml`/`release.yml`'s winget job stay off (no `WINGET_TOKEN`). + +## Rules for a sync + +1. Branch `sync/v` from `main`, then merge the upstream **tag** (`git merge v`), + never a squash: the history must keep upstream's commits. +2. On a conflict, keep upstream's code and re-apply our changes above on top. +3. Every key upstream added to `Strings.en-US.json` goes into `Strings.it-IT.json`, translated + (the localization tests fail on a missing key, a wrong `{0}` or an untranslated sentence). Run + `dotnet test tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj` (in a `mcr.microsoft.com/dotnet/sdk:8.0` + container when `dotnet` is missing). +4. **Version**: the fork's version is the higher of upstream's and ours; if ours is higher or equal, + ours +1 patch. Set it in `src/ConsoleMode/ConsoleMode.csproj`: `Version`, `AssemblyVersion`, + `FileVersion` and `InformationalVersion`. +5. **Changelog**: a `## []` section in **both** `CHANGELOG.md` (Portuguese) and + `CHANGELOG.en-US.md`; the release fails without them. Keep upstream's sections, add ours on top. +6. Anything beyond the Italian catalog, `README.it-IT.md`, the changelogs and the version lines + makes the PR "not clean": it waits for the owner (`needs-review`). +7. Never push to `main`, never merge: `fork-sync.yml` decides, with fixed rules, after the CI is green. From d9beefc3707e54311b1f8210f6ed735fcd07d304 Mon Sep 17 00:00:00 2001 From: 1r0n51uv Date: Wed, 25 Nov 2026 16:40:20 +0100 Subject: [PATCH 4/7] feat: remove TV control (Android TV, Wake-on-LAN, HDMI input) Drops the TV settings tab, its services and strings; the System tabs after it are renumbered. Co-Authored-By: Claude Sonnet 5.5 --- src/ConsoleMode/Models/Models.cs | 39 ---- src/ConsoleMode/Resources/Strings.de-DE.json | 28 --- src/ConsoleMode/Resources/Strings.en-US.json | 28 --- src/ConsoleMode/Resources/Strings.es-ES.json | 28 --- src/ConsoleMode/Resources/Strings.fr-FR.json | 28 --- src/ConsoleMode/Resources/Strings.it-IT.json | 28 --- src/ConsoleMode/Resources/Strings.pt-BR.json | 28 --- src/ConsoleMode/Resources/Strings.ru-RU.json | 28 --- src/ConsoleMode/Services/ConsoleEngine.cs | 9 - .../Services/LocalizationService.cs | 15 -- src/ConsoleMode/Services/Tv/AdbClient.cs | 205 ------------------ src/ConsoleMode/Services/Tv/AdbProtocol.cs | 159 -------------- src/ConsoleMode/Services/Tv/AdbShellOutput.cs | 21 -- .../Services/Tv/AndroidTvController.cs | 44 ---- .../Services/Tv/TvControlService.cs | 85 -------- src/ConsoleMode/Services/Tv/TvNetwork.cs | 56 ----- src/ConsoleMode/Services/Tv/WakeOnLan.cs | 49 ----- .../ViewModels/MainViewModel.ConsoleUi.cs | 5 - .../ViewModels/MainViewModel.Tv.cs | 124 ----------- src/ConsoleMode/ViewModels/MainViewModel.cs | 5 +- src/ConsoleMode/Views/ConsoleHomeView.xaml | 52 +---- src/ConsoleMode/Views/ConsoleHomeView.xaml.cs | 3 +- .../ConsoleMode.Tests.csproj | 3 - tests/ConsoleMode.Tests/TvControlTests.cs | 171 --------------- 24 files changed, 9 insertions(+), 1232 deletions(-) delete mode 100644 src/ConsoleMode/Services/Tv/AdbClient.cs delete mode 100644 src/ConsoleMode/Services/Tv/AdbProtocol.cs delete mode 100644 src/ConsoleMode/Services/Tv/AdbShellOutput.cs delete mode 100644 src/ConsoleMode/Services/Tv/AndroidTvController.cs delete mode 100644 src/ConsoleMode/Services/Tv/TvControlService.cs delete mode 100644 src/ConsoleMode/Services/Tv/TvNetwork.cs delete mode 100644 src/ConsoleMode/Services/Tv/WakeOnLan.cs delete mode 100644 src/ConsoleMode/ViewModels/MainViewModel.Tv.cs delete mode 100644 tests/ConsoleMode.Tests/TvControlTests.cs diff --git a/src/ConsoleMode/Models/Models.cs b/src/ConsoleMode/Models/Models.cs index 10d57b85..499d792c 100644 --- a/src/ConsoleMode/Models/Models.cs +++ b/src/ConsoleMode/Models/Models.cs @@ -145,9 +145,6 @@ public sealed class AppConfig /// A version the user chose to skip; newer ones are still announced. public string SkippedUpdateVersion { get; set; } = ""; - /// Turning the TV on / to the PC's input when console mode starts (issue #75). - public TvControlConfig Tv { get; set; } = new(); - /// Settings applied while a given Steam game runs during a session (issue #69). public List GameProfiles { get; set; } = []; @@ -169,40 +166,6 @@ public AppConfig WithMonitors(string focusMonitor, List hideMonitors, Di $"{FocusMonitor}|{(MonitorModes.TryGetValue(FocusMonitor, out var mode) ? mode.Key : "current")}"; } -public sealed class TvControlConfig -{ - public const string None = "none"; - public const string AndroidTv = "androidTv"; - - /// "none" | "androidTv". - public string Provider { get; set; } = None; - - /// The TV's IP address or host name, optionally with ":port". - public string Host { get; set; } = ""; - - /// For Wake-on-LAN when the TV is in deep standby; empty = don't send it. - public string MacAddress { get; set; } = ""; - - /// HDMI input the PC is plugged into (1-4). - public int HdmiInput { get; set; } = 1; - - /// Android TV: shell command that switches to the PC's input, for TVs that ignore the HDMI key codes. - public string InputCommand { get; set; } = ""; - - /// Put the TV in standby after the desk is restored. Off by default. - public bool TurnOffOnRestore { get; set; } - - /// Android TV: shell command sent when the desk is back, before standby (Home screen, another input…). - public string RestoreCommand { get; set; } = ""; - - /// Something to send the TV when going back to the PC. - [JsonIgnore] - public bool HasRestoreStep => TurnOffOnRestore || !string.IsNullOrWhiteSpace(RestoreCommand); - - [JsonIgnore] - public bool IsEnabled => !string.IsNullOrWhiteSpace(Provider) && Provider != None; -} - /// /// One game's own settings, saved from the session menu while it runs. Every field left empty keeps /// the session's value. Applied when the game starts, undone when it closes. @@ -403,8 +366,6 @@ public sealed class ScreenRect public sealed class ConsoleRuntimeState { public bool IsActive { get; set; } - /// TV control used for this session, for the optional standby on restore. - public TvControlConfig? Tv { get; set; } public bool ShouldExit { get; set; } public bool RestoreInProgress { get; set; } public bool SteamMoved { get; set; } diff --git a/src/ConsoleMode/Resources/Strings.de-DE.json b/src/ConsoleMode/Resources/Strings.de-DE.json index 64278c0a..3bb87ff8 100644 --- a/src/ConsoleMode/Resources/Strings.de-DE.json +++ b/src/ConsoleMode/Resources/Strings.de-DE.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Weitere Apps des Entwicklers", "TvConfirmationCard": "TV-Bestätigung", "TvConfirmationDescription": "Wenn du einen neuen Gaming-Bildschirm zum ersten Mal verwendest, bittet dich der Fernseher zu bestätigen, dass du das Bild sehen kannst. Bestätige mit Maus, Tastatur oder Controller (Xbox: A/B · PlayStation: ✕/○). Du kannst dies hier testen, ohne deine Bildschirme zu ändern.", - "TvSection": "Fernseher", - "TvControlCard": "Fernseher einschalten und Eingang wechseln", - "TvProviderNone": "Nicht steuern", - "TvProviderAndroid": "Google TV / Android TV (Netzwerk)", - "TvNoneDescription": "Beim Start des Konsolenmodus schaltet die App den Fernseher ein und wechselt zum PC-Eingang. Beim Wiederherstellen kann sie ihn in den Standby versetzen.", - "TvAndroidDescription": "Über das Netzwerk, ohne Installation. Auf dem Fernseher: Einstellungen → System → Entwickleroptionen → „USB-Debugging“ (oder „Netzwerk-Debugging“) aktivieren. Beim ersten Mal „Debugging zulassen“ auf dem Fernseher bestätigen.", - "TvHostCard": "TV-Adresse", - "TvHostDescription": "Die IP-Adresse des Fernsehers in deinem Netzwerk (Einstellungen → Netzwerk). Tipp: Reserviere die Adresse im Router, damit sie sich nicht ändert.", - "TvMacCard": "MAC-Adresse (optional)", - "TvMacDescription": "Damit der Fernseher aus dem Tiefschlaf geweckt werden kann (Wake-on-LAN). Leer lassen, wenn der Fernseher auch im ausgeschalteten Zustand reagiert.", - "TvHdmiCard": "PC-Eingang", - "TvHdmiDescription": "Der HDMI-Anschluss des Fernsehers, an den der PC angeschlossen ist.", - "TvInputCommandCard": "Eingangsbefehl (erweitert)", - "TvInputCommandDescription": "Nur verwenden, wenn der Fernseher die HDMI-Taste ignoriert: ein Android-Shell-Befehl, der zum PC-Eingang wechselt. Leer lassen = die oben ausgewählte HDMI-Taste verwenden.", - "TvRestoreCommandCard": "Befehl bei der Rückkehr zum PC (erweitert)", - "TvTurnOffCard": "Fernseher beim Wiederherstellen in den Standby versetzen", - "TvTurnOffDescription": "Nachdem die Desktop-Bildschirme wiederhergestellt wurden.", - "TvTestCard": "Fernseher testen", - "TvTestDescription": "Schaltet den Fernseher jetzt ein und wechselt zum PC-Eingang, ohne die Bildschirme zu verändern. Beim ersten Mal wird er mit dem Fernseher gekoppelt.", - "TvTesting": "Verbindung zum Fernseher wird hergestellt… Falls eine Abfrage erscheint, bestätige sie auf dem Fernseher.", - "TvTestSuccess": "Der Fernseher hat geantwortet: Er sollte jetzt eingeschaltet und auf den PC-Eingang eingestellt sein.", - "TvTestFailure": "Verbindung zum Fernseher fehlgeschlagen: {0}", - "TvTestTimedOut": "Der Fernseher hat nicht innerhalb von 90 Sekunden vollständig geantwortet. Versuche es erneut.", - "TvNotConfigured": "Lege fest, wie der Fernseher gesteuert werden soll.", - "TvHostMissing": "Gib die IP-Adresse des Fernsehers ein.", - "TvUnreachable": "Der Fernseher unter {0} hat nicht geantwortet. Prüfe die IP-Adresse, ob der Fernseher im selben Netzwerk ist und ob Debugging aktiviert ist.", - "TvAdbNotAllowed": "Der Fernseher hat diesem PC keinen Zugriff erlaubt. Drücke erneut auf „Testen“ und wähle auf dem Fernseher „Immer zulassen“ + „Zulassen“.", - "TvAdbTlsUnsupported": "Der Fernseher akzeptiert nur „Drahtloses Debugging“ (Kopplung mit Code). Aktiviere in den Entwickleroptionen „USB-Debugging“ / „Netzwerk-Debugging“.", "ControllerTestCard": "Controller testen", "ControllerTestDescription": "Zeigt live, welche Eingaben Windows von jedem Controller erhält: Quelle, Tasten nach Index, Steuerkreuz und Sticks. Verwende diese Funktion, wenn ein Controller erkannt wird, aber nichts bewirkt.", "ControllerTestSteamHint": "Wenn Steam mit PlayStation-Unterstützung läuft, fängt es die Eingaben des Controllers ab und die App erhält nichts. Schließe Steam (oder deaktiviere die PlayStation-Unterstützung in Steam Input) und teste erneut.", diff --git a/src/ConsoleMode/Resources/Strings.en-US.json b/src/ConsoleMode/Resources/Strings.en-US.json index e94cb515..83180740 100644 --- a/src/ConsoleMode/Resources/Strings.en-US.json +++ b/src/ConsoleMode/Resources/Strings.en-US.json @@ -171,34 +171,6 @@ "OtherAppsSection": "More apps from the developer", "TvConfirmationCard": "TV confirmation", "TvConfirmationDescription": "The first time you use a new gaming display, the TV asks you to confirm that you can see the image. Respond with a mouse, keyboard, or controller (Xbox: A/B · PlayStation: ✕/○). Test it here without changing your displays.", - "TvSection": "TV", - "TvControlCard": "Turn the TV on and switch input", - "TvProviderNone": "Don't control it", - "TvProviderAndroid": "Google TV / Android TV (network)", - "TvNoneDescription": "When console mode starts, the app turns the TV on and switches it to the PC's input; on restore it can put it in standby.", - "TvAndroidDescription": "Over the network, nothing to install. On the TV: Settings → System → Developer options → turn on \"USB debugging\" (or \"Network debugging\"). The first time, accept \"Allow debugging\" on the TV.", - "TvHostCard": "TV address", - "TvHostDescription": "The TV's IP on your network (Settings → Network). Tip: reserve it in your router so it doesn't change.", - "TvMacCard": "MAC address (optional)", - "TvMacDescription": "To wake the TV from deep standby (Wake-on-LAN). Leave it empty if the TV answers while off.", - "TvHdmiCard": "PC input", - "TvHdmiDescription": "The TV's HDMI port the PC is plugged into.", - "TvInputCommandCard": "Input command (advanced)", - "TvInputCommandDescription": "Only if the TV ignores the HDMI key: an Android shell command that switches to the PC's input. Empty = the HDMI key chosen above.", - "TvRestoreCommandCard": "Command when going back to the PC (advanced)", - "TvTurnOffCard": "Put the TV in standby on restore", - "TvTurnOffDescription": "After the desk screens are back.", - "TvTestCard": "Test the TV", - "TvTestDescription": "Turns the TV on and switches to the PC's input now, without touching the screens. The first time, it pairs with the TV.", - "TvTesting": "Talking to the TV… If it asks, accept on the TV screen.", - "TvTestSuccess": "The TV answered: it should now be on, on the PC's input.", - "TvTestFailure": "Could not talk to the TV: {0}", - "TvTestTimedOut": "The TV did not finish responding within 90 seconds. Try again.", - "TvNotConfigured": "Choose how to control the TV.", - "TvHostMissing": "Enter the TV's IP address.", - "TvUnreachable": "The TV at {0} didn't answer. Check the IP, that the TV is on the same network and that debugging is on.", - "TvAdbNotAllowed": "The TV didn't allow this PC. Press Test again and choose \"Always allow\" + \"Allow\" on the TV.", - "TvAdbTlsUnsupported": "The TV only accepts \"Wireless debugging\" (pairing with a code). Turn on \"USB debugging\" / \"Network debugging\" in Developer options.", "ControllerTestCard": "Test controller", "ControllerTestDescription": "Shows live what Windows delivers from each controller: source, buttons by index, D-pad and sticks. Use it when a pad shows up but does nothing.", "ControllerTestSteamHint": "Steam running with PlayStation support captures the pad and the app gets nothing. Close Steam (or turn off PlayStation support in Steam Input) and test again.", diff --git a/src/ConsoleMode/Resources/Strings.es-ES.json b/src/ConsoleMode/Resources/Strings.es-ES.json index 1e824828..5c1dafbe 100644 --- a/src/ConsoleMode/Resources/Strings.es-ES.json +++ b/src/ConsoleMode/Resources/Strings.es-ES.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Más apps del desarrollador", "TvConfirmationCard": "Confirmación en la TV", "TvConfirmationDescription": "La primera vez con una pantalla de juego nueva, la TV pide que confirmes que ves la imagen. Responde con ratón, teclado o mando (Xbox: A/B · PlayStation: ✕/○). Pruébalo aquí sin cambiar tus pantallas.", - "TvSection": "TV", - "TvControlCard": "Encender la TV y cambiar la entrada", - "TvProviderNone": "No controlarla", - "TvProviderAndroid": "Google TV / Android TV (red)", - "TvNoneDescription": "Al entrar en el modo consola, la app enciende la TV y cambia a la entrada del PC; al restaurar, puede ponerla en reposo.", - "TvAndroidDescription": "Por la red, sin instalar nada. En la TV: Ajustes → Sistema → Opciones de desarrollador → activa \"Depuración USB\" (o \"Depuración por red\"). La primera vez, acepta \"Permitir depuración\" en la TV.", - "TvHostCard": "Dirección de la TV", - "TvHostDescription": "IP de la TV en tu red (Ajustes → Red). Consejo: resérvala en el router para que no cambie.", - "TvMacCard": "Dirección MAC (opcional)", - "TvMacDescription": "Para despertar la TV del reposo profundo (Wake-on-LAN). Déjalo vacío si la TV responde apagada.", - "TvHdmiCard": "Entrada del PC", - "TvHdmiDescription": "Puerto HDMI de la TV donde está conectado el PC.", - "TvInputCommandCard": "Comando de la entrada (avanzado)", - "TvInputCommandDescription": "Solo si la TV ignora la tecla HDMI: un comando de shell de Android que cambia a la entrada del PC. Vacío = la tecla HDMI elegida arriba.", - "TvRestoreCommandCard": "Comando al volver al PC (avanzado)", - "TvTurnOffCard": "Poner la TV en reposo al restaurar", - "TvTurnOffDescription": "Después de que vuelvan las pantallas del escritorio.", - "TvTestCard": "Probar la TV", - "TvTestDescription": "Enciende la TV y cambia a la entrada del PC ahora, sin tocar las pantallas. La primera vez, se empareja con la TV.", - "TvTesting": "Hablando con la TV… Si lo pide, acepta en la pantalla de la TV.", - "TvTestSuccess": "La TV respondió: debería estar encendida en la entrada del PC.", - "TvTestFailure": "No se pudo hablar con la TV: {0}", - "TvTestTimedOut": "La TV no terminó de responder en 90 segundos. Inténtalo de nuevo.", - "TvNotConfigured": "Elige cómo controlar la TV.", - "TvHostMissing": "Indica la dirección IP de la TV.", - "TvUnreachable": "La TV en {0} no respondió. Revisa la IP, que la TV esté en la misma red y que la depuración esté activada.", - "TvAdbNotAllowed": "La TV no autorizó este PC. Pulsa Probar de nuevo y elige \"Permitir siempre\" + \"Permitir\" en la TV.", - "TvAdbTlsUnsupported": "La TV solo acepta \"Depuración inalámbrica\" (emparejamiento con código). Activa \"Depuración USB\" / \"Depuración por red\" en Opciones de desarrollador.", "ControllerTestCard": "Probar mando", "ControllerTestDescription": "Muestra en vivo lo que Windows entrega de cada mando: origen, botones por índice, cruceta y sticks. Úsalo si el mando aparece pero no responde.", "ControllerTestSteamHint": "Steam abierto con soporte para PlayStation captura el mando y la aplicación no recibe nada. Cierra Steam (o desactiva el soporte para PlayStation en Steam Input) y prueba de nuevo.", diff --git a/src/ConsoleMode/Resources/Strings.fr-FR.json b/src/ConsoleMode/Resources/Strings.fr-FR.json index f24fd23e..bb564e0e 100644 --- a/src/ConsoleMode/Resources/Strings.fr-FR.json +++ b/src/ConsoleMode/Resources/Strings.fr-FR.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Autres applications du développeur", "TvConfirmationCard": "Confirmation sur la TV", "TvConfirmationDescription": "La première fois que vous utilisez un nouvel écran de jeu, la TV vous demande de confirmer que vous voyez l'image. Répondez avec la souris, le clavier ou la manette (Xbox : A/B · PlayStation : ✕/○). Testez-la ici sans modifier vos écrans.", - "TvSection": "TV", - "TvControlCard": "Allumer la TV et changer d'entrée", - "TvProviderNone": "Ne pas la contrôler", - "TvProviderAndroid": "Google TV / Android TV (réseau)", - "TvNoneDescription": "Au lancement du mode console, l'application allume la TV et la bascule sur l'entrée du PC ; à la restauration, elle peut la mettre en veille.", - "TvAndroidDescription": "Par le réseau, rien à installer. Sur la TV : Paramètres → Système → Options pour les développeurs → activez \"Débogage USB\" (ou \"Débogage réseau\"). La première fois, acceptez \"Autoriser le débogage\" sur la TV.", - "TvHostCard": "Adresse de la TV", - "TvHostDescription": "L'adresse IP de la TV sur votre réseau (Paramètres → Réseau). Astuce : réservez-la dans votre routeur pour qu'elle ne change pas.", - "TvMacCard": "Adresse MAC (facultatif)", - "TvMacDescription": "Pour sortir la TV de la veille profonde (Wake-on-LAN). Laissez vide si la TV répond lorsqu'elle est éteinte.", - "TvHdmiCard": "Entrée du PC", - "TvHdmiDescription": "Le port HDMI de la TV auquel le PC est branché.", - "TvInputCommandCard": "Commande d'entrée (avancé)", - "TvInputCommandDescription": "Seulement si la TV ignore la touche HDMI : une commande shell Android qui bascule sur l'entrée du PC. Vide = la touche HDMI choisie ci-dessus.", - "TvRestoreCommandCard": "Commande au retour sur le PC (avancé)", - "TvTurnOffCard": "Mettre la TV en veille à la restauration", - "TvTurnOffDescription": "Une fois les écrans du bureau rétablis.", - "TvTestCard": "Tester la TV", - "TvTestDescription": "Allume la TV et bascule sur l'entrée du PC maintenant, sans toucher aux écrans. La première fois, l'appairage avec la TV est effectué.", - "TvTesting": "Communication avec la TV… Si elle le demande, acceptez sur l'écran de la TV.", - "TvTestSuccess": "La TV a répondu : elle devrait maintenant être allumée, sur l'entrée du PC.", - "TvTestFailure": "Impossible de communiquer avec la TV : {0}", - "TvTestTimedOut": "La TV n'a pas fini de répondre en 90 secondes. Réessayez.", - "TvNotConfigured": "Choisissez comment contrôler la TV.", - "TvHostMissing": "Saisissez l'adresse IP de la TV.", - "TvUnreachable": "La TV à l'adresse {0} n'a pas répondu. Vérifiez l'IP, que la TV est sur le même réseau et que le débogage est activé.", - "TvAdbNotAllowed": "La TV n'a pas autorisé ce PC. Appuyez à nouveau sur Tester et choisissez \"Toujours autoriser\" + \"Autoriser\" sur la TV.", - "TvAdbTlsUnsupported": "La TV n'accepte que le \"Débogage sans fil\" (association par code). Activez \"Débogage USB\" / \"Débogage réseau\" dans les Options pour les développeurs.", "ControllerTestCard": "Tester la manette", "ControllerTestDescription": "Affiche en direct ce que Windows reçoit de chaque manette : source, boutons par index, croix directionnelle et sticks. Utile quand une manette apparaît mais ne fait rien.", "ControllerTestSteamHint": "Steam ouvert avec la prise en charge PlayStation capture la manette et l'application ne reçoit rien. Fermez Steam (ou désactivez la prise en charge PlayStation dans Steam Input) et testez à nouveau.", diff --git a/src/ConsoleMode/Resources/Strings.it-IT.json b/src/ConsoleMode/Resources/Strings.it-IT.json index 6c46748c..d095f64d 100644 --- a/src/ConsoleMode/Resources/Strings.it-IT.json +++ b/src/ConsoleMode/Resources/Strings.it-IT.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Altre app dello sviluppatore", "TvConfirmationCard": "Conferma sulla TV", "TvConfirmationDescription": "La prima volta che usi un nuovo schermo da gioco, la TV ti chiede di confermare che vedi l'immagine. Rispondi con mouse, tastiera o controller (Xbox: A/B · PlayStation: ✕/○). Provalo qui senza modificare i tuoi schermi.", - "TvSection": "TV", - "TvControlCard": "Accendi la TV e cambia ingresso", - "TvProviderNone": "Non controllarla", - "TvProviderAndroid": "Google TV / Android TV (rete)", - "TvNoneDescription": "Quando parte la modalità console, l'app accende la TV e la porta sull'ingresso del PC; al ripristino può metterla in standby.", - "TvAndroidDescription": "Tramite la rete, senza installare nulla. Sulla TV: Impostazioni → Sistema → Opzioni sviluppatore → attiva \"Debug USB\" (o \"Debug di rete\"). La prima volta, accetta \"Consenti debug\" sulla TV.", - "TvHostCard": "Indirizzo della TV", - "TvHostDescription": "L'IP della TV nella tua rete (Impostazioni → Rete). Suggerimento: riservalo nel router così non cambia.", - "TvMacCard": "Indirizzo MAC (facoltativo)", - "TvMacDescription": "Per riattivare la TV dallo standby profondo (Wake-on-LAN). Lascialo vuoto se la TV risponde da spenta.", - "TvHdmiCard": "Ingresso del PC", - "TvHdmiDescription": "La porta HDMI della TV a cui è collegato il PC.", - "TvInputCommandCard": "Comando per l'ingresso (avanzato)", - "TvInputCommandDescription": "Solo se la TV ignora il tasto HDMI: un comando shell Android che passa all'ingresso del PC. Vuoto = il tasto HDMI scelto sopra.", - "TvRestoreCommandCard": "Comando al ritorno al PC (avanzato)", - "TvTurnOffCard": "Metti la TV in standby al ripristino", - "TvTurnOffDescription": "Dopo che gli schermi della postazione sono tornati.", - "TvTestCard": "Prova la TV", - "TvTestDescription": "Accende la TV e passa subito all'ingresso del PC, senza toccare gli schermi. La prima volta si associa alla TV.", - "TvTesting": "Comunico con la TV… Se te lo chiede, accetta sullo schermo della TV.", - "TvTestSuccess": "La TV ha risposto: ora dovrebbe essere accesa, sull'ingresso del PC.", - "TvTestFailure": "Impossibile comunicare con la TV: {0}", - "TvTestTimedOut": "La TV non ha finito di rispondere entro 90 secondi. Riprova.", - "TvNotConfigured": "Scegli come controllare la TV.", - "TvHostMissing": "Inserisci l'indirizzo IP della TV.", - "TvUnreachable": "La TV all'indirizzo {0} non ha risposto. Controlla l'IP, che la TV sia sulla stessa rete e che il debug sia attivo.", - "TvAdbNotAllowed": "La TV non ha autorizzato questo PC. Premi di nuovo Prova e scegli \"Consenti sempre\" + \"Consenti\" sulla TV.", - "TvAdbTlsUnsupported": "La TV accetta solo il \"Debug wireless\" (associazione con un codice). Attiva \"Debug USB\" / \"Debug di rete\" nelle Opzioni sviluppatore.", "ControllerTestCard": "Prova il controller", "ControllerTestDescription": "Mostra in tempo reale ciò che Windows riceve da ogni controller: origine, pulsanti per indice, croce direzionale e stick. Usalo quando un controller compare ma non fa nulla.", "ControllerTestSteamHint": "Se Steam è in esecuzione con il supporto PlayStation, cattura il controller e l'app non riceve nulla. Chiudi Steam (o disattiva il supporto PlayStation in Steam Input) e riprova.", diff --git a/src/ConsoleMode/Resources/Strings.pt-BR.json b/src/ConsoleMode/Resources/Strings.pt-BR.json index b4813bc0..43dc9097 100644 --- a/src/ConsoleMode/Resources/Strings.pt-BR.json +++ b/src/ConsoleMode/Resources/Strings.pt-BR.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Outros apps do desenvolvedor", "TvConfirmationCard": "Confirmação na TV", "TvConfirmationDescription": "Na primeira vez com uma tela de jogo nova, a TV pergunta se você está vendo a imagem. Responda com mouse, teclado ou controle (Xbox: A/B · PlayStation: ✕/○). Teste aqui sem mexer nas telas.", - "TvSection": "TV", - "TvControlCard": "Ligar a TV e trocar a entrada", - "TvProviderNone": "Não controlar", - "TvProviderAndroid": "Google TV / Android TV (rede)", - "TvNoneDescription": "Ao entrar no modo console, o app liga a TV e troca para a entrada do PC; ao restaurar, pode colocá-la em espera.", - "TvAndroidDescription": "Pela rede, sem instalar nada. Na TV: Configurações → Sistema → Opções do desenvolvedor → ative \"Depuração USB\" (ou \"Depuração pela rede\"). Na primeira vez, aceite \"Permitir depuração\" na TV.", - "TvHostCard": "Endereço da TV", - "TvHostDescription": "IP da TV na sua rede (Configurações → Rede). Dica: reserve esse IP no roteador para ele não mudar.", - "TvMacCard": "Endereço MAC (opcional)", - "TvMacDescription": "Para acordar a TV em espera profunda (Wake-on-LAN). Deixe vazio se a TV responde mesmo desligada.", - "TvHdmiCard": "Entrada do PC", - "TvHdmiDescription": "Porta HDMI da TV onde o PC está ligado.", - "TvInputCommandCard": "Comando da entrada (avançado)", - "TvInputCommandDescription": "Só se a TV ignorar a tecla HDMI: um comando de shell do Android que troca para a entrada do PC. Vazio = tecla HDMI escolhida acima.", - "TvRestoreCommandCard": "Comando ao voltar ao PC (avançado)", - "TvTurnOffCard": "Colocar a TV em espera ao restaurar", - "TvTurnOffDescription": "Depois que as telas da mesa voltam.", - "TvTestCard": "Testar a TV", - "TvTestDescription": "Liga a TV e troca para a entrada do PC agora, sem mexer nas telas. Na primeira vez, pareia com a TV.", - "TvTesting": "Falando com a TV… Se ela pedir, aceite na tela da TV.", - "TvTestSuccess": "A TV respondeu: ela deve estar ligada na entrada do PC.", - "TvTestFailure": "Não foi possível falar com a TV: {0}", - "TvTestTimedOut": "A TV não concluiu a resposta em 90 segundos. Tente novamente.", - "TvNotConfigured": "Escolha como controlar a TV.", - "TvHostMissing": "Informe o endereço IP da TV.", - "TvUnreachable": "A TV em {0} não respondeu. Confira o IP, se a TV está na mesma rede e se a depuração está ativada.", - "TvAdbNotAllowed": "A TV não autorizou este PC. Toque em Testar de novo e escolha \"Sempre permitir\" + \"Permitir\" na TV.", - "TvAdbTlsUnsupported": "A TV só aceita \"Depuração sem fio\" (com pareamento por código). Ative \"Depuração USB\" / \"Depuração pela rede\" nas Opções do desenvolvedor.", "ControllerTestCard": "Testar controle", "ControllerTestDescription": "Mostra ao vivo o que o Windows entrega de cada controle: origem, botões por índice, D-pad e analógicos. Use se o controle aparece mas não responde.", "ControllerTestSteamHint": "Steam aberto com suporte a PlayStation captura o controle e o app não recebe nada. Feche o Steam (ou desligue o suporte a PlayStation no Steam Input) e teste de novo.", diff --git a/src/ConsoleMode/Resources/Strings.ru-RU.json b/src/ConsoleMode/Resources/Strings.ru-RU.json index 6f28d1d3..1de12786 100644 --- a/src/ConsoleMode/Resources/Strings.ru-RU.json +++ b/src/ConsoleMode/Resources/Strings.ru-RU.json @@ -171,34 +171,6 @@ "OtherAppsSection": "Другие приложения разработчика", "TvConfirmationCard": "Подтверждение на телевизоре", "TvConfirmationDescription": "При первом использовании нового игрового экрана телевизор просит подтвердить, что изображение видно. Ответьте мышью, клавиатурой или геймпадом (Xbox: A/B · PlayStation: ✕/○). Проверьте здесь, не меняя настройки экранов.", - "TvSection": "Телевизор", - "TvControlCard": "Включать телевизор и переключать вход", - "TvProviderNone": "Не управлять", - "TvProviderAndroid": "Google TV / Android TV (по сети)", - "TvNoneDescription": "При запуске режима консоли приложение включает телевизор и переключает его на вход ПК; при восстановлении может перевести его в режим ожидания.", - "TvAndroidDescription": "По сети, ничего устанавливать не нужно. На телевизоре: «Настройки» → «Система» → «Для разработчиков» → включите «Отладка по USB» (или «Отладка по сети»). В первый раз примите запрос «Разрешить отладку» на телевизоре.", - "TvHostCard": "Адрес телевизора", - "TvHostDescription": "IP-адрес телевизора в вашей сети («Настройки» → «Сеть»). Совет: зарезервируйте его в роутере, чтобы он не менялся.", - "TvMacCard": "MAC-адрес (необязательно)", - "TvMacDescription": "Для пробуждения телевизора из глубокого режима ожидания (Wake-on-LAN). Оставьте пустым, если телевизор отвечает в выключенном состоянии.", - "TvHdmiCard": "Вход ПК", - "TvHdmiDescription": "Порт HDMI телевизора, к которому подключён ПК.", - "TvInputCommandCard": "Команда входа (дополнительно)", - "TvInputCommandDescription": "Только если телевизор игнорирует клавишу HDMI: команда оболочки Android, переключающая на вход ПК. Пусто — клавиша HDMI, выбранная выше.", - "TvRestoreCommandCard": "Команда при возврате к ПК (дополнительно)", - "TvTurnOffCard": "Переводить телевизор в режим ожидания при восстановлении", - "TvTurnOffDescription": "После того как экраны рабочего места вернутся.", - "TvTestCard": "Проверить телевизор", - "TvTestDescription": "Включает телевизор и сразу переключает на вход ПК, не трогая экраны. В первый раз выполняется сопряжение с телевизором.", - "TvTesting": "Связь с телевизором… Если появится запрос, примите его на экране телевизора.", - "TvTestSuccess": "Телевизор ответил: теперь он должен быть включён на входе ПК.", - "TvTestFailure": "Не удалось связаться с телевизором: {0}", - "TvTestTimedOut": "Телевизор не ответил за 90 секунд. Повторите попытку.", - "TvNotConfigured": "Выберите способ управления телевизором.", - "TvHostMissing": "Введите IP-адрес телевизора.", - "TvUnreachable": "Телевизор по адресу {0} не ответил. Проверьте IP-адрес, что телевизор в той же сети и что отладка включена.", - "TvAdbNotAllowed": "Телевизор не разрешил подключение этого ПК. Снова нажмите «Проверить» и выберите на телевизоре «Всегда разрешать» + «Разрешить».", - "TvAdbTlsUnsupported": "Телевизор принимает только «Беспроводную отладку» (сопряжение по коду). Включите «Отладка по USB» / «Отладка по сети» в разделе «Для разработчиков».", "ControllerTestCard": "Проверка геймпада", "ControllerTestDescription": "Показывает в реальном времени, что Windows получает от каждого геймпада: источник, кнопки по номерам, крестовину и стики. Используйте, если геймпад виден, но ничего не делает.", "ControllerTestSteamHint": "Steam с включённой поддержкой PlayStation перехватывает геймпад, и приложение ничего не получает. Закройте Steam (или отключите поддержку PlayStation в Steam Input) и проверьте снова.", diff --git a/src/ConsoleMode/Services/ConsoleEngine.cs b/src/ConsoleMode/Services/ConsoleEngine.cs index 49733bbc..28fb3022 100644 --- a/src/ConsoleMode/Services/ConsoleEngine.cs +++ b/src/ConsoleMode/Services/ConsoleEngine.cs @@ -1,6 +1,5 @@ using ConsoleMode.Models; using ConsoleMode.Native; -using ConsoleMode.Services.Tv; namespace ConsoleMode.Services; @@ -12,7 +11,6 @@ public sealed partial class ConsoleEngine public RtssService Rtss { get; } = new(); public LaunchService Launch { get; } = new(); public VideoFeaturesService Video { get; } = new(); - public TvControlService Tv { get; } = new(); public const string AudioOnConnectId = "__on_connect__"; @@ -95,11 +93,6 @@ public void Start(AppConfig config, MonitorInfo? focusInfo, Func m.Name == config.FocusMonitor) ?? focusInfo; @@ -398,7 +391,6 @@ public void Stop() Rtss.SetOverlay("", hideOthers: false); Monitors.ClearCache(); Audio.ClearCache(); - if (State.Tv is { IsEnabled: true, HasRestoreStep: true } tv) Tv.Restore(tv); AppLog.Write("Stop-ConsoleMode: restauração concluída"); // Only once the screens are back: a restore that threw or left them wrong is tried again on the next start. if (!restore.Success) @@ -421,7 +413,6 @@ public void Stop() State.RestoreInProgress = false; State.IsActive = false; State.ShouldExit = false; - State.Tv = null; State.SteamMoved = false; State.MoveCount = 0; State.HasAppeared = false; diff --git a/src/ConsoleMode/Services/LocalizationService.cs b/src/ConsoleMode/Services/LocalizationService.cs index f7df11e2..afe24710 100644 --- a/src/ConsoleMode/Services/LocalizationService.cs +++ b/src/ConsoleMode/Services/LocalizationService.cs @@ -281,21 +281,6 @@ internal void NotifyAll() public string OtherAppsStageBeta => LocalizationService.Get(nameof(OtherAppsStageBeta)); public string TvConfirmationCard => LocalizationService.Get(nameof(TvConfirmationCard)); public string TvConfirmationDescription => LocalizationService.Get(nameof(TvConfirmationDescription)); - public string TvSection => LocalizationService.Get(nameof(TvSection)); - public string TvControlCard => LocalizationService.Get(nameof(TvControlCard)); - public string TvHostCard => LocalizationService.Get(nameof(TvHostCard)); - public string TvHostDescription => LocalizationService.Get(nameof(TvHostDescription)); - public string TvMacCard => LocalizationService.Get(nameof(TvMacCard)); - public string TvMacDescription => LocalizationService.Get(nameof(TvMacDescription)); - public string TvHdmiCard => LocalizationService.Get(nameof(TvHdmiCard)); - public string TvHdmiDescription => LocalizationService.Get(nameof(TvHdmiDescription)); - public string TvInputCommandCard => LocalizationService.Get(nameof(TvInputCommandCard)); - public string TvInputCommandDescription => LocalizationService.Get(nameof(TvInputCommandDescription)); - public string TvRestoreCommandCard => LocalizationService.Get(nameof(TvRestoreCommandCard)); - public string TvTurnOffCard => LocalizationService.Get(nameof(TvTurnOffCard)); - public string TvTurnOffDescription => LocalizationService.Get(nameof(TvTurnOffDescription)); - public string TvTestCard => LocalizationService.Get(nameof(TvTestCard)); - public string TvTestDescription => LocalizationService.Get(nameof(TvTestDescription)); public string TutorialCard => LocalizationService.Get(nameof(TutorialCard)); public string TutorialDescription => LocalizationService.Get(nameof(TutorialDescription)); public string SessionTourCard => LocalizationService.Get(nameof(SessionTourCard)); diff --git a/src/ConsoleMode/Services/Tv/AdbClient.cs b/src/ConsoleMode/Services/Tv/AdbClient.cs deleted file mode 100644 index 0feb4191..00000000 --- a/src/ConsoleMode/Services/Tv/AdbClient.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; - -namespace ConsoleMode.Services.Tv; - -/// -/// Minimal ADB client over TCP ("ADB debugging" / "network debugging" on the TV, port 5555): -/// connect, authenticate with this PC's key and run shell commands. -/// The first time, the TV asks "Allow debugging from this computer?"; with "Always allow" -/// ticked the key is remembered and later connections go straight through. -/// -public sealed class AdbClient : IAsyncDisposable -{ - private readonly TcpClient _tcp; - private readonly NetworkStream _stream; - private uint _nextLocalId = 1; - - private AdbClient(TcpClient tcp) - { - _tcp = tcp; - _stream = tcp.GetStream(); - } - - /// How long to wait for the user to accept the prompt on the TV. - public static async Task ConnectAsync(string host, int port, TimeSpan approvalTimeout, CancellationToken ct) - { - var tcp = new TcpClient { NoDelay = true }; - try - { - using (var connect = CancellationTokenSource.CreateLinkedTokenSource(ct)) - { - connect.CancelAfter(TimeSpan.FromSeconds(3)); - try - { - await tcp.ConnectAsync(host, port, connect.Token); - } - catch (OperationCanceledException) when (!ct.IsCancellationRequested) - { - throw new SocketException((int)SocketError.TimedOut); - } - } - var client = new AdbClient(tcp); - await client.HandshakeAsync(approvalTimeout, ct); - return client; - } - catch - { - tcp.Dispose(); - throw; - } - } - - public async Task ShellAsync(string command, CancellationToken ct) - { - var localId = _nextLocalId++; - uint remoteId = 0; - var output = new AdbShellOutput(); - await SendAsync(AdbProtocol.Open, localId, 0, AdbProtocol.ShellService(command), ct); - - while (true) - { - var message = await ReadAsync(ct); - if (message.Arg1 != localId) continue; - switch (message.Command) - { - case AdbProtocol.Okay: - remoteId = message.Arg0; - break; - case AdbProtocol.Write: - output.Append(message.Data); - await SendAsync(AdbProtocol.Okay, localId, message.Arg0, null, ct); - break; - case AdbProtocol.Close: - if (remoteId != 0) await SendAsync(AdbProtocol.Close, localId, remoteId, null, ct); - return output.ToString(); - } - } - } - - public ValueTask DisposeAsync() - { - _tcp.Dispose(); - return ValueTask.CompletedTask; - } - - private async Task HandshakeAsync(TimeSpan approvalTimeout, CancellationToken ct) - { - using var key = AdbKeyStore.LoadOrCreate(); - await SendAsync(AdbProtocol.Connect, AdbProtocol.Version, AdbProtocol.MaxPayload, AdbProtocol.ConnectBanner(), ct); - - var sentSignature = false; - var sentPublicKey = false; - while (true) - { - // After sending our public key the TV waits for someone to press "Allow". - using var wait = CancellationTokenSource.CreateLinkedTokenSource(ct); - wait.CancelAfter(sentPublicKey ? approvalTimeout : TimeSpan.FromSeconds(5)); - AdbProtocol.Message message; - try - { - message = await ReadAsync(wait.Token); - } - catch (OperationCanceledException) when (!ct.IsCancellationRequested) - { - if (sentPublicKey) throw new TvControlException(LocalizationService.Get("TvAdbNotAllowed")); - throw new IOException("ADB: a TV não respondeu ao handshake"); - } - - switch (message.Command) - { - case AdbProtocol.Connect: - return; - case AdbProtocol.StartTls: - // "Wireless debugging" (Android 11+ pairing) wraps ADB in TLS; the classic - // "ADB debugging"/"network debugging" on port 5555 doesn't. - throw new TvControlException(LocalizationService.Get("TvAdbTlsUnsupported")); - case AdbProtocol.Auth when message.Arg0 == AdbProtocol.AuthToken: - if (!sentSignature) - { - await SendAsync(AdbProtocol.Auth, AdbProtocol.AuthSignature, 0, AdbProtocol.SignToken(key, message.Data), ct); - sentSignature = true; - } - else if (!sentPublicKey) - { - AppLog.Write("TV: chave deste PC ainda não autorizada; aguardando \"Permitir\" na TV"); - var publicKey = AdbProtocol.EncodePublicKey(key.ExportParameters(false), $"ConsoleMode@{Environment.MachineName}"); - await SendAsync(AdbProtocol.Auth, AdbProtocol.AuthRsaPublicKey, 0, publicKey, ct); - sentPublicKey = true; - } - else - { - throw new TvControlException(LocalizationService.Get("TvAdbNotAllowed")); - } - break; - } - } - } - - private async Task SendAsync(uint command, uint arg0, uint arg1, byte[]? data, CancellationToken ct) => - await _stream.WriteAsync(AdbProtocol.Encode(command, arg0, arg1, data), ct); - - private async Task ReadAsync(CancellationToken ct) - { - var header = new byte[AdbProtocol.HeaderSize]; - await _stream.ReadExactlyAsync(header, ct); - var (command, arg0, arg1, length, checksum) = AdbProtocol.DecodeHeader(header); - var data = new byte[length]; - if (length > 0) await _stream.ReadExactlyAsync(data, ct); - AdbProtocol.ValidatePayload(checksum, data); - return new AdbProtocol.Message(command, arg0, arg1, data); - } -} - -/// -/// This PC's ADB key (RSA-2048), kept next to the config so the TV only asks once. -/// The private key is encrypted with DPAPI (see ): the portable -/// data folder travels with the exe, and the key lets whoever has it control the paired TV. -/// -internal static class AdbKeyStore -{ - private static readonly object Gate = new(); - - public static RSA LoadOrCreate() - { - lock (Gate) - { - var path = Path.Combine(AppPaths.DataDir, "adbkey.pem"); - if (File.Exists(path)) - { - var saved = RSA.Create(); - try - { - var stored = File.ReadAllText(path).Trim(); - if (SecretProtector.TryUnprotect(stored, out var pem) && pem.Length > 0) - { - saved.ImportFromPem(pem); - if (saved.KeySize == 2048) - { - // A key written before encryption existed: protect it in place. - if (!SecretProtector.IsProtected(stored)) File.WriteAllText(path, SecretProtector.Protect(pem)); - return saved; - } - } - else - { - // Copied from another Windows user / PC: DPAPI can't open it. A new key just - // means the TV asks "Allow debugging?" once more. - AppLog.Write("TV: chave ADB de outro usuário/PC; criando outra (a TV pedirá permissão de novo)"); - } - } - catch (Exception ex) when (ex is CryptographicException or ArgumentException or IOException) - { - AppLog.Write($"TV: chave ADB ilegível, criando outra: {ex.Message}"); - } - saved.Dispose(); - } - - var created = RSA.Create(2048); - File.WriteAllText(path, SecretProtector.Protect(created.ExportPkcs8PrivateKeyPem())); - AppLog.Write("TV: chave ADB criada"); - return created; - } - } -} diff --git a/src/ConsoleMode/Services/Tv/AdbProtocol.cs b/src/ConsoleMode/Services/Tv/AdbProtocol.cs deleted file mode 100644 index 1b4e8f93..00000000 --- a/src/ConsoleMode/Services/Tv/AdbProtocol.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System.Buffers.Binary; -using System.Numerics; -using System.Security.Cryptography; -using System.Text; - -namespace ConsoleMode.Services.Tv; - -/// -/// The pieces of the ADB wire protocol (the one adb connect speaks to port 5555) that -/// Console Mode needs to send key presses to an Android TV / Google TV, without shipping adb.exe. -/// Pure logic: framing, the auth signature and Android's public key format. -/// -public static class AdbProtocol -{ - public const uint Connect = 0x4e584e43; // CNXN - public const uint Auth = 0x48545541; // AUTH - public const uint Open = 0x4e45504f; // OPEN - public const uint Okay = 0x59414b4f; // OKAY - public const uint Close = 0x45534c43; // CLSE - public const uint Write = 0x45545257; // WRTE - public const uint StartTls = 0x534c5453; // STLS - - public const uint AuthToken = 1; - public const uint AuthSignature = 2; - public const uint AuthRsaPublicKey = 3; - - /// Version with the payload checksum, which every device still accepts. - public const uint Version = 0x01000000; - public const uint MaxPayload = 256 * 1024; - public const int MaxShellOutput = 1024 * 1024; - public const int HeaderSize = 24; - public const int DefaultPort = 5555; - - // android.view.KeyEvent codes. - public const int KeyWakeUp = 224; - public const int KeySleep = 223; - public const int KeyTvInputHdmi1 = 243; - - public readonly record struct Message(uint Command, uint Arg0, uint Arg1, byte[] Data); - - public static byte[] Encode(uint command, uint arg0, uint arg1, byte[]? data = null) - { - data ??= []; - var buffer = new byte[HeaderSize + data.Length]; - var span = buffer.AsSpan(); - BinaryPrimitives.WriteUInt32LittleEndian(span[0..], command); - BinaryPrimitives.WriteUInt32LittleEndian(span[4..], arg0); - BinaryPrimitives.WriteUInt32LittleEndian(span[8..], arg1); - BinaryPrimitives.WriteUInt32LittleEndian(span[12..], (uint)data.Length); - BinaryPrimitives.WriteUInt32LittleEndian(span[16..], Checksum(data)); - BinaryPrimitives.WriteUInt32LittleEndian(span[20..], command ^ 0xFFFFFFFF); - data.CopyTo(buffer, HeaderSize); - return buffer; - } - - /// Reads a header; returns the command, args and payload length. - public static (uint Command, uint Arg0, uint Arg1, int Length, uint Checksum) DecodeHeader(ReadOnlySpan header) - { - if (header.Length < HeaderSize) throw new InvalidDataException("ADB: cabeçalho curto"); - var command = BinaryPrimitives.ReadUInt32LittleEndian(header); - var magic = BinaryPrimitives.ReadUInt32LittleEndian(header[20..]); - if (magic != (command ^ 0xFFFFFFFF)) throw new InvalidDataException("ADB: cabeçalho inválido"); - var length = BinaryPrimitives.ReadUInt32LittleEndian(header[12..]); - if (length > MaxPayload) throw new InvalidDataException("ADB: mensagem grande demais"); - return (command, - BinaryPrimitives.ReadUInt32LittleEndian(header[4..]), - BinaryPrimitives.ReadUInt32LittleEndian(header[8..]), - (int)length, - BinaryPrimitives.ReadUInt32LittleEndian(header[16..])); - } - - public static void ValidatePayload(uint expectedChecksum, ReadOnlySpan data) - { - if (Checksum(data) != expectedChecksum) - throw new InvalidDataException("ADB: checksum do pacote inválido"); - } - - public static uint Checksum(ReadOnlySpan data) - { - uint sum = 0; - foreach (var b in data) sum += b; - return sum; - } - - /// "host::" banner sent with CNXN. - public static byte[] ConnectBanner() => Encoding.ASCII.GetBytes("host::\0"); - - public static byte[] ShellService(string command) => Encoding.UTF8.GetBytes($"shell:{command}\0"); - - /// - /// adb signs the 20-byte token as if it were a SHA-1 digest (RSA_sign with NID_sha1), - /// i.e. PKCS#1 v1.5 over the SHA-1 DigestInfo of the raw token. - /// - public static byte[] SignToken(RSA key, byte[] token) => - key.SignHash(token, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); - - /// - /// Android's RSAPublicKey struct (android_pubkey_encode), base64 encoded, followed by - /// " comment" and a NUL: what the TV shows in "Allow debugging from this computer?". - /// - public static byte[] EncodePublicKey(RSAParameters key, string comment) - { - var modulus = key.Modulus ?? throw new ArgumentException("modulus"); - var exponent = key.Exponent ?? throw new ArgumentException("exponent"); - if (modulus.Length != 256) throw new ArgumentException("ADB keys are RSA-2048"); - - var n = new BigInteger(modulus, isUnsigned: true, isBigEndian: true); - var n0 = BinaryPrimitives.ReadUInt32BigEndian(modulus.AsSpan(modulus.Length - 4)); - // Newton's iteration for the inverse of an odd number mod 2^32. - var inverse = n0; - for (var i = 0; i < 5; i++) inverse = unchecked(inverse * (2 - n0 * inverse)); - var n0Inverse = unchecked(0u - inverse); - var rr = BigInteger.ModPow(2, 2 * 2048, n); - - var buffer = new byte[4 + 4 + 256 + 256 + 4]; - var span = buffer.AsSpan(); - BinaryPrimitives.WriteUInt32LittleEndian(span, 256 / 4); - BinaryPrimitives.WriteUInt32LittleEndian(span[4..], n0Inverse); - WriteLittleEndian(n, span.Slice(8, 256)); - WriteLittleEndian(rr, span.Slice(264, 256)); - uint e = 0; - foreach (var b in exponent) e = (e << 8) | b; - BinaryPrimitives.WriteUInt32LittleEndian(span[520..], e); - - return Encoding.ASCII.GetBytes($"{Convert.ToBase64String(buffer)} {comment}\0"); - } - - /// "host" or "host:port" (default 5555). - public static (string Host, int Port) ParseEndpoint(string value) - { - var text = value.Trim(); - var colon = text.LastIndexOf(':'); - if (colon > 0 && text.IndexOf(':') == colon && int.TryParse(text[(colon + 1)..], out var port) && port is > 0 and < 65536) - return (text[..colon], port); - return (text, DefaultPort); - } - - /// Key code for "HDMI n" (1-4). - public static int HdmiKey(int input) => KeyTvInputHdmi1 + Math.Clamp(input, 1, 4) - 1; - - /// - /// What the TV gets when the desk comes back (issue #209): the user's command first (the TV's Home screen, - /// another HDMI input…), then standby if that is on. Empty when there is nothing to send. - /// - public static IReadOnlyList RestoreCommands(string? restoreCommand, bool standby) - { - var commands = new List(); - if (!string.IsNullOrWhiteSpace(restoreCommand)) commands.Add(restoreCommand.Trim()); - if (standby) commands.Add($"input keyevent {KeySleep}"); - return commands; - } - - private static void WriteLittleEndian(BigInteger value, Span destination) - { - destination.Clear(); - var bytes = value.ToByteArray(isUnsigned: true, isBigEndian: false); - bytes.AsSpan(0, Math.Min(bytes.Length, destination.Length)).CopyTo(destination); - } -} diff --git a/src/ConsoleMode/Services/Tv/AdbShellOutput.cs b/src/ConsoleMode/Services/Tv/AdbShellOutput.cs deleted file mode 100644 index dd94c3a6..00000000 --- a/src/ConsoleMode/Services/Tv/AdbShellOutput.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Text; - -namespace ConsoleMode.Services.Tv; - -/// Accumulates bounded output from a remote ADB shell command. -public sealed class AdbShellOutput -{ - private readonly StringBuilder _text = new(); - private int _bytes; - - public void Append(byte[] data) - { - if (data.Length > AdbProtocol.MaxShellOutput - _bytes) - throw new InvalidDataException("ADB: saída do comando excede o limite de 1 MiB"); - - _bytes += data.Length; - _text.Append(Encoding.UTF8.GetString(data)); - } - - public override string ToString() => _text.ToString(); -} diff --git a/src/ConsoleMode/Services/Tv/AndroidTvController.cs b/src/ConsoleMode/Services/Tv/AndroidTvController.cs deleted file mode 100644 index 471efcae..00000000 --- a/src/ConsoleMode/Services/Tv/AndroidTvController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using ConsoleMode.Models; - -namespace ConsoleMode.Services.Tv; - -/// -/// Android TV / Google TV (TCL, Sony, Hisense, Philips…) over the network with ADB: -/// wake up, then the "HDMI n" key (or a custom command). Needs Developer options → -/// "USB debugging" / "Network debugging" on the TV; nothing to install on the PC. -/// -public sealed class AndroidTvController : ITvController -{ - public async Task TurnOnAsync(TvControlConfig config, TimeSpan approvalTimeout, CancellationToken ct) - { - await using var adb = await ConnectAsync(config, approvalTimeout, wakeOnLan: true, ct); - await adb.ShellAsync($"input keyevent {AdbProtocol.KeyWakeUp}", ct); - // Right after waking, some TVs drop the input key while the launcher loads. - await Task.Delay(1500, ct); - var inputCommand = string.IsNullOrWhiteSpace(config.InputCommand) - ? $"input keyevent {AdbProtocol.HdmiKey(config.HdmiInput)}" - : config.InputCommand.Trim(); - await adb.ShellAsync(inputCommand, ct); - } - - public async Task RestoreAsync(TvControlConfig config, CancellationToken ct) - { - var commands = AdbProtocol.RestoreCommands(config.RestoreCommand, config.TurnOffOnRestore); - if (commands.Count == 0) return; - await using var adb = await ConnectAsync(config, TimeSpan.FromSeconds(5), wakeOnLan: false, ct); - for (var i = 0; i < commands.Count; i++) - { - // A moment between the user's command and standby, or the TV may drop the second while it switches. - if (i > 0) await Task.Delay(1000, ct); - await adb.ShellAsync(commands[i], ct); - } - } - - private static Task ConnectAsync(TvControlConfig config, TimeSpan approvalTimeout, bool wakeOnLan, CancellationToken ct) - { - if (string.IsNullOrWhiteSpace(config.Host)) - throw new TvControlException(LocalizationService.Get("TvHostMissing")); - var (host, port) = AdbProtocol.ParseEndpoint(config.Host); - return TvNetwork.ConnectAsync(config, wakeOnLan, token => AdbClient.ConnectAsync(host, port, approvalTimeout, token), ct); - } -} diff --git a/src/ConsoleMode/Services/Tv/TvControlService.cs b/src/ConsoleMode/Services/Tv/TvControlService.cs deleted file mode 100644 index eab1ed09..00000000 --- a/src/ConsoleMode/Services/Tv/TvControlService.cs +++ /dev/null @@ -1,85 +0,0 @@ -using ConsoleMode.Models; - -namespace ConsoleMode.Services.Tv; - -/// One way of reaching the TV (network API, CEC adapter…). -public interface ITvController -{ - /// Turns the TV on and switches it to the PC's HDMI input. - Task TurnOnAsync(TvControlConfig config, TimeSpan approvalTimeout, CancellationToken ct); - - /// Puts the TV in standby. - Task RestoreAsync(TvControlConfig config, CancellationToken ct); -} - -/// A failure worth showing to the user as is (already localized). -public sealed class TvControlException(string message) : Exception(message); - -/// -/// Turns the TV on / to the PC's input when console mode starts and, optionally, puts it in -/// standby after the restore. A TV that doesn't answer never blocks or breaks console mode: -/// the engine only logs, and its own "wait for the game screen" check does the rest. -/// -public sealed class TvControlService -{ - /// Enough for a TV waking from deep standby (Wake-on-LAN) to answer. - private static readonly TimeSpan StartTimeout = TimeSpan.FromSeconds(30); - private static readonly TimeSpan StopTimeout = TimeSpan.FromSeconds(15); - private static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(90); - - /// Settings → Test: time to press "Allow" on the TV the first time. - public static readonly TimeSpan PairingTimeout = TimeSpan.FromSeconds(60); - - public static ITvController? Create(string provider) => provider switch - { - TvControlConfig.AndroidTv => new AndroidTvController(), - _ => null - }; - - /// Settings → Test. Throws with a message for the user. - public async Task TestAsync(TvControlConfig config, CancellationToken ct) - { - var controller = Create(config.Provider) ?? throw new TvControlException(LocalizationService.Get("TvNotConfigured")); - AppLog.Write($"TV: teste ({config.Provider})"); - using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct); - timeoutCts.CancelAfter(TestTimeout); - try - { - await controller.TurnOnAsync(config, PairingTimeout, timeoutCts.Token); - } - catch (OperationCanceledException) when (!ct.IsCancellationRequested) - { - throw new TvControlException(LocalizationService.Get("TvTestTimedOut")); - } - } - - /// Called by the engine on its worker thread; never throws. - public void TurnOn(TvControlConfig config) => - Run(config, "ligar", StartTimeout, (c, tv, ct) => c.TurnOnAsync(tv, TimeSpan.FromSeconds(10), ct)); - - /// Called by the engine after the restore (the user's command, then standby if on); never throws. - public void Restore(TvControlConfig config) => - Run(config, "voltar ao PC", StopTimeout, (c, tv, ct) => c.RestoreAsync(tv, ct)); - - private static void Run(TvControlConfig config, string action, TimeSpan timeout, - Func work) - { - var controller = Create(config.Provider); - if (controller is null) return; - var started = DateTime.UtcNow; - try - { - using var cts = new CancellationTokenSource(timeout); - Task.Run(() => work(controller, config, cts.Token), cts.Token).GetAwaiter().GetResult(); - AppLog.Write($"TV: {action} ({config.Provider}) ok em {(DateTime.UtcNow - started).TotalSeconds:0.0}s"); - } - catch (OperationCanceledException) - { - AppLog.Write($"TV: {action} ({config.Provider}) sem resposta em {timeout.TotalSeconds:0}s"); - } - catch (Exception ex) - { - AppLog.Write($"TV: {action} ({config.Provider}) falhou: {ex.Message}"); - } - } -} diff --git a/src/ConsoleMode/Services/Tv/TvNetwork.cs b/src/ConsoleMode/Services/Tv/TvNetwork.cs deleted file mode 100644 index 42fea230..00000000 --- a/src/ConsoleMode/Services/Tv/TvNetwork.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Net.Sockets; -using ConsoleMode.Models; - -namespace ConsoleMode.Services.Tv; - -/// Connecting to a TV on the network, waking it with Wake-on-LAN when it's in deep standby. -public static class TvNetwork -{ - /// A TV woken by Wake-on-LAN takes a while to bring its network (and services) up. - private static readonly TimeSpan WakeWait = TimeSpan.FromSeconds(20); - - /// One connection attempt; throws a network error when nobody answers. - /// Send the magic packet (when a MAC is set) if the first attempt fails. - public static async Task ConnectAsync(TvControlConfig config, bool wakeOnLan, - Func> connect, CancellationToken ct) - { - try - { - return await connect(ct); - } - catch (Exception ex) when (IsUnreachable(ex) && wakeOnLan && WakeOnLan.TryParseMac(config.MacAddress, out var mac)) - { - // Deep standby: no network until the magic packet wakes the TV. - AppLog.Write($"TV: {config.Host} sem resposta; enviando Wake-on-LAN"); - await WakeOnLan.SendAsync(mac, ct); - } - catch (Exception ex) when (IsUnreachable(ex)) - { - throw Unreachable(config); - } - - var deadline = DateTime.UtcNow + WakeWait; - while (true) - { - await Task.Delay(2000, ct); - try - { - return await connect(ct); - } - catch (Exception ex) when (IsUnreachable(ex) && DateTime.UtcNow < deadline) - { - // Still booting; try again. - } - catch (Exception ex) when (IsUnreachable(ex)) - { - throw Unreachable(config); - } - } - } - - /// Nothing listening, no route, connect timeout or a TV that hung up mid-handshake. - public static bool IsUnreachable(Exception ex) => ex is SocketException or IOException; - - private static TvControlException Unreachable(TvControlConfig config) => - new(LocalizationService.Get("TvUnreachable", config.Host)); -} diff --git a/src/ConsoleMode/Services/Tv/WakeOnLan.cs b/src/ConsoleMode/Services/Tv/WakeOnLan.cs deleted file mode 100644 index 0a6857a6..00000000 --- a/src/ConsoleMode/Services/Tv/WakeOnLan.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Globalization; -using System.Net; -using System.Net.Sockets; - -namespace ConsoleMode.Services.Tv; - -/// Wake-on-LAN "magic packet": 6 × 0xFF followed by the MAC address 16 times. -public static class WakeOnLan -{ - /// Accepts AA:BB:CC:DD:EE:FF, AA-BB-CC-DD-EE-FF or AABBCCDDEEFF. - public static bool TryParseMac(string? text, out byte[] mac) - { - mac = []; - if (string.IsNullOrWhiteSpace(text)) return false; - var hex = text.Trim().Replace(":", "").Replace("-", "").Replace(".", ""); - if (hex.Length != 12) return false; - - var bytes = new byte[6]; - for (var i = 0; i < 6; i++) - { - if (!byte.TryParse(hex.AsSpan(i * 2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out bytes[i])) - return false; - } - mac = bytes; - return true; - } - - public static byte[] BuildPacket(byte[] mac) - { - if (mac.Length != 6) throw new ArgumentException("MAC must have 6 bytes", nameof(mac)); - var packet = new byte[6 + 16 * 6]; - Array.Fill(packet, (byte)0xFF, 0, 6); - for (var i = 0; i < 16; i++) mac.CopyTo(packet, 6 + i * 6); - return packet; - } - - /// Broadcasts the packet on the usual ports (9 and 7); a few sends in case one is lost. - public static async Task SendAsync(byte[] mac, CancellationToken ct) - { - var packet = BuildPacket(mac); - using var udp = new UdpClient { EnableBroadcast = true }; - for (var attempt = 0; attempt < 3; attempt++) - { - foreach (var port in new[] { 9, 7 }) - await udp.SendAsync(packet, new IPEndPoint(IPAddress.Broadcast, port), ct); - await Task.Delay(100, ct); - } - } -} diff --git a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs index 6db7d18c..dfd09159 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.ConsoleUi.cs @@ -184,7 +184,6 @@ private void CycleSetting(string spec) case "desktopicons": RestoreDesktopIcons = !RestoreDesktopIcons; break; case "hidedesktopicons": HideDesktopIcons = !HideDesktopIcons; break; case "parkpointer": ParkPointer = !ParkPointer; break; - case "tvpower": TvTurnOffOnRestore = !TvTurnOffOnRestore; break; // The FPS counter (RTSS): what it shows, one item at a time. case "overlaycard": OverlayCard = !OverlayCard; break; case "overlayline": OverlaySingleLine = !OverlaySingleLine; break; @@ -251,9 +250,7 @@ private void OpenPicker(string key) "hide" => (LocalizationService.Get("HideOtherScreensCard"), HideStrategies.Select(o => (o.Text, o.Value)), SelectedHideStrategy?.Value), "language" => (LocalizationService.Get("LanguageCard"), LanguageOptions.Select(o => (o.Text, o.Value)), SelectedLanguage?.Value), "controllerlayout" => (LocalizationService.Get("ControllerLayoutCard"), ControllerLayoutOptions.Select(o => (o.Text, o.Value)), SelectedControllerLayout?.Value), - "tvprovider" => (LocalizationService.Get("TvControlCard"), TvProviders.Select(o => (o.Text, o.Value)), SelectedTvProvider?.Value), "introstyle" => (LocalizationService.Get("IntroStyleCard"), IntroStyleOptions.Select(o => (o.Text, o.Value)), SelectedIntroStyle?.Value), - "tvhdmi" => (LocalizationService.Get("TvHdmiCard"), TvHdmiInputs.Select(o => (o.Text, o.Value)), SelectedTvHdmiInput?.Value), "overlay" => (LocalizationService.Get("FpsOverlayCard"), FpsOverlayOptions.Select(o => (o.Text, o.Value)), SelectedFpsOverlay?.Value), "overlaysize" => (LocalizationService.Get("FpsOverlaySize"), FpsOverlaySizeOptions.Select(o => (o.Text, o.Value)), SelectedFpsOverlaySize?.Value), "overlayposition" => (LocalizationService.Get("FpsOverlayPosition"), FpsOverlayPositionOptions.Select(o => (o.Text, o.Value)), SelectedFpsOverlayPosition?.Value), @@ -286,9 +283,7 @@ private void PickOption(PickerItem? item) case "hide": SelectedHideStrategy = HideStrategies.FirstOrDefault(o => o.Value == item.Value) ?? SelectedHideStrategy; break; case "language": SelectedLanguage = LanguageOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedLanguage; break; case "controllerlayout": SelectedControllerLayout = ControllerLayoutOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedControllerLayout; break; - case "tvprovider": SelectedTvProvider = TvProviders.FirstOrDefault(o => o.Value == item.Value) ?? SelectedTvProvider; break; case "introstyle": ChooseIntroStyle(item.Value); break; - case "tvhdmi": SelectedTvHdmiInput = TvHdmiInputs.FirstOrDefault(o => o.Value == item.Value) ?? SelectedTvHdmiInput; break; case "overlay": SelectedFpsOverlay = FpsOverlayOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlay; break; case "overlaysize": SelectedFpsOverlaySize = FpsOverlaySizeOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlaySize; break; case "overlayposition": SelectedFpsOverlayPosition = FpsOverlayPositionOptions.FirstOrDefault(o => o.Value == item.Value) ?? SelectedFpsOverlayPosition; break; diff --git a/src/ConsoleMode/ViewModels/MainViewModel.Tv.cs b/src/ConsoleMode/ViewModels/MainViewModel.Tv.cs deleted file mode 100644 index a37a51b0..00000000 --- a/src/ConsoleMode/ViewModels/MainViewModel.Tv.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System.Collections.ObjectModel; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using ConsoleMode.Models; -using ConsoleMode.Services; -using ConsoleMode.Services.Tv; -using Microsoft.UI.Xaml.Controls; - -namespace ConsoleMode.ViewModels; - -// Settings → TV: turn the TV on and switch it to the PC's input (issue #75). -public partial class MainViewModel -{ - public ObservableCollection TvProviders { get; } = []; - public ObservableCollection TvHdmiInputs { get; } = []; - - [ObservableProperty] private ComboOption? _selectedTvProvider; - [ObservableProperty] private ComboOption? _selectedTvHdmiInput; - [ObservableProperty] private string _tvHost = ""; - [ObservableProperty] private string _tvMacAddress = ""; - [ObservableProperty] private string _tvInputCommand = ""; - [ObservableProperty] private bool _tvTurnOffOnRestore; - [ObservableProperty] private string _tvRestoreCommand = ""; - [ObservableProperty] private bool _isTestingTv; - - private string TvProvider => SelectedTvProvider?.Value ?? TvControlConfig.None; - - public bool IsTvEnabled => TvProvider != TvControlConfig.None; - public bool IsTvAndroid => TvProvider == TvControlConfig.AndroidTv; - public bool UsesTvHost => IsTvAndroid; - public bool UsesTvHdmiInput => IsTvAndroid; - - public string TvProviderDescription => LocalizationService.Get(TvProvider switch - { - TvControlConfig.AndroidTv => "TvAndroidDescription", - _ => "TvNoneDescription" - }); - - partial void OnSelectedTvProviderChanged(ComboOption? value) - { - OnPropertyChanged(nameof(IsTvEnabled)); - OnPropertyChanged(nameof(IsTvAndroid)); - OnPropertyChanged(nameof(UsesTvHost)); - OnPropertyChanged(nameof(UsesTvHdmiInput)); - OnPropertyChanged(nameof(TvProviderDescription)); - SaveQuietly(); - } - - partial void OnSelectedTvHdmiInputChanged(ComboOption? value) => SaveQuietly(); - partial void OnTvHostChanged(string value) => SaveQuietly(); - partial void OnTvMacAddressChanged(string value) => SaveQuietly(); - partial void OnTvInputCommandChanged(string value) => SaveQuietly(); - partial void OnTvTurnOffOnRestoreChanged(bool value) => SaveQuietly(); - partial void OnTvRestoreCommandChanged(string value) => SaveQuietly(); - - /// Part of : the names follow the interface language. - private void BuildTvOptions() - { - var provider = SelectedTvProvider?.Value ?? _loadedConfig.Tv?.Provider ?? TvControlConfig.None; - var hdmi = SelectedTvHdmiInput?.Value ?? (_loadedConfig.Tv?.HdmiInput ?? 1).ToString(); - - TvProviders.Clear(); - TvProviders.Add(new ComboOption { Text = LocalizationService.Get("TvProviderNone"), Value = TvControlConfig.None }); - TvProviders.Add(new ComboOption { Text = LocalizationService.Get("TvProviderAndroid"), Value = TvControlConfig.AndroidTv }); - SelectedTvProvider = TvProviders.FirstOrDefault(o => o.Value == provider) ?? TvProviders[0]; - - TvHdmiInputs.Clear(); - for (var i = 1; i <= 4; i++) - TvHdmiInputs.Add(new ComboOption { Text = $"HDMI {i}", Value = i.ToString() }); - SelectedTvHdmiInput = TvHdmiInputs.FirstOrDefault(o => o.Value == hdmi) ?? TvHdmiInputs[0]; - } - - private void ApplyTv(TvControlConfig? tv) - { - tv ??= new TvControlConfig(); - SelectedTvProvider = TvProviders.FirstOrDefault(o => o.Value == tv.Provider) ?? TvProviders.FirstOrDefault(); - SelectedTvHdmiInput = TvHdmiInputs.FirstOrDefault(o => o.Value == tv.HdmiInput.ToString()) ?? TvHdmiInputs.FirstOrDefault(); - TvHost = tv.Host ?? ""; - TvMacAddress = tv.MacAddress ?? ""; - TvInputCommand = tv.InputCommand ?? ""; - TvTurnOffOnRestore = tv.TurnOffOnRestore; - TvRestoreCommand = tv.RestoreCommand ?? ""; - } - - private TvControlConfig BuildTvConfig() => new() - { - Provider = TvProvider, - Host = TvHost.Trim(), - MacAddress = TvMacAddress.Trim(), - HdmiInput = int.TryParse(SelectedTvHdmiInput?.Value, out var hdmi) ? hdmi : 1, - InputCommand = TvInputCommand.Trim(), - TurnOffOnRestore = TvTurnOffOnRestore, - RestoreCommand = TvRestoreCommand.Trim() - }; - - /// Turns the TV on and switches the input now; the first time, pairs with the TV. - [RelayCommand] - private async Task TestTvAsync() - { - if (IsTestingTv) return; - IsTestingTv = true; - SetStatus(LocalizationService.Get("TvTesting"), InfoBarSeverity.Informational); - try - { - var config = BuildTvConfig(); - await Task.Run(() => Engine.Tv.TestAsync(config, CancellationToken.None)); - SetStatus(LocalizationService.Get("TvTestSuccess"), InfoBarSeverity.Success); - } - catch (TvControlException ex) - { - AppLog.Write($"TV: teste falhou: {ex.Message}"); - SetStatus(ex.Message, InfoBarSeverity.Warning); - } - catch (Exception ex) - { - AppLog.Write($"TV: teste falhou: {ex}"); - SetStatus(LocalizationService.Get("TvTestFailure", ex.Message), InfoBarSeverity.Error); - } - finally - { - IsTestingTv = false; - } - } -} diff --git a/src/ConsoleMode/ViewModels/MainViewModel.cs b/src/ConsoleMode/ViewModels/MainViewModel.cs index 2bb837f7..7af860bb 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.cs @@ -198,7 +198,6 @@ private void BuildLocalizedOptions() BuildAudioOptions(audioValue); BuildControllerLayoutOptions(); BuildIntroStyleOptions(); - BuildTvOptions(); FpsStatusText = LocalizationService.Get(IsFpsAvailable ? "FpsAvailable" : "FpsUnavailable"); } finally @@ -336,7 +335,6 @@ private void Apply(LoadResult data) IsPlayniteAvailable = Engine.Launch.IsPlayniteAvailable(); BuildLocalizedOptions(); SelectedLaunch = LaunchOptions.FirstOrDefault(o => o.Value == LaunchValueOf(config)) ?? LaunchOptions[0]; - ApplyTv(config.Tv); HdrEnable = config.HdrEnable; VrrEnable = config.VrrEnable; CheckUpdates = config.CheckUpdates; @@ -927,8 +925,7 @@ private AppConfig BuildConfig() ParkPointer = ParkPointer, GameProfiles = [.. _gameProfiles], ControllerLayout = SelectedControllerLayout?.Value ?? _loadedConfig.ControllerLayout, - SkippedUpdateVersion = _loadedConfig.SkippedUpdateVersion, - Tv = BuildTvConfig() + SkippedUpdateVersion = _loadedConfig.SkippedUpdateVersion }; if (Monitors.Count == 0) return config; diff --git a/src/ConsoleMode/Views/ConsoleHomeView.xaml b/src/ConsoleMode/Views/ConsoleHomeView.xaml index e2117e39..331bc042 100644 --- a/src/ConsoleMode/Views/ConsoleHomeView.xaml +++ b/src/ConsoleMode/Views/ConsoleHomeView.xaml @@ -537,7 +537,7 @@ - @@ -547,7 +547,7 @@ - @@ -557,7 +557,7 @@ - @@ -567,18 +567,8 @@ - - - - @@ -742,34 +732,6 @@ - - - - - - - - - - - - + - + @@ -991,7 +953,7 @@ - + - - - - - - - - @@ -658,13 +641,6 @@ - - - - - - - - - - - - - - - - - - - - - -public sealed class ControlPipeService : IDisposable -{ - public const string PipeName = "ConsoleMode.Control"; - - private readonly MainViewModel _vm; - private readonly DispatcherQueue _dispatcher; - private readonly Action _requestStart; - private readonly Action _requestStop; - private readonly Action _requestShow; - private readonly CancellationTokenSource _cts = new(); - - public ControlPipeService(MainViewModel vm, DispatcherQueue dispatcher, Action requestStart, Action requestStop, Action requestShow) - { - _vm = vm; - _dispatcher = dispatcher; - _requestStart = requestStart; - _requestStop = requestStop; - _requestShow = requestShow; - _ = Task.Run(ListenAsync); - } - - public void Dispose() => _cts.Cancel(); - - private async Task ListenAsync() - { - while (!_cts.IsCancellationRequested) - { - NamedPipeServerStream? pipe = null; - try - { - pipe = CreatePipe(); - await pipe.WaitForConnectionAsync(_cts.Token); - var client = pipe; - pipe = null; - _ = Task.Run(() => HandleAsync(client)); - } - catch (OperationCanceledException) - { - break; - } - catch (Exception ex) - { - AppLog.Write($"Controle: {ex.Message}"); - try { await Task.Delay(2000, _cts.Token); } - catch (OperationCanceledException) { break; } - } - finally - { - pipe?.Dispose(); - } - } - } - - private static NamedPipeServerStream CreatePipe() - { - var security = new PipeSecurity(); - var user = WindowsIdentity.GetCurrent().User ?? throw new InvalidOperationException("no user SID"); - security.AddAccessRule(new PipeAccessRule(user, PipeAccessRights.ReadWrite | PipeAccessRights.CreateNewInstance, AccessControlType.Allow)); - security.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null), PipeAccessRights.ReadWrite, AccessControlType.Allow)); - return NamedPipeServerStreamAcl.Create(PipeName, PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, - PipeTransmissionMode.Byte, PipeOptions.Asynchronous, 0, 0, security); - } - - private async Task HandleAsync(NamedPipeServerStream pipe) - { - await using (pipe) - { - try - { - using var timeout = CancellationTokenSource.CreateLinkedTokenSource(_cts.Token); - timeout.CancelAfter(TimeSpan.FromSeconds(90)); - using var reader = new StreamReader(pipe, new UTF8Encoding(false), false, 1024, leaveOpen: true); - var line = await reader.ReadLineAsync(timeout.Token); - var reply = await ExecuteAsync(ControlProtocol.ParseCommand(line), timeout.Token); - await pipe.WriteAsync(Encoding.UTF8.GetBytes(reply + "\n"), timeout.Token); - await pipe.FlushAsync(timeout.Token); - } - catch (Exception ex) - { - AppLog.Write($"Controle: {ex.Message}"); - } - } - } - - private async Task ExecuteAsync(string cmd, CancellationToken token) - { - if (cmd != ControlProtocol.Status) AppLog.Write($"Controle: {cmd}"); - switch (cmd) - { - case ControlProtocol.Status: - return await ReplyAsync(true); - case ControlProtocol.Start: - _requestStart(); - // starting can ask "can you see this screen?" on a new TV: give it time - var started = await WaitForAsync(s => s.Active, TimeSpan.FromSeconds(60), token); - return await ReplyAsync(started, started ? null : "console mode did not start"); - case ControlProtocol.Stop: - if (!(await SnapshotAsync()).Active) return await ReplyAsync(true); - _requestStop(); - var stopped = await WaitForAsync(s => !s.Active && !s.Restoring, TimeSpan.FromSeconds(60), token); - return await ReplyAsync(stopped, stopped ? null : "restore did not finish"); - case ControlProtocol.Show: - _requestShow(); - return await ReplyAsync(true); - default: - return await ReplyAsync(false, "unknown command"); - } - } - - private readonly record struct Snapshot(bool Active, bool Restoring, string Mode); - - // the view model belongs to the UI thread - private Task SnapshotAsync() - { - var done = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var queued = _dispatcher.TryEnqueue(() => - { - try - { - var mode = _vm.IsConsoleActive ? _vm.Engine.State.FullscreenMode : ConfigService.Load().FullscreenMode; - done.SetResult(new Snapshot(_vm.IsConsoleActive, _vm.IsRestoring, mode)); - } - catch (Exception ex) - { - done.SetException(ex); - } - }); - if (!queued) done.SetException(new InvalidOperationException("dispatcher unavailable")); - return done.Task; - } - - private async Task WaitForAsync(Func condition, TimeSpan limit, CancellationToken token) - { - var deadline = DateTime.UtcNow + limit; - await Task.Delay(300, token); - while (DateTime.UtcNow < deadline) - { - if (condition(await SnapshotAsync())) return true; - await Task.Delay(500, token); - } - return condition(await SnapshotAsync()); - } - - private async Task ReplyAsync(bool ok, string? error = null) - { - var s = await SnapshotAsync(); - var version = UpdateService.CurrentVersion; - return ControlProtocol.Reply(ok, error, s.Active, s.Restoring, s.Mode, version); - } -} diff --git a/src/ConsoleMode/Services/ControlProtocol.cs b/src/ConsoleMode/Services/ControlProtocol.cs deleted file mode 100644 index bb39af08..00000000 --- a/src/ConsoleMode/Services/ControlProtocol.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System.Text; -using System.Text.Json; - -namespace ConsoleMode.Services; - -/// -/// Wire format of the local control API (): one JSON line in, -/// one JSON line out. Kept free of app state so it can be unit-tested. -/// -/// → {"cmd":"status"} // or "start", "stop", "show" -/// ← {"ok":true,"active":true,"restoring":false,"mode":"xboxMode","version":"1.5.0"} -/// -/// -public static class ControlProtocol -{ - public const string Status = "status"; - public const string Start = ProtocolService.StartAction; - public const string Stop = ProtocolService.StopAction; - public const string Show = ProtocolService.ShowAction; - - /// The command of a request line, lower-cased; "" when the line isn't one. - public static string ParseCommand(string? line) - { - if (string.IsNullOrWhiteSpace(line)) return ""; - try - { - using var doc = JsonDocument.Parse(line); - if (doc.RootElement.ValueKind != JsonValueKind.Object || - !doc.RootElement.TryGetProperty("cmd", out var cmd) || - cmd.ValueKind != JsonValueKind.String) - return ""; - var value = (cmd.GetString() ?? "").Trim().ToLowerInvariant(); - return value is Status or Start or Stop or Show ? value : ""; - } - catch (JsonException) - { - return ""; - } - } - - public static string Reply(bool ok, string? error, bool active, bool restoring, string mode, string version) - { - using var buffer = new MemoryStream(); - using (var json = new Utf8JsonWriter(buffer)) - { - json.WriteStartObject(); - json.WriteBoolean("ok", ok); - if (error is not null) json.WriteString("error", error); - json.WriteBoolean("active", active); - json.WriteBoolean("restoring", restoring); - json.WriteString("mode", mode); - json.WriteString("version", version); - json.WriteEndObject(); - } - return Encoding.UTF8.GetString(buffer.ToArray()); - } -} diff --git a/src/ConsoleMode/Services/DisplayBackend.cs b/src/ConsoleMode/Services/DisplayBackend.cs index 46e80069..3540570b 100644 --- a/src/ConsoleMode/Services/DisplayBackend.cs +++ b/src/ConsoleMode/Services/DisplayBackend.cs @@ -5,7 +5,7 @@ namespace ConsoleMode.Services; /// -/// Single display commands through Windows' own APIs: CCD, ChangeDisplaySettingsEx and DDC/CI +/// Single display commands through Windows' own APIs: CCD, ChangeDisplaySettingsEx /// (issue #91). keeps the orchestration (retries, waits, fallbacks). /// internal sealed class DisplayBackend @@ -115,8 +115,6 @@ public Dictionary> ResolveLayout(Dictionary names) => NativeDisplays.Disable(names); public void SetPrimary(string name) => CcdHelper.SetPrimary(name); public int SetPositions(IReadOnlyDictionary positions) => CcdHelper.SetPositions(positions); - public void PowerOn(string name) => NativeDisplays.SetPower(name, on: true); - public void PowerOff(string name) => NativeDisplays.SetPower(name, on: false); public void SetMode(string name, int width, int height, int frequency, string? colors, int? x, int? y, bool primary) { diff --git a/src/ConsoleMode/Services/LocalizationService.cs b/src/ConsoleMode/Services/LocalizationService.cs index 09e4494d..2fda0b1c 100644 --- a/src/ConsoleMode/Services/LocalizationService.cs +++ b/src/ConsoleMode/Services/LocalizationService.cs @@ -10,11 +10,7 @@ public static class LocalizationService { public const string PortugueseBrazil = "pt-BR"; public const string EnglishUnitedStates = "en-US"; - public const string SpanishSpain = "es-ES"; - public const string GermanGermany = "de-DE"; - public const string FrenchFrance = "fr-FR"; public const string ItalianItaly = "it-IT"; - public const string RussianRussia = "ru-RU"; /// A UI language: its culture code and how it names itself in the language picker. public sealed record LanguageInfo(string Code, string NativeName); @@ -28,11 +24,7 @@ public sealed record LanguageInfo(string Code, string NativeName); [ new(PortugueseBrazil, "Português (Brasil)"), new(EnglishUnitedStates, "English (United States)"), - new(SpanishSpain, "Español"), - new(GermanGermany, "Deutsch"), - new(FrenchFrance, "Français"), - new(ItalianItaly, "Italiano"), - new(RussianRussia, "Русский") + new(ItalianItaly, "Italiano") ]; private static readonly IReadOnlyDictionary> Catalogs = diff --git a/src/ConsoleMode/Services/MonitorService.cs b/src/ConsoleMode/Services/MonitorService.cs index f3257682..8e2591c0 100644 --- a/src/ConsoleMode/Services/MonitorService.cs +++ b/src/ConsoleMode/Services/MonitorService.cs @@ -116,13 +116,6 @@ public RestoreResult RestoreBackup(ConsoleRuntimeState state) AppLog.Write($"Restore: telas com outro nome desde o backup: {string.Join(", ", moved.Select(kv => $"{kv.Key} → {kv.Value}"))}"); AppLog.Write($"Restore: iniciando (primário={ctx.OriginalPrimary}, foco={ctx.FocusMonitor}, focoInativo={ctx.FocusWasInactive}, esconder={string.Join('+', ctx.HideMonitors)})"); - if (ctx.HideStrategy == "turnOff" && ctx.HideMonitors.Count > 0) - { - foreach (var name in ctx.HideMonitors.Distinct()) - _backend.PowerOn(name); - Thread.Sleep(300); - } - // Screens that were on before the session come back; the ones that were off (the TV, usually) stay off. var monitorsToVerify = backupSpecs .Where(kv => IsBackupSpecActive(kv.Value)) @@ -292,7 +285,6 @@ public void EnableMonitors(IReadOnlyList names, bool windowsEnable) foreach (var name in names) { - _backend.PowerOn(name); _backend.Enable([name]); } MarkActive(names); @@ -319,12 +311,6 @@ public void DisableWindows(IReadOnlyList names) _backend.Disable(names); } - public void DisableDdc(IReadOnlyList names) - { - foreach (var name in names) - _backend.PowerOff(name); - } - public void ApplyFocusMode(string focusMonitor, SavedDisplayMode mode) { var monitors = GetMonitors(true); diff --git a/src/ConsoleMode/Services/ProtocolService.cs b/src/ConsoleMode/Services/ProtocolService.cs deleted file mode 100644 index be2ecc0c..00000000 --- a/src/ConsoleMode/Services/ProtocolService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.Win32; - -namespace ConsoleMode.Services; - -/// -/// consolemode:// links (consolemode://start, consolemode://stop, consolemode://show) so -/// shortcuts, Stream Deck buttons, launchers and future widgets can drive the app. -/// Windows hands the URI to the exe as its first argument; the running instance is then -/// signalled the same way "--start" is. Registered per user, like StartupService. -/// -public static class ProtocolService -{ - public const string Scheme = "consolemode"; - public const string StartAction = "start"; - public const string StopAction = "stop"; - public const string ShowAction = "show"; - /// Opens the session menu (Stream Deck etc.); ignored when no session is running. - public const string MenuAction = "menu"; - - private const string ClassKey = @"Software\Classes\" + Scheme; - - /// The action named by a consolemode:// argument, or null when it isn't one. - public static string? ParseAction(string? argument) - { - if (string.IsNullOrWhiteSpace(argument) || - !argument.StartsWith(Scheme + ":", StringComparison.OrdinalIgnoreCase)) - return null; - - // "consolemode://start/", "consolemode:start" and "consolemode://START?x=1" all mean start. - var rest = argument[(Scheme.Length + 1)..].TrimStart('/'); - var end = rest.IndexOfAny(['/', '?', '#']); - var action = (end < 0 ? rest : rest[..end]).Trim().ToLowerInvariant(); - return action is StartAction or StopAction or ShowAction or MenuAction ? action : null; - } - - /// Points the scheme at this exe; a no-op when it already does (portable moves included). - public static void EnsureRegistered() - { - try - { - var exe = Environment.ProcessPath; - if (string.IsNullOrEmpty(exe)) return; - var command = $"\"{exe}\" \"%1\""; - - using var existing = Registry.CurrentUser.OpenSubKey(ClassKey + @"\shell\open\command"); - if (existing?.GetValue(null) is string current && string.Equals(current, command, StringComparison.OrdinalIgnoreCase)) - return; - - using var key = Registry.CurrentUser.CreateSubKey(ClassKey, writable: true); - key.SetValue(null, "URL:Console Mode"); - key.SetValue("URL Protocol", ""); - using (var icon = key.CreateSubKey("DefaultIcon")) icon.SetValue(null, $"\"{exe}\",0"); - using (var open = key.CreateSubKey(@"shell\open\command")) open.SetValue(null, command); - AppLog.Write($"Protocolo: {Scheme}:// registrado para {exe}"); - } - catch (Exception ex) - { - AppLog.Write($"Protocolo: não foi possível registrar {Scheme}://: {ex.Message}"); - } - } -} diff --git a/src/ConsoleMode/ViewModels/MainViewModel.cs b/src/ConsoleMode/ViewModels/MainViewModel.cs index e26aea29..64c7ae08 100644 --- a/src/ConsoleMode/ViewModels/MainViewModel.cs +++ b/src/ConsoleMode/ViewModels/MainViewModel.cs @@ -165,7 +165,6 @@ private void BuildLocalizedOptions() HideStrategies.Clear(); HideStrategies.Add(new ComboOption { Text = LocalizationService.Get("StrategyDisconnect"), Value = "disconnect" }); HideStrategies.Add(new ComboOption { Text = LocalizationService.Get("StrategyBlack"), Value = "blackCurtain" }); - HideStrategies.Add(new ComboOption { Text = LocalizationService.Get("StrategyTurnOff"), Value = "turnOff" }); SelectedHideStrategy = HideStrategies.FirstOrDefault(x => x.Value == hideValue) ?? HideStrategies[0]; RebuildLaunchOptions(launchValue); diff --git a/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj b/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj index 944d366e..bcd8399c 100644 --- a/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj +++ b/tests/ConsoleMode.Tests/ConsoleMode.Tests.csproj @@ -23,8 +23,6 @@ - - @@ -61,11 +59,7 @@ - - - - diff --git a/tests/ConsoleMode.Tests/ControlProtocolTests.cs b/tests/ConsoleMode.Tests/ControlProtocolTests.cs deleted file mode 100644 index d9107cba..00000000 --- a/tests/ConsoleMode.Tests/ControlProtocolTests.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Text.Json; -using ConsoleMode.Services; - -namespace ConsoleMode.Tests; - -public class ControlProtocolTests -{ - [Theory] - [InlineData("{\"cmd\":\"status\"}", "status")] - [InlineData("{\"cmd\":\"start\"}", "start")] - [InlineData("{\"cmd\":\" STOP \"}", "stop")] - [InlineData("{\"cmd\":\"show\",\"from\":\"wakeon\"}", "show")] - public void ParseCommand_ReadsKnownCommands(string line, string expected) => - Assert.Equal(expected, ControlProtocol.ParseCommand(line)); - - [Theory] - [InlineData("{\"cmd\":\"reboot\"}")] - [InlineData("{\"cmd\":1}")] - [InlineData("[\"start\"]")] - [InlineData("start")] - [InlineData("{")] - [InlineData("")] - [InlineData(null)] - public void ParseCommand_RejectsAnythingElse(string? line) => - Assert.Equal("", ControlProtocol.ParseCommand(line)); - - [Fact] - public void Reply_IsOneJsonObjectWithTheState() - { - var line = ControlProtocol.Reply(false, "restore did not finish", true, false, "xboxMode", "1.5.0"); - Assert.DoesNotContain('\n', line); - using var doc = JsonDocument.Parse(line); - var r = doc.RootElement; - Assert.False(r.GetProperty("ok").GetBoolean()); - Assert.Equal("restore did not finish", r.GetProperty("error").GetString()); - Assert.True(r.GetProperty("active").GetBoolean()); - Assert.False(r.GetProperty("restoring").GetBoolean()); - Assert.Equal("xboxMode", r.GetProperty("mode").GetString()); - Assert.Equal("1.5.0", r.GetProperty("version").GetString()); - } - - [Fact] - public void Reply_OmitsErrorWhenOk() - { - using var doc = JsonDocument.Parse(ControlProtocol.Reply(true, null, false, false, "bigPicture", "1.5.0")); - Assert.False(doc.RootElement.TryGetProperty("error", out _)); - } -} diff --git a/tests/ConsoleMode.Tests/LocalizationTests.cs b/tests/ConsoleMode.Tests/LocalizationTests.cs index 299c171b..54b2aaa1 100644 --- a/tests/ConsoleMode.Tests/LocalizationTests.cs +++ b/tests/ConsoleMode.Tests/LocalizationTests.cs @@ -41,12 +41,9 @@ public void Embedded_catalogs_support_en_us_and_pt_br_with_matching_keys() // Unknown languages read English; a known language in another region maps to its catalog. LocalizationService.SetLanguage("ja-JP"); Assert.Equal(LocalizationService.EnglishUnitedStates, LocalizationService.Language); - LocalizationService.SetLanguage("es-MX"); - Assert.Equal(LocalizationService.SpanishSpain, LocalizationService.Language); - Assert.Equal("Elige la pantalla en la que quieres jugar.", LocalizationService.Get("ChooseGameScreen")); - LocalizationService.SetLanguage("de-AT"); - Assert.Equal(LocalizationService.GermanGermany, LocalizationService.Language); - Assert.Equal("Wähle den Bildschirm aus, auf dem du spielen möchtest.", LocalizationService.Get("ChooseGameScreen")); + LocalizationService.SetLanguage("it-CH"); + Assert.Equal(LocalizationService.ItalianItaly, LocalizationService.Language); + Assert.Equal("Scegli lo schermo su cui vuoi giocare.", LocalizationService.Get("ChooseGameScreen")); LocalizationService.SetLanguage(LocalizationService.PortugueseBrazil); } @@ -165,12 +162,8 @@ public void App_language_config_is_empty_until_chosen_and_roundtrips() [InlineData(null, null, "en-GB", "en-US")] // then the Windows language [InlineData(null, null, "pt-PT", "pt-BR")] [InlineData(null, null, "ja-JP", "en-US")] // unknown languages read English - [InlineData(null, null, "de-CH", "de-DE")] - [InlineData(null, null, "fr-CA", "fr-FR")] [InlineData(null, null, "it-CH", "it-IT")] - [InlineData(null, null, "ru-KZ", "ru-RU")] - [InlineData(null, null, "es-MX", "es-ES")] - [InlineData("es-ES", null, "pt-BR", "es-ES")] + [InlineData("it-IT", null, "pt-BR", "it-IT")] [InlineData(null, null, null, "en-US")] public void Initial_language_follows_saved_choice_then_installer_then_windows(string? saved, string? installer, string? windows, string expected) => Assert.Equal(expected, LocalizationService.ResolveInitial(saved, installer, windows)); diff --git a/tests/ConsoleMode.Tests/ProtocolServiceTests.cs b/tests/ConsoleMode.Tests/ProtocolServiceTests.cs deleted file mode 100644 index e154e6b0..00000000 --- a/tests/ConsoleMode.Tests/ProtocolServiceTests.cs +++ /dev/null @@ -1,27 +0,0 @@ -using ConsoleMode.Services; - -namespace ConsoleMode.Tests; - -public class ProtocolServiceTests -{ - [Theory] - [InlineData("consolemode://start", "start")] - [InlineData("consolemode://start/", "start")] - [InlineData("CONSOLEMODE://Stop", "stop")] - [InlineData("consolemode:show", "show")] - [InlineData("consolemode://start?preset=sala", "start")] - [InlineData("consolemode://start#x", "start")] - [InlineData("consolemode://menu", "menu")] - public void ParseAction_ReadsTheActionFromTheUri(string argument, string expected) => - Assert.Equal(expected, ProtocolService.ParseAction(argument)); - - [Theory] - [InlineData("consolemode://reboot")] - [InlineData("consolemode://")] - [InlineData("--start")] - [InlineData("http://consolemode://start")] - [InlineData("")] - [InlineData(null)] - public void ParseAction_IgnoresAnythingElse(string? argument) => - Assert.Null(ProtocolService.ParseAction(argument)); -} diff --git a/tests/ConsoleMode.Tests/ReleaseNotesTests.cs b/tests/ConsoleMode.Tests/ReleaseNotesTests.cs index 9d156d01..4669e0b6 100644 --- a/tests/ConsoleMode.Tests/ReleaseNotesTests.cs +++ b/tests/ConsoleMode.Tests/ReleaseNotesTests.cs @@ -77,7 +77,7 @@ public void FirstLine_EnglishOnlyBodyIsSharedByEveryLanguage() Notas em português: CHANGELOG.md """; Assert.Equal("Session menu over the game. (#46)", ReleaseNotes.FirstLine(englishOnly, LocalizationService.PortugueseBrazil)); - Assert.Equal("Session menu over the game. (#46)", ReleaseNotes.FirstLine(englishOnly, LocalizationService.SpanishSpain)); + Assert.Equal("Session menu over the game. (#46)", ReleaseNotes.FirstLine(englishOnly, LocalizationService.ItalianItaly)); } private const string WithSummaries = """ @@ -106,7 +106,7 @@ public void FirstLine_LanguagesWithoutASummaryReadTheEnglishNotes() Assert.Equal("Minimize to the system tray: a new option in Settings. (#150)", ReleaseNotes.FirstLine(WithSummaries, LocalizationService.EnglishUnitedStates)); Assert.Equal("Minimize to the system tray: a new option in Settings. (#150)", - ReleaseNotes.FirstLine(WithSummaries, LocalizationService.GermanGermany)); + ReleaseNotes.FirstLine(WithSummaries, LocalizationService.ItalianItaly)); } [Fact] From 2407d64b633e6743bc7e4f629289c17058e8eee8 Mon Sep 17 00:00:00 2001 From: 1r0n51uv Date: Wed, 25 Nov 2026 17:00:33 +0100 Subject: [PATCH 7/7] docs: update READMEs, guides, test checklist and changelogs for the lean edition Co-Authored-By: Claude Sonnet 5.5 --- AGENTS.md | 5 +- CHANGELOG.en-US.md | 2 + CHANGELOG.md | 2 + FORK.md | 7 +++ README.it-IT.md | 17 +++---- README.md | 21 +++----- README.pt-BR.md | 21 +++----- docs/GUIDE.md | 56 +++------------------ docs/GUIDE.pt-BR.md | 54 +++----------------- docs/TESTING.md | 120 ++++---------------------------------------- docs/TRANSLATING.md | 6 +-- 11 files changed, 60 insertions(+), 251 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1c69b155..d05e5053 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,14 +33,13 @@ Xbox mode, and restores the desk setup afterwards. ## Conventions - **Every user-facing string** goes in every catalog in `src/ConsoleMode/Resources/` - (`Strings.pt-BR.json`, `en-US`, `es-ES`, `de-DE`, `fr-FR`, `it-IT`, `ru-RU`), translated. + (`Strings.pt-BR.json`, `en-US`, `it-IT`), translated. The localization tests fail when keys or `{0}` placeholders don't match, or when a sentence is left in English. - **Changelog**: add user-visible changes under `## [Unreleased]` in both `CHANGELOG.md` (Portuguese) and `CHANGELOG.en-US.md`, ending the item with the PR number. - **Docs come in pairs**: `README.md` / `README.pt-BR.md`, `docs/GUIDE.md` / `docs/GUIDE.pt-BR.md`. - The `README..md` and `docs/GUIDE..md` translations (es-ES, de-DE, fr-FR, ru-RU) are leaner - (no version numbers, "What's new" or roadmap): update them too when you change a section they carry. + `README.it-IT.md` is leaner (no version numbers, "What's new" or roadmap): update it too when you change a section it carries. Adding a language: follow `docs/TRANSLATING.md`. - **Commits and PR titles**: Conventional Commits in English (`fix: …`, `feat: …`, `docs: …`), one topic per PR. `AppLog` messages are written in Portuguese, like the existing ones. diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 3bcc58c2..001c2b70 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -3,6 +3,8 @@ English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Before publishing a version, add a `## [VERSION]` section to **both** files: the workflow publishes the section matching the tag from each one and fails if either is missing. ## [Unreleased] +### Changes +- Lean edition: removed TV control (Google TV / Android TV), the FPS limit and counter (RTSS), per-game profiles, the local control API and `consolemode://` links, DDC/CI panel power-off, and the Spanish, German, French and Russian languages. ## [1.7.2] ### What's new diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff1ffeb..fab579f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CHANGELOG.en-US.md`. Antes de publicar uma versão, adicione uma seção `## [VERSÃO]` com o changelog daquela versão **nos dois arquivos**. O workflow publica as duas seções correspondentes à tag na mesma release e falha se faltar alguma. ## [Unreleased] +### Mudanças +- Edição enxuta: removidos o controle da TV (Google TV / Android TV), o limite e o contador de FPS (RTSS), os perfis por jogo, a API de controle local e os links `consolemode://`, o desligar por DDC/CI e os idiomas espanhol, alemão, francês e russo. ## [1.7.2] ### Novidades diff --git a/FORK.md b/FORK.md index 298113ec..53b7945c 100644 --- a/FORK.md +++ b/FORK.md @@ -5,6 +5,13 @@ This is a fork of [lippdev/consolemode](https://github.com/lippdev/consolemode). release, merges it here and opens a PR from `sync/vX`. Keep it current: it is what the agent knows about what we changed. +## Lean edition (branch `alt/lean`) + +This branch deliberately diverges from upstream and is **not** part of the keeper's sync flow. It removes +TV control, RTSS (FPS limit and counter), per-game profiles, the local control API, `consolemode://` links, +DDC/CI power-off and the es/de/fr/ru catalogs, and is meant to be redesigned further. Merging upstream into it +will conflict heavily; do it by hand, not with the keeper. + ## What we changed - **Italian**: `src/ConsoleMode/Resources/Strings.it-IT.json` (a catalog with every key of diff --git a/README.it-IT.md b/README.it-IT.md index 8d570081..3410ffdf 100644 --- a/README.it-IT.md +++ b/README.it-IT.md @@ -2,7 +2,7 @@ Trasforma il tuo PC Windows in una **console** con un clic: mette a fuoco la TV, spegne gli altri schermi, cambia l'audio e apre l'interfaccia dei tuoi giochi. Quando esci dal gioco, la tua scrivania torna com'era. -[English](README.md) · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · Italiano · [Русский](README.ru-RU.md) +[English](README.md) · [Português (Brasil)](README.pt-BR.md) · Italiano ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Versione](https://img.shields.io/github/v/release/1r0n51uv/consolemode?label=versione&color=brightgreen) @@ -19,7 +19,7 @@ Scarica l'ultima versione stabile dalla **[pagina delle release](https://github. Vuoi provare per primo ciò che sta per arrivare? Attiva Sistema → App → "Ricevi le versioni di prova (beta)". -Windows 10 o 11, più [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) o l'app Xbox. [RTSS](https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html) è facoltativo, per il limite di FPS e il contatore di FPS. +Windows 10 o 11, più [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) o l'app Xbox. ## Come funziona @@ -34,28 +34,25 @@ Le scorciatoie del controller le scegli tu: all'inizio non ce n'è nessuna attiv | Scorciatoia del controller | Cosa fa | Suggerita | |---|---|---| | Tieni premuta la scorciatoia per **aprire** | Entra in modalità console dall'area di notifica | **Home** (Xbox / PS) | -| Tieni premuta la scorciatoia del **menu** | Menu sopra il gioco: finestre aperte, gestione file, volume, risoluzione, audio, FPS, HDR, uscita | **Select + Y** (Create + △) | +| Tieni premuta la scorciatoia del **menu** | Menu sopra il gioco: finestre aperte, gestione file, volume, risoluzione, audio, HDR, uscita | **Select + Y** (Create + △) | | Tieni premuta la scorciatoia per **tornare al PC** | Torna al PC | **Start + Select** (Options + Create) | ## Funzioni -- Nasconde gli altri schermi **scollegandoli**, con **schermate nere** o tramite **DDC/CI**, tutto con le API di Windows: non include nessuno strumento di terze parti per schermo o audio -- **Risoluzione e frequenza di aggiornamento** per schermo, **HDR**, **VRR** e **limite di FPS** (RTSS) mentre giochi -- **Contatore di FPS** sopra il gioco (RTSS) in una scheda con tre dimensioni: solo FPS, compatto (uso di CPU, GPU e RAM), dettagliato (frequenze, temperatura e memoria della GPU) o una disposizione tutta tua +- Nasconde gli altri schermi **scollegandoli**, o con **schermate nere**, tutto con le API di Windows: non include nessuno strumento di terze parti per schermo o audio +- **Risoluzione e frequenza di aggiornamento** per schermo, **HDR**, e **VRR** mentre giochi - L'audio va alla TV (o a qualsiasi uscita) e poi torna com'era -- [Accende la TV e la porta sull'ingresso del PC](docs/GUIDE.md#tv-control) (Google TV / Android TV via rete) e può eseguire un comando prima di metterla in standby quando torni al PC - Nasconde le **icone del desktop** durante la sessione, se attivi l'opzione, e ripristina la visibilità precedente quando torni al PC - Apre **Steam Big Picture**, **Playnite a schermo intero** o la **modalità Xbox**, e manda Steam nell'area di notifica quando torni al PC -- **Menu della sessione** sopra il gioco: cambia o chiudi le finestre aperte, regola volume, risoluzione, audio, FPS e HDR, nascondi il puntatore del mouse o muovilo con il controller, ed esplora i tuoi file con [ControlFS](https://github.com/nextestudios/ControlFS) e il web con [JoyChromium](https://github.com/lippdev/joychromium) +- **Menu della sessione** sopra il gioco: cambia o chiudi le finestre aperte, regola volume, risoluzione, audio e HDR, nascondi il puntatore del mouse o muovilo con il controller, ed esplora i tuoi file con [ControlFS](https://github.com/nextestudios/ControlFS) e il web con [JoyChromium](https://github.com/lippdev/joychromium) - Un'interfaccia in stile console, pensata per la TV, che funziona anche con mouse e tastiera (schermo intero, controller Xbox e PlayStation, schede con LB/RB, uno sfondo tuo o le copertine di Steam come sfondo), con un giro guidato la prima volta che la apri -- Automazione con i collegamenti `consolemode://start` / `stop` / `menu` (Stream Deck, script) e una [API di controllo locale](docs/GUIDE.md#local-control-api) - Inglese, portoghese, spagnolo, tedesco, francese, italiano e russo Le novità di ogni versione sono nel [CHANGELOG.en-US.md](CHANGELOG.en-US.md) (in inglese). ## Altro -- [Guida](docs/GUIDE.md) (in inglese): modalità e ripristino, API di controllo, HDR/VRR/FPS, risoluzione dei problemi +- [Guida](docs/GUIDE.md) (in inglese): modalità e ripristino, HDR/VRR, risoluzione dei problemi - **Feedback:** il pulsante accanto a Impostazioni nell'app, oppure [questo modulo](https://github.com/1r0n51uv/consolemode/issues/new?template=feedback.yml). Una ⭐ aiuta altri giocatori da divano a trovare il progetto. - Le versioni non sono ancora firmate digitalmente, quindi Windows SmartScreen o un antivirus possono segnalare il download; tutto il codice sorgente è qui. - Vuoi aiutare con le traduzioni? Vedi [docs/TRANSLATING.md](docs/TRANSLATING.md). diff --git a/README.md b/README.md index af11b759..05cfb06c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Turn your Windows PC into a **game console** with one click: focus the TV, turn off the other screens, switch the audio and launch your game UI. Quit the game and your desk comes back on its own. -English · [Português (Brasil)](README.pt-BR.md) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) +English · [Português (Brasil)](README.pt-BR.md) · [Italiano](README.it-IT.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=version&color=brightgreen) @@ -22,7 +22,7 @@ On 1.6? The app offers the update and keeps your settings. Prefer the old interf Want to try what comes next before everyone else? Turn on System → App → "Receive test versions (beta)". -Windows 10 or 11, plus [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) or the Xbox app. [RTSS](https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html) is optional, for the FPS limit and the FPS counter. +Windows 10 or 11, plus [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) or the Xbox app. ## How it works @@ -37,29 +37,24 @@ You pick the controller shortcuts yourself: none is on at first, the tour the ap | Controller shortcut | Does | Suggested | |---|---|---| | Hold your **open** shortcut | Enter console mode from the tray | **Home** (Xbox / PS) | -| Hold your **menu** shortcut | Menu over the game: open windows, file explorer, volume, resolution, audio, FPS, HDR, exit | **Select + Y** (Create + △) | +| Hold your **menu** shortcut | Menu over the game: open windows, file explorer, volume, resolution, audio, HDR, exit | **Select + Y** (Create + △) | | Hold your **back to the PC** shortcut | Back to the PC | **Start + Select** (Options + Create) | ## Features -- Hide the other screens by **disconnecting** them, **black overlays** or **DDC/CI**, all with Windows' own APIs: no third-party display or audio tool is bundled -- Per-screen **resolution and refresh rate**, **HDR**, **VRR** and an **FPS limit** (RTSS) while you play -- **FPS counter** over the game (RTSS) on a card in three sizes: FPS only, compact (CPU, GPU and RAM usage), detailed (clocks, GPU temperature and memory) or your own layout +- Hide the other screens by **disconnecting** them, or **black overlays**, all with Windows' own APIs: no third-party display or audio tool is bundled +- Per-screen **resolution and refresh rate**, **HDR**, and **VRR** while you play - Audio goes to the TV (or any output) and comes back afterwards -- [Turns the TV on and switches it to the PC's input](docs/GUIDE.md#tv-control) (Google TV / Android TV over the network), and can run a command before putting it in standby when you return to the PC - Hides the **desktop icons** during a session if you enable the option and restores their previous visibility when you return to the PC - Launches **Steam Big Picture**, **Playnite fullscreen** or **Xbox** mode, and sends Steam to the tray when you go back to the PC -- **Session menu** over the game: switch or close the open windows, change volume, resolution, audio, FPS and HDR, hide the mouse pointer or drive it with the controller, and browse your files with [ControlFS](https://github.com/nextestudios/ControlFS) and the web with [JoyChromium](https://github.com/lippdev/joychromium) +- **Session menu** over the game: switch or close the open windows, change volume, resolution, audio and HDR, hide the mouse pointer or drive it with the controller, and browse your files with [ControlFS](https://github.com/nextestudios/ControlFS) and the web with [JoyChromium](https://github.com/lippdev/joychromium) - A console-style interface made for the TV that also works with the mouse and the keyboard (full screen, Xbox and PlayStation pads, LB/RB tabs, its own wallpaper or your Steam covers as the background), with a guided tour the first time you open it - **Your own apps** as launchers: any `.exe` (RetroArch, another launcher…) becomes a tile on Home -- **Per-game profiles** for Steam games (resolution, HDR, FPS limit and audio) and the controller's battery on screen - Puts the **desktop icons** and the **mouse pointer** back where they were, can let the controller **wake the PC**, and restores the desk on the next start if a session was cut short -- Automation with `consolemode://start` / `stop` / `menu` links (Stream Deck, scripts) and a [local control API](docs/GUIDE.md#local-control-api) - English, Portuguese, Spanish, German, French, Italian and Russian ## What's new in 1.7.1 -- **Google TV and Android TV control is back:** turn on the TV and switch to the PC input when a session starts, then optionally run a command before standby when you return. - **Hide desktop icons during a session:** the app restores their previous visibility when you return to the PC. - **Controller improvements:** Windows battery readings for Bluetooth controllers when available, support for HID centre buttons, and more details in **Test controller**. - **Session fixes:** launcher selection survives tab changes, controller connect-to-start works again from the tray, and TV modes at 59 and 59.94 Hz are handled correctly. @@ -69,7 +64,6 @@ You pick the controller shortcuts yourself: none is on at first, the tour the ap - **One interface, made like a console's:** your launchers in a row with their official logos, the Inter font, the Aurora background, an opening with sound and a guided tour the first time. It works with the controller, the mouse and the keyboard; the Desktop interface lives on in Legacy - **Your apps on Home:** add any `.exe` with **+**, as many as you like, and take one off from its own tile -- **Per-game profiles:** each Steam game remembers its resolution, HDR, FPS limit and audio, saved from the session menu - **Session menu anywhere:** the menu shortcut opens it without starting a session, to use the PC from the couch, and a new shortcut opens Windows' Task View - **JoyChromium in the session menu:** the TV browser you drive with the controller opens over the game and installs from there if it is missing - **The desk comes back whole:** desktop icons and the mouse pointer return to their places, and if the app or the PC goes down mid-session, the next start restores everything @@ -81,7 +75,6 @@ You pick the controller shortcuts yourself: none is on at first, the tour the ap - **Console interface, redesigned:** Home, Session and System tabs on LB/RB, screen tiles, your Steam covers as the background and interface sounds - **Session menu like Steam's overlay:** full screen over the game, with the open windows in the middle (an Alt + Tab for the controller) - **File explorer built in:** ControlFS opens from the session menu, and installs from there if it is missing -- **FPS counter** over the game through RTSS, with Compact, Detailed and Custom styles - **Your shortcuts, your buttons:** pick the controller buttons that open Console Mode, the session menu and the way back to the PC - **All the project's own code:** displays and audio through Windows' APIs, without the NirSoft tools - Steam goes to the tray when you go back to the PC, the desk layout comes back exactly as it was (portrait monitors too), and slow Playnite starts no longer end the session @@ -90,7 +83,7 @@ All the details in the [release notes](https://github.com/lippdev/consolemode/re ## More -- [Guide](docs/GUIDE.md): modes and restore, control API, HDR/VRR/FPS, troubleshooting, building from source +- [Guide](docs/GUIDE.md): modes and restore, HDR/VRR, troubleshooting, building from source - **Feedback:** System → Shortcut, help, and data → Send feedback in the app, or [this form](https://github.com/lippdev/consolemode/issues/new?template=feedback.yml). A ⭐ helps other couch gamers find the project. - **Translations:** fix a line or add your language with the [translation guide](docs/TRANSLATING.md); no Windows needed. - The releases are not code-signed yet, so Windows SmartScreen or an antivirus may warn about the download; the source is all here. diff --git a/README.pt-BR.md b/README.pt-BR.md index b6dce902..60557667 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -2,7 +2,7 @@ Transforme seu PC Windows em um **console de jogos** com um clique: foque na TV, desligue as outras telas, mude o áudio e abra a interface de jogos. Saiu do jogo, a mesa volta sozinha. -[English](README.md) · Português (Brasil) · [Español](README.es-ES.md) · [Deutsch](README.de-DE.md) · [Français](README.fr-FR.md) · [Italiano](README.it-IT.md) · [Русский](README.ru-RU.md) +[English](README.md) · Português (Brasil) · [Italiano](README.it-IT.md) ![Windows](https://img.shields.io/badge/Windows-10%2F11-blue) ![Version](https://img.shields.io/github/v/release/lippdev/consolemode?label=vers%C3%A3o&color=brightgreen) @@ -22,7 +22,7 @@ Está na 1.6? O app oferece a atualização e mantém suas configurações. Pref Quer testar o que vem aí antes de todo mundo? Ligue Sistema → App → "Receber versões de teste (beta)". -Windows 10 ou 11, com [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) ou o app Xbox. O [RTSS](https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html) é opcional, para o limite de FPS e o contador de FPS. +Windows 10 ou 11, com [Steam](https://store.steampowered.com/) (Big Picture), [Playnite](https://playnite.link/) ou o app Xbox. ## Como funciona @@ -37,29 +37,24 @@ Os atalhos do controle são você quem escolhe: nenhum vem ligado, o tour da pri | Atalho no controle | Faz | Sugestão | |---|---|---| | Segurar o seu atalho de **abrir** | Entra no modo console a partir da bandeja | **Home** (Xbox / PS) | -| Segurar o seu atalho do **menu** | Menu sobre o jogo: janelas abertas, explorador de arquivos, volume, resolução, áudio, FPS, HDR, sair | **Select + Y** (Create + △) | +| Segurar o seu atalho do **menu** | Menu sobre o jogo: janelas abertas, explorador de arquivos, volume, resolução, áudio, HDR, sair | **Select + Y** (Create + △) | | Segurar o seu atalho de **voltar ao PC** | Volta para o PC | **Start + Select** (Options + Create) | ## Recursos -- Esconde as outras telas **desconectando**, com **cortinas pretas** ou por **DDC/CI**, tudo pelas APIs do próprio Windows: nenhuma ferramenta de terceiros para telas ou áudio vem embutida -- **Resolução e Hz** por tela, **HDR**, **VRR** e **limite de FPS** (RTSS) enquanto você joga -- **Contador de FPS** sobre o jogo (RTSS) num card em três tamanhos: apenas FPS, compacto (uso de CPU, GPU e RAM), detalhado (clocks, temperatura da GPU e memória) ou do seu jeito +- Esconde as outras telas **desconectando**, ou com **cortinas pretas**, tudo pelas APIs do próprio Windows: nenhuma ferramenta de terceiros para telas ou áudio vem embutida +- **Resolução e Hz** por tela, **HDR**, e **VRR** enquanto você joga - O áudio vai para a TV (ou qualquer saída) e volta depois -- [Liga a TV e troca para a entrada do PC](docs/GUIDE.pt-BR.md#controle-da-tv) (Google TV / Android TV pela rede), e pode executar um comando antes de colocá-la em espera ao voltar ao PC - Oculta os **ícones da área de trabalho** durante a sessão se você ativar a opção e restaura a visibilidade anterior ao voltar ao PC - Abre **Steam Big Picture**, **Playnite em tela cheia** ou o **Modo Xbox**, e manda a Steam para a bandeja ao voltar ao PC -- **Menu da sessão** sobre o jogo: troque ou feche as janelas abertas, mude volume, resolução, áudio, FPS e HDR, esconda o cursor do mouse ou mova-o com o controle e navegue pelos seus arquivos com o [ControlFS](https://github.com/nextestudios/ControlFS) e pela web com o [JoyChromium](https://github.com/lippdev/joychromium) +- **Menu da sessão** sobre o jogo: troque ou feche as janelas abertas, mude volume, resolução, áudio e HDR, esconda o cursor do mouse ou mova-o com o controle e navegue pelos seus arquivos com o [ControlFS](https://github.com/nextestudios/ControlFS) e pela web com o [JoyChromium](https://github.com/lippdev/joychromium) - Uma interface no estilo dos consoles, feita para a TV, que também funciona com mouse e teclado (tela cheia, controles Xbox e PlayStation, abas no LB/RB, um papel de parede próprio ou as capas da sua Steam como plano de fundo), com um tour guiado na primeira vez que você abre - **Seus aplicativos** como iniciadores: qualquer `.exe` (RetroArch, outro launcher…) vira um bloco no Início -- **Perfis por jogo** para os jogos da Steam (resolução, HDR, limite de FPS e áudio) e a bateria do controle na tela - Devolve os **ícones da área de trabalho** e o **ponteiro do mouse** ao lugar, pode deixar o controle **acordar o PC** e restaura a mesa na próxima abertura se uma sessão for interrompida -- Automação com os links `consolemode://start` / `stop` / `menu` (Stream Deck, scripts) e uma [API de controle local](docs/GUIDE.pt-BR.md#api-de-controle-local) - Português, inglês, espanhol, alemão, francês, italiano e russo ## Novidades da 1.7.1 -- **O controle de Google TV e Android TV voltou:** ligue a TV e troque para a entrada do PC ao iniciar a sessão. Ao voltar, você pode executar um comando antes de colocar a TV em espera. - **Oculte os ícones da área de trabalho durante a sessão:** o app restaura a visibilidade anterior ao voltar ao PC. - **Melhorias nos controles:** leitura de bateria pelo Windows para controles Bluetooth quando disponível, suporte a botões centrais HID e mais detalhes em **Testar controle**. - **Correções na sessão:** a seleção do iniciador é mantida ao trocar de aba, conectar um controle volta a iniciar a sessão com o app na bandeja e os modos de TV a 59 e 59,94 Hz são tratados corretamente. @@ -69,7 +64,6 @@ Os atalhos do controle são você quem escolhe: nenhum vem ligado, o tour da pri - **Uma interface só, com cara de console:** seus iniciadores numa fileira com os logos oficiais, a fonte Inter, o fundo Aurora, uma abertura com som e um tour guiado na primeira vez. Funciona com controle, mouse e teclado; a interface Desktop continua no Legacy - **Seus aplicativos no Início:** adicione qualquer `.exe` pelo **+**, quantos quiser, e tire um deles pelo próprio bloco -- **Perfis por jogo:** cada jogo da Steam lembra a própria resolução, HDR, limite de FPS e áudio, salvos pelo menu da sessão - **Menu da sessão em qualquer lugar:** o atalho do menu abre sem iniciar uma sessão, para usar o PC do sofá, e um atalho novo abre a visão de tarefas do Windows - **JoyChromium no menu da sessão:** o navegador para a TV que se usa com o controle abre por cima do jogo e se instala por ali mesmo se faltar - **A mesa volta inteira:** os ícones da área de trabalho e o ponteiro do mouse voltam ao lugar e, se o app ou o PC cair no meio da sessão, a próxima abertura restaura tudo @@ -81,7 +75,6 @@ Os atalhos do controle são você quem escolhe: nenhum vem ligado, o tour da pri - **Interface Console redesenhada:** abas Início, Sessão e Sistema no LB/RB, blocos das telas, as capas da sua Steam como plano de fundo e sons da interface - **Menu da sessão como o overlay do Steam:** tela cheia sobre o jogo, com as janelas abertas no meio (um Alt+Tab para o controle) - **Explorador de arquivos embutido:** o ControlFS abre pelo menu da sessão, e é instalado dali mesmo se faltar -- **Contador de FPS** sobre o jogo pelo RTSS, com os estilos Compacto, Detalhado e Personalizado - **Seus atalhos, seus botões:** escolha os botões do controle que abrem o Console Mode, o menu da sessão e a volta ao PC - **Só código do projeto:** telas e áudio pelas APIs do Windows, sem as ferramentas da NirSoft - A Steam vai para a bandeja ao voltar ao PC, o layout da mesa volta idêntico (monitores em retrato também) e o Playnite demorando para abrir não encerra mais a sessão @@ -90,7 +83,7 @@ Todos os detalhes nas [notas da versão](https://github.com/lippdev/consolemode/ ## Mais -- [Guia](docs/GUIDE.pt-BR.md): modos e restauração, API de controle, HDR/VRR/FPS, solução de problemas, compilar +- [Guia](docs/GUIDE.pt-BR.md): modos e restauração, HDR/VRR, solução de problemas, compilar - **Feedback:** Sistema → Atalho, ajuda e dados → Enviar feedback no app, ou [este formulário](https://github.com/lippdev/consolemode/issues/new?template=feedback.yml). Uma ⭐ ajuda outros jogadores de sofá a encontrar o projeto. - **Traduções:** corrija um texto ou traga o seu idioma pelo [guia de tradução](docs/TRANSLATING.md) (em inglês); não precisa de Windows. - As versões ainda não são assinadas, então o Windows SmartScreen ou um antivírus pode avisar sobre o download; o código está todo aqui. diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 12ec1f53..1624804c 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -2,7 +2,7 @@ Details that don't fit in the [README](../README.md). -English · [Português (Brasil)](GUIDE.pt-BR.md) · [Español](GUIDE.es-ES.md) · [Deutsch](GUIDE.de-DE.md) · [Français](GUIDE.fr-FR.md) · [Русский](GUIDE.ru-RU.md) +English · [Português (Brasil)](GUIDE.pt-BR.md) ## Modes and restore @@ -13,7 +13,7 @@ English · [Português (Brasil)](GUIDE.pt-BR.md) · [Español](GUIDE.es-ES.md) | **Xbox mode** | Manual — use *Restore now*, the tray menu, or reopen the window | | **Custom app** | Automatic restore when the app (or the process you chose to watch) closes | -If the app closes or the PC shuts down in the middle of a session, the next time Console Mode opens (also at Windows sign-in, if it starts with Windows) it restores everything the session changed: displays, audio, RTSS, desktop icons and the pointer, and says so. +If the app closes or the PC shuts down in the middle of a session, the next time Console Mode opens (also at Windows sign-in, if it starts with Windows) it restores everything the session changed: displays, audio, desktop icons and the pointer, and says so. **Custom app** opens any `.exe` you pick (RetroArch, another launcher…) from its own folder, with optional arguments, and moves its window to the game screen. The session ends a few seconds after that process closes. You can add as many as you like: each one is a tile on Home with its program's icon (**+ Add app** at the end of the row), and System changes or removes the selected one. If the exe only starts another program and exits (a launcher stub), Console Mode follows that program by itself; **Process to watch** is only needed when it guesses wrong (type the real program's process name there). If the watched process never shows up, the session stays until you end it (hold Start + Select, the session menu or the tray). @@ -21,9 +21,9 @@ If the app closes or the PC shuts down in the middle of a session, the next time You can also restore anytime from the tray (*Restore setup* / *Show window*). With black overlays, **ESC** dismisses the curtains. -The session menu has two ways out. **Back to the PC** ends the session and puts screens, resolution, HDR, audio and the FPS limit back as they were; the app stays in the tray. **Exit Console Mode** does the same and then closes the app, so the controller shortcuts stop until you open it again. The first time the menu opens, it offers a tour that explains each option; to see it later, press **Y** (△ on PlayStation) or **F1** in the menu, or use **System → App → Session menu tour**. +The session menu has two ways out. **Back to the PC** ends the session and puts screens, resolution, HDR and audio back as they were; the app stays in the tray. **Exit Console Mode** does the same and then closes the app, so the controller shortcuts stop until you open it again. The first time the menu opens, it offers a tour that explains each option; to see it later, press **Y** (△ on PlayStation) or **F1** in the menu, or use **System → App → Session menu tour**. -The menu also works **outside console mode**, to use the PC from the couch without starting anything: with Console Mode open (even just in the tray), the menu shortcut, the tray icon or `consolemode://menu` opens it on the game screen, if it is on, or on the primary one. There you can switch windows, change the volume, resolution, audio output and HDR, open ControlFS and JoyChromium, hide the pointer and drive the mouse with the controller. What you change stays that way until changed again, since there is no session to undo; the FPS limit and counter only show in a session. If the shortcut gets in the way in a game, turn off **System → Controller → Session menu outside console mode** (the tray still opens the menu). +The menu also works **outside console mode**, to use the PC from the couch without starting anything: with Console Mode open (even just in the tray), the menu shortcut or the tray icon opens it on the game screen, if it is on, or on the primary one. There you can switch windows, change the volume, resolution, audio output and HDR, open ControlFS and JoyChromium, hide the pointer and drive the mouse with the controller. What you change stays that way until changed again, since there is no session to undo. If the shortcut gets in the way in a game, turn off **System → Controller → Session menu outside console mode** (the tray still opens the menu). The **Task View shortcut** does from the controller what Win + Tab does: it opens Windows' Task View with all your open windows, in a session or not. While it is open, the D-pad or the left stick picks a window (holding repeats), **A** opens it and **B** closes the view; the shortcut again closes it too. It comes on as **Select + X**; change it or turn it off in **System → Controller → Controller shortcut for Task View** (the Xbox button alone works too, held, if it isn't the open-Console-Mode shortcut). The first three times, a notice shows the buttons before the view opens, since nothing shows on top of it. With an Xbox controller, Windows itself moves the selection; with a PlayStation controller, which Windows doesn't understand there, Console Mode does (turn off **Move around Task View with a PlayStation controller** if you use DS4Windows or Steam Input and moves repeat). @@ -31,13 +31,13 @@ The **Task View shortcut** does from the controller what Win + Tab does: it open Console Mode has one interface, made like a console's: it fills the screen and works with an Xbox or PlayStation controller, the mouse or the keyboard (click a tab or use Page Up / Page Down; Enter and Esc work as A and B). The first time you open it, a guided tour walks through the tabs, the launchers, the play button, the screens, the quick settings and the controller shortcuts; each stop moves on by itself once there has been time to read it (the bar under the card shows how long is left), **A** goes on at once, **B** skips it. To see it again: **System → App → Tutorial**. While the app loads it shows an opening with its logo and an entrance sound; any button skips it, now and then it is, as a surprise, one inspired by the Xbox 360 or the PS4, with that console's sound; **System → App** picks a style (which ends the surprises), plays it right away, and turns it off, or just its sound. -**Home** puts your launchers in a row at the top (Steam Big Picture, Playnite, Xbox mode): **A** on one picks what opens, and **Play now** below starts it. The **+** tile at the end adds an app of your own; on one of those, **☰** (OPTIONS on PlayStation) or a right click opens its menu, with **Remove from Home**. The line under the name says where you will play and what changes (audio, resolution, FPS, HDR, VRR); the round button next to Play now opens **Session**, with the screens and quick settings. +**Home** puts your launchers in a row at the top (Steam Big Picture, Playnite, Xbox mode): **A** on one picks what opens, and **Play now** below starts it. The **+** tile at the end adds an app of your own; on one of those, **☰** (OPTIONS on PlayStation) or a right click opens its menu, with **Remove from Home**. The line under the name says where you will play and what changes (audio, resolution, HDR, VRR); the round button next to Play now opens **Session**, with the screens and quick settings. The **System** tab lists its categories on the left (Gaming display, When entering console mode, Controller, TV, Optional extras, App, Shortcut, help, and data, More apps from the developer). Moving over a category shows its options on the right; **A** or right goes into them, and **B** or left goes back to the categories. In **System → Controller**, choose the button layout: **Automatic**, **Xbox** or **PlayStation**. The preview and shortcut labels follow the choice, which is saved when you close the app. This changes the displayed symbols; the controller's inputs keep their existing mapping. -The **System** tab holds every setting, including controller shortcuts, Playnite, Android TV, custom FPS, the FPS counter's layout, the custom app's arguments, the diagnostics report and the data folder. The values stay saved after restarting the app. +The **System** tab holds every setting, including controller shortcuts, Playnite, the custom app's arguments, the diagnostics report and the data folder. The values stay saved after restarting the app. Open the shortcut action you want to configure, choose **Set** or **Change**, hold the desired combination on one controller and release the buttons. **Remove** disables that shortcut. During capture, controller buttons do not navigate the interface; use **Cancel** or **Esc** to stop capture. Outside capture, **B** leaves the editor. Address and custom FPS fields accept keyboard input. @@ -49,43 +49,6 @@ Changing the main display can make Windows reshuffle the desktop icons. **Put de **Wake the PC with the controller** lets the Xbox Wireless Adapter, the Bluetooth radio or a wired controller wake the PC from sleep with the controller's center button. **Turn on** asks Windows for administrator permission and ticks *Allow this device to wake the computer* on those devices. It can't wake a PC that is shut down or hibernating, and some PCs cut power to Bluetooth while asleep. Together with **Enter when a controller connects**, the PC wakes straight into console mode. -**Per-game profiles** give each Steam game its own resolution, HDR, FPS limit and audio output. With the game running, open the session menu and pick **Game profile → Save the current settings for…**: whatever the game screen uses at that moment is saved. Next time that game starts during a session, Console Mode applies it, and when the game closes the screen goes back to how it was. The game is detected from Steam, whether it was opened from Big Picture, Playnite or the Xbox app. The saved profiles are listed in System → When entering console mode → **Per-game profiles**, where you can delete them. - -## Local control API - -`consolemode://` links fire and forget. Tools that need an answer — a remote-control agent running as a Windows service, a Stream Deck plugin showing whether console mode is on — can use the named pipe `\\.\pipe\ConsoleMode.Control` while the app is running: send one JSON line, get one back. - -``` -→ {"cmd":"status"} // or "start", "stop", "show" -← {"ok":true,"active":true,"restoring":false,"mode":"xboxMode","version":"1.5.0"} -``` - -`start`, `stop` and `show` do exactly what the matching `consolemode://` link does, then reply once the app has settled (`ok:false` with an `error` if console mode didn't start or the restore didn't finish). `status` only reads. Only the signed-in user and LocalSystem can connect; nothing is exposed to the network. - -## TV control - -System → **TV** can turn the TV on and switch it to the PC's HDMI input when console mode starts, and optionally put it back in standby after the desk is restored. A TV that doesn't answer never blocks console mode: the app logs it and waits for the game screen as usual. - -With the default, **Don't control it**, nothing is sent and nothing is added to starting or restoring. With a route selected, the TV step runs first when console mode starts and is capped at **30 seconds** (the worst case, when the TV doesn't answer and Wake-on-LAN is tried); the optional standby on restore is capped at **15 seconds**. A TV that is already on usually answers in about a second or two. - -Most PC graphics cards can't send HDMI-CEC, so the app talks to the TV over the network instead: - -### Google TV / Android TV - -TCL, Sony, Hisense, Philips and other TVs running Google TV or Android TV, through ADB (the Android debugging protocol). Nothing to install on the PC. - -1. On the TV: **Settings → System → About**, press **Android TV OS build** 7 times to unlock Developer options. -2. **Settings → System → Developer options**: turn on **USB debugging** (on some TVs, **Network debugging** / **ADB over network**). -3. In Console Mode, pick *Google TV / Android TV*, enter the TV's IP (Settings → Network on the TV; reserve it in your router) and the HDMI input the PC uses. -4. Press **Test now**. The TV asks "Allow debugging from this computer?": tick **Always allow** and press **Allow**. - -The PC's ADB key is stored encrypted for your Windows user (DPAPI), so the TV only asks once. If the data folder is copied to another Windows user or PC, the key can't be read there: the app creates a new one and the TV asks "Allow debugging?" again. - -Waking uses the Android wake-up key, then the **HDMI 1-4** key. If your TV ignores that key, set **Input command** to any Android shell command that opens the PC's input. If the TV drops off the network in standby, fill in its **MAC address** so the app sends Wake-on-LAN first (the TV's "Wake on network" / "Wake on Wi-Fi" option must be on). - -When the desk comes back, **Command when going back to the PC** (optional) is sent to the TV first, for example `input keyevent 3` for its Home screen or the command of another input; then standby, if **Put the TV in standby on restore** is on. - -"Wireless debugging" with a pairing code (Android 11+ phones) is a different, TLS-wrapped protocol and isn't supported: use USB / network debugging. ## Optional extras @@ -97,15 +60,10 @@ Enable HDR on the focus monitor while console mode is active. It is turned back Console Mode can toggle the Windows VRR optimize setting. For best results, also enable VRR / G-SYNC / FreeSync in your **GPU control panel** (NVIDIA or AMD). -### FPS limit (RTSS) - -Cap the global frame rate while console mode runs (helpful on a 60 Hz TV). Requires RTSS installed and running. The previous limit is restored when you exit. - ## Limitations - 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 -- The FPS limit is global (RTSS limitation), not per display - The WinUI 3 build currently requires Windows to compile (`net8.0-windows`) ## Troubleshooting @@ -131,7 +89,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 rtss-cli, then builds both packages +# Builds both packages .\build\Publish-ConsoleMode.ps1 -Version 1.4.0 ``` diff --git a/docs/GUIDE.pt-BR.md b/docs/GUIDE.pt-BR.md index 66f383ec..a8c0024d 100644 --- a/docs/GUIDE.pt-BR.md +++ b/docs/GUIDE.pt-BR.md @@ -2,7 +2,7 @@ Detalhes que não cabem no [README](../README.pt-BR.md). -[English](GUIDE.md) · Português (Brasil) · [Español](GUIDE.es-ES.md) · [Deutsch](GUIDE.de-DE.md) · [Français](GUIDE.fr-FR.md) · [Русский](GUIDE.ru-RU.md) +[English](GUIDE.md) · Português (Brasil) ## Modos e restauração @@ -13,7 +13,7 @@ Detalhes que não cabem no [README](../README.pt-BR.md). | **Modo Xbox** | Manual — *Restaurar agora*, menu da bandeja ou reabrir a janela | | **Aplicativo personalizado** | Restauração automática quando o app (ou o processo escolhido para acompanhar) fecha | -Se o app fechar ou o PC desligar no meio de uma sessão, na próxima vez que o Console Mode abrir (também ao entrar no Windows, se ele inicia com o Windows) ele restaura tudo o que a sessão mudou: telas, áudio, RTSS, ícones da área de trabalho e o ponteiro, e avisa. +Se o app fechar ou o PC desligar no meio de uma sessão, na próxima vez que o Console Mode abrir (também ao entrar no Windows, se ele inicia com o Windows) ele restaura tudo o que a sessão mudou: telas, áudio, ícones da área de trabalho e o ponteiro, e avisa. **Aplicativo personalizado** abre qualquer `.exe` que você escolher (RetroArch, outro launcher…) a partir da própria pasta, com argumentos opcionais, e move a janela dele para a tela de jogo. A sessão termina alguns segundos depois que esse processo fecha. Dá para adicionar quantos quiser: cada um vira um bloco no Início com o ícone do programa (**+ Adicionar app** no fim da fileira), e em Sistema dá para trocar ou remover o selecionado. Se o exe só abre outro programa e fecha (um launcher intermediário), o Console Mode passa a acompanhar esse programa sozinho; **Processo a acompanhar** só é preciso quando ele errar (digite ali o nome do processo do programa de verdade). Se o processo acompanhado nunca aparecer, a sessão continua até você encerrá-la (segurar Start + Select, o menu da sessão ou a bandeja). @@ -21,9 +21,9 @@ Se o app fechar ou o PC desligar no meio de uma sessão, na próxima vez que o C Também dá para restaurar a qualquer momento pela bandeja (*Restaurar setup* / *Mostrar janela*). Com cortinas pretas, **ESC** remove o overlay. -No menu da sessão há duas saídas. **Voltar ao PC** encerra a sessão e devolve telas, resolução, HDR, áudio e limite de FPS ao que eram; o app continua na bandeja. **Sair do Console Mode** faz o mesmo e depois fecha o app, então os atalhos do controle param até você abri-lo de novo. Na primeira vez que o menu abre, ele oferece um tour que explica cada opção; para vê-lo depois, aperte **Y** (△ no PlayStation) ou **F1** no menu, ou use **Sistema → App → Tour do menu da sessão**. +No menu da sessão há duas saídas. **Voltar ao PC** encerra a sessão e devolve telas, resolução, HDR e áudio ao que eram; o app continua na bandeja. **Sair do Console Mode** faz o mesmo e depois fecha o app, então os atalhos do controle param até você abri-lo de novo. Na primeira vez que o menu abre, ele oferece um tour que explica cada opção; para vê-lo depois, aperte **Y** (△ no PlayStation) ou **F1** no menu, ou use **Sistema → App → Tour do menu da sessão**. -O menu também funciona **fora do modo console**, para usar o PC do sofá sem iniciar nada: com o Console Mode aberto (mesmo só na bandeja), o atalho do menu, o ícone da bandeja ou `consolemode://menu` o abrem na tela de jogo, se ela estiver ligada, ou na principal. Ali dá para trocar de janela, mexer no volume, na resolução, na saída de áudio e no HDR, abrir o ControlFS e o JoyChromium, esconder o cursor e controlar o mouse com o controle. O que você muda fica assim até ser trocado de novo, já que não há sessão para desfazer; o limite e o contador de FPS só aparecem numa sessão. Se o atalho atrapalhar algum jogo, desligue **Sistema → Controle → Menu da sessão fora do modo console** (a bandeja continua abrindo o menu). +O menu também funciona **fora do modo console**, para usar o PC do sofá sem iniciar nada: com o Console Mode aberto (mesmo só na bandeja), o atalho do menu ou o ícone da bandeja o abrem na tela de jogo, se ela estiver ligada, ou na principal. Ali dá para trocar de janela, mexer no volume, na resolução, na saída de áudio e no HDR, abrir o ControlFS e o JoyChromium, esconder o cursor e controlar o mouse com o controle. O que você muda fica assim até ser trocado de novo, já que não há sessão para desfazer; o limite e o contador de FPS só aparecem numa sessão. Se o atalho atrapalhar algum jogo, desligue **Sistema → Controle → Menu da sessão fora do modo console** (a bandeja continua abrindo o menu). O **atalho da visão de tarefas** faz pelo controle o que o Win + Tab faz: abre a visão de tarefas do Windows com todas as janelas abertas, numa sessão ou fora dela. Com ela aberta, o direcional ou o analógico esquerdo escolhe a janela (segurar repete), **A** abre e **B** fecha; o atalho de novo também fecha. Ele já vem ligado com **Select + X**; troque ou desligue em **Sistema → Controle → Atalho do controle para a visão de tarefas** (o botão Xbox sozinho também serve, segurado, se não estiver no atalho de abrir o Console Mode). Nas três primeiras vezes, um aviso mostra os botões antes de a visão abrir, porque nada aparece por cima dela. Com controle Xbox, quem move a seleção é o próprio Windows; com controle PlayStation, que o Windows não entende ali, é o Console Mode (desligue em **Navegar na visão de tarefas com controle PlayStation** se usar DS4Windows ou o Steam Input e os comandos se repetirem). @@ -37,7 +37,7 @@ A aba **Sistema** lista as categorias à esquerda (Tela de jogo, Ao entrar no mo Em **Sistema → Controle**, escolha o layout dos botões: **Automático**, **Xbox** ou **PlayStation**. A prévia e os nomes dos atalhos acompanham a escolha, que fica salva ao fechar o app. Isso muda os símbolos exibidos; as entradas do controle mantêm o mapeamento existente. -A aba **Sistema** reúne todos os ajustes, incluindo os atalhos do controle, Playnite, Android TV, FPS personalizado, o layout do contador de FPS, os argumentos do aplicativo personalizado, o relatório de diagnóstico e a pasta de dados. Os valores permanecem salvos ao reabrir o app. +A aba **Sistema** reúne todos os ajustes, incluindo os atalhos do controle, Playnite, os argumentos do aplicativo personalizado, o relatório de diagnóstico e a pasta de dados. Os valores permanecem salvos ao reabrir o app. Abra a ação de atalho que deseja configurar, escolha **Definir** ou **Alterar**, segure a combinação desejada em um único controle e solte os botões. **Remover** desativa aquele atalho. Durante a captura, os botões não navegam pela interface; use **Cancelar** ou **Esc** para interrompê-la. Fora da captura, **B** volta do editor. Campos de endereço e FPS personalizado aceitam digitação por teclado. @@ -49,43 +49,6 @@ Trocar a tela principal pode fazer o Windows embaralhar os ícones da área de t **Acordar o PC pelo controle** deixa o adaptador sem fio Xbox, o Bluetooth ou o controle no cabo acordarem o PC da suspensão pelo botão central do controle. **Ativar** pede permissão de administrador ao Windows e marca *Permitir que este dispositivo ative o computador* nesses dispositivos. Não acorda o PC desligado ou em hibernação, e alguns PCs cortam a energia do Bluetooth ao suspender. Junto com **Entrar ao conectar um controle**, o PC já acorda no modo console. -**Perfis por jogo** dão a cada jogo da Steam sua própria resolução, HDR, limite de FPS e saída de áudio. Com o jogo rodando, abra o menu da sessão e escolha **Perfil do jogo → Salvar os ajustes atuais para…**: o que a tela de jogo usa naquele momento fica salvo. Da próxima vez que esse jogo abrir durante uma sessão, o Console Mode aplica o perfil e, quando o jogo fecha, a tela volta a ser como era. O jogo é detectado pela Steam, seja ele aberto pelo Big Picture, pelo Playnite ou pelo app Xbox. Os perfis salvos ficam em Sistema → Ao entrar no modo console → **Perfis por jogo**, onde dá para apagá-los. - -## API de controle local - -Os links `consolemode://` não dão resposta. Ferramentas que precisam de uma — um agente de controle remoto rodando como serviço do Windows, um plugin de Stream Deck que mostra se o modo console está ligado — podem usar o named pipe `\\.\pipe\ConsoleMode.Control` com o app aberto: envie uma linha JSON e receba outra. - -``` -→ {"cmd":"status"} // ou "start", "stop", "show" -← {"ok":true,"active":true,"restoring":false,"mode":"xboxMode","version":"1.5.0"} -``` - -`start`, `stop` e `show` fazem o mesmo que o link `consolemode://` correspondente e respondem quando o app terminou (`ok:false` com `error` se o modo console não entrou ou a restauração não terminou). `status` só consulta. Só o usuário logado e o LocalSystem conseguem conectar; nada fica exposto na rede. - -## Controle da TV - -Sistema → **TV** pode ligar a TV e trocar para a entrada HDMI do PC quando o modo console começa e, se você quiser, colocá-la em espera depois que a mesa volta. Uma TV que não responde nunca trava o modo console: o app registra no log e espera a tela de jogo como sempre. - -Com o padrão, **Não controlar**, nada é enviado e nada é acrescentado ao iniciar nem ao restaurar. Com um caminho escolhido, a etapa da TV roda primeiro quando o modo console começa e tem limite de **30 segundos** (o pior caso, quando a TV não responde e o Wake-on-LAN é tentado); a espera opcional ao restaurar tem limite de **15 segundos**. Uma TV que já está ligada costuma responder em um ou dois segundos. - -A maioria das placas de vídeo de PC não envia HDMI-CEC, então o app fala com a TV pela rede: - -### Google TV / Android TV - -TVs TCL, Sony, Hisense, Philips e outras com Google TV ou Android TV, via ADB (o protocolo de depuração do Android). Nada para instalar no PC. - -1. Na TV: **Configurações → Sistema → Sobre**, aperte **Build do Android TV OS** 7 vezes para liberar as Opções do desenvolvedor. -2. **Configurações → Sistema → Opções do desenvolvedor**: ative **Depuração USB** (em algumas TVs, **Depuração pela rede** / **ADB pela rede**). -3. No Console Mode, escolha *Google TV / Android TV*, informe o IP da TV (Configurações → Rede na TV; reserve esse IP no roteador) e a entrada HDMI do PC. -4. Aperte **Testar agora**. A TV pergunta "Permitir depuração deste computador?": marque **Sempre permitir** e aperte **Permitir**. - -A chave ADB deste PC fica guardada criptografada para o seu usuário do Windows (DPAPI), então a TV só pergunta uma vez. Se a pasta de dados for copiada para outro usuário do Windows ou outro PC, a chave não pode ser lida lá: o app cria outra e a TV pergunta "Permitir depuração?" de novo. - -Para acordar, o app usa a tecla de despertar do Android e depois a tecla **HDMI 1-4**. Se a sua TV ignorar essa tecla, preencha **Comando da entrada** com qualquer comando de shell do Android que abra a entrada do PC. Se a TV sai da rede em espera, informe o **endereço MAC** para o app mandar Wake-on-LAN antes (a opção "Ligar pela rede" / "Wake on Wi-Fi" da TV precisa estar ativa). - -Quando a mesa volta, o **Comando ao voltar ao PC** (opcional) vai primeiro para a TV, por exemplo `input keyevent 3` para a tela inicial dela ou o comando de outra entrada; depois vem a espera, se **Colocar a TV em espera ao restaurar** estiver ligado. - -A "Depuração sem fio" com código de pareamento (Android 11+ em celulares) é outro protocolo, com TLS, e não é suportada: use a depuração USB / pela rede. ## Extras opcionais @@ -97,15 +60,10 @@ Ativa HDR no monitor de foco enquanto o modo console estiver ligado. Ao sair, o O Console Mode pode alterar a opção de VRR do Windows. Para melhor resultado, ligue também VRR / G-SYNC / FreeSync no **painel do driver da GPU** (NVIDIA ou AMD). -### Limite de FPS (RTSS) - -Limita a taxa de quadros global durante o modo console (útil em TV 60 Hz). Exige RTSS instalado e em execução. O limite anterior volta ao sair. - ## Limitações - 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 -- 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`) ## Solução de problemas @@ -131,7 +89,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 o rtss-cli e compila os dois pacotes +# Compila os dois pacotes .\build\Publish-ConsoleMode.ps1 -Version 1.4.0 ``` diff --git a/docs/TESTING.md b/docs/TESTING.md index f6f772f8..37417a6d 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -56,7 +56,7 @@ Pré-condições: interface Console ativa (Ajustes → Interface → Console, ou ### Navegação pelo controle (direcional e analógico) -- [ ] Em Sessão, com o foco num ajuste rápido à direita (ex.: "Limite de FPS"), **cima** sobe para uma tela (a mais próxima), não fica parado. Resultado: ______ +- [ ] Em Sessão, com o foco num ajuste rápido à direita (ex.: "HDR"), **cima** sobe para uma tela (a mais próxima), não fica parado. Resultado: ______ - [ ] Em Sessão, **baixo** das telas vai para o ajuste rápido mais próximo; esquerda/direita andam só dentro da própria fileira e param nas pontas. Resultado: ______ - [ ] Ao trocar de aba com LB/RB o foco cai no primeiro item (Início: Jogar agora; Sessão: primeira tela; Sistema: primeira linha), com o anel branco visível. Resultado: ______ - [ ] Em Início, baixo de Jogar agora vai para "Setup atual"; cima volta; cima de Jogar agora vai ao botão Modo desktop do topo. Resultado: ______ @@ -135,27 +135,13 @@ Pré-condições: PC com adaptador sem fio Xbox, Bluetooth ou controle no cabo; - [ ] Suspender o PC (Iniciar → Energia → Suspender) e apertar o botão Xbox/PS: o PC acorda. Anote a conexão (adaptador Xbox, Bluetooth, cabo) e o modelo do controle. Resultado: ______ - [ ] Com **Entrar ao conectar um controle** ligado e o app na bandeja: acordar pelo controle já entra no modo console. Resultado: ______ - [ ] Teclado e mouse não aparecem na lista e não são alterados. Resultado: ______ -## 1b3. Perfis por jogo (issue #69) - -Pré-condições: dois jogos da Steam instalados (de preferência um que aceite outra resolução sem reiniciar); RTSS instalado para o limite de FPS; sessão ativa. - -- [ ] Sem jogo rodando, o menu da sessão **não** mostra a linha "Perfil do jogo". Com um jogo aberto (pelo Big Picture), em até ~5 s a linha aparece com ": sem perfil". Resultado: ______ -- [ ] No menu, trocar resolução, HDR, FPS e saída de áudio; depois **Perfil do jogo → Salvar os ajustes atuais**: a linha passa a ": perfil salvo" e Ajustes → **Perfis por jogo** lista o jogo com o resumo certo. Resultado: ______ -- [ ] Fechar o jogo: a resolução, o HDR, o FPS e o áudio voltam ao que eram quando o jogo abriu. O log mostra `Perfil por jogo: … fechou; voltando a tela de antes`. Resultado: ______ -- [ ] Abrir o mesmo jogo de novo: o perfil é aplicado sozinho (log `aplicando o perfil de …`) e desfeito ao fechar. Resultado: ______ -- [ ] Abrir **outro** jogo sem perfil: nada muda. Trocar direto de um jogo com perfil para outro: o primeiro é desfeito antes. Resultado: ______ -- [ ] Jogo aberto pelo **Playnite** ou pelo **app Xbox** (jogo da Steam): o perfil também vale. Resultado: ______ -- [ ] **Voltar ao PC** com o jogo ainda aberto e perfil aplicado: a mesa volta exatamente como antes da sessão (resolução, HDR, FPS, áudio). Resultado: ______ -- [ ] A saída de áudio do perfil desconectada (fone desligado): o resto do perfil é aplicado e o log diz que a saída não está ativa. Resultado: ______ -- [ ] Apagar: pelo menu da sessão (Perfil do jogo → Apagar), em Ajustes (botão **Apagar**) e na aba Sistema → Ao entrar no modo console → Perfis por jogo. Sem perfis, a linha da aba Sistema fica desativada. Resultado: ______ - ## 1c. Menu da sessão (atalho sugerido: Select + Y) ### Tela cheia estilo Steam (Shift+Tab), prévia e janelas - [ ] O menu cobre a **tela inteira** do monitor do jogo (ou o principal, na prévia), com o jogo escurecido e desfocado por trás: painel lateral à esquerda com as opções e, no meio, o bloco "Janelas". Resultado: ______ -- [ ] Com o atalho do menu definido e **sem** sessão ativa, segurar o atalho abre o menu (prévia), com o selo "Prévia · fora da sessão". O link `consolemode://menu` e o item da bandeja também abrem. Resultado: ______ -- [ ] Na prévia: o FPS não aparece, "Voltar ao PC" vira "Fechar menu" e só fecha o menu, e "Sair do Console Mode" fecha o app sem restaurar nada. Volume, saída de áudio, resolução e HDR valem de verdade (não há sessão para desfazê-los). Resultado: ______ +- [ ] Com o atalho do menu definido e **sem** sessão ativa, segurar o atalho abre o menu (prévia), com o selo "Prévia · fora da sessão". O item da bandeja também abre. Resultado: ______ +- [ ] Na prévia: "Voltar ao PC" vira "Fechar menu" e só fecha o menu, e "Sair do Console Mode" fecha o app sem restaurar nada. Volume, saída de áudio, resolução e HDR valem de verdade (não há sessão para desfazê-los). Resultado: ______ - [ ] O painel lateral entra deslizando pela esquerda com as linhas em cascata, as janelas sobem e aparecem, e ao fechar (B, Esc ou o atalho) tudo some em ~0,2 s. Com as animações do Windows desligadas, abre e fecha sem movimento. Resultado: ______ - [ ] A linha/card em foco ganha contorno branco e cresce um pouco; há som ao mover, confirmar e voltar. Resultado: ______ - [ ] Direcional entre o painel lateral e o grid de janelas (esquerda/direita) e dentro de cada um (cima/baixo) nunca fica "morto"; com o seletor (resolução, áudio, FPS) aberto o foco não escapa para trás. Resultado: ______ @@ -183,14 +169,12 @@ Pré-condições: sessão ativa com Big Picture (ou jogo borderless) na tela; co - [ ] **Volume:** ◀/▶ na linha muda de 5 em 5 e o Windows reflete; A alterna mudo. O valor inicial é o atual do Windows. Resultado: ______ - [ ] **Resolução:** abre a lista com a atual marcada; escolher outra aplica na TV, o Big Picture continua aberto e a sessão não se encerra sozinha. Ao restaurar no fim, a resolução original volta. Resultado: ______ - [ ] **Saída de áudio:** lista só saídas ativas; escolher troca o som na hora e o "ao conectar" não desfaz. Resultado: ______ -- [ ] **Limite de FPS** (só com RTSS): trocar o limite vale no jogo; "Sem limite" desliga o limitador; ao restaurar, o RTSS volta ao que era antes da sessão. Resultado: ______ - [ ] **HDR:** alternar liga/desliga na TV; ao restaurar, o HDR volta ao estado de antes da sessão (inclusive se você desligou um que estava ligado). Resultado: ______ - [ ] "Gravar os últimos 30 s" aparece desativado com "em breve". Resultado: ______ - [ ] **Voltar ao PC** restaura e o app fica na bandeja; **Sair do Console Mode** restaura e fecha o app. Resultado: ______ - [ ] Start + Select continua restaurando direto, sem abrir o menu. Resultado: ______ - [ ] Com **PlayStation**: D-pad/✕/○ funcionam no menu (a janela toma o primeiro plano). Resultado: ______ - [ ] Jogo em **tela cheia exclusiva**: o menu não aparece por cima (limitação documentada); Select + Y não quebra nada. Resultado: ______ -- [ ] `start consolemode://menu` no cmd abre o menu; fora da sessão, não faz nada. Resultado: ______ ### Tour guiado do menu @@ -199,7 +183,7 @@ Pré-condição para o convite: `SessionMenuTourDone` ausente ou `false` no `con - [ ] **Convite na primeira vez**: ao abrir o menu (sessão ou prévia), depois que as linhas terminam de entrar, aparece um cartão centralizado "Primeira vez neste menu?", com "Agora não" (B) e "Fazer o tour" (A, em foco). A dica do convite mostra o botão certo (Y no Xbox, △ no PlayStation). Resultado: ______ - [ ] **Agora não** (ou B): o cartão some, o foco volta para "Voltar ao jogo" e o convite **não** aparece mais ao reabrir o menu (`SessionMenuTourDone: true` no config). Resultado: ______ - [ ] **Fechar o menu com o convite aberto** (pelo atalho): o convite aparece de novo na próxima abertura. Resultado: ______ -- [ ] **Paradas**: A avança por Voltar ao jogo → Explorador de arquivos → Volume → Tela e som → FPS (só com RTSS e fora da prévia) → Janelas → Voltar ao PC (ou "Fechar menu" na prévia) → Sair do Console Mode. Cada parada escurece o resto do menu, contorna na cor de destaque só as linhas certas (resolução e áudio juntas e o HDR à parte quando as linhas de FPS estão entre eles) e mostra "n de N". Resultado: ______ +- [ ] **Paradas**: A avança por Voltar ao jogo → Explorador de arquivos → Volume → Tela e som → Janelas → Voltar ao PC (ou "Fechar menu" na prévia) → Sair do Console Mode. Cada parada escurece o resto do menu, contorna na cor de destaque só as linhas certas (resolução e áudio juntas e o HDR à parte quando as linhas de FPS estão entre eles) e mostra "n de N". Resultado: ______ - [ ] **Balão**: fica à direita do painel lateral, na altura das linhas destacadas, sem sair da tela; na parada Janelas fica sobre o painel lateral. Os textos não ficam cortados a 1080p nem a 4K com escala. Resultado: ______ - [ ] **Rolagem**: numa tela em que o painel lateral precisa rolar (1080p com escala de 125%+), as paradas Voltar ao PC e Sair do Console Mode rolam o painel até as linhas e o destaque acompanha. Resultado: ______ - [ ] **Textos das saídas**: em sessão, "Voltar ao PC" explica que restaura e o app fica na bandeja, e "Sair do Console Mode" que também fecha o app; na prévia, "Fechar menu" diz que só fecha o menu. Resultado: ______ @@ -268,15 +252,6 @@ Onde aparece: no cabeçalho do menu da sessão (depois de "controle Xbox detecta - [ ] Bateria fraca na sessão: com um controle em 15 % ou menos, aparece um aviso no canto da TV ("Bateria do controle fraca"), sem tirar o foco do jogo; não repete a cada 30 s. Aparece de novo só em 5 % ou menos, ou depois de carregar. Fora da sessão não há aviso. Log: `Controle: bateria fraca (...)`. Resultado: ______ - [ ] Leitor de tela (Narrador) no indicador: lê "Bateria do controle: 65%" (e ", carregando"). Resultado: ______ -## 2. Links `consolemode://` - -- [ ] `start consolemode://start` no `cmd` com o app **fechado**: abre e entra no modo console. Resultado: ______ -- [ ] `consolemode://start` com o app **aberto**: entra no modo console sem abrir segunda instância (só um `ConsoleMode.exe` no Gerenciador de Tarefas). Resultado: ______ -- [ ] `consolemode://stop` durante a sessão: restaura a mesa. Com sessão inativa: só mostra a janela. Resultado: ______ -- [ ] `consolemode://show`: traz a janela para frente (da bandeja também). Resultado: ______ -- [ ] Versão **instalada**: o instalador registra o protocolo; desinstalar remove `HKCU\Software\Classes\consolemode`. Resultado: ______ -- [ ] Versão **portátil** movida de pasta: ao abrir, o registro passa a apontar para o novo caminho (log `Protocolo: consolemode:// registrado`). Resultado: ______ - ## 3. Interface Console Pré-condições: Ajustes → Interface = **Automático** (padrão). @@ -303,7 +278,7 @@ Pré-condições: Ajustes → Interface = **Automático** (padrão). - [ ] Ao abrir, o foco está em **Jogar agora** (anel grosso). Resultado: ______ - [ ] D-pad e analógico esquerdo movem o foco: Jogar → cartões de ajustes → cartões de telas → "Modo desktop", e de volta. Segurar uma direção repete. Resultado: ______ - [ ] **A** num cartão de tela abre o painel "O que a tela X faz?" com foco em "Jogar aqui"; A escolhe; **B** fecha sem mudar. Resultado: ______ -- [ ] **A** num cartão de ajuste rápido cicla o valor (Abrir, Áudio, Resolução, HDR, VRR, FPS) e o resumo no topo acompanha. Resultado: ______ +- [ ] **A** num cartão de ajuste rápido cicla o valor (Abrir, Áudio, Resolução, HDR, VRR) e o resumo no topo acompanha. Resultado: ______ - [ ] **Start/Options** com foco em qualquer lugar inicia a sessão; **Y/△** abre "Todos os ajustes" (interface Desktop). Resultado: ______ - [ ] As dicas do rodapé mostram A/B/☰/Y com Xbox e ✕/○/OPTIONS/△ com PlayStation. Resultado: ______ - [ ] Teclado: setas, Enter e Esc fazem o mesmo que D-pad, A e B. Resultado: ______ @@ -328,7 +303,7 @@ Pré-condições: Ajustes → Interface = **Automático** (padrão). Pré-condições: lançador = Steam Big Picture; Ajustes → "Mandar a Steam para a bandeja ao voltar ao PC" **ligado** (padrão); nenhum jogo aberto. -- [ ] Voltar ao PC por cada caminho (botão "Voltar ao PC", menu da sessão, atalho do controle, `consolemode://stop`, tray → Restaurar): o **Big Picture fecha**, a janela principal some e a **Steam continua em execução na bandeja**. Resultado: ______ +- [ ] Voltar ao PC por cada caminho (botão "Voltar ao PC", menu da sessão, atalho do controle, tray → Restaurar): o **Big Picture fecha**, a janela principal some e a **Steam continua em execução na bandeja**. Resultado: ______ - [ ] Sair pelo próprio Big Picture (Sair → Sair do Big Picture): a mesa volta e a Steam permanece na bandeja. Resultado: ______ - [ ] O processo da Steam continua no Gerenciador de Tarefas; clicar no ícone da bandeja reabre o cliente sem login nem reinício. Resultado: ______ - [ ] Com um **jogo da Steam rodando**: a Steam fica aberta e o log mostra `Steam: mantida aberta (jogo em execução, id …)`; o Big Picture ainda é fechado. Resultado: ______ @@ -341,39 +316,13 @@ Pré-condições: lançador = Steam Big Picture; Ajustes → "Mandar a Steam par - [ ] Janelas de jogo, chat/popups da Steam e outros aplicativos não recebem o pedido de fechamento da janela principal. Resultado: ______ - [ ] Se o Big Picture demorar a fechar (travado), a restauração da mesa continua e termina normalmente (o log mostra `Big Picture ainda aberto`). Resultado: ______ -## 3c. Controle da TV: Google TV / Android TV (issue #75) - -### Volta na 1.7.1 (#207) - -- [ ] Sistema mostra de novo a categoria **TV**; o direcional e o mouse chegam nela e nas outras sem buracos. Resultado: ______ -- [ ] Com a TV configurada na 1.6 (ou no Legacy): o `config.json` mantém o bloco `tv`, a sessão liga a TV e troca a entrada, e a volta a coloca em espera se a opção estiver ligada (o log tem "TV: ligar" / "TV: desligar"). Resultado: ______ -- [ ] Com um **Comando de entrada** próprio (ex.: `am start -n com.smartdevice.livetv/skyworth.skyworthlivetv.osd.ui.mainActivity.LiveTvScreenActivity` numa Coocaa/Skyworth): a TV vai para a entrada do PC. Resultado: ______ - -Pré-condições: TV Google TV / Android TV na mesma rede do PC, com **Depuração USB** (ou "Depuração pela rede") ativada nas Opções do desenvolvedor; Ajustes → TV → *Google TV / Android TV* com o IP e a entrada HDMI do PC. - -- [ ] **Testar agora** na primeira vez: a TV pede "Permitir depuração"; com "Sempre permitir" + "Permitir", a TV acorda e vai para a entrada do PC. O status mostra sucesso. Resultado: ______ -- [ ] **Testar agora** de novo: não pede mais permissão; com a TV em espera, ela liga e troca a entrada. Resultado: ______ -- [ ] Recusar o pedido na TV (ou esperar 60 s): o status explica que a TV não autorizou este PC. Resultado: ______ -- [ ] IP errado / TV fora da rede: o status diz que a TV não respondeu, em poucos segundos. Resultado: ______ -- [ ] TV acessível pela rede, mas sem responder ao teste ADB: o status informa o limite de 90 s e o botão **Testar agora** volta a ficar disponível. Resultado: ______ -- [ ] **Jogar agora** com a TV em espera: ela liga, troca para o PC e o modo console segue normal. O log tem `TV: ligar (androidTv) ok`. Resultado: ______ -- [ ] Com a TV desligada da tomada: o modo console não trava; o log tem `TV: ligar ... falhou` e o fluxo segue (a TV não aparece, o app avisa como antes). Resultado: ______ -- [ ] TV que some da rede em espera + **MAC** preenchido: o log mostra `enviando Wake-on-LAN` e a TV liga (com "Ligar pela rede" ativo na TV). Resultado: ______ -- [ ] **Colocar a TV em espera ao restaurar** ligado: ao sair do Big Picture, a mesa volta e depois a TV entra em espera. Desligado (padrão): a TV continua ligada. Resultado: ______ -- [ ] TV que ignora a tecla HDMI: preencher **Comando da entrada** faz a troca funcionar. Resultado: ______ -- [ ] Escolher "Não controlar": os campos somem e nada é enviado à TV, e **Jogar agora** não demora mais do que antes (nenhuma linha `TV:` no log). Resultado: ______ -- [ ] O arquivo `adbkey.pem` na pasta de dados começa com `dpapi:` (não com `-----BEGIN`). Copiar a pasta de dados para outro usuário do Windows: o log mostra "chave ADB de outro usuário/PC; criando outra" e a TV pede permissão de novo. Resultado: ______ -- [ ] TV desligada da tomada: **Jogar agora** espera no máximo ~30 s pela TV e segue (o log mostra o tempo). Resultado: ______ - ## 3d. Configurações no modo Console -- [ ] Em Sistema, as configurações do modo PC também estão disponíveis: caminho do Playnite, fechar a Steam, Android TV, FPS personalizado, atalhos, diagnóstico do controle, tutorial e pasta de dados. Resultado: ______ +- [ ] Em Sistema, as configurações do modo PC também estão disponíveis: caminho do Playnite, fechar a Steam, atalhos, diagnóstico do controle, tutorial e pasta de dados. Resultado: ______ - [ ] Configurar, alterar e remover os atalhos de abrir o app, menu da sessão e voltar ao PC; uma combinação em conflito mostra o mesmo erro do modo PC. Durante a captura, os botões não navegam nem iniciam uma sessão. Resultado: ______ - [ ] Na captura, apertar e soltar B/○ sozinho cancela sem alterar o atalho; B/○ de novo fecha o editor e devolve o foco à configuração. B/○ junto com outro botão ainda pode ser salvo como combinação, mas B/○ sozinho não é um atalho válido. Teclado e mouse também conseguem abrir e fechar o editor sem acionar opções atrás dele. Resultado: ______ - [ ] Alterar uma configuração no modo Console, trocar para PC e reabrir o app: o valor permanece igual nas duas interfaces. Resultado: ______ - [ ] Selecionar e limpar o caminho do Playnite; cancelar o seletor mantém o valor anterior. Resultado: ______ -- [ ] Configurar a Android TV no modo Console: endereço, MAC opcional, entrada HDMI, comando da entrada e espera ao restaurar; Testar agora mostra o resultado e libera o botão após erro ou timeout. Resultado: ______ -- [ ] Selecionar FPS personalizado e digitar o limite; o modo PC mostra o mesmo valor. Sem RTSS disponível, a configuração respeita a mesma indisponibilidade das duas interfaces. Resultado: ______ - [ ] Copiar o diagnóstico do controle, abrir a pasta de dados e rever o tutorial no modo Console; ao voltar, o foco continua em uma opção visível. Resultado: ______ - [ ] Passar o mouse sobre categorias, opções, abas e cards: o realce aparece e some suavemente (sem cinza brusco), e o texto não fica apagado ao clicar; clicar afunda o item de leve. Trocar de categoria acende a barra verde e o nome com transição. Resultado: ______ - [ ] Desativar uma opção (ex.: atalho de toque curto sem atalho Home) a deixa esmaecida e sem realce. Menu da sessão: as mesmas linhas e cards continuam legíveis no tema claro. Resultado: ______ @@ -444,7 +393,6 @@ Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (te ### Outras estratégias - [ ] "Cortinas pretas": as telas da mesa ficam pretas e voltam ao restaurar. Resultado: ______ -- [ ] "Desligar por DDC/CI" (monitor com DDC/CI ligado no menu dele): as telas da mesa apagam e voltam a acender ao restaurar. Resultado: ______ ### Aplicativo personalizado @@ -501,43 +449,6 @@ Pré-condições: 1.6 instalada por cima da 1.5, com a configuração da 1.5 (te - [ ] Reduza a altura da janela e confirme que o editor rola até **Voltar**, sem esconder os cartões. - [ ] Feche o editor durante uma captura e confirme que ela para; reabra-o e confirme que nenhum botão fica preso em captura. -## Contador de FPS (RTSS) - -Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Display" ligado; MSI Afterburner aberto com o OSD dele ligado. - -- [ ] Sem o RTSS instalado, a linha "Contador de FPS" não aparece no menu da sessão e o cartão em Ajustes fica desabilitado. -- [ ] Na prévia (menu aberto fora de uma sessão), a linha não aparece. -- [ ] Config nova: o estilo é "Afterburner (não mexer)" e o OSD do Afterburner aparece normal na sessão. -- [ ] Em sessão, A na linha "Contador de FPS" abre a lista de ajustes do contador. A em "Estilo" alterna Afterburner → Desligado → Apenas FPS → Compacto → Detalhado → Personalizado → Afterburner, e o jogo muda na hora; a lista continua aberta com o foco na mesma linha. -- [ ] Na lista do contador, Tamanho, Posição, Fundo em card e Cor mudam o contador na hora; com Personalizado aparecem "Tudo em uma linha" e os itens (com ✓ nos ligados), e A liga/desliga cada um. B fecha a lista e volta para a linha do contador. Os ajustes ficam salvos e aparecem iguais em Ajustes. -- [ ] Desligado: nada na tela, nem o nosso nem o do Afterburner (no máximo um piscar rápido do Afterburner de vez em quando). -- [ ] Compacto / Detalhado / Personalizado: só o nosso aparece; o do Afterburner fica escondido. -- [ ] Afterburner: o nosso some e o do Afterburner volta em até 1 s. -- [ ] Ajustes → Contador de FPS → Personalizado: marcar/desmarcar API, FPS e tempo de quadro, "Tudo em uma linha" e a cor muda o contador no jogo na hora (com a sessão ativa). -- [ ] Personalizado sem nenhum item marcado ainda mostra o FPS. -- [ ] Com o RTSS fechado, ligar Compacto abre o RTSS e o contador aparece. -- [ ] Voltar ao PC: o nosso some e o do Afterburner volta. -- [ ] A escolha e o layout ficam salvos para a próxima sessão. -- [ ] Com Compacto (ou outro estilo nosso) já salvo em Ajustes, iniciar a sessão: o contador aparece e o do Afterburner some sem precisar mexer na linha do menu. - -### Card, tamanhos e dados do PC (1.6.1) - -- [ ] Apenas FPS / Compacto / Detalhado aparecem dentro de um card escuro, translúcido e de cantos arredondados, com uma folga em volta do texto; o card acompanha o tamanho do texto (não cobre a tela toda nem o OSD de outro programa). -- [ ] Posição "A do RTSS": o card fica na posição do OSD escolhida no RTSS. -- [ ] Posição em cada um dos quatro cantos: o contador vai para aquele canto da tela, com e sem o card, e não sai da tela nos cantos da direita e de baixo. -- [ ] "Fundo em card" desligado: o texto volta a ficar direto sobre o jogo, sem fundo. -- [ ] Tamanho Pequeno / Médio / Grande muda o tamanho de todo o contador na hora; no Grande o texto continua nítido e as unidades (FPS, %, GHz) ficam alinhadas na base dos números. -- [ ] Compacto: uma linha com FPS, CPU %, GPU % e RAM %; os números não fazem o texto "pular" quando mudam de 2 para 3 dígitos. -- [ ] Detalhado: FPS, tempo de quadro e API na primeira linha; CPU (uso e clock), GPU (uso, clock e °C), VRAM (usada / total) e RAM (usada / total) em linhas alinhadas. -- [ ] Os valores batem com o Gerenciador de Tarefas (CPU %, velocidade, GPU %, memória dedicada, temperatura da GPU) e atualizam a cada ~1 s. -- [ ] No primeiro segundo os valores aparecem como "--" e depois são preenchidos. -- [ ] Notebook com GPU integrada + dedicada: os dados de GPU são da placa que está rodando o jogo. -- [ ] GPU cujo driver não informa temperatura ou clock: esses itens simplesmente não aparecem (sem "0 MHz"). -- [ ] Personalizado: marcar/desmarcar cada item do PC (uso/clock da CPU, RAM, VRAM, uso/clock/temperatura da GPU) muda o contador na hora; com "Tudo em uma linha" ligado, fica tudo numa linha. -- [ ] Config salva na 1.6.0 com "Compacto": depois de atualizar, aparece "Apenas FPS" e o jogo mostra só o FPS. -- [ ] Voltar ao PC com Compacto/Detalhado: o contador some e não volta sozinho segundos depois. -- [ ] Uso de CPU do Console Mode com Detalhado ligado continua baixo (Gerenciador de Tarefas, < 1%). - ## Minimizar para a bandeja - [ ] Ajustes → "Minimizar para a bandeja" vem desligado; minimizar deixa a janela na barra de tarefas, como antes. @@ -592,14 +503,6 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] TV como tela de jogo com 2560x1440 @ 60 Hz em Sistema: a sessão começa e a TV muda de resolução **uma vez só** (sem apagar duas ou três vezes). O log tem "Telas: ... em 2560x1440@59 (pedido 2560x1440@60)" ou "@60", e nenhum "Não foi possível aplicar". Resultado: ______ - [ ] O mesmo com 3840x2160 @ 60 e com "Não alterar": nada muda para pior. Resultado: ______ -- [ ] Perfil por jogo salvo com @60: abrir o jogo com a TV já em @59 não faz a TV piscar. Resultado: ______ - -## Comando na TV ao voltar ao PC (#213, issue #209) - -- [ ] Android TV configurada, **Comando ao voltar ao PC** = `input keyevent 3`, espera desligada: ao voltar ao PC a TV vai para a tela inicial e continua ligada. O log tem "TV: voltar ao PC (androidTv) ok". Resultado: ______ -- [ ] O mesmo com a espera ligada: a TV vai para a tela inicial e depois entra em espera. Resultado: ______ -- [ ] Comando vazio e espera ligada: igual à 1.6 (só a espera). Comando vazio e espera desligada: nada é enviado (nenhuma linha "TV: voltar ao PC" no log). Resultado: ______ -- [ ] Com o comando de outra entrada (ex.: o `am start …` da Skyworth do PLEXX-DE para a HDMI dele), a TV troca para ela ao voltar ao PC. Resultado: ______ ## Interface Console no estilo console (1.7.0) @@ -611,7 +514,7 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] A num iniciador (ou um clique) só marca aquele iniciador, sem abrir nada; com A o foco desce para o Jogar agora, e é ele que abre. - [ ] Fonte Inter: os textos da interface Console e do menu da sessão usam a Inter (o "a" e o "g" de dois andares mudam de cara em relação à Segoe), em negrito de verdade no título e no Jogar agora, sem aparência borrada de negrito sintético. Conferir também no **portátil**: se a fonte não carregar, o app cai na Segoe UI sem quebrar. O modo PC continua com a Segoe UI. - [ ] Russo: o cirílico aparece na Inter, sem misturar fontes no meio da palavra. -- [ ] A linha embaixo do título mostra a resolução da tela de jogo e depois áudio, FPS, HDR e VRR quando ligados, separados por "·", e atualiza ao mudar cada um. +- [ ] A linha embaixo do título mostra a resolução da tela de jogo e depois áudio, HDR e VRR quando ligados, separados por "·", e atualiza ao mudar cada um. - [ ] Sem tela de jogo escolhida, o texto pede para escolher a tela e Jogar agora fica desativado. - [ ] O botão redondo ao lado de Jogar agora abre a aba Sessão. - [ ] Com capas da Steam como fundo, as capas aparecem mais à direita e o lado esquerdo e a parte de baixo ficam escuros; o texto continua legível. Com imagem própria e sem fundo também. @@ -629,7 +532,6 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] Atalhos (Controle): abrir o editor e voltar devolve o foco para a linha do atalho. - [ ] Teste do controle (Atalho, ajuda e dados): ao fechar, o foco volta para a linha. - [ ] Fundo, imagem do fundo e sons da interface ficam em App; Fechar a Steam ao voltar ao PC fica em Ao entrar no modo console. -- [ ] Campos de texto da TV e do FPS personalizado continuam aceitando digitação e as setas movem o cursor neles. ### Visual geral - [ ] Blocos e linhas sem borda fina, cantos mais arredondados, Jogar agora em formato de pílula; o contorno branco do foco aparece em tudo, inclusive no menu da sessão. @@ -642,7 +544,7 @@ Pré-requisito: RivaTuner Statistics Server instalado, com "Show On-Screen Displ - [ ] Ligar o HDR no Windows e clicar em **Atualizar**: a tela passa a "HDR on". - [ ] Áudio: lista as saídas, com a padrão do Windows e a escolhida no app marcadas; com "Ao conectar", nenhuma vem como escolhida. - [ ] Controles: com um Xbox e um DualSense ligados, os dois aparecem (Xbox / PlayStation); sem nenhum, "(none)". -- [ ] Programas: Steam, Playnite, RTSS e ControlFS com caminho e versão quando instalados, e "not found" quando não; "Launches" mostra o iniciador escolhido. +- [ ] Programas: Steam, Playnite e ControlFS com caminho e versão quando instalados, e "not found" quando não; "Launches" mostra o iniciador escolhido. - [ ] Log: as últimas ~50 linhas do `consolemode.log` aparecem no fim. - [ ] Nenhum caminho mostra o nome do usuário do Windows (`C:\Users\…\`), nem com Playnite instalado em `%LOCALAPPDATA%`. - [ ] **Copiar relatório** mostra o aviso de copiado e o texto colado no Bloco de Notas é igual ao da tela. @@ -683,7 +585,6 @@ Pré-condições: a opção **Tirar o ponteiro do mouse do caminho** ligada (é - [ ] Com uma soundbar ou receiver que liga junto com a TV: o áudio vai para a soundbar, não para a TV. Resultado: ______ - [ ] Controle que fazia o menu "subir sozinho": o menu fica parado; se o log mostrar `analógico fora do centro desde o início`, o direcional e os botões continuam navegando. Anote o modelo do controle. Resultado: ______ - [ ] Controle normal: o analógico navega como antes (na primeira leitura ele está no centro). Resultado: ______ -- [ ] Aba Sessão em espanhol, francês e russo: as legendas dos ajustes rápidos aparecem inteiras, em até duas linhas. Resultado: ______ ## Barra de título (#182) @@ -741,7 +642,6 @@ Pré-condições: um `config.json` sem `consoleTourDone` (vale para quem atualiz - [ ] Iniciado escondido (Iniciar com o Windows, `--start`, um controle conectando com o app na bandeja): a janela não aparece sozinha; ao abri-la pela bandeja, ela maximiza. Resultado: ______ - [ ] Só com mouse e teclado: clicar nas abas, Page Up / Page Down, setas, Enter e Esc navegam em tudo (Início, Sessão, Sistema, listas de opções, editor de atalhos). Resultado: ______ - [ ] Um `config.json` antigo com `"uiMode": "desktop"` abre normalmente na interface Console; a chave some na próxima gravação. Resultado: ______ -- [ ] Sistema → Extras opcionais, contador de FPS: estilo, tamanho, posição, cor, cartão, itens do jogo e do PC e "uma linha" mudam o contador na sessão; sem RTSS a linha do estilo fica desabilitada, e tamanho/posição/cor só valem com um estilo que desenha, os itens só no estilo personalizado. Resultado: ______ - [ ] Sistema → Ao entrar no modo console, com Aplicativo personalizado: "Argumentos" e "Processo a acompanhar" aceitam texto (o teclado na tela não é necessário para o resto) e ficam salvos ao reabrir. Resultado: ______ - [ ] Sistema → Atalho, ajuda e dados: "Diagnóstico → Copiar relatório" põe o relatório na área de transferência e mostra o aviso; a versão do app aparece no fim da lista. Resultado: ______ - [ ] Sistema: com o foco numa linha, a descrição dela aparece embaixo da lista (até 3 linhas); no trilho das categorias, some. Em alemão, francês e russo o texto não estoura. Resultado: ______ @@ -772,7 +672,7 @@ Pré-condições: um `config.json` sem `consoleTourDone` (vale para quem atualiz - [ ] Aviso de início de sessão (com o atalho do menu definido) e de bateria fraca: entra deslizando da borda direita da TV, sem aparecer em outra tela ao lado; o fundo em volta do card é transparente (sem retângulo preto); a barrinha verde esvazia e o aviso sai deslizando para a direita. O jogo não perde o foco em nenhum momento. Resultado: ______ -- [ ] Menu fora do modo console: com o atalho do menu definido e o Console Mode só na bandeja, segurar o atalho abre o Menu da sessão na tela de jogo (ou na principal, com a TV desligada), com o selo "Fora da sessão" e sem limite/contador de FPS. Resultado: ______ +- [ ] Menu fora do modo console: com o atalho do menu definido e o Console Mode só na bandeja, segurar o atalho abre o Menu da sessão na tela de jogo (ou na principal, com a TV desligada), com o selo "Fora da sessão". Resultado: ______ - [ ] Fora da sessão, **Controlar o mouse com o controle** move o ponteiro e clica; com a janela do Console Mode em primeiro plano o controle volta a navegar a interface (o mouse espera); com o menu aberto, também. **Ocultar o cursor** some com a seta. Começar uma sessão desliga os dois; fechar o Console Mode traz o cursor de volta. Resultado: ______ - [ ] Sistema → Controle → **Menu da sessão fora do modo console** desligado: o atalho não abre o menu fora da sessão (abre numa sessão), o ícone da bandeja continua abrindo; desligar com o mouse do controle ligado o desliga. Resultado: ______ diff --git a/docs/TRANSLATING.md b/docs/TRANSLATING.md index 4cfa4443..215698cd 100644 --- a/docs/TRANSLATING.md +++ b/docs/TRANSLATING.md @@ -1,12 +1,12 @@ # Translating Console Mode -Console Mode speaks English, Português (Brasil), Español, Deutsch, Français, Italiano and Русский. Thanks for helping it speak yours, or for fixing a line that reads wrong in your language. +Console Mode speaks English, Português (Brasil) and Italiano. Thanks for helping it speak yours, or for fixing a line that reads wrong in your language. You don't need Windows or a build environment: every text the app shows lives in one JSON file per language, and the tests that check it run on any OS. ## Fix or improve an existing translation -1. Open `src/ConsoleMode/Resources/Strings..json` for your language (for example `Strings.de-DE.json`). +1. Open `src/ConsoleMode/Resources/Strings..json` for your language (for example `Strings.it-IT.json`). 2. Change the **values**, never the keys. To find a text, search for it in `Strings.en-US.json`, then look up the same key in your file. 3. Open a pull request. If you'd rather not touch Git, [open a feedback issue](https://github.com/lippdev/consolemode/issues/new?template=feedback.yml) with the key (or a screenshot), the current text and your suggestion. @@ -31,7 +31,7 @@ A translated `README..md` and `docs/GUIDE..md` are welcome too, in a - **Keep it short.** Much of the app is read from the couch on a TV and laid out in cards and menu rows; a text much longer than the English may be cut. If your language runs long, prefer the shorter wording. - **Talk to the player** the way games and consoles in your language do (in most languages, informally). Keep one tone across the whole file. - **Use the official names** of things outside the app as they appear in your language: Windows settings, Steam, Big Picture, Xbox, PlayStation buttons (✕ ○ □ △), HDR, VRR. -- **Don't translate** product names: Console Mode, Steam Big Picture, Playnite, RTSS, ControlFS, the `Console Mode 1 Click` shortcut. +- **Don't translate** product names: Console Mode, Steam Big Picture, Playnite, ControlFS, the `Console Mode 1 Click` shortcut. ## Checking your work