Skip to content

Commit

Permalink
Updating example in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chdxD1 committed Jul 4, 2021
1 parent d5e9bb6 commit ad3aec5
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ It requires either Showkontrol / Beatkontrol (https://www.tc-supply.com/home) to
```typescript
import { TCNetConfiguration, PioneerDJTCClient, LayerIndex } from "node-tcnet"

const config = new TCNetConfiguration();

// Linux
config.broadcastInterface = "eth0";
// Windows - at least for a locally running PRO DJ LINK BRIDGE
config.broadcastAddress = "0.0.0.0";

const client = new PioneerDJTCClient(config);

client.on('statuschange', async () => {
try {
let layer1 = await client.trackInfo(LayerIndex.Layer1);
let layer2 = await client.trackInfo(LayerIndex.Layer2);
console.log(layer1);
console.log(layer2);
} catch (e) {
console.log("Error while processing statuschange");
console.log(e);
}
});
client.connect();
async function main() {
// Init new TCNet configuration
const config = new TCNetConfiguration();

// Linux
config.broadcastInterface = "eth0";
// Windows - at least for a *locally* running PRO DJ LINK BRIDGE
config.broadcastAddress = "<ip address of selected interface>";
// Init new client for Pioneer DJ TCNet
const client = new PioneerDJTCClient(config);

// Wait for connect
await client.connect();

// Ask for track information on Layer 1
const layer1 = await client.trackInfo(LayerIndex.Layer1);
console.log(layer1);
}

main();
```
### Windows Notes
Instead of `config.broadcastInterface` the address should be set. Windows works a bit different here with Broadcast.. Please set `config.broadcastAddress = 0.0.0.0`.
Instead of `config.broadcastInterface` the address should be set. Windows works a bit different here with Broadcast.. Please set `config.broadcastAddress` to the interface selected in Pro DJ Link or when running on a different PC the IP address of your main interface.

## Comparable work
- Directly implementing ProDJLink: Implements the native protocol of Pioneer DJ players/mixers by emulating a CDJ in the network. This has the downside of trying to reverse-engineer an unknown protocol from Pioneer, with no documentation. However these libraries have some better support for other devices like the XDJ-XZ. Using TCNet has the benefit of a clear seperation between the productive Pro DJ Link network and a documented protocol.
Expand Down

0 comments on commit ad3aec5

Please sign in to comment.