From 76bfec4c6d79e1a1fd4aafc4d39676d62867f9de Mon Sep 17 00:00:00 2001 From: Ferdinand Malcher Date: Sun, 29 Dec 2024 14:08:24 +0100 Subject: [PATCH] docs: add quick start guide --- docs/docs/usage/commands-feedback.md | 2 +- docs/docs/usage/connection.md | 2 +- docs/docs/usage/quickstart.md | 47 ++++++++++++++++++++++++++++ docs/docs/usage/status.md | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 docs/docs/usage/quickstart.md diff --git a/docs/docs/usage/commands-feedback.md b/docs/docs/usage/commands-feedback.md index b7a5bc8..adf5d87 100644 --- a/docs/docs/usage/commands-feedback.md +++ b/docs/docs/usage/commands-feedback.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 3 --- # Use commands and feedback diff --git a/docs/docs/usage/connection.md b/docs/docs/usage/connection.md index a332a3c..35a3d4d 100644 --- a/docs/docs/usage/connection.md +++ b/docs/docs/usage/connection.md @@ -1,5 +1,5 @@ --- -sidebar_position: 0 +sidebar_position: 1 --- # Initialization and connection diff --git a/docs/docs/usage/quickstart.md b/docs/docs/usage/quickstart.md new file mode 100644 index 0000000..42cb1e0 --- /dev/null +++ b/docs/docs/usage/quickstart.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 0 +--- + +# Quick Start + +**This Quick Start Guide will help you get started with this library by creating a simple Node.js script to toggle MUTE on a master channel.** + +First, ensure that the [Node.js runtime](https://nodejs.org/en) is installed on your machine. +Create a new folder and initialize a new NPM project: + +```bash +mkdir soundcraft-quickstart +cd soundcraft-quickstart +npm init -y +``` + +Install the library: + +```bash +npm install soundcraft-ui-connection +``` + +Create an `index.mjs` file for your script. Import the `SoundcraftUI` class from the package and create an instance with the IP address of the mixer. Use the `conn.connect()` method to connect to the mixer, which returns a Promise that resolves when the connection is established. + +Finally, set an interval to toggle MUTE every 1000 ms: + +```javascript +import { SoundcraftUI } from 'soundcraft-ui-connection'; + +const conn = new SoundcraftUI('192.168.1.111'); +await conn.connect(); + +setInterval(() => { + conn.master.input(2).toggleMute(); +}, 1000); +``` + +You can run the script from the command line: + +```bash +node index.mjs +``` + +Open the Soundcraft Web App to see Channel 2 mute and unmute every second. + +🎉 **Congratulations! You have successfully set up a new project with our library.** diff --git a/docs/docs/usage/status.md b/docs/docs/usage/status.md index cd8cc9b..441ad94 100644 --- a/docs/docs/usage/status.md +++ b/docs/docs/usage/status.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 2 --- # Connection Status