VirtualBox

Ignore:
Timestamp:
Jul 11, 2024 7:49:37 AM (9 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/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r105265 r105266  
    527527    {
    528528        CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();
    529         if (comRecordingSettings.GetEnabled())
     529        CProgress comProgress = comRecordingSettings.GetProgress(); /** @todo r=andy Revamp this. */
     530        /** @r=andy Check if recording is running: if not completed AND not canceled. */
     531        if (comProgress.isOk() && !comProgress.GetCompleted() && !comProgress.GetCanceled())
    530532        {
    531533            /* For now all screens have the same config: */
     
    14621464    /* Get recording settings: */
    14631465    CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();
    1464     fRecordingEnabled = comRecordingSettings.GetEnabled();
     1466    CProgress comProgress = comRecordingSettings.GetProgress(); /** r=andy Revamp this. */
     1467    /** @r=andy Check if recording is running: if not completed AND not canceled. */
     1468    fRecordingEnabled = comProgress.isOk() && !comProgress.GetCompleted() && !comProgress.GetCanceled();
    14651469    if (fRecordingEnabled)
    14661470    {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r103803 r105266  
    481481            break;
    482482        }
    483         case KVBoxEventType_OnRecordingChanged:
     483        case KVBoxEventType_OnRecordingStateChanged:
    484484        {
    485485            emit sigRecordingChange();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r103803 r105266  
    217217        << KVBoxEventType_OnVRDEServerChanged
    218218        << KVBoxEventType_OnVRDEServerInfoChanged
    219         << KVBoxEventType_OnRecordingChanged
     219        << KVBoxEventType_OnRecordingStateChanged
    220220        << KVBoxEventType_OnUSBControllerChanged
    221221        << KVBoxEventType_OnUSBDeviceStateChanged
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r105265 r105266  
    19391939    else
    19401940    {
    1941         const BOOL fSettingsEnabled = comSettings.GetEnabled();
    1942         fSuccess = comSettings.isOk();
    1943         if (!fSuccess)
    1944             UINotificationMessage::cannotAcquireRecordingSettingsParameter(comSettings);
    1945         else
    1946             fEnabled = fSettingsEnabled == TRUE;
     1941        /** @todo r=andy Revamp this. */
     1942        CProgress comProgress = comSettings.GetProgress();
     1943        fEnabled = comProgress.isOk() && !comProgress.GetCompleted() && !comProgress.GetCanceled();
    19471944    }
    19481945    return fSuccess;
     
    19581955    else
    19591956    {
    1960         comSettings.SetEnabled(fEnabled);
    1961         fSuccess = comSettings.isOk();
    1962         if (!fSuccess)
    1963             UINotificationMessage::cannotToggleRecording(comSettings, machineName(), fEnabled);
     1957        /** @todo r=andy Revamp this function to better use the progress object.
     1958         *               Probably also needs a bit of refactoring of the overall handling within FE/Qt. */
     1959        CProgress comProgress;
     1960        if (fEnabled)
     1961        {
     1962            comProgress = comSettings.Start();
     1963            fSuccess = comSettings.isOk();
     1964            if (!fSuccess)
     1965                UINotificationMessage::cannotToggleRecording(comSettings, machineName(), fEnabled);
     1966        }
     1967        else
     1968        {
     1969            comProgress = comSettings.GetProgress();
     1970            if (comProgress.isOk())
     1971                comProgress.Cancel();
     1972            else
     1973                UINotificationMessage::cannotToggleRecording(comSettings, machineName(), fEnabled);
     1974        }
     1975
    19641976    }
    19651977    return fSuccess;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r105120 r105266  
    5353#include "CExtPackManager.h"
    5454#include "CGraphicsAdapter.h"
     55#include "CProgress.h" /* For starting recording. */
    5556#include "CRecordingScreenSettings.h"
    5657#include "CRecordingSettings.h"
     
    13291330                    fSuccess = comRecordingScreenSettings.isOk();
    13301331                }
    1331 
    13321332                if (!fSuccess)
    13331333                {
     
    13441344                recordingSettings.SetEnabled(newDisplayData.m_fRecordingEnabled);
    13451345                fSuccess = recordingSettings.isOk();
     1346                if (fSuccess)
     1347                {
     1348                    /* Start recording when recording got enabled. */
     1349                    /** @todo r=andy Not sure if this is the right place for it. */
     1350                    CProgress comProgress = recordingSettings.Start();
     1351                    fSuccess = recordingSettings.isOk();
     1352                }
    13461353            }
    13471354        }
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