#include <mediasession_progress.h>
This class simplifies the progress tracking of operations. Once created a operation can simply put the current progress into the object by calling SetProgressAndCheckBreak(). On the other end the ObservableProgressNotification can be hooked up to get notifications (e.g. for the ui).
Public Member Functions | |
MAXON_METHOD Result< void > | InitProgress (const TimeValue &delayFirstProgress, const TimeValue &minProgressUpdate) |
MAXON_METHOD Result< Int > | AddProgressJob (const Float jobWeight, const String &jobName) |
MAXON_METHOD Result< void > | SetProgressAndCheckBreak (Int jobIndex, Float percent) |
MAXON_OBSERVABLE (void, ObservableProgressNotification,(const MediaSessionProgressRef &progress, Float percent, const TimeValue &duration, const TimeValue &expectedTotalTime), ObservableCombinerRunAllComponent) | |
Private Member Functions | |
MAXON_INTERFACE (MediaSessionProgressInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.mediasessionprogress") | |
|
private |
MAXON_METHOD Result<void> InitProgress | ( | const TimeValue & | delayFirstProgress, |
const TimeValue & | minProgressUpdate | ||
) |
[in] | delayFirstProgress | Time to delay the first progress notification. |
[in] | minProgressUpdate | Minimum time difference to call the progress callback. |
MAXON_METHOD Result<Int> AddProgressJob | ( | const Float | jobWeight, |
const String & | jobName | ||
) |
[in] | jobWeight | Add the weight for this job. All the weights are summed up and is taken into account for the overall percentage. |
MAXON_METHOD Result<void> SetProgressAndCheckBreak | ( | Int | jobIndex, |
Float | percent | ||
) |
Sets the progress of the current operation.
[in] | jobIndex | Job index returned by AddProgressJob or -1 if no jobs are added |
[in] | percent | Percentage between 0.0 and 1.0 of the done work. |
MAXON_OBSERVABLE | ( | void | , |
ObservableProgressNotification | , | ||
(const MediaSessionProgressRef &progress, Float percent, const TimeValue &duration, const TimeValue &expectedTotalTime) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Observable will be called as soon as the progress changes.
[in] | progress | Reference to this object. |
[in] | percent | Percentage between 0.0 and 1.0 of the done work. |
[in] | duration | Duration of the current operation. |
[in] | expectedTotalTime | Expected total time of the current operation. TIMEVALUE_INFINITE will be set for infinite time. |
[in] | userData | User data passed from the caller. |