1 | /* $Id: AudioAdapterImpl.h 44528 2013-02-04 14:27:54Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2011 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 ____H_AUDIOADAPTER
|
---|
21 | #define ____H_AUDIOADAPTER
|
---|
22 |
|
---|
23 | #include "VirtualBoxBase.h"
|
---|
24 |
|
---|
25 | namespace settings
|
---|
26 | {
|
---|
27 | struct AudioAdapter;
|
---|
28 | }
|
---|
29 |
|
---|
30 | class ATL_NO_VTABLE AudioAdapter :
|
---|
31 | public VirtualBoxBase,
|
---|
32 | VBOX_SCRIPTABLE_IMPL(IAudioAdapter)
|
---|
33 | {
|
---|
34 | public:
|
---|
35 |
|
---|
36 | struct Data
|
---|
37 | {
|
---|
38 | Data();
|
---|
39 |
|
---|
40 | BOOL mEnabled;
|
---|
41 | AudioDriverType_T mAudioDriver;
|
---|
42 | AudioControllerType_T mAudioController;
|
---|
43 | };
|
---|
44 |
|
---|
45 | VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(AudioAdapter, IAudioAdapter)
|
---|
46 |
|
---|
47 | DECLARE_NOT_AGGREGATABLE(AudioAdapter)
|
---|
48 |
|
---|
49 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
50 |
|
---|
51 | BEGIN_COM_MAP(AudioAdapter)
|
---|
52 | VBOX_DEFAULT_INTERFACE_ENTRIES(IAudioAdapter)
|
---|
53 | END_COM_MAP()
|
---|
54 |
|
---|
55 | DECLARE_EMPTY_CTOR_DTOR (AudioAdapter)
|
---|
56 |
|
---|
57 | HRESULT FinalConstruct();
|
---|
58 | void FinalRelease();
|
---|
59 |
|
---|
60 | // public initializer/uninitializer for internal purposes only
|
---|
61 | HRESULT init(Machine *aParent);
|
---|
62 | HRESULT init(Machine *aParent, AudioAdapter *aThat);
|
---|
63 | HRESULT initCopy(Machine *aParent, AudioAdapter *aThat);
|
---|
64 | void uninit();
|
---|
65 |
|
---|
66 | STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
|
---|
67 | STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
|
---|
68 | STDMETHOD(COMGETTER(AudioDriver))(AudioDriverType_T *aAudioDriverType);
|
---|
69 | STDMETHOD(COMSETTER(AudioDriver))(AudioDriverType_T aAudioDriverType);
|
---|
70 | STDMETHOD(COMGETTER(AudioController))(AudioControllerType_T *aAudioControllerType);
|
---|
71 | STDMETHOD(COMSETTER(AudioController))(AudioControllerType_T aAudioControllerType);
|
---|
72 |
|
---|
73 | // public methods only for internal purposes
|
---|
74 |
|
---|
75 | HRESULT loadSettings(const settings::AudioAdapter &data);
|
---|
76 | HRESULT saveSettings(settings::AudioAdapter &data);
|
---|
77 |
|
---|
78 | void rollback();
|
---|
79 | void commit();
|
---|
80 | void copyFrom(AudioAdapter *aThat);
|
---|
81 |
|
---|
82 | private:
|
---|
83 |
|
---|
84 | Machine * const mParent;
|
---|
85 | const ComObjPtr<AudioAdapter> mPeer;
|
---|
86 |
|
---|
87 | Backupable<Data> mData;
|
---|
88 | };
|
---|
89 |
|
---|
90 | #endif // ____H_AUDIOADAPTER
|
---|
91 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|