Skip to content

Commit

Permalink
feat: ChannelTypes: Changed numberOfChannels to numberOfChannelsInTyp…
Browse files Browse the repository at this point in the history
…e (current ussage is [0])
  • Loading branch information
olzzon committed Jun 27, 2019
1 parent 995b99e commit 114538d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class App extends React.Component<IAppProps> {
(window as any).automationConnection = new AutomationConnection();
(window as any).huiRemoteConnection = new HuiMidiRemoteConnection();
this.snapShopStoreTimer();
loadSnapshotState(this.props.store.channels[0], this.props.store.settings[0].numberOfChannels);
loadSnapshotState(this.props.store.channels[0], this.props.store.settings[0].numberOfChannelsInType[0]);
}

public shouldComponentUpdate(nextProps: IAppProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Settings extends React.PureComponent<IAppProps & Store, IState> {
<br/>
<label className="settings-input-field">
NUMBER OF CHANNELS :
<input name="numberOfChannels" type="text" value={this.state.settings.numberOfChannels} onChange={this.handleChange} />
<input name="numberOfChannels" type="text" value={this.state.settings.numberOfChannelsInType[0]} onChange={this.handleChange} />
</label>
<br/>
<label className="settings-input-field">
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/settingsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ISettings {
enableRemoteFader: boolean,
remoteFaderMidiInputPort: string,
remoteFaderMidiOutputPort: string,
numberOfChannels: number,
numberOfChannelsInType: Array<number>,
numberOfSnaps: number,
fadeTime: number
showPfl: boolean
Expand All @@ -33,7 +33,7 @@ const defaultSettingsReducerState: Array<ISettings> = [
enableRemoteFader: false,
remoteFaderMidiInputPort: "",
remoteFaderMidiOutputPort: "",
numberOfChannels: 8,
numberOfChannelsInType: [8],
numberOfSnaps: DEFAULTS.NUMBER_OF_SNAPS,
fadeTime: 100, //Time in ms
showPfl: false
Expand Down
2 changes: 1 addition & 1 deletion src/utils/EmberMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class EmberMixerConnection {
let node: any;
console.log("Ember Connected");

for (let ch=1; ch <= this.store.settings[0].numberOfChannels ; ch++) {
for (let ch=1; ch <= this.store.settings[0].numberOfChannelsInType[0] ; ch++) {
this.emberConnection.getNodeByPath(this.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_FADER_LEVEL.replace("{channel}", String(ch)))
.then((node: any) => {
this.emberConnection.subscribe(node, (() => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/productSpecific/behringer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const behringerMeter = (message: any) => {
let uint8bytes = Uint8Array.from(message[0]);
let dataview = new DataView(uint8bytes.buffer);

for (let i=0; i < store.settings[0].numberOfChannels; i++) {
for (let i=0; i < store.settings[0].numberOfChannelsInType[0]; i++) {
window.storeRedux.dispatch({
type:'SET_VU_LEVEL',
channel: i,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/productSpecific/midas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const midasMeter = (message: any) => {
let dataview = new DataView(uint8bytes.buffer);
//console.log(dataview);
let vuMeters = [];
let numberOfChannels = store.settings[0].numberOfChannels;
let numberOfChannels = store.settings[0].numberOfChannelsInType[0];

for (let i=0; i < numberOfChannels; i++) {
vuMeters.push({vuVal : dataview.getFloat32(4*i+headerData , true)});
Expand Down

0 comments on commit 114538d

Please sign in to comment.