Skip to content

Commit

Permalink
feat: updates to selectors for destination list
Browse files Browse the repository at this point in the history
  • Loading branch information
ndorin committed Apr 12, 2024
1 parent ea778d8 commit 0d80a6f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/lib/store/rooms/roomsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export const useRoomDestinations = (roomKey: string) =>
: undefined
);

export const useRoomDestinationList = (roomKey: string) =>
useAppSelector((state) =>
state.rooms[roomKey]
? state.rooms[roomKey]?.configuration?.destinationList
: undefined
);

export const useRoomEnvironmentalDevices = (roomKey: string) =>
useAppSelector((state) =>
state.rooms[roomKey]
Expand All @@ -49,15 +56,15 @@ export const useRoomEnvironmentalDevices = (roomKey: string) =>

export const useRoomProgramAudioDestinationKey = (roomKey: string) =>
useAppSelector((state) =>
state.rooms[roomKey]
? state.rooms[roomKey]?.configuration?.destinations["programAudio"]
: undefined
state.rooms[roomKey]?.configuration?.destinationList["programAudio"]
? state.rooms[roomKey]?.configuration?.destinationList["programAudio"]?.sinkKey
: state.rooms[roomKey]?.configuration?.destinationList["defaultDisplay"]?.sinkKey || ""
);

export const useRoomCodecContentDestinationKey = (roomKey: string) =>
useAppSelector((state) =>
state.rooms[roomKey]
? state.rooms[roomKey]?.configuration?.destinations["codecContent"]
? state.rooms[roomKey]?.configuration?.destinationList["codecContent"]?.sinkKey
: undefined
);

Expand Down
14 changes: 14 additions & 0 deletions src/lib/types/state/DestinationListItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SignalType } from 'src/lib/shared';


export interface DestinationListItem {
sinkKey: string;
preferredName: string;
name: string;
includeInDestinationList: boolean;
order: number;
surfaceLocation: number;
vertialLocation: number;
horizontalLocation: number;
sinkType: SignalType;
}
2 changes: 2 additions & 0 deletions src/lib/types/state/state/RoomState.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable max-classes-per-file */

import { DestinationListItem } from '../DestinationListItem';
import { SourceListItem } from '../sourceListItem';
import { Volume } from '../volume/volume';
import { DeviceState } from './DeviceState';
Expand All @@ -26,6 +27,7 @@ export interface RoomConfiguration {
defaultDisplayKey?: string;
defaultPresentationSourceKey: string;
destinations: Record<DestinationTypes, string>;
destinationList: Record<string, DestinationListItem>;
environmentalDevices: EnvironmentalDeviceConfiguration[];
hasAudioConferencing?: boolean;
hasEnvironmentalControls?: boolean;
Expand Down

0 comments on commit 0d80a6f

Please sign in to comment.