Skip to content

General commands

This class is accessed via the general property on a CamillaClient instance.

It provides the basic methods such as starting and stopping processing.

class: General

Bases: _CommandGroup

Basic commands

Source code in camilladsp/camilladsp.py
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
class General(_CommandGroup):
    """
    Basic commands
    """

    # ========================= CamillaDSP state =========================

    def state(self) -> Optional[ProcessingState]:
        """
        Get current processing state.

        Returns:
            ProcessingState | None: Current processing state.
        """
        state = self.client.query("GetState")
        return _state_from_string(state)

    def stop_reason(self) -> StopReason:
        """
        Get reason why processing stopped.

        Returns:
            StopReason: Stop reason enum variant.
        """
        reason = self.client.query("GetStopReason")
        return _reason_from_reply(reason)

    # ========================= Basic commands =========================

    def stop(self):
        """
        Stop processing and wait for new config if wait mode is active, else exit.
        """
        self.client.query("Stop")

    def exit(self):
        """
        Stop processing and exit.
        """
        self.client.query("Exit")

    def reload(self):
        """
        Reload config from disk.
        """
        self.client.query("Reload")

    def supported_device_types(self) -> Tuple[List[str], List[str]]:
        """
        Read what device types the running CamillaDSP process supports.
        Returns a tuple with two lists of device types,
        the first for playback and the second for capture.

        Returns:
            Tuple[List[str], List[str]]: A tuple containing two lists,
                with the supported playback and capture device types.
        """
        (playback, capture) = self.client.query("GetSupportedDeviceTypes")
        return (playback, capture)

    def state_file_path(self) -> Optional[str]:
        """
        Get path to current state file.

        Returns:
            str | None: Path to state file, or None.
        """
        path = self.client.query("GetStateFilePath")
        return path

    def state_file_updated(self) -> bool:
        """
        Check if all changes have been saved to the state file.

        Returns:
            bool: True if all changes are saved.
        """
        updated = self.client.query("GetStateFileUpdated")
        return updated

    def list_playback_devices(self, value: str) -> List[Tuple[str, str]]:
        """
        List the available playback devices for a given backend.
        Returns a list of tuples. Returns the system name and
        a descriptive name for each device.
        For some backends, those two names are identical.

        Returns:
            List[Tuple[str, str]: A list containing tuples of two strings,
                with system device name and a descriptive name.
        """
        devs = self.client.query("GetAvailablePlaybackDevices", arg=value)
        return devs

    def list_capture_devices(self, value: str) -> List[Tuple[str, str]]:
        """
        List the available capture devices for a given backend.
        Returns a list of tuples. Returns the system name and
        a descriptive name for each device.
        For some backends, those two names are identical.

        Returns:
            List[Tuple[str, str]: A list containing tuples of two strings,
                with system device name and a descriptive name.
        """
        devs = self.client.query("GetAvailableCaptureDevices", arg=value)
        return devs

exit()

Stop processing and exit.

Source code in camilladsp/camilladsp.py
765
766
767
768
769
def exit(self):
    """
    Stop processing and exit.
    """
    self.client.query("Exit")

list_capture_devices(value)

List the available capture devices for a given backend. Returns a list of tuples. Returns the system name and a descriptive name for each device. For some backends, those two names are identical.

Returns:

Type Description
List[Tuple[str, str]]

List[Tuple[str, str]: A list containing tuples of two strings, with system device name and a descriptive name.

Source code in camilladsp/camilladsp.py
824
825
826
827
828
829
830
831
832
833
834
835
836
def list_capture_devices(self, value: str) -> List[Tuple[str, str]]:
    """
    List the available capture devices for a given backend.
    Returns a list of tuples. Returns the system name and
    a descriptive name for each device.
    For some backends, those two names are identical.

    Returns:
        List[Tuple[str, str]: A list containing tuples of two strings,
            with system device name and a descriptive name.
    """
    devs = self.client.query("GetAvailableCaptureDevices", arg=value)
    return devs

list_playback_devices(value)

List the available playback devices for a given backend. Returns a list of tuples. Returns the system name and a descriptive name for each device. For some backends, those two names are identical.

Returns:

Type Description
List[Tuple[str, str]]

List[Tuple[str, str]: A list containing tuples of two strings, with system device name and a descriptive name.

Source code in camilladsp/camilladsp.py
810
811
812
813
814
815
816
817
818
819
820
821
822
def list_playback_devices(self, value: str) -> List[Tuple[str, str]]:
    """
    List the available playback devices for a given backend.
    Returns a list of tuples. Returns the system name and
    a descriptive name for each device.
    For some backends, those two names are identical.

    Returns:
        List[Tuple[str, str]: A list containing tuples of two strings,
            with system device name and a descriptive name.
    """
    devs = self.client.query("GetAvailablePlaybackDevices", arg=value)
    return devs

reload()

Reload config from disk.

Source code in camilladsp/camilladsp.py
771
772
773
774
775
def reload(self):
    """
    Reload config from disk.
    """
    self.client.query("Reload")

state()

Get current processing state.

Returns:

Type Description
Optional[ProcessingState]

ProcessingState | None: Current processing state.

Source code in camilladsp/camilladsp.py
737
738
739
740
741
742
743
744
745
def state(self) -> Optional[ProcessingState]:
    """
    Get current processing state.

    Returns:
        ProcessingState | None: Current processing state.
    """
    state = self.client.query("GetState")
    return _state_from_string(state)

state_file_path()

Get path to current state file.

Returns:

Type Description
Optional[str]

str | None: Path to state file, or None.

Source code in camilladsp/camilladsp.py
790
791
792
793
794
795
796
797
798
def state_file_path(self) -> Optional[str]:
    """
    Get path to current state file.

    Returns:
        str | None: Path to state file, or None.
    """
    path = self.client.query("GetStateFilePath")
    return path

state_file_updated()

Check if all changes have been saved to the state file.

Returns:

Name Type Description
bool bool

True if all changes are saved.

Source code in camilladsp/camilladsp.py
800
801
802
803
804
805
806
807
808
def state_file_updated(self) -> bool:
    """
    Check if all changes have been saved to the state file.

    Returns:
        bool: True if all changes are saved.
    """
    updated = self.client.query("GetStateFileUpdated")
    return updated

stop()

Stop processing and wait for new config if wait mode is active, else exit.

Source code in camilladsp/camilladsp.py
759
760
761
762
763
def stop(self):
    """
    Stop processing and wait for new config if wait mode is active, else exit.
    """
    self.client.query("Stop")

stop_reason()

Get reason why processing stopped.

Returns:

Name Type Description
StopReason StopReason

Stop reason enum variant.

Source code in camilladsp/camilladsp.py
747
748
749
750
751
752
753
754
755
def stop_reason(self) -> StopReason:
    """
    Get reason why processing stopped.

    Returns:
        StopReason: Stop reason enum variant.
    """
    reason = self.client.query("GetStopReason")
    return _reason_from_reply(reason)

supported_device_types()

Read what device types the running CamillaDSP process supports. Returns a tuple with two lists of device types, the first for playback and the second for capture.

Returns:

Type Description
Tuple[List[str], List[str]]

Tuple[List[str], List[str]]: A tuple containing two lists, with the supported playback and capture device types.

Source code in camilladsp/camilladsp.py
777
778
779
780
781
782
783
784
785
786
787
788
def supported_device_types(self) -> Tuple[List[str], List[str]]:
    """
    Read what device types the running CamillaDSP process supports.
    Returns a tuple with two lists of device types,
    the first for playback and the second for capture.

    Returns:
        Tuple[List[str], List[str]]: A tuple containing two lists,
            with the supported playback and capture device types.
    """
    (playback, capture) = self.client.query("GetSupportedDeviceTypes")
    return (playback, capture)