### Install MusikCube Binaries Source: https://github.com/clangen/musikcube/wiki/raspberry-pi Install MusikCube using dpkg and apt-get to handle dependencies. Ensure MusikCube is started to verify installation. ```bash sudo dpkg -i ./musikcube_x.x.x_raspberry_pi_armhf.deb ``` ```bash sudo apt-get install -f ``` ```bash musikcube ``` -------------------------------- ### Install Nginx Source: https://github.com/clangen/musikcube/wiki/ssl-server-setup Installs the Nginx web server using apt-get. ```bash sudo apt-get install nginx ``` -------------------------------- ### Install Chroot Dependencies Source: https://github.com/clangen/musikcube/blob/master/doc/rpi-buster-chroot.md Installs necessary QEMU and filesystem utilities for setting up the chroot environment. ```bash sudo apt install qemu-kvm qemu-user-static binfmt-support qemu-user-static qemu-utils kpartx e2fsprogs ``` -------------------------------- ### Install Dependencies on openSUSE Source: https://github.com/clangen/musikcube/wiki/building Installs development packages for MusikCube on openSUSE using zypper. ```bash sudo zypper install libcurl-devel libmicrohttpd-devel cmake ncurses5-devel libogg-devel libvorbis-devel ffmpeg-3-libavcodec-devel ffmpeg-3-libswresample-devel ffmpeg-3-libavformat-devel ffmpeg-3-libavutil-devel libmp3lame-devel pulseaudio libpulse-devel alsa-devel zlib-devel libressl-devel libev-devel libtag-devel libopenmpt-devel ``` -------------------------------- ### Install MusikCube via AUR (Arch Linux) Source: https://github.com/clangen/musikcube/wiki/installing Install MusikCube on Arch Linux using an AUR helper like yaourt. This example uses yaourt. ```bash yaourt -S musikcube ``` -------------------------------- ### Install Dependencies on FreeBSD Source: https://github.com/clangen/musikcube/wiki/building Installs required packages and ports for building MusikCube on FreeBSD. ```bash pkg install ncurses curl libvorbis libogg libmicrohttpd ffmpeg alsa-lib cmake sndio libev taglib libopenmpt bash pkgconf portsnap fetch portsnap extract cd /usr/ports/audio/lame make reinstall ``` -------------------------------- ### Install Dependencies on OpenBSD Source: https://github.com/clangen/musikcube/wiki/building Installs necessary packages for MusikCube on OpenBSD using pkg_add. ```bash pkg_add git cmake ffmpeg sndio libev libmicrohttpd taglib libopenmpt ``` -------------------------------- ### Install Dependencies on Ubuntu (Artful) Source: https://github.com/clangen/musikcube/wiki/building Installs development packages required for MusikCube on Ubuntu Artful using apt-get. ```bash sudo apt-get install build-essential clang cmake libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libssl-dev libopenmpt-dev ``` -------------------------------- ### Install MusikCube on FreeBSD Source: https://github.com/clangen/musikcube/wiki/installing Install MusikCube on FreeBSD using the ports system. This requires fetching and extracting the ports tree first. ```bash portsnap fetch portsnap extract cd /usr/ports/multimedia/musikcube make install ``` -------------------------------- ### Install Dependencies on Ubuntu (Cosmic, Disco, Eoan) Source: https://github.com/clangen/musikcube/wiki/building Installs development packages required for MusikCube on specific Ubuntu versions using apt-get. ```bash sudo apt-get install build-essential clang cmake libogg-dev libvorbis-dev libavutil-dev libavformat-dev libswresample-dev libncursesw5-dev libasound2-dev libpulse-dev pulseaudio libmicrohttpd-dev libmp3lame-dev libcurl4-openssl-dev libev-dev libssl-dev libtag1-dev libopenmpt-dev ``` -------------------------------- ### Install Dependencies on Arch Linux Source: https://github.com/clangen/musikcube/wiki/building Installs necessary packages for MusikCube on Arch Linux using pacman. ```bash sudo pacman -S libogg libvorbis libmicrohttpd ffmpeg lame cmake ncurses pulseaudio libpulse alsa-lib curl libev taglib libopenmpt pkg-config ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/clangen/musikcube/wiki/building Installs development packages for MusikCube on Fedora using dnf. ```bash sudo dnf install gcc-c++ make cmake libogg-devel libvorbis-devel ffmpeg-devel ncurses-devel zlib-devel alsa-lib-devel pulseaudio-libs-devel libcurl-devel libmicrohttpd-devel lame-devel libev-devel taglib-devel openssl-devel libopenmpt-devel ``` -------------------------------- ### Get Equalizer Settings Response Example Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation This is an example of a generic success/failure response structure that might be received after an equalizer-related request. It includes the request ID and options, which may contain enabled status and frequency bands. ```json { "name": "get_transport_type", "type": "response", "id": "", "options": { "enabled": , "bands": [ {"": }, ... ] } } ``` -------------------------------- ### Install Cross-compile Toolchain Source: https://github.com/clangen/musikcube/blob/master/doc/crosscompile-rpi.md This script downloads and installs a suitable cross-compile toolchain for Raspberry Pi, using a provided sysroot archive. ```bash cd /build cp /path/to/generated/sysroot/sysroot.tar . node /build/musikcube/script/install-crosscompile-tools.js ``` -------------------------------- ### Install Dependencies on macOS (Homebrew) Source: https://github.com/clangen/musikcube/wiki/building Installs necessary libraries and tools for building MusikCube on macOS using Homebrew. ```bash brew install cmake openssl libogg libvorbis ffmpeg libmicrohttpd lame libev taglib ``` -------------------------------- ### Enable MusikCube systemd Service Source: https://github.com/clangen/musikcube/wiki/installing Enable the musikcube systemd service to start automatically on boot. ```bash systemctl enable musikcube ``` -------------------------------- ### Set Installation Directory Source: https://github.com/clangen/musikcube/blob/master/src/core_c_demo/CMakeLists.txt Sets the installation directory for the executable, prioritizing HOMEBREW_PREFIX if defined, otherwise using CMAKE_INSTALL_PREFIX. ```cmake set(musikcube_INSTALL_DIR ${HOMEBREW_PREFIX}) if (NOT DEFINED musikcube_INSTALL_DIR) set(musikcube_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Run MusikCube on Startup with Tmux Source: https://github.com/clangen/musikcube/wiki/raspberry-pi Set up MusikCube to automatically start on Raspberry Pi boot using tmux. This allows for detached sessions that can be reattached later. ```bash sudo apt-get install tmux ``` ```bash sudo vim /etc/rc.local ``` ```bash su - pi -c "tmux new -s musikcube -d musikcube" ``` -------------------------------- ### Install MusikCube via Homebrew (macOS) Source: https://github.com/clangen/musikcube/wiki/installing Use Homebrew to install MusikCube on macOS. This is the recommended method. ```bash brew install musikcube ``` -------------------------------- ### Install MusikCube on Ubuntu Source: https://github.com/clangen/musikcube/wiki/installing Install MusikCube on Ubuntu using dpkg and apt-get. Ensure you download the correct .deb file from the releases page. ```bash sudo dpkg -i musikcube_x.y.z_ubuntu_xxx_amd64.deb sudo apt-get install -f /usr/bin/musikcube ``` -------------------------------- ### Update apt and Install Certbot Source: https://github.com/clangen/musikcube/wiki/ssl-server-setup Updates the package list and installs Certbot from the jessie-backports repository. ```bash sudo apt-get update ``` ```bash sudo apt-get install certbot -t jessie-backports ``` -------------------------------- ### Include CMake Install and Package Modules Source: https://github.com/clangen/musikcube/blob/master/CMakeLists.txt Includes CMake modules for handling file installations and package generation. ```cmake include(InstallFiles) ``` ```cmake include(GeneratePackage) ``` -------------------------------- ### Enable RPM Fusion Repositories (Fedora) Source: https://github.com/clangen/musikcube/wiki/installing Enable the RPM Fusion repositories required for installing MusikCube on Fedora. This command installs both free and nonfree repositories. ```bash sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm ``` -------------------------------- ### Install and Configure USB Drive Mounting Source: https://github.com/clangen/musikcube/wiki/raspberry-pi Install the 'usbmount' package to automatically mount USB drives. Note that 'usbmount' does not support exFAT; ensure drives are formatted as FAT32, ext2/3/4, or similar. ```bash sudo apt-get install usbmount ``` -------------------------------- ### Install MusikCube on Fedora Source: https://github.com/clangen/musikcube/wiki/installing Install MusikCube on Fedora after enabling the RPM Fusion repositories. Replace x.y.z and fcxx.x86_64 with your specific version details. ```bash sudo dnf install musikcube-x.y.z.fcxx.x86_64.rpm ``` -------------------------------- ### play_snapshot_tracks Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replaces the current play queue with a snapshot and starts playback. ```APIDOC ## play_snapshot_tracks ### Description Replaces the current play queue with the snapshot for the specified `device_id`, and starts playback at the specified index and time. ### Method Not specified (assumed to be a JSON-RPC or similar request) ### Endpoint Not specified ### Parameters #### Request Body - **name** (string) - Required - "play_snapshot_tracks" - **type** (string) - Required - "request" - **id** (string) - Required - Unique identifier for the request - **device_id** (string) - Required - Unique device identifier whose snapshot to play - **options** (object) - **index** (int32) - Optional - The index to start playback from within the snapshot - **time** (double) - Optional - The time in seconds to start playback from within the snapshot ### Request Example ```json { "name": "play_snapshot_tracks ", "type": "request", "id": "", "device_id": "", "options": { "index": 5, "time": 120.5 } } ``` ### Response #### Success Response Generic success/failure response. ``` -------------------------------- ### Get Gain Settings Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Retrieves preamp and replaygain settings. No options are required for this request. ```json { "name": "get_gain_settings", "type": "request", "id": "", "device_id": "", "options": { /* none */ } } ``` -------------------------------- ### Play Snapshot Tracks Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replaces the current play queue with a snapshot and starts playback. Optionally specify the starting index and time. ```json { "name": "play_snapshot_tracks ", "type": "request", "id": "", "device_id": "", "options": { "index": , /* optional */ "time": /* in seconds. optional */ } } ``` -------------------------------- ### Update and Install Debian Packages Source: https://github.com/clangen/musikcube/blob/master/doc/build-standalone-unix.md Updates the package list and installs essential build dependencies using apt-get. ```bash sudo apt update sudo apt dist-upgrade sudo apt install build-essential g++ gcc git libasound2-dev libev-dev libncurses-dev libopus-dev libopus-dev libopus0 libpulse-dev libsndio-dev libssl-dev libsystemd-dev libvorbis-dev libvorbis-dev libvorbis0a libvorbisenc2 portaudio19-dev rpm wget zlib1g-dev libdbus-1-dev libudev-dev libglib2.0-dev patchelf libstdc++6-i386-cross nodejs ``` -------------------------------- ### Build MusikCube on macOS Source: https://github.com/clangen/musikcube/wiki/building Builds and runs MusikCube after dependencies are installed and the source code is cloned. ```bash cd musikcube cmake . make cd bin ./musikcube ``` -------------------------------- ### Add Certbot Repository Source: https://github.com/clangen/musikcube/wiki/ssl-server-setup Adds the jessie-backports repository to apt sources for installing Certbot. ```bash echo 'deb http://httpredir.debian.org/debian jessie-backports main contrib non-free' | sudo tee -a /etc/apt/sources.list.d/jessie-backports.list ``` -------------------------------- ### Build MusikCube on Linux/BSD Source: https://github.com/clangen/musikcube/wiki/building Configures, builds, installs, and runs MusikCube using CMake and Make on Linux and BSD systems. ```bash cd musikcube cmake -G "Unix Makefiles" . make sudo make install musikcube ``` -------------------------------- ### Play Tracks Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replaces the current play queue with specified tracks and starts playback. Optionally specify the starting index and playback time. ```json { "name": "play_tracks", "type": "request", "id": "", "device_id": "", "options": { "ids": [ /* array of int64 ids */], "index": , /* optional */ "time": /* in seconds. optional */ } } ``` -------------------------------- ### Request: play_all_tracks Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replace the current play queue with all tracks (filtered by optional keywords), and start play back at the specified index (defaults to the first track). ```APIDOC ## Request: play_all_tracks ### Description Replace the current play queue with all tracks (filtered by optional keywords), and start play back at the specified index (defaults to the first track). ### Request Format ```json { "name": "play_all_tracks", "type": "request", "id": "", "device_id": "", "options": { "index": , /* optional */ "time": , /* in seconds. optional */ "filter": "" /* optional */ } } ``` ### Response Format Generic success/failure response. ``` -------------------------------- ### play_tracks Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replaces the current play queue with the specified array of tracks and starts playback at the specified index. Defaults to the first track if index is not provided. ```APIDOC ## play_tracks ### Description Replaces the current play queue with the specified array of tracks, and starts playback at the specified index (defaults to the first track). ### Request Body ```json { "name": "play_tracks", "type": "request", "id": "", "device_id": "", "options": { "ids": [ /* array of int64 ids */], "index": , /* optional */ "time": /* in seconds. optional */ } } ``` ### Response Generic success/failure response. ``` -------------------------------- ### Get Gain Settings Response Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Response containing replaygain mode and preamp gain settings. Replaygain mode can be disabled, album, or track. Preamp gain ranges from -20.0 to 20.0. ```json { "name": "get_gain_settings", "type": "response", "id": "", "options": { "replaygain_mode": "", "preamp_gain": } } ``` -------------------------------- ### Prepare Chroot Mount Points Source: https://github.com/clangen/musikcube/blob/master/doc/rpi-buster-chroot.md Copies the QEMU static binary for ARM emulation into the chroot environment and binds essential host system directories. ```bash sudo cp /usr/bin/qemu-arm-static ./os-mount/usr/bin ``` ```bash sudo mount -o bind /dev ./os-mount/dev ``` ```bash sudo mount -o bind /proc ./os-mount/proc ``` ```bash sudo mount -o bind /sys ./os-mount/sys ``` -------------------------------- ### Enter Chroot Environment Source: https://github.com/clangen/musikcube/blob/master/doc/rpi-buster-chroot.md Enters the chroot environment using qemu-arm-static to execute bash. If /usr/bin/bash is not found, try /bin/bash. ```bash sudo chroot ./os-mount /usr/bin/qemu-arm-static /usr/bin/bash ``` -------------------------------- ### Create Server Library Source: https://github.com/clangen/musikcube/blob/master/src/plugins/server/CMakeLists.txt Builds a shared library named 'server' from the defined source files. ```cmake add_library(server SHARED ${server_SOURCES}) ``` -------------------------------- ### Map Image Partitions Source: https://github.com/clangen/musikcube/blob/master/doc/rpi-buster-chroot.md Maps the partitions within the disk image to device nodes using kpartx, making them accessible for mounting. ```bash sudo kpartx -a -v 2023-05-03-raspios-buster-armhf-lite.img ``` -------------------------------- ### Enable and Restart Nginx Source: https://github.com/clangen/musikcube/wiki/ssl-server-setup Creates a symbolic link to enable the Musikcube Nginx site configuration and restarts the Nginx service. ```bash sudo ln -s /etc/nginx/sites-available/musikcube /etc/nginx/sites-enabled/ ``` ```bash sudo /etc/init.d/nginx restart ``` -------------------------------- ### Build Vendor Libraries Source: https://github.com/clangen/musikcube/blob/master/doc/build-standalone-unix.md Compiles and prepares third-party libraries required for musikcube, placing them in a vendor directory. ```bash cd /build ./musikcube/script/build-vendor-libraries.sh ``` -------------------------------- ### Configure Target Directories and Libraries Source: https://github.com/clangen/musikcube/blob/master/src/core_c_demo/CMakeLists.txt Configures include directories and link libraries for the core_c_demo target. ```cmake target_include_directories(core_c_demo BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES}) target_link_libraries(core_c_demo ${musikcube_LINK_LIBS} musikcore) ``` -------------------------------- ### Configure and Create Daemon Executable Source: https://github.com/clangen/musikcube/blob/master/src/musikcubed/CMakeLists.txt Configures the musikcubed executable using a template file and adds it as a build target. It also sets include directories and links necessary libraries. ```cmake configure_file("musikcubed.in" "musikcubed" @ONLY) add_executable(musikcubed ${DAEMON_SRCS}) target_include_directories(musikcubed BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES}) ``` -------------------------------- ### Log Library Information Source: https://github.com/clangen/musikcube/blob/master/src/plugins/server/CMakeLists.txt Prints the found microhttpd and zlib library paths to the console during the build process. ```cmake message(STATUS "[server] using " ${LIBMICROHTTPD} ", " ${LIBZ}) ``` -------------------------------- ### Define Server Source Files Source: https://github.com/clangen/musikcube/blob/master/src/plugins/server/CMakeLists.txt Lists the source files that will be compiled for the server library. ```cmake set (server_SOURCES BlockingTranscoder.cpp HttpServer.cpp main.cpp Snapshots.cpp Transcoder.cpp TranscodingAudioDataStream.cpp Util.cpp WebSocketServer.cpp) ``` -------------------------------- ### Set Gain Settings Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Updates preamp and replaygain settings. Requires replaygain mode and preamp gain values. ```json { "name": "update_gain_settings", "type": "request", "id": "", "device_id": "", "options": { "replaygain_mode": "", "preamp_gain": } } ``` -------------------------------- ### Get Transport Type Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Retrieves the currently selected transport type, which can be 'gapless' or 'crossfade'. ```json { "name": "get_transport_type", "type": "request", "id": "", "device_id": "", "options": { /* none */ } } ``` -------------------------------- ### Build Main Application for Raspberry Pi Source: https://github.com/clangen/musikcube/blob/master/doc/crosscompile-rpi.md Compile the main application using the previously built dependencies and the cross-compile toolchain. ```bash cd /build/musikcube CROSSCOMPILE=rpi-armv6 ./script/archive-standalone-nix.sh 3.0.2 ``` -------------------------------- ### Play At Index Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Plays a track from the current play queue at a specified index, with an optional start time. ```json { "name": "play_at_index", "type": "request", "id": "", "device_id": "", "options": { "index": , /* optional */ "time": /* in seconds. optional */ } } ``` -------------------------------- ### Configure Wi-Fi Connection Source: https://github.com/clangen/musikcube/wiki/raspberry-pi Edit the wpa_supplicant configuration file to add your Wi-Fi network's SSID and password. Ensure the country code is set correctly. A reboot is recommended after changes. ```bash sudo vim /etc/wpa_supplicant/wpa_supplicant.conf ``` ```text country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="ACCESS_POINT_NAME" psk="WIFI_PASSWORD" } ``` ```bash sudo reboot ``` -------------------------------- ### Get Equalizer Settings Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Retrieves the current equalizer settings. This command is available from version 0.60.0 onwards. ```json { "name": "get_equalizer_settings", "type": "request", "id": "", "device_id": "", "options": { } } ``` -------------------------------- ### Get Transport Type Response Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Response indicating the current transport type. The type can be either 'gapless' or 'crossfade'. ```json { "name": "get_transport_type", "type": "response", "id": "", "options": { "type": "" } } ``` -------------------------------- ### Get Playback Overview Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Requests the current playback overview from the server to update client-side transport controls. ```json { "name": "get_playback_overview", "type": "request", "id": "", "device_id": "", "options": { } } ``` -------------------------------- ### Update System Packages Source: https://github.com/clangen/musikcube/wiki/raspberry-pi Update the package list and upgrade all installed packages to their latest versions. A reboot may be necessary. ```bash sudo apt-get update ``` ```bash sudo apt-get dist-upgrade ``` ```bash sudo reboot ``` -------------------------------- ### Add Server Include Directories Source: https://github.com/clangen/musikcube/blob/master/src/plugins/server/CMakeLists.txt Specifies directories to search for header files for the server library. 'BEFORE' ensures these are checked first. ```cmake target_include_directories(server BEFORE PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include") target_include_directories(server BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES}) ``` -------------------------------- ### Get Playback Overview Response Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation The response containing the playback overview resource, used to update client transport controls. ```json { "name": "get_playback_overview", "type": "response", "id": "", "options": { /* playback overview resource */ } } ``` -------------------------------- ### Create MusikCube systemd Service File Source: https://github.com/clangen/musikcube/wiki/installing Create the systemd service file for the musikcube daemon. This involves creating the file and then editing it. ```bash sudo touch /etc/systemd/system/musikcube.service sudo systemctl edit --full musikcube.service ``` -------------------------------- ### Play All Tracks Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Replaces the current play queue with all available tracks (optionally filtered) and starts playback from a specified index and time. ```json { "name": "play_all_tracks", "type": "request", "id": "", "device_id": "", "options": { "index": , /* optional */ "time": , /* in seconds. optional */ "filter": "" /* optional */ } } ``` -------------------------------- ### HTTP Basic Authentication Header Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Example of the Authorization header required for HTTP Basic Authentication. Credentials are base64 encoded username and password. ```http Authorization: Basic ZGVmYXVsdDpteXBhc3N3b3Jk ``` -------------------------------- ### Update and Upgrade Raspbian Packages Source: https://github.com/clangen/musikcube/blob/master/doc/crosscompile-rpi.md Run these commands within the Raspberry Pi chroot environment or on the device to update package lists and upgrade installed packages. ```bash apt-get update sudo apt-get dist-upgrade ``` -------------------------------- ### List Output Drivers Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Requests a list of all available audio output drivers and their associated devices. This request has no options. ```json { "name": "list_output_drivers", "type": "request", "id": "", "device_id": "", "options": { /* none */ } } ``` -------------------------------- ### Register QEMU Interpreter Source: https://github.com/clangen/musikcube/blob/master/doc/rpi-buster-chroot.md Registers qemu-arm-static as the interpreter for ARM binaries within the chroot environment by writing to the binfmt_misc interface. This step requires root privileges and should not be run with sudo. ```bash su ``` ```bash echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register ``` ```bash exit ``` -------------------------------- ### Get Equalizer Settings Response Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Response containing equalizer settings, including whether it's enabled and a list of frequency bands with their gain values. Band frequencies are server-determined. ```json { "name": "get_equalizer_settings", "type": "response", "id": "", "options": { "enabled": , "bands": [ {"": }, ... ] } } ``` -------------------------------- ### set_gain_settings Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Sets preamp and replaygain settings for a device. ```APIDOC ## set_gain_settings ### Description Sets preamp and replaygain settings for the specified device. ### Method Not specified (assumed to be a JSON-RPC or similar request) ### Endpoint Not specified ### Parameters #### Request Body - **name** (string) - Required - "update_gain_settings" - **type** (string) - Required - "request" - **id** (string) - Required - Unique identifier for the request - **device_id** (string) - Required - Unique device identifier - **options** (object) - **replaygain_mode** (string) - Optional - The replaygain mode: "disabled", "album", or "track" - **preamp_gain** (float32) - Optional - The preamp gain value, ranging from -20.0 to 20.0 ### Request Example ```json { "name": "update_gain_settings", "type": "request", "id": "", "device_id": "", "options": { "replaygain_mode": "album", "preamp_gain": -3.0 } } ``` ### Response #### Success Response Generic success/failure response. ``` -------------------------------- ### Define Executable Sources Source: https://github.com/clangen/musikcube/blob/master/src/core_c_demo/CMakeLists.txt Defines the source files for the core_c_demo executable. ```cmake set (CORE_C_DEMO_SRCS ./main.c ) ``` -------------------------------- ### Set Permissions for Let's Encrypt Live Directory Source: https://github.com/clangen/musikcube/wiki/ssl-server-setup Changes group ownership and permissions for the Let's Encrypt live directory to allow access by the web server user. ```bash sudo chgrp www-data /etc/letsencrypt/live ``` ```bash sudo chmod 750 /etc/letsencrypt/live ``` -------------------------------- ### Define Post-Build Target and Command Source: https://github.com/clangen/musikcube/blob/master/CMakeLists.txt Defines a custom target 'postbuild' that depends on 'musikcube' and 'musikcubed'. It also configures a post-build command to execute a script for further processing. ```cmake add_custom_target(postbuild ALL DEPENDS musikcube musikcubed) ``` ```cmake add_custom_command( TARGET postbuild POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/script/post-build.sh" ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SYSTEM_NAME} ${CMAKE_BUILD_TYPE} ${BUILD_STANDALONE}) ``` -------------------------------- ### Configure NullOut Plugin Build Source: https://github.com/clangen/musikcube/blob/master/src/plugins/nullout/CMakeLists.txt Defines source files and builds the NullOut plugin as a shared library. Ensure target_link_libraries is used for any dependencies. ```cmake set (nullout_SOURCES nullout_plugin.cpp NullOut.cpp ) add_library(nullout SHARED ${nullout_SOURCES}) target_link_libraries(nullout) ``` -------------------------------- ### get_gain_settings Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Retrieves the current preamp and replaygain settings for a device. ```APIDOC ## get_gain_settings ### Description Retrieves preamp and replaygain settings for the specified device. ### Method Not specified (assumed to be a JSON-RPC or similar request) ### Endpoint Not specified ### Parameters #### Request Body - **name** (string) - Required - "get_gain_settings" - **type** (string) - Required - "request" - **id** (string) - Required - Unique identifier for the request - **device_id** (string) - Required - Unique device identifier - **options** (object) - Required - Must be empty ### Request Example ```json { "name": "get_gain_settings", "type": "request", "id": "", "device_id": "", "options": {} } ``` ### Response #### Success Response (200) - **name** (string) - The name of the response, "get_gain_settings" - **type** (string) - "response" - **id** (string) - The ID of the original request - **options** (object) - **replaygain_mode** (string) - The replaygain mode: "disabled", "album", or "track" - **preamp_gain** (float32) - The preamp gain value, ranging from -20.0 to 20.0 #### Response Example ```json { "name": "get_gain_settings", "type": "response", "id": "", "options": { "replaygain_mode": "track", "preamp_gain": 5.5 } } ``` ``` -------------------------------- ### Run Indexer Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Initiates a metadata rescan of the user's library. Choose between `reindex` to scan only updated files or `rebuild` to scan all files regardless of modification status. ```json { "name": "run_indexer", "type": "request", "id": "", "device_id": "", "options": { "type": "" } } ``` -------------------------------- ### Set Default Output Driver Request Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Sets the playback system's default driver and device. Playback is automatically re-routed immediately. ```json { "name": "set_default_output_driver", "type": "request", "id": "", "device_id": "", "options": { "driver_name": "", "device_id": "" /* optional. */ } } ``` -------------------------------- ### Find and Link Libraries Source: https://github.com/clangen/musikcube/blob/master/src/musikcubed/CMakeLists.txt Locates the 'ev' library (libev.a) and links it along with other specified libraries to the musikcubed executable. The library search path is conditional based on the BUILD_STANDALONE flag. ```cmake if (${BUILD_STANDALONE} MATCHES "true") find_library(EVLIB NAMES libev.a ev) else() find_library(EVLIB NAMES ev) endif() target_link_libraries(musikcubed ${musikcube_LINK_LIBS} ${EVLIB} musikcore) ``` -------------------------------- ### Request: get_playback_overview Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation Returns a playback overview, suitable for updating transport controls on the client to match server playback state. ```APIDOC ## Request: get_playback_overview ### Description Returns a playback overview, suitable for updating transport controls on the client to match server playback state. ### Request Format ```json { "name": "get_playback_overview", "type": "request", "id": "", "device_id": "", "options": { } } ``` ### Response Format ```json { "name": "get_playback_overview", "type": "response", "id": "", "options": { /* playback overview resource */ } } ``` ``` -------------------------------- ### List Output Drivers Response Source: https://github.com/clangen/musikcube/wiki/remote-api-documentation The response includes the currently selected output driver and device, as well as a list of all available drivers and their respective devices. ```json { "name": "list_output_drivers", "type": "response", "id": "", "options": { "selected": { "driver_name": "", "device_id": "" }, "all": [ { "driver_name": "", "devices": [ { "device_name": "", "device_id": "" }, ... ], ... }, ... ] } } ```