# AppleDeviceWatcher

<a id="appledevicewatcher"></a>

# AppleDeviceWatcher

```cpp
#include <icy/av/apple/coreaudio.h>

class AppleDeviceWatcher
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:46](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L46)

> **Inherits:** [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher)

Monitors device add/remove events via AVFoundation notifications and CoreAudio property listeners.

## List of all members

| Name | Kind | Owner |
|------|------|-------|
| [`AppleDeviceWatcher`](#appledevicewatcher-1) | `function` | Declared here |
| [`~AppleDeviceWatcher`](#appledevicewatcher-2) | `function` | Declared here |
| [`start`](#start-16) | `function` | Declared here |
| [`stop`](#stop-8) | `function` | Declared here |
| [`_impl`](#_impl-1) | `variable` | Declared here |
| [`_manager`](#_manager-1) | `variable` | Declared here |
| [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher-1) | `function` | Inherited from [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher) |
| [`~DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher-2) | `function` | Inherited from [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher) |
| [`start`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#start-19) | `function` | Inherited from [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher) |
| [`stop`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#stop-10) | `function` | Inherited from [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher) |

## Inherited from [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher)

| Kind | Name | Description |
|------|------|-------------|
| `function` | [`DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher-1) `inline` `explicit` |  |
| `function` | [`~DeviceWatcher`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#devicewatcher-2) `virtual` `noexcept` | Defaulted destructor. |
| `function` | [`start`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#start-19) `virtual` `inline` |  |
| `function` | [`stop`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#stop-10) `virtual` `inline` |  |

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`AppleDeviceWatcher`](#appledevicewatcher-1) `explicit` |  |
|  | [`~AppleDeviceWatcher`](#appledevicewatcher-2) `noexcept` `override` |  |
| `bool` | [`start`](#start-16) `virtual` `override` | Begin monitoring for device connect/disconnect events. |
| `void` | [`stop`](#stop-8) `virtual` `override` | Stop monitoring and release all notification observers. |

---

<a id="appledevicewatcher-1"></a>

### AppleDeviceWatcher

`explicit`

```cpp
explicit AppleDeviceWatcher(DeviceManager * manager)
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:50](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L50)

#### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `manager` | [`DeviceManager`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceManager.md#devicemanager) * | The [DeviceManager](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceManager.md#devicemanager) whose DevicesChanged signal will be emitted on changes. |

---

<a id="appledevicewatcher-2"></a>

### ~AppleDeviceWatcher

`noexcept` `override`

```cpp
~AppleDeviceWatcher() noexcept override
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:51](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L51)

---

<a id="start-16"></a>

### start

`virtual` `override`

```cpp
virtual bool start() override
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:55](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L55)

Begin monitoring for device connect/disconnect events. 
#### Returns
True if monitoring was successfully started.

#### Reimplements

- [`DeviceWatcher::start`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#start-19)

---

<a id="stop-8"></a>

### stop

`virtual` `override`

```cpp
virtual void stop() override
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:58](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L58)

Stop monitoring and release all notification observers.

#### Reimplements

- [`DeviceWatcher::stop`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceWatcher.md#stop-10)

## Private Attributes

| Return | Name | Description |
|--------|------|-------------|
| `std::unique_ptr< Impl >` | [`_impl`](#_impl-1)  |  |
| [`DeviceManager`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceManager.md#devicemanager) * | [`_manager`](#_manager-1)  |  |

---

<a id="_impl-1"></a>

### _impl

```cpp
std::unique_ptr< Impl > _impl
```

[Defined in src/av/include/icy/av/apple/coreaudio.h:63](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L63)

---

<a id="_manager-1"></a>

### _manager

```cpp
DeviceManager * _manager
```

Type: [`DeviceManager`](https://auscaster.com/icey/docs/api-reference/icy-av-DeviceManager.md#devicemanager) *

[Defined in src/av/include/icy/av/apple/coreaudio.h:64](https://github.com/auscaster/icey/blob/main/src/av/include/icy/av/apple/coreaudio.h#L64)
