Compare commits

..
2857 Commits
Author SHA1 Message Date
Sakamoto Shiina 942a257e79 Merge branch 'bugfix_ui_endpoint' into develop 2026-02-19 14:49:03 +09:00
Sakamoto Shiina 6b2be0f22b [Fix] UI: Add 'run' endpoint for selected translation and transcription compute type. 2026-02-19 14:47:04 +09:00
Sakamoto Shiina 242c022e33 Merge branch 'version' into develop 2026-01-20 03:43:39 +09:00
Sakamoto Shiina 0765908184 👍️[Update] Version 3.4.1 -> 3.4.2 2026-01-20 03:42:23 +09:00
Sakamoto Shiina f6a3b0e8fd Merge branch 'hotfix_update_available_error' into develop 2026-01-20 03:39:36 +09:00
Sakamoto Shiina 5811158231 [Hotfix] UI: SoftwareUpdateAvailableButton: Fix update check logic and rendering order. 2026-01-20 03:36:59 +09:00
misyaguziya 0cb2b7e6ae Merge branch 'version' into develop 2026-01-19 22:13:07 +09:00
misyaguziya 623d17e885 [Update] バージョンを3.4.0から3.4.1に更新 2026-01-19 22:12:32 +09:00
misyaguziya 4c95b66dd8 Merge branch 'bugfix_telemetry' into develop 2026-01-19 21:14:03 +09:00
misyaguziya 1656620ce4 [Update] テレメトリ機能の改善と不要なコードの削除 2026-01-19 21:12:16 +09:00
misyaguziya 597b0e15b0 Merge branch 'bugfix_languages' into develop 2026-01-17 22:51:07 +09:00
misyaguziya 6743735086 [Update] 中国語の表記を「中国」から「簡体字中国」と「繁体字中国」に変更 2026-01-17 22:44:29 +09:00
misyaguziya 096dd2c10b Merge branch 'version' into develop 2026-01-17 11:59:31 +09:00
misyaguziya 50c85ccd75 [Update] バージョン番号を3.3.2から3.4.0に更新 2026-01-17 11:59:07 +09:00
misyaguziya d4036e758c Merge branch 'readme' into develop 2026-01-14 15:32:43 +09:00
misyaguziya 0921ef578b [Update] テレメトリー機能を追加し、匿名データ収集の詳細をREADMEに記載 2026-01-14 15:27:40 +09:00
misyaguziya 6d34d6b041 Merge branch 'bugfix_clipboard' into develop 2026-01-13 21:12:19 +09:00
misyaguziya 4e5acd4ac3 [Update] クリップボード機能を統合し、コピーとペーストを一度の呼び出しで実行できるように変更 2026-01-13 21:12:05 +09:00
misyaguziya ba0f834fbd Merge branch 'bugfix_trans_model_name' into develop 2026-01-13 15:25:17 +09:00
misyaguziya c257591b21 [Update] 後方互換性のためのモデルの重みディレクトリ名変更機能を追加 2026-01-13 15:25:01 +09:00
misyaguziya d39d5a198e [Update] 互換性のために古いモデルのディレクトリ名を変更する機能を追加 2026-01-13 11:15:31 +09:00
misyaguziya 19f5c4fa75 Merge branch 'bugfix_tans_lang' into develop 2026-01-13 10:44:04 +09:00
misyaguziya 0f9f7ec3f3 [Update] 英語とポルトガル語の表記を修正 2026-01-13 10:40:46 +09:00
Sakamoto Shiina 7735d2b485 Merge branch 'ui' into develop 2026-01-13 10:39:23 +09:00
Sakamoto Shiina 261a1deed4 [Update] UI: Add Aptabase Privacy Policy label to telemetry settings. 2026-01-13 10:38:51 +09:00
Sakamoto Shiina 9987ca8dde Merge branch 'ui' into develop 2026-01-12 19:41:17 +09:00
Sakamoto Shiina c6d678e29e [Update] UI: Improve telemetry description for clarity and user reassurance. 2026-01-12 19:40:34 +09:00
misyaguziya 44f7a414ad Merge branch 'bugfix_llm_select' into develop 2026-01-11 17:58:31 +09:00
misyaguziya a31e47bf85 [Update] 翻訳エンジンのバックグラウンドチェックを削除し、エンジンのステータス確認を簡素化 2026-01-11 14:27:23 +09:00
misyaguziya 7dab5c4c06 Merge branch 'docs' into develop 2026-01-11 08:55:45 +09:00
misyaguziya 4559d83766 [Update] クリップボード機能の設計書を追加し、設定およびコントローラーの制御を明記 2026-01-11 08:55:30 +09:00
misyaguziya 40d2678c23 Merge branch 'bugfix_llm' into develop 2026-01-11 07:31:34 +09:00
misyaguziya bf7d2e61a7 [Update] 翻訳者クラスにLM StudioおよびOllamaの接続状態を管理する機能を追加 2026-01-10 23:50:36 +09:00
misyaguziya 7834a98a54 Merge branch 'bugfix_pip_list' into develop 2026-01-10 02:51:14 +09:00
misyaguziya bdd43eb3cb ペースト機能のために必要なパッケージを追加 2026-01-10 02:51:01 +09:00
misyaguziya d51b069bb2 Merge branch 'develop' of https://github.com/misyaguziya/VRCT into develop 2026-01-10 02:19:26 +09:00
misyaguziya 2d7f9b35ad Merge branch 'copy_and_paste' into develop
# Conflicts:
#	src-python/config.py
#	src-python/model.py
2026-01-10 02:19:01 +09:00
misyaguziya c2a906fca8 [Update] クリップボード機能の強化: VRモニタリングをバックグラウンドスレッドで実行し、機能の有効化/無効化を追加 2026-01-10 02:13:20 +09:00
Sakamoto Shiina 6d827ff2fb Merge branch 'ui' into develop 2026-01-10 00:26:14 +09:00
Sakamoto Shiina c6d5b6c6a8 [Fix] UI: useReceiveRoutes: add '/run/shutdown' endpoint. 2026-01-10 00:24:30 +09:00
Sakamoto Shiina de79f2799f [Update] UI: Telemetry: Add telemetry settings component. 2026-01-10 00:20:36 +09:00
misyaguziya 718706b2e4 Merge branch 'telemetry' into develop 2026-01-09 23:50:33 +09:00
misyaguziya 1bbc9e6182 feat: テレメトリ設定のプロパティ名を変更し、APIを追加してテレメトリの有効化/無効化を管理 2026-01-09 23:49:39 +09:00
Sakamoto Shiina 4f89f0d328 Merge branch 'ui' into develop 2026-01-09 22:55:46 +09:00
Sakamoto Shiina 6415656853 [Update] UI: Add Clipboard Feature as Voice Typing Mode settings. 2026-01-09 22:50:44 +09:00
misyaguziya c371eeff96 Merge branch 'telemetry' into develop 2026-01-09 22:34:26 +09:00
misyaguziya 19af0ea918 refactor: 不要なシャットダウン処理を削除し、アプリ終了時のテレメトリ送信を簡素化 2026-01-09 22:30:01 +09:00
misyaguziya 7336d01469 [Update] クリップボード機能の統合: コピーおよびペーストの設定を一つのプロパティにまとめ、関連するメソッドを整理 2026-01-09 19:35:55 +09:00
misyaguziya 4b29b283a1 Merge branch 'develop' into copy_and_paste 2026-01-09 19:18:58 +09:00
Sakamoto Shiina c11999c933 [Refactor] UI: Enhance backend error handling: refactor error codes and improve notification messages for various error scenarios. 2026-01-09 15:06:06 +09:00
misyaguziya 3f646a97d8 Merge branch 'refactoring_backend' into develop 2026-01-09 10:01:00 +09:00
misyaguziya d4a5a1ca6f 一旦フロントエンドまで接続 2026-01-09 10:00:33 +09:00
misyaguziya d157dc8b7b feat: テレメトリ機能を追加し、アプリの起動・終了時にイベントを送信するように変更 2026-01-08 09:16:18 +09:00
misyaguziya 4eb61fa4b7 feat: アプリ終了時の app_closed イベント処理を追加 2026-01-05 22:38:17 +09:00
misyaguziya 300c0d4648 feat: テレメトリ実装設計書を追加 2026-01-05 21:55:45 +09:00
misyaguziya c60995a0fe [Update] 初期化プロセスのログ出力を整理し、不要な時間計測を削除 2026-01-04 14:58:02 +09:00
misyaguziya dd1c47069c [Update] エラーハンドリングの構造を統一し、VRAM不足や接続エラーの通知方法を改善 2026-01-03 09:48:14 +09:00
misyaguziya 312999a50b [Update] Optimize initialization process: reduce startup time, implement caching for model weight checks, and enhance parallel processing for AI model checks. 2026-01-03 08:35:39 +09:00
misyaguziya b0cf8bf335 feat: Implement unified error handling system
- Added `errors.py` to define a centralized error management system with error codes and metadata.
- Created `VRCTError` class for generating standardized error responses.
- Introduced `error_handling_migration_guide.md` to document migration patterns for existing error handling to the new system.
- Updated error handling patterns in the codebase to utilize the new error management system.
2026-01-02 19:38:06 +09:00
Sakamoto Shiina cab7d48de1 Merge branch 'ui' into develop 2026-01-01 23:19:55 +09:00
Sakamoto Shiina 3a009ce336 [Update] Localization: Adjust keys and lines. add missing keys ko.yml, zh-Hans.yml, zh-Hant.yml 2026-01-01 19:10:39 +09:00
Sakamoto Shiina 457b5e04ee [Update] Add connection check functionality and new auth key labels in translation files. 2026-01-01 18:01:04 +09:00
Sakamoto Shiina 43f0bf6027 [Update] Adjust button padding and entry width in OpenWebpageButton; add responsive text size in SidebarSection 2026-01-01 14:38:47 +09:00
Sakamoto Shiina 3168a8ad26 [Update] Add new auth key URLs and update translation labels for key management. 2026-01-01 12:50:58 +09:00
Sakamoto Shiina 3d71dbacce Merge branch 'localization' into develop 2025-12-31 16:17:40 +09:00
Sakamoto Shiina 5ec12a5b57 [Update] Adjust column gap in AboutVrct.module.scss and update localization images 2025-12-31 16:04:28 +09:00
Sakamoto Shiina fdb1c0df75 [Update] Update last updated date in readme_first.txt to December 2025 2025-12-31 15:45:47 +09:00
Sakamoto Shiina 0325619407 Merge branch 'PR_73_localization' into localization 2025-12-31 15:00:39 +09:00
Sakamoto Shiina 74ba63e787 Merge branch 'ui' into develop 2025-12-31 13:00:32 +09:00
Sakamoto Shiina 263a8ad0d0 [Chore] Remove unnecessary label for ui checking. 2025-12-31 12:46:46 +09:00
misyaguziya 3771081210 Merge branch 'bugfix_build' into develop 2025-12-30 14:58:37 +09:00
misyaguziya 2a5044b86a [Fix] Update data paths in backend_cuda.spec to correct translation settings directory structure. 2025-12-30 14:58:19 +09:00
misyaguziya c806c0f93b Merge branch 'error_handling' into develop 2025-12-30 07:52:46 +09:00
misyaguziya 01061cf98f [Fix] Error Handling: Update setter methods to clarify None value handling and enhance authentication failure response policy. 2025-12-30 07:52:08 +09:00
misyaguziya 588b95eebe [Fix] Error Handling: Update setter methods to allow None values for type checks and enhance sensitive data handling in authentication failures. 2025-12-30 06:44:15 +09:00
misyaguziya 6014c2d362 [Fix] Error Handling: Refactor authentication response handling to avoid exposing sensitive data. 2025-12-30 06:07:46 +09:00
misyaguziya 4031a5556d [Fix] Error Handling: Update authentication check to use OpenRouter API for key validation. 2025-12-29 19:15:08 +09:00
misyaguziya bf1c0236b5 [Fix] Error Handling: Improve network disconnection handling and enhance logging mechanisms. 2025-12-29 16:27:27 +09:00
misyaguziya 063b79477f [Fix] Error Handling: Enhance authentication checks and add support for Groq and OpenRouter models. 2025-12-26 05:30:37 +09:00
Sakamoto Shiina 1a62ca04f0 [Fix] UI: Implement debounce for input changes in MessageFormat component. 2025-12-25 07:56:40 +09:00
Sakamoto Shiina 214edb083d Merge branch 'ui' into develop 2025-12-22 16:43:34 +09:00
Sakamoto Shiina 316843f875 [Fix] UI: Correct endpoint case for transcription receive error handling. 2025-12-22 16:25:11 +09:00
Sakamoto Shiina bf9b28d199 [Fix] UI: Fix error handling for LMStudio and Ollama connections. 2025-12-22 16:00:19 +09:00
Sakamoto Shiina 22e6af860d [Update] UI: Add Groq and OpenRouter components. 2025-12-22 15:18:30 +09:00
Sakamoto Shiina 4f2401551a Merge branch 'documents' into develop 2025-12-22 14:39:46 +09:00
Sakamoto Shiina b8c6d13dea docs: Add localized document URLs and update references in UI components. 2025-12-22 13:51:46 +09:00
misyaguziya 97ea17f649 docs: Remove obsolete URL properties from Config class 2025-12-16 18:10:42 +09:00
misyaguziya 86afa24d5b docs: Update documents link in README files 2025-12-16 17:37:34 +09:00
misyaguziya f3bace5376 docs: Remove Ko-fi support link from README files 2025-12-16 17:32:08 +09:00
misyaguziya 76134a465b Merge branch 'llm' into develop 2025-12-15 01:32:34 +09:00
misyaguziya dac903e07c feat: Implement translation prompt history injection for Chat/Mic/Speaker
- Added a history management system in model.py to store and retrieve recent messages from Chat, Mic, and Speaker.
- Updated controller.py to automatically add messages to the translation history after processing.
- Enhanced translation clients (OpenAI, Gemini, Groq, etc.) to accept and utilize context history for improved translation quality.
- Introduced YAML configuration options for enabling history injection and customizing its behavior across different translation models.
- Ensured that only original messages are stored in history to optimize token usage during translation.
2025-12-15 01:15:47 +09:00
misyaguziya 9e88cff889 Refactor translation settings and prompts
- Updated paths for translation settings in backend.spec and backend_cuda.spec to reflect new directory structure.
- Renamed loadPromptConfig to loadTranslatePromptConfig in translation utility files for consistency.
- Created new YAML files for translation prompts (gemini, groq, lmstudio, ollama, openai, openrouter, plamo) with standardized system prompts.
- Added languages.yml file to define language mappings for various translation backends.
2025-12-14 16:10:40 +09:00
misyaguziya 86a6de75ae [Add] Implement clipboard control functions in Controller class 2025-12-11 14:38:08 +09:00
misyaguziya 07bcf041b5 Merge branch 'add_llm' into develop 2025-12-11 14:17:39 +09:00
misyaguziya da4845f9ce [Add] README自動生成モード: プロジェクト解析に基づくREADMEファイル生成のための新しいモードを追加 2025-12-11 14:16:59 +09:00
misyaguziya c2cd5ee973 [Add] Documentation: Integrate Groq and OpenRouter API support, including model management and authentication details. 2025-12-11 14:16:02 +09:00
misyaguziya 658da465ea Merge branch 'add_llm' into develop 2025-12-11 09:53:31 +09:00
misyaguziya f327b8e4fa [Add] Controller: Update model selection logic for Groq and OpenRouter, and add corresponding API endpoints in mainloop. 2025-12-11 09:28:38 +09:00
misyaguziya 8b853f4c20 [Add] OpenRouter: Integrate OpenRouter API for authentication, model management, and translation capabilities. 2025-12-10 23:48:56 +09:00
misyaguziya e59d52815c [Add] Groq: Implement Groq API integration with authentication, model management, and translation capabilities. 2025-12-10 23:33:51 +09:00
Sakamoto Shiina 5144ddfa1b Merge branch 'ui' into develop 2025-12-10 17:09:01 +09:00
Sakamoto Shiina 11ef81f170 [Fix] UI: Corrected casing for LMStudio URL variable and updated related error handling logic. 2025-12-10 17:06:32 +09:00
Sakamoto Shiina 27454c8a88 [Update] UI: Add 'Correct Auth Key/Connection Required' message and update model selection logic for Plamo, Gemini, OpenAI, LMStudio, and Ollama components. 2025-12-10 17:02:32 +09:00
Sakamoto Shiina 5030c88eea [Update] UI: Add flex-shrink 0 to download button and dropdown menu styles for better layout control. 2025-12-08 13:04:28 +09:00
Sakamoto Shiina 4862a885c9 Merge branch 'ui' into develop 2025-12-04 14:55:07 +09:00
Sakamoto Shiina 318736553f [Fix] UI: Fixed an issue where the function name was incorrect. 2025-12-04 14:53:23 +09:00
Sakamoto Shiina 83edccabad Merge branch 'ui' into develop 2025-12-04 14:26:09 +09:00
Sakamoto Shiina a85320b874 [Update] UI: Enhance backend error handling for Plamo, Gemini, OpenAI, LMStudio, and Ollama authentication keys and models. 2025-12-04 14:24:44 +09:00
超级有节操的逆袭 6c8620e7f7 Merge branch 'misyaguziya:develop' into develop 2025-12-01 15:33:12 +08:00
Sakamoto Shiina 14a4a1ed99 [Update] Add an error notification that is when an invalid endpoint or message is received(mostly frontend side endpoint error handling bug). 2025-11-29 15:58:52 +09:00
超级有节操的逆袭 e8abeecd1b chore: add .qoder/ directory to .gitignore 2025-11-29 01:34:08 +08:00
misyaguziya 592149afed Merge branch 'build' into develop 2025-11-25 21:47:14 +09:00
misyaguziya 3ce8590ce2 buildドキュメントを追加 2025-11-25 21:46:48 +09:00
misyaguziya 318928d049 Merge branch 'bugfix_ollama' into develop 2025-11-25 18:43:42 +09:00
misyaguziya ea4863f195 入れ込み忘れを修正 2025-11-25 18:43:16 +09:00
Sakamoto Shiina e89da88c19 Merge branch 'ui_add_new_translation_engines' into develop 2025-11-25 13:42:58 +09:00
Sakamoto Shiina fca4be5951 [Update] UI: Add 'get' endpoints for connection status retrieval. 2025-11-25 13:41:02 +09:00
Sakamoto Shiina ead734983c Merge branch 'update_llm_connect' into ui_add_new_translation_engines 2025-11-25 13:26:22 +09:00
misyaguziya 7f7413e050 [Update] utils: Change version update message to English 2025-11-25 12:22:22 +09:00
misyaguziya ff6ac43fee [Update] Build scripts and configuration: Added new build and install scripts, updated versioning in config files, and improved project structure. 2025-11-25 12:20:55 +09:00
misyaguziya 54ec5ba45d [Update] バージョン管理: package.json, tauri.conf.json, config.pyのバージョンを更新し、update_version.pyを追加 2025-11-25 00:22:23 +09:00
misyaguziya 9a35577ec6 [Update] Controller: Add methods for LMStudio and Ollama connection status checks 2025-11-24 18:01:30 +09:00
Sakamoto Shiina 8cc9255fd0 Merge branch 'bugfix_llm' into ui_add_new_translation_engines 2025-11-23 09:48:39 +09:00
misyaguziya 5ca809c8dd [Update] Config: Add model revalidation logic to ensure selected models are valid based on available options. 2025-11-23 00:59:09 +09:00
misyaguziya add96c1fda [Update] Config: Enhance configuration persistence by filtering serializable properties and updating loading logic for managed properties. 2025-11-23 00:07:32 +09:00
misyaguziya 27b3006ffd [Update] Controller: Add error handling for empty translation model lists and improve logging for translation engine availability checks. 2025-11-20 01:38:50 +09:00
misyaguziya 4eac9654a7 clipboard機能のパイプラインを接続 2025-11-20 00:25:28 +09:00
Sakamoto Shiina ef06cd1c7a [Update] UI: Implement LLM connection handling and add connection check UI components.(Test UI) 2025-11-19 17:19:39 +09:00
Sakamoto Shiina e1125ae241 [Update] UI: Add new translation engines and adjust UI styles for better layout. 2025-11-19 08:31:07 +09:00
超级有节操的逆袭 e390adc651 [Update] Added missing translation data for both Simplified Chinese and Traditional Chinese. 2025-11-19 00:55:38 +08:00
Sakamoto Shiina e1662a4238 Merge branch 'ui_handle_osc_has_disabled' into develop 2025-11-18 09:12:09 +09:00
Sakamoto Shiina 1dd470e9d5 [Update] Display OSC unavailability warning on VRC mic mute sync setting. 2025-11-18 09:07:25 +09:00
Sakamoto Shiina fbbc1a8d45 [Fix/Update] FIx OSC availability handling and integrate into UI components. 2025-11-18 07:23:41 +09:00
misyaguziya 3cd37cf458 [Add] Implement clipboard functionality with support for Windows, Pyperclip, and Tkinter 2025-11-17 17:01:09 +09:00
Sakamoto Shiina d22c6c8f0c Merge branch 'ui_translation_api' into develop 2025-11-14 12:48:20 +09:00
Sakamoto Shiina 430c9f5da2 [Update] UI: Add LM Studio and Ollama model components to the Translation section. 2025-11-14 12:41:05 +09:00
misyaguziya 81e90a285b Merge branch 'bugfix_config' into develop 2025-11-14 11:30:22 +09:00
misyaguziya 877f4cefa9 [Fix] Update configuration handling to improve stability and error management 2025-11-14 11:26:33 +09:00
Sakamoto Shiina 28b65deb95 [Refactor] Implement useSaveButtonLogic for managing save functionality in Translation settings. 2025-11-14 11:07:04 +09:00
misyaguziya 2cc7052d7a Merge branch 'bugfix_openai_auth' into develop 2025-11-14 10:58:16 +09:00
misyaguziya bc6798714d [Fix] Improve OpenAI authentication handling and error response 2025-11-14 10:42:40 +09:00
Sakamoto Shiina 11c16fadbd [Update] UI: Add Plamo, OpenAI and Gemini authentication key components and integrate them into the Translation section. 2025-11-14 09:40:25 +09:00
Sakamoto Shiina 3105df3486 [bugfix] Ensure the delete function is callable and correctly handled in config setters. 2025-11-13 15:55:00 +09:00
Sakamoto Shiina 3a31b0a9fe [Refactor] Introduce AuthKey component and update related containers and styles. 2025-11-13 12:58:34 +09:00
Sakamoto Shiina ef4a19d0bb [Refactor] Implement _OpenWebpageButton component and integrate it into DeeplAuthKeyContainer. 2025-11-13 12:17:18 +09:00
Sakamoto Shiina ddcf49e243 [Refactor] Integrate DeepL authentication key URL and enhance OpenWebpage_DeeplAuthKey component to accept props. 2025-11-13 12:01:32 +09:00
Sakamoto Shiina d6498a78ca Merge branch 'ui_refactor' into develop 2025-11-13 10:33:16 +09:00
misyaguziya 44b04ddef6 Merge branch 'refactor_endpoints' into develop 2025-11-13 10:02:40 +09:00
misyaguziya 215f5f6815 [Refactor] Update endpoint names to use 'selectable' prefix for mic, speaker, and translation engines 2025-11-12 20:55:08 +09:00
Sakamoto Shiina db60529466 [Update]: Allow inserting custom components into MultiDropdownMenu.
- For Device components Auto select device that is SwitchBox component.
2025-11-12 16:33:20 +09:00
Sakamoto Shiina ddcd19d5eb [Refactor] Separate SwitchBox into _atom and wrapper, add secondary label support. 2025-11-12 15:27:10 +09:00
Sakamoto Shiina d529ed8962 [Refactor] Introduce MultiDropdownMenuContainer template for layout consistency. 2025-11-12 14:48:13 +09:00
misyaguziya cfc0e9fcc4 [Feature] Add VAD parameters and no-repeat N-gram size to Config and AudioTranscriber 2025-11-12 12:42:04 +09:00
Sakamoto Shiina 4a852374ab [Refactor]: Introduce MultiDropdownMenu component for layout consistency. 2025-11-12 12:32:18 +09:00
Sakamoto Shiina 01327fa852 [Refactor] Introduce wrapper component for DropdownMenu to enhance versatility. 2025-11-12 10:18:26 +09:00
Sakamoto Shiina dc3c236791 [Refactor] Move DropdownMenu to _atoms directory. 2025-11-12 10:01:55 +09:00
Sakamoto Shiina b21a46e96e [Refactor] Extract container logic into TemplatesContainerWrapper. 2025-11-11 03:02:21 +09:00
Sakamoto Shiina 3612f2cb80 [Refactor] MessageFormats: Improve reusability of setting container templates. 2025-11-10 23:07:17 +09:00
Sakamoto Shiina 5d15b47b3e [Refactor] WordFilter: Improve reusability of setting container templates. 2025-11-10 22:55:29 +09:00
Sakamoto Shiina 2062849887 Merge branch 'ui_refactor' into develop 2025-11-08 07:47:13 +09:00
Sakamoto Shiina 1bdea275dc [Refactor] Improve slider logic flexibility.(Adjust to Vr section) 2025-11-08 06:46:52 +09:00
Sakamoto Shiina 4770908831 [bugfix] Correct postUpdateAction handling in slider component.
- Fixed bug where postUpdateAction was not properly passed as a prop to the slider component
- Prevented infinite re-renders by removing postUpdateAction from the dependency array
2025-11-07 08:09:18 +09:00
Sakamoto Shiina 9b69ffe8ff [Refactor/TMP2] Refactor slider logic and appearance settings
- Improve slider logic by adding useMemo for marks calculation and fixing floating point precision issues
- Add loop safety check to prevent infinite loops in createMarks function
- Remove show_label_values prop from TransparencyContainer
- Add proper decimal place handling for slider values
2025-11-07 06:41:33 +09:00
Sakamoto Shiina 2cd4ddc4a3 [Refactor/TMP1] Unify Slider components. (Appearance, Transcription.) VR section is commented out temporally. 2025-11-06 21:44:33 +09:00
Sakamoto Shiina e23bf223ae [Refactor] Improve clarity of slider logic by inverting label filtering. 2025-11-06 13:04:35 +09:00
Sakamoto Shiina c76b2981c6 [Refactor] Unify and encapsulate slider UI logic into useSliderLogic hook. Part 1. 2025-11-06 12:44:04 +09:00
Sakamoto Shiina 4adfc8fbc1 [Refactor] Export config hooks from index.js 2025-11-06 10:50:21 +09:00
Sakamoto Shiina 5cbd7618e3 [Refactor] Reorganize config hooks into config_page_setter folder. 2025-11-05 15:15:09 +09:00
Sakamoto Shiina db820375f1 [Refactor] Move to src-ui/views and src-ui/logics structure. 2025-11-05 11:49:48 +09:00
misyaguziya 62f7c6d534 Merge branch 'test_client' into develop 2025-10-30 22:04:34 +09:00
misyaguziya 3af594960a test_endpoints.py と docs/test_endpoints.md を追加: APIエンドポイント総合テストモジュールを実装・文書化
- 新規: src-python/test_endpoints.py を追加。メインループ統合の総合テストモジュールを実装
  - /set/data/* の動的値を実行時に /get/data/... から取得して self.config_dict にキャッシュしてから選択する方式を導入
  - main_instance の start()/controller.init() 呼び出しと、Watchdog 用の no-op コールバック設定を追加
  - main.mapping のすべての status を True に設定してテスト対象を列挙
  - /set/enable /set/disable /set/data /run /delete/data の個別テスト実装(single/all/random/specific パターン)
  - LLM/API 関連(plamo/gemini/openai/lmstudio/ollama 等)のモデルリスト取得・ランダム選択、認証キー/URL 系は期待ステータスに [200,400] を設定
  - マイク/スピーカー等の検証(閾値・タイムアウト)で不正値時に期待ステータスを [400] にするバリデーション追加
  - 実行系エンドポイント(/run/*)のテスト実装、テスト不能な操作は [401] でスキップ扱い
  - ランダムアクセステスト(全体/ON-OFF/特定セット)を実装
  - 翻訳の総当たりテスト機能と結果を translation_test_results.json に出力
  - テスト結果を収集する record_test_result と generate_summary によるサマリー出力を実装
  - 実行中のデバッグログ出力やスキップ/エラー時の詳細ログを追加

- 新規: src-python/docs/test_endpoints.md を追加。上記モジュールの目的・使用方法・取得/キャッシュ戦略・対象エンドポイント一覧などを文書化

目的: API エンドポイントの包括的な自動テスト基盤を整備し、動的値取得による安定化・LLM/API の接続挙動検査・ランダム負荷試験を容易にする
2025-10-30 22:03:37 +09:00
misyaguziya 7f3db2f82c test_client.pyを改善: /set/data/ のモデル/認証キー/URL系エンドポイント(plamo,gemini,openai,lmstudio,ollama)で expected に [200,400] を追加。データが None の場合のスキップ条件を見直し、expected に 400 が含まれる場合はデータ無しでもリクエストを送信してテストするように変更。 2025-10-29 23:37:12 +09:00
misyaguziya 5f3dcbec81 Merge branch 'bugfix_config' into develop 2025-10-29 11:51:58 +09:00
misyaguziya 8e73469e41 backend_test.mdを更新・mainloop.mdを更新・test_client.mdを追加: /set/data/* の実行時取得とキャッシュ挙動を文書化して動的値選択の理由を追記、mainloopの start() 簡素化(メインループ維持、KeyboardInterruptでstop)と Watchdog(/run/feed_watchdog) 連携を明記、status=348ログ取り扱い・初期化待機・Watchdog運用などドキュメント整形と説明強化 2025-10-29 11:51:04 +09:00
misyaguziya 30f5b44168 test_client.pyを改善: サイレントモード・348ログ展開・自動テストのエクスポート機能を追加
- TestClient.send_request に silent 引数を追加し、詳細ログの抑制に対応
- バックエンド初期化待機/受信処理で status==348 をログ扱いとして全フィールドを整形表示するよう拡張
- 受信表示や他エンドポイントログの出力を silent フラグで抑制するよう修正
- AutomatedEndpointTester のコンストラクタを拡張 (silent, export_path, export_csv) とし、内部呼び出しで silent を伝搬
- テスト結果の JSON/CSV エクスポート機能を追加 (export_results / export_results_csv) とエクスポート用ユーティリティを実装
- インタラクティブメニューに詳細ログ抑制・出力ファイル選択オプションを追加し、AutomatedEndpointTester へ渡すようにした
- その他、watchdog/disable系呼び出し等で silent を使った出力抑制を適用
2025-10-29 11:22:38 +09:00
misyaguziya 66d102abf1 test_client.pyを改善: watchdog スレッドを追加して /run/feed_watchdog を30秒間隔で送信、初期化後に起動・cleanupで停止してjoinする処理と送信エラーのハンドリングを追加 2025-10-29 04:46:46 +09:00
misyaguziya cf5ce23839 test_client.pyを改善: 起動時のconfig.json削除を追加、初期化待機ロジックを拡張(VRCT_INIT_TIMEOUT対応、ソフトタイムアウト警告、30秒ごとの進捗ログ、プロセス終了検出とログ化、JSONログ表示の安定化)およびAutomatedEndpointTesterクラスを追加して run_all / run_random / run_specific を実装・メニューに統合 2025-10-29 04:38:49 +09:00
misyaguziya 65729d8cad test_client.pyを追加: バックエンドをsubprocessで起動しstdin/stdout経由で通信する対話式テストクライアントを実装。/run/initialization_completeの待機、リクエストデータのJSON→Base64変換、サンプルテスト/対話モード、色付きログ表示、タイムアウト・通信エラーのハンドリング、プロセスの安全なクリーンアップを含む 2025-10-28 23:03:26 +09:00
misyaguziya 5ce281e99b Main.startを簡素化し、受信/ハンドラスレッドの起動を削除してメインループで稼働を維持。KeyboardInterruptでstopを呼び出すように変更 2025-10-28 23:02:16 +09:00
misyaguziya 73969c2fb6 compute_typesをソートして出力を安定化、getBestComputeTypeのselected_typesを初期化してロジックを簡素化 2025-10-25 15:22:50 +09:00
misyaguziya a54538ee70 configのdictとlistの保存の問題を修正 2025-10-24 16:17:02 +09:00
misyaguziya c5d075253d Merge branch 'overlay_ruby' into develop 2025-10-23 16:24:05 +09:00
misyaguziya c97ceec3bc 長文の折り返しに対応 2025-10-23 16:23:50 +09:00
misyaguziya 72a82d82d8 Merge branch 'overlay_ruby' into develop 2025-10-23 15:39:37 +09:00
misyaguziya c9d09f1e08 不要なconfig Parameterを削除 2025-10-23 15:39:12 +09:00
misyaguziya a66459baa3 Merge branch 'overlay_ruby' into develop
# Conflicts:
#	src-python/config.py
2025-10-23 14:51:47 +09:00
misyaguziya 31e7ba2a08 Merge branch 'config' into develop 2025-10-23 14:42:24 +09:00
misyaguziya 0a9cb9952b overlay: 大ログにトランスリテレーション(ルビ)対応を追加し描画/APIを拡張
- controller/model: transliteration_message / transliteration_translation を伝搬するよう変更し、createOverlayImage* 呼び出しの引数を更新
- overlay: createTextboxLargeLogWithRubyTokens を実装し、大ログでのトークン単位ルビ描画(フォールバックロジック、外側パディング、行間等)を追加
- overlay: 小型ログAPI/呼び出しを transliteration_* 名に合わせて修正・簡素化
- docs: overlay_ruby.md に大ログ向け仕様と使用例を追記
2025-10-23 14:41:37 +09:00
Sakamoto Shiina ad8a5ce8a7 Merge branch 'ui_refactor_and_connect_to_backend' into develop 2025-10-23 11:28:39 +09:00
Sakamoto Shiina 4fdaf6611f [Refactor] Remove the commented code that is no longer needed. 2025-10-23 11:20:05 +09:00
Sakamoto Shiina d3ef567ef2 [Refactor/TMP5] Refactor UI components and connect to backend APIs. (VR(Overlay)) 2025-10-22 17:34:57 +09:00
misyaguziya 66d3c09a0d overlay: ルビ表示の上下パディングを対称化(outer_padding導入)しテキスト周囲にUIパディングを追加、ルビ機能のドキュメントを追加 2025-10-22 17:22:50 +09:00
Sakamoto Shiina e9287318c3 [Refactor/TMP4] Refactor UI components and connect to backend APIs. (MessageFormat) 2025-10-22 15:17:06 +09:00
misyaguziya 8be132abe6 overlay: フォントキャッシュ追加と小型ログのルビ描画を改善
- フォントのメモリキャッシュ(_font_cache)と _get_font を導入し truetype 読み込みを最適化
- createTextboxSmallLog を堅牢化(None対応、幅測定の例外処理、改行判定の改善)
- 単語単位ルビ描画機能を追加(renderRubyBlock / createTextboxSmallLogWithRubyTokens)
  - トークン毎の幅算出/センタリング、行折り返し検出時のフォールバック実装
- createOverlayImageSmallLog を拡張して、元文・翻訳それぞれにルビ適用とフォールバック合成を実行
- __main__ のテスト呼び出しを翻訳リスト形式に合わせて修正し、ルビテスト追加
2025-10-22 14:23:41 +09:00
Sakamoto Shiina 9473bdef13 [Update/Refactor/TMP3] Refactor UI components and connect to backend APIs. (WordFilter)
Remove message format redo function.
2025-10-22 13:41:08 +09:00
Sakamoto Shiina dfb08a96bb [Refactor/TMP2] Refactor UI components and connect to backend APIs. (Translation, Transcription models) 2025-10-22 12:04:05 +09:00
misyaguziya c8ffb329ba config: ManagedProperty/ValidatedProperty を拡張して自動シリアライズ登録を導入
- ManagedProperty / ValidatedProperty に serialize / readonly オプションを追加
- 属性の取得/設定で可変型(dict/list)を deepcopy するようにして外部からの破壊的変更を防止
- readonly プロパティへの書き込みを AttributeError で拒否
- _auto_register_descriptors() を導入し、serialize=True なディスクリプタを自動で json_serializable に登録して JSON シリアライズのボイラープレートを削減
- 多数の手動プロパティ/シリアライズ関数をディスクリプタ定義へ置換・整理し、バリデータ群を上部に集約
- 不要になった inspect インポートを削除
2025-10-21 23:16:42 +09:00
Sakamoto Shiina 36fb857dbb [Refactor/TMP1] Refactor UI components and connect to backend APIs. (Device, Appearance) 2025-10-21 13:17:37 +09:00
misyaguziya 98e2e50b34 config: ManagedProperty/ValidatedProperty を導入して Config を大規模リファクタリング
- 冗長な getter/setter を ManagedProperty / ValidatedProperty のディスクリプタで置換
- _apply_validated_set を追加して複雑なプロパティ設定と保存を共通化・安全化
- オーバーレイ設定・メッセージフォーマット・デバイス選択などのバリデータを整理・強化
- 各プロパティ用の JSON シリアライズヘルパーを追加
- device_manager 依存や初期化時の例外に対して堅牢化
- スクリプト単体実行時の簡易テスト出力を追加
2025-10-21 10:37:59 +09:00
misyaguziya dd0109d591 config: SEND_MESSAGE_FORMAT_PARTS / RECEIVED_MESSAGE_FORMAT_PARTS の定義と初期化を整理
- プロパティ/セッターと validate ロジックを関連する箇所へ移動
- init_config 内のデフォルト値初期化を移動して設定周りの構成を整備
- 動作に変更はなく、コードの可読性と構造を改善
2025-10-21 07:01:28 +09:00
misyaguziya caeb8b6888 Merge branch 'translate_api' into develop 2025-10-20 17:20:02 +09:00
misyaguziya 87d11c617c backend_test/docs: LMStudio/Ollama run 接続エンドポイントのテスト追加とドキュメント修正
- backend_test: /run/lmstudio_connection, /run/ollama_connection をテスト対象に追加(期待ステータス 200,400)
- docs: controller.md / mainloop.md の LMStudio/Ollama 接続エンドポイント表記を /get/data→/run に修正
- docs: APIキー検証の厳格化と翻訳モデル選択時の適用確実化に関する説明を追記
2025-10-20 12:23:16 +09:00
misyaguziya 306f0af734 controller: 翻訳モデル選択時にモデル適用とクライアント更新を確実に行うよう修正
- デフォルト選択時および明示的なモデル設定時に model.setTranslatorXModel(...) を呼び出し、モデル状態を確実に反映
- OpenAI/LMStudio/Ollama/Plamo/Gemini/Ollama でクライアント更新を適切な箇所に追加して整合性を向上

mainloop: LMStudio/Ollama 接続チェックのエンドポイントを run 系に変更、ローマ字変換関連を追加
- "/get/data/*_connection" → "/run/*_connection" に変更(LMStudio/Ollama)
- ローマ字変換(convert_message_to_romaji) のマッピングを追加(取得/有効化/無効化)

translation_ollama: 認証チェックのエンドポイント呼び出しを修正
- base_url + "/api/ping" ではなく base_url 直下に対して GET を行うよう変更(環境による応答差異に対応)
2025-10-20 03:48:41 +09:00
misyaguziya 452f564c00 backend_test: LLM/API関連の set/data テスト拡張とデバッグ出力を追加
- /set/data 系のテストに Plamo/Gemini/OpenAI/LMStudio/Ollama のモデル選択と認証キー投入を追加(/get/data/* でモデルリストを事前取得してランダム選択)
- LMStudio の URL を正常/異常ケースでランダム投入するテストを追加
- Deepl 等の認証キーの期待ステータスを [200, 400] に更新(成功/失敗両方を許容)
- set_data_endpoints の数をデバッグログ出力する行を追加
- transliteration 機能(convert_message_to_romaji / convert_message_to_hiragana)の enable/disable エントリをテスト用に追加
2025-10-20 01:30:41 +09:00
misyaguziya 49aafadd1c 認証キー検証を修正(Plamo/Gemini/OpenAI)
- Plamo API のキー判定を厳密化: 長さチェックを「==72」から「>=72」に変更して72文字以上を受け入れるように
- Gemini API の最小長を20→39に引き上げ
- OpenAI API キー判定を簡易長さチェックから厳格化: "sk-"で始まりかつ長さ>=164 を要求するように変更
- OpenAI のエラーメッセージを「長さが不正」から「無効」に変更して意図を明確化
2025-10-20 01:30:00 +09:00
misyaguziya bcfbf51696 LMStudio 認証呼び出しで base_url を明示渡しへ修正 + ドキュメント整備(ローカルLLM/言語マッピング/フォント等)
- controller: model.authenticationTranslatorLMStudio 呼び出しに base_url=config.LMSTUDIO_URL を明示的に渡すよう修正(LMStudio 接続判定で設定 URL を利用)
- docs: 新規ドキュメントを追加・更新
  - 追加: translation_gemini.md, translation_lmstudio.md, translation_ollama.md, translation_openai.md, translation_plamo.md
  - 更新: config.md, controller.md, mainloop.md, model.md, overlay.md, translation_languages.md, translation_translator.md, 仕様書.md(翻訳/モデル管理・エンドポイント・YAML 言語定義・フォント探索・VRAM フォールバック等の記載追加)
- ドキュメントに記載した主な変更点
  - LMStudio / Ollama のローカルLLM統合(モデルリスト/選択用プロパティ追加、接続確認エンドポイント)
  - CTranslate2 の言語定義を weight_type ネスト構造へ変更対応
  - 外部 YAML による言語マッピング導入(loadTranslationLanguages)
  - フォント探索を PyInstaller バンドル(_internal/fonts/) を考慮して強化
  - 認証後のモデルリスト自動更新・SELECTED_* プロパティ名統一、VRAM エラー検知時の自動フォールバック等の動作説明追加

(コードの振る舞いは既存処理に合わせた引数指定の修正とドキュメント反映が主体)
2025-10-20 01:19:49 +09:00
misyaguziya 83e72b37cc LMStudio 接続チェックとモデル選択処理を追加・強化、mainloop にエンドポイント追加、LMStudio/Ollama のモデル取得を例外耐性化
- Controller に checkTranslatorLMStudioConnection を追加し、接続成功時に SELECTABLE_TRANSLATION_ENGINE_STATUS や SELECTABLE_LMSTUDIO_MODEL_LIST を更新、選択モデルのフォールバック設定・クライアント更新・UI 更新呼び出しを行うよう実装
- setTranslatorLMStudioURL を接続成功時にモデルリスト/ステータス更新や選択モデルのフォールバック処理を行うよう拡張
- checkTranslatorOllamaConnection 成功時にも SELECTABLE_TRANSLATION_ENGINE_STATUS/モデルリスト更新、選択モデルフォールバック、クライアント更新、UI 更新呼び出しを追加
- mainloop に /get/data/lmstudio_connection エンドポイントを追加して LMStudio 接続チェックを公開
- translation_lmstudio.py と translation_ollama.py のモデル取得処理を try/except で保護し、例外時は空リストを返すよう修正(接続失敗やレスポンス異常に対する耐性向上)
2025-10-20 00:38:38 +09:00
misyaguziya e71bf17e13 各翻訳クライアントで supported_languages を YAML から translation_lang に移行・参照するよう修正、プロンプトYAMLの重複した supported_languages ブロックを削除、LMStudio のデフォルト URL を /v1 に変更、mainloop に LMStudio/Ollama のモデル関連エンドポイントと run_mapping を追加、Controller 内の Ollama 表記のtypo(Lollama→Ollama)を修正してメソッド名・ログ文を更新、各クライアントで translation_languages のフォールバック import を追加 2025-10-19 22:07:58 +09:00
misyaguziya 6596743b6b 翻訳言語定義を YAML に移行しロード処理を実装
- 言語マッピングを src-python/models/translation/languages/languages.yml として追加
- translation_languages.py を全面リファクタ:YAML から読み込み、構造検証、スレッドロック、キャッシュ対応を導入
- config.py に loadTranslationLanguages のインポート/フォールバックを追加し、Config 初期化時に言語定義を読み込むよう変更
- PyYAML を requirements.txt / requirements_cuda.txt に追記
- PyInstaller spec (backend.spec / backend_cuda.spec) に言語ファイル配布先を追加
- translation_ollama.py の loadPromptConfig 呼び出しを修正(ファイル名を明示)
2025-10-18 23:16:22 +09:00
misyaguziya 7e7b3505a1 LMStudio と Ollama の翻訳バックエンドを追加・統合。
- config: SELECTABLE_/SELECTED_ の LMStudio/Ollama 項目と LMSTUDIO_URL を追加。
- Controller: LMStudio/Ollama の認証チェック、URL取得/設定、モデル一覧取得/設定のエンドポイントを実装。
- Model/Translator: LMStudio/Ollama 用の認証・モデル一覧・モデル設定・クライアント更新メソッドを追加し、翻訳処理の選択肢に対応。
- translation_* クライアント: 各クライアントでのプロンプト読み込み処理を共通化し、translation_utils.loadPromptConfig を利用するようにリファクタ。
- translation_languages: LMStudio/Ollama 用の言語マッピングを追加。
2025-10-17 21:48:44 +09:00
misyaguziya 965bee818a LM Studio と Ollama の翻訳クライアントとプロンプトを追加、requirements に langchain-ollama を追記
- src-python/models/translation に LM Studio 用 (translation_lmstudio.py / translation_lmstudio.yml) を追加
- Ollama 用クライアント (translation_ollama.py / translation_ollama.yml) を追加
- 各クライアントでプロンプト YAML から system_prompt / supported_languages を読み込み、認証チェック・モデル一覧取得・モデル設定・クライアント更新・translate 呼び出しを実装
- requirements.txt と requirements_cuda.txt に langchain-ollama==0.3.10 を追記
2025-10-17 15:58:50 +09:00
misyaguziya 1b3c87bebe Merge branch 'device_run_mapping' into develop 2025-10-17 11:11:10 +09:00
misyaguziya 80a7fd7107 updateSelectedMicDeviceで選択マイクのホスト/デバイス通知を分割、restartAccessMicDevicesの戻り値と通知を調整、run_mappingにselected_mic_hostを追加(位置調整)
- Controller.updateSelectedMicDevice: これまで単一のペイロードで送っていた{"host", "device"}をやめ、selected_mic_hostとselected_mic_deviceを個別にrunで通知するように変更。
- Controller.restartAccessMicDevices: selected_mic_deviceのrun通知を追加し、戻り値をデバイス情報の辞書からSELECTED_MIC_HOSTに変更。
- mainloop.run_mapping: selected_mic_hostエントリを追加(配置を調整)して通知先キーを確実に登録。
2025-10-17 11:10:39 +09:00
misyaguziya c18748f6bc 翻訳モデル設定を SELECTED_* に統一し、Controller と UI 更新の連携を追加
- config: PLAMO_MODEL/GEMINI_MODEL/OPENAI_MODEL を SELECTED_PLAMO_MODEL/SELECTED_GEMINI_MODEL/SELECTED_OPENAI_MODEL にリネーム
  - JSON シリアライズキーも SELECTED_* に変更
  - 初期化フィールドを新キーに合わせて修正
- controller: すべての参照を新しい SELECTED_* プロパティへ置換
  - モデル一覧取得時に run コールバックで selectable リストを通知
  - 選択モデルを更新した際に run コールバックで選択状態を通知
  - モデル更新・クライアント再構築処理の呼び出しを保持
- mainloop: GUI 更新用の run_mapping に selectable/selected のモデル関連エンドポイントを追加
2025-10-16 21:55:27 +09:00
misyaguziya a862805a05 OpenAI関連のメソッド名を統一し、認証後のモデル更新処理を追加
- メソッド名を OpenAi -> OpenAI に統一(get/set/del/get_model_list/get_model/set_model)
- OpenAI 認証キー設定時にモデル一覧を取得して SELECTABLE_OPENAI_MODEL_LIST を更新、選択モデルが存在しなければ第一候補へフォールバックして OpenAI クライアントを再初期化する処理を追加
- model のメソッド名を setTranslatorOpenAiModel -> setTranslatorOpenAIModel に変更
- mainloop のエンドポイントマッピングを新しいメソッド名に合わせて更新
2025-10-16 18:53:45 +09:00
misyaguziya 526fd4d5aa 翻訳バックエンドを拡張・リファクタリング:OpenAI/Plamo/Gemini クライアントを追加・改修し、プロンプトを YAML から読み込むように変更。各クライアントでモデル一覧取得・認証・クライアント更新機能を実装し、Translator/Model 層の対応メソッドを追加。Controller と mainloop にプラモ・ジェミニ・OpenAI の認証/モデル操作エンドポイントを追加・整備。config のモデル/API設定をプロパティ化して既定値を None に変更し、選択肢リストを初期化。translation_languages に OpenAI 用マッピングを追加。requirements ファイルの依存記述を調整。 2025-10-16 18:09:08 +09:00
misyaguziya f8466bd6e4 翻訳APIの認証ロジックを改善し、YAMLファイルからプロンプト設定を読み込む機能を追加。新しいフォントファイルを追加し、データパスを更新。 2025-10-15 18:50:26 +09:00
misyaguziya 7d0f63c118 CTranslate2に対応する翻訳言語の設定を追加し、翻訳ロジックを更新 2025-10-14 23:15:49 +09:00
misyaguziya 6fc89fbb3e Merge branch 'develop' into translate_api
# Conflicts:
#	requirements.txt
#	requirements_cuda.txt
#	src-python/config.py
#	src-python/mainloop.py
#	src-python/model.py
#	src-python/models/osc/osc.py
#	src-python/models/translation/translation_languages.py
#	src-python/models/translation/translation_translator.py
#	src-python/models/translation/translation_utils.py
2025-10-14 12:47:47 +09:00
misyaguziya b0403cfa70 Merge branch 'refacta_backend' into develop 2025-10-14 12:14:28 +09:00
misyaguziya d1aef28c7a Add comprehensive detailed design documents 2025-10-14 07:28:03 +09:00
misyaguziya fcb1295302 Add documentation and coding guidelines for VRCT backend
- Introduced a comprehensive coding rules document outlining naming conventions, module structure, import order, type annotations, error handling, and testing practices.
- Created a specification document detailing project goals, target users, and functional/non-functional requirements for the VRCT project.
- Added a design document describing the application's architecture, initialization policies, concurrency models, and error handling strategies.
- Included a detailed design document specifying major classes, functions, data structures, and exception handling.
- Removed outdated mypy configuration and several unused scripts related to documentation verification and cleanup.
- Deleted test files for OSC and overlay imports as part of the cleanup process.
2025-10-13 22:55:48 +09:00
misyaguziya d4f89a734d デバイスマネージャーの監視機能を追加し、マイクおよびスピーカーの自動選択機能の有効/無効に応じて監視を開始・停止するロジックを実装。 2025-10-13 16:41:34 +09:00
misyaguziya 914789c9cb mainloopのスレッド管理を改善し、マルチワーカー化を実装。デバイス管理の初期化を遅延させ、エラーハンドリングを強化。ドキュメントを更新し、設定の変更点を明示化。 2025-10-13 08:28:27 +09:00
Sakamoto Shiina 2da132eebc Merge branch 'version' into develop 2025-10-10 09:30:16 +09:00
Sakamoto Shiina 127ff3e84a 👍️[Update] Version 3.3.0 -> 3.3.1 2025-10-10 09:29:35 +09:00
Sakamoto Shiina 69a3d36b20 Merge branch 'hotfix_slow_message_sending' into develop 2025-10-10 09:27:34 +09:00
Sakamoto Shiina 0e786cd04f [bugfix] Hotfix: Fix slowed message sending.(too much sent '/run/typing_message_box'). set 2 secs cool time. 2025-10-10 09:26:07 +09:00
misyaguziya 0130792682 mainloopモジュールのドキュメントを新規作成し、Mainクラスのstart()/stop()メソッドを追加。受信スレッドとハンドラスレッドのライフサイクル管理を明示化し、エラーハンドリングを強化。ポーリング負荷を低減するためにqueue.get()にタイムアウトを追加。 2025-10-09 22:52:15 +09:00
misyaguziya 6f33f8afbd Controllerの初期化時にmodel.init()を呼び出す互換レイヤを追加し、オーバーレイの存在チェックを安全に行うためのヘルパメソッドを導入。未使用のimportを削除し、ドキュメントを新規作成して変更点と注意事項を明示化。 2025-10-09 22:38:50 +09:00
misyaguziya 2b6611ef8e Modelクラスの初期化を遅延させる設計に変更し、各メソッドでのensure_initialized()呼び出しによって必要時にリソースを初期化するように修正。これにより、インポート時の副作用を抑止。 2025-10-09 21:47:19 +09:00
misyaguziya ba13443d1c config.pyのリファクタリングを実施し、外部モジュールのインポートをガードして安全性を向上。初期化時のエラーハンドリングを強化し、デフォルト値の取得を安全に行えるように修正。関連ドキュメントを新規作成し、変更点と利用上の注意を明示化。 2025-10-09 19:27:55 +09:00
misyaguziya 61cbe07f0f デバイス管理モジュールのインポートをガードし、Windows固有の依存関係をオプショナルに変更。クラスの初期化メソッドを修正し、デフォルトデバイス変更時のコールバックを追加。ドキュメントを新規作成し、使用例や注意点を明示化。エラーハンドリングを強化し、コードの可読性を向上。 2025-10-09 19:04:31 +09:00
misyaguziya eca5e31429 torchとctranslate2のインポートをガードし、安全なデフォルトを提供。型注釈とdocstringを追加して可読性を向上。ログ設定の重複ハンドラ追加を防ぐチェックを導入。encodeBase64はデコード失敗時に空辞書を返すように変更。getComputeDeviceListはGPU情報取得失敗時にCPU情報を返すように例外保護を追加。 2025-10-09 18:53:42 +09:00
misyaguziya 35e8d7dda9 スレッドセーフなトークナイザーアクセスのためにロックを追加。トークナイザーの呼び出し時に発生する可能性のあるRuntimeErrorを防ぐために、アクセスを直列化。 2025-10-09 18:43:12 +09:00
misyaguziya 944577eaf4 OSCモジュールのドキュメントを更新し、使用例や注意点を追加。型注釈を強化し、エラーハンドリングを改善。OSCHandlerクラスの初期化メソッドを修正し、サービスのアドバタイズ中の例外処理を追加。テストファイルを新規作成し、OSCモジュールのインポートテストを追加。 2025-10-09 17:39:52 +09:00
misyaguziya 690a2f081b ドキュメントを更新し、型注釈を追加してコードの可読性とメンテナンス性を向上。各モジュールの使用例や依存関係を明示化し、エラーハンドリングを改善。 2025-10-09 17:35:55 +09:00
misyaguziya b26129af68 翻訳モジュールのドキュメントを更新し、セットアップ手順やAPI使用例を追加。型注釈を強化し、関数の戻り値を明示化。エラーハンドリングを改善し、コードの可読性を向上。 2025-10-09 17:30:48 +09:00
misyaguziya 7d24b3839c 型注釈を追加し、関数の戻り値を明示化。コードの可読性と型安全性を向上。 2025-10-09 17:07:21 +09:00
misyaguziya 7255722b67 ウォッチドッグのドキュメントを更新し、使用例を追加。型注釈とエラーハンドリングの改善を反映。 2025-10-09 17:01:31 +09:00
misyaguziya 569d8e3f76 [ref] overlayのリファクタリングとテストを追加 2025-10-09 16:43:41 +09:00
misyaguziya c1cf78cda4 [改善] 型注釈の追加とドキュメントの更新
- config.py, controller.py, model.py, mainloop.py, utils.py での型注釈の追加
- CODING_RULES.md と api.md のドキュメントを更新
- 不要なコードの削除とリファクタリング
2025-10-09 13:34:05 +09:00
misyaguziya e67242a0c4 [新規追加] ドキュメントのエンドポイントとマッピングの検証スクリプトを追加 2025-10-09 13:15:01 +09:00
misyaguziya 5efa9c37d6 Add documentation for modules and runtime instructions
- Created detailed documentation for the device_manager, model, model_extra, osc, overlay, overlay_image, transcription, translation, transliteration, utils, watchdog, and websocket modules.
- Added a comprehensive run events payloads document outlining the payloads sent during various run events in the controller.
- Included runtime instructions and dependencies for setting up the project in a Windows environment.
- Introduced a mypy configuration file to manage type checking and ignore errors in specific modules temporarily.
2025-10-09 13:11:59 +09:00
Sakamoto Shiina b0fd63afbd Merge branch 'version' into develop 2025-10-09 09:24:14 +09:00
Sakamoto Shiina 28e952ada3 👍️[Update] Version 3.2.2 -> 3.3.0 2025-10-09 09:23:05 +09:00
Sakamoto Shiina 1a7c0b1e1d Merge branch 'ui' into develop 2025-10-08 16:30:11 +09:00
Sakamoto Shiina faec6e91ba [bugfix] UI: Fix the bug that the main functions ware not in loading status even while restoring the status 'enable'. 2025-10-08 16:25:15 +09:00
misyaguziya b23b40d8e4 Merge branch 'bugfix_error_message' into develop 2025-10-08 13:01:57 +09:00
misyaguziya 78a580f521 OSCQueryの名前解決のためservice名をユニークに変更
service_nameを "VRCT" -> f"VRCT:{UTC}"
2025-10-08 13:01:16 +09:00
misyaguziya 6c655b6043 [Update] OverlayImage: Improve font loading logic with error handling for font file paths 2025-10-07 19:01:55 +09:00
misyaguziya 2d6beef2ed Merge branch 'bugfix_translate_lang' into develop 2025-10-07 13:34:50 +09:00
misyaguziya a167e57ff0 [Update] Test: Add translation tests for all language pairs and log results
[Update] remove unsupported langs
2025-10-07 13:33:04 +09:00
misyaguziya cfd674bc5c Merge branch 'test' into change_translation_process 2025-10-06 16:44:33 +09:00
misyaguziya 4572aee2b7 [Update] Controller and Model: Refactor translation device management and add parameter change tracking 2025-10-06 16:40:05 +09:00
misyaguziya e2d401b848 実装漏れを修正 2025-10-06 14:30:35 +09:00
Sakamoto Shiina b632d66225 [Update] UI: Add disable translation function when config page has opened. 2025-10-06 14:30:24 +09:00
misyaguziya c7bae73363 Merge branch 'bugfix_auto_device_select' into develop 2025-10-05 21:16:18 +09:00
misyaguziya 4b0c7e9775 [Update] Controller and DeviceManager: Refactor device management methods for mic and speaker separation 2025-10-05 21:15:44 +09:00
misyaguziya eb08ed6ff6 Merge branch 'transliteration' into develop 2025-10-05 17:15:47 +09:00
misyaguziya ca07aef201 [Update] Translator: Add check to return original message if source and target languages are the same 2025-10-05 17:15:25 +09:00
misyaguziya 3ee7246224 [Feature] Transliterator: Implement contextual transliteration rules and integrate with analysis method 2025-10-05 16:18:58 +09:00
misyaguziya 7b1e9136ee [Update] Transliterator: Enhance transliteration control and improve tokenizer initialization 2025-10-04 22:25:55 +09:00
Sakamoto Shiina 3d674c64db Merge branch 'ui' into develop 2025-10-03 01:11:31 +09:00
Sakamoto Shiina 741cfed8c3 [Update/Chore] Localizations: Add texts to Romaji/Hiragana settings and adjust all locales languages. 2025-10-03 01:10:03 +09:00
misyaguziya df1ac3aaa0 Merge branch 'transliteration' into develop 2025-10-02 23:19:19 +09:00
misyaguziya c1011c4520 Merge branch 'bugfix_auto_device_select' into develop 2025-10-02 23:18:58 +09:00
misyaguziya 4b55a9bca2 [Fix] Controller: Remove redundant assignments in auto mic/speaker select methods 2025-10-02 23:05:06 +09:00
misyaguziya fe3fea34ff [Cleanup] Transliterator: Remove debug print statement from analyze method 2025-10-02 22:58:13 +09:00
Sakamoto Shiina 957cddfe18 [bugfix] UI: Transliteration: Fix the bug that isn't shown when only hiragana or only hepburn is provided. 2025-09-30 05:03:08 +09:00
misyaguziya e32e5c1b5f [Update] Transliterator: Change tokenizer mode to SplitMode.C and enhance analyze method for better reading assignment 2025-09-29 10:15:03 +09:00
misyaguziya c5a5fc62f7 Merge branch 'add_test_case' into develop 2025-09-28 06:58:13 +09:00
misyaguziya cde8b4b806 selected_translation_compute_type/selected_transcription_compute_typeのテストケースを追加 2025-09-28 06:57:58 +09:00
Sakamoto Shiina e7cd872fcc Merge branch 'bugfix_compute_type' into develop 2025-09-28 02:10:23 +09:00
Sakamoto Shiina 9a11c6ff9f [Update] Config Page: Compute Device/Type: Add localization and make compute types order properly. 2025-09-28 02:07:47 +09:00
Sakamoto Shiina e9067c05c6 [Update/Chore] UI: Compute Type: Rename and add endpoint '/run/'. 2025-09-27 07:55:45 +09:00
misyaguziya 6effedcce2 [Update] Refactor compute type management: rename properties to 'SELECTED_TRANSLATION_COMPUTE_TYPE' and 'SELECTED_TRANSCRIPTION_COMPUTE_TYPE' 2025-09-27 07:07:54 +09:00
misyaguziya 5366622fca [Update] Refactor compute device management: change methods to instance methods and set compute types to "auto" 2025-09-26 23:30:39 +09:00
Sakamoto Shiina 8c5f1b5db2 [Update/Chore] Config Page: Put the selectors 'Compute Device' and 'Compute Type' to the same section.
Rename: UI: CTranslate2/Whisper Compute Type to Translation/Transcription Compute Type.
2025-09-26 17:07:19 +09:00
misyaguziya 92f9d645f8 [Update] Refactor compute type management: rename CTranslate2 and Whisper compute types to Translation and Transcription 2025-09-25 22:56:16 +09:00
misyaguziya 0bb6bb5977 Merge branch 'refactoring_backend' into develop 2025-09-25 17:27:33 +09:00
misyaguziya 9e2c91905c SHOW_RESEND_BUTTONの条件を修正し、main_instanceの起動処理を簡素化 2025-09-25 17:27:08 +09:00
misyaguziya 361c7ca49a Merge branch 'unittest' into develop 2025-09-25 16:39:34 +09:00
misyaguziya 272ed8629f bugfix test case 2025-09-25 16:39:18 +09:00
misyaguziya 9fe6107ae3 Merge branch 'unittest' into develop 2025-09-25 12:48:03 +09:00
misyaguziya 96ffd5509f テストコードな名前を変更 2025-09-25 12:43:23 +09:00
misyaguziya 93bdec7922 エンドポイントテストにおいて、401および404ステータスの処理を追加し、該当するエンドポイントに対するテスト結果を記録する機能を実装。 2025-09-25 12:37:13 +09:00
misyaguziya 89a027a8e0 エンドポイントテストのリファクタリングを実施し、動的にエンドポイントを取得するように変更。テスト結果の記録機能を追加し、削除系エンドポイントのテストを新たに実装。テスト結果のサマリー表示機能も追加。 2025-09-25 12:30:35 +09:00
misyaguziya 53f1b95843 エンドポイントテストの期待されるステータスを強化し、リクエスト処理の結果を改善。データ設定系のエンドポイントにおけるランダムデータの範囲を拡大し、出力メッセージをフラッシュするように修正。 2025-09-24 23:51:22 +09:00
misyaguziya 1b0e93b8f8 特定のエンドポイントに対するランダムアクセスのテストを追加し、出力メッセージを改善。テストの範囲を拡大し、無効化エンドポイントの処理を強化。 2025-09-24 21:12:08 +09:00
misyaguziya c38e474385 エンドポイントテストを強化し、ON/OFF状態のテストメソッドをリファクタリング。データ設定系および実行系エンドポイントのテストを追加し、ランダムアクセスのテストを実装。 2025-09-24 01:06:11 +09:00
misyaguziya 95cf247e2e 処理の安定化のために待機時間を追加し、エンドポイントテストを強化。テストケースを整理し、実行系のエンドポイントテストを新たに追加。 2025-09-23 23:19:35 +09:00
misyaguziya d9f1dabecb テストメソッドの出力メッセージを改善し、データ設定系のエンドポイントテストを追加 2025-09-23 20:51:09 +09:00
misyaguziya a4656a5081 Controllerクラスの設定メソッドを修正し、重複した設定を防止する条件を追加。テストケースを更新し、ON/OFF状態のランダムアクセスと連続テストを強化。 2025-09-23 16:56:11 +09:00
misyaguziya 1689a45e3e Refactor test_endpoints.py: Enhance endpoint testing with structured tests for ON/OFF states, random access, and continuous testing. Introduce Color class for colored output and streamline endpoint handling logic. 2025-09-23 14:45:08 +09:00
misyaguziya 29ca5bfbe1 [WIP/TEST] Mainクラスの初期化ロジックを改善し、テスト用のエンドポイントを追加 2025-09-23 07:25:48 +09:00
misyaguziya 46584a0e3e Merge branch 'bugfix_overlay' into develop 2025-09-19 22:50:10 +09:00
misyaguziya c171588ba9 [bugfix] Chat機能より改行を含む文章を送信した場合に、マルチラインのoverlayの表示に失敗する問題を修正 2025-09-19 22:49:48 +09:00
misyaguziya 9d94fd6a5e [Update] Refactor compute type management: unify device list retrieval and remove deprecated methods 2025-09-19 18:09:39 +09:00
Sakamoto Shiina 9fd61677f9 [Update/Chore] Config Page: Add 'Whisper Compute Type' Selection.
UI: Rename 'Whisper compute device' to 'Transcription compute device'.
2025-09-19 15:58:19 +09:00
Sakamoto Shiina 4808dcbc96 [Update/Chore] Config Page: Add 'CTranslate2 Compute Type' Selection.
UI: Rename 'CTranslate2 compute device' to 'Translation compute device'.
2025-09-19 14:43:13 +09:00
misyaguziya ed02493a77 Merge branch 'bugfix_init' into develop 2025-09-19 11:07:50 +09:00
misyaguziya 6501e0c1d7 [Update] 修正: SELECTED_TARGET_LANGUAGESの初期化ロジックを改善し、最初の言語のみを有効化 2025-09-19 11:06:23 +09:00
Sakamoto Shiina 1c5ca0b7a5 Merge branch 'transliteration' into develop 2025-09-18 10:21:46 +09:00
Sakamoto Shiina 56af62029a [Update] Add transliteration position navigator when hiragana and romaji is both enabled and mouse hovered. 2025-09-18 00:06:09 +09:00
Sakamoto Shiina 17e450310e [bugfix] Fix the bugs:
A message resend/edit feature that was not working.
Romaji didn't show up even when mouse hover at some point.
2025-09-17 23:32:35 +09:00
misyaguziya 7274c514a7 [Update] トランスリテレーション処理を有効化する条件を追加 2025-09-17 21:40:28 +09:00
Sakamoto Shiina 9cf4a378f1 [Update] UI: ローマ字/かな 表示するように。 2025-09-17 18:07:10 +09:00
misyaguziya 396d5d7d88 メッセージのトランスリテレーション処理を改善し、日本語の条件を簡素化 2025-09-17 17:52:12 +09:00
misyaguziya c9dd352565 メッセージの変換処理を改善し、日本語のトランスリテレーションの条件を整理 2025-09-17 17:05:59 +09:00
misyaguziya 5ed0d555b9 Transliteration変数の名称を変更し、メッセージ処理の一貫性を向上 2025-09-17 15:28:45 +09:00
misyaguziya 4617954928 [Add] Implement Transliterator class and katakana to Hepburn conversion function 2025-09-17 14:09:36 +09:00
misyaguziya 3d34b50793 ConfigクラスにSELECTED_TAB_TARGET_LANGUAGES_NO_LISTプロパティを追加し、メッセージの変換処理を改善 2025-09-17 12:35:14 +09:00
misyaguziya fad01f6f90 [Change] ファイル名を変更 2025-09-17 11:26:44 +09:00
misyaguziya 5f0f918642 [Update] Rename and add methods for CTranslate2 compute type management in Controller 2025-09-17 10:52:56 +09:00
misyaguziya 245855d0ca [Update] Add compute type management for CTranslate2 and Whisper models 2025-09-17 10:35:34 +09:00
misyaguziya 224eaf3cef [Add] translation_gemini: Integrate Gemini translation model and authentication; [Update] controller: Implement methods for managing Gemini models and auth keys; [Update] mainloop: Add routes for Gemini model and auth key management; [Update] translation: Enhance Translator class for Gemini API support; [Update] translation_languages: Add Gemini language mappings 2025-09-15 17:42:09 +09:00
misyaguziya d3c206fb26 [Add] Implement Transliterator class for kanji and okurigana analysis; update requirements and spec files 2025-09-15 05:33:30 +09:00
misyaguziya 0d121ecaad [Update] Enhance kanji and okurigana processing in Transliterator class 2025-09-15 05:22:57 +09:00
misyaguziya 2efedfb572 [Add] Implement transliterator and katakana to Hepburn conversion functions 2025-09-15 05:00:24 +09:00
misyaguziya 5a9a13146c [Update] Refactor transliteration function to accept parameters for hiragana and romaji conversion 2025-09-12 16:06:12 +09:00
misyaguziya e3555d204e [Update] requirements: Add langchain-google-genai to dependencies; [Add] translation_gemini: Implement GeminiClient for translation functionality 2025-09-12 14:40:35 +09:00
misyaguziya 4e53584cff [Update] mainloop: Improve receiver loop to handle empty input and add stop message
[Update] osc: Refactor OSC query service initialization to run in a separate thread
2025-09-11 23:11:39 +09:00
misyaguziya 6bf09970a4 Merge branch 'develop' 2025-09-11 19:06:34 +09:00
misyaguziya 484d201cb0 Merge branch 'workflow' into develop 2025-09-11 19:06:02 +09:00
misyaguziya bbfc61b335 [Update] Fix Hugging Face CLI commands for tagging and uploading model 2025-09-11 19:05:26 +09:00
misyaguziya 8f9968df33 Merge branch 'develop' 2025-09-11 18:06:55 +09:00
misyaguziya ffcd868724 Merge branch 'workflow' into develop 2025-09-11 18:06:22 +09:00
misyaguziya 06e1e73018 [Update] Change Hugging Face CLI commands to use new syntax and specify version for huggingface_hub installation 2025-09-11 18:05:50 +09:00
misyaguziya 7bed19c81f [Update] controller: Change Plamo model list to selectable models 2025-09-11 18:02:12 +09:00
Sakamoto Shiina 38f479656a Merge branch 'develop' 2025-09-11 17:03:15 +09:00
Sakamoto Shiina 59630ccc03 Merge branch 'version' into develop 2025-09-11 17:01:54 +09:00
Sakamoto Shiina 684d9c3283 [Update] Version 3.2.1 -> 3.2.2 2025-09-11 17:00:15 +09:00
misyaguziya bc269bc1fb [Update] translation: Integrate Plamo API support with model selection and authentication features 2025-09-11 14:15:26 +09:00
Sakamoto Shiina 05a05b0589 Merge branch 'localization' into develop 2025-09-11 13:53:19 +09:00
Sakamoto Shiina 9096d05e65 [Update] Update 'readme_first.txt'. 2025-09-11 13:51:14 +09:00
Sakamoto Shiina 2efba7247e [Update] Localization: Update English localization. 2025-09-11 13:32:32 +09:00
misyaguziya d76a5b9e07 [Update] requirements: Add langchain-openai to dependencies 2025-09-10 17:59:31 +09:00
misyaguziya f5ebcd7bd8 [Update] translation: Add Plamo API support with authentication and translation functionality 2025-09-10 17:52:42 +09:00
misyaguziya 7ffef350fe [Update] package.json: Add task-kill script to terminate VRCT-sidecar.exe before development builds
[Add] task_kill.py: Implement script to forcefully terminate VRCT-sidecar.exe
2025-09-08 16:30:58 +09:00
misyaguziya 83a61e2e87 [Update] translation: Add support for new translation models and improve weight handling 2025-09-08 16:27:47 +09:00
misyaguziya 6fb7ecbc52 [Update] translation_utils.py: Refactor weight handling and improve error logging
add translate model
- jncraton/m2m100_418M-ct2-int8
- jncraton/m2m100_1.2B-ct2-int8
- OpenNMT/nllb-200-3.3B-ct2-int8
- OpenNMT/nllb-200-distilled-1.3B-ct2-int8
2025-09-07 23:59:20 +09:00
Sakamoto Shiina 7a0913928e [Update] Localization: Unify the new line code to LF 2025-09-05 11:45:29 +09:00
Sakamoto Shiina 3fca9ad736 Merge branch 'transcription_advanced_settings' into develop 2025-09-05 10:48:26 +09:00
Sakamoto Shiina cad0f796fa [Update] Transcription: Add UI. The user can config 'mic/speaker avg logprob' and 'mic/speaker no speech prob' that is related with Whisper's parameter. 2025-09-05 10:44:23 +09:00
Sakamoto Shiina c9dbd13a3a [Chore] Adjust new line codes. 2025-09-04 13:49:49 +09:00
Soumt 9c2123fe31 [Chore] Localization: Address minor Korean localization review feedback 2025-09-03 20:38:06 +09:00
Soumt 8867d180d2 [Update] Localization: Updated Korean localization 2025-09-03 20:03:41 +09:00
Sakamoto Shiina e7ae70add0 [Update] Localization: Add and adjust keys for each language. (Asked korean localization from this edited version.) 2025-08-30 22:45:09 +09:00
Sakamoto Shiina 7a6ed850b5 [Chore] Localization: Add quotations. (Asked english localization from this edited version.) 2025-08-30 21:13:15 +09:00
Sakamoto Shiina 8ae56563ca Merge branch 'message_format' into develop 2025-08-26 17:41:02 +09:00
Sakamoto Shiina 21e4714658 [Update] Config Page: MessageFormat: Add ui, message format. 2025-08-26 17:27:05 +09:00
Sakamoto Shiina e6bd0e32ed [bugfix] controller.py: Fix the bug, type error. that was unable to store the data correctly. 2025-08-26 17:20:29 +09:00
misyaguziya a79b87b17f Merge branch 'format' into develop 2025-08-06 21:46:11 +09:00
misyaguziya b1fabc37a4 [Update] Add comments to clarify property access levels in Config class 2025-08-06 21:36:51 +09:00
misyaguziya d12c157b66 [Update] Refactor message formatting and add validation for message structure 2025-08-06 20:33:36 +09:00
Sakamoto Shiina c8ac60144f Merge branch 'ui_notification_add_link' into develop 2025-08-02 17:06:37 +09:00
Sakamoto Shiina 3403b52fb9 [Update/Refactor] Add link to notification component to guide users to get more information.
(handleAiModelsAvailability)
2025-08-02 17:03:04 +09:00
Sakamoto Shiina 0258dd8ad0 Merge branch 'ui_bugfix_init_data_sync' into develop 2025-07-14 11:08:27 +09:00
Sakamoto Shiina 5ca7d73be4 [bugfix] Fix settings data has not sync when init startup the software.(Mic Word Filter, VRC Mic Mute Sync) 2025-07-14 11:06:13 +09:00
Sakamoto Shiina 780af9a019 Merge branch 'develop' 2025-06-25 10:55:26 +09:00
misyaguziya 600faaf608 Merge branch 'version' into develop 2025-06-24 21:23:29 +09:00
misyaguziya c2f40d2f5d [Update] version 3.2.0 -> 3.2.1 2025-06-24 21:23:18 +09:00
misyaguziya e3994851ea Merge branch 'fix-issue-50-logging-and-attributeerror' into develop 2025-06-24 15:10:04 +09:00
Sakamoto Shiina 2524b174aa Merge branch 'bugfix_ui' into develop 2025-06-23 13:16:14 +09:00
Sakamoto Shiina 49366791fb [bugfix/Chore]
Fix update function.(Notification was not shown even the software update has available.)
Add noop endpoints '/run/update_software' and '/run/update_cuda_software'.
2025-06-23 12:47:43 +09:00
Sakamoto Shiina b15a26c3d5 [bugfix] Plugins: Add error handling. when error occurred while rendering a plugin, set status disabled and an error. 2025-06-23 11:24:18 +09:00
Sakamoto Shiina db61f33578 Merge branch 'update_notification_ui' into develop 2025-06-21 09:44:03 +09:00
Sakamoto Shiina e02ed91721 [Update/bugfix] Notification UI:
Adjust an animation.
Add localizations.
Fix stack behavior that was not updated correctly. (it still has an issue tho.)
2025-06-21 09:43:12 +09:00
Sakamoto Shiina 1623352c92 [Update] Add save success notification. 2025-06-21 02:35:41 +09:00
Sakamoto Shiina 824be74b6e Merge branch 'ui_refactoring' into develop 2025-06-21 02:34:02 +09:00
Sakamoto Shiina 50bd182d8f [Chore] Remove unused define params in store.js 2025-06-19 09:32:34 +09:00
Sakamoto Shiina e480c373cd [Refactor] (Huge Refactoring 2)
Consolidated all logic into category-specific files.
Renamed useTranslation from react-i18next to useI18n to avoid a name conflict with our own function.
2025-06-19 08:40:45 +09:00
Sakamoto Shiina 65b5ffb2fa [Refactor]
Remove unused codes and a file.
Rename file format .jsx to .js that was not intended.
2025-06-19 00:34:46 +09:00
google-labs-jules[bot] 172617a523 Fix: Enhance logging for OSError and prevent AttributeError
This commit addresses two potential issues related to issue #50:

1.  Enhanced `OSError` Logging in `utils.py`:
    The `printResponse` function in `src-python/utils.py` has been modified
    to include more robust error handling around the `json.dumps()` call.
    If an `OSError` (such as `[Errno 22] Invalid argument`) occurs during
    JSON serialization, the function will now:
    - Log the full traceback of the OSError.
    - Log the specific problematic response dictionary that caused the error.
    - Print a fallback JSON error message to stdout.
    This change aims to help diagnose the root cause of the `OSError`
    reported by you by capturing the exact data that triggers it.

2.  Prevent `AttributeError` for `.close()` calls:
    Added checks in `src-python/models/osc/osc.py` and
    `src-python/models/websocket/websocket_server.py` to ensure that
    objects are not `None` before their `.close()` or `.cancel()` methods
    are called. This specifically addresses:
    - `self.browser.zc.close()` and `self.browser.browser.cancel()` in `osc.py`.
    - `self._loop.close()` in `websocket_server.py`.
    These changes prevent potential `AttributeError: 'NoneType' object
    has no attribute 'close'` errors if these objects are not fully
    initialized before cleanup.
2025-06-18 14:47:17 +00:00
misyaguziya 7e6ffad5fe Merge branch 'bugfix_translation' into develop 2025-06-17 15:41:56 +09:00
misyaguziya 5813ede67b [Refactor] Simplify conditional checks for transcript retrieval in Model class 2025-06-17 15:06:30 +09:00
misyaguziya c1157d30cf [Refactor] Move WebSocket message sending and logging to the correct position in the flow 2025-06-17 15:05:24 +09:00
misyaguziya a3384ff235 Merge branch 'bugfix_overlay' into develop 2025-06-16 18:59:49 +09:00
misyaguziya c12f51f802 [bugfix] remove print root path 2025-06-16 18:59:37 +09:00
misyaguziya f86f3fb4f0 Merge branch 'bugfix_overlay' into develop 2025-06-16 11:50:33 +09:00
misyaguziya e25cd62891 [Refactor] Improve overlay image creation logic for small logs and translations 2025-06-16 11:29:54 +09:00
misyaguziya ab5c6b7bb5 [Refactor] Improve overlay image creation logic for large logs and translations 2025-06-16 06:45:13 +09:00
Sakamoto Shiina 00c5258b57 Merge branch 'refactor_and_chore' into develop 2025-06-15 18:15:12 +09:00
Sakamoto Shiina cbfce55c16 [Refactor] Move the code that is related with Send Message Button Type. (It was remained at Others section but it should've move to Appearance section so.) 2025-06-15 18:11:07 +09:00
Sakamoto Shiina d96c9a5151 [Chore] Fix typo in test code. '/set/data/mic_word_filter' 2025-06-15 17:53:41 +09:00
Sakamoto Shiina 5f4baaf48d Merge branch 'adjust_feature_resend_button' into develop 2025-06-15 17:52:00 +09:00
Sakamoto Shiina 3f38bfbba8 [Update] Resend Message Button: To be store-able the status.
Move to Appearance settings.
2025-06-15 17:49:42 +09:00
misyaguziya acae7644eb [bugfix] ttfファイルのバスを修正 2025-06-15 15:54:41 +09:00
Sakamoto Shiina d454c9b13a Merge branch 'ui_refactoring' into develop 2025-06-14 03:31:00 +09:00
Sakamoto Shiina 4886552639 [Refactor] Put together device-related logic into useDevice. 2025-06-14 03:29:34 +09:00
Sakamoto Shiina fb2b224231 [Refactor] (Huge Refactoring) ReceiveRoutes: change the way define endpoints, hooks and methods.
Remove 'multi language translation enable/disable' related methods that is no longer in use from quite ago.
2025-06-14 03:29:22 +09:00
Sakamoto Shiina 1fcb765ca0 [Refactor] Change aliases and move test_data.js. 2025-06-11 20:22:38 +09:00
Sakamoto Shiina f229d9ec95 [Refactor] Organize files. 2025-06-10 20:36:16 +09:00
Sakamoto Shiina 66e9fc9126 Merge branch 'gpu_error' into develop 2025-06-10 17:49:30 +09:00
Sakamoto Shiina 2b281dfcfd Merge branch 'ui' into develop 2025-06-10 17:19:46 +09:00
Sakamoto Shiina 1fe8a512f0 Merge branch 'osc_query' into develop 2025-06-10 17:19:38 +09:00
Sakamoto Shiina 5c7c730809 [Update] UI: Error Handling: VRC Mic Mute Sync: Add an error notification. 2025-06-10 17:17:10 +09:00
Sakamoto Shiina bc7f70729a [Update] UI: OSC query availability: Update disable functions. 2025-06-10 16:42:49 +09:00
misyaguziya f6216dbdbe [Update] Enhance OSC Query handling by adding mute sync info flag and modifying disableOscQuery method 2025-06-09 17:15:42 +09:00
Sakamoto Shiina 35369f7394 [Update/bugfix] Notification UI:
Expand max width for readability.
Line breaks now follow newline characters correctly.
Fixed the bug that was success progress bar was not set properly.
2025-06-09 15:30:55 +09:00
Sakamoto Shiina 8289c9f1b3 [bugfix] Config Page: Entry components: Prevent showing the currently stored value; instead, display the value the user intends to store. 2025-06-09 14:44:42 +09:00
Sakamoto Shiina 1f52c3625a [Refactor] Adjust color variables. Add some comments. 2025-06-09 12:35:40 +09:00
Sakamoto Shiina 851e3b7640 [Update] UI: Add VRAM overflow and out of memory error notifications and functions. 2025-06-09 01:21:58 +09:00
misyaguziya 5facadf139 Merge branch 'workflow' into develop 2025-06-08 15:35:18 +09:00
misyaguziya 05daf17a74 [Update] Refactor Hugging Face upload process to use temporary directory and add tagging for releases 2025-06-08 10:33:45 +09:00
misyaguziya 67f61aa7e7 Merge branch 'workflow' into develop 2025-06-08 09:54:45 +09:00
misyaguziya 636eb02392 [Update] Fix Hugging Face upload repository path and set release name to version 2025-06-08 09:54:22 +09:00
misyaguziya f2ac3dc768 [Update] Clean up comments and ensure permissions are set for release job 2025-06-07 21:54:47 +09:00
misyaguziya 69af7fce22 [Update] Modify commit messages for Hugging Face uploads to include version release emoji 2025-06-07 21:09:02 +09:00
misyaguziya 1be2a1939f [Update] Refactor version extraction in release workflow to use PowerShell syntax 2025-06-07 19:57:36 +09:00
misyaguziya 205b5262da [Add] Install Python script dependencies for tqdm 2025-06-07 18:15:41 +09:00
misyaguziya a9cc7480ea [Update] Change Node.js version to 22.15.0 in release workflow 2025-06-07 17:44:10 +09:00
misyaguziya dfdb0812c3 [Update] Bump version to 3.2.0 in tauri configuration 2025-06-07 16:26:39 +09:00
misyaguziya 0abeca4533 [Add] Create release workflow for VRCT with GitHub Actions 2025-06-07 16:26:32 +09:00
Sakamoto Shiina fed5a08e3d Merge branch 'develop' into gpu_error 2025-06-06 15:59:06 +09:00
Sakamoto Shiina 7ff5ba8973 Merge branch 'ui_update_notifications' into develop 2025-06-06 15:58:19 +09:00
Sakamoto Shiina ad0e87f5a1 [bugfix/Chore] Fix warning progress bar color that was not applied. 2025-06-05 22:04:40 +09:00
Sakamoto Shiina bcef981955 [Update] Change the notification UI.
(Change the base notification library from MUI to React-Toastify.)
2025-06-05 18:11:53 +09:00
misyaguziya 547b186a9d Merge branch 'develop' 2025-06-03 11:09:11 +09:00
misyaguziya 620085054b Merge branch 'version' into develop 2025-06-03 11:08:43 +09:00
misyaguziya 2118ec9d01 [Update] Version 3.1.2 -> 3.2.0 2025-06-03 11:08:31 +09:00
misyaguziya dfc90508d1 [Fix] Controller: Handle VRAM overflow errors during translation and transcription processes. 2025-06-02 15:07:33 +09:00
Sakamoto Shiina e32dd7014b Merge branch 'ui_change_labels' into develop 2025-06-02 14:55:32 +09:00
Sakamoto Shiina cda42a0901 [Update] Change labels Japanese: Main Page: Main Functions. 音声認識◯◯ -> マイク入力, 聞き取り.
and change some labels.
2025-06-02 14:52:33 +09:00
Sakamoto Shiina 807aa90549 Merge branch 'ui_vr_settings' into develop 2025-06-02 14:32:03 +09:00
Sakamoto Shiina 2ea0a3b529 [Update/Refactor] Config Page: VR: Change triangle icon from symbol to svg.
Refactor the common component and function.
2025-06-02 13:37:37 +09:00
Sakamoto Shiina 09865d02be [Update] Config Page: VR: Add adjust buttons to each position and rotation sliders for become much easier handling on VR controller. 2025-06-02 12:17:00 +09:00
misyaguziya 7b42387a19 Merge branch 'bugfix_translate_engines' into develop 2025-05-31 04:17:16 +09:00
misyaguziya 32e4ec0682 [Bugfix] Controller: Fixed degradation that occurred with commit hash: d940097. 2025-05-31 04:09:28 +09:00
Sakamoto Shiina ccc19f4c9c Merge branch 'ui_supporters' into develop 2025-05-30 17:23:35 +09:00
misyaguziya 4a47a95884 Merge branch 'bugfix_osc_query' into develop 2025-05-30 17:21:50 +09:00
Sakamoto Shiina 51c90b3b74 [Update] Config Page: Supporters. Adjust period box designs.(Add second line.) 2025-05-30 17:04:42 +09:00
Sakamoto Shiina 149c3b1093 [bugfix] UI: OSCクエリ無効時、ミュート同期機能が無効にならない問題を修正。 2025-05-30 16:36:29 +09:00
Sakamoto Shiina 88cb4f72b5 [Update/bugfix] UI: Add disable/enable UI function when osc query is disabled.
Fix the error that the mic mute sync couldn't enable/disable.
2025-05-30 15:32:03 +09:00
misyaguziya ae38ed165d [Update] controller.py: Refactor OSC IP address handling and improve VRC mic mute sync logic 2025-05-30 11:31:09 +09:00
misyaguziya b1c68679cd Merge branch 'osc' into develop 2025-05-29 09:16:53 +09:00
misyaguziya 29ef8f401d Merge branch 'websocket' into develop 2025-05-29 09:16:39 +09:00
misyaguziya 3593a4d8c0 Merge branch 'huggingface' into develop 2025-05-29 09:16:19 +09:00
misyaguziya 50cd701ca5 Merge branch 'zip' into develop 2025-05-29 09:16:04 +09:00
misyaguziya 6c5c9d2c9c [Update] .gitignore: Add VRCT.zip and VRCT_cuda.zip to ignore list 2025-05-29 09:12:11 +09:00
misyaguziya 67d06ab1e1 [Update] Enhance build scripts and requirements for Hugging Face integration; improve logging and error handling 2025-05-29 08:04:06 +09:00
misyaguziya 238bd41109 [Update] Refactor Hugging Face dependencies in requirements files and enhance cache directory handling in mainloop.py 2025-05-28 11:14:39 +09:00
misyaguziya 8dac3da933 [Update] Add hf_xet and huggingface-hub to requirements; enhance mainloop.py for Hugging Face caching 2025-05-27 14:12:20 +09:00
misyaguziya 88c27a9c70 [Update] WebSocket: Implement availability check for WebSocket server and refactor related logic 2025-05-26 16:15:04 +09:00
Sakamoto Shiina ed27a8c7ba [Update/Refactor] UI: Add websocket error handlings.
Refactor. Change the error handling switch method from message to endpoint primarily.
2025-05-26 12:06:36 +09:00
misyaguziya bdaccdf421 [Update] OSC: Improve error handling and refactor OSC server initialization 2025-05-25 22:15:53 +09:00
misyaguziya 23fc46bd0f [Update] OSC: Refactor OSC query handling and add enable/disable methods 2025-05-25 15:42:33 +09:00
misyaguziya 279fc1f66d [Update] OSCHandler: Enhance OSC query handling and refactor mute status management 2025-05-24 21:51:11 +09:00
misyaguziya f6927b9ae7 [Update] zip.py: Enhance zip file creation with improved error handling and verbose output 2025-05-22 11:35:48 +09:00
misyaguziya de4f22f704 [Update] Controller: Update WebSocket error messages to clarify host and port availability 2025-05-20 14:28:55 +09:00
misyaguziya 63d853bf7d Merge branch 'websocket' into develop 2025-05-20 13:12:49 +09:00
misyaguziya f310e6d6d5 [Update] WebSocket: Refactor server availability checks and improve error handling 2025-05-20 13:12:31 +09:00
misyaguziya e59bfcecf2 Merge branch 'websocket' into develop 2025-05-20 11:33:59 +09:00
misyaguziya cfc26c4767 [Update] Model: Modify error logging to remove exception details on address in use 2025-05-20 11:33:40 +09:00
misyaguziya acee8c442e Merge branch 'websocket' into develop 2025-05-20 11:09:38 +09:00
misyaguziya 60fb58f6d5 [Update] WebSocket: Disable server by default and add port availability check 2025-05-20 11:08:11 +09:00
Sakamoto Shiina 7289770f9c Merge branch 'ui_websocket' into develop 2025-05-19 03:53:56 +09:00
Sakamoto Shiina 0b48631363 [Update] AdvancedSettings: Websocket: Add settings ui. 2025-05-19 03:52:43 +09:00
misyaguziya eb0ab29b37 Merge branch 'websocket' into develop 2025-05-18 16:24:33 +09:00
misyaguziya 989abbe2c2 [Update] check用のメッセージをコメントアウト 2025-05-18 16:24:20 +09:00
misyaguziya f0f0dd5ea5 Merge branch 'websocket' into develop 2025-05-18 15:24:35 +09:00
misyaguziya 1cc22d35c3 [Update] WebSocket server: Add message handler for processing incoming messages 2025-05-18 15:23:58 +09:00
misyaguziya e7304247c7 [Update] WebSocket configuration: Change host to 127.0.0.1 and port to 2231; refactor WebSocket server initialization and message handling 2025-05-18 15:20:27 +09:00
misyaguziya ed5ebcee90 [Update] WebSocket server: Refactor threading and message handling 2025-05-18 13:16:52 +09:00
misyaguziya d940097e44 👍️[Update] Model : WebSocket module 2025-05-17 09:30:17 +09:00
misyaguziya e7eff7753f Merge branch 'develop' 2025-05-15 13:07:30 +09:00
misyaguziya f9d1405a85 Merge branch 'bugfix_deepl' into develop 2025-05-15 13:06:52 +09:00
misyaguziya 949486c447 [bugfix] Correct DeepL authentication error messages for clarity 2025-05-15 13:06:29 +09:00
misyaguziya 1ab2cd2283 Merge branch 'develop' 2025-05-15 12:43:41 +09:00
misyaguziya f5e33be7f6 Merge branch 'version' into develop 2025-05-15 12:43:11 +09:00
misyaguziya d0e0fc3c28 [Update] Version 3.1.1 -> 3.1.2 2025-05-15 12:43:00 +09:00
misyaguziya 2d057debe6 Merge branch 'bugfix_deepl' into develop 2025-05-15 12:39:11 +09:00
misyaguziya a619cd6114 [update] Upgrade deepl package version to 1.22.0 and refactor translation code to use DeepLClient 2025-05-15 12:38:54 +09:00
misyaguziya fac33e06ba [Add] websocket server 2025-05-15 11:46:13 +09:00
Sakamoto Shiina 39d52f6570 Merge branch 'develop' 2025-05-11 17:54:32 +09:00
Sakamoto Shiina bc412024da Merge branch 'version' into develop 2025-05-11 17:53:09 +09:00
Sakamoto Shiina a94fff401b 👍️[Update] Version 3.1.0 -> 3.1.1 2025-05-11 17:52:11 +09:00
Sakamoto Shiina b2df674026 Merge branch 'bugfix_build_error' into develop 2025-05-11 17:49:08 +09:00
Sakamoto Shiina df231ad618 [bugfix] Fix top-level async error. 2025-05-11 17:47:49 +09:00
Sakamoto Shiina 0d1a59a5ce Merge branch 'plugins' into develop 2025-05-11 16:59:15 +09:00
Sakamoto Shiina 83686f3073 [Update] QuickSettings: Add plugins section. 2025-05-11 16:58:19 +09:00
Sakamoto Shiina 8ea7fb05c0 [Update] Config Page: Move and add plugin section from AdvancedSettings. 2025-05-11 16:25:02 +09:00
Sakamoto Shiina bdf59a9932 Merge branch 'bugfix_window_geometry' into develop 2025-05-11 15:27:39 +09:00
Sakamoto Shiina b2bc1e62cb [bugfix] Fix window geometry bug that was not save and restore. changes the way how to get appWindow instance from Tauri. 2025-05-11 15:26:05 +09:00
misyaguziya f45fe90de0 Merge branch 'develop' 2025-05-08 16:11:46 +09:00
misyaguziya 61e333401f Merge branch 'version' into develop 2025-05-08 16:10:35 +09:00
misyaguziya 8d6da2eacc [Update] Version 3.0.5 -> 3.1.0 2025-05-08 16:10:19 +09:00
Sakamoto Shiina 9d65156d92 Merge branch 'update_special_thanks_members' into develop 2025-05-08 13:06:09 +09:00
Sakamoto Shiina a556486c83 [Update] Add a special thanks member. 2025-05-08 13:05:35 +09:00
misyaguziya 38e31695a3 Merge branch 'osc_query' into develop 2025-05-08 11:41:35 +09:00
misyaguziya 23764340bd Merge branch 'cuda128' into develop 2025-05-08 10:47:26 +09:00
misyaguziya c6bcb36ab1 [Update] Package : RTX5000番台対応のためにfast-whisper/ctranslate2のバージョンを更新 2025-05-08 10:35:57 +09:00
misyaguziya e9715651d9 [Update] Upgrade torch version to 2.7.0 and adjust pip install options in install scripts 2025-05-06 14:44:10 +09:00
Sakamoto Shiina 504c8c6f49 Merge branch 'plugins' into develop 2025-05-06 13:14:21 +09:00
Sakamoto Shiina 37d78e1d87 [Update] Plugins: Add homepage link button. 2025-05-06 13:12:50 +09:00
misyaguziya 8266048933 Merge branch 'windows_corner_radius_bug' into develop 2025-05-06 12:03:27 +09:00
Sakamoto Shiina da577b5116 [bugfix] Fix corner rounded bug.
before: win10, corner rounded true. win 11 corner rounded true and when window maximized likewise.
after: win10, corner rounded false. win 11 corner rounded true but turn to false when window maximized.
2025-05-06 10:57:38 +09:00
misyaguziya 2e424fcc2a [Update] Optimize OSCQueryBrowser usage and reduce CPU load in OSC server 2025-05-05 17:06:23 +09:00
Sakamoto Shiina 82458ca992 Merge branch 'ui_supporters_about_vrct' into develop 2025-05-04 13:41:35 +09:00
Sakamoto Shiina 8f687d0a55 [Update] Add a special thanks member. 2025-05-04 13:39:51 +09:00
Sakamoto Shiina af17e057e8 [Update] Add crown emoji to supporter label.
Add tooltip that shows their supporting period.
Add icon rotate animation when hovered supporter's image.
2025-05-04 10:03:37 +09:00
Sakamoto Shiina 9118a54be7 Merge branch 'tauri_v2' into develop 2025-05-04 02:51:01 +09:00
Sakamoto Shiina b5364cc705 [Chore] Add a note for experimental feature globalSync.
Remove comments.
Set version to tauri.conf.json(3.0.0 is just restore from pre-checkout develop branch, though.)
2025-05-04 02:41:14 +09:00
Sakamoto Shiina 8316c24d0d [bugfix] More fixes. c20b58a011 2025-05-04 02:22:44 +09:00
misyaguziya 27b177b903 Merge branch 'word_filter_for_s2c' into develop 2025-05-03 15:32:21 +09:00
misyaguziya 6f1ab32019 [Update] Speaker2Chatboxにword filterを追加 2025-05-03 15:31:50 +09:00
misyaguziya c20b58a011 🐛[bugfix] ビルド時のエラー/ワーニングが発生する問題を修正
インストーラーのURLを修正
2025-05-03 12:41:15 +09:00
Sakamoto Shiina 3210d5c898 [Update] update tauri v1-> v2 (development) 2025-05-03 08:51:04 +09:00
Sakamoto Shiina c6f669336a Merge branch 'update_contributor' into develop 2025-04-28 11:19:07 +09:00
Sakamoto Shiina 0d96c7c690 [Update] Change the contributor's title for not making misunderstanding. 2025-04-28 11:16:47 +09:00
Sakamoto Shiina 24ee335768 Merge branch 'plugins_system' into develop 2025-04-27 04:36:58 +09:00
Sakamoto Shiina a599c39814 [Update] Remove unnecessary plugins files that is for plugin development. 2025-04-27 04:35:29 +09:00
Sakamoto Shiina e0895ad653 Merge branch 'plugins_system' into develop 2025-04-27 04:17:49 +09:00
Sakamoto Shiina 7cdd3f8603 [bugfix/Chore] Plugins: Fix the bug that localization and the description can't see form latest information.
Add gap between labels and controller component.
2025-04-27 02:27:25 +09:00
Sakamoto Shiina e3b75f2cfb [Update] Plugins: Adjust designs.
Add localizations.
2025-04-27 02:15:31 +09:00
Sakamoto Shiina 56936d0285 [Update] Plugins -> AdvancedSettings. Move to AdvancedSettings because the plugin just only one is available and it's for specific user, actually. so put it to AdvancedSettings for now. 2025-04-26 19:41:28 +09:00
Sakamoto Shiina c665f1d355 [Update/bugfix] Plugins: Add localization system to plugins list(plugin_info.json).
Fix the issue that the i18n didn't work in development environment.
2025-04-26 05:01:30 +09:00
Sakamoto Shiina 819783ea09 [Update] Plugins: Add localization system. 2025-04-26 01:55:28 +09:00
Sakamoto Shiina 249c686442 [Update] Plugins: Add error handlings when network is not connected and failed to fetch plugins info.
Also add pending ui(TMP) while fetching.
2025-04-25 18:51:16 +09:00
Sakamoto Shiina 81a422b07d [Update] Plugins: Add notifications. 2025-04-24 23:44:11 +09:00
Sakamoto Shiina b9d9edb7c3 [Update] Add the safety that is not show on UI if the plugin, downloaded, is not supported. 2025-04-24 21:48:05 +09:00
Sakamoto Shiina e9aa3aa8ac Merge branch 'develop' into plugins_system
# Conflicts:
#	src-tauri/tauri.conf.json
2025-04-24 02:20:00 +09:00
Sakamoto Shiina 5aa5c0068e Merge branch 'readmes' into develop 2025-04-24 01:55:08 +09:00
Sakamoto Shiina 3e010376f4 [bugfix] Change the links relative path to absolute path that is from root dir. 2025-04-24 01:48:15 +09:00
Sakamoto Shiina 1f4c4e7640 [Update] Adjust file paths. 2025-04-23 14:34:31 +09:00
Sakamoto Shiina 1b7e315c2b [Update] Add Symbolic link. 2025-04-23 13:51:34 +09:00
Sakamoto Shiina d0dbdf69f0 [Refactor] Organize readme files. 2025-04-23 06:36:55 +09:00
Sakamoto Shiina ec33d4020d [Update] Readmes: Remove the outdated information 'How to run in python'. 2025-04-23 01:37:23 +09:00
misyaguziya e20497bb87 Merge branch 'develop' 2025-04-22 17:35:46 +09:00
misyaguziya 63e34f747c Merge branch 'version' into develop 2025-04-22 10:25:06 +09:00
misyaguziya 066c4fa4e4 👍️[Update] Version 3.0.4 -> 3.0.5 2025-04-22 10:24:49 +09:00
Sakamoto Shiina ff4f40328a [Update] About VRCT: Add a localizer and a contributor. 2025-04-21 17:41:42 +09:00
Sakamoto Shiina 2f27e5a491 [Update] Localization(EN): Localized by RIKU_730. 2025-04-21 16:21:59 +09:00
Sakamoto Shiina 144293636f Merge branch 'ui' into develop 2025-04-21 15:20:23 +09:00
Sakamoto Shiina 4eca60d495 [bugfix] AdvancedSettings: OSC Port: Add the validation that the entry component is only allowed numeric. 2025-04-19 23:51:47 +09:00
Sakamoto Shiina 1a9e961d71 Merge branch 'ui' into develop 2025-04-19 22:39:52 +09:00
Sakamoto Shiina 33f1e54f4d [bugfix] Plugins: fix auto disable plugins function. 2025-04-19 22:09:20 +09:00
Sakamoto Shiina cd63e2e3ca [bugfix/Refactor]
Fix plugin compatibility list that was showed incorrectly.
Change init function.
2025-04-19 16:15:47 +09:00
Sakamoto Shiina 7bcbefaf06 [Refactor] Remove the code that is no longer in use. 2025-04-18 14:53:36 +09:00
Sakamoto Shiina 74e38f9318 [bugfix] Fix the bug that the plugin update unintentionally when its latest version available and it turn to enabled. 2025-04-18 14:30:47 +09:00
Sakamoto Shiina 0be9674f69 [bugfix] Plugins: Fix the error that was happened if 'plugins' directory is not exist and try to load. 2025-04-18 01:50:30 +09:00
Sakamoto Shiina 01b7d6c945 [Update] Plugins: Sort plugins list and remain the order of it. 2025-04-18 00:38:31 +09:00
Sakamoto Shiina 9ef56db2dd [Update] Add safety that prevent to show the title Plugin compatibility list unnecessary.
Remove the test code that is for showing the update modal.
2025-04-18 00:10:09 +09:00
Sakamoto Shiina fd59c0b28f [Update/Refactor] Automatically disable and save the status to config.json if the plugin is not supported. 2025-04-17 19:44:14 +09:00
Sakamoto Shiina b8c1688172 [Update] Plugins: separate dev mode. url and import path. 2025-04-17 17:46:17 +09:00
Sakamoto Shiina 1c56167dba [Update] Plugins: Show enabled plugins compatibility when update modal is opened. 2025-04-17 17:30:30 +09:00
Sakamoto Shiina ee4bbf772f [Refactor] Remove the file and code that is no longer in use. 2025-04-17 00:11:50 +09:00
Sakamoto Shiina 4c12e8b946 [Update/Refactor]
For data integration correctly, the plugins data (saved, downloaded, fetched) merge whenever update data each of it.
Separate plugins controllers.
2025-04-16 19:02:41 +09:00
Sakamoto Shiina 379ca86b45 [Refactor/bugfix/TMP] TMP:
Separate plugins controller.
Add ui pattern for outdated plugins and the plugin that is not supported current vrct version but supported in newest vrct version.
2025-04-15 16:48:50 +09:00
Sakamoto Shiina ddc6408828 [Update/bugfix]
Fix handling flag 'is_latest_version_already' that was overrode unexpectedly.
Add some patterns to plugin list. it shows update-able if the user update vrct.
Add auto update function if the plugin is enabled.
Add safety that turn to disable the plugin if it's not supported with current vrct version.
2025-04-13 17:14:54 +09:00
Sakamoto Shiina 1bea61c45a [Update] Add dev plugin mode and dev plugin list. 2025-04-12 14:28:01 +09:00
Sakamoto Shiina d4219b5ce0 [Update/Refactor] Plugins: Organize codes. 2025-04-11 19:14:55 +09:00
Sakamoto Shiina 2157d5952c [UPdate] Add error boundary. 2025-04-10 21:47:18 +09:00
Sakamoto Shiina 7e637b795d [Update/Refactor/bugfix]
Update: Add functions and test ui.
Update, backend: send latest vrct version to frontend.
Refactor: Change the plugins data structure.
bugfix: fix endless showing update button.
2025-04-09 17:34:55 +09:00
Sakamoto Shiina 67f32ad7b9 [Update] Plugins: Add update function. 2025-04-02 22:52:20 +09:00
Sakamoto Shiina c02d7c49e9 [Update] Plugins dev: Apply-able aliases. 2025-04-01 06:02:58 +09:00
Sakamoto Shiina 9d98f8c4f2 [Update] Show the error notification, prompting the user to contact us or restart VRCT, when an error occurred in stdout that error occur without status number. 2025-03-30 20:14:42 +09:00
Sakamoto Shiina b0b68233aa [Update] Plugins: Send all logics to the plugins when it's registered. 2025-03-30 04:18:54 +09:00
Sakamoto Shiina 5681038c22 [bugfix] Plugins(VRCT Subtitles as testing one): Apply styles by importing css file. 2025-03-29 16:22:00 +09:00
Sakamoto Shiina a59b9282df [Update] Plugins(VRCT Subtitles as testing one): Provide-able store and functions from main app. 2025-03-27 02:43:13 +09:00
Sakamoto Shiina 0c6829616c [Update/bugfix] Plugins: Fix plugins position.
Switchable rendering MessageContainer and Plugins.
2025-03-26 21:46:43 +09:00
Sakamoto Shiina 1ebdefcd43 [Update/bugfix] Plugins: For development, fix hot reload issue that was restart every time updated the files. 2025-03-26 00:45:29 +09:00
Sakamoto Shiina 824a9fa0a9 [Update] Plugins: Move location from index to plugin_info.json. 2025-03-25 17:57:03 +09:00
Sakamoto Shiina 92ea06eb77 [bugfix] Fix load json format error. 2025-03-25 16:53:52 +09:00
Sakamoto Shiina e65e9be052 [Update] Add plugin_info.json load function. 2025-03-25 16:35:17 +09:00
Sakamoto Shiina 0148f9bee0 [Update] (Affect to backend) Plugin System. Saveable if the plugin is enabled or not.
Add functions that merge plugins data.
2025-03-25 13:30:52 +09:00
Sakamoto Shiina cb2d0d5455 Merge branch 'bugfix_no_device' into develop 2025-03-22 18:10:42 +09:00
Sakamoto Shiina 377899d5e1 [bugfix] typo, Speaker -> speaker. 2025-03-22 18:06:27 +09:00
Sakamoto Shiina dcc0a27215 Merge branch 'bugfix_ip_address' into develop 2025-03-22 17:31:20 +09:00
Sakamoto Shiina a5e59af885 [Update] AdvancedSettings: OSC IP Address: Add error notifications.
Add 500 status error message.
2025-03-22 17:28:31 +09:00
misyaguziya 7a3a2cfe07 [fix] Model: Handle cases where selected microphone or speaker devices are not available 2025-03-22 17:20:26 +09:00
misyaguziya df344baa06 [bugfix] Controller: Fix response handling in setOscIpAddress method. 2025-03-22 14:43:52 +09:00
misyaguziya 3d53652b2d [Update] Controller: Validate and handle IP address setting in setOscIpAddress method.
[Update] Utils: Implement isValidIpAddress function to check IP address validity.
2025-03-22 14:37:05 +09:00
Sakamoto Shiina 863baddad0 Merge branch 'add_transcript_engine' into develop 2025-03-21 18:25:43 +09:00
Sakamoto Shiina d091f1b603 [Update] UI: Add selectable Whisper models. 2025-03-21 18:24:34 +09:00
Sakamoto Shiina 84eccb1912 Merge branch 'bugfix_advanced_settings' into develop 2025-03-21 17:39:49 +09:00
Sakamoto Shiina b8ade54e85 [bugfix] Config Page: AdvancedSettings: Add save button to Entry components.
Add error handlings.
2025-03-21 17:38:15 +09:00
misyaguziya 4da99ab4d4 [Update] transcription_whisper.py: Add new Whisper model entries for large-v3-turbo and large-v3-turbo-int8. 2025-03-21 09:06:01 +09:00
Sakamoto Shiina cbd8a77eb6 Merge branch 'refactor' into develop 2025-03-19 15:46:02 +09:00
Sakamoto Shiina 6f01ee2206 [Refactor] store.js. 2025-03-19 15:45:31 +09:00
Sakamoto Shiina f3d2de54b5 [Refactor] tauri.conf.json: Align indentation to 4 spaces. 2025-03-19 14:15:42 +09:00
Sakamoto Shiina 1e6c2762c2 Merge branch 'develop' into plugins_system 2025-03-19 09:46:33 +09:00
Sakamoto Shiina 4003687e73 Merge branch 'ui' into develop 2025-03-18 21:12:38 +09:00
Sakamoto Shiina 92752d5953 [Update] Main Page: MainFunctionSwitch: to be a bit smaller than before for allow long label on its main function. 2025-03-18 21:09:59 +09:00
Sakamoto Shiina f40f916bec [Update] Add success notification when deepL Auth key has updated successfully. 2025-03-18 20:25:54 +09:00
Sakamoto Shiina e670672e15 [Chore/update] Change localization, Japanese. 2025-03-18 16:42:05 +09:00
Sakamoto Shiina 8ea37eb39a [Update] Main Page: TranslatorSelector: Add the label 'default'. 2025-03-18 15:26:55 +09:00
Sakamoto Shiina c9e40fc682 [Update] Adjust localizations. (every yaml key and lines are same with en.yml) 2025-03-18 11:18:03 +09:00
Sakamoto Shiina adf98b8c33 [Update] Change sentences, Japanese. 2025-03-18 08:23:53 +09:00
Sakamoto Shiina e5e1d2ca39 Merge branch 'error_message_handling' into develop 2025-03-18 06:51:32 +09:00
Sakamoto Shiina c82a89a7fb [Update] UI: Add error handlings and show error notifications. adjust each localization for it. 2025-03-17 15:58:16 +09:00
Sakamoto Shiina 84a116291c [bugfix] controller.py: fix typo mic/speaker, error messages. 2025-03-16 10:44:01 +09:00
Sakamoto Shiina 371d2ed5b2 Merge branch 'ui' into develop 2025-03-16 10:23:57 +09:00
Sakamoto Shiina ab39421c79 [Update/bugfix] Config Page: Transcription: Change the input design entry to dropdowns. It will fix the bug that cant put e.g. the user wanna put "10" actually, then, type "1" at first, but validation says "1" is not allowed. 2025-03-16 09:56:30 +09:00
Sakamoto Shiina fa2c851c5b [bugfix] Main Page: LanguageSelector: Go back button: add min width for prevent to shrink its width too much.
Config Page: SidebarSection: to not scroll x axis even if its label overflowed.
2025-03-15 15:06:50 +09:00
Sakamoto Shiina fec499cfad [Update] Adjust localization and design. 2025-03-15 13:32:40 +09:00
Sakamoto Shiina 3ebd605092 [Update/TMP] Save plugin status that if enabled or not(on store.js, yet).
Handle download.
2025-03-14 23:24:19 +09:00
Sakamoto Shiina b0f5751e11 [Update/Refactor] Fetch and show the plugins info list.
Refactor some functions.
Try to fetch functions from github api just once when vrct started.(It used to every time plugin tab has opened so easy to reach to the api limit)
2025-03-13 12:19:35 +09:00
Sakamoto Shiina 77795192a0 [Update] Change download and load plugins structure.(change the plugins' build method vite to webpack. load esm.js ) 2025-03-11 01:03:18 +09:00
Sakamoto Shiina 48c6e7d69f [TMP 2] Plugins system. support directory structure and store system.(the plugin needs build at each project) 2025-03-08 18:43:56 +09:00
Sakamoto Shiina 22ada89fa6 [TMP] Plugins system. 2025-03-05 23:22:22 +09:00
Sakamoto Shiina a2cc69b8ee Merge branch 'develop' into scheduled_message_send 2025-02-22 09:29:17 +09:00
misyaguziya caad079961 Merge branch 'develop'
# Conflicts:
#	locales/ko.yml
2025-02-21 14:59:25 +09:00
misyaguziya 63d6f33ada Merge branch 'version' into develop 2025-02-21 14:57:01 +09:00
misyaguziya 8e97621fca 👍️[Update] Version 3.0.3 -> 3.0.4 2025-02-21 14:56:49 +09:00
Sakamoto Shiina 3205dea576 Merge branch 'locales' into develop 2025-02-21 14:44:24 +09:00
Sakamoto Shiina f68a0231c2 [Refactor] Adjust yaml format. 2025-02-21 10:13:19 +09:00
Sakamoto Shiina 9c84c9905d [bugfix/Update] Config Page: Others: Sound: fix japanese localize. add description. 2025-02-21 08:49:01 +09:00
misyaguziya 6caf247d1c Merge branch 'develop' 2025-02-19 13:41:07 +09:00
misyaguziya 2ee1c2d51e Merge branch 'version' into develop 2025-02-19 13:39:21 +09:00
misyaguziya 62571f55a1 👍️[Update] Version 3.0.2 -> 3.0.3 2025-02-19 13:38:55 +09:00
Sakamoto Shiina 5b6199b226 Merge branch 'vrc_sfx' into develop 2025-02-18 15:40:30 +09:00
Sakamoto Shiina fd0069cb6b [Update] UI: VRC ChatBoxの通知音のON/OFF 設定項目追加 2025-02-18 15:36:08 +09:00
misyaguziya 132bb08582 Merge branch 'bugfix_overlay' into develop 2025-02-18 15:34:05 +09:00
misyaguziya 6fe403315a 🐛[bugfix] model : overlay 200回表示後のリセット処理でエラーが発生した場合のみエラーログを保存するように修正 2025-02-18 15:33:45 +09:00
misyaguziya 1ca14ca33e 🐛[bugfix] model : overlay動作時にoverlay表示デバイスが存在しない場合にエラーが発生する問題を修正
デバイスの存在チェックを追加
2025-02-18 15:30:48 +09:00
misyaguziya 4b61178b0e 👍️[Update] Main/Controller/Model/Config : VRC ChatBoxの通知音のON/OFFのエンドポイントを追加 2025-02-18 14:23:02 +09:00
Sakamoto Shiina a9c5ccdbb8 [Update/Refactor] Subtitle system v1.1. Organize file system and change the design. 2025-02-15 08:46:15 +09:00
Sakamoto Shiina ae62642945 Merge branch 'develop' into scheduled_message_send 2025-02-14 22:29:32 +09:00
Sakamoto Shiina 8360a7e955 [Update/TMP] Subtitle system v1.0(It works) 2025-02-14 22:09:56 +09:00
misyaguziya 36f25b7a21 Merge branch 'clean' into develop 2025-02-13 13:07:46 +09:00
misyaguziya 8c117d5b1f 👍️[Update] Build : ビルド時に不要なファイルを削除する処理を追加 2025-02-13 13:05:21 +09:00
misyaguziya 1fc039a409 Merge branch 'develop'
# Conflicts:
#	locales/en.yml
#	locales/ja.yml
2025-02-13 08:44:08 +09:00
Sakamoto Shiina eb81fae2a0 [Update/Refactor] Move files to main container. 2025-02-13 05:28:00 +09:00
misyaguziya 3e26cb29f6 Merge branch 'version' into develop 2025-02-12 20:19:54 +09:00
misyaguziya 058e72b52b 👍️[Update] Version : 3.0.1 -> 3.0.2 2025-02-12 20:19:42 +09:00
Sakamoto Shiina 31deeae53f [Update] Support ASS format file. and show actor combine with text. 2025-02-12 18:32:31 +09:00
Sakamoto Shiina 65ee75b49e [Update/TMP] Add feature Scheduled message send. 2025-02-12 14:32:48 +09:00
misyaguziya 60f87e42f8 Merge branch 'bugfix_translation' into develop 2025-02-12 13:48:33 +09:00
misyaguziya bdf67ab7c8 🐛[bugfix] offline時の処理を修正 2025-02-12 13:48:16 +09:00
Sakamoto Shiina 26a3e868e2 Merge branch 'bugfix_global_hotkey_controller' into develop 2025-02-11 15:26:12 +09:00
Sakamoto Shiina 9f728f46d3 [bugfix] GlobalHotKeyController: Fix the bug that even if VRCT is not available, (that when ai models has not been detected), registered the hotkeys works and could turn on main functions. 2025-02-11 15:21:57 +09:00
Sakamoto Shiina 945b2a83a8 Merge branch 'bugfix_translate' into develop 2025-02-10 03:11:25 +09:00
Sakamoto Shiina ab5eeae4bf Merge branch 'bugfix_overlay' into develop 2025-02-10 03:11:01 +09:00
Sakamoto Shiina 3228f0bb50 [bugfix] Overlay: Fix the error 'TypeError:’float’ object cannot be interpreted as an integer'
改行が必要なくらいの長さのテキストを表示しようとするときに出るエラー。計算時、int型に強制変換して修正。
2025-02-10 03:06:14 +09:00
Sakamoto Shiina 9daa50294e [Update] Add VRCT Availability Status that if the status set to false, that is when ai models has not been detected by backend, can't use VRCT. 2025-02-08 21:58:29 +09:00
misyaguziya a36dc93522 Merge branch 'bugfix_translate' of https://github.com/misyaguziya/VRCT into bugfix_translate 2025-02-08 14:31:02 +09:00
misyaguziya 7746cffb08 👍️[Update] Controller : AIモデルが使用可能かを通知するエンドポイントを追加 2025-02-08 14:29:02 +09:00
Sakamoto Shiina 0592695f1f [Update] Add network error notification. 2025-02-07 17:57:27 +09:00
misyaguziya 07723d495a 🐛[bugfix] controller: offline時の処理でエラーになる問題を修正 2025-02-07 10:34:29 +09:00
misyaguziya 78d79f4a54 🐛[bugfix] controller: offline時の処理を追加 2025-02-06 18:29:07 +09:00
Sakamoto Shiina 81e3241e38 Merge branch 'about_vrct' into develop 2025-02-06 17:50:05 +09:00
Sakamoto Shiina 2637e8eef9 [Update] About VRCT: Change the title to only mention 'Special Thanks' and remove 'Supporters' cuz 'Supporters' means patron for now.
Add members.
2025-02-06 17:46:38 +09:00
Sakamoto Shiina d3f87d7801 Merge branch 'supporters_page' into develop 2025-02-05 23:36:38 +09:00
Sakamoto Shiina 8ed5922465 [Update] Adjust calculation and apply multi supporting plans. 2025-02-05 23:34:22 +09:00
misyaguziya 69d9e9bad3 Merge branch 'bugfix_transcript' into develop 2025-02-04 21:08:48 +09:00
misyaguziya 483e6a1d32 🐛[bugfix] Main/Controller : 処理順を修正 2025-02-04 21:05:05 +09:00
misyaguziya 2953f5c7fb 🐛[bugfix] Model : 変数の初期化処理を修正 2025-02-04 21:04:34 +09:00
Sakamoto Shiina 539d360ebe Merge branch 'ui' into develop 2025-02-03 17:15:17 +09:00
Sakamoto Shiina 4df958caf1 Merge branch 'supporters_page' into develop 2025-02-03 17:15:08 +09:00
Sakamoto Shiina 52a43b1780 Merge branch 'bugfix_window_scaling_issue' into develop 2025-02-03 17:14:57 +09:00
Sakamoto Shiina 37aaf1aad0 [Update] Config Page: About VRCT: Apply a responsive design. 2025-02-03 16:49:58 +09:00
Sakamoto Shiina 34f6bb215a [Update] Config Page: supporters: Update-able supporters title calc period. 2025-02-03 14:08:07 +09:00
Sakamoto Shiina 0955aaa12c [Update] Config Page: Supporters: Add animation. 2025-02-03 12:41:19 +09:00
Sakamoto Shiina 4fb675943f [Update] Config Page: Supporters: Update-able anytime.
Fetch the supporters data and images from the git repo, https://github.com/ShiinaSakamoto/vrct_supporters, via web.
2025-02-03 11:26:10 +09:00
misyaguziya 182c277ef5 Merge branch 'bugfix_errorlog' into develop 2025-01-31 13:12:15 +09:00
misyaguziya ec590240c0 🐛[bugfix] Utils : loggerのファイル容量を制限(10MBまで)、ローテーションとしてxxx.logとxxx.log.1を生成するように変更 2025-01-31 13:11:45 +09:00
Sakamoto Shiina 225c9c73b9 [Update] Main Page: Sidebar: Add scroll bar to compact mode. 2025-01-30 21:40:06 +09:00
Sakamoto Shiina e39f77704e [Update] Config Page: Side menu: Add scroll bar. 2025-01-30 21:19:50 +09:00
Sakamoto Shiina 87b890652b Merge branch 'version_copy_feature' into develop 2025-01-30 20:01:54 +09:00
Sakamoto Shiina 1b2a9a4efd [Update] Add Copyable version label. 2025-01-30 20:00:34 +09:00
Sakamoto Shiina 5869cbae2f [bugfix] Fix window size and scale issue when windows' scaling is not 100%. 2025-01-30 12:00:10 +09:00
Sakamoto Shiina 59fe407834 [bugfix] Fix window scaling issue when dragging between monitors. 2025-01-28 18:50:53 +09:00
Sakamoto Shiina 2caf04fcd1 [Refactor] Remove the files that was for backup the code. 2025-01-28 17:39:31 +09:00
Sakamoto Shiina e48d1a09c7 Merge branch 'supporters_page' into develop 2025-01-28 17:30:38 +09:00
Sakamoto Shiina ae0b21e233 [Update] Change the design support us section (Add ko-fi and patreon button.). 2025-01-28 16:08:21 +09:00
Sakamoto Shiina ef5ec8732a [Update] Add supporter period. 2025-01-27 20:14:36 +09:00
Sakamoto Shiina eb9519cfdd [Refactor/Update] Organize the codes for easy to update. Cut out rendering cost. 2025-01-27 17:57:52 +09:00
Sakamoto Shiina ccb8425f97 Merge branch 'bugfix_npm_run_script' into develop 2025-01-23 15:41:00 +09:00
Sakamoto Shiina 473ac08572 [bugfix] npm run releaseやrelease-cudaなど単体実行時、新たにbuildされずに前回build実行時のコードのままでパッケージされてしまうのを修正。 2025-01-23 15:38:19 +09:00
Sakamoto Shiina 5fc00a53dc Merge branch 'fix_message_input_box' into develop 2025-01-22 10:54:02 +09:00
Sakamoto Shiina e3f118254d [bugfix] Message Input Box: Remove unnecessary padding where the input box right when the send button is hide. 2025-01-22 10:47:31 +09:00
Sakamoto Shiina fe16a94262 [bugfix] Message Input Box: fix and change calculation rem to percentage.
*When resize the window, input box height wasn't change on purpose. but the down side was made some bugs.
so gave it up and change the calculation.
2025-01-22 10:29:14 +09:00
Sakamoto Shiina 43951cf9ba Merge branch 'update_readmes' into develop 2025-01-21 16:38:09 +09:00
Sakamoto Shiina 5eeeb97286 [bugfix/Update] Add zh-Hant selection to README.ko 2025-01-21 16:33:00 +09:00
Sakamoto Shiina 9fc03a7a5f [Update] Add Support us section and buttons.
Change VRCT logo size and adjust dark/light theme on github.
2025-01-21 16:29:25 +09:00
Sakamoto Shiina a1be11ae24 [Chore] Change a new line code. 2025-01-21 05:41:53 +09:00
Sakamoto Shiina d42bbb2c21 Merge branch 'hotkeys' into develop 2025-01-20 12:32:08 +09:00
Sakamoto Shiina 93a6d304c0 [Update] Hotkeys: Add prevent the default function that when pressed F10, F12. 2025-01-20 12:27:30 +09:00
Sakamoto Shiina 16b41c8102 [bugfix] to register hotkeys when start up the software.(to unregisterAll when the software is updating) 2025-01-20 12:06:05 +09:00
misyaguziya 710fccc1c0 Merge branch 'add_funding_url' into develop 2025-01-19 15:16:29 +09:00
misyaguziya 2c6e952ff9 👍️[Update] Add Funding URL (patreon, ko-fi ) 2025-01-19 15:16:01 +09:00
Sakamoto Shiina d074b3e881 Merge branch 'feature_hotkey' into develop 2025-01-17 06:19:49 +09:00
Sakamoto Shiina 3e23509e68 [Update] Prevent to register the same hotkey that is already in use. 2025-01-17 05:18:09 +09:00
Sakamoto Shiina 21235068f7 [Update] Add Japanese and add breakpoint. 2025-01-17 04:33:15 +09:00
Sakamoto Shiina 04f7c1f556 [Update] Prevent hotkeys function while opening config page and register the hotkeys when closed. 2025-01-17 04:08:13 +09:00
Sakamoto Shiina bac7bb15d3 [Update] Add hotkeys main functions 2025-01-17 02:41:27 +09:00
Sakamoto Shiina 34d221c437 [Update] Save and register -able. 2025-01-13 06:56:13 +09:00
Sakamoto Shiina a76ea77d5d [Refactor] Refactor. 2025-01-12 22:56:00 +09:00
Sakamoto Shiina ff57454073 [Update/TMP] tmp 2025-01-12 04:46:55 +09:00
Sakamoto Shiina 9e5af73ccb [Update/TMP] The shortcut will trigger whenever.(Remove the checking whether the window is VRChat or not) 2025-01-05 14:23:10 +09:00
Sakamoto Shiina 47126bf5c8 [Update/TMP] Hotkey Alt+Y will active VRCT when VRChat is the active window. 2025-01-05 14:10:48 +09:00
Sakamoto Shiina ffa1319b5b Merge branch 'ui' into develop 2025-01-03 21:14:49 +09:00
Sakamoto Shiina abeeb69afb [Chore] About VRCT: Set the position to center. 2025-01-03 21:12:14 +09:00
Sakamoto Shiina 31fb57baad [bugfix] Message Page: Message Logs: System Message: Fix width and set to text center. 2025-01-03 20:59:06 +09:00
Sakamoto Shiina b6b73b2d01 [Chore] Update Modal: Deny button. to be a little bit darker. 2025-01-03 20:30:09 +09:00
Sakamoto Shiina 4502f30b29 [bugfix] Main Page: Message Logs: Sent Message: Fix text wrap that was not wrap and over flowed. 2025-01-03 20:12:07 +09:00
Sakamoto Shiina 227aacd005 [Refactor/bugfix] Main Page: Message Logs. Fix scroll animation, that is not using at this time though. 2025-01-03 19:04:46 +09:00
Sakamoto Shiina 0d6c73fba4 [Chore] Config Page: Device: Adjust label position. 2025-01-02 20:53:39 +09:00
Sakamoto Shiina 5d0e9e0559 [Refactor] Tidy up the color variables. 2025-01-02 19:22:09 +09:00
misyaguziya 93975aab36 Merge branch 'bugfix_compute_type' into develop 2025-01-02 17:11:33 +09:00
Sakamoto Shiina d798562de7 [bugfix] Main Page: MessageInputBox: Fix the bug that can't bring the history back and occur undefined error when shift+arrow down kay pressed. 2025-01-02 16:00:00 +09:00
misyaguziya 567907fc4d 🐛[bugfix] Model : Added the ability to automatically select calculation types from GPU devices 2025-01-02 08:32:35 +09:00
misyaguziya e9d33b6e42 Merge branch 'develop' 2024-12-31 19:47:28 +09:00
misyaguziya 7616a11a46 Merge branch 'version' into develop 2024-12-31 19:46:53 +09:00
misyaguziya 5b21aef481 👍️[Update] Version : 3.0.0 -> 3.0.1 2024-12-31 19:46:40 +09:00
misyaguziya 4007731342 Merge branch 'develop' 2024-12-31 19:40:18 +09:00
Sakamoto Shiina a1e2bc2e66 Merge branch 'ui' into develop 2024-12-31 15:37:26 +09:00
misyaguziya e595dc4025 Merge branch 'installer' into develop 2024-12-31 14:46:20 +09:00
misyaguziya 70014cbdf1 🐛[bugfix] Installer : AIモデルの選択を削除 2024-12-31 14:21:35 +09:00
Sakamoto Shiina 5673225ecc [Update] Starting up: Add animation more to announcements button. 2024-12-31 13:15:41 +09:00
Sakamoto Shiina dfc9b66059 Merge branch 'ui' into develop 2024-12-30 22:42:39 +09:00
Sakamoto Shiina 9ee1275162 [Update] root.css: Prevent user drag and select images. 2024-12-30 21:28:20 +09:00
Sakamoto Shiina 806e65e85e [Update] Main Page: Top bar help button: Change the link document to temporary hub(Google sheet). 2024-12-30 19:27:27 +09:00
Sakamoto Shiina f5b0252e79 [Update] Starting up: Adjust announcement button's design and animation. 2024-12-30 19:11:35 +09:00
Sakamoto Shiina c69cce00b6 [Update] Config Page: Compute Device. Add button that can open the software version updater. 2024-12-30 17:19:06 +09:00
misyaguziya b032e101e3 Merge branch 'develop' 2024-12-30 15:19:51 +09:00
misyaguziya 3edca119dd Merge branch 'installer' into develop 2024-12-30 15:19:05 +09:00
misyaguziya 02e2624842 🐛[bugfix] Installer : アンインストール時に_internalフォルダを削除するように修正 2024-12-30 15:18:33 +09:00
misyaguziya 9a4911f6d5 🐛[bugfix] Installer : perUser -> currentUser 2024-12-30 15:13:36 +09:00
misyaguziya a21fd5aa96 🐛[bugfix] Installer : アンインストール時に追加で生成されたファイルも削除するように変更 2024-12-30 14:53:56 +09:00
Sakamoto Shiina f7638366ee Merge branch 'ui' into develop 2024-12-30 14:47:09 +09:00
Sakamoto Shiina 24a90007f3 [Update] Starting up: Add close button. 2024-12-30 14:44:36 +09:00
misyaguziya 97f06c66f3 🐛[bugfix] Installer : インストール先がコンピュータの場合管理者権限が必要なため、インストール先をユーザーに制限するように変更した 2024-12-30 14:41:49 +09:00
Sakamoto Shiina 0283a74bfe [bugfix] Main Page: Message Logs: Fix text-align where sent message. 2024-12-30 13:39:38 +09:00
Sakamoto Shiina 07fa8b6720 Merge branch 'ui' into develop 2024-12-30 10:56:07 +09:00
Sakamoto Shiina c2868e445f [Update] Starting Up: Add announcements button to starting up display. temporarily tho 2024-12-30 10:53:47 +09:00
misyaguziya e5d4307436 Merge branch 'develop' 2024-12-29 01:25:28 +09:00
misyaguziya 94d46cf094 Merge branch 'installer' into develop 2024-12-29 01:24:41 +09:00
misyaguziya aadda48d3b 🐛[bugfix] Installer : githubのアップロード容量制限により、zipファイルの保存先をhaggingfaceへ変更 2024-12-29 01:24:16 +09:00
misyaguziya 01fc0d1fc8 Merge branch 'develop'
# Conflicts:
#	config.py
#	controller.py
#	locales/en.yml
#	locales/ja.yml
#	locales/ko.yml
#	locales/zh-Hans.yml
#	locales/zh-Hant.yml
#	models/overlay/overlay_image.py
#	requirements.txt
#	view.py
#	vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py
2024-12-28 21:26:13 +09:00
misyaguziya 530f78c35e Merge branch 'remove_files' into develop 2024-12-28 17:58:03 +09:00
misyaguziya d771ada3fd Merge branch 'for_webui' into remove_files
# Conflicts:
#	build.bat
#	install.bat
#	locales/en.yml
#	locales/ja.yml
#	locales/ko.yml
#	locales/readme_first.txt
#	locales/zh-Hant.yml
#	requirements.txt
#	src-python/models/overlay/overlay_utils.py
#	src-python/models/transcription/transcription_languages.py
#	src-python/models/transcription/transcription_recorder.py
#	src-python/models/transcription/transcription_transcriber.py
#	src-python/models/transcription/transcription_whisper.py
#	src-python/models/translation/translation_languages.py
#	src-python/models/translation/translation_translator.py
#	src-python/models/translation/translation_utils.py
#	src-ui/assets/about_vrct/contributors_members.png
#	src-ui/assets/about_vrct/contributors_section_title.png
#	src-ui/assets/about_vrct/dev_section_title.png
#	src-ui/assets/about_vrct/localization_section_title.png
#	src-ui/assets/about_vrct/poster_showcase_section_title.png
#	src-ui/assets/about_vrct/project_link_booth.png
#	src-ui/assets/about_vrct/project_link_contact_us.png
#	src-ui/assets/about_vrct/project_link_documents.png
#	src-ui/assets/about_vrct/project_link_vrct_github.png
#	src-ui/assets/about_vrct/showcased_worlds/language_exchange_tervern.png
#	src-ui/assets/about_vrct/showcased_worlds/silakan_datang_ke_rumahku.png
#	src-ui/assets/about_vrct/showcased_worlds/sushi_stand_guruguru.png
#	src-ui/assets/about_vrct/special_thanks_message_en.png
#	src-ui/assets/about_vrct/special_thanks_message_ja.png
#	src-ui/assets/about_vrct/special_thanks_section_title.png
#	src-ui/assets/about_vrct/vrchat_disclaimer.png
#	src-ui/assets/about_vrct/vrct_logo_for_about_vrct.png
#	src-ui/assets/about_vrct/vrct_posters/authors/poster_images_authors_en.png
#	src-ui/assets/about_vrct/vrct_posters/authors/poster_images_authors_ja.png
#	src-ui/assets/about_vrct/vrct_posters/authors/poster_images_authors_m_en.png
#	src-ui/assets/about_vrct/vrct_posters/authors/poster_images_authors_m_ja.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_manga_en.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_manga_ja.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_manga_ko.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_poster_cn.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_poster_en.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_poster_ja.png
#	src-ui/assets/about_vrct/vrct_posters/iya_vrct_poster_ko.png
#	src-ui/assets/chato_white.png
#	src-ui/assets/chato_white_square.png
#	src-ui/assets/swap_icon.png
#	src-ui/assets/vrct_logo_for_dark_mode.png
2024-12-28 17:56:14 +09:00
misyaguziya 3719f5142e 🗑️[remove] 不要なファイルを削除 2024-12-28 17:50:09 +09:00
misyaguziya 2e0fbda239 Merge branch 'version' into for_webui 2024-12-28 15:49:43 +09:00
misyaguziya 6d28f62aba 👍️[Update] Version : v 2.2.9 -> v 3.0.0. 2024-12-28 15:48:27 +09:00
misyaguziya b6166bfc3f Merge branch 'rename' into for_webui 2024-12-28 15:43:40 +09:00
misyaguziya a8d54768c6 👍️[Update] Rename/Remove : webui_を削除/test.pyを削除 2024-12-28 15:42:59 +09:00
Sakamoto Shiina da406b55b4 Merge branch 'ui' into for_webui 2024-12-28 10:16:54 +09:00
Sakamoto Shiina 833fa24545 [Update] Config Page: Adjust slider component and deepL auth key component width. 2024-12-28 07:31:16 +09:00
Sakamoto Shiina 9e057d4395 [bugfix] Config Page: To reset scroll position to top when the tabs are changed. 2024-12-28 05:49:30 +09:00
Sakamoto Shiina 0f226da217 Merge branch 'when_the_same_language_is_selected' into for_webui 2024-12-28 05:27:29 +09:00
Sakamoto Shiina afdb9d6914 [Update] Main Page: Translator: Add warning ui to translate selector when the same languages are selected. 2024-12-28 05:24:52 +09:00
misyaguziya 306c84c4b8 Merge branch 'bugfix_multi_language' into for_webui 2024-12-27 22:12:39 +09:00
misyaguziya dfe03ca71c Merge branch 'error_log' into for_webui 2024-12-27 22:12:21 +09:00
misyaguziya 72b6679012 🐛[bugfix] Controller : 翻訳Engineの設定条件を追加 2024-12-27 22:11:43 +09:00
misyaguziya 146da42b2d 👍️[Update] Model : loggerの形式を統一 2024-12-27 18:24:00 +09:00
Sakamoto Shiina bfa661aa72 Merge branch 'supporters_page' into for_webui 2024-12-27 17:31:09 +09:00
Sakamoto Shiina 32699e4585 [Update] Supporters: The members cards will be shown in random order every 20 seconds. 2024-12-27 17:26:54 +09:00
Sakamoto Shiina 26c3e10050 [Update] Supporters: Add 'and you' card to the end of them for not making to be alone style whenever flex-style changed.
Add and fix some sentences.
2024-12-27 10:21:14 +09:00
Sakamoto Shiina 8b65434790 Merge branch 'bugfix_dropdown_component' into for_webui 2024-12-26 16:16:49 +09:00
Sakamoto Shiina a36cd988c2 [bugfix] Config Page: Device. Fix the dropdown label that was possibly undefined. 2024-12-26 16:14:46 +09:00
Sakamoto Shiina 648e0d954a Merge branch 'word_filter_system_message' into for_webui 2024-12-26 15:37:16 +09:00
Sakamoto Shiina 92cb5801da [Update] Main Page: Message Logs. Add system message (Word Filter) 2024-12-26 15:35:41 +09:00
Sakamoto Shiina 775e92daf5 Merge branch 'ui' into for_webui 2024-12-26 13:42:22 +09:00
Sakamoto Shiina 3991747dad [Update] Localization: Add the comments. 2024-12-26 13:40:47 +09:00
Sakamoto Shiina 7202b86e78 [Update] Update/Switch Compute Device Modal: Add description. 2024-12-26 11:52:38 +09:00
Sakamoto Shiina d6aff05ebf [Update] Config Page: Transcription, Whisper models. Add desc. 2024-12-26 08:10:06 +09:00
Sakamoto Shiina c15c11fa63 Merge branch 'add_supporters_section' into for_webui 2024-12-26 06:44:20 +09:00
Sakamoto Shiina fcdb38c9cf [Update] Config Page: Add Supporters Section. -2024.12 2024-12-26 06:42:57 +09:00
Sakamoto Shiina 01bff554e6 Merge branch 'update_about_vrct' into for_webui 2024-12-24 03:14:52 +09:00
Sakamoto Shiina 1107d575be [Update] About VRCT. Update. 2024-12-24 03:13:48 +09:00
Sakamoto Shiina 939db21e00 Merge branch 'bugfix_message_logs' into for_webui 2024-12-23 19:22:37 +09:00
Sakamoto Shiina 55b9bfd69c [bugfix/TMP] Fix the bug that message logs hasn't scrolled down even when it should be.(like when the logs update speed fast) 2024-12-22 17:57:12 +09:00
misyaguziya 50f3c85548 Merge branch 'bugfix_transcript' into for_webui 2024-12-21 17:34:40 +09:00
misyaguziya b545abce44 🐛[bugfix] Model : resultを取得する際にエラーが出る問題を修正 2024-12-21 17:34:10 +09:00
misyaguziya 0c500effba Merge branch 'sidecar' into for_webui 2024-12-21 02:32:55 +09:00
misyaguziya 215ce618ba 🐛[bugfix] Sidecar : iconを削除 2024-12-21 02:32:40 +09:00
misyaguziya 59a9b893b5 Merge branch 'overlay_sample' into for_webui 2024-12-21 01:17:48 +09:00
misyaguziya b7e37980e0 👍️[Update] Model : overlay large logのsampleのエンドポイントを修正 2024-12-21 01:17:22 +09:00
Sakamoto Shiina 899c4c08ef Merge branch 'ui' into for_webui 2024-12-21 01:03:10 +09:00
misyaguziya 61920a19db Merge branch 'overlay_sample' into for_webui 2024-12-21 00:58:16 +09:00
misyaguziya c506a1f08f 👍️[Update] Model : overlay large logのsampleエンドポイントを追加 2024-12-21 00:57:50 +09:00
Sakamoto Shiina 2aab58d1ea [bugfix] Config Page: Checkbox. Resend Button. Fix pending status that was endlessly showed loading UI. 2024-12-20 23:59:00 +09:00
Sakamoto Shiina 56fda283b4 [Update] Config Page: Adjust some width and design that was shrink unexpectedly.
Remove some indicator numbers and only show even numbers on Slider components.
2024-12-20 23:53:39 +09:00
Sakamoto Shiina 64c14fab2f [Update] Update Modal: Change the cuda version description to imply the meaning NVIDIA GPU only.
and fix design a bit.
2024-12-20 23:37:52 +09:00
Sakamoto Shiina ff5aa80633 Merge branch 'ui' into for_webui 2024-12-20 19:11:30 +09:00
Sakamoto Shiina 798a4a87fc [Update] Change the design. Update/Switch CPU/GPU version. 2024-12-20 19:05:30 +09:00
Sakamoto Shiina 5a498fc98c [Update] Main Page: Add headphones icon to every language select open button when Speaker2Log is turned on. 2024-12-20 03:48:33 +09:00
Sakamoto Shiina 9b41bfd1ee Merge branch 'ui' into for_webui 2024-12-20 03:43:41 +09:00
Sakamoto Shiina 1d615ab97d [Update] Config Page: Advanced Settings Tab. Add modal and section that is switchable between CPU and CUDA version. 2024-12-20 01:28:44 +09:00
misyaguziya d3cfdea855 Merge branch 'bugfix_translate_language' into for_webui 2024-12-19 21:31:50 +09:00
misyaguziya c74b5f0929 🐛[bugfix] Model : your とtargetの言語が同一だった場合に一部の翻訳エンジンでエラーが発生するため、その場合に翻訳エンジンをCTranslate2に強制するように修正 2024-12-19 21:31:24 +09:00
Sakamoto Shiina 0eec985a62 [bugfix/Refactor] Checkbox Component. Fix to disabled when it's loading(it was clickable continuously) 2024-12-19 15:38:09 +09:00
misyaguziya 10651f75e5 Merge branch 'multi_language_transcript' into for_webui 2024-12-19 15:21:14 +09:00
misyaguziya 309869c494 🐛[bugfix] Model : 非対応言語の場合に文字起こし失敗の例外処理をパスするように修正 2024-12-19 15:19:38 +09:00
misyaguziya 616125895b Merge branch 'multi_language_transcript' into for_webui 2024-12-19 13:45:47 +09:00
misyaguziya 4d2fd379a8 👍️[Update] Model : 複数言語選択時に複数の音声に対して文字起こしを行う機能を追加 2024-12-19 13:44:52 +09:00
Sakamoto Shiina 0b3e17c331 Merge branch 'ui' into for_webui 2024-12-19 04:05:30 +09:00
Sakamoto Shiina 81ae79dc92 [Update] Localization: en. remove the word 'Select' from some labels in Config Page. 2024-12-18 17:20:28 +09:00
Sakamoto Shiina c429a82b0f [bugfix] Fix some breakpoints. 2024-12-18 17:13:19 +09:00
Sakamoto Shiina 8cc66ca0cc [Update] Config Page: VR Tab. Add button that send sample texts to Overlay. per 1 sec for now. 2024-12-18 16:31:10 +09:00
Sakamoto Shiina 8629d9aa4a [Update/bugfix] Quick Settings: Expand width.
Config Page: Sidebar: shrink width a bit.
Config Page: Setting Box: each component: Fix gap to prevent sliders cover the label.
2024-12-17 23:56:30 +09:00
misyaguziya 01d9c27728 Merge branch 'bugfix_overlay' into for_webui 2024-12-17 23:47:00 +09:00
misyaguziya 02673f772a Merge branch 'bugfix_transcript' into for_webui 2024-12-17 23:46:42 +09:00
misyaguziya a1b9aed8a9 🐛[bugfix] Model : overlayのリスタート処理を修正 2024-12-17 23:44:44 +09:00
Sakamoto Shiina 0f7bc29069 [Update] Localization: Config Page: Transcription Tab: Whisper weight type section. change description. 2024-12-17 22:33:48 +09:00
Sakamoto Shiina 3c9c4366ea [Update] Config Page: Change the background color modal and quick settings. 2024-12-17 20:16:44 +09:00
Sakamoto Shiina 988a42f15d [Update] Config Page: VR Tab: Position, Rotation settings. Add reset button that is set default settings. 2024-12-17 20:00:04 +09:00
misyaguziya 6a8a09a3b7 🐛[bugfix] Model : 文字起こしのスピーカー終了処理時のキューの削除処理をマイクの終了処理のキューの削除処理に合わせるように修正 2024-12-17 16:10:44 +09:00
Sakamoto Shiina ea59cdc63c Merge branch 'ui' into for_webui 2024-12-17 15:17:52 +09:00
misyaguziya e8d195410e Merge branch 'bugfix_translate' into for_webui 2024-12-17 02:18:39 +09:00
misyaguziya 1afbd8fec6 👍️[Update] Controller : 翻訳エンジンがlimit error時にerror対象の翻訳エンジンのみを使用不可にするように変更 2024-12-17 02:18:26 +09:00
Sakamoto Shiina 857c28db22 [Chore] Config Page: VR: Position, Rotation label's position to a bit above. 2024-12-17 02:02:12 +09:00
Sakamoto Shiina 04b746923c [Update] Localization. Main Page: MessageLogSettingsContainer MessageLogs. Add some Japanese. 2024-12-17 01:28:34 +09:00
Sakamoto Shiina 95855d8191 [Update] Main Page: Message MessageLogSettingsContainer: Add config icon to bottom of it. 2024-12-17 01:11:26 +09:00
misyaguziya 813f2d20f9 👍️[Update] Controller : フラグのON/OFFタイミングを修正 2024-12-17 00:19:50 +09:00
misyaguziya d381c0a474 Merge branch 'error_log' into for_webui 2024-12-16 23:38:35 +09:00
misyaguziya 3fa819df3f 👍️[Update] All : 不要なprintLogを削除 / なるべくtry exceptした場合にはerrorLogを保存するように変更 2024-12-16 23:38:05 +09:00
Sakamoto Shiina 13deaffee4 [Update] Localization: Config Page: Add some japanese. 2024-12-16 23:30:01 +09:00
misygauziya 030b8a9f01 👍️[Update] Main : error logのトレースバックの処理を集約 2024-12-16 14:22:49 +09:00
misygauziya 8a4721b61d Merge branch 'default_compute_device' into for_webui 2024-12-16 10:13:13 +09:00
misygauziya a78d63398d 👍️[Update] Config : 初回起動時に限りgpuが使える場合はdefaultでgpuを使用する設定になるように変更 2024-12-16 10:11:53 +09:00
Sakamoto Shiina 78decb1ad0 Merge branch 'ui' into for_webui 2024-12-14 19:29:54 +09:00
Sakamoto Shiina 0f0dcb560c [Update] Config Page: Temporality, Remove About VRCT section. 2024-12-14 19:27:17 +09:00
misyaguziya 0678e3e8bc Merge branch 'text_format' into for_webui 2024-12-14 19:07:57 +09:00
misyaguziya cf04771d32 👍️[Update] Controller : メッセージフォーマットの翻訳を改行で表現するように変更 2024-12-14 19:07:32 +09:00
Sakamoto Shiina 44f2354483 Merge branch 'prepare_to_the_beta_test' into for_webui 2024-12-14 18:22:45 +09:00
Sakamoto Shiina 9b0a71cccc [Update] Prepare to the beta test. Disable the window refresh function(f5 key) and i18n debug mode. 2024-12-14 18:20:56 +09:00
Sakamoto Shiina b3a4a25504 Merge branch 'overlay' into for_webui 2024-12-14 13:59:01 +09:00
Sakamoto Shiina 62131b1f3c Merge branch 'ui' into for_webui 2024-12-14 13:50:32 +09:00
Sakamoto Shiina 9f3ff15499 [bugfix/Prepare] Main Page: Message Logs. Remove test code. and hide init invalid endpoint for now.
Fix the error 'Uncaught TypeError: currentMessageLogs.data.map is not a function' with change the type obj to array when init.
2024-12-14 13:43:13 +09:00
Sakamoto Shiina a5ad2408be [bugfix] Main Page: TranslatorSelectorOpenButton. Fix the new line. 2024-12-13 19:18:53 +09:00
misyaguziya 43b481c185 🐛[bugfix] Model : 起動処理/終了処理を修正 未起動でのパラメータ変更時のエラーを修正 2024-12-13 17:32:32 +09:00
Sakamoto Shiina 5cbd8c46ab [Chore] Config Page: software version text. Adjust size a bit. 2024-12-13 15:42:27 +09:00
Sakamoto Shiina 6d84cabf88 [Update] Config Page: VR Tab: Add restore default settings button. 2024-12-13 15:12:36 +09:00
Sakamoto Shiina b570034e5b Merge branch 'organize_packages_npm' into for_webui 2024-12-13 14:25:48 +09:00
Sakamoto Shiina dc1f6d52c8 [Update] Update and fixed the most of the packages for now.(update sass is postponed cuz import syntax deprecated.) 2024-12-13 14:20:03 +09:00
Sakamoto Shiina 62edaf552f [Update] Update Packages tauri and vite. confirmed the released data and It's working. 2024-12-13 12:18:04 +09:00
Sakamoto Shiina 3473d40b89 [Update] Update MUI v5 to v6 and it needs @emotion/react @emotion/styled so restored them... 2024-12-13 10:25:15 +09:00
Sakamoto Shiina 949270b8ca [Remove] Remove some packages that is no longer in use.
@emotion/react, @emotion/styled: It was installed when installed MUI (Material UI) as official install documentation but it doesn't use it for now.
@typescript-eslint/eslint-plugin, @typescript-eslint/parser: It's not using Typescript so remove it. I think it was installed when it set up by vite at the first time? I guess.
2024-12-13 09:55:57 +09:00
Sakamoto Shiina 0e74833f22 Merge branch 'ui' into for_webui 2024-12-13 09:30:46 +09:00
Sakamoto Shiina 941c24d9b8 [Update] Main Page: LanguageSelectorOpenButton. Only show the speaker icon at the first target language section. 2024-12-13 09:18:35 +09:00
Sakamoto Shiina 266eb6319b [Update] Add some localization texts(Japanese). 2024-12-13 09:13:43 +09:00
Sakamoto Shiina 461c59f5e8 [Update] Main Page: Language Settings. Change the design add and remove target language buttons. 2024-12-12 17:23:29 +09:00
Sakamoto Shiina 192d6ec0e6 Merge branch 'ui_multi_language' into for_webui 2024-12-12 16:17:23 +09:00
Sakamoto Shiina a7d094bbcb [Update] Main Page: Add UI, multi language. 2024-12-12 16:16:40 +09:00
Sakamoto Shiina 607c04d7ba Merge branch 'multi_language' into for_webui 2024-12-11 07:08:51 +09:00
misyaguziya 1d2b41be13 Merge branch 'immediate_save_config' into for_webui 2024-12-11 01:09:57 +09:00
misyaguziya fb6e758607 👍️[Update] Config : 一部configを即時に保存するように変更 2024-12-11 01:08:30 +09:00
misyaguziya e2a30d9371 👍️[Update] Model : 多言語対応のkeyを数字に変更 2024-12-10 20:09:04 +09:00
Sakamoto Shiina fbf0a79085 Merge branch 'adjust_localization' into for_webui 2024-12-10 18:48:02 +09:00
Sakamoto Shiina ae3e359fd6 [Refactor/Update] Organize localization files and apply to some labels. 2024-12-10 18:45:52 +09:00
misyaguziya b635d452b1 Merge branch 'multi_language' into for_webui 2024-12-10 17:30:56 +09:00
misyaguziya bd38d220c8 👍️[Update] Model : 多言語対応の処理をtabごとに持つように変更 2024-12-10 17:11:11 +09:00
misyaguziya 3cadad4a71 Merge branch 'bugfix_ssl_error' into for_webui 2024-12-10 14:57:25 +09:00
misyaguziya 6a30c62769 🐛[bugfix] Model : プロクシ等でPOST/GETした場合にSSL認証エラーが発生する問題に対応 #33 2024-12-10 14:56:47 +09:00
Sakamoto Shiina 656b7c414c [Update] Localization: Adjust and apply new line code. 2024-12-09 17:19:54 +09:00
Sakamoto Shiina 5ad4207f29 [Update] Localization: json to yaml. 2024-12-09 16:52:40 +09:00
Sakamoto Shiina 057e2ced63 Merge branch 'ui' into for_webui 2024-12-09 10:49:24 +09:00
Sakamoto Shiina d7243190cb [Refactor] App.jsx: Distribute controllers to each files. 2024-12-09 10:44:34 +09:00
Sakamoto Shiina b4eacc7175 [bugfix_2] Main Page: Message Log Input Box Ratio: Fix init apply ratio. (when I did it at the first time, 5ddc77a9cc, it looks not fixed yet.) 2024-12-09 09:25:05 +09:00
Sakamoto Shiina a2bcbed780 [Chore] Change the name of functions. Remove and organize some imports. 2024-12-08 17:38:56 +09:00
Sakamoto Shiina e7b8dac36d [Update] Config Page: Add notification ui. show error messages. 2024-12-08 17:02:19 +09:00
Sakamoto Shiina c65bb4578c [Update] Config Page: Translation Tab: DeeplAuthKey. Add disable and loading ui when it's pending status. 2024-12-07 05:28:13 +09:00
Sakamoto Shiina 9c5625ac85 [Update] Config Page: Translation Tab: DeeplAuthKey. to be editable when input box is empty. 2024-12-06 13:59:06 +09:00
Sakamoto Shiina 2a9a905794 Merge branch 'ui' into for_webui 2024-12-06 13:08:36 +09:00
Sakamoto Shiina 043208f58f [Update] Add updating display. 2024-12-06 13:07:00 +09:00
Sakamoto Shiina a55e1dd59f [Chore] Config Page: Adjust design a bit. 2024-12-06 11:09:09 +09:00
Sakamoto Shiina f4aea309cf [Update] Config Page: Add break point and change the design layout.(UI Scaling will apply) 2024-12-06 10:27:37 +09:00
Sakamoto Shiina 451391bcdb [Update/Refactor] UI: Slider component. Adjust color and code. 2024-12-05 11:00:34 +09:00
Sakamoto Shiina 6367140708 [Update] Config Page: VR Tab. Add section show only translated messages. 2024-12-05 10:15:57 +09:00
misyaguziya cae9589427 Merge branch 'updater' into for_webui 2024-12-04 11:34:14 +09:00
misyaguziya 90c6daeb29 👍️[Update] Build : backend.exe -> VRCT-sidecar.exe 2024-12-04 11:33:19 +09:00
misyaguziya 2adf451dbe Merge branch 'cuda' into for_webui 2024-12-03 12:59:21 +09:00
misyaguziya 1c4a832afc 🐛[bugfix] Controller : compute device変更時に翻訳エンジンのAIモデルを変更するように修正 2024-12-03 12:59:04 +09:00
Sakamoto Shiina 358ea324a6 Merge branch 'compute_device_selector' into for_webui 2024-12-03 11:07:29 +09:00
Sakamoto Shiina 2a4ef9ba13 [Fix] git_fix 2024-12-03 11:06:43 +09:00
Sakamoto Shiina 1f148d5979 Merge branch 'compute_device_selector' into for_webui 2024-12-03 10:27:21 +09:00
Sakamoto Shiina 7d8a2cacd0 [Update] Config Page: Translation, Transcription Tab. Add Select CTranslate2/Whisper Compute Device section. 2024-12-03 10:25:53 +09:00
misyaguziya e6a7ff03aa Merge branch 'bugfix_cuda' into for_webui 2024-12-03 08:22:45 +09:00
misyaguziya ddf7fadc91 🐛[bugfix] Config : compute device "name" -> "device_name" 2024-12-03 08:21:43 +09:00
misyaguziya 37c53a9c36 Merge branch 'for_webui' of https://github.com/misyaguziya/VRCT into for_webui 2024-12-02 22:35:48 +09:00
misyaguziya 1a1ea80d13 Merge branch 'config_safety_settings' into for_webui 2024-12-02 22:33:21 +09:00
misyaguziya d1e124b392 🐛[bugfix] Config : MESSAGE_FORMATの処理を修正 2024-12-02 22:33:03 +09:00
Sakamoto Shiina b729cfe653 Merge branch 'ui' into for_webui 2024-12-02 20:05:59 +09:00
misyaguziya 455d464f80 Merge branch 'config_safety_settings' into for_webui 2024-12-02 19:57:21 +09:00
misyaguziya becff72cfa 👍️[Update] Config : config.jsonが異常値だった場合のセーフティ機能を追加 2024-12-02 18:19:36 +09:00
misyaguziya 36943fd6cd Merge branch 'overlay' 2024-12-02 11:21:13 +09:00
misyaguziya f0bf6aee8d Merge branch 'overlay_only_translation' into for_webui 2024-12-02 11:15:24 +09:00
misyaguziya bf49715209 👍️[Update] Model : overlay_show_only_translated_messagesのendpointを追加 2024-12-02 11:15:10 +09:00
misyaguziya 1083ee6ca2 Merge branch 'overlay_only_translation' into for_webui 2024-12-02 11:07:25 +09:00
misyaguziya c0942b0fbc 👍️[Update] Model : Add send only translated messages overlay #32 for web_ui 2024-12-02 11:07:09 +09:00
misyaguziya e25abe11eb Merge branch 'cuda' into for_webui 2024-12-02 10:06:01 +09:00
misyaguziya 9d62906903 👍️[Update] Main : Add endpoint "/get/data/compute_mode" 2024-12-02 10:05:45 +09:00
misyaguziya 6017f013a1 Merge branch 'overlay_fade' into for_webui 2024-12-02 09:54:31 +09:00
misyaguziya 93a1a5230b 🐛[bugfix] Model : overlay fadeの処理を修正
overlay ONを複数起動しないように修正
2024-12-02 09:53:40 +09:00
Sakamoto Shiina 3bd0010539 [bugfix] Fix the receive endpoints that was got invalid endpoint but I'm not gonna implement on UI yet so through it for now. 2024-12-02 08:04:26 +09:00
Sakamoto Shiina 7d1ea8755f [bugfix] Main Page: Top bar: Overlay. Fix showing indicator whether enabled or disabled. 2024-12-02 07:38:09 +09:00
Sakamoto Shiina 94f2078fff [bugfix] Fix receive endpoint that was got invalid endpoint but that should've implemented already.(just through tho) 2024-12-02 06:52:13 +09:00
Sakamoto Shiina 8429d9b122 [bugfix] Main Page: Message Input Box. Fix 'show_and_disable_enter_key' behavior that was block everything and can't get arrow up and down key that history navigation feature. 2024-12-02 06:44:27 +09:00
Sakamoto Shiina 474ab3d4b4 [Update] Main Page: Message Input Box. Add startTyping and stopTyping.(send backend and show 「・・・」) 2024-12-02 06:39:43 +09:00
Sakamoto Shiina f721c3c7ad Merge branch 'ui' into for_webui 2024-11-30 20:42:57 +09:00
Sakamoto Shiina b88efcdf08 [Update] Add update software UI(modal). 2024-11-30 20:41:53 +09:00
Sakamoto Shiina 5ddc77a9cc [bugfix] Main Page: Message Log Input Box Ratio: Fix init apply ratio. imperfectly, tho. 2024-11-30 19:28:36 +09:00
misya eefb24280d Merge pull request #32 from McHauge/add-send_only_translated_messages_overlay
Add send only translated messages overlay
2024-11-30 17:23:45 +09:00
misyaguziya 0639be0ea3 Merge branch 'overlay' into for_webui 2024-11-30 16:42:49 +09:00
misyaguziya 663534acf8 👍️[Update] Model : Overlayのフェードの処理を修正 2024-11-30 15:50:31 +09:00
Sakamoto Shiina 7df1eb04d0 [Update] Main Page: Message Logs: Add message log settings. and add tot visible resend or not toggle. 2024-11-30 04:33:38 +09:00
McHauge b019e37b31 remove debug logs 2024-11-27 16:20:23 +01:00
McHauge 6572fb96a3 Add support for send_only_translated_messages_overlay to only send translation to XS-Overlay 2024-11-27 16:04:35 +01:00
misyaguziya 11bee2309a Merge branch 'overlay' into for_webui 2024-11-27 22:47:46 +09:00
misyaguziya 6e0455ef78 👍️[Update] Model : Overlayのスケールがループする問題を修正 2024-11-27 22:47:12 +09:00
McHauge 1ebd32fea9 [Update] Requirements : Upgrade sentencepiece to version 0.2.0 2024-11-27 14:24:58 +01:00
Sakamoto Shiina 2d5d148f17 [Update] Main Page: Add feature that the sent message be editable and resend-able from logs. 2024-11-27 20:37:37 +09:00
misyaguziya 61c8a5a652 👍️[Update] Model : OverlayのUIを調整 2024-11-27 15:48:31 +09:00
Sakamoto Shiina 3a360fcbf0 [bugfix] Fix sendable the message even when it was empty. 2024-11-26 20:28:02 +09:00
Sakamoto Shiina 44888b7e05 [Update] Main Page: Add feature that message history navigation with Shift + ArrowUp/Down. 2024-11-26 20:17:38 +09:00
Sakamoto Shiina bb170d795c Merge branch 'ui_overlay_settings' into for_webui 2024-11-26 18:25:12 +09:00
Sakamoto Shiina 8cb81878db [Update] Config Page: VR Tab. x,y,z pos. ui_scalingのmin maxなど設定値を変数化、ui_config.js上で設定可能に。 2024-11-26 16:23:24 +09:00
misyaguziya 21be71da80 👍️[Update] Model : OverlayのUIを調整 2024-11-26 15:01:13 +09:00
Sakamoto Shiina 01d7858a59 Merge branch 'ui_starting_up_progress' into for_webui 2024-11-26 14:47:02 +09:00
Sakamoto Shiina 70e411daf5 [Update] Add Starting Up Animation and downloading models progress display.
Backend: Move the init progressed position 4 to a little bit earlier.
2024-11-26 14:44:31 +09:00
misyaguziya 83ff143064 Merge branch 'oscquery' into for_webui 2024-11-25 17:49:25 +09:00
misyaguziya 347b71561f 👍️[Update] Model : OSCQueryServiceの起動処理を起動するまで処理するようにロールバック 2024-11-25 17:49:06 +09:00
misyaguziya f468cda043 Merge branch 'oscquery' into for_webui 2024-11-25 15:06:03 +09:00
misyaguziya 81232fdefc 👍️[Update] Model : OSCQueryServiceの起動処理をリトライに変更
起動処理に成功しない場合、Mute同期機能を有効にできないように変更
2024-11-25 14:39:13 +09:00
misyaguziya 819d13dc4e Merge branch 'oscquery' into for_webui 2024-11-23 23:46:20 +09:00
misyaguziya 2e26038eab 👍️[Update] Model : OSCQueryServiceを強制的に起動するように修正 2024-11-23 23:45:59 +09:00
misyaguziya de5c3b3ccf Merge branch 'overlay_image' into for_webui 2024-11-22 12:00:33 +09:00
misyaguziya 8526d36b37 👍️[Update] Model : Overlay largeのUIサイズを調整 2024-11-22 12:00:09 +09:00
misyaguziya d2084bdacd Merge branch 'initialization' into for_webui 2024-11-21 23:49:49 +09:00
misyaguziya 9f163391f2 👍️[Update] Config : "ui_scaling": 0.5 -> 1.0 2024-11-21 23:49:10 +09:00
misyaguziya 650ec2cce7 👍️[Update] Controller : change endpoint for ai model download progress
download_ctranslate2_weight -> download_progress_ctranslate2_weight
download_whisper_weight -> download_progress_whisper_weight
2024-11-21 23:47:36 +09:00
misyaguziya 3e883dfeb7 👍️[Update] Config : Auto device select をTrueに変更 2024-11-21 23:38:08 +09:00
misyaguziya 1b1a2773a1 👍️[Update] Controller : add init progress 2024-11-21 23:36:04 +09:00
misyaguziya 10bac3bbdb 👍️[Update] Model : overlay largeのUIを調整 2024-11-21 21:58:09 +09:00
Sakamoto Shiina 282ab0c2e1 Merge branch 'ui' into for_webui 2024-11-21 19:44:09 +09:00
Sakamoto Shiina e3138bb8e9 [bugfix] Config Page: Advanced Settings Tab. open config file section. Fix the label. 2024-11-21 19:30:48 +09:00
Sakamoto Shiina f2487e2ea6 [bugfix] Fix the error: Uncaught TypeError: Cannot read properties of null (reading 'scrollTop')
I just put Early return, though.
2024-11-21 19:02:09 +09:00
Sakamoto Shiina 737cdf15cf [bugfix] Fix the bug that the component was not re-rendering when even the Ui language is changed. 2024-11-21 18:45:14 +09:00
Sakamoto Shiina 9e58bff26e [Update] Localization. Add zh-Hans.(yaml data from v2.2.9 and I changed its format to json) 2024-11-21 15:35:28 +09:00
Sakamoto Shiina 7e16b2f101 [bugfix] Config Page: Appearance tab. Fix Ui Font setting that was not working. 2024-11-21 15:17:36 +09:00
Sakamoto Shiina c05b5d18fa Merge branch 'ui' into for_webui 2024-11-19 17:10:27 +09:00
Sakamoto Shiina 3d054e4d72 [Update/Refactor] Main Page: When the translation engine is already selected, to not send the data and just close translation engine selector. 2024-11-19 16:57:56 +09:00
Sakamoto Shiina ba408af32a [bugfix] Config Page: RadioButton components. to disabled while it's pending. 2024-11-19 13:10:26 +09:00
misyaguziya bec6578778 Merge branch 'bugfix_overlay' into for_webui 2024-11-19 00:03:59 +09:00
misyaguziya f41c7ad8dc 🐛[bugfix] Model : overlayの設定変更を反映されるように修正 2024-11-19 00:03:31 +09:00
misyaguziya 1dbc4cc422 Merge branch 'bugfix_overlay' into for_webui 2024-11-16 17:52:24 +09:00
misyaguziya 69e248fb07 🐛[bugfix] Model : overlayのinit完了タイミングを修正 2024-11-16 17:52:05 +09:00
misyaguziya 28c645e636 Merge branch 'bugfix_overlay' into for_webui 2024-11-16 10:19:48 +09:00
misyaguziya 2e54648ee6 👍️[Update] Model : Overlayの起動タイミングを修正 2024-11-16 10:19:38 +09:00
misyaguziya 57cc83b332 Merge branch 'bugfix_overlay' into for_webui 2024-11-16 02:41:36 +09:00
misyaguziya 59f544396c 🐛[bugfix] Model : overlayのバグを修正
fontのバスを修正
翻訳の変数の型がstr -> listに変更になったため、修正
2024-11-16 02:41:23 +09:00
Sakamoto Shiina ea12cbc083 Merge branch 'ui_overlay' into for_webui 2024-11-15 17:41:54 +09:00
Sakamoto Shiina d47b47cc5a [UPdate] Config Page: Vr Tab. Add tracker settings. 2024-11-15 17:35:06 +09:00
misyaguziya d8e256ed98 Merge branch 'bugfix_config' into for_webui 2024-11-15 17:27:32 +09:00
misyaguziya cd0aa41e6f 🐛[bugfix] config : _OVERLAY_SMALL_LOG_SETTINGSにtrackerを設定できるように修正 2024-11-15 17:27:18 +09:00
Sakamoto Shiina d024062a05 [Update] Config Page: Vr Tab: Add OverlayLargeLogSettings. 2024-11-15 16:54:23 +09:00
misyaguziya e68cdfbf19 🐛[bugfix] typo : removeLogFiles -> removeLog 2024-11-15 11:24:08 +09:00
misyaguziya b3dda2cecf Merge branch 'init_download' into for_webui 2024-11-15 11:01:19 +09:00
misyaguziya b37d9248c3 👍️[Update] Controller : process.logの削除機能を追加 2024-11-15 11:00:06 +09:00
misyaguziya e147f68a19 👍️[Update] Controller : AI modelのダウンロードをCTranslate2とWhisper同時に行うように変更 2024-11-15 10:58:40 +09:00
Sakamoto Shiina 5d118fc73b Merge branch 'ui_starting_up' into for_webui 2024-11-15 07:14:59 +09:00
Sakamoto Shiina 36e5c66e9b [Update] Starting Up: Add model downloading animation for initialization(temporary). 2024-11-15 07:04:15 +09:00
misyaguziya fddf4d10dc Merge branch 'init_download' into for_webui 2024-11-14 23:09:26 +09:00
misyaguziya c5cd80b542 👍️[Update] Controller : AI modelのダウンロードの同期処理を追加 2024-11-14 22:53:42 +09:00
Sakamoto Shiina 2c7bb53b64 [Update] Starting Up: Add loading animation when the software preparing, until backend is ready. 2024-11-14 15:48:38 +09:00
misyaguziya a3d257fa18 Merge branch 'bugfix_update' into for_webui 2024-11-14 14:43:07 +09:00
misyaguziya 53b169804d 🐛[bugfix] Model : github apiのアクセス制限による起動エラーに対応 2024-11-14 14:42:43 +09:00
misyaguziya 3bdfe0a389 Merge branch 'overlay' into for_webui 2024-11-14 14:13:42 +09:00
misyaguziya d7231e17b8 👍️[Update] Model : Overlay LargeLogのUIを修正 2024-11-14 14:07:51 +09:00
misyaguziya 547a410ecc 👍️[Update] Model : Overlay LargeLogのUIを修正 2024-11-14 13:52:58 +09:00
misyaguziya b6760877e3 👍️[Update] Model : Overlay LargeLogのUIを修正 2024-11-14 11:55:18 +09:00
Sakamoto Shiina 2d77f15c41 Merge branch 'change_init_transcription_engine' into for_webui 2024-11-14 10:40:23 +09:00
Sakamoto Shiina bd69261397 [Update] config.py: 音声認識エンジンの初期値をWhisperからGoogleに変更。 2024-11-14 10:37:05 +09:00
Sakamoto Shiina b4fe4961f7 Merge branch 'ui' into for_webui 2024-11-14 10:08:26 +09:00
Sakamoto Shiina 4b92c210d6 [Update] Main Page: Add the software update available button. 2024-11-14 10:07:09 +09:00
Sakamoto Shiina c374a2dc03 [bugfix] fix error log(console) 2024-11-14 08:05:26 +09:00
misyaguziya b05c952148 🐛[bugfix] Model : Overlay 設定値のミスを修正 2024-11-14 07:03:19 +09:00
Sakamoto Shiina 4b8b098c57 [Update] Config Page: Others Tab: Add EnableSendReceivedMessageToVrc(Speaker2Chatbox). 2024-11-14 06:59:41 +09:00
Sakamoto Shiina 7cacdae46b [Update] Config Page: Transcription Tab. Add section label. 2024-11-14 05:47:41 +09:00
Sakamoto Shiina 7bb64daccb Merge branch 'ui' into for_webui 2024-11-13 12:43:37 +09:00
Sakamoto Shiina 9d620e9834 [Update] Config Page: Transcription Tab. Add SelectedTranscriptionEngine. 2024-11-13 12:35:09 +09:00
Sakamoto Shiina 4db5306178 [Update] Config Page: Translation, Transcription Tab: CTranslate2, Whisper. Apply Localization. 2024-11-13 09:50:21 +09:00
Sakamoto Shiina 6c0c67ab40 [Refactor] Tidy up utils' files and functions. 2024-11-13 09:31:27 +09:00
Sakamoto Shiina dd21623b59 [Update/Refactor] Main Page: Translation Engines. Apply Localization. 2024-11-13 06:54:28 +09:00
misyaguziya a1c29117a5 Merge branch 'develop' 2024-11-12 23:15:36 +09:00
misyaguziya 8fb73cfc56 Merge branch 'remove_speaker2chatbox_pass' into develop 2024-11-12 22:44:13 +09:00
misyaguziya 1a20c899d1 👍️[Update] View : Speaker2ChatboxのDocumentを修正 2024-11-12 22:43:55 +09:00
misyaguziya a1c7b9e1e3 👍️[Update] Model : Speaker2Chatboxの機能をpass無しで動作できるように変更 2024-11-12 22:43:17 +09:00
Sakamoto Shiina f835a3be80 [Refactor] ui_configs: rename the keys. 2024-11-12 15:23:02 +09:00
Sakamoto Shiina b503c843b2 [bugfix] fix the radio button width. 2024-11-12 15:05:15 +09:00
Sakamoto Shiina 8367ccca9e Merge branch 'ui_weight_types' into for_webui 2024-11-12 14:55:20 +09:00
Sakamoto Shiina 96ed2a9afc [Update] Config Page: Transcription Tab. Add Whisper Weight Type Selector. Downloadable. 2024-11-12 14:52:15 +09:00
Sakamoto Shiina 36c53c49a2 [Update] Config Page: Translation Tab. Add Internal Translation Weight Type Selector. Downloadable. 2024-11-12 13:02:05 +09:00
Sakamoto Shiina 6750655237 Merge branch 'about_vrct' into develop 2024-11-11 02:28:15 +09:00
Sakamoto Shiina 6f8cc814a5 [Update] Change the message dev_misya, shiina. Add localization member. Remove the part 'tell us' completely. 2024-11-11 02:24:43 +09:00
misyaguziya 711190bfab Merge branch 'version' into develop 2024-11-11 00:38:33 +09:00
misyaguziya 194568aa4e 👍️[Update] version : 2.2.8 -> 2.2.9 2024-11-11 00:38:20 +09:00
misyaguziya b64f7799bd Merge branch 'readme' into develop 2024-11-11 00:37:18 +09:00
misyaguziya 50315128a7 👍️[Update] README : change Donation icon and add contributors 2024-11-11 00:37:03 +09:00
misyaguziya b7ac2ac89c Merge branch 'bugfix_update' into develop 2024-11-11 00:25:30 +09:00
misyaguziya 3721a55704 🐛[bugfix] Model : github apiのアクセス制限時にエラーとならないように修正 2024-11-11 00:24:27 +09:00
misyaguziya 2df88bf698 👍️[Update] Model : Overlay() classをsizeに依存しない設計に修正 2024-11-10 17:55:06 +09:00
misyaguziya 109b7e62ba 🐛[bugfix] Model : Overlayの起動でライブラリの初期化を行うタイミングでsmallとlargeの2つのハンドルを生成するように変更 2024-11-10 03:58:13 +09:00
misyaguziya d5066cb60d 🐛[bugfix] Model : Overlayの起動処理を修正 2024-11-10 00:57:43 +09:00
misyaguziya 7f1b635f63 👍️[Update] Model : Overlay settings にtrackerを追加 2024-11-09 17:33:51 +09:00
misyaguziya d4f58fdb90 👍️[Update] Model : Overlay Large logを文字起こし動作時に設定するように追加 2024-11-09 17:16:35 +09:00
misyaguziya 78dad96124 👍️[Update] Model : Overlay Large log機能を追加 2024-11-09 16:49:45 +09:00
Sakamoto Shiina 43b061b007 Merge branch 'restore__bugfix_translator' into for_webui 2024-11-07 07:06:39 +09:00
Sakamoto Shiina 768debfb2b [Update] Restore the branch bugfix_translator. 2024-11-07 07:05:55 +09:00
Sakamoto Shiina 2a8c4a6772 Merge branch 'weight_endpoint' into for_webui 2024-11-07 07:04:14 +09:00
Sakamoto Shiina 825811b3b6 [bugfix] 選択中翻訳エンジンリストのアプデ部分が元に戻ってなかったので、追加で元に戻した。 2024-11-07 06:22:17 +09:00
misyaguziya b9160c4ecd 👍️[Update] Main : 以下のエンドポイントを元に戻した
- /get/data/ctranslate2_weight_type
- /set/data/ctranslate2_weight_type
- /get/data/whisper_weight_type
- /set/data/whisper_weight_type
2024-11-07 01:25:47 +09:00
misyaguziya c00542ef57 👍️[Update] Model : overlayのsmall logの処理を整理
- 変数名をsmall_log用に修正
- OVERLAY_SETTINGSを削除しOVERLAY_SMALL_LOG_SETTINGSに統合
- OVERLAY_UI_TYPEを廃止
2024-11-06 04:16:09 +09:00
Sakamoto Shiina 7648ebe493 Merge branch 'ui_init_configs' into for_webui 2024-11-06 00:25:42 +09:00
Sakamoto Shiina 1acb0a9565 [Update] UIで使うデータ(min,maxなど)を浅い階層で設定するように。
初期データとして送られてきていたrangeなど、必要のないエンドポイントをコメントアウト。
2024-11-06 00:23:43 +09:00
Sakamoto Shiina 9beba4905b [Update] Separate test_data.js, for testing, and ui_configs.js, that is for initialize settings like min max data, from data.js. 2024-11-05 22:50:26 +09:00
Sakamoto Shiina 834d5886ab Merge branch 'window_geometry' into for_webui 2024-11-05 21:35:51 +09:00
Sakamoto Shiina 901e829829 [Update] Add min width and height to window setting. 2024-11-05 21:34:32 +09:00
Sakamoto Shiina 0f599ce679 [bugfix] 1: To do not restore and save the data x,y_pos and its size when the window is minimized.
2: To do not restore and save the message box ratio data when the window is minimized either.
2024-11-05 21:26:13 +09:00
misyaguziya ef5799cd9b Merge branch 'cuda' into for_webui 2024-11-05 00:49:11 +09:00
misyaguziya 8d9013ef51 👍️[Update] Model : cuda版のsoftwareをダウンロードできるようにendpointを追加 2024-11-05 00:46:45 +09:00
misyaguziya 21bd59c915 Merge branch 'osc_query' into for_webui 2024-11-04 22:44:17 +09:00
misyaguziya 7350910c7b 👍️[Update] Model : ミュート同期の処理を見直し 2024-11-04 22:44:01 +09:00
misyaguziya f79735f13c 👍️[Update] Model : rename osc_tools.py -> osc.py 2024-11-04 06:29:36 +09:00
misyaguziya e21661df1e 👍️[Update] Model : OSC の処理を見直し 2024-11-04 06:27:08 +09:00
Sakamoto Shiina f380616bdb Merge branch 'bugfix_translator' into for_webui 2024-11-02 18:32:49 +09:00
Sakamoto Shiina ccc7fec756 [bugfix] フロント: 選択中の翻訳エンジンデータ形式変更とUIへの流し込み、
バック: UIへのrun時のデータ形式をset/getにあわせて変更。
2024-11-02 18:30:40 +09:00
Sakamoto Shiina 623366ab24 Merge branch 'selectable_no_device' into for_webui 2024-11-02 14:52:09 +09:00
Sakamoto Shiina b5e113f20e [Update] Config Page: Device Tab. to selectable the devices when it even NoDevice. (Revert) 2024-11-02 14:50:41 +09:00
misyaguziya a63f55f736 Merge branch 'bugfix_NoDevice' into for_webui 2024-11-02 06:39:15 +09:00
misyaguziya 4ddcad1e3e [bugfix] DeviceManager : Deviceを接続していない場合に発生する問題を修正
- 関数設定されていない変数をコールする問題を修正
- Deviceソート時にindexを参照しているため、NoDeviceにindex=-1を設定するように変更
2024-11-02 06:39:05 +09:00
Sakamoto Shiina 98c14e795a Merge branch 'ui' into for_webui 2024-11-01 19:54:10 +09:00
Sakamoto Shiina 65f0739645 [Update] Config Page: Add Translation Tab. DeeplAuthKey section.
Allow null value to Entry component's input element.
2024-11-01 19:33:49 +09:00
Sakamoto Shiina 113881ad52 [bugfix] Config Page: Device Tab. Add disabled behavior when the device is 'NoDevice'. 2024-11-01 16:25:47 +09:00
misyaguziya 22d83dd3de Merge branch 'init_optimize' into for_webui 2024-10-31 17:21:40 +09:00
misyaguziya 5e2aea8f7e 👍️[Update] Controller : WHISPER_WEIGHT_TYPEに"none"を設定した場合の処理を追加 2024-10-31 17:10:51 +09:00
Sakamoto Shiina 4a1723a322 Merge remote-tracking branch 'origin/for_webui' into for_webui 2024-10-31 16:57:56 +09:00
Sakamoto Shiina bef4a78d70 Merge branch 'ui' into for_webui 2024-10-31 16:56:59 +09:00
Sakamoto Shiina 30de46cf2c [Update] Quick Settings: Apply localization. 2024-10-31 16:50:21 +09:00
Sakamoto Shiina 51bf5a2e27 [Update] Quick Settings: Add Vrc Mic Mute Sync. 2024-10-31 16:36:42 +09:00
Sakamoto Shiina a3230937f3 [Update] Config Page: VR Tab. Add EnabledOverlaySmallLog Switch and connect to backend. 2024-10-31 16:36:42 +09:00
Sakamoto Shiina 3c76902124 [Update] Quick Settings: Add Overlay settings. 2024-10-31 16:36:25 +09:00
misyaguziya d3e90a8b53 Merge branch 'init_optimize' into for_webui 2024-10-31 00:06:15 +09:00
misyaguziya fd1140c813 👍️[Update] Main : 以下のエンドポイントでEngineとweightを同時にセットするように変更
- /set/data/selected_translation_engines
- /set/data/selected_transcription_engine
2024-10-31 00:05:46 +09:00
misyaguziya 7d38b13a39 👍️[Update] Controller : CUDAが使用できない場合にデバイス設定をcudaからcpuに変更する処理を追加 2024-10-30 17:57:29 +09:00
misyaguziya c57fcff7db 👍️[Update] Config : 初期設定値を見直し 2024-10-30 17:56:04 +09:00
misyaguziya ac2a974947 Merge branch 'donwload_ai_models' into for_webui 2024-10-30 10:30:45 +09:00
misyaguziya 2da19efb19 👍️[Update] Model : ブログレスの表示をmodel.binのダウンロードのみに変更/wisperのweightの表記に合わせてctanslate2のweightも小文字に変更 2024-10-30 10:30:31 +09:00
misyaguziya 1bc87e623a 🐛[bugfix] Model : Speaker Transcription実行時に翻訳が機能しない問題を修正 2024-10-30 10:15:40 +09:00
misyaguziya d777339110 👍️[Update] Model : use_translation_featureを削除/それに伴い一部機能を修正 2024-10-30 00:37:41 +09:00
misyaguziya 7fd3fad3ea 👍️[Update] Model : AI モデルのダウンロード方法を修正
- AIモデルのダウンロード済み確認辞書を追加
	- selectable_ctranslate2_weight_type_dict
	- selectable_whisper_weight_type_dict
- AIモデルダウンロード処理完了のエンドポイントを追加
	- /run/download_ctranslate2_weight
	- /run/downloaded_whisper_weight
2024-10-29 22:58:18 +09:00
misyaguziya 134ef373af 🗑️ [Remove] Model : Whisperの不要な関数を削除 2024-10-29 15:58:21 +09:00
misyaguziya 192507a605 🗑️ [Remove] Config : IS_RESET_BUTTON_DISPLAYED_FOR_**を削除 2024-10-29 15:48:28 +09:00
misyaguziya ee150b692d 🗑️ [Remove] main.pyとcontroller.pyが不要になったため、削除 2024-10-29 15:40:14 +09:00
misyaguziya 66da155d8a Merge branch 'controller' into for_webui 2024-10-29 15:29:37 +09:00
misyaguziya 31e2edf3eb Merge branch 'bugfix_osc' into for_webui 2024-10-29 15:17:33 +09:00
Sakamoto Shiina 82355003d4 Merge branch 'init_optimize' into for_webui 2024-10-29 14:54:30 +09:00
misyaguziya a1164ade51 🐛[bugfix] Model : VRChat未起動時にOSCQueryを起動させるとエラーが発生する問題を回避するように変更 2024-10-28 23:06:40 +09:00
Sakamoto Shiina afed3fffcd [Update/bugfix] バックエンドからもらった初期データを繋げ、UIと初回同期
initialization_complete エンドポイント修正 ('/'追加)
2024-10-28 21:04:55 +09:00
misyaguziya 68d05b38a8 🐛[bugfix] Config : 保存用timerがcancelされていない問題を修正 2024-10-28 10:07:33 +09:00
misyaguziya fea2cdae61 Merge branch 'config_optimize' into init_optimize
# Conflicts:
#	src-python/config.py
2024-10-27 18:45:50 +09:00
misyaguziya 4fff111173 👍️[Update] Config : config.jsonの保存タイミングをdebounce処理に変更 2024-10-27 18:22:20 +09:00
misyaguziya 2dd4419bb1 👍️[Update] Config : config.jsonの保存タイミングをfire and forgetに変更 2024-10-27 15:12:04 +09:00
misyaguziya 69d9de686e 👍️[Update] Optimize : Init完了時にrun\initialization_completeでconfig設定値をすべてresultで渡すように変更 2024-10-27 09:49:51 +09:00
misyaguziya ca7ba5ce09 👍️[Update] Optimize : Init時のconfigの取得処理を変更 2024-10-26 01:24:37 +09:00
Sakamoto Shiina bd0431f79c Merge branch 'overlay_setting_ui' into for_webui 2024-10-25 17:10:18 +09:00
Sakamoto Shiina 33bb2c7620 [bugfix] Config Page: VR Tab. Fix the bug that the settings data has sent to the backend when init. 2024-10-25 13:02:53 +09:00
Sakamoto Shiina 5438874668 [Update] Config Page: VR Tab. Add delay when send and save the settings data to the backend. 2024-10-25 12:18:07 +09:00
Sakamoto Shiina ed24dbd428 [Update] Config Page: VR Tab. Connect to the backend and save the data. 2024-10-24 15:45:23 +09:00
misyaguziya e9b3024210 Merge branch 'config' into for_webui 2024-10-24 12:02:10 +09:00
misyaguziya 1ab715ac49 🐛[bugfix] Config: javascriptでint/floatの型指定ができないためconfigでsetter時にfloatにキャストするように修正 2024-10-24 12:01:58 +09:00
misyaguziya 0c7a59c5d8 Merge branch 'cuda' into for_webui 2024-10-24 04:50:32 +09:00
misyaguziya b99c3925a4 👍️[Update] Build : npm run release-all でcpu/cudaの実行ファイルのzipを作成できるようにした 2024-10-24 04:48:04 +09:00
Sakamoto Shiina 984f989646 [bugfix] Config Page: VR Tab. Fix the error "Failed prop type: Invalid prop valueLabelFormat supplied to ForwardRef(Slider2), expected one of type [function, string]."
It should've put strings but I put number (init value 0)
2024-10-23 17:56:17 +09:00
Sakamoto Shiina 69953eec1b [Update] Config Page: VR Tab. Change the design. 2024-10-23 17:40:07 +09:00
misyaguziya 04f13c4c88 Merge branch 'cuda' into for_webui 2024-10-23 14:14:16 +09:00
misyaguziya 5b44ddefde 🐛[bugfix] Config: cpu/cudaの保存するdictの形式を修正 2024-10-23 14:13:54 +09:00
misyaguziya af3fe1f0f9 👍️[Update] Model: cpu/cudaをtranslationもしくはtranscriptionで選択できるように実装 2024-10-23 13:41:34 +09:00
misyaguziya 2136865493 👍️[Update] Installer : GPUを使う項目を追加 2024-10-23 03:12:27 +09:00
misyaguziya c480b3694c 👍️[Update] Installer : dllを内包するように変更 2024-10-23 02:27:15 +09:00
misyaguziya 5fba6e9e38 👍️[Update] Installer : ダウンロード形式に変更
以下のpluginをusername\AppData\Local\tauri\NSIS\Pluginsに保存する必要がある
- inetc : https://nsis.sourceforge.io/Inetc_plug-in
- nsisunz : https://nsis.sourceforge.io/Nsisunz_plug-in
2024-10-22 17:32:01 +09:00
misyaguziya 68e25f503a 👍️[Update] Main : cudaのインストール環境を整備 2024-10-21 18:27:42 +09:00
Sakamoto Shiina 6950347ffb [Update/Memo] Config Page: Add VR Tab. Overlay settings. 2024-10-20 09:58:16 +09:00
misyaguziya 2fadf7f1e9 👍️[Update] Model : Overlay 任意のテキストをOverlayで表示するエンドポイントを追加 2024-10-18 18:23:33 +09:00
misyaguziya 2504bb5832 Merge branch 'installer' into for_webui 2024-10-18 16:18:49 +09:00
misyaguziya 8d03251be1 🐛[bugfix] Installer : タスクバーの表示をVRCTに修正 2024-10-18 16:18:33 +09:00
misyaguziya 5ba595cefe 🚧 [WIP/TEST] Model : CUDAでの処理実装 part 1 2024-10-18 16:16:42 +09:00
Sakamoto Shiina 147b5cc396 Merge branch 'ui' into for_webui 2024-10-17 02:03:47 +09:00
Sakamoto Shiina ec64b64535 [Update] Config Page: Add Advanced Settings Tab. 2024-10-17 01:58:49 +09:00
Sakamoto Shiina 2f6a9d4f2b [Update] Config Page: Auto Export Message Logs. Add open folder button. 2024-10-16 23:50:55 +09:00
Sakamoto Shiina 3e88604fd7 [bugfix] Config Page: Appearance tab. Fix the deign where Ui language section that was not putted selected mark by adding name attribute to radio element. 2024-10-16 23:03:59 +09:00
Sakamoto Shiina e201cee24a [Update] Config Page: Others Tab. EnableSendOnlyTranslatedMessages, EnableAutoExportMessageLogs, EnableVrcMicMuteSync, EnableSendMessageToVrc 2024-10-16 22:44:26 +09:00
misyaguziya 0198da50d6 Merge branch 'remove_s2c_pass' into for_webui 2024-10-16 21:28:22 +09:00
Sakamoto Shiina 2cb4a41e64 [Update] Config Page: Move section Send Message Button Type where others tab to appearance tab. 2024-10-16 21:23:04 +09:00
Sakamoto Shiina 2c460bc8e5 [Update] Config Page: Add Others Tab. Auto Clear Message Input Box, Send Message Button Type. 2024-10-16 21:09:14 +09:00
Sakamoto Shiina fd0cadab8c Merge branch 'add_word_filter' into for_webui 2024-10-16 16:01:52 +09:00
Sakamoto Shiina 4d99207acc [Update] Add WordFilter. 2024-10-16 16:00:32 +09:00
Sakamoto Shiina 3cc4365697 Merge branch 'ui' into for_webui 2024-10-16 14:11:26 +09:00
misyaguziya 49128d2657 👍️[Update] Controller : Speaker2Chatboxのパスワードを削除 2024-10-16 02:36:13 +09:00
Sakamoto Shiina e1e06febd2 [Update] Add Transcription Tab. Mix/Speaker, record timeout, phrase timeout, max words. 2024-10-16 00:44:14 +09:00
misyaguziya aeb15f237a Merge branch 'error_process' into for_webui 2024-10-15 10:12:49 +09:00
misyaguziya 6c41c5477c 👍️[Update] Controller : 400番エラーに対して現在値を渡すように修正 2024-10-15 10:12:36 +09:00
misyaguziya 313ab2c988 Merge branch 'installer' into for_webui 2024-10-15 00:10:34 +09:00
misyaguziya 2c67841b11 👍️[Update] INSTALLER : templateにVRCT固有の設定を追加
- UI language
- Enable Translate Function
- Select Transcript Engine
2024-10-15 00:09:53 +09:00
misyaguziya 22a10f6f0d 👍️[Update] INSTALLER : templateを使用しvrct用にCopyright等を変更 2024-10-14 09:51:37 +09:00
misyaguziya c5b3f667c1 👍️[Update] README : change Donation icon 2024-10-13 10:24:32 +09:00
Sakamoto Shiina 62be4c5bca Merge branch 'ui' into for_webui 2024-10-13 08:41:38 +09:00
Sakamoto Shiina 5629192760 [Refactor] Organize file structures. 2024-10-13 08:40:23 +09:00
Sakamoto Shiina d7cf2425a1 [Refactor] Remove the codes that is no longer in use and organize a bit. 2024-10-13 07:11:47 +09:00
Sakamoto Shiina 743e73b9ed Merge branch 'add_restore_window_geometry' into for_webui 2024-10-13 04:00:00 +09:00
Sakamoto Shiina 0582091908 [Update] Add feature Restore Main Window Geometry.
Note: the toggle-able setting, to restore or don't, has removed for now.
2024-10-13 03:57:23 +09:00
misyaguziya 7076e27fc6 👍️[Update] README : add Donation 2024-10-12 00:53:00 +09:00
misyaguziya a7a0c74a2d Merge branch 'develop' 2024-10-11 23:38:51 +09:00
misyaguziya e96d267c92 Merge branch 'issue_template' into develop 2024-10-11 23:38:28 +09:00
misyaguziya 2f5586227f add fanbox link 2024-10-11 23:38:18 +09:00
misyaguziya 9351a015f3 Add issue template 2024-10-11 23:37:52 +09:00
Sakamoto Shiina e75458a312 Merge branch 'localization_zh_hans' into develop 2024-10-11 21:36:50 +09:00
Sakamoto Shiina bca654a27c [Remove] Remove .DS_Store file. 2024-10-11 21:34:48 +09:00
ShiinaSakamoto 58ad71c3ae Merge pull request #31 from Heart-Breezer/localization_zh_hans
Added translation in zh_Hans
2024-10-11 20:55:45 +09:00
Heart-Breezer b619a8dd2c Added translation in zh_Hans 2024-10-11 17:05:52 +08:00
Sakamoto Shiina 0c3b36a43d Merge branch 'bugfix_message_box_ratio' into for_webui 2024-10-11 17:14:31 +09:00
Sakamoto Shiina 0d8eb887f7 [bugfix] Fix the separator position, that was bit off again, when the Ui scaling bigger than 100%. 2024-10-11 17:12:16 +09:00
Sakamoto Shiina 99cd3d1df0 [bugfix] Main Page: Message Box Ratio. store the data in float and fix the bug that was set bit off message box's height. 2024-10-11 04:25:34 +09:00
Sakamoto Shiina 31d8b503d0 Merge branch 'ui' into for_webui 2024-10-11 04:24:22 +09:00
Sakamoto Shiina d44c2dd7d9 [Refactor] Refactor the way import files.
Organize some codes.
2024-10-11 00:23:52 +09:00
misyaguziya 4de48edbc1 Merge branch 'watchdog' into for_webui
# Conflicts:
#	src-python/webui_controller.py
#	src-python/webui_mainloop.py
2024-10-10 22:36:23 +09:00
Sakamoto Shiina ae34ff8f64 Merge branch 'add_transparency' into for_webui 2024-10-10 22:11:15 +09:00
Sakamoto Shiina 5d9da2bf1c [Update] Add Transparency. 2024-10-10 22:09:10 +09:00
Sakamoto Shiina a1ef81e5cb [WIP/Update] Commented out some parts that we're planning to remove. 2024-10-10 21:17:34 +09:00
Sakamoto Shiina 1d6f177660 [WIP] Prepare for localization zh-Hans Chinese (Simplified) 2024-10-10 21:06:13 +09:00
Sakamoto Shiina a637226b4d Merge branch 'ui' into for_webui 2024-10-10 19:46:21 +09:00
Sakamoto Shiina 21aa407a50 [Chore] Remove the code that is no longer in use. 2024-10-09 22:21:42 +09:00
Sakamoto Shiina 61f50215d7 [Update] Add Window Title bar.
[bugfix] Note: I think this is tauri's bug. When I try to resize the window and hovered dragable area, I could see resize cursor but it work as a dragging the window behavior that should't be.
Updated npm packages but still not work so I  managed it as adding margin-top by referring Discord title bar.
2024-10-09 22:00:30 +09:00
misyaguziya 98d57bdc13 Merge branch 'bugfix_Overlay' into for_webui 2024-10-09 15:57:59 +09:00
misyaguziya 537e11c7c4 🐛[bugfix] Model : Overlay typo x_rotation -> z_rotation (#28) 2024-10-09 15:57:42 +09:00
misyaguziya ec52828c6e Merge branch 'develop' 2024-10-09 14:25:43 +09:00
misyaguziya db85854efc Merge branch 'updater' into develop 2024-10-09 14:24:37 +09:00
misyaguziya 45ddacf4d0 🐛[bugfix] Model : UpdateのUI表示を修正 2024-10-09 14:24:10 +09:00
misyaguziya bf283affe1 Merge branch 'version' into develop 2024-10-09 12:38:02 +09:00
misyaguziya a6e18bc2f6 👍️[Update] version 2.2.7 -> 2.2.8 2024-10-09 12:37:44 +09:00
misyaguziya 86c7ec26d5 Merge branch 'updater' into develop 2024-10-09 12:07:32 +09:00
misyaguziya 8ae0bf8e82 Merge branch 'bugfix_Overlay' into develop 2024-10-09 12:07:23 +09:00
misyaguziya 4c5aa46b7e 👍️[Update] Config : Add Updater URL 2024-10-09 12:07:01 +09:00
misyaguziya 42c336cb5e 👍️[Update] Model : Update updaterを使用するように変更 2024-10-09 07:06:10 +09:00
misyaguziya be3d34cd64 🐛[bugfix] Model : Overlay typo x_rotation -> z_rotation (#28) 2024-10-09 01:05:10 +09:00
misyaguziya ebb07ceef5 Merge branch 'updater' into for_webui 2024-10-08 18:04:08 +09:00
misyaguziya ecab9036b6 👍️[Update] Controller : software update の処理にリトライを追加 2024-10-08 06:26:55 +09:00
misyaguziya 94889f5b30 👍️[Update] Controller : software update の処理を追加 2024-10-07 10:37:45 +09:00
misyaguziya 9abf8742f7 Merge branch 'auto_device_detect' into for_webui
# Conflicts:
#	src-python/config.py
2024-10-04 16:47:05 +09:00
misyaguziya b5db201e70 🐛[bugfix] DeviceManager : device自動設定ON時にデフォルトデバイスに変更するように修正 2024-10-04 16:44:28 +09:00
misyaguziya 4f509d06db 👍️[Update] DeviceManager : テスト用の不要なprintLogを削除 2024-10-04 13:28:45 +09:00
misyaguziya b3d8750975 👍️[Update] Controller : device manager を root に移動 2024-10-04 13:27:49 +09:00
misyaguziya c953661046 👍️[Update] Controller : Deviceの自動変更処理を実装 2024-10-04 13:16:34 +09:00
misyaguziya 65f25725e9 🚧 [WIP/TEST] Deviceの自動変更に対応中
Energyの取得処理を修正
2024-10-03 17:59:25 +09:00
misyaguziya d183c56736 🚧 [WIP/TEST] Deviceの自動変更に対応中
検出処理を修正、たまに変化を検出しても応答しない場合がある
2024-10-03 15:50:25 +09:00
Sakamoto Shiina 47d0103dda Merge branch 'add_font_family_feature' into for_webui 2024-10-02 18:50:30 +09:00
Sakamoto Shiina 3be8c0d715 [bugfix] Font Family. Fix default font family when the font family, that is selected by the user, is not found. 2024-10-02 18:39:04 +09:00
Sakamoto Shiina 9f7101e233 [Update] Font Family. Change the way to fetch font family list. 2024-10-02 18:26:58 +09:00
Sakamoto Shiina b1aadc7cda [Update] Config Page: DropdownMenu: Add max hight and scrollable. 2024-10-02 18:00:47 +09:00
Sakamoto Shiina faa6656e00 [Update] Add Font Family. 2024-10-02 17:52:19 +09:00
misyaguziya 92f21c32f6 🚧 [WIP/TEST] Deviceの自動変更に対応中 2024-10-02 12:34:11 +09:00
Sakamoto Shiina 3570fffbf6 Merge branch 'add_message_log_ui_scaling' into for_webui 2024-09-30 10:34:31 +09:00
Sakamoto Shiina 6828c255a6 [Update] Add Message Log Ui Scaling. 2024-09-30 10:33:54 +09:00
misyaguziya d2e03e0093 Merge branch 'bugfix' into for_webui 2024-09-29 11:03:43 +09:00
misyaguziya 4072c020a6 🐛[bugfix] Controller : run mappingのkeyを修正 2024-09-29 11:03:33 +09:00
misyaguziya ad6dc82594 Merge branch 'device_access' into for_webui 2024-09-28 01:57:26 +09:00
misyaguziya edbc1f8391 👍️[Update] Controller : transcriptionのmic/speakerが同時にONになった場合に片方の処理が完了するまで待つように変更 2024-09-28 01:57:14 +09:00
misyaguziya 00af80b830 Merge branch 'controller' into for_webui 2024-09-27 21:59:18 +09:00
misyaguziya 0b29ad8321 👍️[Update] Controller : transcription実行時にDeviceの自動切り替え処理が動作しない問題を修正 2024-09-27 21:58:48 +09:00
misyaguziya 12a2eb420a 👍️[Update] Controller : volume check時にDeviceの自動切り替え処理が動作しない問題を修正 2024-09-27 17:39:24 +09:00
misyaguziya 107320ad28 👍️[Update] Controller : Config WindowのOPEN/CLOSE機能を削除 2024-09-27 17:37:20 +09:00
Sakamoto Shiina 74bcfb428d Merge branch 'config_page_open_close_func' into for_webui 2024-09-27 13:15:52 +09:00
Sakamoto Shiina c32a186e88 [Update] 設定ページ開閉時に、音声認識オンオフ状態の復元を実装。
※今まではBackendで状態復元をしていたが、処理があれなのでUI側での便利機能としてUIが管理することに。
2024-09-27 13:13:33 +09:00
Sakamoto Shiina c1165a2185 Merge branch 'add_ui_scaling' into for_webui 2024-09-27 07:49:55 +09:00
Sakamoto Shiina 14843066bb [Update] Add Ui Scaling. 2024-09-27 07:48:29 +09:00
misyaguziya 0611ed21e3 👍️[Update] Controller : 文字起こし処理のデバイス自動設定機能に対応 2024-09-27 02:45:20 +09:00
misyaguziya 98f53d4866 👍️[Update] Controller : 翻訳エンジンが対応していない場合にCTranslate2を指定するように変更 2024-09-27 02:10:24 +09:00
misyaguziya 304d97ae22 👍️[Update] Controller : classから関数に変化した部分を修正 2024-09-27 02:07:32 +09:00
misyaguziya a0407afa54 👍️[Update] Model : Watchdog timerの終了処理をmain loopの終了処理に変更 2024-09-27 01:02:20 +09:00
misyaguziya 71225bf045 👍️[Update] Model : Watchdogの引数(*args, **kwargs)を追加 2024-09-26 12:50:00 +09:00
misyaguziya 4bd659103b Merge branch 'auto_device_detect' into for_webui 2024-09-26 12:47:50 +09:00
misyaguziya d1384f6c6e 👍️[Update] Model : Deviceの自動検出機能を強化
deviceの変更したものだけを通知するように変更
2024-09-26 12:47:22 +09:00
Sakamoto Shiina 726dff60bd [Update/bugfix] UI: Watchdogタイマーに10秒間隔で信号を送るように。
backend watchdog関数の引数エラーの修正
2024-09-26 12:31:50 +09:00
Sakamoto Shiina 09241e1eeb Merge branch 'connect_endpoints_run_devices' into for_webui 2024-09-26 11:29:33 +09:00
Sakamoto Shiina fbce381e32 [Update] Remove the get devices lists function that is working when dropdown menu opens and move to init place(app.jsx). 2024-09-26 11:26:29 +09:00
Sakamoto Shiina 7d14effde2 [Update] デバイス自動変更時のendpoint(run)をUIと繋いだ。 2024-09-26 09:48:48 +09:00
misyaguziya 11e4c12f85 👍️[Update] Model : Watchdogタイマー機能を追加
"/run/feed_watchdog"でタイマーを定期的にリセットする必要あり
2024-09-26 08:17:38 +09:00
Sakamoto Shiina 321c9cbe45 Merge branch 'update_translation_engines' into for_webui 2024-09-26 07:39:26 +09:00
Sakamoto Shiina 08c79d8ed8 [Update/Refactor] 翻訳エンジン周り: 選択中の翻訳エンジン系のendpoint名を統一。
言語切替時、選択中のプリセット番号の設定ではなく、全てのプリセット番号分の設定も送ることで他と統一。
以上に伴い、UI側でendpointの追加や、翻訳エンジンリストを開く度にリストを更新していた部分を削除。
2024-09-26 07:35:09 +09:00
Sakamoto Shiina 8f7300598c Merge branch 'ui' into for_webui 2024-09-26 00:31:54 +09:00
Sakamoto Shiina a43b4df8ef [bugfix] useStdoutToPython: fix the send data that can't send 0, int, data. 2024-09-25 23:42:18 +09:00
misyaguziya d6c6694700 Merge branch 'run_mapping' into for_webui 2024-09-25 16:13:37 +09:00
misyaguziya 6367c43cce 👍️[Update] Controller : 文言を修正
ENERGYを削除
2024-09-25 16:13:23 +09:00
Sakamoto Shiina 69d835855c [Update] Main Page: Message Input Box Ratio. Save the ratio when window is resized. 2024-09-25 13:37:21 +09:00
misyaguziya 53a3d8c3d6 👍️[Update] Controller : 文言を修正
inpurt -> mic
output -> speaker
2024-09-25 12:43:00 +09:00
misyaguziya cd8bf2e684 🐛[bugfix] test : endpointを修正 2024-09-25 11:59:58 +09:00
Sakamoto Shiina b3d7d3f87e [Update] Main Page: Message Input Box Ratio. saveable the ratio. 2024-09-25 11:56:28 +09:00
misyaguziya e3abc40701 👍️[Update] Controller : CTranslate2に強制変更するときにUIに通知するように変更 2024-09-25 11:53:47 +09:00
misyaguziya 03165cb3b7 👍️[Update] Controller : run_mappingに以下を追加
"selected_mic_device":"/run/selected_mic_device",
    "selected_speaker_device":"/run/selected_speaker_device",
    "selected_translation_engine":"/run/selected_translation_engine",
    "translation_engines":"/run/translation_engines",
    "mic_host_list":"/run/mic_host_list",
    "mic_device_list":"/run/mic_device_list",
    "speaker_device_list":"/run/speaker_device_list",
2024-09-25 11:32:25 +09:00
misyaguziya 14470e5217 Merge branch 'controller' into for_webui 2024-09-25 02:20:02 +09:00
misyaguziya a1cb3dc029 👍️[Update] Controller : controllerからuiに指示するendpointをrun_mappingに集約するように変更 2024-09-25 02:19:20 +09:00
Sakamoto Shiina 2a27192dc4 Merge remote-tracking branch 'origin/for_webui' into for_webui 2024-09-25 01:19:11 +09:00
Sakamoto Shiina 1e6259d09c Merge branch 'ui' into for_webui 2024-09-25 01:18:07 +09:00
Sakamoto Shiina 3557ac4761 [bugfix] Main Page: Message Log. Restrict selectable text.(The texts, categories and time, is selectable yet when select all of them, though.) 2024-09-25 01:15:20 +09:00
misyaguziya 6708f9b026 Merge branch 'bugfix' into for_webui 2024-09-24 20:18:16 +09:00
misyaguziya 033906f0e0 🐛[bugfix] Main : getter/setterの修正漏れ 2024-09-24 20:18:00 +09:00
misyaguziya e119647545 👍️[Update] Controller : controller関数をすべてclassに内包するように変更 2024-09-24 20:17:30 +09:00
misyaguziya 5bdc3a1a09 Merge branch 'bugfix' into for_webui 2024-09-24 14:43:18 +09:00
misyaguziya fb1ee9fcfb 🐛[bugfix] Main : getter/setterの修正漏れ 2024-09-24 14:42:52 +09:00
Sakamoto Shiina 1266c94c5f Merge branch 'ui' into for_webui 2024-09-24 13:52:11 +09:00
misyaguziya 69fb7e994e Merge branch 'getter/setter' into for_webui 2024-09-24 11:54:29 +09:00
misyaguziya e129fd308b 👍️[Update] Mainl: endpointの命名規則を修正 2024-09-24 11:51:57 +09:00
Sakamoto Shiina f0685e206f [Update] Main Page: Message Log. the texts to be selectable. 2024-09-24 10:20:35 +09:00
Sakamoto Shiina c0c826b443 [Rename] is_loading to is_pending. 2024-09-24 10:00:15 +09:00
Sakamoto Shiina 97b047a09e [Perf] Fix UiLanguageController, i18next, re-rendering unnecessarily. 2024-09-24 09:42:43 +09:00
Sakamoto Shiina 465e97d206 [Chore] Rename atom functions that I forgot to change WIP version to the one actually use.
and fix typo.
2024-09-24 09:41:31 +09:00
Sakamoto Shiina c0ba530d32 [Update] Main Page: Connect to backend. IsMainPageCompactMode. 2024-09-23 10:21:49 +09:00
Sakamoto Shiina fab5fbc070 [Update] Main Page: LanguageSelector. close the language selector when any language is selected from it. 2024-09-23 09:58:54 +09:00
Sakamoto Shiina 7dbf324e31 [Update] Main Page. Add Language swap button functionally. 2024-09-23 09:26:58 +09:00
Sakamoto Shiina 80b57612bc Merge branch 'ui' into for_webui 2024-09-23 03:54:39 +09:00
Sakamoto Shiina 72b01be3af [Remove] Remove MessageFormat. 2024-09-23 03:53:00 +09:00
Sakamoto Shiina 0616092eff [Refactor] Change state management structures. Async atom to be manage manually. 2024-09-23 03:44:33 +09:00
Sakamoto Shiina 586aaf0091 [Update] Main Page: Language Settings. Translation Engines. To selectable. 2024-09-22 12:02:50 +09:00
misyaguziya 8e8eeeb239 Merge branch 'model_getset' into for_webui 2024-09-21 06:51:09 +09:00
Sakamoto Shiina 1fea7b659a Merge branch 'ui' into for_webui 2024-09-21 00:59:58 +09:00
Sakamoto Shiina e20a4eecd1 [Remove] useWindow that is no longer in use for now. 2024-09-21 00:57:09 +09:00
Sakamoto Shiina 7573e99617 [Refactor] Organize logics files. and change import path as well. 2024-09-21 00:54:32 +09:00
Sakamoto Shiina 79e4d28176 [Refactor] useReceiveRoutes: Add comments and change the order. 2024-09-21 00:40:30 +09:00
Sakamoto Shiina 66e3267798 [bugfix] Add endpoint '/set/disable_speaker_dynamic_energy_threshold' UI will receive. 2024-09-21 00:27:31 +09:00
misyaguziya c857e2c57a 👍️[Update] Mainl: endpointの順番を修正 2024-09-20 14:48:54 +09:00
misyaguziya 0bf479bdf1 Merge branch 'model_getset' into for_webui 2024-09-20 05:36:03 +09:00
misyaguziya de44599827 👍️[Update] Model: Auto Mic/Speaker Select ON時にDefault DeviceをUIにセットするように変更 2024-09-20 05:35:51 +09:00
misyaguziya ca6514b090 👍️[Update] UI: backendのendpointに合わせて修正 2024-09-20 05:14:51 +09:00
misyaguziya d3b66b7000 👍️[Update] Model: endpointをget/set/runの形に変更 2024-09-20 03:00:55 +09:00
misyaguziya 16f63c3e20 Merge branch 'model_getset' into for_webui 2024-09-19 12:28:08 +09:00
misyaguziya 52fcd2bc29 🐛[bugfix] Model : test_all -> main 2024-09-19 12:27:52 +09:00
misyaguziya ae18c92a5a 👍️[Update] Model: 言語スワップの処理を修正/引数修正に伴いテストの内容を修正 2024-09-19 11:43:24 +09:00
misyaguziya c752196a1c 👍️[Update] Model: 翻訳言語のset関数を修正 2024-09-19 10:55:58 +09:00
misyaguziya 11ba04379d 👍️[Update] Model: 翻訳言語のset関数の引数を修正 2024-09-19 10:32:11 +09:00
Sakamoto Shiina adfaed1eb1 Merge branch 'ui' into for_webui 2024-09-19 09:18:13 +09:00
Sakamoto Shiina a288b8730e [Update] Config Page: Appearance Tab. UI Language. Show localization language and 'UI Language' when it's not en to desc section.
Add padding more between label and desc.
2024-09-19 07:52:51 +09:00
Sakamoto Shiina e7a39b6fa8 [Chore] Main Page: Add padding to language selector open button. Add localization function to the title Language Settings. 2024-09-19 07:31:18 +09:00
Sakamoto Shiina f662e21c5d Merge branch 'ui' into for_webui 2024-09-18 23:49:40 +09:00
Sakamoto Shiina e409e333e0 [Update] Main Page: Language Settings. LanguageSelector. It works functionally. 2024-09-18 23:46:46 +09:00
misyaguziya 7de36849cd Merge branch 'device_event_handler' into for_webui 2024-09-18 17:39:03 +09:00
misyaguziya aa30c248d5 👍️[Update] Model: ENABLE_MIC_AUTOMATIC_SELECTION/ENABLE_SPEAKER_AUTOMATIC_SELECTIONの処理をdevice_managerのcallbackで実行するように変更 2024-09-18 17:38:32 +09:00
misyaguziya f34d5183d1 🐛[bugfix] Model : デバッグ用のprint文を削除 2024-09-18 16:44:56 +09:00
misyaguziya d7d41c2e66 👍️[Update] Model: Default Audio Deviceの変更/Deviceの追加/削除された場合のみDevice情報を更新するように変更 2024-09-18 15:54:06 +09:00
misyaguziya d21e0a09fc 👍️[Update] Model: Deviceのアクセス干渉の回避処理をするためにDeviceの検出を常に行うように変更 2024-09-16 23:05:30 +09:00
ShiinaSakamoto 24d7e7540e Merge pull request #24 from cheongpark/update-korean-&-fix-string
Update Korean translation, update YAML strings
2024-09-16 12:29:18 +09:00
Sakamoto Shiina 0e623b73fd [bugfix/Update] Config Page: Device Tab. Mic/Speaker auto select section. Fetch initial data. 2024-09-16 04:06:34 +09:00
misyaguziya e751f5ddbd 👍️[Update] Model: Deviceのアクセス干渉の回避処理を追加 2024-09-16 03:33:27 +09:00
misyaguziya 9ceb6bcee2 👍️[Update] Main: mappingにstatusを追加 2024-09-16 02:25:25 +09:00
Sakamoto Shiina a439f7e3da [Update/bugfix] Config Page: Device Tab. Adjust design and fix styles. 2024-09-16 02:12:14 +09:00
misyaguziya 7b39bfd044 👍️[Update] Main: Handlerの処理を分割しConfig用とController用を別々に処理するように変更 2024-09-16 00:13:16 +09:00
Sakamoto Shiina 17ecab50f4 Merge branch 'ui' into for_webui 2024-09-15 23:26:03 +09:00
Sakamoto Shiina 418d9f4ad7 [Update] Config Page: Device Tab. Add mic/speaker auto select section. 2024-09-15 23:22:10 +09:00
misyaguziya 0309757028 Merge branch 'change_device_with_energy' into for_webui 2024-09-15 22:22:43 +09:00
misyaguziya e560d9a6f1 🐛[bugfix] Model : typo 2024-09-15 22:22:31 +09:00
misyaguziya f0883e51f0 Merge branch 'change_device_with_energy' into for_webui 2024-09-15 17:49:46 +09:00
misyaguziya ca649cf8c6 🐛[bugfix] Model : マイクデバイスの出力形式を修正 2024-09-15 17:49:29 +09:00
Sakamoto Shiina 045bedc6ad Merge branch 'ui' into for_webui 2024-09-15 17:26:36 +09:00
misyaguziya 1be7783266 Merge branch 'change_device_with_energy' into for_webui 2024-09-15 17:25:18 +09:00
misyaguziya 5deeb4da2d 👍️[Update] Model : Deviceの変更監視処理を変更
- デバイス監視処理実行時にデバイス選択を行うとアクセス干渉のために動作停止の可能性あり
2024-09-15 17:25:02 +09:00
청박 79c97cf5a6 Update en.yml 2024-09-15 09:16:58 +09:00
청박 6adc416d5f Update Korean translation, update YAML strings 2024-09-15 09:12:54 +09:00
Sakamoto Shiina b7b1aa2d2f [Chore] Receive routes: Volume Check: Adjust the receive data format from python and put the data to update store function directly. 2024-09-15 08:32:47 +09:00
Sakamoto Shiina b56b182357 [Update] Add some color on console.log for preventing mix up with code 348.
and show result data when received invalid endpoint that when receive route is not ready to implement yet.
2024-09-15 08:06:15 +09:00
Sakamoto Shiina 1424abe44e [Update] Main Page: LanguageSelector. Fetch language list data from Python when starting up software. 2024-09-15 07:45:44 +09:00
misyaguziya 551bc424b8 👍️[Update] Model : Deviceの変更監視処理を追加
マイク/スピーカーの別々のスレッドの処理を一つにまとめたら動いた
2024-09-14 03:09:19 +09:00
misyaguziya a40529aaa5 🚧[WIP/TEST] Model : Deviceの変更監視処理を追加
マイク/スピーカー両方とも自動選択ONの場合にUIが固まる
2024-09-14 00:22:03 +09:00
Sakamoto Shiina b6b67e9bd1 [Update] Config Page: Set volume, that check mic/speaker volume, to 0 when config page is closed. 2024-09-13 23:41:41 +09:00
Sakamoto Shiina 8198263b02 [Update] Disable mic/speaker volume check when config page is closed. 2024-09-13 22:56:20 +09:00
misyaguziya 6254a93b20 👍️[Update] device変更時にenergyも同期して変更するようにしました 2024-09-13 18:15:49 +09:00
Sakamoto Shiina f74ebc1942 [Update] Config Page: Add Appearance Tab. Add UI Language section.(Functionally, too) 2024-09-13 16:23:23 +09:00
misyaguziya 8bc6160ce8 Merge branch 'ui_language' into for_webui 2024-09-13 16:14:17 +09:00
misyaguziya 2d89ce71e0 👍️[Update] Controller : callbackSetUiLanguageの処理を修正
SELECTABLE_UI_LANGUAGES_DICT周りを削除
2024-09-13 16:14:01 +09:00
misyaguziya 319843f235 Merge branch 'ui_language' into for_webui 2024-09-13 16:09:09 +09:00
misyaguziya a4ac82fe7e 👍️[Update] Controller : callbackSetUiLanguageの処理を修正
utils.getKeyByValueを削除
2024-09-13 16:08:58 +09:00
misyaguziya 1eceb8e8e8 Merge branch 'remove_compact_mode' into for_webui 2024-09-13 15:10:34 +09:00
misyaguziya 62e6064fd9 🗑️[remove] Model : compact modeのconfigを削除 2024-09-13 15:10:18 +09:00
misyaguziya ad84c10391 Merge branch 'remove_compact_mode' into for_webui 2024-09-13 14:28:43 +09:00
misyaguziya 0d74cc3607 🗑️[remove] Model : compact modeのendpointを削除 2024-09-13 14:28:31 +09:00
misyaguziya 3dbedca97d Merge branch 'automatic_device_selection' into for_webui 2024-09-13 13:49:15 +09:00
misyaguziya e8c65ed81f 👍️[Update] Model : defaultのデバイス動作する機能のendpointを追加 2024-09-13 13:48:50 +09:00
misyaguziya 8a1c17f994 Merge branch 'automatic_device_selection' into for_webui 2024-09-13 13:37:23 +09:00
misyaguziya fc8eb374b3 Merge branch 'remove_compact_mode' into for_webui 2024-09-13 13:37:13 +09:00
misyaguziya 53edb45825 👍️[Update] Model : defaultのデバイス動作する機能を追加 2024-09-13 13:34:46 +09:00
misyaguziya e1aa72715d 🗑️[remove] Model : IS_CONFIG_WINDOW_COMPACT_MODE周りの処理を削除 2024-09-13 11:21:27 +09:00
misyaguziya c83715e9f6 Merge branch 'endpoint_response' into for_webui 2024-09-13 10:39:44 +09:00
misyaguziya f001bebce7 👍️[Update] Model : endpointにreturn に何かしらのresultをすべて入れるように変更 2024-09-13 10:39:27 +09:00
misyaguziya 441ab8b374 Merge branch 'multi_language_translate' into for_webui 2024-09-13 02:29:36 +09:00
misyaguziya 8e35f93a58 Merge branch 'exclude_word' into for_webui 2024-09-13 02:29:29 +09:00
misyaguziya 8f23292a2c 🐛[bugfix] Model: 多言語対応に伴い翻訳エンジンの成否をsuccess[list]形式に対応 2024-09-13 02:29:12 +09:00
misyaguziya 2b5a03efa1 🐛[bugfix] Model: 多言語対応に伴いexclude_wordをtranslation[list]形式に対応 2024-09-13 02:26:56 +09:00
misyaguziya 2f10f03ec8 Merge branch 'exclude_word' into for_webui 2024-09-12 23:14:29 +09:00
misyaguziya 3777da6a0f Merge branch 'overlay' into for_webui 2024-09-12 23:12:00 +09:00
misyaguziya 2201e5bcce 🗑️[remove] Model : XSOverlay の機能を削除 2024-09-12 23:11:46 +09:00
misyaguziya d0c3e6dd1c 🐛[bugfix] Model: overlay | setOverlayRawの処理を200回繰り返すとOverlayError_RequestFailedが発生するため、Overlayの再起動処理を追加 2024-09-12 23:11:20 +09:00
misyaguziya 39f3c5a84e Merge branch 'papago' into for_webui 2024-09-12 22:52:14 +09:00
misyaguziya 24ac8e1081 👍️[Update] translators update 5.9.2 -> 5.9.2.1 2024-09-12 22:51:54 +09:00
misyaguziya 6cfaf29ba0 Merge branch 'Transliteration' into for_webui 2024-09-12 22:46:50 +09:00
misyaguziya bdb3ac8954 👍️ [Update] Model : pykakasiのデータベースをbuild時に追加するように変更 2024-09-12 22:46:14 +09:00
Sakamoto Shiina eeabb8088a Merge branch 'ui' into for_webui 2024-09-12 17:13:36 +09:00
Sakamoto Shiina 6b3ff1f3b2 [Update] Main Page: Side bar scroll bar. Adjust scroll bar color when language selector is opened.(For hiding in appearance) 2024-09-12 16:50:47 +09:00
Sakamoto Shiina b12908f01f [Update] Config Page: Device Tab. Add dynamic energy threshold functionally and sync slider and entry component. 2024-09-12 15:45:03 +09:00
misyaguziya 84ca8bc2db Merge branch 'develop' 2024-09-12 14:53:13 +09:00
misyaguziya 6e2b29e84c Merge branch 'version' into develop 2024-09-12 14:14:59 +09:00
misyaguziya c0029e7e62 👍️[Update]Version 2.2.6 -> 2.2.7 2024-09-12 14:14:43 +09:00
misyaguziya 67e73d0dfa Merge branch 'requirements' into develop 2024-09-12 14:13:49 +09:00
misyaguziya d47fcda679 👍️[Update] numpy のバージョンを修正 2024-09-12 14:13:21 +09:00
misyaguziya 4ca27d98ed Merge branch 'requirements' into develop 2024-09-12 14:00:34 +09:00
misyaguziya 7d8ffaa15b 👍️[Update] torch周りで問題が発生したため、requirementsを最新のものに更新 2024-09-12 14:00:20 +09:00
Sakamoto Shiina 4a3d5b142f Merge branch 'remove_xsoverlay_ui' into develop 2024-09-12 13:41:56 +09:00
Sakamoto Shiina 72ed196329 [Remove] XSOverlay廃止に伴いUI削除 2024-09-12 13:41:22 +09:00
misyaguziya ff981622be Merge branch 'remove_xsoverlay' into develop 2024-09-12 13:29:26 +09:00
misyaguziya 437d9eb644 🗑️[remove] Model : XSOverlay の機能を削除 2024-09-12 13:29:13 +09:00
misyaguziya 394daac730 Merge branch 'bugfix_papago' into develop 2024-09-12 13:20:57 +09:00
misyaguziya fbbf3189fc 👍️[Update] translators update 5.9.2 -> 5.9.2.1 2024-09-12 13:20:37 +09:00
misyaguziya b1751f69cb Merge branch 'transliteration' into for_webui 2024-09-12 00:43:44 +09:00
misyaguziya ce28366278 👍️ [Update] Model : 日本語ひらがな/ローマ字 変換の実装
ローマ字/ひらがな有効でかつ以下の場合に動作
- 送信の翻訳時にtargetのプライマリが日本語の場合
- 受診時にtargetのプライマリが日本語の場合
2024-09-12 00:42:49 +09:00
Sakamoto Shiina 166759075a [Update] Config Page: Device Tab. dropdown component. Add onMouseLeave Function. The content's text size up. 2024-09-12 00:27:27 +09:00
Sakamoto Shiina c422a13df3 [Update] Config Page: Device Tab. Adjust designs. 2024-09-11 23:50:36 +09:00
Sakamoto Shiina f6eaf84f85 [Update/bugfix] Config Page: Device Tab. Mic host/device section. Put together mic host and device settings in one section.
Fix dropdown menu contents width and position. and add padding right for preventing text to cover svg arrow.
2024-09-11 19:02:44 +09:00
Sakamoto Shiina f2f9b7d1c9 [bugfix] Main Page: Side bar. Fix the width (and remove scroll bar when it's compact mode.) 2024-09-11 16:00:58 +09:00
Sakamoto Shiina f0cffa7127 [Update] Main Page: Side bar. Scroll bar only shows when the side bar area is hovered. 2024-09-11 14:46:00 +09:00
Sakamoto Shiina 7068167866 [UPdate] Main Page: Side bar. Now, scrollable. 2024-09-11 13:46:45 +09:00
misyaguziya 8345945bdc Merge branch 'listening_energy' into for_webui 2024-09-11 13:28:52 +09:00
misyaguziya 0e226f7328 👍️[Update] Model : energyの終了方法とreturnの値を修正 2024-09-11 13:28:35 +09:00
misyaguziya ab2dc073b9 🚧 [WIP/TEST] Model : 日本語ひらがな/ローマ字 変換の実装 2024-09-11 11:08:51 +09:00
Sakamoto Shiina ccdd070fed Merge branch 'ui' into for_webui 2024-09-11 00:45:14 +09:00
Sakamoto Shiina 4d9a6fedb7 [Update] Config Page: Device Tab. Threshold section. Add check volume button and remove dev component. 2024-09-11 00:33:09 +09:00
Sakamoto Shiina e1d8f59890 [Refactor] Change the function names. 2024-09-10 21:11:15 +09:00
Sakamoto Shiina b4d164e116 [bugfix] Config Page: Device Tab. ThresholdEntry. fix that can see green background color that I forgot to remove. 2024-09-10 20:16:22 +09:00
Sakamoto Shiina be7e77787e [Update] Config Page: Device Tab. Threshold section. Add validation that when input area to be blank, put 0 automatically. 2024-09-10 20:08:32 +09:00
Sakamoto Shiina f0cadb1335 [bugfix] Main Page: Message Log. fix format error that receive from python. 2024-09-10 18:10:52 +09:00
Sakamoto Shiina ac6b898a46 [Perf/bugfix] Separate custom hooks and prevent re-render issues.
Config Page: Device Tab. threshold component. fix problem that the input component focused out when input something each time.
Set threshold data when started python.
2024-09-10 17:21:03 +09:00
misyaguziya 5a7de58525 Merge branch 'multi_language_translation' into for_webui 2024-09-10 14:46:30 +09:00
misyaguziya 3a4ae5401a 👍️[Update] Model : 未使用のconfigをコメントアウト 2024-09-10 14:45:57 +09:00
misyaguziya ac14d2c76b 👍️[Update] Model : 翻訳エンジン周りのendpointを追加
- /controller/callback_enable_multi_language_translation
- /controller/callback_disable_multi_language_translation
- /controller/list_translation_engines
2024-09-10 14:45:20 +09:00
Sakamoto Shiina 37989d5f7a [Update] Config Page: Device Tab. To sync Threshold value between slider and entry component. 2024-09-10 08:06:09 +09:00
misyaguziya 467b02b3d2 Merge branch 'multi_language_translation' into for_webui 2024-09-10 02:15:22 +09:00
misyaguziya 4eaa3c5c89 🐛[bugfix] Model : 多言語翻訳を使用しない場合にプライマリの言語のみで翻訳エンジンを選択できるように修正 2024-09-10 02:15:05 +09:00
Sakamoto Shiina 49bb7d7c5f [Update] Config Page: Device Tab. Add threshold slider functionally. 2024-09-09 20:09:32 +09:00
misyaguziya 1f172c8127 🐛[bugfix] Model : 言語設定のバグを修正 2024-09-09 19:39:21 +09:00
misyaguziya 1ef829c33b Merge branch 'multi_language' into for_webui 2024-09-09 17:46:06 +09:00
misyaguziya da028da20b 🚧 [WIP/TEST] Model : 言語の設定方法を全面的に見直し
SOURCE_COUNTRY等を削除
2024-09-09 17:43:06 +09:00
misyaguziya 095f95bbff Merge branch 'model_traslation_format' into for_webui 2024-09-09 12:57:37 +09:00
misyaguziya 5ccedb8cd0 👍️[Update] Model : translationの出力をlist形式に変更 2024-09-09 12:57:22 +09:00
Sakamoto Shiina 0773d0e75f Merge branch 'ui' into for_webui 2024-09-09 12:39:04 +09:00
misyaguziya 24a0bc0b55 🚧 [WIP/TEST] Model : マルチ言語対応のconfig設定について実装
PRIMARY/SECONDARY/TERTIARY
2024-09-09 12:38:50 +09:00
Sakamoto Shiina 5eaaea535c [Update] Main Page: Log Box. 翻訳後文章表示対応。 2024-09-09 12:37:38 +09:00
Sakamoto Shiina a4d7e886d5 [Update] Main Page: Message Input Box. Add function, changeable the send button "hide", "show", "show_and_disable_enter_key". 2024-09-08 23:52:00 +09:00
Sakamoto Shiina 2b9061d74d [Update] Config Page: Others Tab. Add section, send message button type. 2024-09-08 23:13:18 +09:00
Sakamoto Shiina 6aa427baec [Update] Main Page: Message input box. Add function, auto clear message box. 2024-09-08 18:14:58 +09:00
Sakamoto Shiina 28a602e01e [Update] Config Page: Add Others Tab. Add section Auto Clear Message Box. 2024-09-08 17:43:54 +09:00
Sakamoto Shiina 33cd7b442d Merge branch 'ui' into for_webui 2024-09-08 14:00:30 +09:00
Sakamoto Shiina e0d9c99075 [Update/WIP] Config Page: Device Tab. 音量チェックができるように(Dev) 2024-09-08 13:59:12 +09:00
misyaguziya 5c6f51bdaa 🚧 [WIP/TEST] プレースホルダーの形式を修正 ex) " <$ 0x1000> " -> " $ 0x1000 "
$と0x1000の間にスペースが入る事があるため、それを考慮して正規表現を修正
2024-09-08 05:48:46 +09:00
Sakamoto Shiina ef5eb2fb40 [Update/Perf] Config Page: Device Tab. Add threshold_component(dev).
Improve re-render, unnecessary, problem.
2024-09-07 21:32:44 +09:00
misyaguziya 619532f03b 🚧 [WIP/TEST] エスケープ文字による翻訳しない文章を設定できるように実装
プレースホルダーの形式を修正 ex) "0x1000" -> " <$ 0x1000> "
2024-09-07 17:59:15 +09:00
misyaguziya a2b52658a8 🚧 [WIP/TEST] エスケープ文字による翻訳しない文章を設定できるように実装
エスケープ時の置換文字を0x1000から順番に規定
2024-09-07 01:13:13 +09:00
misyaguziya 73abc9b5e9 🚧 [WIP/TEST] エスケープ文字による翻訳しない文章を設定できるように実装
![...]で囲んだ範囲(...は文章)翻訳ONの状態でもその部分は翻訳しない。
この機能はチャットのみで有効
2024-09-06 23:13:47 +09:00
misyaguziya 480d0f3f11 Merge branch 'model_downloader' into for_webui 2024-09-05 17:26:57 +09:00
misyaguziya 04378c5937 🐛[Update] Model : 間違っているpathを修正 2024-09-05 17:26:31 +09:00
misyaguziya cb0e6e12f9 Merge branch 'model_downloader' into for_webui 2024-09-04 14:20:23 +09:00
misyaguziya 9d7819b186 👍️[Update] Model : モデルのダウンロード処理をスレッドで進行するように変更 2024-09-04 14:19:21 +09:00
misyaguziya 93ba4a0155 Merge branch 'python-build' into for_webui 2024-09-04 10:11:48 +09:00
misyaguziya 4d3b0b96dc 👍️[Update] Build : pythonをonefile から onedirに変更
pyinstallerのビルド設定をspecファイルに書き出し
_internalフォルダはresourcesで追加
2024-09-04 01:37:35 +09:00
misyaguziya 1fc2ad6824 Merge branch 'encode' into for_webui 2024-09-03 19:36:40 +09:00
misyaguziya 9b7a614b8b 🐛[bugfix] Model : typoを修正 2024-09-03 19:36:26 +09:00
misyaguziya 7ae86268a9 👍️[Update] Model : tauri -> python のencode処理を整理 2024-09-03 18:18:58 +09:00
misyaguziya fb0a4a8f26 👍️[Update] Model : tauri -> python のデータ部分をbase64でencodeするように修正 2024-09-03 14:47:22 +09:00
Sakamoto Shiina 87d2ecef34 Merge branch 'ui' into for_webui 2024-09-03 11:33:16 +09:00
Sakamoto Shiina f34eaa6ee2 [Update] Config Page: Device Tab. Add Speaker device selector.
(Now, Devices (Mic host, Mic device, Speaker device) are selectable.)
2024-09-03 11:30:40 +09:00
Sakamoto Shiina 18672d6dd1 [bugfix/Refactor] Config Page: Device Tab. Fix render error when open config page before preparing backend.
And remove the code that is no longer in use.
2024-09-03 11:15:34 +09:00
Sakamoto Shiina 96708a27a6 [Update] Config Page: Device Tab. Fetch latest data mic host list and device list when open the list container every time. 2024-09-03 10:49:52 +09:00
Sakamoto Shiina aed9faa72f Merge branch 'ui' into for_webui 2024-09-03 09:00:39 +09:00
Sakamoto Shiina 87cda49994 [Update] Config Page: Device Tab. To be selectable mic host and device. 2024-09-03 08:59:38 +09:00
misyaguziya 2a148f3c75 Merge branch 'model' into for_webui 2024-09-02 22:01:28 +09:00
misyaguziya 9a829c162d 🐛[bugfix] Model : 出力するデータを修正 2024-09-02 22:01:12 +09:00
Sakamoto Shiina bf21a20315 [Update] Config Page: Device tab. add mic device list.(not selectable yet.) 2024-09-02 17:25:43 +09:00
Sakamoto Shiina 26691f773f [Update] Config Page: Add Device tab. add mic host list.(not selectable yet.) 2024-09-02 17:05:38 +09:00
misyaguziya e45fc340e8 👍️[Update] Model : transcriptionの終了処理のactionを削除 2024-09-02 16:01:31 +09:00
misyaguziya 2fd40aeb23 👍️[Update] Model : messagebox send/typing/typing_stopで不要なコードを削除 2024-09-02 14:04:51 +09:00
Sakamoto Shiina 6c68f3744f [bugfix] Config Page: Fix get software version function that wasn't working because of typo. 2024-09-02 12:36:37 +09:00
Sakamoto Shiina 45c6562717 [Update] Change the endpoint that send message from message box. 2024-09-02 12:27:25 +09:00
Sakamoto Shiina 61c1ad624a Merge branch 'ui' into for_webui 2024-09-02 12:12:02 +09:00
misyaguziya e5e01f5939 Merge branch 'models' into for_webui 2024-09-02 12:07:53 +09:00
misyaguziya b5f8a0d560 🗑️[Remove] Model : SENT_MESSAGES_LOG/CURRENT_SENT_MESSAGES_LOG_INDEXを削除(コメントアウトのみ) 2024-09-02 12:07:13 +09:00
misyaguziya 5697f3273f 👍️[Update] Model : messagebox send/typing/typing_stopを追加 2024-09-02 12:05:27 +09:00
Sakamoto Shiina 231125e406 [Update] Config Page: Change background color and adjust DropdownMenu component for it. 2024-09-02 10:39:02 +09:00
misyaguziya 1f5a27343d 👍️[Update] Model : messegae送信のテストコードを修正 2024-09-02 10:33:08 +09:00
Sakamoto Shiina fdbaaaaca9 [bugfix/chore] Main Page: Sidebar. fix vrct logo height that was shrink. 2024-09-02 09:08:39 +09:00
Sakamoto Shiina 597fee16df [bugfix] Main Page: MainFunctionSwitches. fix the label width that was shrinking and wrapping unexpectedly. 2024-09-02 09:08:39 +09:00
Sakamoto Shiina ed26d157b5 [Update] Config Page: Adjust sidebar sizes to smaller. 2024-09-02 09:08:39 +09:00
Sakamoto Shiina e9d4ce2012 [Update] Config Page: Adjust Go back button to be a bit smaller and expand clickable range. 2024-09-02 09:08:39 +09:00
Sakamoto Shiina 91c2a9cb5b [Update] Config Page: Change the design to be natural and behavior smoother. 2024-09-02 09:08:02 +09:00
misyaguziya 0528bfe181 🗑️[Remove] Model : remove xsoverlay module(不足分を追加) 2024-09-01 23:22:20 +09:00
misyaguziya dfbc1f92e7 🗑️[Remove] Model : remove xsoverlay module 2024-09-01 23:14:20 +09:00
Sakamoto Shiina 3446862eda [Update] To be switchable between ConfigPage and MainPage. 2024-09-01 19:48:58 +09:00
misyaguziya 1fa46fea12 Merge branch 'models' into for_webui 2024-09-01 19:18:06 +09:00
misyaguziya bde07be4e2 👍️[Update] Model : warnings ignoreの場所を修正 2024-09-01 18:11:45 +09:00
misyaguziya c724f7d7ae 👍️[Update] Model : import のパスを修正 2024-09-01 17:59:07 +09:00
misyaguziya 4c2e4a6e04 👍️[Update] Model : status 348のlog を printLog関数に集約 2024-09-01 17:33:22 +09:00
misyaguziya 8f2c81a7d7 Merge branch 'models' into for_webui 2024-08-31 16:10:27 +09:00
misyaguziya 5ff0e45b24 Merge branch 'send_message' into for_webui 2024-08-31 16:10:20 +09:00
misyaguziya 6886241154 👍️[Update] Model : FutureWarningが出るのでignoreで対応
huggingface_hub\file_download.py:1150: FutureWarning: resume_download is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use force_download=True.
2024-08-31 16:10:00 +09:00
misyaguziya bc59cf6089 🚧[WIP/TEST] Controller : stdioでのtauriとpythonの通信をutf8でエンコード/デコードするように変更 2024-08-31 11:04:11 +09:00
misyaguziya 0a7e5e0a93 Merge branch 'models' into send_message 2024-08-30 23:47:01 +09:00
misyaguziya 090483543b 🚧[WIP/TEST] Controller : チャット時にIDを付与するように変更 2024-08-30 23:46:51 +09:00
Sakamoto Shiina 652e336d86 [Update/WIP] メッセージ送信リクエスト時にidを付与。 2024-08-29 10:37:56 +09:00
Sakamoto Shiina 9110ab1ce9 Merge branch 'ui' into for_webui 2024-08-28 17:24:42 +09:00
misyaguziya caab8f746b 👍️[Update] Controller : 起動時にモデルのweightファイルをダウンロードするように実装 2024-08-28 11:39:34 +09:00
misyaguziya 519ab57137 🗑️[Removal] update/restart処理を別プログラムに任せるためバッチ処理を削除 2024-08-28 11:36:17 +09:00
Sakamoto Shiina 9d278c87aa [Update] 文字起こしされたメッセージをログに表示(スピーカー)(翻訳未対応) 2024-08-28 09:09:56 +09:00
Sakamoto Shiina 4ef575f2a9 [Update] 文字起こしされたメッセージをログに表示(マイクのみ + 翻訳未対応) 2024-08-28 00:40:06 +09:00
misyaguziya 41199221f6 Merge branch 'models' into for_webui 2024-08-27 17:42:51 +09:00
misyaguziya 2135b1a561 👍️[Update] change requirements.txt
update package version
2024-08-27 17:41:17 +09:00
Sakamoto Shiina 1042c5e2b9 [Refactor] Logic: Move object structure creation to the parent file. 2024-08-27 11:06:10 +09:00
misyaguziya aa0902ee15 👍️[Update] Backend : backend exe name change text.exe to backend.exe 2024-08-21 01:18:02 +09:00
misyaguziya 95c0634300 👍️[Update] Model : 初期化処理のスタート/完了を通知するように修正 2024-08-19 12:28:46 +09:00
misyaguziya 2e77206080 Merge branch 'models' into for_webui 2024-08-16 01:22:44 +09:00
misyaguziya 29585076ed 👍️[Update] View : Endpointを一部接続 2024-08-16 01:22:18 +09:00
Sakamoto Shiina 614905fa6a Merge branch 'ui' into for_webui 2024-08-14 14:28:30 +09:00
Sakamoto Shiina c0411ef4a8 [Update/bugfix] About VRCT: Poster showcase worlds. Fix clickable range to expand.
And replace the link "Twitter" to "X".
2024-08-14 14:01:22 +09:00
Sakamoto Shiina f96b834de5 [Update] About VRCT: Add some poster showcased worlds. (sync with v2.2.6) 2024-08-14 13:29:00 +09:00
misyaguziya 67e3b77c39 Merge branch 'develop' 2024-08-14 11:40:50 +09:00
misyaguziya 6d85fb2826 Merge branch 'version' into develop 2024-08-14 10:50:45 +09:00
misyaguziya 31ad2fec27 👍️[Update] version 2.2.5 -> 2.2.6 2024-08-14 10:50:24 +09:00
misyaguziya 88ee4468be Merge branch 'bugfix_overlay' into develop 2024-08-13 22:47:25 +09:00
Sakamoto Shiina 10476bd523 Merge branch 'ui' into develop 2024-08-13 21:35:16 +09:00
Sakamoto Shiina 1541bed3ef [Update] About VRCT: Remove supporter 'tell us' section. and change the members section's text-align, center to left. 2024-08-13 21:32:06 +09:00
Sakamoto Shiina 0890711911 [Update] About VRCT: Poster Showcased World. Add and change some worlds. Pages are overflowed so the pagination button looks bug... I'm gonna fix it next web-ui update. 2024-08-13 21:23:49 +09:00
Sakamoto Shiina 70b4ab838b [Update/fix] Config Window: Word Filter. Fix the arrow image that was put in opposite rotation. 2024-08-13 19:24:38 +09:00
misyaguziya aa57c5d911 🐛[bugfix] Model: overlay | setOverlayRawの処理を200回繰り返すとOverlayError_RequestFailedが発生するため、Overlayの再起動処理を追加 2024-08-13 00:27:52 +09:00
misyaguziya ed54509383 Merge branch 'downloader' into for_webui 2024-08-11 19:48:18 +09:00
misyaguziya 83bf21c20e 👍️[Update] Main/Controller : CTranslate2/Whisper model weight download のDownload済みの場合の処理を追加 2024-08-11 19:02:55 +09:00
misyaguziya a8f6a31128 Merge branch 'downloader' into for_webui 2024-08-11 13:51:59 +09:00
misyaguziya 633cdf246c 👍️[Update] Models : change print log to json format log 2024-08-11 13:51:48 +09:00
misyaguziya 3924b2eb3b 👍️[Update] Main/Controller : Add CTranslate2/Whisper model weight download endpoints 2024-08-11 13:50:51 +09:00
misyaguziya c7ed586bb3 Merge branch 'model' into for_webui 2024-08-10 11:21:19 +09:00
misyaguziya 87148af4e5 🐛[bugfix] Main : テストコードのlogのstatusを追加 2024-08-10 11:19:51 +09:00
Sakamoto Shiina 2218d4615e [Chore/bugfix] fix the receive status code 384 to 348 that i wanted to put. 2024-08-10 11:13:26 +09:00
misyaguziya be6e29515d Merge branch 'models' into for_webui 2024-08-10 04:49:13 +09:00
misyaguziya 294b519d02 👍️[Update] Main/Controller : logのstatusを追加 2024-08-10 04:48:04 +09:00
misyaguziya 3a1e5b8d89 👍️[Update] Main/Controller : エンドポイントの検証用のテストコードを追加 2024-08-10 04:37:54 +09:00
misyaguziya d4d68d17cf 👍️[Update] Main/Controller : エンドポイントの検証用のテストコードを追加(途中) 2024-08-09 19:11:08 +09:00
misyaguziya 8bb5b27e9f 👍️[Update] Main/Controller : データ送信の形を修正 2024-08-09 14:59:31 +09:00
Sakamoto Shiina 9a17bbccbb Merge branch 'handle_backend_log' into for_webui 2024-08-09 13:22:27 +09:00
Sakamoto Shiina 8be398e0c0 [Update] Add stdout handling status code 348 and show log to console. It's for showing log from backend properly. 2024-08-09 13:19:34 +09:00
Sakamoto Shiina 3ed3d5eb40 [Update] Combine in one window. Rename Main/Config Window to Main/Config Page accordingly.
For now, I put Config Page to below the main page temporary. Open Config Button does not work.
2024-08-09 12:23:17 +09:00
misyaguziya af1cdd2d7b Merge branch 'std_log_json' into for_webui 2024-08-09 01:32:41 +09:00
misyaguziya 8780624689 👍️[Update] Main/Controller : logをjsonとしてstdに送信するように変更 2024-08-09 01:31:59 +09:00
Sakamoto Shiina e8fd6b724d [Update/bugfix] To get software version.(show it to the console for now.)
fix the error that was wrong amount arguments.
2024-08-08 16:36:40 +09:00
Sakamoto Shiina e9de5df8a5 [Update/bugfix] Localization. Adjust to i18next's variable format. 2024-08-08 07:31:38 +09:00
misyaguziya 9511e2e201 Merge branch 'models' into for_webui 2024-08-07 17:06:13 +09:00
Sakamoto Shiina f23a9425c3 [Update/bugfix] Config Window: WordFilter. Add toggle button that can open and close the word filter list. And Add the text that the word filter list's length.
fix the error, input_value undefined but do split function.
2024-08-07 16:53:44 +09:00
misyaguziya 8494bd2197 👍️[Update] Main/Controller : Callbackのpathとinitを追加 2024-08-07 16:46:34 +09:00
misyaguziya 3f814d123c 🚧[WIP/TEST] Main/Controller : コールバックのつなぎを実装 2024-08-07 16:20:09 +09:00
misyaguziya 1fdccbcb0d 🚧[WIP/TEST] Main/Controller : 送信形式を修正 2024-08-07 15:17:22 +09:00
Sakamoto Shiina 1276298187 [Update] Config Window: Add WordFilter. (tmp data) 2024-08-07 14:59:21 +09:00
Sakamoto Shiina 67248bfa09 [Update] Config Window: Add ActionButton component. 2024-08-06 17:01:56 +09:00
Sakamoto Shiina ca2154b3d8 [bugfix] Config Window: DeeplAuthKey. fix save button's design that was a bit off. 2024-08-06 15:24:17 +09:00
Sakamoto Shiina 9bd82baf53 [Refactor] Config Window: nest _entry directory. 2024-08-06 15:06:19 +09:00
Sakamoto Shiina 0e9ff561ac [Update] Config Window: MessageFormat. Sync the data between message format and UI components. 2024-08-06 13:22:01 +09:00
Sakamoto Shiina 352222f49d [Update] Config Window: MessageFormat. Add translated message to the example display, language flexibly. 2024-08-06 08:27:24 +09:00
Sakamoto Shiina eb38d6a2b1 [Update] Config Window: Add MessageFormat component. 2024-08-05 11:56:47 +09:00
Sakamoto Shiina 524f4d79a4 [bugfix] Config Window: DeeplAuthKey. Replace open deepl webpage url, that was test url, to correct one. 2024-08-05 07:54:04 +09:00
Sakamoto Shiina 891e750a97 [Update] Config Window: DeeplAuthKey. to focus input component when edit button clicked. 2024-08-05 07:48:01 +09:00
Sakamoto Shiina 19ef8d3226 [Update] Config Window: DeeplAuthKey. put edit and save button and move open webpage button to label section. 2024-08-05 06:40:42 +09:00
Sakamoto Shiina 0d7eb9eb8c [bugfix_2] to fix git ignorecase. 2024-08-04 11:49:09 +09:00
Sakamoto Shiina 29276fae23 [bugfix_1] to fix git ignorecase. 2024-08-04 11:39:01 +09:00
Sakamoto Shiina 88b911bfc2 [Update/Refactor] Config Window: Add DeeplAuthKey.
Refactor: Separate entry component.
2024-08-04 09:12:39 +09:00
Sakamoto Shiina 1d2df69507 [Update] Config Window: Add Radio button component. 2024-08-03 11:17:42 +09:00
Sakamoto Shiina 4679804500 [Update] Config Window: Add Mic/Speaker Threshold component. 2024-08-03 08:11:07 +09:00
Sakamoto Shiina ef94d755c6 [Update] Config Window: Add Entry component. 2024-08-02 10:33:29 +09:00
Sakamoto Shiina 112ace95d7 [Update] Config Window: Add Switchbox component. Adjust switchbox in main window's main functions. 2024-08-02 09:49:45 +09:00
Sakamoto Shiina 329fb36219 [Update] Config Window: Add Checkbox component. 2024-08-01 12:45:09 +09:00
Sakamoto Shiina 072a85750b [Update] Config Window: Add slider component by using Material UI reluctantly.
I didn't want to use it because it's hard to customize. but I didn't like the slider's thumbs behaver so I did it.
It has Tooltip component so It will be useful somewhere. still difficult to customize it, tho.
2024-08-01 10:42:29 +09:00
misyaguziya e4fe2dd907 🚧[WIP/TEST] Controller : 応答値を修正/各セクションでprocess.logに書き出す用に追加 2024-07-30 15:37:58 +09:00
misyaguziya 209070f90e 🐛[Bugfix] Config : PATH_LOCALが正しく取得できない問題を修正 2024-07-30 15:30:08 +09:00
Sakamoto Shiina 14e033b2e9 [Update] Config Window: Setting Box: DropdownMenu: Adjust design. add arrow icon that can toggle and border-radius.
Also change the open dropdown menu function to the toggle function.
2024-07-30 08:36:06 +09:00
Sakamoto Shiina 6bd5eba707 [Update] Config Window: Setting Box. Put the design to label component. 2024-07-30 07:51:21 +09:00
Sakamoto Shiina dd1448a145 [Refactor] Config Window: SettingBox. rename and tidy them up a bit. 2024-07-30 07:39:41 +09:00
Sakamoto Shiina 4e7667e277 [Update/Prepare] Prepare for window transparency feature. 2024-07-30 05:31:00 +09:00
Sakamoto Shiina 4c82f72c8f [Update] Main Window: LanguageSelector. Adjust padding. 2024-07-30 05:03:48 +09:00
Sakamoto Shiina 60471eacde [bugifx] Resolve the error that can't import favicon.ico.
(the solution I added link tag is just facade. It's not working in fact.)
2024-07-30 04:49:36 +09:00
Sakamoto Shiina ae1bb8cce1 [Update] Change icons and titles default ones to VRCT's. 2024-07-30 00:35:39 +09:00
Sakamoto Shiina 080939a853 [Refactor] Separate 'useReceiveRoutes' function that is control the received path from Python and send to the specific function, React. 2024-07-29 22:16:12 +09:00
misyaguziya 73954d12fe 🚧[WIP/TEST] Main: viewをコメントアウト 2024-07-29 18:31:29 +09:00
Sakamoto Shiina 3f499b243b [Update] npm run時のコマンドを整理。
pythonファイルを編集していないのに、毎回 pyinstallerが走るのは厄介なので、コマンド分け。
2024-07-28 02:00:52 +09:00
Sakamoto Shiina 245ca210bc [Refactor] Change the way import. and also move useWindow.js to logics. 2024-07-27 23:03:20 +09:00
Sakamoto Shiina a32d53975a [Refactor] Separate Logics directory. 2024-07-27 22:28:35 +09:00
Sakamoto Shiina a1da98d29c Merge remote-tracking branch 'origin/for_webui' into for_webui 2024-07-27 21:15:58 +09:00
Sakamoto Shiina 04a68fe074 [Refactor] store.js, etc..: Rename variables and functions.
suffix '_Status' is for async. It has 'loading' state, for now.
2024-07-27 21:08:48 +09:00
misyaguziya 1be04cb571 👍️ [Update] pythonのメイン処理部分を移動/webui_mainloop.pyをビルドできるように修正 2024-07-27 01:30:36 +09:00
Sakamoto Shiina 03d689ac18 [Refactor] store.js: put the function names dynamically. 2024-07-26 22:18:16 +09:00
Sakamoto Shiina 7ce3bc9be9 [Update] Config Window: About VRCT. PosterShowcase section. reduce animation duration a bit and the indicator will be brighter when hovered. 2024-07-25 05:21:36 +09:00
Sakamoto Shiina ebd1a8d70d [Update] Migrate to tauri-app(Web UI) 2024-07-25 01:01:22 +09:00
misyaguziya 25899b63da 🚧[WIP/TEST] Main: webuiのためのmain実装途中#4 2024-07-24 18:38:50 +09:00
misyaguziya ebe284bcb2 🚧[WIP/TEST] Main: webuiのためのmain実装途中#3 2024-07-24 03:34:01 +09:00
misyaguziya d80260c113 🚧[WIP/TEST] Main: webuiのためのmain実装途中#2 2024-07-17 01:10:02 +09:00
misyaguziya da5a71c93b 🚧[WIP/TEST] Main: webuiのためのmain実装途中 2024-07-16 02:26:21 +09:00
misyaguziya ea3a1c8e57 Merge branch 'develop' 2024-06-23 16:02:31 +09:00
misyaguziya 4df87a58e0 Merge branch 'version' into develop 2024-06-23 16:02:04 +09:00
misyaguziya 94705e1fec 👍️[Update] version 2.2.4 -> 2.2.5 2024-06-23 16:01:50 +09:00
misyaguziya ff637e74d5 Merge branch 'bugfix_speakerdevice' into develop 2024-06-20 17:06:16 +09:00
misyaguziya f94f0d1d71 👍️[Update] Model : add package pydub 2024-06-20 17:06:03 +09:00
misyaguziya 9aa4b1447f Merge branch 'bugfix_speakerdevice' into develop 2024-06-20 17:00:14 +09:00
misyaguziya 5bb3152d02 🐛[bugfix] Model : speakerがサラウンドデバイスの場合に音声が文字起こしされない問題を修正 #10 2024-06-20 16:59:59 +09:00
misyaguziya 44b36801ed 🐛[bugfix] Model : speaker channel audio_sources["channels"] >= 2 の時sample_rateを調整するように修正 2024-06-20 00:56:12 +09:00
misyaguziya 2f3c34ca43 Merge branch 'installer' into develop 2024-06-19 17:35:11 +09:00
misyaguziya 593eed7988 🐛[bugfix] Model : speaker channel audio_sources["channels"] -> 2 に固定 2024-06-19 17:34:57 +09:00
misyaguziya e132883103 👍️[Update] installer : remove README.txt 2024-06-19 17:25:01 +09:00
misyaguziya bf77195210 Merge branch 'whisper_param' into develop 2024-06-18 23:46:32 +09:00
misyaguziya 01f73bc1f8 👍️[Update] Model : whisperの設定項目を追加(avg_logprob, no_speech_prob) 2024-06-18 23:46:04 +09:00
Sakamoto Shiina 5178e5aeba Merge branch 'about_vrct' into develop 2024-06-14 14:31:40 +09:00
Sakamoto Shiina 19c5e6b0a7 [Update] Add localization section. and tidy up a bit. 2024-06-14 14:29:16 +09:00
Sakamoto Shiina cc34301e7f Merge branch 'add_info_localization' into develop 2024-06-14 12:51:27 +09:00
Sakamoto Shiina 3d785a62b9 [Update] add info for localization users. 2024-06-14 12:51:12 +09:00
Sakamoto Shiina 7ced3652e5 Merge branch 'remove_readme_txt' into develop 2024-06-14 12:16:18 +09:00
Sakamoto Shiina 3cdc12b6d0 [Remove] README.txt that it no longer in use 2024-06-14 12:16:03 +09:00
Sakamoto Shiina 2110c8ef29 Merge branch 'fix_locales' into develop 2024-06-14 12:13:14 +09:00
Sakamoto Shiina 32195ef778 [Update] README.zh-Hant.md: 言語識別子変更 追加修正 2024-06-14 12:10:59 +09:00
Sakamoto Shiina 099a57cb23 Merge branch 'develop' into fix_locales 2024-06-14 12:10:22 +09:00
Sakamoto Shiina af0da7ca88 Merge branch 'add_ui_language' into develop
# Conflicts:
#	README.ja.md
#	README.md
2024-06-14 12:07:17 +09:00
Sakamoto Shiina d94fc06236 [Update] zh->zh-Hant 正體中文->繁體中文 2024-06-13 18:04:48 +09:00
Sakamoto Shiina 7e67a1f5a1 Merge branch 'fix_locales' into develop 2024-06-10 11:10:21 +09:00
Sakamoto Shiina 064dab994c [Update] Readme系の言語識別子を、国コードから言語コードに変更。jp->ja kr->ko 2024-06-10 11:05:13 +09:00
Sakamoto Shiina 85f64aa656 [Remove] locales.yml that is no longer in use. 2024-06-10 10:57:07 +09:00
Flizzy 9393797e80 feat: Add Traditional Chinese README 2024-06-06 18:53:45 +08:00
Flizzy 0f8f4b8952 feat: UI Support Traditional Chinese 2024-06-06 18:53:32 +08:00
misyaguziya eef9a2ae6c Merge branch 'AddLang' into develop 2024-06-05 18:56:34 +09:00
misyaguziya 70efd85d85 👍️[Update] Model : 以下のリンクに基づき、文字起こしの言語を追加
https://cloud.google.com/speech-to-text/docs/speech-to-text-supported-languages?hl=ja
2024-06-05 18:48:07 +09:00
Sakamoto Shiina de27ae8302 Merge branch 'about_vrct' into develop 2024-06-04 23:39:11 +09:00
Sakamoto Shiina f40928dc0e [Update] About VRCT: add a special thanks member. 2024-06-04 23:38:26 +09:00
misyaguziya fe01d57457 Merge branch 'bugfix_Estonian' into develop 2024-06-04 23:01:38 +09:00
misyaguziya f2a602cc81 🐛[bugfix] Model : Add Estonian in transcription_languages.py 2024-06-04 23:01:30 +09:00
misyaguziya 7d96366924 Merge branch 'bugfix_translators' into develop 2024-05-30 18:28:06 +09:00
misyaguziya 57acfae45d 🐛[bugfix] Model : translatorsのpackageを更新
`RuntimeError: input(): lost sys.stdin`を回避する処理を追加
2024-05-30 18:27:41 +09:00
misyaguziya 5c5962df50 Merge branch 'bugfix_typo' into develop 2024-05-30 15:33:11 +09:00
misyaguziya 6a83c41198 🐛[bugfix] Typo : phase -> phrase 2024-05-30 15:32:54 +09:00
misyaguziya d80832fe34 Merge branch 'bugfix_AudioDevice' into develop 2024-05-27 02:16:37 +09:00
misyaguziya 9b086e711d 🐛[bugfix] Model : getInputDefaultDeviceを取得するように修正 2024-05-27 02:16:24 +09:00
misyaguziya 6366dc1c82 Merge branch 'bugfix_restart' into develop 2024-05-23 23:44:24 +09:00
misyaguziya 88ae7fb857 🐛[bugfix] Model : restart/update時にpathにスペースがある場合に処理が失敗する問題を修正 2024-05-23 23:44:10 +09:00
misyaguziya 8587c009ee Merge branch 'develop' 2024-05-23 16:57:13 +09:00
misyaguziya 171fd05ecb Merge branch 'version' into develop 2024-05-23 16:28:28 +09:00
misyaguziya 0265211149 👍️[Update] version 2.2.3 -> 2.2.4 2024-05-23 16:28:08 +09:00
Sakamoto Shiina 035a13acff Merge branch 'change_overlay_xyz_settings' into develop 2024-05-22 22:05:10 +09:00
Sakamoto Shiina 49a11ce0df [Update] Quick Settings(Overlay): adjust overlay XYZ settings to much narrow range, cuz it's hard to adjust by VR user. 2024-05-22 22:02:38 +09:00
Sakamoto Shiina de8674284f Merge branch 'bugfix' into develop 2024-05-20 10:51:19 +09:00
Sakamoto Shiina 89c32dfc57 Merge branch 'about_vrct' into develop 2024-05-20 10:49:40 +09:00
Sakamoto Shiina 2d90a847cc [UPdate] About VRCT: Add some poster showcased worlds. and add page number 4. 2024-05-20 10:48:10 +09:00
misyaguziya c29ac5da5c 🐛[bugfix] Model : 以下の条件の場合にMic文字起こし終了時に状態を復帰出来ない問題を修正
VRChat側のマイクはミュートのまま、vrc mic mute syncオンの時で、
Voice2Chatboxオンにして、オフにしたらそのままメイン画面disabledのまま帰ってこない
2024-05-20 10:13:47 +09:00
misyaguziya e38987d916 🐛[bugfix] Model : 一部実装漏れを修正
- translation成功時に文字列が帰ってることを検証する処理に変更
- ミュート同期ボタンON/OFF時にマイク文字起こしの状態を変更する処理を追加
2024-05-18 20:57:29 +09:00
Sakamoto Shiina 67ba3f62e2 Merge branch 'ui_bugfix' into develop 2024-05-17 15:46:09 +09:00
Sakamoto Shiina 1ca9c6d936 [bugfix] Splash Window: モデルダウンロード時に、応答なしになる問題を修正。 2024-05-17 15:43:34 +09:00
misyaguziya 2f619d9114 Merge branch 'overlay_rotation' into develop 2024-05-17 09:31:02 +09:00
Sakamoto Shiina f4be54d1d1 Merge branch 'about_vrct' into develop 2024-05-17 09:28:39 +09:00
misyaguziya bd6ea56627 👍️[Update] Model/View : rename "depth" -> " z_pos" 2024-05-15 16:25:19 +09:00
Sakamoto Shiina 811734c50b [Update] About VRCT: update some poster showcases worlds. 2024-05-15 15:19:33 +09:00
Sakamoto Shiina 46a7880ba9 Merge branch 'overlay_rotation' into develop 2024-05-15 14:51:17 +09:00
misyaguziya 818fa307b9 👍️[Update] Model : overlay 右手周りの処理を追加 2024-05-15 14:41:48 +09:00
Sakamoto Shiina 34a372686b [Update] Quick Settings Window: スライダー系の幅が固定されるのを防ぐため、ウィンドウの幅に合わせて可変的に。
Quick Settings Window(Overlay): position, depthの設定範囲に合わせて、0.01単位で設定できるように刻み数を増加。
2024-05-15 14:28:23 +09:00
Sakamoto Shiina 85a1decfb4 [Refactor] controller.py: match case文で、同じ処理のものをまとめた。 2024-05-15 13:33:22 +09:00
Sakamoto Shiina dd643daa78 [Update] Quick Settings Window(Overlay):
・rotation周り、文言修正、日本語対応。
・初期値に戻すボタンへの対応。
2024-05-15 13:26:05 +09:00
misyaguziya 095eaac420 👍️[Update] Model : overlay 左手周りの処理を追加
- HMD,左手の初期値を追加
- 初期値からの変化量をUIから調整できるように変更
- quaternionは不要なため、削除
2024-05-15 12:58:58 +09:00
misyaguziya 212a3e62d1 👍️[Update] Model : overlay rotation and bind lefthand 2024-05-11 22:05:01 +09:00
Sakamoto Shiina 2e1d0591b7 [Update] Add UI and config: Overlay Rotation X,Y,Z. 2024-05-11 00:40:11 +09:00
misyaguziya ea21b1b644 Merge branch 'develop' of https://github.com/misyaguziya/VRCT into develop 2024-05-10 16:50:49 +09:00
misyaguziya 27f99e01d6 Merge branch 'deepl_pro' into develop 2024-05-10 16:50:06 +09:00
misyaguziya 943f1178f9 Merge branch 'traslate_mask' into develop 2024-05-10 16:49:27 +09:00
misyaguziya cdea680f08 👍️[Update] Model : translation モデルロード時のマスク処理を追加
モデルデータをgcするコードを削除
重複する処理を関数化
2024-05-10 16:44:36 +09:00
Sakamoto Shiina 6a589a43c4 Merge branch 'view' into develop 2024-05-09 23:51:45 +09:00
Sakamoto Shiina 1aeeda4828 [Update] About VRCT: adjust bottom padding for About VRCT as an exception. 2024-05-09 21:54:35 +09:00
misyaguziya bbde617414 🐛[bugfix] Model : 翻訳処理のマスク処理 2024-05-09 20:46:38 +09:00
Sakamoto Shiina 7339cf10a3 [Refactor/Update] Quick Settings Window(Overlay, VRC Mic Mute Sync): Apply UI Scaling.
and remove the codes that is no longer in use.
2024-05-09 19:29:26 +09:00
misyaguziya 23c2fa1119 🐛[bugfix] Model : 翻訳処理のマスク処理
まだ一部バグあり
2024-05-09 11:51:24 +09:00
Sakamoto Shiina 4c02a75221 Merge branch 'view' into develop 2024-05-09 07:08:36 +09:00
Sakamoto Shiina 6bd2ad4133 [Update] 文言修正、イースターエッグ。 2024-05-09 07:07:33 +09:00
Sakamoto Shiina fa87946d4c [bugfix] Config Window: 設定項目変更時に、黒カバーが前に出てきてしまうのを無理やり修正。
テキストボックス上部、ステータス変更関数setStateOverlaySmallLogとsetStateVrcMicMuteSync実行時。
2024-05-09 07:03:15 +09:00
Sakamoto Shiina e76d42172d [Update/bugfix] 文言修正。インデントミスで日本語対応できていなかったのを修正。 2024-05-09 07:00:14 +09:00
Sakamoto Shiina 37cab3fe3c [Update] Main Window: VRC Mic Mute Sync, Overlay. Quick Settings. add Japanese and light theme. 2024-05-09 06:43:08 +09:00
Sakamoto Shiina d1f4688b5c [Update] Main Window: Add VRC Mic Mute Sync quick settings. and the place where above on textbox is now show the state which whether it's enabled or disabled. 2024-05-09 06:29:47 +09:00
Sakamoto Shiina 4b9255d3dd Merge branch 'remove_textbox_tabs' into develop 2024-05-08 17:17:24 +09:00
Sakamoto Shiina f24127f631 [Update] Main Window: Remove textbox tabs that seems to be not used and for make space. 2024-05-08 17:14:07 +09:00
misyaguziya bc7a763487 Merge branch 'osc' into develop 2024-05-08 12:15:51 +09:00
misyaguziya 79054b4472 🐛[bugfix] Model : OSC 不要なthreadの処理の終了処理を追加 2024-05-08 12:15:38 +09:00
misyaguziya be629f519a Merge branch 'overlay' into develop 2024-05-08 11:45:41 +09:00
misyaguziya 32ad466d9d 🐛[bugfix] Model : マージに合わせてoverlayの処理を修正
- overlay off時にParameterを変更できるように修正
- overlay終了処理時を修正
- Easter Eggのコメントアウトを削除
2024-05-08 11:45:28 +09:00
misyaguziya 457c4a48f9 Merge branch 'overlay_reversion' into develop
# Conflicts:
#	model.py
2024-05-08 11:07:22 +09:00
misyaguziya f449b4ebf1 🐛[bugfix] Model : overlay_image 生成する画像サイズを戻した 2024-05-08 11:01:30 +09:00
misyaguziya b78c4b8d4d Merge branch 'oscVoiceMute' into develop
# Conflicts:
#	model.py
2024-05-08 09:51:06 +09:00
misyaguziya 7535565009 🐛[bugfix] Model : mute同期処理をメイン画面からの操作で変更できるように修正 2024-05-08 02:51:15 +09:00
misyaguziya 835f4739fd 🐛[bugfix] Model : mute同期が動作していない問題を修正
- 起動時にmuteselfしているかどうか監視するように変更
- VRChatが起動指定な場合にgetOSCParameterValueがエラーになる問題を修正
- config移行の状態遷移によるmute状態の初期化問題を修正
2024-05-08 01:29:02 +09:00
misyaguziya 6ace1ed524 🐛[bugfix] Model : overlay リファクタリング
- settingsのkey名を変更
- updateOpacityのちらつきを修正
2024-05-07 18:08:01 +09:00
misyaguziya ade7ae2649 🗑️[Remove] Model : テストコードを削除 2024-05-07 18:05:06 +09:00
misyaguziya db56019747 👍️[Update] Model : rename overlay_2.py -> overlay.py 2024-05-07 16:43:05 +09:00
misyaguziya 28073fbd81 🚧 [WIP/TEST] Model : Overlay リファクタリング 2024-05-07 16:40:45 +09:00
misyaguziya 564167a980 🗑️[Remove] Model : テストコードを削除 2024-05-07 16:39:00 +09:00
misyaguziya d7f48d0366 🐛[bugfix] Model : callback_energyを使用する場合の条件を追加 2024-05-07 15:20:57 +09:00
misyaguziya 0e4ad7eec3 🚧[WIP/TEST] Model : packageの処理に合わせて修正 2024-05-07 15:05:43 +09:00
misyaguziya 8b866e1577 🚧[WIP/TEST] Model : mute同期処理で文字起こしの同期をQueueからpause/resumeの関数に変更 2024-05-07 10:15:38 +09:00
misyaguziya 1401562ddb 🗑️[Remove] Model : 不要なコード(createDictOSCReceiveParameters)を削除 2024-05-07 10:13:10 +09:00
misyaguziya 9241a7cf1f 🚧[WIP/TEST] Model : mute同期でOFF時にキューに入っているものは文字起こしを出力するように変更 2024-05-06 18:37:13 +09:00
misyaguziya 7f6c9a53ac 🐛[bugfix] Model : OSC mute同期機能を修正 2024-05-06 17:30:09 +09:00
misyaguziya b926fb856c Merge branch 'oscVoiceMute' of https://github.com/misyaguziya/VRCT into oscVoiceMute
# Conflicts:
#	model.py
2024-05-06 17:01:12 +09:00
misyaguziya 047a3a35bf 👍️[Update] Model : OSC Parameterを能動的に取得する処理を追加/mute同期機能を修正 2024-05-06 16:57:15 +09:00
misyaguziya 7c07949f4b Merge branch 'bugfix_speakerdevice' into develop 2024-05-06 03:21:30 +09:00
misyaguziya 39faa8707f 👍️[Update] Model : custom_speech_recognitionのversionを更新 2024-05-06 03:21:02 +09:00
misyaguziya 6552dc4aa8 🐛[bugfix] Model: ThreadFncの処理を修正 2024-05-06 02:16:45 +09:00
misyaguziya 5566ebe401 🐛[bugfix] Model: mic/speakerの音声入力処理のThreadの処理を修正(energyはまだ) 2024-05-06 01:29:44 +09:00
misyaguziya 3ea40e1bd3 🐛[bugfix] Model: mic/speakerの音声入力処理をOFF時に強制終了する処理が不要になったため、削除 2024-05-05 02:46:15 +09:00
misyaguziya 313682cbbd 🚧 [WIP/TEST] Model : Overlayの処理を起動したらしっぱなしにするように変更 2024-05-04 17:25:39 +09:00
misyaguziya a5962f699b 🚧 [WIP/TEST] Model : Overlayの処理にマスクを追加 2024-05-04 16:31:36 +09:00
misyaguziya 0577756dc1 🚧 [WIP/TEST] Model : Overlayの処理を最小限までに削除 2024-05-03 23:05:42 +09:00
misyaguziya 6f318a8b05 🚧 [WIP/TEST] Model : Overlayの処理で画像生成を削除 2024-05-03 17:14:17 +09:00
misyaguziya b97273eace 🚧 [WIP/TEST] Model : Overlayの処理で画像を固定 2024-05-03 01:04:39 +09:00
misyaguziya 0eba5443b4 🚧 [WIP/TEST] Model : Overlayの処理からasyncを削除 2024-05-02 18:24:09 +09:00
misyaguziya ee8c25dea9 🚧 [WIP/TEST] Model : Overlayの処理を逐次処理から定期処理に変更 2024-05-02 14:57:45 +09:00
Sakamoto Shiina bd0a0e4592 [Chore] 変数名変更: config.ENABLE_MUTE_DETECT -> config.ENABLE_VRC_MIC_MUTE_SYNC 2024-05-02 14:25:21 +09:00
Sakamoto Shiina cc7e21a609 [Update] Config Window: Add switch function. VRChat Mic Mute Sync. 2024-05-01 20:05:33 +09:00
misyaguziya 3aa39bd1ee [Unmask] overlayの処理を戻した 2024-05-01 15:02:37 +09:00
misyaguziya d5c98aabe4 Merge branch 'bugfix_speakerdevice' into develop 2024-05-01 14:42:09 +09:00
misyaguziya e9afde0be4 🐛[bugfix] Model: mic/speakerの音声入力処理をOFF時に強制終了するように変更 2024-05-01 03:44:33 +09:00
misyaguziya adf0272038 🐛[bugfix] Model : Translation DeepL Pro版で認証できない問題を修正 2024-04-30 00:51:30 +09:00
Sakamoto Shiina 726221df5a Merge branch 'overlay_unmask' into develop 2024-04-29 23:48:54 +09:00
Sakamoto Shiina 63dd15c10e [Unmask] Overlay用のUIと、configを戻した。 2024-04-29 23:36:25 +09:00
misyaguziya e9cb9629ef Merge branch 'develop' 2024-04-28 17:47:45 +09:00
misyaguziya 74f311fb2a Merge branch 'version' into develop 2024-04-28 17:46:37 +09:00
misyaguziya 29d3257dd3 👍[Update] Version : 2.2.2 -> 2.2.3 2024-04-28 17:46:24 +09:00
Sakamoto Shiina 9aad53d753 Merge branch 'fix_overlay_mask' into develop 2024-04-28 17:41:04 +09:00
Sakamoto Shiina 3dc0a3aa41 [Mask] XSoverlayの項目がOthersタブから消えていたのを復元。 2024-04-28 17:40:05 +09:00
Sakamoto Shiina 342ea45951 Merge branch 'fix_overlay_mask' into develop 2024-04-28 17:33:48 +09:00
Sakamoto Shiina 3d5985de73 [Mask] fix. コンフリクト修正で失敗したので手作業で修正。 2024-04-28 17:31:45 +09:00
Sakamoto Shiina 64741a966c Merge branch 'overlay_mask' into develop
# Conflicts:
#	view.py
#	vrct_gui/main_window/createMainWindowWidgets.py
2024-04-28 17:20:02 +09:00
Sakamoto Shiina 55d79ae007 Merge branch 'overlay' into develop 2024-04-28 17:12:51 +09:00
misyaguziya 773e0aca60 🐛[bugfix] コミットハッシュ : c63e9a0668 の修正案にフリーズする問題があるため元に戻す。
オーディオデバイスが無音の場合に処理が中でスタックする。
この問題はspeech_recognition packageで修正予定
2024-04-28 17:02:33 +09:00
Sakamoto Shiina 799e649e51 [Mask] Config, View, Controller: overlayとイースターエッグの処理やUIをマスク。 2024-04-28 15:41:41 +09:00
misyaguziya a4a73c0c9e 🗑️ [Mask] Model: 処理が不安定なためoverlayの処理を一時的にMask 2024-04-28 15:12:06 +09:00
misyaguziya d3bc434d38 👍️[Update] Model : overlay OFF時にoverlayの表示を消す処理を追加 2024-04-28 14:59:31 +09:00
misyaguziya 61b7084939 Merge branch 'overlay' into develop 2024-04-27 09:45:43 +09:00
misyaguziya 61ec79a39d 👍️[Update] Model : 不要なコメントを削除 2024-04-27 09:45:32 +09:00
misyaguziya a8ab055147 Merge branch 'overlay' into develop 2024-04-27 05:50:27 +09:00
misyaguziya dcdcf1aeea 👍️[Update] Model : steamVRが起動してる最中のみoverlayが動作するように修正 2024-04-27 05:45:45 +09:00
Sakamoto Shiina 587edf6ae1 Merge branch 'view' into develop 2024-04-27 01:55:33 +09:00
Sakamoto Shiina 10f498daf2 [Update/bugfix] Config Window: VR Tab. Overlay詳細設定として、メイン画面から開けるOverlay Settings Windowを開くボタンを追加。
XSOverlay項目をVR Tabに移動。それにともない「VR限定」の文字を削除
Overlay Settings、初期値に戻すボタン右側の余計な余白を削除
2024-04-27 01:52:42 +09:00
Sakamoto Shiina fc5ba74a83 [Update] Overlay Settings:
一部日本語対応。
それぞれの項目が広すぎと感じたので少し狭く。
2024-04-27 01:12:49 +09:00
Sakamoto Shiina a43f089adb [Update] Overlay Settings:
初期値に戻すボタンと機能を追加。
y_posの設定可能範囲を増やした。
padding調整など。
2024-04-27 00:48:02 +09:00
Sakamoto Shiina 0026102f45 [Update] Overlay Settings:
有効無効スイッチ追加。
VR Settingsではなく、Overlay Settingsに。
Lightテーマに一部対応。
2024-04-26 22:34:19 +09:00
misyaguziya f508dd6114 👍️[Update] Model : steamVRが起動してるかどうかの確認処理を修正 2024-04-26 17:31:00 +09:00
Sakamoto Shiina 2feb1a6fba [Update] About VRCT: add link that poster-exhibition-contact-us. 2024-04-26 12:01:05 +09:00
Sakamoto Shiina e20fbfa139 Merge branch 'about_vrct' into develop 2024-04-26 11:32:03 +09:00
Sakamoto Shiina ebca8116e3 [bugfix] About VRCT: 一部リンクが開けなかったのを修正。
openWebPage_AboutVrct関数にarg引数を入れたことにより、arg引数なしで呼ばれた時にエラーが出ていた。
2024-04-26 11:28:55 +09:00
Sakamoto Shiina 9bd3e71477 [Update] About VRCT: 画像更新.
・The Developer m's software新ロゴに伴いデザイン変更。
・Special Thanks メンバー追加。
2024-04-25 20:40:28 +09:00
Sakamoto Shiina e5ec5ac5dd [Chore] About VRCT: 位置の微調整。 2024-04-25 20:07:17 +09:00
Sakamoto Shiina bae638b7d7 [Update] About VRCT: Poster Showcase. 起動毎に、最初に表示されるワールド名部分のページをランダムに。 2024-04-25 18:36:10 +09:00
Sakamoto Shiina 44cba3f3ae [Update/Refactor] About VRCT: Poster Showcase. ワールド名追加や、ハイパーリンクの設定(Xの投稿)。
リンクがまだ(投稿がまだ)のものは、アイコンが暗く、クリックも出来ないように。
項目が増えたことにより、ページネーションの動きを新しく。
2024-04-25 17:29:22 +09:00
Sakamoto Shiina 14cde02b86 Merge branch 'overlay' into develop 2024-04-25 11:48:07 +09:00
Sakamoto Shiina 6ec46e42ea [Update] Overlay: 画質向上。(基準の4倍で画像生成するように) 2024-04-25 11:46:55 +09:00
misygauziya d1cd96cca9 Merge branch 'overlay_transparency' into develop 2024-04-25 11:14:01 +09:00
misygauziya 6d93ca0f42 🐛[bugfix] Model : overlayの不透明度が追従しない問題の対策2 2024-04-25 11:05:53 +09:00
misygauziya d3920e730e 🐛[bugfix] Model : overlayの不透明度が追従しない問題の対策1 2024-04-25 10:47:21 +09:00
misygauziya fc39dee2e0 🚧[WIP/TEST] Model : overlayの透過処理をsetTransparencyで実装 2024-04-25 00:01:39 +09:00
Sakamoto Shiina da83041fca [Chore] About VRCT: ポスターとポスターAuthorの間、余白詰め。
ポスターと漫画のアイコン追加なデザイン変更に伴い、隙間が空きすぎて見えるようになったので。
2024-04-24 23:30:28 +09:00
Sakamoto Shiina c70d86e1c7 [bugfix] About VRCT: ポスター切替時、制作者翻訳者部分の高さが変わってデザインが崩れるのを、無理やり修正。 2024-04-24 23:01:13 +09:00
Sakamoto Shiina c808cb91a5 [Update] About VRCT: ポスター制作者、翻訳者を多言語対応、ポスターと漫画の切り替えにも対応。 2024-04-24 22:11:18 +09:00
Sakamoto Shiina 7655b3e0ee [Refactor] About VRCT: ポスター画像切替関数をリファクタリング 2024-04-24 20:49:27 +09:00
Sakamoto Shiina 12052d796a [Update] About VRCT: add poster(ko) and mangas. 2024-04-24 18:49:19 +09:00
misygauziya 721ee76923 🐛[bugfix] Model : overlayのui_scalingの処理を修正 2024-04-24 17:42:01 +09:00
misygauziya d5d5a4a9d7 🐛[bugfix] Model : overlayのinitの処理を修正 2024-04-24 16:52:52 +09:00
misygauziya 763f8c655c 🐛[bugfix] Model : overlayのposの設定処理を修正 2024-04-24 16:32:58 +09:00
misygauziya 143107b7f9 👍️[Update] Model : overlayのUIの動作に連動するようにCallbackを設定(未検証) 2024-04-24 16:09:24 +09:00
Sakamoto Shiina 5b38db9557 [Update] Main Window, Quick Settings Window: add VR Settings and it'll open the settings window that is for Overlay settings. 2024-04-23 16:31:43 +09:00
Sakamoto Shiina e74140dc08 Merge branch 'speaker2Chatbox_pass' into develop 2024-04-21 15:47:45 +09:00
Sakamoto Shiina b8d7358ebd [bugfix] Config.py: Change the password that enable speaker2Chatbox function. 2024-04-21 15:44:52 +09:00
Sakamoto Shiina 62d01d4168 Merge branch 'view' into develop
# Conflicts:
#	vrct_gui/splash_window/SplashWindow.py
2024-04-21 10:26:48 +09:00
ShiinaSakamoto 352c87da5c Merge pull request #9 from soumt-r/add_korean_ui_language
Add korean UI language
2024-04-21 10:14:40 +09:00
misyaguziya 0f4fe7c350 🚧[WIP/TEST] Model : 変数名の修正
関数の処理が一部変だったので修正
2024-04-19 15:13:19 +09:00
Sakamoto Shiina d715f0b6d6 [Update] Config Window: Add VR Tab. Add Item, Enable OpenVR Switch. 2024-04-19 08:59:31 +09:00
Sakamoto Shiina 136feb768e Merge branch 'updateTask' into develop 2024-04-18 13:56:35 +09:00
Sakamoto Shiina 68cdbe1684 [Update] 起動時スプラッシュ画面をタスクバーに表示。
※起動時間が長いため、タスクバーに表示することにより、他の画面が覆いかぶさったとしても、いつでも手間に表示できるように。
(ユーザーに、今何を行っているのかをタスクバーから見えるようにしたかった。)
2024-04-18 13:32:24 +09:00
Sakamoto Shiina e19cc9bccf [Update] アップデート中画面をタスクバーなどからウィンドウを閉じた時、メインプロセスも終了するように。
※アプデ中の終了(中断)操作は、ユーザーの自己責任とする。
2024-04-18 13:16:59 +09:00
Soumt 54dddd29ec Merge branch 'add_korean_ui_language' of https://github.com/soumt-r/VRCT into add_korean_ui_language 2024-04-18 12:45:00 +09:00
Soumt b6b04a99a0 chore: Korean Locale Update 2024-04-18 12:44:56 +09:00
Sakamoto Shiina 680ca8a955 [Update] アップデート時専用の表示を追加。※失敗した時の処理など、改良の余地あり。 2024-04-17 15:44:14 +09:00
misyaguziya 192b48accc 👍️[Update] Model : オーバーレイについて表記を修正 2024-04-17 11:02:51 +09:00
Sakamoto Shiina 3413f6e498 [Update] Add "tmp/" to gitignore. 2024-04-17 08:31:06 +09:00
misyaguziya 497de5bcff 🗑️[Remove] Model : OSC Receiveについて不要なコードを削除 2024-04-16 21:46:27 +09:00
misyaguziya 1c19236d62 👍️[Update] Model : VRChatのmute/voiceを検出し文字起こしを停止する機能を追加 2024-04-16 21:44:26 +09:00
misyaguziya 77f76514c4 Merge branch 'detectRepeatMessage' into develop 2024-04-16 10:24:59 +09:00
misyaguziya ca6e037086 Merge branch 'overlay' into develop
# Conflicts:
#	requirements.txt
2024-04-16 10:24:05 +09:00
misyaguziya 2e2c237a26 🚧[WIP/TEST] Model : VRChatでMUTEにした場合にマイク文字起こしをしない機能を実装(途中) 2024-04-16 10:21:55 +09:00
misyaguziya 46fae4da0c 👍️[Update] Model : add detect repeat message function
- detectRepeatSendMessage
- detectRepeatReceiveMessage
2024-04-15 22:06:00 +09:00
misyaguziya 058ae48798 🐛[bugfix] Model : steamVRが起動していない場合にOverlayが動作をしないように修正 2024-04-14 22:31:03 +09:00
Sakamoto Shiina cae1406d2b [Update] Easter Eggとして、メイン画面ロゴ(コンパクトモード未対応)を3回クリックするとEaster Egg機能がオンになるように。
オフに戻すには再起動で。
※save jsonはコメントアウトしています。(今後、本実装する時に値が増えたり何かしら名前が変更になる可能性を考えて、ユーザー側にデータを保存したくないため)
2024-04-14 21:46:42 +09:00
misyaguziya f0bcc56483 🐛[bugfix] Model : build時にfontsフォルダを含めるように修正 2024-04-14 20:58:16 +09:00
misyaguziya 8faf0c27e1 🐛[bugfix] Model : build時にopenvrがincludeされないため修正 2024-04-14 15:30:15 +09:00
misyaguziya 935ec22c4b 🐛[bugfix] Model : overlayのimg/fontのパスを修正 2024-04-14 15:25:10 +09:00
misyaguziya 2b9717535b 🐛[bugfix] Model : updateの処理をthreadFncからThreadの処理に変更 2024-04-14 14:38:59 +09:00
Sakamoto Shiina fe1c0a45d7 [WIP/TEST] アプデ時にプログレスバーを表示。※WIP 注意事項あり
・他のウィンドウにフォーカスを当てると消えます。(後ろで処理は動いている)
・ダークモードのみの対応です。
・とりあえずの表示です。downloadedとextractedで2回同じものが表示されます。
2024-04-14 07:35:34 +09:00
Sakamoto Shiina e51fd602bf [bugfix] controller.py: 引数名が違うことによるエラーの修正。fnc->func 2024-04-14 06:08:43 +09:00
misyaguziya ce0ca2844b [Update] Model : Update処理をthreads処理に変更
- fncにプログレスの数値情報を設定できるように追加
- スプラッシュUIから処理が抜けるのでUIの修正が必要
2024-04-13 18:08:14 +09:00
misyaguziya ceb3267821 👍️[Update] Model : OverlayのUIにsakuraを追加 2024-04-11 23:36:04 +09:00
ShiinaSakamoto a6554b604c Merge pull request #8 from soumt-r/add_korean_ui_language
feat: add korean string
2024-04-11 19:12:12 +09:00
Soumt cd9b631d8c feat: add korean string 2024-04-11 18:04:34 +09:00
Sakamoto Shiina 8b3e3cb7b0 [Update] 文言修正とローカライズ韓国語準備
※アプデ時、説明文に「再起動」としていたのを「アプリを再起動」に変更。PCを再起動すると勘違いするため。
2024-04-11 16:54:37 +09:00
misyaguziya 0a80ba4e0d Merge branch 'speakerDevice' into develop 2024-04-09 17:28:22 +09:00
misyaguziya 7c2e966784 👍️[Update] Model : デバイスがない場合の処理を追加 2024-04-09 17:27:59 +09:00
misyaguziya 1c9ddfddee Merge branch 'speakerDevice' into develop 2024-04-08 23:57:55 +09:00
misyaguziya 2f7cdbb670 👍️[Update] Model : デバイスの重複を削除する処理を追加 2024-04-08 23:56:20 +09:00
misyaguziya c63e9a0668 🚧[WIP/TEST] Model : 文字起こし処理切替時のフリーズ問題の修正案 2024-04-08 22:53:05 +09:00
Sakamoto Shiina 406d846b6b [Update] Config Window: Transcription (Speaker) Tab. Add Select Speaker Devices. 2024-04-07 11:56:39 +09:00
Sakamoto Shiina 84c3904de8 [bugfix] fixed default active tab in config window.
I forgot to change back to the code that is supposed to.
2024-04-06 22:05:46 +09:00
Sakamoto Shiina a2949e60c4 Merge branch 'add_ui_about_vrct_page' into develop 2024-04-06 22:00:54 +09:00
Sakamoto Shiina 1b6fa4c3e8 [Update] Config Window: Add About VRCT Tab. This is The Credit Page.
*The button that is supposed to open the link is not working yet.
2024-04-06 21:53:29 +09:00
misyaguziya a9d0ca531e 🐛[bugfix] Model : SpeakerDeviceの取得処理を修正 2024-04-04 00:31:56 +09:00
misyaguziya e61cbd00aa 🐛[bugfix] Model : remove print 2024-04-03 18:06:58 +09:00
misyaguziya 0d7741a427 👍️[Update] Model : Add Select Speaker Devices 2024-04-03 18:01:27 +09:00
Sakamoto Shiina 3916144723 [Update] requirements.txt: ctranslate2とfaster-whisperを最新版に。
理由:
The conflict is caused by:
    The user requested ctranslate2==3.24.0
    faster-whisper 0.10.0 depends on ctranslate2<5 and >=4.0
2024-03-31 16:42:31 +09:00
Sakamoto Shiina 6bba5acd6a Merge branch 'develop' 2024-03-31 13:53:52 +09:00
Sakamoto Shiina 5e757f81dc Merge branch 'bugfix_Ctranslate2_weights' into develop 2024-03-31 13:51:40 +09:00
Sakamoto Shiina c160b1a13d 👍[Update/Hotfix] Version : 2.2.1 -> 2.2.2 2024-03-31 13:51:12 +09:00
misyaguziya 766323bc31 🐛[bugfix] Model : weightのリンクが消失したため、別リンクをホストするように修正 2024-03-31 12:57:05 +09:00
misyaguziya 34c81cec18 👍️[Update] Model : overlay機能を修正
- 画像生成をoverlay_img.pyにまとめた
2024-03-29 23:34:31 +09:00
misyaguziya c3b2f08b9b 👍️[Update] Model : overlayの機能をSpeaker2Logで表示できるように変更 2024-03-27 10:39:24 +09:00
misyaguziya 14bb05ad4e 🚧[WIP/TEST] Model : overlay機能を追加(単独動作のみ) 2024-03-22 02:17:24 +09:00
misyaguziya fc5f9b24c3 Merge branch 'master' into develop 2024-03-12 22:43:09 +09:00
misya 24a93d2ab3 Create FUNDING.yml 2024-03-11 20:36:27 +09:00
misyaguziya dddfb4367c Merge branch 'master' of https://github.com/misyaguziya/VRCT 2024-03-11 11:36:35 +09:00
misyaguziya a9bce6458a Merge branch 'develop' 2024-03-11 11:35:40 +09:00
misyaguziya 501defe6f1 Merge branch 'version' into develop 2024-03-11 11:33:22 +09:00
misyaguziya 4d70e18dc1 👍[Update] Version 2.2.0 -> 2.2.1 2024-03-11 11:32:18 +09:00
misyaguziya c5c817a7b7 Merge branch 'develop' 2024-03-11 10:31:48 +09:00
Sakamoto Shiina 5ae5a8717a Merge branch 'view' into develop 2024-03-09 23:57:37 +09:00
Sakamoto Shiina e698aff97a [bugfix] Main Window.Translation Engine Dropdown Menu Window: 指定ミスにより、想定より幅が大きかったのを修正 2024-03-09 23:31:16 +09:00
Sakamoto Shiina 285ff0a7dd Merge branch 'view' into develop 2024-03-09 22:36:53 +09:00
Sakamoto Shiina 6e6cf7183d Merge branch 'bugfix_Chinese' into develop 2024-03-09 22:35:56 +09:00
Sakamoto Shiina 8056e9d668 [bugfix] Config: 起動時のconfig.jsonチェックで、強制的に初期化されていたのを修正。(SELECTED_TAB_YOUR_LANGUAGES, SELECTED_TAB_TARGET_LANGUAGES)
※保存する形式が変わったことが原因
2024-03-09 17:44:22 +09:00
Sakamoto Shiina 4a85823439 [Refactor] View: 言語リストは view以下で表示用は表示用として処理するように。
※controller.pyからview.pyへ言語リストを渡す時、その場で表示用の文字列を作っていたのをview.py内で処理。
2024-03-09 17:15:06 +09:00
misyaguziya cb78942b8d 👍[Update] Model/Veiw/Config : SELECTED_TAB_YOUR_LANGUAGES/SELECTED_TAB_TARGET_LANGUAGESの表現の変更に伴い処理を変更 2024-03-09 01:26:10 +09:00
misyaguziya 7791f371b4 🐛[bugfix] Config : 言語設定のlanguage, countryの表現方法を見直し
見直しに伴い、処理方法を修正
2024-03-08 01:25:54 +09:00
misyaguziya 3703406ff7 🐛[bugfix] Config : 中国語表記変更に伴い、config設定値可能な値が変更されたため既存config.jsonで起動した場合に特定依ってプログラムが起動しない問題を修正2 2024-03-08 00:31:46 +09:00
misyaguziya d0934cd6b0 🐛[bugfix] Config : 中国語表記変更に伴い、config設定値可能な値が変更されたため既存config.jsonで起動した場合に特定依ってプログラムが起動しない問題を修正 2024-03-07 23:50:13 +09:00
misyaguziya 202e459aad 🐛[bugifx] Model: 中国語、繁体字が表示されないず、全部簡体字になってる問題を修正 2024-03-04 17:18:28 +09:00
misyaguziya d0d34fbbd4 Merge branch 'develop' 2024-02-15 23:27:24 +09:00
misyaguziya dc36fb6c2b Merge branch 'version' into develop 2024-02-15 23:26:45 +09:00
misyaguziya c34a6c1c9f 👍[Update] Version : 2.1.1 -> 2.2.0 2024-02-15 23:25:39 +09:00
misyaguziya e91561431a Merge branch 'bugfix_autoupdate' into develop 2024-02-15 23:01:50 +09:00
misyaguziya 42df4f4eef 🐛[bugfix] Controller : Speaker2Chatbox有効時のアップデート通知のマスク処理を削除 2024-02-15 23:01:36 +09:00
Sakamoto Shiina c1437de575 [Update] Config Window: DeepL Auth Key. 認証キー成功時と失敗時に通知として設定画面上に表示。 2024-02-15 11:56:58 +09:00
Sakamoto Shiina 4b8e36794b Merge branch 'view' into develop 2024-02-15 00:09:41 +09:00
Sakamoto Shiina 10a18edd24 [Update] Config Window: Whisperモデル 説明文追加。実際にmedium以上のモデル選択時、使用すら困難なくらい重いので、警告の意味を込めて追加。 2024-02-14 23:29:45 +09:00
Sakamoto Shiina e46603ac4f Merge branch 'view' into develop 2024-02-14 23:09:56 +09:00
Sakamoto Shiina 9e12d43fe0 [Update/bugfix] Config Window: DeepL Auth Key. DeepLアカウントページを開けるボタンを追加。
メイン画面翻訳エンジン選択のボタンを押した時の処理が2回走っていたのを修正。
2024-02-14 23:00:54 +09:00
misyaguziya f0bbffe31d Merge branch 'bugfix_resetButton' into develop 2024-02-14 19:37:21 +09:00
misyaguziya 3a06ee5cf1 🐛[bugfix] Controller : モデルがダウンロードされてい状態で whisper機能を ON -> OFFした場合にリスタートボタンが表示され続けるバグを修正 2024-02-14 19:37:03 +09:00
misyaguziya 420804d9fe Merge branch 'config' into develop 2024-02-14 18:46:33 +09:00
misyaguziya 099b36e1bf 🐛[bugfix] Config : 不要なjsonへの保存処理を削除 2024-02-14 16:08:26 +09:00
Sakamoto Shiina 98c838352b Merge branch 'view' into develop 2024-02-14 11:27:21 +09:00
Sakamoto Shiina e012f92e06 [Update] Config Window: Message Formats. 文言の変更。 2024-02-14 10:57:14 +09:00
misyaguziya 0985363be6 Merge branch 'cashclear_transcript' into develop 2024-02-14 00:22:31 +09:00
misyaguziya d3ea3c2c54 Merge branch 'bugfix_whisper' into develop 2024-02-14 00:22:13 +09:00
misyaguziya 4eb811aac4 🚧[WIP/TEST] Model : 翻訳起動時にモデルをロードするように変更 2024-02-14 00:21:56 +09:00
misyaguziya bc0d2f246b 🚧[WIP/TEST] Model : 文字起こし機能の終了時にキャッシュクリアを追加 2024-02-14 00:00:14 +09:00
misyaguziya 7cdd9d19d7 🚧[WIP/TEST] Model : 文字起こし起動時にエンジンを選択するように変更#2 2024-02-13 23:25:31 +09:00
misyaguziya 07b3c92f1b 🚧[WIP/TEST] Model : 文字起こし起動時にエンジンを選択するように変更 2024-02-13 23:20:14 +09:00
misyaguziya 5a0c6392e0 🐛[bugfix] Controller : whisper不使用時のフラグを追加 2024-02-13 22:23:13 +09:00
Sakamoto Shiina 158b139415 [Chore] view.py register部分 記述の統一 2024-02-13 09:05:47 +09:00
Sakamoto Shiina 34c5a05fda [bugfix] Main Window: 初回起動時のメイン画面サイズを拡大。
CTranslate2実装時に、若干高さが増えたのでその分を追加。
2024-02-13 08:55:55 +09:00
misyaguziya badffc234e Merge branch 'installer' into develop 2024-02-13 00:43:21 +09:00
misyaguziya 8ae5ee4de9 🐛[bugfix] installer : zeroconfがexe作成時に追加されない問題を修正 2024-02-13 00:43:07 +09:00
misyaguziya 0072f2741b Merge branch 'get_energys' into develop 2024-02-12 23:07:41 +09:00
misyaguziya c2715adab7 👍[Update] Model : 文字起こしのENERGY取得処理を一時的にマスク 2024-02-12 23:07:29 +09:00
misyaguziya fe768be48d typo SelectedSpeakeEnergyRecorder -> SelectedSpeakerEnergyRecorder 2024-02-12 22:47:35 +09:00
misyaguziya ed4c0e8942 Merge branch 'weightFile' into develop 2024-02-12 22:42:38 +09:00
misyaguziya c34aac28f6 ✨[Feature] utils : weightフォルダ名をweightsに変更する関数を一時的に追加 2024-02-12 22:29:32 +09:00
Sakamoto Shiina b46a9d5664 Merge branch 'audio_indicator' into develop 2024-02-09 22:50:52 +09:00
misyaguziya d5554487f4 [Update] requirements.txt : install version fix 2024-02-09 22:33:11 +09:00
Sakamoto Shiina 1b44ac995c Merge branch 'speaker2Chatbox' into develop 2024-02-09 20:38:49 +09:00
misyaguziya e08a3ab42d [WIP/TEST] Model : Add energy indicator for speaker 2024-02-09 02:29:49 +09:00
misyaguziya 2857d8f543 [WIP/TEST] Model : Add energy indicator 2024-02-09 02:03:44 +09:00
misyaguziya 2de67e9bb9 Merge branch 'develop' of https://github.com/misyaguziya/VRCT into develop 2024-02-09 00:28:45 +09:00
misyaguziya 4b11ef3499 Merge branch 'OSCQuery' into develop 2024-02-09 00:28:10 +09:00
misyaguziya 45e77aa7a7 👍[Update] Config : Speaker2Chatboxにpassword設定を追加 2024-02-09 00:23:20 +09:00
misyaguziya fe1054212b 👍[Update] Model : OSCQuery Receive処理実装
辞書型をインプットにコールバックで動作するように設定
2024-02-08 22:58:22 +09:00
Sakamoto Shiina 5734bd1fb1 Merge branch 'view' into develop 2024-02-08 10:34:02 +09:00
Sakamoto Shiina c46901802d [Update] Splash Window: モデルダウンロード時に右下に表示される文章を変更。 2024-02-08 10:26:37 +09:00
Sakamoto Shiina c459b97ca3 [Refactor] Config Window: Transcription tab. whisper関係の文言をi18nを使って呼び出す部分、重複した部分が多いのでリファクタリング。 2024-02-08 04:31:27 +09:00
Sakamoto Shiina ea10573a3d [Update/Chore] Config Window: Transcription Tab. Whisper関連の文言追加や変更。
config.pyからの読み込み時に間違った方法で読み込んでいたのを修正。
2024-02-08 02:27:41 +09:00
misyaguziya 52682a5c2e [WIP/TEST] Add OSCQuery 2024-02-07 23:00:51 +09:00
Sakamoto Shiina d4164d7c58 Merge branch 'faster-whisper' into develop 2024-02-07 22:50:26 +09:00
misyaguziya 61a6eb792b [WIP/TEST] distil-wisperを削除/faster-wisperの処理を修正 2024-02-04 02:42:59 +09:00
misyaguziya 7aafce6e2e [WIP/TEST] distil-wisperの処理を追加 2024-02-04 01:03:38 +09:00
misyaguziya 801d948513 [WIP/TEST] Wisperの処理についてUIと内部の処理を接続 2024-02-03 02:35:40 +09:00
Sakamoto Shiina 11c8f6eb4d Merge remote-tracking branch 'origin/faster-whisper' into faster-whisper 2024-02-02 18:13:49 +09:00
Sakamoto Shiina ee5c4c05ce [WIP/TEST] UI: 機能と見た目を繋ぎました。設定画面からいじれます。 2024-02-02 18:08:18 +09:00
misyaguziya 78b8cb5909 🐛[bugfix] install.bat : package version fix 2024-02-02 13:14:56 +09:00
Sakamoto Shiina a22e4b9b91 Merge branch 'add_rollback_sent_message_feature' into develop 2024-02-02 02:59:58 +09:00
Sakamoto Shiina 6d949858b8 [Update/Refactor] Main Window: 送信済メッセージのロールバック機能調整(ロールバック可能なメッセージに、マイクからの入力時を追加)
Redo Undoの履歴保存サイズを設定。理由は、上記の機能使用時もRedo Undoの保存タイミングになるので、使用の際膨大な数になる可能性があるため上限を設定。設定値は今後変更する可能性は全然ある。
2024-02-01 16:16:09 +09:00
Sakamoto Shiina 6fbc2ede3a [Update] Main Window: Message box. 送信したメッセージを、キーボード矢印キー上下で呼び出せるように。 2024-02-01 15:54:22 +09:00
misyaguziya 1de239549f [WIP/TEST] Model : モデルの保存位置の変更
- speakerの文字起こし処理のバグを修正
2024-02-01 15:49:17 +09:00
misyaguziya 7cb8c473d4 [WIP/TEST] Model : largeモデルをダウンロード処理を修正/ enを削除 2024-02-01 13:41:31 +09:00
misyaguziya e4c685d382 [WIP/TEST] Config : USE_RECOGNIZER_FEATURE -> USE_WHISPER_FEATURE 2024-02-01 13:40:24 +09:00
misyaguziya 10b8d115a1 [WIP/TEST] faster-whisper model weight のダウンロード/ベリファイ処理を実装 2024-01-31 22:50:31 +09:00
misyaguziya 9cd1831ecb [WIP/TEST] faster-whisperが最低限動く形で実装
config.jsonで設定変更で実行可能
2024-01-30 18:26:04 +09:00
misyaguziya ba12e39bbc [WIP/TEST] Model : faster-whisperを追加 2024-01-30 18:25:50 +09:00
Sakamoto Shiina 4ae35e51a9 Merge branch 'add_undo_redo_feature' into develop 2024-01-30 16:36:29 +09:00
Sakamoto Shiina 1ba580302a [Update] Main Window: Message Box. Add Undo and Redo feature. 2024-01-30 16:29:14 +09:00
misyaguziya 5e79cb5539 Merge branch 'bugfix_tokenizer' into develop 2024-01-29 23:28:14 +09:00
misyaguziya 82eab0db3c [bugfix] Model : AutoTokenizer.from_pretrainedは非ASCII文字に対応していないため、修正
ユーザー名が非ASCII文字の場合、絶対バスの場合失敗するので相対パスで対応
2024-01-29 23:27:33 +09:00
misyaguziya 86e43371e6 🐛[bugfix] Model : tokenizerをローカルの指定パスに保存するように変更 2024-01-29 16:38:13 +09:00
misyaguziya 564300d07c Merge branch 'develop' 2024-01-28 23:03:21 +09:00
misyaguziya f8fe2053aa Merge branch 'version' into develop 2024-01-28 23:03:02 +09:00
misyaguziya d6e05acaca 👍[Update] : Config : version 2.1.0 -> 2.1.1 2024-01-28 22:48:57 +09:00
misyaguziya 91b2634472 Merge branch 'gitignore' into develop 2024-01-28 22:46:35 +09:00
misyaguziya fad843224a 👍[Update] gitiginore : add *.exe 2024-01-28 22:46:15 +09:00
misyaguziya f20286b43b Merge branch 'bugfix_tqdm' into develop 2024-01-28 07:11:55 +09:00
misyaguziya c784969324 Merge branch 'bugfix_deepl' into develop 2024-01-28 07:11:46 +09:00
misyaguziya 3f40a77b02 🐛[bugfix] Model : DeepL_APIの場合のTargetの言語コードの設定処理を修正 2024-01-28 05:54:08 +09:00
misyaguziya 49b53aee2e 🐛[bugfix] Model : tqdmを削除 2024-01-27 00:28:33 +09:00
misyaguziya ae133891be Merge branch 'develop' 2024-01-26 22:59:08 +09:00
misyaguziya 8ea9d841f0 Merge branch 'version' into develop 2024-01-26 22:57:12 +09:00
misyaguziya 7c4cdbbdf6 👍[Update] Version 2.0.2 -> 2.1.0 2024-01-26 22:54:30 +09:00
Sakamoto Shiina aca1091650 Merge branch 'startup_progress_animation' into develop 2024-01-26 17:14:20 +09:00
Sakamoto Shiina 70ec62e56b Merge remote-tracking branch 'origin/add_korean_ui_language' into develop 2024-01-26 17:09:45 +09:00
Sakamoto Shiina 0a09297cef [Update] Splash Window: 起動時アニメーション追加。weightダウンロード時の表示も若干の調整あり。 2024-01-26 17:03:38 +09:00
ShiinaSakamoto 91685c5a7c Merge pull request #5 from soumt-r/add_korean_ui_language
Locale:韓国語翻訳文追加
2024-01-25 23:47:36 +09:00
Soumt 88a34e456e [Update] Locales : Add some Korean strings 2024-01-23 00:40:45 +09:00
Sakamoto Shiina 204710ea58 [WIP] Prepare for adding korean ui language. 2024-01-22 23:14:46 +09:00
Sakamoto Shiina efb54e730e Merge branch 'view' into develop 2024-01-22 22:57:03 +09:00
Sakamoto Shiina 96c8d071f1 [Chore] Remove the code that is no longer in use. 2024-01-22 22:56:14 +09:00
Sakamoto Shiina 79733f62d5 [Update] Config Window: Add description to DeepL Auth Key Section. 2024-01-22 22:52:12 +09:00
misyaguziya 159ee161b3 Merge branch 'installer' into develop 2024-01-22 22:34:17 +09:00
misyaguziya fd7aeebd25 🐛[bugfix] build.batのコメントアウトを修正 2024-01-22 22:33:57 +09:00
Sakamoto Shiina 127ce6fb3f Merge branch 'change_ctranslate2_model' into develop 2024-01-22 22:28:05 +09:00
Sakamoto Shiina edaca7edc2 [bugfix/refactor] weightタイプ変更処理中は、weightタイプ変更と翻訳機能オンオフwidgetをdisabledに。
理由: weightタイプ変更処理は非同期で、変更処理中に上記widgetを触れるとUIへの変更処理順が意図した順番と変わってしまうため。

その他リファクタリングあり。
2024-01-22 20:33:50 +09:00
misyaguziya f2734e726c 👍[Uodate] installer : Sの指示の元UIを修正 2024-01-22 18:53:17 +09:00
Sakamoto Shiina 46aafa4a4d [Update/Refactor] Main Window: Use translation feature ON/OFF時のwidget調整。
Translation Each Other表示は、翻訳機能使わない場合は必要のない情報なので、その時はSwap Language表示に固定。
2024-01-22 18:20:10 +09:00
misyaguziya 3bdf179a72 👍[Update] Installer : 表示を修正 2024-01-22 03:04:15 +09:00
misyaguziya 6ed71f1a4a 🐛[bugfix] Controller : リスタートボタンの表示タイミングを修正 2024-01-22 01:45:18 +09:00
misyaguziya d965dcf171 WIP on installer: 548668e 👍[Update] Installer : 初回起動時に翻訳モデルのダウンロードの有効無効を追加 2024-01-22 01:34:50 +09:00
misyaguziya b381e2d8ba index on installer: 548668e 👍[Update] Installer : 初回起動時に翻訳モデルのダウンロードの有効無効を追加 2024-01-22 01:34:50 +09:00
Sakamoto Shiina 59079def6a [bugfix] Config Window: 再起動ボタン表示のラベルが表示されない場合があるバグ修正。
weight type変更時のみ発生していた。after関数を使い、表示を若干遅らせることで対処。
2024-01-21 14:49:04 +09:00
Sakamoto Shiina 9208bb3ac3 [Chore] view.py guiのupdate関数処理が被っていたのを修正。※消し忘れでした。 2024-01-21 13:00:16 +09:00
Sakamoto Shiina b0def64cf1 [Update] Main Window Sidebar: 翻訳機能を使わない時は、そもそも翻訳機能のボタンを表示しないように。
音声認識処理中などのボタンdisabled時、スイッチの色をもっと無効感がでるように変更。
2024-01-20 18:13:18 +09:00
misyaguziya 548668e8d4 👍[Update] Installer : 初回起動時に翻訳モデルのダウンロードの有効無効を追加 2024-01-20 15:14:38 +09:00
misyaguziya ef76621a86 Merge branch 'change_ctranslate2_model' of https://github.com/misyaguziya/VRCT into change_ctranslate2_model 2024-01-20 14:20:21 +09:00
misyaguziya 3fc3ae02bb [WIP/TEST] Controller : Resetボタンの表示タイミングを修正 2024-01-20 14:19:14 +09:00
Sakamoto Shiina 9dd10f14a8 [bugfix] Use translation featureオン時、weight切替時などにメイン画面黒いカバーが前に出てきて、そこそこ長い時間とどまっていたのを修正。完全ではないが妥協案です。 2024-01-20 13:30:28 +09:00
Sakamoto Shiina 82293ca88f Merge branch 'view' into develop 2024-01-19 19:13:21 +09:00
misyaguziya f48581dcd8 [WIP/TEST] Controller : モデルのロード処理をスレッドに変更
・モデルの切り替え時や翻訳機能有効時にリスタートボタンの表示タイミングが微妙な為改修の必要あり
2024-01-19 18:27:27 +09:00
Sakamoto Shiina 0ae206f4bd [Chore] img: 画像データ一つだけサイズが大きかったので、48pxのものに差し替え。 2024-01-19 17:48:51 +09:00
Sakamoto Shiina 43b09de167 [Refactor] Config Window: 変数名変更 snake_case to camelCase.
config.py: テスト用の一部print文が間違っていたのを修正。
2024-01-19 17:35:01 +09:00
Sakamoto Shiina 379c5bfdb6 [Chore] 変数名変更: AUTHKEY -> AUTH_KEY のように分けた。 2024-01-19 14:04:11 +09:00
Sakamoto Shiina ee7589ba93 [Update] 文言修正。カッコなど。 2024-01-19 12:21:05 +09:00
misyaguziya a1b53dc2b0 [WIP/TEST] Controller : CTranslate2のモデル変更時処理を実装 2024-01-19 01:27:41 +09:00
misyaguziya a24e77be98 Merge branch 'translation' into develop 2024-01-17 23:22:28 +09:00
misyaguziya c20f27fadf 👍[Update] Model : CTranslate2のダウンロード処理を追加 2024-01-17 23:22:00 +09:00
Sakamoto Shiina 5fb9f5a6ec Merge branch 'ui_ctranslate2' into develop 2024-01-17 18:50:15 +09:00
Sakamoto Shiina d0a9be1b79 [bugfix] 設定画面「翻訳機能を使用する」切替時に、メイン画面カバーが前に出てきてしまうのを無理やり修正。
config.WEIGHT_TYPEがm2m100_418mの時に、view.py側で"Small"と解釈するように一時的な処理をいれています。
2024-01-17 18:45:19 +09:00
Sakamoto Shiina a067bfa733 [Update/Refactor] 設定画面にて「翻訳機能を使用する」のオンオフで、メイン画面翻訳エンジン選択Widgetの表示非表示を切り替え。
「翻訳機能を使用する」オンオフをprocessとして切り出してviewで管理。
2024-01-17 18:17:46 +09:00
Sakamoto Shiina 6e64edb1c6 [Update] 設定画面にて「翻訳機能を使用する」をオフにした時に、メイン画面の翻訳機能をDisabledとしてさわれないようにする処理追加。(その逆も) 2024-01-17 16:52:44 +09:00
Sakamoto Shiina 8b9ffaab1f Merge branch 'ui_ctranslate2' into develop 2024-01-17 14:22:36 +09:00
Sakamoto Shiina 369506013f [Update] Config Window: Translation Tab: add "Use Translation Feature" and "Select Internal Translation Model"
翻訳機能そのものを使うかどうかの設定と、内部翻訳モデルの選択UI追加

・Use Translation Feature からは True or Falseを渡し、config.USE_TRANSLATION_FEATUREへ保存します。
・Select Internal Translation Model からは 文字列 "Small" か "Large" を渡し、config.WEIGHT_TYPEへ保存します。

※機能側実装に合わせて、初回起動時config.WEIGHT_TYPEには"Small"ではなく"m2m100_418m"が入ります。
※それに合わせ、起動時はSmall固定にしています。文字列"Small"対応後、一つ下のコメントアウト部分と入れ替えてください。
2024-01-17 14:12:18 +09:00
misyaguziya 6ac55ee0dd Merge branch 'installer' into develop 2024-01-16 14:28:46 +09:00
misyaguziya e34a4e630b 👍[Update] Installer : installer.nsi内部でconfig.jsonを生成するように変更 2024-01-16 14:28:11 +09:00
Sakamoto Shiina 52b39e92d1 [Chore] remove the deprecated code that I forgot to do it before. 2024-01-16 10:49:14 +09:00
Sakamoto Shiina b9ae2e107a [Update/Refactor] フェールセーフとしてCTranslate2への切り替わり時に、システムログとして表示を変更。ポップアップ表示のコードなどは一旦コメントアウト。
controller.py: 重複していたコードを関数として切り出しなど。
2024-01-16 10:29:26 +09:00
misyaguziya 8dfc702325 👍[Update] Installer : インストール時のUI言語設定を追加 2024-01-15 22:58:02 +09:00
Sakamoto Shiina e3a1cd0a37 Merge branch 'view' into develop 2024-01-15 14:25:04 +09:00
Sakamoto Shiina f2321fcbc4 [Update] Main Window: Selectable Translation Engines.
・UI調整、文言変更。日本語は幅を取りすぎるので、"(デフォルト)"表示を"(Default)"と英語表記に。他の言語との兼ね合いもあるので、今はとりあえずlocalesのymlにそれぞれ直接記述。
・UI Scaling対応
・UI Theme(Light)対応
2024-01-15 12:05:06 +09:00
Sakamoto Shiina 6cd56991c3 [bugfix/chore] Main Window: Selectable Translation Engines.
・ドロップダウンメニューの文言修正。(CTranslate2の表示修正と、デフォルトである旨を追加)
・幅が規定値より超えた時の処理でエラーが発生するのを修正
2024-01-14 19:11:09 +09:00
misyaguziya 22e24514e0 Merge branch 'controller' into develop 2024-01-14 13:14:01 +09:00
misyaguziya d65829175e 🐛[bugfix] Model : deepl authkey 削除時に 翻訳エンジンの"DeepL_API"が削除されない問題を修正 2024-01-14 13:13:43 +09:00
misyaguziya 135f634c36 🐛[bugfix] Controller : DeepL AuthKeyの認証タイミングを修正 2024-01-14 12:08:58 +09:00
misyaguziya 3783a0fff2 🐛[bugfix] Controller : 変数設定間違いを修正 2024-01-14 12:03:05 +09:00
misyaguziya 12bbec013a 👍[Update] Model : 翻訳失敗時の処理を変更 2024-01-14 11:46:37 +09:00
misyaguziya d03330ea03 👍[Update] Controller : UIの翻訳エンジンとControllerを接続 2024-01-14 11:45:19 +09:00
Sakamoto Shiina 7f9faf3676 Merge branch 'add_ui_ctranslate2' into develop 2024-01-13 12:52:31 +09:00
Sakamoto Shiina 8c64b91839 [Update] Main Window: (WIP UI) CTranslate2、内部翻訳機能などの追加により、メイン画面にUI追加。デザインは確定ではなく、UI Scaling未対応などテスト状態です。 2024-01-13 12:37:37 +09:00
misyaguziya 017963bb0b Merge branch 'CTranslate2' into develop 2024-01-12 13:42:41 +09:00
misyaguziya 5e40fde99a 🐛[bugfix] Model : tqdmを削除 2024-01-12 13:33:11 +09:00
misyaguziya bf95873bd0 Merge branch 'CTranslate2' into develop 2024-01-11 22:35:08 +09:00
misyaguziya ae45ff3e44 👍[Update] Model : config.CTRANSLATE2_WEIGHTSが不要な為関連処理を削除 2024-01-11 22:24:35 +09:00
Sakamoto Shiina c6a15dca14 Merge branch 'update_gitignore' into develop 2024-01-10 17:27:22 +09:00
Sakamoto Shiina bf72e417d5 [Update] add some files to gitignore for comfortable development 2024-01-10 17:20:46 +09:00
misyaguziya 5f1eb70516 🐛[bugfix] Model : Cranslate2の不要なコードを削除 2024-01-10 15:37:56 +09:00
misyaguziya 2aaae11e97 Merge branch 'bugfix' into develop 2024-01-09 22:53:00 +09:00
misyaguziya 0a410d2c1a 🐛[bugfix] Conflict : Conflict時の修正漏れを修正 2024-01-09 22:52:41 +09:00
misyaguziya 9e961e5b60 Merge branch 'CTranslate2' into develop
# Conflicts:
#	config.py
#	requirements.txt
2024-01-08 22:36:48 +09:00
misyaguziya 16a1d3a0ec Merge branch 'develop' 2024-01-08 15:34:52 +09:00
Sakamoto Shiina 5df44b4fb8 Merge branch 'add_ui_language_korean' into develop 2024-01-07 21:02:42 +09:00
Sakamoto Shiina 7a4c4b8f76 [Update] Remove the 'Speaker2Chatbox' section (I'm sorry and thank you, rera-san). Adjust the wording for selectable UI language. Add comments to the section 'Speaker2Chatbox' in en.yml. 2024-01-07 20:53:29 +09:00
Soumt 38a8a17b10 [Update] Locales : Add some Korean strings 2024-01-07 16:47:56 +09:00
Sakamoto Shiina 46fa1d2528 Merge branch 'view' into develop 2024-01-07 08:22:52 +09:00
Sakamoto Shiina 24f7823f44 [bugfix] Word Filter: 単語削除時、即座に設定が反映されていなかったのを修正。 2024-01-07 08:19:40 +09:00
Sakamoto Shiina caf9f87db6 [Update] Config Window: add corner radius to image buttons. 2024-01-07 08:17:44 +09:00
Sakamoto Shiina bcb8d9c394 [bugfix] ワードフィルターに単語追加後、EntryBoxが空にならないバグ修正。
idk why, but in CTkEntry and CTkTextbox, the first argument for the delete function is different. Otherwise, it throws an error and doesn't work.
2024-01-07 07:43:08 +09:00
Sakamoto Shiina 1ab619680b Merge branch 'add_pyinstaller_to_requirements' into develop 2024-01-07 06:38:31 +09:00
Sakamoto Shiina 65299a6e94 [Update] Add pyinstaller to requirements.txt. 開発環境のpyinstallerバージョン違いにより、ビルド時の挙動が違っていたためバージョンを指定。固定。 2024-01-07 06:36:58 +09:00
Sakamoto Shiina 05e606ba65 Merge branch 'speaker2Chatbox' into develop 2024-01-07 06:24:04 +09:00
Sakamoto Shiina 01cbb9c30b [Update] config.ENABLE_SPEAKER2CHATBOX True時にはアップデート確認をしないように。Speaker2Chatbox機能使用者が多くなって、管理が大変と思うまでは個別に手動で配布する方針。
また、Speaker2Chatbox機能がONになっているバージョンには、その旨を設定画面バージョン情報部分に表示するように。
2024-01-07 06:19:25 +09:00
Sakamoto Shiina 130d371c44 Merge remote-tracking branch 'origin/develop' into develop 2024-01-07 05:58:27 +09:00
Sakamoto Shiina 534aa02b84 Merge branch 'add_send_message_button' into develop 2024-01-07 05:57:41 +09:00
Sakamoto Shiina 29def026fc [bugfix] Main Window: メッセージ入力欄Disabled時でも、フォーカスを当ててエンターキーを押せば、送信出来てしまっていたのを修正。 2024-01-07 05:49:17 +09:00
Sakamoto Shiina 827e92e6f3 [Update] Main Window: 送信ボタンを押した後、メッセージ入力欄にフォーカスするように。 2024-01-07 05:08:33 +09:00
Sakamoto Shiina 2d9228034d [bugfix] Config Window: Send Message Button. 選択項目変更時(非表示、表示)にメイン画面のカバーが前に出てくるバグの修正。
選択時に遅延させてConfig Windowのlift()を行っている。
2024-01-07 04:57:08 +09:00
Sakamoto Shiina 5128fa590c [Update] Main Window: メッセージ送信ボタンの追加。
設定項目で非表示、表示、表示しつつメッセージ入力欄でのエンターキー送信を無効 を選択可能に。

デフォルトが表示の理由: メッセージ入力欄のプレースホルダーが使えなくなり、初見でどこに入力すればいいのか分かりにくくなったので、横に送信ボタンが付くことにより、よくあるUIとなり、メッセージ入力欄っぽくなる。

その他要らないコードの削除や、corner radius指定し忘れなどの修正あり。
2024-01-07 03:30:46 +09:00
misyaguziya de66233b90 👍[Update] Model : 不要な変数”translatorEngine”を削除 2024-01-07 02:05:59 +09:00
misyaguziya fe3b38c5fd 👍[Update] Model : 翻訳自体が失敗することがなくなったのでフェールセーフの処理を削除
※別途、ポップアップにて翻訳エンジンが使用できなかった旨のメッセージを出す必要がある
2024-01-07 01:50:50 +09:00
misyaguziya 82dde149ee 👍[Update] Model : 翻訳失敗時にCTranslate2での翻訳処理を追加修正
不要なコードを削除
2024-01-07 01:46:29 +09:00
misyaguziya 0742d635af 👍[Update] Model : DeepL_APIの認証処理の条件を修正 2024-01-07 01:43:50 +09:00
misyaguziya 9556998518 Merge branch 'version' into develop 2024-01-06 23:26:53 +09:00
misyaguziya ad92e1b5f7 🐛[bugfix] Model : Update処理の不要なCommandを削除 2024-01-06 23:15:36 +09:00
misyaguziya bed525297e 👍[Update] Config : version 2.0.1 -> 2.0.2 2024-01-06 22:15:42 +09:00
misyaguziya 90e631726c 👍[Update] Model : Update処理をtempfileを使用する処理に変更 2024-01-06 22:13:56 +09:00
Sakamoto Shiina a5eb0a874f Merge branch 'improve_ui_message_box' into develop 2024-01-05 19:03:49 +09:00
Sakamoto Shiina c2a37057f1 [Update] Main Window: メッセージ入力欄で、Shift+Enterキーを押した際に送信せず、ただ改行するように。
※VRC上では改行は削除される。
2024-01-05 08:40:11 +09:00
Sakamoto Shiina 5bb1a83ed9 Merge branch 'restore_main_window_geometry' into develop 2024-01-05 00:37:04 +09:00
Sakamoto Shiina f6414843cf [Update] Main Window: ウィンドウ位置、サイズ。UI Size変更時、それに合わせて保存する値も変化。 2024-01-05 00:31:52 +09:00
misyaguziya 9e91be145e 👍[Update] Model : getListLanguageAndCountryを動的に変化するように変更
findTranslationEnginesで翻訳エンジンのリストを取得するように変更
2024-01-04 03:03:18 +09:00
misyaguziya aac8f08da9 👍[Update] Model : 翻訳失敗時のフェールセーフ処理を追加 2024-01-04 03:01:50 +09:00
Sakamoto Shiina 7729a1dcb8 Merge branch 'view' into develop 2024-01-04 00:05:40 +09:00
Sakamoto Shiina 3891cafc15 [Update] Main Window Cover: 設定画面などを開いた時にメイン画面を黒く覆う画面の透明度を下げた。
変更理由: その上に出る文字(The functionality is temporarily disabled until the settings window is closed.)が、後ろのテキストボックスの文字と被って視認性が悪かったので。
2024-01-02 11:52:21 +09:00
Sakamoto Shiina 31755c5031 [Update] Config Window: Dropdown Menu. スクロール速度UP, 幅調整(フォントや言語によって文字幅が変わるので、マージンとして少し追加) 2024-01-02 07:11:31 +09:00
Sakamoto Shiina 9bc2756ac5 Merge branch 'refactoring' into develop 2024-01-02 04:55:27 +09:00
Sakamoto Shiina 94b928e194 [Refactor] config.pyへ、設定可能な範囲などを移動。設定値のソース一元化。
language.pyの中身はconfig.SELECTABLE_UI_LANGUAGES_DICTに移動しました。
設定可能な範囲、TRANSPARENCYが0~100になっていたので50~100に修正。
2024-01-02 03:59:52 +09:00
misyaguziya fa32d0ff87 👍[Update] Model : 文字起こしと翻訳エンジンの組わせの有効性辞書を追加
getDictTranslationEngineValidity
2023-12-31 00:36:50 +09:00
misyaguziya 1777988294 👍[Update] Main : 翻訳エンジンの手動設定に変更
翻訳エンジンの自動設定機能を削除
input/outputの翻訳エンジンを別に設定できるように機能を追加
Aurhkeyの認証をDeepLのみ削減
2023-12-30 23:38:09 +09:00
Sakamoto Shiina 3175f44a9a Merge branch 'speaker2chatbox' into develop 2023-12-30 19:51:58 +09:00
Sakamoto Shiina 6152f5e91a [Update] Speaker2Chatbox: config.pyのself._ENABLE_SPEAKER2CHATBOX True/Falseによって、Speaker2Chatbox機能の有効無効切り替え。
通常はFalse: 設定画面での項目もdisabled状態になります。
Trueの場合に設定項目が開放され、On/Offの設定を可能に。

※通常公開しない理由: 相手の発言をチャットボックスに表示できる(オウム返しのようになる)ため、迷惑目的での使用が想定でき、それをできるだけ防ぐためです。オープンソースとはいえ、ある程度抑制できると考えています。
使用者は開発者に直接相談し、config.pyのself._ENABLE_SPEAKER2CHATBOXがTrueなコードをビルドしたものを配布する予定です。
2023-12-30 19:41:19 +09:00
Sakamoto Shiina be049d9145 Merge branch 'restore_main_window_geometry' into develop 2023-12-30 18:21:23 +09:00
Sakamoto Shiina 053b8080a4 [bugfix] Confirmation Modal: Add lift() after displaying the confirmation modal to prevent it from being hidden by the main window cover. 2023-12-30 18:13:40 +09:00
Sakamoto Shiina 38edeaebf3 [Update] Main Window: Add Restore the main window position feature. VRCT終了時(メイン画面のXを押した時)の画面位置とサイズを記録し、次回起動時に同じ場所同じサイズで表示させる機能を追加。デフォルトでオンです。
※次回アプデ後の初期起動時はみんな、一番左上端座標x-0 y-0で表示されます。この設定をオフにすると常に画面中央(今まで通り)に表示されます。
2023-12-30 17:25:29 +09:00
Sakamoto Shiina 4eeb76f9fb [Update] UI: Themeのデフォルト値をSystemからDarkに。Lightテーマを作りはしたが、ユーザーにはできるだけDarkテーマを使って欲しいため。 2023-12-29 03:22:34 +09:00
Sakamoto Shiina 0728192ca5 Merge branch 'improve_message_input_UI' into develop 2023-12-29 02:34:47 +09:00
Sakamoto Shiina 1d380264e4 [bugfix/chore] Main Window: Message Box. 入力ボックスが空の状態でエンターキーを押した時に送信されてしまうのを修正。※CTkEntryからCTkTextboxに変更したことによる影響 2023-12-29 02:20:58 +09:00
Sakamoto Shiina 7c23adfc24 [Update] Main Window: Message Box. メッセージ入力欄のサイズを変更できるように。厳密な計算はしてません。
【見た目への影響大】デフォルトのチャット入力欄を少し大きくしました。(もちろん変更できる)
テキストボックスとの比率としているので、Windowサイズを変更すると、それに合わせて可変します。
CTkEntryからCTkTextboxに変更しました。プレースホルダーの使用が厳しくなったので廃止しました。最小にしても、入力中の位置が中央にならないなど、デザインが若干崩れましたが許容しました。
2023-12-29 01:51:13 +09:00
misyaguziya a82435dc29 [Update] Model : deepl_translateを削除 2023-12-27 22:37:38 +09:00
misyaguziya 8463ccda69 👍[Update] Model : translators更新に伴い言語セットを変更/Papagoを追加 2023-12-27 22:14:10 +09:00
Sakamoto Shiina 5e16d319e3 Merge branch 'view' into develop 2023-12-23 18:25:30 +09:00
Sakamoto Shiina b668d6fd21 [Update] Main Window: 言語選択時のスクロール速度UP。それにともないCustomizedCTkScrollableFrameを別ファイルとして切り出し、ui_utilsからimportできるように。 2023-12-21 13:36:23 +09:00
Sakamoto Shiina 2e6523625a Merge branch 'view' into develop 2023-12-20 16:31:48 +09:00
Sakamoto Shiina dccbfb7e5d [Update] Config Window: スクロール(y軸)速度を上げました。CustomizedCTkScrollableFrameとしてライブラリをオーバーライドしています。
適用したかったファイルの先頭にただ書いているだけの状態です。いずれ切り出したほうが良いかもしれません。
2023-12-20 16:20:56 +09:00
Sakamoto Shiina 3fcaca917a [Update] Main Window: Transcription Mic/Speakerのオン・オフ時に、Language Settings部分にそれぞれアイコン表示。少しはYour LanguageとTarget Languageを意図したものとは反対に設定してしまう問題を解消できるかな。 2023-12-20 15:13:33 +09:00
Sakamoto Shiina d982a76048 [Refactor] リファクタリング コメントアウトしていた[deprecated](起動時OSCチェック)のコード削除や、コメント追加、改行調整など。 2023-12-20 10:28:23 +09:00
Sakamoto Shiina 6855413109 Merge branch 'send_only_translated_messages' into develop 2023-12-20 01:23:45 +09:00
Sakamoto Shiina 74bd06c768 [Update] Add feature, Send Only Translated Messages: 翻訳オン時、翻訳後のメッセージのみを送信する機能を追加。 2023-12-20 01:07:42 +09:00
Sakamoto Shiina 1eb84517db Merge branch 'update_message_format_features' into develop 2023-12-19 23:51:46 +09:00
Sakamoto Shiina 870e276ec5 [Refactor] controller.py Message formatを使用する関数周りで、共通した処理切り出し。 2023-12-19 23:45:11 +09:00
Sakamoto Shiina 8a0b2de540 [Update] Message Format: config.jsonで元々のkey "MESSAGE_FORMAT"が存在していた場合、"SEND_MESSAGE_FORMAT_WITH_T"へと引き継ぐ処理追加。 2023-12-19 22:28:18 +09:00
Sakamoto Shiina 6a9732aaa8 [Update] Add Message Formats Features more. 機能として追加。実際に各メッセージ送信時に各フォーマットが機能するように。 2023-12-19 21:49:35 +09:00
Sakamoto Shiina f34abbe184 [Update/Refactor] Add Message Formats Features more. UIとしての設定項目追加と、config.jsonへの書き込みまで。
送信メッセージと、受信したメッセージを送信する際のメッセージフォーマット設定項目追加。また、翻訳付きとそうじゃない場合のメッセージフォーマット設定項目を追加。
それに伴いリファクタリングなど。
※config.jsonのMESSAGE_FORMAT項目は消えます。ユーザーが元々設定していたデータは今のところ引き継げない状態です。
2023-12-19 12:31:34 +09:00
misyaguziya 8146b8b988 👍[Update] Model : hashによる検証を追加 2023-11-29 23:37:44 +09:00
misyaguziya 8cc95078e9 🐛[bugfix] typo 2023-11-29 23:36:55 +09:00
Sakamoto Shiina 69f6e44720 [Update] UI追加 初期起動時の言語モデルダウンロード中、splash画面にプログレスバー表示。 2023-11-29 17:11:47 +09:00
misyaguziya 52abfb8a97 🐛[bugfix] typo WIGHTS -> WEIGHTS 2023-11-28 10:18:51 +09:00
misyaguziya 0311d4cdfc 👍[Update] model : translation/utils.pyを追加に伴い一部修正 2023-11-28 10:17:50 +09:00
misyaguziya 92ea7914b8 👍[Update] model : モデルのロード位置を変更 2023-11-26 00:30:59 +09:00
misyaguziya 194ec9241c Merge branch 'speaker2chatbox' into develop 2023-11-25 22:53:05 +09:00
misyaguziya 8fe5536ea7 Merge branch 'venv' into develop 2023-11-25 22:52:52 +09:00
misyaguziya 0d7642f727 🐛[bugfix] Controller : ReceiveをOSCで送信するとき以外でReceiveがlogに表示されない問題を修正 2023-11-25 22:40:37 +09:00
misyaguziya 1b6074c60b 👍[Update] venv : 起動パスを修正 2023-11-23 16:13:20 +09:00
Sakamoto Shiina 5d0db4a8fa [Update] 機能追加 2023-11-23 00:41:05 +09:00
Sakamoto Shiina 89b8a47a76 [Update] Speaker2Chatbox UI追加。 2023-11-23 00:15:57 +09:00
misyaguziya e6e62cf350 👍[Update] Model : CTranslate2のweightデータを起動時に取得するように変更 2023-11-19 00:03:57 +09:00
misyaguziya 8bdce3c1b3 Merge branch 'readme' into develop 2023-11-18 16:00:57 +09:00
misyaguziya 60d4e2ad52 👍[Update] Readme : リンクを追加 2023-11-18 16:00:38 +09:00
misyaguziya dcb6c07eee 👍[Update] Model : weightのパスをPATH_LOACLから接続するように変更 2023-11-15 16:06:45 +09:00
misyaguziya 1a766cfde3 👍[Update] setup : pipのアップデートを追加 2023-11-15 14:39:27 +09:00
misyaguziya 1f5a2e92cc [Add] Model: ctranslate2のテストコードを追加 2023-11-15 14:38:37 +09:00
misyaguziya ad7080438f ➕[Add] 仮想環境のvenvを追加 2023-11-14 12:04:46 +09:00
Sakamoto Shiina 64e601c70d Merge branch 'startup_osc_setting_feature' into develop 2023-11-10 17:54:06 +09:00
Sakamoto Shiina 80940fccb2 [Update] cmdからのexe起動時などに、引数としてosc portとip addressの設定ができるように。 2023-11-10 17:52:25 +09:00
Sakamoto Shiina 3d917a8f57 Merge branch 'view' into develop 2023-11-09 15:36:00 +09:00
Sakamoto Shiina 74e28ca101 [Refactor] Remove the code that is no longer in use. 2023-11-09 15:33:31 +09:00
Sakamoto Shiina 76e86c64ab [Chore/fix] Config Window: Appearance theme 文言修正(en) 2023-11-09 15:25:49 +09:00
misyaguziya 7555a7c27e Merge branch 'develop' 2023-11-09 00:23:17 +09:00
misyaguziya a5d03a7d8e Merge branch 'bugfix' into develop 2023-11-09 00:22:35 +09:00
misyaguziya 750a338d53 🐛[bugfix] Model : batファイルをmoveからcopyに変更 2023-11-09 00:22:18 +09:00
misyaguziya 37f75caacf Merge branch 'develop' 2023-11-08 23:58:24 +09:00
misyaguziya 8487e74dde 👍[Update] Locales : ライトテーマ追加に伴い文言を修正 2023-11-08 23:57:48 +09:00
misyaguziya 5736fee505 Merge branch 'develop' 2023-11-08 23:19:03 +09:00
misyaguziya af4968618a Merge branch 'version' into develop 2023-11-08 22:12:00 +09:00
misyaguziya 37cc3f63d2 👍[Update] Config : version 2.0.0 -> 2.0.1 2023-11-08 22:11:48 +09:00
misyaguziya 42cb19e818 Merge branch 'installer' into develop 2023-11-08 22:08:38 +09:00
misyaguziya cbd717666a 👍[Update] Controller : config fileとlogs folderのリンクが開く昨日を追加 2023-11-08 22:00:31 +09:00
misyaguziya 5e1a293e9f 📝[Refactor] ruffを使用しコード検証修正を行った 2023-11-08 17:40:14 +09:00
misyaguziya 9eb157b871 Merge branch 'ruff' into installer
# Conflicts:
#	model.py
2023-11-08 17:37:41 +09:00
misyaguziya 4351122cb4 📝[Refactor] ruffを使用しコード検証修正を行った 2023-11-08 17:35:50 +09:00
Sakamoto Shiina 02acc4a191 Merge branch 'view' into develop 2023-11-08 16:16:00 +09:00
Sakamoto Shiina 9768f3e724 [Refactor] 使ってないimageファイルの削除 2023-11-08 16:14:39 +09:00
Sakamoto Shiina 9905a4f2d0 [Update] Add Light Theme 2023-11-08 15:52:43 +09:00
misyaguziya a3492ad72b Merge branch 'develop' into installer 2023-11-06 19:06:47 +09:00
Sakamoto Shiina f8db9c927b [bugfix] Config Window: Current Active Config Titleに縦1pxの線が入っていたバグを修正。
(1pxバグ修正がバグを生んでいました。消した分、代わりに端っこ1pxバグ発生しそうな気はするけど)
2023-11-06 14:03:21 +09:00
Sakamoto Shiina fc4bf7648f Merge branch 'view' into develop 2023-11-06 13:14:40 +09:00
Sakamoto Shiina c8415d8370 [Refactor] Config Window: _SettingBoxGenerator ボタン系サイズと色指定の汎用化 2023-11-06 13:10:55 +09:00
Sakamoto Shiina f21ffea568 [Update] Config Window: Advanced Settings Tab: add Open Config File. add item open file(config.json) button. 2023-11-06 12:54:02 +09:00
Sakamoto Shiina 5d6902c196 [Update] Config Window: Auto Export Message Logs. add open file(logs) button. 2023-11-06 12:31:49 +09:00
Sakamoto Shiina d396a56721 Merge branch 'ui_update_swap_languages' into develop 2023-11-06 06:24:25 +09:00
Sakamoto Shiina 74c8a253e8 [Update] Main Window: add feature. Swap Languages. when hover the label 'Translate Each Other', 'Swap Languages Button' appear. and It can swap 'Your language' and 'Target Language'. 2023-11-06 06:21:43 +09:00
Sakamoto Shiina ef747a2f40 Merge branch 'ui_update_message_format' into develop 2023-11-05 11:38:37 +09:00
Sakamoto Shiina 72877ab98b [Update] Message Format: [message]と[translation]は一意かつそれぞれ一つだけの使用に。それに伴いエラー表示や初期値の挿入など。 2023-11-05 11:30:34 +09:00
Sakamoto Shiina 44baaa84b8 [Update] Message Format: UI改善、[message]や[translation]など必須なものは固定(入れ替え可能)し、ユーザーは編集できないように。不完全な気はしているが、表示の例を追加し、直感的にメッセージフォーマットを使えるように。 2023-11-05 08:03:52 +09:00
Sakamoto Shiina f5b3b503e4 [Update] config.py: Message Format. 設定された文字列に"[message]"と"[translation]"の両方が入っていなければ初期値を設定するように。 2023-11-01 09:19:40 +09:00
misyaguziya 4cbc449eb1 Merge remote-tracking branch 'origin/develop' into installer 2023-11-01 06:28:01 +09:00
misyaguziya 0dca7ff6a2 👍[Update] installer : build.batにNSISを追加 2023-11-01 06:24:42 +09:00
misyaguziya 2f27ae3464 🐛[bugfix] installer : update処理のパスを修正 2023-11-01 06:00:51 +09:00
misyaguziya 9951398c36 🐛[bugfix] installer : restart処理時にパスがおかしくなる問題を修正 2023-11-01 04:09:41 +09:00
Sakamoto Shiina 8d90ca0cc6 Merge branch 'update_ui_word_filter' into develop 2023-11-01 02:55:28 +09:00
Sakamoto Shiina c98912f31b [Update] Mic Word Filter: UI改善、リスト表記にし、追加や削除も直感的に行えるように。※_SettingBoxGenerator.py内に追加された関数が、汎用的ではなく、ワードフィルター専用状態です。
config.py: 登録された単語は一意になるように、順序を保持しつつ重複削除処理。
その他ワードフィルターの説明文言調整など。
2023-11-01 02:49:10 +09:00
misyaguziya 57a040f648 👍[Update] installer : データ移行の処理を変更 2023-10-31 17:24:46 +09:00
misyaguziya 033a64a725 👍[Update] installer : 暫定的に更新処理を追加 2023-10-31 16:34:05 +09:00
misyaguziya bfd718ce76 🐛[bugfix] installer : パスを修正 2023-10-31 15:31:44 +09:00
misyaguziya a25fe345ed 👍[Update] installer : autoupdateの処理を変更 2023-10-30 20:29:18 +09:00
misyaguziya 676a64d0f5 👍[Update] installer : インストールするパスを修正 2023-10-30 18:25:22 +09:00
Sakamoto Shiina 266b809353 Merge branch 'view' into develop 2023-10-29 19:05:57 +09:00
Sakamoto Shiina c85b312504 [bugfix/Update] Config Window: ToolTip. 角丸を無くしました。
理由, OS側でライトテーマなど選択された時に影響されて周りが白くなってしまい、消そうにもTkinterの透過が不完全すぎて見えちゃうのでもう角丸をなくすことにしました。
2023-10-29 19:02:04 +09:00
Sakamoto Shiina 6e54b541dd [Chore] ColorThemeManager: 変数名変更やコメント追加など。ダークテーマの基本テキストカラーを、元々Lightテーマから持ってきていたのをDarkテーマ固有のものに(中身は今のところ同じでf2f2f2だけど)。
SENTやRECEIVEDも変数化。参考にしたサイトのコメント記述など。
2023-10-29 01:12:06 +09:00
Sakamoto Shiina 1efd7d0330 [Refactor] ColorThemeManager: カラーテーマごとにファイル分け。ImageFileManager廃止、ColorThemeManagerに統合。 2023-10-28 16:05:18 +09:00
Sakamoto Shiina 20f48999d1 [bugfix] ColorThemeManager: 指定ミス修正。 2023-10-27 19:59:58 +09:00
Sakamoto Shiina 2707332ec8 [Update] ColorThemeManager: (WIP)Lightテーマ選択時、カラー指定がない時に、Darkテーマとマージして値を持ってくるように。 2023-10-27 19:56:22 +09:00
misyaguziya 958cd45b0c [Update] installer : 既にインストール済みの場合、ファイルを削除して置き換えるように修正 2023-10-27 17:14:52 +09:00
Sakamoto Shiina 5fd156545f [Refactor] ColorThemeManager: SimpleNamespaceを使った記述に切り替えて可読性と利便性アップ。 2023-10-27 10:37:22 +09:00
misyaguziya 7fe43cc882 🐛[bugfix] Installer : エンコードをShift-jis -> UTD-8 with BOMに変更 2023-10-27 04:08:21 +09:00
Sakamoto Shiina 161e4b9543 Merge branch 'view' into develop 2023-10-26 19:59:29 +09:00
Sakamoto Shiina b4479e570a [Update] Config Window: Mic/Speaker Energy Threshold Check. しきい値を超えると色が変わるように。
ProgressBar Widgetを変化させるのは問題ないが、entry widgetなど、他のwidgetだとスタックして?遅延が発生するので、できるのは今のところここまで。
2023-10-26 19:58:56 +09:00
misyaguziya 85f285271e 🐛[bugfix] Model : remake restart.bat 2023-10-26 03:52:56 +09:00
misyaguziya ad3a8f38ae 👍[Update] Model : update installer 2023-10-26 03:52:12 +09:00
misyaguziya fc8b8ac5ee 👍[Update] Model : Add Installer 2023-10-25 22:45:28 +09:00
Sakamoto Shiina 0ac41060ac Merge branch 'fix_filename_problem' into develop 2023-10-24 21:31:58 +09:00
Sakamoto Shiina a6f5e30e39 [fix] _PrintToTextbox: ファイル名の変更がトラッキングされておらず、読込み時にエラーがでていたのを無理やり修正。 2023-10-24 21:30:37 +09:00
Sakamoto Shiina 6119e254a6 [fix/tmp] copy _printToTextbox 2023-10-24 21:29:19 +09:00
Sakamoto Shiina 5132e6252a Merge branch 'view' into develop 2023-10-24 20:36:40 +09:00
Sakamoto Shiina b7af569996 [Update] Config Window: slider tooltips. ステップを1ずつにして、さらにパーセンテージ表記するように。 2023-10-24 20:31:05 +09:00
Sakamoto Shiina c6d52f05c5 [Update] Config Window: Slider系にtooltip追加。Thanks of Akascape. 2023-10-24 19:39:32 +09:00
Sakamoto Shiina 8f2934e510 [Update] テキストボックスのフォントサイズを、UI全体のサイズとは別でユーザーが変えられるように。
(UI size, scalingを基準とした倍率)
2023-10-24 18:33:32 +09:00
Sakamoto Shiina 8cffee569a [Refactor] TextboxのUi Sizeを独立させるための準備でリファクタリング。クラスなど。 2023-10-24 16:07:29 +09:00
Sakamoto Shiina 64ac7d2c61 Merge branch 'view' into develop 2023-10-24 10:00:03 +09:00
Sakamoto Shiina 7bbf539f14 [bugfix] Word filterで検出された際に、テキストボックスにログが送信されないバグを修正。i18nの指定の仕方が悪かったみたい。 2023-10-24 09:43:04 +09:00
Sakamoto Shiina 78c9a290cc [Refactor] メイン画面の閉じるボタンを押したときの処理をCALLBACK関数にしてview.pyに移動。 2023-10-23 15:35:25 +09:00
Sakamoto Shiina 4526c2a28e [Refactor] view.pyのリファクタリング。不要なコードの削除や並び替え、コメント追加など。 2023-10-23 15:24:16 +09:00
misyaguziya 688a43691b Merge branch 'develop' 2023-10-21 01:04:48 +09:00
misyaguziya 0ffbe17b7e Merge branch 'UI_2.0' into develop 2023-10-21 01:04:10 +09:00
misyaguziya c18eb02a04 Merge branch 'version' into UI_2.0 2023-10-21 01:03:17 +09:00
misyaguziya ffc505a712 👍[Update] Config : version 2.0.0 alpha 5 -> 2.0.0 2023-10-21 01:03:05 +09:00
misyaguziya 7c269e3e17 Merge branch 'readme' into UI_2.0 2023-10-21 01:01:03 +09:00
misyaguziya e2f87e94dd 👍[Update] README : youtubeリンクを変更 2023-10-21 01:00:48 +09:00
Sakamoto Shiina bea88879af [Chore] Config Window: 設定項目のラベル名変更 2023-10-21 00:02:50 +09:00
misyaguziya d022cbf124 Merge branch 'model' into UI_2.0 2023-10-20 23:59:12 +09:00
misyaguziya f3b218e86e 🐛[bugfix] Model : modelでconfigにセットしていたため修正 2023-10-20 23:58:46 +09:00
misyaguziya 2e97ade02b Merge branch 'model' into UI_2.0 2023-10-20 18:32:58 +09:00
misyaguziya e52321132d 🐛[bugfix] Model : 処理負荷軽減のためにsleepを追加 2023-10-20 18:32:42 +09:00
Sakamoto Shiina e1d927cfae Merge branch 'view' into UI_2.0 2023-10-20 18:27:55 +09:00
Sakamoto Shiina c001e5c069 [Update] add(move) UI Language Korean. that was used in v1.3.x too. 2023-10-20 18:26:28 +09:00
misyaguziya 5d99002aec Merge branch 'model' into UI_2.0 2023-10-20 17:29:49 +09:00
misyaguziya 5f3f3afeb7 🐛[bugfix] Model : print文削除/speaker energy のエラー発生問題を修正 2023-10-20 17:29:36 +09:00
misyaguziya 2bd891f7ba Merge branch 'version' into UI_2.0 2023-10-20 14:38:34 +09:00
misyaguziya 46ebd84c39 👍[Update] Config : versionを2.0.0 alpha 5に変更 2023-10-20 14:38:19 +09:00
misyaguziya 0662339124 Merge branch 'model' into UI_2.0 2023-10-20 14:36:16 +09:00
misyaguziya b63990d4ce 🐛[bugfix] Model : auth keyを記入したあとに、削除すると翻訳に失敗するバグを修正 2023-10-20 14:35:29 +09:00
misyaguziya ff0e13caf0 👍[Update] Main : error.logを出力するように機能を追加 2023-10-20 10:36:03 +09:00
misyaguziya 12175a0788 👍[Update] Model : 翻訳エンジンへのrequestが失敗した場合にエラーログを出力する機能を追加 2023-10-20 10:29:46 +09:00
Sakamoto Shiina d9e9c4d2ba Merge branch 'view' into UI_2.0 2023-10-20 06:25:52 +09:00
Sakamoto Shiina e8ee8891b0 [Update] Remove the background color that was for testing. 2023-10-20 06:21:08 +09:00
Sakamoto Shiina 55db1c2e75 [bugfix] Main Window, Cover Window: メイン画面に追従しないバグなど修正。追従する関数やイベント登録もcover windowクラス内に押し込み。 2023-10-20 06:00:18 +09:00
Sakamoto Shiina f668686daf [Update] add Information Modal. This is for displaying when reached translation limit that 429 too many requests. 2023-10-20 04:30:30 +09:00
misyaguziya 2a7bcb8872 Merge branch 'model' into UI_2.0 2023-10-19 19:48:49 +09:00
misyaguziya 9b974b8632 🐛[Update] Model : Auth keyの復旧作業2 2023-10-19 19:45:06 +09:00
Sakamoto Shiina 780bd32cf4 [bugfix] 色の指定漏れ修正。OSの設定でライトテーマにしている場合に、色指定していない部分が自動的にライトテーマ用(Tkinter側で)に指定されてしまうので指定漏れがあった部分を指定。その際にVRCT上のダークテーマでの色が一部微妙に変わっている。 2023-10-19 17:33:31 +09:00
misyaguziya 9428a19f4f Merge branch 'model' into UI_2.0 2023-10-19 15:41:59 +09:00
misyaguziya bfe177aa17 🐛[bugfix] Model : Auth keyの復旧作業 2023-10-19 15:39:39 +09:00
Sakamoto Shiina 6207d5a807 Merge branch 'ui_restore_deepl_auth' into UI_2.0 2023-10-19 15:37:28 +09:00
Sakamoto Shiina 7aefe652e5 [Update] Config Window: Restore DeepL Auth Key UI 2023-10-19 15:36:04 +09:00
Sakamoto Shiina d6dfd0ae9a Merge branch 'view' into UI_2.0 2023-10-19 15:26:47 +09:00
Sakamoto Shiina 40f999f556 [bugfix] Config Window: Dropdown Menu Window. 幅を内容に合わせて可変的に。長いテキストが入っても見きれないように修正。 2023-10-19 15:18:10 +09:00
Sakamoto Shiina b007fb1c55 [bugfix] Selectable Language Window: Focusイベントが意図しないところで発生してウィンドウ閉じてしまうのを修正。 2023-10-19 09:32:06 +09:00
Sakamoto Shiina 2b0476c8b9 [bugfix] VRCTウィンドウUI Size40%でもOSウィンドウサイズを超える場合は、確認モーダルが永遠出てしまうのを修正。そういう環境を作れずテストはできていないが、まぁ想定外すぎるディスプレイサイズなので。 2023-10-19 09:06:40 +09:00
Sakamoto Shiina 7eee38f107 [Chore] Remove the python print code that forgot to remove. 2023-10-19 08:58:47 +09:00
Sakamoto Shiina 8e55a5426c [Update] Config Window: 各項目のエラーメッセージを追加(仮置きじゃなくなりました。) 2023-10-19 08:53:44 +09:00
Sakamoto Shiina 62652dccd4 Merge branch 'view' into UI_2.0 2023-10-18 18:50:24 +09:00
Sakamoto Shiina 7cc7b5a7c3 [Update] 使用ディスプレイサイズの大きさ(高さ)より、VRCT起動時のウィンドウの方が大きい場合の対応。UI Scalingを20%下げて再起動するかどうかの確認モーダルを表示。
それにともない確認モーダルの汎用化。
さらにそれに伴い計算の都合上UI Scalingが40%から200%で10%刻みに対応(選択できるように)しました。
2023-10-18 18:46:10 +09:00
Sakamoto Shiina 5abfe3c20b [Update] add Update Software Confirmation Modal Window. 2023-10-18 14:54:18 +09:00
Sakamoto Shiina 98ac2232a3 [Refactor] Main Window: メイン画面カバーのgeometry計算をshow時に変更。 2023-10-17 23:24:41 +09:00
Sakamoto Shiina 7430bd25f8 [Update] Config Window: Mic/Speaker Record Timeoutなどの説明文追加と修正。 2023-10-17 17:31:45 +09:00
Sakamoto Shiina 239b0acce3 [Update] Config Window: message format's description. add sentence for mentioning that will be used Notification XSOverlay too.
[Update] Config Window: Notification XSOverlay's label. 日本語版での文言変更。
2023-10-17 15:03:17 +09:00
misyaguziya 63b9bc9f8e Merge branch 'model' into UI_2.0 2023-10-17 13:17:41 +09:00
misyaguziya f4f5ef07e7 👍[Update] Config : versionを2.0.0 alpha 4.1に変更 2023-10-17 13:17:25 +09:00
misyaguziya ae986b215e 🐛[bugfix] Model : speaker_deviceの設定を間違えたので修正 2023-10-17 13:16:04 +09:00
misyaguziya bd5968c5cb Merge branch 'version' into UI_2.0 2023-10-17 10:51:57 +09:00
misyaguziya 80c043f707 👍[Update] Config : versionを 2.0.0 alpha 4に変更 2023-10-17 10:51:42 +09:00
Sakamoto Shiina f5f635cac4 Merge branch 'show_error_when_no_device' into UI_2.0 2023-10-17 05:40:07 +09:00
Sakamoto Shiina 314e0c86b6 [Update] No Device時の処理。スピーカー/マイクを使う処理時に表示するエラーメッセージの実装。表示方法は改善予定。 2023-10-17 05:36:29 +09:00
misyaguziya 9eafb5f340 Merge branch 'model' into UI_2.0 2023-10-17 04:03:49 +09:00
misyaguziya 3b6222c6f7 👍[Update] : Model : 不要になった関数getOutputDevicesを削除 2023-10-17 04:03:30 +09:00
misyaguziya fa1854f2d3 👍[Update] Model : NoDevice時にエラーを表示するためにerror_fncを追加
仮でlambda:print("[ERROR] Speaker NoDevice"を差し込んである
2023-10-17 04:02:40 +09:00
misyaguziya 8ebfb99401 🐛[bugfix] Config : NoDevice時にCHOICE_SPEAKER_DEVICEをセットするとエラーになる問題を修正 2023-10-17 04:01:01 +09:00
Sakamoto Shiina 785f9b5c7f Merge branch 'view' into UI_2.0 2023-10-16 21:03:45 +09:00
Sakamoto Shiina 6714833b0f [Update] Config Window: showRestartButton関数の調整。前回の設定と同じで、再起動が必要なければ再起動ボタンを表示しないように。選択中の言語での表示も対応。 2023-10-16 20:49:39 +09:00
Sakamoto Shiina 29b30bba92 [Chore] Remove the code that is useless. and change the function getLongestText for somehow. 2023-10-16 20:00:31 +09:00
Sakamoto Shiina 4a62b31db0 Merge branch 'view' into UI_2.0 2023-10-16 12:42:31 +09:00
Sakamoto Shiina bd71a96ccb [Update] Main Window: メッセージボックスからフォーカスが外れると、VRChat上ででるチャット入力中をstopするように。
それに伴ってfocus in/outイベントをcontroller.pyで管理。
[Refactor] 関数名を適切な名前へ変更。
2023-10-16 12:34:41 +09:00
Sakamoto Shiina a054f05b1b [Remove] Config Window: Speaker Device自動設定により、UIから選択項目を削除。また、config.CHOICE_SPEAKER_DEVICE が "NoDevice"だったときの初期処理も必要なくなったのでview.pyからも削除。 2023-10-16 11:40:57 +09:00
Sakamoto Shiina 0519a2bbfb [Remove] DeepL Authキー廃止によりUIから削除。Translationタブ自体はコメントアウトで削除(将来的にまた必要になると予想して)」 2023-10-16 11:00:49 +09:00
Sakamoto Shiina 91cc9802a3 [Chore] Remove the code ctypes from requirements.txt. 2023-10-16 10:29:25 +09:00
Sakamoto Shiina 574a84cdb2 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-10-16 10:20:58 +09:00
Sakamoto Shiina de1c0a5c96 Merge branch 'bugfix_ui_corruption_by_windowz_scaling' into UI_2.0 2023-10-16 10:20:28 +09:00
Sakamoto Shiina 16cac0d557 [bugfix] Main Window: Main Window Cover: UI崩壊修正続き。SetProcessDpiAwareness 1 -> 0
[bugfix] 設定画面を開いた時にカバーするWindowがずれるのを修正するため、メイン画面を移動した時に毎回lift(最前面に表示)する機能を削除。
[Update] Main Window: ウィンドウサイズの幅を縮めた時に、テキストボックスのサイズが一定以上縮まず、ログが折り返されなかったので、折り返されるように改善。それにより幅固定を外したので、起動時にgeometryを指定するなどしている。
※上記相互に影響しているためまとめて編集しました。
2023-10-16 10:15:02 +09:00
misyaguziya 528a94455b Merge branch 'model' into UI_2.0 2023-10-16 00:15:18 +09:00
misyaguziya 7e416406f2 [Remove] Model : DeepLのpackageを削除 2023-10-16 00:15:05 +09:00
misyaguziya d99a10f052 Merge branch 'model' into UI_2.0 2023-10-16 00:06:35 +09:00
misyaguziya f1f803f8e3 [Remove] Model : DeepLのAuthキーを必要とする処理を削除 2023-10-16 00:05:28 +09:00
misyaguziya c051d663f9 Merge branch 'model' into UI_2.0 2023-10-15 17:04:23 +09:00
misyaguziya acbdfa501b 🐛[bugfix] Model : 不要なpackageを削除 2023-10-15 17:03:47 +09:00
misyaguziya 6c96673966 Merge branch 'model' into UI_2.0 2023-10-15 16:42:15 +09:00
misyaguziya 8e93080a8e 🐛[bugfix] Model : スピーカーデバイスの取得タイミングを変更
config windowでのデバイス選択が不要になりました
2023-10-15 16:25:36 +09:00
Sakamoto Shiina 465f9f9628 [bugfix] Main Window: UI崩壊修正 Windows本体でスケーリングを変更している場合にUIが崩れるのを修正。DPIを固定するためにctypesを使っているため、requirements.txtに追加。 2023-10-15 11:32:38 +09:00
Sakamoto Shiina e5238fd4a7 Merge branch 'bugfix_xsoverlay_message' into UI_2.0 2023-10-15 10:57:55 +09:00
Sakamoto Shiina 808007ece6 [bufgix] XSOverlayへの受信メッセージ送信機能で、翻訳をオフにした場合にもメッセージフォーマットが適用されて括弧が入っていたのを修正。 2023-10-15 10:55:20 +09:00
misyaguziya 5152b3679c [Refactor] Model : spk -> speaker 2023-10-15 04:21:52 +09:00
misyaguziya 39a63cb0e2 🐛[bugfix] Controller : ENABLE_SEND_MESSAGE_TO_VRCがFalseの場合にタイピングが送信されないように修正 2023-10-15 03:38:06 +09:00
misyaguziya 033cece3a7 🐛[bugfix] Model : Auth keyの場合に翻訳言語設定が国を含めた言語設定になるように修正 2023-10-15 03:18:58 +09:00
Sakamoto Shiina 38b3bc22e1 Merge branch 'view' into UI_2.0 2023-10-14 19:52:49 +09:00
Sakamoto Shiina 8f0ccdda5b [bugfix/tmp] Config Window: デバイス系の設定、ドロップダウンメニューの幅を基本500pxと広く。間に合わせです。 2023-10-14 19:49:43 +09:00
Sakamoto Shiina f8ce0ee0e6 [Update] Config Window: Transcriptionタブ、Mic/Speaker Max Phrasesなどの数値入力系の説明に「単位」を表記。yml内に追加されたコメントアウトdesc文章は制作中。 2023-10-14 19:16:55 +09:00
Sakamoto Shiina 6ed59df596 [Update] Config Window: 再起動ボタンの表示言語。UI Languageが変更された場合は、変更先の言語で表示。 2023-10-14 17:48:15 +09:00
Sakamoto Shiina c0fb949a38 [Update] Main Window: Textbox log内のシステムメッセージの英語、日本語対応追加。
help and infoボタンをクリックし、VRCTドキュメントページが開いたときの文言をさらに追加。
2023-10-14 17:16:18 +09:00
Sakamoto Shiina 6d6e678f72 [bugfix] Typo 2023-10-14 15:59:08 +09:00
Sakamoto Shiina ff675330c6 [Update] Main Window: Textbox log内のシステムメッセージを英語と日本語に対応。文言調整。
[Refactor] Commented out the code that is no longer in use in view.py (osc error message)
2023-10-14 15:57:01 +09:00
Sakamoto Shiina fb67930ed1 [Refactor] Remove the code that is no longe in use. 2023-10-14 08:58:01 +09:00
Sakamoto Shiina 31ea7ebf8a [Refactor] view以下の引数系のインデント調整
※だいぶ感覚的な独自ルール
2023-10-14 08:33:54 +09:00
Sakamoto Shiina 6968f81366 [Refactor] 変数名変更。 2023-10-14 08:10:57 +09:00
misyaguziya 27eb498793 Merge branch 'version' into UI_2.0 2023-10-13 22:49:53 +09:00
misyaguziya db328692ef 👍[Update] Config : versionを 2.0.0 alpha 3に変更 2023-10-13 22:49:42 +09:00
misyaguziya e5aadddbf1 Merge branch 'hideConsole' into UI_2.0 2023-10-13 22:00:19 +09:00
misyaguziya f9a1ec5feb 👍[Update] Model : batchファイルのコンソールを表示しないように修正 2023-10-13 21:59:38 +09:00
Sakamoto Shiina db97346752 Merge branch 'view' into UI_2.0 2023-10-13 21:57:26 +09:00
Sakamoto Shiina 5283741f30 [Update] Config Window: 文言の調整、日本語と英語。
スレッショルドの設定項目 手動自動切り替え時にそれぞれの文章を入れ込む方式に変更。柔軟性はあるが、今のところ切替時にスイッチの位置が変わってしまう。
2023-10-13 21:44:18 +09:00
Sakamoto Shiina 9ae3bf3530 [bugfix] Config Window: 再起動ボタンのUI Size対応漏れを修正。 2023-10-13 20:03:38 +09:00
Sakamoto Shiina 1bd98c7769 [Update] Config Window: 再起動が必要な変更がある場合に、再起動ボタンを表示。(現状、設定が変わらなくても変更しようとすると表示される状態ではある。例: UI size 100%からもう一度100%を選択した場合など) 2023-10-13 19:56:30 +09:00
Sakamoto Shiina 869654084f Merge branch 'view' into UI_2.0 2023-10-13 18:44:28 +09:00
Sakamoto Shiina bfc5ff04f8 [Update] Config Window: UI Theme Darkモード固定。設定項目からテーマ選択をできなくして、config.jsonを編集したとしても常にDarkモードに固定。※項目として残しているのは、Lightモード実装予定で開発中という事を見せたいため。 2023-10-13 18:23:55 +09:00
misyaguziya a490416544 Merge branch 'remove-unused-files' into UI_2.0 2023-10-13 17:59:17 +09:00
Sakamoto Shiina f24ca9c30d [bugfix] Splash Window: toolwindowをTrueにし忘れていて、起動時にタスクバーに見えてしまっていたのを修正。 2023-10-13 17:58:49 +09:00
misyaguziya ca692ce9bf 👍[Update] Remove Unused Files 2023-10-13 17:53:17 +09:00
Sakamoto Shiina 708bcea533 [bugfix] Config Window: Setting Box Labels. fix the position to the center that was a bit above before. 2023-10-13 17:32:23 +09:00
Sakamoto Shiina 376f5e7b5a [Update] ソフトのバージョン情報を設定画面に移動、UI Size変更、色の変数化、表記を英語と日本語に対応。 2023-10-13 16:56:49 +09:00
Sakamoto Shiina a2c090f234 Merge branch 'bugfix' into UI_2.0 2023-10-13 16:11:13 +09:00
Sakamoto Shiina 0ea376df10 [bugfix] controller.py: 各設定項目、Entry系で空文字を受け取ったときはエラーではなく処理をスルー(return)するように。 これによりUIとしては、ユーザーがdelete keyを押して中身を空にした時のエラーメッセージを出さないように。 2023-10-13 16:09:33 +09:00
Sakamoto Shiina 84ef79e598 Merge branch 'view' into UI_2.0 2023-10-13 16:07:06 +09:00
Sakamoto Shiina a49f382b16 [Update] remove the items that is about startup_osc_enabled_check in localize 2023-10-13 15:49:07 +09:00
Sakamoto Shiina 1b5515cc95 [bugfix] Main Window: サイドバーコンパクトモードにして、VRCTを終了し、次回起動時にコンパクトモードでのroot geometry計算になるためWindowが小さくなるのを修正。 2023-10-13 14:56:23 +09:00
Sakamoto Shiina 1380d66da1 [Refactor] Main Window: 起動時はサイドバーが開いた状態で、もしconfig.IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODEがTrueなら閉じるという動作に。(ユーザーに見えるまでにしている処理なので見た目は変わらない) 2023-10-13 14:44:20 +09:00
Sakamoto Shiina 638b5c25ec Merge branch 'comment_out__startup_osc_enabled_check' into UI_2.0 2023-10-13 14:26:52 +09:00
Sakamoto Shiina bd851ac8d3 [Update] comment out and disable the feature that startup osc enabled check 2023-10-13 14:22:44 +09:00
Sakamoto Shiina 949813da8a Merge branch 'view' into UI_2.0 2023-10-13 13:49:45 +09:00
Sakamoto Shiina 508cca8215 [Update] 設定画面から透明度変更時に、メイン画面のカバーを一時的に外すように。
スライダークリック時(ドラッグ時)にカバーを外し、リリース時に戻す。
リリースはCTkSlider側で設定されていないのでうまくいくけど、
CTkSliderはbind ButtonPress(クリック)はオーバーライドされるので引数command(クリックイベント)に無理やり挟み込み。
2023-10-13 13:41:10 +09:00
Sakamoto Shiina 77500adb8d [bugfix] Main Window: 設定画面を開いた時に、メイン画面に被せるモーダル型ウィンドウが、メイン画面最小化時はそれに従って消し、メイン画面をまた開いた時に表示するように修正。
[Refactor] そのモーダル型ウィンドウの表示関数を移動
2023-10-13 12:24:53 +09:00
misyaguziya 8260043333 Merge branch 'README' into UI_2.0 2023-10-13 11:39:22 +09:00
Sakamoto Shiina 36d750501e [bugfix] Config Window: fix 1px bug. 2023-10-13 09:04:26 +09:00
misyaguziya 5678fec290 Merge branch 'bugfix_AutoUpdate' into UI_2.0 2023-10-13 07:04:21 +09:00
misyaguziya 94c3b72a52 👍[Update] Model : AutoUpdate失敗時にboothを開くように変更 2023-10-13 07:02:48 +09:00
Sakamoto Shiina bdb9023f89 Merge branch 'view' into UI_2.0 2023-10-13 06:00:27 +09:00
Sakamoto Shiina 717a56a580 [bugfix] fix 1px bugs. (まだ発生する) 2023-10-13 05:59:14 +09:00
Sakamoto Shiina f185b2f475 [Refactor] Remove the code that is no longer in use. 2023-10-12 17:03:26 +09:00
Sakamoto Shiina 67611af116 Merge branch 'view' into UI_2.0 2023-10-12 16:19:31 +09:00
Sakamoto Shiina 0bad71decc [Update] Config Window: combine Mic/Speaker Dynamic Energy Threshold and Mic/Speaker Energy Threshold. change the label and description for it. 2023-10-12 16:08:51 +09:00
misyaguziya 5ac4897fa9 👍[Update] README : 文言の修正、shieldsの追加 2023-10-12 15:26:11 +09:00
misyaguziya f82d5bfd54 Merge branch 'model' into UI_2.0 2023-10-12 15:01:00 +09:00
misyaguziya 07ffb89a5d 👍[Update] Model : energyがストップした場合に必ず0になるように終了時関数を追加 2023-10-12 14:59:21 +09:00
Sakamoto Shiina 2d43061f8e [bugfix] Config Window: スレッショルドチェックボタンDisabled処理が、コンパクトモードや設定画面閉じる際に解除されてしまうのを修正。 2023-10-12 14:27:12 +09:00
Sakamoto Shiina 01ade68d4e [Update] Config Window: スレッショルドチェックボタンのDisabled処理追加や変更。Disabledなボタンそのものを追加。 2023-10-12 13:41:14 +09:00
Sakamoto Shiina 46e406bfc4 [Update] Config Window: スレッショルドチェック周りの文言変更(間に合わせ) 2023-10-12 12:22:35 +09:00
Sakamoto Shiina 17b33d57df [Update] Config Window: Mic/Speaker Dynamic Energy Thresholdのオンオフで、Mic/Speaker Energy ThresholdのWidgetを折りたたんだり開いたり。初期値に合わせた動作も含めて実装。
[bugfix] Speaker Dynamic Energy ThresholdにMicのctk variableを設定していたのを修正。
2023-10-12 11:50:39 +09:00
misyaguziya a9b137be02 👍[Update] README : 表示の修正 2023-10-12 11:47:39 +09:00
misyaguziya 318f55065e 👍[Update] README : 2.0.0へ向けて boothのドキュメントを修正 2023-10-12 11:46:58 +09:00
misyaguziya fba51e5847 👍[Update] README : EN版を追加 2023-10-12 11:27:45 +09:00
misyaguziya bbb5fcce30 👍[Update] README : 表現の修正/画像の変更 2023-10-12 10:51:37 +09:00
Sakamoto Shiina fd433754fc [Update] Config Window: デバイスがなかった場合、オプションメニューにはNo Mic Device Detectedなどの表示に。 2023-10-12 10:19:03 +09:00
Sakamoto Shiina a7644fce23 [Update] Config Window: デバイスが検出されなかった場合のdisabled表示一部実装(Mic Host, Mic Device, Speaker Deviceのオプションメニューのみ) そしてその関数の汎用化。
[Chore] Appearance Themeを開発中としてラベル編集。
2023-10-12 09:40:01 +09:00
Sakamoto Shiina 243492ac91 [bugfix] Config Window: オプションメニュー系で、矢印画像とラベルの隙間px指定がテスト用に大きく指定していたままだったのを修正。 2023-10-12 06:37:25 +09:00
Sakamoto Shiina 475da85b51 Merge branch 'view' into UI_2.0 2023-10-12 00:21:27 +09:00
Sakamoto Shiina 3e6bce367c [Update] 各Window表示時に画面の中央に配置するように。(それによって一瞬再配置が見えるので、誤魔化し用でもある)フェードインアニメーション追加とそれら関数の汎用化。 2023-10-11 23:11:59 +09:00
Sakamoto Shiina 8185050ea2 [Update] Config Window: UI Size変更対応(指定していたものは全て対応したはず)。コンパクトモードのラベル日本語対応。
[Refactor] CTkScrollableFrameを使用しているwidgetのUI Size変更対応やCTKのheight bug修正をui_utils.pyへ関数切り出し。
2023-10-11 15:28:54 +09:00
Sakamoto Shiina 1a7cf32dc6 Merge branch 'splash_screen' into UI_2.0 2023-10-11 13:37:39 +09:00
Sakamoto Shiina 379e916428 [Update] Add Splash Screen: 起動中に何かしらの表示をして、ユーザーへのフィードバック。画像は仮置き。 2023-10-11 13:34:58 +09:00
Sakamoto Shiina 1b554c7c0c Merge branch 'separate_create_and_show_GUI' into UI_2.0 2023-10-11 13:22:17 +09:00
Sakamoto Shiina 61ecbe1e84 [Refactor] createGUIを、createGUIとshowGUIに分割。createGUIでは画面を表示せず中身の組み立てや関数登録。showGUIで表示するように。
その他関数名変更(vrct_gui. から呼ぶ関数はすべてアンダーバーをつける。view.pyで呼ばれる関数と区別するため。)
2023-10-11 13:20:09 +09:00
misyaguziya a870efc44b Merge branch 'controller' into UI_2.0 2023-10-11 11:28:11 +09:00
misyaguziya fe34d269dc 👍[Update] Controller : main.pyを切り分け 2023-10-11 11:27:55 +09:00
misyaguziya 3d59e3b265 👍[Update] README : 文言を修正 youtubeリンクを追加 2023-10-11 02:51:50 +09:00
misyaguziya b76ae66b79 👍[Update] README : 画像差し替え 2023-10-11 02:42:52 +09:00
misyaguziya 2996c4e67e 🐛[bugfix] README : 埋め込みが出来なかったので削除 2023-10-11 02:23:22 +09:00
misyaguziya e860a4d912 👍[Update] READE : ドキュメントに書いてある部分を削除/文言変更 2023-10-11 02:11:30 +09:00
Sakamoto Shiina 61fed5d898 Merge branch 'view' into UI_2.0 2023-10-10 19:49:18 +09:00
Sakamoto Shiina 153764f48a [bugfix] Main Window: サイドバーを閉じた時に、root geometry(Windowサイズ)の高さが変わってしまうのを修正。
(コンパクトではあるが、機能としてはサイドバーの開閉なので、意図したサイズ変更ではなかった。)
2023-10-10 19:46:25 +09:00
Sakamoto Shiina 0efecc6daf [bugfix] Main Window: minimize sidebar button. ステータスを一度disabledにして、その後サイドバー開閉を行った時に矢印の向きがおかしくなっていたのを修正。 2023-10-10 19:32:32 +09:00
Sakamoto Shiina 724f1f4eff Merge branch 'view' into UI_2.0 2023-10-10 19:18:15 +09:00
Sakamoto Shiina 33ffa14edf [Update] Config Window: タイトルとウインドウのタイトルのlocalize, UI日本語対応。 2023-10-10 19:13:16 +09:00
Sakamoto Shiina 7b804aba44 [Refactor] 変数名変更、統一。 grid_row/columnconfigureなどでminsize指定している変数はMIN_をつける。_MIN_HEIGHTや_MIN_WIDTHなど。 2023-10-10 19:02:02 +09:00
Sakamoto Shiina 7d33a6dff2 [Update] UI Size変更対応. Main Window Root Geometry. Config Window Root Geometry(tmp) 2023-10-10 18:48:28 +09:00
Sakamoto Shiina ee524bc57e [Update] Main Window: UI Size変更対応. Sidebar Preset tabs, Option Menu's arrow images and Textbox(_ptintToTextbox.py).
[Refactor] Main Window: Textbox(_ptintToTextbox.py) 必要のないコードの削除と統合
2023-10-10 18:28:06 +09:00
Sakamoto Shiina 998fa6d3dc [bugfix] Main Window: Fix the config button size when it is disabled. It changed size unexpectedly before. 2023-10-10 16:48:12 +09:00
Sakamoto Shiina 0b5b3a62fe [Update] Main Window: Language Selectable Window. UI Size変更対応。 2023-10-10 16:14:31 +09:00
Sakamoto Shiina 7fe1cb329a [Refactor] 呼び出し関数名統一
.rowconfigure .columnconfigure を .grid_rowconfigure .grid_columnconfigure と統一。
(.rowconfigure .columnconfigure 側に統一しなかった理由は、.configure関数と大きく区別するため)
2023-10-10 16:13:42 +09:00
Sakamoto Shiina 8957e65e61 [Update] Config Window: Error Message Window. UI Size変更対応。色指定を変数化。
[bugfix] Config Window: Error Message Window. Fix 1px bugs.
2023-10-10 16:13:35 +09:00
Sakamoto Shiina 1722cfecff [Update] Config Window: Dropdown Menu Window. UI Size変更対応(スクロールーバー)
[bugfix] Config Window: Dropdown Menu Window. さらに1pxバグの修正 指定サイズに関わらず、フォントによってheightが変わるので、内部で更に計算して調整。修正。
2023-10-10 16:13:16 +09:00
Sakamoto Shiina 00561ae3ba [Update] Expand available UI Size. It is also for testing more easier. 2023-10-10 16:12:58 +09:00
Sakamoto Shiina 7fd8b089d5 [Update] Config Window: Dropdown Menu Window. UI Size変更対応。
[bugfix] Config Window: Dropdown Menu Window. それに伴いrootのgeometry, positionが崩れたのでその修正。
2023-10-10 16:12:49 +09:00
Sakamoto Shiina 6657903c57 [bugfix] Config Window: Dropdown Menu Window. 1pxバグ修正 生成時にrootのgeometryを手動で計算(pxは偶数に)して保存。表示時にその値をrootのgeometryにセットすることによって修正(今の所この方法しかわからない)。
[Refactor] Config Window: Dropdown Menu Window. 色指定をインスタンス生成時に指定させ汎用化。
2023-10-10 06:15:05 +09:00
misyaguziya f6283e9c93 Merge branch 'build' into UI_2.0 2023-10-09 16:21:59 +09:00
misyaguziya d59a1a05a9 👍[Update] Model : batchファイルを一箇所にまとめた 2023-10-09 16:21:46 +09:00
misyaguziya 944f852285 Merge branch 'autoUpdate' into UI_2.0 2023-10-09 16:14:51 +09:00
misyaguziya ad1e1c98bc Merge branch 'reboot' into UI_2.0 2023-10-09 16:14:42 +09:00
misyaguziya c266a098d4 🐛[bugfix] Model : 不要なcommandを削除 2023-10-09 16:14:28 +09:00
misyaguziya 0bc021cbe8 👍[Update] Model : restart処理を追加 2023-10-09 13:49:22 +09:00
misyaguziya 776501b363 Merge branch 'bugfix_NoDevice' into UI_2.0 2023-10-09 10:27:50 +09:00
misyaguziya 040ca9c8e9 🐛[bugfix] Model : NoDevice -> NoHost 2023-10-09 10:25:58 +09:00
Sakamoto Shiina f98bab23a7 Merge branch 'view' into UI_2.0 2023-10-09 06:33:49 +09:00
Sakamoto Shiina 305b061f1c [Update] Main Window: add Version info and Restart button(VRCT LOGO). ※開発用の一時的なもの。 2023-10-09 06:30:46 +09:00
Sakamoto Shiina 54ff9296b2 Merge branch 'update_software_feature' into UI_2.0 2023-10-09 06:04:41 +09:00
Sakamoto Shiina 4f8bad129b [Update] Update Software関数の受け口追加。update availableボタンを押されるとコールバック関数が呼ばれるように。実際にアップデートも可能状態。
Restart Software関数の受け口追加。
[bugfix] update availableボタンとhelp and infoボタンのコールバック関数指定が逆だったのを修正。(今まで奇跡的にview側もUIボタン側も反対の指定をしていて結果的に機能していました……。)
その他コメントなどコード整形あり
2023-10-09 05:50:04 +09:00
misyaguziya d83bb4cf5a Merge branch 'bugfix_NoDevice' into UI_2.0 2023-10-09 00:17:41 +09:00
misyaguziya aa3ca4036e 🐛[bugfix] Model : Deviceが一つもない場合に"NoHost"/"NoDevice"でセットするように修正 2023-10-09 00:17:27 +09:00
misyaguziya 8ac248bf3d Merge branch 'autoUpdate' into UI_2.0 2023-10-08 23:45:59 +09:00
misyaguziya b8994ffd87 👍[Update] Model : updateSoftwareに再起動の引数を追加 2023-10-08 23:45:44 +09:00
Sakamoto Shiina 58ec4cd183 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-10-08 22:54:00 +09:00
Sakamoto Shiina ddbf15abce Merge branch 'view' into UI_2.0 2023-10-08 22:52:18 +09:00
Sakamoto Shiina 7be50d0010 [Chore] remove the code that is no longer in use 2023-10-08 21:05:25 +09:00
Sakamoto Shiina c87c3fa4da [Chore] Config Window: 各設定項目の一番最後の要素 border bottom消し。
項目の移動や追加などで毎回指定するのが手間なので後回しにしていたが、リリースに向けて今回すべて指定。
2023-10-08 20:58:10 +09:00
Sakamoto Shiina 9fce7f6a94 [bugfix] Config Window: Dropdown Menu Window. スクロールバー幅が左右で違っていたのを修正。
各Windowに1pxバグ検出用色追加と調整。
2023-10-08 20:49:17 +09:00
Sakamoto Shiina 1e220281ba [Update] Dropdown Window and Selectable Language WIndow: add cursor=hand2. and the color when it is hovered and clicked.
[Chore] remove the CTkFrame widget that was meaningless.
2023-10-08 20:24:32 +09:00
Sakamoto Shiina e80ba886d7 [Chore] Config Window: Setting Box. ホバー時のOption Menuの色が明るすぎる気がしたので少しだけ暗く。 2023-10-08 20:08:56 +09:00
Sakamoto Shiina 95758919bd [Update] Config Window: Dropdown Menu Window. Width指定。フォントやデバイスなどテキストが長くなるものは幅を広めに。(可変は難しいので今は指定型に) 2023-10-08 20:03:55 +09:00
Sakamoto Shiina 39472e64c4 [Refactor] UiScalingManager: 変数名変更、汎用化。Entry widget以外でも使いたくなったので。 2023-10-08 14:15:20 +09:00
Sakamoto Shiina b47738b424 [bugfix] Config Window: Dropdown Menu Window. Set the maximum height to be 8 times the label's height, and adjust it if the value's length is less than 8. 2023-10-08 12:43:07 +09:00
Sakamoto Shiina 7e33f04baa [Update] Config Window: DropdownMenu追加。前回コミットではOption Menuをクリックしても何も起こらなかったが、DropdownMenuとして選択肢を表示。選択された際の機能も今まで通り。
grab_set廃止。focus_setやliftを使ってこちらでコントロール。 理由は、設定画面上で新たにDropdown Menu Windowを生成し、選択肢をクリックする際邪魔になるため。
2023-10-08 11:13:18 +09:00
misyaguziya e7b362bfe9 Merge branch 'requirements' into UI_2.0 2023-10-07 22:35:57 +09:00
misyaguziya c4cd3772cd 👍[Update] パッケージのバージョンを固定 2023-10-07 22:35:46 +09:00
Sakamoto Shiina 8dd1ddd6ac [Update(tmp)] ※Dropdown Menu開きません。 Config Window: Option Menu系widgetを全てframeを使った自作widgetにすり替え。 2023-10-07 01:30:18 +09:00
Sakamoto Shiina 29e106ce9a Merge branch 'view' into UI_2.0 2023-10-06 08:57:36 +09:00
Sakamoto Shiina a393f80e23 [Chore] Change the variable names of color to appropriate ones. Option MenuなのにDropdown Menuとして表記していたので。 2023-10-06 08:09:24 +09:00
Sakamoto Shiina b1058efebe [Refactor] Main Window: Language Settings. Option Menu. 関数切り出し、汎用化。 2023-10-06 07:35:16 +09:00
Sakamoto Shiina ff4460620b [bugfix] Main Window: Language Settings Preset Tabs. 見た目は上側だけの角丸に。(4pxから6pxにもしている)
具体的にはplace使って要素を下にずらし、下角丸を隠している。(text_boxのtabsでは既に同じことをしている)
2023-10-06 02:57:15 +09:00
Sakamoto Shiina be02b948aa [Chore] Main Window: add corner_radius=4 to language settings button and the tab switches that is belong to. 2023-10-06 01:06:18 +09:00
Sakamoto Shiina 5270c680a5 [Refactor] main.pyからview.setGuiVariable系への引数で、型変換していたのをなくし、view側で変換するように。
(型変換はview側の都合だと思ったため)
2023-10-05 13:28:14 +09:00
Sakamoto Shiina 5e110cea8b Merge branch 'view' into UI_2.0 2023-10-05 11:10:08 +09:00
Sakamoto Shiina 53cb8d9088 [Update] Config Window:
エラーメッセージ表示機能(メッセージ内容は仮置き): バリデーションにより無効な値を入力した場合にエラーメッセージを表示。エラーメッセージは新しくWindowを作って被せる形にしています。他の部分をクリックしたり、ホイールによるスクロールなどで画面外へいった時に消したりなどの処理も実装。

Entry Widget系フォーカスアウト機能:そのWidget外をクリックした時にちゃんとフォーカスアウトし、その際にconfigに保存されている有効な値をセット。
(今のところTranscription項目内のEntry Widgetがある項目のみ)

[bugfix] Main Window: Modal Windowのevent unbindに、ちゃんとIDを指定してunbindするように。(vrct_gui.py line 90)
2023-10-05 10:51:15 +09:00
misyaguziya f95656ab8d Merge branch 'autoUpdate' into UI_2.0 2023-10-04 11:37:04 +09:00
misyaguziya a936740aa4 👍[Update] Model: AutoUpdate機能を追加 2023-10-03 02:18:07 +09:00
Sakamoto Shiina 584eb7e33a [Update] add Modal Window: When the configuration window is opened, cover the main window with a modal window containing a message. 2023-10-02 14:48:42 +09:00
Sakamoto Shiina 491893acc4 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-10-01 13:45:49 +09:00
Sakamoto Shiina 54a1174d9e Merge branch 'view' into UI_2.0 2023-10-01 13:43:55 +09:00
Sakamoto Shiina 913b18c5cc [Chore] remove the code that is no longer in use 2023-10-01 13:40:54 +09:00
Sakamoto Shiina c287df5c10 [bugfix/Refactor] Config Window: Setting Box周り。謎の1pxバグ修正(無理やり)と、要素の幅が合っておらず、文字数などの影響により幅が広くなり、意図していない線が見えていたのを修正。
(rowやcolumn, sticky指定、セクションタイトルの指定方法の変更など。)
2023-10-01 13:28:37 +09:00
misyaguziya ecabd835c2 Merge branch 'model' into UI_2.0 2023-09-30 23:00:19 +09:00
misyaguziya 6c04d496c9 🐛[bugfix] Model: Mic/SpeakerのデバイスがNoneの場合にTranscriptもしくはCheckEnergyの処理をしないようにフェールセーフ処理を追加 2023-09-30 22:51:23 +09:00
misyaguziya 494324fd8f 🐛[bugfix] Model: MicもしくはSpeakerが一つも接続されていない状態でデバイス情報を取得した場合にNoneになるように修正 2023-09-30 22:41:52 +09:00
Sakamoto Shiina 49ac0a62d4 [bugfix] Config Windowのwithdraw()コメントアウト戻し忘れ修正。 2023-09-29 02:55:34 +09:00
Sakamoto Shiina ebdb326af7 Merge branch 'view' into UI_2.0 2023-09-29 02:53:47 +09:00
Sakamoto Shiina 3a4be19bb5 [Refactor/fix] Config Window: _SettingBoxGenerator周りのリファクタリング。見た目は同じだけど構造を結構変えている。
また、ui_utilsにあるcreateButtonWithImageは、circleを廃止。
2023-09-29 02:51:51 +09:00
Sakamoto Shiina af07c85bf4 [Refactor] Main Window: Sidebar Compact Mode. 初期配置の処理方法を他に合わせて調整。 2023-09-27 22:22:22 +09:00
Sakamoto Shiina d6edea6be3 Merge branch 'fix_config_window_compact_mode' into UI_2.0 2023-09-27 21:46:24 +09:00
Sakamoto Shiina 2270cff006 [fix] Config Window: Compact Mode. 今までDestroy()してWidgetsが再生成されていたのを、grid_removeを使う方法に変更、これによりコンパクトモード切り替えがスムーズになりました。 2023-09-27 21:44:36 +09:00
Sakamoto Shiina 5a5d4ad3b8 [bugfix] Main Window: Selectable Language Window: Callback関数を誤って消してしまっていたのを修正。
メモ: 消してしまってた問題のコミットハッシュ「0efd82b04997fb4fcf381d27ba7c36675fc62658」
2023-09-26 17:58:06 +09:00
Sakamoto Shiina e64269dcc4 Merge branch 'view' into UI_2.0 2023-09-26 16:03:11 +09:00
misyaguziya 4c0cf3043a Merge branch 'build' into UI_2.0 2023-09-26 15:53:49 +09:00
misyaguziya c42257394b 👍[Update] build.bat : localesを追加 2023-09-26 15:53:04 +09:00
Sakamoto Shiina 0efd82b049 [Update/bugfix/Refactor] Main Window: Sidebar Compact Mode 有効無効値がjsonに保存されていなかったのを修正、起動時も保持されるように。 コンパクトモード有効無効関数分け。 main.pyで受け取るmain window系 callback関数のkeyをまとめた。 2023-09-26 15:48:47 +09:00
Sakamoto Shiina 9495df1016 Merge branch 'localization' into UI_2.0 2023-09-26 12:43:12 +09:00
Sakamoto Shiina cae92e2252 [Update] Config Window: Localization. とりあえずの日本語さらに追加(表記ゆれあり) 2023-09-26 12:40:48 +09:00
Sakamoto Shiina d58ad09708 [Update] Config Window: Localization. 各項目のタイトルを変数化、多言語対応。(それに合わせて切り替え処理も) 2023-09-26 11:39:35 +09:00
Sakamoto Shiina b0d734e19b [Update] Localization. add python-i18n into requirements.txt. 英語と日本語の一部対応。設定項目のDescriptionなど一部省いたり調整あり。 2023-09-26 11:38:20 +09:00
Sakamoto Shiina 7eee987e0f Merge branch 'bugfix_setting_box' into UI_2.0 2023-09-25 23:02:21 +09:00
Sakamoto Shiina 14cb8f11ca [bugfix] message formatのcallback関数指定ミス修正 2023-09-25 23:01:23 +09:00
Sakamoto Shiina b91c31f793 Merge branch 'view' into UI_2.0 2023-09-25 13:28:02 +09:00
Sakamoto Shiina e86a9c6048 [Update] Config Window: Setting box, Font Family. アルファベット順にsortし、@(縦書き)のフォントを排除。 2023-09-25 13:18:44 +09:00
Sakamoto Shiina abcc7ef80e [Update] Update Available ButtonとHelp and Info Buttonが押されたときのリンク先(URL)をconfigから読み取るように。 2023-09-25 12:42:23 +09:00
misyaguziya 1f3cac717a Merge branch 'config' into UI_2.0 2023-09-25 07:07:42 +09:00
misyaguziya 17504793ef 🐛[bugfix] Config : コメントの位置を修正 2023-09-25 07:07:28 +09:00
misyaguziya 755b4f580c Merge branch 'config' into UI_2.0 2023-09-25 05:40:39 +09:00
misyaguziya 06ba68ecdd 👍[Update] Main Init : configで保存する変数削除に伴い、初期化処理を追加 2023-09-25 05:40:28 +09:00
misyaguziya b259a2a3d8 👍[Update] Config : config.jsonに保存するデータを仕分け
保存する必要のある変数は@json_serializable('XXX')でデコレートするように変更
2023-09-25 05:39:06 +09:00
Sakamoto Shiina 25d6e03cb0 Merge branch 'view' into UI_2.0 2023-09-24 21:39:14 +09:00
Sakamoto Shiina bfda7a6e25 [Update] Update通知ボタン、Help and Infoボタンを押したときにview.pyで定義しているコールバック関数が呼ばれるように。
実際にリンク先に飛ぶがURLは仮置き。
2023-09-24 20:42:40 +09:00
misyaguziya 80e8c0d2b3 Merge branch 'model_update_notification' into UI_2.0 2023-09-24 05:42:59 +09:00
misyaguziya 95a9adadef 👍[Update] Main Window : UPDATE_FLAGへの処理を削除 2023-09-24 05:41:00 +09:00
misyaguziya 7662dd4bf5 👍[Update] Main WIndow : update処理をmodelの変更に合わせて修正
updateの結果から直接viewを変更する
2023-09-24 05:38:48 +09:00
misyaguziya a9692a2ee9 👍[Update] model : update結果をreturnで出力するように変更 2023-09-24 05:36:39 +09:00
Sakamoto Shiina c532861091 Merge branch 'feature_update_notification' into UI_2.0 2023-09-23 17:18:32 +09:00
Sakamoto Shiina ed795cfd9f [Update] Main Window: Update通知UI デフォルトは非表示で、main.py側でconfig.UPDATE_FLAGを見て表示するかどうかの関数追加。(実際にconfig変数を見るかどうかは別担当 misya へ引き継ぎ) 2023-09-23 17:13:41 +09:00
Sakamoto Shiina c072a5a406 [Update] Main Window: Update通知ボタンをクリックすると、クライアント側で設定されているデフォルトブラウザを開く。リンク先はBooth VRCTページ。 2023-09-23 16:09:09 +09:00
Sakamoto Shiina 79e70089cd [Chore] Main Window: 色調整。トップバーのボタン類の色指定まとめ。クリック時の色を少しだけ薄く。 2023-09-23 15:50:00 +09:00
Sakamoto Shiina 4d9600159b [Update] Main Window: 色やUIスケール変更に対応するために変数追加。指定。 2023-09-23 15:34:11 +09:00
Sakamoto Shiina 34c61291bb [Update] Main Window: Update通知のUI追加。見た目だけ。(常に表示状態) 2023-09-23 14:31:35 +09:00
misyaguziya 2fedd8b0bc Merge branch 'makefile' into UI_2.0 2023-09-22 16:44:23 +09:00
misyaguziya bcf9eba5e3 🔧 [Add] build.bat
pyinstallerでexe生成するためのbat
2023-09-22 16:44:12 +09:00
misyaguziya 213d08bc7e Merge branch 'model' into UI_2.0 2023-09-21 22:42:31 +09:00
misyaguziya 9410dc8291 🐛[bugfix] 文字起こしのstop処理のバグを修正 if self.mic_energy_recorder != None:この処理が問題だったので関連して全部修正 2023-09-21 22:42:10 +09:00
Sakamoto Shiina 6618cc6129 Merge branch 'view' into UI_2.0 2023-09-21 19:27:52 +09:00
Sakamoto Shiina 0344c9ae34 [bugfix] Config Window: 謎の各項目間に、想定より+1pxボーダー入ってしまうのを修正(無理やり)
偶然見つけた方法です。設定画面改修はいずれ必要なので、とりあえずという修正です。
2023-09-21 19:24:54 +09:00
Sakamoto Shiina 617f1a4d08 [typo] Config Window: 設定項目のtypoや少し文法修正 2023-09-21 16:00:55 +09:00
Sakamoto Shiina 43055d493e Merge branch 'view' into UI_2.0 2023-09-21 14:58:46 +09:00
Sakamoto Shiina 48fd43b2a9 [bugfix] Config Window: attribute指定ミス修正や表記揺れ修正 2023-09-21 14:57:49 +09:00
Sakamoto Shiina bd9f0bb58c [Refactor] remove the code that is no longer in use 2023-09-20 23:20:42 +09:00
Sakamoto Shiina 4cd62309c6 Merge branch 'view' into UI_2.0 2023-09-20 21:07:13 +09:00
Sakamoto Shiina 4176ec4cb0 [Refactor] IS_CONFIG_WINDOW_COMPACT_MODE をview_variableへ移動。 2023-09-20 21:01:58 +09:00
Sakamoto Shiina cfca2be71e [Refactor] Config Window: Setting Box回り。共通で使う変数をクラス変数にしたり、ctm(色)やuism(サイズ)もsettingsにまとめたり。 2023-09-20 20:02:07 +09:00
Sakamoto Shiina c3b7c735dd [Refactor] Config Window: Setting Box回り。特に意味のない関数の切り出しをなくしたり。
※テスト用のコードはコメントアウトしてそのままです。
2023-09-20 17:39:18 +09:00
misyaguziya 0826d9ef0c Merge branch 'model' into UI_2.0 2023-09-18 12:42:25 +09:00
misyaguziya 4cd3bf741e 👍[Update] main ConfigWindow Open/Close時のTranscriptionの処理を単独の処理に変更 2023-09-18 12:42:01 +09:00
misyaguziya c80fcabe67 Merge branch 'model' into UI_2.0 2023-09-18 03:27:05 +09:00
misyaguziya acd9373938 👍[Update] model change method check osc 2023-09-18 03:26:53 +09:00
misyaguziya fee6c5c62d Merge branch 'model' into UI_2.0 2023-09-17 18:47:45 +09:00
misyaguziya cd7f4aa614 👍[Update] OSCのcheckが完了するまでOSCのテストを続けるように変更 2023-09-17 18:47:33 +09:00
misyaguziya 8c3f2cb243 Merge branch 'model' into UI_2.0 2023-09-17 18:13:48 +09:00
misyaguziya e29d5ae9d4 👍[Update] OSCの有効性のエラーログの表示を起動時のみに変更 2023-09-17 18:13:32 +09:00
Sakamoto Shiina 58d60c20da Merge branch 'view' into UI_2.0 2023-09-17 15:07:00 +09:00
Sakamoto Shiina f0abb8bcfa [Update] add function to view.py and print system message when switched language preset and selected language. 2023-09-17 14:57:16 +09:00
Sakamoto Shiina bc6547cf5c [Chore] remove the print code that is under vrct_gui directory. 2023-09-17 12:45:05 +09:00
Sakamoto Shiina d90bd7fcfa Merge branch 'fix_logger_message' into UI_2.0 2023-09-17 12:30:06 +09:00
Sakamoto Shiina 6e0efd6607 [Update] Loggerで出力する際のタグ変更 [SEND] [RECEIVE] -> [SENT] [RECEIVED] 2023-09-17 12:24:08 +09:00
Sakamoto Shiina 5e97741812 Merge branch 'osc_check_variable_and_callbacks' into UI_2.0 2023-09-17 12:05:07 +09:00
Sakamoto Shiina 6f5b7983a9 [Update] add config variable and callback, ENABLE_SEND_MESSAGE_TO_VRC and callbackSetEnableSendMessageToVrc.
add Config Window Setting Item(Send Message To VRChat)
2023-09-17 12:01:23 +09:00
Sakamoto Shiina 43133ac7ad [Chore] Auto Clear The Message BoxはデフォルトでONに。 2023-09-17 10:23:24 +09:00
Sakamoto Shiina c719f7b510 Merge branch 'view' into UI_2.0 2023-09-17 09:28:53 +09:00
Sakamoto Shiina 5e7174501d [refactor] Main Window: Sidebar開閉ボタンを開閉時に毎回destroyしてwidget再生成していたのを、grid_removeとgridに置き換えて、再生成しないように。 2023-09-17 09:24:27 +09:00
Sakamoto Shiina 7f888ea08a Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-17 08:37:47 +09:00
Sakamoto Shiina 10adecec7a Merge branch 'startup_osc_enabled_check' into UI_2.0 2023-09-17 08:37:05 +09:00
Sakamoto Shiina 7a8aa701d2 [Update] 変数名変更とそれに合わせてUIの文言調整 ENABLE_OSC_ERROR_LOG -> STARTUP_OSC_ENABLED_CHECK
VRCT起動時にOSCが有効かどうかのチェックアクションをするかどうかという意味に。
2023-09-17 08:34:19 +09:00
misyaguziya f6071edd75 Merge branch 'model' into UI_2.0 2023-09-17 07:41:53 +09:00
misyaguziya e84764dcd9 🐛[bugfix] main config.ENABLE_TRANSCRIPTION_SEND is True かつ config.ENABLE_TRANSCRIPTION_RECEIVE is Trueの場合にデバイスドライバのアクセス干渉が起きないようにNOPを追加 2023-09-17 07:40:07 +09:00
misyaguziya b31cfc0487 🐛[bugfix] model stopCheckMicEnergy/stopCheckSpeakerEnergyの終了処理をstopMicTranscript/stopSpeakerTranscriptの処理と同じになるように修正 2023-09-17 07:38:51 +09:00
Sakamoto Shiina 5fc4f04adc Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-17 06:53:52 +09:00
Sakamoto Shiina fa9b2f6f60 Merge branch 'view' into UI_2.0 2023-09-17 06:53:37 +09:00
misyaguziya d375df1720 Merge branch 'config_callback' into UI_2.0 2023-09-17 06:43:20 +09:00
misyaguziya 7ebc06d049 👍[Update] main configWindow open/close時に最前面表示ONの場合の処理を追加 2023-09-17 03:58:41 +09:00
Sakamoto Shiina 5f0cca062d [Update] Config Window: Add chackboxes ENABLE_OSC and ENABLE_OSC_ERROR_LOG to setting box. 2023-09-16 20:34:25 +09:00
Sakamoto Shiina 5a95fccd37 [Update] Config Window: 設定画面の選択されたタブ情報を保存。設定画面開閉、コンパクトモード切り替え時でも前回開いていたタブが選択された状態で表示されるように(VRCT再起動で初期表示タブへとリセット) 2023-09-16 17:37:26 +09:00
misyaguziya a4e21f02bb Merge branch 'bugfix_authcheck' into UI_2.0 2023-09-16 03:04:03 +09:00
misyaguziya 4b0b573645 🐛[bugfix] 翻訳エンジンを変更した時に常にmodel.authenticationTranslator(...)を行うように修正
エンジン変更時にmodel.translator.translator_statusのステータスを変更する必要があった
2023-09-16 03:03:52 +09:00
Sakamoto Shiina 44463faa7b Merge branch 'view' into UI_2.0 2023-09-15 17:55:45 +09:00
Sakamoto Shiina 5d7c34a6bf [bugfix](Not enough) Sidebar Language Settings DropdownMenuボタン自体を押した時の開閉が機能していなかったのを修正。ただ無理やりなうえに根本的な解決ではないので、長押しだったり、早い操作だったりすると現状予期せぬ動作は起こる。(エラーが出るわけではない見た目の問題。開閉が正しく行われないなど) 2023-09-15 17:50:14 +09:00
Sakamoto Shiina cdc8495f99 [Update] Main Window: Sidebar Language SettingsのDropdownMenuボタンのホバー時に、カーソル変更を追加。
[bugfix] 矢印img部分ホバー時の色変更処理し忘れを修正
2023-09-15 15:03:50 +09:00
Sakamoto Shiina 0ea26a5387 [bugfix] 設定画面閉じた時に、マイク/スピーカー スレッショルドチェックボタンがそのままなのを修正
ProgressBarに0をセットする関数をview.pyにとりあえず追加。
2023-09-15 14:42:14 +09:00
Sakamoto Shiina 23b15a8a67 [bugfix] Config Window: Add functions that replaces the threshold check button's passive/active state within the callbackCloseConfigWindow function(main.py). 2023-09-15 13:52:54 +09:00
Sakamoto Shiina 41d8e9ca87 [Refactor] view.py系の関数名変更 2023-09-15 13:33:44 +09:00
Sakamoto Shiina 34cd261128 [Add] Config Window開閉時のCALLBACK関数の受け取り、実行処理を追加 2023-09-15 11:40:36 +09:00
Sakamoto Shiina 4c0f356ee1 [Chore] remove the code that is no longer in use. and fixed some comments. 2023-09-15 10:58:33 +09:00
Sakamoto Shiina 94433fe3e2 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-15 09:59:45 +09:00
Sakamoto Shiina 10594cd204 Merge branch 'view' into UI_2.0 2023-09-15 09:57:47 +09:00
Sakamoto Shiina cbef891fe8 [Update] Main Window: Textbox デザイン大幅変更。テスト用or今後ユーザーがデザインカスタム設定する際に使えるサンプルとして会話を挿入する関数追加。 2023-09-15 09:51:41 +09:00
misyaguziya 63d2f4962c Merge branch 'config_callback' into UI_2.0 2023-09-15 06:43:19 +09:00
misyaguziya 9aeea21498 👍[Update] main add stop check Energy function for callbackCloseConfigWindow 2023-09-15 06:43:08 +09:00
misyaguziya 9eb8c305d2 Merge branch 'config' into UI_2.0 2023-09-14 17:32:50 +09:00
misyaguziya 4e4ca0076a Merge branch 'bugfix_wordfilter' into UI_2.0 2023-09-14 17:32:42 +09:00
misyaguziya c258156a54 Merge branch 'config_callback' into UI_2.0 2023-09-14 17:32:36 +09:00
misyaguziya af1396876d 🐛[bugfix] config config.jsonがUnicodeエスケープで保存される問題を修正 2023-09-14 17:32:18 +09:00
misyaguziya bf263c91d5 🐛[bugfix] model 削除する変数を間違えていた問題を修正
del self.translator -> del self.keyword_processor
2023-09-14 17:29:50 +09:00
misyaguziya f4026816ee 👍[Update] main Add callback ConfigWindow Open/Close 2023-09-14 16:32:10 +09:00
Sakamoto Shiina f27e4985cd [Refactor] Main Window: _printToTextbox. textboxへの出力関数のリファクタリング2
textbox widget指定を_printToTextbox関数内で行うように。
2023-09-14 05:13:47 +09:00
Sakamoto Shiina 6af238b754 [Chore] Config Window: change the config window title to Settings for the production env. 2023-09-14 04:13:11 +09:00
Sakamoto Shiina 2fe9de0d19 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-14 03:24:33 +09:00
Sakamoto Shiina ccf5605b4a Merge branch 'view' into UI_2.0 2023-09-14 03:14:15 +09:00
Sakamoto Shiina 43a880775b [Refactor] Main Window: _printToTextbox. textboxへの出力関数のリファクタリング。
view.pyではターゲットタイプとメッセージを渡すだけにして、vrct_gui内でwidgetの取得と、allタブへの出力自動設定を行うように。
2023-09-14 03:06:12 +09:00
misyaguziya 0e09634c3f Merge branch 'favicon' into UI_2.0 2023-09-14 02:40:12 +09:00
misyaguziya 504cd6e802 🐛[bugfix] faviconをマルチアイコンに変更 2023-09-14 02:40:01 +09:00
misyaguziya 4b1482fade Merge branch 'gitignore' into UI_2.0 2023-09-14 02:25:40 +09:00
misyaguziya fbd940310a 👍[Update] gitignoreにlogsを追加 2023-09-14 02:25:29 +09:00
misyaguziya d5dfe2219e Merge branch 'icon' into UI_2.0 2023-09-14 02:24:07 +09:00
misyaguziya 7b15aff02e 👍[Update] ファビコンを新しいものに変更 2023-09-14 02:23:11 +09:00
misyaguziya ecfd278f96 👍[Update] main PHRASE_TIMEOUTとRECORD_TIMEOUTの設定値で上下限の条件を追加 2023-09-14 02:21:17 +09:00
Sakamoto Shiina 0b1e731246 [Update] Main Window: Sidebar Language Settings DropdownMenu開閉機能をトグル式に。
Selectable Languages Window: タイトル追加。今開いているものがYour LanguageなのかTarget Languageなのか分かるように。
メイン画面のサイズに合わせて開くウインドウのサイズも変わるように。
2023-09-13 16:31:44 +09:00
Sakamoto Shiina 3714162340 [Update] Main Window: Sidebar Language Settings DropdownButton ホバー時とクリック時の色を追加。
その他要らないコードの削除や、widgetの親frameの指定忘れ(被り)の修正。
2023-09-13 10:14:57 +09:00
Sakamoto Shiina bbfbb5e5dc Merge branch 'view' into UI_2.0 2023-09-13 00:06:05 +09:00
Sakamoto Shiina 60e73760a7 [bugfix] CTkEntry系で、入力値に簡易バリデーション追加。
TkinterのVariableを使っているCTkEntryは、型を可能なものはStrings型に。(空文字などint型に変換できずエラーになってしまうので)
UI側ではどんな型であれ値であれコントローラへ値を渡し、コントローラが判断して処理するように(CTkEntryにセットしたり値を削除したり)
2023-09-12 23:24:05 +09:00
misyaguziya f071be5cb6 Merge branch 'bugfix_translation' into UI_2.0 2023-09-12 11:58:05 +09:00
misyaguziya 658cddc9d6 🐛[bigfix] DeepL Auth Keyの利用上限に達した場合の処理を追加 2023-09-12 11:31:22 +09:00
misyaguziya d352e4ded6 Merge branch 'model_callback' into UI_2.0 2023-09-12 10:39:18 +09:00
misyaguziya 9975dc6ba0 👍[Update] main loggerのcallbackを設定/翻訳を使わない場合に翻訳部分の()をlogに残さないように修正 2023-09-12 10:38:44 +09:00
misyaguziya 6c88a541e1 🐛[bugfix] model loggerの再動作時にファイルが生成されるように修正、logsフォルダへのパスも修正 2023-09-12 10:38:44 +09:00
misyaguziya ae4e77d390 🐛[bugfix] model INPUT_MIC_RECORD_TIMEOUTとINPUT_MIC_PHRASE_TIMEOUTの大小による文字起こしのバグを修正 2023-09-12 10:38:21 +09:00
Sakamoto Shiina 73d8df9166 [Chore] view.py register引数の変数名変更. config_windowなど特に、変数名被りを防ぐため。 2023-09-12 10:37:21 +09:00
Sakamoto Shiina e15b711464 [bugfix] view.py register関数内で、引数が指定されなかった場合でもエラーがでないように処理を変更。 2023-09-12 10:37:20 +09:00
Sakamoto Shiina 80a1ad5d1a [Add] Config Window: Auto Export Message Logs(LOGファイル出力機能)を設定項目に追加。カテゴリーはOthersとした。 2023-09-12 10:36:59 +09:00
misyaguziya 62e297822c Merge branch 'model' into UI_2.0 2023-09-12 09:43:14 +09:00
misyaguziya 73c9ea4e03 👍[Update] model INPUT_MIC_RECORD_TIMEOUTとINPUT_MIC_PHRASE_TIMEOUTの大小による文字起こしのバグを修正 2023-09-12 09:42:23 +09:00
Sakamoto Shiina 7c46520380 Merge branch 'view' into UI_2.0 2023-09-12 09:19:43 +09:00
Sakamoto Shiina 7a5860442c [Chore] view.py register引数の変数名変更. config_windowなど特に、変数名被りを防ぐため。 2023-09-12 09:16:18 +09:00
misyaguziya cd46a16178 👍[Update] model view.printToTextbox_OSCError()の動作条件にENABLE_OSC_ERROR_LOGを追加 2023-09-12 09:04:24 +09:00
misyaguziya cd78cadbbb 👍[Update] config ENABLE_OSC_ERROR_LOGを追加 2023-09-12 09:03:17 +09:00
Sakamoto Shiina 9b3a347c2a [bugfix] view.py register関数内で、引数が指定されなかった場合でもエラーがでないように処理を変更。 2023-09-12 09:00:36 +09:00
misyaguziya ac37851c7d 👍[Update] model func OSC Change Input Voice 2023-09-12 08:49:27 +09:00
Sakamoto Shiina 5a257c93fd [Add] Config Window: Auto Export Message Logs(LOGファイル出力機能)を設定項目に追加。カテゴリーはOthersとした。 2023-09-12 07:14:36 +09:00
Sakamoto Shiina 9c04034cc8 Merge branch 'view' into UI_2.0 2023-09-11 04:58:46 +09:00
Sakamoto Shiina 7adc08ed93 [Update] VRCTテーマカラー変更によりPRIMARY COLORの変更、その調整と適用。 2023-09-11 04:55:18 +09:00
Sakamoto Shiina 7baed52999 [Update] Main Window: 全体的に色を明るく。Textboxでたくさんの文字を常に見る事を考えるとハレーションを起こしそうなので、コントラスト比を下げた。それに伴いサイドバーの色なども変えないとおかしいので全体的に色が明るく。 2023-09-11 04:22:37 +09:00
Sakamoto Shiina 99f3d8551c Merge branch 'view' into UI_2.0 2023-09-10 07:38:56 +09:00
Sakamoto Shiina 7404ea80ea [bugfix] Main Window: Language Settingsボタンのステータス変更時に出るエラーを修正(コメントアウトなうえに見た目だけのdisabledなので押せる) 2023-09-10 07:34:39 +09:00
Sakamoto Shiina c841ceda18 [Update] Main Window: 言語選択ウィンドウにスクロールフレームを追加。サイズも無理やりではあるけどメイン画面に合わせて調整。 2023-09-10 07:08:07 +09:00
Sakamoto Shiina 9f9cd1e64c [Add] Main Window: Language Settings. 言語選択ボタンを押して言語選択ウィンドウ開閉時に、矢印の向きが反転するように。
[Bugfix] 根本的な解決ではないけれど、言語選択ウィンドウの開く位置が固定されてしまうのでその修正(サイドバーの幅は可変なので、それに合わせてウィンドウ生成時に毎回位置を指定)
2023-09-09 11:35:24 +09:00
Sakamoto Shiina 5222f7cc68 [Chore] remove the code that is no longer in use 2023-09-09 06:24:45 +09:00
Sakamoto Shiina 0c43fd8965 [Update] Main Window: Language Settings.言語選択時のドロップダウンメニューを既存のものからカスタムしたものに変更。とりあえず機能する状態。 2023-09-09 06:17:53 +09:00
Sakamoto Shiina 7b9baf09a9 Merge branch 'view' into UI_2.0 2023-09-06 10:57:14 +09:00
Sakamoto Shiina b596f6df54 [bugfix] Main Window: Config Buttonが、サイドバーコンパクトモード時に表示されなかったのを修正。(無理やり) 2023-09-06 07:47:06 +09:00
Sakamoto Shiina cd16666aa7 [Add] Main Window: Text box回りの変数をview.pyへ追加。
Text boxのtabの生成方法を変えたため、無駄な処理が減った。(ラベル群の中で最大文字数に合わせて中央揃え ということがしたかったために今まで遠回りなことをしていた。)
2023-09-06 07:13:03 +09:00
Sakamoto Shiina 128878c1cf Merge branch 'view' into UI_2.0 2023-09-06 05:29:30 +09:00
Sakamoto Shiina 9583203a35 [Refactor] view.py以下でself使っていなかった関数に@staticmethodデコレータ追加 2023-09-06 04:56:11 +09:00
Sakamoto Shiina 83fab83f5b [Chore] 関数名変更 updateConfigWindowTransparency -> setMainWindowTransparency
設定画面からCALLBACKで呼ばれて扱う関数ではあるものの、実際に影響するのは今のところメイン画面だけなのでそういう意味での変更と、
view.pyでconfigから値を読み込んでいたのを、引数で渡してそれをただセットする関数に変更。そのため名前はupdateではなくsetに。
2023-09-06 04:18:14 +09:00
Sakamoto Shiina 10b22d9aa3 Merge branch 'design' into UI_2.0 2023-09-06 04:02:08 +09:00
Sakamoto Shiina ec5732ec2e [Update] New VRCT Logo! replace to the new one. so adjust UI position and scaling for it. 2023-09-06 03:59:44 +09:00
Sakamoto Shiina 1133334d36 Merge branch 'view' into UI_2.0 2023-09-06 02:33:56 +09:00
misyaguziya 74769883de Merge branch 'config_Transparency' into UI_2.0 2023-09-06 02:24:49 +09:00
misyaguziya f12a5d10a5 👍[Update] Config Window transparencyが変化するように実装を追加 2023-09-06 02:23:24 +09:00
Sakamoto Shiina 89352885a0 Merge branch 'bugfix_config_window_compact_mode' into UI_2.0 2023-09-06 00:58:51 +09:00
misyaguziya 5db665ecf1 🐛[bugfix] model.py コールバックの関数(fnc)が呼べないことを考慮してtry exceptで囲うように修正 2023-09-06 00:55:28 +09:00
Sakamoto Shiina 9ce41dad10 [Test] bugfix_config_window_compact_mode 2023-09-06 00:44:13 +09:00
Sakamoto Shiina 93a130801f Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-06 00:27:39 +09:00
misyaguziya 4df19b6a53 Merge branch 'bugfix_model_transcription' into UI_2.0 2023-09-06 00:26:09 +09:00
misyaguziya 0ad9652d3e 🐛[bugfix] speaker_energy_get_progressbar -> speaker_energy_recorderに変更 2023-09-06 00:25:21 +09:00
misyaguziya f6fc7bc5cb Merge branch 'UI_2.0' of https://github.com/misyaguziya/VRCT into UI_2.0 2023-09-05 23:49:24 +09:00
misyaguziya 372c7eebf1 Merge branch 'config_word_filter' into UI_2.0 2023-09-05 23:49:15 +09:00
misyaguziya 143af06b91 👍[Update] wordfilterのコメントアウトを削除 2023-09-05 23:49:00 +09:00
Sakamoto Shiina ca3333d717 [Add] Main Window: view.pyへの変数移動 Language Settings回り。 2023-09-05 23:42:23 +09:00
misyaguziya bcde7b6c4d Merge branch 'energy_ProgressBar' into UI_2.0 2023-09-05 23:13:27 +09:00
misyaguziya 408a4d7996 👍[Update] マイク/スピーカーのデバイス変更時にenergyのProgressBarの動作を停止するように変更 2023-09-05 23:12:42 +09:00
Sakamoto Shiina 2536b3897c Merge branch 'view' into UI_2.0 2023-09-05 23:09:42 +09:00
misyaguziya 80bb888775 Merge branch 'bugfix_energy_ProgressBar' into UI_2.0 2023-09-05 22:38:39 +09:00
misyaguziya bfed9a2d26 🐛[bugfix] Config Windowのマイク/スピーカーのenergy検出処理でスピーカー->マイクの順でONにした場合にプログラムが落ちる問題を修正 2023-09-05 22:38:26 +09:00
Sakamoto Shiina e7350038a0 [Chore] Main Window: Language Settings 使ってない変数や引数指定の削除。
変数名の変更も少し。
2023-09-05 15:17:58 +09:00
Sakamoto Shiina 74b759ad6b [Add] Main Window. language settings label系を変数にしてview.pyに移動 2023-09-05 09:38:24 +09:00
Sakamoto Shiina dc440d53b6 Merge branch 'view' into UI_2.0 2023-09-05 07:01:26 +09:00
Sakamoto Shiina 84ebe47b89 [Add] Config Window スレッショルドチェック時のボタンのステータス変更(disabled, normal)関数追加と処理 2023-09-05 06:57:56 +09:00
misyaguziya 936e2d9721 Merge branch 'config_progressbar_energy' into UI_2.0 2023-09-05 02:45:35 +09:00
misyaguziya fab05ae888 [Add] Config Windowのマイク/スピーカーの動作確認のenergyを表示できるように追加 2023-09-05 02:43:22 +09:00
Sakamoto Shiina 8e01229369 Merge branch 'view' into UI_2.0 2023-09-05 02:09:03 +09:00
Sakamoto Shiina 08fbbd1b59 [bugfix] Config Window: マイク、スピーカーのThresholdチェックボタンを押した時に、変数アクセスエラーがでるのを修正。
テストとしてSleep関数を入れていたのを削除。
2023-09-05 02:02:14 +09:00
Sakamoto Shiina 670a651e57 [bugfix] getImageFileFromUiUtilsなどimage file取得をimageFileManager(元imageFilenameManager)にて一括で行うように。
UIに入れる時はファイル名ではなくファイルそのもの
2023-09-05 01:57:50 +09:00
Sakamoto Shiina e1466efc51 [Chore] ui_managers: 不要なreturn文の削除 2023-09-05 00:54:15 +09:00
Sakamoto Shiina f44b5cd7f9 Merge branch 'view' into UI_2.0 2023-09-05 00:43:19 +09:00
Sakamoto Shiina 8a91cffcf4 [bugifx] Main Window: view_variable(view.py変数)の参照の仕方がおかしく、意図した値の保存と参照がされていなかったのを修正。 2023-09-04 23:43:22 +09:00
Sakamoto Shiina 52b1939ae7 Merge branch 'view' into UI_2.0 2023-09-04 23:27:32 +09:00
Sakamoto Shiina ca669f9fec [bugfix] view.py OSC_IP_ADDRESSに入れるTkinter変数の型指定ミス修正 int型からstr型に。
今まではint型で指定していたので、127.0.0.1などはfloatとして認識されてエラーがでていた。
2023-09-04 23:08:28 +09:00
Sakamoto Shiina 69fae94707 [bugifx] Config Window: view_variable(view.py変数)の参照の仕方がおかしく、意図した値の保存と参照がされていなかったのを修正。 2023-09-04 22:48:24 +09:00
Sakamoto Shiina fb22ffa31e [bugfix] Config Window Font Family CALLBACK関数登録のし忘れ(テスト用にコメントアウトしたままだった)と、実際にフォント選択時に正しく関数が動いていなかったのを修正 2023-09-04 18:29:04 +09:00
Sakamoto Shiina 90668b1e7a [Add] view.pyに、設定項目 mic_host mic_device speaker_deviceの更新、セット関数を追加。
model.pyで実際にdeviceなどを取得する関数も入れ込み(元々あったものを移植)したので、設定画面上で見た目だけは実際の値で動くように。
2023-09-04 18:17:01 +09:00
Sakamoto Shiina e71309f272 Merge commit 'stash@{0}' into view 2023-09-04 15:00:00 +09:00
Sakamoto Shiina 394c715b5b WIP on view: 6b4d782 Merge branch 'remove_modules' into UI_2.0 2023-09-04 14:48:25 +09:00
Sakamoto Shiina c819b956b4 index on view: 6b4d782 Merge branch 'remove_modules' into UI_2.0 2023-09-04 14:48:25 +09:00
misyaguziya 83492f0a38 Merge branch 'autoselect_deepl_auth' into UI_2.0 2023-09-04 13:58:43 +09:00
misyaguziya 26403461b4 [bugfix] model.findTranslationEngineで翻訳エンジンを設定するように変更 2023-09-04 12:40:34 +09:00
misyaguziya a6137149a0 [Add] view.pyにprintToTextbox_AuthenticationSuccessを追加 2023-09-04 12:33:00 +09:00
misyaguziya aabfa535bf [update] auth keyが設定されている場合、優先的にDeepL(auth)を使用するように変更
※view.pyにprintToTextbox_AuthenticationSuccessが実装される前提で実装
2023-09-04 12:26:27 +09:00
misyaguziya 6b4d78230a Merge branch 'remove_modules' into UI_2.0 2023-09-04 09:14:59 +09:00
misyaguziya d9eb202b6f [Update] 不要なmoduleを削除 2023-09-04 09:14:40 +09:00
misyaguziya fffdaa803d Merge branch 'config_path' into UI_2.0 2023-09-04 09:01:04 +09:00
misyaguziya 768e1d4de4 [bugfix] どのディレクトリでmian.pyを実行してもmain.pyのディレクトリにconfig.jsonが生成させるように変更 2023-09-04 09:00:47 +09:00
Sakamoto Shiina ec565d5365 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-04 05:16:24 +09:00
Sakamoto Shiina 77e5971c72 Merge branch 'main_window_sidebar' into UI_2.0 2023-09-04 05:14:50 +09:00
misyaguziya f44c7c99dd Merge branch 'model_callback' into UI_2.0 2023-09-04 05:09:13 +09:00
Sakamoto Shiina 45d5dffd3c [Chore] remove the code that is no longer in use. 2023-09-04 05:05:43 +09:00
misyaguziya b014b1f3cc [Update] modelでconfigにセットしていた部分をcallbackとしてmainでセットするように変更 2023-09-04 05:04:37 +09:00
Sakamoto Shiina 434faafe94 [bugfix] Main Window: Sidebar compact mode. サイドバーコンパクトモード切り替え時に、各機能のON/OFF状態、選択されたlanguage preset tab noを保持したまま開閉できるように。
具体的には今までサイドバー開閉はdestroy関数を使用した後widgetごと再生成していたのを、grid_remove() -> grid() を使用し、再生成ではなく再配置にした。
2023-09-04 04:53:37 +09:00
Sakamoto Shiina 4466e01458 [Refactor] separate function create_sidebar into createSidebarFeatures and createSidebarLanguagesSettings 2023-09-04 02:41:26 +09:00
Sakamoto Shiina 9be2ca29a1 Merge branch 'view' into UI_2.0 2023-09-04 00:19:47 +09:00
Sakamoto Shiina c232f5e5cd view.pyへサイドバー開閉回りの変数を移動。関数は(view.pyがwrapperしているけど)vrct_gui.pyへ移動。 2023-09-04 00:14:50 +09:00
Sakamoto Shiina 38870a6638 Merge remote-tracking branch 'origin/UI_2.0' into UI_2.0 2023-09-03 04:07:07 +09:00
Sakamoto Shiina f38ff130d2 Merge branch 'view' into UI_2.0 2023-09-03 04:00:50 +09:00
Sakamoto Shiina 63b220a2d0 変数名変更: Prefixにしていたsqlsをslsに。Sidebar Quick Languages Settingsの意だったけど、メイン画面にあるとはいえQuickでもなんでもないのでsls(Sidebar Languages Settings)と変更。 2023-09-02 19:27:40 +09:00
Sakamoto Shiina 01245d9c63 Main Window: Sidebar Features系のLABEL変数を作成。
不要な関数移動と削除: switch toggle関数をlambdaにして作成時にそのまま指定。
2023-09-02 18:44:48 +09:00
Sakamoto Shiina 53356dd58c [Chore] Main Window: side bar features' labels VRCT 1.x系でしてた表記に一旦戻した。そもそもSpeaker2chatboxとしてたのはtypoでした。正しくはSpeaker2Logです。 2023-09-02 14:39:35 +09:00
misyaguziya cabe79ecbb Merge branch 'model_logger' into UI_2.0 2023-09-02 06:03:08 +09:00
misyaguziya 3c172db7d1 [Add] model logger func 2023-09-02 06:02:29 +09:00
Sakamoto Shiina a4cdc7da6a Merge branch 'view' into UI_2.0 2023-09-02 05:34:46 +09:00
Sakamoto Shiina ce65a36b8d Main Window: Language Settingの変数YOUR_LANGUAGEとTARGET_LANGUAGEをview.pyに移動。
tab切り替わり時に、UI側でvariableをなぜか新たにセットしていたので修正(set関数を使って)
2023-09-02 05:27:52 +09:00
Sakamoto Shiina fa82961eb3 Main Window: Language Preset Tab Callback関数系。変数をview.pyへ移動。
Callback時に値を受け取れるので、tab番号をもらって一つの関数で処理できるように。
2023-09-02 04:19:35 +09:00
Sakamoto Shiina cc94added0 Main Window: Sidebar features系のCALLBACK変数をview.pyに移動。処理もリファクタリング。
そのCALLBACK関数の引数でTrue/Falseの値を受け取れるようになったので、view.pyが提供していたgetButtonStatus系関数も削除。
2023-09-02 03:45:42 +09:00
Sakamoto Shiina 66413a60dd [Chore] view.pyの変数群にコメントを追加するなど。 2023-09-02 02:46:27 +09:00
Sakamoto Shiina a4507eea18 [Chore] Config Window: config.py, CTkScrollableDropdownのimport文を削除 2023-09-02 02:36:17 +09:00
Sakamoto Shiina 2ee8eca63b Config Window 各設定項目を変数化し、ctk variableなど全てview.pyに移動。
vrct_gui以下ではconfig.pyを使わないように切り離した。
CTkScrollableDropdownを使うことをやめた。(grab_setと干渉するため)
2023-09-02 02:33:08 +09:00
Sakamoto Shiina 3affcc1ee6 Merge branch 'config_window' into UI_2.0 2023-09-01 03:38:09 +09:00
Sakamoto Shiina b60eb501c3 Merge branch 'chore' into config_window 2023-09-01 03:37:27 +09:00
Sakamoto Shiina 55ee9e6325 [Chore] remove the code that is no longer in use. 2023-09-01 03:36:33 +09:00
Sakamoto Shiina 19b2cbb010 変数名 関数名変更: chatbox -> message box. メイン画面のテキスト入力欄の事はmessage box. chatboxはvrc内のchatboxもあるので呼び方を分ける 2023-09-01 03:29:33 +09:00
Sakamoto Shiina f3f549494e Config Window: Transcription Tab Thresholdチェック(Mic, Speaker)のCallback関数をmain.pyから呼べるように。
各設定項目がちゃんとmain.pyで呼ばれているか確認するためにprint文追加。おかげで指定し忘れなどが分かったのでその修正。
起動時OSCチェック処理のコメントアウト戻すのを忘れていたのを修正(開発上しいながよくやる)
2023-09-01 03:10:43 +09:00
Sakamoto Shiina 799a1a27bb Config Windowの各項目Callback関数をmain.pyコントローラで実行できるように 2023-09-01 02:25:00 +09:00
Sakamoto Shiina ed88a5b886 [Chore] messageboxのバグを直してもらったので要らないコメントを削除 2023-08-31 23:38:07 +09:00
misyaguziya 94590aa7e2 Merge branch 'bugfix_messagebox' into UI_2.0
# Conflicts:
#	view.py
2023-08-31 23:28:32 +09:00
misyaguziya 250be654bd [bugfix] 変数名の被りを修正 2023-08-31 23:25:31 +09:00
Sakamoto Shiina 31e6f615bc Merge branch 'chore' into UI_2.0 2023-08-31 22:10:45 +09:00
Sakamoto Shiina 4db1acc455 [Chore] printToTextBox内でconfig.pyを使っていたが、そもそもconfig.pyはGUI以下では使わないとの、特にコードの移動も必要なく書き換えだけで修正 2023-08-31 22:09:43 +09:00
Sakamoto Shiina 23b03654fd Merge branch 'view' into UI_2.0 2023-08-31 22:03:47 +09:00
Sakamoto Shiina fac28edba6 GUIが生成される前にしたい処理(色やスケールなど)をvrct_gui.pyからview.pyに移動。今後コントローラ側で値を変更してGUI再生成などしやすくなるはず。 2023-08-31 21:44:53 +09:00
Sakamoto Shiina a11e5f906f Merge branch 'config_window' into UI_2.0 2023-08-31 21:07:29 +09:00
Sakamoto Shiina c3459c1ffe [Bugfix] Config WindowをCompact modeにするかどうかの設定をconfig.jsonに保存しているにも関わらず、GUI起動時に反映されないのを修正 2023-08-31 21:00:30 +09:00
Sakamoto Shiina 08d3f04738 add UI and Feature: Config Window Compact Mode. 2023-08-31 19:13:14 +09:00
Sakamoto Shiina cb434717e0 add UI to config_window compact_mode切り替えスイッチ。 2023-08-31 15:59:07 +09:00
Sakamoto Shiina 9bb9c0e480 Merge branch 'view' into UI_2.0 2023-08-31 00:46:56 +09:00
Sakamoto Shiina be5a0e386f view.pyへの分離完了(messageBoxPressKeyAnyをgui内部に移動、使わなくなったconfig.pyのBREAK_KEYSYM_LISTは一旦コメントアウト) 2023-08-31 00:43:10 +09:00
Sakamoto Shiina fde7ea6a75 main.pyからview.pyにいくつか関数移動 続き(messageBoxPressKeyAnyは別の場所に移動になるので別のコミットに。それ以外は完了) 2023-08-31 00:19:19 +09:00
Sakamoto Shiina 36dde7f0b3 main.pyからview.pyにいくつか関数移動 2023-08-30 19:54:40 +09:00
Sakamoto Shiina 13d4a84e7f add view.py: main.pyからUIの初期設定処理をview.py移動。その他一部関数名の変更など。 2023-08-30 15:13:33 +09:00
Sakamoto Shiina 28d1dbb47e Merge branch 'config_window' into UI_2.0 2023-08-30 02:43:22 +09:00
Sakamoto Shiina 572889990a [Refactor] config_window. setting_box回りのファイルや関数名の変更。何をどう読み込んでいるのか少しだけ分かりやすく。 2023-08-30 02:35:35 +09:00
Sakamoto Shiina ff306ed53d Setting box: add Translation tab. add item DeepL Auth Key. 2023-08-30 02:17:05 +09:00
Sakamoto Shiina 338a29baa3 Merge branch 'config_window' into UI_2.0 2023-08-29 19:57:05 +09:00
Sakamoto Shiina fcb66fa0c8 Setting box: add Advanced Settings tab (formerly Parameters). add items OSC IP Address and OSC Port. 2023-08-29 19:53:09 +09:00
Sakamoto Shiina 47b80da502 Chore: Remove the code that is no longer in use and __tmp.py from the setting_box_containers directory because it's no longer needed. 2023-08-29 17:01:48 +09:00
Sakamoto Shiina 246409fe2c Setting box: add Others tab. add items Auto Clear The Message Box, Notification XSOverlay and Message Format. 2023-08-29 16:54:51 +09:00
misygauziya 88cd7352c8 Merge branch 'language-template' into UI_2.0 2023-08-29 16:16:09 +09:00
misygauziya 957c48caeb [Update] main windowのみ処理の実装完了 2023-08-29 16:15:54 +09:00
Sakamoto Shiina 4b9a90e6d3 Chore: Change the name of variable optionmenu_attr_name and dropdown_menu_attr_name in Setting Boxes. 2023-08-29 15:48:04 +09:00
Sakamoto Shiina 6b593b99d6 Setting box: add items Speaker Device, Speaker Energy Threshold include Dynamic one, Speaker Record Timeout, Speaker Phrase Timeout, Speaker Max Phrases.
Fixed typo and remove the code that is not using anymore in createSettingBox_Mic.py.
2023-08-29 15:32:23 +09:00
misygauziya 78ef7404aa [Update] 起動時に前回のtabを選択するように変更 2023-08-29 15:25:56 +09:00
misygauziya bcc2f69b83 [Update] remove DeepL(auth) 2023-08-29 12:43:29 +09:00
misygauziya f5049b3f65 [Update] 翻訳エンジンを自動で設定するように変更 2023-08-29 12:12:51 +09:00
misygauziya c8e4df0349 途中まで翻訳Engine部分がまだ 2023-08-29 04:48:44 +09:00
misygauziya 18275b5700 [Change] transcription_languages.py
言語の階層構造を変更
2023-08-28 23:25:13 +09:00
Sakamoto Shiina d13603b3db Merge branch 'config_window' into UI_2.0 2023-08-28 21:28:05 +09:00
Sakamoto Shiina 213b42fd56 fixed: I forgot to change the label text that word filter. 2023-08-28 21:27:04 +09:00
Sakamoto Shiina cf4600acd8 Setting box: add items Mic Record Timeout, Mic Phrase Timeout, Mic Max Phrases and Mic Word Filter 2023-08-28 21:21:56 +09:00
Sakamoto Shiina d99beb104d Merge branch 'config_window' into UI_2.0 2023-08-28 18:55:49 +09:00
Sakamoto Shiina 3a52c9ad1e Setting box: add Transcription tab. add items Mic Host, Mic Device, and Mic Energy Threshold include Dynamic one. 2023-08-28 18:41:43 +09:00
Sakamoto Shiina 3cc8fa885a chore: Remove the instance variable that are no longer in use. 2023-08-28 15:36:26 +09:00
Sakamoto Shiina 38eb3ae5c6 Merge branch 'config_window' into UI_2.0 2023-08-28 14:54:10 +09:00
Sakamoto Shiina 84d76ed9a4 Setting box: add items UI Scaling, Font Family, UI Language. add the function get_key_by_value to utils.py. and fixed a bit 2023-08-28 14:43:34 +09:00
Sakamoto Shiina 9ec37061e5 Setting box: add item appearance theme. and fixed a bit 2023-08-28 13:42:55 +09:00
Sakamoto Shiina 6e4dd14c3e setting box: add Appearance tab(change the name general to appearance). add item Transparency. 2023-08-28 12:08:47 +09:00
misygauziya ec9f491a0d Merge branch 'bugfix_OSC' into UI_2.0 2023-08-28 06:50:38 +09:00
misygauziya 32b01cf99c [bugfix] 翻訳未使用時に()が残っていたバグを修正 2023-08-28 06:50:20 +09:00
Sakamoto Shiina 644fc4dbb1 メイン画面 Light theme 色調整 2023-08-27 14:02:30 +09:00
Sakamoto Shiina cd415df824 起動時に設定画面が一瞬見えるのを無くした。VRCT1.xと同じやり方でいく。 2023-08-27 13:58:47 +09:00
misygauziya 4c1c2e4649 Merge branch 'messagebox' into UI_2.0 2023-08-27 13:30:15 +09:00
misygauziya 419766a2fc [Update] message box (only main window) 2023-08-27 13:30:03 +09:00
misygauziya 11ea8949ae Merge branch 'checkbox_foreground' into UI_2.0 2023-08-27 11:57:42 +09:00
misygauziya a9b7073a08 [Update] foreground (only main window) 2023-08-27 10:53:10 +09:00
misygauziya f6eb6dc922 Merge branch 'checkbox_transcripton_receive' into UI_2.0 2023-08-27 09:55:09 +09:00
misygauziya c1b5154c97 [Update] transcription receive (only main window) 2023-08-27 09:54:42 +09:00
misygauziya 8011e7d96a Merge branch 'checkbox_transcription_send' into UI_2.0 2023-08-27 08:04:15 +09:00
misygauziya a0cabdd8d2 [Update] transcription send (only main window) 2023-08-27 07:40:19 +09:00
misygauziya d668a37174 Merge branch 'checkbox_translate' into UI_2.0 2023-08-27 06:18:56 +09:00
misygauziya 0c81d65fe4 [Add] translation checkboxでconfig.ENABLE_TRANSLATIONがTrue/Flaseに変化するように実装 2023-08-27 06:13:47 +09:00
misygauziya d597032231 [bugfix] テストコードを削除 2023-08-27 05:13:02 +09:00
misygauziya 0780c7d75f [Update] guiの起動関数を分割/model,configをimport 2023-08-27 05:09:55 +09:00
misygauziya 644ce9afa4 [Add] New GUI from Shiina 2023-08-27 04:56:36 +09:00
misygauziya cd4e431be2 [Add] model test code
既存のVRCT 1.3.2のUIをmodelのテストコードとして移動
2023-08-27 04:54:25 +09:00
misygauziya 2bcf096c88 Merge branch 'refactoring' into develop 2023-08-20 09:01:10 +09:00
misygauziya b2021aeaab [bugfix] ソフトウェアの更新チェック処理が分離されていなかった 2023-08-20 09:00:56 +09:00
misygauziya 7919f2ed77 Merge branch 'refactoring' into develop 2023-08-20 02:33:35 +09:00
misygauziya b7d6477228 [Update] change transcription_recorder.py/transcription_transcriber.py/notification.py func name 2023-08-20 02:28:17 +09:00
misygauziya 2be54f9aee [Update] change transcription_utils.py func name 2023-08-20 01:40:01 +09:00
misygauziya 1470187c02 [Update] change osc_tools.py func name 2023-08-20 01:33:43 +09:00
misygauziya 02d8fbdb1c [Update] 機能部分をmodelsフォルダに移動 2023-08-20 01:20:30 +09:00
misygauziya 31e786f2a8 [Update] model.pyからprint_textboxをすべて引き剥がした。
UIの依存関係はなくなったはず
2023-08-19 19:09:01 +09:00
misygauziya e3a37c576c [typo] remove print command 2023-08-18 15:46:52 +09:00
misygauziya 027e9397d5 [Update] 要素機能をmodel.pyを通して処理するように変更 2023-08-18 15:39:57 +09:00
misygauziya 19b29b4955 [Update] 処理を分割 2023-08-16 01:59:07 +09:00
misygauziya 99f06e5935 Merge branch 'getter/setter' into develop 2023-08-15 22:57:55 +09:00
misygauziya b13af36727 Merge branch 'bugfix_energy_threshold' into develop 2023-08-15 22:57:44 +09:00
misygauziya 65f5b6bc0e [bugfix] remove adjust_for_noise()
ENERGY_THRESHOLD/DYNAMIC_ENERGY_THRESHOLDが機能していない問題を修正
2023-08-15 22:43:08 +09:00
misygauziya 65d1427876 [bugfix] config.py AUTH_KEYESのsetterを修正 2023-08-15 12:44:06 +09:00
misygauziya 1231fbd83c [Update] config.pyの設定を他ファイルに適応した 2023-08-15 11:45:37 +09:00
misygauziya 6ada555c5f [Update] config.py add save config.json 2023-08-15 10:42:26 +09:00
misygauziya b7896336fc [Add] config.py method getter/setter 2023-08-15 08:03:48 +09:00
misygauziya beb108ba4d Merge branch 'remove_package' into develop 2023-08-11 02:17:38 +09:00
misygauziya 83e2d4bed8 [update] remove packages 2023-08-11 02:17:25 +09:00
misygauziya 8125407e4d Merge branch 'auto_update' into develop 2023-08-11 01:57:58 +09:00
misygauziya 944346d608 [bugfix] __version__ を1.3.1 -> 1.3.2に修正 2023-08-11 01:57:44 +09:00
misygauziya 4701b1bf39 Merge branch 'auto_update' into develop 2023-08-11 01:53:53 +09:00
misygauziya 61837ae6de Merge branch 'AudioTranscriber' into develop 2023-08-11 01:53:28 +09:00
misygauziya 115cf8fab9 [Update] 音声認識のtranscribe_audio_queue関数コール時にlanguageを設定するように変更 2023-08-11 01:53:11 +09:00
misygauziya 4286fe6aab [Update] 自動更新は危険なのでアップデートの通知用フラグのみの実装に変更 2023-07-30 23:52:45 +09:00
misygauziya b16ea1e7bf [Add] update module(test) 2023-07-30 23:10:08 +09:00
misygauziya c77983509f Merge branch 'develop' 2023-07-30 02:14:16 +09:00
misygauziya f58b08c5a4 Merge branch 'information' into develop 2023-07-30 01:52:45 +09:00
misygauziya 49a0687947 [bugfix] typo!!!! 2023-07-30 01:52:25 +09:00
misygauziya 023e902297 Merge branch 'information' into develop 2023-07-30 01:48:47 +09:00
misygauziya 9518f83668 [Update] information v1.3.2 2023-07-30 01:47:05 +09:00
misygauziya 970f8eb306 Merge branch 'install_bat(#33)' into develop 2023-07-30 00:40:31 +09:00
misygauziya aab21dc9b4 [Update] パッケージのインストール方法を変更 2023-07-30 00:40:10 +09:00
misygauziya 1b89f1a40e Merge branch 'config_window(redmine#19)' into develop 2023-07-27 15:12:16 +09:00
misygauziya 3b0ee5325d [Update] 不要なコードを削除/typoを修正 2023-07-27 15:11:08 +09:00
misygauziya a1fcf0702b [bugfix] checkboxを押した時にconfig buttonのサイズが変化する問題を修正 2023-07-27 15:09:58 +09:00
misygauziya 546eb7e1fc [bugfix] checkbox動作中にconfig windowが開ける問題を修正 2023-07-27 15:09:03 +09:00
misygauziya aea8700ebb Merge branch 'bugfix(redmine#29)' into develop 2023-07-27 04:00:49 +09:00
misygauziya f83cfa79c8 [bugfix] Deepl(auth)でEN→JPの翻訳がうまくいかない問題を修正(#29) 2023-07-27 03:58:51 +09:00
misygauziya 470e1cbabe [Update] information windowを表示した時に最前面になるように変更 2023-07-26 12:54:45 +09:00
misygauziya 9be6e3de41 [Update] main window のcheckboxをONの状態でもconfigを開けるように変更 2023-07-26 11:23:44 +09:00
misygauziya 6627b5e7e6 [Update] config windowをグラップするように変更 2023-07-26 06:48:56 +09:00
misygauziya a6a88065ef Merge branch 'bugfix#21' into develop 2023-07-26 04:02:41 +09:00
misygauziya 6bf2b4d975 [Update] Add translate languages [Korean, Indonesian, Ukrainian, Turkish, Norwegian] for DeepL(web) 2023-07-26 03:56:42 +09:00
misygauziya 01c8dc95ae [bugfix] typo
hr_HR -> hr-HR
2023-07-26 03:20:15 +09:00
misygauziya e0d0c4f048 [bugfix] 文字起こしの言語説明をgoogleを参考に修正
https://cloud.google.com/speech-to-text/docs/speech-to-text-supported-languages
2023-07-26 03:19:49 +09:00
misygauziya 97caa41fee Merge branch 'xsoverlay' into develop 2023-07-25 11:28:49 +09:00
misygauziya 9d95c508b7 [Update] XSOverlayの表示のparameterを修正 2023-07-25 11:26:54 +09:00
misygauziya 972353fec2 [Add] img/xsoverlay.png
大きい画像だと送信できなかったため、32x32で作成
2023-07-25 11:25:56 +09:00
misygauziya 89f563c41b Merge branch 'OSC_RunCheck' into develop 2023-07-24 23:51:15 +09:00
misygauziya 36374d6979 [Add] init時にOSCの起動確認を行う処理を追加
裏でOSC receive処理は回りっぱなし
2023-07-24 23:50:35 +09:00
misygauziya 53ddab3fc0 [update] Speakerからの文字起こし結果をXSOverlayの通知機能で表示する機能を追加(VR限定) 2023-07-24 00:43:39 +09:00
misygauziya 42cddcfe80 [Add] notification.py 2023-07-24 00:18:21 +09:00
misygauziya 67df35360d Merge branch 'develop' 2023-07-22 15:45:40 +09:00
misygauziya 8e31472978 Merge branch 'information' into develop 2023-07-22 15:44:45 +09:00
misygauziya 311ea80555 [update] UIに韓国語が追加されたため、ドキュメントを修正 2023-07-22 15:44:29 +09:00
misygauziya d13f6a1444 Merge branch 'master' into develop 2023-07-22 15:27:13 +09:00
ShiinaSakamoto 4adbf290c4 Merge pull request #1 from soumt-r/master
feat: add Korean language
2023-07-22 13:50:54 +09:00
Soumt 48d98fce97 feat: add Korean language 2023-07-22 10:45:05 +09:00
misygauziya 8cb1a1ed16 Merge branch 'develop' 2023-07-22 05:47:38 +09:00
misygauziya bf60e6f549 Merge branch 'bugfix#20_poposuke' into develop 2023-07-21 17:10:02 +09:00
misygauziya 4937d7b1f1 [update] VRCT.py
処理の重複を削除
2023-07-21 17:09:16 +09:00
misygauziya 4942193b47 [bugfix] window_config.py
energy checkのAPI干渉を軽減する処理を追加
2023-07-21 17:08:48 +09:00
misygauziya 058b978357 Merge branch 'request#1_shiina' into develop 2023-07-21 15:42:39 +09:00
misygauziya 731eb76040 [update] window_config.py
word filterに全角半角スペースを除くように修正
2023-07-21 15:38:21 +09:00
misygauziya 3a8e02f986 [bugfix] VRCT.py
checkboxを外した時にも排他処理を実装
2023-07-21 14:22:19 +09:00
misygauziya bbd7e0d6ea [bugfix]VRCT.py
メインウィンドウのcheckboxをclick連打すると落ちる現象に対策
2023-07-21 13:47:16 +09:00
misygauziya b569e9b9ec Merge branch 'for_v1.3' into develop 2023-07-21 05:42:43 +09:00
misygauziya 94c751af85 [bugfix] README.md, README.txt, window_information.py
旧UIの文言を削除
2023-07-21 03:31:38 +09:00
misygauziya f670925d6a [update] locales.yml
日本語化してない部分を修正
2023-07-21 02:51:07 +09:00
misygauziya b69476b246 [update] window_config.py
entry_input_mic_word_filterにplaceholder_textを追加
2023-07-21 02:37:04 +09:00
misygauziya 28be2b3840 [update] README.txt
更新内容を追加
2023-07-21 02:24:12 +09:00
misygauziya 97a9958d1b [update] README.md
更新内容を追加
2023-07-21 02:23:36 +09:00
misygauziya ee600cfd3d [update]informationの記入漏れを修正 2023-07-21 02:22:22 +09:00
misygauziya 6006357381 [update] informationに更新内容を追加 2023-07-21 02:01:11 +09:00
misygauziya 60ce296289 [update] v1.3リリースのため、SCROLLABLE_DROPDOWN = Falseに変更 2023-07-21 01:33:50 +09:00
misygauziya c3d9a66fda [update] dropdown_fontをoptionmenu設定時に入れ込むように変更 2023-07-21 01:33:11 +09:00
misygauziya 90814371d2 Merge branch 'bugfix#19_misya' into develop 2023-07-21 01:05:42 +09:00
misygauziya e2d13d0997 [bugfix] SCROLLABLE_DROPDOWN=Falseの場合に設定されていない項目を設定 2023-07-21 01:05:22 +09:00
misygauziya e42f0acddf Merge branch 'bugfix#19_misya' into develop 2023-07-19 17:56:52 +09:00
misygauziya b40c074e4d [bugfix]HOST API切替時にCHOICE_MIC_DEVICEにdevice名を保持するように変更 2023-07-19 17:56:36 +09:00
misygauziya 31c8ce9f09 Merge branch 'languages' into develop 2023-07-19 17:17:29 +09:00
misygauziya baf74949cc Merge branch 'bugfix#19_misya' into develop 2023-07-19 17:17:20 +09:00
misygauziya 7a8e522a19 [bugfix] #18の修正漏れ
翻訳エンジンまたはHOSTAPI変更時にscrollableDropdownのvaluesが更新されない問題を修正
2023-07-19 17:17:04 +09:00
misygauziya b9df31dab3 [update]translation_langの先頭を大文字に変更 2023-07-19 17:14:34 +09:00
misygauziya be84fa234d Merge branch 'bugfix#18_shiina' into develop 2023-07-18 23:52:40 +09:00
misygauziya c6ac2eff81 [update] main windowのcheckboxをすべてOFFに変更 2023-07-18 23:49:55 +09:00
misygauziya 7843608b7b Merge branch 'Add_CTkScrollableDropdown' into develop 2023-07-18 07:11:50 +09:00
misygauziya 5de6a22347 Merge branch 'bugfix#18_shiina' into develop 2023-07-18 07:10:05 +09:00
misygauziya 9ebb452c3d [bugfix] 環境に依ってマイクとスピーカーを同時起動するとエラーが発生するため、起動時は強制的にOFFにするように変更 2023-07-18 07:09:34 +09:00
misygauziya aa65721acd Merge branch 'bugfix#17_funagashi' into develop 2023-07-18 07:01:15 +09:00
misygauziya 08b5496f6d [bugfix] 半角入力時にkeysymが実行されて正しく文字が表示されない問題を修正
https://minekoa.hatenadiary.org/entry/20090315/1237125640
https://stackoverflow.com/questions/18568988/tkinter-prevent-deletion-of-selected-text-with-return-key
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/key-names.html
2023-07-18 06:59:11 +09:00
misygauziya 101f236123 [bugfix]起動時に瞬間的に開いて閉じてが行われてフォーカスがチカチカするバグを修正 2023-07-15 16:45:09 +09:00
misygauziya 631fb1e6fb スクロールバーの消えるタイミングを修正 2023-07-15 09:42:06 +09:00
misygauziya 931fe674a6 すべてのoptionmenuにCTkScrollableDropdownを設定
SCROLLABLE_DROPDOWNで切り替え可
2023-07-15 04:08:16 +09:00
misygauziya ba8ab43901 configを表示した時に最前面に来るように変更 2023-07-15 04:07:12 +09:00
misygauziya 41d87fbf59 move ctk_scrollable_dropdown_frame.py to ./ 2023-07-15 04:05:27 +09:00
misygauziya bb1a37f282 scrollableDropdown_font_familyからマウスカーソルが離れると非表示になるようにMethodを追加 2023-07-14 18:26:53 +09:00
misygauziya c7cc2ff551 test code CTkScrollableDropdown for font 2023-07-13 15:53:32 +09:00
misygauziya 2cc9d68303 remove comment out 2023-07-13 15:52:30 +09:00
misygauziya d11f9d716f withdrawのタイミングを修正 2023-07-13 15:43:44 +09:00
misygauziya 88155e5b01 起動時にToplevelWindowConfigを生成するように変更 2023-07-13 11:01:25 +09:00
misygauziya 83967cd55d Merge branch 'bugfix#16' into develop 2023-07-13 10:45:32 +09:00
misygauziya 0755b41cf0 スピーカーについて既定デバイス以外を選択した時にERRORが出るように修正 2023-07-13 10:45:15 +09:00
misygauziya 1097f6d776 Merge branch 'add_ui_multilingual_support' into develop 2023-07-13 09:17:12 +09:00
Sakamoto Shiina 7ea247ced2 add pyyaml into requiremnts.txt 2023-07-13 09:14:38 +09:00
Sakamoto Shiina 829e1de2b3 UIの多言語化(日本語と英語)に対応、Configで言語を変更できるように。それに伴いUIを再生成しているため、その部分を関数化して切り出しました。 2023-07-12 10:32:37 +09:00
Sakamoto Shiina ffbcc4d940 Chore: just move comma 2023-07-12 05:10:40 +09:00
Sakamoto Shiina 8ffe90e387 Chore: move code to a different location 2023-07-12 05:00:09 +09:00
misygauziya ab5f89b3f3 Merge branch 'bugfix#15' into develop 2023-07-12 01:26:15 +09:00
misygauziya 4025e0ae70 [bugfix] Add change font items
フォント変更時の記載漏れ
2023-07-12 01:26:05 +09:00
misygauziya 79cbf69955 Merge branch 'bugfix#14_ryouran' into develop 2023-07-11 22:47:40 +09:00
misygauziya 0b0ec88b8e [bugfix] Add Mic Host API
WASAPI以外のHostAPIでもマイクとして使用できるように変更
2023-07-11 22:35:42 +09:00
misygauziya 1b8cbbd01d Merge branch 'bugfix#13_typo' into develop 2023-07-11 12:00:40 +09:00
misygauziya 0d4ed64590 remove customtkinter 2023-07-11 12:00:22 +09:00
misygauziya 59e77ef7bf Merge branch 'bugfix#13_typo' into develop 2023-07-11 11:48:14 +09:00
misygauziya 81f2c9e44e remove customtkinter 2023-07-11 11:47:57 +09:00
misygauziya adbed5969a Merge branch 'readme' into develop 2023-07-11 11:32:06 +09:00
misygauziya e0d3e321e9 add package flashtext 2023-07-11 11:31:26 +09:00
misygauziya 4f926d6ba9 Merge branch 'energy_Indicator' into develop 2023-07-11 11:28:02 +09:00
misygauziya 57a92893fe Merge branch 'bugfix#12_typo' into develop 2023-07-11 11:27:44 +09:00
misygauziya 1987128b0e fix typo 2023-07-11 11:27:20 +09:00
misygauziya a0a7b59732 Merge branch 'optimization' into develop 2023-07-11 11:24:09 +09:00
misygauziya 35f7ec1a1c Merge branch 'WordFilter' into develop 2023-07-11 11:20:21 +09:00
misygauziya f4099e5e76 remove comment out 2023-07-11 11:16:43 +09:00
misygauziya 44b3b7de33 スピーカーの出力だけ直接取得するように変更 2023-07-11 10:52:20 +09:00
misygauziya d6e950f662 update progressBar energy
マイクとスピーカーのthresholdの閾値を可視化
2023-07-11 10:03:57 +09:00
Sakamoto Shiina 9d7401392f fixed README.md installの項目を編集。install時にカレントディレクトリの移動が必要だったので、その移動方法も含めてコマンドを追加。 2023-07-11 08:35:32 +09:00
Sakamoto Shiina 4cfc4d0d2e チャット送信後、自動的にチャットボックスを空にする機能を復活。Configでオンオフ切替可能。また、Config画面のタブにOthersタブを追加。(今回の機能は既存のどのタブにも当てはまらないと判断)
それに伴いREADMEの項目も追加。
2023-07-11 07:13:28 +09:00
misygauziya 574133034d fix typo 2023-07-11 01:20:50 +09:00
misygauziya 14d3a4a33e add SelectedMicEnergyRecorder, SelectedSpeakeEnergyRecorder 2023-07-11 00:40:39 +09:00
misygauziya 41df105bab Corrected process
But unstable
2023-07-09 03:54:19 +09:00
misygauziya 0a8c7dd0d0 Check Point
このままだと動かない
2023-07-09 02:03:45 +09:00
misygauziya 3c6d51f835 [update] Config Transcription Tab
change energy threshold UI. Entry to Slider
2023-07-07 18:05:22 +09:00
misygauziya ac3fc3f29a Merge branch 'optimization' into develop 2023-07-06 13:53:59 +09:00
misygauziya a5c5090335 optimization same code 2023-07-06 09:20:10 +09:00
misygauziya 4f8e6e0014 Merge branch 'WordFilter' into develop 2023-07-06 07:08:18 +09:00
misygauziya 401bc7f504 add word filter 2023-07-06 07:05:43 +09:00
misygauziya d3cd3e4cf1 Merge branch 'develop' 2023-07-05 14:41:00 +09:00
misygauziya cac3b2189a Merge branch 'readme' into develop 2023-07-05 14:39:20 +09:00
misygauziya 945299037b update information 2023-07-05 14:29:18 +09:00
misygauziya 03d6e0facd update README.txt 2023-07-05 14:28:58 +09:00
misygauziya 355eb2544a add README.md 2023-07-05 14:19:55 +09:00
misygauziya 7b7ff20c7d Merge branch 'requirements' into develop 2023-07-05 11:47:43 +09:00
misygauziya 38ff47f1d6 add requirements 2023-07-05 11:41:37 +09:00
misyaguziya 821e043fef Merge branch 'speech_recognition' into develop 2023-07-03 11:33:27 +09:00
misyaguziya e15b71a89b bugfix 2023-07-03 11:33:06 +09:00
misyaguziya 6dabae6b85 Merge branch 'speech_recognition' into develop 2023-07-03 11:10:15 +09:00
misyaguziya d67b383716 update button fg_color 2023-07-03 11:09:36 +09:00
misyaguziya 92b80c1e1d bugfix daemon=True 2023-07-02 00:03:07 +09:00
misyaguziya 4ef73793d8 Add UI changes to font change function 2023-07-01 23:59:58 +09:00
misyaguziya 248317a1a5 update click config motion
翻訳/文字起こし機能が動作中はコンフィグを変更できないように変更
2023-07-01 23:54:49 +09:00
misyaguziya 6b7230ff4f update transcription module
Thread処理の不要な部分を削除
2023-07-01 23:30:57 +09:00
misyaguziya e7899a6b1d update config UI 2023-07-01 23:17:16 +09:00
misyaguziya b8b04f1be4 add Hyperparameter
phrase_timeout, max_phrases
2023-07-01 23:16:56 +09:00
misyaguziya a28f91a8b3 Create LICENSE 2023-07-01 17:26:05 +09:00
misyaguziya b4c8d79734 change import package 2023-07-01 17:03:28 +09:00
misyaguziya f322849c12 remove custom_speech_recognition 2023-07-01 17:02:29 +09:00
misyaguziya c45250a2df update translation.py
change match to the structure of languages.py
2023-07-01 04:53:38 +09:00
misyaguziya 707d64c473 remove files 2023-07-01 04:08:42 +09:00
misyaguziya eedd77762d update UI 2023-07-01 04:06:56 +09:00
misyaguziya 2cac67e9ad update VRCT.py window_config.py
change to match the structure of languages.py
2023-07-01 02:51:24 +09:00
misyaguziya 94fc82a613 update languages.py
change dict structure
2023-07-01 02:44:25 +09:00
misyaguziya 55e7fab281 rename files 2023-06-30 22:02:48 +09:00
misyaguziya ba6838a488 bugfix
Change referrer languages and audio_utils
2023-06-30 21:58:04 +09:00
misyaguziya 5374591ef8 update receive transcript 2023-06-30 18:20:39 +09:00
misyaguziya 98cf5a81f8 update send transcript 2023-06-30 17:46:35 +09:00
misyaguziya aca449349a tempfile.mkstemp to io.BytesIO() 2023-06-30 11:19:18 +09:00
misyaguziya c89da3e7ae update AudioTranscriber 2023-06-29 18:51:37 +09:00
misyaguziya 868c84a9eb test code custom speech recognition 2023-06-29 10:10:00 +09:00
misyaguziya a2bed56323 Merge branch 'develop' 2023-06-28 02:26:51 +09:00
misyaguziya bc300eae4c Merge branch 'README' into develop 2023-06-28 02:26:17 +09:00
misyaguziya 524926c9b4 Merge branch 'information' into develop 2023-06-28 02:26:03 +09:00
misyaguziya c4f7c3e7a6 update information 2023-06-28 02:25:32 +09:00
misyaguziya 9446da21aa update readme 2023-06-28 02:23:49 +09:00
misyaguziya 06604f9767 Merge branch 'README' into develop 2023-06-28 02:08:48 +09:00
misyaguziya e8be38dc02 typo README name 2023-06-28 02:08:04 +09:00
misyaguziya 6976a82ee5 Merge branch 'bugfix#11_koneko' into develop 2023-06-28 02:04:42 +09:00
misyaguziya b6c6011397 update languages.py
change dict keys
2023-06-28 02:03:59 +09:00
misyaguziya f7742046b2 update languages typing 2023-06-28 00:49:49 +09:00
misyaguziya e0a68c8f04 update languages typing 2023-06-28 00:49:34 +09:00
misyaguziya 00499e5eba Merge branch 'bugfix#10_koneko' into develop 2023-06-27 22:36:41 +09:00
misyaguziya be9a355be4 Queue() -> Queue(10) 2023-06-27 22:36:09 +09:00
misyaguziya dda25b81b8 Merge branch 'bugfix#9_koneko' into develop 2023-06-26 16:20:04 +09:00
misyaguziya e6e4e3e305 update search_input_device search_default_device 2023-06-26 16:18:35 +09:00
misyaguziya aa18458ed5 Merge branch 'bugfix#8_aji' into develop 2023-06-23 18:30:01 +09:00
misyaguziya 80ab946d5f change mic/spk start/stop timing 2023-06-23 18:03:33 +09:00
misyaguziya b99b818cee Merge branch 'bugfix#7_aji_pop' into develop 2023-06-23 14:58:41 +09:00
misyaguziya dfe38d4046 bugfix AUTH_KEYS dict check 2023-06-23 14:58:21 +09:00
misyaguziya 1a91482541 typo remove parent 2023-06-23 14:20:09 +09:00
misyaguziya 555006f65a update init process
config.jsonが異常だった場合でも起動するように修正
2023-06-23 14:12:25 +09:00
misyaguziya 071e845f1c bugfix change font and init font 2023-06-23 13:25:10 +09:00
misyaguziya 2a74897628 Merge branch 'develop' 2023-06-23 10:45:39 +09:00
misyaguziya 159c3222a8 Merge branch 'gitignore' into develop 2023-06-22 10:25:03 +09:00
misyaguziya ab8a8e8fae update gitignore 2023-06-22 10:24:45 +09:00
misyaguziya 48ab3a1ca2 Merge branch 'bugfix#6_ichiya' into develop 2023-06-21 10:34:59 +09:00
misyaguziya 5cb7d16dfe bugfix
deepl auth check
2023-06-21 10:29:34 +09:00
misyaguziya 7b50eaa372 Merge branch 'develop' 2023-06-20 11:22:23 +09:00
misyaguziya be59d75f1a Merge branch 'README' into develop 2023-06-20 11:22:04 +09:00
misyaguziya 19ae8e05b1 update readme 2023-06-20 11:11:29 +09:00
misyaguziya 00af9b9d2b Merge branch 'information' into develop 2023-06-20 11:00:11 +09:00
misyaguziya c99f49ca7b update information 2023-06-20 10:59:51 +09:00
misyaguziya ef1dfbaa36 Merge branch 'errorlog' into develop 2023-06-20 10:57:09 +09:00
misyaguziya 2c1d75c55f add save error log 2023-06-20 10:56:42 +09:00
misyaguziya 971701cc88 Merge branch 'transcription_for_spk' into develop 2023-06-20 10:55:48 +09:00
misyaguziya ab1c9f5254 remove Parameters
INPUT_SPEAKER_SAMPLING_RATE/INPUT_SPEAKER_BUFFER_SIZE
2023-06-20 10:46:09 +09:00
misyaguziya 3e246b7aa6 update transcription
add daemon=True
2023-06-20 10:41:32 +09:00
misyaguziya 92e6ed9205 update spk process 2023-06-20 09:01:31 +09:00
misyaguziya 2009b613ec remove import package 2023-06-16 21:49:55 +09:00
misyaguziya 156019e5a4 Merge branch 'information' into develop 2023-06-15 18:06:09 +09:00
misyaguziya c495321021 update information 2023-06-15 18:05:54 +09:00
misyaguziya c571aa0e52 Merge branch 'UI' into develop 2023-06-15 16:30:42 +09:00
misyaguziya 71d6d00971 update Parameter config UI 2023-06-15 16:29:58 +09:00
misyaguziya 3f59e80ea1 update log text color 2023-06-15 15:26:59 +09:00
misyaguziya edb20b4da7 update tab UI 2023-06-15 10:27:54 +09:00
misyaguziya 3e9ee2d2a5 Merge branch 'transcription' into develop 2023-06-15 09:40:21 +09:00
misyaguziya edefa119e9 bugfix Thread close process 2023-06-15 03:18:05 +09:00
misyaguziya cb5b4f4e49 update textbox print message 2023-06-15 01:03:36 +09:00
misyaguziya 35cba754cc bugfix 2023-06-14 22:37:43 +09:00
misyaguziya 0f4b63e67b update func change font 2023-06-14 09:03:22 +09:00
misyaguziya 96472dfc81 add translation send/receive checkbox 2023-06-13 19:17:30 +09:00
misyaguziya 115d3a75c6 add output language optionmenu 2023-06-13 18:39:18 +09:00
misyaguziya dbc322ac15 update transcription UI 2023-06-13 18:04:29 +09:00
misyaguziya 61f769ef06 update transcription mic/spk 2023-06-13 13:51:31 +09:00
misyaguziya 073603ed91 pyaudio -> sounddevice 2023-06-13 06:25:41 +09:00
misyaguziya 6e31404e2c Merge branch 'dividing_modules' into develop 2023-06-12 17:56:32 +09:00
misyaguziya 63ed087986 make modules 2023-06-12 12:49:37 +09:00
misyaguziya f3d955e8fd Merge branch 'gitignore' into develop 2023-06-12 12:13:51 +09:00
misyaguziya a0004f0070 update gitignore 2023-06-12 12:13:35 +09:00
misyaguziya edc7f5116f Merge branch 'UI' into develop 2023-06-12 11:23:19 +09:00
misyaguziya 5c822de80b add unuse items font change 2023-06-11 17:59:48 +09:00
misyaguziya 1e6c5ad1bc add ui font change 2023-06-11 17:45:22 +09:00
misyaguziya eb7faea978 add message tab ui 2023-06-11 10:04:49 +09:00
misyaguziya dfd41fe787 add auto scroll textbox 2023-06-11 06:47:06 +09:00
misyaguziya 6940983478 add osc send typing 2023-06-11 06:01:23 +09:00
misyaguziya 1ba2bcc9e1 update textbox message 2023-06-11 05:48:43 +09:00
misyaguziya 6dd1734e53 update config parameter 2023-06-11 05:08:25 +09:00
misyaguziya 723d7d73ab update UI
fix config UI
2023-06-11 04:19:50 +09:00
misyaguziya 1b28499972 Merge branch 'transcription' into develop 2023-06-11 02:41:19 +09:00
misyaguziya 21a9edd43e add ui font 2023-06-09 18:12:41 +09:00
misyaguziya f8e2ab861c add transcription config 2023-06-09 18:04:58 +09:00
misyaguziya cd2ef8cd65 bugfix
choice mic device when 1st time
2023-06-09 02:43:04 +09:00
misyaguziya 8040bb66a6 add voice2chat 2023-06-09 02:02:11 +09:00
misyaguziya a2b62699e0 Merge branch 'gitignore' into develop 2023-06-08 11:39:53 +09:00
misyaguziya f88ffd826c update gitignore 2023-06-08 11:39:35 +09:00
misyaguziya 8a9e01a5c7 Merge branch 'develop' 2023-06-06 05:15:42 +09:00
misyaguziya b42c5fd7e4 Merge branch 'information' into develop 2023-06-06 05:15:18 +09:00
misyaguziya a4f0d9b322 update information 2023-06-06 05:14:56 +09:00
misyaguziya fa3f400fcb Merge branch 'develop' 2023-06-06 04:32:42 +09:00
misyaguziya 0bc4582f2c Merge branch 'information' into develop 2023-06-06 04:32:15 +09:00
misyaguziya 6ae92ff7fc update information 2023-06-06 04:31:51 +09:00
misyaguziya 7d1e546df4 Merge branch 'develop' 2023-06-06 04:13:35 +09:00
misyaguziya 2e8e3a6c97 Merge branch 'add_Translators' into develop 2023-06-06 04:12:46 +09:00
misyaguziya 028ad8f92a add google, bing 2023-06-06 04:12:10 +09:00
misyaguziya 3718ea32d1 Merge branch 'refactoring#1' into develop 2023-06-05 17:04:53 +09:00
misyaguziya ca476a74bc remove global 2023-06-05 02:49:27 +09:00
misyaguziya 046d249179 Merge branch 'add_deepl_web' into develop 2023-06-05 00:44:37 +09:00
misyaguziya 14155d5d83 add deepl(web) 2023-06-05 00:43:48 +09:00
misyaguziya 8f5151df80 Merge branch 'develop' 2023-06-03 01:57:49 +09:00
misyaguziya b004f07a26 Merge branch 'bugfix#5' into develop 2023-06-03 01:57:23 +09:00
misyaguziya d6d675f981 UI scaleを保持するように変更 2023-06-03 01:57:04 +09:00
misyaguziya 554ecc1fe9 Merge branch 'develop' 2023-06-03 01:39:46 +09:00
misyaguziya ba337cc04e Merge branch 'verion_name' into develop 2023-06-03 01:39:24 +09:00
misyaguziya 05b70e52ab update version number 2023-06-03 01:37:44 +09:00
misyaguziya 8788b51813 Merge branch 'develop' 2023-06-03 01:34:41 +09:00
misyaguziya 9a141bf4e4 Merge branch 'bugfux#4' into develop 2023-06-03 01:34:19 +09:00
misyaguziya e72e9302b6 information_windowが存在しない場合の処理を追加 2023-06-03 01:34:00 +09:00
misyaguziya 55df568fcc Merge branch 'information' into develop 2023-06-03 01:29:19 +09:00
misyaguziya 06742dc875 Merge branch 'bugfix#3' into develop 2023-06-03 01:29:08 +09:00
misyaguziya 3e71bd3926 最前面表示のバグを修正 2023-06-03 01:28:40 +09:00
misyaguziya 2fad9abbab Auth keyを入力しなくても文字入力できるように変更 2023-06-03 01:07:35 +09:00
misyaguziya fb5c9dbb2e update information 2023-06-03 00:59:09 +09:00
misyaguziya 64042d40f2 Merge branch 'UI' into develop 2023-06-03 00:46:18 +09:00
misyaguziya de782e1042 update UI 2023-06-03 00:45:37 +09:00
misyaguziya 1c4f06af81 add tabview for config 2023-06-02 15:44:34 +09:00
misyaguziya 6412f7df5a トップ画面を簡素に修正 2023-06-02 15:05:00 +09:00
misyaguziya 458252631c Merge branch 'transparent' into develop 2023-06-02 12:11:18 +09:00
misyaguziya b77afccf54 slider for transparency 2023-06-02 12:09:42 +09:00
misyaguziya 4f43a81b92 Merge branch 'develop' 2023-05-30 17:38:32 +09:00
misyaguziya d679d74fb5 Merge branch 'bugfix#2_poposuke' into develop 2023-05-30 17:38:13 +09:00
misyaguziya 9d93c66fcc bugfix#2 font 2023-05-30 17:37:36 +09:00
misyaguziya c33012f137 Merge branch 'develop' 2023-05-30 14:58:54 +09:00
misyaguziya a0caa45004 Merge branch 'information' into develop 2023-05-30 14:58:34 +09:00
misyaguziya 74ea836d10 update information 2023-05-30 14:58:18 +09:00
misyaguziya 60cdb9124d Merge branch 'bugfix#1_shiina' into develop 2023-05-30 14:52:20 +09:00
misyaguziya a94785a4bd bugfix#1 2023-05-30 14:51:51 +09:00
misyaguziya 52df4d3f7a Merge branch 'develop' 2023-05-30 03:13:52 +09:00
misyaguziya 4803c7c7c8 update 2023-05-30 03:13:34 +09:00
misyaguziya 45451f06e7 Merge branch 'develop' 2023-05-30 03:12:49 +09:00
misyaguziya 35984f01a9 Merge branch 'image_path' into develop 2023-05-30 03:12:26 +09:00
misyaguziya 27e049f4ad bugfix image path 2023-05-30 03:11:55 +09:00
misyaguziya 86f21c6989 Merge branch 'develop' 2023-05-30 02:27:39 +09:00
misyaguziya f404dbffe9 Merge branch 'information' into develop 2023-05-30 02:26:59 +09:00
misyaguziya 85f14db21f update information 2023-05-30 02:26:42 +09:00
misyaguziya 64b65efeff Merge branch 'foreground' into develop 2023-05-30 02:23:38 +09:00
misyaguziya 0b0bf988ee add checkbox for foreground 2023-05-30 02:23:11 +09:00
misyaguziya d6e356f80c Merge branch 'UI' into develop 2023-05-30 01:46:36 +09:00
misyaguziya ebb9d20a2a change name
VRC ChatBox Translator -> VRCT
2023-05-30 01:41:51 +09:00
misyaguziya 7b1c12487c update information 2023-05-30 01:39:18 +09:00
misyaguziya 2a0b2e45fc Merge branch 'UI' into develop 2023-05-30 01:29:25 +09:00
misyaguziya 554c71873a bugfix typo 2023-05-30 01:29:05 +09:00
misyaguziya 97b03d0725 add iconbitmap 2023-05-30 01:24:37 +09:00
misyaguziya 6a3ccb627a Merge branch 'UI' into develop 2023-05-30 01:07:44 +09:00
misyaguziya 939870a64a add checkbox for translation 2023-05-30 01:07:19 +09:00
misyaguziya 230d2f6ac9 Merge branch 'change_textbox' into develop 2023-05-30 00:35:00 +09:00
misyaguziya 41a3b876b6 update textbox & add information 2023-05-30 00:34:37 +09:00
misyaguziya 84f1e75100 Merge branch 'add_info' into develop 2023-05-30 00:23:05 +09:00
misyaguziya 8bd0c22670 add information 2023-05-30 00:21:30 +09:00
misyaguziya 591f230bf5 Merge branch 'develop' 2023-05-29 22:50:42 +09:00
misyaguziya 099f75d32b update codes 2023-05-29 22:49:57 +09:00
misyaguziya b239e1d724 add Format 2023-05-23 03:08:05 +09:00
misyaguziya 41a2a331b7 update config file 2023-05-23 00:43:31 +09:00
misyaguziya e0d10dfe05 init 2023-05-21 15:48:55 +09:00
551 changed files with 72727 additions and 0 deletions

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true // Allows for the parsing of JSX
}
},
"rules": {
"react/prop-types": "off",
"@typescript-eslint/no-empty-interface": 0,
"no-unreachable": "warn",
"no-unused-vars": "warn",
"react/react-in-jsx-scope": "off",
"semi": ["error", "always"]
},
"settings": {
"react": {
"version": "detect"
}
}
}
+13
View File
@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: [misyaguziya]
patreon: vrct_dev
open_collective: # Replace with a single Open Collective username
ko_fi: vrct_dev
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
custom: ["https://misyaguziya.booth.pm", "https://vrct-dev.fanbox.cc"]
+81
View File
@@ -0,0 +1,81 @@
name: Bug Report
description: File a bug report
title: "[Bug]: (Please note that the title must be in English.)"
assignees:
- misyaguziya
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
id: debug-tips
attributes:
label: Debug Tips
description: To improve debug efficiency, please read [Issues of README](https://github.com/misyaguziya/VRCT/issues) first.
options:
- label: I'm sure I've read this project's Issues of README.
required: true
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: input
id: app-version
attributes:
label: APP Version
description: What version of App are you running?
placeholder: Tell us what you see!
validations:
required: true
- type: dropdown
id: runtime-environment
attributes:
label: Runtime Environment
description: What runtime environment(OS) are you running?
options:
- "Windows 10"
- "Windows 11"
- "Other"
validations:
required: true
- type: input
id: region
attributes:
label: Country/Region
description: What Country(Region) are you running?
placeholder: Tell us what you see!
value: "Qatar (example)"
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste the relevant log output. Error logs are generated in the folder where VRCT.exe is stored.
render: sh
validations:
required: false
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: Markdown
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
options:
- label: I agree to follow this project's Code of Conduct
required: true
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
@@ -0,0 +1,73 @@
name: Feature Request
description: File a feature request
title: "[Feature]: (Please note that the title must be in English)"
assignees:
- misyaguziya
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: expect-to-happened
attributes:
label: Expect to happened
description: What happened, and what did you expect to happen?
placeholder: Tell us what you see!
value: "A feature I have expected ..."
validations:
required: true
- type: dropdown
id: expected-app-version
attributes:
label: Expected APP Version
description: What version of App did you expect?
options:
- next newest version
- a future version
validations:
required: true
- type: dropdown
id: expected-runtime-environment
attributes:
label: Expected Runtime Environment
description: What runtime environment(OS) did you expect?
options:
- "Windows 10"
- "Windows 11"
- "Other"
validations:
required: true
- type: input
id: region
attributes:
label: Country/Region
description: What Country(Region) did you expect?
placeholder: Tell us what you see!
value: "Qatar(example)"
validations:
required: true
- type: textarea
id: expected-output
attributes:
label: Expected Output
render: sh
validations:
required: false
- type: textarea
id: screenshot
attributes:
label: "Sharing features in images"
value: |
![DESCRIPTION](LINK.png)
render: Markdown
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
options:
- label: I agree to follow this project's Code of Conduct
required: true
@@ -0,0 +1,56 @@
---
description: 'プロジェクト解析に基づくREADME自動生成専用モード'
tools: ['edit', 'search', 'runCommands', 'runTasks', 'usages', 'vscodeAPI', 'problems', 'changes', 'fetch', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'todos']
model: 'Auto'
---
# README自動生成モード ※下記コードでは絵文字をカットしています
あなたは優秀な技術文書ライターです。プロジェクトのコードベースを詳細に分析し、正確で包括的なREADMEファイルを生成することが役割です。
## 基本方針 ※下記コードでは絵文字をカットしています
### 分析対象
- プロジェクトの全ファイル構成
- 主要なソースコード(HTML、JavaScript、CSS、Python等)
- 設定ファイル(package.json、requirements.txt等)
- 既存のドキュメント
### README構成要件 ※下記コードでは絵文字をカットしています
必須セクション(この順序で記載):
1. **プロジェクト概要** - 1-2文でプロジェクトの目的を説明
2. **主要機能** - 実装されている機能のリスト
3. **使用方法** - エンドユーザー向けの操作手順
4. **動作環境** - 必要な環境・依存関係
5. **インストール・実行方法** - 開発者向けセットアップ手順
6. **ファイル構成** - 主要ファイルの説明
7. **制限事項・既知の問題** - 現在できないこと、バグ
8. **技術仕様** - 使用技術・ライブラリ
9. **ライセンス** - 適用されるライセンス情報
### 重要な制約事項 ※下記コードでは絵文字をカットしています
1. **事実のみ記載**: コードベースに存在しない機能は記載しない
2. **検証可能な情報**: 実際のファイルから確認できる内容のみ
3. **ユーザー目線**: エンドユーザーが最初に知りたい情報を優先
4. **簡潔で明確**: 冗長な説明は避け、必要な情報を効率的に伝達
5. **制限事項の明記**: 実装されていない機能や既知の問題を正直に記載
### 文体・フォーマット ※下記コードでは絵文字をカットしています
- 敬語は使用せず、簡潔で読みやすい文体
- コードブロックやリストを適切に活用
- 見出しは階層的に整理
- 技術用語は必要に応じて補足説明
### 分析手順 ※下記コードでは絵文字をカットしています
1. プロジェクトの全体構造を把握
2. メインファイル(index.html、main.js等)の機能を解析
3. 設定ファイルから依存関係や環境要件を抽出
4. 実際の動作フローを追跡
5. 未実装部分や制限事項を特定
6. 上記構成要件に従ってREADMEを生成
コードベースの事実に基づいた、正確で有用なREADMEファイルの生成を最優先に作業してください。
+92
View File
@@ -0,0 +1,92 @@
name: Release VRCT
on:
push:
tags:
- 'v*' # タグが 'v' で始まる場合にトリガー (例: v1.0.0)
jobs:
release:
name: Build VRCT
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.15.0'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install dependencies
run: npm install
- name: Setup Python environment
run: npm run setup-python
- name: Install Python script dependencies
run: pip install tqdm
- name: Build and package
run: npm run release-all
- name: Get version from tag
id: get_version
shell: pwsh
run: |
$TAG_WITH_V = $env:GITHUB_REF -replace "^refs/tags/", ""
$VERSION_NUM = $TAG_WITH_V -replace "^v", ""
echo "VERSION=$VERSION_NUM" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Upload to Hugging Face Hub
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
shell: pwsh
run: |
pip install huggingface_hub==0.34.4
$UPLOAD_DIR = "./hf_upload_temp"
New-Item -ItemType Directory -Force -Path $UPLOAD_DIR
Copy-Item -Path ./VRCT.zip -Destination "$UPLOAD_DIR/VRCT.zip"
Copy-Item -Path ./VRCT_cuda.zip -Destination "$UPLOAD_DIR/VRCT_cuda.zip"
hf upload --repo-type model --commit-message "👍️[Update] ${{ env.VERSION }} Release" ms-software/VRCT $UPLOAD_DIR
hf repo tag create ms-software/VRCT ${{ github.ref_name }} --repo-type model --message "Release ${{ github.ref_name }}"
Remove-Item -Recurse -Force $UPLOAD_DIR
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset (NSIS Installer)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./src-tauri/target/release/bundle/nsis/VRCT_${{ env.VERSION }}_x64-setup.exe
asset_name: VRCT_${{ env.VERSION }}_x64-setup.exe
asset_content_type: application/octet-stream
+51
View File
@@ -0,0 +1,51 @@
tmp/
build/
dist/
/config.json
memo.txt
*.pyc
logs/
.venv/
.venv_cuda/
weights/
.vscode
error.log
*.exe
*.ipynb
VRCT.zip
VRCT_cuda.zip
.qoder/
# Added by WebUI migration
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
.vscode
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.venv
# Customize
/build
error.txt
config.json
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 misyaguziya
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
View File
Whitespace-only changes.
Symlink
+1
View File
@@ -0,0 +1 @@
docs/readmes/README.en.md
+2
View File
@@ -0,0 +1,2 @@
call .venv/Scripts/activate
pyinstaller spec/backend.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR
+2
View File
@@ -0,0 +1,2 @@
call .venv_cuda/Scripts/activate
pyinstaller spec/backend_cuda.spec --distpath src-tauri/bin --clean --noconfirm --log-level ERROR
+25
View File
@@ -0,0 +1,25 @@
REM .venv exists
if exist .venv (
rmdir /s /q .venv
)
REM make .venv
python -m venv .venv
REM install packages for .venv
call .venv/Scripts/activate
python.exe -m pip install --upgrade pip
pip install --no-cache-dir --force-reinstall -r requirements.txt
REM if .venv_cuda exists
if exist .venv_cuda (
rmdir /s /q .venv_cuda
)
REM make .venv_cuda
python -m venv .venv_cuda
REM install packages for .venv_cuda
call .venv_cuda/Scripts/activate
python.exe -m pip install --upgrade pip
pip install --no-cache-dir --force-reinstall -r requirements_cuda.txt
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

+422
View File
@@ -0,0 +1,422 @@
# VRCTビルドガイド
このドキュメントでは、VRCTプロジェクトのビルド方法について説明します。
## 目次
- [必要な環境](#必要な環境)
- [初回セットアップ](#初回セットアップ)
- [ビルドの種類](#ビルドの種類)
- [開発ビルド](#開発ビルド)
- [リリースビルド](#リリースビルド)
- [ビルドプロセスの詳細](#ビルドプロセスの詳細)
- [トラブルシューティング](#トラブルシューティング)
## 必要な環境
### 必須ソフトウェア
- **Node.js** (npm含む)
- **Python 3.x**
- **Rust** (Tauri用)
- **Git**
### 推奨環境
- Windows 10/11
- メモリ: 8GB以上
- ストレージ: 5GB以上の空き容量
## 初回セットアップ
### 1. リポジトリのクローン
```bash
git clone <repository-url>
cd VRCT
```
### 2. Node.js依存関係のインストール
```bash
npm install
```
### 3. Python環境のセットアップ
以下のコマンドで、CPU版とCUDA版の両方の仮想環境を作成します:
```bash
npm run setup-python
```
このコマンドは以下の処理を実行します:
- `.venv` (CPU版) の作成と依存関係のインストール
- `.venv_cuda` (CUDA版) の作成と依存関係のインストール
> **注意**: CUDA版を使用する場合は、NVIDIAのGPUとCUDA Toolkit 12.8が必要です。
## ビルドの種類
VRCTでは、以下の2種類のビルドが可能です:
### CPU版
標準的なCPUで動作するバージョン。GPUは不要。
### CUDA版
NVIDIA GPUを活用した高速処理版。CUDA対応GPUが必要。
## 開発ビルド
開発中にアプリケーションを実行・テストするためのビルドです。
### CPU版の開発ビルド
```bash
npm run dev
```
このコマンドは以下を実行します:
1. 実行中のプロセスを終了 (`task-kill`)
2. ビルドファイルのクリーンアップ (`clean`)
3. バージョン情報の更新 (`update-version`)
4. Pythonバックエンドのビルド (`build-python`)
5. ViteとTauriの開発サーバー起動
### CUDA版の開発ビルド
```bash
npm run dev-cuda
```
CPU版と同様ですが、CUDA対応のPythonバックエンドをビルドします。
### UIのみの開発
バックエンドのビルドをスキップして、UIのみを開発する場合:
```bash
npm run dev-ui
```
## リリースビルド
配布用のインストーラーを作成するビルドです。
### CPU版のリリースビルド
```bash
npm run build
```
または、ZIP形式でパッケージング:
```bash
npm run release
```
生成されるファイル:
- インストーラー: `src-tauri/target/release/bundle/nsis/`
- ZIPファイル: `VRCT.zip` (releaseコマンド使用時)
### CUDA版のリリースビルド
```bash
npm run build-cuda
```
または、ZIP形式でパッケージング:
```bash
npm run release-cuda
```
生成されるファイル:
- インストーラー: `src-tauri/target/release/bundle/nsis/`
- ZIPファイル: `VRCT_cuda.zip` (release-cudaコマンド使用時)
### 両バージョンの同時ビルド
CPU版とCUDA版の両方をビルドする場合:
```bash
npm run release-all
```
## ビルドプロセスの詳細
### バージョン管理
バージョンは `package.json` で一元管理され、以下のファイルに自動で同期されます:
```bash
npm run update-version
```
更新されるファイル:
- `src-tauri/tauri.conf.json`
- `src-python/config.py`
### どこにバージョンを設定すればReleaseに反映されるか
- **設定箇所**: `package.json` の `version` が唯一のソース・オブ・トゥルース。
- **反映方法**: `npm run update-version`(`build`/`build-cuda`/`release`コマンド内でも自動実行)により、
- `src-tauri/tauri.conf.json` の `version` に同期(Tauri/NSISインストーラーの表示・メタデータに使用)
- `src-python/config.py` の `self._VERSION` に同期(ランタイム表示等に使用)
- **成果物への影響**:
- インストーラー(NSIS)は `tauri.conf.json` の `version` を取り込み、プロダクトバージョンとして反映。
- ZIPパッケージ名はスクリプト既定では固定(`VRCT.zip`/`VRCT_cuda.zip`)。ファイル名にバージョンを含めたい場合は、`package.json` の `release` スクリプトを調整してください。
### Pythonバックエンドのビルド
#### CPU版
```bash
npm run build-python
```
実行内容:
- `.venv` 環境をアクティベート
- PyInstallerで `spec/backend.spec` を使用してビルド
- 出力先: `src-tauri/bin/`
#### CUDA版
```bash
npm run build-python-cuda
```
実行内容:
- `.venv_cuda` 環境をアクティベート
- PyInstallerで `spec/backend_cuda.spec` を使用してビルド
- 出力先: `src-tauri/bin/`
### フロントエンドのビルド
```bash
npm run vite-build
```
Viteを使用してフロントエンド(React)をビルドし、`dist/` ディレクトリに出力します。
### Tauriアプリケーションのビルド
```bash
npm run tauri build
```
Tauriを使用して最終的なデスクトップアプリケーションをビルドします。
## GitHub ActionsでのRelease自動化
Windows用のReleaseをGitHub Actionsで自動生成・公開する例です。`package.json` のバージョンをタグ・リリース名に使い、TauriのNSISインストーラーとZIPを添付します。
### 推奨トリガー
- タグプッシュ(例: `v*`)または手動実行(`workflow_dispatch`)
### サンプルワークフロー(Windows)
```yaml
name: Release (Windows)
on:
workflow_dispatch: {}
push:
tags:
- 'v*'
jobs:
build-release-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
npm ci
- name: Setup Python envs (.venv/.venv_cuda)
run: |
npm run setup-python
- name: Sync versions from package.json
run: |
npm run update-version
- name: Build (CPU)
run: |
npm run build
- name: Package ZIP (CPU)
run: |
python utils/zip.py --zip_name VRCT.zip
- name: Read version from package.json
id: pkg
shell: pwsh
run: |
$version = (Get-Content package.json | ConvertFrom-Json).version
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: VRCT-windows-${{ steps.pkg.outputs.version }}
path: |
src-tauri/target/release/bundle/nsis/**/*
VRCT.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.pkg.outputs.version }}
name: VRCT v${{ steps.pkg.outputs.version }}
files: |
src-tauri/target/release/bundle/nsis/**/*
VRCT.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### ポイント
- ビルド前に必ず `npm run update-version` を実行して、`tauri.conf.json` と `config.py` にバージョンを同期します。
- アーティファクトのパスは既定構成に合わせています:
- インストーラー: `src-tauri/target/release/bundle/nsis/`
- ZIP: ルート直下の `VRCT.zip`
- CUDA版も同様にビルドする場合は、`npm run build-cuda` と `python utils/zip.py --zip_name VRCT_cuda.zip` を追加して、別アーティファクト名でアップロード・添付してください。
## ユーティリティコマンド
### クリーンアップ
```bash
npm run clean
```
以下のディレクトリを削除します:
- `build/`
- `dist/`
- `src-tauri/bin/`
- `src-tauri/target/`
### プロセスの強制終了
```bash
npm run task-kill
```
VRCTに関連する実行中のプロセスを終了します。
## ディレクトリ構成
```
VRCT/
├── bat/ # バッチスクリプト
│ ├── build.bat # CPU版Pythonビルド
│ ├── build_cuda.bat # CUDA版Pythonビルド
│ └── install.bat # Python環境セットアップ
├── spec/ # PyInstallerスペックファイル
│ ├── backend.spec # CPU版ビルド設定
│ └── backend_cuda.spec # CUDA版ビルド設定
├── src-python/ # Pythonバックエンドソースコード
├── src-tauri/ # Tauriアプリケーション設定
│ ├── bin/ # ビルド済みPythonバイナリ(生成)
│ └── target/ # Tauriビルド出力(生成)
├── src-ui/ # Reactフロントエンドソースコード
├── utils/ # ユーティリティスクリプト
│ ├── clean.py # クリーンアップスクリプト
│ ├── task_kill.py # プロセス終了スクリプト
│ ├── update_version.py # バージョン更新スクリプト
│ └── zip.py # ZIPパッケージング
├── package.json # Node.js設定とバージョン管理
├── requirements.txt # Python依存関係(CPU版)
└── requirements_cuda.txt # Python依存関係(CUDA版)
```
## トラブルシューティング
### Python環境のエラー
仮想環境を再作成してください:
```bash
npm run setup-python
```
### ビルドが失敗する
1. クリーンアップを実行:
```bash
npm run clean
```
2. Node.js依存関係を再インストール:
```bash
npm install
```
3. 再度ビルド:
```bash
npm run build
```
### CUDA版が動作しない
- CUDA Toolkit 12.8がインストールされているか確認
- NVIDIA GPUドライバーが最新か確認
- `requirements_cuda.txt` の依存関係が正しくインストールされているか確認
### プロセスが残っている
```bash
npm run task-kill
```
を実行して、すべてのVRCTプロセスを終了してください。
## 参考情報
### PyInstallerスペックファイル
- `spec/backend.spec` - CPU版の設定
- `spec/backend_cuda.spec` - CUDA版の設定
これらのファイルでは、以下を設定しています:
- エントリーポイント: `src-python/mainloop.py`
- データファイル(フォント、プロンプト、言語ファイル等)のパス
- 依存ライブラリのパス
### バージョン管理フロー
1. `package.json` のバージョンを更新
2. `npm run update-version` を実行
3. 自動的に `tauri.conf.json` と `config.py` が更新される
### リリースパッケージの内容
ZIPファイルには以下が含まれます:
- `VRCT.exe` - メインアプリケーション
- `VRCT-sidecar.exe` - Pythonバックエンド
- `_internal/` - 必要な依存ファイル
## ライセンス
プロジェクトのライセンスについては、`LICENSE` ファイルを参照してください。
+107
View File
@@ -0,0 +1,107 @@
<div align="center">
<picture>
<source srcset="/docs/img/vrct_logo_white.png" media="(prefers-color-scheme: dark)" width="50%">
<source srcset="/docs/img/vrct_logo_black.png" media="(prefers-color-scheme: light)" width="50%">
<img src="/docs/img/vrct_logo.png" alt="VRCT Logo" width="50%">
</picture>
<br>
<br>
[![GitHub release](https://img.shields.io/github/v/release/misyaguziya/VRCT.svg)](https://github.com/misyaguziya/VRCT/releases)
[![Downloads](https://img.shields.io/github/downloads/misyaguziya/VRCT/total)](https://github.com/misyaguziya/VRCT/releases)
[![Licence](https://img.shields.io/github/license/misyaguziya/VRCT)](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
[![Booth](https://img.shields.io/badge/Store-Booth.pm-red)](https://misyaguziya.booth.pm/items/5155325)
[![Github Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-30363D?&logo=GitHub-Sponsors&logoColor=EA4AAA)](https://github.com/sponsors/misyaguziya)
<h3>
Become a VRCT Supporter on:
</h3>
<a href="https://vrct-dev.fanbox.cc">
<picture>
<source srcset="/docs/img/pixiv_fanbox_white.png" media="(prefers-color-scheme: dark)" height="18px">
<source srcset="/docs/img/pixiv_fanbox_black.png" media="(prefers-color-scheme: light)" height="18px">
<img src="/docs/img/pixiv_fanbox_black.png" alt="PIXIV FANBOX" height="18px">
</picture>
</a>&emsp;&nbsp;
<a href="https://patreon.com/vrct_dev">
<picture>
<source srcset="/docs/img/patreon_logo_white.png" media="(prefers-color-scheme: dark)" height="22px">
<source srcset="/docs/img/patreon_logo_black.png" media="(prefers-color-scheme: light)" height="22px">
<img src="/docs/img/patreon_logo_black.png" alt="Patreon" height="22px">
</picture>
</a>&emsp;&nbsp;
<br>
<picture>
<source srcset="/docs/img/supporter_section_border_d.png" media="(prefers-color-scheme: dark)">
<source srcset="/docs/img/supporter_section_border_l.png" media="(prefers-color-scheme: light)">
<img src="/docs/img/supporter_section_border_d.png" alt="Supporter Section Border">
</picture>
<br>
<br>
| **English** | [日本語](/docs/readmes/README.ja.md) | [한국어](/docs/readmes/README.ko.md) | [繁體中文](/docs/readmes/README.zh-Hant.md) |
<h3>
VRCT is software that supports VRChat conversations with translation and transcription.
</h3>
![](/docs/img/main_window.png)
<div align="left">
# Download & Install
Download from anywhere you like.
- [Github.com](https://github.com/misyaguziya/VRCT/releases/)
- [BOOTH.pm](https://misyaguziya.booth.pm/items/5155325)
Just download and run the exe.
# What is VRCT?
VRCT is software that supports conversations between people who speak different languages by providing chat or voice translation.
These features are designed for use within VRChat.
*Although not supported, it is also used for other purposes such as watching movies.
VRCT supports your conversations with
- 💬 **Send chat to VRChat**
- 🌐 **Translation**
- 🎙 **Transcription of audio from microphone**
- 🔈 **Transcription of audio from Speaker**
# Documents
Initial setup, basic functions, and other features are also described.
- [Documents Link](https://misyaguziya.github.io/VRCT-Docs/)
# How to Use (YouTube)
<div align="center">
[![](https://img.youtube.com/vi/rUTad037n8Q/0.jpg)](https://www.youtube.com/watch?v=rUTad037n8Q)
<div align="left">
## Author
- [みしゃ(misyaguzi)](https://github.com/misyaguziya) (Main Development)
- [しいな(Shiina_12siy)](https://twitter.com/Shiina_12siy) (UI/UX, UI multilingual support)
- [レラ](https://github.com/soumt-r) (Technical Advisor)
- [どね](https://twitter.com/done_vrc) (Logo Design)
## Telemetry
VRCT collects anonymous telemetry data via [Aptabase](https://aptabase.com) to help improve the app. The collected data includes app starts, session duration, and feature usage. No personally identifiable information is collected.
You can opt out of telemetry in the app settings at any time. See the [Aptabase Privacy Policy](https://aptabase.com/legal/privacy) for more details.
## Thanks to our contributors
<a href="https://github.com/misyaguziya/VRCT/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=misyaguziya/VRCT" />
</a>
---
VRCT is not endorsed by VRChat and does not reflect the views or opinions of VRChat or anyone officially involved in producing or managing VRChat properties. VRChat and all associated properties are trademarks or registered trademarks of VRChat Inc. VRChat © VRChat Inc.
+107
View File
@@ -0,0 +1,107 @@
<div align="center">
<picture>
<source srcset="/docs/img/vrct_logo_white.png" media="(prefers-color-scheme: dark)" width="50%">
<source srcset="/docs/img/vrct_logo_black.png" media="(prefers-color-scheme: light)" width="50%">
<img src="/docs/img/vrct_logo.png" alt="VRCT Logo" width="50%">
</picture>
<br>
<br>
[![GitHub release](https://img.shields.io/github/v/release/misyaguziya/VRCT.svg)](https://github.com/misyaguziya/VRCT/releases)
[![Downloads](https://img.shields.io/github/downloads/misyaguziya/VRCT/total)](https://github.com/misyaguziya/VRCT/releases)
[![Licence](https://img.shields.io/github/license/misyaguziya/VRCT)](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
[![Booth](https://img.shields.io/badge/Store-Booth.pm-red)](https://misyaguziya.booth.pm/items/5155325)
[![Github Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-30363D?&logo=GitHub-Sponsors&logoColor=EA4AAA)](https://github.com/sponsors/misyaguziya)
<h3>
Become a VRCT Supporter on:
</h3>
<a href="https://vrct-dev.fanbox.cc">
<picture>
<source srcset="/docs/img/pixiv_fanbox_white.png" media="(prefers-color-scheme: dark)" height="18px">
<source srcset="/docs/img/pixiv_fanbox_black.png" media="(prefers-color-scheme: light)" height="18px">
<img src="/docs/img/pixiv_fanbox_black.png" alt="PIXIV FANBOX" height="18px">
</picture>
</a>&emsp;&nbsp;
<a href="https://patreon.com/vrct_dev">
<picture>
<source srcset="/docs/img/patreon_logo_white.png" media="(prefers-color-scheme: dark)" height="22px">
<source srcset="/docs/img/patreon_logo_black.png" media="(prefers-color-scheme: light)" height="22px">
<img src="/docs/img/patreon_logo_black.png" alt="Patreon" height="22px">
</picture>
</a>&emsp;&nbsp;
<br>
<picture>
<source srcset="/docs/img/supporter_section_border_d.png" media="(prefers-color-scheme: dark)">
<source srcset="/docs/img/supporter_section_border_l.png" media="(prefers-color-scheme: light)">
<img src="/docs/img/supporter_section_border_d.png" alt="Supporter Section Border">
</picture>
<br>
<br>
| [English](/docs/readmes/README.en.md) | **日本語** | [한국어](/docs/readmes/README.ko.md) | [繁體中文](/docs/readmes/README.zh-Hant.md) |
<h3>
VRCTは翻訳や文字起こしでVRChatの会話をサポートするソフトウェアです。
</h3>
![](/docs/img/main_window.png)
<div align="left">
# ダウンロード&インストール
好きな場所からダウンロードしてください。
- [Github.com](https://github.com/misyaguziya/VRCT/releases/)
- [BOOTH.pm](https://misyaguziya.booth.pm/items/5155325)
ダウンロードしてexeを起動するだけです。
# VRCTってなに?
VRCTは話す言語の異なる人同士が会話を行うためにチャットもしくは音声の翻訳を行うことで会話をサポートするソフトウェアです。
これらの機能はVRChat内で使用するために設計されています。
※サポート対象外ですがその他の用途として映画鑑賞等でも使用されています。
VRCTはあなたの会話を以下でサポートをします。
- 💬 **VRChatへのチャット送信機能**
- 🌐 **翻訳機能**
- 🎙 **マイクの文字起こし機能**
- 🔈 **スピーカーの文字起こし機能**
# ドキュメント
初期設定や基本機能、その他の機能についても記載してあります。
- [Documents Link](https://misyaguziya.github.io/VRCT-Docs/)
# 使い方(Youtube)
<div align="center">
[![](https://img.youtube.com/vi/rUTad037n8Q/0.jpg)](https://www.youtube.com/watch?v=rUTad037n8Q)
<div align="left">
## Author
- [みしゃ(misyaguzi)](https://github.com/misyaguziya) (メイン開発)
- [しいな(Shiina_12siy)](https://twitter.com/Shiina_12siy) (UI/UX, UI多言語対応)
- [レラ](https://github.com/soumt-r) (テクニカルサポート)
- [どね](https://twitter.com/done_vrc) (ロゴデザイン)
## テレメトリー(利用統計情報)
VRCTは[Aptabase](https://aptabase.com)を通じて、アプリの改善のために匿名のテレメトリーデータを収集しています。収集されるデータは、起動回数、起動時間、使用機能です。個人を特定できる情報は一切収集されません。
テレメトリーはアプリの設定からいつでも無効化できます。詳細は[Aptabaseプライバシーポリシー](https://aptabase.com/legal/privacy)をご確認ください。
## Thanks to our contributors
<a href="https://github.com/misyaguziya/VRCT/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=misyaguziya/VRCT" />
</a>
---
VRCT は VRChat によって承認されておらず、VRChat または VRChat の開発もしくは管理に公式に関与する者の見解や意見が反映されたものではありません。VRChat および関連するすべての財産は 米国VRChat, Incの商標または登録商標です。
+107
View File
@@ -0,0 +1,107 @@
<div align="center">
<picture>
<source srcset="/docs/img/vrct_logo_white.png" media="(prefers-color-scheme: dark)" width="50%">
<source srcset="/docs/img/vrct_logo_black.png" media="(prefers-color-scheme: light)" width="50%">
<img src="/docs/img/vrct_logo.png" alt="VRCT Logo" width="50%">
</picture>
<br>
<br>
[![GitHub release](https://img.shields.io/github/v/release/misyaguziya/VRCT.svg)](https://github.com/misyaguziya/VRCT/releases)
[![Downloads](https://img.shields.io/github/downloads/misyaguziya/VRCT/total)](https://github.com/misyaguziya/VRCT/releases)
[![Licence](https://img.shields.io/github/license/misyaguziya/VRCT)](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
[![Booth](https://img.shields.io/badge/Store-Booth.pm-red)](https://misyaguziya.booth.pm/items/5155325)
[![Github Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-30363D?&logo=GitHub-Sponsors&logoColor=EA4AAA)](https://github.com/sponsors/misyaguziya)
<h3>
Become a VRCT Supporter on:
</h3>
<a href="https://vrct-dev.fanbox.cc">
<picture>
<source srcset="/docs/img/pixiv_fanbox_white.png" media="(prefers-color-scheme: dark)" height="18px">
<source srcset="/docs/img/pixiv_fanbox_black.png" media="(prefers-color-scheme: light)" height="18px">
<img src="/docs/img/pixiv_fanbox_black.png" alt="PIXIV FANBOX" height="18px">
</picture>
</a>&emsp;&nbsp;
<a href="https://patreon.com/vrct_dev">
<picture>
<source srcset="/docs/img/patreon_logo_white.png" media="(prefers-color-scheme: dark)" height="22px">
<source srcset="/docs/img/patreon_logo_black.png" media="(prefers-color-scheme: light)" height="22px">
<img src="/docs/img/patreon_logo_black.png" alt="Patreon" height="22px">
</picture>
</a>&emsp;&nbsp;
<br>
<picture>
<source srcset="/docs/img/supporter_section_border_d.png" media="(prefers-color-scheme: dark)">
<source srcset="/docs/img/supporter_section_border_l.png" media="(prefers-color-scheme: light)">
<img src="/docs/img/supporter_section_border_d.png" alt="Supporter Section Border">
</picture>
<br>
<br>
| [English](/docs/readmes/README.en.md) | [日本語](/docs/readmes/README.ja.md) | **한국어** | [繁體中文](/docs/readmes/README.zh-Hant.md) |
<h3>
VRCT는 음성인식 및 번역 기능을 통해 VRChat의 대화를 지원하는 소프트웨어입니다.
</h3>
![](/docs/img/main_window.png)
<div align="left">
# 다운로드 및 설치
원하는 곳에서 다운로드 할 수 있어요.
- [Github.com](https://github.com/misyaguziya/VRCT/releases/)
- [BOOTH.pm](https://misyaguziya.booth.pm/items/5155325)
다운로드 후 exe를 실행하기만 하면 됩니다.
# VRCT가 뭔가요?
VRCT는 서로 다른 언어를 사용하는 사람들끼리 대화를 할 수 있도록 채팅이나 음성 번역을 통해 대화를 지원하는 소프트웨어에요.
이 기능들은 VRChat 내에서 사용하도록 설계되었어요.
※ 지원 대상에서 제외되지만, 영화 감상 등 다른 용도로도 사용되고 있습니다.
VRCT는 다음과 같이 당신의 대화를 도와드려요.
- 💬 **VRChat으로의 채팅 전송 기능**
- 🌐 **번역 기능**
- 🎙 **마이크 음성인식 기능**
- 🔈 **스피커 음성인식 기능**
# 문서 (일본어)
초기 설정과 기본 기능 및 기타 기능에 대해 설명되어 있어요.
- [Documents Link](https://misyaguziya.github.io/VRCT-Docs/)
# 사용법 (Youtube)
<div align="center">
[![](https://img.youtube.com/vi/rUTad037n8Q/0.jpg)](https://www.youtube.com/watch?v=rUTad037n8Q)
<div align="left">
## Author
- [みしゃ(misyaguzi)](https://github.com/misyaguziya) (주요 개발)
- [しいな(Shiina_12siy)](https://twitter.com/Shiina_12siy) (UI/UX, UI 다국어 지원)
- [レラ](https://github.com/soumt-r) (기술 지원)
- [どね](https://twitter.com/done_vrc) (로고 디자인)
## 텔레메트리 (사용 통계)
VRCT는 [Aptabase](https://aptabase.com)를 통해 앱 개선을 위한 익명 텔레메트리 데이터를 수집합니다. 수집되는 데이터는 앱 시작 횟수, 세션 시간, 기능 사용입니다. 개인 식별 정보는 수집되지 않습니다.
앱 설정에서 언제든지 텔레메트리를 비활성화할 수 있습니다. 자세한 내용은 [Aptabase 개인정보 처리방침](https://aptabase.com/legal/privacy)을 참조하세요.
## Thanks to our contributors
<a href="https://github.com/misyaguziya/VRCT/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=misyaguziya/VRCT" />
</a>
---
VRCT는 VRChat의 어떠한 승인도 받지 않았으며, VRChat 또는 VRChat의 개발 또는 관리에 공식적으로 관여하는 사람의 견해나 의견을 반영하지 않습니다. VRChat 및 모든 관련 재산은 미국 VRChat, Inc의 상표 또는 등록상표입니다.
+106
View File
@@ -0,0 +1,106 @@
<div align="center">
<picture>
<source srcset="/docs/img/vrct_logo_white.png" media="(prefers-color-scheme: dark)" width="50%">
<source srcset="/docs/img/vrct_logo_black.png" media="(prefers-color-scheme: light)" width="50%">
<img src="/docs/img/vrct_logo.png" alt="VRCT Logo" width="50%">
</picture>
<br>
<br>
[![GitHub release](https://img.shields.io/github/v/release/misyaguziya/VRCT.svg)](https://github.com/misyaguziya/VRCT/releases)
[![Downloads](https://img.shields.io/github/downloads/misyaguziya/VRCT/total)](https://github.com/misyaguziya/VRCT/releases)
[![Licence](https://img.shields.io/github/license/misyaguziya/VRCT)](https://github.com/misyaguziya/VRCT/blob/master/LICENSE)
[![Booth](https://img.shields.io/badge/Store-Booth.pm-red)](https://misyaguziya.booth.pm/items/5155325)
[![Github Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-30363D?&logo=GitHub-Sponsors&logoColor=EA4AAA)](https://github.com/sponsors/misyaguziya)
<h3>
Become a VRCT Supporter on:
</h3>
<a href="https://vrct-dev.fanbox.cc">
<picture>
<source srcset="/docs/img/pixiv_fanbox_white.png" media="(prefers-color-scheme: dark)" height="18px">
<source srcset="/docs/img/pixiv_fanbox_black.png" media="(prefers-color-scheme: light)" height="18px">
<img src="/docs/img/pixiv_fanbox_black.png" alt="PIXIV FANBOX" height="18px">
</picture>
</a>&emsp;&nbsp;
<a href="https://patreon.com/vrct_dev">
<picture>
<source srcset="/docs/img/patreon_logo_white.png" media="(prefers-color-scheme: dark)" height="22px">
<source srcset="/docs/img/patreon_logo_black.png" media="(prefers-color-scheme: light)" height="22px">
<img src="/docs/img/patreon_logo_black.png" alt="Patreon" height="22px">
</picture>
</a>&emsp;&nbsp;
<br>
<picture>
<source srcset="/docs/img/supporter_section_border_d.png" media="(prefers-color-scheme: dark)">
<source srcset="/docs/img/supporter_section_border_l.png" media="(prefers-color-scheme: light)">
<img src="/docs/img/supporter_section_border_d.png" alt="Supporter Section Border">
</picture>
<br>
<br>
| [English](/docs/readmes/README.en.md) | [日本語](/docs/readmes/README.ja.md) | [한국어](/docs/readmes/README.ko.md) | **繁體中文** |
<h3>
VRCT 是一個支援 VRChat 對話翻譯和紀錄的軟體。
</h3>
![](/docs/img/main_window.png)
<div align="left">
# 下載 & 安裝
你可以從這些地方下載 VRCT:
- [Github.com](https://github.com/misyaguziya/VRCT/releases/)
- [BOOTH.pm](https://misyaguziya.booth.pm/items/5155325)
你只需要下載並啟動 exe 文件。
# 什麼是 VRCT?
VRCT 是一種透過提供聊天或語音翻譯來幫助語言不通的人對話的軟體。
這些功能專為在 VRChat 中使用而設計,但你也可以拿來看電影。
VRCT 可以:
- 💬 **傳送訊息至遊戲內 Chatbox**
- 🌐 **自動翻譯**
- 🎙 **麥克風轉文字**
- 🔈 **喇叭轉文字**
# 文件
解釋了初始設定、基本功能以及其他功能。
- [Documents Link](https://misyaguziya.github.io/VRCT-Docs/)
# YouTube 教學(日語、英文字幕)
<div align="center">
[![](https://img.youtube.com/vi/rUTad037n8Q/0.jpg)](https://www.youtube.com/watch?v=rUTad037n8Q)
<div align="left">
## 作者
- [みしゃ(misyaguzi)](https://github.com/misyaguziya) (主要開發)
- [しいな(Shiina_12siy)](https://twitter.com/Shiina_12siy) (UI/UX, UI 多語系支援)
- [レラ](https://github.com/soumt-r) (技術支援)
- [どね](https://twitter.com/done_vrc) (Logo 設計)
## 遙測(使用統計)
VRCT 透過 [Aptabase](https://aptabase.com) 收集匿名遙測資料以協助改善應用程式。收集的資料包括應用程式啟動次數、使用時長、功能使用。不會收集任何可識別個人身份的資訊。
您可以隨時在應用程式設定中停用遙測。詳情請參閱 [Aptabase 隱私權政策](https://aptabase.com/legal/privacy)。
## Thanks to our contributors
<a href="https://github.com/misyaguziya/VRCT/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=misyaguziya/VRCT" />
</a>
---
VRCT 未得到 VRChat 的認可,也不反映 VRChat 或正式參與製作或管理 VRChat 財產的任何人的觀點或意見。VRChat 和所有相關財產均為 VRChat Inc. 的商標或註冊商標。
+14
View File
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="./assets/chato_icon_fill.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>VRCT</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./src-ui/views/app/index.jsx"></script>
</body>
</html>
+38
View File
@@ -0,0 +1,38 @@
import yaml from "js-yaml";
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en_yml from "./en.yml?raw";
import ja_yml from "./ja.yml?raw";
import ko_yml from "./ko.yml?raw";
import zh_hant_yml from "./zh-Hant.yml?raw";
import zh_hans_yml from "./zh-Hans.yml?raw";
const translation_en = yaml.load(en_yml);
const translation_ja = yaml.load(ja_yml);
const translation_ko = yaml.load(ko_yml);
const translation_zh_Hant = yaml.load(zh_hant_yml);
const translation_zh_Hans = yaml.load(zh_hans_yml);
const resources = {
en: { translation: translation_en },
ja: { translation: translation_ja },
ko: { translation: translation_ko },
"zh-Hant": { translation: translation_zh_Hant },
"zh-Hans": { translation: translation_zh_Hans },
};
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
lng: "en",
fallbackLng: "en",
// debug: true,
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;
+379
View File
@@ -0,0 +1,379 @@
# =================================
# IMPORTANT:
# Please read 'readme_first.txt' before making any changes.
# =================================
common:
go_back_button_label: "Go Back"
common_error:
no_device_mic: "No mic device detected."
no_device_speaker: "No speaker device detected."
threshold_invalid_value: "You can set it with a value between {{min}} to {{max}}."
failed_download_weight_ctranslate2: "CTranslate2 weight download error."
failed_download_weight_whisper: "Whisper weight download error."
translation_limit: "Translation engine limit reached or temporarily restricted."
deepl_auth_key_invalid_length: "DeepL auth key length is not correct."
deepl_auth_key_failed_authentication: "Auth key is incorrect or API usage limit reached."
invalid_value_mic_record_timeout: "It cannot be greater than '{{mic_phrase_timeout_label}}' with a value of 0 or more."
invalid_value_mic_phrase_timeout: "It cannot be set lower than '{{mic_record_timeout_label}}' with a value of 0 or more."
invalid_value_mic_max_phrase: "You can set a number equal to or greater than 0."
invalid_value_speaker_record_timeout: "It cannot be greater than '{{speaker_phrase_timeout_label}}' with a value of 0 or more."
invalid_value_speaker_phrase_timeout: "It cannot be set lower than '{{speaker_record_timeout_label}}' with a value of 0 or more."
invalid_value_speaker_max_phrase: "You can set a number equal to or greater than 0."
common_warning:
unable_to_use_osc_query: "The following functions have been automatically disabled due to the OSC IP Address settings preventing OSC data from being received."
main_page:
translation: "Translation"
transcription_send: "Voice2Chatbox"
transcription_receive: "Speaker2Log"
foreground: "Set To Stay On Top"
language_settings: "Language Settings"
your_language: "Your Language"
translate_each_other_label: "Translate Both Languages"
swap_button_label: "Switch Languages"
target_language: "Target Language"
translator: "Translator"
translator_label_default: "Default"
translator_selector:
is_selected_same_language: "You are selecting the same language for '{{your_language}}' and '{{target_language}}' so only '{{ctranslate2}}' is available."
message_log:
all: "All"
sent: "Sent"
received: "Received"
system: "System"
resend_button_on_hover_desc: "Press And Hold To Send"
state_text_enabled: "Enabled"
state_text_disabled: "Disabled"
language_selector:
title_your_language: "Select Your Language"
title_target_language: "Select Target Language"
update_available: "New version is ready!"
updating: "Now updating..."
update_modal:
cpu_desc: "Use CPU only as the compute device."
cuda_desc: "Selectable between CPU and NVIDIA GPUs as compute devices."
cuda_compare_cpu_desc: "GPUs offer faster processing than CPUs."
cuda_disk_space_desc: "Requires approximately {{size}} of disk space."
close_modal: "Close"
download_latest_and_restart: "The latest version will be downloaded,\nand the app will automatically restart."
is_latest_version_already: "Already using the latest version"
is_current_compute_device: "The version currently in use"
config_page:
common:
version: "Version {{version}}"
model_download_button_label: "Download"
correct_auth_key_required: "Correct Auth Key Required"
open_auth_key_webpage: "Open Auth Key Management Webpage"
connection_check:
button_label: "Connection Check"
checking: "Checking..."
connected: "Connected"
disconnected: "Disconnected"
compute_device:
desc: "The accuracy and speed of each processing type may vary depending on your machine specs, and the compatibility with calculation methods may differ from the displayed order. Please use this as a general guideline."
label_device: "Processing Device"
label_type: "Processing Type"
type_template_auto: "Automatic"
type_template_low: "{{type_name}} (Lower accuracy, faster processing)"
type_template_high: "{{type_name}} (Higher accuracy, slower processing)"
warning_labels:
unable_to_use_osc_query: "Due to the OSC IP Address settings, OSC data cannot be received, so this feature is currently unavailable."
side_menu_labels:
device: "Device"
appearance: "Appearance"
translation: "Translation"
transcription: "Transcription"
others: "Other"
hotkeys: "Hotkeys"
plugins: "Plugins"
advanced_settings: "Advanced Settings"
device:
check_volume: "Check Volume"
label_auto_select: "Auto Select"
label_host: "Host/Driver"
label_device: "Device"
mic_host_device:
label: "Mic Device"
mic_dynamic_energy_threshold:
label_for_automatic: "Mic Sensitivity Settings (Current Setting: Automatic)"
desc_for_automatic: "Automatically control mic input sensitivity."
label_for_manual: "Mic Sensitivity Settings (Current Setting: Manual)"
desc_for_manual: "Input sensitivity can be manually adjusted using the slider. Click the mic icon to test your voice input and adjust the level while monitoring the volume."
speaker_device:
label: "Speaker Device"
speaker_dynamic_energy_threshold:
label_for_automatic: "Speaker Input Sensitivity Adjustment (Current Setting: Automatic)"
desc_for_automatic: "Automatically control speaker input sensitivity."
label_for_manual: "Speaker Input Sensitivity Adjustment (Current Setting: Manual)"
desc_for_manual: "Input sensitivity can be manually adjusted using the slider. Click the headphone icon to listen to the audio and adjust the level while checking the volume."
appearance:
transparency:
label: "Transparency"
desc: "Change the main window's transparency."
ui_size:
label: "UI Size"
textbox_ui_size:
label: "Message Logs Font Size"
desc: "You can adjust the log font size by changing the scaling factor relative to the UI size."
send_message_button_type:
label: "Send Message Button"
hide: "Hide (Use Enter key to send)"
show: "Show"
show_and_disable_enter_key: "Show and disable sending using the Enter key."
show_resend_button:
label: "Show Resend Button"
desc: "When hovering over a sent message log, the resend button appears. Click to edit, long press to resend."
font_family:
label: "Font Family"
ui_language:
label: "UI Language"
translation:
ctranslate2_weight_type:
label: "{{ctranslate2}} Model"
desc: "You can choose the translation model when using the {{ctranslate2}} translation engine."
small: "Basic Model ({{capacity}})"
large: "High Accuracy Model ({{capacity}})"
translation_compute_device:
label: "Processing device for AI translation"
deepl_auth_key:
label: "DeepL Auth Key"
desc: "When using it, please change {{translator}} on the main screen to DeepL_API. ※Some languages may not be supported."
open_auth_key_webpage: "Open DeepL Account Webpage"
save: "Save"
edit: "Edit"
auth_key_success: "Auth key update completed."
plamo_auth_key:
label: "Plamo Auth Key"
select_plamo_model:
label: "Select Plamo Model"
gemini_auth_key:
label: "Gemini Auth Key"
select_gemini_model:
label: "Select Gemini Model"
openai_auth_key:
label: "OpenAI Auth Key"
select_openai_model:
label: "Select OpenAI Model"
groq_auth_key:
label: "Groq Auth Key"
select_groq_model:
label: "Select Groq Model"
openrouter_auth_key:
label: "OpenRouter Auth Key"
select_openrouter_model:
label: "Select OpenRouter Model"
lmstudio_connection_check:
label: "Check LM Studio Connection"
select_lmstudio_model:
label: "Select LMStudio Model"
connection_required: "LMStudio Connection Required"
ollama_connection_check:
label: "Check Ollama Connection"
select_ollama_model:
label: "Select Ollama Model"
connection_required: "Ollama Connection Required"
transcription:
section_label_mic: "Mic"
section_label_speaker: "Speaker"
section_label_transcription_engines: "Transcription Engines"
mic_record_timeout:
label: "Mic Record Timeout"
desc: "Detects silence and, when the specified number of seconds passes, the system considers the voice input to have ended. (Second(s))"
mic_phrase_timeout:
label: "Mic Phrase Timeout"
desc: "Transcription processing is performed at intervals of the specified number of seconds."
mic_max_phrase:
label: "Mic Max Words"
desc: "It is the lower limit for the number of transcribed words, and only when this number is exceeded will the transcription results be displayed logs and send to VRChat."
mic_word_filter:
label: "Mic Word Filter"
desc: "If a registered word is detected, the message will not be sent. To add multiple words at once, separate them with ',' (comma).\n*Duplicate words will not be registered."
add_button_label: "Add"
count_desc: "Words Currently Registered: {{count}}"
speaker_record_timeout:
label: "Speaker Record Timeout"
desc: "Detects silence and, when the specified number of seconds has passed, considers the speaker input to have ended. (Second(s))"
speaker_phrase_timeout:
label: "Speaker Phrase Timeout"
desc: "Transcription processing is performed at intervals of the specified number of seconds."
speaker_max_phrase:
label: "Speaker Max Words"
desc: "It is the lower limit for the number of transcribed words, and only when this number is exceeded will the transcription results be displayed logs."
select_transcription_engine:
label: "Transcription Engine Used For Speech Recognition"
whisper_weight_type:
label: "Whisper Model"
desc: "Larger models have higher accuracy, but they also consume more CPU or GPU resources.\nEspecially for models larger than medium, it may be difficult or even impossible to use them depending on the performance of your CPU/GPU."
model_template: "{{model_name}} model ({{capacity}})"
recommended_model_template: "{{model_name}} model ({{capacity}}) (Recommended)"
transcription_compute_device:
label: "Processing Device Used For AI transcription"
vr:
single_line: "Single line"
multi_lines: "Multiple Lines"
overlay_enable: "Enable"
restore_default_settings: "Reset to Default Settings"
position: "Position"
rotation: "Rotation"
x_position: "X-axis (left-right)"
y_position: "Y-axis (up-down)"
z_position: "Z-axis (front-back)"
x_rotation: "X-axis rotation"
y_rotation: "Y-axis rotation"
z_rotation: "Z-axis rotation"
sample_text_button:
start: "Send Sample Texts\nTo Overlay"
stop: "Stop Sending"
sample_text: "Sample Text."
opacity: "Opacity"
ui_scaling: "UI Scaling"
display_duration: "Display Duration"
fadeout_duration: "Fadeout Duration"
common_settings: "Common Settings"
tracker: "Tracker"
hmd: "HMD"
left_hand: "Left Hand"
right_hand: "Right Hand"
overlay_show_only_translated_messages:
label: "Show Only Translated Messages"
voice_typing_mode:
label: "Voice Typing Mode"
desc: "Automatically pastes transcribed text into the active input field.\n*Utilizes standard Windows clipboard functionality."
others:
section_label_sounds: "Sounds"
section_label_message_formats: "Message Formats"
auto_clear_the_message_box:
label: "Auto Clear Message box"
send_only_translated_messages:
label: "Send Only Translated Messages"
auto_export_message_logs:
label: "Auto Save Message Logs"
desc: "Automatically saves the conversation messages as text files."
vrc_mic_mute_sync:
label: "VRC Mic Mute Sync"
desc: "Messages will not be sent to VRCT while VRChat's mic is muted.\n*There may be a slight delay. Push-To-Talk is not supported."
send_message_to_vrc:
label: "Send Message To VRChat"
desc: "This feature is not supported, but there is a way to use it without sending messages to VRChat. Make sure to enable this feature when you wish to send messages to VRChat."
notification_vrc_sfx:
label: "Enable Notification Sound When Sending Chat"
desc: "When this feature is disabled, messages will be sent silently without playing the chatbox notification sound that others can hear."
send_received_message_to_vrc:
label: "Send Received Message To VRChat"
desc: "Send the message you received from the speaker's voice to VRChat's chatbox."
message_format_common:
example_view:
title: "Preview"
original_translated: "Original + Translation"
original_translated_multi: "Original + Translation (Multi-language)"
translated_only_multi: "Translation Only (Multi-language)"
translated_only: "Translation Only"
original_only: "Original Only"
settings:
title: "Settings"
original: "Original"
translated: "Translation"
for_multi_translation: "For Multi-Translation"
send_message_format:
label: "Message Format (Send)"
desc: "This allows you to change the format of the message that others see in VRChat."
received_message_format:
label: "Message Format (Speaker2Chatbox)"
desc: "Currently, it is used in Speaker2Chatbox."
common_convert_message_hiragana_romaji:
desc_1: "Supported only when Japanese is selected as the translation language."
desc_2: "Due to the complexity of Japanese, it has limitations on accuracy."
convert_message_to_romaji:
label: "Show Romaji"
desc: "When enabled along with '{{convert_message_to_hiragana}}', romaji will be shown on mouse hover."
convert_message_to_hiragana:
label: "Show Hiragana"
telemetry:
label: "Support Our Development"
desc: "Sends usage data so our developers can grin and say 'Thanks for using it!' while improving the app.\n* No personal info or conversation content is ever sent."
aptabase_privacy_policy_label: "Aptabase Privacy Policy"
hotkeys:
toggle_vrct_visibility:
label: "Toggle VRCT visibility"
toggle_translation:
label: "Toggle {{translation}}"
toggle_transcription_send:
label: "Toggle {{transcription_send}}"
toggle_transcription_receive:
label: "Toggle {{transcription_receive}}"
plugins:
downloaded_version: "Downloaded version: {{downloaded_version}}"
latest_version: "Latest version: {{latest_version}}"
available_after_updating: "Available after updating to the latest version"
unavailable_downloaded: "Currently Unavailable - Incompatible with the VRCT version in use"
no_latest_info: "Unable to retrieve the latest information"
using_latest_version: "Using the latest version"
available_latest_version: "Latest version available"
unavailable_latest_version: "Latest version currently unavailable"
available_in_latest_vrct_version: "Available in the latest VRCT version"
unavailable_not_downloaded: "Currently unavailable"
advanced_settings:
osc_ip_address:
label: "OSC IP Address"
osc_port:
label: "OSC Port"
open_config_filepath:
label: "Open Config File"
switch_compute_device:
label: "Switch VRCT To CPU/GPU Version"
enable_websocket:
label: "Enable WebSocket Server"
websocket_host:
label: "WebSocket Host"
websocket_port:
label: "WebSocket Port"
notifications:
save_success: "Settings have been saved."
plugin_notifications:
downloading: "Downloading the plugin."
downloaded_success: "Downloaded successfully."
downloaded_error: "Download failed."
updating: "Updating the plugin."
updated_success: "Updated successfully."
updated_error: "Update failed."
disabled_out_of_support: "The plugin has been disabled. It's not supported on this VRCT version."
disabled_due_to_an_error: "An error was detected while running the plugin. Please report this to the plugin developer."
is_enabled: "The plugin enabled."
is_disabled: "The plugin disabled."
+379
View File
@@ -0,0 +1,379 @@
# =================================
# IMPORTANT:
# Please read 'readme_first.txt' before making any changes.
# =================================
common:
go_back_button_label: "戻る"
common_error:
no_device_mic: "マイクデバイスが検出されませんでした。"
no_device_speaker: "スピーカーデバイスが検出されませんでした。"
threshold_invalid_value: "{{min}} から {{max}} までの数値で設定できます。"
failed_download_weight_ctranslate2: "CTranslate2 モデルのダウンロードに失敗しました。"
failed_download_weight_whisper: "Whisper モデルのダウンロードに失敗しました。"
translation_limit: "翻訳エンジンの使用制限に達したか、一時的に利用制限がかけられています。"
deepl_auth_key_invalid_length: "認証キーの文字数が間違っています。"
deepl_auth_key_failed_authentication: "認証キーが間違っているか、API使用制限が上限に達しています。"
invalid_value_mic_record_timeout: "0 以上で 「{{mic_phrase_timeout_label}}」 より大きくすることはできません。"
invalid_value_mic_phrase_timeout: "0 以上で 「{{mic_record_timeout_label}}」 より小さくすることはできません。"
invalid_value_mic_max_phrase: "0 以上の数値を設定できます。"
invalid_value_speaker_record_timeout: "0 以上で 「{{speaker_phrase_timeout_label}}」 より大きくすることはできません。"
invalid_value_speaker_phrase_timeout: "0 以上で 「{{speaker_record_timeout_label}}」 より小さくすることはできません。"
invalid_value_speaker_max_phrase: "0 以上の数値を設定できます。"
common_warning:
unable_to_use_osc_query: "OSC IP Address の設定によりOSCデータの受信ができないため、以下の機能が自動的に無効になっています。"
main_page:
translation: "翻訳"
transcription_send: "マイク入力"
transcription_receive: "聞き取り"
foreground: "最前面固定"
language_settings: "言語設定"
your_language: "あなたの言語"
translate_each_other_label: "双方向に翻訳"
swap_button_label: "言語を入れ替え"
target_language: "相手の言語"
translator: "翻訳エンジン"
translator_label_default: "デフォルト"
translator_selector:
is_selected_same_language: "「{{your_language}}」と「{{target_language}}」に同じ言語が選択がされているため、「{{ctranslate2}}」のみが使用できます。"
message_log:
all: "全て"
sent: "送信"
received: "受信"
system: "システム"
resend_button_on_hover_desc: "長押しで送信"
state_text_enabled: "有効"
state_text_disabled: "無効"
language_selector:
title_your_language: "あなたの言語"
title_target_language: "相手の言語"
update_available: "新しいバージョンが出ました!"
updating: "アップデート中..."
update_modal:
cpu_desc: "処理デバイスとしてCPUのみを使用"
cuda_desc: "処理デバイスとしてCPUとNVIDIA製のGPUを選択可能"
cuda_compare_cpu_desc: "GPU選択時、CPUと比べて処理が高速"
cuda_disk_space_desc: "約{{size}}のディスク容量が必要"
close_modal: "閉じる"
download_latest_and_restart: "最新版がダウンロードされ、\nアプリは自動的に再起動します。"
is_latest_version_already: "すでに最新版を使用中"
is_current_compute_device: "現在使用中のバージョン"
config_page:
common:
version: "バージョン {{version}}"
model_download_button_label: "ダウンロード"
correct_auth_key_required: "正しい認証キーが必要"
open_auth_key_webpage: "認証キー管理ページを開く"
connection_check:
button_label: "接続確認"
checking: "確認中..."
connected: "接続済み"
disconnected: "未接続"
compute_device:
desc: "各処理タイプの精度・速度は、マシンスペックによって計算方法に相性があり、表示順とは異なる事があるため、大まかな目安としてください。"
label_device: "処理デバイス"
label_type: "処理タイプ"
type_template_auto: "自動"
type_template_low: "{{type_name}} (精度が悪く、処理は早い)"
type_template_high: "{{type_name}} (精度が良く、処理は遅い)"
warning_labels:
unable_to_use_osc_query: "OSC IP Address の設定によりOSCデータの受信ができないため、現在この機能は使用できません。"
side_menu_labels:
device: "デバイス"
appearance: "デザイン"
translation: "翻訳"
transcription: "音声認識"
others: "その他"
hotkeys: "ホットキー"
plugins: "プラグイン"
advanced_settings: "高度な設定"
device:
check_volume: "音量チェック"
label_auto_select: "自動選択"
label_host: "ホスト/ドライバー"
label_device: "デバイス"
mic_host_device:
label: "マイク (デバイス)"
mic_dynamic_energy_threshold:
label_for_automatic: "マイク入力感度の調整 (現在の設定: 自動)"
desc_for_automatic: "マイクの入力感度を自動的に調節する。"
label_for_manual: "マイク入力感度の調整 (現在の設定: 手動)"
desc_for_manual: "スライダーを調整して入力感度を手動で決められます。マイクのアイコンを押すと、実際に声を入力し、音量を確認しながら調節できます。"
speaker_device:
label: "スピーカー (デバイス)"
speaker_dynamic_energy_threshold:
label_for_automatic: "スピーカー入力感度の調整 (現在の設定: 自動)"
desc_for_automatic: "スピーカーの入力感度を自動的に調節する。"
label_for_manual: "スピーカー入力感度の調整 (現在の設定: 手動)"
desc_for_manual: "スライダーを調整して入力感度を手動で決められます。ヘッドフォンのアイコンを押すと、実際に音声を聞き取り、音量を確認しながら調節できます。"
appearance:
transparency:
label: "透明度"
desc: "メイン画面の透明度を変更できます。"
ui_size:
label: "UIサイズ"
textbox_ui_size:
label: "ログのフォントサイズ"
desc: "ログに表示されるフォントのサイズを、UIサイズを基準にして倍率を変えられます。"
send_message_button_type:
label: "メッセージ送信ボタン"
hide: "非表示 (エンターキーを使って送信)"
show: "表示"
show_and_disable_enter_key: "表示し、エンターキーでの送信を無効"
show_resend_button:
label: "再送信ボタンを表示する"
desc: "送信済メッセージログにマウスホバーすると、再送信ボタンが表示されます。クリックで編集モード、長押しで再送信します。"
font_family:
label: "使用フォント"
ui_language:
label: "UIの言語"
translation:
ctranslate2_weight_type:
label: "AI翻訳 {{ctranslate2}} のモデルタイプ"
desc: "翻訳エンジン「{{ctranslate2}}」で翻訳する際に、使用する翻訳モデルを選択できます。"
small: "通常モデル ({{capacity}})"
large: "高精度モデル ({{capacity}})"
translation_compute_device:
label: "AI翻訳の処理デバイス"
deepl_auth_key:
label: "DeepL APIキーの登録"
desc: "使用の際は、メイン画面にある {{translator}} をDeepL_APIに変更してください。\n※対応していない言語もあります。"
open_auth_key_webpage: "DeepLアカウントページを開く"
save: "保存"
edit: "編集"
auth_key_success: "認証キーの更新が完了しました。"
plamo_auth_key:
label: "Plamo 認証キー"
select_plamo_model:
label: "Plamo モデルを選択"
gemini_auth_key:
label: "Gemini 認証キー"
select_gemini_model:
label: "Gemini モデルを選択"
openai_auth_key:
label: "OpenAI 認証キー"
select_openai_model:
label: "OpenAI モデルを選択"
groq_auth_key:
label: "Groq 認証キー"
select_groq_model:
label: "Groq モデルを選択"
openrouter_auth_key:
label: "OpenRouter 認証キー"
select_openrouter_model:
label: "OpenRouter モデルを選択"
lmstudio_connection_check:
label: "LM Studio との接続確認"
select_lmstudio_model:
label: "LMStudio モデルを選択"
connection_required: "LMStudio との接続が必要"
ollama_connection_check:
label: "Ollama との接続確認"
select_ollama_model:
label: "Ollama モデルを選択"
connection_required: "Ollama との接続が必要"
transcription:
section_label_mic: "マイク"
section_label_speaker: "スピーカー"
section_label_transcription_engines: "音声認識エンジン"
mic_record_timeout:
label: "入力が終了したとみなす無音時間"
desc: "無音を検出し、設定された秒数経過すると、音声入力が終了したとみなします。"
mic_phrase_timeout:
label: "一度に文字起こしする時間の長さ"
desc: "設定された秒数ごとに文字起こし処理が行われます。"
mic_max_phrase:
label: "送信するまでに保持する単語数"
desc: "文字起こしされた単語数の下限値で、この数値を超えた場合のみ結果をVRChatへ送信し、ログに表示します。"
mic_word_filter:
label: "ワードフィルター"
desc: "登録された単語を検出すると、その文章は送信されません。\n「,」カンマで区切ると、まとめて複数の単語を追加できます。\n※重複した単語は登録されません。"
add_button_label: "追加"
count_desc: "現在登録されている単語数: {{count}}"
speaker_record_timeout:
label: "入力が終了したとみなす無音時間"
desc: "無音を検出し、設定された秒数経過すると、音声入力が終了したとみなします。"
speaker_phrase_timeout:
label: "一度に文字起こしする時間の長さ"
desc: "設定された秒数ごとに文字起こし処理が行われます。"
speaker_max_phrase:
label: "ログとして表示するまでに保持する単語数"
desc: "文字起こしされた単語数の下限値で、この数値を超えた場合のみ結果をログに表示します。"
select_transcription_engine:
label: "音声認識で使用するエンジン"
whisper_weight_type:
label: "Whisperモデルのタイプ"
desc: "容量が大きいモデルほど精度は高いですが、その分CPUやGPUを占有します。\n※特にmediumより容量の大きいモデルは、CPU/GPUの性能によっては使用すらも困難です。"
model_template: "{{model_name}} モデル ({{capacity}})"
recommended_model_template: "{{model_name}} モデル ({{capacity}}) [推奨]"
transcription_compute_device:
label: "AI音声認識で使用する処理デバイス"
vr:
single_line: "一行"
multi_lines: "複数行"
overlay_enable: "有効にする"
restore_default_settings: "初期値に戻す"
position: "位置"
rotation: "回転"
x_position: "X軸(左右)"
y_position: "Y軸(上下)"
z_position: "Z軸(前後)"
x_rotation: "X軸の回転"
y_rotation: "Y軸の回転"
z_rotation: "Z軸の回転"
sample_text_button:
start: "サンプルテキストを\nOverlayに送信する"
stop: "送信を停止"
sample_text: "サンプルテキスト"
opacity: "透明度"
ui_scaling: "サイズ"
display_duration: "表示時間"
fadeout_duration: "フェードアウト時間"
common_settings: "共通設定"
tracker: "表示するトラッカーの位置"
hmd: "HMD"
left_hand: "左手"
right_hand: "右手"
overlay_show_only_translated_messages:
label: "翻訳後のメッセージのみ表示する"
voice_typing_mode:
label: "音声タイピングモード"
desc: "文字起こしされたテキストを、アクティブな入力欄へと自動的に貼り付けます。\n※Windows標準のクリップボード機能を利用しています。"
others:
section_label_sounds: "サウンド"
section_label_message_formats: "メッセージフォーマット"
auto_clear_the_message_box:
label: "送信後はメッセージ入力欄を空にする"
send_only_translated_messages:
label: "翻訳後のメッセージのみ送信する"
auto_export_message_logs:
label: "会話ログを自動的に保存する"
desc: "テキストファイルとしてログがlogsフォルダ内に保存されます。"
vrc_mic_mute_sync:
label: "VRCマイクミュート同期"
desc: "VRChatのマイクがミュートされている間は、メッセージをVRChatに送信しません。\n※若干の遅延はあります。また、Push-To-Talkは非対応です。"
send_message_to_vrc:
label: "VRChatにメッセージを送信する"
desc: "サポート対象外ですが、VRChatにメッセージを送信せずに使う方法があります。送信したい場合、この機能を有効にする事を忘れないでください。"
notification_vrc_sfx:
label: "チャット送信時にチャットボックスの通知音を鳴らす"
desc: "この機能を無効にすると、他の人が聞こえるチャットボックスの通知音を鳴らさず、静かに送信します。"
send_received_message_to_vrc:
label: "受信したメッセージをVRChatに送信する"
desc: "スピーカーから聞き取り、文字起こしされたメッセージをVRChatに送信します。"
message_format_common:
example_view:
title: "プレビュー"
original_translated: "原文 + 翻訳"
original_translated_multi: "原文 + 翻訳(多言語)"
translated_only_multi: "翻訳のみ(多言語)"
translated_only: "翻訳のみ"
original_only: "原文のみ"
settings:
title: "設定"
original: "原文"
translated: "翻訳"
for_multi_translation: "多言語翻訳用"
send_message_format:
label: "メッセージフォーマット(送信)"
desc: "VRChatで相手に実際に見えるフォーマットを変更できます。"
received_message_format:
label: メッセージフォーマット(Speaker2Chatbox)
desc: 今のところ、Speaker2Chatboxで送信した時の表示に使われます。
common_convert_message_hiragana_romaji:
desc_1: "翻訳言語として日本語を選択した時のみサポート。"
desc_2: "日本語は特殊なため、精度には限界があります。"
convert_message_to_romaji:
label: "ローマ字を表示"
desc: "「{{convert_message_to_hiragana}}」と同時に有効にした場合は、マウスホバーで表示されます。"
convert_message_to_hiragana:
label: "ひらがなを表示"
telemetry:
label: "製品の改善に協力する"
desc: "開発者が「みんな使ってくれてるんだな~」ってにやにやしながら機能改善するための使用状況データを送信します。\n※会話内容など個人情報は一切送信しません。"
aptabase_privacy_policy_label: "Aptabase プライバシーポリシー"
hotkeys:
toggle_vrct_visibility:
label: "VRCTの最小化/アクティブ化の切り替え"
toggle_translation:
label: "「{{translation}}」 オン/オフの切り替え"
toggle_transcription_send:
label: "「{{transcription_send}}」 オン/オフの切り替え"
toggle_transcription_receive:
label: "「{{transcription_receive}}」 オン/オフの切り替え"
plugins:
downloaded_version: "ダウンロード済バージョン: {{downloaded_version}}"
latest_version: "最新バージョン: {{latest_version}}"
available_after_updating: "最新版にアップデート後 利用可能"
unavailable_downloaded: "現在利用不可 使用中VRCTバージョンとの互換性なし"
no_latest_info: "最新情報が取得できません"
using_latest_version: "最新版を使用中"
available_latest_version: "最新版を利用可能"
unavailable_latest_version: "最新版は現在利用不可"
available_in_latest_vrct_version: "VRCT最新版で利用可能"
unavailable_not_downloaded: "現在利用不可"
advanced_settings:
osc_ip_address:
label: "OSC IP Address"
osc_port:
label: "OSC Port"
open_config_filepath:
label: "設定ファイルを開く"
switch_compute_device:
label: "VRCT CPU/GPUバージョンの切り替え"
enable_websocket:
label: "WebSocketサーバーを有効にする"
websocket_host:
label: "WebSocket Host"
websocket_port:
label: "WebSocket Port"
notifications:
save_success: "設定を保存しました。"
plugin_notifications:
downloading: "プラグインをダウンロード中。"
downloaded_success: "プラグインのダウンロードが完了しました。"
downloaded_error: "プラグインのダウンロードに失敗しました。"
updating: "プラグインをアップデート中。"
updated_success: "プラグインのアップデートが完了しました。"
updated_error: "プラグインのアップデートに失敗しました。"
disabled_out_of_support: "現在のバージョンとの互換性がありません。プラグインを無効にしました。"
disabled_due_to_an_error: "プラグイン実行中にエラーを検知しました。プラグイン開発者に報告してください。"
is_enabled: "プラグインを有効にしました。"
is_disabled: "プラグインを無効にしました。"
+379
View File
@@ -0,0 +1,379 @@
# =================================
# IMPORTANT:
# Please read 'readme_first.txt' before making any changes.
# =================================
common:
go_back_button_label: "돌아가기"
common_error:
no_device_mic: "마이크 디바이스를 찾지 못했습니다."
no_device_speaker: "스피커 디바이스를 찾지 못했습니다."
threshold_invalid_value: "{{min}}부터 {{max}}까지의 숫자로 설정할 수 있습니다."
failed_download_weight_ctranslate2: "CTranslate2 모델 다운로드에 실패했습니다."
failed_download_weight_whisper: "Whisper 모델 다운로드에 실패했습니다."
translation_limit: "번역 엔진 사용 제한에 도달했거나 일시적으로 이용 제한이 걸렸습니다."
deepl_auth_key_invalid_length: "DeepL 인증 키의 문자 수가 잘못되었습니다."
deepl_auth_key_failed_authentication: "인증키가 잘못되었거나 API 사용 제한이 상한에 도달했습니다."
invalid_value_mic_record_timeout: "0 이상에서 '{{mic_phrase_timeout_label}}'보다 클 수 없습니다."
invalid_value_mic_phrase_timeout: "0 이상에서 '{{mic_record_timeout_label}}'보다 작을 수 없습니다."
invalid_value_mic_max_phrase: "0 이상의 숫자만 설정할 수 있습니다."
invalid_value_speaker_record_timeout: "0 이상에서 '{{speaker_phrase_timeout_label}}'보다 클 수 없습니다."
invalid_value_speaker_phrase_timeout: "0 이상에서 '{{speaker_record_timeout_label}}'보다 작을 수 없습니다."
invalid_value_speaker_max_phrase: "0 이상의 숫자만 설정할 수 있습니다."
common_warning:
unable_to_use_osc_query: "OSC IP 주소 설정으로 인해 OSC 데이터 수신이 불가능하므로, 아래 기능이 자동으로 비활성화되었습니다."
main_page:
translation: "번역"
transcription_send: "음성인식 (마이크)"
transcription_receive: "음성인식 (스피커)"
foreground: "항상 위로"
language_settings: "언어 설정"
your_language: "당신의 언어"
translate_each_other_label: "양방향으로 번역"
swap_button_label: "언어 교체"
target_language: "상대방의 언어"
translator: "번역 엔진"
translator_label_default: "기본값"
translator_selector:
is_selected_same_language: "'{{your_language}}'와 '{{target_language}}'에 동일한 언어가 선택되어 있으므로, 「{{ctranslate2}}」만 사용할 수 있습니다."
message_log:
all: "전체"
sent: "전송"
received: "수신"
system: "시스템"
resend_button_on_hover_desc: "길게 눌러서 보내기"
state_text_enabled: "Enabled"
state_text_disabled: "Disabled"
language_selector:
title_your_language: "당신의 언어"
title_target_language: "상대방의 언어"
update_available: "새로운 버전이 나왔습니다!"
updating: "업데이트 중..."
update_modal:
cpu_desc: "처리 장치로 CPU만을 사용합니다."
cuda_desc: "처리 장치로 CPU와 NVIDIA GPU를 선택할 수 있습니다."
cuda_compare_cpu_desc: "GPU 선택 시, CPU에 비해 처리가 빠릅니다."
cuda_disk_space_desc: "약 {{size}}의 디스크 용량이 필요합니다."
close_modal: "닫기"
download_latest_and_restart: "최신 버전이 다운로드되면 앱이 자동으로 재시작됩니다."
is_latest_version_already: "이미 최신 버전을 사용 중입니다."
is_current_compute_device: "현재 사용 중인 버전"
config_page:
common:
version: "버전 {{version}}"
model_download_button_label: "다운로드"
correct_auth_key_required:
open_auth_key_webpage:
connection_check:
button_label:
checking:
connected:
disconnected:
compute_device:
desc:
label_device:
label_type:
type_template_auto:
type_template_low:
type_template_high:
warning_labels:
unable_to_use_osc_query:
side_menu_labels:
device: "장치"
appearance: "모양"
translation: "번역"
transcription: "음성인식"
others: "기타"
hotkeys: "단축키"
plugins: "플러그인"
advanced_settings: "고급 설정"
device:
check_volume: "음량 확인"
label_auto_select: "자동 선택"
label_host: "호스트/드라이버"
label_device: "장치"
mic_host_device:
label: "마이크 장치"
mic_dynamic_energy_threshold:
label_for_automatic: "음성 입력 최소 볼륨 (현재 설정: 자동)"
desc_for_automatic: "마이크의 입력 감도를 자동으로 조절합니다."
label_for_manual: "음성 입력 최소 볼륨 (현재 설정: 수동)"
desc_for_manual: "슬라이더를 움직여 입력 감도를 수동으로 조절합니다. 마이크 아이콘을 누르면 실제 음성의 볼륨을 확인하며 감도를 조절할 수 있습니다."
speaker_device:
label: "스피커 장치"
speaker_dynamic_energy_threshold:
label_for_automatic: "음성 입력 최소 볼륨 (현재 설정: 자동)"
desc_for_automatic: "스피커의 입력 감도를 자동으로 조절합니다."
label_for_manual: "음성 입력 최소 볼륨 (현재 설정: 수동)"
desc_for_manual: "슬라이더를 움직여 입력 감도를 수동으로 조절합니다. 헤드폰 아이콘을 누르면 실제 음성의 볼륨을 확인하며 감도를 조절할 수 있습니다."
appearance:
transparency:
label: "투명도"
desc: "메인 화면의 투명도를 변경합니다."
ui_size:
label: "UI 크기"
textbox_ui_size:
label: "텍스트 박스 글자 크기"
desc: "로그에 표시되는 글자 크기의 배율을 UI 크기에 따라 변경합니다."
send_message_button_type:
label: "메시지 전송 버튼"
hide: "숨김 (Enter 키를 사용하여 전송)"
show: "표시"
show_and_disable_enter_key: "표시 (Enter 키 전송 비활성화)"
show_resend_button:
label: "재전송 버튼 표시"
desc: "보낸 메시지 로그에 마우스를 올리면 재전송 버튼이 표시됩니다. 클릭하면 편집 모드로 전환되며, 길게 누르면 재전송됩니다."
font_family:
label: "폰트"
ui_language:
label: "UI 언어"
translation:
ctranslate2_weight_type:
label: "번역 모델"
desc: "오프라인 번역 시의 번역 모델을 변경합니다."
small: "일반 모델 ({{capacity}})"
large: "정밀 모델 ({{capacity}})"
translation_compute_device:
label: "AI 번역 처리 장치"
deepl_auth_key:
label: "DeepL 인증키"
desc: "사용시 메인화면에 있는 {{translator}}를 DeepL_API로 변경해 주세요.\n지원하지 않는 언어도 있습니다."
open_auth_key_webpage: "DeepL 계정 페이지 열기"
save: "저장"
edit: "편집"
auth_key_success: "인증키 갱신이 완료되었습니다."
plamo_auth_key:
label:
select_plamo_model:
label:
gemini_auth_key:
label:
select_gemini_model:
label:
openai_auth_key:
label:
select_openai_model:
label:
groq_auth_key:
label:
select_groq_model:
label:
openrouter_auth_key:
label:
select_openrouter_model:
label:
lmstudio_connection_check:
label:
select_lmstudio_model:
label:
connection_required:
ollama_connection_check:
label:
select_ollama_model:
label:
connection_required:
transcription:
section_label_mic: "마이크"
section_label_speaker: "스피커"
section_label_transcription_engines: "음성 인식 엔진"
mic_record_timeout:
label: "최대 무음 시간"
desc: "무음을 감지하고 설정된 시간(초)만큼의 시간이 지나면 음성 입력이 종료된 것으로 판단합니다."
mic_phrase_timeout:
label: "최대 인식 시간"
desc: "설정된 초 단위로 음성인식 처리가 이루어집니다."
mic_max_phrase:
label: "최대 입력 절(phrases) 수"
desc: "인식된 단어 수의 하한값으로, 이 수치를 초과하는 경우에만 결과를 VRChat으로 전송하고 로그에 표시합니다."
mic_word_filter:
label: "단어 필터"
desc: "등록된 단어가 감지되면 해당 문장은 전송되지 않습니다.\n',' 쉼표로 구분하면 여러 단어를 추가할 수 있습니다.\n* 중복된 단어는 등록되지 않습니다."
add_button_label: "추가"
count_desc: "현재 등록되어 있는 단어 수: {{count}}"
speaker_record_timeout:
label: "최대 무음 시간"
desc: "무음을 감지하고 설정된 시간(초)만큼의 시간이 지나면 음성 입력이 종료된 것으로 판단합니다."
speaker_phrase_timeout:
label: "최대 인식 시간"
desc: "설정된 초 단위로 음성인식 처리가 이루어집니다."
speaker_max_phrase:
label: "최대 입력 절(phrases) 수"
desc: "식된 단어 수의 하한값으로, 이 수치를 초과하는 경우에만 결과를 로그에 표시합니다."
select_transcription_engine:
label: "음성 인식에 사용할 엔진"
whisper_weight_type:
label: "Whisper 모델 타입"
desc: "용량이 큰 모델일수록 정확도는 높지만, 그만큼 CPU나 GPU를 많이 차지합니다. * 특히 medium보다 용량이 큰 모델은 CPU/GPU 성능에 따라 사용 자체가 어려울 수 있습니다."
model_template: "{{model_name}} 모델 ({{capacity}})"
recommended_model_template: "{{model_name}} 모델 ({{capacity}}) (권장)"
transcription_compute_device:
label:
vr:
single_line: "한 줄"
multi_lines: "여러 줄"
overlay_enable: "활성화"
restore_default_settings: "초기값으로 되돌리기"
position: "위치"
rotation: "회전"
x_position: "X축 (좌우)"
y_position: "Y축 (상하)"
z_position: "Z축 (앞뒤)"
x_rotation: "X축 회전"
y_rotation: "Y축 회전"
z_rotation: "Z축 회전"
sample_text_button:
start: "샘플 텍스트를\n오버레이에 전송"
stop: "전송 중지"
sample_text: "샘플 텍스트"
opacity: "투명도"
ui_scaling: "UI 크기 조정"
display_duration: "표시 시간"
fadeout_duration: "페이드 아웃 시간"
common_settings: "공통 설정"
tracker: "표시할 트래커의 위치"
hmd: "HMD"
left_hand: "왼손"
right_hand: "오른손"
overlay_show_only_translated_messages:
label: "번역된 메시지만 표시"
voice_typing_mode:
label:
desc:
others:
section_label_sounds: "사운드"
section_label_message_formats: "메시지 형식"
auto_clear_the_message_box:
label: "챗박스 자동 삭제"
send_only_translated_messages:
label: "번역된 메시지만 전송"
auto_export_message_logs:
label: "대화 로그 자동 저장"
desc: "logs 폴더에 텍스트 파일로 로그가 저장됩니다."
vrc_mic_mute_sync:
label: "VRC 마이크 음소거 동기화"
desc: "VRChat의 마이크가 음소거 상태인 동안에는 메시지를 VRChat에 전송하지 않습니다. * 약간의 지연이 발생할 수 있습니다. 또한 눌러서 말하기(Push-To-Talk) 기능은 지원되지 않습니다."
send_message_to_vrc:
label: "VRChat에 메시지 전송"
desc: "VRChat에 메시지를 보내지 않고 사용할 수 있는 방법이 있지만 지원되지 않습니다. VRChat에 메시지를 보내려면 이 기능을 활성화하세요."
notification_vrc_sfx:
label: "채팅 전송 시 채팅창 알림음 재생"
desc: "이 기능을 비활성화하면 다른 사람이 들을 수 있는 채팅창 알림음을 울리지 않고 조용히 전송합니다."
send_received_message_to_vrc:
label: "수신한 메시지를 VRChat에 전송"
desc: "스피커에서 인식된 내용을 텍스트로 변환한 메시지가 VRChat에 전송됩니다."
message_format_common:
example_view:
title: "미리 보기"
original_translated: "원문 + 번역문"
original_translated_multi: "원문 + 번역문 (다국어)"
translated_only_multi: "번역문만 (다국어)"
translated_only: "번역문만"
original_only: "원문만"
settings:
title: "설정"
original: "원문"
translated: "번역문"
for_multi_translation: "다국어 번역용"
send_message_format:
label: "메시지 형식 (송신)"
desc: "VRChat에서 상대방에게 실제로 보이는 형식을 변경할 수 있습니다."
received_message_format:
label: "메시지 형식 (Speaker2Chatbox)"
desc: "현재로서는 Speaker2Chatbox로 전송할 때의 표시용으로 사용됩니다."
common_convert_message_hiragana_romaji:
desc_1:
desc_2:
convert_message_to_romaji:
label:
desc:
convert_message_to_hiragana:
label:
telemetry:
label:
desc:
aptabase_privacy_policy_label:
hotkeys:
toggle_vrct_visibility:
label: "VRCT 최소화/활성화 전환"
toggle_translation:
label: "'{{translation}}' 켜기/끄기 전환"
toggle_transcription_send:
label: "'{{transcription_send}}' 켜기/끄기 전환"
toggle_transcription_receive:
label: "'{{transcription_receive}}' 켜기/끄기 전환"
plugins:
downloaded_version: "다운로드된 버전: {{downloaded_version}}"
latest_version: "최신 버전: {{latest_version}}"
available_after_updating: "최신 버전으로 업데이트 후 이용 가능"
unavailable_downloaded: "현재 사용 중인 VRCT 버전과의 호환성 문제로 인해 이용 불가"
no_latest_info: "최신 정보를 가져올 수 없습니다"
using_latest_version: "최신 버전을 사용 중"
available_latest_version: "최신 버전을 이용 가능"
unavailable_latest_version: "최신 버전은 현재 이용 불가"
available_in_latest_vrct_version: "VRCT 최신 버전에서 이용 가능"
unavailable_not_downloaded: "현재 이용 불가"
advanced_settings:
osc_ip_address:
label: "OSC IP 주소"
osc_port:
label: "OSC 포트"
open_config_filepath:
label: "설정 파일 열기"
switch_compute_device:
label: "VRCT CPU/GPU 버전 전환"
enable_websocket:
label: "WebSocket 서버 활성화"
websocket_host:
label: "WebSocket 호스트"
websocket_port:
label: "WebSocket 포트"
notifications:
save_success: "설정을 저장했습니다."
plugin_notifications:
downloading: "플러그인을 다운로드 중입니다."
downloaded_success: "플러그인 다운로드가 완료되었습니다."
downloaded_error: "플러그인 다운로드에 실패했습니다."
updating: "플러그인을 업데이트 중입니다."
updated_success: "플러그인 업데이트가 완료되었습니다."
updated_error: "플러그인 업데이트에 실패했습니다."
disabled_out_of_support: "현재 버전과 호환되지 않습니다. 플러그인을 비활성화했습니다."
disabled_due_to_an_error: "플러그인 실행 중 오류를 감지했습니다. 플러그인 개발자에게 보고해 주세요."
is_enabled: "플러그인을 활성화했습니다."
is_disabled: "플러그인을 비활성화했습니다."
+13
View File
@@ -0,0 +1,13 @@
Thank you for considering contributing to VRCT's UI translations.
If you want to edit a language:
- If it already exists: edit the corresponding [xx].yml file.
- If it doesn’t exist: please open a GitHub issue or contact us through another channel. (If you know how to add a new language yourself, feel free to do so! Sorry for the complicated structure...)
Languages currently supported:
- en: English
- ja: 日本語
- ko: 한국어
- zh-Hant: 繁體中文
- zh-Hans: 简体中文
Last updated: 2025/12
+11
View File
@@ -0,0 +1,11 @@
// To avoid a name conflict with our own `useTranslation` function,
// rename the one from `react-i18next` to `useI18n`.
// This is aliased via `vite.config.js`, so it can be imported using `@useI18n`.
// Example:
// import { useI18n } from "@useI18n";
//
// export const useTranslation = () => {
// const { t } = useI18n();
// ...
// };
export { useTranslation as useI18n } from "react-i18next";
+379
View File
@@ -0,0 +1,379 @@
# =================================
# IMPORTANT:
# Please read 'readme_first.txt' before making any changes.
# =================================
common:
go_back_button_label: "返回"
common_error:
no_device_mic: "未检测到麦克风设备。"
no_device_speaker: "未检测到扬声器设备。"
threshold_invalid_value: "可设置的数值范围为 {{min}} 到 {{max}}。"
failed_download_weight_ctranslate2: "CTranslate2 模型下载失败。"
failed_download_weight_whisper: "Whisper 模型下载失败。"
translation_limit: "已达到翻译引擎使用限制或临时受到使用限制。"
deepl_auth_key_invalid_length: "授权密钥字符数错误。"
deepl_auth_key_failed_authentication: "授权密钥错误或已达API使用上限。"
invalid_value_mic_record_timeout: "数值应为 0 至 「{{mic_phrase_timeout_label}}」"
invalid_value_mic_phrase_timeout: "转录间隔时间大于0秒且不能小于「{{mic_record_timeout_label}}」"
invalid_value_mic_max_phrase: "数值应为 0 以上"
invalid_value_speaker_record_timeout: "数值应为 0 至 「{{speaker_phrase_timeout_label}}」"
invalid_value_speaker_phrase_timeout: "转录间隔时间大于0秒且不能小于「{{speaker_record_timeout_label}}」"
invalid_value_speaker_max_phrase: "数值应为 0 以上"
common_warning:
unable_to_use_osc_query: "由于 OSC IP Address 的设置无法接收 OSC 数据,以下功能已自动禁用。"
main_page:
translation: "翻译"
transcription_send: "你的语音转文字"
transcription_receive: "他人语音转文字"
foreground: "顶层显示"
language_settings: "语言设定"
your_language: "你的语言"
translate_each_other_label: "双向翻译"
swap_button_label: "互换"
target_language: "目标语言"
translator: "翻译器"
translator_label_default: "默认"
translator_selector:
is_selected_same_language: "「{{your_language}}」和「{{target_language}}」选择了相同的语言,因此只能使用「{{ctranslate2}}」。"
message_log:
all: "全部"
sent: "发送"
received: "接受"
system: "系统"
resend_button_on_hover_desc: "长按发送"
state_text_enabled: "启用"
state_text_disabled: "停用"
language_selector:
title_your_language: "你的语言"
title_target_language: "目标语言"
update_available: "有新版本可供使用!"
updating: "更新中..."
update_modal:
cpu_desc: "仅使用 CPU 作为处理设备"
cuda_desc: "可选择 CPU 和 NVIDIA GPU 作为处理设备"
cuda_compare_cpu_desc: "选择 GPU 时,与 CPU 相比处理更快"
cuda_disk_space_desc: "需要约 {{size}} 的磁盘空间"
close_modal: "关闭"
download_latest_and_restart: "将下载最新版本,\n应用程序将自动重启。"
is_latest_version_already: "已在使用最新版本"
is_current_compute_device: "当前使用的版本"
config_page:
common:
version: "版本 {{version}}"
model_download_button_label: "下载"
correct_auth_key_required:
open_auth_key_webpage:
connection_check:
button_label:
checking:
connected:
disconnected:
compute_device:
desc: "各处理类型的精度和速度会因机器规格不同而有所差异,可能与显示顺序不同,请作为大致参考。"
label_device: "处理设备"
label_type: "处理类型"
type_template_auto: "自动"
type_template_low: "{{type_name}} (精度较低,处理较快)"
type_template_high: "{{type_name}} (精度较高,处理较慢)"
warning_labels:
unable_to_use_osc_query: "由于 OSC IP Address 的设置无法接收 OSC 数据,目前无法使用此功能。"
side_menu_labels:
device: "设备"
appearance: "外观"
translation: "翻译"
transcription: "语音识别"
others: "其他"
hotkeys: "快捷键"
plugins: "插件"
advanced_settings: "高级设置"
device:
check_volume: "音量检查"
label_auto_select: "自动选择"
label_host: "主机/驱动程序"
label_device: "设备"
mic_host_device:
label: "麦克风 (设备)"
mic_dynamic_energy_threshold:
label_for_automatic: "麦克风输入阈值(当前设置:自动)"
desc_for_automatic: "自动调整麦克风输入阈值"
label_for_manual: "麦克风输入阈值(当前设置:手动)"
desc_for_manual: "使用滑杆手动确定麦克风输入灵敏度。按下麦克风图标输入语音,并在监控音量的同时调节灵敏度。"
speaker_device:
label: "他人语音 (设备)"
speaker_dynamic_energy_threshold:
label_for_automatic: "他人语音接收阈值(当前设置:自动)"
desc_for_automatic: "自动调节他人语音接收阈值"
label_for_manual: "他人语音接收阈值(当前设置:手动)"
desc_for_manual: "使用滑杆手动调整他人语音接收阈值.在按下耳机按钮时,请根据实际听到的声音调整该大小"
appearance:
transparency:
label: "透明度"
desc: "更改主视窗透明度"
ui_size:
label: "界面大小"
textbox_ui_size:
label: "文本框字体大小"
desc: "你可以根据用户界面大小调整文本框中使用的字体大小。"
send_message_button_type:
label: "发送信息按钮"
hide: "隐藏 (可使用回车发送信息)"
show: "显示"
show_and_disable_enter_key: "显示,并且停用‘回车发送信息’"
show_resend_button:
label: "显示重新发送按钮"
desc: "鼠标悬停在已发送消息日志上时,会显示重新发送按钮。点击进入编辑模式,长按重新发送。"
font_family:
label: "字体"
ui_language:
label: "界面语言"
translation:
ctranslate2_weight_type:
label: "选择离线翻译模型"
desc: "可以选择用于离线翻译的翻译模型"
small: "普通模型 ({{capacity}})"
large: "高精度模型 ({{capacity}})"
translation_compute_device:
label: "AI 翻译的处理设备"
deepl_auth_key:
label: "DeepL 授权密匙"
desc: "在使用的时候,使用时请在主屏幕上通过 DeepL_API 选择 {{translator}}\n※某些语言可能不支持"
open_auth_key_webpage: "打开DeepL账号页面"
save: "保存"
edit: "编辑"
auth_key_success: "授权密匙认证完成。"
plamo_auth_key:
label:
select_plamo_model:
label:
gemini_auth_key:
label:
select_gemini_model:
label:
openai_auth_key:
label:
select_openai_model:
label:
groq_auth_key:
label:
select_groq_model:
label:
openrouter_auth_key:
label:
select_openrouter_model:
label:
lmstudio_connection_check:
label:
select_lmstudio_model:
label:
connection_required:
ollama_connection_check:
label:
select_ollama_model:
label:
connection_required:
transcription:
section_label_mic: "麦克风"
section_label_speaker: "扬声器"
section_label_transcription_engines: "语音识别引擎"
mic_record_timeout:
label: "语音输入结束后的静音时间"
desc: "当检测到静音并经过设定的秒数后,语音输入即被视为完成。"
mic_phrase_timeout:
label: "转录间隔"
desc: "在经过设定的时间后执行转录"
mic_max_phrase:
label: "麦克风发送时的最小单词数"
desc: "转录字数的下限,只有超过这个数字,才会记录翻译结果并发送到VRC"
mic_word_filter:
label: "单词过滤器"
desc: "检测出被记录的单词时,不会发送这段话\n如要添加多个单词,可以用逗号来分割\n※不会记录重复的单词"
add_button_label: "添加"
count_desc: "现在被记录的单词数: {{count}}"
speaker_record_timeout:
label: "语音接收结束后的静音时间"
desc: "当检测到静音并经过设定的秒数后,语音接收即被视为完成。"
speaker_phrase_timeout:
label: "转录间隔"
desc: "在经过设定的时间后执行转录"
speaker_max_phrase:
label: "语音接收时的最小单词数"
desc: "转录字数的下限,只有超过这个数字,才会记录转录结果"
select_transcription_engine:
label: "语音识别使用的引擎"
whisper_weight_type:
label: "Whisper 模型类型"
desc: "容量越大的模型精度越高,但会占用更多 CPU/GPU 资源。\n※特别是比 medium 更大的模型,根据 CPU/GPU 性能可能难以使用。"
model_template: "{{model_name}} 模型 ({{capacity}})"
recommended_model_template: "{{model_name}} 模型 ({{capacity}}) (推荐)"
transcription_compute_device:
label: "AI 语音识别使用的处理设备"
vr:
single_line: "单行"
multi_lines: "多行"
overlay_enable: "启用"
restore_default_settings: "恢复默认设置"
position: "位置"
rotation: "旋转"
x_position: "X轴(左右)"
y_position: "Y轴(上下)"
z_position: "Z轴(前后)"
x_rotation: "X轴旋转"
y_rotation: "Y轴旋转"
z_rotation: "Z轴旋转"
sample_text_button:
start: "向 Overlay\n发送示例文本"
stop: "停止发送"
sample_text: "示例文本"
opacity: "透明度"
ui_scaling: "大小"
display_duration: "显示持续时间"
fadeout_duration: "渐隐持续时间"
common_settings: "通用设置"
tracker: "显示追踪器的位置"
hmd: "HMD"
left_hand: "左手"
right_hand: "右手"
overlay_show_only_translated_messages:
label: "仅显示翻译后的消息"
voice_typing_mode:
label:
desc:
others:
section_label_sounds: "声音"
section_label_message_formats: "消息格式"
auto_clear_the_message_box:
label: "发言后自动清空chatbox"
send_only_translated_messages:
label: "只发送翻译后的信息"
auto_export_message_logs:
label: "自动导出聊天记录"
desc: "以文本文件的形式在logs文件夹中保存。"
vrc_mic_mute_sync:
label: "与VRC中的麦克风静音同步"
desc: "当VRChat的麦克风处于静音时,不在VRChat中发送信息\n※存在少许延迟且不支持按键发言."
send_message_to_vrc:
label: "发送信息至VRChat"
desc: "不发送信息至VRChat的情况下也能使用它,但该功能现在并未完成.在想要发送信息时,请不要忘记打开这个功能."
notification_vrc_sfx:
label: "发送聊天时播放聊天框的通知音"
desc: "禁用此功能后,将不会播放其他人能听到的聊天框通知音,静默发送。"
send_received_message_to_vrc:
label: "将接收到的消息发送到 VRChat"
desc: "将从扬声器听到并转录的消息发送到 VRChat。"
message_format_common:
example_view:
title: "预览"
original_translated: "原文 + 翻译"
original_translated_multi: "原文 + 翻译(多语言)"
translated_only_multi: "仅翻译(多语言)"
translated_only: "仅翻译"
original_only: "仅原文"
settings:
title: "设置"
original: "原文"
translated: "翻译"
for_multi_translation: "多语言翻译用"
send_message_format:
label: "消息格式(发送)"
desc: "可以更改在 VRChat 中对方实际看到的格式。"
received_message_format:
label: "消息格式(Speaker2Chatbox)"
desc: "目前用于通过 Speaker2Chatbox 发送时的显示。"
common_convert_message_hiragana_romaji:
desc_1: "仅在选择日语作为翻译语言时支持。"
desc_2: "由于日语的特殊性,精度有限。"
convert_message_to_romaji:
label: "显示罗马音"
desc: "与「{{convert_message_to_hiragana}}」同时启用时,将通过鼠标悬停显示。"
convert_message_to_hiragana:
label: "显示平假名"
telemetry:
label:
desc:
aptabase_privacy_policy_label:
hotkeys:
toggle_vrct_visibility:
label: "切换 VRCT 最小化/激活"
toggle_translation:
label: "切换「{{translation}}」开/关"
toggle_transcription_send:
label: "切换「{{transcription_send}}」开/关"
toggle_transcription_receive:
label: "切换「{{transcription_receive}}」开/关"
plugins:
downloaded_version: "已下载版本:{{downloaded_version}}"
latest_version: "最新版本:{{latest_version}}"
available_after_updating: "更新到最新版后可用"
unavailable_downloaded: "当前不可用 与使用中的 VRCT 版本不兼容"
no_latest_info: "无法获取最新信息"
using_latest_version: "正在使用最新版本"
available_latest_version: "最新版本可用"
unavailable_latest_version: "最新版本当前不可用"
available_in_latest_vrct_version: "可在 VRCT 最新版中使用"
unavailable_not_downloaded: "当前不可用"
advanced_settings:
osc_ip_address:
label: "OSC IP 地址"
osc_port:
label: "OSC 端口"
open_config_filepath:
label: "打开设置文件"
switch_compute_device:
label: "切换 VRCT CPU/GPU 版本"
enable_websocket:
label: "启用 WebSocket 服务器"
websocket_host:
label: "WebSocket 主机"
websocket_port:
label: "WebSocket 端口"
notifications:
save_success: "设置已保存。"
plugin_notifications:
downloading: "正在下载插件。"
downloaded_success: "插件下载完成。"
downloaded_error: "插件下载失败。"
updating: "正在更新插件。"
updated_success: "插件更新完成。"
updated_error: "插件更新失败。"
disabled_out_of_support: "与当前版本不兼容。已禁用插件。"
disabled_due_to_an_error: "插件运行时检测到错误。请向插件开发者报告。"
is_enabled: "插件已启用。"
is_disabled: "插件已禁用。"
+379
View File
@@ -0,0 +1,379 @@
# =================================
# IMPORTANT:
# Please read 'readme_first.txt' before making any changes.
# =================================
common:
go_back_button_label: "返回"
common_error:
no_device_mic: "未偵測到麥克風裝置。"
no_device_speaker: "未偵測到喇叭裝置。"
threshold_invalid_value: "可以設置 {{min}} 到 {{max}} 之間的值。"
failed_download_weight_ctranslate2: "CTranslate2 模型下載失敗。"
failed_download_weight_whisper: "Whisper 模型下載失敗。"
translation_limit: "已達到翻譯引擎使用限制或臨時受到使用限制。"
deepl_auth_key_invalid_length: "授權金鑰字元數錯誤。"
deepl_auth_key_failed_authentication: "授權金鑰錯誤或已達 API 使用上限。"
invalid_value_mic_record_timeout: "不能大於「{{mic_phrase_timeout_label}}」,應為 0 或更高。"
invalid_value_mic_phrase_timeout: "不能小於「{{mic_record_timeout_label}}」,應為 0 或更高。"
invalid_value_mic_max_phrase: "可以設置 0 或更高的數值。"
invalid_value_speaker_record_timeout: "不能大於「{{speaker_phrase_timeout_label}}」,應為 0 或更高。"
invalid_value_speaker_phrase_timeout: "不能小於「{{speaker_record_timeout_label}}」,應為 0 或更高。"
invalid_value_speaker_max_phrase: "可以設置 0 或更高的數值。"
common_warning:
unable_to_use_osc_query: "由於 OSC IP Address 的設定無法接收 OSC 資料,以下功能已自動停用。"
main_page:
translation: "翻譯"
transcription_send: "麥克風轉文字"
transcription_receive: "喇叭轉文字"
foreground: "最上層顯示"
language_settings: "語言設定"
your_language: "你的語言"
translate_each_other_label: "互相翻譯"
swap_button_label: "交換語言"
target_language: "目標語言"
translator: "翻譯器"
translator_label_default: "預設"
translator_selector:
is_selected_same_language: "「{{your_language}}」和「{{target_language}}」選擇了相同的語言,因此只能使用「{{ctranslate2}}」。"
message_log:
all: "全部"
sent: "已發送"
received: "已接收"
system: "系統"
resend_button_on_hover_desc: "長按發送"
state_text_enabled: "啟用"
state_text_disabled: "停用"
language_selector:
title_your_language: "選擇你的語言"
title_target_language: "選擇目標語言"
update_available: "有新版本可供使用!"
updating: "正在更新..."
update_modal:
cpu_desc: "僅使用 CPU 作為處理裝置"
cuda_desc: "可選擇 CPU 和 NVIDIA GPU 作為處理裝置"
cuda_compare_cpu_desc: "選擇 GPU 時,與 CPU 相比處理更快"
cuda_disk_space_desc: "需要約 {{size}} 的磁碟空間"
close_modal: "關閉"
download_latest_and_restart: "將下載最新版本,\n應用程式將自動重新啟動。"
is_latest_version_already: "已在使用最新版本"
is_current_compute_device: "目前使用的版本"
config_page:
common:
version: "版本 {{version}}"
model_download_button_label: "下載"
correct_auth_key_required:
open_auth_key_webpage:
connection_check:
button_label:
checking:
connected:
disconnected:
compute_device:
desc: "各處理類型的精度和速度會因機器規格不同而有所差異,可能與顯示順序不同,請作為大致參考。"
label_device: "處理裝置"
label_type: "處理類型"
type_template_auto: "自動"
type_template_low: "{{type_name}}(精度較低,處理較快)"
type_template_high: "{{type_name}}(精度較高,處理較慢)"
warning_labels:
unable_to_use_osc_query: "由於 OSC IP Address 的設定無法接收 OSC 資料,目前無法使用此功能。"
side_menu_labels:
device: "裝置"
appearance: "外觀"
translation: "翻譯"
transcription: "語音辨識"
others: "其他"
hotkeys: "快捷鍵"
plugins: "外掛程式"
advanced_settings: "進階設定"
device:
check_volume: "音量檢查"
label_auto_select: "自動選擇"
label_host: "主機/驅動程式"
label_device: "裝置"
mic_host_device:
label: "麥克風裝置"
mic_dynamic_energy_threshold:
label_for_automatic: "麥克風能量閾值(當前設置:自動)"
desc_for_automatic: "自動判定麥克風輸入靈敏度。"
label_for_manual: "麥克風能量閾值(當前設置:手動)"
desc_for_manual: "使用滑桿調整麥克風輸入靈敏度,你可以按下麥克風圖示來測試。"
speaker_device:
label: "喇叭裝置"
speaker_dynamic_energy_threshold:
label_for_automatic: "喇叭能量閾值(當前設置:自動)"
desc_for_automatic: "自動確定喇叭輸入靈敏度。"
label_for_manual: "喇叭能量閾值(當前設置:手動)"
desc_for_manual: "使用滑桿調整喇叭輸入靈敏度,你可以按下喇叭圖示來測試。"
appearance:
transparency:
label: "透明度"
desc: "變更主視窗的透明度。"
ui_size:
label: "介面大小"
textbox_ui_size:
label: "訊息框字體大小"
desc: "你可以根據介面大小調整記錄中使用的字體大小。"
send_message_button_type:
label: "發送訊息按鈕"
hide: "隱藏(使用 Enter 鍵發送)"
show: "顯示"
show_and_disable_enter_key: "顯示並停用 Enter 鍵發送"
show_resend_button:
label: "顯示重新發送按鈕"
desc: "滑鼠懸停在已發送訊息記錄上時,會顯示重新發送按鈕。點擊進入編輯模式,長按重新發送。"
font_family:
label: "字型"
ui_language:
label: "介面語言"
translation:
ctranslate2_weight_type:
label: "選擇離線翻譯模型"
desc: "你可以選擇用於離線翻譯引擎的翻譯模型。"
small: "基本模型({{capacity}})"
large: "高準確率模型({{capacity}})"
translation_compute_device:
label: "AI 翻譯的處理裝置"
deepl_auth_key:
label: "DeepL 授權金鑰"
desc: "使用 DeepL API 時請在主螢幕選擇 {{translator}}。※可能不支援某些語言。"
open_auth_key_webpage: "打開 DeepL 帳號頁面"
save: "儲存"
edit: "編輯"
auth_key_success: "授權金鑰更新完成。"
plamo_auth_key:
label:
select_plamo_model:
label:
gemini_auth_key:
label:
select_gemini_model:
label:
openai_auth_key:
label:
select_openai_model:
label:
groq_auth_key:
label:
select_groq_model:
label:
openrouter_auth_key:
label:
select_openrouter_model:
label:
lmstudio_connection_check:
label:
select_lmstudio_model:
label:
connection_required:
ollama_connection_check:
label:
select_ollama_model:
label:
connection_required:
transcription:
section_label_mic: "麥克風"
section_label_speaker: "喇叭"
section_label_transcription_engines: "語音辨識引擎"
mic_record_timeout:
label: "麥克風音訊 - 判定結束時間"
desc: "麥克風未收到音訊後,結束一段話的判定時間(秒)。"
mic_phrase_timeout:
label: "麥克風音訊 - 紀錄間隔時間"
desc: "每隔多久要紀錄一次音訊。"
mic_max_phrase:
label: "麥克風音訊 - 最大單詞數量"
desc: "只有在單詞超過此數量時,才會記錄結果並發送到 VRChat。"
mic_word_filter:
label: "麥克風單詞過濾器"
desc: "如果偵測到清單內的單詞,則不會發送訊息。要一次新增多個詞語,請用「,」(半形逗號)分隔。\n*重複詞語會被忽略。"
add_button_label: "新增"
count_desc: "當前註冊詞語數量:{{count}}"
speaker_record_timeout:
label: "喇叭音訊 - 判定結束時間"
desc: "偵測到靜音並在指定秒數後認為喇叭輸入已結束。(秒)"
speaker_phrase_timeout:
label: "喇叭音訊 - 紀錄間隔時間"
desc: "以指定秒數間隔進行轉錄處理。"
speaker_max_phrase:
label: "喇叭音訊 - 最大單詞數量"
desc: "只有在單詞超過此數量時,才會記錄結果並發送到 VRChat。"
select_transcription_engine:
label: "語音辨識使用的引擎"
whisper_weight_type:
label: "Whisper 模型類型"
desc: "容量越大的模型精度越高,但會占用更多 CPU/GPU 資源。\n※特別是比 medium 更大的模型,根據 CPU/GPU 效能可能難以使用。"
model_template: "{{model_name}}模型({{capacity}})"
recommended_model_template: "{{model_name}}模型({{capacity}})(推薦)"
transcription_compute_device:
label: "AI 語音辨識使用的處理裝置"
vr:
single_line: "單行"
multi_lines: "多行"
overlay_enable: "啟用"
restore_default_settings: "恢復預設設定"
position: "位置"
rotation: "旋轉"
x_position: "X軸(左右)"
y_position: "Y軸(上下)"
z_position: "Z軸(前後)"
x_rotation: "X軸旋轉"
y_rotation: "Y軸旋轉"
z_rotation: "Z軸旋轉"
sample_text_button:
start: "向 Overlay\n發送範例文字"
stop: "停止發送"
sample_text: "範例文字"
opacity: "透明度"
ui_scaling: "介面縮放"
display_duration: "顯示持續時間"
fadeout_duration: "淡出持續時間"
common_settings: "通用設定"
tracker: "顯示追蹤器的位置"
hmd: "HMD"
left_hand: "左手"
right_hand: "右手"
overlay_show_only_translated_messages:
label: "僅顯示翻譯後的訊息"
voice_typing_mode:
label:
desc:
others:
section_label_sounds: "音效"
section_label_message_formats: "訊息格式"
auto_clear_the_message_box:
label: "自動清除 Chatbox"
send_only_translated_messages:
label: "僅發送翻譯訊息"
auto_export_message_logs:
label: "自動匯出訊息記錄"
desc: "自動將對話訊息匯出為文字文件。"
vrc_mic_mute_sync:
label: "VRC 麥克風靜音同步"
desc: "當 VRChat 的麥克風靜音時,VRCT 將不會向 VRChat 發送訊息。\n*存在一些延遲且不支援按鍵發話 (PTT)。"
send_message_to_vrc:
label: "發送訊息到 VRChat"
desc: "當你打算向 VRChat 發送訊息時啟用此功能。"
notification_vrc_sfx:
label: "發送聊天時播放聊天框的通知音"
desc: "停用此功能後,將不會播放其他人能聽到的聊天框通知音,靜默發送。"
send_received_message_to_vrc:
label: "將接收到的訊息發送到 VRChat"
desc: "將從喇叭聽到並轉錄的訊息發送到 VRChat。"
message_format_common:
example_view:
title: "預覽"
original_translated: "原文 + 翻譯"
original_translated_multi: "原文 + 翻譯(多語言)"
translated_only_multi: "僅翻譯(多語言)"
translated_only: "僅翻譯"
original_only: "僅原文"
settings:
title: "設定"
original: "原文"
translated: "翻譯"
for_multi_translation: "多語言翻譯用"
send_message_format:
label: "訊息格式(發送)"
desc: "可以變更在 VRChat 中對方實際看到的格式。"
received_message_format:
label: "訊息格式(Speaker2Chatbox)"
desc: "目前用於透過 Speaker2Chatbox 發送時的顯示。"
common_convert_message_hiragana_romaji:
desc_1: "僅在選擇日語作為翻譯語言時支援。"
desc_2: "由於日語的特殊性,精度有限。"
convert_message_to_romaji:
label: "顯示羅馬字"
desc: "與「{{convert_message_to_hiragana}}」同時啟用時,將透過滑鼠懸停顯示。"
convert_message_to_hiragana:
label: "顯示平假名"
telemetry:
label:
desc:
aptabase_privacy_policy_label:
hotkeys:
toggle_vrct_visibility:
label: "切換 VRCT 最小化/啟動"
toggle_translation:
label: "切換「{{translation}}」開/關"
toggle_transcription_send:
label: "切換「{{transcription_send}}」開/關"
toggle_transcription_receive:
label: "切換「{{transcription_receive}}」開/關"
plugins:
downloaded_version: "已下載版本:{{downloaded_version}}"
latest_version: "最新版本:{{latest_version}}"
available_after_updating: "更新到最新版後可用"
unavailable_downloaded: "目前不可用 與使用中的 VRCT 版本不相容"
no_latest_info: "無法取得最新資訊"
using_latest_version: "正在使用最新版本"
available_latest_version: "最新版本可用"
unavailable_latest_version: "最新版本目前不可用"
available_in_latest_vrct_version: "可在 VRCT 最新版中使用"
unavailable_not_downloaded: "目前不可用"
advanced_settings:
osc_ip_address:
label: "OSC IP 位址"
osc_port:
label: "OSC 端口"
open_config_filepath:
label: "打開設定文件"
switch_compute_device:
label: "切換 VRCT CPU/GPU 版本"
enable_websocket:
label: "啟用 WebSocket 伺服器"
websocket_host:
label: "WebSocket 主機"
websocket_port:
label: "WebSocket 連接埠"
notifications:
save_success: "設定已儲存。"
plugin_notifications:
downloading: "正在下載外掛程式。"
downloaded_success: "外掛程式下載完成。"
downloaded_error: "外掛程式下載失敗。"
updating: "正在更新外掛程式。"
updated_success: "外掛程式更新完成。"
updated_error: "外掛程式更新失敗。"
disabled_out_of_support: "與目前版本不相容。已停用外掛程式。"
disabled_due_to_an_error: "外掛程式執行時偵測到錯誤。請向外掛程式開發者回報。"
is_enabled: "外掛程式已啟用。"
is_disabled: "外掛程式已停用。"
+78
View File
@@ -0,0 +1,78 @@
#!/usr/bin/env node
// 使用例: node map-stack.js
// カレントディレクトリの error.txt を読み込み、各エラーフレームから
// 対応するソースマップ(dist/assets/ 以下の *.js.map)を用いて元の位置情報を出力する
import fs from "fs";
import path from "path";
import { SourceMapConsumer } from "source-map";
// 各スタックフレームにマッチする正規表現
const FRAME_REGEX = /^\s*at\s+(.*?)\s+\((.*):(\d+):(\d+)\)$/;
// スタックトレースのパース関数
const parseStackTrace = (text) => {
return text
.split(/\r?\n/)
.map((line) => {
const match = line.match(FRAME_REGEX);
if (match) {
return {
original: line,
functionName: match[1],
file: match[2],
line: Number(match[3]),
column: Number(match[4])
};
} else {
return { original: line };
}
});
};
// エラースタックをソースマップから逆引きする関数(位置情報のみを表示)
const mapStackTrace = async () => {
const errorTxtPath = path.resolve(process.cwd(), "error.txt");
const stackTraceText = fs.readFileSync(errorTxtPath, "utf8");
const frames = parseStackTrace(stackTraceText);
const consumerMap = new Map();
const mappedFrames = await Promise.all(frames.map(async (frame) => {
if (frame.file && frame.line && frame.column) {
const relativeFile = frame.file.replace(/^\//, ""); // 例: "assets/main-Td8-sruo.js"
const mapFilePath = path.resolve(process.cwd(), "dist", relativeFile + ".map");
let consumer = consumerMap.get(mapFilePath);
if (!consumer) {
const rawSourceMap = fs.readFileSync(mapFilePath, "utf8");
consumer = await new SourceMapConsumer(rawSourceMap);
consumerMap.set(mapFilePath, consumer);
}
const pos = consumer.originalPositionFor({
line: frame.line,
column: frame.column
});
if (pos && pos.source && pos.line != null && pos.column != null) {
return ` at ${frame.functionName} (${pos.source}:${pos.line}:${pos.column})`;
} else {
return frame.original;
}
} else {
return frame.original;
}
}));
consumerMap.forEach((consumer) => consumer.destroy());
return mappedFrames.join("\n");
};
mapStackTrace()
.then((mapped) => {
console.log("--- Mapped Stack Trace ---");
console.log(mapped);
})
.catch((err) => {
console.error(err);
process.exit(1);
});
+6702
View File
File diff suppressed because it is too large. Load diff
+63
View File
@@ -0,0 +1,63 @@
{
"name": "vrct",
"private": true,
"version": "3.4.2",
"type": "module",
"scripts": {
"setup-python": "bat\\install.bat",
"build-python": "bat\\build.bat",
"build-python-cuda": "bat\\build_cuda.bat",
"vite": "vite",
"vite-build": "vite build",
"vite-preview": "vite preview",
"tauri": "tauri",
"tauri-dev": "tauri dev",
"task-kill": "python utils\\task_kill.py",
"clean": "python utils\\clean.py",
"update-version": "python utils\\update_version.py",
"dev": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run dev-ui",
"dev-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run dev-ui",
"dev-ui": "npm run task-kill && npm-run-all --parallel vite tauri-dev",
"build": "npm run task-kill && npm run clean && npm run update-version && npm run build-python && npm run vite-build && npm run tauri build",
"build-cuda": "npm run task-kill && npm run clean && npm run update-version && npm run build-python-cuda && npm run vite-build && npm run tauri build",
"release": "npm run update-version && npm run build && python utils\\zip.py --zip_name VRCT.zip",
"release-cuda": "npm run update-version && npm run build-cuda && python utils\\zip.py --zip_name VRCT_cuda.zip",
"release-all": "npm run update-version && npm run release && npm run release-cuda"
},
"dependencies": {
"@babel/standalone": "7.27.0",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@mui/material": "7.0.2",
"@tauri-apps/api": "2.5.0",
"@tauri-apps/plugin-fs": "2.2.1",
"@tauri-apps/plugin-global-shortcut": "2.2.0",
"@tauri-apps/plugin-http": "2.4.3",
"@tauri-apps/plugin-opener": "2.2.6",
"@tauri-apps/plugin-shell": "2.2.1",
"clsx": "2.1.1",
"i18next": "25.0.1",
"jotai": "2.12.3",
"js-base64": "3.7.7",
"jszip": "3.10.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "5.0.0",
"react-i18next": "15.5.1",
"react-resizable-layout": "0.7.2",
"react-toastify": "11.0.5",
"sass": "1.79.4",
"semver": "7.7.1"
},
"devDependencies": {
"@rollup/plugin-yaml": "4.1.2",
"@tauri-apps/cli": "2.5.0",
"@vitejs/plugin-react": "4.4.1",
"eslint": "9.25.1",
"eslint-plugin-react": "7.37.5",
"npm-run-all": "4.1.5",
"source-map": "0.7.4",
"vite": "6.3.4",
"vite-plugin-svgr": "4.3.0"
}
}
+34
View File
@@ -0,0 +1,34 @@
torch==2.7.0
faster-whisper==1.1.1
ctranslate2==4.6.0
transformers==4.40.2
pillow == 10.0.0
PyAudioWPatch == 0.2.12.6
python-osc == 1.9.0
PyYAML==6.0.2
deepl == 1.22.0
flashtext ==2.7
pyinstaller==6.10.0
numpy==1.26.4
sentencepiece==0.2.0
openvr==1.26.701
pydub==0.25.1
psutil==5.9.8
pycaw==20240210
websockets==15.0.1
huggingface_hub==0.32.2
hf-xet==1.1.2
setuptools==80.8.0
langchain-openai==0.3.32
langchain-google-genai==2.1.10
google-genai==1.45.0
grpcio==1.67.1
langchain-ollama==0.3.10
SudachiPy==0.6.10
SudachiDict-core==20250825
SudachiDict-full==20250825
translators @ git+https://github.com/misyaguziya/translators@5.9.2.1
SpeechRecognition @ git+https://github.com/misyaguziya/custom_speech_recognition@3.10.4.1
tinyoscquery @ git+https://github.com/cyberkitsune/tinyoscquery@0.1.3
aptabase==0.1.0
PyAutoGUI==0.9.54
+35
View File
@@ -0,0 +1,35 @@
torch==2.7.0
--extra-index-url https://download.pytorch.org/whl/cu128
faster-whisper==1.1.1
ctranslate2==4.6.0
transformers==4.40.2
pillow == 10.0.0
PyAudioWPatch == 0.2.12.6
python-osc == 1.9.0
PyYAML==6.0.2
deepl == 1.22.0
flashtext ==2.7
pyinstaller==6.10.0
numpy==1.26.4
sentencepiece==0.2.0
openvr==1.26.701
pydub==0.25.1
psutil==5.9.8
pycaw==20240210
websockets==15.0.1
huggingface_hub==0.32.2
hf-xet==1.1.2
setuptools==80.8.0
langchain-openai==0.3.32
langchain-google-genai==2.1.10
google-genai==1.45.0
grpcio==1.67.1
langchain-ollama==0.3.10
SudachiPy==0.6.10
SudachiDict-core==20250825
SudachiDict-full==20250825
translators @ git+https://github.com/misyaguziya/translators@5.9.2.1
SpeechRecognition @ git+https://github.com/misyaguziya/custom_speech_recognition@3.10.4.1
tinyoscquery @ git+https://github.com/cyberkitsune/tinyoscquery@0.1.3
aptabase==0.1.0
PyAutoGUI==0.9.54
+53
View File
@@ -0,0 +1,53 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['..\\src-python\\mainloop.py'],
pathex=[],
binaries=[],
datas=[
('./../src-python/models/overlay/fonts', 'fonts/'),
('./../src-python/models/translation/translation_settings/prompt', 'translation_settings/prompt/'),
('./../src-python/models/translation/translation_settings/languages', 'translation_settings/languages/'),
('./../.venv/Lib/site-packages/zeroconf', 'zeroconf/'),
('./../.venv/Lib/site-packages/openvr', 'openvr/'),
('./../.venv/Lib/site-packages/faster_whisper', 'faster_whisper/'),
('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/')
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['pandas', 'matplotlib', 'PyQt5'],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='VRCT-sidecar-x86_64-pc-windows-msvc',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=[],
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='.',
)
+53
View File
@@ -0,0 +1,53 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['..\\src-python\\mainloop.py'],
pathex=[],
binaries=[],
datas=[
('./../src-python/models/overlay/fonts', 'fonts/'),
('./../src-python/models/translation/translation_settings/prompt', 'translation_settings/prompt/'),
('./../src-python/models/translation/translation_settings/languages', 'translation_settings/languages/'),
('./../.venv_cuda/Lib/site-packages/zeroconf', 'zeroconf/'),
('./../.venv_cuda/Lib/site-packages/openvr', 'openvr/'),
('./../.venv_cuda/Lib/site-packages/faster_whisper', 'faster_whisper/'),
('./../.venv/Lib/site-packages/hf_xet', 'hf_xet/')
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['pandas', 'matplotlib', 'PyQt5'],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='VRCT-sidecar-x86_64-pc-windows-msvc',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=[],
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='.',
)
+1093
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+529
View File
@@ -0,0 +1,529 @@
from typing import Callable, Dict, List, Optional, Any
from time import sleep
from threading import Thread
# Optional, Windows-specific dependencies. Guard imports so module can be imported on non-Windows systems.
try:
import comtypes
except Exception: # pragma: no cover - optional runtime
comtypes = None # type: ignore
try:
from pyaudiowpatch import PyAudio, paWASAPI
except Exception: # pragma: no cover - optional runtime
PyAudio = None # type: ignore
paWASAPI = None # type: ignore
try:
from pycaw.callbacks import MMNotificationClient
from pycaw.utils import AudioUtilities
except Exception: # pragma: no cover - optional runtime
MMNotificationClient = object # type: ignore
AudioUtilities = None # type: ignore
from utils import errorLogging
class Client(MMNotificationClient):
"""Callback client used by pycaw to detect device changes.
This subclass is lightweight: it flips a flag when events arrive so the
monitoring loop can break and refresh device lists.
"""
def __init__(self) -> None:
# If MMNotificationClient is the placeholder object (non-windows), avoid calling super
try:
super().__init__()
except Exception:
pass
self.loop: bool = True
def on_default_device_changed(self, *args: Any, **kwargs: Any) -> None:
self.loop = False
def on_device_added(self, *args: Any, **kwargs: Any) -> None:
self.loop = False
def on_device_removed(self, *args: Any, **kwargs: Any) -> None:
self.loop = False
def on_device_state_changed(self, *args: Any, **kwargs: Any) -> None:
self.loop = False
# def on_property_value_changed(self, device_id, key):
# self.loop = False
class DeviceManager:
_instance = None
def __new__(cls):
if cls._instance is None:
cls._instance = super(DeviceManager, cls).__new__(cls)
# do NOT auto-init monitoring-heavy resources on import; require explicit init
# Still perform a light-weight init so that callers observing the singleton
# do not see uninitialized internal structures (which caused NoDevice to
# be seen when import order differed).
cls._instance._initialized = False
try:
# Call init() to populate internal containers. This will NOT start
# the monitoring thread (startMonitoring must be called explicitly).
cls._instance.init()
except Exception:
# Avoid import-time crashes; log and continue.
try:
errorLogging()
except Exception:
pass
return cls._instance
def init(self) -> None:
"""Initialize internal state. This is intentionally separate from object
creation so importing the module won't start threads or access OS
audio APIs. Call `device_manager.init()` and then
`device_manager.startMonitoring()` explicitly when ready.
"""
if getattr(self, "_initialized", False):
return
self.mic_devices: Dict[str, List[Dict[str, Any]]] = {"NoHost": [{"index": -1, "name": "NoDevice"}]}
self.default_mic_device: Dict[str, Any] = {"host": {"index": -1, "name": "NoHost"}, "device": {"index": -1, "name": "NoDevice"}}
self.speaker_devices: List[Dict[str, Any]] = [{"index": -1, "name": "NoDevice"}]
self.default_speaker_device: Dict[str, Any] = {"device": {"index": -1, "name": "NoDevice"}}
# Initialize previous state trackers
self.prev_mic_host: List[str] = [host for host in self.mic_devices]
self.prev_mic_devices: Dict[str, List[Dict[str, Any]]] = self.mic_devices
self.prev_default_mic_device: Dict[str, Any] = self.default_mic_device
self.prev_speaker_devices: List[Dict[str, Any]] = self.speaker_devices
self.prev_default_speaker_device: Dict[str, Any] = self.default_speaker_device
# Update flags
self.update_flag_default_mic_device: bool = False
self.update_flag_default_speaker_device: bool = False
self.update_flag_host_list: bool = False
self.update_flag_mic_device_list: bool = False
self.update_flag_speaker_device_list: bool = False
# Callbacks
self.callback_default_mic_device: Optional[Callable[..., None]] = None
self.callback_default_speaker_device: Optional[Callable[..., None]] = None
self.callback_host_list: Optional[Callable[..., None]] = None
self.callback_mic_device_list: Optional[Callable[..., None]] = None
self.callback_speaker_device_list: Optional[Callable[..., None]] = None
self.callback_process_before_update_mic_devices: Optional[Callable[..., None]] = None
self.callback_process_after_update_mic_devices: Optional[Callable[..., None]] = None
self.callback_process_before_update_speaker_devices: Optional[Callable[..., None]] = None
self.callback_process_after_update_speaker_devices: Optional[Callable[..., None]] = None
# Monitoring control
self.monitoring_flag: bool = False
self.th_monitoring: Optional[Thread] = None
self._initialized = True
# Best-effort single update: if PyAudio is available, attempt to populate
# real device lists. Keep this short and ignore errors to avoid import-time
# failures.
try:
if PyAudio is not None:
try:
# update() is robust and will fall back to defaults if audio libs
# are missing or fail; do not let exceptions bubble up.
self.update()
except Exception:
errorLogging()
except Exception:
# defensive: if errorLogging isn't available or other issues occur,
# swallow to avoid breaking initialization
pass
def update(self):
buffer_mic_devices: Dict[str, List[Dict[str, Any]]] = {}
buffer_default_mic_device: Dict[str, Any] = {"host": {"index": -1, "name": "NoHost"}, "device": {"index": -1, "name": "NoDevice"}}
buffer_speaker_devices: List[Dict[str, Any]] = []
buffer_default_speaker_device: Dict[str, Any] = {"device": {"index": -1, "name": "NoDevice"}}
if PyAudio is None:
# PyAudio not available; leave defaults in place
self.mic_devices = buffer_mic_devices or {"NoHost": [{"index": -1, "name": "NoDevice"}]}
self.default_mic_device = buffer_default_mic_device
self.speaker_devices = buffer_speaker_devices or [{"index": -1, "name": "NoDevice"}]
self.default_speaker_device = buffer_default_speaker_device
return
try:
with PyAudio() as p:
# gather input devices grouped by host
for host_index in range(p.get_host_api_count()):
host = p.get_host_api_info_by_index(host_index)
device_count = host.get('deviceCount', 0)
for device_index in range(device_count):
device = p.get_device_info_by_host_api_device_index(host_index, device_index)
if device.get("maxInputChannels", 0) > 0 and not device.get("isLoopbackDevice", True):
buffer_mic_devices.setdefault(host["name"], []).append(device)
if not buffer_mic_devices:
buffer_mic_devices = {"NoHost": [{"index": -1, "name": "NoDevice"}]}
api_info = p.get_default_host_api_info()
default_mic_device = api_info.get("defaultInputDevice", -1)
for host_index in range(p.get_host_api_count()):
host = p.get_host_api_info_by_index(host_index)
device_count = host.get('deviceCount', 0)
for device_index in range(device_count):
device = p.get_device_info_by_host_api_device_index(host_index, device_index)
if device.get("index") == default_mic_device:
buffer_default_mic_device = {"host": host, "device": device}
break
else:
continue
break
# collect speaker loopback devices (requires WASAPI)
speaker_devices: List[Dict[str, Any]] = []
if paWASAPI is not None:
try:
wasapi_info = p.get_host_api_info_by_type(paWASAPI)
wasapi_name = wasapi_info.get("name")
for host_index in range(p.get_host_api_count()):
host = p.get_host_api_info_by_index(host_index)
if host.get("name") == wasapi_name:
device_count = host.get('deviceCount', 0)
for device_index in range(device_count):
device = p.get_device_info_by_host_api_device_index(host_index, device_index)
if not device.get("isLoopbackDevice", True):
for loopback in p.get_loopback_device_info_generator():
# match by name inclusion
if device.get("name") in loopback.get("name", ""):
speaker_devices.append(loopback)
except Exception:
# WASAPI not available or failed; ignore and continue
pass
# deduplicate and sort
speaker_devices = [dict(t) for t in {tuple(d.items()) for d in speaker_devices}] or [{"index": -1, "name": "NoDevice"}]
buffer_speaker_devices = sorted(speaker_devices, key=lambda d: d.get('index', -1))
# default speaker
if paWASAPI is not None:
try:
wasapi_info = p.get_host_api_info_by_type(paWASAPI)
default_speaker_device_index = wasapi_info.get("defaultOutputDevice", -1)
for host_index in range(p.get_host_api_count()):
host_info = p.get_host_api_info_by_index(host_index)
device_count = host_info.get('deviceCount', 0)
for device_index in range(0, device_count):
device = p.get_device_info_by_host_api_device_index(host_index, device_index)
if device.get("index") == default_speaker_device_index:
default_speakers = device
if not default_speakers.get("isLoopbackDevice", True):
for loopback in p.get_loopback_device_info_generator():
if default_speakers.get("name") in loopback.get("name", ""):
buffer_default_speaker_device = {"device": loopback}
break
break
if buffer_default_speaker_device["device"].get("name") != "NoDevice":
break
except Exception:
# best-effort; ignore failures
pass
except Exception:
errorLogging()
self.mic_devices = buffer_mic_devices
self.default_mic_device = buffer_default_mic_device
self.speaker_devices = buffer_speaker_devices
self.default_speaker_device = buffer_default_speaker_device
def checkUpdate(self):
if self.prev_default_mic_device["device"]["name"] != self.default_mic_device["device"]["name"]:
self.update_flag_default_mic_device = True
self.prev_default_mic_device = self.default_mic_device
if self.prev_default_speaker_device["device"]["name"] != self.default_speaker_device["device"]["name"]:
self.update_flag_default_speaker_device = True
self.prev_default_speaker_device = self.default_speaker_device
if self.prev_mic_host != [host for host in self.mic_devices]:
self.update_flag_host_list = True
self.prev_mic_host = [host for host in self.mic_devices]
if {key: [device['name'] for device in devices] for key, devices in self.prev_mic_devices.items()} != {key: [device['name'] for device in devices] for key, devices in self.mic_devices.items()}:
self.update_flag_mic_device_list = True
self.prev_mic_devices = self.mic_devices
if [device['name'] for device in self.prev_speaker_devices] != [device['name'] for device in self.speaker_devices]:
self.update_flag_speaker_device_list = True
self.prev_speaker_devices = self.speaker_devices
update_flag = (
self.update_flag_default_mic_device or
self.update_flag_default_speaker_device or
self.update_flag_host_list or
self.update_flag_mic_device_list or
self.update_flag_speaker_device_list
)
return update_flag
def monitoring(self):
try:
while self.monitoring_flag is True:
try:
# Use COM only when available (Windows). If comtypes is not present,
# fall back to periodic polling using PyAudio only.
if comtypes is not None and AudioUtilities is not None:
try:
comtypes.CoInitialize()
cb = Client()
enumerator = AudioUtilities.GetDeviceEnumerator()
enumerator.RegisterEndpointNotificationCallback(cb)
while cb.loop is True and self.monitoring_flag is True:
sleep(1)
try:
enumerator.UnregisterEndpointNotificationCallback(cb)
except Exception:
# best-effort unregister
pass
comtypes.CoUninitialize()
except Exception:
# if COM monitoring fails, log and fall through to polling
errorLogging()
# polling and update cycle
self.runProcessBeforeUpdateMicDevices()
self.runProcessBeforeUpdateSpeakerDevices()
sleep(2)
for _ in range(10):
self.update()
if self.checkUpdate():
break
sleep(2)
self.noticeUpdateDevices()
self.runProcessAfterUpdateMicDevices()
self.runProcessAfterUpdateSpeakerDevices()
except Exception:
errorLogging()
except Exception:
errorLogging()
def startMonitoring(self):
if self.monitoring_flag:
return
self.monitoring_flag = True
self.th_monitoring = Thread(target=self.monitoring)
self.th_monitoring.daemon = True
self.th_monitoring.start()
def stopMonitoring(self):
self.monitoring_flag = False
if getattr(self, "th_monitoring", None) is not None:
try:
self.th_monitoring.join(timeout=5)
except Exception:
# If join fails or thread is not joinable, ignore - it's a best-effort stop
pass
def setCallbackDefaultMicDevice(self, callback):
self.callback_default_mic_device = callback
def clearCallbackDefaultMicDevice(self):
self.callback_default_mic_device = None
def setCallbackDefaultSpeakerDevice(self, callback):
self.callback_default_speaker_device = callback
def clearCallbackDefaultSpeakerDevice(self):
self.callback_default_speaker_device = None
def setCallbackHostList(self, callback):
self.callback_host_list = callback
def clearCallbackHostList(self):
self.callback_host_list = None
def setCallbackMicDeviceList(self, callback):
self.callback_mic_device_list = callback
def clearCallbackMicDeviceList(self):
self.callback_mic_device_list = None
def setCallbackSpeakerDeviceList(self, callback):
self.callback_speaker_device_list = callback
def clearCallbackSpeakerDeviceList(self):
self.callback_speaker_device_list = None
def setCallbackProcessBeforeUpdateMicDevices(self, callback):
self.callback_process_before_update_mic_devices = callback
def clearCallbackProcessBeforeUpdateMicDevices(self):
self.callback_process_before_update_mic_devices = None
def runProcessBeforeUpdateMicDevices(self):
if isinstance(self.callback_process_before_update_mic_devices, Callable):
try:
self.callback_process_before_update_mic_devices()
except Exception:
errorLogging()
def setCallbackProcessAfterUpdateMicDevices(self, callback):
self.callback_process_after_update_mic_devices = callback
def clearCallbackProcessAfterUpdateMicDevices(self):
self.callback_process_after_update_mic_devices = None
def runProcessAfterUpdateMicDevices(self):
if isinstance(self.callback_process_after_update_mic_devices, Callable):
try:
self.callback_process_after_update_mic_devices()
except Exception:
errorLogging()
def setCallbackProcessBeforeUpdateSpeakerDevices(self, callback):
self.callback_process_before_update_speaker_devices = callback
def clearCallbackProcessBeforeUpdateSpeakerDevices(self):
self.callback_process_before_update_speaker_devices = None
def runProcessBeforeUpdateSpeakerDevices(self):
if isinstance(self.callback_process_before_update_speaker_devices, Callable):
try:
self.callback_process_before_update_speaker_devices()
except Exception:
errorLogging()
def setCallbackProcessAfterUpdateSpeakerDevices(self, callback):
self.callback_process_after_update_speaker_devices = callback
def clearCallbackProcessAfterUpdateSpeakerDevices(self):
self.callback_process_after_update_speaker_devices = None
def runProcessAfterUpdateSpeakerDevices(self):
if isinstance(self.callback_process_after_update_speaker_devices, Callable):
try:
self.callback_process_after_update_speaker_devices()
except Exception:
errorLogging()
def noticeUpdateDevices(self):
if self.update_flag_default_mic_device is True:
self.setMicDefaultDevice()
if self.update_flag_default_speaker_device is True:
self.setSpeakerDefaultDevice()
if self.update_flag_host_list is True:
self.setMicHostList()
if self.update_flag_mic_device_list is True:
self.setMicDeviceList()
if self.update_flag_speaker_device_list is True:
self.setSpeakerDeviceList()
self.update_flag_default_mic_device = False
self.update_flag_default_speaker_device = False
self.update_flag_host_list = False
self.update_flag_mic_device_list = False
self.update_flag_speaker_device_list = False
def setMicDefaultDevice(self):
if isinstance(self.callback_default_mic_device, Callable):
try:
self.callback_default_mic_device(self.default_mic_device["host"]["name"], self.default_mic_device["device"]["name"])
except Exception:
errorLogging()
def setSpeakerDefaultDevice(self):
if isinstance(self.callback_default_speaker_device, Callable):
try:
self.callback_default_speaker_device(self.default_speaker_device["device"]["name"])
except Exception:
errorLogging()
def setMicHostList(self):
if isinstance(self.callback_host_list, Callable):
try:
self.callback_host_list()
except Exception:
errorLogging()
def setMicDeviceList(self):
if isinstance(self.callback_mic_device_list, Callable):
try:
self.callback_mic_device_list()
except Exception:
errorLogging()
def setSpeakerDeviceList(self):
if isinstance(self.callback_speaker_device_list, Callable):
try:
self.callback_speaker_device_list()
except Exception:
errorLogging()
def getMicDevices(self):
# Ensure initialized and return devices (safe default if still not populated)
if not getattr(self, '_initialized', False):
try:
self.init()
except Exception:
try:
errorLogging()
except Exception:
pass
return getattr(self, 'mic_devices', {"NoHost": [{"index": -1, "name": "NoDevice"}]})
def getDefaultMicDevice(self):
# Ensure initialized and return default mic device (safe default if still not populated)
if not getattr(self, '_initialized', False):
try:
self.init()
except Exception:
try:
errorLogging()
except Exception:
pass
return getattr(self, 'default_mic_device', {"host": {"index": -1, "name": "NoHost"}, "device": {"index": -1, "name": "NoDevice"}})
def getSpeakerDevices(self):
# Ensure initialized and return speaker devices (safe default if still not populated)
if not getattr(self, '_initialized', False):
try:
self.init()
except Exception:
try:
errorLogging()
except Exception:
pass
return getattr(self, 'speaker_devices', [{"index": -1, "name": "NoDevice"}])
def getDefaultSpeakerDevice(self):
# Ensure initialized and return default speaker device (safe default if still not populated)
if not getattr(self, '_initialized', False):
try:
self.init()
except Exception:
try:
errorLogging()
except Exception:
pass
return getattr(self, 'default_speaker_device', {"device": {"index": -1, "name": "NoDevice"}})
def forceUpdateAndSetMicDevices(self):
self.update()
self.setMicHostList()
self.setMicDeviceList()
self.setMicDefaultDevice()
def forceUpdateAndSetSpeakerDevices(self):
self.update()
self.setSpeakerDeviceList()
self.setSpeakerDefaultDevice()
# Provide a module-level singleton. Call `device_manager.init()` explicitly to
# initialize audio resources and `device_manager.startMonitoring()` to begin
# background monitoring. This avoids side-effects during simple imports.
device_manager = DeviceManager()
if __name__ == "__main__":
print("DeviceManager demo. Call device_manager.init() and device_manager.startMonitoring() to run live monitoring.")
try:
while True:
sleep(1)
except KeyboardInterrupt:
print("exiting")
+449
View File
@@ -0,0 +1,449 @@
# config.py ドキュメント
## 概要
`config.py` は、アプリケーションの全設定を一元管理するシングルトンクラス `Config` を提供するモジュール。設定値の読み込み・保存・検証を行い、JSON ファイルへの永続化をデバウンス機能付きで実現する。
## 主要機能
- シングルトンパターンによる設定の一元管理
- JSONファイル (`config.json`) からの設定読み込みと自動保存
- デバウンス機能による書き込み最適化(デフォルト2秒)
- 読み取り専用プロパティと読み書き可能プロパティの明確な分離
- オプショナルモジュールのセーフガードインポート(環境依存の依存関係を安全に処理)
- プロパティセッター内での型チェックとバリデーション
- `@json_serializable` デコレータによる永続化対象プロパティの管理
## アーキテクチャ
### デザインパターン
- **シングルトンパターン**: `__new__` メソッドで単一インスタンスを保証
- **プロパティパターン**: getter/setter による型安全なアクセス制御
### 設定の分類
1. **読み取り専用設定** (Read Only)
- アプリケーションバージョン、パス、URL、定数など
- プロパティのみ(setter なし)
2. **ランタイム設定** (Read Write)
- 機能の有効/無効フラグ
- 実行時の状態管理
- JSON保存されない一時的な設定
3. **永続化設定** (Save Json Data)
- ユーザー設定、デバイス選択、UI設定など
- `@json_serializable` デコレータでマーク
- `saveConfig()` 経由で自動保存
## 使用方法
### 基本的な使い方
```python
from config import config
# 設定値の取得(読み取り専用)
version = config.VERSION
app_path = config.PATH_LOCAL
# 設定値の取得(読み書き可能)
current_tab = config.SELECTED_TAB_NO
mic_threshold = config.MIC_THRESHOLD
# 設定値の変更(自動保存される)
config.SELECTED_TAB_NO = "2"
config.MIC_THRESHOLD = 500
config.TRANSPARENCY = 80
# 即座に保存する場合
config.MAIN_WINDOW_GEOMETRY = {"x_pos": 100, "y_pos": 200, "width": 900, "height": 700}
# MESSAGE_BOX_RATIO と MAIN_WINDOW_GEOMETRY は immediate_save=True で即座に保存
```
### デバウンス保存の仕組み
```python
# 通常の設定変更: 2秒後に保存
config.UI_LANGUAGE = "ja"
config.FONT_FAMILY = "Arial" # 前のタイマーがキャンセルされ、新たに2秒のタイマー開始
# 即座保存が必要な設定: デバウンスなし
config.MESSAGE_BOX_RATIO = 15 # 即座にファイル書き込み
```
## 動作環境・依存関係
### 必須依存
- Python 3.10以上(match-case 構文使用)
- `torch`: CUDA利用可否の判定に使用
- `threading`: デバウンスタイマー用
### オプション依存(セーフガード付き)
以下のモジュールはインポートに失敗しても動作する:
- `device_manager`: デバイス管理(マイク/スピーカー)
- `models.translation.translation_languages`: 翻訳言語リスト
- `models.translation.translation_utils`: CTranslate2 重みリスト
- `models.transcription.transcription_languages`: 音声認識言語リスト
- `models.transcription.transcription_whisper`: Whisper モデルリスト
### プロジェクト内依存
- `utils`: エラーロギング、辞書構造検証、計算デバイスリスト取得
## ファイル構成
### 主要クラス: `Config`
#### クラス属性
```python
_instance: Config | None # シングルトンインスタンス
_config_data: Dict[str, Any] # JSON保存用データ
_timer: Optional[threading.Timer] # デバウンスタイマー
_debounce_time: int = 2 # デバウンス時間(秒)
```
#### 主要メソッド
**初期化・保存**
- `__new__(cls)`: シングルトンインスタンス生成・初期化
- `init_config()`: デフォルト値の設定
- `load_config()`: JSONファイルから設定読み込み
- `saveConfig(key, value, immediate_save=False)`: 設定の保存(デバウンス付き)
- `saveConfigToFile()`: JSONファイルへの即座書き込み
**デコレータ**
- `@json_serializable(var_name)`: 永続化対象プロパティのマーク
### 設定プロパティ一覧
#### 読み取り専用設定(23項目)
| プロパティ名 | 型 | 説明 | デフォルト値 |
|------------|----|----|------------|
| `VERSION` | str | アプリケーションバージョン | "3.3.0" |
| `PATH_LOCAL` | str | アプリケーションローカルパス | 実行時決定 |
| `PATH_CONFIG` | str | 設定ファイルパス | `{PATH_LOCAL}/config.json` |
| `PATH_LOGS` | str | ログディレクトリパス | `{PATH_LOCAL}/logs` |
| `GITHUB_URL` | str | GitHub API URL | リポジトリURL |
| `UPDATER_URL` | str | アップデーターAPIの URL | アップデーターURL |
| `BOOTH_URL` | str | Booth 販売ページURL | Booth URL |
| `DOCUMENTS_URL` | str | ドキュメントURL | Notion URL |
| `DEEPL_AUTH_KEY_PAGE_URL` | str | DeepL認証キー取得ページ | DeepL URL |
| `MAX_MIC_THRESHOLD` | int | マイクしきい値の最大値 | 2000 |
| `MAX_SPEAKER_THRESHOLD` | int | スピーカーしきい値の最大値 | 4000 |
| `WATCHDOG_TIMEOUT` | int | Watchdog タイムアウト(秒) | 60 |
| `WATCHDOG_INTERVAL` | int | Watchdog チェック間隔(秒) | 20 |
| `SELECTABLE_TAB_NO_LIST` | List[str] | 選択可能タブ番号 | ["1", "2", "3"] |
| `SELECTED_TAB_TARGET_LANGUAGES_NO_LIST` | List[str] | ターゲット言語タブ番号 | ["1", "2", "3"] |
| `SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_LIST` | List[str] | CTranslate2重みタイプリスト | 動的取得 |
| `SELECTABLE_WHISPER_WEIGHT_TYPE_LIST` | List[str] | Whisper重みタイプリスト | 動的取得 |
| `SELECTABLE_TRANSLATION_ENGINE_LIST` | List[str] | 翻訳エンジンリスト | 動的取得 |
| `SELECTABLE_TRANSCRIPTION_ENGINE_LIST` | List[str] | 音声認識エンジンリスト | 動的取得 |
| `SELECTABLE_UI_LANGUAGE_LIST` | List[str] | UI言語リスト | ["en", "ja", "ko", "zh-Hant", "zh-Hans"] |
| `COMPUTE_MODE` | str | 計算モード | "cuda" or "cpu" |
| `SELECTABLE_COMPUTE_DEVICE_LIST` | List[Dict] | 選択可能な計算デバイスリスト | 動的取得 |
| `SEND_MESSAGE_BUTTON_TYPE_LIST` | List[str] | 送信ボタンタイプリスト | ["show", "hide", "show_and_disable_enter_key"] |
#### ランタイム設定(10項目)
| プロパティ名 | 型 | 説明 | デフォルト値 | JSON保存 |
|------------|----|----|-----------|---------|
| `ENABLE_TRANSLATION` | bool | 翻訳機能有効フラグ | False | なし |
| `ENABLE_TRANSCRIPTION_SEND` | bool | 送信音声認識有効フラグ | False | なし |
| `ENABLE_TRANSCRIPTION_RECEIVE` | bool | 受信音声認識有効フラグ | False | なし |
| `ENABLE_FOREGROUND` | bool | フォアグラウンド有効フラグ | False | なし |
| `ENABLE_CHECK_ENERGY_SEND` | bool | 送信エネルギーチェック有効 | False | なし |
| `ENABLE_CHECK_ENERGY_RECEIVE` | bool | 受信エネルギーチェック有効 | False | なし |
| `SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_DICT` | Dict[str, bool] | CTranslate2重み状態辞書 | {} | なし |
| `SELECTABLE_WHISPER_WEIGHT_TYPE_DICT` | Dict[str, bool] | Whisper重み状態辞書 | {} | なし |
| `SELECTABLE_TRANSLATION_ENGINE_STATUS` | Dict[str, bool] | 翻訳エンジン状態辞書 | {} | なし |
| `SELECTABLE_TRANSCRIPTION_ENGINE_STATUS` | Dict[str, bool] | 音声認識エンジン状態辞書 | {} | なし |
#### 永続化設定(60項目以上)
**メインウィンドウ設定**
- `SELECTED_TAB_NO`: 選択中のタブ番号
- `SELECTED_TRANSLATION_ENGINES`: タブごとの翻訳エンジン選択
- `SELECTED_YOUR_LANGUAGES`: タブごとの入力言語設定
- `SELECTED_TARGET_LANGUAGES`: タブごとのターゲット言語設定
- `SELECTED_TRANSCRIPTION_ENGINE`: 音声認識エンジン
- `CONVERT_MESSAGE_TO_ROMAJI`: ローマ字変換有効フラグ
- `CONVERT_MESSAGE_TO_HIRAGANA`: ひらがな変換有効フラグ
- `MAIN_WINDOW_SIDEBAR_COMPACT_MODE`: サイドバーコンパクトモード
- `SEND_MESSAGE_FORMAT_PARTS`: 送信メッセージフォーマット
- `RECEIVED_MESSAGE_FORMAT_PARTS`: 受信メッセージフォーマット
**UIウィンドウ設定**
- `TRANSPARENCY`: ウィンドウ透明度(0-100)
- `UI_SCALING`: UIスケーリング(%)
- `TEXTBOX_UI_SCALING`: テキストボックススケーリング(%)
- `MESSAGE_BOX_RATIO`: メッセージボックス比率(即座保存)
- `SEND_MESSAGE_BUTTON_TYPE`: 送信ボタンタイプ
- `SHOW_RESEND_BUTTON`: 再送信ボタン表示フラグ
- `FONT_FAMILY`: フォントファミリー
- `UI_LANGUAGE`: UI言語
- `MAIN_WINDOW_GEOMETRY`: ウィンドウ位置・サイズ(即座保存)
**マイク設定**
- `AUTO_MIC_SELECT`: 自動マイク選択
- `SELECTED_MIC_HOST`: 選択されたマイクホスト
- `SELECTED_MIC_DEVICE`: 選択されたマイクデバイス
- `MIC_THRESHOLD`: マイクしきい値
- `MIC_AUTOMATIC_THRESHOLD`: 自動しきい値調整
- `MIC_RECORD_TIMEOUT`: 録音タイムアウト(秒)
- `MIC_PHRASE_TIMEOUT`: フレーズタイムアウト(秒)
- `MIC_MAX_PHRASES`: 最大フレーズ数
- `MIC_WORD_FILTER`: ワードフィルターリスト
- `MIC_AVG_LOGPROB`: 平均対数確率しきい値
- `MIC_NO_SPEECH_PROB`: 無音確率しきい値
**スピーカー設定**
- `AUTO_SPEAKER_SELECT`: 自動スピーカー選択
- `SELECTED_SPEAKER_DEVICE`: 選択されたスピーカーデバイス
- `SPEAKER_THRESHOLD`: スピーカーしきい値
- `SPEAKER_AUTOMATIC_THRESHOLD`: 自動しきい値調整
- `SPEAKER_RECORD_TIMEOUT`: 録音タイムアウト(秒)
- `SPEAKER_PHRASE_TIMEOUT`: フレーズタイムアウト(秒)
- `SPEAKER_MAX_PHRASES`: 最大フレーズ数
- `SPEAKER_AVG_LOGPROB`: 平均対数確率しきい値
- `SPEAKER_NO_SPEECH_PROB`: 無音確率しきい値
**モデル設定**
- `SELECTED_TRANSLATION_COMPUTE_DEVICE`: 翻訳計算デバイス
- `SELECTED_TRANSCRIPTION_COMPUTE_DEVICE`: 音声認識計算デバイス
- `CTRANSLATE2_WEIGHT_TYPE`: CTranslate2重みタイプ
- `SELECTED_TRANSLATION_COMPUTE_TYPE`: 翻訳計算タイプ
- `WHISPER_WEIGHT_TYPE`: Whisper重みタイプ
- `SELECTED_TRANSCRIPTION_COMPUTE_TYPE`: 音声認識計算タイプ
**通信設定**
- `OSC_IP_ADDRESS`: OSC IPアドレス(デフォルト: "127.0.0.1")
- `OSC_PORT`: OSCポート(デフォルト: 9000)
- `AUTH_KEYS`: 認証キー辞書(DeepL API, Groq API, OpenRouter API等)
- `WEBSOCKET_HOST`: WebSocketホスト
- `WEBSOCKET_PORT`: WebSocketポート
- `WEBSOCKET_SERVER`: WebSocketサーバー有効フラグ(非永続化)
**翻訳エンジン モデル選択**
- `SELECTABLE_GROQ_MODEL_LIST`: 利用可能な Groq モデルリスト(非永続化)
- `SELECTED_GROQ_MODEL`: 選択中の Groq モデル
- `SELECTABLE_OPENROUTER_MODEL_LIST`: 利用可能な OpenRouter モデルリスト(非永続化)
- `SELECTED_OPENROUTER_MODEL`: 選択中の OpenRouter モデル
**オーバーレイ設定**
- `OVERLAY_SMALL_LOG`: 小ログオーバーレイ有効
- `OVERLAY_SMALL_LOG_SETTINGS`: 小ログオーバーレイ設定(位置、回転、表示時間等)
- `OVERLAY_LARGE_LOG`: 大ログオーバーレイ有効
- `OVERLAY_LARGE_LOG_SETTINGS`: 大ログオーバーレイ設定
- `OVERLAY_SHOW_ONLY_TRANSLATED_MESSAGES`: 翻訳メッセージのみ表示
**その他設定**
- `HOTKEYS`: ホットキー設定辞書(即座保存)
- `PLUGINS_STATUS`: プラグイン状態リスト(即座保存)
- `USE_EXCLUDE_WORDS`: 除外ワード機能使用フラグ
- `AUTO_CLEAR_MESSAGE_BOX`: メッセージボックス自動クリア
- `SEND_ONLY_TRANSLATED_MESSAGES`: 翻訳メッセージのみ送信
- `SEND_MESSAGE_TO_VRC`: VRChatへメッセージ送信
- `SEND_RECEIVED_MESSAGE_TO_VRC`: 受信メッセージをVRChatへ送信
- `LOGGER_FEATURE`: ロガー機能有効
- `VRC_MIC_MUTE_SYNC`: VRChatマイクミュート同期
- `NOTIFICATION_VRC_SFX`: VRChat通知効果音
## 内部実装の詳細
### デバウンス保存の実装
```python
def saveConfig(self, key: str, value: Any, immediate_save: bool = False) -> None:
self._config_data[key] = value
# 既存のタイマーをキャンセル
if isinstance(self._timer, threading.Timer) and self._timer.is_alive():
self._timer.cancel()
if immediate_save:
self.saveConfigToFile()
else:
# 2秒後に保存するタイマーをセット
self._timer = threading.Timer(self._debounce_time, self.saveConfigToFile)
self._timer.daemon = True
self._timer.start()
```
### プロパティのバリデーション例
```python
@SELECTED_TAB_NO.setter
def SELECTED_TAB_NO(self, value):
if isinstance(value, str):
if value in self.SELECTABLE_TAB_NO_LIST:
self._SELECTED_TAB_NO = value
self.saveConfig(inspect.currentframe().f_code.co_name, value)
```
各setterは以下のパターンを実装:
1. 型チェック (`isinstance`):`ManagedProperty` による型チェックは `None` を許容するが、個別 setter が数値変換などを行う場合は `None` を拒否するケースがある
2. 値の範囲・有効性チェック
3. 内部変数への代入
4. `saveConfig` 呼び出し(永続化対象の場合)
#### 型チェックの詳細(v3.3.0+)
```python
# 型チェック実装:ManagedProperty 経由では None を常に許可
if self.type_ is not None and value is not None and not isinstance(value, self.type_):
return # 無視する
```
この仕様は `ManagedProperty` を通じた型チェックに適用される。個別の setter で追加のバリデーションやキャストを行う場合、`None` は別途拒否されることがある。
### メッセージフォーマット構造
```python
{
"message": {
"prefix": "", # メッセージ前置文字列
"suffix": "" # メッセージ後置文字列
},
"separator": "\n", # メッセージと翻訳の区切り
"translation": {
"prefix": "", # 翻訳前置文字列
"separator": "\n", # 複数翻訳の区切り
"suffix": "" # 翻訳後置文字列
},
"translation_first": False # 翻訳を先に表示するか
}
```
### オーバーレイ設定構造
```python
{
"x_pos": 0.0, # X座標
"y_pos": 0.0, # Y座標
"z_pos": 0.0, # Z座標
"x_rotation": 0.0, # X軸回転
"y_rotation": 0.0, # Y軸回転
"z_rotation": 0.0, # Z軸回転
"display_duration": 5, # 表示時間(秒)
"fadeout_duration": 2, # フェードアウト時間(秒)
"opacity": 1.0, # 不透明度(0.0-1.0)
"ui_scaling": 1.0, # UIスケーリング
"tracker": "HMD" # トラッカー ("HMD", "LeftHand", "RightHand")
}
```
## エラーハンドリング
### セーフガードインポート
```python
try:
from device_manager import device_manager
except Exception:
device_manager = None # フォールバック値
```
全ての外部モジュールインポートはtry-exceptでラップされており、インポート失敗時でも `Config` クラスは正常に動作する。
### 初期化エラー
```python
def __new__(cls):
if cls._instance is None:
cls._instance = super(Config, cls).__new__(cls)
try:
cls._instance.init_config()
except Exception:
errorLogging() # エラーをログに記録
try:
cls._instance.load_config()
except Exception:
errorLogging()
return cls._instance
```
初期化とロード処理はそれぞれ独立してエラーハンドリングされる。
### 設定ロード時のエラー
```python
for key, value in self._config_data.items():
try:
setattr(self, key, value)
except Exception:
errorLogging() # 個別設定の読み込み失敗は継続
```
JSONから読み込んだ設定のうち、不正な値があっても他の設定の読み込みは継続される。
## パフォーマンス考慮事項
1. **デバウンス保存**: 頻繁な設定変更時にI/Oを削減
2. **遅延初期化**: オプションモジュールは必要時のみロード
3. **シングルトン**: 設定オブジェクトの複製を防止
4. **デーモンスレッド**: タイマースレッドはメインスレッド終了時に自動終了
## セキュリティ考慮事項
1. **認証キー**: `AUTH_KEYS` に格納される外部APIキーは平文でJSON保存される
2. **パス検証**: IP アドレスは `isValidIpAddress` でバリデーション
3. **型安全性**: 全てのセッターで型チェック実施
## テスト推奨事項
### 単体テスト
```python
def test_config_singleton():
config1 = Config()
config2 = Config()
assert config1 is config2
def test_debounce_save():
config.UI_LANGUAGE = "ja"
time.sleep(1)
config.UI_LANGUAGE = "en"
# 2秒以内の変更は1回のみ保存される
time.sleep(2.5)
# ここで保存完了
```
### バリデーションテスト
```python
def test_invalid_tab_no():
config.SELECTED_TAB_NO = "invalid" # 無視される
assert config.SELECTED_TAB_NO != "invalid"
```
### オプション依存のテスト
```python
def test_missing_device_manager():
# device_manager が None でも動作すること
assert config.SELECTABLE_COMPUTE_DEVICE_LIST is not None
```
## マイグレーション
### 設定ファイルのバージョンアップ
`load_config()` は存在しないキーを無視し、`init_config()` のデフォルト値を使用する。新しいバージョンでキーが追加された場合:
1. 既存キーはJSONから読み込まれる
2. 新規キーは `init_config()` のデフォルト値が使用される
3. 次回保存時に全てのキーがJSON に書き込まれる
## 制限事項
1. **マルチプロセス**: シングルトンはプロセス単位。マルチプロセス環境では各プロセスが独立したインスタンスを持つ
2. **スレッドセーフティ**: プロパティアクセス自体はスレッドセーフではない(保存タイマーのみスレッド対応)
3. **循環参照**: `device_manager` と `config` 間の循環参照に注意
4. **JSON制限**: JSON にシリアライズ可能な型のみ保存可能
## ライセンス
プロジェクトのルートディレクトリの `LICENSE` ファイルを参照
## 関連ドキュメント
- `controller.md`: Controller クラスの設定使用方法
- `mainloop.md`: メインループでの設定参照
- `仕様書.md`: 全体仕様
- `設計書.md`: システム設計
## 変更履歴
### v3.3.0
- 現行バージョン
- WebSocket サーバー設定追加
- オーバーレイ設定の拡張
File diff suppressed because it is too large. Load diff
+250
View File
@@ -0,0 +1,250 @@
# Clipboard 機能設計書
## 概要
VRCT のクリップボード機能は、VRChat 内でのテキスト送信効率を向上させるため、翻訳結果をクリップボードにコピーし、ペースト機能を提供します。
## 主要機能
### 1. テキストコピー
- 翻訳結果をシステムクリップボードにコピー
- 複数のバックエンド対応(Windows clip、pyperclip、tkinter)
- UTF-16LE BOM 対応でクロスプラットフォーム互換性を確保
### 2. テキストペースト
- `Ctrl+V` による自動ペースト
- VRChat ウィンドウの自動フォーカス
- カウントダウン機能で準備時間を確保
### 3. VR アプリ検出
- OpenVR を用いた VRChat アプリ名の自動検出
- バックグラウンドスレッドによる非同期監視
- SteamVR の起動を待機・検出
## クラス設計
### Clipboard クラス
```python
class Clipboard:
def __init__(self)
def enable(self) -> None
def disable(self) -> None
def copy(self, message: str) -> bool
def paste(self, window_name: str|None = None, countdown: int = 0) -> bool
```
#### メンバ変数
- `is_enabled`: クリップボード機能の有効/無効状態
- `app_name`: VRChat アプリケーション名(自動検出)
- `_vr_monitor_thread`: SteamVR 監視スレッド
- `_stop_monitoring`: スレッド停止フラグ
### 主要メソッド
#### `__init__()`
初期化処理:
1. VR 監視スレッドを起動
2. SteamVR の起動を待機(10秒間隔で確認)
#### `enable()`
クリップボード機能を有効化:
1. `is_enabled` フラグを True に設定
2. `_initialize()` を呼び出し VR 監視を再開
#### `disable()`
クリップボード機能を無効化:
1. `is_enabled` フラグを False に設定
2. `_stop_monitoring` フラグを設定しスレッド停止
3. スレッド終了を待機(タイムアウト 1秒)
#### `copy(message: str) -> bool`
**パラメータ:**
- `message`: クリップボードにコピーするテキスト
**戻り値:**
- `True`: コピー成功
- `False`: コピー失敗または無効状態
**動作:**
1. `is_enabled` チェック
2. `copy_to_clipboard()` 関数を呼び出し
#### `paste(window_name: str|None = None, countdown: int = 0) -> bool`
**パラメータ:**
- `window_name`: フォーカス対象ウィンドウ(タイトル部分一致 or プロセス名)
- `countdown`: ペースト前の待機秒数
**戻り値:**
- `True`: ペースト送信成功
- `False`: ペースト失敗または無効状態
**動作:**
1. `is_enabled` チェック
2. `window_name` 未指定時は自動検出した VRChat アプリ名を使用
3. Windows 環境下でウィンドウをフォーカス(以下の順序)
- ウィンドウタイトルで部分一致検索
- マッチしない場合、プロセス名で検索
4. ウィンドウフォーカス成功時、`paste_via_pyautogui()` でペースト実行
### 内部メソッド
#### `_initialize()`
VR 監視スレッドの初期化:
1. `_stop_monitoring` を False に設定
2. デーモンスレッドで `_monitor_steamvr()` を起動
#### `_monitor_steamvr()`
バックグラウンドスレッド処理:
1. 10秒間隔で `checkSteamvrRunning()` を確認
2. SteamVR 検出時に `_setup_vr_app_name()` を呼び出し
3. `_stop_monitoring` が True になるまで監視
#### `_setup_vr_app_name()`
OpenVR を用いた VR アプリ名検出:
1. OpenVR 初期化(`VRApplication_Background` モード)
2. すべてのアプリケーション情報を取得
3. `steam.app` で始まるキーを検索し `app_name` に設定
4. 例外発生時は `app_name` を None に設定
## 支援関数
### `checkSteamvrRunning() -> bool`
SteamVR が起動しているかを確認
- プロセス名 `vrmonitor.exe`(Windows)または `vrmonitor`(その他)を検索
### `copy_to_clipboard(text: str) -> bool`
複数バックエンド対応のコピー関数
1. Windows: `clip` コマンド + UTF-16LE BOM
2. 汎用: `pyperclip` ライブラリ
3. フォールバック: `tkinter` 使用
### `paste_via_pyautogui(countdown: int = 0) -> bool`
PyAutoGUI を用いたペースト
- `pyautogui.hotkey('ctrl', 'v')` で Ctrl+V を送信
- カウントダウン実行
### ウィンドウ検索関数(Windows のみ)
#### `find_windows_by_title_substring(substring: str) -> list`
ウィンドウタイトルで部分一致検索
#### `find_windows_by_process_name(proc_name: str) -> list`
プロセス名でウィンドウを検索
#### `focus_window(hwnd) -> bool`
指定ウィンドウをアクティブ化
## 依存ライブラリ
| ライブラリ | 用途 | オプション |
|-----------|------|----------|
| pyautogui | キー入力シミュレーション | 必須(ペースト機能) |
| pyperclip | クリップボード操作 | オプション(フォールバック) |
| tkinter | クリップボード操作 | オプション(フォールバック) |
| openvr | VR アプリ名検出 | 必須 |
| psutil | プロセス検索 | 必須 |
## 動作フロー
### 初期化フロー
```
Clipboard.__init__()
└─ _initialize()
└─ スレッド起動: _monitor_steamvr()
└─ 10秒間隔で SteamVR 監視
└─ 検出時: _setup_vr_app_name()
└─ VRChat アプリ名を app_name に設定
```
### コピー・ペーストフロー
```
Model.setCopyToClipboard(text)
└─ clipboard.copy(text)
└─ copy_to_clipboard(text) [成功/失敗]
Model.setPasteFromClipboard()
└─ clipboard.paste(window_name=self.app_name)
└─ find_windows_by_title_substring() [Windows]
or find_windows_by_process_name()
└─ focus_window(hwnd)
└─ paste_via_pyautogui(countdown)
```
## 有効/無効制御
### コンフィグ設定
- `config.ENABLE_CLIPBOARD`: True/False でクリップボード機能を制御
- Controller 側で `config.ENABLE_CLIPBOARD` をチェックし、True の場合のみ `setCopyToClipboard()` と `setPasteFromClipboard()` を呼び出し
### 制御メソッド(Clipboard クラス内部)
```python
# 有効化(内部API、通常は使用しない)
clipboard.enable()
# 無効化(内部API、通常は使用しない)
clipboard.disable()
```
**注意**: 現在の実装では、Controller は `clipboard.enable()/disable()` を呼び出さず、`config.ENABLE_CLIPBOARD` フラグのみで制御します。Clipboard インスタンスは常に初期化されており、VR 監視スレッドも稼働し続けます。
### API エンドポイント(Controller)
```
/get/data/clipboard - 現在の有効/無効状態を取得
/set/enable/clipboard - config.ENABLE_CLIPBOARD を True に設定
/set/disable/clipboard - config.ENABLE_CLIPBOARD を False に設定
```
## エラーハンドリング
### 失敗時の動作
- コピー失敗: `False` を返却、リトライなし
- ペースト失敗: `False` を返却、リトライなし
- VR アプリ名検出失敗: `app_name` を None に設定、現在フォーカス中のウィンドウにペースト
### 例外処理
- OpenVR 初期化失敗時は `app_name = None` に設定
- プロセス検索例外も握りつぶし
- ウィンドウフォーカス失敗はログのみ出力
## パフォーマンス考慮
### スレッド設計
- VR 監視スレッドは **デーモンスレッド**(アプリ終了時の強制停止可能)
- 10秒間隔で監視(CPU 負荷最小化)
### クリップボード操作
- コピー・ペースト操作はメインスレッド実行
- ウィンドウフォーカス後に 0.2秒スリープで安定性向上
## セキュリティ・プライバシー
### データ保護
- クリップボードデータは一切ログ出力されない
- VR アプリ名のみ app_name として保持
### OS 依存性
- Windows: `clip` コマンド、ctypes によるウィンドウ制御
- その他 OS: pyperclip/tkinter フォールバック、自動フォーカス機能なし
## 制限事項・既知の問題
1. **非 Windows 環境**
- ウィンドウフォーカス機能は Windows のみ対応
- その他 OS では現在フォーカス中のウィンドウにペースト
2. **VRChat アプリ名検出**
- OpenVR が利用可能で SteamVR が起動している必要がある
- `steam.app` 接頭辞のアプリのみ認識
3. **PyAutoGUI の制限**
- キー入力シミュレーションはOS依存
- 一部アプリケーションではセキュリティ制限により失敗する可能性あり
4. **クリップボードバッファ**
- Ctrl+V 送信のタイミングはユーザー判断(カウントダウン機能あり)
- クリップボード内容の永続化はしない
## 参考資料
- [PyAutoGUI 公式ドキュメント](https://pyautogui.readthedocs.io/)
- [OpenVR Python バインディング](https://github.com/ValvePython/openvr)
- [psutil ドキュメント](https://psutil.readthedocs.io/)
+473
View File
@@ -0,0 +1,473 @@
# config.py - 設定管理モジュール
## 概要
VRCTアプリケーションの全設定を一元管理するモジュールです。シングルトンパターンを採用し、アプリケーション全体で統一された設定アクセスを提供します。JSON設定ファイルの読み書き、設定の永続化、デバウンス機能付き保存機能を提供します。
## 主要機能
### シングルトン設計
- アプリケーション全体で単一の設定インスタンス
- スレッドセーフな設定アクセス
- 遅延初期化による軽量インポート
### 設定永続化
- JSON形式での設定ファイル管理
- デバウンス機能付き自動保存
- 設定変更の即座反映
### 動的設定管理
- 実行時設定変更対応
- デバイス情報の動的取得
- 言語・エンジン設定の自動更新
### 型安全な設定アクセス
- プロパティベースのアクセス制御
- 読み取り専用・読み書き可能設定の分離
- デコレータによるシリアライゼーション管理
## クラス構造
### Config クラス
```python
class Config:
_instance = None # シングルトンインスタンス
_config_data: Dict[str, Any] # 設定データ
_timer: Optional[threading.Timer] # デバウンスタイマー
_debounce_time: int = 2 # デバウンス時間(秒)
```
## 設定カテゴリ
### 読み取り専用設定
```python
@property
def VERSION(self) -> str
```
- アプリケーションバージョン
```python
@property
def PATH_LOCAL(self) -> str
```
- ローカルディレクトリパス
```python
@property
def PATH_CONFIG(self) -> str
```
- 設定ファイルパス
### UI・表示設定
```python
@property
def UI_LANGUAGE(self) -> str
```
- UIの表示言語
```python
@property
def TRANSPARENCY(self) -> int
```
- ウィンドウの透明度(0-100)
```python
@property
def UI_SCALING(self) -> int
```
- UIのスケーリング(50-200%)
```python
@property
def FONT_FAMILY(self) -> str
```
- 使用フォントファミリー
### 翻訳設定
```python
@property
def ENABLE_TRANSLATION(self) -> bool
```
- 翻訳機能の有効・無効
```python
@property
def SELECTED_TRANSLATION_ENGINES(self) -> Dict[str, str]
```
- 選択されている翻訳エンジン
```python
@property
def SELECTED_YOUR_LANGUAGES(self) -> Dict[str, Dict[str, Any]]
```
- 送信言語設定
```python
@property
def SELECTED_TARGET_LANGUAGES(self) -> Dict[str, Dict[str, Any]]
```
- 受信言語設定
### 音声認識設定
```python
@property
def ENABLE_TRANSCRIPTION_SEND(self) -> bool
```
- 送信音声認識の有効・無効
```python
@property
def SELECTED_TRANSCRIPTION_ENGINE(self) -> str
```
- 音声認識エンジン
```python
@property
def SELECTED_MIC_DEVICE(self) -> str
```
- 選択されたマイクデバイス
```python
@property
def MIC_THRESHOLD(self) -> int
```
- マイク音声しきい値
```python
@property
def MIC_RECORD_TIMEOUT(self) -> int
```
- マイク録音タイムアウト(秒)
### VR設定
```python
@property
def OVERLAY_SMALL_LOG(self) -> bool
```
- 小型ログオーバーレイの有効・無効
```python
@property
def OVERLAY_SMALL_LOG_SETTINGS(self) -> Dict[str, Any]
```
- 小型オーバーレイの詳細設定
```python
@property
def OVERLAY_LARGE_LOG_SETTINGS(self) -> Dict[str, Any]
```
- 大型オーバーレイの詳細設定
### 通信設定
```python
@property
def OSC_IP_ADDRESS(self) -> str
```
- OSC通信IPアドレス
```python
@property
def OSC_PORT(self) -> int
```
- OSC通信ポート
```python
@property
def WEBSOCKET_HOST(self) -> str
```
- WebSocketサーバーホスト
```python
@property
def WEBSOCKET_PORT(self) -> int
```
- WebSocketサーバーポート
### クリップボード設定
```python
@property
def ENABLE_CLIPBOARD(self) -> bool
```
- クリップボード機能(コピー・ペースト)の有効・無効
### テレメトリ設定
```python
@property
def ENABLE_TELEMETRY(self) -> bool
```
- テレメトリ(Aptabase)の有効・無効
- デフォルト: True(有効)
- ユーザーは設定から任意で無効化可能
### 計算デバイス設定
```python
@property
def SELECTED_TRANSLATION_COMPUTE_DEVICE(self) -> Dict[str, Any]
```
- 翻訳用計算デバイス
```python
@property
def SELECTED_TRANSCRIPTION_COMPUTE_DEVICE(self) -> Dict[str, Any]
```
- 音声認識用計算デバイス
## 主要メソッド
### 設定保存
```python
saveConfig(key: str, value: Any, immediate_save: bool = False) -> None
```
- 設定値の保存(デバウンス付き)
- immediate_save=Trueで即座保存
```python
saveConfigToFile() -> None
```
- 設定ファイルへの直接保存
### 初期化・設定読み込み
```python
init_config() -> None
```
- 設定の初期化
- デフォルト値の設定
```python
load_config() -> None
```
- 設定ファイルからの読み込み
- 存在しない場合はデフォルト設定を作成
## デコレータ機能
### @json_serializable
```python
@json_serializable("setting_name")
@property
def SETTING_NAME(self) -> Any:
```
- 設定のJSONシリアライゼーション対象指定
- 自動的にconfig.jsonに保存される設定を定義
## 使用方法
### 基本的な使い方
```python
from config import config
# 設定値の取得
version = config.VERSION
ui_language = config.UI_LANGUAGE
translation_enabled = config.ENABLE_TRANSLATION
# 設定値の変更
config.UI_LANGUAGE = "ja"
config.TRANSPARENCY = 80
config.MIC_THRESHOLD = 1500
```
### 複雑な設定の変更
```python
# 翻訳エンジンの設定
engines = config.SELECTED_TRANSLATION_ENGINES
engines["1"] = "DeepL"
config.SELECTED_TRANSLATION_ENGINES = engines
# オーバーレイ設定の変更
overlay_settings = config.OVERLAY_SMALL_LOG_SETTINGS
overlay_settings["x_pos"] = 0.5
overlay_settings["opacity"] = 0.8
config.OVERLAY_SMALL_LOG_SETTINGS = overlay_settings
```
### 即座保存
```python
# 重要な設定変更時の即座保存
config.saveConfig("ENABLE_TRANSLATION", True, immediate_save=True)
```
## 設定ファイル形式
設定は`config.json`ファイルにJSON形式で保存されます:
```json
{
"UI_LANGUAGE": "ja",
"TRANSPARENCY": 85,
"UI_SCALING": 100,
"ENABLE_TRANSLATION": true,
"SELECTED_TRANSLATION_ENGINES": {
"1": "DeepL",
"2": "Google",
"3": "CTranslate2"
},
"OVERLAY_SMALL_LOG_SETTINGS": {
"x_pos": 0.0,
"y_pos": -0.4,
"z_pos": 1.0,
"opacity": 1.0,
"ui_scaling": 1.0,
"display_duration": 5,
"fadeout_duration": 1
}
}
```
## デフォルト設定
### UI設定
- UI言語: "en"(英語)
- 透明度: 85%
- UIスケーリング: 100%
- フォント: "Noto Sans JP"
### 翻訳設定
- 翻訳機能: 無効
- デフォルトエンジン: "Google"
- 送信言語: English(US)
- 受信言語: 日本語
### 音声認識設定
- 送信音声認識: 無効
- 受信音声認識: 無効
- 音声認識エンジン: "Google"
- マイクしきい値: 300
### VR設定
- 小型オーバーレイ: 無効
- 大型オーバーレイ: 無効
- オーバーレイ位置: HMD正面
### 通信設定
- OSC IP: "127.0.0.1"
- OSC ポート: 9000
- WebSocket ホスト: "127.0.0.1"
- WebSocket ポート: 8765
### クリップボード設定
- クリップボード機能: 無効
### テレメトリ設定
- テレメトリ: **有効(デフォルト)**
## 依存関係
### 必須依存関係
- `json`: 設定ファイルのシリアライゼーション
- `threading`: デバウンス機能
- `typing`: 型注釈
### オプション依存関係
- `device_manager`: デバイス情報取得
- `torch`: CUDA計算デバイス情報
- 各種モデルモジュール: 言語・エンジン情報
## エラーハンドリング
- 設定ファイル読み込みエラーの適切な処理
- 不正な設定値の検証・補正
- オプション依存関係の欠如に対するフォールバック
- ファイル書き込みエラーの処理
## パフォーマンス特性
### デバウンス機能
- 設定変更から2秒後に自動保存
- 連続する変更の統合
- I/O負荷の軽減
### 遅延初期化
- 重い依存関係の遅延読み込み
- インポート時間の短縮
### メモリ効率
- 設定データのシングルトン管理
- 不要な複製の防止
## 注意事項
- 設定変更は即座にメモリに反映される
- ファイル保存はデバウンス機能により遅延される
- 重要な設定はimmediate_save=Trueを使用
- オプション依存関係の欠如時はデフォルト値を使用
- 不正な設定値は自動的に補正される
- 設定ファイルが破損した場合は新規作成される
## セキュリティ考慮事項
- 設定ファイルの適切な権限管理
- 外部入力値の検証
- APIキー等の機密情報の適切な取り扱い
- パスインジェクション攻撃の防止
## 最近の更新 (2025-10-20)
### LMStudio / Ollama ローカル LLM 設定プロパティ追加
- `LMSTUDIO_URL` / `SELECTABLE_LMSTUDIO_MODEL_LIST` / `SELECTED_LMSTUDIO_MODEL`
- `SELECTABLE_OLLAMA_MODEL_LIST` / `SELECTED_OLLAMA_MODEL`
ローカル推論エンジン接続用 URL と動的モデルリスト取得・選択プロパティを追加。認証は不要で接続テスト後自動でモデルリストを更新。
### モデル選択プロパティ名称統一
Plamo / Gemini / OpenAI の選択モデルを `PLAMO_MODEL` / `GEMINI_MODEL` / `OPENAI_MODEL` から `SELECTED_PLAMO_MODEL` / `SELECTED_GEMINI_MODEL` / `SELECTED_OPENAI_MODEL` へ統一。設定 JSON の保存キーも `SELECTED_*` に変更し UI との整合性を確保。
### CTranslate2 言語マッピング構造変更対応
`translation_lang` 内の CTranslate2 言語辞書が `translation_lang["CTranslate2"][weight_type]["source"|"target"]` へネスト化。`CTRANSLATE2_WEIGHT_TYPE` プロパティがアクセスのキーとなるため、重みタイプ変更時に翻訳エンジン再初期化が必要。
### YAML 言語外部定義導入
`loadTranslationLanguages()` を初期化時に呼び出し、`models/translation/languages/languages.yml` を読み込んで既存マッピングへマージ。失敗時は空辞書フォールバック。動的言語追加がコード改修無しで可能になったため設定初期化の失敗ログ確認が重要。
### OpenAI モデルリスト自動更新
`setOpenAIAuthKey()` 成功後に `SELECTABLE_OPENAI_MODEL_LIST` を取得し未選択の場合は先頭を自動選択。Gemini / Plamo / LMStudio / Ollama も同様に認証/接続確立時にリスト更新と未選択モデル補完。
### フォント設定のパッケージ対応
`overlay_image.py` で PyInstaller ビルド環境(`_internal/fonts/`)検出を追加。開発環境とバンドル後でフォント探索パスが異なるため、`FONT_FAMILY` はファイル名基準のまま変更無し。
### 依存関係追加
- `PyYAML`: 言語マッピング YAML 読み込み
- `google-genai`: Gemini 連携
- `grpcio`: OpenAI 連携(ストリーミング等)
### VRAM エラー時の自動フォールバック
翻訳有効化や翻訳実行時に VRAM 不足検出で `ENABLE_TRANSLATION` を False にし CTranslate2 へ強制切替。設定値は保持されるが UI には無効化状態を通知。再度有効化要求時に重いモデル再初期化を試行。
### テスト関連
包括的翻訳ペアテストにより `SELECTED_*` モデルと言語マッピング組合せを大量実行。設定値の変更頻度増加に伴いデバウンス 2 秒でファイル書き込み負荷を抑制。
### 影響まとめ
| 項目 | 内容 |
|------|------|
| ローカルLLM | LMStudio / Ollama の導入でオフライン翻訳拡張 |
| プロパティ統一 | SELECTED_* 命名で一貫性・ドキュメント整備性向上 |
| 言語ネスト化 | CTranslate2 重みタイプ切替処理の再初期化必要性増加 |
| YAML外部化 | 言語追加が設定初期化のみで反映可能 |
| モデルリスト自動更新 | 認証後の選択ミス防止・初回 UX 改善 |
| フォント探索 | PyInstaller ビルド後でも同一コードで動作 |
| 依存追加 | 新機能対応で環境構築ステップ増加 |
| VRAM検知 | 安全停止と軽量エンジン切替で安定性向上 |
| テスト増強 | 大量ペア検証で言語/モデル設定の信頼性向上 |
+503
View File
@@ -0,0 +1,503 @@
# controller.py - VRCTコントローラーモジュール
## 概要
VRCTアプリケーションのビジネスロジックを制御するコントローラークラスです。UI層とモデル層の間に位置し、ユーザーの入力を適切な処理に変換し、結果を UI に返す役割を担います。全ての機能制御、設定管理、状態管理を一元的に行います。
## 最近の更新 (2026-01-03)
### 起動高速化・非同期化
- 初期化時間を約12.6s→8.9sに短縮(環境計測値)
- AI Models Check を2並列化(CTranslate2/Whisper)し、結果を `_ctranslate2_available_cache` / `_whisper_available_cache` に保存
- 翻訳エンジン判定を並列化(ThreadPoolExecutor, max_workers=4)し、LMStudio/Ollamaはバックグラウンド判定に変更
- ソフトウェア更新チェックをバックグラウンド化
- OSC受信初期化をバックグラウンド化し、OSCQueryサービス生成は接続成功まで継続リトライ
- 翻訳/音声認識エンジンのセット処理で重みチェックキャッシュを再利用し再計測を排除(0.98s/0.52s→0.00s)
### 影響
| 項目 | 内容 |
|------|------|
| 起動時間 | 約3.7s短縮(12.6s→8.9s) |
| 並列・非同期化 | 翻訳・音声認識エンジン判定を並列/バックグラウンド化 |
| 安定性 | OSCQuery起動のリトライ上限でブロッキングを抑制 |
| 再利用性 | 重みチェック結果をキャッシュし重複I/Oを削減 |
## 最近の更新 (2025-10-20)
### 新規ローカルLLM翻訳エンジン統合
- LMStudio / Ollama への接続確認エンドポイント追加: `/run/lmstudio_connection`, `/run/ollama_connection`
- LMStudio URL 設定: `/get|set/data/lmstudio_url`
- モデルリスト取得と選択: `/get/data/*_model_list`, `/get|set/data/*_model` (lmstudio / ollama / plamo / gemini / openai)
- 認証・接続成功時に `selectable_*_model_list` / `selected_*_model` を run 経由で通知 (例: `/run/selectable_lmstudio_model_list`, `/run/selected_lmstudio_model`)
### モデルリスト自動更新フロー
- Plamo / Gemini / OpenAI 認証後に動的に最新モデルリストを取得し未選択時は先頭モデルへ自動設定
- LMStudio / Ollama は接続成功時にローカル列挙したモデルを即座に選択候補へ反映
### VRAMエラー検出と自動フォールバック
- 翻訳処理中の `CUDA out of memory` / `CUBLAS_STATUS_ALLOC_FAILED` などを検出し `/run/error_translation_*_vram_overflow` で通知
- 自動で翻訳機能を無効化し CTranslate2 へフォールバック、再度有効化試行時も VRAM エラー検出で安全に解除
### CTranslate2 ウェイト / Whisper ウェイト管理
- ダウンロード進捗/完了/エラー用 run エンドポイント: `download_progress_ctranslate2_weight`, `downloaded_ctranslate2_weight`, `error_ctranslate2_weight` / Whisper も同様
- `SELECTABLE_CTRANSLATE2_WEIGHT_TYPE_DICT` / `SELECTABLE_WHISPER_WEIGHT_TYPE_DICT` の値更新を完了時に反映
### 命名・構造整理
- 翻訳エンジン選択はタブ別 `SELECTED_TRANSLATION_ENGINES[tab_no]` を使用
- 言語選択構造: `SELECTED_YOUR_LANGUAGES[tab_no]`, `SELECTED_TARGET_LANGUAGES[tab_no]` のネストを前提にエンジン適合性判定
- CTranslate2 の言語マッピングはウェイト種別 (`CTRANSLATE2_WEIGHT_TYPE`) でネストされた構造に対応
### 言語マッピング外部化
- `getListLanguageAndCountry()` が YAML からロード済み `translation_lang` / `transcription_lang` を統合して互換言語のみ抽出
### APIキー検証の厳格化
- Plamo API: キー長判定を「==72」から「>=72」へ変更し 72 文字以上を許容
- Gemini API: 最小キー長を 20 → 39 へ引き上げ
- OpenAI API: "sk-" 接頭辞必須かつ長さ 164 文字以上の厳格化、エラーメッセージを「無効」に統一
### 翻訳モデル選択時の適用確実化
- OpenAI / Plamo / Gemini / LMStudio / Ollama でモデル設定後に `setTranslatorXModel()` と `updateTranslatorXClient()` を必ず呼び出してクライアント状態を確実反映
- デフォルトモデル自動選択時もモデル適用を即座実行
### デバイス自動選択改善
- マイク/スピーカー自動選択機能で更新前後に適切な停止/再開コールバックをチェーン設定 (energy チェック再起動含む)
### 影響
| 項目 | 内容 |
|------|------|
| 翻訳柔軟性 | ローカルLLM (LMStudio/Ollama) によりネットワーク不要運用が可能 |
| 回復性 | VRAMエラー時自動フォールバックで異常終了を防止 |
| 拡張性 | モデルリスト自動更新により新モデル追加時の手動変更不要化 |
| 一貫性 | 統一された SELECTED_/SELECTABLE_ 命名とタブ別管理で UI 連携が簡易化 |
| 可読性 | 外部 YAML 言語定義によりコード側のハードコード削減 |
## 主要機能
### 機能制御
- 翻訳機能の有効化・無効化
- 音声認識機能の制御
- VRオーバーレイの管理
- WebSocketサーバーの制御
### 設定管理
- アプリケーション設定の取得・更新
- デバイス設定の管理
- 言語・エンジン設定の制御
### 状態管理
- システム状態の監視
- エラー状態の管理
- 初期化プロセスの制御
### 通信制御
- OSC通信の管理
- WebSocket通信の制御
- 外部アプリケーション連携
## クラス構造
### Controller クラス
```python
class Controller:
def __init__(self) -> None
```
中核となるコントローラークラス
### 内部ヘルパークラス
#### DownloadCTranslate2 クラス
```python
class DownloadCTranslate2:
def progressBar(self, progress) -> None
def downloaded(self) -> None
```
- 翻訳モデルのダウンロード進捗管理
#### DownloadWhisper クラス
```python
class DownloadWhisper:
def progressBar(self, progress) -> None
def downloaded(self) -> None
```
- 音声認識モデルのダウンロード進捗管理
## 主要メソッド
### 初期化・設定
```python
init() -> None
```
- コントローラーの初期化
- 各コンポーネントの起動
- 初期設定の適用
```python
setInitMapping(init_mapping: dict) -> None
setRunMapping(run_mapping: dict) -> None
setRun(run: Callable) -> None
```
- エンドポイント・コールバック設定
### 翻訳機能制御
```python
setEnableTranslation(data) -> dict
setDisableTranslation(data) -> dict
```
- 翻訳機能の有効化・無効化
```python
setSelectedTranslationEngines(data) -> dict
getSelectedTranslationEngines(data) -> dict
```
- 翻訳エンジンの選択・取得
```python
setSelectedYourLanguages(data) -> dict
setSelectedTargetLanguages(data) -> dict
```
- 送信・受信言語の設定
```python
sendMessageBox(data) -> dict
```
- メッセージの翻訳・送信処理
### 音声認識機能制御
```python
setEnableTranscriptionSend(data) -> dict
setEnableTranscriptionReceive(data) -> dict
```
- 音声認識機能の有効化
```python
setSelectedTranscriptionEngine(data) -> dict
getSelectedTranscriptionEngine(data) -> dict
```
- 音声認識エンジンの選択・取得
```python
setSelectedMicDevice(data) -> dict
setSelectedSpeakerDevice(data) -> dict
```
- 音声デバイスの選択
```python
setMicThreshold(data) -> dict
setSpeakerThreshold(data) -> dict
```
- 音声しきい値の設定
### VRオーバーレイ制御
```python
setEnableOverlaySmallLog(data) -> dict
setEnableOverlayLargeLog(data) -> dict
```
- VRオーバーレイの有効化
```python
setOverlaySmallLogSettings(data) -> dict
setOverlayLargeLogSettings(data) -> dict
```
- オーバーレイ設定の更新
### WebSocket制御
```python
setEnableWebSocketServer(data) -> dict
setDisableWebSocketServer(data) -> dict
```
- WebSocketサーバーの制御
### クリップボード制御
```python
getClipboard() -> dict
setEnableClipboard() -> dict
setDisableClipboard() -> dict
```
- クリップボード機能(コピー・ペースト)の状態取得・設定変更
- `config.ENABLE_CLIPBOARD` フラグを変更(True/False)
- 取得結果は `{"status": 200, "result": bool}`
- **注意**: `model.clipboard.enable()/disable()` は呼び出されません
### テレメトリ制御
```python
getTelemetry() -> dict
setEnableTelemetry() -> dict
setDisableTelemetry() -> dict
```
- テレメトリ(Aptabase)の有効化・無効化・状態取得
- 有効化時は `telemetryInit()` を呼び出し
- 無効化時は `telemetryShutdown()` を呼び出し
### WebSocket接続設定
```python
setWebSocketHost(data) -> dict
setWebSocketPort(data) -> dict
```
- WebSocketホスト・ポートの設定
### システム管理
```python
updateSoftware(data) -> dict
updateCudaSoftware(data) -> dict
```
- ソフトウェアアップデート
```python
downloadCtranslate2Weight(data) -> dict
downloadWhisperWeight(data) -> dict
```
- AIモデルのダウンロード
```python
feedWatchdog(data) -> dict
```
- ウォッチドッグの生存シグナル送信
## 使用方法
### 基本的な使い方
```python
from controller import Controller
# コントローラーの初期化
controller = Controller()
controller.init()
# 翻訳機能の有効化
result = controller.setEnableTranslation(None)
print(f"翻訳機能: {result}")
# メッセージ送信
message_data = {"id": "123", "message": "Hello World"}
result = controller.sendMessageBox(message_data)
```
### エンドポイント設定
```python
# マッピング設定
mapping = {
"/set/enable/translation": controller.setEnableTranslation,
"/get/data/version": controller.getVersion,
}
# 実行関数の設定
def run_callback(status, endpoint, result):
print(f"Status: {status}, Endpoint: {endpoint}, Result: {result}")
controller.setRun(run_callback)
```
### 音声認識の設定
```python
# マイクデバイスの選択
host_data = "DirectSound"
result = controller.setSelectedMicHost(host_data)
device_data = "マイク (USB Audio Device)"
result = controller.setSelectedMicDevice(device_data)
# 音声認識の開始
result = controller.setEnableTranscriptionSend(None)
```
## レスポンス形式
全てのメソッドは統一されたレスポンス形式を返します:
```python
{
"status": int, # HTTPステータスコード(200, 400, 500等)
"result": any # 処理結果(成功時)または エラーメッセージ(失敗時)
}
```
### 成功レスポンス例
```python
{
"status": 200,
"result": "翻訳機能が有効化されました"
}
```
### エラーレスポンス例
```python
{
"status": 400,
"result": "Invalid device selection"
}
```
## 詳細状態管理
### システム状態
- 各機能の有効・無効状態
- デバイスの接続状態
- ネットワーク接続状態
### エラー状態
- デバイスエラー
- 翻訳エンジンエラー
- VRAMオーバーフローエラー
### 初期化状態
- 段階的な初期化プロセス
- 依存関係の解決状態
## イベント処理
### 音声認識イベント
```python
micMessage(result: dict) -> None
```
- マイク音声認識結果の処理
- 翻訳・フィルタリング・送信
```python
speakerMessage(result: dict) -> None
```
- スピーカー音声認識結果の処理
### ダウンロードイベント
- 進捗通知
- 完了通知
- エラー通知
### デバイス変更イベント
- マイク・スピーカーの選択変更
- 計算デバイスの変更
## 依存関係
### 直接依存
- `config`: 設定管理
- `model`: コアモデル機能
- `device_manager`: デバイス管理
- `utils`: ユーティリティ機能
### 間接依存
- 各種モデルモジュール(翻訳、音声認識等)
- VRオーバーレイモジュール
- 通信モジュール
## エラーハンドリング
### エラー構造
- すべて `VRCTError` で生成し、ステータス・コード・メッセージ・data を統一
- `create_error_response()` / `create_exception_error_response()` を使用し、`self.run()` へそのまま渡す
- 代表コード: デバイス系 (`DEVICE_NO_MIC` / `DEVICE_NO_SPEAKER`)、VRAM系 (`TRANSLATION_VRAM_*`)、認証系 (`AUTH_*`)、モデル不正 (`MODEL_*`)、バリデーション系 (`VALIDATION_*`)、接続系 (`CONNECTION_LMSTUDIO_FAILED` など)
### VRAM不足エラー
- 翻訳処理中に VRAM 例外を検出し `/run/error_translation_*_vram_overflow` で通知
- 翻訳機能を自動で無効化し、`TRANSLATION_DISABLED_VRAM` を通知
- マイク/スピーカー/チャット/有効化時の各パスで専用コードを返却
### デバイスエラー
- マイク・スピーカー未検出時に `DEVICE_NO_MIC` / `DEVICE_NO_SPEAKER`
- エネルギーしきい値/タイムアウト等のバリデーションに `VALIDATION_*` を使用
### 認証・モデルエラー
- DeepL/Plamo/Gemini/OpenAI/Groq/OpenRouter の認証失敗やキー長不正を `AUTH_*` で通知
- モデル未選択/不正時は `MODEL_*` で通知し、選択リストを再送
### 接続エラー
- LMStudio/Ollama 接続失敗を `CONNECTION_*` で通知し、翻訳エンジンリストを更新
### 設定エラー
- IP アドレスやしきい値などの不正値を `VALIDATION_*` で統一し、リクエスト値を data に格納
## パフォーマンス考慮事項
### 遅延初期化
- 必要な時点での機能初期化
- メモリ使用量の最適化
### 非同期処理
- バックグラウンドでの重い処理
- UI の応答性維持
### キャッシュ機能
- 設定値のキャッシュ
- 翻訳結果のキャッシュ
## 注意事項
- すべてのメソッドは例外安全である
- 設定変更は即座に config に反映される
- 重い処理は別スレッドで実行される
- VR機能は適切な環境でのみ動作する
- ネットワーク機能はオフライン時に制限される
## セキュリティ考慮事項
- 外部入力の適切な検証
- APIキーの安全な管理
- ファイルアクセスの制限
- ネットワーク通信の暗号化(該当する場合)
+360
View File
@@ -0,0 +1,360 @@
# mainloop.py - VRCTメインループモジュール
## 概要
VRCTアプリケーションのメインイベントループを管理するモジュールです。標準入力からのJSONリクエストを処理し、適切なコントローラーメソッドを呼び出してレスポンスを返す、アプリケーションの中枢的な役割を担います。
## 最近の更新 (2025-10-20)
### 新規エンドポイントと run_mapping 拡張
- VRAM 関連エラー通知エンドポイント追加: `/run/error_translation_chat_vram_overflow` など 5 種類 (翻訳/音声認識送受信別)
- ローカル LLM (LMStudio/Ollama) モデルリスト通知: `/run/selectable_lmstudio_model_list`, `/run/selectable_ollama_model_list` と選択モデル `/run/selected_*_model`
- 従来の Plamo/Gemini/OpenAI モデル取得通知と形式統一
- LMStudio/Ollama 接続確認エンドポイント: `/get/data/lmstudio_connection`, `/get/data/ollama_connection` を `/run/lmstudio_connection`, `/run/ollama_connection` に移動して非同期通知統一
- 文字変換エンドポイント追加: `/set/data/convert_message_to_romaji`, `/set/data/convert_message_to_hiragana`, `/set/enable/convert_message_to_romaji`, `/set/enable/convert_message_to_hiragana`, `/set/disable/convert_message_to_romaji`, `/set/disable/convert_message_to_hiragana` で音訳機能制御
### エンドポイントロックキー正規化
- `/set/enable/*` `/set/disable/*` の競合を `/lock/set/<name>` に正規化し排他制御強化
- ロック取得失敗時は再キュー投入し軽量リトライでデッドロック防止
### 並列ワーカー処理の安定化
- ハンドラ処理後に短い `sleep(0.2)` により大量高速連続要求時のスレッド飢餓を緩和
- 423 (Locked) ステータス時に指数的ではなく固定短期リトライ採用で応答時間予測性向上
### VRAM エラーフォールバック連携
- Controller が VRAM 検出し翻訳 OFF / CTranslate2 フォールバック後、run_mapping 経由で UI へ状態反映
- ハンドラはエラー時でもスレッド継続し `Internal error` を 500 応答で返しつつログ出力
### モデルリスト動的更新通知
- 認証・接続成功後に対象モデルリスト/選択モデルを run で逐次通知 (Plamo/Gemini/OpenAI/LMStudio/Ollama)
### 影響
| 項目 | 内容 |
|------|------|
| 安定性 | 排他制御と再キュー投入で競合時の落ち込み回避 |
| 可観測性 | VRAM/ダウンロード進捗/モデル更新イベントを run 経由で即時通知 |
| 拡張性 | 新規ローカル LLM エンジン追加に伴う汎用モデル通知フォーマット統一 |
| 応答予測性 | 固定リトライ戦略で待ち時間が読みやすい |
| フォールバック | VRAM エラー時の自動翻訳停止と CTranslate2 への切替連携 |
## 主要機能
### リクエスト処理システム
- JSON形式の標準入力からのリクエスト受信
- エンドポイントベースのルーティング
- 非同期・並列処理対応
### エンドポイント管理
- RESTライクなエンドポイント構造
- 機能別のエンドポイント分類
- 排他制御によるスレッドセーフティ
### 初期化システム
- アプリケーション設定の初期化
- コンポーネント間の依存関係解決
- 段階的な機能有効化
## クラス構造
### Main クラス
```python
class Main:
def __init__(self, controller_instance: Controller, mapping_data: dict, worker_count: int = 3)
```
- メインループの制御
- ワーカースレッドプール管理
- エンドポイント排他制御
## エンドポイント分類
### 機能制御系
```text
/set/enable/* - 各機能の有効化
/set/disable/* - 各機能の無効化
```
### データ操作系
```text
/get/data/* - 設定データの取得
/set/data/* - 設定データの更新
/delete/data/* - データの削除
```
### 実行系
```text
/run/* - 各種処理の実行
```
## 主要エンドポイント
### 翻訳機能
- `/set/enable/translation`: 翻訳機能の有効化
- `/set/disable/translation`: 翻訳機能の無効化
- `/set/data/selected_translation_engines`: 翻訳エンジンの選択
- `/run/send_message_box`: メッセージ送信
### 音声認識機能
- `/set/enable/transcription_send`: 送信音声認識の有効化
- `/set/enable/transcription_receive`: 受信音声認識の有効化
- `/set/data/selected_transcription_engine`: 音声認識エンジン選択
### VR機能
- `/set/data/overlay_small_log_settings`: 小型オーバーレイ設定
- `/set/data/overlay_large_log_settings`: 大型オーバーレイ設定
### WebSocket機能
- `/set/enable/websocket_server`: WebSocketサーバー有効化
- `/set/data/websocket_host`: サーバーホスト設定
- `/set/data/websocket_port`: サーバーポート設定
### クリップボード機能
- `/get/data/clipboard`: クリップボード機能の状態取得(`config.ENABLE_CLIPBOARD` の値)
- `/set/enable/clipboard`: `config.ENABLE_CLIPBOARD` を True に設定
- `/set/disable/clipboard`: `config.ENABLE_CLIPBOARD` を False に設定
### テレメトリ機能
- `/get/data/telemetry`: テレメトリの状態取得
- `/set/enable/telemetry`: テレメトリの有効化(Aptabase初期化)
- `/set/disable/telemetry`: テレメトリの無効化(シャットダウン)
### システム管理
- `/run/update_software`: ソフトウェアアップデート
- `/run/download_ctranslate2_weight`: 翻訳モデルダウンロード
- `/run/download_whisper_weight`: 音声認識モデルダウンロード
## 主要メソッド
### リクエスト処理
```python
receiver() -> None
```
- 標準入力からのJSONリクエスト受信
- パースエラーの適切な処理
```python
handleRequest(endpoint: str, data: Any = None) -> tuple
```
- エンドポイント処理の実行
- ステータスコードと結果の返却
```python
handler() -> None
```
- ワーカースレッドのメイン処理
- キューからのリクエスト取得・処理
### スレッド管理
```python
startReceiver() -> None
```
- レシーバースレッドの起動
```python
startHandler() -> None
```
- ハンドラースレッドプールの起動
```python
start() -> None
```
- 全スレッドの起動
```python
stop(wait: float = 2.0) -> None
```
- 全スレッドの安全な停止
## 使用方法
### 基本的な使い方
```python
from mainloop import main_instance
# メインループの開始
main_instance.start()
# ウォッチドッグコールバックの設定
main_instance.controller.setWatchdogCallback(main_instance.stop)
# コントローラーの初期化
main_instance.controller.init()
```
### 直接リクエスト処理
```python
# エンドポイントの直接呼び出し
result, status = main_instance.handleRequest("/get/data/version", None)
print(f"バージョン: {result}")
# 翻訳機能の有効化
result, status = main_instance.handleRequest("/set/enable/translation", None)
```
### 標準入力からの処理
```json
{
"endpoint": "/run/send_message_box",
"data": "eyJpZCI6ICIxMjMiLCAibWVzc2FnZSI6ICJIZWxsbyBXb3JsZCJ9"
}
```
## リクエスト形式
### 入力形式
```json
{
"endpoint": "string", // 必須:処理対象のエンドポイント
"data": "string|null" // オプション:Base64エンコード済みデータ
}
```
### 出力形式
```json
{
"status": 200, // HTTPステータスコード
"endpoint": "string", // 処理されたエンドポイント
"result": "any" // 処理結果
}
```
## ステータスコード
- `200`: 成功
- `400`: 不正なリクエスト
- `404`: 存在しないエンドポイント
- `423`: ロック中(機能が無効化されている)
- `500`: 内部エラー
## 排他制御
### ロック機能
- enable/disableペアは同一ロックキーを共有
- 同一機能の同時実行を防止
- デッドロックを回避する設計
### ロックキー正規化
```python
/set/enable/translation -> /lock/set/translation
/set/disable/translation -> /lock/set/translation
```
## 初期化プロセス
### 段階的初期化
1. コントローラーの初期化
2. デバイスマネージャーの初期化
3. モデルの初期化
4. 各機能の段階的有効化
### 初期化mapping
- `/get/data/*`エンドポイントから初期化設定を自動抽出
- システム起動時の設定復元
## ログ機能
### プロセスログ
- 全リクエスト・レスポンスの記録
- JSON形式での構造化ログ
### エラーログ
- 例外の詳細記録
- スタックトレースの保存
## 依存関係
### 直接依存
- `controller`: ビジネスロジック制御
- `utils`: ユーティリティ機能(ログ、エンコード等)
### 間接依存
- `config`: 設定管理
- `model`: コアモデル機能
- `device_manager`: デバイス管理
## 設定項目
### ワーカー数
```python
DEFAULT_WORKER_COUNT = 3 # 並列処理スレッド数
```
### タイムアウト
- キュー待機タイムアウト: 0.5秒
- スレッド停止待機: 2.0秒
- 処理安定化待機: 0.2秒
## エラーハンドリング
- JSONパースエラーの適切な処理
- エンドポイント実行エラーのキャッチ
- スレッドセーフなエラーログ記録
- グレースフルシャットダウン
## パフォーマンス特性
### スループット
- 複数ワーカーによる並列処理
- ノンブロッキングI/O
### レイテンシ
- キューイング遅延の最小化
- 排他制御による一時的な遅延あり
### メモリ使用量
- リクエストキューのサイズ制限なし(要注意)
- スレッドプールによる固定オーバーヘッド
## 注意事項
- 標準入力をブロッキングで読み取るため、パイプ経由での使用を想定
- エンドポイント名の大文字小文字は区別される
- Base64データは自動的にデコードされる
- 長時間のブロッキング処理は他のリクエストに影響する可能性
+416
View File
@@ -0,0 +1,416 @@
# model.py - VRCTコアモデルクラス
## 概要
VRCTアプリケーションの中核となるModelクラスを定義するモジュールです。音声認識、翻訳、VRオーバーレイ、OSC通信、WebSocketサーバーなどの主要機能を統合管理し、システム全体の動作を制御します。
## 最近の更新 (2026-01-11)
### クリップボード機能
- `clipboard` インスタンスを Model 内に保持
- `setCopyToClipboard(text: str) -> bool`: 翻訳結果をクリップボードにコピー
- `setPasteFromClipboard() -> bool`: Ctrl+V でペースト実行(VRChat ウィンドウ自動フォーカス)
- OpenVR による VRChat アプリ名の自動検出
### テレメトリ機能
- `telemetryInit(enabled: bool, app_version: str)`: Aptabase を用いたテレメトリ初期化
- `telemetryShutdown()`: テレメトリのシャットダウン(app_closed イベント送信)
- `telemetryTouchActivity()`: ユーザーアクティビティの記録
- `telemetry.*()`: イベント送信メソッド群
- デフォルト有効、ユーザー制御可能な設計
### その他の更新
## 最近の更新 (2025-10-20)
### VRAMエラー検出とフォールバック
- `detectVRAMError()` を追加し CUDA メモリ関連メッセージ/独自例外 `VRAM_OUT_OF_MEMORY` を判別
- 翻訳/音声認識実行中に VRAM エラー検出時、Controller 側で翻訳機能を無効化し CTranslate2 へフォールバックする運用を支援
- エラー詳細文字列を UI へ通知するためのメッセージ抽出を標準化
### CTranslate2 言語マッピングネスト対応
- `getListLanguageAndCountry()` / `findTranslationEngines()` が `translation_lang['CTranslate2'][CTRANSLATE2_WEIGHT_TYPE]['source']` を参照するネスト構造へ更新
- ウェイト種別切替時に対応言語集合が動的に変化しエンジン再判定をトリガー
### ローカル LLM 翻訳エンジン統合
- LMStudio / Ollama 用クライアント初期化・モデルリスト取得メソッド追加: `authenticationTranslatorLMStudio()`, `getTranslatorLMStudioModelList()`, `setTranslatorLMStudioModel()`, `updateTranslatorLMStudioClient()` など
- Ollama も同様のインターフェースで統一 (`getTranslatorOllamaModelList`, `setTranslatorOllamaModel`, `updateTranslatorOllamaClient`)
- Plamo / Gemini / OpenAI と同一フォーマットでモデル選択ロジックを実装し Controller からの呼び出しを簡素化
### トークナイザ・リソース取得安定化
- CTranslate2 トークナイザダウンロード処理を `downloadCTranslate2ModelTokenizer()` で明示化し PyInstaller パス周りの不整合回避
- フォントパス探索は OverlayImage 側へ委譲 (`OverlayImage(config.PATH_LOCAL)`) し Model は生成と更新呼び出しのみ保持
### 翻訳失敗時のフェールセーフ再試行
- `getTranslate()` 内で翻訳失敗(非文字列)時に CTranslate2 をリトライループして安定した結果を返却
- 成功判定フラグを返却し上位層でエンジン制限エラー検出/フォールバックを容易化
### キーワードフィルタ再初期化改善
- `resetKeywordProcessor()` でインスタンス再生成し `addKeywords()` により設定変更後のフィルタ更新即時反映
### WebSocket サーバー管理強化
- 非同期サーバー起動を `asyncio.run` ラッパースレッドで安定化
- ループフラグ `websocket_server_loop` と状態フラグ `websocket_server_alive` を追加し安全な停止処理と存活確認を標準化
### 影響
| 項目 | 内容 |
|------|------|
| 安定性 | VRAM 検出とフェールセーフ再試行で異常終了回避 |
| 拡張性 | ローカル LLM 統合によりネットワーク不要環境対応 |
| 柔軟性 | CTranslate2 ウェイト種別に応じた言語集合動的切替 |
| 保守性 | トークナイザ/フォント取得責務分離で可読性向上 |
| 観測性 | エラー詳細標準化により UI/ログでの診断容易 |
## 主要機能
### シングルトンパターン
- アプリケーション全体で単一のModelインスタンスを保証
- 遅延初期化による軽量なインポート
### 音声認識機能
- マイク音声のリアルタイム文字起こし
- スピーカー出力の音声認識
- エネルギーレベル監視
- 複数言語対応
### 翻訳機能
- 複数の翻訳エンジン対応(DeepL、Google、CTranslate2等)
- 言語自動検出
- バッチ翻訳処理
### VRオーバーレイ
- OpenVR統合
- 小型・大型ログオーバーレイ
- 動的配置・透明度制御
### OSC通信
- VRChatとのOSC通信
- タイピング状態の同期
- ミュート状態の監視
### WebSocketサーバー
- 外部アプリケーションとの通信
- リアルタイムメッセージ配信
## クラス構造
### threadFnc クラス
```python
class threadFnc(Thread):
def __init__(self, fnc, end_fnc=None, daemon: bool = True, *args, **kwargs)
```
- 関数を繰り返し実行するスレッドラッパー
- 一時停止・再開機能
- エラー保護機能
### Model クラス
```python
class Model:
def __new__(cls) # シングルトンパターン
def init(self) # 重い初期化処理
def ensure_initialized(self) # 遅延初期化
```
## 主要メソッド
### 初期化・管理
```python
init() -> None
```
- 全コンポーネントの初期化
- 重い処理のため明示的に呼び出し
```python
ensure_initialized() -> None
```
- 必要時の自動初期化
- 安全な遅延初期化
### 翻訳機能メソッド
```python
getInputTranslate(message, source_language=None) -> Tuple[List[str], List[bool]]
```
- 入力メッセージの多言語翻訳
- 成功フラグも同時に返却
```python
getOutputTranslate(message, source_language=None) -> Tuple[List[str], List[bool]]
```
- 出力メッセージの翻訳(逆方向)
```python
authenticationTranslatorDeepLAuthKey(auth_key) -> bool
```
- DeepL APIキーの認証
### 音声認識機能メソッド
```python
startMicTranscript(fnc: Callable) -> None
```
- マイク音声認識の開始
- コールバック関数で結果を通知
```python
startSpeakerTranscript(fnc: Callable) -> None
```
- スピーカー音声認識の開始
```python
pauseMicTranscript() -> None
resumeMicTranscript() -> None
```
- 音声認識の一時停止・再開
```python
startCheckMicEnergy(fnc: Callable) -> None
startCheckSpeakerEnergy(fnc: Callable) -> None
```
- 音声エネルギーレベルの監視
### VRオーバーレイ機能
```python
createOverlayImageSmallLog(message, your_language, translation, target_language) -> Image
```
- 小型ログオーバーレイ画像の生成
```python
createOverlayImageLargeLog(message_type, message, your_language, translation, target_language) -> Image
```
- 大型ログオーバーレイ画像の生成
```python
updateOverlaySmallLogSettings() -> None
updateOverlayLargeLogSettings() -> None
```
- オーバーレイ設定の更新
### OSC通信機能
```python
oscSendMessage(message: str) -> None
```
- VRChatへのメッセージ送信
```python
oscStartSendTyping() -> None
oscStopSendTyping() -> None
```
- タイピング状態の通知
```python
setMuteSelfStatus() -> None
```
- VRChatミュート状態の取得
### WebSocket機能
```python
startWebSocketServer(host: str, port: int) -> None
```
- WebSocketサーバーの起動
```python
websocketSendMessage(message_dict: dict) -> bool
```
- 全クライアントへのメッセージ送信
```python
checkWebSocketServerAlive() -> bool
```
- サーバー稼働状態の確認
### ファイルダウンロード機能
```python
downloadCTranslate2ModelWeight(weight_type, callback=None, end_callback=None)
```
- 翻訳モデルのダウンロード
```python
downloadWhisperModelWeight(weight_type, callback=None, end_callback=None)
```
- 音声認識モデルのダウンロード
### ウォッチドッグ機能
```python
startWatchdog() -> None
feedWatchdog() -> None
setWatchdogCallback(callback: Callable) -> None
```
- システム監視とタイムアウト処理
## 使用方法
### 基本的な使い方
```python
from model import model
# 明示的な初期化(推奨)
model.init()
# または自動初期化
model.ensure_initialized()
# 翻訳機能の使用
translations, success_flags = model.getInputTranslate("Hello World")
# 音声認識の開始
def on_transcript_result(result):
print(f"認識結果: {result}")
model.startMicTranscript(on_transcript_result)
```
### VRオーバーレイの使用
```python
# オーバーレイの開始
model.startOverlay()
# 画像の作成と更新
img = model.createOverlayImageSmallLog(
message="Hello",
your_language="English",
translation=["こんにちは"],
target_language={"1": {"language": "Japanese", "enable": True}}
)
model.updateOverlaySmallLog(img)
```
### WebSocketサーバーの使用
```python
# サーバー起動
model.startWebSocketServer("127.0.0.1", 8765)
# メッセージ送信
message = {"type": "translation", "text": "Hello", "translation": "こんにちは"}
success = model.websocketSendMessage(message)
```
### クリップボード機能の使用
```python
# テキストをクリップボードにコピー
text = "翻訳結果"
success = model.setCopyToClipboard(text)
# ペースト実行(VRChat ウィンドウに自動フォーカス)
success = model.setPasteFromClipboard()
```
### テレメトリの初期化・シャットダウン
```python
# テレメトリ初期化(アプリ起動時)
model.telemetryInit(enabled=config.ENABLE_TELEMETRY, app_version=config.VERSION)
# テレメトリシャットダウン(アプリ終了時)
model.telemetryShutdown()
# アクティビティ記録
model.telemetryTouchActivity()
```
## 依存関係
### 必須モジュール
- `controller`: アプリケーション制御
- `config`: 設定管理
- `device_manager`: デバイス管理
### 音声・翻訳関連
- `models.transcription.*`: 音声認識
- `models.translation.*`: 翻訳機能
- `models.transliteration.*`: 音写変換
### VR・通信関連
- `models.overlay.*`: VRオーバーレイ
- `models.osc.*`: OSC通信
- `models.websocket.*`: WebSocket通信
### ユーティリティ
- `models.watchdog.*`: 監視機能
- `utils`: 共通ユーティリティ
- `flashtext`: キーワードフィルタリング
## 設定依存関係
多くの機能がconfigモジュールの設定に依存:
- 音声認識設定(しきい値、タイムアウト等)
- 翻訳設定(エンジン選択、言語設定等)
- VR設定(オーバーレイ位置、透明度等)
- OSC設定(IPアドレス、ポート等)
## エラーハンドリング
- 初期化エラーの適切な処理
- VRAM不足エラーの検出と対応
- ネットワークエラーの回復機能
- スレッドセーフティの保証
## 注意事項
- 重い初期化処理のため、明示的な初期化を推奨
- OpenVR環境が必要(VRオーバーレイ使用時)
- CUDA環境推奨(高速な音声認識・翻訳)
- WebSocketサーバーは非同期で動作
- 音声デバイスのアクセス権限が必要
## パフォーマンス考慮事項
- 遅延初期化によるメモリ使用量の最適化
- スレッドプールによる並行処理
- モデルの重複読み込み防止
- キューイングによる非同期処理
+602
View File
@@ -0,0 +1,602 @@
# osc.py - OSC通信・OSCQueryプロトコル管理
## 概要
VRChatとの高度なOSC(Open Sound Control)通信を管理する包括的なシステムです。基本的なOSCメッセージ送信に加え、OSCQueryプロトコルによる双方向通信、パラメータ監視、自動サービス発見機能を提供します。
## 主要機能
### OSC通信機能
- VRChatチャットボックスへのメッセージ送信
- タイピング状態の制御
- パラメータ値の動的取得
### OSCQuery対応
- 自動サービス発見・接続
- リアルタイムパラメータ監視
- 双方向エンドポイント公開
### 堅牢性機能
- 防御的プログラミング設計
- 欠損ライブラリの優雅な処理
- 自動エラー復旧機構
## クラス構造
### OSCHandler クラス
```python
class OSCHandler:
def __init__(self, ip_address: str = "127.0.0.1", port: int = 9000) -> None:
self.is_osc_query_enabled: bool
self.osc_ip_address: str
self.osc_port: int
self.udp_client: udp_client.SimpleUDPClient
self.osc_server: Optional[osc_server.ThreadingOSCUDPServer]
self.osc_query_service: Optional[OSCQueryService]
self.browser: Optional[OSCQueryBrowser]
```
OSC通信の中核管理クラス
#### 属性
- **is_osc_query_enabled**: OSCQuery機能の有効性フラグ
- **osc_ip_address**: 送信先IPアドレス
- **osc_port**: UDP通信ポート
- **udp_client**: OSC送信クライアント
- **osc_server**: ローカルOSCサーバー
- **osc_query_service**: OSCQueryサービスインスタンス
- **browser**: OSCQueryブラウザー
## 主要メソッド
### メッセージ送信
```python
def sendMessage(self, message: str = "", notification: bool = True) -> None
```
VRChatチャットボックスにメッセージを送信
#### パラメータ
- **message**: 送信するテキストメッセージ
- **notification**: 通知フラグ(音・表示の有無)
```python
def sendTyping(self, flag: bool = False) -> None
```
タイピング状態をVRChatに送信
#### パラメータ
- **flag**: タイピング中フラグ
### パラメータ監視
```python
def getOSCParameterMuteSelf() -> Optional[bool]
```
VRChatのMuteSelfパラメータ値を取得
#### 戻り値
- **Optional[bool]**: ミュート状態(取得失敗時はNone)
```python
def getOSCParameterValue(self, address: str) -> Any
```
任意のOSCパラメータ値を取得
#### パラメータ
- **address**: OSCアドレス(例:"/avatar/parameters/MuteSelf")
#### 戻り値
- **Any**: パラメータ値(取得失敗時はNone)
### 設定変更
```python
def setOscIpAddress(self, ip_address: str) -> None
```
送信先IPアドレスを変更し、サービスを再初期化
#### パラメータ
- **ip_address**: 新しいIPアドレス
```python
def setOscPort(self, port: int) -> None
```
送信ポートを変更し、サービスを再初期化
#### パラメータ
- **port**: 新しいUDPポート番号
## 使用方法
### 基本的なメッセージ送信
```python
from models.osc.osc import OSCHandler
# OSCハンドラーの初期化
osc = OSCHandler(ip_address="127.0.0.1", port=9000)
# チャットボックスにメッセージを送信
osc.sendMessage("こんにちは、VRChat!", notification=True)
# タイピング状態の制御
osc.sendTyping(True) # タイピング開始
# ... 実際のタイピング処理 ...
osc.sendTyping(False) # タイピング終了
# 再度メッセージ送信
osc.sendMessage("翻訳完了しました", notification=False)
```
### リモートVRChatへの接続
```python
# リモートVRChatインスタンスへの接続
remote_osc = OSCHandler(ip_address="192.168.1.100", port=9000)
# OSCQuery機能は自動的に無効化される
print(f"OSCQuery有効: {remote_osc.getIsOscQueryEnabled()}") # False
# 基本的なメッセージ送信は利用可能
remote_osc.sendMessage("リモートからの翻訳結果", notification=True)
```
### パラメータ監視(ローカル接続時のみ)
```python
# ローカル接続でのパラメータ監視
local_osc = OSCHandler(ip_address="127.0.0.1", port=9000)
if local_osc.getIsOscQueryEnabled():
# MuteSelfパラメータの監視
mute_status = local_osc.getOSCParameterMuteSelf()
if mute_status is not None:
if mute_status:
print("ユーザーはミュート中です")
else:
print("ユーザーはミュート解除中です")
else:
print("MuteSelfパラメータの取得に失敗しました")
# カスタムパラメータの監視
custom_value = local_osc.getOSCParameterValue("/avatar/parameters/CustomParam")
if custom_value is not None:
print(f"カスタムパラメータ値: {custom_value}")
```
### 双方向OSC通信の設定
```python
def handle_mute_change(address, *args):
"""ミュート状態変更のハンドラー"""
print(f"ミュート状態が変更されました: {args}")
def handle_typing_change(address, *args):
"""タイピング状態変更のハンドラー"""
print(f"タイピング状態: {args}")
def handle_chatbox_input(address, *args):
"""チャットボックス入力のハンドラー"""
print(f"チャットボックス入力: {args}")
# OSCパラメータハンドラーの設定
osc_handlers = {
"/avatar/parameters/MuteSelf": handle_mute_change,
"/chatbox/typing": handle_typing_change,
"/chatbox/input": handle_chatbox_input
}
osc = OSCHandler()
osc.setDictFilterAndTarget(osc_handlers)
# OSCサーバー開始(OSCQuery自動公開)
osc.receiveOscParameters()
print("OSC受信サーバーが開始されました")
print("VRChatからのパラメータ変更を監視中...")
# メッセージ送信テスト
import time
time.sleep(2)
osc.sendMessage("双方向通信テスト", notification=True)
# 長時間実行
time.sleep(30)
# クリーンアップ
osc.oscServerStop()
```
### 動的設定変更
```python
# 実行時のIP・ポート変更
osc = OSCHandler(ip_address="127.0.0.1", port=9000)
# 初期設定でローカル接続
osc.sendMessage("ローカル接続テスト")
print("リモート接続に切り替え中...")
osc.setOscIpAddress("192.168.1.150") # 自動的にOSCQueryが無効化
osc.sendMessage("リモート接続テスト")
print("ポート変更...")
osc.setOscPort(9001)
osc.sendMessage("新しいポートでのテスト")
print("ローカル接続に戻る...")
osc.setOscIpAddress("127.0.0.1") # OSCQueryが再度有効化
osc.sendMessage("ローカル接続復帰テスト")
```
## OSCQuery詳細機能
### 自動サービス発見
```python
class VRChatMonitor:
"""VRChatサービス監視クラス"""
def __init__(self):
self.osc = OSCHandler()
self.monitoring = False
def start_monitoring(self):
"""VRChatパラメータの継続監視開始"""
if not self.osc.getIsOscQueryEnabled():
print("OSCQuery機能が無効です(ローカル接続のみサポート)")
return
# OSCハンドラー設定
handlers = {
"/avatar/parameters/MuteSelf": self.on_mute_change,
"/avatar/parameters/Voice": self.on_voice_change,
"/avatar/parameters/Viseme": self.on_viseme_change,
"/avatar/parameters/GestureLeft": self.on_gesture_left,
"/avatar/parameters/GestureRight": self.on_gesture_right
}
self.osc.setDictFilterAndTarget(handlers)
self.osc.receiveOscParameters()
self.monitoring = True
print("VRChatパラメータ監視を開始しました")
def on_mute_change(self, address, *args):
print(f"ミュート状態変更: {args[0] if args else 'Unknown'}")
def on_voice_change(self, address, *args):
print(f"音声レベル: {args[0] if args else 'Unknown'}")
def on_viseme_change(self, address, *args):
print(f"口形変化: {args[0] if args else 'Unknown'}")
def on_gesture_left(self, address, *args):
print(f"左手ジェスチャー: {args[0] if args else 'Unknown'}")
def on_gesture_right(self, address, *args):
print(f"右手ジェスチャー: {args[0] if args else 'Unknown'}")
def stop_monitoring(self):
"""監視停止"""
self.osc.oscServerStop()
self.monitoring = False
print("VRChatパラメータ監視を停止しました")
# 使用例
monitor = VRChatMonitor()
monitor.start_monitoring()
# 監視中に他の処理を実行
time.sleep(60) # 1分間監視
monitor.stop_monitoring()
```
### リアルタイムパラメータ追跡
```python
class ParameterTracker:
"""パラメータ値の追跡・履歴管理"""
def __init__(self, osc_handler):
self.osc = osc_handler
self.parameter_history = {}
self.tracking_active = False
def track_parameter(self, address, interval=0.1):
"""指定されたパラメータを定期監視"""
import threading
def monitoring_loop():
while self.tracking_active:
try:
value = self.osc.getOSCParameterValue(address)
if value is not None:
timestamp = time.time()
if address not in self.parameter_history:
self.parameter_history[address] = []
# 値が変更された場合のみ記録
if (not self.parameter_history[address] or
self.parameter_history[address][-1][1] != value):
self.parameter_history[address].append((timestamp, value))
print(f"{address}: {value} (時刻: {timestamp:.2f})")
# 履歴サイズ制限(最新100件まで)
if len(self.parameter_history[address]) > 100:
self.parameter_history[address] = self.parameter_history[address][-100:]
time.sleep(interval)
except Exception as e:
print(f"パラメータ追跡エラー: {e}")
time.sleep(interval)
self.tracking_active = True
thread = threading.Thread(target=monitoring_loop, daemon=True)
thread.start()
def stop_tracking(self):
"""追跡停止"""
self.tracking_active = False
def get_parameter_history(self, address):
"""パラメータの履歴取得"""
return self.parameter_history.get(address, [])
def get_latest_value(self, address):
"""最新パラメータ値取得"""
history = self.get_parameter_history(address)
return history[-1][1] if history else None
# 使用例
osc = OSCHandler()
tracker = ParameterTracker(osc)
# MuteSelfパラメータの追跡開始
tracker.track_parameter("/avatar/parameters/MuteSelf", interval=0.5)
# しばらく監視
time.sleep(30)
# 結果確認
mute_history = tracker.get_parameter_history("/avatar/parameters/MuteSelf")
print(f"MuteSelf変更履歴: {len(mute_history)}件")
for timestamp, value in mute_history[-5:]: # 最新5件表示
print(f" {time.ctime(timestamp)}: {value}")
tracker.stop_tracking()
```
## エラーハンドリング・復旧機構
### 堅牢な接続管理
```python
class RobustOSCHandler:
"""堅牢性を高めたOSCハンドラー"""
def __init__(self, ip_address="127.0.0.1", port=9000):
self.osc = OSCHandler(ip_address, port)
self.connection_retries = 3
self.retry_delay = 1.0
def safe_send_message(self, message, notification=True, max_retries=None):
"""安全なメッセージ送信(リトライ機構付き)"""
retries = max_retries or self.connection_retries
for attempt in range(retries):
try:
self.osc.sendMessage(message, notification)
return True
except Exception as e:
print(f"送信試行 {attempt + 1}/{retries} 失敗: {e}")
if attempt < retries - 1:
time.sleep(self.retry_delay * (attempt + 1)) # 指数バックオフ
# 接続再初期化を試行
try:
self.osc.udp_client = udp_client.SimpleUDPClient(
self.osc.osc_ip_address,
self.osc.osc_port
)
except Exception as reconnect_error:
print(f"再接続失敗: {reconnect_error}")
print(f"メッセージ送信に失敗しました: '{message}'")
return False
def safe_get_parameter(self, address, timeout=5.0):
"""安全なパラメータ取得(タイムアウト付き)"""
if not self.osc.getIsOscQueryEnabled():
return None
import threading
import queue
result_queue = queue.Queue()
def parameter_getter():
try:
value = self.osc.getOSCParameterValue(address)
result_queue.put(value)
except Exception as e:
result_queue.put(e)
# タイムアウト付きでパラメータ取得
thread = threading.Thread(target=parameter_getter, daemon=True)
thread.start()
try:
result = result_queue.get(timeout=timeout)
if isinstance(result, Exception):
raise result
return result
except queue.Empty:
print(f"パラメータ取得タイムアウト: {address}")
return None
# 使用例
robust_osc = RobustOSCHandler()
# 堅牢な送信
success = robust_osc.safe_send_message("堅牢性テスト", notification=True)
print(f"送信成功: {success}")
# 安全なパラメータ取得
mute_value = robust_osc.safe_get_parameter("/avatar/parameters/MuteSelf", timeout=3.0)
print(f"MuteSelf値: {mute_value}")
```
## パフォーマンス最適化
### 効率的な通信管理
```python
class OptimizedOSCHandler:
"""パフォーマンス最適化OSCハンドラー"""
def __init__(self, ip_address="127.0.0.1", port=9000):
self.osc = OSCHandler(ip_address, port)
self.message_queue = []
self.batch_size = 10
self.batch_interval = 0.1
self.last_batch_time = 0
def queue_message(self, message, notification=True):
"""メッセージをキューに追加(バッチ送信用)"""
self.message_queue.append((message, notification))
# バッチサイズまたは時間間隔でフラッシュ
current_time = time.time()
if (len(self.message_queue) >= self.batch_size or
current_time - self.last_batch_time >= self.batch_interval):
self.flush_messages()
def flush_messages(self):
"""キューされたメッセージを一括送信"""
if not self.message_queue:
return
# 最新のメッセージのみ送信(重複排除)
if len(self.message_queue) > 1:
# 最後のメッセージを優先
last_message, last_notification = self.message_queue[-1]
self.osc.sendMessage(last_message, last_notification)
else:
message, notification = self.message_queue[0]
self.osc.sendMessage(message, notification)
# キューをクリア
self.message_queue.clear()
self.last_batch_time = time.time()
def send_immediate(self, message, notification=True):
"""即座にメッセージ送信(キューをバイパス)"""
self.flush_messages() # 既存キューを先にフラッシュ
self.osc.sendMessage(message, notification)
# 使用例
optimized_osc = OptimizedOSCHandler()
# 複数のメッセージを効率的に送信
for i in range(20):
optimized_osc.queue_message(f"バッチメッセージ {i}")
time.sleep(0.05) # 短い間隔
# 残りのメッセージをフラッシュ
optimized_osc.flush_messages()
# 即座に送信が必要な重要メッセージ
optimized_osc.send_immediate("緊急メッセージ", notification=True)
```
## 依存関係・要件
### 必須依存関係
- `pythonosc`: 基本OSC通信ライブラリ
- `threading`: 並行処理制御
- `time`: 時間管理機能
### オプション依存関係
- `tinyoscquery`: OSCQuery機能(ローカル接続時のみ)
- `utils`: エラーログ機能(フォールバック処理あり)
### システム要件
```python
# 最小システム要件
requirements = {
"python_version": "3.7+",
"network": "UDP通信対応",
"vrchat_version": "OSCサポート版(2022年8月以降)",
"local_ports": "空きUDP/TCPポート(OSCQuery使用時)"
}
# 推奨環境
recommended = {
"network_latency": "< 10ms(ローカル接続)",
"cpu_usage": "OSCQuery使用時は追加CPU負荷",
"memory": "tinyoscquery使用時は追加メモリ"
}
```
## 注意事項・制限
### OSCQuery制限
- ローカルホスト(127.0.0.1/localhost)接続時のみ利用可能
- tinyoscqueryライブラリが必要
- ファイアウォール設定によっては動作しない可能性
### 通信制限
- UDPプロトコルのため送達保証なし
- VRChatのOSC受信制限(レート制限あり)
- ネットワーク環境による遅延・パケット loss
### プラットフォーム依存
```python
# 既知の制限事項
limitations = {
"windows": "Windowsファイアウォールの設定が必要な場合あり",
"macos": "セキュリティ設定によるポート制限の可能性",
"linux": "一部のLinuxディストリビューションでの互換性問題",
"vrchat_platform": "PC版VRChatのみOSCサポート"
}
```
## 関連モジュール
- `config.py`: OSC設定管理
- `controller.py`: OSC機能制御インターフェース
- `model.py`: OSC機能統合
- `utils.py`: エラーログ・ネットワークユーティリティ
## 将来の改善点
- より高度なOSCQueryパラメータ監視
- カスタムOSCプロトコル拡張
- パフォーマンス監視・分析機能
- 自動再接続・復旧機構の改善
- VRChatアバター固有パラメータ対応
+775
View File
@@ -0,0 +1,775 @@
# overlay - VRオーバーレイ統合システム
## 概要
VRChat向けのOpenVRオーバーレイシステムです。翻訳結果や字幕をVR空間内に表示する機能を提供し、HMD・コントローラー追跡、フェード効果、多言語フォント対応を統合的に管理します。
## 主要コンポーネント
### overlay.py - メインオーバーレイ管理
- OpenVRオーバーレイの生成・配置・制御
- HMD・左手・右手への追跡設定
- フェードイン・フェードアウト効果
### overlay_image.py - 画像生成・描画
- 多言語対応テキスト画像生成
- メッセージログ・履歴表示
- フォント・レイアウト管理
### overlay_utils.py - 数学的変換ユーティリティ
- 3D座標変換行列計算
- オイラー角・回転行列変換
- 同次座標系変換
## クラス構造
### Overlay クラス (overlay.py)
```python
class Overlay:
def __init__(self, settings_dict: Dict[str, Dict[str, Any]]) -> None:
self.system: Optional[Any] = None # OpenVRシステム
self.overlay: Optional[Any] = None # オーバーレイインターface
self.handle: Dict[str, Any] = {} # サイズ別ハンドル
self.settings: Dict[str, Dict[str, Any]] # サイズ別設定
self.lastUpdate: Dict[str, float] = {} # 最終更新時刻
self.fadeRatio: Dict[str, float] = {} # フェード比率
```
VRオーバーレイの総合管理クラス
#### 主要機能
- OpenVRの初期化・管理
- 複数サイズオーバーレイの同時管理
- リアルタイムフェード効果処理
- SteamVR接続状態監視
### OverlayImage クラス (overlay_image.py)
```python
class OverlayImage:
LANGUAGES = {
"Default": "NotoSansJP-Regular.ttf",
"Japanese": "NotoSansJP-Regular.ttf",
"Korean": "NotoSansKR-Regular.ttf",
"Chinese Simplified": "NotoSansSC-Regular.ttf",
"Chinese Traditional": "NotoSansTC-Regular.ttf"
}
def __init__(self, root_path: Optional[str] = None) -> None:
self.message_log: List[dict] = []
self.root_path: str
```
テキスト画像生成・多言語フォント管理クラス
#### 主要機能
- 多言語フォント自動選択
- メッセージ履歴管理
- 動的画像生成・合成
- UI要素のサイズ計算
## 主要メソッド
### Overlay クラス
#### 初期化・制御
```python
def startOverlay(self) -> None
```
オーバーレイシステム開始
```python
def shutdownOverlay(self) -> None
```
オーバーレイシステム終了・リソース解放
```python
def reStartOverlay(self) -> None
```
オーバーレイシステム再起動
#### 表示制御
```python
def showOverlay(self, image: Image, size: str) -> None
```
画像をオーバーレイに表示
#### パラメータ
- **image**: 表示するPIL画像
- **size**: オーバーレイサイズ識別子
```python
def setOpacity(self, opacity: float, size: str) -> None
```
オーバーレイ透明度設定
#### パラメータ
- **opacity**: 透明度(0.0-1.0)
- **size**: 対象サイズ
```python
def setTrackedDeviceRelative(self, tracker: str, size: str) -> None
```
追跡デバイスへのオーバーレイ配置
#### パラメータ
- **tracker**: 追跡デバイス("HMD", "LeftHand", "RightHand")
- **size**: オーバーレイサイズ
### OverlayImage クラス
#### 画像生成
```python
def createOverlayImage(self, message: str, language: str, ui_size: dict,
ui_settings: dict, message_log_settings: dict) -> Image
```
オーバーレイ用画像の生成
#### パラメータ
- **message**: 表示メッセージ
- **language**: 言語設定
- **ui_size**: UIサイズ設定
- **ui_settings**: UI表示設定
- **message_log_settings**: ログ表示設定
#### 戻り値
- **Image**: 生成されたPIL画像
#### 履歴管理
```python
def addMessageLog(self, message: str, timestamp: datetime) -> None
```
メッセージログに新規追加
#### パラメータ
- **message**: 追加するメッセージ
- **timestamp**: タイムスタンプ
```python
def clearMessageLog(self) -> None
```
メッセージログのクリア
## 使用方法
### 基本的なオーバーレイ表示
```python
from models.overlay.overlay import Overlay
from models.overlay.overlay_image import OverlayImage
from PIL import Image
# オーバーレイ設定
settings = {
"small": {
"width": 0.3,
"height": 0.1,
"x_pos": 0.0,
"y_pos": -0.2,
"z_pos": 1.0,
"opacity": 0.8,
"display_duration": 3.0,
"fadeout_duration": 1.0
},
"large": {
"width": 0.5,
"height": 0.2,
"x_pos": 0.0,
"y_pos": -0.3,
"z_pos": 1.2,
"opacity": 0.9,
"display_duration": 5.0,
"fadeout_duration": 1.5
}
}
# オーバーレイシステム初期化
overlay_system = Overlay(settings)
overlay_image = OverlayImage()
# システム開始
overlay_system.startOverlay()
# 翻訳結果の表示
translation_text = "Hello, world! / こんにちは、世界!"
# 画像生成設定
ui_size = OverlayImage.getUiSizeSmallLog()
ui_settings = {
"font_size": 20,
"text_color": (255, 255, 255, 255),
"background_color": (0, 0, 0, 180)
}
message_log_settings = {
"enabled": True,
"max_lines": 5
}
# 画像生成・表示
overlay_img = overlay_image.createOverlayImage(
message=translation_text,
language="Japanese",
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings=message_log_settings
)
# オーバーレイに表示
overlay_system.showOverlay(overlay_img, "small")
# システム終了
import time
time.sleep(10)
overlay_system.shutdownOverlay()
```
### HMD・コントローラー追跡設定
```python
# HMDに固定表示
overlay_system.setTrackedDeviceRelative("HMD", "large")
# 左手コントローラーに追従
overlay_system.setTrackedDeviceRelative("LeftHand", "small")
# 右手コントローラーに追従
overlay_system.setTrackedDeviceRelative("RightHand", "small")
# 位置・回転の微調整(設定変更)
overlay_system.settings["small"]["x_pos"] = 0.1
overlay_system.settings["small"]["y_pos"] = -0.1
overlay_system.settings["small"]["z_pos"] = 0.8
overlay_system.settings["small"]["x_rotation"] = -30.0
overlay_system.settings["small"]["y_rotation"] = 15.0
# 設定を適用
overlay_system.setTrackedDeviceRelative("LeftHand", "small")
```
### フェード効果制御
```python
# フェード効果設定
overlay_system.updateDisplayDuration(4.0, "large") # 4秒表示
overlay_system.updateFadeoutDuration(2.0, "large") # 2秒でフェードアウト
# 即座に透明度変更
overlay_system.setOpacity(0.5, "large") # 50%透明度
# フェード効果を無効にして固定表示
overlay_system.settings["small"]["fadeout_duration"] = 0
overlay_system.setOpacity(1.0, "small") # 完全不透明で固定
```
### 多言語対応表示
```python
# 日本語表示
japanese_text = "これは日本語のテストです"
jp_image = overlay_image.createOverlayImage(
message=japanese_text,
language="Japanese",
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings=message_log_settings
)
overlay_system.showOverlay(jp_image, "large")
# 韓国語表示
korean_text = "이것은 한국어 테스트입니다"
kr_image = overlay_image.createOverlayImage(
message=korean_text,
language="Korean",
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings=message_log_settings
)
overlay_system.showOverlay(kr_image, "small")
# 中国語(簡体字)表示
chinese_text = "这是中文测试"
cn_image = overlay_image.createOverlayImage(
message=chinese_text,
language="Chinese Simplified",
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings=message_log_settings
)
overlay_system.showOverlay(cn_image, "large")
```
### メッセージログ機能
```python
from datetime import datetime
# メッセージログの追加
overlay_image.addMessageLog("最初のメッセージ", datetime.now())
overlay_image.addMessageLog("翻訳結果: Hello -> こんにちは", datetime.now())
overlay_image.addMessageLog("音声認識: こんにちは", datetime.now())
# ログ表示設定
log_settings = {
"enabled": True,
"max_lines": 3, # 最大3行表示
"show_timestamp": True, # タイムスタンプ表示
"font_size": 16,
"text_color": (200, 200, 200, 255)
}
# ログ付きオーバーレイ画像生成
logged_image = overlay_image.createOverlayImage(
message="新しいメッセージ",
language="Japanese",
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings=log_settings
)
overlay_system.showOverlay(logged_image, "large")
# ログクリア
overlay_image.clearMessageLog()
```
## 座標系・変換システム
### 基本座標設定
```python
# HMD基準座標(頭部固定表示)
def getHMDBaseMatrix() -> np.ndarray:
x_pos = 0.0 # 左右位置
y_pos = -0.4 # 上下位置(下方向)
z_pos = 1.0 # 前後位置(前方向)
x_rotation = 0.0 # X軸回転
y_rotation = 0.0 # Y軸回転
z_rotation = 0.0 # Z軸回転
# 左手コントローラー基準座標
def getLeftHandBaseMatrix() -> np.ndarray:
x_pos = 0.3 # 右側にオフセット
y_pos = 0.1 # 上方向にオフセット
z_pos = -0.31 # 手前にオフセット
x_rotation = -65.0 # 下向きに傾斜
y_rotation = 165.0 # Y軸回転
z_rotation = 115.0 # Z軸回転
# 右手コントローラー基準座標
def getRightHandBaseMatrix() -> np.ndarray:
x_pos = -0.3 # 左側にオフセット
y_rotation = -165.0 # 左手と対称
z_rotation = -115.0 # 左手と対称
```
### 変換行列計算 (overlay_utils.py)
```python
import numpy as np
from models.overlay.overlay_utils import *
# 移動変換
translation = (0.1, -0.2, 0.5) # x, y, z移動
translation_matrix = calcTranslationMatrix(translation)
# 回転変換(各軸独立)
x_rotation_matrix = calcRotationMatrixX(30.0) # X軸30度回転
y_rotation_matrix = calcRotationMatrixY(45.0) # Y軸45度回転
z_rotation_matrix = calcRotationMatrixZ(60.0) # Z軸60度回転
# オイラー角から回転行列生成
euler_angles = (30.0, 45.0, 60.0) # X, Y, Z軸回転角度
rotation_matrix = euler_to_rotation_matrix(euler_angles)
# 基本行列への変換適用
base_matrix = getHMDBaseMatrix()
translation = (0.05, -0.1, 0.2)
rotation = (10.0, -5.0, 0.0)
transformed_matrix = transform_matrix(base_matrix, translation, rotation)
# 3x4行列を4x4同次座標に変換
homogeneous_matrix = toHomogeneous(transformed_matrix)
```
### カスタム配置設定
```python
# カスタム位置でのオーバーレイ配置
def createCustomOverlay(overlay_system, custom_pos, custom_rot, size):
"""カスタム位置・回転でのオーバーレイ設定"""
# 設定を動的に変更
overlay_system.settings[size]["x_pos"] = custom_pos[0]
overlay_system.settings[size]["y_pos"] = custom_pos[1]
overlay_system.settings[size]["z_pos"] = custom_pos[2]
overlay_system.settings[size]["x_rotation"] = custom_rot[0]
overlay_system.settings[size]["y_rotation"] = custom_rot[1]
overlay_system.settings[size]["z_rotation"] = custom_rot[2]
# 追跡デバイス設定を再適用
overlay_system.setTrackedDeviceRelative("HMD", size)
# 使用例:カスタム配置
custom_position = (0.2, -0.3, 0.8) # やや右下前方
custom_rotation = (-15.0, 10.0, 5.0) # 軽く傾斜
createCustomOverlay(overlay_system, custom_position, custom_rotation, "large")
```
## 高度な機能
### 動的サイズ・レイアウト管理
```python
class AdaptiveOverlayManager:
"""適応的オーバーレイ管理クラス"""
def __init__(self, base_overlay_system, base_overlay_image):
self.overlay = base_overlay_system
self.image_gen = base_overlay_image
self.current_layout = "compact"
def adaptLayoutToContent(self, message, language):
"""コンテンツに応じたレイアウト自動調整"""
# メッセージ長に応じてサイズ決定
if len(message) < 50:
layout = "compact"
size_key = "small"
elif len(message) < 150:
layout = "standard"
size_key = "medium"
else:
layout = "expanded"
size_key = "large"
# 言語に応じたフォントサイズ調整
if language in ["Chinese Simplified", "Chinese Traditional"]:
font_scale = 1.1 # 中国語は少し大きめ
elif language == "Korean":
font_scale = 1.05 # 韓国語は微調整
else:
font_scale = 1.0 # 日本語・その他
# UI設定の動的生成
ui_size = self.getAdaptiveUiSize(layout)
ui_settings = {
"font_size": int(18 * font_scale),
"line_height": int(24 * font_scale),
"text_color": (255, 255, 255, 255),
"background_color": (0, 0, 0, 200),
"border_width": 2,
"border_color": (100, 150, 255, 255)
}
return ui_size, ui_settings, size_key
def getAdaptiveUiSize(self, layout):
"""レイアウトに応じたUIサイズ取得"""
layouts = {
"compact": {
"width": 400,
"height": 100,
"margin": 10,
"padding": 8
},
"standard": {
"width": 600,
"height": 150,
"margin": 15,
"padding": 12
},
"expanded": {
"width": 800,
"height": 200,
"margin": 20,
"padding": 16
}
}
return layouts.get(layout, layouts["standard"])
# 使用例
adaptive_manager = AdaptiveOverlayManager(overlay_system, overlay_image)
messages = [
("Hello!", "English"),
("これは中程度の長さのメッセージです。翻訳結果を表示します。", "Japanese"),
("这是一个很长的消息,用来测试自适应布局功能。当消息内容很长时,系统会自动选择更大的显示区域,并调整字体大小以确保良好的可读性。", "Chinese Simplified")
]
for message, language in messages:
# 自動レイアウト調整
ui_size, ui_settings, size_key = adaptive_manager.adaptLayoutToContent(message, language)
# 画像生成・表示
adaptive_image = overlay_image.createOverlayImage(
message=message,
language=language,
ui_size=ui_size,
ui_settings=ui_settings,
message_log_settings={"enabled": True, "max_lines": 3}
)
overlay_system.showOverlay(adaptive_image, size_key)
time.sleep(3)
```
### パフォーマンス監視・最適化
```python
class OverlayPerformanceMonitor:
"""オーバーレイパフォーマンス監視クラス"""
def __init__(self, overlay_system):
self.overlay = overlay_system
self.frame_times = []
self.update_counts = {}
def monitorFrameRate(self, duration=10.0):
"""フレームレート監視"""
start_time = time.monotonic()
frame_count = 0
while time.monotonic() - start_time < duration:
frame_start = time.monotonic()
# フレーム処理(空の処理)
time.sleep(1/90) # 90Hz目標
frame_end = time.monotonic()
self.frame_times.append(frame_end - frame_start)
frame_count += 1
# 統計計算
avg_frame_time = sum(self.frame_times) / len(self.frame_times)
avg_fps = 1.0 / avg_frame_time if avg_frame_time > 0 else 0
print(f"平均フレーム時間: {avg_frame_time*1000:.2f}ms")
print(f"平均FPS: {avg_fps:.1f}")
print(f"総フレーム数: {frame_count}")
return avg_fps
def optimizeSettings(self, target_fps=60):
"""パフォーマンス目標に基づく設定最適化"""
current_fps = self.monitorFrameRate(5.0)
if current_fps < target_fps * 0.8:
print("パフォーマンス不足。設定を軽量化します...")
# フェード処理間隔を延長
for size in self.overlay.settings:
self.overlay.settings[size]["fadeout_duration"] *= 1.5
# 更新頻度を下げる
# (mainloopの sleep_time 調整は overlay.py 内で実装)
elif current_fps > target_fps * 1.2:
print("パフォーマンスに余裕があります。品質を向上します...")
# より滑らかなフェード
for size in self.overlay.settings:
self.overlay.settings[size]["fadeout_duration"] *= 0.8
# 使用例
performance_monitor = OverlayPerformanceMonitor(overlay_system)
performance_monitor.monitorFrameRate(10.0)
performance_monitor.optimizeSettings(target_fps=60)
```
## エラーハンドリング・復旧
### 堅牢な接続管理
```python
class RobustOverlaySystem:
"""堅牢性を高めたオーバーレイシステム"""
def __init__(self, settings_dict):
self.base_overlay = Overlay(settings_dict)
self.connection_retries = 3
self.auto_reconnect = True
def safeStartOverlay(self, max_retries=None):
"""安全なオーバーレイ開始(リトライ機構付き)"""
retries = max_retries or self.connection_retries
for attempt in range(retries):
try:
# SteamVR接続確認
if not self.base_overlay.checkSteamvrRunning():
print("SteamVRが起動していません。待機中...")
time.sleep(5)
continue
# オーバーレイ開始
self.base_overlay.startOverlay()
# 初期化完了まで待機
timeout = 10.0
start_time = time.monotonic()
while not self.base_overlay.initialized and time.monotonic() - start_time < timeout:
time.sleep(0.1)
if self.base_overlay.initialized:
print("オーバーレイシステム開始完了")
return True
else:
print(f"初期化タイムアウト(試行 {attempt + 1}/{retries})")
except Exception as e:
print(f"オーバーレイ開始エラー(試行 {attempt + 1}/{retries}): {e}")
# 既存システムのクリーンアップ
try:
self.base_overlay.shutdownOverlay()
except Exception:
pass
if attempt < retries - 1:
time.sleep(2 ** attempt) # 指数バックオフ
print("オーバーレイシステムの開始に失敗しました")
return False
def monitorConnection(self):
"""接続監視・自動復旧"""
while self.auto_reconnect:
try:
if self.base_overlay.initialized and not self.base_overlay.checkActive():
print("OpenVR接続が切断されました。再接続を試行します...")
self.base_overlay.shutdownOverlay()
time.sleep(2)
if self.safeStartOverlay():
print("オーバーレイシステムが復旧しました")
else:
print("復旧に失敗しました")
time.sleep(1)
except Exception as e:
print(f"接続監視エラー: {e}")
time.sleep(5)
# 使用例
robust_overlay = RobustOverlaySystem(settings)
# 安全な開始
if robust_overlay.safeStartOverlay():
# 接続監視開始(別スレッド)
import threading
monitor_thread = threading.Thread(target=robust_overlay.monitorConnection, daemon=True)
monitor_thread.start()
# 通常の操作
overlay_img = overlay_image.createOverlayImage(...)
robust_overlay.base_overlay.showOverlay(overlay_img, "small")
```
## 依存関係・システム要件
### 必須依存関係
- `openvr`: OpenVR Python バインディング
- `numpy`: 数値計算・行列演算
- `PIL (Pillow)`: 画像処理・生成
- `psutil`: プロセス監視
### システム要件
```python
system_requirements = {
"steamvr": "SteamVR環境必須",
"openvr_runtime": "OpenVR Runtime",
"vr_headset": "対応VRヘッドセット(Oculus, Vive, Index等)",
"graphics": "VR対応GPU",
"python": "Python 3.7以上"
}
performance_requirements = {
"cpu": "VR処理に十分なCPU性能",
"memory": "追加メモリ使用量 ~100-500MB",
"disk_space": "フォントファイル用容量 ~50MB"
}
```
### オプション依存関係
- `utils.errorLogging`: エラーログ機能(フォールバック処理あり)
## 注意事項・制限
### VR環境制限
- SteamVRが起動していない場合は動作不可
- VRヘッドセットが接続されていない場合は制限あり
- OpenVRドライバーの互換性に依存
### パフォーマンス制限
- リアルタイム描画処理によるCPU・GPU負荷
- フォントレンダリングによるメモリ使用量
- 高解像度VRディスプレイでの描画負荷
### プラットフォーム制限
```python
platform_limitations = {
"windows": "主要サポートプラットフォーム",
"linux": "SteamVR Linux版での制限あり",
"macos": "SteamVR macOS版サポート終了により制限",
"mobile_vr": "OpenVR非対応のため利用不可"
}
```
## 関連モジュール
- `config.py`: オーバーレイ設定管理
- `controller.py`: オーバーレイ制御インターフェース
- `model.py`: オーバーレイ機能統合
- `utils.py`: エラーログ・ユーティリティ
## 最近の更新 (2025-10-20)
### フォント探索仕様の強化
`overlay_image.py` に PyInstaller ビルド後の `_internal/fonts/` ディレクトリ検出ロジックを追加。以下の優先順位でフォントディレクトリを探索:
1. `root_path/_internal/fonts/` (PyInstallerバンドル環境)
2. `src-python/models/overlay/fonts/` (開発環境相対パス)
3. `models/overlay/fonts/` (直接実行時)
見つからない場合は `FileNotFoundError` で早期通知。これにより配布バイナリと開発環境で同一コードパスを維持。
### 影響
| 項目 | 内容 |
|------|------|
| PyInstaller対応 | バンドル後のフォント読み込み失敗を防止 |
| 移植性 | 環境差異をコード内条件分岐で吸収 |
| エラー検知 | フォント未配置時の早期例外で不正描画防止 |
## 将来の改善点
- よりリッチなUI要素対応
- アニメーション・エフェクト機能
- カスタムフォント・テーマシステム
- パフォーマンス監視・自動最適化
- 他のVRプラットフォーム対応検討
@@ -0,0 +1,229 @@
# transcription_languages.py - 音声認識言語マッピング
## 概要
音声認識エンジンが対応する言語コードのマッピングテーブルを提供するモジュールです。異なる音声認識エンジンの言語コード仕様の差異を吸収し、統一的なインターフェースを提供します。
## 主要機能
### 言語マッピングテーブル
- 表示用言語名から各エンジン固有の言語コードへの変換
- 国・地域固有の言語バリエーション対応
- 複数音声認識エンジンの統一的な言語管理
### 対応エンジン
- Google Speech Recognition
- OpenAI Whisper(faster-whisper)
- その他の音声認識エンジン
## データ構造
### transcription_lang
```python
transcription_lang: Dict[str, List[Dict[str, str]]]
```
言語とその地域バリエーションのマッピング
```python
transcription_lang = {
"English": [
{"country": "United States", "google_language_code": "en-US"},
{"country": "United Kingdom", "google_language_code": "en-GB"},
{"country": "Australia", "google_language_code": "en-AU"}
],
"Japanese": [
{"country": "Japan", "google_language_code": "ja-JP"}
],
"Korean": [
{"country": "South Korea", "google_language_code": "ko-KR"}
]
}
```
## 使用方法
### 基本的な言語コード取得
```python
from models.transcription.transcription_languages import transcription_lang
# 日本語の言語コード取得
japanese_codes = transcription_lang.get("Japanese", [])
if japanese_codes:
code = japanese_codes[0]["google_language_code"] # "ja-JP"
# 英語の地域別言語コード取得
english_codes = transcription_lang.get("English", [])
for region in english_codes:
print(f"{region['country']}: {region['google_language_code']}")
```
### 利用可能言語の一覧取得
```python
# 対応言語の一覧
supported_languages = list(transcription_lang.keys())
print(f"対応言語: {supported_languages}")
# 言語と国の組み合わせ一覧
language_country_pairs = []
for lang, countries in transcription_lang.items():
for country_data in countries:
language_country_pairs.append({
"language": lang,
"country": country_data["country"],
"code": country_data["google_language_code"]
})
```
### 翻訳システムとの連携
```python
# 翻訳システムで対応している言語の確認
from models.translation.translation_languages import translation_lang
transcription_langs = list(transcription_lang.keys())
translation_langs = []
for engine in translation_lang.keys():
translation_langs.extend(translation_lang[engine]["source"].keys())
# 音声認識と翻訳の両方で対応している言語
supported_langs = list(filter(lambda x: x in transcription_langs, translation_langs))
```
## 主要対応言語
### 西欧言語
- **English**: US, UK, Australia, Canada, India, South Africa
- **Spanish**: Spain, Mexico, Argentina, Colombia
- **French**: France, Canada, Belgium
- **German**: Germany, Austria, Switzerland
- **Italian**: Italy
- **Portuguese**: Brazil, Portugal
### アジア言語
- **Japanese**: Japan
- **Korean**: South Korea
- **Chinese**: China (Simplified), Taiwan (Traditional), Hong Kong
- **Thai**: Thailand
- **Vietnamese**: Vietnam
### その他の言語
- **Russian**: Russia
- **Arabic**: Saudi Arabia, UAE, Egypt
- **Hindi**: India
- **Dutch**: Netherlands
- **Swedish**: Sweden
- **Norwegian**: Norway
## エンジン別言語コード形式
### Google Speech Recognition
- RFC 5646準拠の言語タグ形式
- 例: "ja-JP", "en-US", "zh-CN"
### OpenAI Whisper
- ISO 639-1言語コード(2文字)
- 例: "ja", "en", "zh"
### その他のエンジン
- エンジン固有の形式に対応
- マッピングテーブルによる変換
## 地域対応
### 同一言語の地域別対応
```python
# 英語の地域バリエーション
"English": [
{"country": "United States", "google_language_code": "en-US"},
{"country": "United Kingdom", "google_language_code": "en-GB"},
{"country": "Australia", "google_language_code": "en-AU"},
{"country": "Canada", "google_language_code": "en-CA"},
{"country": "India", "google_language_code": "en-IN"}
]
```
### 方言・変種対応
```python
# 中国語の簡体字・繁体字対応
"Chinese Simplified": [
{"country": "China", "google_language_code": "zh-CN"}
],
"Chinese Traditional": [
{"country": "Taiwan", "google_language_code": "zh-TW"},
{"country": "Hong Kong", "google_language_code": "zh-HK"}
]
```
## 統合利用
### VRCTでの利用例
```python
def get_supported_transcription_languages():
"""音声認識対応言語の取得"""
languages = []
for language, countries in transcription_lang.items():
for country_data in countries:
languages.append({
"language": language,
"country": country_data["country"],
"display_name": f"{language} ({country_data['country']})",
"code": country_data["google_language_code"]
})
return languages
```
### エラーハンドリング
```python
def get_language_code(language: str, country: str = None) -> str:
"""安全な言語コード取得"""
try:
countries = transcription_lang.get(language, [])
if not countries:
return "en-US" # フォールバック
if country:
for country_data in countries:
if country_data["country"] == country:
return country_data["google_language_code"]
# 国指定なしまたは見つからない場合は最初の項目を返す
return countries[0]["google_language_code"]
except (KeyError, IndexError):
return "en-US" # エラー時のフォールバック
```
## 拡張性
### 新言語の追加
```python
# 新しい言語の追加例
transcription_lang["Turkish"] = [
{"country": "Turkey", "google_language_code": "tr-TR"}
]
```
### 新エンジンへの対応
```python
# 新しいエンジンのコードフィールドを追加
transcription_lang["English"][0]["azure_language_code"] = "en-US"
transcription_lang["English"][0]["aws_language_code"] = "en-US"
```
## 注意事項
- 言語コードは各エンジンの仕様に依存
- 新しいエンジン追加時は対応コードの追加が必要
- 地域固有の音声認識精度差に注意
- エンジンによってサポート言語が異なる場合がある
## 関連モジュール
- `transcription_transcriber.py`: 音声認識エンジン本体
- `translation_languages.py`: 翻訳エンジン言語マッピング
- `config.py`: 言語設定管理
- `controller.py`: 言語選択UI制御
@@ -0,0 +1,325 @@
# transcription_recorder.py - 音声録音インターフェース
## 概要
音声認識システムの入力となる音声データを録音するレコーダークラス群です。マイクとスピーカー出力の両方をサポートし、エネルギーレベル監視機能とともに音声データをキューに送信します。pyaudiowpatchライブラリを使用してWindowsの音声システムと統合します。
## 主要機能
### 音声録音機能
- マイクからの音声録音
- スピーカー出力の録音(ループバック)
- リアルタイム音声データキューイング
### エネルギー監視
- 音声エネルギーレベルの監視
- 動的しきい値調整
- 無音検出
### デバイス対応
- 複数音声デバイスの対応
- デバイス固有設定の管理
- 自動デバイス選択
## クラス構造
### BaseRecorder クラス
```python
class BaseRecorder:
def __init__(self, source: Any, energy_threshold: int, dynamic_energy_threshold: bool, record_timeout: int)
```
基底レコーダークラス - 共通機能を提供
### SelectedMicRecorder クラス
```python
class SelectedMicRecorder(BaseRecorder):
def __init__(self, device: dict, energy_threshold: int, dynamic_energy_threshold: bool, record_timeout: int)
```
選択されたマイクデバイスからの録音
### SelectedSpeakerRecorder クラス
```python
class SelectedSpeakerRecorder(BaseRecorder):
def __init__(self, device: dict, energy_threshold: int, dynamic_energy_threshold: bool, record_timeout: int)
```
選択されたスピーカーデバイスからの録音(ループバック)
### エネルギー監視クラス群
#### BaseEnergyRecorder クラス
```python
class BaseEnergyRecorder:
def __init__(self, source: Any)
```
エネルギーレベル監視の基底クラス
#### SelectedMicEnergyRecorder クラス
```python
class SelectedMicEnergyRecorder(BaseEnergyRecorder):
def __init__(self, device: dict)
```
マイクエネルギーレベルの監視
#### SelectedSpeakerEnergyRecorder クラス
```python
class SelectedSpeakerEnergyRecorder(BaseEnergyRecorder):
def __init__(self, device: dict)
```
スピーカーエネルギーレベルの監視
### 統合録音クラス群
#### BaseEnergyAndAudioRecorder クラス
```python
class BaseEnergyAndAudioRecorder:
def __init__(self, source: Any, energy_threshold: int, dynamic_energy_threshold: bool,
phrase_time_limit: int, phrase_timeout: int, record_timeout: int)
```
音声録音とエネルギー監視を統合
#### SelectedMicEnergyAndAudioRecorder クラス
```python
class SelectedMicEnergyAndAudioRecorder(BaseEnergyAndAudioRecorder):
def __init__(self, device: dict, energy_threshold: int, dynamic_energy_threshold: bool,
phrase_time_limit: int, phrase_timeout: int = 1, record_timeout: int = 5)
```
マイクの音声録音とエネルギー監視を統合
#### SelectedSpeakerEnergyAndAudioRecorder クラス
```python
class SelectedSpeakerEnergyAndAudioRecorder(BaseEnergyAndAudioRecorder):
def __init__(self, device: dict, energy_threshold: int, dynamic_energy_threshold: bool,
phrase_time_limit: int, phrase_timeout: int = 1, record_timeout: int = 5)
```
スピーカーの音声録音とエネルギー監視を統合
## 主要メソッド
### 録音制御
```python
adjustForNoise() -> None
```
- 環境ノイズに合わせたしきい値調整
- 録音開始前の較正
```python
recordIntoQueue(audio_queue: Queue) -> None
```
- 音声データの継続的キューイング
- バックグラウンドスレッドでの実行
```python
pause() -> None
resume() -> None
stop() -> None
```
- 録音の一時停止・再開・停止制御
### エネルギー監視
```python
recordIntoQueue(energy_queue: Queue) -> None
```
- エネルギーレベルのキューイング
- リアルタイム監視データの提供
## 使用方法
### 基本的なマイク録音
```python
from queue import Queue
from models.transcription.transcription_recorder import SelectedMicRecorder
# デバイス設定
mic_device = {
"name": "マイク (USB Audio Device)",
"index": 0,
"channels": 1,
"sample_rate": 16000
}
# 録音設定
energy_threshold = 300
dynamic_threshold = True
record_timeout = 5
# レコーダー初期化
recorder = SelectedMicRecorder(
device=mic_device,
energy_threshold=energy_threshold,
dynamic_energy_threshold=dynamic_threshold,
record_timeout=record_timeout
)
# 音声キューの作成
audio_queue = Queue()
# 録音開始
recorder.adjustForNoise() # ノイズ調整
recorder.recordIntoQueue(audio_queue)
# 音声データの取得
while True:
if not audio_queue.empty():
audio_data = audio_queue.get()
print(f"音声データ受信: {len(audio_data)} bytes")
```
### スピーカー録音(ループバック)
```python
from models.transcription.transcription_recorder import SelectedSpeakerRecorder
# スピーカーデバイス設定
speaker_device = {
"name": "スピーカー (USB Audio Device)",
"index": 1,
"channels": 2,
"sample_rate": 44100
}
# スピーカーレコーダー
recorder = SelectedSpeakerRecorder(
device=speaker_device,
energy_threshold=500,
dynamic_energy_threshold=False,
record_timeout=3
)
audio_queue = Queue()
recorder.recordIntoQueue(audio_queue)
```
### エネルギー監視
```python
from models.transcription.transcription_recorder import SelectedMicEnergyRecorder
# エネルギー監視のみ
energy_recorder = SelectedMicEnergyRecorder(mic_device)
energy_queue = Queue()
energy_recorder.recordIntoQueue(energy_queue)
# エネルギーレベルの取得
while True:
if not energy_queue.empty():
energy_level = energy_queue.get()
print(f"エネルギーレベル: {energy_level}")
```
### 統合録音(音声+エネルギー)
```python
from models.transcription.transcription_recorder import SelectedMicEnergyAndAudioRecorder
# 統合レコーダー
integrated_recorder = SelectedMicEnergyAndAudioRecorder(
device=mic_device,
energy_threshold=300,
dynamic_energy_threshold=True,
phrase_time_limit=5, # フレーズ制限時間
phrase_timeout=1, # フレーズタイムアウト
record_timeout=5 # 録音タイムアウト
)
audio_queue = Queue()
energy_queue = Queue()
# 両方のキューに同時出力
integrated_recorder.recordIntoQueue(audio_queue, energy_queue)
```
## 設定パラメータ
### しきい値設定
- **energy_threshold**: 音声検出のエネルギーしきい値
- **dynamic_energy_threshold**: 動的しきい値調整の有効・無効
### タイムアウト設定
- **record_timeout**: 録音継続時間の上限
- **phrase_timeout**: フレーズ間の無音許容時間
- **phrase_time_limit**: 単一フレーズの最大長
### デバイス設定
- **name**: デバイス名
- **index**: デバイスインデックス
- **channels**: チャンネル数(1=モノラル、2=ステレオ)
- **sample_rate**: サンプリングレート(Hz)
## デバイス対応
### マイクデバイス
- USB マイク
- 内蔵マイク
- Bluetooth マイク
- 仮想マイクデバイス
### スピーカーデバイス(ループバック)
- USB スピーカー/ヘッドフォン
- 内蔵スピーカー
- Bluetooth スピーカー
- 仮想音声デバイス
## エラーハンドリング
### デバイスエラー
- デバイス接続失敗の検出
- 適切なエラーメッセージの提供
### 音声フォーマットエラー
- 非対応フォーマットの検出
- 自動フォーマット変換
### メモリエラー
- キューオーバーフローの防止
- メモリ使用量の最適化
## パフォーマンス特性
### レイテンシ
- 低レイテンシ録音(~10ms)
- リアルタイム処理最適化
### スループット
- 連続録音対応
- 高サンプリングレート対応
### メモリ使用量
- 効率的なバッファ管理
- キューサイズの最適化
## 依存関係
### 必須依存関係
- `speech_recognition`: 音声認識ライブラリ
- `pyaudiowpatch`: Windows音声システム統合
- `queue`: データキューイング
### オプション依存関係
- `datetime`: タイムスタンプ機能
## 注意事項
- Windows専用(pyaudiowpatchによる制限)
- 適切な音声デバイスドライバーが必要
- 排他制御による同時デバイスアクセス制限
- 高サンプリングレート使用時のCPU使用率上昇
## 関連モジュール
- `transcription_transcriber.py`: 音声認識エンジン
- `device_manager.py`: デバイス管理
- `config.py`: 録音設定管理
- `model.py`: 録音制御統合
@@ -0,0 +1,325 @@
# transcription_transcriber.py - 音声文字起こしエンジン
## 概要
音声データを文字テキストに変換する音声認識エンジンのメインクラスです。Google Speech RecognitionとOpenAI Whisper(faster-whisper)の両方をサポートし、オンライン・オフラインの音声認識を統合的に管理します。キューベースの非同期処理により、リアルタイム音声認識を実現します。
## 主要機能
### 音声認識エンジン
- Google Speech Recognition(オンライン)
- OpenAI Whisper(faster-whisper、オフライン)
- エンジン自動切り替え機能
### リアルタイム処理
- 音声キューからの継続的データ処理
- 非同期音声認識処理
- 結果の即座通知
### 多言語対応
- 複数言語の同時認識
- 地域固有言語コードの対応
- 自動言語検出
### 音声品質制御
- 音声品質フィルタリング
- ノイズ除去機能
- 信頼度スコア評価
## クラス構造
### AudioTranscriber クラス
```python
class AudioTranscriber:
def __init__(self, speaker: bool, source: Any, phrase_timeout: int, max_phrases: int,
transcription_engine: str, root: Optional[str] = None,
whisper_weight_type: Optional[str] = None, device: str = "cpu",
device_index: int = 0, compute_type: str = "auto")
```
音声認識の中核クラス
#### 初期化パラメータ
- **speaker**: スピーカー音声かマイク音声か
- **source**: 音声ソース
- **phrase_timeout**: フレーズタイムアウト(秒)
- **max_phrases**: 最大フレーズ数
- **transcription_engine**: 認識エンジン("Google"/"Whisper")
- **whisper_weight_type**: Whisperモデル種類
- **device**: 計算デバイス("cpu"/"cuda")
- **device_index**: デバイスインデックス
- **compute_type**: 計算精度タイプ
## 主要メソッド
### 音声認識処理
```python
transcribeAudioQueue(audio_queue: Queue, languages: List[str], countries: List[str],
avg_logprob: float = -0.8, no_speech_prob: float = 0.6) -> bool
```
音声キューからの継続的音声認識
#### パラメータ
- **audio_queue**: 音声データキュー
- **languages**: 認識対象言語リスト
- **countries**: 地域コードリスト
- **avg_logprob**: Whisper平均対数確率しきい値
- **no_speech_prob**: Whisper無音判定しきい値
### 結果管理
```python
getTranscript() -> dict
```
最新の認識結果を取得
```python
updateTranscript(result: dict) -> None
```
認識結果の更新と通知
```python
clearTranscriptData() -> None
```
認識データのクリア
### 音声データ処理
```python
processMicData() -> AudioData
```
マイク音声データの前処理
```python
processSpeakerData() -> AudioData
```
スピーカー音声データの前処理
## 使用方法
### 基本的な音声認識
```python
from queue import Queue
from models.transcription.transcription_transcriber import AudioTranscriber
# 音声認識の初期化
transcriber = AudioTranscriber(
speaker=False, # マイク音声
source=mic_source, # 音声ソース
phrase_timeout=3, # 3秒のフレーズタイムアウト
max_phrases=10, # 最大10フレーズ
transcription_engine="Google", # Google音声認識
device="cpu"
)
# 音声キューの準備
audio_queue = Queue()
# 認識対象言語の設定
languages = ["Japanese", "English"]
countries = ["Japan", "United States"]
# 音声認識の実行
def transcription_loop():
while True:
success = transcriber.transcribeAudioQueue(
audio_queue, languages, countries
)
if success:
result = transcriber.getTranscript()
print(f"認識結果: {result['text']}")
print(f"言語: {result['language']}")
# バックグラウンドで実行
import threading
thread = threading.Thread(target=transcription_loop)
thread.daemon = True
thread.start()
```
### Whisperエンジンの使用
```python
# Whisper音声認識の初期化
whisper_transcriber = AudioTranscriber(
speaker=True, # スピーカー音声
source=speaker_source,
phrase_timeout=5,
max_phrases=5,
transcription_engine="Whisper",
whisper_weight_type="base", # Whisperモデル
device="cuda", # CUDA使用
device_index=0,
compute_type="float16" # 半精度浮動小数点
)
# Whisper固有パラメータでの認識
success = whisper_transcriber.transcribeAudioQueue(
audio_queue, languages, countries,
avg_logprob=-0.5, # より厳しい品質しきい値
no_speech_prob=0.4 # より敏感な無音検出
)
```
### コールバック処理
```python
def on_transcription_result(result):
"""認識結果のコールバック処理"""
if result["text"]:
print(f"認識成功: {result['text']}")
print(f"言語: {result['language']}")
print(f"信頼度: {result.get('confidence', 'N/A')}")
else:
print("音声認識失敗")
# 結果通知の設定
transcriber.transcript_changed_event.set() # イベント設定
```
### エラーハンドリング付きの使用
```python
def safe_transcription(transcriber, audio_queue, languages, countries):
"""安全な音声認識処理"""
try:
success = transcriber.transcribeAudioQueue(
audio_queue, languages, countries
)
if success:
result = transcriber.getTranscript()
return result
else:
return {"text": False, "language": None, "error": "認識失敗"}
except Exception as e:
print(f"音声認識エラー: {e}")
return {"text": False, "language": None, "error": str(e)}
```
## 認識エンジン比較
### Google Speech Recognition
#### 利点
- 高い認識精度
- 多言語対応
- リアルタイム処理
- ノイズ耐性
#### 制限
- インターネット接続必須
- API制限
- プライバシー懸念
- レイテンシ
### OpenAI Whisper(faster-whisper)
#### 利点
- オフライン動作
- プライバシー保護
- 高精度
- 多言語対応
#### 制限
- 初回起動時間
- メモリ使用量
- CUDA推奨
- モデルファイル必要
## 設定パラメータ
### フレーズ制御
- **phrase_timeout**: フレーズ間無音時間(秒)
- **max_phrases**: バッファ内最大フレーズ数
### Whisper品質設定
- **avg_logprob**: 平均対数確率しきい値(-1.0〜0.0)
- **no_speech_prob**: 無音判定しきい値(0.0〜1.0)
### 計算設定
- **device**: "cpu" または "cuda"
- **compute_type**: "float32", "float16", "int8" など
## 音声データフォーマット
### 入力形式
- サンプリングレート: 16kHz推奨
- ビット深度: 16bit
- チャンネル: モノラル推奨
- フォーマット: WAV、FLAC等
### 処理フロー
1. 音声キューからデータ取得
2. 音声フォーマット正規化
3. 音声認識エンジン実行
4. 結果の後処理・フィルタリング
5. 最終結果の通知
## パフォーマンス最適化
### メモリ管理
- 音声バッファの適切なサイズ設定
- 不要な音声データの早期解放
- Whisperモデルのメモリ効率化
### 計算最適化
- CUDA使用による高速化
- 適切な計算精度選択
- バッチ処理の活用
### レイテンシ削減
- 音声バッファサイズの最適化
- エンジン切り替えの高速化
- キャッシュ機能の活用
## エラーハンドリング
### ネットワークエラー
- Google API接続失敗の検出
- 自動Whisperエンジン切り替え
### 音声品質エラー
- 低品質音声の検出・フィルタリング
- ノイズレベル監視
### リソースエラー
- VRAM不足の検出
- メモリ不足時の対応
## 依存関係
### 必須依存関係
- `speech_recognition`: Google音声認識
- `faster_whisper`: Whisper音声認識
- `pyaudiowpatch`: 音声入力
- `pydub`: 音声処理
### オプション依存関係
- `torch`: CUDA計算
- `utils`: エラーログ機能
## 注意事項
- Google APIは使用制限あり
- Whisperは初回起動に時間要
- CUDA使用時はVRAM消費に注意
- 音声品質が認識精度に大きく影響
- 多言語認識時は処理負荷増加
## 関連モジュール
- `transcription_recorder.py`: 音声録音
- `transcription_whisper.py`: Whisperモデル管理
- `transcription_languages.py`: 言語コード管理
- `config.py`: 認識設定管理
- `model.py`: 音声認識統合制御
@@ -0,0 +1,373 @@
# transcription_whisper.py - Whisperモデル管理
## 概要
OpenAI Whisper(faster-whisper)モデルのダウンロード、検証、読み込みを管理するユーティリティモジュールです。複数のモデルサイズをサポートし、Hugging Face Hubからの自動ダウンロード機能とファイル整合性チェック機能を提供します。
## 主要機能
### モデル管理
- 複数Whisperモデルサイズの対応
- Hugging Face Hubからの自動ダウンロード
- モデルファイルの整合性検証
### ダウンロード機能
- 進捗表示付きダウンロード
- レジューム対応
- エラーハンドリング
### モデル読み込み
- 効率的なモデル初期化
- CUDA対応
- 計算タイプ最適化
## サポートモデル
### 利用可能なモデル
```python
_MODELS = {
"tiny": "Systran/faster-whisper-tiny", # ~39MB
"base": "Systran/faster-whisper-base", # ~74MB
"small": "Systran/faster-whisper-small", # ~244MB
"medium": "Systran/faster-whisper-medium", # ~769MB
"large-v1": "Systran/faster-whisper-large-v1", # ~1.5GB
"large-v2": "Systran/faster-whisper-large-v2", # ~1.5GB
"large-v3": "Systran/faster-whisper-large-v3", # ~1.5GB
"large-v3-turbo-int8": "Zoont/faster-whisper-large-v3-turbo-int8-ct2", # ~794MB
"large-v3-turbo": "deepdml/faster-whisper-large-v3-turbo-ct2" # ~1.58GB
}
```
### モデル特性比較
#### tiny
- **サイズ**: ~39MB
- **精度**: 低
- **速度**: 最高速
- **用途**: リアルタイム処理、リソース制限環境
#### base
- **サイズ**: ~74MB
- **精度**: 中程度
- **速度**: 高速
- **用途**: 一般的な用途、バランス重視
#### small
- **サイズ**: ~244MB
- **精度**: 良好
- **速度**: 中程度
- **用途**: 品質重視、モバイル環境
#### medium
- **サイズ**: ~769MB
- **精度**: 高
- **速度**: やや低速
- **用途**: 高品質認識、デスクトップ環境
#### large系
- **サイズ**: ~1.5GB
- **精度**: 最高
- **速度**: 低速
- **用途**: 最高品質、サーバー環境
## 主要関数
### ファイルダウンロード
```python
downloadFile(url: str, path: str, func: Optional[Callable[[float], None]] = None) -> None
```
ファイルのストリームダウンロード
#### パラメータ
- **url**: ダウンロードURL
- **path**: 保存先パス
- **func**: 進捗コールバック関数
### モデル検証
```python
checkWhisperWeight(root: str, weight_type: str) -> bool
```
Whisperモデルの利用可能性確認
#### パラメータ
- **root**: アプリケーションルートパス
- **weight_type**: モデルタイプ("tiny", "base"等)
#### 戻り値
- **bool**: モデルが利用可能かどうか
### モデルダウンロード
```python
downloadWhisperWeight(root: str, weight_type: str,
callback: Optional[Callable[[float], None]] = None,
end_callback: Optional[Callable[[], None]] = None) -> None
```
Whisperモデルのダウンロード
#### パラメータ
- **root**: アプリケーションルートパス
- **weight_type**: ダウンロードするモデルタイプ
- **callback**: 進捗コールバック
- **end_callback**: 完了コールバック
### モデル読み込み
```python
getWhisperModel(root: str, weight_type: str, device: str = "cpu",
device_index: int = 0, compute_type: str = "auto") -> WhisperModel
```
Whisperモデルの初期化
#### パラメータ
- **root**: アプリケーションルートパス
- **weight_type**: 使用するモデルタイプ
- **device**: 計算デバイス("cpu"/"cuda")
- **device_index**: デバイスインデックス
- **compute_type**: 計算精度タイプ
#### 戻り値
- **WhisperModel**: 初期化されたWhisperモデルインスタンス
## 使用方法
### モデルの確認とダウンロード
```python
from models.transcription.transcription_whisper import checkWhisperWeight, downloadWhisperWeight
root_path = "."
model_type = "base"
# モデルの利用可能性確認
if not checkWhisperWeight(root_path, model_type):
print(f"{model_type}モデルが見つかりません。ダウンロードします...")
# 進捗コールバック
def progress_callback(progress):
print(f"ダウンロード進捗: {progress:.1%}")
# 完了コールバック
def completion_callback():
print("ダウンロード完了!")
# モデルダウンロード
downloadWhisperWeight(
root=root_path,
weight_type=model_type,
callback=progress_callback,
end_callback=completion_callback
)
else:
print(f"{model_type}モデルは利用可能です")
```
### モデルの読み込みと使用
```python
from models.transcription.transcription_whisper import getWhisperModel
# CPUでのモデル読み込み
model = getWhisperModel(
root=".",
weight_type="base",
device="cpu"
)
# CUDAでのモデル読み込み(GPU使用)
gpu_model = getWhisperModel(
root=".",
weight_type="small",
device="cuda",
device_index=0,
compute_type="float16" # 半精度で高速化
)
# 音声認識の実行
audio_file = "audio.wav"
segments, info = model.transcribe(audio_file, language="ja")
for segment in segments:
print(f"{segment.start:.1f}s - {segment.end:.1f}s: {segment.text}")
```
### エラーハンドリング付きの使用
```python
def safe_model_loading(root, weight_type, device="cpu"):
"""安全なモデル読み込み"""
try:
# モデル存在確認
if not checkWhisperWeight(root, weight_type):
print(f"モデル {weight_type} をダウンロード中...")
downloadWhisperWeight(root, weight_type)
# モデル読み込み
model = getWhisperModel(root, weight_type, device)
return model
except Exception as e:
print(f"モデル読み込みエラー: {e}")
# フォールバック: より小さなモデルを試す
if weight_type != "tiny":
return safe_model_loading(root, "tiny", device)
return None
```
### 進捗表示付きダウンロード
```python
import sys
def download_with_progress(root, weight_type):
"""進捗表示付きダウンロード"""
def show_progress(progress):
bar_length = 40
filled_length = int(bar_length * progress)
bar = '█' * filled_length + '-' * (bar_length - filled_length)
sys.stdout.write(f'\r[{bar}] {progress:.1%}')
sys.stdout.flush()
def download_complete():
print("\nダウンロード完了!")
print(f"Whisper {weight_type} モデルをダウンロード中...")
downloadWhisperWeight(root, weight_type, show_progress, download_complete)
```
## ディレクトリ構造
### モデルファイル配置
```
root/
└── weights/
└── whisper/
├── tiny/
│ ├── config.json
│ ├── preprocessor_config.json
│ ├── model.bin
│ ├── tokenizer.json
│ └── vocabulary.txt
├── base/
└── small/
```
### 必要ファイル
```python
_FILENAMES = [
"config.json", # モデル設定
"preprocessor_config.json", # 前処理設定
"model.bin", # モデルウェイト
"tokenizer.json", # トークナイザー
"vocabulary.txt", # 語彙ファイル
"vocabulary.json" # 語彙ファイル(JSON形式)
]
```
## パフォーマンス考慮事項
### メモリ使用量
- **tiny**: ~100MB RAM
- **base**: ~200MB RAM
- **small**: ~500MB RAM
- **medium**: ~1.5GB RAM
- **large**: ~3GB RAM
### VRAM使用量(CUDA使用時)
- **tiny**: ~200MB VRAM
- **base**: ~300MB VRAM
- **small**: ~600MB VRAM
- **medium**: ~1.8GB VRAM
- **large**: ~3.5GB VRAM
### 処理速度(目安)
- **tiny**: リアルタイム処理可能
- **base**: 1x-2x リアルタイム
- **small**: 0.5x-1x リアルタイム
- **medium**: 0.2x-0.5x リアルタイム
- **large**: 0.1x-0.3x リアルタイム
## 計算タイプ設定
### 利用可能な計算タイプ
- **float32**: 最高精度、低速
- **float16**: 高精度、中速(CUDA推奨)
- **int8**: 中精度、高速
- **int8_float16**: 混合精度、バランス
### 推奨設定
```python
# CPU使用時
compute_type = "int8" # 速度重視
# CUDA使用時(RTX以上)
compute_type = "float16" # 精度と速度のバランス
# CUDA使用時(VRAM制限)
compute_type = "int8_float16" # メモリ効率重視
```
## エラーハンドリング
### ダウンロードエラー
- ネットワーク接続失敗
- ディスク容量不足
- 権限不足
### モデル読み込みエラー
- VRAM不足
- 破損したモデルファイル
- 非対応デバイス
### 対応策
```python
def robust_model_loading(root, preferred_type="base"):
"""堅牢なモデル読み込み"""
model_priority = ["tiny", "base", "small", "medium"]
# 優先モデルを先頭に配置
if preferred_type in model_priority:
model_priority.remove(preferred_type)
model_priority.insert(0, preferred_type)
for model_type in model_priority:
try:
if checkWhisperWeight(root, model_type):
return getWhisperModel(root, model_type)
except Exception as e:
print(f"{model_type} モデル読み込み失敗: {e}")
continue
raise RuntimeError("利用可能なWhisperモデルがありません")
```
## 依存関係
### 必須依存関係
- `faster_whisper`: Whisperエンジン
- `requests`: ファイルダウンロード
- `utils`: ユーティリティ機能
### オプション依存関係
- `torch`: CUDA計算(GPU使用時)
## 注意事項
- 初回モデル読み込み時はダウンロードに時間がかかる
- 大きなモデルほど高精度だが、メモリとVRAMを大量消費
- CUDAを使用する場合は適切なGPUドライバーが必要
- モデルファイルの整合性チェックが重要
- ネットワーク環境によってダウンロード時間が大きく変動
## 関連モジュール
- `transcription_transcriber.py`: Whisper音声認識エンジン
- `config.py`: Whisperモデル設定管理
- `utils.py`: 計算デバイス管理
- `model.py`: Whisper統合制御
@@ -0,0 +1,87 @@
# translation_gemini.py - Gemini 翻訳クライアント
## 概要
Google Gemini / Gemma 系モデルを翻訳用途で利用するためのクライアントラッパー。モデル一覧取得・認証・モデル選択・翻訳実行を統一インターフェースで提供する。
## 最近の更新 (2025-10-20)
- 新規追加: Gemini クライアント統合
- 除外キーワード (`audio`, `image`, `veo`, `tts`, `robotics`, `computer-use`) により非テキスト指向モデルをフィルタ
- `generateContent` をサポートするモデルのみ採用
- YAML (`prompt/translation_gemini.yml`) からシステムプロンプト (`system_prompt`) をロード
### 影響
| 項目 | 内容 |
|------|------|
| 正確性 | 非テキスト特化モデル除外で翻訳品質安定 |
| 保守性 | 明示的フィルタリングロジックで再利用容易 |
| 一貫性 | 他 LLM クライアントとの API 形状統一 |
## 責務
- API Key 認証確認
- Gemini/Gemma 系モデル列挙とフィルタリング
- モデル選択検証と内部保持
- LangChain `ChatGoogleGenerativeAI` インスタンス生成
- システムプロンプトによる翻訳実行
## 公開API (メソッド)
```python
class GeminiClient:
def __init__(root_path: str = None)
def getModelList() -> list[str]
def getAuthKey() -> str | None
def setAuthKey(api_key: str) -> bool
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setAuthKey`: `_authentication_check` 成功時のみ内部保存
- `getModelList`: フィルタリング適用後ソート
- `setModel`: 取得済みモデル一覧内のみ受理
- `updateClient`: `ChatGoogleGenerativeAI` を再構築
- `translate`: システム + ユーザメッセージ構築→呼び出し→レスポンス正規化
## 使用例
```python
client = GeminiClient()
if client.setAuthKey("GEMINI_API_KEY"):
models = client.getModelList()
if models:
client.setModel(models[0])
client.updateClient()
result = client.translate("こんにちは世界", "Japanese", "English")
print(result)
```
## 依存関係
- `google.genai`: モデル列挙 / 認証
- `langchain_google_genai.ChatGoogleGenerativeAI`: LangChain ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- 非テキスト向けモデル (画像/音声/ロボティクス等) は除外
- ストリーミング無効 (streaming=False)
- API Key 必須 (未設定時 getModelList 不可)
## 制限事項
- 詳細エラーを包括的に扱わない (上位層でロギング/フォールバック)
- 複雑レスポンス構造は単純文字列へ normalize のみ
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
@@ -0,0 +1,87 @@
# translation_groq.py - Groq 翻訳クライアント
## 概要
Groq API を用いた高速 LLM 翻訳クライアントラッパー。OpenAI 互換エンドポイント (`https://api.groq.com/openai/v1`) を利用し、モデル一覧取得・認証・モデル選択・翻訳実行を提供する。
## 最近の更新 (2025-12-10)
- Groq API サポートを新規追加
- OpenAI 互換エンドポイント経由で高速 LLM 推論を実現
- 除外キーワード (`whisper`, `embedding`, `image`, `tts`, `audio`, `search`, `transcribe`, `diarize`, `vision`) によるテキスト処理モデルのフィルタリング
- YAML (`prompt/translation_groq.yml`) からシステムプロンプトをロード
### 影響
| 項目 | 内容 |
|------|------|
| 高速化 | Groq の専用ハードウェアによる高速推論 |
| 互換性 | OpenAI 互換 API で既存実装との一貫性維持 |
| 保守性 | OpenAI クライアントと同様の設計で保守容易 |
## 責務
- Groq API Key (`gsk-` で始まる40文字以上) を用いた認証確認
- 利用可能モデルのフィルタリングとソート
- 選択モデルの検証と内部保持
- LangChain `ChatOpenAI` インスタンス生成(base_url に Groq エンドポイント指定)
- システムプロンプトによる翻訳実行
## 公開API (メソッド)
```python
class GroqClient:
def __init__(root_path: str = None)
def getModelList() -> list[str]
def getAuthKey() -> str | None
def setAuthKey(api_key: str) -> bool
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setAuthKey`: `_authentication_check` に成功した場合のみ内部保存
- `getModelList`: モデル列挙後フィルタリング適用しソート
- `setModel`: 取得済みリスト内のモデルのみ受理
- `updateClient`: `ChatOpenAI` を選択モデル・Groq base_url で再生成
- `translate`: システム + ユーザメッセージ構築→LLM呼び出し→レスポンス正規化
## 使用例
```python
client = GroqClient()
if client.setAuthKey("gsk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):
models = client.getModelList()
client.setModel(models[0])
client.updateClient()
result = client.translate("こんにちは世界", "Japanese", "English")
print(result)
```
## 依存関係
- `openai.OpenAI`: モデル列挙 / 推論(Groq エンドポイント経由)
- `langchain_openai.ChatOpenAI`: LangChain ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- base_url は固定で `https://api.groq.com/openai/v1`
- ストリーミング無効 (streaming=False) 固定
- API Key 無設定時 `getModelList()` は空
- API Key は `gsk` で始まり40文字以上であることを検証
## 制限事項
- エラーメッセージ詳細は包括的に扱わない (上位層でロギング)
- 翻訳結果の構造が複雑 (list/dict) 場合を単純文字列へ normalize するのみ
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
- `details/translation_openai.md` (類似実装)
@@ -0,0 +1,389 @@
# translation_languages.py - 翻訳言語マッピング
## 概要
翻訳エンジンが対応する言語コードのマッピングテーブルを提供するモジュールです。複数の翻訳エンジン(DeepL、Google、Bing、Papago等)の言語コード仕様の差異を吸収し、統一的な翻訳言語管理を実現します。
## 主要機能
### 多エンジン対応
- DeepL(無料版・API版)
- Google Translate
- Microsoft Translator(Bing)
- Papago Translator
- その他のWeb翻訳サービス
### 言語コード統合管理
- 各エンジン固有の言語コード形式を統一
- 送信元(source)と送信先(target)言語の分離管理
- 地域固有言語バリエーションの対応
## データ構造
### translation_lang
```python
translation_lang: Dict[str, Dict[str, Dict[str, str]]] = {
"エンジン名": {
"source": {"言語名": "言語コード", ...},
"target": {"言語名": "言語コード", ...}
}
}
```
### DeepL翻訳エンジン(無料版)
```python
translation_lang["DeepL"] = {
"source": {
"Arabic": "ar", "Bulgarian": "bg", "Czech": "cs", "Danish": "da",
"German": "de", "Greek": "el", "English": "en", "Spanish": "es",
"Estonian": "et", "Finnish": "fi", "French": "fr", "Irish": "ga",
"Croatian": "hr", "Hungarian": "hu", "Indonesian": "id",
"Icelandic": "is", "Italian": "it", "Japanese": "ja",
"Korean": "ko", "Lithuanian": "lt", "Latvian": "lv",
"Maltese": "mt", "Bokmal": "nb", "Dutch": "nl",
"Norwegian": "no", "Polish": "pl", "Portuguese": "pt",
"Romanian": "ro", "Russian": "ru", "Slovak": "sk",
"Slovenian": "sl", "Swedish": "sv", "Turkish": "tr",
"Ukrainian": "uk", "Chinese Simplified": "zh",
"Chinese Traditional": "zh"
},
"target": {/* 同じマッピング */}
}
```
### DeepL API(有料版 概要)
```python
translation_lang["DeepL_API"] = {
"source": {/* 基本的にDeepLと同様 */},
"target": {
"Japanese": "ja",
"English American": "en-US", # 地域別対応
"English British": "en-GB",
"Portuguese Brazilian": "pt-BR", # ブラジル・ポルトガル語
"Portuguese European": "pt-PT", # ヨーロッパ・ポルトガル語
"Chinese Simplified": "zh",
"Chinese Traditional": "zh"
/* その他の言語 */
}
}
```
## 主要対応言語
### 西欧言語
- **English**: 英語(米国・英国バリエーション)
- **German**: ドイツ語
- **French**: フランス語
- **Spanish**: スペイン語
- **Italian**: イタリア語
- **Portuguese**: ポルトガル語(ブラジル・欧州)
- **Dutch**: オランダ語
- **Swedish**: スウェーデン語
- **Norwegian**: ノルウェー語
### 東欧・スラブ言語
- **Russian**: ロシア語
- **Polish**: ポーランド語
- **Czech**: チェコ語
- **Slovak**: スロバキア語
- **Ukrainian**: ウクライナ語
- **Bulgarian**: ブルガリア語
- **Croatian**: クロアチア語
- **Slovenian**: スロベニア語
### アジア言語
- **Japanese**: 日本語
- **Korean**: 韓国語
- **Chinese Simplified**: 中国語(簡体字)
- **Chinese Traditional**: 中国語(繁体字)
- **Indonesian**: インドネシア語
### その他の言語
- **Arabic**: アラビア語
- **Turkish**: トルコ語
- **Finnish**: フィンランド語
- **Estonian**: エストニア語
- **Latvian**: ラトビア語
- **Lithuanian**: リトアニア語
- **Maltese**: マルタ語
- **Irish**: アイルランド語
## 使用方法
### 基本的な言語コード取得
```python
from models.translation.translation_languages import translation_lang
# DeepLで日本語から英語への翻訳
deepl_source = translation_lang["DeepL"]["source"]["Japanese"] # "ja"
deepl_target = translation_lang["DeepL"]["target"]["English"] # "en"
# DeepL APIで地域固有の英語指定
deepl_api_target = translation_lang["DeepL_API"]["target"]["English American"] # "en-US"
```
### 対応言語の確認
```python
def get_supported_languages(engine_name):
"""指定エンジンの対応言語一覧取得"""
if engine_name in translation_lang:
engine_data = translation_lang[engine_name]
source_langs = list(engine_data["source"].keys())
target_langs = list(engine_data["target"].keys())
return {
"source": source_langs,
"target": target_langs,
"common": list(set(source_langs) & set(target_langs))
}
return None
# 使用例
deepl_langs = get_supported_languages("DeepL")
print(f"DeepL対応言語数: {len(deepl_langs['common'])}")
```
### 言語コード変換
```python
def convert_language_code(language_name, from_engine, to_engine, direction="source"):
"""エンジン間での言語コード変換"""
try:
# 元エンジンから言語名を確認
from_codes = translation_lang[from_engine][direction]
to_codes = translation_lang[to_engine][direction]
if language_name in from_codes and language_name in to_codes:
return to_codes[language_name]
return None
except KeyError:
return None
# 使用例:DeepLからGoogle Translateへの変換
google_code = convert_language_code("Japanese", "DeepL", "Google", "target")
```
### 翻訳システムでの統合利用
```python
class TranslationLanguageManager:
"""翻訳言語管理クラス"""
@staticmethod
def get_language_code(engine, language, direction="target"):
"""安全な言語コード取得"""
try:
return translation_lang[engine][direction][language]
except KeyError:
return None
@staticmethod
def is_language_supported(engine, language, direction="target"):
"""言語サポート確認"""
try:
return language in translation_lang[engine][direction]
except KeyError:
return False
@staticmethod
def get_compatible_engines(source_lang, target_lang):
"""両言語をサポートするエンジン一覧"""
compatible = []
for engine in translation_lang:
source_supported = TranslationLanguageManager.is_language_supported(
engine, source_lang, "source"
)
target_supported = TranslationLanguageManager.is_language_supported(
engine, target_lang, "target"
)
if source_supported and target_supported:
compatible.append(engine)
return compatible
# 使用例
manager = TranslationLanguageManager()
# 日本語→英語をサポートするエンジン
engines = manager.get_compatible_engines("Japanese", "English")
print(f"対応エンジン: {engines}")
# 特定エンジンでの言語コード取得
ja_code = manager.get_language_code("DeepL", "Japanese", "source")
en_code = manager.get_language_code("DeepL", "English", "target")
```
## エンジン別特徴
### DeepL(無料版)
- **強み**: 高精度、自然な翻訳
- **制限**: 月間使用量制限、API制限
- **対応**: 26言語
### DeepL API(有料版)
- **強み**: DeepLの高精度、地域別言語対応
- **制限**: 従量課金
- **対応**: 地域固有言語バリエーション
### Google Translate
- **強み**: 多言語対応、高速
- **制限**: API制限、精度のばらつき
- **対応**: 100+言語
### Microsoft Translator
- **強み**: リアルタイム翻訳、音声対応
- **制限**: APIキー必要
- **対応**: 70+言語
## 地域バリエーション対応
### 英語の地域別対応
```python
# DeepL APIでの英語バリエーション
"English American": "en-US", # アメリカ英語
"English British": "en-GB", # イギリス英語
```
### ポルトガル語の地域別対応
```python
# ブラジル・ポルトガル語とヨーロッパ・ポルトガル語
"Portuguese Brazilian": "pt-BR",
"Portuguese European": "pt-PT",
```
### 中国語の文字体系対応
```python
# 簡体字・繁体字の区別
"Chinese Simplified": "zh", # 簡体字(中国本土)
"Chinese Traditional": "zh", # 繁体字(台湾・香港)
```
## 拡張性
### 新エンジンの追加
```python
# 新しい翻訳エンジンの追加例
translation_lang["NewEngine"] = {
"source": {
"Japanese": "jp",
"English": "en",
"Korean": "kr"
},
"target": {
"Japanese": "jp",
"English": "en",
"Korean": "kr"
}
}
```
### 新言語の追加
```python
# 既存エンジンへの新言語追加
translation_lang["DeepL"]["source"]["Hindi"] = "hi"
translation_lang["DeepL"]["target"]["Hindi"] = "hi"
```
## エラーハンドリング
### 安全な言語コード取得
```python
def safe_get_language_code(engine, language, direction="target", fallback="en"):
"""フォールバック機能付き言語コード取得"""
try:
return translation_lang[engine][direction][language]
except KeyError:
# フォールバック言語を返す
try:
return translation_lang[engine][direction].get("English", fallback)
except KeyError:
return fallback
```
### 言語サポート検証
```python
def validate_translation_pair(engine, source_lang, target_lang):
"""翻訳ペアの有効性検証"""
try:
engine_data = translation_lang[engine]
source_supported = source_lang in engine_data["source"]
target_supported = target_lang in engine_data["target"]
return {
"valid": source_supported and target_supported,
"source_supported": source_supported,
"target_supported": target_supported
}
except KeyError:
return {
"valid": False,
"source_supported": False,
"target_supported": False,
"error": f"Unknown engine: {engine}"
}
```
## 注意事項
- エンジンによって言語コード形式が異なる
- 地域バリエーションはエンジンにより対応状況が異なる
- 新しい言語追加時は全エンジンでの対応状況を確認
- API制限や課金体系はエンジンごとに異なる
- 一部の言語ペアは翻訳精度に差がある場合がある
## 関連モジュール
- `translation_translator.py`: 翻訳エンジン本体
- `translation_utils.py`: 翻訳ユーティリティ
- `transcription_languages.py`: 音声認識言語マッピング
- `config.py`: 翻訳言語設定管理
- `controller.py`: 言語選択UI制御
## 最近の更新 (2025-10-20)
### CTranslate2 言語構造変更
従来: 重みタイプがトップレベルキー (`translation_lang["m2m100_418M-ct2-int8"]`).
現在: `translation_lang["CTranslate2"][weight_type]["source"|"target"]` のネスト構造。`model.findTranslationEngines` / `translation_translator` で `engine == "CTranslate2"` の場合は `CTRANSLATE2_WEIGHT_TYPE` を用いて内部辞書へアクセス。
### 外部 YAML 言語マッピング導入
`models/translation/languages/languages.yml` を追加し、`config.init_config()` 内で `loadTranslationLanguages(path=config.PATH_LOCAL)` を呼び出し、既存 `translation_lang` にマージ/上書き。読込失敗時は空辞書を返しフォールバック。(PyYAML 追加)
### LMStudio / Ollama 翻訳モデル対応準備
新規ローカル LLM 接続用として LMStudio / Ollama 追加。現段階ではモデルリスト・選択用のエンドポイントとプロパティ (`SELECTABLE_LMSTUDIO_MODEL_LIST`, `SELECTED_LMSTUDIO_MODEL`, `SELECTABLE_OLLAMA_MODEL_LIST`, `SELECTED_OLLAMA_MODEL`) を定義。言語マッピングは今後 YAML 拡張で統合予定(未実装部分は翻訳本体の `translate()` に未統合)。
### モデル選択プロパティ名称統一
Plamo / Gemini / OpenAI の選択モデルプロパティを `PLAMO_MODEL` / `GEMINI_MODEL` / `OPENAI_MODEL` から `SELECTED_PLAMO_MODEL` / `SELECTED_GEMINI_MODEL` / `SELECTED_OPENAI_MODEL` へ統一。保存キーも `SELECTED_*` に更新。
### 影響
| 項目 | 内容 |
|------|------|
| CTranslate2 | ネスト化により言語参照コード修正が必要 |
| YAML | 動的言語追加がコード編集無しに可能 |
| LLM接続 | 今後言語マッピングを YAML で拡張予定(未実装) |
| プロパティ | SELECTED_* へ統一で UI/設定整合性向上 |
@@ -0,0 +1,98 @@
# translation_lmstudio.py - LMStudio ローカル LLM 翻訳クライアント
## 概要
LMStudio 互換 OpenAI API を利用したローカル LLM 翻訳クライアントラッパー。モデル一覧取得・モデル選択・翻訳処理を統一インターフェースで提供する。
## 最近の更新 (2025-12-30)
- 接続失敗時のエラーハンドリング改善
- URL への疎通確認失敗時にモデルリストをクリア (`SELECTABLE_LMSTUDIO_MODEL_LIST = []`)
- 選択モデルをクリア (`SELECTED_LMSTUDIO_MODEL = None`)
- `SELECTABLE_TRANSLATION_ENGINE_STATUS["LMStudio"]` を False に設定
- フロントエンドに通知して UI を同期
## 最近の更新 (2025-10-20)
- 新規追加: ローカル LLM (LMStudio) を翻訳エンジン群へ統合
- `getModelList()` により現在起動中インスタンスから利用可能モデルを取得
- `setModel()` 成功時に `updateClient()` を呼ぶことで LangChain `ChatOpenAI` を再構築
- YAML (`prompt/translation_lmstudio.yml`) からシステムプロンプト (`system_prompt`) と対応言語をロード
### 影響
| 項目 | 内容 |
|------|------|
| 拡張性 | ネットワーク不要のローカル推論を利用可能 |
| 一貫性 | 他 API クライアント (OpenAI/Plamo/Gemini/Ollama) と同一メソッド構成 |
| 保守性 | 翻訳ロジックを共通フォーマットへ集約 |
## 責務
- LMStudio エンドポイントへの疎通確認 (認証代替)
- 利用可能モデル一覧の収集とソート
- 選択モデルの検証と内部保持
- LangChain ラッパーインスタンス生成
- システムプロンプトによる指示付き翻訳実行
## 公開API (メソッド)
```python
class LMStudioClient:
def __init__(base_url: str | None = None, root_path: str = None)
def getBaseURL() -> str | None
def setBaseURL(base_url: str | None) -> bool
def getModelList() -> list[str]
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setBaseURL`: 疎通確認 (_authentication_check) に成功した場合のみ内部更新
- `getModelList`: `OpenAI` クライアントで `/models` を列挙し id を抽出
- `setModel`: `getModelList` 内のモデル名のみ受理
- `updateClient`: `ChatOpenAI` インスタンスを最新モデルで再生成
- `translate`: システム / ユーザメッセージで LLM へ問い合わせし文字列レスポンスを正規化
## 使用例
```python
client = LMStudioClient(base_url="http://localhost:1234/v1")
models = client.getModelList()
if models:
client.setModel(models[0])
client.updateClient()
translated = client.translate("こんにちは世界", "Japanese", "English")
print(translated)
```
## 依存関係
- `openai.OpenAI`: LMStudio OpenAI 互換 API 呼び出し
- `langchain_openai.ChatOpenAI`: LangChain 抽象化
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- `api_key` は固定文字列 "lmstudio" (LMStudio 側で不要のため) を利用
- モデル一覧取得はエンドポイントの互換性に依存 (古いバージョン非対応の可能性)
- `updateClient()` 呼び出し前は `translate()` を利用できない
- **接続失敗時の自動処理:**
- URL への疎通確認(接続テスト)が失敗すると、自動的にモデルリストと選択モデルがクリアされる
- `SELECTABLE_TRANSLATION_ENGINE_STATUS["LMStudio"]` が False に設定され、エンジンが使用不可状態になる
- Controller が自動的にフロントエンドに状態変化を通知
## 制限事項
- ストリーミング未対応 (streaming=False)
- エラーハンドリングは包括的ではなく詳細原因は上位層で処理必要
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
@@ -0,0 +1,98 @@
# translation_ollama.py - Ollama ローカル LLM 翻訳クライアント
## 概要
Ollama サーバー上で稼働するローカル LLM を翻訳エンジンとして扱うためのクライアントラッパー。モデル一覧取得・モデル選択・翻訳実行を統一パターンで提供する。
## 最近の更新 (2025-12-30)
- 接続失敗時のエラーハンドリング改善
- `/api/ping` への疎通確認失敗時にモデルリストをクリア (`SELECTABLE_OLLAMA_MODEL_LIST = []`)
- 選択モデルをクリア (`SELECTED_OLLAMA_MODEL = None`)
- `SELECTABLE_TRANSLATION_ENGINE_STATUS["Ollama"]` を False に設定
- フロントエンドに通知して UI を同期
## 最近の更新 (2025-10-20)
- 新規追加: Ollama を翻訳エンジン群へ統合
- `/api/ping` を用いた疎通確認による簡易認証
- `/api/tags` から利用可能モデル一覧抽出・ソート
- YAML (`prompt/translation_ollama.yml`) からシステムプロンプト (`system_prompt`) と対応言語をロード
### 影響
| 項目 | 内容 |
|------|------|
| 拡張性 | LAN 内ローカル推論を利用可能 |
| 可搬性 | GPU/CPU 任意構成の Ollama 環境に適応 |
| 一貫性 | 他翻訳クライアント (OpenAI/Gemini/Plamo/LMStudio) と統一 API |
## 責務
- Ollama インスタンスへの接続確認
- モデル一覧取得 (タグ列挙) とソート
- 選択モデルの検証と内部保持
- LangChain `ChatOllama` インスタンス生成
- システムプロンプトとユーザ入力を組み立てて翻訳実行
## 公開API (メソッド)
```python
class OllamaClient:
def __init__(root_path: str = None)
def authenticationCheck() -> bool
def getModelList() -> list[str]
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `authenticationCheck`: `/api/ping` が 200 を返すかで利用可否判定
- `getModelList`: 認証成功時のみ `/api/tags` 結果から name 抽出
- `setModel`: 取得済みモデル一覧内に存在する場合のみ設定
- `updateClient`: `ChatOllama` を最新モデルで再生成
- `translate`: system / user メッセージを LLM へ送信し結合結果を正規化
## 使用例
```python
client = OllamaClient()
if client.authenticationCheck():
models = client.getModelList()
if models:
client.setModel(models[0])
client.updateClient()
translated = client.translate("こんにちは世界", "Japanese", "English")
print(translated)
```
## 依存関係
- `requests`: Ping/タグ API 呼び出し
- `langchain_ollama.ChatOllama`: LangChain LLM ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- サーバー既定 URL: `http://localhost:11434`
- モデル一覧取得は起動しているローカルサーバー状態に依存
- `updateClient()` 呼び出し前は `translate()` を利用不可
- **接続失敗時の自動処理:**
- `/api/ping` への疎通確認が失敗すると、自動的にモデルリストと選択モデルがクリアされる
- `SELECTABLE_TRANSLATION_ENGINE_STATUS["Ollama"]` が False に設定され、エンジンが使用不可状態になる
- Controller が自動的にフロントエンドに状態変化を通知
## 制限事項
- ストリーミング未対応 (streaming=False)
- エラー詳細は包括的に扱わない (上位層でフォールバック)
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
@@ -0,0 +1,85 @@
# translation_openai.py - OpenAI 翻訳クライアント
## 概要
OpenAI API (公式または互換エンドポイント) を用いた汎用 LLM 翻訳クライアントラッパー。モデル一覧取得・認証・モデル選択・翻訳実行を提供する。
## 最近の更新 (2025-10-20)
- 除外キーワード (`whisper`, `embedding`, `image`, `tts`, `audio`, `search`, `transcribe`, `diarize`, `vision`) を用いて翻訳非適合モデルをフィルタ
- Fine-tune モデル (`ft:`) は root が `gpt-` で始まる場合採用
- YAML (`prompt/translation_openai.yml`) からシステムプロンプト (`system_prompt`) をロードする構成へ統合
### 影響
| 項目 | 内容 |
|------|------|
| 正確性 | 不適合モデル除外で翻訳品質安定 |
| 保守性 | フィルタリングロジック明示化で再利用容易 |
| 一貫性 | 他翻訳クライアントと API 形状統一 |
## 責務
- OpenAI API Key を用いた認証確認
- 利用可能モデルのフィルタリングとソート
- 選択モデルの検証と内部保持
- LangChain `ChatOpenAI` インスタンス生成
- システムプロンプトによる翻訳実行
## 公開API (メソッド)
```python
class OpenAIClient:
def __init__(base_url: str | None = None, root_path: str = None)
def getModelList() -> list[str]
def getAuthKey() -> str | None
def setAuthKey(api_key: str) -> bool
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setAuthKey`: `_authentication_check` に成功した場合のみ内部保存
- `getModelList`: モデル列挙後フィルタリング適用しソート
- `setModel`: 取得済みリスト内のモデルのみ受理
- `updateClient`: `ChatOpenAI` を選択モデルで再生成
- `translate`: システム + ユーザメッセージ構築→LLM呼び出し→レスポンス正規化
## 使用例
```python
client = OpenAIClient()
if client.setAuthKey("OPENAI_API_KEY"):
models = client.getModelList()
client.setModel(models[0])
client.updateClient()
result = client.translate("こんにちは世界", "Japanese", "English")
print(result)
```
## 依存関係
- `openai.OpenAI`: モデル列挙 / 推論
- `langchain_openai.ChatOpenAI`: LangChain ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- `base_url` が None の場合公式エンドポイント
- ストリーミング無効 (streaming=False) 固定
- API Key 無設定時 `getModelList()` は空
## 制限事項
- エラーメッセージ詳細は包括的に扱わない (上位層でロギング)
- 翻訳結果の構造が複雑 (list/dict) 場合を単純文字列へ normalize するのみ
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
@@ -0,0 +1,96 @@
# translation_openrouter.py - OpenRouter 翻訳クライアント
## 概要
OpenRouter API を用いた統合 LLM 翻訳クライアントラッパー。OpenAI 互換エンドポイント (`https://openrouter.ai/api/v1`) を利用し、複数の LLM プロバイダーへの統一アクセスを提供する。
## 最近の更新 (2025-12-29)
- OpenRouter API 認証チェック方法を変更
- **以前:** `client.models.list()` を呼び出して認証確認
- **現在:** `https://openrouter.ai/api/v1/auth/key` エンドポイントに GET リクエスト送信して確認
- **理由:** より信頼性の高い専用認証エンドポイントを使用し、高速かつ確実に API キー有効性を検証
- 認証失敗時の sensitive data 処理
- API キー検証失敗時はレスポンス `data` フィールドに `None` を設定(API キーを露出させない)
- エラーメッセージのみを返却し、具体的なキー情報は隠蔽
### 影響
| 項目 | 内容 |
|------|------|
| 柔軟性 | 複数 LLM プロバイダーを単一インターフェースで利用 |
| 互換性 | OpenAI 互換 API で既存実装との一貫性維持 |
| 拡張性 | 新規モデル追加時も API キー再設定不要 |
## 責務
- OpenRouter API Key (20文字以上) を用いた認証確認
- `https://openrouter.ai/api/v1/auth/key` エンドポイントへの HTTP GET リクエストで検証(タイムアウト10秒)
- ステータスコード 200 で有効と判定
- 利用可能モデルのフィルタリングとソート
- 選択モデルの検証と内部保持
- LangChain `ChatOpenAI` インスタンス生成(base_url に OpenRouter エンドポイント指定)
- システムプロンプトによる翻訳実行
## 公開API (メソッド)
```python
class OpenRouterClient:
def __init__(root_path: str = None)
def getModelList() -> list[str]
def getAuthKey() -> str | None
def setAuthKey(api_key: str) -> bool
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setAuthKey`: `_authentication_check` に成功した場合のみ内部保存
- `getModelList`: モデル列挙後フィルタリング適用しソート
- `setModel`: 取得済みリスト内のモデルのみ受理
- `updateClient`: `ChatOpenAI` を選択モデル・OpenRouter base_url で再生成
- `translate`: システム + ユーザメッセージ構築→LLM呼び出し→レスポンス正規化
## 使用例
```python
client = OpenRouterClient()
if client.setAuthKey("sk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):
models = client.getModelList()
# OpenRouter は多数のモデルを提供
client.setModel("anthropic/claude-3-sonnet")
client.updateClient()
result = client.translate("こんにちは世界", "Japanese", "English")
print(result)
```
## 依存関係
- `openai.OpenAI`: モデル列挙 / 推論(OpenRouter エンドポイント経由)
- `langchain_openai.ChatOpenAI`: LangChain ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- base_url は固定で `https://openrouter.ai/api/v1`
- ストリーミング無効 (streaming=False) 固定
- API Key 無設定時 `getModelList()` は空
- API Key は20文字以上であることを検証
## 制限事項
- エラーメッセージ詳細は包括的に扱わない (上位層でロギング)
- 翻訳結果の構造が複雑 (list/dict) 場合を単純文字列へ normalize するのみ
- OpenRouter の料金体系はモデル毎に異なる(利用前に確認が必要)
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
- `details/translation_openai.md` (類似実装)
- `details/translation_groq.md` (類似実装)
@@ -0,0 +1,86 @@
# translation_plamo.py - Plamo 翻訳クライアント
## 概要
Preferred Networks 提供の Plamo API を利用した翻訳向け LLM クライアントラッパー。モデル一覧取得・認証・モデル選択・翻訳実行を統一インターフェースで提供する。
## 最近の更新 (2025-10-20)
- 新規追加: Plamo クライアント統合
- プロンプト設定を YAML (`prompt/translation_plamo.yml`) からロード(システムプロンプト `system_prompt`)
- モデル一覧取得後ソートして再現性を確保
### 影響
| 項目 | 内容 |
|------|------|
| 拡張性 | 日本発 API への対応により選択肢拡大 |
| 保守性 | 他 LLM クライアントと同一構造でメンテ容易 |
| 一貫性 | メソッド命名/責務の統一化 |
## 責務
- API Key 認証確認
- 利用可能モデルの列挙とソート
- モデル選択の検証
- LangChain `ChatOpenAI` インスタンス生成
- システムプロンプトによる翻訳実行
## 公開API (メソッド)
```python
class PlamoClient:
def __init__(root_path: str = None)
def getModelList() -> list[str]
def getAuthKey() -> str | None
def setAuthKey(api_key: str) -> bool
def getModel() -> str | None
def setModel(model: str) -> bool
def updateClient() -> None
def translate(text: str, input_lang: str, output_lang: str) -> str
```
### メソッド詳細
- `setAuthKey`: `_authentication_check` 成功時のみ内部保存
- `getModelList`: 認証済み状態でモデル列挙→ソート
- `setModel`: 列挙済みリスト内モデルのみ受理
- `updateClient`: `ChatOpenAI` を再構築
- `translate`: システム + ユーザメッセージで推論し応答正規化
## 使用例
```python
client = PlamoClient()
if client.setAuthKey("PLAMO_API_KEY"):
models = client.getModelList()
if models:
client.setModel(models[0])
client.updateClient()
result = client.translate("こんにちは世界", "Japanese", "English")
print(result)
```
## 依存関係
- `openai.OpenAI`: Plamo 互換 API 呼び出し
- `langchain_openai.ChatOpenAI`: LangChain ラッパー
- `translation_languages.translation_lang`: 対応言語集合
- `translation_utils.loadPromptConfig`: プロンプト YAML ロード
## 注意事項
- BASE_URL 固定: `https://api.platform.preferredai.jp/v1`
- API Key 未設定時はモデル一覧取得不可
- ストリーミング無効 (streaming=False)
## 制限事項
- 詳細エラーは包括的に扱わず (上位層でログ/フォールバック)
- 翻訳結果の構造が複雑な場合単純文字列へ normalize のみ
## 関連ドキュメント
- `details/translation_translator.md`
- `details/translation_languages.md`
@@ -0,0 +1,186 @@
# 翻訳プロンプトへの履歴注入(Chat/Mic/Speaker)
LLM は直前までの会話文脈を理解して翻訳品質を向上させられます。そのため、システムプロンプトに最近の履歴(Chat/Mic/Speaker)を内包する機能を追加しました。大量のログでトークン消費が増えないよう、YAML 設定で取り込み範囲と上限を管理できます。
## アーキテクチャ
### 履歴管理(Model)
**`model.py`** でChat/Mic/Speakerのメッセージ履歴を一元管理:
```python
# 履歴バッファ(最大50件)
self.translation_history: list[dict] = []
self.translation_history_max_items = 50
# 履歴追加(オリジナルメッセージのみ、翻訳結果は保存しない)
model.addTranslationHistory("chat", "こんにちは")
model.addTranslationHistory("mic", "今日はいい天気")
model.addTranslationHistory("speaker", "Hello!")
# 履歴取得
history = model.getTranslationHistory(max_items=10)
# 履歴クリア
model.clearTranslationHistory()
```
### 自動注入(Model → Translator → 各LLMクライアント)
- **`model.getTranslate()`** で履歴を取得し、`translator.translate(..., context_history=history)` に渡す。
- **`Translator.translate()`** 側でエンジンごとの分岐直前に `setContextHistory()` を呼び、履歴をプロンプト組み立てに反映する。
```python
# model.getTranslate()
history = self.getTranslationHistory()
translation = self.translator.translate(
translator_name=translator_name,
weight_type=config.CTRANSLATE2_WEIGHT_TYPE,
source_language=source_language,
target_language=target_language,
target_country=target_country,
message=message,
context_history=history,
)
# Translator.translate() の一例(OpenAI)
case "OpenAI_API":
if self.openai_client is None:
result = False
else:
if context_history:
self.openai_client.setContextHistory(context_history)
result = self.openai_client.translate(message, input_lang=source_language, output_lang=target_language)
```
### メッセージ処理(Controller)
**`controller.py`** で各メッセージ処理完了後に履歴へ追加(翻訳の成否に関係なく、オリジナル文だけ保存):
- **Chat**: `chatMessage()` の末尾で `model.addTranslationHistory("chat", ...)`
- **Mic**: `micMessage()` の末尾で `model.addTranslationHistory("mic", ...)`
- **Speaker**: `speakerMessage()` の末尾で `model.addTranslationHistory("speaker", ...)`
## 設定ファイル(例: OpenAI)
`src-python/models/translation/translation_settings/prompt/translation_openai.yml`
```yaml
system_prompt: |
You are a helpful translation assistant.
Supported languages:
{supported_languages}
Translate the user provided text from {input_lang} to {output_lang}.
Return ONLY the translated text. Do not add quotes or extra commentary.
history:
use_history: true # 履歴をプロンプトへ注入するか
sources: [chat, mic, speaker] # 取り込み対象の履歴種別
max_messages: 10 # 注入する履歴件数の上限(新しい順)
max_chars: 4000 # 履歴整形後の最大文字数(超過時は先頭を切り捨て)
header_template: |
Conversation context (recent {max_messages} messages):
{history}
item_template: "[{timestamp}][{source}] {text}"
```
- `system_prompt`: 従来どおり、`{supported_languages}`/`{input_lang}`/`{output_lang}` が利用可能。
- `history.use_history`: 履歴注入を有効化します。
- `history.sources`: 取り込み対象ソース。`chat`/`mic`/`speaker` から選択。
- `history.max_messages`: 新しい順に N 件を取り込みます。
- `history.max_chars`: 整形後の履歴文字列の最大長。上限を超えた場合は先頭側を切り捨て(新しい文脈を優先)。
- `history.header_template`: 履歴ヘッダの整形テンプレート。`{max_messages}`/`{history}` が利用可能。
- `history.item_template`: 各履歴アイテムの整形テンプレート。`{timestamp}`(HH:MM形式)/`{source}`/`{text}` が利用可能。
## 実装(OpenAI クライアント)
`src-python/models/translation/translation_openai.py`
- `OpenAIClient.setContextHistory(history_items: list[dict])` を追加。
- `history_items` は以下のキーを含む辞書の配列:
- `source`: `"chat" | "mic" | "speaker"`
- `text`: 文字列
- `timestamp`: ISO形式の日時文字列(HH:MM形式にフォーマットされてプロンプトに挿入)
- `translate()` 呼び出し時、YAML の `history` 設定に基づき、指定履歴をシステムプロンプト末尾へ整形して注入します。
- 文字数上限は簡易的に `max_chars` で制御(トークンカウントは行わず、過剰消費抑制用の安全策)。
## 使い方
### 基本的な流れ
1. **メッセージ発生時に履歴追加**(controller.py で自動実行)
```python
# Chat送信時(オリジナルメッセージのみ保存)
model.addTranslationHistory("chat", user_message)
# Mic入力時(音声認識結果のみ保存)
model.addTranslationHistory("mic", transcribed_text)
# Speaker受信時(受信したオリジナルメッセージのみ保存)
model.addTranslationHistory("speaker", received_text)
```
2. **翻訳時に自動注入**(model.py で自動実行)
```python
# getTranslate() 内で自動的に履歴が各LLMクライアントへ注入される
translation = model.getTranslate(translator_name, ...)
```
3. **設定の調整**(YAML編集)
```yaml
history:
use_history: true # 有効/無効
sources: [chat, mic] # chatとmicのみ使う場合
max_messages: 5 # 最新5件のみ
max_chars: 2000 # 2000文字まで
```
### 手動で履歴を操作(必要な場合のみ)
```python
# 履歴をクリア
model.clearTranslationHistory()
# 履歴を取得
recent_history = model.getTranslationHistory(max_items=10)
# 手動で追加
model.addTranslationHistory("chat", "カスタムメッセージ")
```
## 連携方法(開発者向け)
既存のcontroller/model統合により、**自動で動作**します:
1. ユーザーがChat入力 → `controller.chatMessage()` → メッセージ処理完了後に `model.addTranslationHistory()` 呼び出し(翻訳の成功/失敗に関係なく)
2. マイク音声 → `controller.micMessage()` → メッセージ処理完了後に `model.addTranslationHistory()` 呼び出し(翻訳の成功/失敗に関係なく)
3. スピーカー受信 → `controller.speakerMessage()` → メッセージ処理完了後に `model.addTranslationHistory()` 呼び出し(翻訳の成功/失敗に関係なく)
4. 翻訳実行 → `model.getTranslate()` → LLMクライアントへ履歴を自動注入 → `client.translate()` で履歴付きプロンプト生成
**重要**: 履歴にはオリジナルメッセージのみが保存されます。翻訳結果は履歴に含まれません。これによりトークン消費を抑え、文脈として必要な情報のみを提供します。
**追加実装は不要です。** YAML設定を変更するだけで履歴注入の有効/無効や範囲を制御できます。
## 連携方法
## 対応状況
✅ **全LLMクライアントに展開済み**
以下のすべてのクライアントで履歴注入機能が利用可能です:
- OpenAI (`translation_openai.py` / `translation_openai.yml`)
- Gemini (`translation_gemini.py` / `translation_gemini.yml`)
- Groq (`translation_groq.py` / `translation_groq.yml`)
- OpenRouter (`translation_openrouter.py` / `translation_openrouter.yml`)
- LMStudio (`translation_lmstudio.py` / `translation_lmstudio.yml`)
- Ollama (`translation_ollama.py` / `translation_ollama.yml`)
- Plamo (`translation_plamo.py` / `translation_plamo.yml`)
各クライアントで同一の設定形式とAPIインターフェースを使用します:
- `setContextHistory(history_items: list[dict])` メソッド
- YAML の `history` セクション
## 今後の拡張案
- 実トークン見積りに基づく切り詰め(tiktoken 等)
- 要約モデルを使った古い履歴の縮約
@@ -0,0 +1,492 @@
# translation_translator.py - 翻訳エンジン統合クラス
## 概要
複数の翻訳エンジンを統合管理する高レベル翻訳インターフェースです。DeepL、Google、Bing、Papago、CTranslate2などの多様な翻訳サービスを統一的に扱い、エラー時の自動フォールバック機能と認証管理を提供します。
## 主要機能
### 多エンジン統合
- DeepL(無料版・API版)
- Google Translate(Webスクレイピング)
- Microsoft Translator(Bing)
- Papago Translator
- CTranslate2(ローカル翻訳)
- Plamo API(プリファードネットワークス LLM)
- Gemini API(Google LLM)
- OpenAI API(ChatGPT系)
- Groq API(高速 LLM 推論)
- OpenRouter API(統合 LLM プロバイダー)
- LMStudio(ローカル LLM)
- Ollama(ローカル LLM)
### 統一インターフェース
- エンジン依存を隠蔽した単一の翻訳メソッド
- 自動エラーハンドリング・フォールバック
- 認証情報の統合管理
### オフライン翻訳対応
- CTranslate2による完全オフライン翻訳
- 複数モデルサイズ(small/large)対応
- CUDA高速化サポート
## クラス構造
### Translator クラス
```python
class Translator:
def __init__(self) -> None:
self.deepl_client: Optional[DeepLClient] = None
self.ctranslate2_translator: Any = None
self.ctranslate2_tokenizer: Any = None
self.is_loaded_ctranslate2_model: bool = False
self.is_changed_translator_parameters: bool = False
self.is_enable_translators: bool = ENABLE_TRANSLATORS
```
翻訳機能の中核クラス
#### 属性
- **deepl_client**: DeepL APIクライアント
- **ctranslate2_translator**: ローカル翻訳モデル
- **ctranslate2_tokenizer**: CTranslate2トークナイザー
- **is_loaded_ctranslate2_model**: ローカルモデル読み込み状態
- **is_enable_translators**: Web翻訳サービス利用可能フラグ
## 主要メソッド
### 翻訳実行
```python
translate(translator_name: str, source_language: str, target_language: str,
target_country: str, message: str) -> Any
```
統一翻訳インターフェース
#### パラメータ
- **translator_name**: 翻訳エンジン名("DeepL", "Google", "CTranslate2"等)
- **source_language**: 送信元言語
- **target_language**: 送信先言語
- **target_country**: 送信先国・地域
- **message**: 翻訳対象テキスト
#### 戻り値
- **str**: 翻訳結果(成功時)
- **False**: 翻訳失敗時
### DeepL認証管理
```python
authenticationDeepLAuthKey(authkey: str) -> bool
```
DeepL APIキーの認証と設定
#### パラメータ
- **authkey**: DeepL APIキー
#### 戻り値
- **bool**: 認証成功可否
### CTranslate2管理
```python
changeCTranslate2Model(path: str, model_type: str, device: str = "cpu",
device_index: int = 0, compute_type: str = "auto") -> None
```
ローカル翻訳モデルの読み込み・変更
#### パラメータ
- **path**: モデルファイルのベースパス
- **model_type**: モデルサイズ("small"/"large")
- **device**: 計算デバイス("cpu"/"cuda")
- **device_index**: デバイスインデックス
- **compute_type**: 計算精度タイプ
### 状態管理
```python
isLoadedCTranslate2Model() -> bool
```
CTranslate2モデルの読み込み状態確認
```python
isChangedTranslatorParameters() -> bool
setChangedTranslatorParameters(is_changed: bool) -> None
```
翻訳設定変更フラグの管理
## 使用方法
### 基本的な翻訳
```python
from models.translation.translation_translator import Translator
# 翻訳器の初期化
translator = Translator()
# Google翻訳の使用
result = translator.translate(
translator_name="Google",
source_language="Japanese",
target_language="English",
target_country="United States",
message="こんにちは、世界!"
)
if result != False:
print(f"翻訳結果: {result}") # "Hello, world!"
else:
print("翻訳に失敗しました")
```
### DeepL API使用
```python
# DeepL APIキーの設定
api_key = "your-deepl-api-key"
auth_success = translator.authenticationDeepLAuthKey(api_key)
if auth_success:
print("DeepL API認証成功")
# DeepL APIで翻訳
result = translator.translate(
translator_name="DeepL_API",
source_language="English",
target_language="Japanese",
target_country="Japan",
message="Hello, world!"
)
print(f"DeepL翻訳: {result}")
else:
print("DeepL API認証失敗")
```
### ローカル翻訳(CTranslate2)の使用
```python
# ローカルモデルの読み込み
translator.changeCTranslate2Model(
path=".", # アプリケーションルート
model_type="small", # smallモデル使用
device="cuda", # GPU使用
device_index=0,
compute_type="float16" # 半精度で高速化
)
# モデル読み込み確認
if translator.isLoadedCTranslate2Model():
print("CTranslate2モデル読み込み完了")
# ローカル翻訳実行
result = translator.translate(
translator_name="CTranslate2",
source_language="Japanese",
target_language="English",
target_country="United States",
message="機械翻訳のテストです"
)
print(f"ローカル翻訳: {result}")
else:
print("CTranslate2モデル読み込み失敗")
```
### エラーハンドリング付きの翻訳
```python
def safe_translate(translator, message, source_lang="Japanese", target_lang="English"):
"""安全な翻訳処理"""
# 翻訳エンジンの優先順位
engines = ["DeepL_API", "DeepL", "Google", "CTranslate2"]
for engine in engines:
try:
result = translator.translate(
translator_name=engine,
source_language=source_lang,
target_language=target_lang,
target_country="United States",
message=message
)
if result != False:
print(f"{engine}で翻訳成功: {result}")
return result
else:
print(f"{engine}翻訳失敗、次のエンジンを試行")
except Exception as e:
print(f"{engine}でエラー: {e}")
continue
print("全ての翻訳エンジンで失敗")
return None
# 使用例
result = safe_translate(translator, "こんにちは")
```
### 翻訳設定の管理
```python
# 設定変更フラグの確認
if translator.isChangedTranslatorParameters():
print("翻訳設定が変更されています")
# 設定変更の適用(例:モデル再読み込み)
translator.changeCTranslate2Model(".", "small", "cpu")
# フラグのリセット
translator.setChangedTranslatorParameters(False)
```
## 翻訳エンジン比較
### DeepL API(有料)
- **精度**: 最高レベル
- **速度**: 高速
- **制限**: API使用料、月間制限
- **対応**: 26言語、地域別対応
### DeepL(無料)
- **精度**: 高品質
- **速度**: 中程度
- **制限**: 月間使用量制限、文字数制限
- **対応**: 26言語
### Google Translate
- **精度**: 良好
- **速度**: 高速
- **制限**: アクセス頻度制限
- **対応**: 100+言語
### CTranslate2(ローカル)
- **精度**: 中〜高(モデル依存)
- **速度**: 高速(GPU使用時)
- **制限**: なし(オフライン)
- **対応**: 主要言語ペア
### その他(Bing, Papago等)
- **精度**: 中程度
- **速度**: 中程度
- **制限**: サービス依存
- **対応**: サービス固有
## CTranslate2詳細
### 対応モデル
```python
ctranslate2_weights = {
"small": {
"url": "m2m100_418m.zip",
"directory_name": "m2m100_418m",
"tokenizer": "facebook/m2m100_418M"
},
"large": {
"url": "m2m100_12b.zip",
"directory_name": "m2m100_12b",
"tokenizer": "facebook/m2m100_1.2b"
}
}
```
### パフォーマンス特性
#### small モデル
- **サイズ**: ~400MB
- **メモリ**: ~1GB RAM
- **VRAM**: ~500MB(CUDA使用時)
- **速度**: 高速
- **精度**: 良好
#### large モデル
- **サイズ**: ~4.8GB
- **メモリ**: ~6GB RAM
- **VRAM**: ~3GB(CUDA使用時)
- **速度**: 中程度
- **精度**: 高品質
### 計算タイプ設定
```python
# CPU使用時
compute_type = "int8" # 速度重視
# CUDA使用時
compute_type = "float16" # バランス重視
compute_type = "int8_float16" # メモリ効率重視
```
## エラーハンドリング
### ネットワークエラー
- 接続タイムアウト
- API制限超過
- サービス一時停止
### 認証エラー
- 無効なAPIキー
- 期限切れアカウント
- 使用量上限到達
### モデルエラー
- ファイル破損
- VRAM不足
- 非対応言語ペア
### 対応策
```python
def robust_translation(translator, message, source_lang, target_lang):
"""堅牢な翻訳処理"""
# オンライン翻訳を先に試行
online_engines = ["DeepL_API", "DeepL", "Google"]
for engine in online_engines:
try:
result = translator.translate(engine, source_lang, target_lang, "", message)
if result != False:
return result
except Exception as e:
print(f"{engine}エラー: {e}")
continue
# オンライン翻訳が全て失敗した場合、ローカル翻訳にフォールバック
try:
if not translator.isLoadedCTranslate2Model():
translator.changeCTranslate2Model(".", "small", "cpu")
result = translator.translate("CTranslate2", source_lang, target_lang, "", message)
if result != False:
return result
except Exception as e:
print(f"ローカル翻訳エラー: {e}")
return "翻訳に失敗しました"
```
## 依存関係
### 必須依存関係
- `translation_languages`: 言語コード管理
- `translation_utils`: CTranslate2ユーティリティ
- `utils`: エラーログ、計算デバイス管理
### オプション依存関係
- `deepl`: DeepL APIライブラリ
- `translators`: Web翻訳サービスライブラリ
- `ctranslate2`: ローカル翻訳エンジン
- `transformers`: トークナイザー
## 設定要件
### 環境変数
- `DEEPL_AUTH_KEY`: DeepL APIキー(オプション)
### ファイル配置
```
root/
└── weights/
└── ctranslate2/
├── m2m100_418m/ # smallモデル
└── m2m100_12b/ # largeモデル
```
## 注意事項
- Web翻訳サービスは利用制限に注意
- CTranslate2の初回読み込みは時間がかかる
- GPU使用時はVRAM消費量に注意
- API認証情報の適切な管理が必要
- 長文翻訳時は分割処理を推奨
## 関連モジュール
- `translation_languages.py`: 言語コードマッピング
- `translation_utils.py`: CTranslate2ユーティリティ
- `config.py`: 翻訳設定管理
- `model.py`: 翻訳機能統合
- `controller.py`: 翻訳制御インターフェース
## 最近の更新
### 2025-12-10: Groq API および OpenRouter API サポート追加
#### Groq API 統合
- Groq API (`https://api.groq.com/openai/v1`) を翻訳エンジンとして追加
- OpenAI 互換エンドポイントで高速 LLM 推論を実現
- API キーバリデーション(`gsk` で始まり40文字以上)
- モデルリスト自動取得とフィルタリング(テキスト処理モデルのみ)
- 認証成功時に `SELECTABLE_GROQ_MODEL_LIST` を更新、未選択時は先頭モデルを自動選択
- API キー無効時にモデルリストと選択モデルをクリアしフロントエンドに通知
#### OpenRouter API 統合
- OpenRouter API (`https://openrouter.ai/api/v1`) を翻訳エンジンとして追加
- 単一 API キーで複数 LLM プロバイダーへアクセス可能
- API キーバリデーション(20文字以上)
- モデルリスト自動取得とフィルタリング(テキスト処理モデルのみ)
- 認証成功時に `SELECTABLE_OPENROUTER_MODEL_LIST` を更新、未選択時は先頭モデルを自動選択
- API キー無効時にモデルリストと選択モデルをクリアしフロントエンドに通知
#### updateTranslationEngineAndEngineList() の拡張
- `SELECTABLE_TRANSLATION_ENGINE_STATUS` で Groq_API と OpenRouter_API の状態を管理
- 各エンジンの認証キー更新時に自動的にモデルリストを再取得
- フロントエンドへの通知を `run_mapping` 経由で送信
#### 影響
| 項目 | 内容 |
|------|------|
| Groq API | 高速 LLM 推論による翻訳速度向上 |
| OpenRouter API | 単一キーで複数 LLM プロバイダーへアクセス |
| モデル管理 | API キー検証失敗時の自動クリアで一貫性向上 |
| UX改善 | 認証後の自動モデル選択で初期設定簡略化 |
### 2025-10-20: LLM エンジン拡張と最適化
#### 新規ローカル LLM エンジン追加
LMStudio / Ollama を翻訳エンジンとして追加。接続確認後にモデルリスト (`SELECTABLE_LMSTUDIO_MODEL_LIST` / `SELECTABLE_OLLAMA_MODEL_LIST`) を取得し、未選択なら先頭モデルを自動選択 (`SELECTED_LMSTUDIO_MODEL` / `SELECTED_OLLAMA_MODEL`)。現時点では CTranslate2 と同様にローカル動作を想定し、翻訳関数側は将来の統合(温度等パラメータ)に備えて抽象化維持。
#### モデル選択プロパティ名称統一
Plamo / Gemini / OpenAI の選択モデルプロパティを `SELECTED_*` 形式へ変更。旧名称 (`PLAMO_MODEL` / `GEMINI_MODEL` / `OPENAI_MODEL`) は利用停止。自動認証後のモデルリスト更新ロジックで未選択時に先頭補完を行う。
#### OpenAI / Gemini / Plamo 認証後のモデルリスト自動更新
Auth設定メソッド完了時に `SELECTABLE_*_MODEL_LIST` を再取得し不足時は UI へ push。OpenAI はキー設定直後に最新モデルリストを反映し高速化。Gemini / Plamo も同様に `updateTranslator*Client()` 呼び出しでクライアント再生成。
#### CTranslate2 言語ネスト化対応
`translation_lang["CTranslate2"][weight_type]["source"|"target"]` へ構造変更。`CTRANSLATE2_WEIGHT_TYPE` により重みタイプ別の言語集合を参照。Translator 内では `translator_name == "CTranslate2"` の分岐で weight_type を参照して言語判定を行う実装に変更。
#### YAML 言語マッピング導入
外部ファイル `languages.yml` を読み込んで翻訳エンジン別対応言語を動的拡張。新言語追加は YAML 編集のみで実現(コード再デプロイ不要)。読み込み失敗時は空辞書でフォールバックし既存ハードコードを保持。
#### VRAM エラー検知とフォールバック
DeepL / Plamo / Gemini / OpenAI 実行時の VRAM 不足検知で自動的に CTranslate2 へ切替し翻訳を停止 (`ENABLE_TRANSLATION=False`)。ユーザー通知後は再度有効化要求時に再初期化を試行。安定性向上のためログへ VRAM エラー詳細を記録。
#### トークナイザーパス修正
CTranslate2 トークナイザーのダウンロード処理で保存ディレクトリ作成とパス使用順序不整合を修正。これにより初回起動時の失敗率低下。
#### 全言語ペア包括テスト導入
`backend_test.py` にて `test_translate_all_language_pairs()` を追加。複数エンジン・全言語ペアを列挙実行し `translation_test_results.json` を生成。失敗ペアの早期検出と YAML 追加言語検証に活用。
#### 影響
| 項目 | 内容 |
|------|------|
| ローカルLLM | オフライン翻訳候補拡充 (LMStudio/Ollama) |
| プロパティ統一 | SELECTED_* 命名で一貫性と保守性向上 |
| CTranslate2構造 | 重みタイプ毎に最適言語集合参照可能 |
| YAML外部化 | 言語追加/削除が設定ファイル編集のみで完結 |
| VRAM検知 | エラー時自動停止 + 軽量エンジン切替で安定性向上 |
| Tokenizer修正 | 初回セットアップ失敗減少 |
| 包括テスト | 言語組合せの網羅的品質担保 |
@@ -0,0 +1,438 @@
# translation_utils.py - CTranslate2モデル管理ユーティリティ
## 概要
CTranslate2によるローカル機械翻訳モデルの自動ダウンロード、展開、管理を行うユーティリティモジュールです。複数のモデルサイズ(small/large)とプラットフォーム(CPU/CUDA)に対応し、モデルファイルの完全性チェックと自動修復機能を提供します。
## 主要機能
### モデル自動管理
- CTranslate2モデルの自動ダウンロード
- ZIP形式モデルの展開・配置
- モデルファイルの完全性検証
- 破損モデルの自動再取得
### マルチプラットフォーム対応
- CPU版・CUDA版の両対応
- 複数モデルサイズの管理
- プラットフォーム別最適化
## 定数・設定
### モデル定義
```python
# CTranslate2重みファイル情報
ctranslate2_weights = {
"small": {
"url": "m2m100_418m.zip",
"directory_name": "m2m100_418m",
"tokenizer": "facebook/m2m100_418M"
},
"large": {
"url": "m2m100_12b.zip",
"directory_name": "m2m100_12b",
"tokenizer": "facebook/m2m100_1.2b"
}
}
```
### 設定パラメータ
- **BASE_WEIGHTS_URL**: モデル配布ベースURL
- **LOCAL_WEIGHTS_DIR**: ローカル保存ディレクトリ
- **CHUNK_SIZE**: ダウンロード時のチャンクサイズ
## 主要機能
### モデルダウンロード
```python
def downloadCTranslate2Model(model_type: str, device: str = "cpu") -> bool:
"""CTranslate2モデルの自動ダウンロード"""
```
指定されたモデルタイプとデバイス用のモデルをダウンロード
#### パラメータ
- **model_type**: モデルサイズ("small"/"large")
- **device**: 計算デバイス("cpu"/"cuda")
#### 戻り値
- **bool**: ダウンロード成功可否
### モデル存在確認
```python
def checkCTranslate2ModelExists(model_type: str, device: str = "cpu") -> bool:
"""モデルファイルの存在確認"""
```
指定されたモデルがローカルに存在するかチェック
#### パラメータ
- **model_type**: 確認対象モデルタイプ
- **device**: 対象デバイス
#### 戻り値
- **bool**: モデル存在可否
### モデル完全性検証
```python
def validateCTranslate2Model(model_type: str, device: str = "cpu") -> bool:
"""モデルファイルの完全性検証"""
```
ダウンロード済みモデルの整合性を確認
#### パラメータ
- **model_type**: 検証対象モデル
- **device**: 対象デバイス
#### 戻り値
- **bool**: モデル正常性
## 使用方法
### 基本的なモデル管理
```python
from models.translation.translation_utils import *
# smallモデル(CPU版)のダウンロード確認
if not checkCTranslate2ModelExists("small", "cpu"):
print("smallモデルが見つかりません。ダウンロード中...")
success = downloadCTranslate2Model("small", "cpu")
if success:
print("ダウンロード完了")
else:
print("ダウンロード失敗")
else:
print("smallモデルは既に存在します")
```
### GPU用モデルの準備
```python
# CUDA版largeモデルのセットアップ
model_type = "large"
device = "cuda"
# 既存モデルの確認
if checkCTranslate2ModelExists(model_type, device):
# モデルの完全性検証
if validateCTranslate2Model(model_type, device):
print(f"{model_type}モデル({device}版)準備完了")
else:
print("モデルが破損しています。再ダウンロード中...")
# 破損モデルの再取得
downloadCTranslate2Model(model_type, device)
else:
# 新規ダウンロード
print(f"{model_type}モデル({device}版)をダウンロード中...")
downloadCTranslate2Model(model_type, device)
```
### 自動モデル管理システム
```python
def ensureModelReady(model_type="small", device="cpu", max_retries=3):
"""モデルの準備を保証する関数"""
for attempt in range(max_retries):
print(f"モデル準備 試行 {attempt + 1}/{max_retries}")
# モデル存在確認
if not checkCTranslate2ModelExists(model_type, device):
print("モデルが見つかりません。ダウンロード中...")
if not downloadCTranslate2Model(model_type, device):
print(f"ダウンロード失敗(試行 {attempt + 1})")
continue
# モデル完全性確認
if validateCTranslate2Model(model_type, device):
print("モデル準備完了")
return True
else:
print("モデルが破損しています。再取得中...")
# 破損ファイルの削除(実装依存)
# remove_corrupted_model(model_type, device)
continue
print("モデル準備に失敗しました")
return False
# 使用例
if ensureModelReady("small", "cpu"):
print("翻訳システム初期化可能")
else:
print("翻訳システム初期化失敗")
```
### 複数モデルの一括管理
```python
def setupAllModels():
"""全モデルの一括セットアップ"""
models = [
("small", "cpu"),
("small", "cuda"),
("large", "cpu"),
("large", "cuda")
]
results = {}
for model_type, device in models:
print(f"\n=== {model_type}モデル({device}版)セットアップ ===")
# デバイス利用可能性チェック(CUDA版の場合)
if device == "cuda" and not torch.cuda.is_available():
print("CUDA環境が利用できません。スキップします。")
results[(model_type, device)] = False
continue
# モデル準備
success = ensureModelReady(model_type, device)
results[(model_type, device)] = success
if success:
print(f"✓ {model_type}({device}版)準備完了")
else:
print(f"✗ {model_type}({device}版)準備失敗")
# 結果サマリー
print("\n=== セットアップ結果 ===")
for (model_type, device), success in results.items():
status = "成功" if success else "失敗"
print(f"{model_type}({device}版): {status}")
return results
# 全モデルセットアップの実行
setupAllModels()
```
## モデル仕様
### smallモデル(m2m100_418m)
```python
model_info = {
"name": "m2m100_418m",
"size": "~400MB",
"parameters": "418M",
"languages": "100言語",
"tokenizer": "facebook/m2m100_418M",
"memory_requirements": {
"cpu": "~1GB RAM",
"cuda": "~500MB VRAM"
},
"performance": {
"speed": "高速",
"quality": "良好"
}
}
```
#### 特徴
- 高速処理に適している
- メモリ使用量が少ない
- リアルタイム翻訳に最適
- 100言語ペア対応
### largeモデル(m2m100_12b)
```python
model_info = {
"name": "m2m100_12b",
"size": "~4.8GB",
"parameters": "1.2B",
"languages": "100言語",
"tokenizer": "facebook/m2m100_1.2b",
"memory_requirements": {
"cpu": "~6GB RAM",
"cuda": "~3GB VRAM"
},
"performance": {
"speed": "中程度",
"quality": "高品質"
}
}
```
#### 特徴
- 高品質翻訳が可能
- 大容量メモリが必要
- バッチ処理に適している
- 複雑な文章に対応
## ファイル構造
### ディレクトリレイアウト
```
weights/
└── ctranslate2/
├── m2m100_418m/ # smallモデル(CPU版)
│ ├── model.bin
│ ├── vocabulary.txt
│ ├── config.json
│ └── shared_vocabulary.txt
├── m2m100_418m_cuda/ # smallモデル(CUDA版)
│ └── [同様のファイル構成]
├── m2m100_12b/ # largeモデル(CPU版)
│ └── [同様のファイル構成]
└── m2m100_12b_cuda/ # largeモデル(CUDA版)
└── [同様のファイル構成]
```
### 必須ファイル
- `model.bin`: 変換済みモデルウェイト
- `vocabulary.txt`: 語彙ファイル
- `config.json`: モデル設定ファイル
- `shared_vocabulary.txt`: 共有語彙ファイル
## ダウンロード処理
### ネットワーク処理
```python
def downloadWithProgress(url: str, destination: str) -> bool:
"""進捗表示付きダウンロード"""
try:
response = requests.get(url, stream=True)
response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
with open(destination, 'wb') as file:
downloaded = 0
for chunk in response.iter_content(chunk_size=CHUNK_SIZE):
if chunk:
file.write(chunk)
downloaded += len(chunk)
# 進捗表示
if total_size > 0:
progress = (downloaded / total_size) * 100
print(f"\rダウンロード進捗: {progress:.1f}%", end="")
print(f"\nダウンロード完了: {destination}")
return True
except Exception as e:
print(f"\nダウンロードエラー: {e}")
return False
```
### 展開処理
```python
def extractZipModel(zip_path: str, extract_to: str) -> bool:
"""ZIPファイルの展開"""
try:
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
# 展開先ディレクトリの作成
os.makedirs(extract_to, exist_ok=True)
# ファイル展開
zip_ref.extractall(extract_to)
print(f"展開完了: {extract_to}")
# 元のZIPファイルを削除(オプション)
os.remove(zip_path)
print(f"一時ファイル削除: {zip_path}")
return True
except Exception as e:
print(f"展開エラー: {e}")
return False
```
## エラーハンドリング
### ネットワークエラー
- 接続タイムアウト
- ダウンロード中断
- サーバーエラー
### ファイルシステムエラー
- 容量不足
- 権限エラー
- ファイル破損
### リトライ機構
```python
def downloadWithRetry(url: str, destination: str, max_retries: int = 3) -> bool:
"""リトライ付きダウンロード"""
for attempt in range(max_retries):
print(f"ダウンロード試行 {attempt + 1}/{max_retries}")
try:
if downloadWithProgress(url, destination):
return True
except Exception as e:
print(f"試行 {attempt + 1} 失敗: {e}")
# 一時ファイルの清理
if os.path.exists(destination):
os.remove(destination)
# 最後の試行でない場合は少し待機
if attempt < max_retries - 1:
time.sleep(2 ** attempt) # 指数バックオフ
print("全ての試行が失敗しました")
return False
```
## パフォーマンス最適化
### ダウンロード最適化
- チャンク単位での分割ダウンロード
- 進捗表示による体験向上
- 自動リトライによる信頼性確保
### ストレージ最適化
- 一時ファイルの自動削除
- 重複ファイルの検出・排除
- 容量効率的なファイル管理
### メモリ最適化
- ストリーミングダウンロード
- 大容量ファイル対応
- メモリ使用量の制御
## 依存関係
### 必須依存関係
- `requests`: HTTPダウンロード
- `zipfile`: アーカイブ展開
- `os`: ファイルシステム操作
- `pathlib`: パス操作
### オプション依存関係
- `tqdm`: 進捗バー表示(実装による)
- `hashlib`: ファイル整合性検証(実装による)
## 注意事項
- 初回ダウンロードは時間がかかる(モデルサイズ依存)
- 十分なストレージ容量を確保
- ネットワーク環境によってダウンロード速度が変動
- CUDA版は対応GPU環境が必要
- モデルファイルのバックアップ推奨
## 関連モジュール
- `translation_translator.py`: モデル利用クラス
- `translation_languages.py`: 言語コード管理
- `config.py`: 設定管理
- `utils.py`: 共通ユーティリティ
- `device_manager.py`: デバイス管理
@@ -0,0 +1,397 @@
# transliteration_context_rules.py - 文脈的転写ルールエンジン
## 概要
トークン化された結果に対して文脈依存の転写ルールを適用するコンパクトなルールエンジンです。隣接するトークンの情報に基づいて読み(かな)を動的に修正し、より自然で正確な転写を実現します。
## 主要機能
### 文脈依存転写
- 隣接トークン情報を利用した読み修正
- 優先度ベースのルール適用順序
- 正規表現・完全一致の両方に対応
### ルールエンジン
- 埋め込み型ルール定義(外部JSONファイル不要)
- 前方・後方の隣接トークン検査対応
- インプレース変更による効率的処理
### 動的読み変更
- 文脈に応じたかな読みの書き換え
- ひらがな・ヘボン式の自動クリア
- 呼び出し元での再計算トリガー
## ルール定義構造
### DEFAULT_RULES
```python
DEFAULT_RULES = {
"rules": [
{
"name": "nan_next_tdna", # ルール名
"target": "何", # 対象文字
"match_mode": "equals", # マッチモード
"direction": "next", # 検査方向
"kana_set": ["タ", "チ", "ツ"...], # 条件文字セット
"on_true": {"kana": "ナン"}, # 条件真時のアクション
"on_false": {"kana": "ナニ"} # 条件偽時のアクション
}
]
}
```
### ルール要素
#### 基本設定
- **name**: ルールの識別名
- **target**: 適用対象となる文字・文字列
- **priority**: 適用優先度(高い順に処理)
- **match_mode**: マッチングモード("equals"/"regex")
#### 条件設定
- **direction**: 隣接トークン検査方向("next"/"prev")
- **kana_set**: 条件判定用の文字セット
- **pattern**: 正規表現パターン(regex時)
#### アクション設定
- **on_true**: 条件成立時のアクション
- **on_false**: 条件不成立時のアクション
- **kana**: 設定する新しいかな読み
## 主要関数
### apply_context_rules
```python
def apply_context_rules(results: List[Dict[str, Any]], use_macron: bool = False) -> List[Dict[str, Any]]
```
文脈ルールをトークンリストに適用
#### パラメータ
- **results**: `Transliterator.split_kanji_okurigana`で生成されたトークン辞書のリスト
- **use_macron**: 互換性のためのパラメータ(ルール処理では未使用)
#### 戻り値
- **List[Dict[str, Any]]**: 修正されたトークンリスト(インプレース変更も実施)
#### 必須キー
各トークン辞書は以下のキーを含む必要があります:
- **orig**: 元の文字・文字列
- **kana**: かな読み
- **hira**: ひらがな表記
- **hepburn**: ヘボン式ローマ字
## 使用方法
### 基本的な文脈ルール適用
```python
from models.transliteration.transliteration_context_rules import apply_context_rules
# トークン化された結果(例)
results = [
{"orig": "何", "kana": "ナニ", "hira": "なに", "hepburn": "nani"},
{"orig": "度", "kana": "ド", "hira": "ど", "hepburn": "do"},
{"orig": "も", "kana": "モ", "hira": "も", "hepburn": "mo"}
]
# 文脈ルールの適用
modified_results = apply_context_rules(results)
# 結果確認
for token in modified_results:
print(f"{token['orig']}: {token['kana']} -> {token['hira']} ({token['hepburn']})")
# 期待される出力(「何度」の場合):
# 何: ナン -> (再計算必要) (再計算必要)
# 度: ド -> ど (do)
# も: モ -> も (mo)
```
### カスタムルールでの処理
```python
# 独自ルール定義の例
custom_rules = {
"rules": [
{
"name": "custom_rule_example",
"target": "今",
"match_mode": "equals",
"direction": "next",
"kana_set": ["バ", "ビ", "ブ", "ベ", "ボ"],
"priority": 100,
"on_true": {"kana": "イマ"},
"on_false": {"kana": "コン"}
}
]
}
# 注意:現在の実装では DEFAULT_RULES が固定使用されています
# カスタムルールを使用するには関数の拡張が必要です
```
### 正規表現マッチングの例
```python
# 正規表現ルールの定義例
regex_rule = {
"name": "kanji_pattern_rule",
"match_mode": "regex",
"pattern": r"^[一-龯]$", # 任意の漢字1文字
"direction": "next",
"kana_set": ["ア", "イ", "ウ", "エ", "オ"],
"priority": 50,
"on_true": {"kana": "特殊読み"},
"on_false": {"kana": "通常読み"}
}
```
### 転写パイプラインでの統合
```python
def complete_transliteration_pipeline(text):
"""完全な転写パイプライン"""
# 1. 初期分割・転写
transliterator = Transliterator()
tokens = transliterator.split_kanji_okurigana(text)
# 2. 文脈ルール適用
tokens = apply_context_rules(tokens)
# 3. 修正されたトークンの再計算
for token in tokens:
if token.get("kana") and not token.get("hira"):
# ひらがな・ヘボン式の再計算
token["hira"] = katakana_to_hiragana(token["kana"])
token["hepburn"] = hiragana_to_hepburn(token["hira"])
return tokens
# 使用例
text = "何度でも挑戦する"
result = complete_transliteration_pipeline(text)
for token in result:
print(f"{token['orig']} -> {token['kana']} -> {token['hira']} -> {token['hepburn']}")
```
## ルール処理ロジック
### 処理フロー
1. **ルール準備**
- 優先度の降順でソート
- 正規表現の事前コンパイル
2. **トークン走査**
- 各トークンに対してルールを順次適用
- 空の`orig`を持つトークンはスキップ
3. **マッチング判定**
- `equals`: 完全一致判定
- `regex`: 正規表現マッチ判定
4. **隣接トークン検査**
- `direction`に基づく隣接トークン特定
- 空のトークンをスキップして有効トークンを検索
5. **条件評価**
- 隣接トークンの`kana`の先頭文字チェック
- `kana_set`との一致判定
6. **アクション実行**
- 条件に応じて`on_true`/`on_false`を選択
- `kana`の書き換えと`hira`/`hepburn`のクリア
### アルゴリズム詳細
```python
def process_token_with_rules(token_index, tokens, rules):
"""単一トークンのルール処理アルゴリズム"""
token = tokens[token_index]
orig = token.get("orig", "")
# 空トークンはスキップ
if not orig:
return
for rule in rules: # 優先度順
# マッチング判定
if not matches_rule(orig, rule):
continue
# 隣接トークン検索
neighbor = find_neighbor_token(token_index, tokens, rule["direction"])
if neighbor:
# 条件評価
condition = evaluate_condition(neighbor, rule["kana_set"])
# アクション実行
action = rule["on_true"] if condition else rule["on_false"]
apply_action(token, action)
# 最初にマッチしたルールで処理終了
break
def find_neighbor_token(current_index, tokens, direction):
"""隣接する有効トークンを検索"""
if direction == "next":
for i in range(current_index + 1, len(tokens)):
if tokens[i].get("orig"):
return tokens[i]
elif direction == "prev":
for i in range(current_index - 1, -1, -1):
if tokens[i].get("orig"):
return tokens[i]
return None
```
## 具体的なルール例
### 「何」の読み分けルール
```python
{
"name": "nan_next_tdna",
"target": "何",
"match_mode": "equals",
"direction": "next",
"kana_set": ["タ", "チ", "ツ", "テ", "ト", "ダ", "ヂ", "ヅ", "デ", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ"],
"on_true": {"kana": "ナン"},
"on_false": {"kana": "ナニ"}
}
```
#### 動作例
```python
# 「何度」の場合
tokens = [
{"orig": "何", "kana": "ナニ"}, # 初期状態
{"orig": "度", "kana": "ド"} # 次のトークン
]
# ルール適用後
tokens = [
{"orig": "何", "kana": "ナン"}, # 「ド」が kana_set に含まれるため "ナン" に変更
{"orig": "度", "kana": "ド"}
]
# 「何回」の場合
tokens = [
{"orig": "何", "kana": "ナニ"}, # 初期状態
{"orig": "回", "kana": "カイ"} # 次のトークン
]
# ルール適用後
tokens = [
{"orig": "何", "kana": "ナニ"}, # 「カイ」が kana_set に含まれないため "ナニ" のまま
{"orig": "回", "kana": "カイ"}
]
```
## エラーハンドリング
### 正規表現コンパイルエラー
```python
# 不正な正規表現の安全な処理
for rule in rules:
if rule.get("match_mode") == "regex" and rule.get("pattern"):
try:
rule["_re"] = re.compile(rule["pattern"])
except Exception as e:
print(f"正規表現コンパイルエラー: {rule['pattern']} - {e}")
rule["_re"] = None # 無効化
```
### 不正なトークン構造
```python
# 必須キーの存在確認
def validate_token(token):
"""トークンの妥当性検証"""
required_keys = ["orig", "kana", "hira", "hepburn"]
for key in required_keys:
if key not in token:
print(f"警告: トークンに必須キー '{key}' が不足")
token[key] = "" # デフォルト値を設定
return token
```
## パフォーマンス考慮事項
### 効率的な処理
- インプレース変更によるメモリ効率
- 優先度ソートによる早期終了
- 正規表現の事前コンパイル
### スケーラビリティ
- 大量トークンでの線形処理時間
- ルール数の増加に対する適切な対応
- キャッシュ機能の追加可能性
## 拡張可能性
### ルール形式の拡張
```python
# より複雑なルール例(将来的な拡張)
complex_rule = {
"name": "multi_condition_rule",
"target": "言",
"conditions": [
{"direction": "prev", "kana_set": ["オ", "コ"]},
{"direction": "next", "kana_set": ["ハ", "バ"]}
],
"operator": "AND", # or "OR"
"actions": {
"all_true": {"kana": "ゴン"},
"any_true": {"kana": "ゲン"},
"all_false": {"kana": "イ"}
}
}
```
### 動的ルール追加
```python
def add_runtime_rule(new_rule):
"""実行時ルール追加(拡張版)"""
# ルールの検証
if validate_rule_format(new_rule):
DEFAULT_RULES["rules"].append(new_rule)
return True
return False
```
## 依存関係
### 必須依存関係
- `typing`: 型ヒント
- `re`: 正規表現処理
### 関連モジュール
- `transliteration_transliterator.py`: メイン転写クラス
- `transliteration_kana_to_hepburn.py`: かな→ヘボン式変換
## 注意事項
- ルール適用後は`hira`と`hepburn`が空文字列になるため、呼び出し元での再計算が必要
- 現在のルールは日本語に特化している
- ルール適用順序は優先度に依存するため、適切な設定が重要
- 正規表現ルールはパフォーマンスに影響する可能性がある
## 将来の改善点
- 外部ルールファイルの読み込み対応
- より複雑な条件式のサポート
- ルール適用ログ・デバッグ機能
- 言語別ルールセットの対応
- パフォーマンス最適化とキャッシュ機能
@@ -0,0 +1,465 @@
# transliteration_kana_to_hepburn.py - カタカナ→ヘボン式変換
## 概要
カタカナ文字列を標準的なヘボン式ローマ字に変換するモジュールです。マクロン(長音記号)対応、外来語音の変換、促音・撥音処理など、日本語のローマ字表記に必要な機能を包括的に提供します。
## 主要機能
### 標準的なヘボン式変換
- カタカナ文字の基本ローマ字変換
- マクロン(ā ī ū ē ō)による長音表現
- 連続母音表記の選択的対応
### 特殊音処理
- 促音(ッ)の適切な子音重複処理
- 撥音(ン)のm/n使い分け
- 長音符(ー)の前母音延長処理
### 外来語対応
- シェ(she)、チェ(che)等の組み合わせ
- ヴ音(vu, va, vi, ve, vo)の変換
- ファ行(fa, fi, fe, fo)の処理
## 主要関数
### katakana_to_hepburn
```python
def katakana_to_hepburn(kata: str, use_macron: bool = True) -> str
```
カタカナ文字列をヘボン式ローマ字に変換
#### パラメータ
- **kata**: 変換対象のカタカナ文字列
- **use_macron**: マクロン使用フラグ(True=ā ī ū ē ō、False=aa ii uu ee oo)
#### 戻り値
- **str**: ヘボン式ローマ字文字列(小文字)
## 使用方法
### 基本的な変換
```python
from models.transliteration.transliteration_kana_to_hepburn import katakana_to_hepburn
# 基本的なカタカナ変換
result1 = katakana_to_hepburn("カタカナ")
print(result1) # "katakana"
# 長音のマクロン表記
result2 = katakana_to_hepburn("コンピューター", use_macron=True)
print(result2) # "konpyūtā"
# 長音の連続母音表記
result3 = katakana_to_hepburn("コンピューター", use_macron=False)
print(result3) # "konpyuutaa"
```
### 特殊音の処理
```python
# 促音(ッ)の処理
result1 = katakana_to_hepburn("キャッチ")
print(result1) # "kyatchi"
result2 = katakana_to_hepburn("マッチャ")
print(result2) # "matcha"
# 撥音(ン)の処理
result3 = katakana_to_hepburn("ホンバン") # ホン+バン
print(result3) # "homban" (n→m変換)
result4 = katakana_to_hepburn("ホンテン") # ホン+テン
print(result4) # "honten" (nのまま)
```
### 外来語音の変換
```python
# 外来語特殊音
result1 = katakana_to_hepburn("シェア")
print(result1) # "shea"
result2 = katakana_to_hepburn("チェック")
print(result2) # "chekku"
result3 = katakana_to_hepburn("ジェット")
print(result3) # "jetto"
# ヴ音の処理
result4 = katakana_to_hepburn("ヴァイオリン")
print(result4) # "vaiorin"
result5 = katakana_to_hepburn("ヴィーナス")
print(result5) # "vīnasu"
# ファ行の処理
result6 = katakana_to_hepburn("ファイル")
print(result6) # "fairu"
result7 = katakana_to_hepburn("フィルム")
print(result7) # "firumu"
```
### 長音処理の詳細
```python
# 長音符(ー)の処理
result1 = katakana_to_hepburn("スーパー", use_macron=True)
print(result1) # "sūpā"
result2 = katakana_to_hepburn("パーティー", use_macron=True)
print(result2) # "pātī"
# ou → ō の変換(東京型)
result3 = katakana_to_hepburn("トウキョウ", use_macron=True)
print(result3) # "tōkyō"
# 連続母音表記との比較
result4 = katakana_to_hepburn("トウキョウ", use_macron=False)
print(result4) # "toukyou"
```
### 複雑な組み合わせ
```python
# 拗音(ゃゅょ)の組み合わせ
test_cases = [
("キャンプ", "kyanpu"),
("シュート", "shūto"),
("チョコレート", "chokorēto"),
("ギュウニュウ", "gyūnyū"),
("リュックサック", "ryukkusakku"),
("ピョンピョン", "pyonpyon")
]
for kata, expected in test_cases:
result = katakana_to_hepburn(kata)
print(f"{kata} -> {result}")
# キャンプ -> kyanpu
# シュート -> shūto
# チョコレート -> chokorēto
# ギュウニュウ -> gyūnyū
# リュックサック -> ryukkusakku
# ピョンピョン -> pyonpyon
```
## 変換ルール詳細
### 基本音対応表
```python
base_mapping = {
# 清音
'ア':'a', 'イ':'i', 'ウ':'u', 'エ':'e', 'オ':'o',
'カ':'ka', 'キ':'ki', 'ク':'ku', 'ケ':'ke', 'コ':'ko',
'サ':'sa', 'シ':'shi', 'ス':'su', 'セ':'se', 'ソ':'so',
'タ':'ta', 'チ':'chi', 'ツ':'tsu', 'テ':'te', 'ト':'to',
'ナ':'na', 'ニ':'ni', 'ヌ':'nu', 'ネ':'ne', 'ノ':'no',
'ハ':'ha', 'ヒ':'hi', 'フ':'fu', 'ヘ':'he', 'ホ':'ho',
'マ':'ma', 'ミ':'mi', 'ム':'mu', 'メ':'me', 'モ':'mo',
'ヤ':'ya', 'ユ':'yu', 'ヨ':'yo',
'ラ':'ra', 'リ':'ri', 'ル':'ru', 'レ':'re', 'ロ':'ro',
'ワ':'wa', 'ヲ':'wo', 'ン':'n',
# 濁音・半濁音
'ガ':'ga', 'ギ':'gi', 'グ':'gu', 'ゲ':'ge', 'ゴ':'go',
'ザ':'za', 'ジ':'ji', 'ズ':'zu', 'ゼ':'ze', 'ゾ':'zo',
'ダ':'da', 'ヂ':'ji', 'ヅ':'zu', 'デ':'de', 'ド':'do',
'バ':'ba', 'ビ':'bi', 'ブ':'bu', 'ベ':'be', 'ボ':'bo',
'パ':'pa', 'ピ':'pi', 'プ':'pu', 'ペ':'pe', 'ポ':'po',
# 特殊音
'ヴ':'vu'
}
```
### 拗音組み合わせ
```python
digraphs_mapping = {
# キャ行
('キ','ャ'):'kya', ('キ','ュ'):'kyu', ('キ','ョ'):'kyo',
('ギ','ャ'):'gya', ('ギ','ュ'):'gyu', ('ギ','ョ'):'gyo',
# シャ行
('シ','ャ'):'sha', ('シ','ュ'):'shu', ('シ','ョ'):'sho',
('ジ','ャ'):'ja', ('ジ','ュ'):'ju', ('ジ','ョ'):'jo',
# チャ行
('チ','ャ'):'cha', ('チ','ュ'):'chu', ('チ','ョ'):'cho',
# その他の拗音
('ニ','ャ'):'nya', ('ヒ','ャ'):'hya', ('ビ','ャ'):'bya',
('ピ','ャ'):'pya', ('ミ','ャ'):'mya', ('リ','ャ'):'rya',
# 外来語音(ファ行等)
('フ','ァ'):'fa', ('フ','ィ'):'fi', ('フ','ェ'):'fe', ('フ','ォ'):'fo',
('シ','ェ'):'she', ('チ','ェ'):'che', ('テ','ィ'):'ti',
('ツ','ァ'):'tsa', ('ツ','ィ'):'tsi', ('ツ','ェ'):'tse', ('ツ','ォ'):'tso',
# ヴ音組み合わせ
('ヴ','ァ'):'va', ('ヴ','ィ'):'vi', ('ヴ','ェ'):'ve',
('ヴ','ォ'):'vo', ('ヴ','ュ'):'vyu'
}
```
### マクロン変換規則
```python
macron_rules = {
'aa': 'ā', # カア → kā
'ii': 'ī', # キイ → kī
'uu': 'ū', # クウ → kū
'ee': 'ē', # ケエ → kē
'oo': 'ō', # コオ → kō
'ou': 'ō' # コウ → kō(東京型長音)
}
```
## 特殊処理アルゴリズム
### 促音(ッ)処理
```python
def handle_sokuon(current_pos, kata_string, result_list):
"""促音の処理アルゴリズム"""
# 次の音を確認
if current_pos + 1 < len(kata_string):
next_kana = kata_string[current_pos + 1]
# 次の音のローマ字を取得
next_roman = get_next_roman(next_kana, kata_string[current_pos + 1:])
# 子音部分を抽出して重複
consonant = extract_initial_consonant(next_roman)
if consonant:
result_list.append(consonant[0]) # 先頭子音を重複
# 促音自体は消費
return current_pos + 1
# 例:
# マッチャ -> ma + tcha (ッ -> t重複) -> matcha
# キャッチ -> kya + tchi (ッ -> t重複) -> kyatchi
```
### 撥音(ン)処理
```python
def handle_hatsuon(roman_string):
"""撥音のm/n使い分け処理"""
# n の後に b/p/m が続く場合は m に変換
import re
# パターン: n + [bmp] -> m + [bmp]
result = re.sub(r'n(?=[bmp])', 'm', roman_string)
return result
# 例:
# ホンバン -> honban -> homban
# サンポ -> sanpo -> sampo
# コンマ -> konma -> komma
# but: ホンテン -> honten (変更なし)
```
### 長音符(ー)処理
```python
def handle_choonpu(roman_list):
"""長音符の前母音延長処理"""
result = []
i = 0
while i < len(roman_list):
if roman_list[i] == '-': # 長音符マーカー
if i > 0:
prev_char = result[-1] # 直前の文字
if prev_char in 'aiueo':
# 前が母音なら重複(後でマクロン処理)
result.append(prev_char)
# else: 子音の場合は無視
else:
result.append(roman_list[i])
i += 1
return result
# 例:
# スー -> su + - -> suu -> sū (マクロン処理後)
# パーティー -> pa + - + ti + - -> paatii -> pātī
```
## 実装例・テストケース
### 基本テストセット
```python
def run_basic_tests():
"""基本変換テストセット"""
test_cases = [
# 基本音
("アイウエオ", "aiueo"),
("カキクケコ", "kakikukeko"),
("サシスセソ", "sashisuseso"),
# 濁音・半濁音
("ガギグゲゴ", "gagigugego"),
("ザジズゼゾ", "zajizuzezo"),
("バビブベボ", "babibubebo"),
("パピプペポ", "papipupepo"),
# 特殊音
("シャシュショ", "shashusho"),
("チャチュチョ", "chachucho"),
("ジャジュジョ", "jajujo"),
# 促音
("アッパ", "appa"),
("イッキ", "ikki"),
("エッサ", "essa"),
# 撥音
("アンパン", "ampan"),
("コンマ", "komma"),
("ホンテン", "honten")
]
for kata, expected in test_cases:
result = katakana_to_hepburn(kata)
assert result == expected, f"Failed: {kata} -> {result} (expected {expected})"
print(f"✓ {kata} -> {result}")
run_basic_tests()
```
### 外来語テストセット
```python
def run_foreign_word_tests():
"""外来語変換テストセット"""
foreign_tests = [
# ファ行
("ファイル", "fairu"),
("フィルム", "firumu"),
("フェイス", "feisu"),
("フォント", "fonto"),
# シェ・チェ
("シェア", "shea"),
("シェル", "sheru"),
("チェック", "chekku"),
("チェイン", "chein"),
# ヴ音
("ヴァイオリン", "vaiorin"),
("ヴィーナス", "vīnasu"),
("ヴェール", "vēru"),
("ヴォーカル", "vōkaru"),
# ティ・トゥ・ドゥ
("ティー", "tī"),
("パーティー", "pātī"),
("トゥー", "tū"),
("ドゥー", "dū")
]
for kata, expected in foreign_tests:
result = katakana_to_hepburn(kata, use_macron=True)
print(f"✓ {kata} -> {result}")
# 実際のexpectedとの比較は実装依存
run_foreign_word_tests()
```
### 長音テストセット
```python
def run_long_vowel_tests():
"""長音処理テストセット"""
long_vowel_tests = [
# マクロンあり
("コーヒー", "kōhī", True),
("スーパー", "sūpā", True),
("パーティー", "pātī", True),
("トウキョウ", "tōkyō", True), # ou -> ō
# マクロンなし
("コーヒー", "koohii", False),
("スーパー", "suupaa", False),
("パーティー", "paatii", False),
("トウキョウ", "toukyou", False)
]
for kata, expected, use_macron in long_vowel_tests:
result = katakana_to_hepburn(kata, use_macron=use_macron)
print(f"✓ {kata} -> {result} (macron={use_macron})")
run_long_vowel_tests()
```
## パフォーマンス考慮事項
### 効率的な処理
- 単一パス処理による高速変換
- 正規表現の最小限使用
- 辞書ルックアップの最適化
### メモリ効率
- 文字列連結の最適化
- 不要な中間オブジェクトの削減
- 大量テキスト処理への対応
## 制限事項・注意点
### 変換精度の制限
- 文脈に依存する読み分けは非対応
- 固有名詞の特殊読みは非対応
- 方言・古語の特殊音は非対応
### ヘボン式の範囲
- 標準的なヘボン式に準拠
- 一部の外来語音は近似変換
- 撥音の文脈依存ルールは簡略化
### 入力制限
```python
# 適切な入力例
good_inputs = ["カタカナ", "シャープ", "コンピューター"]
# 問題のある入力例
problematic_inputs = [
"ひらがな", # ひらがな混在(処理されるがそのまま)
"English", # 英字混在(処理されるがそのまま)
"123数字", # 数字混在(処理されるがそのまま)
"", # 空文字列(空文字列を返す)
]
# 混在入力の処理例
mixed_result = katakana_to_hepburn("カタカナと英語English")
print(mixed_result) # "katakanaと英語english"
```
## 関連モジュール
- `transliteration_transliterator.py`: メイン転写クラス
- `transliteration_context_rules.py`: 文脈依存ルール
- 外部のひらがな↔カタカナ変換モジュール(必要に応じて)
## 将来の改善点
- 更なる外来語音への対応
- 文脈依存の読み分け機能
- パフォーマンス最適化
- より詳細なヘボン式バリエーション対応
- 音韻変化ルールの追加
@@ -0,0 +1,659 @@
# transliteration_transliterator.py - 総合音写・転写システム
## 概要
SudachiPyを利用した日本語のローマ字転写システムのメインクラスです。形態素解析、漢字・送り仮名の分離、文脈依存ルールの適用、ヘボン式変換を統合し、高精度な日本語ローマ字化を提供します。
## 主要機能
### 統合転写システム
- SudachiPyによる高精度形態素解析
- 漢字・送り仮名の自動分離処理
- 文脈依存読み変更ルールの適用
### 多層変換処理
- カタカナ読み取得・分配
- ひらがな自動変換
- ヘボン式ローマ字生成
### 並行処理対応
- スレッドセーフなトークナイザー利用
- ロック機構による安全な並行実行
- 高負荷環境での安定動作
## クラス構造
### Transliterator クラス
```python
class Transliterator:
def __init__(self) -> None:
self.tokenizer_obj: tokenizer.Tokenizer
self.mode: tokenizer.Tokenizer.SplitMode
self._tokenizer_lock: threading.Lock
```
日本語転写処理の中核クラス
#### 属性
- **tokenizer_obj**: SudachiPyトークナイザーインスタンス
- **mode**: 分割モード(SplitMode.C = 最長一致)
- **_tokenizer_lock**: 並行アクセス制御用ミューテックス
## 主要メソッド
### analyze
```python
def analyze(self, text: str, use_macron: bool = False) -> List[Dict[str, Any]]
```
テキストを解析して転写情報を生成
#### パラメータ
- **text**: 解析対象の日本語テキスト
- **use_macron**: マクロン使用フラグ(長音表記方式)
#### 戻り値
- **List[Dict[str, Any]]**: トークン転写情報のリスト
#### 出力辞書構造
```python
{
"orig": str, # 元の文字・文字列
"kana": str, # カタカナ読み
"hira": str, # ひらがな読み
"hepburn": str # ヘボン式ローマ字
}
```
### split_kanji_okurigana (静的メソッド)
```python
@staticmethod
def split_kanji_okurigana(surface: str, reading_kana: str, use_macron: bool = True) -> List[Dict[str, str]]
```
単語の表層形と読みを漢字・送り仮名ブロックに分割
#### パラメータ
- **surface**: 表層形(漢字+ひらがな混在可能)
- **reading_kana**: 全体のカタカナ読み
- **use_macron**: ヘボン式変換でのマクロン使用
#### 戻り値
- **List[Dict[str, str]]**: 分割された部分の転写情報
## 補助メソッド
### is_kanji (静的メソッド)
```python
@staticmethod
def is_kanji(ch: str) -> bool
```
文字が漢字かどうかを判定
#### パラメータ
- **ch**: 判定対象文字
#### 戻り値
- **bool**: 漢字判定結果
### kata_to_hira (静的メソッド)
```python
@staticmethod
def kata_to_hira(text: str) -> str
```
カタカナをひらがなに変換
#### パラメータ
- **text**: 変換対象のカタカナテキスト
#### 戻り値
- **str**: ひらがな変換結果
## 使用方法
### 基本的な転写処理
```python
from models.transliteration.transliteration_transliterator import Transliterator
# 転写システムの初期化
transliterator = Transliterator()
# 基本的な文章の転写
text = "向こうへ行く"
results = transliterator.analyze(text)
for token in results:
print(f"{token['orig']} -> {token['kana']} -> {token['hira']} -> {token['hepburn']}")
# 期待される出力例:
# 向こう -> ムコウ -> むこう -> mukou
# へ -> ヘ -> へ -> he
# 行く -> イク -> いく -> iku
```
### マクロン使用の長音処理
```python
# マクロンを使用した長音表記
text = "東京に行く"
results_macron = transliterator.analyze(text, use_macron=True)
results_normal = transliterator.analyze(text, use_macron=False)
print("=== マクロンあり ===")
for token in results_macron:
print(f"{token['orig']} -> {token['hepburn']}")
print("=== マクロンなし ===")
for token in results_normal:
print(f"{token['orig']} -> {token['hepburn']}")
# 期待される出力:
# === マクロンあり ===
# 東京 -> tōkyō
# に -> ni
# 行く -> iku
# === マクロンなし ===
# 東京 -> toukyou
# に -> ni
# 行く -> iku
```
### 複雑な文章の処理
```python
# 漢字・ひらがな・カタカナ・英語混在文の処理
complex_text = "パーティーで美しい花を見る"
results = transliterator.analyze(complex_text, use_macron=True)
for token in results:
print(f"原文: '{token['orig']}'")
print(f" カナ: {token['kana']}")
print(f" ひら: {token['hira']}")
print(f" ローマ: {token['hepburn']}")
print()
# 期待される出力:
# 原文: 'パーティー'
# カナ: パーティー
# ひら: ぱーてぃー
# ローマ: pātī
#
# 原文: 'で'
# カナ: デ
# ひら: で
# ローマ: de
#
# 原文: '美しい'
# カナ: ウツクシイ
# ひら: うつくしい
# ローマ: utsukushii
```
### 文脈依存ルールの効果確認
```python
# 文脈に依存する読み変更の例(「何」の読み分け)
test_cases = [
"何が好き?", # 何 -> ナニ (後続が「ガ」)
"何度も挑戦", # 何 -> ナン (後続が「ド」)
"何色ありますか?" # 何 -> ナニ (後続が「イ」)
]
for text in test_cases:
results = transliterator.analyze(text)
print(f"入力: {text}")
# 「何」トークンを探して読みを確認
for token in results:
if token['orig'] == '何':
print(f"「何」の読み: {token['kana']} -> {token['hepburn']}")
break
print()
# 期待される出力:
# 入力: 何が好き?
# 「何」の読み: ナニ -> nani
#
# 入力: 何度も挑戦
# 「何」の読み: ナン -> nan
#
# 入力: 何色ありますか?
# 「何」の読み: ナニ -> nani
```
### 特殊文字・記号の処理
```python
# 記号・英数字混在テキストの処理
mixed_text = "ID:12345、URL:https://example.com"
results = transliterator.analyze(mixed_text)
for token in results:
print(f"'{token['orig']}' -> '{token['hepburn']}'")
# 期待される出力:
# 'ID' -> 'ID' # 英字はそのまま
# ':' -> ':' # 記号はそのまま
# '12345' -> '12345' # 数字はそのまま
# '、' -> '、' # 区切り記号はそのまま
# 'URL' -> 'URL' # 英字はそのまま
```
## 内部処理フロー
### 解析処理パイプライン
```python
def analyze_pipeline_explained(self, text):
"""転写処理パイプラインの詳細説明"""
# 1. SudachiPy形態素解析
with self._tokenizer_lock:
tokens = self.tokenizer_obj.tokenize(text, self.mode)
results = []
# 2. 各トークンの処理
for token in tokens:
surface = token.surface() # 表層形
reading = token.reading_form() # 読み(カタカナ)
pos = token.part_of_speech() # 品詞情報
# 3. 記号・空白の特別処理
if pos and pos[0] in ["記号", "補助記号", "空白"]:
reading = surface # 記号は表層形をそのまま使用
# 4. 表層形と読みが同じ場合(ひらがな・記号等)
if surface == reading:
results.append({
"orig": surface,
"kana": reading,
"hira": surface, # そのまま
"hepburn": surface # そのまま
})
continue
# 5. 単一文字の処理
if len(surface) == 1:
results.append({
"orig": surface,
"kana": reading,
"hira": self.kata_to_hira(reading),
"hepburn": katakana_to_hepburn(reading, use_macron)
})
else:
# 6. 複数文字の漢字・送り仮名分離
parts = self.split_kanji_okurigana(surface, reading, use_macron)
results.extend(parts)
# 7. 文脈依存ルールの適用
try:
results = apply_context_rules(results, use_macron) or results
except Exception:
pass # ルール適用失敗時は元の結果を使用
# 8. ルール適用後の再計算
for entry in results:
kana = entry.get("kana", "")
if kana:
entry["hira"] = self.kata_to_hira(kana)
entry["hepburn"] = katakana_to_hepburn(kana, use_macron)
return results
```
### 漢字・送り仮名分離アルゴリズム
```python
def split_algorithm_explained(surface, reading_kana):
"""分離アルゴリズムの詳細説明"""
# 1. 表層形のブロック分割
blocks = []
current_block = ""
prev_is_kanji = None
for char in surface:
is_kanji = Transliterator.is_kanji(char)
if prev_is_kanji is None or is_kanji == prev_is_kanji:
# 同じタイプの文字は同じブロックに
current_block += char
else:
# タイプが変わったら新しいブロック
blocks.append((prev_is_kanji, current_block))
current_block = char
prev_is_kanji = is_kanji
if current_block:
blocks.append((prev_is_kanji, current_block))
# 例: "向こう" -> [(True, "向"), (False, "こう")]
# "行く" -> [(True, "行"), (False, "く")]
# 2. 読みの分配
kana_len = len(reading_kana)
# 初期割当: 各ブロックの文字数に比例
allocations = [len(block_text) for _, block_text in blocks]
allocated_total = sum(allocations)
remaining = kana_len - allocated_total
# 3. 余った読みの分配(漢字ブロック優先)
if remaining > 0:
# まず漢字ブロックに分配
for i, (is_kanji, _) in enumerate(blocks):
if remaining <= 0:
break
if is_kanji:
allocations[i] += 1
remaining -= 1
# まだ余りがある場合は左から順に分配
i = 0
while remaining > 0 and len(blocks) > 0:
allocations[i] += 1
remaining -= 1
i = (i + 1) % len(blocks)
# 4. 読みが不足している場合は右から削減
if remaining < 0:
need_to_remove = -remaining
i = len(blocks) - 1
while need_to_remove > 0 and i >= 0:
can_remove = max(0, allocations[i] - 1)
remove_amount = min(can_remove, need_to_remove)
allocations[i] -= remove_amount
need_to_remove -= remove_amount
i -= 1
# 5. 最終的な読み分配
pos = 0
result = []
for (is_kanji, block_text), allocation in zip(blocks, allocations):
block_reading = reading_kana[pos:pos + allocation]
pos += allocation
result.append({
"orig": block_text,
"kana": block_reading,
"hira": Transliterator.kata_to_hira(block_reading),
"hepburn": katakana_to_hepburn(block_reading, use_macron)
})
return result
```
## 並行処理・スレッドセーフティ
### ロック機構
```python
class ThreadSafeUsage:
"""スレッドセーフな使用例"""
def __init__(self):
self.transliterator = Transliterator()
def process_texts_concurrently(self, texts):
"""複数テキストの並行処理"""
import concurrent.futures
def process_single(text):
return self.transliterator.analyze(text)
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
# 内部のロック機構により安全に並行実行
futures = [executor.submit(process_single, text) for text in texts]
results = [f.result() for f in futures]
return results
# 使用例
processor = ThreadSafeUsage()
texts = ["東京に行く", "大阪で食事", "名古屋を観光", "福岡に宿泊"]
results = processor.process_texts_concurrently(texts)
for i, result in enumerate(results):
print(f"テキスト{i+1}: {texts[i]}")
for token in result:
print(f" {token['orig']} -> {token['hepburn']}")
```
### パフォーマンス考慮事項
```python
# 大量テキスト処理のベストプラクティス
def efficient_batch_processing(texts, batch_size=100):
"""効率的なバッチ処理"""
transliterator = Transliterator()
results = []
for i in range(0, len(texts), batch_size):
batch = texts[i:i + batch_size]
batch_results = []
for text in batch:
# 各テキストを個別に処理(ロック制御あり)
result = transliterator.analyze(text)
batch_results.append(result)
results.extend(batch_results)
# バッチ間で少し休憩(メモリ管理)
if len(results) % 1000 == 0:
print(f"処理済み: {len(results)} テキスト")
return results
```
## エラーハンドリング
### 例外処理
```python
def safe_analyze(text):
"""安全な解析処理"""
transliterator = Transliterator()
try:
results = transliterator.analyze(text)
return results, None
except RuntimeError as e:
if "Already borrowed" in str(e):
# SudachiPyの並行アクセスエラー
print("並行アクセスエラーが発生しました。リトライします。")
return None, "RETRY_NEEDED"
else:
print(f"実行時エラー: {e}")
return None, "RUNTIME_ERROR"
except Exception as e:
print(f"予期しないエラー: {e}")
return None, "UNKNOWN_ERROR"
# 使用例(リトライ機構付き)
def analyze_with_retry(text, max_retries=3):
"""リトライ機構付き解析"""
for attempt in range(max_retries):
results, error = safe_analyze(text)
if results is not None:
return results
if error == "RETRY_NEEDED":
print(f"リトライ {attempt + 1}/{max_retries}")
import time
time.sleep(0.1 * (attempt + 1)) # 指数バックオフ
continue
else:
break
# 全てのリトライが失敗した場合のフォールバック
print("解析に失敗しました。フォールバック処理を実行します。")
return [{"orig": text, "kana": text, "hira": text, "hepburn": text}]
```
## 設定・カスタマイズ
### SudachiPy設定
```python
# カスタムSudachiPy設定での初期化
class CustomTransliterator(Transliterator):
def __init__(self, dict_type="full", split_mode="C"):
"""カスタム設定での初期化"""
# 辞書タイプの選択
dict_types = {
"small": dictionary.Dictionary.create(dict_type="small"),
"core": dictionary.Dictionary.create(dict_type="core"),
"full": dictionary.Dictionary.create(dict_type="full")
}
self.tokenizer_obj = dict_types.get(dict_type, dict_types["full"])
# 分割モードの選択
split_modes = {
"A": tokenizer.Tokenizer.SplitMode.A, # 短い単位
"B": tokenizer.Tokenizer.SplitMode.B, # 中間単位
"C": tokenizer.Tokenizer.SplitMode.C # 長い単位(デフォルト)
}
self.mode = split_modes.get(split_mode, split_modes["C"])
self._tokenizer_lock = threading.Lock()
# 使用例
# 短い単位での分割を使用
small_unit_transliterator = CustomTransliterator(dict_type="core", split_mode="A")
text = "取り敢えず検索してみる"
results = small_unit_transliterator.analyze(text)
for token in results:
print(f"{token['orig']} -> {token['hepburn']}")
```
## テスト・デバッグ
### 包括的テストセット
```python
def run_comprehensive_tests():
"""包括的な機能テスト"""
transliterator = Transliterator()
test_cases = [
# 基本的な文章
("向こうへ行く", "向こう", "ムコウ"),
("美しい花", "美しい", "ウツクシイ"),
# 文脈依存
("何度も", "何", "ナン"),
("何が", "何", "ナニ"),
# 外来語
("パーティー", "パーティー", "パーティー"),
("コンピューター", "コンピューター", "コンピューター"),
# 漢字・送り仮名
("取り敢えず", "取り", "トリ"),
("見知らぬ", "見知ら", "ミシラ"),
# 記号・英数字
("ID:12345", "ID", "ID"),
("SessionIDを取得", "SessionID", "SessionID")
]
for text, target_orig, expected_kana in test_cases:
results = transliterator.analyze(text)
# 対象トークンを検索
target_token = None
for token in results:
if token['orig'] == target_orig:
target_token = token
break
if target_token:
actual_kana = target_token['kana']
status = "✓" if actual_kana == expected_kana else "✗"
print(f"{status} {text}: {target_orig} -> {actual_kana} (期待値: {expected_kana})")
else:
print(f"✗ {text}: トークン '{target_orig}' が見つかりません")
run_comprehensive_tests()
```
## 依存関係
### 必須依存関係
- `sudachipy`: 形態素解析エンジン
- `threading`: 並行制御
- `typing`: 型ヒント
### 内部モジュール依存
- `transliteration_kana_to_hepburn`: ヘボン式変換
- `transliteration_context_rules`: 文脈依存ルール
### システム要件
- Python 3.7以上
- SudachiPy辞書ファイル(自動ダウンロード)
- 十分なメモリ(辞書読み込み用)
## 注意事項・制限
### 処理精度の制限
- 形態素解析結果に依存
- 未知語・固有名詞は読み推定
- 文脈によっては不正確な分割
### パフォーマンス制限
- 初回実行時の辞書読み込み時間
- 大量テキスト処理時のメモリ使用量
- 並行アクセス時のロック待機
### 出力形式の制限
```python
# 現在サポートしていない機能
unsupported_features = [
"アクセント記号(音調)",
"方言・古語の特殊読み",
"人名・地名の特殊読み",
"外国語の音写(中国語・韓国語等)",
"カスタム読み辞書",
"品詞情報の出力"
]
```
## 関連モジュール
- `transliteration_kana_to_hepburn.py`: ヘボン式変換処理
- `transliteration_context_rules.py`: 文脈依存ルール適用
- `config.py`: システム設定管理
- `utils.py`: ユーティリティ関数
## 将来の改善点
- カスタム読み辞書対応
- より高精度な文脈解析
- 他言語音写システムとの統合
- リアルタイム処理最適化
- 分散処理対応
+213
View File
@@ -0,0 +1,213 @@
# utils.py - ユーティリティ関数モジュール
## 概要
VRCTアプリケーション全体で使用される汎用的なユーティリティ関数を提供するモジュールです。データ検証、ネットワーク接続確認、計算デバイス管理、ログ機能などの共通機能を集約しています。
## 主要機能
### データ検証機能
- 辞書構造の型安全な検証
- IPアドレス形式の検証
- WebSocketサーバーの可用性確認
### システム情報取得
- 利用可能な計算デバイス(CPU/CUDA)の一覧取得
- 最適な計算タイプの自動選択
- デバイス固有の制約対応
### ログ機能
- 構造化ログの出力
- ローテーションログファイル管理
- エラーログとプロセスログの分離
### ネットワーク機能
- インターネット接続状態の確認
- Base64エンコード/デコード処理
## 主要関数
### データ検証
```python
validateDictStructure(data: dict, structure: dict) -> bool
```
- 辞書とその期待される構造が完全に一致するかを判別
- 入れ子構造にも対応
- 型安全性を保証
### ネットワーク関連
```python
isConnectedNetwork(url="http://www.google.com", timeout=3) -> bool
```
- 指定URLへの接続可能性をチェック
- タイムアウト設定可能
```python
isAvailableWebSocketServer(host: str, port: int) -> bool
```
- WebSocketサーバーのバインド可能性を確認
```python
isValidIpAddress(ip_address: str) -> bool
```
- IPv4/IPv6アドレスの有効性を検証
### 計算デバイス管理
```python
getComputeDeviceList() -> List[Dict[str, Any]]
```
- 利用可能なCPU/CUDA計算デバイスの一覧を取得
- 各デバイスの計算タイプを含む詳細情報を提供
```python
getBestComputeType(device: str, device_index: int) -> str
```
- デバイスに最適な計算タイプを自動選択
- GPU固有の制約を考慮(GTX、RTX、Tesla、A100、Quadro等)
### ログ機能
```python
setupLogger(name: str, log_file: str, level: int = logging.INFO) -> logging.Logger
```
- ローテーション機能付きログの設定
- 10MBサイズでのローテーション
- UTF-8エンコード対応
```python
printLog(log: str, data: Any = None) -> None
```
- 構造化プロセスログの出力
- JSON形式での標準出力
```python
printResponse(status: int, endpoint: str, result: Any = None) -> None
```
- APIレスポンスの構造化出力
- シリアライゼーションエラーの安全な処理
```python
errorLogging() -> None
```
- 例外トレースバックのログ記録
- フォールバック機能付き
### その他のユーティリティ
```python
encodeBase64(data: str) -> Dict[str, Any]
```
- Base64エンコード済みJSON文字列のデコード
- エラー処理付き
```python
removeLog() -> None
```
- プロセスログファイルの初期化
## 使用方法
### 基本的な使い方
```python
from utils import validateDictStructure, isConnectedNetwork, printLog
# 辞書構造の検証
expected_structure = {"name": str, "age": int}
data = {"name": "test", "age": 25}
is_valid = validateDictStructure(data, expected_structure)
# ネットワーク接続確認
is_connected = isConnectedNetwork()
# ログ出力
printLog("処理開始", {"user_id": 123})
```
### 計算デバイス管理
```python
from utils import getComputeDeviceList, getBestComputeType
# 利用可能デバイス一覧
devices = getComputeDeviceList()
# 最適な計算タイプ選択
compute_type = getBestComputeType("cuda", 0)
```
### ログ設定
```python
from utils import setupLogger, errorLogging
# カスタムログの設定
logger = setupLogger("my_module", "my_module.log")
logger.info("処理完了")
# エラーログ記録
try:
# 何らかの処理
pass
except Exception:
errorLogging()
```
## 依存関係
### 必須依存関係
- `json`: JSON処理
- `logging`: ログ機能
- `requests`: HTTP通信
- `ipaddress`: IPアドレス検証
- `socket`: ソケット通信
### オプション依存関係
- `torch`: CUDA計算デバイス情報取得
- `ctranslate2`: 計算タイプ情報取得
## デバイス別計算タイプ制約
### GTXシリーズ
- サポート: `float32`のみ
- 理由: 古いアーキテクチャによる制約
### RTX/Tesla/A100/Quadroシリーズ
- サポート: フル機能
- 優先順位: `int8_bfloat16` > `int8_float16` > `int8` > `bfloat16` > `float16` > `int8_float32` > `float32`
### CPU
- サポート: 全計算タイプ(ハードウェア依存)
## エラーハンドリング
- すべての関数は例外安全性を考慮
- オプション依存関係の欠如に対する適切なフォールバック
- ログ機能は多段階のフェールセーフ機構を持つ
## 注意事項
- 計算デバイス情報取得は初回実行時にやや時間がかかる場合がある
- ログローテーションは10MBサイズで自動実行
- ネットワーク接続確認はデフォルト3秒のタイムアウト設定
+670
View File
@@ -0,0 +1,670 @@
# watchdog.py - 軽量監視システム
## 概要
タイムアウトベースの軽量監視(ウォッチドッグ)システムです。定期的な"餌やり"(feed)により正常動作を確認し、指定時間内に餌やりがない場合にコールバック関数を実行する単純で効果的な監視機構を提供します。
## 主要機能
### タイムアウト監視
- 最後の餌やり時刻からの経過時間監視
- 設定可能なタイムアウト閾値
- タイムアウト時の自動コールバック実行
### 柔軟な実行モード
- 単発チェック(手動呼び出し)
- バックグラウンドスレッド実行
- カスタムチェック間隔設定
### 防御的設計
- コールバック例外の隔離処理
- スレッドセーフな制御機構
- 適切なリソース管理
## クラス構造
### Watchdog クラス
```python
class Watchdog:
def __init__(self, timeout: int = 60, interval: int = 20) -> None:
self.timeout: int # タイムアウト秒数
self.interval: int # チェック間隔秒数
self.last_feed_time: float # 最後の餌やり時刻
self.callback: Optional[Callable] # タイムアウト時コールバック
self._thread: Optional[Thread] # バックグラウンドスレッド
self._stop_event: Optional[Event] # 停止イベント
```
軽量ウォッチドッグの中核クラス
#### パラメータ
- **timeout**: 餌やりなしでタイムアウトするまでの秒数
- **interval**: 監視チェックの推奨間隔秒数
## 主要メソッド
### 基本制御
```python
def feed(self) -> None
```
ウォッチドッグに餌やりを行い、タイマーをリセット
```python
def setCallback(self, callback: Callable[[], None]) -> None
```
タイムアウト時に実行するコールバック関数を設定
#### パラメータ
- **callback**: 引数なしの呼び出し可能オブジェクト
### 監視実行
```python
def start(self) -> None
```
単発のウォッチドッグチェックを実行し、間隔秒数だけスリープ
```python
def start_in_thread(self, daemon: bool = True) -> None
```
バックグラウンドスレッドでウォッチドッグを開始
#### パラメータ
- **daemon**: デーモンスレッドとして実行するかのフラグ
```python
def stop(self, timeout: Optional[float] = None) -> None
```
バックグラウンドスレッドを停止
#### パラメータ
- **timeout**: スレッド終了待機のタイムアウト秒数
## 使用方法
### 基本的な監視システム
```python
from models.watchdog.watchdog import Watchdog
import time
def on_timeout():
"""タイムアウト時の処理"""
print("警告: システムの応答がありません!")
# ログ出力、アラート送信、復旧処理等
# ウォッチドッグの初期化
watchdog = Watchdog(timeout=30, interval=10) # 30秒でタイムアウト、10秒間隔
watchdog.setCallback(on_timeout)
# バックグラウンドで監視開始
watchdog.start_in_thread(daemon=True)
# メインプロセスのシミュレーション
for i in range(10):
print(f"処理中... {i}")
# 正常な処理では定期的に餌やり
if i % 3 == 0: # 3回に1回餌やり
watchdog.feed()
print("ウォッチドッグに餌やりしました")
time.sleep(5)
# 監視停止
watchdog.stop()
```
### 手動チェックモード
```python
# 手動でウォッチドッグをチェック
def manual_monitoring_example():
watchdog = Watchdog(timeout=60, interval=5)
def system_failure_handler():
print("システム障害を検出しました")
# 復旧処理、通知等
watchdog.setCallback(system_failure_handler)
# メインループ内で定期チェック
while True:
# 何らかの重要な処理
process_critical_work()
# 処理が正常なら餌やり
if is_system_healthy():
watchdog.feed()
# 監視チェック実行(5秒間隔でスリープ)
watchdog.start()
def process_critical_work():
"""重要な処理のシミュレーション"""
time.sleep(2)
def is_system_healthy():
"""システム正常性チェックのシミュレーション"""
import random
return random.random() > 0.2 # 80%の確率で正常
# manual_monitoring_example()
```
### プロセス監視システム
```python
class ProcessMonitor:
"""外部プロセス監視システム"""
def __init__(self, process_name, check_interval=30):
self.process_name = process_name
self.watchdog = Watchdog(timeout=60, interval=check_interval)
self.watchdog.setCallback(self.on_process_timeout)
self.monitoring = False
def on_process_timeout(self):
"""プロセス応答タイムアウト時の処理"""
print(f"警告: プロセス {self.process_name} が応答しません")
# プロセス存在確認
if self.is_process_running():
print("プロセスは実行中ですが応答なし。再起動を試行します。")
self.restart_process()
else:
print("プロセスが停止しています。再起動します。")
self.start_process()
def is_process_running(self):
"""プロセス実行状態確認"""
import psutil
for proc in psutil.process_iter(['name']):
if proc.info['name'] == self.process_name:
return True
return False
def start_process(self):
"""プロセス起動"""
print(f"プロセス {self.process_name} を起動中...")
# 実際の起動処理
def restart_process(self):
"""プロセス再起動"""
print(f"プロセス {self.process_name} を再起動中...")
# 実際の再起動処理
def feed_watchdog(self):
"""外部から呼び出される餌やりメソッド"""
self.watchdog.feed()
def start_monitoring(self):
"""監視開始"""
self.monitoring = True
self.watchdog.start_in_thread(daemon=True)
print(f"プロセス {self.process_name} の監視を開始しました")
def stop_monitoring(self):
"""監視停止"""
self.monitoring = False
self.watchdog.stop()
print(f"プロセス {self.process_name} の監視を停止しました")
# 使用例
vrchat_monitor = ProcessMonitor("VRChat.exe", check_interval=15)
vrchat_monitor.start_monitoring()
# VRChatプロセスが正常に動作している時の餌やり
# (実際にはVRChatからのOSC通信等で判定)
for _ in range(20):
time.sleep(10)
if vrchat_monitor.is_process_running():
vrchat_monitor.feed_watchdog()
print("VRChat正常動作確認")
vrchat_monitor.stop_monitoring()
```
### ネットワーク監視システム
```python
class NetworkWatchdog:
"""ネットワーク接続監視"""
def __init__(self, target_host="8.8.8.8", timeout=45):
self.target_host = target_host
self.watchdog = Watchdog(timeout=timeout, interval=15)
self.watchdog.setCallback(self.on_network_timeout)
self.last_ping_success = True
def on_network_timeout(self):
"""ネットワークタイムアウト処理"""
print("ネットワーク接続に問題があります")
# 複数ホストでの確認
test_hosts = ["8.8.8.8", "1.1.1.1", "google.com"]
for host in test_hosts:
if self.ping_host(host):
print(f"{host} への接続は正常です")
self.watchdog.feed() # 1つでも成功したら復旧とみなす
return
print("すべてのホストへの接続に失敗。ネットワーク設定を確認してください。")
self.handle_network_failure()
def ping_host(self, host):
"""ホストへのping確認"""
import subprocess
import platform
# プラットフォームに応じたpingコマンド
if platform.system().lower() == "windows":
cmd = ["ping", "-n", "1", "-w", "3000", host]
else:
cmd = ["ping", "-c", "1", "-W", "3", host]
try:
result = subprocess.run(cmd, capture_output=True, timeout=5)
return result.returncode == 0
except (subprocess.TimeoutExpired, Exception):
return False
def handle_network_failure(self):
"""ネットワーク障害時の処理"""
print("ネットワーク障害対応処理を実行中...")
# DNS設定リセット、ネットワークアダプター再起動等
def check_network_continuously(self):
"""継続的なネットワーク監視"""
self.watchdog.start_in_thread(daemon=True)
while True:
if self.ping_host(self.target_host):
if not self.last_ping_success:
print("ネットワーク接続が復旧しました")
self.watchdog.feed()
self.last_ping_success = True
else:
if self.last_ping_success:
print("ネットワーク接続に問題が発生しました")
self.last_ping_success = False
time.sleep(10)
# 使用例
network_monitor = NetworkWatchdog(target_host="google.com", timeout=60)
# バックグラウンドでネットワーク監視
import threading
monitor_thread = threading.Thread(target=network_monitor.check_network_continuously, daemon=True)
monitor_thread.start()
# メインプログラムの実行
print("ネットワーク監視システム開始...")
time.sleep(120) # 2分間監視
network_monitor.watchdog.stop()
```
### システムリソース監視
```python
class SystemResourceWatchdog:
"""システムリソース監視"""
def __init__(self):
self.cpu_watchdog = Watchdog(timeout=300, interval=30) # CPU使用率監視
self.memory_watchdog = Watchdog(timeout=180, interval=20) # メモリ監視
self.cpu_watchdog.setCallback(self.on_cpu_overload)
self.memory_watchdog.setCallback(self.on_memory_pressure)
self.cpu_threshold = 80.0 # CPU使用率閾値(%)
self.memory_threshold = 85.0 # メモリ使用率閾値(%)
def on_cpu_overload(self):
"""CPU過負荷時の処理"""
print("警告: CPU使用率が長時間高い状態です")
self.optimize_cpu_usage()
def on_memory_pressure(self):
"""メモリ圧迫時の処理"""
print("警告: メモリ使用率が危険なレベルです")
self.free_memory()
def get_cpu_usage(self):
"""CPU使用率取得"""
import psutil
return psutil.cpu_percent(interval=1)
def get_memory_usage(self):
"""メモリ使用率取得"""
import psutil
return psutil.virtual_memory().percent
def optimize_cpu_usage(self):
"""CPU使用率最適化"""
print("CPU最適化処理を実行中...")
# 低優先度プロセスの特定・制限
# 不要なバックグラウンドタスクの停止等
def free_memory(self):
"""メモリ解放処理"""
print("メモリ解放処理を実行中...")
# ガベージコレクション実行
import gc
gc.collect()
# キャッシュクリア等
def monitor_resources(self):
"""リソース監視メインループ"""
self.cpu_watchdog.start_in_thread(daemon=True)
self.memory_watchdog.start_in_thread(daemon=True)
while True:
# CPU使用率チェック
cpu_usage = self.get_cpu_usage()
if cpu_usage < self.cpu_threshold:
self.cpu_watchdog.feed()
# メモリ使用率チェック
memory_usage = self.get_memory_usage()
if memory_usage < self.memory_threshold:
self.memory_watchdog.feed()
print(f"CPU: {cpu_usage:.1f}%, メモリ: {memory_usage:.1f}%")
time.sleep(5)
def stop_monitoring(self):
"""監視停止"""
self.cpu_watchdog.stop()
self.memory_watchdog.stop()
# 使用例
resource_monitor = SystemResourceWatchdog()
# リソース監視開始
import threading
resource_thread = threading.Thread(target=resource_monitor.monitor_resources, daemon=True)
resource_thread.start()
# しばらく監視
time.sleep(60)
resource_monitor.stop_monitoring()
```
## 高度な使用パターン
### 多段階監視システム
```python
class MultilevelWatchdog:
"""多段階警告レベル対応ウォッチドッグ"""
def __init__(self):
# 異なるタイムアウトレベル
self.warning_watchdog = Watchdog(timeout=30, interval=10) # 警告レベル
self.critical_watchdog = Watchdog(timeout=60, interval=15) # 危険レベル
self.emergency_watchdog = Watchdog(timeout=120, interval=20) # 緊急レベル
# 各レベルのコールバック設定
self.warning_watchdog.setCallback(self.on_warning)
self.critical_watchdog.setCallback(self.on_critical)
self.emergency_watchdog.setCallback(self.on_emergency)
self.alert_level = "normal"
def on_warning(self):
"""警告レベルのコールバック"""
self.alert_level = "warning"
print("⚠️ 警告: システムの応答が遅くなっています")
# 軽度の対応処理
def on_critical(self):
"""危険レベルのコールバック"""
self.alert_level = "critical"
print("🔴 危険: システムの重大な問題を検出")
# 中程度の復旧処理
def on_emergency(self):
"""緊急レベルのコールバック"""
self.alert_level = "emergency"
print("🚨 緊急: システムが完全に応答停止")
# 強制復旧・再起動処理
def feed_all(self):
"""すべてのウォッチドッグに餌やり"""
self.warning_watchdog.feed()
self.critical_watchdog.feed()
self.emergency_watchdog.feed()
if self.alert_level != "normal":
print("✅ システム復旧確認")
self.alert_level = "normal"
def start_monitoring(self):
"""多段階監視開始"""
self.warning_watchdog.start_in_thread(daemon=True)
self.critical_watchdog.start_in_thread(daemon=True)
self.emergency_watchdog.start_in_thread(daemon=True)
def stop_monitoring(self):
"""監視停止"""
self.warning_watchdog.stop()
self.critical_watchdog.stop()
self.emergency_watchdog.stop()
# 使用例
multilevel_monitor = MultilevelWatchdog()
multilevel_monitor.start_monitoring()
# 正常時は定期餌やり、異常時は餌やり停止で段階的警告
for i in range(30):
time.sleep(5)
# 時々餌やりを忘れるシミュレーション
if i % 7 != 0: # 7回に1回は餌やりしない
multilevel_monitor.feed_all()
print(f"現在の警告レベル: {multilevel_monitor.alert_level}")
multilevel_monitor.stop_monitoring()
```
## エラーハンドリング・防御機構
### 例外安全性
```python
def safe_callback_example():
"""安全なコールバック実装例"""
def potentially_failing_callback():
"""例外を起こす可能性があるコールバック"""
print("重要な処理を実行中...")
# 何らかの理由で例外が発生
raise RuntimeError("処理中にエラーが発生しました")
# ウォッチドッグは例外を隔離するため、システム全体は継続動作
watchdog = Watchdog(timeout=10, interval=5)
watchdog.setCallback(potentially_failing_callback)
# エラーが発生してもウォッチドッグ自体は停止しない
watchdog.start_in_thread(daemon=True)
# 通常の処理継続
for i in range(5):
time.sleep(3)
watchdog.feed()
print(f"メイン処理継続中: {i}")
watchdog.stop()
print("ウォッチドッグは例外に関係なく正常に停止しました")
safe_callback_example()
```
### 堅牢なスレッド制御
```python
class RobustWatchdog:
"""より堅牢なウォッチドッグ実装"""
def __init__(self, timeout=60, interval=20):
self.base_watchdog = Watchdog(timeout, interval)
self.restart_count = 0
self.max_restarts = 3
def robust_callback(self):
"""自動復旧機能付きコールバック"""
try:
print(f"問題検出(再起動回数: {self.restart_count}/{self.max_restarts})")
if self.restart_count < self.max_restarts:
self.attempt_recovery()
self.restart_count += 1
else:
print("最大再起動回数に達しました。管理者に連絡してください。")
self.emergency_shutdown()
except Exception as e:
print(f"復旧処理中にエラー: {e}")
def attempt_recovery(self):
"""復旧処理の試行"""
print("自動復旧処理を実行中...")
time.sleep(2) # 復旧処理のシミュレーション
# 復旧成功時はカウンターリセット
if self.check_system_health():
self.restart_count = 0
self.base_watchdog.feed()
print("復旧成功")
else:
print("復旧失敗")
def check_system_health(self):
"""システム正常性確認"""
# 実際のヘルスチェックロジック
import random
return random.random() > 0.3 # 70%成功率
def emergency_shutdown(self):
"""緊急停止処理"""
print("緊急停止処理を実行します")
# 安全な停止処理
def start_robust_monitoring(self):
"""堅牢監視開始"""
self.base_watchdog.setCallback(self.robust_callback)
self.base_watchdog.start_in_thread(daemon=True)
def feed(self):
"""餌やり(成功時はカウンターリセット)"""
self.base_watchdog.feed()
self.restart_count = 0
def stop(self):
"""監視停止"""
self.base_watchdog.stop()
# 使用例
robust_monitor = RobustWatchdog(timeout=20, interval=8)
robust_monitor.start_robust_monitoring()
# 不安定なシステムのシミュレーション
for i in range(15):
time.sleep(3)
# 時々システム異常をシミュレート
if random.random() > 0.7: # 30%の確率で異常
print("システム異常発生...")
# 餌やりしない
else:
robust_monitor.feed()
print("システム正常動作")
robust_monitor.stop()
```
## 性能・リソース考慮事項
### 軽量設計の特徴
- 最小限のメモリフットプリント
- 効率的なスレッド利用
- CPU使用量の最適化
### 推奨設定値
```python
# 用途別推奨設定
usage_patterns = {
"realtime_monitoring": {
"timeout": 10, # 10秒
"interval": 2 # 2秒間隔
},
"service_monitoring": {
"timeout": 60, # 1分
"interval": 15 # 15秒間隔
},
"batch_processing": {
"timeout": 300, # 5分
"interval": 60 # 1分間隔
},
"background_tasks": {
"timeout": 1800, # 30分
"interval": 300 # 5分間隔
}
}
```
## 依存関係・要件
### 必須依存関係
- `threading`: スレッド制御
- `time`: 時刻管理
- 標準ライブラリのみ(外部依存なし)
### システム要件
- Python 3.7以上
- マルチスレッド対応OS
- 最小限のシステムリソース
## 注意事項・制限
### 設計上の制限
- 単純なタイムアウトベース監視のみ
- 複雑な条件判定は非対応
- ネットワーク監視等は上位層で実装
### 使用上の注意
- コールバック関数は軽量に保つ
- 長時間ブロックする処理は避ける
- 適切なタイムアウト値の設定が重要
## 関連モジュール
- `threading`: スレッド管理
- `config.py`: 監視設定管理
- `utils.py`: エラーログ・ユーティリティ
- `controller.py`: 監視制御インターフェース
## 将来の改善点
- より複雑な監視条件のサポート
- 監視統計・メトリクス収集機能
- 設定可能な復旧戦略
- 分散監視システムとの連携
- Webインターフェースでの監視状態表示
+989
View File
@@ -0,0 +1,989 @@
# websocket_server.py - WebSocket通信サーバー
## 概要
非同期WebSocket通信を提供する包括的なサーバーシステムです。クライアント接続管理、メッセージ配信、外部スレッドからの安全な操作を統合し、VRCTアプリケーションとWebフロントエンド間のリアルタイム通信を実現します。
## 主要機能
### 非同期WebSocket通信
- asyncio/websockets による高性能WebSocketサーバー
- 複数クライアント同時接続対応
- 自動接続・切断管理
### メッセージング機能
- リアルタイムメッセージ受信処理
- 全クライアントへのブロードキャスト配信
- カスタムメッセージハンドラー対応
### スレッド間通信
- GUI等の外部スレッドからの安全なメッセージ送信
- 非同期キューによる効率的な通信制御
- スレッドセーフな操作保証
## クラス構造
### WebSocketServer クラス
```python
class WebSocketServer:
def __init__(self, host: str='127.0.0.1', port: int=8765):
self.host: str # サーバーホスト
self.port: int # サーバーポート
self.clients: Set[WebSocketServerProtocol] # 接続クライアント集合
self._message_handler: Optional[Callable] # メッセージハンドラー
self._loop: Optional[asyncio.AbstractEventLoop] # イベントループ
self._server: Optional[websockets.serve] # WebSocketサーバー
self._thread: Optional[threading.Thread] # サーバースレッド
self._send_queue: Optional[asyncio.Queue] # 送信キュー
self.is_running: bool # 動作状態フラグ
```
WebSocket通信の中核管理クラス
## 主要メソッド
### サーバー制御
```python
def start_server(self) -> None
```
WebSocketサーバーを開始(バックグラウンドスレッド)
```python
def stop_server(self) -> None
```
WebSocketサーバーを停止・リソース解放
### メッセージハンドリング
```python
def set_message_handler(self, handler: Callable[['WebSocketServer', WebSocketServerProtocol, str], None]) -> None
```
クライアントからのメッセージ受信時コールバック設定
#### パラメータ
- **handler**: メッセージハンドラー関数 `(server, websocket, message) -> None`
### メッセージ送信
```python
def send(self, message: str) -> None
```
外部スレッドから安全にメッセージを全クライアントに送信
#### パラメータ
- **message**: 送信するメッセージ文字列
```python
def broadcast(self, message: str) -> None
```
非同期的に全クライアントにメッセージをブロードキャスト
#### パラメータ
- **message**: ブロードキャストするメッセージ
## 使用方法
### 基本的なWebSocketサーバー
```python
from models.websocket.websocket_server import WebSocketServer
import time
import json
# メッセージハンドラーの定義
def on_message_received(server, websocket, message):
"""クライアントからのメッセージ処理"""
print(f"クライアントからメッセージ受信: {message}")
try:
# JSONメッセージの解析
data = json.loads(message)
if data.get('type') == 'translation_request':
# 翻訳要求の処理
handle_translation_request(server, data)
elif data.get('type') == 'config_update':
# 設定更新の処理
handle_config_update(server, data)
else:
# エコーバック
response = {
'type': 'echo',
'original_message': data,
'timestamp': time.time()
}
server.broadcast(json.dumps(response))
except json.JSONDecodeError:
# テキストメッセージの場合
response = f"受信しました: {message}"
server.broadcast(response)
def handle_translation_request(server, data):
"""翻訳要求の処理"""
text = data.get('text', '')
target_lang = data.get('target_language', 'English')
# 実際の翻訳処理(ここではモック)
translated_text = f"[{target_lang}] {text}"
response = {
'type': 'translation_result',
'original': text,
'translated': translated_text,
'target_language': target_lang
}
server.broadcast(json.dumps(response))
def handle_config_update(server, data):
"""設定更新の処理"""
config_key = data.get('key')
config_value = data.get('value')
print(f"設定更新: {config_key} = {config_value}")
response = {
'type': 'config_updated',
'key': config_key,
'value': config_value,
'status': 'success'
}
server.broadcast(json.dumps(response))
# WebSocketサーバーの起動
ws_server = WebSocketServer(host='127.0.0.1', port=8765)
ws_server.set_message_handler(on_message_received)
ws_server.start_server()
print("WebSocketサーバーが起動しました: ws://127.0.0.1:8765")
# 定期的なステータス送信
for i in range(10):
status_message = {
'type': 'status',
'server_time': time.time(),
'uptime': i * 5,
'connected_clients': len(ws_server.clients)
}
ws_server.send(json.dumps(status_message))
time.sleep(5)
# サーバー停止
ws_server.stop_server()
```
### VRCTアプリケーション統合
```python
class VRCTWebSocketInterface:
"""VRCT用WebSocketインターフェース"""
def __init__(self, controller, port=8765):
self.controller = controller # VRCTコントローラー
self.ws_server = WebSocketServer(host='127.0.0.1', port=port)
self.ws_server.set_message_handler(self.handle_web_message)
def handle_web_message(self, server, websocket, message):
"""Webクライアントからのメッセージ処理"""
try:
data = json.loads(message)
command = data.get('command')
if command == 'get_config':
self.send_config(server)
elif command == 'set_config':
self.update_config(server, data)
elif command == 'start_translation':
self.start_translation_service(server, data)
elif command == 'stop_translation':
self.stop_translation_service(server)
elif command == 'get_status':
self.send_status(server)
elif command == 'translate_text':
self.translate_text(server, data)
else:
self.send_error(server, f"未知のコマンド: {command}")
except Exception as e:
self.send_error(server, f"メッセージ処理エラー: {e}")
def send_config(self, server):
"""設定情報をWebクライアントに送信"""
config_data = {
'type': 'config',
'data': {
'source_language': self.controller.config.source_language,
'target_language': self.controller.config.target_language,
'translation_engine': self.controller.config.translation_engine,
'osc_enabled': self.controller.config.osc_enabled,
'overlay_enabled': self.controller.config.overlay_enabled
}
}
server.broadcast(json.dumps(config_data))
def update_config(self, server, data):
"""設定更新"""
config_updates = data.get('config', {})
for key, value in config_updates.items():
if hasattr(self.controller.config, key):
setattr(self.controller.config, key, value)
print(f"設定更新: {key} = {value}")
# 更新確認を送信
response = {
'type': 'config_updated',
'status': 'success',
'updated_keys': list(config_updates.keys())
}
server.broadcast(json.dumps(response))
def start_translation_service(self, server, data):
"""翻訳サービス開始"""
try:
self.controller.start_translation()
response = {
'type': 'service_status',
'service': 'translation',
'status': 'started',
'message': '翻訳サービスが開始されました'
}
server.broadcast(json.dumps(response))
except Exception as e:
self.send_error(server, f"翻訳サービス開始エラー: {e}")
def stop_translation_service(self, server):
"""翻訳サービス停止"""
try:
self.controller.stop_translation()
response = {
'type': 'service_status',
'service': 'translation',
'status': 'stopped',
'message': '翻訳サービスが停止されました'
}
server.broadcast(json.dumps(response))
except Exception as e:
self.send_error(server, f"翻訳サービス停止エラー: {e}")
def send_status(self, server):
"""システム状態送信"""
status_data = {
'type': 'system_status',
'data': {
'translation_active': self.controller.is_translation_active(),
'osc_connected': self.controller.is_osc_connected(),
'overlay_active': self.controller.is_overlay_active(),
'connected_clients': len(server.clients),
'uptime': self.controller.get_uptime(),
'memory_usage': self.controller.get_memory_usage()
}
}
server.broadcast(json.dumps(status_data))
def translate_text(self, server, data):
"""即座翻訳実行"""
text = data.get('text', '')
source_lang = data.get('source_language')
target_lang = data.get('target_language')
try:
# 翻訳実行
result = self.controller.translate_text(
text, source_lang, target_lang
)
response = {
'type': 'translation_result',
'original': text,
'translated': result,
'source_language': source_lang,
'target_language': target_lang,
'timestamp': time.time()
}
server.broadcast(json.dumps(response))
except Exception as e:
self.send_error(server, f"翻訳エラー: {e}")
def send_error(self, server, error_message):
"""エラーメッセージ送信"""
error_data = {
'type': 'error',
'message': error_message,
'timestamp': time.time()
}
server.broadcast(json.dumps(error_data))
def start(self):
"""WebSocketインターフェース開始"""
self.ws_server.start_server()
print(f"VRCT WebSocketインターフェース開始: ws://127.0.0.1:{self.ws_server.port}")
def stop(self):
"""WebSocketインターフェース停止"""
self.ws_server.stop_server()
print("VRCT WebSocketインターフェース停止")
def notify_translation_result(self, original, translated, source_lang, target_lang):
"""翻訳結果の通知(VRCTコントローラーから呼び出し)"""
notification = {
'type': 'live_translation',
'original': original,
'translated': translated,
'source_language': source_lang,
'target_language': target_lang,
'timestamp': time.time()
}
self.ws_server.send(json.dumps(notification))
# 使用例(VRCTアプリケーション内)
# vrct_ws_interface = VRCTWebSocketInterface(controller)
# vrct_ws_interface.start()
```
### リアルタイム監視ダッシュボード
```python
class MonitoringDashboard:
"""リアルタイム監視ダッシュボード"""
def __init__(self, system_components, port=8766):
self.components = system_components
self.ws_server = WebSocketServer(host='127.0.0.1', port=port)
self.ws_server.set_message_handler(self.handle_dashboard_message)
self.monitoring_active = False
def handle_dashboard_message(self, server, websocket, message):
"""ダッシュボードからのメッセージ処理"""
try:
data = json.loads(message)
action = data.get('action')
if action == 'start_monitoring':
self.start_monitoring(server)
elif action == 'stop_monitoring':
self.stop_monitoring(server)
elif action == 'get_metrics':
self.send_metrics(server)
elif action == 'get_logs':
self.send_logs(server, data.get('limit', 100))
except Exception as e:
self.send_dashboard_error(server, str(e))
def start_monitoring(self, server):
"""監視開始"""
if not self.monitoring_active:
self.monitoring_active = True
# 監視スレッド開始
import threading
monitor_thread = threading.Thread(
target=self.monitoring_loop,
args=(server,),
daemon=True
)
monitor_thread.start()
response = {
'type': 'monitoring_status',
'status': 'started'
}
server.broadcast(json.dumps(response))
def stop_monitoring(self, server):
"""監視停止"""
self.monitoring_active = False
response = {
'type': 'monitoring_status',
'status': 'stopped'
}
server.broadcast(json.dumps(response))
def monitoring_loop(self, server):
"""リアルタイム監視ループ"""
while self.monitoring_active:
try:
# システムメトリクス収集
metrics = self.collect_metrics()
# ダッシュボードに送信
dashboard_data = {
'type': 'live_metrics',
'metrics': metrics,
'timestamp': time.time()
}
server.broadcast(json.dumps(dashboard_data))
time.sleep(2) # 2秒間隔で更新
except Exception as e:
print(f"監視ループエラー: {e}")
time.sleep(5)
def collect_metrics(self):
"""システムメトリクス収集"""
import psutil
metrics = {
'system': {
'cpu_percent': psutil.cpu_percent(),
'memory_percent': psutil.virtual_memory().percent,
'disk_usage': psutil.disk_usage('/').percent
},
'network': {
'bytes_sent': psutil.net_io_counters().bytes_sent,
'bytes_recv': psutil.net_io_counters().bytes_recv
},
'vrct': {
'translation_count': self.components.get('translation_count', 0),
'osc_messages_sent': self.components.get('osc_count', 0),
'overlay_updates': self.components.get('overlay_count', 0),
'active_connections': len(self.ws_server.clients)
}
}
return metrics
def send_metrics(self, server):
"""メトリクス送信"""
metrics = self.collect_metrics()
response = {
'type': 'metrics_snapshot',
'metrics': metrics,
'timestamp': time.time()
}
server.broadcast(json.dumps(response))
def send_logs(self, server, limit):
"""ログ送信"""
# ログファイルから最新のログを取得(実装例)
logs = self.get_recent_logs(limit)
response = {
'type': 'log_data',
'logs': logs,
'count': len(logs)
}
server.broadcast(json.dumps(response))
def get_recent_logs(self, limit):
"""最新ログ取得"""
# 実際のログファイル読み込み処理
mock_logs = [
{'level': 'INFO', 'message': 'システム開始', 'timestamp': time.time() - 60},
{'level': 'DEBUG', 'message': '翻訳処理完了', 'timestamp': time.time() - 30},
{'level': 'WARNING', 'message': 'メモリ使用量増加', 'timestamp': time.time() - 10}
]
return mock_logs[-limit:]
def send_dashboard_error(self, server, error_message):
"""ダッシュボードエラー送信"""
error_data = {
'type': 'dashboard_error',
'message': error_message,
'timestamp': time.time()
}
server.broadcast(json.dumps(error_data))
def start_dashboard(self):
"""ダッシュボード開始"""
self.ws_server.start_server()
print(f"監視ダッシュボード開始: ws://127.0.0.1:{self.ws_server.port}")
def stop_dashboard(self):
"""ダッシュボード停止"""
self.monitoring_active = False
self.ws_server.stop_server()
# 使用例
system_components = {
'translation_count': 150,
'osc_count': 75,
'overlay_count': 200
}
dashboard = MonitoringDashboard(system_components)
dashboard.start_dashboard()
# しばらく実行
time.sleep(60)
dashboard.stop_dashboard()
```
### 高度なメッセージルーティング
```python
class WebSocketRouter:
"""WebSocketメッセージルーティングシステム"""
def __init__(self, port=8767):
self.ws_server = WebSocketServer(host='127.0.0.1', port=port)
self.ws_server.set_message_handler(self.route_message)
self.routes = {}
self.middleware = []
self.client_subscriptions = {}
def add_route(self, message_type, handler):
"""メッセージタイプに対するハンドラー登録"""
self.routes[message_type] = handler
def add_middleware(self, middleware_func):
"""ミドルウェア追加"""
self.middleware.append(middleware_func)
def route_message(self, server, websocket, message):
"""メッセージルーティング処理"""
try:
# JSON解析
data = json.loads(message)
message_type = data.get('type')
# ミドルウェア実行
for middleware in self.middleware:
data = middleware(data, websocket)
if data is None: # ミドルウェアがNoneを返した場合は処理中断
return
# ルーティング実行
if message_type in self.routes:
handler = self.routes[message_type]
response = handler(data, websocket, server)
if response:
server.broadcast(json.dumps(response))
else:
# 未定義メッセージタイプ
error_response = {
'type': 'error',
'message': f'未対応メッセージタイプ: {message_type}',
'original_type': message_type
}
websocket.send(json.dumps(error_response))
except json.JSONDecodeError as e:
error_response = {
'type': 'error',
'message': f'JSON解析エラー: {e}'
}
websocket.send(json.dumps(error_response))
except Exception as e:
error_response = {
'type': 'error',
'message': f'処理エラー: {e}'
}
websocket.send(json.dumps(error_response))
def subscription_middleware(self, data, websocket):
"""購読管理ミドルウェア"""
message_type = data.get('type')
if message_type == 'subscribe':
# 購読登録
topics = data.get('topics', [])
client_id = id(websocket)
self.client_subscriptions[client_id] = topics
response = {
'type': 'subscription_confirmed',
'topics': topics
}
websocket.send(json.dumps(response))
return None # 処理終了
elif message_type == 'unsubscribe':
# 購読解除
client_id = id(websocket)
if client_id in self.client_subscriptions:
del self.client_subscriptions[client_id]
response = {
'type': 'unsubscription_confirmed'
}
websocket.send(json.dumps(response))
return None
return data # そのまま次の処理に進む
def authentication_middleware(self, data, websocket):
"""認証ミドルウェア"""
# 簡易認証例
api_key = data.get('api_key')
if api_key != 'valid_api_key_123':
error_response = {
'type': 'authentication_error',
'message': '無効なAPIキー'
}
websocket.send(json.dumps(error_response))
return None
return data
def logging_middleware(self, data, websocket):
"""ログ記録ミドルウェア"""
client_ip = websocket.remote_address[0] if websocket.remote_address else 'unknown'
message_type = data.get('type', 'unknown')
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] {client_ip} -> {message_type}")
return data
def broadcast_to_subscribers(self, topic, message_data):
"""購読者へのトピック配信"""
message_data['topic'] = topic
message_json = json.dumps(message_data)
for client_id, topics in self.client_subscriptions.items():
if topic in topics:
# 該当クライアントを検索
for client in self.ws_server.clients:
if id(client) == client_id:
try:
client.send(message_json)
except Exception as e:
print(f"配信エラー: {e}")
break
def start_router(self):
"""ルーター開始"""
self.ws_server.start_server()
print(f"WebSocketルーター開始: ws://127.0.0.1:{self.ws_server.port}")
def stop_router(self):
"""ルーター停止"""
self.ws_server.stop_server()
# 使用例
def handle_chat_message(data, websocket, server):
"""チャットメッセージハンドラー"""
username = data.get('username', 'Anonymous')
message = data.get('message', '')
response = {
'type': 'chat_broadcast',
'username': username,
'message': message,
'timestamp': time.time()
}
return response
def handle_translation_request(data, websocket, server):
"""翻訳要求ハンドラー"""
text = data.get('text', '')
# 翻訳処理(モック)
translated = f"[翻訳] {text}"
response = {
'type': 'translation_response',
'original': text,
'translated': translated
}
return response
# ルーター設定
router = WebSocketRouter()
# ミドルウェア登録
router.add_middleware(router.logging_middleware)
router.add_middleware(router.subscription_middleware)
# router.add_middleware(router.authentication_middleware) # 認証が必要な場合
# ルート登録
router.add_route('chat_message', handle_chat_message)
router.add_route('translation_request', handle_translation_request)
router.start_router()
# トピック配信テスト
time.sleep(2)
router.broadcast_to_subscribers('system_updates', {
'type': 'system_notification',
'message': 'システム更新完了',
'severity': 'info'
})
time.sleep(10)
router.stop_router()
```
## 高度な機能・パターン
### 接続プール管理
```python
class ConnectionPoolManager:
"""WebSocket接続プール管理"""
def __init__(self):
self.pools = {} # pool_name -> set of websockets
def assign_to_pool(self, websocket, pool_name):
"""クライアントをプールに割り当て"""
if pool_name not in self.pools:
self.pools[pool_name] = set()
self.pools[pool_name].add(websocket)
print(f"クライアントを {pool_name} プールに追加")
def remove_from_pools(self, websocket):
"""すべてのプールからクライアントを削除"""
for pool_name, pool in self.pools.items():
if websocket in pool:
pool.discard(websocket)
print(f"クライアントを {pool_name} プールから削除")
def broadcast_to_pool(self, pool_name, message):
"""特定プールに対してブロードキャスト"""
if pool_name in self.pools:
for websocket in self.pools[pool_name].copy():
try:
websocket.send(message)
except Exception:
# 切断されたクライアントを削除
self.pools[pool_name].discard(websocket)
def get_pool_stats(self):
"""プール統計情報"""
stats = {}
for pool_name, pool in self.pools.items():
stats[pool_name] = len(pool)
return stats
```
### メッセージ永続化・再送機能
```python
class PersistentMessageSystem:
"""メッセージ永続化・再送システム"""
def __init__(self, max_history=1000):
self.message_history = []
self.max_history = max_history
self.client_last_seen = {} # client_id -> last_message_id
def store_message(self, message_data):
"""メッセージを履歴に保存"""
message_id = len(self.message_history)
stored_message = {
'id': message_id,
'data': message_data,
'timestamp': time.time()
}
self.message_history.append(stored_message)
# 履歴サイズ制限
if len(self.message_history) > self.max_history:
self.message_history = self.message_history[-self.max_history:]
return message_id
def get_missed_messages(self, client_id, last_seen_id):
"""クライアントが見逃したメッセージを取得"""
missed_messages = []
for msg in self.message_history:
if msg['id'] > last_seen_id:
missed_messages.append(msg)
return missed_messages
def client_reconnected(self, websocket, client_id):
"""クライアント再接続時の処理"""
last_seen = self.client_last_seen.get(client_id, -1)
missed_messages = self.get_missed_messages(client_id, last_seen)
# 見逃したメッセージを再送
for msg in missed_messages:
try:
recovery_data = {
'type': 'message_recovery',
'original_message': msg['data'],
'message_id': msg['id'],
'original_timestamp': msg['timestamp']
}
websocket.send(json.dumps(recovery_data))
except Exception as e:
print(f"メッセージ再送エラー: {e}")
print(f"クライアント {client_id} に {len(missed_messages)} 件のメッセージを再送")
def update_client_position(self, client_id, message_id):
"""クライアントの最新メッセージ位置更新"""
self.client_last_seen[client_id] = message_id
```
## パフォーマンス・スケーラビリティ
### 負荷分散・最適化
```python
class OptimizedWebSocketServer(WebSocketServer):
"""最適化されたWebSocketサーバー"""
def __init__(self, host='127.0.0.1', port=8765):
super().__init__(host, port)
self.message_stats = {
'total_messages': 0,
'messages_per_second': 0,
'last_reset_time': time.time()
}
self.compression_enabled = True
self.batch_size = 50
self.batch_timeout = 0.1
def enable_message_batching(self, batch_size=50, timeout=0.1):
"""メッセージバッチング有効化"""
self.batch_size = batch_size
self.batch_timeout = timeout
async def optimized_broadcast(self, message_batch):
"""最適化されたバッチブロードキャスト"""
if not self.clients:
return
# 圧縮対応
if self.compression_enabled and len(message_batch) > 1:
# 複数メッセージをまとめて送信
combined_message = json.dumps({
'type': 'batch',
'messages': message_batch,
'count': len(message_batch)
})
else:
combined_message = json.dumps(message_batch[0])
# 並列送信(エラー処理付き)
send_tasks = []
for client in self.clients.copy():
send_tasks.append(self.safe_send(client, combined_message))
results = await asyncio.gather(*send_tasks, return_exceptions=True)
# 失敗したクライアントを削除
for i, result in enumerate(results):
if isinstance(result, Exception):
failed_client = list(self.clients)[i]
self.clients.discard(failed_client)
print(f"クライアント削除(送信失敗): {result}")
# 統計更新
self.update_message_stats(len(message_batch))
async def safe_send(self, client, message):
"""安全なメッセージ送信"""
try:
await client.send(message)
except Exception as e:
raise e # gather で捕捉される
def update_message_stats(self, message_count):
"""メッセージ統計更新"""
self.message_stats['total_messages'] += message_count
current_time = time.time()
time_diff = current_time - self.message_stats['last_reset_time']
if time_diff >= 1.0: # 1秒ごとに速度計算
self.message_stats['messages_per_second'] = message_count / time_diff
self.message_stats['last_reset_time'] = current_time
def get_performance_stats(self):
"""パフォーマンス統計取得"""
return {
'connected_clients': len(self.clients),
'total_messages': self.message_stats['total_messages'],
'messages_per_second': self.message_stats['messages_per_second'],
'compression_enabled': self.compression_enabled,
'batch_size': self.batch_size
}
```
## 依存関係・システム要件
### 必須依存関係
- `asyncio`: 非同期処理フレームワーク
- `websockets`: WebSocketライブラリ
- `threading`: マルチスレッド制御
- `json`: JSON形式データ処理
### システム要件
```python
system_requirements = {
"python_version": "3.7以上",
"asyncio_support": "非同期処理対応",
"network_stack": "TCP/WebSocket対応",
"memory": "同時接続数に応じた十分なメモリ"
}
performance_characteristics = {
"concurrent_connections": "数百~数千接続対応",
"message_throughput": "秒間数千メッセージ処理可能",
"latency": "低レイテンシー(ミリ秒オーダー)",
"memory_per_connection": "約1-5MB(接続当たり)"
}
```
### オプション依存関係
- `ujson`: 高速JSON処理(パフォーマンス向上)
- `compression`: メッセージ圧縮(帯域節約)
## 注意事項・制限
### ネットワーク制限
- ファイアウォール設定の要確認
- プロキシ環境での制限可能性
- ブラウザーのWebSocket接続制限
### スケーラビリティ制限
- 単一プロセスでの同時接続数制限
- メモリ使用量の線形増加
- CPU集約的な処理での性能劣化
### セキュリティ考慮事項
```python
security_considerations = {
"authentication": "認証機構の実装推奨",
"authorization": "適切な認可制御",
"rate_limiting": "レート制限の実装",
"input_validation": "入力データの検証必須",
"cors_policy": "CORS設定の適切な構成"
}
```
## 関連モジュール
- `config.py`: WebSocket設定管理
- `controller.py`: WebSocket制御インターフェース
- `utils.py`: エラーログ・ユーティリティ
- `model.py`: WebSocket機能統合
## 将来の改善点
- Redis等を用いたメッセージブローカー連携
- 負荷分散・クラスタリング対応
- より高度な認証・認可システム
- WebRTC等のより高速な通信プロトコル対応
- GraphQL over WebSocketサポート
- リアルタイム監視・分析機能の強化
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,212 @@
# エラーハンドリング統一システム移行ガイド
## 概要
`errors.py`で定義された統一エラーシステムを使用して、すべてのエラーハンドリングを標準化しました。
## 変更パターン
### 1. 基本的なエラーレスポンス
#### 修正前:
```python
response = {
"status": 400,
"result": {
"message": "Error message",
"data": some_value
}
}
```
#### 修正後:
```python
from errors import ErrorCode, VRCTError
response = VRCTError.create_error_response(
ErrorCode.APPROPRIATE_ERROR_CODE,
data=some_value
)
```
### 2. run_mapping経由のエラー通知
#### 修正前:
```python
self.run(
400,
self.run_mapping["error_device"],
{
"message": "No mic device detected",
"data": None
},
)
```
#### 修正後:
```python
error_response = VRCTError.create_error_response(
ErrorCode.DEVICE_NO_MIC,
data=None
)
self.run(
error_response["status"],
self.run_mapping["error_device"],
error_response["result"],
)
```
### 3. 例外からのエラー生成
#### 修正前:
```python
except Exception as e:
errorLogging()
response = {
"status": 400,
"result": {
"message": f"Error {e}",
"data": original_value
}
}
```
#### 修正後:
```python
except Exception as e:
errorLogging()
response = VRCTError.create_exception_error_response(
e,
data=original_value
)
```
## 既に移行済みの箇所
### デバイスエラー
- ✅ `progressBarMicEnergy` - `ErrorCode.DEVICE_NO_MIC`
- ✅ `progressBarSpeakerEnergy` - `ErrorCode.DEVICE_NO_SPEAKER`
### ウェイトダウンロードエラー
- ✅ `DownloadCTranslate2.downloaded` - `ErrorCode.WEIGHT_CTRANSLATE2_DOWNLOAD`
- ✅ `DownloadWhisper.downloaded` - `ErrorCode.WEIGHT_WHISPER_DOWNLOAD`
### 翻訳エラー
- ✅ `micMessage` - `ErrorCode.TRANSLATION_ENGINE_LIMIT`, `ErrorCode.TRANSLATION_VRAM_MIC`, `ErrorCode.TRANSLATION_DISABLED_VRAM`
- ✅ `speakerMessage` - `ErrorCode.TRANSLATION_ENGINE_LIMIT`, `ErrorCode.TRANSLATION_VRAM_SPEAKER`, `ErrorCode.TRANSLATION_DISABLED_VRAM`
- ✅ `chatMessage` - `ErrorCode.TRANSLATION_ENGINE_LIMIT`, `ErrorCode.TRANSLATION_VRAM_CHAT`, `ErrorCode.TRANSLATION_DISABLED_VRAM`
- ✅ `setEnableTranslation` - `ErrorCode.TRANSLATION_VRAM_ENABLE`, `ErrorCode.TRANSLATION_DISABLED_VRAM`
### バリデーションエラー
- ✅ `setMicThreshold` - `ErrorCode.VALIDATION_MIC_THRESHOLD`
- ✅ `setSpeakerThreshold` - `ErrorCode.VALIDATION_SPEAKER_THRESHOLD`
- ✅ `setMicRecordTimeout` - `ErrorCode.VALIDATION_MIC_RECORD_TIMEOUT`
- ✅ `setMicPhraseTimeout` - `ErrorCode.VALIDATION_MIC_PHRASE_TIMEOUT`
- ✅ `setMicMaxPhrases` - `ErrorCode.VALIDATION_MIC_MAX_PHRASES`
- ✅ `setSpeakerRecordTimeout` - `ErrorCode.VALIDATION_SPEAKER_RECORD_TIMEOUT`
- ✅ `setSpeakerPhraseTimeout` - `ErrorCode.VALIDATION_SPEAKER_PHRASE_TIMEOUT`
- ✅ `setSpeakerMaxPhrases` - `ErrorCode.VALIDATION_SPEAKER_MAX_PHRASES`
- ✅ `setOscIpAddress` - `ErrorCode.VALIDATION_INVALID_IP`, `ErrorCode.VALIDATION_CANNOT_SET_IP`
### VRC連携エラー
- ✅ `setEnableVrcMicMuteSync` - `ErrorCode.VRC_MIC_MUTE_SYNC_OSC_DISABLED`
### 認証エラー
- ✅ `setDeeplAuthKey` - `ErrorCode.AUTH_DEEPL_LENGTH`, `ErrorCode.AUTH_DEEPL_FAILED`
## 未移行の箇所(要対応)
以下の箇所は同様のパターンで移行が必要です:
### 認証関連
- ⬜ `setPlamoAuthKey` - `ErrorCode.AUTH_PLAMO_LENGTH`, `ErrorCode.AUTH_PLAMO_FAILED`
- ⬜ `setPlamoModel` - `ErrorCode.MODEL_PLAMO_INVALID`
- ⬜ `setGeminiAuthKey` - `ErrorCode.AUTH_GEMINI_LENGTH`, `ErrorCode.AUTH_GEMINI_FAILED`
- ⬜ `setGeminiModel` - `ErrorCode.MODEL_GEMINI_INVALID`
- ⬜ `setOpenAIAuthKey` - `ErrorCode.AUTH_OPENAI_INVALID`, `ErrorCode.AUTH_OPENAI_FAILED`
- ⬜ `setOpenAIModel` - `ErrorCode.MODEL_OPENAI_INVALID`
- ⬜ `setGroqAuthKey` - `ErrorCode.AUTH_GROQ_INVALID`, `ErrorCode.AUTH_GROQ_FAILED`
- ⬜ `setGroqModel` - `ErrorCode.MODEL_GROQ_INVALID`
- ⬜ `setOpenRouterAuthKey` - `ErrorCode.AUTH_OPENROUTER_INVALID`, `ErrorCode.AUTH_OPENROUTER_FAILED`
- ⬜ `setOpenRouterModel` - `ErrorCode.MODEL_OPENROUTER_INVALID`
### 接続関連
- ⬜ `checkTranslatorLMStudioConnection` - `ErrorCode.CONNECTION_LMSTUDIO_FAILED`
- ⬜ `setTranslatorLMStudioURL` - `ErrorCode.CONNECTION_LMSTUDIO_URL_INVALID`
- ⬜ `setTranslatorLMStudioModel` - `ErrorCode.MODEL_LMSTUDIO_INVALID`
- ⬜ `checkTranslatorOllamaConnection` - `ErrorCode.CONNECTION_OLLAMA_FAILED`
- ⬜ `setTranslatorOllamaModel` - `ErrorCode.MODEL_OLLAMA_INVALID`
### WebSocket関連
- ⬜ `setWebSocketHost` - `ErrorCode.VALIDATION_INVALID_IP`, `ErrorCode.WEBSOCKET_HOST_INVALID`
- ⬜ `setWebSocketPort` - `ErrorCode.WEBSOCKET_PORT_UNAVAILABLE`
- ⬜ `setEnableWebSocketServer` - `ErrorCode.WEBSOCKET_SERVER_UNAVAILABLE`
### 音声認識VRAM関連
- ⬜ `startTranscriptionSendMessage` - `ErrorCode.TRANSCRIPTION_VRAM_MIC`, `ErrorCode.TRANSCRIPTION_SEND_DISABLED_VRAM`
- ⬜ `startTranscriptionReceiveMessage` - `ErrorCode.TRANSCRIPTION_VRAM_SPEAKER`, `ErrorCode.TRANSCRIPTION_RECEIVE_DISABLED_VRAM`
## エラーコードとエンドポイントの対応
`errors.py`の`ENDPOINT_ERROR_MAPPING`に、すべてのエンドポイントとエラーコードの対応が定義されています。
UI開発者はこのマッピングを参照して、各エンドポイントがどのようなエラーを返すか確認できます。
## エラーレスポンスの構造
統一されたエラーレスポンスは以下の構造を持ちます:
```python
{
"status": 400, # HTTPステータスコード
"result": {
"error_code": "ERROR_CODE_CONSTANT", # エラーコード定数
"message": "Human readable message", # 人間が読めるメッセージ
"data": None or original_value, # エラー時に戻す値(通常は元の値)
"details": {}, # 追加情報(オプション)
"category": "category_name", # エラーカテゴリ
"severity": "warning|error|critical", # 重要度
}
}
```
## UI側での活用
UI側では`error_code`を使用して、エラーの種類を判定し、適切な処理を行うことができます:
```javascript
if (response.status === 400) {
const { error_code, message, data, severity } = response.result;
switch (error_code) {
case "DEVICE_NO_MIC":
// マイクデバイスエラーの処理
break;
case "VALIDATION_MIC_THRESHOLD":
// バリデーションエラーの処理(元の値に戻す)
setValue(data);
break;
// ...
}
// 重要度に応じた表示
if (severity === "critical") {
showCriticalError(message);
}
}
```
## 移行作業の進め方
1. **パターンの確認**: 上記の変更パターンを参照
2. **エラーコードの特定**: `errors.py`から適切な`ErrorCode`を選択
3. **コードの置き換え**: 古いエラーハンドリングを新しいシステムに置き換え
4. **テスト**: エラーが正しく返されることを確認
5. **チェックリストの更新**: このドキュメントの✅を更新
## 注意事項
- すべてのエラーは`errors.py`に定義されたエラーコードを使用すること
- 新しいエラーが必要な場合は、まず`errors.py`に追加すること
- エラーメッセージは`ERROR_METADATA`で定義されたデフォルトメッセージを使用すること
- カスタムメッセージが必要な場合は`custom_message`パラメータを使用
- `data`パラメータには、エラー時にUIが元の値に戻せるように、元の値を渡すこと
+422
View File
@@ -0,0 +1,422 @@
# mainloop.py 設計書
## 概要
`mainloop.py` は VRCT アプリケーションのバックエンドエントリーポイントであり、stdin/stdout を介したフロントエンド(Tauri/React UI)との通信を担当する。JSON ベースのリクエスト/レスポンスプロトコルを実装し、複数のワーカースレッドによる並列処理と排他制御を提供する。
## 主要コンポーネント
### 1. グローバル変数
#### `run_mapping` (dict)
フロントエンドへの通知用エンドポイントマッピング。Controllerが `run()` コールバックを通じてフロントエンドに状態変化を通知する際に使用。
**主要なエンドポイント:**
- `/run/enable_translation` - 翻訳機能の有効/無効状態
- `/run/transcription_mic_message` - マイク音声認識結果
- `/run/transcription_speaker_message` - スピーカー音声認識結果
- `/run/selectable_groq_model_list` - 利用可能な Groq モデルリスト通知
- `/run/selected_groq_model` - 選択中の Groq モデル通知
- `/run/selectable_openrouter_model_list` - 利用可能な OpenRouter モデルリスト通知
- `/run/selected_openrouter_model` - 選択中の OpenRouter モデル通知
- `/run/error_*` - 各種エラー通知
- `/run/initialization_complete` - 初期化完了通知
#### `mapping` (dict)
フロントエンドからのリクエストを処理する関数マッピング。各エンドポイントに対して:
- `status`: ロック状態(True: 処理可能, False: ロック中)
- `variable`: 実行する Controller メソッド
**エンドポイント分類:**
- `/get/data/*` - 設定値の取得(初期化時に使用)
- `/get/data/groq_auth_key` - Groq API キー取得
- `/get/data/selectable_groq_model_list` - 利用可能な Groq モデルリスト取得
- `/get/data/selected_groq_model` - 選択中の Groq モデル取得
- `/get/data/openrouter_auth_key` - OpenRouter API キー取得
- `/get/data/selectable_openrouter_model_list` - 利用可能な OpenRouter モデルリスト取得
- `/get/data/selected_openrouter_model` - 選択中の OpenRouter モデル取得
- `/set/data/*` - 設定値の更新
- `/set/data/groq_auth_key` - Groq API キー設定
- `/set/data/selected_groq_model` - Groq モデル選択
- `/set/data/openrouter_auth_key` - OpenRouter API キー設定
- `/set/data/selected_openrouter_model` - OpenRouter モデル選択
- `/delete/data/*` - 設定値の削除
- `/delete/data/groq_auth_key` - Groq API キー削除
- `/delete/data/openrouter_auth_key` - OpenRouter API キー削除
- `/set/enable/*` - 機能の有効化
- `/set/disable/*` - 機能の無効化
- `/run/*` - アクション実行(メッセージ送信、ダウンロード等)
#### `init_mapping` (dict)
初期化時に実行される `/get/data/*` エンドポイントのサブセット。アプリケーション起動時に全設定値をフロントエンドに送信するために使用。
### 2. Mainクラス
#### コンストラクタ `__init__(controller_instance, mapping_data, worker_count)`
**パラメータ:**
- `controller_instance`: Controller インスタンス
- `mapping_data`: エンドポイントマッピング辞書
- `worker_count`: ハンドラワーカースレッド数(デフォルト: 3)
**初期化処理:**
1. リクエストキュー (`Queue[Tuple[str, Any]]`) の作成
2. 停止イベント (`Event`) の作成
3. エンドポイント別 Lock の生成:
- `/set/enable/xxx` と `/set/disable/xxx` を `/lock/set/xxx` に正規化
- 同一機能の有効化/無効化リクエストが競合しないよう排他制御
**正規化ロジックの例:**
```python
"/set/enable/translation" → "/lock/set/translation"
"/set/disable/translation" → "/lock/set/translation"
# 両方が同じロックを共有 → 排他的に実行される
```
#### `receiver()` メソッド
**責務:** stdin から JSON リクエストを読み取り、キューに投入
**処理フロー:**
1. `sys.stdin.readline()` でブロッキング読み取り
2. JSON パース (`json.loads()`)
3. エンドポイントとデータを抽出
4. データが存在する場合は Base64 デコード (`encodeBase64()`)
5. ログ出力 (`printLog()`)
6. キューに投入 `self.queue.put((endpoint, data))`
**エラー処理:**
- JSON パースエラー: ログ出力して継続
- EOF 到達: 0.1秒待機して再試行
- その他の例外: `errorLogging()` でトレースバック記録
**スレッド:** デーモンスレッド `main_receiver` として起動
#### `handler()` メソッド
**責務:** キューからリクエストを取り出し、適切なロックを取得して処理
**処理フロー:**
1. キューから `(endpoint, data)` を取得(0.5秒タイムアウト)
2. エンドポイントを正規化キーに変換
3. 対応する Lock を取得試行(非ブロッキング)
- 取得成功 → 処理実行 → ロック解放
- 取得失敗 → 0.05秒待機して再キュー
4. `_call_handler(endpoint, data)` を呼び出し
5. レスポンスを stdout に出力 (`printResponse()`)
**排他制御の意義:**
- 例: 翻訳機能の有効化中に無効化リクエストが来た場合、無効化は待機
- 異なる機能のリクエストは並列実行可能
**再キューロジック:**
- status == 423 (Locked): 0.1秒待機して再キュー
- これにより、初期化中の設定変更リクエストが適切にリトライされる
**ワーカー数:** `worker_count` 個のスレッド `main_handler_0`, `main_handler_1`, ... として起動
#### `_call_handler(endpoint, data)` メソッド
**責務:** 実際のビジネスロジック実行
**処理フロー:**
1. `mapping` から対応するハンドラを取得
2. エンドポイントが存在しない → status 404
3. ハンドラの `status` が False → status 423 (Locked)
4. ハンドラの `variable` 関数を実行 → `response = handler["variable"](data)`
5. 0.2秒待機(処理安定化のため)
6. status と result を抽出して返却
**エラー処理:**
- 例外発生時: `errorLogging()` でトレースバック記録、status 500 を返却
#### `start()` / `stop(wait)` メソッド(2025-10 仕様)
**start():**
コミット `5ce281e` によりシンプルな「メインループ維持」機能のみになりました。`startReceiver()` / `startHandler()` は `start()` 内では呼ばれません。呼び出し側(`__main__` ブロックや外部プロセスマネージャ)で必要なスレッドを起動した後、`start()` を呼び出して以下の挙動を提供します。
```python
def start(self) -> None:
try:
while not self._stop_event.is_set():
time.sleep(1)
except KeyboardInterrupt:
self.stop()
```
ポイント:
- メインスレッドを 1 秒スリープしつつ存続させ、Ctrl+C(KeyboardInterrupt)で安全に停止へ遷移。
- 既存の receiver / handler スレッド二重起動のリスクを除去。
- ライフサイクル明確化: スレッド起動責務を `start()` から分離しテスト・拡張容易性向上。
従来仕様ドキュメントの「`start()` がスレッドを直接起動する」記述は廃止済みであり、最新コードでは不要です。
**stop(wait):**
- `_stop_event.set()` - 全スレッドに停止シグナル送信
- 各スレッドを `join(timeout=remaining)` で待機(最大 `wait` 秒)
### 3. 初期化シーケンス
**`if __name__ == "__main__":` ブロック:**
1. `main_instance` 作成
2. `startReceiver()` - stdin リスニング開始
3. `startHandler()` - リクエスト処理開始
4. **Watchdog 設定:**
- `controller.setWatchdogCallback(main_instance.stop)`
- Watchdog がタイムアウトした場合にプロセス全体を停止
5. **Controller 初期化:**
- `controller.init()`
- Model の遅延初期化、デバイス列挙、ネットワーク接続チェック
- `init_mapping` のすべてのエンドポイントを実行して初期設定をフロントエンドに送信
6. **マッピングのアンロック:**
- すべての `mapping[key]["status"]` を True に設定
- これにより初期化中だった機能が利用可能になる
7. `main_instance.start()` - メインループ維持のみ(receiver / handler は事前に起動済み)
### Watchdog エンドポイント連携
バックエンドはクライアント側から `/run/feed_watchdog` が一定間隔(例: 30 秒)で送信される前提の設計が可能です。テストクライアント(`test_client.py`)は初期化完了後にバックグラウンドスレッドでこのエンドポイントを自動送信し、内部監視(`controller` 側の Watchdog コールバック)タイムアウト防止を行います。
ログ上は通常レスポンス非取得(fire & forget)となるため、負荷低減のためにハートビート頻度調整が可能です。
## 並列処理とスレッドセーフティ
### スレッド構成
| スレッド名 | 役割 | 生存期間 |
|-----------|------|---------|
| `main_receiver` | stdin からの JSON 読み取り | プロセス終了まで |
| `main_handler_0` ~ `main_handler_N` | リクエスト処理ワーカー | プロセス終了まで |
### 同期メカニズム
1. **キュー (`Queue`):**
- スレッドセーフな FIFO キュー
- receiver → handler への通信チャネル
2. **エンドポイント別 Lock (`dict[str, Lock]`):**
- 同一リソースへの競合アクセスを防止
- 正規化キーによる enable/disable ペアの統合
3. **停止イベント (`Event`):**
- グレースフルシャットダウン用のシグナル
### デッドロック回避
- **非ブロッキング Lock 取得:** `lock.acquire(blocking=False)`
- **失敗時の再キュー:** ロック取得失敗時は即座に諦めて再キュー
- **タイムアウト付きキュー取得:** `queue.get(timeout=0.5)` で無限待機を回避
## プロトコル仕様
### リクエストフォーマット (stdin)
```json
{
"endpoint": "/set/data/transparency",
"data": "ODU=" // Base64 encoded: "85"
}
```
**フィールド:**
- `endpoint`: 実行するエンドポイント(必須)
- `data`: パラメータ(オプション、Base64 エンコード)
### レスポンスフォーマット (stdout)
```json
{
"status": 200,
"endpoint": "/set/data/transparency",
"result": 85
}
```
**フィールド:**
- `status`: HTTP ステータスコード相当
- 200: 成功
- 400: バリデーションエラー
- 404: 無効なエンドポイント
- 423: ロック中(リトライされる)
- 500: 内部エラー
- `endpoint`: リクエストされたエンドポイント
- `result`: 処理結果(型はエンドポイントに依存)
### ログフォーマット (stdout)
```json
{
"status": 348, // 専用ステータスコード
"log": "setSelectedTabNo",
"data": "1"
}
```
## エラーハンドリング
### 1. JSON パースエラー
- **発生箇所:** `receiver()` の `json.loads()`
- **処理:** `errorLogging()` でトレースバック記録、リクエストをスキップ
### 2. ハンドラ実行エラー
- **発生箇所:** `_call_handler()` の `handler["variable"](data)`
- **処理:**
- `errorLogging()` でトレースバック記録
- status 500 と "Internal error" を返却
- プロセスは継続
### 3. JSON シリアライズエラー
- **発生箇所:** `printResponse()` の `json.dumps()`
- **処理:**
- エラーログに詳細を記録
- フォールバック JSON を出力(status 500)
- プロセスは継続
### 4. EOF (stdin 終了)
- **発生箇所:** `receiver()` の `readline()`
- **処理:** 0.1秒待機して再試行(フロントエンドの再起動待ち)
## パフォーマンス最適化
### 1. 複数ワーカースレッド
- デフォルト3スレッドで並列処理
- CPU バウンドな処理(翻訳、文字起こし)を効率化
### 2. 非ブロッキングロック
- ロック競合時に即座に再キュー
- スレッドのブロッキング時間を最小化
### 3. 処理安定化待機
- 各ハンドラ実行後に 0.2秒待機
- 連続リクエストによる競合状態を回避
## 制限事項
### 1. 初期化中の制限
- `mapping[key]["status"] = False` の間はリクエストが 423 でリトライされる
- 初期化完了まで最大数秒のレイテンシが発生
### 2. stdin の単方向性
- stdin → キュー → ハンドラの一方向フロー
- 複数のフロントエンドからの同時接続は非対応
### 3. シリアル実行の保証
- 同一エンドポイントのリクエストは排他的に実行されるが、
- 異なるエンドポイントは並列実行される可能性がある
- 依存関係のある操作は呼び出し側で順序制御が必要
## デバッグとトラブルシューティング
### ログファイル
| ファイル名 | 内容 |
|-----------|------|
| `process.log` | 全リクエスト/レスポンスの記録 |
| `error.log` | 例外トレースバック |
### デバッグ手法
1. **リクエストトレース:**
- `process.log` で endpoint と data を確認
- Base64 デコードは `base64.b64decode(data).decode('utf-8')` で手動実行
2. **ロック競合の検出:**
- 同一エンドポイントで status 423 が頻発する場合
- `_canonical_lock_key()` の正規化ロジックを確認
3. **パフォーマンス分析:**
- 各リクエストの処理時間は status 前後のタイムスタンプから算出
- worker_count を増やして並列度を調整
## 今後の拡張性
### 1. 双方向通信
- WebSocket への移行でリアルタイム通知を改善
- stdin/stdout は互換性のため維持
### 2. 動的ワーカー数調整
- キューの深さに応じてスレッド数を自動調整
- CPU 負荷に応じた適応的なスケーリング
### 3. 優先度キュー
- 重要なリクエスト(エラー通知等)を優先処理
- `queue.PriorityQueue` への移行
## 関連ファイル
- `controller.py` - ビジネスロジック実装
- `model.py` - 機能ファサード
- `utils.py` - ログとユーティリティ
- `config.py` - 設定管理
## コーディング規約
本ファイルは以下の規約に従う:
- PEP 8 スタイルガイド
- 型ヒント (`typing` モジュール)
- Docstring は Google スタイル
- エラーハンドリングは防御的に実装
## テストシナリオ
### 1. 基本動作テスト
```python
# stdin に JSON を送信
echo '{"endpoint": "/get/data/version", "data": null}' | python mainloop.py
# 期待される出力: {"status": 200, "endpoint": "/get/data/version", "result": "1.0.0"}
```
### 2. 並列リクエストテスト
- 複数の設定変更リクエストを同時送信
- すべてが正常に処理されることを確認
### 3. ロック競合テスト
- 翻訳の有効化と無効化を連続送信
- 両方が排他的に実行されることを確認
### 4. エラー回復テスト
- 不正なJSON、無効なエンドポイント、不正なデータを送信
- プロセスがクラッシュせずエラーレスポンスを返すことを確認
## まとめ
`mainloop.py` は VRCT の中核となる通信レイヤーであり、stdin/stdout を介したフロントエンドとの JSON ベースプロトコルを実装する。複数のワーカースレッドと細粒度のロックにより、高い並列性と排他制御を両立させている。初期化シーケンスとエラーハンドリングは堅牢に設計されており、プロセスの安定稼働を保証する。
File diff suppressed because it is too large. Load diff
+97
View File
@@ -0,0 +1,97 @@
# 小型ログ ルビ表示機能 (Ruby Overlay for Small Log)
## 概要
小型ログ (Small Log Overlay) に日本語原文が含まれる場合、ローマ字(hepburn) を上段、ひらがな(hira) を下段として原文メッセージの上に 2 段のルビを表示できます。翻訳行には現段階ではルビを付与しません。
## 有効化条件
- 原文 `message` が存在し空文字列でない。
- `model.createOverlayImageSmallLog` 内で自動的に `convertMessageToTransliteration(..., hiragana=True, romaji=True)` を呼び出しトークン生成。
- 生成されたトークンに `hepburn` または `hira` が含まれる。
## 大ログ (Large Log) への拡張
大ログについてもトークン単位のルビ描画をサポートしました。`createOverlayImageLargeLog` / `createTextboxLargeLog` 系の API に以下のような追加引数が入り、同等のルビ出力が可能です。
- transliteration_tokens: Optional[List[dict]] — 原文用トークン(orig/hira/hepburn)
- translation_transliteration_tokens: Optional[List[List[dict]] | List[dict]] — 翻訳ごとのトークン配列、もしくは先頭翻訳用の平坦な List[dict]
- ruby_font_scale: float — ルビのフォント倍率(原文フォントサイズに対するスケール)
- ruby_line_spacing: int — ルビ行間ピクセル
対応挙動:
- 原文のみが存在し、その原文にトークンがあれば原文にトークン単位ルビを振ります。
- 原文と翻訳の両方が存在する場合は、原則として原文のルビを抑止し、翻訳側にルビを振ります(翻訳側にトークンがある場合)。
- `translation_transliteration_tokens` は二通りの入力形式を受け付けます:
- List[List[dict]] — 各翻訳行ごとの tokens 配列(推奨)
- List[dict] — 平坦な tokens 配列(最初の翻訳行に適用されます)
フォールバック:
- トークン単位レイアウトで横幅がはみ出す or 改行がある場合は、既存のブロックルビ(romaji 上 / hira 下 を 1 行ブロックで表示)へ自動フォールバックします。
注意点:
- 既存の表示ロジックの互換性を保つため、引数は省略可能です(None/[])。
- フラットな `translation_transliteration_tokens` を渡す場合は最初の翻訳にのみ適用されます。複数翻訳に個別のルビを渡す場合は List[List[dict]] 形式で与えてください。
## 設定キー (`config.OVERLAY_SMALL_LOG_SETTINGS`)
| キー | 型 | 初期値 | 説明 |
| ---- | --- | ------ | ---- |
| ruby_font_scale | float | 0.5 | ルビ文字サイズ倍率 (原文フォントサイズ * 倍率)。安全範囲 0.05〜3.0 |
| ruby_line_spacing | int | 4 | ローマ字行とひらがな行の垂直スペース (px)。0〜200 |
## レイアウト仕様
1. ルビブロック (romaji 上 / hiragana 下) を中央揃えで描画。
2. その下に従来の本文テキストボックスを縦方向に連結。
3. フォントファミリは本文と同一 (言語に対応する NotoSans 系)。
4. ルビが存在しない場合は従来表示のみ。
## フォールバック
- ルビ生成中に例外が発生した場合はログを記録し、ルビ無しで本文のみ表示。
- トークンが空の場合(両方 False など)は従来表示。
## 例
以下は `createOverlayImageLargeLog` を使って、翻訳側にだけルビを渡す例(平坦な tokens を渡す場合と翻訳ごとの tokens を渡す場合):
```python
# 平坦な tokens を渡して最初の翻訳に適用
overlay.createOverlayImageLargeLog("receive", "こんにちは、世界!", "Japanese", ["Hello, World!"], ["English"], transliteration_tokens=[], translation_transliteration_tokens=[
{"orig": "こんにちは", "hira": "こんにちは", "hepburn": "konnichiha"},
{"orig": "世界", "hira": "せかい", "hepburn": "sekai"},
])
# 翻訳ごとに tokens を与える(推奨)
overlay.createOverlayImageLargeLog("receive", "こんにちは、世界!", "Japanese", ["Hello, World!"], ["English"], transliteration_tokens=[], translation_transliteration_tokens=[
[
{"orig": "Hello", "hira": "", "hepburn": "Hello"},
{"orig": "World", "hira": "", "hepburn": "World"},
]
])
```
## 今後の拡張候補
- 翻訳行へのルビ付与オプション。
- トークン単位での幅センタリングと折り返し。
- 高度な幅計測 (可変幅フォント対応改善)。
## 簡易テスト
`src-python/overlay_ruby_test.py` を実行すると `overlay_small_ruby_test.png` が生成され、縦順と配置を確認できます。
```bash
# PowerShell (仮想環境有効化後)
python src-python/overlay_ruby_test.py
```
## 注意
UI スケーリングは OpenVR 側の表示サイズのみ変更し、画像内部フォントサイズは直接変更しません。ルビの視認性が低い場合は `ruby_font_scale` を調整してください。
File diff suppressed because it is too large. Load diff
+139
View File
@@ -0,0 +1,139 @@
# test_client.py ドキュメント
## 概要
`test_client.py` は stdin/stdout 経由でバックエンド (`mainloop.py`) と通信し、各種 API エンドポイントを自動 / 半自動でテストするためのクライアントユーティリティ。初期化完了待機、ログ (status=348) 展開表示、サイレントモード、結果エクスポート(JSON/CSV)、Watchdog ハートビート送信 (/run/feed_watchdog) などの補助機能を備える。
## 主な責務
- バックエンドプロセス起動と初期化完了待機 (`/run/initialization_complete`)
- エンドポイント単発送信/応答待機 (Base64 エンコード/デコード)
- status=348 ログエントリの全文展開表示
- タイムアウト / 例外発生時の復旧メッセージ出力
- Watchdog ハートビート送信スレッド管理
- 自動テスター (`AutomatedEndpointTester`) による包括的エンドポイント試験
- テスト結果の JSON / CSV エクスポート (インタラクティブ指定)
## クラス構成
### `Color`
ANSIカラー定数を定義し、可読性の高い出力を実現。
### `TestClient`
バックエンドとの 1 プロセス・1 チャンネル通信を管理。
| 属性 | 役割 |
|------|------|
| `process` | 起動した Python バックエンド subprocess |
| `_watchdog_stop_event` | Watchdog スレッド停止制御用 Event |
| `_watchdog_thread` | /run/feed_watchdog 送信スレッド |
#### 初期化フロー
1. `subprocess.Popen([sys.executable, 'mainloop.py'], ...)` でバックエンド起動
2. `_wait_for_initialization()` を呼び出し `/run/initialization_complete` 受信まで待機
- VRCT_INIT_TIMEOUT 環境変数があれば soft timeout として利用 (超過時 WARN のみ)
- 30 秒間隔で進捗ログ (最後に受信した endpoint)
- status=348 レコードは全文 JSON 展開
3. 初期化完了後 `_start_watchdog()` がバックグラウンドで /run/feed_watchdog を 30 秒間隔送信
#### 重要メソッド
- `send_request(endpoint, data=None, timeout=30.0, silent=False)`
- リクエスト JSON を構築し送信
- `data` は JSON シリアライズ → Base64 → `data` フィールド
- 指定 endpoint のレスポンス行まで逐次読み取り (他 endpoint のログ行は通過)
- status=348 の場合ログとして全文表示(silent=False のとき)
- タイムアウト時 504 レスポンスを合成
- `_wait_for_initialization(timeout=None)`
- 無期限または soft timeout 待機
- プロセス死亡検知で RuntimeError
- `_start_watchdog()` / `cleanup()`
- Watchdog スレッド開始と安全停止 (Event セット後 join)
### `AutomatedEndpointTester`
`backend_test.py` のロジック移植版(stdin/stdout プロトコル向け)。
| 属性 | 説明 |
|------|------|
| `silent` | True ならクライアント側詳細出力を抑制 |
| `export_path` | JSON エクスポート先 (None なら未出力) |
| `export_csv` | CSV 追加出力有無 |
| `results` | 収集したテストレコード一覧 |
#### エンドポイント分類 (ハードコード暫定)
- 有効/無効化: `/set/enable/*`, `/set/disable/*`
- 設定更新: `/set/data/*`
- 実行系: `/run/*`
- 削除系: `/delete/data/*`
#### 主メソッド
- `test_validity_single(endpoint)` 有効/無効化系単一試験
- `test_set_data_single(endpoint)` 設定更新系単一試験(事前に動的取得が必要な値は `/get/data/...` を呼び最新値をキャッシュ)
- `test_run_single(endpoint)` 実行系単一試験
- `test_delete_single(endpoint)` 削除系単一試験
- `run_all()` 全カテゴリ順次実行
- `run_random(count=1000)` 全エンドポイントプールからランダム選択
- `run_specific_random(category, count)` 指定カテゴリ内ランダム
- `summary()` 結果集計出力および必要な場合 JSON/CSV エクスポート
#### 結果レコード構造
```json
{
"endpoint": "/set/data/transparency",
"status": 200,
"result": 85,
"expected": "status==200"
}
```
CSV 例:
```
endpoint,status,expected,success
/set/data/transparency,200,status==200,True
```
## status=348 ログ取り扱い
- 初期化待機中: 展開してインデント付き表示
- リクエスト応答処理中: silent=False ならログエントリ全文を優先表示
- 通常 API 応答 (status != 348) との区別を明確化しデバッグ容易化
## Watchdog ハートビート
- 30 秒間隔で `/run/feed_watchdog` を送信 (fire-and-forget)
- 送信失敗時は警告を表示しループ終了
- クライアント終了時に停止イベントをセットしスレッド join でリーク防止
## エクスポート機能
### JSON エクスポート
- `export_path` が指定されていれば `results` を UTF-8 / ensure_ascii=False で整形出力
- フィールド: endpoint, status, result, expected, success
### CSV エクスポート
- JSON パスから拡張子置換(`.csv`)で派生 (内部 `_derive_csv_path` 相当ロジック)
- 成功判定: `status` と `expected` 文字列評価結果に依存 (単純比較)
## 例外 / エラー処理方針
| ケース | 対応 |
|--------|------|
| バックエンド終了検知 | 初期化待機中: RuntimeError を投げる / 通常通信: 500 レスポンス合成 |
| JSONDecodeError | ログ行扱いでスキップ (初期化中は進捗ログとして表示) |
| BrokenPipe / OSError | 通信切断とみなして 500 レスポンス返却 |
| タイムアウト | 504 レスポンス返却 (endpoint 同梱) |
## 制限事項
- エンドポイント一覧は動的取得ではなくハードコード (将来的改善余地)
- レスポンスの並行受信は未対応(1 リクエスト同期待ち)
- status=200 以外の詳細な意味的検証は限定的 (expected = 単純条件)
- Watchdog レスポンスは読み取らないため送信失敗検知は例外経路のみ
## 今後の改善候補
1. CLI 引数サポート (`--mode random --count 500 --silent --export result.json`)
2. 動的エンドポイント列挙 API 追加後の自動反映
3. リトライポリシー (指数バックオフ) 導入
4. 応答時間測定とパフォーマンスレポート出力
5. 並列テスト実行 (複数 subprocess / async IO)
## 参考
- `backend_test.py` : 元ロジック
- `utils.py` : status=348 ログ出力仕様
- `mainloop.md` : 通信プロトコル詳細
## まとめ
`test_client.py` は VRCT バックエンドに対する包括的なテストおよび運用補助を 1 ファイルで実現するツール。初期化待機の堅牢化(無期限 + soft timeout)、Watchdog ハートビート、ログ展開、静音化オプション、結果エクスポートにより長時間動作・回帰試験・CI への組み込みを容易にする基盤を提供する。
+131
View File
@@ -0,0 +1,131 @@
# test_endpoints.py - APIエンドポイントテストモジュール
## 概要
VRCTアプリケーションのAPIエンドポイントを包括的にテストするためのモジュールです。メインループの各種機能をランダムアクセスでテストし、システムの安定性と堅牢性を検証します。
### 2025-10 更新点(commit a54538e 反映)
動的値が必要な `/set/data/*` エンドポイントに対し、事前に対応する `/get/data/...` エンドポイントを呼び出して最新値を取得し、`self.config_dict` にキャッシュしてからランダム選択する方式に変更しました。これにより以下が改善されています:
- 翻訳/転写エンジン選択時の存在しないキー送信防止
- 計算デバイス / 重みタイプ選択の安定化(リスト更新後に選択)
- マイク/スピーカー関連タイムアウト値の正常範囲チェック(取得した最新値を基準にバリデーション)
- Whisper / CTranslate2 重みタイプ辞書のキー集合変化への追従
例: `"/set/data/selected_translation_engines"` 試験前に `"/get/data/selectable_translation_engines"` を呼び、取得したリストから `random.choice()`。従来の初期キャッシュ依存から、実行時取得へ移行。
## 主要機能
### Color クラス
- ANSIエスケープシーケンスを使用したコンソール出力色彩管理
- テスト結果の視覚的表示(成功・失敗・スキップ等)
### TestMainloop クラス
- APIエンドポイントの包括的テスト実行
- ランダムアクセステスト
- テスト結果の記録・分析
- VRCTメインループとの統合テスト
## 主要メソッド
### テスト実行メソッド
- `test_endpoints_on_off_all()`: ON/OFF系エンドポイントの全テスト
- `test_set_data_endpoints_all()`: データ設定系エンドポイントの全テスト
- `test_run_endpoints_all()`: 実行系エンドポイントの全テスト
- `test_endpoints_all_random()`: 全エンドポイントのランダムアクセステスト
### 特定機能テスト
- `test_translate_all_language_pairs()`: 全言語ペアでの翻訳テスト
- `test_endpoints_on_off_continuous()`: ON/OFF連続切り替えテスト
- `test_endpoints_specific_random()`: 特定エンドポイントのランダムテスト
### 結果分析
- `generate_summary()`: テスト結果のサマリー生成
- `record_test_result()`: テスト結果の記録
## 使用方法
### 基本的な使い方
```python
# テストインスタンスを作成
test = TestMainloop()
# 各種テストを実行
test.test_endpoints_on_off_all()
test.test_set_data_endpoints_all()
test.test_run_endpoints_all()
# テスト結果のサマリー表示
test.generate_summary()
```
### ランダムテストの実行
```python
# 全エンドポイントのランダムアクセステスト
test.test_endpoints_all_random()
# 特定エンドポイントのランダムテスト
test.test_endpoints_specific_random()
```
## 依存関係
- `mainloop`: VRCTメインループモジュール
- `random`: ランダムテストデータ生成
- `time`: テスト間隔制御
## テスト対象エンドポイント
### 制御系
- `/set/enable/*`: 機能有効化
- `/set/disable/*`: 機能無効化
### データ設定系
- `/set/data/*`: 各種設定データの更新
動的取得対象(代表例):
- `selected_translation_engines` → `/get/data/selectable_translation_engines`
- `selected_transcription_engine` → `/get/data/selectable_transcription_engines`
- `selected_translation_compute_device` → `/get/data/selectable_translation_compute_device_list`
- `ctranslate2_weight_type` → `/get/data/selectable_ctranslate2_weight_type_dict`
- `whisper_weight_type` → `/get/data/selectable_whisper_weight_type_dict`
- `selected_mic_host` / `selected_mic_device` → `/get/data/selectable_mic_host_list` / `/get/data/selectable_mic_device_list`
- `selected_speaker_device` → `/get/data/selectable_speaker_device_list`
### 実行系
- `/run/*`: 各種機能の実行
### データ削除系
- `/delete/data/*`: データの削除
## 注意事項
- テスト実行前に`config.json`を削除して初期化
- 重いAIモデルを使用するテストは実行時間に注意
- ランダムテストは指定回数(デフォルト1000-10000回)実行される
- テスト終了時は自動的にすべての機能を無効化する
## エラーハンドリング
- 各テストは独立して実行され、一つの失敗が全体に影響しない
- 期待されるステータスコードと実際の結果を比較
- VRAM不足等のリソースエラーも適切にハンドリング
## テスト結果の分類
- **PASS**: 期待されるステータスコードと一致
- **ERROR**: 期待されるステータスコードと不一致
- **SKIP**: テスト実行不可(401ステータス)
- **Invalid**: 無効なエンドポイント(404ステータス)
+940
View File
@@ -0,0 +1,940 @@
# utils.py ドキュメント
## 概要
`utils.py` は VRCT アプリケーション全体で使用される汎用ユーティリティ関数とロギング機能を提供するモジュール。辞書構造の検証、ネットワーク接続確認、計算デバイス管理、Base64エンコーディング、構造化ログ出力など、複数のサブシステムで共有される基盤機能を集約している。
## 主要機能
- 辞書構造の厳密な検証
- ネットワーク接続状態の診断
- WebSocketサーバーのアドレス可用性チェック
- IPアドレスのバリデーション
- CUDA/CPU計算デバイスの検出と最適化
- 構造化ログ出力(process.log, error.log)
- Base64エンコード/デコード
- ログファイルのローテーション管理
## アーキテクチャ上の位置づけ
```
┌─────────────────┐
│ All Modules │ (controller, model, device_manager, etc.)
└────────┬────────┘
│ Import
┌────────▼────────┐
│ utils.py │ ◄── このファイル
└─────────────────┘
│
┌────────▼────────┐
│ External Deps │ (torch, ctranslate2, requests, ipaddress)
└─────────────────┘
```
全てのモジュールから参照される共通基盤として機能し、循環参照を避けるため他の内部モジュールへの依存を持たない。
## 依存関係
### 標準ライブラリ
```python
import base64
import json
import traceback
import logging
from logging.handlers import RotatingFileHandler
from typing import Any, List, Dict, Optional
```
### サードパーティライブラリ(オプション依存)
```python
import torch # GPU検出用(インポート失敗時はNoneにフォールバック)
from ctranslate2 import get_supported_compute_types # 計算タイプ取得用
import requests # ネットワーク接続確認用
import ipaddress # IPアドレス検証用
import socket # WebSocketサーバー可用性チェック用
```
**セーフガードインポート:**
```python
try:
import torch
except Exception:
torch = None # type: ignore
try:
from ctranslate2 import get_supported_compute_types
except Exception:
def get_supported_compute_types(device: str, device_index: int) -> List[str]:
return []
```
オプション依存が満たされない環境でもモジュールは正常にロード可能。
## 関数リファレンス
### 1. 辞書構造検証
#### `validateDictStructure(data: dict, structure: dict) -> bool`
**責務:** 辞書の構造と型が期待される仕様と完全に一致するかを検証
**アルゴリズム:**
1. 両方が辞書型であることを確認
2. キーの数と名前が完全一致するかチェック
3. 各キーの値について:
- 期待値が辞書の場合: 再帰的に検証(多重入れ子対応)
- 期待値が型オブジェクトの場合: `isinstance()` で型チェック
**引数:**
- `data` (dict): 検証対象の辞書
- `structure` (dict): 期待される構造定義
- 値には型(str, int, bool等)または入れ子の辞書を指定
**返り値:**
- `True`: 構造が完全に一致
- `False`: 不一致(キー不足、余分なキー、型不一致等)
**使用例:**
```python
# 単純な構造検証
data = {"name": "Alice", "age": 30}
structure = {"name": str, "age": int}
assert validateDictStructure(data, structure) is True
# 入れ子構造の検証
data = {
"user": {
"id": 123,
"profile": {"name": "Bob", "active": True}
}
}
structure = {
"user": {
"id": int,
"profile": {"name": str, "active": bool}
}
}
assert validateDictStructure(data, structure) is True
# 不一致の検出
data = {"name": "Alice", "extra_key": "value"}
structure = {"name": str, "age": int}
assert validateDictStructure(data, structure) is False # キーが不一致
```
**使用場面:**
- フロントエンドからのリクエストペイロード検証
- 設定ファイルのスキーマ検証
- API レスポンスの構造確認
---
### 2. ネットワーク診断
#### `isConnectedNetwork(url: str = "http://www.google.com", timeout: int = 3) -> bool`
**責務:** インターネット接続の可用性を高速チェック
**処理:**
1. 指定URLに HTTP GET リクエストを送信
2. `timeout` 秒以内に 200 OK レスポンスを受信したら接続あり
3. タイムアウトまたは例外発生時は接続なし
**引数:**
- `url` (str): 接続確認先URL(デフォルト: Google)
- `timeout` (int): タイムアウト時間(秒)
**返り値:**
- `True`: ネットワーク接続あり
- `False`: ネットワーク接続なし
**使用例:**
```python
if isConnectedNetwork():
# モデルウェイトをダウンロード
downloadModelWeights()
else:
# オフラインモードで動作
useLocalModels()
```
**注意事項:**
- ファイアウォールやプロキシ環境では正しく動作しない場合がある
- 初期化時の1回のみチェックを推奨(頻繁な呼び出しは避ける)
---
#### `isAvailableWebSocketServer(host: str, port: int) -> bool`
**責務:** 指定したホスト/ポートでWebSocketサーバーが起動可能かを確認
**処理:**
1. TCP ソケットを作成
2. `SO_REUSEADDR` オプションを設定
3. `bind()` を試行
4. 成功 → アドレス利用可能、失敗 → アドレス使用中
**引数:**
- `host` (str): バインドするIPアドレス
- `port` (int): バインドするポート番号
**返り値:**
- `True`: アドレスが利用可能
- `False`: アドレスが使用中
**使用例:**
```python
if isAvailableWebSocketServer("127.0.0.1", 8080):
startWebSocketServer("127.0.0.1", 8080)
else:
print("Port 8080 is already in use")
```
**注意事項:**
- `SO_REUSEADDR` により、TIME_WAIT 状態のアドレスも利用可能と判定される
- 管理者権限が必要なポート(1024未満)では失敗する場合がある
---
#### `isValidIpAddress(ip_address: str) -> bool`
**責務:** IPv4/IPv6アドレスの妥当性を検証
**処理:**
- `ipaddress.ip_address()` でパース
- 成功 → 有効なIPアドレス、失敗 → 無効
**引数:**
- `ip_address` (str): 検証対象のIPアドレス文字列
**返り値:**
- `True`: 有効なIPアドレス
- `False`: 無効なIPアドレス
**使用例:**
```python
assert isValidIpAddress("127.0.0.1") is True
assert isValidIpAddress("2001:db8::1") is True
assert isValidIpAddress("invalid") is False
```
**サポート形式:**
- IPv4: "192.168.1.1", "127.0.0.1"
- IPv6: "2001:db8::1", "fe80::1"
---
### 3. 計算デバイス管理
#### `getComputeDeviceList() -> List[Dict[str, Any]]`
**責務:** 利用可能な計算デバイス(CPU/GPU)とサポートされる計算タイプを列挙
**返り値構造:**
```python
[
{
"device": "cpu",
"device_index": 0,
"device_name": "cpu",
"compute_types": ["auto", "float32", "int8", ...]
},
{
"device": "cuda",
"device_index": 0,
"device_name": "NVIDIA GeForce RTX 3090",
"compute_types": ["auto", "int8_bfloat16", "int8_float16", ...]
},
...
]
```
**処理フロー:**
1. CPU デバイスを常に追加(最低限の計算環境を保証)
2. PyTorch と CUDA が利用可能な場合:
- 全GPUデバイスを列挙
- 各GPUの計算タイプを `get_supported_compute_types()` で取得
- GPU アーキテクチャに応じて計算タイプを制限:
- **GTX シリーズ**: `int8_bfloat16`, `bfloat16`, `float16`, `int8` を除外
- **RTX, Tesla, A100, Quadro**: 全計算タイプをサポート
- **その他**: `float32` のみ
**GPU別の計算タイプ制限:**
```python
if "GTX" in gpu_device_name:
unsupported_types = {"int8_bfloat16", "bfloat16", "float16", "int8"}
gpu_compute_types = [t for t in gpu_compute_types if t not in unsupported_types]
elif not any(keyword in gpu_device_name for keyword in ["RTX", "Tesla", "A100", "Quadro"]):
gpu_compute_types = ["float32"]
```
**使用例:**
```python
devices = getComputeDeviceList()
for device in devices:
print(f"{device['device_name']}: {', '.join(device['compute_types'])}")
# 出力例:
# cpu: auto, float32, int8
# NVIDIA GeForce RTX 3090: auto, int8_bfloat16, int8_float16, int8, bfloat16, float16, int8_float32, float32
```
**エラーハンドリング:**
- GPU検出中の例外は `errorLogging()` でログ記録し、CPU デバイスのみ返却
---
#### `getBestComputeType(device: str, device_index: int) -> str`
**責務:** デバイスアーキテクチャに最適な計算タイプを自動選択
**優先順位:**
```python
preferred_types = {
"default": [
"int8_bfloat16", # 最も効率的(対応GPUのみ)
"int8_float16", # 2番目に効率的
"int8", # 整数演算高速化
"bfloat16", # 混合精度
"float16", # 半精度浮動小数点
"int8_float32", # 互換性重視
"float32" # フォールバック
],
"GTX": ["float32"], # GTXシリーズは制限あり
"RTX": ["int8_bfloat16", "int8_float16", ...],
"Tesla": [...],
"A100": [...],
"Quadro": [...]
}
```
**処理フロー:**
1. `get_supported_compute_types()` で利用可能な計算タイプを取得
2. デバイス名に基づいて優先リストを選択
3. 優先順に計算タイプをチェックし、最初に利用可能なものを返却
4. 全て利用不可の場合は `"float32"` を返却(安全なフォールバック)
**引数:**
- `device` (str): "cpu" または "cuda"
- `device_index` (int): GPUデバイスのインデックス(CPUの場合は0)
**返り値:**
- 最適な計算タイプ文字列(例: "int8_bfloat16", "float32")
**使用例:**
```python
best_type = getBestComputeType("cuda", 0)
model.load_model(compute_type=best_type)
```
**計算タイプの特性:**
| 計算タイプ | メモリ使用量 | 速度 | 精度 | 対応GPU |
|----------|------------|------|------|--------|
| int8_bfloat16 | 最小 | 最速 | 高 | RTX 30xx以降 |
| int8_float16 | 最小 | 最速 | 高 | RTX 20xx以降 |
| int8 | 小 | 高速 | 中 | 多くのGPU |
| bfloat16 | 中 | 高速 | 高 | RTX 30xx以降 |
| float16 | 中 | 高速 | 高 | RTX 20xx以降 |
| float32 | 大 | 標準 | 最高 | 全GPU/CPU |
---
### 4. エンコーディング
#### `encodeBase64(data: str) -> Dict[str, Any]`
**責務:** Base64エンコードされたJSON文字列をデコードしてパース
**処理:**
1. Base64デコード
2. UTF-8文字列に変換
3. JSON パース
4. 失敗時は空の辞書を返却
**引数:**
- `data` (str): Base64エンコードされたJSON文字列
**返り値:**
- パース成功: JSON オブジェクト
- パース失敗: `{}`(空の辞書)
**使用例:**
```python
# エンコード例(参考)
import base64
import json
payload = {"message": "Hello", "id": 123}
encoded = base64.b64encode(json.dumps(payload).encode('utf-8')).decode('utf-8')
# デコード
decoded = encodeBase64(encoded)
assert decoded == {"message": "Hello", "id": 123}
```
**エラーハンドリング:**
- 不正なBase64文字列
- 不正なJSON形式
- 文字エンコーディングエラー
全て `errorLogging()` でログ記録し、空の辞書を返却。
**注意事項:**
- 関数名が `encodeBase64` だが、実際には**デコード**を行う(命名の歴史的経緯)
- セキュリティ: Base64は暗号化ではないため、機密情報の保護には使用しない
---
### 5. ロギング
#### `removeLog() -> None`
**責務:** プロセスログファイル(process.log)を初期化
**処理:**
- `process.log` を空の内容で上書き
- ファイルが存在しない場合は新規作成
**使用例:**
```python
# アプリケーション起動時にログをクリア
removeLog()
printLog("Application started")
```
**エラーハンドリング:**
- ファイル書き込み失敗時は `errorLogging()` でエラーログに記録
---
#### `setupLogger(name: str, log_file: str, level: int = logging.INFO) -> logging.Logger`
**責務:** ローテーション機能付きロガーインスタンスを生成
**設定:**
- **最大ログサイズ**: 10MB
- **バックアップ数**: 1(最大2ファイル)
- **ローテーション動作**: 10MB到達時に `.1` バックアップを作成し、新規ログを開始
- **エンコーディング**: UTF-8
- **遅延書き込み**: `delay=True`(最初の書き込み時にファイルを開く)
**引数:**
- `name` (str): ロガー名(例: "process", "error")
- `log_file` (str): ログファイルパス
- `level` (int): ログレベル(デフォルト: `logging.INFO`)
**返り値:**
- 設定済み `logging.Logger` インスタンス
**ログフォーマット:**
```
%(asctime)s - %(name)s - %(levelname)s - %(message)s
```
**出力例:**
```
2025-10-13 14:30:45,123 - process - INFO - Application started
2025-10-13 14:30:46,456 - error - ERROR - Connection failed
```
**重複ハンドラー防止:**
```python
if not any(isinstance(h, RotatingFileHandler) and getattr(h, 'baseFilename', None) == getattr(file_handler, 'baseFilename', None) for h in logger.handlers):
logger.addHandler(file_handler)
```
同じファイルへの重複ハンドラー追加を防止し、複数回呼び出されても安全。
---
#### `printLog(log: str, data: Any = None) -> None`
**責務:** 構造化プロセスログの出力
**出力先:**
1. `process.log` ファイル
2. 標準出力(JSON形式)
**出力形式:**
```python
{
"status": 348, # プロセスログ専用ステータス
"log": "User action performed",
"data": "additional context"
}
```
**引数:**
- `log` (str): ログメッセージ
- `data` (Any): 追加のコンテキスト情報(オプション)
**使用例:**
```python
printLog("Model loading started", {"model_type": "whisper", "weight": "medium"})
# 出力(stdout):
# {"status": 348, "log": "Model loading started", "data": "{'model_type': 'whisper', 'weight': 'medium'}"}
```
**実装の詳細:**
```python
global process_logger
if process_logger is None:
process_logger = setupLogger("process", "process.log", logging.INFO)
response = {
"status": 348,
"log": log,
"data": str(data),
}
process_logger.info(response)
serialized = json.dumps(response)
print(serialized, flush=True)
```
**注意事項:**
- `data` は `str()` で文字列化されるため、複雑なオブジェクトは読みにくくなる可能性がある
- `flush=True` により即座に出力(バッファリングを無効化)
---
#### `printResponse(status: int, endpoint: str, result: Any = None) -> None`
**責務:** 構造化APIレスポンスの出力
**出力先:**
1. `process.log` ファイル
2. 標準出力(JSON形式)
**出力形式:**
```python
{
"status": 200,
"endpoint": "/get/config/version",
"result": {"version": "3.3.0"}
}
```
**引数:**
- `status` (int): HTTPステータスコード風のステータス番号
- `endpoint` (str): エンドポイント識別子
- `result` (Any): レスポンスペイロード(オプション)
**使用例:**
```python
printResponse(200, "/set/config/language", {"language": "ja"})
printResponse(400, "/set/config/threshold", {"error": "Value out of range"})
```
**JSONシリアライズエラーハンドリング:**
```python
try:
serialized_response = json.dumps(response)
except Exception as e:
errorLogging() # 完全なトレースバックをログ
process_logger.error(f"Problematic response object: {response}")
process_logger.error(f"Exception during json.dumps: {e}")
# フォールバックエラーペイロード
error_json = json.dumps({
"status": 500,
"endpoint": endpoint,
"result": {"error": "Failed to serialize response", "details": str(e)},
})
print(error_json, flush=True)
else:
print(serialized_response, flush=True)
```
**シリアライズ不可能なオブジェクトの例:**
- `datetime` オブジェクト
- カスタムクラスインスタンス
- 循環参照を持つ辞書
**対策:**
- `result` を構築する際に JSON シリアライズ可能な型のみ使用
- 必要に応じて `str()` や専用のシリアライザーで変換
---
#### `errorLogging() -> None`
**責務:** 現在の例外トレースバックをエラーログに記録
**処理:**
1. `error.log` ファイルにトレースバックを出力
2. ロガー初期化失敗時は標準出力にフォールバック
**使用例:**
```python
try:
risky_operation()
except Exception:
errorLogging() # トレースバックをerror.logに記録
# 必要に応じて追加処理
```
**出力例(error.log):**
```
2025-10-13 14:35:12,789 - error - ERROR - Traceback (most recent call last):
File "model.py", line 123, in loadModel
model.load()
File "ctranslate2/model.py", line 456, in load
raise RuntimeError("CUDA out of memory")
RuntimeError: CUDA out of memory
```
**注意事項:**
- **例外コンテキスト内でのみ呼び出し可能**(`traceback.format_exc()` を使用)
- 例外をキャッチせずに呼び出すと空のトレースバックが記録される
**ベストプラクティス:**
```python
try:
dangerous_function()
except SpecificException as e:
errorLogging() # 詳細をログ
# ユーザーフレンドリーなエラー処理
printResponse(400, endpoint, {"error": "Operation failed"})
except Exception:
errorLogging() # 予期しないエラーもログ
raise # 上位へ伝播
```
---
## グローバル変数
### `process_logger: Optional[logging.Logger] = None`
プロセスログ用のグローバルロガーインスタンス。初回 `printLog()` または `printResponse()` 呼び出し時に初期化される。
### `error_logger: Optional[logging.Logger] = None`
エラーログ用のグローバルロガーインスタンス。初回 `errorLogging()` 呼び出し時に初期化される。
**遅延初期化の理由:**
- モジュールインポート時のオーバーヘッド削減
- ファイルシステムへの不要なアクセスを回避
---
## エラーハンドリング戦略
### 1. 防御的プログラミング
全てのユーティリティ関数は例外を内部で処理し、呼び出し元に例外を伝播しない:
```python
def isConnectedNetwork(url="http://www.google.com", timeout=3) -> bool:
try:
response = requests.get(url, timeout=timeout)
return response.status_code == 200
except requests.RequestException:
return False # 例外をキャッチして安全な値を返却
```
### 2. フォールバック値
- `encodeBase64()`: パース失敗時は `{}`
- `getComputeDeviceList()`: GPU検出失敗時はCPUのみ
- `getBestComputeType()`: 全て失敗時は `"float32"`
### 3. ログ記録
全てのエラーは `errorLogging()` でトレースバックを記録し、デバッグを容易にする。
---
## パフォーマンス考慮事項
### 1. ネットワーク接続チェック
`isConnectedNetwork()` はブロッキング操作(最大3秒)のため、起動時の1回のみ実行を推奨:
```python
# 良い例
if isConnectedNetwork():
downloadModels()
# 悪い例(UI フリーズの原因)
while True:
if isConnectedNetwork(): # 毎回3秒待機
processData()
```
### 2. ログローテーション
10MB のログファイルローテーションにより、ディスク容量を制御(最大20MB)。
### 3. グローバルロガーの遅延初期化
ロガーは初回使用時に初期化されるため、インポート時のオーバーヘッドを最小化。
---
## 使用パターン
### パターン1: ネットワーク依存機能の初期化
```python
def initialize_online_features():
if not isConnectedNetwork():
printLog("Offline mode: skipping model download")
return
printLog("Online mode: downloading models")
downloadModels()
```
### パターン2: デバイス自動選択
```python
devices = getComputeDeviceList()
if len(devices) > 1:
# GPU利用可能
best_device = devices[1] # 最初のGPU
best_type = getBestComputeType(best_device["device"], best_device["device_index"])
printLog(f"Using GPU: {best_device['device_name']}", {"compute_type": best_type})
else:
# CPUのみ
printLog("No GPU detected, using CPU")
best_type = "float32"
```
### パターン3: 構造化リクエスト検証
```python
def handle_request(payload):
expected_structure = {
"action": str,
"data": {
"id": int,
"value": str
}
}
if not validateDictStructure(payload, expected_structure):
printResponse(400, "/handle_request", {"error": "Invalid request structure"})
return
# 処理続行
printLog("Valid request received", payload)
```
### パターン4: WebSocketサーバー起動
```python
def start_websocket(host, port):
if not isValidIpAddress(host):
printResponse(400, "/websocket/start", {"error": "Invalid IP address"})
return
if not isAvailableWebSocketServer(host, port):
printResponse(400, "/websocket/start", {"error": f"Port {port} is in use"})
return
# サーバー起動
printLog(f"Starting WebSocket server", {"host": host, "port": port})
startServer(host, port)
```
---
## テスト推奨事項
### 単体テスト例
**辞書構造検証:**
```python
def test_validate_dict_structure_simple():
data = {"name": "Alice", "age": 30}
structure = {"name": str, "age": int}
assert validateDictStructure(data, structure) is True
def test_validate_dict_structure_nested():
data = {"user": {"id": 1, "active": True}}
structure = {"user": {"id": int, "active": bool}}
assert validateDictStructure(data, structure) is True
def test_validate_dict_structure_invalid():
data = {"name": "Alice"}
structure = {"name": str, "age": int} # 'age'キーが不足
assert validateDictStructure(data, structure) is False
```
**ネットワーク診断:**
```python
def test_network_connection():
# 実際のネットワーク接続をテスト
result = isConnectedNetwork()
assert isinstance(result, bool)
def test_network_timeout():
# タイムアウト動作を確認
result = isConnectedNetwork(url="http://192.0.2.1", timeout=1)
assert result is False
```
**計算デバイス:**
```python
def test_get_compute_device_list():
devices = getComputeDeviceList()
assert len(devices) >= 1 # 最低限CPUが含まれる
assert devices[0]["device"] == "cpu"
def test_get_best_compute_type():
compute_type = getBestComputeType("cpu", 0)
assert compute_type in ["float32", "int8"]
```
**ロギング:**
```python
def test_print_log(capsys):
printLog("Test message", {"key": "value"})
captured = capsys.readouterr()
output = json.loads(captured.out)
assert output["status"] == 348
assert output["log"] == "Test message"
def test_print_response(capsys):
printResponse(200, "/test", {"result": "success"})
captured = capsys.readouterr()
output = json.loads(captured.out)
assert output["status"] == 200
assert output["endpoint"] == "/test"
```
---
## セキュリティ考慮事項
### 1. IPアドレス検証
`isValidIpAddress()` はフォーマット検証のみで、プライベートアドレス範囲のチェックは行わない:
```python
# セキュリティを強化する場合
import ipaddress
def is_public_ip(ip_str):
if not isValidIpAddress(ip_str):
return False
ip = ipaddress.ip_address(ip_str)
return not (ip.is_private or ip.is_loopback or ip.is_reserved)
```
### 2. Base64デコード
`encodeBase64()` は入力検証を行わないため、信頼できないソースからのデータには注意:
```python
# 安全な使用例
if source_is_trusted:
data = encodeBase64(base64_string)
else:
# 追加の検証を実施
pass
```
### 3. ログファイルへの機密情報記録
ログに機密情報(API キー、パスワード等)が含まれないよう注意:
```python
# 悪い例
printLog("API key loaded", api_key)
# 良い例
printLog("API key loaded", "***REDACTED***")
```
---
## 制限事項
1. **プラットフォーム依存性:**
- GPU検出は CUDA 環境でのみ動作(ROCm/Metal非対応)
2. **ネットワークチェックの制限:**
- ファイアウォール、プロキシ環境で誤判定の可能性
- IPv6専用環境での動作は未検証
3. **ログファイルのスレッドセーフティ:**
- `RotatingFileHandler` は基本的にスレッドセーフだが、高負荷時のローテーション中にログ損失の可能性
4. **計算タイプの最適化:**
- `getBestComputeType()` の優先順位は一般的な推奨値であり、特定のモデルやタスクでは最適でない場合がある
---
## 依存モジュールとの関係
### controller.py
- デバイス管理の設定変更時にデバイスリスト取得
- エラー時のログ記録
- ネットワーク接続確認
### model.py
- 計算デバイスとタイプの決定
- エラー時のトレースバック記録
### config.py
- 起動時のネットワーク接続確認
- 計算デバイスリストの提供
### mainloop.py
- リクエスト/レスポンスの構造化ログ出力
- エラー時のトレースバック記録
---
## 今後の拡張性
### 1. 非同期ネットワークチェック
```python
import asyncio
import aiohttp
async def isConnectedNetworkAsync(url="http://www.google.com", timeout=3) -> bool:
try:
async with aiohttp.ClientSession() as session:
async with session.get(url, timeout=aiohttp.ClientTimeout(total=timeout)) as response:
return response.status == 200
except Exception:
return False
```
### 2. 構造化ログの拡張
```python
def printStructuredLog(level: str, message: str, context: dict = None):
"""
より詳細な構造化ログ出力
- timestamp
- level
- message
- context (key-value pairs)
- stack trace (error時)
"""
pass
```
### 3. メトリクス収集
```python
def recordMetric(metric_name: str, value: float, tags: dict = None):
"""
パフォーマンスメトリクスの記録
- function execution time
- memory usage
- GPU utilization
"""
pass
```
---
## 関連ドキュメント
- `controller.md`: Controller での utils 関数使用例
- `config.md`: Config での計算デバイス管理
- `model.md`: Model でのエラーハンドリング
- `コーディングルール.md`: ロギングとエラーハンドリングの規約
---
## ライセンス
プロジェクトのルートディレクトリの `LICENSE` ファイルを参照
---
## まとめ
`utils.py` は VRCT プロジェクトの基盤インフラストラクチャとして、以下の重要な責務を担う:
1. **安全性**: 全ての関数が例外を内部処理し、安全なフォールバック値を提供
2. **可観測性**: 構造化ログとローテーション機能により、問題の診断を容易化
3. **互換性**: オプション依存のセーフガードにより、様々な環境で動作
4. **最適化**: GPU アーキテクチャに応じた計算タイプの自動選択
5. **検証**: 辞書構造、IPアドレス、ネットワーク接続の厳密なバリデーション
全てのサブシステムから依存される中核モジュールとして、高い信頼性と保守性を維持している。
@@ -0,0 +1,169 @@
# VRCT backend — コーディングルール
目的:
- 可読性と保守性を保ちながら既存スタイルを尊重する。
- 漸進的に型注釈を導入し、mypy と ruff のチェックに合わせる。
- 自動化(CI / pre-commit)へ導出しやすくする。
注意: 既存の命名・構造(関数名・クラス名・変数名・run mapping のキー等)はコード上の互換性のためそのまま維持します。以下は新規実装やリファクタ時に従うべきルールです。
## 目次
- 命名規則
- モジュール・パッケージ構成
- インポート
- 型注釈と mypy 方針
- ドキュメンテーション / docstrings
- エラーハンドリングとロギング
- 非同期 / スレッド / キューの扱い
- テストと CI
- リファクタ・互換性の観点
---
## 命名規則
- モジュール名: 小文字、アンダースコアで区切る(例: `overlay_utils.py`)。既存ファイルに従う。
- パッケージ名: 小文字(`models`, `websocket` など)。
- クラス名: CapWords (PascalCase)。既存クラス(`Controller`, `Model`, `Overlay`)に従う。
- 関数・メソッド名: snake_case。
- 変数名: snake_case。短い一時変数は `i`, `j`, `buf` 等の伝統的な省略形を可とするが、意味ある名前を優先する。
- 定数: UPPER_SNAKE_CASE(`config.py` の定数に合わせる)。
- run_mapping のキー: 現在は短い key(例: `transcription_mic`)を内部で使い `run_mapping` に `/run/...` を置いている。この慣習は維持する。Controller 内で `self.run_mapping[...]` を直接参照する実装は許容される。
## モジュール・パッケージ構成
- 各サブ領域(ocr, overlay, transcription, translation, websocket 等)は `models/` 下に整理済みのため、同様の粒度で新機能は追加する。
- パッケージは必ず `__init__.py` を置く(static analysis / mypy のため)。空の `__init__.py` でも可。これにより相対インポートが安定する。
## インポート
- 標準ライブラリ、サードパーティ、ローカルの順でインポートをまとめる。
- ローカルモジュールを参照する場合は相対 import を使ってもよいが、プロジェクト全体を PYTHONPATH に入れてテスト/静的解析できるようにすること。
- 例:
```
import os
import json
import numpy as np
from . import overlay_utils
```
## 型注釈と mypy 方針
- 戦略: Relax + incremental annotations(漸進的型付け)。以下を守る。
- 新規コードは可能な限り型注釈を追加する(関数シグネチャ・返り値)。
- 既存の大きな関数は段階的に注釈する。まずモジュール境界(public API)のシグネチャに注釈を入れる。内部の細かい変数は後回し。
- CI では初期段階で mypy を `--ignore-missing-imports --allow-untyped-defs --allow-redefinition` のように緩めて実行する。段階的に `--check-untyped-defs` を有効化していく。
- 型の `Any` を多用しない。どうしても必要な場合は `# type: ignore[assignment]` を付けて理由をコメントに残す。
## docstrings / コメント
- 重要な public 関数・メソッドとクラスに短い docstring を追加する(目的・引数・返り値の要約)。Google/Numpy スタイルのどちらかに統一する必要はないが、プロジェクト内で混乱しないよう短く統一すること。
- 実装トリッキーな箇所には `# NOTE:` や `# FIXME:` コメントを残し、必要なら issue を紐付ける(例: `# NOTE: keep in sync with mainloop.run_mapping`)。
## エラーハンドリングとロギング
- 例外をキャッチするときは有用なコンテキストをログに残す(`errorLogging()` のようなユーティリティを使う)。
- broad except: を使う場合は最低限 `errorLogging()` を呼び、必要なら `raise` して上位へ伝播する。
## 非同期 / スレッド / キューの扱い
- スレッドは `threading.Thread` を使っている箇所があるため、スレッド間通信は `queue.Queue` ベースで実装すること。
- スレッドを生成する関数は `start_` プレフィックス(例: `start_transcription_thread`)のように命名すると分かりやすい。
## テスト・CI
- まずは軽量な CI ワークフローを入れる:
- ruff check
- mypy (relaxed)
- 自動テスト(将来的に pytest を追加)
- pre-commit フックの導入を推奨: ruff auto-fix と isort (import 整理) を採用できる。
## リファクタ・互換性
- 既存 public API(stdin/stdout の endpoint 仕様や `run_mapping` のキー、Controller のメソッド名)は後方互換を優先する。変更が必要な場合は CHANGELOG に明示する。
## 小さなコーディング規約チェックリスト(PR テンプレ)
- 新しい public メソッドには docstring を付けたか
- 既存命名規則に従っているか(snake_case / PascalCase / UPPER_SNAKE_CASE)
- 型アノテーションをシグネチャに追加したか(可能な限り)
- 直接 stdout に JSON を print する箇所は `printResponse` 等ユーティリティ経由か確認する
---
このドキュメントは現状のスタイルを尊重して最小限の規則を与えることを目的としています。次のステップを希望する場合:
- CI に ruff/mypy を組み込む PR を作成
- pre-commit 用の設定ファイル(`.pre-commit-config.yaml`)を追加して自動整形を導入
- 型注釈・テストのためのタスク分割(優先順位をつけた TODO)
要望があれば、これをベースに `.pre-commit-config.yaml`、`pyproject.toml` の ruff 設定、あるいは CI ワークフローの雛形(GitHub Actions)を作成します。
## Copilot と共同作業するための具体例とテンプレート
以下は Copilot に推奨プロンプトを投げやすく、また PR 作成時に便利なテンプレート類です。コピー&ペーストして使用してください。
### 関数テンプレート(型注釈 + docstring)
```python
from typing import Any, Dict, Optional
def example_handler(endpoint: str, data: Any) -> Dict[str, Any]:
"""Handle an example endpoint.
Args:
endpoint: incoming endpoint string (e.g. '/get/data/version')
data: request payload (None for many GETs)
Returns:
A dict suitable for printResponse(status, endpoint, result)
"""
# implementation...
result = {"status": 200, "endpoint": endpoint, "result": data}
return result
```
### Controller の run 発行パターン(推奨)
Controller 内で run を呼ぶときは `self.run(self.run_mapping["key"], payload)` の形を維持してください。Copilot に尋ねるときは「この run key に対応する payload の形は?」と聞くとペイロード例を生成しやすいです。
### Docstring 例(Google スタイル)
```python
def set_selected_tab_no(tab_no: int) -> Dict[str, Any]:
"""Set the current tab.
Args:
tab_no: index of tab to select
Returns:
A response dict with status and new tab number
"""
...
```
### PR チェックリスト(拡張版)
- コーディング規則に従っているか
- 新しい public API の docstring があるか
- 型注釈を最小限追加しているか(特に関数シグネチャ)
- ruff check が通るか
- mypy(relaxed)で重大な型エラーが出ていないか
- docs (必要箇所) を更新したか(API 変更があれば)
### 推奨 `.pre-commit-config.yaml`(例)
```yaml
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
args: ["--ignore-missing-imports", "--allow-untyped-defs", "--allow-redefinition"]
```
### 推奨 ruff 設定(pyproject.toml への最小設定例)
```toml
[tool.ruff]
line-length = 88
extend-ignore = ["E203"]
select = ["E", "F", "W", "C90"]
```
---
更新が必要なら私が `.pre-commit-config.yaml`、`pyproject.toml`、および CI ワークフロー (GitHub Actions) の雛形を作成してコミットまでできます。どれを優先しますか?
+132
View File
@@ -0,0 +1,132 @@
# 仕様書
概要
- プロジェクト名: VRCT (VR Chat Translator)
- 目的: マイク入力とスピーカー出力をリアルタイムに文字起こし・翻訳し、VR オーバーレイや OSC/WebSocket 経由で外部に送出するバックエンドロジック。
- 言語: Python
対象ユーザー
- VR 環境でリアルタイム翻訳・文字起こしを利用したいエンドユーザー
- フロントエンド(GUI)や VR クライアント(OSC)と連携するアプリケーション開発者
主要機能(機能要件)
1. 音声の取り込み・文字起こし
- マイク(送信)およびスピーカー(受信)から音声を取得し、ローカル Whisper(faster-whisper)または外部サービスによりテキスト化する。
- 音声エネルギー(音量)監視を行い、閾値ベースで検出する。
2. 翻訳
- DeepL / DeepL API / 各クラウド翻訳 / ローカル CTranslate2 モデルの複数バックエンドをサポート。
- 複数出力言語への一括翻訳、翻訳エンジンのフォールバック(CTranslate2 など)。
- 翻訳モデルのダウンロードと管理機能。
3. 表示・通知
- OpenVR オーバーレイ(small/large)用の画像生成と更新。
- OSC による VR へのメッセージ送信(typing/通知等)。
- WebSocket サーバーを介した外部クライアントへの JSON ブロードキャスト。
4. 入出力インターフェース
- stdin ラインベースの JSON コマンド受信(mainloop が実装)。
- stdout に対して構造化された JSON レスポンスを出力(printResponse/printLog)。
5. 設定・永続化
- JSON ベースの設定ファイルを使用(`config.py` による読み書きとデバウンス保存)。
6. ロギングと監視
- プロセスログ(process.log)とエラーログ(error.log)をローテーションで管理。
- ウォッチドッグ機構で定期的に死活チェック・コールバック。
非機能要件
- プラットフォーム: 主に Windows(Audio 周りは WASAPI を利用)を想定。クロスプラットフォームでの import 安全性を考慮。
- 可用性: 外部依存(PyAudio, CUDA, ctranslate2 等)が無い環境でも安全にインポートでき、機能劣化しつつ動作する。
- パフォーマンス: ローカルモデル利用時は GPU を利用して計算性能を確保。compute type 選択ロジックを実装。
- セキュリティ: 外部への API キー(DeepL など)は設定で扱い、コード上では平文保持を避ける(設定ファイルに保存)。
運用フロー
- 起動: stdin でコマンドを受け付ける mainloop を実行。必要な初期化は遅延実行(lazy init)を採用。
- モデル重ダウンロード: CTranslate2/Whisper 重みは `weights/` 配下にダウンロードし、チェックサム等で整合性確認。
- 障害時: 例外は utils.errorLogging() でトレースを error.log に出力。重要機能はフォールバック実装。
インターフェース(抜粋)
- stdin(JSON): {"endpoint": "/set/..." | "/get/..." | "/run/...", "data": <base64(JSON)|any>}
- stdout(JSON): 標準化されたレスポンスを printResponse/printLog が出力(status, endpoint, result など)。
依存関係(オプション含む)
- 必須(実装時想定): requests, packaging, flashtext, pillow, pyaudiowpatch, speech_recognition
- ローカル推奨: faster-whisper, ctranslate2, torch(GPU 利用時)
- Windows 固有(音声ループバック): pycaw, comtypes
参考: 実装上の安全設計として optional な import は try/except でガードしており、存在しない依存があっても import 時にクラッシュしない。
## 最近の更新 (2025-10-20 translate_api ブランチ)
本章は既存仕様への差分のみを記載します。コードベースの事実に基づく更新点です。
### 翻訳エンジン / モデル管理の拡張
- OpenAI / Plamo / Gemini の選択モデルプロパティを `PLAMO_MODEL` / `GEMINI_MODEL` / `OPENAI_MODEL` から `SELECTED_PLAMO_MODEL` / `SELECTED_GEMINI_MODEL` / `SELECTED_OPENAI_MODEL` にリネーム (旧名称は保存対象から移行)。
- 新規ローカル LLM 接続: LMStudio (`LMSTUDIO_URL`, `SELECTABLE_LMSTUDIO_MODEL_LIST`, `SELECTED_LMSTUDIO_MODEL`) を追加。
- 新規ローカル LLM 接続: Ollama (`SELECTABLE_OLLAMA_MODEL_LIST`, `SELECTED_OLLAMA_MODEL`) を追加。
- OpenAI 認証キー設定時にモデル一覧 (`SELECTABLE_OPENAI_MODEL_LIST`) を自動取得し、未選択時に第一候補へフォールバックする処理を追加。メソッド名を `OpenAi` → `OpenAI` に統一。
### エンドポイント追加 / 変更
`mainloop.py` の `mapping` / `run_mapping` に以下を追加:
- `/get/data/selectable_lmstudio_model_list`, `/get/data/selected_lmstudio_model`, `/set/data/selected_lmstudio_model`, `/get/data/lmstudio_url`, `/set/data/lmstudio_url`
- `/get/data/ollama_connection`, `/get/data/selectable_ollama_model_list`, `/get/data/selected_ollama_model`, `/set/data/selected_ollama_model`
- OpenAI 系: `getOpenAIAuthKey`, `setOpenAIAuthKey`, `delOpenAIAuthKey`, `getOpenAIModelList`, `getOpenAIModel`, `setOpenAIModel` に名称統一。
### 翻訳言語定義の構造変更
- CTranslate2 の言語定義をトップレベル直接キー (例: `m2m100_418M-ct2-int8`) から `translation_lang['CTranslate2'][weight_type]` のネスト構造へ再編。利用側の互換ロジック (`model.findTranslationEngines`) は weight_type 経由で参照するよう修正。
- 新規 YAML 言語マッピングファイル `models/translation/languages/languages.yml` を追加。`config.init_config()` 内で `loadTranslationLanguages()` を呼び出し統合 (失敗時は空辞書フォールバック)。
### プロンプトファイルの整理
- `translation_gemini.yml`, `translation_lmstudio.yml` から `supported_languages` ブロックを削除し、`system_prompt` 内に簡潔化。
### リソース / PyInstaller
- PyInstaller spec (`backend.spec`, `backend_cuda.spec`) の `datas` に `./src-python/models/translation/prompt` および `./src-python/models/translation/languages` を追加。
- フォント配置を `fonts/` 直下から `src-python/models/overlay/fonts/` へ移動し、`overlay_image.py` にビルド時 (`_internal/fonts`) と開発時の動的探索ロジックを追加。
### 依存パッケージの追加
- `requirements.txt` / `requirements_cuda.txt` に `PyYAML==6.0.2` (YAML読込), `google-genai==1.45.0`, `grpcio==1.67.1` を追加。
### 認証処理の微調整
- Plamo / Gemini 認証メソッドで `root_path=config.PATH_LOCAL` を渡すよう変更し、ローカル参照を統一。
- OpenAI モデル設定メソッドの名称を `setTranslatorOpenAiModel` → `setTranslatorOpenAIModel` に変更。
### テスト拡張
- `backend_test.py` に全言語ペア翻訳網羅テスト `test_translate_all_language_pairs()` を追加。結果を `translation_test_results.json` として保存。
### 内部ユーティリティの修正
- `downloadCTranslate2Tokenizer()` が `tokenizer_path` を正しく作成し `transformers.AutoTokenizer.from_pretrained(tokenizer, cache_dir=tokenizer_path)` を使用するよう修正。
### 影響範囲まとめ
| 区分 | 影響内容 |
|------|----------|
| 設定 | 新規プロパティ / 既存名称変更 (`SELECTED_*`, `LMSTUDIO_URL`) |
| エンドポイント | LMStudio / Ollama / OpenAI 名称統一追加 |
| 翻訳言語 | CTranslate2 ネスト構造 / YAML マッピング導入 |
| リソース | PyInstaller datas 追加 / フォントパス移行 |
| 依存 | PyYAML / google-genai / grpcio 追加 |
| 認証 | OpenAI/Plamo/Gemini 認証後モデルリスト更新 & root_path 引数追加 |
| テスト | 全言語ペア網羅テスト追加 |
| ユーティリティ | Tokenizer ダウンロード処理修正 |
### ライセンス影響
追加された依存は既存 LICENSE の記載範囲に変更を強制するものではなく、ライセンス本文の更新不要 (現行 OSS ライセンス許容範囲内)。
+57
View File
@@ -0,0 +1,57 @@
# 設計書
概要
- 本設計書はアプリケーションのアーキテクチャ、主要コンポーネント、並列化モデル、エラー処理ポリシー、設定の保存方針を記述する。
アーキテクチャ概要
- 層構造
- mainloop: stdin ベースのコマンド受け取り、ワーカー(複数スレッド)で実行。
- controller: GUI/フロントエンドからの操作とモデルの仲介。`Controller` がビジネスロジックを実行。
- model: 実際の機能(翻訳、文字起こし、オーバーレイ、OSC、WebSocket、デバイス管理)を提供するファサード的シングルトン。
- models/*: 翻訳、文字起こしなどのドメイン別実装(Translator, AudioTranscriber, Overlay, WebSocketServer ...)。
- device_manager: 音声デバイス検出・監視(Windows の場合は WASAPI/pycaw を利用)。
- utils: 共通ユーティリティ(ロギング、ネットワークチェック、compute device 列挙など)。
初期化ポリシー
- 重い初期化(GPU モデルロード、OpenVR 初期化など)は import 時に行わず、`model.init()` か要求時の `ensure_initialized()` にて遅延実行。
- `DeviceManager` は import 時に軽量な init を行い、監視スレッドは `startMonitoring()` で開始する。
並列化・同期モデル
- mainloop.Main は 1 つの受信スレッド(stdin 읽取り)と N 個のハンドラワーカースレッドを持つ。
- 各リクエストはキューに入れられ、handler() により処理される。
- 有効/無効の切替(/set/enable/**, /set/disable/**)は同一リソースを競合しないよう正規化キーで Lock を割り当てる。
- モデル内部では threadFnc(Thread ラッパ)で周期的な送信処理や監視処理を実装。
- Audio 録音や文字起こしは専用の Queue を用い、Producer(Recorder)と Consumer(AudioTranscriber)を分離。
エラー処理
- すべての外周呼び出しは try/except で保護し、`utils.errorLogging()` によってトレースバックを error.log に出力する。
- JSON シリアライズに失敗した場合はフォールバック JSON を stdout に出力してプロセスを止めない。
- VRAM 関連のエラーは model.detectVRAMError() で判定し、該当する機能(翻訳等)を無効化してユーザーに通知する。
設定管理
- `config.py` が単一の Config シングルトンを持ち、変更はデバウンスして JSON ファイルへ保存。
- GUI からの操作は Controller が受け取り、Config を更新する。
ログ
- `utils.setupLogger` によりローテートファイルハンドラを使ったログを実装(process.log / error.log)。
- stdout には構造化ログを出力してフロントエンドと通信する。
インターフェース一覧(抜粋)
- STDIN/STDOUT プロトコル: mainloop の JSON 入出力(詳細は `mainloop.py` の mapping を参照)
- OSC: `models.osc.OSCHandler` が OSC 送受信と OSCQuery を管理
- WebSocket: `models.websocket.WebSocketServer` がクライアント管理とメッセージブロードキャストを担う
スレッド図(要点)
- main_thread: メイン(stdin 読み取り、キュー投入)
- handler_threads: キューから取り出し処理
- device_manager.th_monitoring: デバイス監視
- model.mic_print_transcript / speaker_print_transcript: 音声 -> 翻訳結果送出のループ
- websocket_server_thread: WebSocket サーバの asyncio ループを別スレッドで実行
拡張性・互換性設計
- 依存性は try/except でガードして optional 機能として扱う(例: faster-whisper が無くても import は成功する)。
- 翻訳エンジンは backend 名で抽象化され、Translator クラスにより統一インターフェースを提供。
運用上の考慮
- 大きなモデルファイル(Whisper, CTranslate2)をダウンロードする仕組みを持ち、進捗を GUI に報告する。
- GPU 計算タイプは utils.getBestComputeType で選択し、不適切な設定を検出した場合はフォールバック。
+150
View File
@@ -0,0 +1,150 @@
# 詳細設計書
この文書は主要クラス・関数の詳細、データ構造、例外ケース、スレッドの振る舞いを記載する。
目次
- Model
- Controller
- Main (mainloop)
- DeviceManager
- Utils
- Clipboard(クリップボード機能)
- Telemetry(テレメトリ機能)
- モデルの重みダウンロードと整合性
## Model
- シングルトン: `model = Model()`
- 遅延初期化: `init()` と `ensure_initialized()` を備え、init は重いリソース(Overlay, Translator, Watchdog, OSC ハンドラ等)を構築する。
- 主な責務
- 翻訳/文字起こし関連の起動停止ラッパ
- Overlay/OSChandler/WebSocket の操作
- キーワード検出(flashtext)と重複検出
- VRAM エラー検出とフォールバック
- クリップボード操作(copy/paste)
- テレメトリ初期化・シャットダウン
- 重要属性(抜粋)
- `translator` : Translator インスタンス
- `overlay` / `overlay_image` : Overlay 系
- `mic_*`, `speaker_*` : 録音、トランスクリプタ、energy recorder
- `watchdog` : Watchdog
- `osc_handler`, `websocket_server`
- `clipboard` : Clipboard インスタンス(2026-01-11 追加)
- `telemetry` : テレメトリシステム(2026-01-11 追加)
- スレッド制御
- threadFnc を用いて周期処理を回す。stop/pause/resume が可能。
- Clipboard の VR 監視スレッドはデーモンスレッド(アプリ終了時に強制停止可能)
## Controller
- GUI からの要求を受け、Model を操作して結果を run() コールバックへ返す。
- 各種設定変更 (/set/ や /get/ エンドポイント) を実装。
- 翻訳/文字起こし/オーバーレイ連携ロジックを持ち、メッセージ整形(messageFormatter)や OSC の送信を行う。
- ダウンロード作業は別スレッドで行い、進捗を run_mapping を通して通知。
- クリップボード/テレメトリ制御エンドポイント追加(2026-01-11)
- `getClipboard()` / `setEnableClipboard()` / `setDisableClipboard()`
- `getTelemetry()` / `setEnableTelemetry()` / `setDisableTelemetry()`
## Main (mainloop.Main)
- stdin を readline() で受け取り JSON を parse、endpoint と data をキューへ投入。
- worker_count 個の handler スレッドが queue を取り出し `_call_handler` を実行。
- endpoint ロック正規化: `/set/enable/...` と `/set/disable/...` は同じ正規化キー `/lock/set/...` を共有して排他制御。
- エラーレスポンスの標準化と再試行ロジック(status==423 は再キュー化)。
## DeviceManager
- シングルトン。初期化は軽量で、`init()` により内部構造をセット、実デバイスは `update()` で取得。
- Windows 環境では COM イベント (pycaw/MMNotificationClient) を用いた検出か、PyAudio によるポーリングでデバイス一覧を構成。
- コールバック設計: 変更検出時に Controller のコールバックを呼び出して UI 更新を促す。
## Utils
- `validateDictStructure(data, structure)` : JSON 構造検証。
- `getComputeDeviceList()` / `getBestComputeType()` : CPU/CUDA を列挙し、推奨 compute_type を返す。
- `setupLogger()` / `printLog()` / `printResponse()` / `errorLogging()` : ログ、標準出力の整形、エラー記録。
- ネットワーク/ソケット/IP アドレス検査ユーティリティ。
## Clipboard(クリップボード機能)
### 概要(2026-01-11 追加)
VRChat 内でのテキスト送信効率向上のため、翻訳結果をクリップボードにコピーし、自動ペースト機能を提供。
### 設計
- **シングルトン**: `models.clipboard.clipboard.Clipboard` クラス
- **初期化**: `Model.__init__()` で `self.clipboard = Clipboard()` インスタンス化
- **VR監視スレッド**: デーモンスレッドで 10 秒間隔 SteamVR 監視、VRChat アプリ名を自動検出
- **コピー・ペースト**:
- `setCopyToClipboard(text: str) -> bool`: 複数バックエンド対応(Windows clip、pyperclip、tkinter)
- `setPasteFromClipboard() -> bool`: PyAutoGUI による Ctrl+V 送信、VRChat ウィンドウ自動フォーカス
### 依存ライブラリ
- `pyautogui==0.9.54`: キー入力シミュレーション(requirements.txt 追加)
- `openvr`: VR アプリ名検出
- `psutil`: プロセス検索
- `pyperclip`(オプション): クリップボード操作フォールバック
### 設定・制御
- `config.ENABLE_CLIPBOARD`: True/False で機能制御
- Controller エンドポイント
- `/get/data/clipboard`: 状態取得(`config.ENABLE_CLIPBOARD` の値)
- `/set/enable/clipboard`: `config.ENABLE_CLIPBOARD` を True に設定
- `/set/disable/clipboard`: `config.ENABLE_CLIPBOARD` を False に設定
### 動作フロー
1. Model 初期化時に Clipboard インスタンス生成(VR 監視スレッド起動)
2. Controller が `config.ENABLE_CLIPBOARD == True` をチェック
3. 有効時のみ `model.setCopyToClipboard(result)` と `model.setPasteFromClipboard()` を呼び出し
4. Clipboard インスタンス自体は常に稼働(`clipboard.is_enabled` は常に True)
### エラーハンドリング
- コピー失敗: False を返却、リトライなし
- ペースト失敗: False を返却
- VR アプリ名検出失敗: app_name = None、現在フォーカスウィンドウにペースト
- 例外はログ出力し握りつぶし
## Telemetry(テレメトリ機能)
### 概要(2026-01-11 追加)
Aptabase を用いた匿名な使用状況データ収集。デフォルト有効、ユーザー制御可能。
### 設計
- **デフォルト有効**: `config.ENABLE_TELEMETRY = True`
- **初期化**: `model.telemetryInit(enabled=config.ENABLE_TELEMETRY, app_version=config.VERSION)`
- **シャットダウン**: `model.telemetryShutdown()` で app_closed イベント送信
- **プライバシー重視**: 個人情報・入力内容・音声データ一切送信なし
### イベント種別(送信固定)
- `app_started`: アプリ起動
- `app_closed`: アプリ終了(最後のイベント)
- `core_feature`: 機能開始(translation / mic_speech_to_text / speaker_speech_to_text / text_input)
### 動作フロー
1. アプリ起動時に telemetryInit() 呼び出し
2. 機能開始時に track_core_feature() で 1 セッション 1 回のみ送信
3. アプリ終了時に telemetryShutdown() で app_closed 送信
4. config.ENABLE_TELEMETRY = False で一切の通信・スレッド停止
### 設定・制御
- `config.ENABLE_TELEMETRY`: True/False で機能制御
- `model.telemetry.enabled`: 現在の有効状態
- Controller エンドポイント
- `/get/data/telemetry`: 状態取得
- `/set/enable/telemetry`: 有効化(telemetryInit 呼び出し)
- `/set/disable/telemetry`: 無効化(telemetryShutdown 呼び出し)
### エラーハンドリング
- API 通信失敗時: 例外握りつぶし、アプリ動作に影響なし
- オフライン時: 機能停止のみ、再送・バッファリングなし
- 無効化時: 一切の通信・スレッド・処理停止
- Aptabase SDK ログ: CRITICAL レベルのみに制限(ノイズ削減)
## モデル重みダウンロード
- `models.translation.translation_utils` と `models.transcription.transcription_whisper` にダウンロード/チェック関数があり、チェックサムやファイル存在を検証する。
- GUI からの要求は Controller により非同期スレッドで実行され、進捗コールバックが run_mapping を介してフロントエンドに渡る。
## エッジケース / 例外処理
- 外部 API のレート制限や認証エラーは呼び出し元に 400 系のレスポンスを返し、必要であればフォールバック実装(CTranslate2 への切替)を行う。
- 大きなモデル実行時の VRAM エラーは検出し、当該機能を無効化してユーザへ通知する。
- 音声デバイスが存在しない場合は NoDevice を返し、UI 側で扱う。
## テスト観点
- メッセージ受信/送信のエンドツーエンド: stdin -> handler -> Controller -> Model -> printResponse の流れ。
- デバイス挙動: DeviceManager.update() がデバイス一覧を取得できるか(PyAudio 経由)。
- モデルダウンロード: ダウンロード成功・失敗、チェックサム検証。
- ログ/エラー: errorLogging() による例外トレースが error.log に記録されるか。
+694
View File
@@ -0,0 +1,694 @@
# src-python/errors.py
"""
統一エラー管理システム
すべてのエラーを一元管理し、エンドポイントとエラーコードの対応を明確にする。
"""
from typing import Any, Optional, Dict
from enum import Enum
class ErrorCode(str, Enum):
"""エラーコード定数
命名規則: カテゴリ_具体的な内容
"""
# ============================================================================
# デバイス関連エラー (DEVICE_*)
# ============================================================================
DEVICE_NO_MIC = "DEVICE_NO_MIC"
DEVICE_NO_SPEAKER = "DEVICE_NO_SPEAKER"
# ============================================================================
# 翻訳関連エラー (TRANSLATION_*)
# ============================================================================
TRANSLATION_ENGINE_LIMIT = "TRANSLATION_ENGINE_LIMIT"
TRANSLATION_VRAM_CHAT = "TRANSLATION_VRAM_CHAT"
TRANSLATION_VRAM_MIC = "TRANSLATION_VRAM_MIC"
TRANSLATION_VRAM_SPEAKER = "TRANSLATION_VRAM_SPEAKER"
TRANSLATION_VRAM_ENABLE = "TRANSLATION_VRAM_ENABLE"
TRANSLATION_DISABLED_VRAM = "TRANSLATION_DISABLED_VRAM"
# ============================================================================
# 音声認識関連エラー (TRANSCRIPTION_*)
# ============================================================================
TRANSCRIPTION_VRAM_MIC = "TRANSCRIPTION_VRAM_MIC"
TRANSCRIPTION_VRAM_SPEAKER = "TRANSCRIPTION_VRAM_SPEAKER"
TRANSCRIPTION_SEND_DISABLED_VRAM = "TRANSCRIPTION_SEND_DISABLED_VRAM"
TRANSCRIPTION_RECEIVE_DISABLED_VRAM = "TRANSCRIPTION_RECEIVE_DISABLED_VRAM"
# ============================================================================
# ウェイトダウンロード関連エラー (WEIGHT_*)
# ============================================================================
WEIGHT_CTRANSLATE2_DOWNLOAD = "WEIGHT_CTRANSLATE2_DOWNLOAD"
WEIGHT_WHISPER_DOWNLOAD = "WEIGHT_WHISPER_DOWNLOAD"
# ============================================================================
# バリデーションエラー (VALIDATION_*)
# ============================================================================
VALIDATION_MIC_THRESHOLD = "VALIDATION_MIC_THRESHOLD"
VALIDATION_SPEAKER_THRESHOLD = "VALIDATION_SPEAKER_THRESHOLD"
VALIDATION_MIC_RECORD_TIMEOUT = "VALIDATION_MIC_RECORD_TIMEOUT"
VALIDATION_MIC_PHRASE_TIMEOUT = "VALIDATION_MIC_PHRASE_TIMEOUT"
VALIDATION_MIC_MAX_PHRASES = "VALIDATION_MIC_MAX_PHRASES"
VALIDATION_SPEAKER_RECORD_TIMEOUT = "VALIDATION_SPEAKER_RECORD_TIMEOUT"
VALIDATION_SPEAKER_PHRASE_TIMEOUT = "VALIDATION_SPEAKER_PHRASE_TIMEOUT"
VALIDATION_SPEAKER_MAX_PHRASES = "VALIDATION_SPEAKER_MAX_PHRASES"
VALIDATION_INVALID_IP = "VALIDATION_INVALID_IP"
VALIDATION_CANNOT_SET_IP = "VALIDATION_CANNOT_SET_IP"
# ============================================================================
# 認証エラー (AUTH_*)
# ============================================================================
AUTH_DEEPL_LENGTH = "AUTH_DEEPL_LENGTH"
AUTH_DEEPL_FAILED = "AUTH_DEEPL_FAILED"
AUTH_PLAMO_LENGTH = "AUTH_PLAMO_LENGTH"
AUTH_PLAMO_FAILED = "AUTH_PLAMO_FAILED"
AUTH_GEMINI_LENGTH = "AUTH_GEMINI_LENGTH"
AUTH_GEMINI_FAILED = "AUTH_GEMINI_FAILED"
AUTH_OPENAI_INVALID = "AUTH_OPENAI_INVALID"
AUTH_OPENAI_FAILED = "AUTH_OPENAI_FAILED"
AUTH_GROQ_INVALID = "AUTH_GROQ_INVALID"
AUTH_GROQ_FAILED = "AUTH_GROQ_FAILED"
AUTH_OPENROUTER_INVALID = "AUTH_OPENROUTER_INVALID"
AUTH_OPENROUTER_FAILED = "AUTH_OPENROUTER_FAILED"
# ============================================================================
# モデル選択エラー (MODEL_*)
# ============================================================================
MODEL_PLAMO_INVALID = "MODEL_PLAMO_INVALID"
MODEL_GEMINI_INVALID = "MODEL_GEMINI_INVALID"
MODEL_OPENAI_INVALID = "MODEL_OPENAI_INVALID"
MODEL_GROQ_INVALID = "MODEL_GROQ_INVALID"
MODEL_OPENROUTER_INVALID = "MODEL_OPENROUTER_INVALID"
MODEL_LMSTUDIO_INVALID = "MODEL_LMSTUDIO_INVALID"
MODEL_OLLAMA_INVALID = "MODEL_OLLAMA_INVALID"
# ============================================================================
# 接続エラー (CONNECTION_*)
# ============================================================================
CONNECTION_LMSTUDIO_FAILED = "CONNECTION_LMSTUDIO_FAILED"
CONNECTION_OLLAMA_FAILED = "CONNECTION_OLLAMA_FAILED"
CONNECTION_LMSTUDIO_URL_INVALID = "CONNECTION_LMSTUDIO_URL_INVALID"
# ============================================================================
# WebSocketエラー (WEBSOCKET_*)
# ============================================================================
WEBSOCKET_HOST_INVALID = "WEBSOCKET_HOST_INVALID"
WEBSOCKET_PORT_UNAVAILABLE = "WEBSOCKET_PORT_UNAVAILABLE"
WEBSOCKET_SERVER_UNAVAILABLE = "WEBSOCKET_SERVER_UNAVAILABLE"
# ============================================================================
# VRC連携エラー (VRC_*)
# ============================================================================
VRC_MIC_MUTE_SYNC_OSC_DISABLED = "VRC_MIC_MUTE_SYNC_OSC_DISABLED"
# ============================================================================
# 汎用エラー (GENERAL_*)
# ============================================================================
GENERAL_EXCEPTION = "GENERAL_EXCEPTION"
GENERAL_UNKNOWN = "GENERAL_UNKNOWN"
class ErrorCategory(str, Enum):
"""エラーカテゴリ"""
DEVICE = "device"
TRANSLATION = "translation"
TRANSCRIPTION = "transcription"
WEIGHT = "weight"
VALIDATION = "validation"
AUTH = "auth"
MODEL = "model"
CONNECTION = "connection"
WEBSOCKET = "websocket"
VRC = "vrc"
GENERAL = "general"
# エラーコードのメタデータ定義
ERROR_METADATA: Dict[ErrorCode, Dict[str, Any]] = {
# デバイスエラー
ErrorCode.DEVICE_NO_MIC: {
"category": ErrorCategory.DEVICE,
"message": "No mic device detected",
"severity": "error",
"user_action_required": True,
},
ErrorCode.DEVICE_NO_SPEAKER: {
"category": ErrorCategory.DEVICE,
"message": "No speaker device detected",
"severity": "error",
"user_action_required": True,
},
# 翻訳エラー
ErrorCode.TRANSLATION_ENGINE_LIMIT: {
"category": ErrorCategory.TRANSLATION,
"message": "Translation engine limit error",
"severity": "warning",
"user_action_required": False,
"auto_fallback": True,
},
ErrorCode.TRANSLATION_VRAM_CHAT: {
"category": ErrorCategory.TRANSLATION,
"message": "VRAM out of memory during translation of chat",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSLATION_VRAM_MIC: {
"category": ErrorCategory.TRANSLATION,
"message": "VRAM out of memory during translation of mic",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSLATION_VRAM_SPEAKER: {
"category": ErrorCategory.TRANSLATION,
"message": "VRAM out of memory during translation of speaker",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSLATION_VRAM_ENABLE: {
"category": ErrorCategory.TRANSLATION,
"message": "VRAM out of memory enabling translation",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSLATION_DISABLED_VRAM: {
"category": ErrorCategory.TRANSLATION,
"message": "Translation disabled due to VRAM overflow",
"severity": "critical",
"user_action_required": True,
},
# 音声認識エラー
ErrorCode.TRANSCRIPTION_VRAM_MIC: {
"category": ErrorCategory.TRANSCRIPTION,
"message": "VRAM out of memory during mic transcription",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSCRIPTION_VRAM_SPEAKER: {
"category": ErrorCategory.TRANSCRIPTION,
"message": "VRAM out of memory during speaker transcription",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSCRIPTION_SEND_DISABLED_VRAM: {
"category": ErrorCategory.TRANSCRIPTION,
"message": "Transcription send disabled due to VRAM overflow",
"severity": "critical",
"user_action_required": True,
},
ErrorCode.TRANSCRIPTION_RECEIVE_DISABLED_VRAM: {
"category": ErrorCategory.TRANSCRIPTION,
"message": "Transcription receive disabled due to VRAM overflow",
"severity": "critical",
"user_action_required": True,
},
# ウェイトダウンロードエラー
ErrorCode.WEIGHT_CTRANSLATE2_DOWNLOAD: {
"category": ErrorCategory.WEIGHT,
"message": "CTranslate2 weight download error",
"severity": "error",
"user_action_required": True,
},
ErrorCode.WEIGHT_WHISPER_DOWNLOAD: {
"category": ErrorCategory.WEIGHT,
"message": "Whisper weight download error",
"severity": "error",
"user_action_required": True,
},
# バリデーションエラー
ErrorCode.VALIDATION_MIC_THRESHOLD: {
"category": ErrorCategory.VALIDATION,
"message": "Mic energy threshold value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_SPEAKER_THRESHOLD: {
"category": ErrorCategory.VALIDATION,
"message": "Speaker energy threshold value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_MIC_RECORD_TIMEOUT: {
"category": ErrorCategory.VALIDATION,
"message": "Mic record timeout value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_MIC_PHRASE_TIMEOUT: {
"category": ErrorCategory.VALIDATION,
"message": "Mic phrase timeout value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_MIC_MAX_PHRASES: {
"category": ErrorCategory.VALIDATION,
"message": "Mic max phrases value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_SPEAKER_RECORD_TIMEOUT: {
"category": ErrorCategory.VALIDATION,
"message": "Speaker record timeout value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_SPEAKER_PHRASE_TIMEOUT: {
"category": ErrorCategory.VALIDATION,
"message": "Speaker phrase timeout value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_SPEAKER_MAX_PHRASES: {
"category": ErrorCategory.VALIDATION,
"message": "Speaker max phrases value is out of range",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_INVALID_IP: {
"category": ErrorCategory.VALIDATION,
"message": "Invalid IP address",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.VALIDATION_CANNOT_SET_IP: {
"category": ErrorCategory.VALIDATION,
"message": "Cannot set IP address",
"severity": "error",
"user_action_required": True,
},
# 認証エラー
ErrorCode.AUTH_DEEPL_LENGTH: {
"category": ErrorCategory.AUTH,
"message": "DeepL auth key length is not correct",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_DEEPL_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of deepL auth key",
"severity": "error",
"user_action_required": True,
},
ErrorCode.AUTH_PLAMO_LENGTH: {
"category": ErrorCategory.AUTH,
"message": "Plamo auth key length is not correct",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_PLAMO_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of plamo auth key",
"severity": "error",
"user_action_required": True,
},
ErrorCode.AUTH_GEMINI_LENGTH: {
"category": ErrorCategory.AUTH,
"message": "Gemini auth key length is not correct",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_GEMINI_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of gemini auth key",
"severity": "error",
"user_action_required": True,
},
ErrorCode.AUTH_OPENAI_INVALID: {
"category": ErrorCategory.AUTH,
"message": "OpenAI auth key is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_OPENAI_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of OpenAI auth key",
"severity": "error",
"user_action_required": True,
},
ErrorCode.AUTH_GROQ_INVALID: {
"category": ErrorCategory.AUTH,
"message": "Groq auth key is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_GROQ_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of Groq auth key",
"severity": "error",
"user_action_required": True,
},
ErrorCode.AUTH_OPENROUTER_INVALID: {
"category": ErrorCategory.AUTH,
"message": "OpenRouter auth key is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.AUTH_OPENROUTER_FAILED: {
"category": ErrorCategory.AUTH,
"message": "Authentication failure of OpenRouter auth key",
"severity": "error",
"user_action_required": True,
},
# モデル選択エラー
ErrorCode.MODEL_PLAMO_INVALID: {
"category": ErrorCategory.MODEL,
"message": "Plamo model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_GEMINI_INVALID: {
"category": ErrorCategory.MODEL,
"message": "Gemini model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_OPENAI_INVALID: {
"category": ErrorCategory.MODEL,
"message": "OpenAI model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_GROQ_INVALID: {
"category": ErrorCategory.MODEL,
"message": "Groq model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_OPENROUTER_INVALID: {
"category": ErrorCategory.MODEL,
"message": "OpenRouter model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_LMSTUDIO_INVALID: {
"category": ErrorCategory.MODEL,
"message": "LMStudio model is not valid",
"severity": "warning",
"user_action_required": True,
},
ErrorCode.MODEL_OLLAMA_INVALID: {
"category": ErrorCategory.MODEL,
"message": "ollama model is not valid",
"severity": "warning",
"user_action_required": True,
},
# 接続エラー
ErrorCode.CONNECTION_LMSTUDIO_FAILED: {
"category": ErrorCategory.CONNECTION,
"message": "Cannot connect to LMStudio server",
"severity": "error",
"user_action_required": True,
},
ErrorCode.CONNECTION_OLLAMA_FAILED: {
"category": ErrorCategory.CONNECTION,
"message": "Cannot connect to ollama server",
"severity": "error",
"user_action_required": True,
},
ErrorCode.CONNECTION_LMSTUDIO_URL_INVALID: {
"category": ErrorCategory.CONNECTION,
"message": "LMStudio URL is not valid",
"severity": "warning",
"user_action_required": True,
},
# WebSocketエラー
ErrorCode.WEBSOCKET_HOST_INVALID: {
"category": ErrorCategory.WEBSOCKET,
"message": "WebSocket server host is not available",
"severity": "error",
"user_action_required": True,
},
ErrorCode.WEBSOCKET_PORT_UNAVAILABLE: {
"category": ErrorCategory.WEBSOCKET,
"message": "WebSocket server port is not available",
"severity": "error",
"user_action_required": True,
},
ErrorCode.WEBSOCKET_SERVER_UNAVAILABLE: {
"category": ErrorCategory.WEBSOCKET,
"message": "WebSocket server host or port is not available",
"severity": "error",
"user_action_required": True,
},
# VRC連携エラー
ErrorCode.VRC_MIC_MUTE_SYNC_OSC_DISABLED: {
"category": ErrorCategory.VRC,
"message": "Cannot enable VRC mic mute sync while OSC query is disabled",
"severity": "warning",
"user_action_required": True,
},
# 汎用エラー
ErrorCode.GENERAL_EXCEPTION: {
"category": ErrorCategory.GENERAL,
"message": "An error occurred",
"severity": "error",
"user_action_required": False,
},
ErrorCode.GENERAL_UNKNOWN: {
"category": ErrorCategory.GENERAL,
"message": "Unknown error",
"severity": "error",
"user_action_required": False,
},
}
class VRCTError:
"""VRCTエラーハンドリングクラス"""
@staticmethod
def create_error_response(
error_code: ErrorCode,
data: Any = None,
details: Optional[Dict[str, Any]] = None,
custom_message: Optional[str] = None
) -> Dict[str, Any]:
"""統一されたエラーレスポンスを生成
Args:
error_code: エラーコード
data: エラー時に戻す値(通常は元の値)
details: 追加の詳細情報
custom_message: カスタムメッセージ(指定しない場合はデフォルトメッセージ)
Returns:
エラーレスポンス辞書
"""
metadata = ERROR_METADATA.get(error_code, ERROR_METADATA[ErrorCode.GENERAL_UNKNOWN])
return {
"status": 400,
"result": {
"error_code": error_code.value,
"message": custom_message or metadata["message"],
"data": data,
"details": details or {},
"category": metadata["category"].value,
"severity": metadata["severity"],
}
}
@staticmethod
def create_exception_error_response(
exception: Exception,
data: Any = None,
error_code: ErrorCode = ErrorCode.GENERAL_EXCEPTION
) -> Dict[str, Any]:
"""例外からエラーレスポンスを生成
Args:
exception: 発生した例外
data: エラー時に戻す値
error_code: エラーコード
Returns:
エラーレスポンス辞書
"""
return VRCTError.create_error_response(
error_code=error_code,
data=data,
custom_message=f"Error: {str(exception)}",
details={"exception_type": type(exception).__name__}
)
# エンドポイントとエラーコードのマッピング
# UIがエラーハンドリングする際の参照として使用
ENDPOINT_ERROR_MAPPING: Dict[str, Dict[str, ErrorCode]] = {
# run_mapping経由のエラー通知
"/run/error_device": {
"NO_MIC": ErrorCode.DEVICE_NO_MIC,
"NO_SPEAKER": ErrorCode.DEVICE_NO_SPEAKER,
},
"/run/error_translation_engine": {
"LIMIT": ErrorCode.TRANSLATION_ENGINE_LIMIT,
},
"/run/error_translation_chat_vram_overflow": {
"VRAM": ErrorCode.TRANSLATION_VRAM_CHAT,
},
"/run/error_translation_mic_vram_overflow": {
"VRAM": ErrorCode.TRANSLATION_VRAM_MIC,
},
"/run/error_translation_speaker_vram_overflow": {
"VRAM": ErrorCode.TRANSLATION_VRAM_SPEAKER,
},
"/run/error_transcription_mic_vram_overflow": {
"VRAM": ErrorCode.TRANSCRIPTION_VRAM_MIC,
},
"/run/error_transcription_speaker_vram_overflow": {
"VRAM": ErrorCode.TRANSCRIPTION_VRAM_SPEAKER,
},
"/run/error_ctranslate2_weight": {
"DOWNLOAD": ErrorCode.WEIGHT_CTRANSLATE2_DOWNLOAD,
},
"/run/error_whisper_weight": {
"DOWNLOAD": ErrorCode.WEIGHT_WHISPER_DOWNLOAD,
},
# エンドポイント直接のエラーレスポンス
"/set/data/mic_threshold": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_MIC_THRESHOLD,
},
"/set/data/speaker_threshold": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_SPEAKER_THRESHOLD,
},
"/set/data/mic_record_timeout": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_MIC_RECORD_TIMEOUT,
},
"/set/data/mic_phrase_timeout": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_MIC_PHRASE_TIMEOUT,
},
"/set/data/mic_max_phrases": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_MIC_MAX_PHRASES,
},
"/set/data/speaker_record_timeout": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_SPEAKER_RECORD_TIMEOUT,
},
"/set/data/speaker_phrase_timeout": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_SPEAKER_PHRASE_TIMEOUT,
},
"/set/data/speaker_max_phrases": {
"OUT_OF_RANGE": ErrorCode.VALIDATION_SPEAKER_MAX_PHRASES,
},
"/set/data/osc_ip_address": {
"INVALID": ErrorCode.VALIDATION_INVALID_IP,
"CANNOT_SET": ErrorCode.VALIDATION_CANNOT_SET_IP,
},
"/set/data/deepl_auth_key": {
"LENGTH": ErrorCode.AUTH_DEEPL_LENGTH,
"FAILED": ErrorCode.AUTH_DEEPL_FAILED,
},
"/set/data/plamo_auth_key": {
"LENGTH": ErrorCode.AUTH_PLAMO_LENGTH,
"FAILED": ErrorCode.AUTH_PLAMO_FAILED,
},
"/set/data/selected_plamo_model": {
"INVALID": ErrorCode.MODEL_PLAMO_INVALID,
},
"/set/data/gemini_auth_key": {
"LENGTH": ErrorCode.AUTH_GEMINI_LENGTH,
"FAILED": ErrorCode.AUTH_GEMINI_FAILED,
},
"/set/data/selected_gemini_model": {
"INVALID": ErrorCode.MODEL_GEMINI_INVALID,
},
"/set/data/openai_auth_key": {
"INVALID": ErrorCode.AUTH_OPENAI_INVALID,
"FAILED": ErrorCode.AUTH_OPENAI_FAILED,
},
"/set/data/selected_openai_model": {
"INVALID": ErrorCode.MODEL_OPENAI_INVALID,
},
"/set/data/groq_auth_key": {
"INVALID": ErrorCode.AUTH_GROQ_INVALID,
"FAILED": ErrorCode.AUTH_GROQ_FAILED,
},
"/set/data/selected_groq_model": {
"INVALID": ErrorCode.MODEL_GROQ_INVALID,
},
"/set/data/openrouter_auth_key": {
"INVALID": ErrorCode.AUTH_OPENROUTER_INVALID,
"FAILED": ErrorCode.AUTH_OPENROUTER_FAILED,
},
"/set/data/selected_openrouter_model": {
"INVALID": ErrorCode.MODEL_OPENROUTER_INVALID,
},
"/run/lmstudio_connection": {
"FAILED": ErrorCode.CONNECTION_LMSTUDIO_FAILED,
},
"/set/data/lmstudio_url": {
"INVALID": ErrorCode.CONNECTION_LMSTUDIO_URL_INVALID,
},
"/set/data/selected_lmstudio_model": {
"INVALID": ErrorCode.MODEL_LMSTUDIO_INVALID,
},
"/run/ollama_connection": {
"FAILED": ErrorCode.CONNECTION_OLLAMA_FAILED,
},
"/set/data/selected_ollama_model": {
"INVALID": ErrorCode.MODEL_OLLAMA_INVALID,
},
"/set/data/websocket_host": {
"INVALID_IP": ErrorCode.VALIDATION_INVALID_IP,
"UNAVAILABLE": ErrorCode.WEBSOCKET_HOST_INVALID,
},
"/set/data/websocket_port": {
"UNAVAILABLE": ErrorCode.WEBSOCKET_PORT_UNAVAILABLE,
},
"/set/enable/websocket_server": {
"UNAVAILABLE": ErrorCode.WEBSOCKET_SERVER_UNAVAILABLE,
},
"/set/enable/vrc_mic_mute_sync": {
"OSC_DISABLED": ErrorCode.VRC_MIC_MUTE_SYNC_OSC_DISABLED,
},
}
def get_error_metadata(error_code: ErrorCode) -> Dict[str, Any]:
"""エラーコードのメタデータを取得
Args:
error_code: エラーコード
Returns:
メタデータ辞書
"""
return ERROR_METADATA.get(error_code, ERROR_METADATA[ErrorCode.GENERAL_UNKNOWN])
def is_critical_error(error_code: ErrorCode) -> bool:
"""クリティカルエラーかどうかを判定
Args:
error_code: エラーコード
Returns:
クリティカルエラーの場合True
"""
metadata = get_error_metadata(error_code)
return metadata.get("severity") == "critical"
def requires_user_action(error_code: ErrorCode) -> bool:
"""ユーザーアクションが必要なエラーかどうかを判定
Args:
error_code: エラーコード
Returns:
ユーザーアクションが必要な場合True
"""
metadata = get_error_metadata(error_code)
return metadata.get("user_action_required", False)
+624
View File
@@ -0,0 +1,624 @@
import sys
import json
import time
from typing import Any, Tuple
from threading import Thread, Event, Lock
from queue import Queue, Empty
import logging
from controller import Controller # noqa: E402
from utils import printLog, printResponse, errorLogging, encodeBase64 # noqa: E402
logging.getLogger("huggingface_hub").setLevel(logging.ERROR)
run_mapping = {
"enable_translation":"/run/enable_translation",
"enable_transcription_send":"/run/enable_transcription_send",
"enable_transcription_receive":"/run/enable_transcription_receive",
"connected_network":"/run/connected_network",
"enable_ai_models":"/run/enable_ai_models",
"transcription_mic":"/run/transcription_send_mic_message",
"transcription_speaker":"/run/transcription_receive_speaker_message",
"check_mic_volume":"/run/check_mic_volume",
"check_speaker_volume":"/run/check_speaker_volume",
"error_device":"/run/error_device",
"error_translation_engine":"/run/error_translation_engine",
"error_translation_chat_vram_overflow":"/run/error_translation_chat_vram_overflow",
"error_translation_mic_vram_overflow":"/run/error_translation_mic_vram_overflow",
"error_translation_speaker_vram_overflow":"/run/error_translation_speaker_vram_overflow",
"error_transcription_mic_vram_overflow":"/run/error_transcription_mic_vram_overflow",
"error_transcription_speaker_vram_overflow":"/run/error_transcription_speaker_vram_overflow",
"word_filter":"/run/word_filter",
"download_progress_ctranslate2_weight":"/run/download_progress_ctranslate2_weight",
"downloaded_ctranslate2_weight":"/run/downloaded_ctranslate2_weight",
"error_ctranslate2_weight":"/run/error_ctranslate2_weight",
"download_progress_whisper_weight":"/run/download_progress_whisper_weight",
"downloaded_whisper_weight":"/run/downloaded_whisper_weight",
"error_whisper_weight":"/run/error_whisper_weight",
"selected_mic_host":"/run/selected_mic_host",
"selected_mic_device":"/run/selected_mic_device",
"selected_speaker_device":"/run/selected_speaker_device",
"selected_translation_engines":"/run/selected_translation_engines",
"translation_engines":"/run/translation_engines",
"selected_translation_compute_type":"/run/selected_translation_compute_type",
"selected_transcription_compute_type":"/run/selected_transcription_compute_type",
"selectable_plamo_model_list":"/run/selectable_plamo_model_list",
"selected_plamo_model":"/run/selected_plamo_model",
"selectable_gemini_model_list":"/run/selectable_gemini_model_list",
"selected_gemini_model":"/run/selected_gemini_model",
"selectable_openai_model_list":"/run/selectable_openai_model_list",
"selected_openai_model":"/run/selected_openai_model",
"selectable_groq_model_list":"/run/selectable_groq_model_list",
"selected_groq_model":"/run/selected_groq_model",
"selectable_openrouter_model_list":"/run/selectable_openrouter_model_list",
"selected_openrouter_model":"/run/selected_openrouter_model",
"selectable_lmstudio_model_list":"/run/selectable_lmstudio_model_list",
"selected_lmstudio_model":"/run/selected_lmstudio_model",
"selectable_ollama_model_list":"/run/selectable_ollama_model_list",
"selected_ollama_model":"/run/selected_ollama_model",
"selectable_mic_host_list":"/run/selectable_mic_host_list",
"selectable_mic_device_list":"/run/selectable_mic_device_list",
"selectable_speaker_device_list":"/run/selectable_speaker_device_list",
"software_update_info":"/run/software_update_info",
"initialization_progress":"/run/initialization_progress",
"initialization_complete":"/run/initialization_complete",
"enable_osc_query":"/run/enable_osc_query",
}
def run(status:int, endpoint:str, result:Any) -> None:
printResponse(status, endpoint, result)
controller = Controller()
controller.setRunMapping(run_mapping)
controller.setRun(run)
mapping = {
# Main Window
"/set/enable/translation": {"status": False, "variable":controller.setEnableTranslation},
"/set/disable/translation": {"status": False, "variable":controller.setDisableTranslation},
"/set/enable/transcription_send": {"status": False, "variable":controller.setEnableTranscriptionSend},
"/set/disable/transcription_send": {"status": False, "variable":controller.setDisableTranscriptionSend},
"/set/enable/transcription_receive": {"status": False, "variable":controller.setEnableTranscriptionReceive},
"/set/disable/transcription_receive": {"status": False, "variable":controller.setDisableTranscriptionReceive},
"/set/enable/foreground": {"status": True, "variable":controller.setEnableForeground},
"/set/disable/foreground": {"status": True, "variable":controller.setDisableForeground},
"/get/data/selected_tab_no": {"status": True, "variable":controller.getSelectedTabNo},
"/set/data/selected_tab_no": {"status": True, "variable":controller.setSelectedTabNo},
"/get/data/main_window_sidebar_compact_mode": {"status": True, "variable":controller.getMainWindowSidebarCompactMode},
"/set/enable/main_window_sidebar_compact_mode": {"status": True, "variable":controller.setEnableMainWindowSidebarCompactMode},
"/set/disable/main_window_sidebar_compact_mode": {"status": True, "variable":controller.setDisableMainWindowSidebarCompactMode},
"/get/data/selectable_translation_engines": {"status": True, "variable":controller.getTranslationEngines},
"/get/data/selectable_language_list": {"status": True, "variable":controller.getListLanguageAndCountry},
"/get/data/selected_translation_engines": {"status": False, "variable":controller.getSelectedTranslationEngines},
"/set/data/selected_translation_engines": {"status": True, "variable":controller.setSelectedTranslationEngines},
"/get/data/selected_your_languages": {"status": True, "variable":controller.getSelectedYourLanguages},
"/set/data/selected_your_languages": {"status": True, "variable":controller.setSelectedYourLanguages},
"/get/data/selected_target_languages": {"status": True, "variable":controller.getSelectedTargetLanguages},
"/set/data/selected_target_languages": {"status": True, "variable":controller.setSelectedTargetLanguages},
"/get/data/selectable_transcription_engines": {"status": False, "variable":controller.getTranscriptionEngines},
"/get/data/selected_transcription_engine": {"status": False, "variable":controller.getSelectedTranscriptionEngine},
"/set/data/selected_transcription_engine": {"status": False, "variable":controller.setSelectedTranscriptionEngine},
"/run/send_message_box": {"status": False, "variable":controller.sendMessageBox},
"/run/typing_message_box": {"status": False, "variable":controller.typingMessageBox},
"/run/stop_typing_message_box": {"status": False, "variable":controller.stopTypingMessageBox},
"/run/send_text_overlay": {"status": True, "variable":controller.sendTextOverlay},
"/get/data/telemetry" : {"status": True, "variable":controller.getTelemetry},
"/set/enable/telemetry" : {"status": True, "variable":controller.setEnableTelemetry},
"/set/disable/telemetry" : {"status": True, "variable":controller.setDisableTelemetry},
"/run/shutdown": {"status": True, "variable":controller.shutdown},
"/run/swap_your_language_and_target_language": {"status": True, "variable":controller.swapYourLanguageAndTargetLanguage},
"/run/update_software": {"status": True, "variable":controller.updateSoftware},
"/run/update_cuda_software": {"status": True, "variable":controller.updateCudaSoftware},
# Config Window
# Appearance
"/get/data/version": {"status": True, "variable":controller.getVersion},
"/get/data/transparency": {"status": True, "variable":controller.getTransparency},
"/set/data/transparency": {"status": True, "variable":controller.setTransparency},
"/get/data/ui_scaling": {"status": True, "variable":controller.getUiScaling},
"/set/data/ui_scaling": {"status": True, "variable":controller.setUiScaling},
"/get/data/textbox_ui_scaling": {"status": True, "variable":controller.getTextboxUiScaling},
"/set/data/textbox_ui_scaling": {"status": True, "variable":controller.setTextboxUiScaling},
"/get/data/message_box_ratio": {"status": True, "variable":controller.getMessageBoxRatio},
"/set/data/message_box_ratio": {"status": True, "variable":controller.setMessageBoxRatio},
"/get/data/send_message_button_type": {"status": True, "variable":controller.getSendMessageButtonType},
"/set/data/send_message_button_type": {"status": True, "variable":controller.setSendMessageButtonType},
"/get/data/show_resend_button": {"status": True, "variable":controller.getShowResendButton},
"/set/enable/show_resend_button": {"status": True, "variable":controller.setEnableShowResendButton},
"/set/disable/show_resend_button": {"status": True, "variable":controller.setDisableShowResendButton},
"/get/data/font_family": {"status": True, "variable":controller.getFontFamily},
"/set/data/font_family": {"status": True, "variable":controller.setFontFamily},
"/get/data/ui_language": {"status": True, "variable":controller.getUiLanguage},
"/set/data/ui_language": {"status": True, "variable":controller.setUiLanguage},
"/get/data/main_window_geometry": {"status": True, "variable":controller.getMainWindowGeometry},
"/set/data/main_window_geometry": {"status": True, "variable":controller.setMainWindowGeometry},
# Compute device
"/get/data/compute_mode": {"status": True, "variable":controller.getComputeMode},
"/get/data/selectable_translation_compute_device_list": {"status": True, "variable":controller.getComputeDeviceList},
"/get/data/selected_translation_compute_device": {"status": True, "variable":controller.getSelectedTranslationComputeDevice},
"/set/data/selected_translation_compute_device": {"status": True, "variable":controller.setSelectedTranslationComputeDevice},
"/get/data/selectable_transcription_compute_device_list": {"status": True, "variable":controller.getComputeDeviceList},
"/get/data/selected_transcription_compute_device": {"status": True, "variable":controller.getSelectedTranscriptionComputeDevice},
"/set/data/selected_transcription_compute_device": {"status": True, "variable":controller.setSelectedTranscriptionComputeDevice},
# Translation
"/get/data/selectable_ctranslate2_weight_type_dict": {"status": True, "variable":controller.getSelectableCtranslate2WeightTypeDict},
"/get/data/selected_ctranslate2_weight_type": {"status": True, "variable":controller.getCtranslate2WeightType},
"/set/data/selected_ctranslate2_weight_type": {"status": True, "variable":controller.setCtranslate2WeightType},
"/get/data/selected_translation_compute_type": {"status": True, "variable":controller.getSelectedTranslationComputeType},
"/set/data/selected_translation_compute_type": {"status": True, "variable":controller.setSelectedTranslationComputeType},
"/run/download_ctranslate2_weight": {"status": True, "variable":controller.downloadCtranslate2Weight},
"/get/data/deepl_auth_key": {"status": False, "variable":controller.getDeepLAuthKey},
"/set/data/deepl_auth_key": {"status": False, "variable":controller.setDeeplAuthKey},
"/delete/data/deepl_auth_key": {"status": False, "variable":controller.delDeeplAuthKey},
"/get/data/selectable_plamo_model_list": {"status": False, "variable":controller.getPlamoModelList},
"/get/data/selected_plamo_model": {"status": False, "variable":controller.getPlamoModel},
"/set/data/selected_plamo_model": {"status": False, "variable":controller.setPlamoModel},
"/get/data/plamo_auth_key": {"status": False, "variable":controller.getPlamoAuthKey},
"/set/data/plamo_auth_key": {"status": False, "variable":controller.setPlamoAuthKey},
"/delete/data/plamo_auth_key": {"status": False, "variable":controller.delPlamoAuthKey},
"/get/data/selectable_gemini_model_list": {"status": True, "variable":controller.getGeminiModelList},
"/get/data/selected_gemini_model": {"status": True, "variable":controller.getGeminiModel},
"/set/data/selected_gemini_model": {"status": True, "variable":controller.setGeminiModel},
"/get/data/gemini_auth_key": {"status": True, "variable":controller.getGeminiAuthKey},
"/set/data/gemini_auth_key": {"status": True, "variable":controller.setGeminiAuthKey},
"/delete/data/gemini_auth_key": {"status": True, "variable":controller.delGeminiAuthKey},
"/get/data/selectable_openai_model_list": {"status": True, "variable":controller.getOpenAIModelList},
"/get/data/selected_openai_model": {"status": True, "variable":controller.getOpenAIModel},
"/set/data/selected_openai_model": {"status": True, "variable":controller.setOpenAIModel},
"/get/data/openai_auth_key": {"status": True, "variable":controller.getOpenAIAuthKey},
"/set/data/openai_auth_key": {"status": True, "variable":controller.setOpenAIAuthKey},
"/delete/data/openai_auth_key": {"status": True, "variable":controller.delOpenAIAuthKey},
"/get/data/selectable_groq_model_list": {"status": True, "variable":controller.getGroqModelList},
"/get/data/selected_groq_model": {"status": True, "variable":controller.getGroqModel},
"/set/data/selected_groq_model": {"status": True, "variable":controller.setGroqModel},
"/get/data/groq_auth_key": {"status": True, "variable":controller.getGroqAuthKey},
"/set/data/groq_auth_key": {"status": True, "variable":controller.setGroqAuthKey},
"/delete/data/groq_auth_key": {"status": True, "variable":controller.delGroqAuthKey},
"/get/data/selectable_openrouter_model_list": {"status": True, "variable":controller.getOpenRouterModelList},
"/get/data/selected_openrouter_model": {"status": True, "variable":controller.getOpenRouterModel},
"/set/data/selected_openrouter_model": {"status": True, "variable":controller.setOpenRouterModel},
"/get/data/openrouter_auth_key": {"status": True, "variable":controller.getOpenRouterAuthKey},
"/set/data/openrouter_auth_key": {"status": True, "variable":controller.setOpenRouterAuthKey},
"/delete/data/openrouter_auth_key": {"status": True, "variable":controller.delOpenRouterAuthKey},
"/get/data/connected_lmstudio": {"status": True, "variable":controller.getTranslatorLMStudioConnection},
"/run/lmstudio_connection": {"status": True, "variable":controller.checkTranslatorLMStudioConnection},
"/get/data/selectable_lmstudio_model_list": {"status": True, "variable":controller.getTranslatorLStudioModelList},
"/get/data/selected_lmstudio_model": {"status": True, "variable":controller.getTranslatorLMStudioModel},
"/set/data/selected_lmstudio_model": {"status": True, "variable":controller.setTranslatorLMStudioModel},
"/get/data/lmstudio_url": {"status": True, "variable":controller.getTranslatorLMStudioURL},
"/set/data/lmstudio_url": {"status": True, "variable":controller.setTranslatorLMStudioURL},
"/get/data/connected_ollama": {"status": True, "variable":controller.getTranslatorOllamaConnection},
"/run/ollama_connection": {"status": True, "variable":controller.checkTranslatorOllamaConnection},
"/get/data/selectable_ollama_model_list": {"status": True, "variable":controller.getTranslatorOllamaModelList},
"/get/data/selected_ollama_model": {"status": True, "variable":controller.getTranslatorOllamaModel},
"/set/data/selected_ollama_model": {"status": True, "variable":controller.setTranslatorOllamaModel},
# Transliteration
"/get/data/convert_message_to_romaji": {"status": True, "variable":controller.getConvertMessageToRomaji},
"/set/enable/convert_message_to_romaji": {"status": True, "variable":controller.setEnableConvertMessageToRomaji},
"/set/disable/convert_message_to_romaji": {"status": True, "variable":controller.setDisableConvertMessageToRomaji},
"/get/data/convert_message_to_hiragana": {"status": True, "variable":controller.getConvertMessageToHiragana},
"/set/enable/convert_message_to_hiragana": {"status": True, "variable":controller.setEnableConvertMessageToHiragana},
"/set/disable/convert_message_to_hiragana": {"status": True, "variable":controller.setDisableConvertMessageToHiragana},
# Transcription
"/get/data/selectable_mic_host_list": {"status": True, "variable":controller.getMicHostList},
"/get/data/selectable_mic_device_list": {"status": True, "variable":controller.getMicDeviceList},
"/get/data/selectable_speaker_device_list": {"status": True, "variable":controller.getSpeakerDeviceList},
# "/get/data/max_mic_threshold": {"status": True, "variable":controller.getMaxMicThreshold},
# "/get/data/max_speaker_threshold": {"status": True, "variable":controller.getMaxSpeakerThreshold},
"/get/data/auto_mic_select": {"status": True, "variable":controller.getAutoMicSelect},
"/set/enable/auto_mic_select": {"status": True, "variable":controller.setEnableAutoMicSelect},
"/set/disable/auto_mic_select": {"status": True, "variable":controller.setDisableAutoMicSelect},
"/get/data/selected_mic_host": {"status": True, "variable":controller.getSelectedMicHost},
"/set/data/selected_mic_host": {"status": True, "variable":controller.setSelectedMicHost},
"/get/data/selected_mic_device": {"status": True, "variable":controller.getSelectedMicDevice},
"/set/data/selected_mic_device": {"status": True, "variable":controller.setSelectedMicDevice},
"/get/data/mic_threshold": {"status": True, "variable":controller.getMicThreshold},
"/set/data/mic_threshold": {"status": True, "variable":controller.setMicThreshold},
"/get/data/mic_automatic_threshold": {"status": True, "variable":controller.getMicAutomaticThreshold},
"/set/enable/mic_automatic_threshold": {"status": True, "variable":controller.setEnableMicAutomaticThreshold},
"/set/disable/mic_automatic_threshold": {"status": True, "variable":controller.setDisableMicAutomaticThreshold},
"/get/data/mic_record_timeout": {"status": True, "variable":controller.getMicRecordTimeout},
"/set/data/mic_record_timeout": {"status": True, "variable":controller.setMicRecordTimeout},
"/get/data/mic_phrase_timeout": {"status": True, "variable":controller.getMicPhraseTimeout},
"/set/data/mic_phrase_timeout": {"status": True, "variable":controller.setMicPhraseTimeout},
"/get/data/mic_max_phrases": {"status": True, "variable":controller.getMicMaxPhrases},
"/set/data/mic_max_phrases": {"status": True, "variable":controller.setMicMaxPhrases},
"/get/data/hotkeys": {"status": True, "variable":controller.getHotkeys},
"/set/data/hotkeys": {"status": True, "variable":controller.setHotkeys},
"/get/data/plugins_status": {"status": True, "variable":controller.getPluginsStatus},
"/set/data/plugins_status": {"status": True, "variable":controller.setPluginsStatus},
"/get/data/mic_avg_logprob": {"status": True, "variable":controller.getMicAvgLogprob},
"/set/data/mic_avg_logprob": {"status": True, "variable":controller.setMicAvgLogprob},
"/get/data/mic_no_speech_prob": {"status": True, "variable":controller.getMicNoSpeechProb},
"/set/data/mic_no_speech_prob": {"status": True, "variable":controller.setMicNoSpeechProb},
"/set/enable/check_mic_threshold": {"status": True, "variable":controller.setEnableCheckMicThreshold},
"/set/disable/check_mic_threshold": {"status": True, "variable":controller.setDisableCheckMicThreshold},
"/get/data/mic_word_filter": {"status": True, "variable":controller.getMicWordFilter},
"/set/data/mic_word_filter": {"status": True, "variable":controller.setMicWordFilter},
"/get/data/auto_speaker_select": {"status": True, "variable":controller.getAutoSpeakerSelect},
"/set/enable/auto_speaker_select": {"status": True, "variable":controller.setEnableAutoSpeakerSelect},
"/set/disable/auto_speaker_select": {"status": True, "variable":controller.setDisableAutoSpeakerSelect},
"/get/data/selected_speaker_device": {"status": True, "variable":controller.getSelectedSpeakerDevice},
"/set/data/selected_speaker_device": {"status": True, "variable":controller.setSelectedSpeakerDevice},
"/get/data/speaker_threshold": {"status": True, "variable":controller.getSpeakerThreshold},
"/set/data/speaker_threshold": {"status": True, "variable":controller.setSpeakerThreshold},
"/get/data/speaker_automatic_threshold": {"status": True, "variable":controller.getSpeakerAutomaticThreshold},
"/set/enable/speaker_automatic_threshold": {"status": True, "variable":controller.setEnableSpeakerAutomaticThreshold},
"/set/disable/speaker_automatic_threshold": {"status": True, "variable":controller.setDisableSpeakerAutomaticThreshold},
"/get/data/speaker_record_timeout": {"status": True, "variable":controller.getSpeakerRecordTimeout},
"/set/data/speaker_record_timeout": {"status": True, "variable":controller.setSpeakerRecordTimeout},
"/get/data/speaker_phrase_timeout": {"status": True, "variable":controller.getSpeakerPhraseTimeout},
"/set/data/speaker_phrase_timeout": {"status": True, "variable":controller.setSpeakerPhraseTimeout},
"/get/data/speaker_max_phrases": {"status": True, "variable":controller.getSpeakerMaxPhrases},
"/set/data/speaker_max_phrases": {"status": True, "variable":controller.setSpeakerMaxPhrases},
"/get/data/speaker_avg_logprob": {"status": True, "variable":controller.getSpeakerAvgLogprob},
"/set/data/speaker_avg_logprob": {"status": True, "variable":controller.setSpeakerAvgLogprob},
"/get/data/speaker_no_speech_prob": {"status": True, "variable":controller.getSpeakerNoSpeechProb},
"/set/data/speaker_no_speech_prob": {"status": True, "variable":controller.setSpeakerNoSpeechProb},
"/set/enable/check_speaker_threshold": {"status": True, "variable":controller.setEnableCheckSpeakerThreshold},
"/set/disable/check_speaker_threshold": {"status": True, "variable":controller.setDisableCheckSpeakerThreshold},
"/get/data/selectable_whisper_weight_type_dict": {"status": True, "variable":controller.getSelectableWhisperWeightTypeDict},
"/get/data/selected_whisper_weight_type": {"status": True, "variable":controller.getWhisperWeightType},
"/set/data/selected_whisper_weight_type": {"status": True, "variable":controller.setWhisperWeightType},
"/get/data/selected_transcription_compute_type": {"status": True, "variable":controller.getSelectedTranscriptionComputeType},
"/set/data/selected_transcription_compute_type": {"status": True, "variable":controller.setSelectedTranscriptionComputeType},
"/run/download_whisper_weight": {"status": True, "variable":controller.downloadWhisperWeight},
# VR
"/get/data/overlay_small_log": {"status": True, "variable":controller.getOverlaySmallLog},
"/set/enable/overlay_small_log": {"status": True, "variable":controller.setEnableOverlaySmallLog},
"/set/disable/overlay_small_log": {"status": True, "variable":controller.setDisableOverlaySmallLog},
"/get/data/overlay_small_log_settings": {"status": True, "variable":controller.getOverlaySmallLogSettings},
"/set/data/overlay_small_log_settings": {"status": True, "variable":controller.setOverlaySmallLogSettings},
"/get/data/overlay_large_log": {"status": True, "variable":controller.getOverlayLargeLog},
"/set/enable/overlay_large_log": {"status": True, "variable":controller.setEnableOverlayLargeLog},
"/set/disable/overlay_large_log": {"status": True, "variable":controller.setDisableOverlayLargeLog},
"/get/data/overlay_large_log_settings": {"status": True, "variable":controller.getOverlayLargeLogSettings},
"/set/data/overlay_large_log_settings": {"status": True, "variable":controller.setOverlayLargeLogSettings},
"/get/data/overlay_show_only_translated_messages": {"status": True, "variable":controller.getOverlayShowOnlyTranslatedMessages},
"/set/enable/overlay_show_only_translated_messages": {"status": True, "variable":controller.setEnableOverlayShowOnlyTranslatedMessages},
"/set/disable/overlay_show_only_translated_messages": {"status": True, "variable":controller.setDisableOverlayShowOnlyTranslatedMessages},
# Others
"/get/data/send_message_format_parts": {"status": True, "variable":controller.getSendMessageFormatParts},
"/set/data/send_message_format_parts": {"status": True, "variable":controller.setSendMessageFormatParts},
"/get/data/received_message_format_parts": {"status": True, "variable":controller.getReceivedMessageFormatParts},
"/set/data/received_message_format_parts": {"status": True, "variable":controller.setReceivedMessageFormatParts},
"/get/data/auto_clear_message_box": {"status": True, "variable":controller.getAutoClearMessageBox},
"/set/enable/auto_clear_message_box": {"status": True, "variable":controller.setEnableAutoClearMessageBox},
"/set/disable/auto_clear_message_box": {"status": True, "variable":controller.setDisableAutoClearMessageBox},
"/get/data/send_only_translated_messages": {"status": True, "variable":controller.getSendOnlyTranslatedMessages},
"/set/enable/send_only_translated_messages": {"status": True, "variable":controller.setEnableSendOnlyTranslatedMessages},
"/set/disable/send_only_translated_messages": {"status": True, "variable":controller.setDisableSendOnlyTranslatedMessages},
"/get/data/logger_feature": {"status": True, "variable":controller.getLoggerFeature},
"/set/enable/logger_feature": {"status": True, "variable":controller.setEnableLoggerFeature},
"/set/disable/logger_feature": {"status": True, "variable":controller.setDisableLoggerFeature},
"/run/open_filepath_logs": {"status": True, "variable":controller.openFilepathLogs},
"/get/data/vrc_mic_mute_sync": {"status": True, "variable":controller.getVrcMicMuteSync},
"/set/enable/vrc_mic_mute_sync": {"status": True, "variable":controller.setEnableVrcMicMuteSync},
"/set/disable/vrc_mic_mute_sync": {"status": True, "variable":controller.setDisableVrcMicMuteSync},
"/get/data/send_message_to_vrc": {"status": True, "variable":controller.getSendMessageToVrc},
"/set/enable/send_message_to_vrc": {"status": True, "variable":controller.setEnableSendMessageToVrc},
"/set/disable/send_message_to_vrc": {"status": True, "variable":controller.setDisableSendMessageToVrc},
"/get/data/send_received_message_to_vrc": {"status": True, "variable":controller.getSendReceivedMessageToVrc},
"/set/enable/send_received_message_to_vrc": {"status": True, "variable":controller.setEnableSendReceivedMessageToVrc},
"/set/disable/send_received_message_to_vrc": {"status": True, "variable":controller.setDisableSendReceivedMessageToVrc},
# WebSocket Settings
"/get/data/websocket_host": {"status": True, "variable":controller.getWebSocketHost},
"/set/data/websocket_host": {"status": True, "variable":controller.setWebSocketHost},
"/get/data/websocket_port": {"status": True, "variable":controller.getWebSocketPort},
"/set/data/websocket_port": {"status": True, "variable":controller.setWebSocketPort},
"/get/data/websocket_server": {"status": True, "variable":controller.getWebSocketServer},
"/set/enable/websocket_server": {"status": True, "variable":controller.setEnableWebSocketServer},
"/set/disable/websocket_server": {"status": True, "variable":controller.setDisableWebSocketServer},
# Clipboard Settings
"/get/data/clipboard": {"status": True, "variable":controller.getClipboard},
"/set/enable/clipboard": {"status": True, "variable":controller.setEnableClipboard},
"/set/disable/clipboard": {"status": True, "variable":controller.setDisableClipboard},
# Advanced Settings
"/get/data/osc_ip_address": {"status": True, "variable":controller.getOscIpAddress},
"/set/data/osc_ip_address": {"status": True, "variable":controller.setOscIpAddress},
"/get/data/osc_port": {"status": True, "variable":controller.getOscPort},
"/set/data/osc_port": {"status": True, "variable":controller.setOscPort},
"/get/data/notification_vrc_sfx": {"status": True, "variable":controller.getNotificationVrcSfx},
"/set/enable/notification_vrc_sfx": {"status": True, "variable":controller.setEnableNotificationVrcSfx},
"/set/disable/notification_vrc_sfx": {"status": True, "variable":controller.setDisableNotificationVrcSfx},
"/run/open_filepath_config_file": {"status": True, "variable":controller.openFilepathConfigFile},
# "/run/start_watchdog": {"status": True, "variable":controller.startWatchdog},
"/run/feed_watchdog": {"status": True, "variable":controller.feedWatchdog},
# "/run/stop_watchdog": {"status": True, "variable":controller.stopWatchdog},
}
init_mapping = {key:value for key, value in mapping.items() if key.startswith("/get/data/")}
controller.setInitMapping(init_mapping)
DEFAULT_WORKER_COUNT = 3 # 必要なら増やす
class Main:
def __init__(self, controller_instance: Controller, mapping_data: dict, worker_count: int = DEFAULT_WORKER_COUNT) -> None:
self.queue: Queue[Tuple[str, Any]] = Queue()
self._stop_event: Event = Event()
self.controller = controller_instance
self.mapping = mapping_data
self._threads: list[Thread] = []
self._worker_count = worker_count
# エンドポイントごとの排他制御用 Lock を作成
# enable/disable ペアは同じロックキーに正規化する
def _canonical_lock_key(endpoint: str) -> str:
if not isinstance(endpoint, str):
return str(endpoint)
if endpoint.startswith("/set/enable/"):
return "/lock/set/" + endpoint[len("/set/enable/"):]
if endpoint.startswith("/set/disable/"):
return "/lock/set/" + endpoint[len("/set/disable/"):]
return endpoint
# mapping に含まれるすべてのエンドポイントを走査して正規化キー集合を作る
lock_keys = set()
for key in self.mapping.keys():
lock_keys.add(_canonical_lock_key(key))
# 正規化キーごとに Lock を割り当てる
self._endpoint_locks: dict[str, Lock] = {k: Lock() for k in lock_keys}
# 正規化関数をインスタンスに保存
self._canonical_lock_key = _canonical_lock_key
def receiver(self) -> None:
"""Read lines from stdin, parse JSON and enqueue requests.
Uses blocking readline but honors stop via _stop_event checked between reads.
"""
while not self._stop_event.is_set():
try:
line = sys.stdin.readline()
if not line:
# EOF reached; sleep briefly and re-check stop event
time.sleep(0.1)
continue
received_data = json.loads(line.strip())
if received_data:
endpoint = received_data.get("endpoint")
data = received_data.get("data")
data = encodeBase64(data) if data is not None else None
printLog(endpoint, {"receive_data": data})
self.queue.put((endpoint, data))
except json.JSONDecodeError:
# malformed input; log and continue
errorLogging()
except Exception:
errorLogging()
def startReceiver(self) -> None:
th_receiver = Thread(target=self.receiver, name="main_receiver")
th_receiver.daemon = True
th_receiver.start()
self._threads.append(th_receiver)
def handleRequest(self, endpoint: str, data: Any = None) -> tuple:
result = None # デフォルト値を設定
status = 500 # デフォルト値を設定
handler = self.mapping.get(endpoint)
if handler is None:
response = "Invalid endpoint"
status = 404
elif handler["status"] is False:
response = "Locked endpoint"
status = 423
else:
try:
response = handler["variable"](data)
status = response.get("status")
result = response.get("result")
time.sleep(0.2) # 処理の安定化のために少し待機
except Exception:
errorLogging()
result = "Internal error"
status = 500
return result, status
def _call_handler(self, endpoint: str, data: Any = None) -> tuple:
result = None
status = 500
handler = self.mapping.get(endpoint)
if handler is None:
response = "Invalid endpoint"
status = 404
else:
try:
response = handler["variable"](data)
status = response.get("status", 500)
result = response.get("result", None)
time.sleep(0.2)
except Exception:
errorLogging()
result = "Internal error"
status = 500
return result, status
def handler(self) -> None:
while not self._stop_event.is_set():
try:
endpoint, data = self.queue.get(timeout=0.5)
except Empty:
continue
# endpoint をロック用の正規化キーに変換してロックを取得
lock_key = self._canonical_lock_key(endpoint)
lock = self._endpoint_locks.get(lock_key)
if lock is not None:
acquired = lock.acquire(blocking=False)
if not acquired:
# 同一機能で既に処理中 -> 少し待って再キュー
time.sleep(0.05)
self.queue.put((endpoint, data))
continue
try:
result, status = self._call_handler(endpoint, data)
finally:
lock.release()
else:
result, status = self._call_handler(endpoint, data)
if status == 423:
time.sleep(0.1)
self.queue.put((endpoint, data))
else:
printLog(endpoint, {"status": status, "send_data": result})
printResponse(status, endpoint, result)
def startHandler(self) -> None:
for i in range(max(1, self._worker_count)):
th_handler = Thread(target=self.handler, name=f"main_handler_{i}")
th_handler.daemon = True
th_handler.start()
self._threads.append(th_handler)
def start(self) -> None:
"""Start the main loop to keep the program running."""
try:
while not self._stop_event.is_set():
time.sleep(1)
except KeyboardInterrupt:
self.stop()
def stop(self, wait: float = 2.0) -> None:
"""Signal threads to stop and wait for them to finish.
Args:
wait: maximum seconds to wait for threads to join.
"""
# Controller 経由でシャットダウン(model.shutdown() → telemetry.shutdown() が呼ばれる)
try:
self.controller.shutdown()
except Exception:
errorLogging()
self._stop_event.set()
# give threads a chance to exit
start = time.time()
for th in self._threads:
remaining = max(0.0, wait - (time.time() - start))
th.join(timeout=remaining)
# 外部から参照可能なインスタンスを提供
main_instance = Main(controller_instance=controller, mapping_data=mapping)
if __name__ == "__main__":
main_instance.startReceiver()
main_instance.startHandler()
main_instance.controller.setWatchdogCallback(main_instance.stop)
main_instance.controller.init()
# mappingのすべてのstatusをTrueにする
for key in mapping.keys():
mapping[key]["status"] = True
main_instance.start()
+1334
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
"""models package init for static analysis and packaging."""
__all__ = [
# subpackages are discovered implicitly
]
+240
View File
@@ -0,0 +1,240 @@
import sys
import time
import os
import threading
from subprocess import Popen, PIPE
from psutil import process_iter
import openvr
try:
from utils import printLog
except ImportError:
def printLog(data, *args, **kwargs):
print(data, *args, **kwargs)
def checkSteamvrRunning() -> bool:
_proc_name = "vrmonitor.exe" if os.name == "nt" else "vrmonitor"
return _proc_name in (p.name() for p in process_iter())
# Windows-specific imports via ctypes will be used when focusing windows
if sys.platform == 'win32':
import ctypes
import ctypes.wintypes as wintypes
user32 = ctypes.WinDLL('user32', use_last_error=True)
def find_windows_by_title_substring(substring: str):
HWND = wintypes.HWND
callback_type = ctypes.WINFUNCTYPE(wintypes.BOOL, HWND, wintypes.LPARAM)
found = []
def _cb(hwnd, lParam):
length = user32.GetWindowTextLengthW(hwnd)
if length == 0:
return True
buf = ctypes.create_unicode_buffer(length + 1)
# fill buffer with window title
user32.GetWindowTextW(hwnd, buf, length + 1)
title = buf.value
if substring.lower() in title.lower():
found.append(hwnd)
return True
user32.EnumWindows(callback_type(_cb), 0)
return found
def find_windows_by_process_name(proc_name: str):
# iterate windows and match process id to name
HWND = wintypes.HWND
callback_type = ctypes.WINFUNCTYPE(wintypes.BOOL, HWND, wintypes.LPARAM)
found = []
def _cb(hwnd, lParam):
pid = wintypes.DWORD()
user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
try:
import psutil
except Exception:
return True
try:
p = psutil.Process(pid.value)
if p.name().lower() == proc_name.lower():
found.append(hwnd)
except Exception:
pass
return True
user32.EnumWindows(callback_type(_cb), 0)
return found
def focus_window(hwnd) -> bool:
try:
# Restore and set foreground
SW_RESTORE = 9
user32.ShowWindow(hwnd, SW_RESTORE)
res = user32.SetForegroundWindow(hwnd)
return bool(res)
except Exception:
return False
def copy_to_clipboard_windows(text: str) -> bool:
try:
p = Popen(['clip'], stdin=PIPE, shell=False)
# Write as UTF-16LE with BOM so Windows clipboard receives correct Unicode
bom_utf16le = b"\xff\xfe"
p.communicate(bom_utf16le + text.encode('utf-16le'))
return True
except Exception:
return False
def copy_to_clipboard_pyperclip(text: str) -> bool:
try:
import pyperclip
pyperclip.copy(text)
return True
except Exception:
return False
def copy_to_clipboard_tk(text: str) -> bool:
try:
import tkinter as tk
r = tk.Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append(text)
r.update()
r.destroy()
return True
except Exception:
return False
def copy_to_clipboard(text: str) -> bool:
if sys.platform == 'win32':
if copy_to_clipboard_windows(text):
return True
if copy_to_clipboard_pyperclip(text):
return True
if copy_to_clipboard_tk(text):
return True
return False
def paste_via_pyautogui(countdown: int = 0) -> bool:
try:
import pyautogui
except Exception:
printLog('pyautogui not installed. Install with: pip install pyautogui')
return False
for i in range(countdown, 0, -1):
print(i, end=' ', flush=True)
time.sleep(1)
try:
# pyautogui.hotkey is a safe cross-platform way to send keys
pyautogui.hotkey('ctrl', 'v')
return True
except Exception as e:
printLog(f'pyautogui failed to send hotkey: {e}')
return False
class Clipboard:
def __init__(self):
self._vr_monitor_thread = None
self._stop_monitoring = False
self.app_name = None
self._initialize()
def _initialize(self):
"""Initialize clipboard by starting VR monitor thread."""
self._stop_monitoring = False
self._vr_monitor_thread = threading.Thread(target=self._monitor_steamvr, daemon=True)
self._vr_monitor_thread.start()
self.app_name = None
printLog("Clipboard initialized. Waiting for SteamVR.")
def _monitor_steamvr(self):
"""Monitor SteamVR startup in background thread."""
printLog("Clipboard: VR monitor thread started.")
while not self._stop_monitoring:
if checkSteamvrRunning():
printLog("Clipboard: SteamVR detected. Setting up app info.")
self._setup_vr_app_name()
break
time.sleep(10)
printLog("Clipboard: VR monitor thread ended.")
def _setup_vr_app_name(self):
"""Setup VR application name from OpenVR."""
try:
openvr.init(openvr.VRApplication_Background)
apps = openvr.VRApplications()
app_count = apps.getApplicationCount()
running_apps = []
for i in range(app_count):
key = apps.getApplicationKeyByIndex(i)
name = apps.getApplicationPropertyString(
key,
openvr.VRApplicationProperty_Name_String
)
running_apps.append((key, name))
self.app_name = None
for key, name in running_apps:
if key.startswith("steam.app"):
self.app_name = name
break
openvr.shutdown()
except Exception as e:
printLog(f"Clipboard: Error setting up VR app name: {e}")
self.app_name = None
def copy_and_paste(self, message: str, window_name: str|None = None, countdown: int = 0) -> bool:
window_name = window_name if window_name is not None else self.app_name
# If window_name is provided, attempt to focus it (Windows only).
# If window_name is None, skip focusing and paste into the currently focused window.
if window_name is not None and sys.platform == 'win32':
printLog(f"paste: attempting to focus window matching '{window_name}'")
focused = False
# try title substring match first
wins = find_windows_by_title_substring(window_name)
printLog(f"paste: found {wins} windows matching title substring '{window_name}'")
for hwnd in wins:
if focus_window(hwnd):
focused = True
break
# if not found by title, try treating window_name as process name
if not focused:
wins = find_windows_by_process_name(window_name)
printLog(f"paste: found {wins} windows matching process name '{window_name}'")
for hwnd in wins:
if focus_window(hwnd):
focused = True
break
if not focused:
printLog(f"copy_and_paste: no window found matching '{window_name}'")
return False
# small delay to allow focus to settle
time.sleep(0.2)
# copy
copied = copy_to_clipboard(message)
if not copied:
printLog("copy_and_paste: failed to copy to clipboard")
return False
# paste
pasted = paste_via_pyautogui(countdown)
return bool(pasted)
else:
return False
if __name__ == '__main__':
clipboard = Clipboard()
clipboard.copy_and_paste("Sample text to copy to clipboard.", window_name=None, countdown=3)
+241
View File
@@ -0,0 +1,241 @@
"""OSC helpers and a thin OSCQuery-enabled server wrapper.
This module provides `OSCHandler`, a convenience wrapper used by the
application to send OSC messages and expose OSCQuery endpoints when the
target address is localhost. The implementation is defensive: missing
utilities are handled gracefully and logging helpers are used where
available.
"""
import time
from typing import Any, Callable, Dict, Optional
from time import sleep
from threading import Thread
from pythonosc import udp_client, dispatcher, osc_server
try:
from tinyoscquery.queryservice import OSCQueryService
from tinyoscquery.query import OSCQueryBrowser, OSCQueryClient
from tinyoscquery.utility import get_open_udp_port, get_open_tcp_port
from tinyoscquery.shared.node import OSCAccess
except Exception:
# tinyoscquery is optional for non-local usage; functionality that
# depends on it will be disabled if it's missing.
OSCQueryService = None # type: ignore
OSCQueryBrowser = None # type: ignore
OSCQueryClient = None # type: ignore
def get_open_udp_port() -> int: # type: ignore
return 0
def get_open_tcp_port() -> int: # type: ignore
return 0
OSCAccess = None # type: ignore
try:
from utils import errorLogging
except Exception:
def errorLogging() -> None:
import traceback
print("Error occurred:", traceback.format_exc())
class OSCHandler:
"""Thin wrapper managing OSC send/receive and optional OSCQuery advertising.
Args:
ip_address: OSC server client target / bind address
port: UDP port to send to
"""
def __init__(self, ip_address: str = "127.0.0.1", port: int = 9000) -> None:
self.is_osc_query_enabled: bool = ip_address in ["127.0.0.1", "localhost"]
self.osc_ip_address: str = ip_address
self.osc_port: int = port
self.osc_parameter_muteself: str = "/avatar/parameters/MuteSelf"
self.osc_parameter_chatbox_typing: str = "/chatbox/typing"
self.osc_parameter_chatbox_input: str = "/chatbox/input"
self.udp_client = udp_client.SimpleUDPClient(self.osc_ip_address, self.osc_port)
self.osc_server_name: str = "VRChat-Client"
self.osc_server = None
self.osc_query_service = None
self.osc_query_service_name: str = "VRCT"
self.osc_server_ip_address: str = ip_address
self.http_port: Optional[int] = None
self.osc_server_port: Optional[int] = None
self.dict_filter_and_target: Dict[str, Callable] = {}
self.browser = None
def getIsOscQueryEnabled(self) -> bool:
"""Return whether OSCQuery support is enabled (local addresses only)."""
return self.is_osc_query_enabled
def setOscIpAddress(self, ip_address: str) -> None:
"""Change the OSC target IP address and reinitialize services."""
self.is_osc_query_enabled = ip_address in ["127.0.0.1", "localhost"]
self.oscServerStop()
self.osc_ip_address = ip_address
self.udp_client = udp_client.SimpleUDPClient(self.osc_ip_address, self.osc_port)
self.receiveOscParameters()
def setOscPort(self, port: int) -> None:
"""Change the OSC UDP port used for sending and reinitialize services."""
self.oscServerStop()
self.osc_port = port
self.udp_client = udp_client.SimpleUDPClient(self.osc_ip_address, self.osc_port)
self.receiveOscParameters()
# send OSC message typing
def sendTyping(self, flag: bool = False) -> None:
"""Send /chatbox/typing with a boolean flag."""
self.udp_client.send_message(self.osc_parameter_chatbox_typing, [flag])
# send OSC message
def sendMessage(self, message: str = "", notification: bool = True) -> None:
"""Send /chatbox/input if message is non-empty.
The second argument historically was a boolean flag for clearing; we keep
compatibility by sending [message, True, notification].
"""
if len(message) > 0:
self.udp_client.send_message(self.osc_parameter_chatbox_input, [f"{message}", True, notification])
def getOSCParameterValue(self, address: str) -> Any:
if not self.is_osc_query_enabled:
# OSCQueryが無効な場合はNoneを返す
return None
value: Any = None
try:
# browserインスタンスを再利用し、毎回の生成と破棄を避ける
if self.browser is None:
# OSCQueryBrowser may not be available; guard
if OSCQueryBrowser is None:
return None
self.browser = OSCQueryBrowser()
sleep(1) # 初回のみスリープ
service = self.browser.find_service_by_name(self.osc_server_name)
if service is not None:
osc_query_client = OSCQueryClient(service)
mute_self_node = osc_query_client.query_node(address)
# mute_self_node may be None when the node is not present on the
# remote OSCQuery service. Also mute_self_node.value may be None
# or an empty list. Guard against those cases to avoid
# AttributeError: 'NoneType' object has no attribute 'value'
if mute_self_node is None:
return None
# prefer explicit checks rather than relying on exceptions
node_value = getattr(mute_self_node, 'value', None)
if not node_value:
return None
value = node_value[0]
except Exception:
errorLogging()
# エラー発生時にbrowserをリセットして次回再初期化
if self.browser is not None:
try:
if hasattr(self.browser, 'zc') and self.browser.zc is not None:
self.browser.zc.close()
if hasattr(self.browser, 'browser') and self.browser.browser is not None:
self.browser.browser.cancel()
except Exception:
pass
self.browser = None
return value
def getOSCParameterMuteSelf(self) -> Optional[bool]:
"""Return the value of the MuteSelf parameter when available, else None."""
return self.getOSCParameterValue(self.osc_parameter_muteself)
def setDictFilterAndTarget(self, dict_filter_and_target: Dict[str, Callable]) -> None:
"""Set the mapping from OSC address filters to handler callables."""
self.dict_filter_and_target = dict_filter_and_target
def receiveOscParameters(self) -> None:
"""Start a local OSC server and advertise OSCQuery endpoints when supported.
If `tinyoscquery` is not available or OSCQuery is disabled, this is a
no-op.
"""
if not self.is_osc_query_enabled or OSCQueryService is None:
# OSCQuery が無効またはライブラリが無い場合は何もしない
return
self.osc_server_port = get_open_udp_port()
self.http_port = get_open_tcp_port()
osc_dispatcher = dispatcher.Dispatcher()
for filter, target in self.dict_filter_and_target.items():
osc_dispatcher.map(filter, target)
self.osc_server = osc_server.ThreadingOSCUDPServer((self.osc_server_ip_address, self.osc_server_port), osc_dispatcher)
Thread(target=self.oscServerServe, daemon=True).start()
while True:
try:
# osc_server_name + UTC timestamp でユニークなサービス名を生成
service_name = f"{self.osc_query_service_name}:{int(time.time())}"
self.osc_query_service = OSCQueryService(service_name, self.http_port, self.osc_server_port)
for filter, target in self.dict_filter_and_target.items():
# OSCAccess may be None when tinyoscquery is not present; guard
if OSCAccess is not None:
self.osc_query_service.advertise_endpoint(filter, access=OSCAccess.READWRITE_VALUE)
break
except Exception:
errorLogging()
sleep(1)
def oscServerServe(self) -> None:
"""Run the OSC server loop with a longer poll interval to reduce CPU."""
# ポーリング間隔を長くして(2秒から10秒に)CPUの使用率を削減
if self.osc_server is not None:
self.osc_server.serve_forever(10)
def oscServerStop(self) -> None:
"""Stop and clean up any running OSC server and OSCQuery service."""
if isinstance(self.osc_server, osc_server.ThreadingOSCUDPServer):
try:
self.osc_server.shutdown()
except Exception:
pass
self.osc_server = None
if OSCQueryService is not None and isinstance(self.osc_query_service, OSCQueryService):
try:
self.osc_query_service.http_server.shutdown()
except Exception:
pass
self.osc_query_service = None
# browser がある場合はクリーンアップ
if self.browser is not None:
try:
if hasattr(self.browser, 'zc') and self.browser.zc is not None:
self.browser.zc.close()
if hasattr(self.browser, 'browser') and self.browser.browser is not None:
self.browser.browser.cancel()
except Exception:
pass
self.browser = None
if __name__ == "__main__":
handler = OSCHandler()
handler.setDictFilterAndTarget({
"/avatar/parameters/MuteSelf": lambda address, *args: print(f"Received {address} with args {args}"),
"/chatbox/typing": lambda address, *args: print(f"Received {address} with args {args}"),
"/chatbox/input": lambda address, *args: print(f"Received {address} with args {args}"),
})
handler.receiveOscParameters()
sleep(5)
handler.sendTyping(True)
sleep(1)
handler.sendMessage(message="Hello World 1", notification=True)
sleep(10)
print("IP address changed to 192.168.193.2")
handler.setOscIpAddress("192.168.193.2")
sleep(5)
handler.sendMessage(message="Hello World 2", notification=True)
print("IP address changed to 127.0.0.1")
handler.setOscIpAddress("127.0.0.1")
sleep(5)
handler.sendMessage(message="Hello World 3", notification=True)
sleep(10)
handler.oscServerStop()
+5
View File
@@ -0,0 +1,5 @@
"""models.overlay package init for static analysis."""
from . import overlay_utils # re-export helper for ease-of-use in tooling
__all__ = ["overlay_utils"]
Loaded 100 of 551 files, more files were not shown because too many files have changed in this diff. Show more