Skip to content

Commit

Permalink
Merge pull request #29 from jrviz/master
Browse files Browse the repository at this point in the history
Allow companion port configuration
  • Loading branch information
jrviz authored Oct 6, 2022
2 parents c2e6d94 + 1d4900f commit bd72ea8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = new Store({
midirelayPort: '4000',
midirelayMIDIPort: 'loopMIDI Port',
companionIP: '127.0.0.1',
companionPort: '51234',
plugin_midirelay: true,
plugin_vista: true,
plugin_http: true,
Expand Down
16 changes: 15 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
$('#switchCompanion').prop('checked', config.get('plugin_companion'));
plugin_enable('companion')
$('#txtCompanionIP').val(config.get('companionIP'));
$('#txtCompanionPort').val(config.get('companionPort'));

$('#switchMdns').prop('checked', config.get('switch_mdns'));
$('#switchSettings').prop('checked', config.get('switch_settings'));
Expand Down Expand Up @@ -374,6 +375,7 @@
config.set('vistaMIDIPort', $('#txtVistaMIDIPort').val());

config.set('companionIP', $('#txtCompanionIP').val());
config.set('companionPort', $('#txtCompanionPort').val());
}

function mdnsRescan() {
Expand Down Expand Up @@ -594,14 +596,26 @@ <h2>Created by <a href="#" onclick="openAuthor();">techministry.blog</a></h2><h3
<label class="custom-control-label" for="switchCompanion"><b>Companion Buttons</b></label>
</div>
</div>
<div class='form-group col-md-4 collapse' id="companionSettings">
</div>
<div class='form-row collapse' id="companionSettings">
<div class='form-group col-md-4'>
</div>
<div class='form-group col-md-4'>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<label class="input-group-text" for="txtCompanionIP">IP</label>
</div>
<input type="text" id='txtCompanionIP' class='form-control' minlength="7" maxlength="15" pattern="^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$">
</div>
</div>
<div class='form-group col-md-4'>
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<label class="input-group-text" for="txtCompanionPort">Port</label>
</div>
<input type='number' id='txtCompanionPort' class='form-control'/>
</div>
</div>
</div>
</section>
<section>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ function createCompanionConnection() {
companionClient.destroy()
companionClient = undefined
}
companionClient = new net.createConnection(51234, config.get('companionIP'));
companionClient = new net.createConnection(config.get('companionPort'), config.get('companionIP'));
console.log('Connecting to Companion.');

companionClient.on('connect', () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "presentationbridge-client",
"productName": "PresentationBridge Client",
"version": "1.0.14",
"version": "1.0.15",
"description": "Links data from your Presentation / lyrics software to other software.",
"license": "MIT",
"repository": "josephdadams/presentationbridge-client",
Expand Down

0 comments on commit bd72ea8

Please sign in to comment.