fix: preset renaming
This commit is contained in:
@@ -164,7 +164,7 @@ pub async fn recall_preset(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x21`
|
||||
// Command `0x21` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn store_current_configuration(
|
||||
state: State<'_, AppState>,
|
||||
@@ -180,7 +180,7 @@ pub async fn store_current_configuration(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x23`
|
||||
// Command `0x23` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn factory_reset(
|
||||
state: State<'_, AppState>,
|
||||
@@ -207,7 +207,7 @@ pub async fn set_current_preset_name(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x2A`
|
||||
// Command `0x2A` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn copy_channel(
|
||||
state: State<'_, AppState>,
|
||||
@@ -223,8 +223,8 @@ pub async fn copy_channel(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x2D`
|
||||
// Command `0x2F`
|
||||
// Command `0x2D` -- TODO
|
||||
// Command `0x2F` -- TODO
|
||||
|
||||
// Command `0x30`
|
||||
#[tauri::command]
|
||||
@@ -372,7 +372,7 @@ pub async fn set_delay(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x39`
|
||||
// Command `0x39` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn set_input_source(
|
||||
state: State<'_, AppState>,
|
||||
@@ -403,7 +403,7 @@ pub async fn set_matrix_routing(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x3B`
|
||||
// Command `0x3B` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn link_channels(
|
||||
state: State<'_, AppState>,
|
||||
@@ -435,7 +435,7 @@ pub async fn set_bypass_peq(
|
||||
})
|
||||
}
|
||||
|
||||
// Command `0x3D`
|
||||
// Command `0x3D` -- TODO
|
||||
#[tauri::command]
|
||||
pub async fn set_channel_name(
|
||||
state: State<'_, AppState>,
|
||||
|
||||
@@ -46,8 +46,8 @@ function AppCombobox({
|
||||
appOptions: SidebarAppOption[];
|
||||
selectedAppId?: string;
|
||||
appName: string;
|
||||
onAppChange?: (id: string) => void;
|
||||
onAppRename?: (name: string) => void;
|
||||
onAppChange: (id: string) => void;
|
||||
onAppRename: (name: string) => void;
|
||||
}) {
|
||||
const currentOption = appOptions.find((o) => o.id === selectedAppId) ?? appOptions[0];
|
||||
const canRename = currentOption?.id !== 'f00';
|
||||
@@ -95,6 +95,7 @@ function AppCombobox({
|
||||
|
||||
if (!canRename) return;
|
||||
|
||||
setInputValue((currentOption?.name ?? appName).trim());
|
||||
setEditing(true);
|
||||
setOpen(false);
|
||||
|
||||
@@ -124,13 +125,13 @@ function AppCombobox({
|
||||
|
||||
if (matched) {
|
||||
if (matched.id !== selectedAppId) {
|
||||
onAppChange?.(matched.id);
|
||||
onAppChange(matched.id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (trimmed !== currentOption?.name) {
|
||||
onAppRename?.(trimmed);
|
||||
onAppRename(trimmed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +187,7 @@ function AppCombobox({
|
||||
onKeyDown={handleKeyDown}
|
||||
aria-haspopup="listbox"
|
||||
aria-expanded={open}
|
||||
title={canRename ? 'Double click to rename' : undefined}
|
||||
>
|
||||
<span className="sidebar-app-trigger-label">{currentOption?.name ?? appName}</span>
|
||||
<svg className="sidebar-app-trigger-caret" viewBox="0 0 24 24" width="14" height="14">
|
||||
@@ -209,7 +211,8 @@ function AppCombobox({
|
||||
onMouseEnter={() => setHighlight(i)}
|
||||
onClick={() => pick(opt)}
|
||||
>
|
||||
{opt.name}
|
||||
<span className="sidebar-app-option-id">{opt.id + '-'}</span>
|
||||
<span>{opt.name}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -236,8 +239,8 @@ export function Sidebar<T extends string>({
|
||||
appName: string;
|
||||
appOptions?: SidebarAppOption[];
|
||||
selectedAppId?: string;
|
||||
onAppChange?: (id: string) => void;
|
||||
onAppRename?: (name: string) => void;
|
||||
onAppChange: (id: string) => void;
|
||||
onAppRename: (name: string) => void;
|
||||
expanded: boolean;
|
||||
onToggle: () => void;
|
||||
}) {
|
||||
|
||||
@@ -151,7 +151,7 @@ function DSP408Panel({ dsp, api }: { dsp: DSP408; api: DSP408Api }) {
|
||||
return (
|
||||
<ChannelSection
|
||||
dsp={dsp}
|
||||
channel={{Input: InputChannel.InA}}
|
||||
channel={{ Input: InputChannel.InA }}
|
||||
setLowPass={api.setLowPass}
|
||||
setHighPass={api.setHighPass}
|
||||
setPeq={api.setPeqBand}
|
||||
@@ -163,7 +163,7 @@ function DSP408Panel({ dsp, api }: { dsp: DSP408; api: DSP408Api }) {
|
||||
return (
|
||||
<ChannelSection
|
||||
dsp={dsp}
|
||||
channel={{Input: InputChannel.InB}}
|
||||
channel={{ Input: InputChannel.InB }}
|
||||
setLowPass={api.setLowPass}
|
||||
setHighPass={api.setHighPass}
|
||||
setPeq={api.setPeqBand}
|
||||
@@ -175,7 +175,7 @@ function DSP408Panel({ dsp, api }: { dsp: DSP408; api: DSP408Api }) {
|
||||
return (
|
||||
<ChannelSection
|
||||
dsp={dsp}
|
||||
channel={{Input: InputChannel.InC}}
|
||||
channel={{ Input: InputChannel.InC }}
|
||||
setLowPass={api.setLowPass}
|
||||
setHighPass={api.setHighPass}
|
||||
setPeq={api.setPeqBand}
|
||||
@@ -187,7 +187,7 @@ function DSP408Panel({ dsp, api }: { dsp: DSP408; api: DSP408Api }) {
|
||||
return (
|
||||
<ChannelSection
|
||||
dsp={dsp}
|
||||
channel={{Input: InputChannel.InD}}
|
||||
channel={{ Input: InputChannel.InD }}
|
||||
setLowPass={api.setLowPass}
|
||||
setHighPass={api.setHighPass}
|
||||
setPeq={api.setPeqBand}
|
||||
@@ -199,7 +199,7 @@ function DSP408Panel({ dsp, api }: { dsp: DSP408; api: DSP408Api }) {
|
||||
return (
|
||||
<ChannelSection
|
||||
dsp={dsp}
|
||||
channel={{Output: OutputChannel.Out1}}
|
||||
channel={{ Output: OutputChannel.Out1 }}
|
||||
setLowPass={api.setLowPass}
|
||||
setHighPass={api.setHighPass}
|
||||
setPeq={api.setPeqBand}
|
||||
|
||||
@@ -459,9 +459,7 @@ function ChannelSection({
|
||||
const ActiveLowPassFilter = activeChannelState.crossover.low_pass;
|
||||
const ActivePeq = activeChannelState.peq_chain;
|
||||
|
||||
const bandsOrder = isInput
|
||||
? PEQ_BANDS_ORDER.slice(0, -1)
|
||||
: PEQ_BANDS_ORDER;
|
||||
const bandsOrder = isInput ? PEQ_BANDS_ORDER.slice(0, -1) : PEQ_BANDS_ORDER;
|
||||
|
||||
const handleResetPeq = async () => {
|
||||
if (resetting) return;
|
||||
|
||||
@@ -12,10 +12,7 @@ export function useNotifications() {
|
||||
|
||||
const fullMessage = dspName ? `${dspName}: ${message}` : message;
|
||||
|
||||
setNotifications((prev) => [
|
||||
...prev,
|
||||
{ id, message: fullMessage, type },
|
||||
]);
|
||||
setNotifications((prev) => [...prev, { id, message: fullMessage, type }]);
|
||||
|
||||
const removeLater = () => {
|
||||
if (hovered.current.has(id)) {
|
||||
@@ -53,4 +50,4 @@ export function useNotifications() {
|
||||
removeNotification,
|
||||
hoverNotification,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user