Skip to content

AdelaideSky/GoXlrKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors OpenIssues ClosedIssues Discord License

GoXlrKit

GoXlrKit allows accessing to the status of every GoXLR connected, as well as sending commands to the connected GoXLRs. This module also brings controls on the GoXlr-utility itself.

Installation

Go in File -> Add packages... and paste the following URL in the search bar:

https://github.com/Adelenade/GoXlrKit

Don't forget to add inside the Sources/GoXlrKit/Ressources folder a build of the goxlr utility's goxlr-daemon and of the goxlr-defaults ! If you don't, every utility-related command will fail (startObserving, daemon.start etc...) and will make your app crash.

Usage

Here is a little example on how you can use this package:

import SwiftUI
import GoXlrKit

struct ContentView: View {
    
    @ObservedObject var goxlr = GoXlr.shared
    
    var body: some View {
        VStack {
            if goxlr.status != nil {
                Text("Connected to the Daemon with GoXlr \(goxlr.device)")
                    .padding()
                Text("Goxlr's System volume: \(goxlr.mixer?.levels.volumes.system ?? 0)")
                Button("Set System volume to 100%") {
                    guard goxlr.device != "" else { return } // check if a GoXlr is connected
                    
                    goxlr.command(.SetVolume(.System, 255)) //Set System volume to maximum. Volumes are a Float going from 0 to 255 
                    //By default, the command is sent to the first device connected. 
                }.disabled(goxlr.status == nil)
                
            } else {
                ProgressView()
            }
        }.onAppear() {
            goxlr.startObserving() // Start the Daemon and connect to its WebSocket
            //If you don't need to connect to the websocket, you can do goxlr.daemon.start(args: [DaemonArguments])
            //If you only need to connect to the websocket, do goxlr.socket.connect()
            
            //Make sure the utility isn't already launched, else the app will crash
        }
        .padding()
    }
}

This project is not supported by, or affiliated in any way with, TC-Helicon. For the official GoXLR software, please refer to their website.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages