File indexing completed on 2024-06-16 07:42:06

0001 /*
0002     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_VIDEODVD_TITLE_DETECTCLIPPING_JOB_H_
0007 #define _K3B_VIDEODVD_TITLE_DETECTCLIPPING_JOB_H_
0008 
0009 #include "k3b_export.h"
0010 #include "k3bjob.h"
0011 #include "k3bvideodvd.h"
0012 #include <QProcess>
0013 
0014 namespace K3b {
0015     /**
0016      * Job to detect the clipping values for a Video DVD title.
0017      */
0018     class LIBK3B_EXPORT VideoDVDTitleDetectClippingJob : public Job
0019     {
0020         Q_OBJECT
0021 
0022     public:
0023         VideoDVDTitleDetectClippingJob( JobHandler* hdl, QObject* parent );
0024         ~VideoDVDTitleDetectClippingJob() override;
0025 
0026         const VideoDVD::VideoDVD& videoDVD() const { return m_dvd; }
0027         int title() const { return m_titleNumber; }
0028         bool lowPriority() const { return m_lowPriority; }
0029 
0030         /**
0031          * Only valid after a successful completion of the job.
0032          */
0033         int clippingTop() const { return m_clippingTop; }
0034 
0035         /**
0036          * Only valid after a successful completion of the job.
0037          */
0038         int clippingLeft() const { return m_clippingLeft; }
0039 
0040         /**
0041          * Only valid after a successful completion of the job.
0042          */
0043         int clippingBottom() const { return m_clippingBottom; }
0044 
0045         /**
0046          * Only valid after a successful completion of the job.
0047          */
0048         int clippingRight() const { return m_clippingRight; }
0049 
0050     public Q_SLOTS:
0051         void start() override;
0052         void cancel() override;
0053 
0054         /**
0055          * The device containing the Video DVD
0056          */
0057         void setVideoDVD( const K3b::VideoDVD::VideoDVD& dvd ) { m_dvd = dvd; }
0058 
0059         /**
0060          * Set the title number to be analysed
0061          *
0062          * The default value is 1, denoting the first title.
0063          */
0064         void setTitle( int t ) { m_titleNumber = t; }
0065 
0066         /**
0067          * If true the transcode processes will be run with a very low scheduling
0068          * priority.
0069          *
0070          * The default is true.
0071          */
0072         void setLowPriority( bool b ) { m_lowPriority = b; }
0073 
0074     private Q_SLOTS:
0075         void slotTranscodeStderr( const QString& );
0076         void slotTranscodeExited( int, QProcess::ExitStatus );
0077 
0078     private:
0079         void startTranscode( int chapter );
0080 
0081         VideoDVD::VideoDVD m_dvd;
0082 
0083         int m_clippingTop;
0084         int m_clippingBottom;
0085         int m_clippingLeft;
0086         int m_clippingRight;
0087 
0088         int m_titleNumber;
0089 
0090         bool m_lowPriority;
0091 
0092         class Private;
0093         Private* d;
0094     };
0095 }
0096 
0097 #endif