mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(ui): render the Radio directory tuner from a store
RadioTuner renders the band label, readouts, slider and needle from the Radio store. RadioControls keeps the drag and its slot and publishes what the tuner shows; the component lays out the tick tape against the dial's measured width, drawing no ticks before it has one, and lays out the snapped needle before it drops the drag class so the needle does not animate from where the drag let go.
This commit is contained in:
1 parent
b6d565a83f
commit
1072df325e
17 files changed
+595
-159
No files matched your search
+22
-5
@@ -4,10 +4,10 @@ import { markRaw, shallowRef } from 'vue';
|
||||
/**
|
||||
* The Radio panel as its view renders it. RadioControls presents the
|
||||
* directory row, station card, transport, volume and playback line and the
|
||||
* Cockpit's compact radio controls (`renderRadioState()`), and which Cockpit
|
||||
* utility popover is open, and publishes them here; it keeps its listeners
|
||||
* and the tuner. LocalSdrControls publishes the local RTL-SDR card beside
|
||||
* it.
|
||||
* Cockpit's compact radio controls (`renderRadioState()`), which Cockpit
|
||||
* utility popover is open, and the directory tuner, and publishes them here;
|
||||
* it keeps its listeners. LocalSdrControls publishes the local RTL-SDR card
|
||||
* beside it.
|
||||
*/
|
||||
export const useRadioStore = defineStore('gev-radio', () => {
|
||||
/** The presented panel; null until the controls first render. */
|
||||
@@ -34,5 +34,22 @@ export const useRadioStore = defineStore('gev-radio', () => {
|
||||
utility.value = markRaw(next);
|
||||
}
|
||||
|
||||
return { view, publish, sdr, publishSdr, utility, publishUtility };
|
||||
/** The directory tuner; null until the controls first present it. */
|
||||
const tuner = shallowRef(null);
|
||||
|
||||
/** @param {object} next A fresh presentation of the tuner. */
|
||||
function publishTuner(next) {
|
||||
tuner.value = markRaw(next);
|
||||
}
|
||||
|
||||
return {
|
||||
view,
|
||||
publish,
|
||||
sdr,
|
||||
publishSdr,
|
||||
utility,
|
||||
publishUtility,
|
||||
tuner,
|
||||
publishTuner,
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user