1 | /* $Id: AudioAdapterImpl.h 30764 2010-07-09 14:12:12Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2007 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 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
53 | COM_INTERFACE_ENTRY(IAudioAdapter)
|
---|
54 | COM_INTERFACE_ENTRY(IDispatch)
|
---|
55 | END_COM_MAP()
|
---|
56 |
|
---|
57 | DECLARE_EMPTY_CTOR_DTOR (AudioAdapter)
|
---|
58 |
|
---|
59 | HRESULT FinalConstruct();
|
---|
60 | void FinalRelease();
|
---|
61 |
|
---|
62 | // public initializer/uninitializer for internal purposes only
|
---|
63 | HRESULT init(Machine *aParent);
|
---|
64 | HRESULT init(Machine *aParent, AudioAdapter *aThat);
|
---|
65 | HRESULT initCopy(Machine *aParent, AudioAdapter *aThat);
|
---|
66 | void uninit();
|
---|
67 |
|
---|
68 | STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
|
---|
69 | STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
|
---|
70 | STDMETHOD(COMGETTER(AudioDriver))(AudioDriverType_T *aAudioDriverType);
|
---|
71 | STDMETHOD(COMSETTER(AudioDriver))(AudioDriverType_T aAudioDriverType);
|
---|
72 | STDMETHOD(COMGETTER(AudioController))(AudioControllerType_T *aAudioControllerType);
|
---|
73 | STDMETHOD(COMSETTER(AudioController))(AudioControllerType_T aAudioControllerType);
|
---|
74 |
|
---|
75 | // public methods only for internal purposes
|
---|
76 |
|
---|
77 | HRESULT loadSettings(const settings::AudioAdapter &data);
|
---|
78 | HRESULT saveSettings(settings::AudioAdapter &data);
|
---|
79 |
|
---|
80 | void rollback();
|
---|
81 | void commit();
|
---|
82 | void copyFrom(AudioAdapter *aThat);
|
---|
83 |
|
---|
84 | private:
|
---|
85 |
|
---|
86 | Machine * const mParent;
|
---|
87 | const ComObjPtr<AudioAdapter> mPeer;
|
---|
88 |
|
---|
89 | Backupable<Data> mData;
|
---|
90 | };
|
---|
91 |
|
---|
92 | #endif // ____H_AUDIOADAPTER
|
---|
93 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|