use real sounds from kbsim
This commit is contained in:
@@ -10,7 +10,7 @@ export const app = $state({
|
||||
fps: 30,
|
||||
pixelsPerSecond: ZOOM_DEFAULT,
|
||||
scrollLeft: 0,
|
||||
activeSwitch: 'cherry-mx-blue' as SwitchType,
|
||||
activeSwitch: 'mxbrown' as SwitchType,
|
||||
videoUrl: null as string | null,
|
||||
videoName: null as string | null,
|
||||
timelineWidth: 800,
|
||||
@@ -68,13 +68,16 @@ export function setTimelineWidth(value: number) {
|
||||
app.timelineWidth = value;
|
||||
}
|
||||
|
||||
export function addMarker(time: number, key: string): Marker {
|
||||
const marker: Marker = { id: createMarkerId(), time, key };
|
||||
export function addMarker(time: number, key: string, code?: string): Marker {
|
||||
const marker: Marker = { id: createMarkerId(), time, key, code };
|
||||
app.markers = [...app.markers, marker].sort((a, b) => a.time - b.time);
|
||||
return marker;
|
||||
}
|
||||
|
||||
export function updateMarker(id: string, patch: Partial<Pick<Marker, 'time' | 'key'>>) {
|
||||
export function updateMarker(
|
||||
id: string,
|
||||
patch: Partial<Pick<Marker, 'time' | 'key' | 'code' | 'releaseTime'>>,
|
||||
) {
|
||||
app.markers = app.markers
|
||||
.map((m) => (m.id === id ? { ...m, ...patch } : m))
|
||||
.sort((a, b) => a.time - b.time);
|
||||
|
||||
Reference in New Issue
Block a user