1 | /* $Id: AudioSettingsImpl.h 95423 2022-06-29 11:13:40Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2022 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef MAIN_INCLUDED_AudioSettingsImpl_h
|
---|
21 | #define MAIN_INCLUDED_AudioSettingsImpl_h
|
---|
22 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
23 | # pragma once
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #include "AudioAdapterImpl.h"
|
---|
27 | #include "GuestOSTypeImpl.h"
|
---|
28 |
|
---|
29 | #include "AudioSettingsWrap.h"
|
---|
30 | namespace settings
|
---|
31 | {
|
---|
32 | struct AudioSettings;
|
---|
33 | }
|
---|
34 |
|
---|
35 | class ATL_NO_VTABLE AudioSettings :
|
---|
36 | public AudioSettingsWrap
|
---|
37 | {
|
---|
38 | public:
|
---|
39 |
|
---|
40 | DECLARE_COMMON_CLASS_METHODS(AudioSettings)
|
---|
41 |
|
---|
42 | HRESULT FinalConstruct();
|
---|
43 | void FinalRelease();
|
---|
44 |
|
---|
45 | // public initializer/uninitializer for internal purposes only
|
---|
46 | HRESULT init(Machine *aParent);
|
---|
47 | HRESULT init(Machine *aParent, AudioSettings *aThat);
|
---|
48 | HRESULT initCopy(Machine *aParent, AudioSettings *aThat);
|
---|
49 | void uninit();
|
---|
50 |
|
---|
51 | HRESULT getHostAudioDevice(AudioDirection_T aUsage, ComPtr<IHostAudioDevice> &aDevice);
|
---|
52 | HRESULT setHostAudioDevice(const ComPtr<IHostAudioDevice> &aDevice, AudioDirection_T aUsage);
|
---|
53 | HRESULT getAdapter(ComPtr<IAudioAdapter> &aAdapter);
|
---|
54 |
|
---|
55 | // public methods only for internal purposes
|
---|
56 | Machine* i_getParent(void);
|
---|
57 | bool i_canChangeSettings(void);
|
---|
58 | void i_onAdapterChanged(IAudioAdapter *pAdapter);
|
---|
59 | void i_onHostDeviceChanged(IHostAudioDevice *pDevice, bool fIsNew, AudioDeviceState_T enmState, IVirtualBoxErrorInfo *pErrInfo);
|
---|
60 | void i_onSettingsChanged(void);
|
---|
61 | HRESULT i_loadSettings(const settings::AudioAdapter &data);
|
---|
62 | HRESULT i_saveSettings(settings::AudioAdapter &data);
|
---|
63 | void i_copyFrom(AudioSettings *aThat);
|
---|
64 | HRESULT i_applyDefaults(ComObjPtr<GuestOSType> &aGuestOsType);
|
---|
65 |
|
---|
66 | void i_rollback();
|
---|
67 | void i_commit();
|
---|
68 |
|
---|
69 | private:
|
---|
70 |
|
---|
71 | struct Data;
|
---|
72 | Data *m;
|
---|
73 | };
|
---|
74 | #endif /* !MAIN_INCLUDED_AudioSettingsImpl_h */
|
---|
75 |
|
---|