Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::CDRIP::CCDDARipJob Class Reference

#include <CDDARipJob.h>

Inheritance diagram for KODI::CDRIP::CCDDARipJob:
CJob

Public Member Functions

 CCDDARipJob (const std::string &input, const std::string &output, const MUSIC_INFO::CMusicInfoTag &tag, int encoder, bool eject=false, unsigned int rate=44100, unsigned int channels=2, unsigned int bps=16)
 Construct a ripper job.
 
 ~CCDDARipJob () override
 
const char * GetType () const override
 Function that returns the type of job.
 
bool operator== (const CJob *job) const override
 
bool DoWork () override
 Main workhorse function of CJob instances.
 
std::string GetOutput () const
 
- Public Member Functions inherited from CJob
 CJob ()
 
virtual ~CJob ()=default
 Destructor for job objects.
 
virtual bool ShouldCancel (unsigned int progress, unsigned int total) const
 Function for longer jobs to report progress and check whether they have been cancelled.
 

Protected Member Functions

std::unique_ptr< CEncoderSetupEncoder (XFILE::CFile &reader)
 Setup the audio encoder.
 
std::string SetupTempFile ()
 Helper used if output is a remote url.
 
int RipChunk (XFILE::CFile &reader, const std::unique_ptr< CEncoder > &encoder, int &percent)
 Rip a chunk of audio.
 

Protected Attributes

unsigned int m_rate
 
unsigned int m_channels
 
unsigned int m_bps
 
MUSIC_INFO::CMusicInfoTag m_tag
 
std::string m_input
 
std::string m_output
 
bool m_eject
 
int m_encoder
 

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

Constructor & Destructor Documentation

◆ CCDDARipJob()

CCDDARipJob::CCDDARipJob ( const std::string & input,
const std::string & output,
const MUSIC_INFO::CMusicInfoTag & tag,
int encoder,
bool eject = false,
unsigned int rate = 44100,
unsigned int channels = 2,
unsigned int bps = 16 )

Construct a ripper job.

Parameters
[in]inputThe input file url
[in]outputThe output file url
[in]tagThe music tag to attach to track
[in]encoderThe encoder to use. See Encoder.h
[in]ejectShould we eject tray on finish?
[in]rateThe sample rate of the input
[in]channelsNumber of audio channels in input
[in]bpsThe bits per sample for input

◆ ~CCDDARipJob()

CCDDARipJob::~CCDDARipJob ( )
overridedefault

Member Function Documentation

◆ DoWork()

bool CCDDARipJob::DoWork ( )
overridevirtual

Main workhorse function of CJob instances.

All CJob subclasses must implement this function, performing all processing. Once this function is complete, the OnJobComplete() callback is called, and the job is then destroyed.

See also
CJobManager, IJobCallback::OnJobComplete()

Implements CJob.

◆ GetOutput()

std::string KODI::CDRIP::CCDDARipJob::GetOutput ( ) const
inline

◆ GetType()

const char * KODI::CDRIP::CCDDARipJob::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::AddLIFOJob() routine, which preempts similar jobs with the new job.

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

Reimplemented from CJob.

◆ operator==()

bool CCDDARipJob::operator== ( const CJob * job) const
overridevirtual

Reimplemented from CJob.

◆ RipChunk()

int CCDDARipJob::RipChunk ( XFILE::CFile & reader,
const std::unique_ptr< CEncoder > & encoder,
int & percent )
protected

Rip a chunk of audio.

Parameters
[in]readerThe input reader
[in]encoderThe audio encoder
[out]percentThe percentage completed on return
Returns
0 (CDDARIP_OK) if everything went okay, or a positive error code from the reader, or -1 if the encoder failed
See also
CCDDARipper::GetData, CEncoder::Encode

◆ SetupEncoder()

std::unique_ptr< CEncoder > CCDDARipJob::SetupEncoder ( XFILE::CFile & reader)
protected

Setup the audio encoder.

◆ SetupTempFile()

std::string CCDDARipJob::SetupTempFile ( )
protected

Helper used if output is a remote url.

Member Data Documentation

◆ m_bps

unsigned int KODI::CDRIP::CCDDARipJob::m_bps
protected

◆ m_channels

unsigned int KODI::CDRIP::CCDDARipJob::m_channels
protected

◆ m_eject

bool KODI::CDRIP::CCDDARipJob::m_eject
protected

◆ m_encoder

int KODI::CDRIP::CCDDARipJob::m_encoder
protected

◆ m_input

std::string KODI::CDRIP::CCDDARipJob::m_input
protected

◆ m_output

std::string KODI::CDRIP::CCDDARipJob::m_output
protected

◆ m_rate

unsigned int KODI::CDRIP::CCDDARipJob::m_rate
protected

◆ m_tag

MUSIC_INFO::CMusicInfoTag KODI::CDRIP::CCDDARipJob::m_tag
protected

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