1 | /* $Id: HostAudioDeviceImpl.cpp 95425 2022-06-29 11:32:32Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation - Host audio device implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.alldomusa.eu.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #define LOG_GROUP LOG_GROUP_MAIN_HOSTAUDIODEVICE
|
---|
19 | #include "HostAudioDeviceImpl.h"
|
---|
20 | #include "VirtualBoxImpl.h"
|
---|
21 |
|
---|
22 | #include <iprt/cpp/utils.h>
|
---|
23 |
|
---|
24 | #include <VBox/settings.h>
|
---|
25 |
|
---|
26 | #include "AutoCaller.h"
|
---|
27 | #include "LoggingNew.h"
|
---|
28 |
|
---|
29 |
|
---|
30 | // constructor / destructor
|
---|
31 | ////////////////////////////////////////////////////////////////////////////////
|
---|
32 |
|
---|
33 | HostAudioDevice::HostAudioDevice()
|
---|
34 | {
|
---|
35 | }
|
---|
36 |
|
---|
37 | HostAudioDevice::~HostAudioDevice()
|
---|
38 | {
|
---|
39 | }
|
---|
40 |
|
---|
41 | HRESULT HostAudioDevice::FinalConstruct()
|
---|
42 | {
|
---|
43 | return BaseFinalConstruct();
|
---|
44 | }
|
---|
45 |
|
---|
46 | void HostAudioDevice::FinalRelease()
|
---|
47 | {
|
---|
48 | uninit();
|
---|
49 | BaseFinalRelease();
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 | // public initializer/uninitializer for internal purposes only
|
---|
54 | ////////////////////////////////////////////////////////////////////////////////
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * Initializes the audio device object.
|
---|
58 | *
|
---|
59 | * @returns HRESULT
|
---|
60 | */
|
---|
61 | HRESULT HostAudioDevice::init(void)
|
---|
62 | {
|
---|
63 | /* Enclose the state transition NotReady->InInit->Ready */
|
---|
64 | AutoInitSpan autoInitSpan(this);
|
---|
65 | AssertReturn(autoInitSpan.isOk(), E_FAIL);
|
---|
66 |
|
---|
67 | /* Confirm a successful initialization */
|
---|
68 | autoInitSpan.setSucceeded();
|
---|
69 |
|
---|
70 | return S_OK;
|
---|
71 | }
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Uninitializes the instance and sets the ready flag to FALSE.
|
---|
75 | * Called either from FinalRelease() or by the parent when it gets destroyed.
|
---|
76 | */
|
---|
77 | void HostAudioDevice::uninit(void)
|
---|
78 | {
|
---|
79 | LogFlowThisFunc(("\n"));
|
---|
80 |
|
---|
81 | /* Enclose the state transition Ready->InUninit->NotReady */
|
---|
82 | AutoUninitSpan autoUninitSpan(this);
|
---|
83 | if (autoUninitSpan.uninitDone())
|
---|
84 | return;
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|
88 | // IHostAudioDevice properties
|
---|
89 | ////////////////////////////////////////////////////////////////////////////////
|
---|