Skip to content

Commit a39335a

Browse files
Remove CasparCG FPS setting UI
1 parent 0afbff5 commit a39335a

1 file changed

Lines changed: 1 addition & 64 deletions

File tree

apps/app/src/react/components/pages/homePage/deviceItem/DeviceItemContent.tsx

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MenuItem, TextField } from '@mui/material'
1+
import { TextField } from '@mui/material'
22
import React, { useCallback, useContext, useEffect, useState } from 'react'
33
import { TextBtn } from '../../../../components/inputs/textBtn/TextBtn.js'
44
import { AtemOptions, CasparCGOptions, DeviceType, OBSOptions, OSCDeviceType } from 'timeline-state-resolver-types'
@@ -13,17 +13,6 @@ import { TSRDeviceId, unprotectString } from '@shared/models'
1313

1414
const MIN_PORT = 1
1515
const MAX_PORT = 65535
16-
const FPS_OPTIONS = [
17-
{ label: 'Auto (default)', value: '' },
18-
{ label: '23.98 (24000/1001)', value: 24000 / 1001 },
19-
{ label: '24', value: 24 },
20-
{ label: '25', value: 25 },
21-
{ label: '29.97 (30000/1001)', value: 30000 / 1001 },
22-
{ label: '30', value: 30 },
23-
{ label: '50', value: 50 },
24-
{ label: '59.94 (60000/1001)', value: 60000 / 1001 },
25-
{ label: '60', value: 60 },
26-
]
2716

2817
export const DeviceItemContent: React.FC<{
2918
bridge: Bridge
@@ -38,7 +27,6 @@ export const DeviceItemContent: React.FC<{
3827
const [host, setHost] = useState('')
3928
const [port, setPort] = useState(MIN_PORT)
4029
const [password, setPassword] = useState('')
41-
const [fps, setFps] = useState<number | ''>('')
4230
const deviceSettings = bridge.settings.devices[unprotectString<TSRDeviceId>(deviceId)]
4331

4432
const handleDeviceNameChange = useCallback(
@@ -98,23 +86,6 @@ export const DeviceItemContent: React.FC<{
9886
[deviceSettings, handleError, ipcServer, project]
9987
)
10088

101-
const handleFpsChange = useCallback(
102-
(newFps: number | '') => {
103-
if (!deviceSettings || deviceSettings.type !== DeviceType.CASPARCG) {
104-
return
105-
}
106-
107-
const options = deviceSettings.options as CasparCGOptions
108-
if (newFps === '') {
109-
delete options.fps
110-
} else {
111-
options.fps = newFps
112-
}
113-
ipcServer.updateProject({ id: project.id, project }).catch(handleError)
114-
},
115-
[deviceSettings, handleError, ipcServer, project]
116-
)
117-
11889
const removeDevice = useCallback(() => {
11990
delete bridge.settings.devices[unprotectString<TSRDeviceId>(deviceId)]
12091
ipcServer.updateProject({ id: project.id, project }).catch(handleError)
@@ -128,13 +99,6 @@ export const DeviceItemContent: React.FC<{
12899
const deviceOptions = deviceSettings?.options as CasparCGOptions | AtemOptions
129100
setHost(deviceOptions?.host ?? '')
130101
setPort(deviceOptions?.port ?? MIN_PORT)
131-
if (deviceSettings?.type === DeviceType.CASPARCG) {
132-
const casparOptions = deviceSettings.options as CasparCGOptions
133-
setFps(casparOptions?.fps ?? '')
134-
} else {
135-
setFps('')
136-
}
137-
138102
if (deviceSettings?.type === DeviceType.OBS) {
139103
setPassword(deviceSettings.options?.password ?? '')
140104
} else {
@@ -221,33 +185,6 @@ export const DeviceItemContent: React.FC<{
221185
}}
222186
/>
223187
</div>
224-
{deviceSettings.type === DeviceType.CASPARCG && (
225-
<div className="form-control">
226-
<TextField
227-
label="FPS"
228-
value={fps}
229-
select
230-
size="small"
231-
margin="dense"
232-
onChange={(event) => {
233-
const raw = event.target.value
234-
const parsed = raw === '' ? '' : parseFloat(String(raw))
235-
const next = Number.isNaN(parsed) ? '' : parsed
236-
setFps(next)
237-
handleFpsChange(next)
238-
}}
239-
>
240-
{FPS_OPTIONS.map((option) => (
241-
<MenuItem key={option.label} value={option.value}>
242-
{option.label}
243-
</MenuItem>
244-
))}
245-
{fps !== '' && !FPS_OPTIONS.some((option) => option.value === fps) && (
246-
<MenuItem value={fps}>Custom ({fps})</MenuItem>
247-
)}
248-
</TextField>
249-
</div>
250-
)}
251188
</>
252189
)}
253190
{deviceSettings.type === DeviceType.OBS ? (

0 commit comments

Comments
 (0)