# DJUCED<no value>

## Install location

djctl must be installed on the same machine running DJUCED. It is not possible to run djctl on a machine separate from the DJUCED software.

## Setup DJUCED

Launch the DJUCED application and click on the gear icon in the top right corner to enter the settings screen.

{{< img src="djuced-settings-icon.png" class="img-fluid mb-3" >}}

Once in the settings screen, click on "Record" text in the left-hand "Settings" column. Ensure "Text File Outut" is marked "Yes."

{{< img src="djuced-settings-record.png" class="img-fluid mb-3" >}}

Click the "Format" button.

{{< img src="djuced-format-button.png" class="img-fluid w-50 mb-3" >}}

Ensure the "Format" text field contains the following:

```text
title=%TI%|artist=%AR%|id=%FL%
```

{{< img src="djuced-format-text.png" class="img-fluid mb-3" >}}

Once this text has been entered, click anywhere on the settings panel to exit text entry mode.

Next, verify the file location. Click on the "File" button.

{{< img src="djuced-file.png" class="img-fluid w-50 mb-3" >}}

A new file selection box will appear. Note the file name and location -- we will use this later as a command line argument when launching djctl. In the example screenshot below the file location is `/Users/mhite/Documents/DJUCED/playing.txt`.

{{< img src="djuced-file-selection.png" class="img-fluid mb-3" >}}

Exit the file selection screen and return to the settings screen. Once back at the DJUCED settings screen, click the "Ok" button to save the changes.

{{< img src="djuced-settings-ok.png" class="img-fluid mb-3" >}}

## Launch djctl

After unarchiving the djctl download, open a terminal window and switch to the directory containing the djctl binary. Use the `djctl start --source=djuced --djuced.filename="<YOUR_FILE_LOCATION>"` command to start monitoring DJUCED.

### Mac or Linux

To launch on a Mac or Linux, use the following command:

```sh
./djctl start --source=djuced --djuced.filename="<replace_with_your_playing.txt>"
```

### Windows

If you are on Windows, use the following command:

```sh
djctl.exe start --source=djuced --djuced.filename="<replace_with_your_playing.txt>"
```

### Output

If all goes well, output in the terminal window will resemble the following:

```sh
./djctl start --source=djuced --djuced.filename="/Users/mhite/Documents/DJUCED/playing.txt"
time="2025-01-15T09:13:05-08:00" level=warning msg="No license key, running in demo mode"
time="2025-01-15T09:13:05-08:00" level=warning msg="Visit https://www.djctl.com/buy/ to purchase a license"
time="2025-01-15T09:13:05-08:00" level=info msg="Starting http listener" httpAddr=":9090"
time="2025-01-15T09:13:05-08:00" level=info msg="Starting DJUCED source"
```

## Connect to the djctl web server

Connect to [http://127.0.0.1:9090/](http://127.0.0.1:9090/).

## Go DJ!

Start DJing! You'll see track transitions automatically update in the browser view. You should also see track transition messages log to the terminal.

```sh
time="2025-01-15T09:13:05-08:00" level=info msg="track transition detected" artist="" song=""
time="2025-01-15T09:13:30-08:00" level=info msg="track transition detected" artist=DJUCED song="Track title unavailable in demo mode"
time="2025-01-15T09:13:30-08:00" level=info msg="Wrote featured track to websocket"
time="2025-01-15T09:13:38-08:00" level=info msg="track transition detected" artist="Scritti Politti" song="Track title unavailable in demo mode"
time="2025-01-15T09:13:38-08:00" level=info msg="Wrote featured track to websocket"
```

To exit, hit CTRL-C.

```sh
^Ctime="2025-01-15T16:32:07-08:00" level=info msg="Received signal interrupt, shutting down..." _source="start/start.go:65"
time="2025-01-15T16:32:07-08:00" level=info msg=Exiting... _source="start/start.go:72"
```