VirtualBox

source: vbox/trunk/src/VBox/Main/include/AudioAdapterImpl.h@ 22309

Last change on this file since 22309 was 22183, checked in by vboxsync, 15 years ago

Main: fix more windows warnings + burns

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: AudioAdapterImpl.h 22183 2009-08-11 17:00:33Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_AUDIOADAPTER
25#define ____H_AUDIOADAPTER
26
27#include "VirtualBoxBase.h"
28
29class Machine;
30
31namespace settings
32{
33 struct AudioAdapter;
34}
35
36class ATL_NO_VTABLE AudioAdapter :
37 public VirtualBoxBase,
38 public VirtualBoxSupportErrorInfoImpl<AudioAdapter, IAudioAdapter>,
39 public VirtualBoxSupportTranslation<AudioAdapter>,
40 VBOX_SCRIPTABLE_IMPL(IAudioAdapter)
41{
42public:
43
44 struct Data
45 {
46 Data();
47
48 bool operator== (const Data &that) const
49 {
50 return this == &that ||
51 (mEnabled == that.mEnabled &&
52 mAudioDriver == that.mAudioDriver &&
53 mAudioController == that.mAudioController);
54 }
55
56 BOOL mEnabled;
57 AudioDriverType_T mAudioDriver;
58 AudioControllerType_T mAudioController;
59 };
60
61 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (AudioAdapter)
62
63 DECLARE_NOT_AGGREGATABLE(AudioAdapter)
64
65 DECLARE_PROTECT_FINAL_CONSTRUCT()
66
67 BEGIN_COM_MAP(AudioAdapter)
68 COM_INTERFACE_ENTRY(ISupportErrorInfo)
69 COM_INTERFACE_ENTRY(IAudioAdapter)
70 COM_INTERFACE_ENTRY(IDispatch)
71 END_COM_MAP()
72
73 NS_DECL_ISUPPORTS
74
75 DECLARE_EMPTY_CTOR_DTOR (AudioAdapter)
76
77 HRESULT FinalConstruct();
78 void FinalRelease();
79
80 // public initializer/uninitializer for internal purposes only
81 HRESULT init (Machine *aParent);
82 HRESULT init (Machine *aParent, AudioAdapter *aThat);
83 HRESULT initCopy (Machine *aParent, AudioAdapter *aThat);
84 void uninit();
85
86 STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
87 STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
88 STDMETHOD(COMGETTER(AudioDriver)) (AudioDriverType_T *aAudioDriverType);
89 STDMETHOD(COMSETTER(AudioDriver)) (AudioDriverType_T aAudioDriverType);
90 STDMETHOD(COMGETTER(AudioController)) (AudioControllerType_T *aAudioControllerType);
91 STDMETHOD(COMSETTER(AudioController)) (AudioControllerType_T aAudioControllerType);
92
93 // public methods only for internal purposes
94
95 HRESULT loadSettings(const settings::AudioAdapter &data);
96 HRESULT saveSettings(settings::AudioAdapter &data);
97
98 bool isModified() { AutoWriteLock alock (this); return mData.isBackedUp(); }
99 bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); }
100 bool rollback();
101 void commit();
102 void copyFrom (AudioAdapter *aThat);
103
104 // public methods for internal purposes only
105 // (ensure there is a caller and a read lock before calling them!)
106
107 const Backupable <Data> &data() const { return mData; }
108
109 // for VirtualBoxSupportErrorInfoImpl
110 static const wchar_t *getComponentName() { return L"AudioAdapter"; }
111
112private:
113
114 const ComObjPtr<Machine, ComWeakRef> mParent;
115 const ComObjPtr<AudioAdapter> mPeer;
116
117 Backupable <Data> mData;
118};
119
120#endif // ____H_AUDIOADAPTER
121/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette