VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h@ 37126

Last change on this file since 37126 was 36924, checked in by vboxsync, 13 years ago

FE/Qt: 4989: UISettingsCache template integrated into Audio page.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 2.8 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * UIMachineSettingsAudio class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2011 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef __UIMachineSettingsAudio_h__
20#define __UIMachineSettingsAudio_h__
21
22#include "UISettingsPage.h"
23#include "UIMachineSettingsAudio.gen.h"
24#include "COMDefs.h"
25
26/* Machine settings / Audio page / Data: */
27struct UIDataSettingsMachineAudio
28{
29 /* Default constructor: */
30 UIDataSettingsMachineAudio()
31 : m_fAudioEnabled(false)
32 , m_audioDriverType(KAudioDriverType_Null)
33 , m_audioControllerType(KAudioControllerType_AC97) {}
34 /* Functions: */
35 bool equal(const UIDataSettingsMachineAudio &other) const
36 {
37 return (m_fAudioEnabled == other.m_fAudioEnabled) &&
38 (m_audioDriverType == other.m_audioDriverType) &&
39 (m_audioControllerType == other.m_audioControllerType);
40 }
41 /* Operators: */
42 bool operator==(const UIDataSettingsMachineAudio &other) const { return equal(other); }
43 bool operator!=(const UIDataSettingsMachineAudio &other) const { return !equal(other); }
44 /* Variables: */
45 bool m_fAudioEnabled;
46 KAudioDriverType m_audioDriverType;
47 KAudioControllerType m_audioControllerType;
48};
49typedef UISettingsCache<UIDataSettingsMachineAudio> UICacheSettingsMachineAudio;
50
51/* Machine settings / Audio page: */
52class UIMachineSettingsAudio : public UISettingsPageMachine,
53 public Ui::UIMachineSettingsAudio
54{
55 Q_OBJECT;
56
57public:
58
59 UIMachineSettingsAudio();
60
61protected:
62
63 /* Load data to cashe from corresponding external object(s),
64 * this task COULD be performed in other than GUI thread: */
65 void loadToCacheFrom(QVariant &data);
66 /* Load data to corresponding widgets from cache,
67 * this task SHOULD be performed in GUI thread only: */
68 void getFromCache();
69
70 /* Save data from corresponding widgets to cache,
71 * this task SHOULD be performed in GUI thread only: */
72 void putToCache();
73 /* Save data from cache to corresponding external object(s),
74 * this task COULD be performed in other than GUI thread: */
75 void saveFromCacheTo(QVariant &data);
76
77 void setOrderAfter (QWidget *aWidget);
78
79 void retranslateUi();
80
81private:
82
83 void prepareComboboxes();
84
85 void polishPage();
86
87 /* Cache: */
88 UICacheSettingsMachineAudio m_cache;
89};
90
91#endif // __UIMachineSettingsAudio_h__
92
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use