Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CVideoLibraryRefreshingSourceJob Class Reference

Video library job implementation for refreshing all library items in a source. More...

#include <VideoLibraryRefreshingSourceJob.h>

Inheritance diagram for CVideoLibraryRefreshingSourceJob:
CVideoLibraryProgressJob CProgressJob CVideoLibraryJob CJob CJob

Public Member Functions

 CVideoLibraryRefreshingSourceJob (std::string sourcePath)
 Creates a new video library job refreshing all library items in the given source.
 
const std::string & GetSourcePath () const
 
bool HasStarted () const
 
bool CanBeCancelled () const override
 Whether the job can be cancelled or not.
 
bool Cancel () override
 Tries to cancel the running job.
 
const char * GetType () const override
 Function that returns the type of job.
 
bool Equals (const CJob *job) const override
 Function that compares this job instance with the given job instance.
 
- Public Member Functions inherited from CVideoLibraryProgressJob
 ~CVideoLibraryProgressJob () override
 
bool DoWork () override
 Main workhorse function of CJob instances.
 
- Public Member Functions inherited from CProgressJob
 ~CProgressJob () override
 
bool ShouldCancel (unsigned int progress, unsigned int total) const override
 Function for longer jobs to report progress and check whether they have been cancelled.
 
bool DoModal ()
 Executes the job showing a modal progress dialog.
 
void SetProgressIndicators (CGUIDialogProgressBarHandle *progressBar, CGUIDialogProgress *progressDialog, bool updateProgress=true, bool updateInformation=true)
 Sets the given progress indicators to be used during execution of the job.
 
bool HasProgressIndicator () const
 
- Public Member Functions inherited from CJob
 CJob ()=default
 
virtual ~CJob ()=default
 Destructor for job objects.
 
void SetProgressCallback (CJobManager *callback)
 Function to set a callback for jobs to report progress.
 
size_t GetPendingCallbackCount () const
 Get the number of callbacks pending for this job during completion.
 
- Public Member Functions inherited from CVideoLibraryJob
 ~CVideoLibraryJob () override
 

Static Public Attributes

static constexpr const char * TYPE = "VideoLibraryRefreshingSourceJob"
 

Protected Member Functions

bool Work (CVideoDatabase &db) override
 Worker method to be implemented by an actual implementation.
 
- Protected Member Functions inherited from CVideoLibraryProgressJob
 CVideoLibraryProgressJob (CGUIDialogProgressBarHandle *progressBar)
 
- Protected Member Functions inherited from CProgressJob
 CProgressJob ()=default
 
 CProgressJob (CGUIDialogProgressBarHandle *progressBar)
 
bool IsModal () const
 Whether the job is being run modally or in the background.
 
CGUIDialogProgressBarHandle * GetProgressBar () const
 Returns the progress bar indicating the progress of the job.
 
void SetProgressBar (CGUIDialogProgressBarHandle *progress)
 Sets the progress bar indicating the progress of the job.
 
CGUIDialogProgress * GetProgressDialog () const
 Returns the progress dialog indicating the progress of the job.
 
void SetProgressDialog (CGUIDialogProgress *progressDialog)
 Sets the progress bar indicating the progress of the job.
 
bool GetAutoClose ()
 Whether to automatically close the progress indicator in MarkFinished().
 
void SetAutoClose (bool autoClose)
 Set whether to automatically close the progress indicator in MarkFinished().
 
bool GetUpdateProgress ()
 Whether to update the progress bar or not.
 
void SetUpdateProgress (bool updateProgress)
 Set whether to update the progress bar or not.
 
bool GetUpdateInformation ()
 Whether to update the progress information or not.
 
void SetUpdateInformation (bool updateInformation)
 Set whether to update the progress information or not.
 
void ShowProgressDialog () const
 Makes sure that the modal dialog is being shown.
 
void SetTitle (const std::string &title)
 Sets the given title as the title of the progress bar.
 
void SetText (const std::string &text)
 Sets the given text as the description of the progress bar.
 
void SetProgress (float percentage) const
 Sets the progress of the progress bar to the given value in percentage.
 
void SetProgress (int currentStep, int totalSteps) const
 Sets the progress of the progress bar to the given value.
 
void MarkFinished ()
 Marks the progress as finished by setting it to 100%.
 
bool IsCancelled () const
 Checks if the progress dialog has been cancelled.
 
- Protected Member Functions inherited from CVideoLibraryJob
 CVideoLibraryJob ()
 

Additional Inherited Members

- Public Types inherited from CJob
enum  PRIORITY {
  PRIORITY_LOW_PAUSABLE = 0 , PRIORITY_LOW , PRIORITY_NORMAL , PRIORITY_HIGH ,
  PRIORITY_DEDICATED
}
 Priority levels for jobs, specified by clients when adding jobs to the CJobManager. More...
 

Detailed Description

Video library job implementation for refreshing all library items in a source.

Constructor & Destructor Documentation

◆ CVideoLibraryRefreshingSourceJob()

CVideoLibraryRefreshingSourceJob::CVideoLibraryRefreshingSourceJob ( std::string sourcePath)
explicit

Creates a new video library job refreshing all library items in the given source.

Parameters
[in]sourcePathPath of the source, which may be a multipath

Member Function Documentation

◆ CanBeCancelled()

bool CVideoLibraryRefreshingSourceJob::CanBeCancelled ( ) const
inlineoverridevirtual

Whether the job can be cancelled or not.

Reimplemented from CVideoLibraryJob.

◆ Cancel()

bool CVideoLibraryRefreshingSourceJob::Cancel ( )
overridevirtual

Tries to cancel the running job.

Returns
True if the job was cancelled, false otherwise

Reimplemented from CVideoLibraryJob.

◆ Equals()

bool CVideoLibraryRefreshingSourceJob::Equals ( const CJob * job) const
overridevirtual

Function that compares this job instance with the given job instance.

CJob subclasses may optionally implement this to provide customized comparison functionality. This is useful for the CJobManager::AddJob() routine, which preempts similar jobs with the new job.

Parameters
jobthe job to compared with this CJob instance.
Returns
if true, the two jobs are equal.
See also
CJobManager::AddJob()

Reimplemented from CJob.

◆ GetSourcePath()

const std::string & CVideoLibraryRefreshingSourceJob::GetSourcePath ( ) const
inline

◆ GetType()

const char * CVideoLibraryRefreshingSourceJob::GetType ( ) const
inlineoverridevirtual

Function that returns the type of job.

CJob subclasses may optionally implement this function to specify the type of job. This is useful for the CJobManager::AddJob() routine, which preempts similar jobs with the new job.

Returns
a unique character string describing the job.
See also
CJobManager

Reimplemented from CVideoLibraryProgressJob.

◆ HasStarted()

bool CVideoLibraryRefreshingSourceJob::HasStarted ( ) const
inline

◆ Work()

bool CVideoLibraryRefreshingSourceJob::Work ( CVideoDatabase & db)
overrideprotectedvirtual

Worker method to be implemented by an actual implementation.

Parameters
[in]dbAlready open video database to be used for interaction
Returns
True if the process succeeded, false otherwise

Implements CVideoLibraryJob.

Member Data Documentation

◆ TYPE

const char* CVideoLibraryRefreshingSourceJob::TYPE = "VideoLibraryRefreshingSourceJob"
staticconstexpr

The documentation for this class was generated from the following files: