Unify CClient/CServer as a single orchestration layer behind UI and JSON-RPC
メンテナーはふだん 5 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- c
- 領域
- api, backend-api-design, desktop
調査の方向性
まず、カレントディレクトリの例を中心に CConnectDlg と CClientRpc を追跡し、次に CClient、CServer、CClientSettings、CServerSettings が現在どのように状態を所有または公開しているかを確認します。既存の機能を動作させたまま、状態またはアクションを1つずつ段階的に移行します。完了条件は、UI と JSON-RPC が同じオーケストレーション層を利用し、同等性が保たれ、所有ロジックが重複していないことです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Currently, Client and Server capabilities and states are scattered across UI and other classes rather than "owned" centrally.
This issue proposes refactoring so that CClient and CServer become the single source of truth for all state and actions, with both the Qt UI and the JSON-RPC interface acting as symmetric, parity consumers of that layer - nothing more.
(This came out of discussion on #3660 - and prior discussions - where a small RPC addition (getCurrentDirectory/getDirectories) surfaced duplicated logic between CConnectDlg and CClientRpc that should really live in one place.)
Goals
- Clear separation of concerns between orchestration logic and presentation/control interfaces.
CClientandCServeras the orchestration core - the single arbiter of all Client/Server capabilities, state, and actions.- Full parity between UI and JSON-RPC. Anything the UI can do, JSON-RPC can do, and vice versa. No interface-specific logic duplicated across them. This should be sufficient, for example, to let someone write a local JSON-RPC + React (or any other) frontend that fully replaces the Qt UI.
CSettings/CClientSettings / CServerSettingsencapsulated behindCClientandCServer, rather than read or mutated directly by UI or RPC code.
Proposed pattern
Using "current directory" as a worked example:
CClientowns the state (e.g. current directory index) and exposes it via a canonical accessor.- UI components (e.g.
CConnectDlg) emit a signal on user interaction (e.g. "selection changed"). CClienthandles the signal and updatesCClientSettings.CClientSettingsemits its own change signal.- Both the UI and
CClientRpclisten and react independently — UI updates its display, RPC pushes new state to subscribers.
Neither the UI nor RPC owns logic the other doesn't have equal access to; both sit on top of the same CClient-owned state and signals.
Scope of JSON-RPC control
There is no remaining debate on how much should be controllable via JSON-RPC: full parity with the UI is the goal, including actions that affect other clients on a server (e.g. join/leave, mute). Restricting RPC to read-only, or to a subset of UI actions, would defeat the purpose — it would prevent RPC or other future mechanisms from being a viable full replacement for the UI.
Scope of exposure (local control)
Jamulus should continue to expose JSON-RPC only to the host machine itself. However, what the operator of that machine chooses to do with that local API - including running their own server-side bridge to expose a remote UI - is entirely outside Jamulus's domain and not something Jamulus needs to secure against. Jamulus's responsibility ends at the local socket; anything built on top (e.g. a remotely-accessible UI) is the hosting user's own responsibility.
Non-goals / explicitly out of scope for this issue
- Ripping out CLI parsing and Settings persistence on the Server side (raised as a related but separate, larger job).
- The longer-term "Jamulus as a DAW plugin" direction (bridges to Reaper/Audacity, etc.) — interesting, but a much bigger and more speculative rewrite than this issue is scoped for.
Whilst out of scope, it's hoped that the change in architecture will help towards both.
Why now
This is a foundational refactor that unblocks a class of feature requests (e.g. setCurrentDirectory, directory management setters) that keep surfacing in feature PRs and forcing the same "should this be centralized" conversation each time. Doing it once, centrally, avoids repeating this discussion piecemeal across future PRs.
Suggested approach
Incremental, in parallel with existing functionality — migrate one area of state/action at a time (starting with connection/directory handling, per the example above) into CClient/CServer ownership, with the existing UI and RPC code updated to consume it, rather than a big-bang rewrite. Keep the current implementation working throughout.
- 主要言語
- C
- スター
- 1.1k
- フォーク
- 248
- 平均マージ
- 7日 14時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jamulussoftware/jamulus のほかの issue
-
Move translation checker (and potentially other runners) to ARM runner対応中かも @ann0see が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jamulussoftware/jamulus#3953 · コメント 2 件 ·
メンテナーはふだん 5 日以内に返信
-
Reused channel slot records the previous occupant's audio対応中かも @mcfnord が 4 日前に担当しました。 オープンAI bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jamulussoftware/jamulus#3901 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 5 日以内に返信
-
AI
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jamulussoftware/jamulus#3846 ·
メンテナーはふだん 5 日以内に返信
-
feature request
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jamulussoftware/jamulus#3964 · コメント 3 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
jamulussoftware/jamulus#3961 ·
メンテナーはふだん 5 日以内に返信
jamulussoftware/jamulus の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
luainkernel/lunatik#1853 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
resetes12/pokeemerald#204 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 6 日以内に返信