Skip to content

Commit

Permalink
feat: mixer online - will restart server.
Browse files Browse the repository at this point in the history
fix: settings cancel will close window instead of restarting
  • Loading branch information
olzzon committed Dec 18, 2019
1 parent adbe5fa commit fea6b24
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 15 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ Routing setups can be stored in STORAGE. So it´s possible to have different Rou



### Install: (On linux)
### Run as Docker: (On linux)
```
docker pull olzzon/sisyfos-audio-controller:develop
sudo docker run --mount source=sisyfos-vol,target=/opt/sisyfos-audio-controller --network="host" olzzon/sisyfos-audio-controller:develop
sudo docker run --mount source=sisyfos-vol,target=/opt/sisyfos-audio-controller --network="host" --restart unless-stopped olzzon/sisyfos-audio-controller:develop
```

### Install Local node host:
(Be aware that a server reload will quit server and you need an external source to restart)
```
git clone https://github.com/olzzon/sisyfos-audio-controller.git
cd sisyfos-audio-controller
yarn
yarn build
yarn start
```


## Settings:
### Show PFL Controls:
As NEXT has been implemented, and PFL usually only work on on channel at a time, the PFL is only working correctly on 1:1 routed setups (And with the CasparCG protocol)
Expand Down
29 changes: 24 additions & 5 deletions server/MainThreadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@ import {
SOCKET_SET_RATIO,
SOCKET_SET_LOW,
SOCKET_SET_MID,
SOCKET_SET_HIGH
SOCKET_SET_HIGH,
SOCKET_RESTART_SERVER
} from './constants/SOCKET_IO_DISPATCHERS'
import { TOGGLE_PGM, TOGGLE_VO, TOGGLE_PST, TOGGLE_PFL, TOGGLE_MUTE, NEXT_MIX, CLEAR_PST, SET_FADER_THRESHOLD, SET_FADER_RATIO, SET_FADER_LOW, SET_FADER_MID, SET_FADER_HIGH } from './reducers/faderActions';
import {
TOGGLE_PGM,
TOGGLE_VO,
TOGGLE_PST,
TOGGLE_PFL,
TOGGLE_MUTE,
NEXT_MIX,
CLEAR_PST,
SET_FADER_THRESHOLD,
SET_FADER_RATIO,
SET_FADER_LOW,
SET_FADER_MID,
SET_FADER_HIGH
} from './reducers/faderActions';
import { SET_FADER_LEVEL } from './reducers/faderActions';
import { SET_ASSIGNED_FADER, SET_AUX_LEVEL } from './reducers/channelActions';
const path = require('path')
Expand Down Expand Up @@ -115,6 +129,11 @@ export class MainThreadHandlers {
global.socketServer.emit('set-store', global.storeRedux.getState())
})
)
.on(SOCKET_RESTART_SERVER, (
() => {
process.exit(0)
})
)
.on(SOCKET_SET_ASSIGNED_FADER, (
(payload: any) => {
console.log('Set assigned fader. Channel:', payload.channel, 'Fader :', payload.faderAssign)
Expand Down Expand Up @@ -164,7 +183,7 @@ export class MainThreadHandlers {
)
.on(SOCKET_SET_LOW, (
(payload: any) => {
console.log('Set Low:', payload.channel)
//console.log('Set Low:', payload.channel)
global.storeRedux.dispatch({
type: SET_FADER_LOW,
channel: payload.channel,
Expand All @@ -176,7 +195,7 @@ export class MainThreadHandlers {
)
.on(SOCKET_SET_MID, (
(payload: any) => {
console.log('Set Mid:', payload.level, ' On channelIndex :', payload.channel)
//console.log('Set Mid:', payload.level, ' On channelIndex :', payload.channel)
global.storeRedux.dispatch({
type: SET_FADER_MID,
channel: payload.channel,
Expand All @@ -188,7 +207,7 @@ export class MainThreadHandlers {
)
.on(SOCKET_SET_HIGH, (
(payload: any) => {
console.log('Set High:', payload.channel)
//console.log('Set High:', payload.channel)
global.storeRedux.dispatch({
type: SET_FADER_HIGH,
channel: payload.channel,
Expand Down
1 change: 1 addition & 0 deletions server/constants/SOCKET_IO_DISPATCHERS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const SOCKET_CLEAR_PST = 'clearPst'

// Div:
export const SOCKET_SAVE_SETTINGS = 'saveSettings'
export const SOCKET_RESTART_SERVER = 'restartServer'
export const SOCKET_SET_VU = 'setVu'
export const SOCKET_GET_SNAPSHOT_LIST = 'getSnapshotList'
export const SOCKET_RETURN_SNAPSHOT_LIST = 'returnSnapshotList'
Expand Down
4 changes: 2 additions & 2 deletions src/assets/css/Channels.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
.channels-show-mixer-online {
outline : none;
-moz-outline : none;
color: rgb(102, 102, 102);
color: rgb(255, 255, 255);
height: 60px;
width: 90px;
border-color: rgb(71, 71, 71);
background-color: rgb(48, 1, 1);
background-color: rgb(219, 1, 1);
margin-left: 5px;
margin-right: 4px;
margin-top: 10px;
Expand Down
27 changes: 22 additions & 5 deletions src/components/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ChannelMonitorOptions from './ChannelMonitorOptions';
import { IChannels } from '../../server/reducers/channelsReducer';
import { IFader } from '../../server/reducers/fadersReducer';
import { ISettings } from '../../server/reducers/settingsReducer';
import { SOCKET_NEXT_MIX, SOCKET_CLEAR_PST } from '../../server/constants/SOCKET_IO_DISPATCHERS';
import { SOCKET_NEXT_MIX, SOCKET_CLEAR_PST, SOCKET_RESTART_SERVER } from '../../server/constants/SOCKET_IO_DISPATCHERS';

interface IChannelsInjectProps {
channels: IChannels
Expand Down Expand Up @@ -67,7 +67,9 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
}

handleReconnect() {
location.reload();
if (window.confirm('Are you sure you will restart server?')) {
window.socketIoClient.emit(SOCKET_RESTART_SERVER)
}
}


Expand Down Expand Up @@ -124,16 +126,31 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
}
<br/>
<div className="channels-mix-body">
{this.props.settings.mixerOnline ?
<button
className={
ClassNames("channels-show-mixer-online", {
"connected": this.props.settings.mixerOnline
})}
onClick={() => {
this.handleReconnect();
this.handleReconnect()
}}
>{this.props.settings.mixerOnline ? 'MIXER ONLINE' : 'RECONNECT'}</button>

>
MIXER ONLINE
</button>
:
<button
className={
ClassNames("channels-show-mixer-online", {
"connected": this.props.settings.mixerOnline
})}
onClick={() => {
this.handleReconnect()
}}
>
RESTART SERVER
</button>
}
{(this.props.settings.automationMode ||
this.props.settings.offtubeMode) ?
null
Expand Down
5 changes: 4 additions & 1 deletion src/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { SHOW_CHANNEL } from '../../server/reducers/faderActions'
import { Store } from 'redux';
import { ChangeEvent } from 'react';
import { SOCKET_SAVE_SETTINGS } from '../../server/constants/SOCKET_IO_DISPATCHERS';
import { TOGGLE_SHOW_SETTINGS } from '../../server/reducers/settingsActions';

//Set style for Select dropdown component:
const selectorColorStyles = {
Expand Down Expand Up @@ -170,7 +171,9 @@ class Settings extends React.PureComponent<IAppProps & Store, IState> {
}

handleCancel = () => {
location.reload();
this.props.dispatch({
type: TOGGLE_SHOW_SETTINGS,
});
}

renderChannelTypeSettings = () => {
Expand Down

0 comments on commit fea6b24

Please sign in to comment.