MediaSessionProgressInterface Class Reference

#include <mediasession_progress.h>

Inheritance diagram for MediaSessionProgressInterface:

详细描述

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).

公共成员函数

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)

私有成员函数

  MAXON_INTERFACE ( MediaSessionProgressInterface , MAXON_REFERENCE_NORMAL , "net.maxon.image.interface.mediasessionprogress")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( MediaSessionProgressInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.image.interface.mediasessionprogress"   
)
private

◆  InitProgress()

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.

◆  AddProgressJob()

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.
返回
Index of the job.

◆  SetProgressAndCheckBreak()

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()

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.