kodi
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KODI::CDRIP::CCDDARipJob Class Reference
Inheritance diagram for KODI::CDRIP::CCDDARipJob:
Inheritance graph
[legend]
Collaboration diagram for KODI::CDRIP::CCDDARipJob:
Collaboration graph
[legend]

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. More...
 
const char * GetType () const override
 Function that returns the type of job. More...
 
bool operator== (const CJob *job) const override
 
bool DoWork () override
 Main workhorse function of CJob instances. More...
 
std::string GetOutput () const
 
- Public Member Functions inherited from CJob
virtual ~CJob ()=default
 Destructor for job objects. More...
 
virtual bool ShouldCancel (unsigned int progress, unsigned int total) const
 Function for longer jobs to report progress and check whether they have been cancelled. More...
 

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

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

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.

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

◆ 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

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