VirtualBox

Ignore:
Timestamp:
Jul 11, 2024 7:49:37 AM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163915
Message:

Recording: Implemented support for a dedicated progress object, which is exposed to API clients. This can be used for better tracking the recording progress as well as for error reporting. The RecordingSettings API also now has a dedicated start() method to start recording, as well as support for attaching to an already ongoing recording by retrieving the progress object at a later time. Adapted FE/Qt (draft, see @todos), FE/VBoxManage and the Validation Kit testdriver to the new APIs. VBoxManage also can attach to an ongoing recording now. The recording progress object also will have multiple operations to get the recording progress for convenience. bugref:10718

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r101035 r105266  
    17971797                 || !strcmp(a->argv[1], "videocap") /* legacy command */)
    17981798        {
     1799            if (!strcmp(a->argv[1], "videocap"))
     1800                RTMsgWarning(ControlVM::tr("Sub command 'videocap' is deprecated -- please use 'recording' instead ."));
     1801
    17991802            if (a->argc < 3)
    18001803            {
     
    18151818            /* Note: For now all screens have the same configuration. */
    18161819
    1817             /*
    1818              * Note: Commands starting with "vcp" are the deprecated versions and are
    1819              *       kept to ensure backwards compatibility.
    1820              */
    18211820            bool fEnabled;
    18221821            if (RT_SUCCESS(parseBool(a->argv[2], &fEnabled)))
    18231822            {
    1824                 setCurrentSubcommand(HELP_SCOPE_CONTROLVM_RECORDING);
     1823                //setCurrentSubcommand(HELP_SCOPE_CONTROLVM_RECORDING);
    18251824                CHECK_ERROR_RET(recordingSettings, COMSETTER(Enabled)(fEnabled), RTEXITCODE_FAILURE);
     1825
     1826                if (fEnabled)
     1827                    RTPrintf(ControlVM::tr("Recording enabled. Use 'start' to start recording.\n"));
     1828            }
     1829            else if (!strcmp(a->argv[2], "start"))
     1830            {
     1831                //setCurrentSubcommand(HELP_SCOPE_CONTROLVM_RECORDING_START);
     1832                bool fWait = false;
     1833                if (a->argc >= 4 && !strcmp(a->argv[3], "--wait"))
     1834                    fWait = true;
     1835
     1836                ComPtr<IProgress> progress;
     1837                CHECK_ERROR_BREAK(recordingSettings, Start(progress.asOutParam()));
     1838
     1839                if (fWait)
     1840                {
     1841                    hrc = showProgress(progress, SHOW_PROGRESS_OPS);
     1842                    CHECK_PROGRESS_ERROR(progress, (ControlVM::tr("Recording failed.")));
     1843                }
     1844                else
     1845                    RTPrintf(ControlVM::tr("Recording started (detacted).\n"));
     1846            }
     1847            else if (!strcmp(a->argv[2], "stop"))
     1848            {
     1849                //setCurrentSubcommand(HELP_SCOPE_CONTROLVM_RECORDING_STOP);
     1850                ComPtr<IProgress> progress;
     1851                CHECK_ERROR_BREAK(recordingSettings, COMGETTER(Progress)(progress.asOutParam()));
     1852                CHECK_ERROR_BREAK(progress, Cancel());
     1853            }
     1854            else if (!strcmp(a->argv[2], "attach"))
     1855            {
     1856                //setCurrentSubcommand(HELP_SCOPE_CONTROLVM_RECORDING_ATTACH);
     1857                ComPtr<IProgress> progress;
     1858                CHECK_ERROR_BREAK(recordingSettings, COMGETTER(Progress)(progress.asOutParam()));
     1859                hrc = showProgress(progress, SHOW_PROGRESS_OPS);
    18261860            }
    18271861            else if (!strcmp(a->argv[2], "screens"))
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r105087 r105266  
    28992899        CHECK_ERROR_RET(machine, COMGETTER(RecordingSettings)(recordingSettings.asOutParam()), hrc);
    29002900
    2901         BOOL  fEnabled;
     2901        BOOL fStarted = FALSE;
     2902        ComPtr<IProgress> progress;
     2903        hrc = recordingSettings->COMGETTER(Progress)(progress.asOutParam());
     2904        if (SUCCEEDED(hrc))
     2905        {
     2906            hrc = progress->COMGETTER(Completed)(&fStarted);
     2907            fStarted = !fStarted;
     2908        }
     2909        SHOW_BOOL_VALUE_EX("recording_started", Info::tr("Recording status:"), fStarted, Info::tr("started"), Info::tr("stopped"));
     2910
     2911        BOOL fEnabled;
    29022912        CHECK_ERROR_RET(recordingSettings, COMGETTER(Enabled)(&fEnabled), hrc);
    29032913        SHOW_BOOL_VALUE_EX("recording_enabled", Info::tr("Recording enabled:"), fEnabled, Info::tr("yes"), Info::tr("no"));
Note: See TracChangeset for help on using the changeset viewer.

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