VirtualBox

source: vbox/trunk/src/VBox/Main/src-server/HostAudioDeviceImpl.cpp@ 95424

最後變更 在這個檔案從95424是 95424,由 vboxsync 提交於 3 年 前

Audio/Main: Bigger revamp of the audio interface(s) to later also support host audio device enumeration and selection for individual VMs. The audio settings now live in a dedicated (per-VM) IAudioSettings interface (audio adapter + audio host device stuff), to further tidy up the IMachine interface. Also added stubs for IAudioDevice + IHostAudioDevice, plus enmuerations, left for further implementation. Added a new IHostAudioDeviceChangedEvent that can also be used later by API clients [build fix]. bugref:10050

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 2.2 KB
 
1/* $Id: HostAudioDeviceImpl.cpp 95424 2022-06-29 11:23:10Z 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
33HostAudioDevice::HostAudioDevice()
34{
35}
36
37HostAudioDevice::~HostAudioDevice()
38{
39}
40
41HRESULT HostAudioDevice::FinalConstruct()
42{
43 return BaseFinalConstruct();
44}
45
46void 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 adapter object.
58 *
59 * @param aParent Handle of the parent object.
60 */
61HRESULT 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 */
77void HostAudioDevice::uninit()
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////////////////////////////////////////////////////////////////////////////////
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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