[Update] Config Page: Add Advanced Settings Tab.
This commit is contained in:
24
src-ui/logics/configs/advanced_settings/useOscIpAddress.js
Normal file
24
src-ui/logics/configs/advanced_settings/useOscIpAddress.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OscIpAddress } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOscIpAddress = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOscIpAddress, updateOscIpAddress, pendingOscIpAddress } = useStore_OscIpAddress();
|
||||
|
||||
const getOscIpAddress = () => {
|
||||
pendingOscIpAddress();
|
||||
asyncStdoutToPython("/get/data/osc_ip_address");
|
||||
};
|
||||
|
||||
const setOscIpAddress = (osc_ip_address) => {
|
||||
pendingOscIpAddress();
|
||||
asyncStdoutToPython("/set/data/osc_ip_address", osc_ip_address);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOscIpAddress,
|
||||
getOscIpAddress,
|
||||
updateOscIpAddress,
|
||||
setOscIpAddress,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/advanced_settings/useOscPort.js
Normal file
24
src-ui/logics/configs/advanced_settings/useOscPort.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_OscPort } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useOscPort = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentOscPort, updateOscPort, pendingOscPort } = useStore_OscPort();
|
||||
|
||||
const getOscPort = () => {
|
||||
pendingOscPort();
|
||||
asyncStdoutToPython("/get/data/osc_port");
|
||||
};
|
||||
|
||||
const setOscPort = (osc_port) => {
|
||||
pendingOscPort();
|
||||
asyncStdoutToPython("/set/data/osc_port", osc_port);
|
||||
};
|
||||
|
||||
return {
|
||||
currentOscPort,
|
||||
getOscPort,
|
||||
updateOscPort,
|
||||
setOscPort,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user