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\general.py
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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\general.py
53
54
55
56
57
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\general.py
112
113
114
115
116
117
118
119
120
121
122
123
124
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\general.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
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\general.py
59
60
61
62
63
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\general.py
25
26
27
28
29
30
31
32
33
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\general.py
78
79
80
81
82
83
84
85
86
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\general.py
88
89
90
91
92
93
94
95
96
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\general.py
47
48
49
50
51
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\general.py
35
36
37
38
39
40
41
42
43
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\general.py
65
66
67
68
69
70
71
72
73
74
75
76
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)