[75251] | 1 | /* $Id: RecordingSettingsImpl.h 105605 2024-08-06 14:00:56Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
[75926] | 3 | * VirtualBox COM class implementation - Machine recording screen settings.
|
---|
[75251] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2018-2023 Oracle and/or its affiliates.
|
---|
[75251] | 8 | *
|
---|
[96407] | 9 | * This file is part of VirtualBox base platform packages, as
|
---|
| 10 | * available from https://www.virtualbox.org.
|
---|
| 11 | *
|
---|
| 12 | * This program is free software; you can redistribute it and/or
|
---|
| 13 | * modify it under the terms of the GNU General Public License
|
---|
| 14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | * License.
|
---|
| 16 | *
|
---|
| 17 | * This program is distributed in the hope that it will be useful, but
|
---|
| 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | * General Public License for more details.
|
---|
| 21 | *
|
---|
| 22 | * You should have received a copy of the GNU General Public License
|
---|
| 23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | *
|
---|
| 25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
[75251] | 26 | */
|
---|
| 27 |
|
---|
[76562] | 28 | #ifndef MAIN_INCLUDED_RecordingSettingsImpl_h
|
---|
| 29 | #define MAIN_INCLUDED_RecordingSettingsImpl_h
|
---|
[76487] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[75251] | 33 |
|
---|
[75361] | 34 | #include "RecordingSettingsWrap.h"
|
---|
[75251] | 35 |
|
---|
| 36 | namespace settings
|
---|
| 37 | {
|
---|
[105605] | 38 | struct Recording;
|
---|
| 39 | struct RecordingScreen;
|
---|
[75251] | 40 | }
|
---|
| 41 |
|
---|
[75361] | 42 | class RecordingScreenSettings;
|
---|
[75251] | 43 |
|
---|
[75926] | 44 | class ATL_NO_VTABLE RecordingSettings
|
---|
| 45 | : public RecordingSettingsWrap
|
---|
[75251] | 46 | {
|
---|
| 47 | public:
|
---|
| 48 |
|
---|
[90828] | 49 | DECLARE_COMMON_CLASS_METHODS(RecordingSettings)
|
---|
[75251] | 50 |
|
---|
| 51 | HRESULT FinalConstruct();
|
---|
| 52 | void FinalRelease();
|
---|
| 53 |
|
---|
| 54 | // public initializer/uninitializer for internal purposes only
|
---|
| 55 | HRESULT init(Machine *parent);
|
---|
[78068] | 56 | HRESULT init(Machine *parent, RecordingSettings *aThat);
|
---|
| 57 | HRESULT initCopy(Machine *parent, RecordingSettings *aThat);
|
---|
[75251] | 58 | void uninit();
|
---|
| 59 |
|
---|
| 60 | // public methods only for internal purposes
|
---|
[105605] | 61 | HRESULT i_loadSettings(const settings::Recording &Settings);
|
---|
| 62 | HRESULT i_saveSettings(settings::Recording &Settings);
|
---|
[75251] | 63 |
|
---|
[95639] | 64 | void i_rollback(void);
|
---|
| 65 | void i_commit(void);
|
---|
| 66 | HRESULT i_copyFrom(RecordingSettings *aThat);
|
---|
| 67 | void i_applyDefaults(void);
|
---|
[75251] | 68 |
|
---|
[95639] | 69 | int i_getDefaultFilename(Utf8Str &strFile, uint32_t idScreen, bool fWithFileExtension);
|
---|
[96545] | 70 | int i_getFilename(Utf8Str &strFile, uint32_t idScreen, const Utf8Str &strTemplate);
|
---|
[75324] | 71 | bool i_canChangeSettings(void);
|
---|
| 72 | void i_onSettingsChanged(void);
|
---|
| 73 |
|
---|
[75251] | 74 | private:
|
---|
| 75 |
|
---|
[75324] | 76 | /** Map of screen settings objects. The key specifies the screen ID. */
|
---|
[95639] | 77 | typedef std::map <uint32_t, ComObjPtr<RecordingScreenSettings> > RecordingScreenSettingsObjMap;
|
---|
[75307] | 78 |
|
---|
[75324] | 79 | void i_reset(void);
|
---|
[105266] | 80 | int i_progressSet(uint64_t msTimestamp);
|
---|
| 81 | int i_start(void);
|
---|
| 82 | int i_stop(void);
|
---|
[95639] | 83 | int i_syncToMachineDisplays(uint32_t cDisplays);
|
---|
[105605] | 84 | int i_createScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap, uint32_t idScreen, const settings::RecordingScreen &data);
|
---|
[95639] | 85 | int i_destroyScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap, uint32_t idScreen);
|
---|
| 86 | int i_destroyAllScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap);
|
---|
[75324] | 87 |
|
---|
[75307] | 88 | private:
|
---|
| 89 |
|
---|
[75361] | 90 | // wrapped IRecordingSettings properties
|
---|
[75251] | 91 | HRESULT getEnabled(BOOL *enabled);
|
---|
| 92 | HRESULT setEnabled(BOOL enable);
|
---|
[75361] | 93 | HRESULT getScreens(std::vector<ComPtr<IRecordingScreenSettings> > &aRecordScreenSettings);
|
---|
[105266] | 94 | HRESULT getProgress(ComPtr<IProgress> &aProgress);
|
---|
[75251] | 95 |
|
---|
[75361] | 96 | // wrapped IRecordingSettings methods
|
---|
| 97 | HRESULT getScreenSettings(ULONG uScreenId, ComPtr<IRecordingScreenSettings> &aRecordScreenSettings);
|
---|
[105266] | 98 | HRESULT start(ComPtr<IProgress> &aProgress);
|
---|
[75251] | 99 |
|
---|
| 100 | private:
|
---|
| 101 |
|
---|
| 102 | struct Data;
|
---|
| 103 | Data *m;
|
---|
| 104 | };
|
---|
| 105 |
|
---|
[76562] | 106 | #endif /* !MAIN_INCLUDED_RecordingSettingsImpl_h */
|
---|
[75926] | 107 |
|
---|