summaryrefslogtreecommitdiffstats
path: root/src/rip/k3baudioripjob.cpp
blob: 3aed35c10417617da6c4a6c2bd77b50124636c60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* 
 *
 * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
 * Copyright (C) 2006 Sebastian Trueg <[email protected]>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2007 Sebastian Trueg <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */

#include "k3baudioripjob.h"
#include "k3baudioripthread.h"

#include <k3bthreadjob.h>
#include <k3bcore.h>

#include <kdebug.h>
#include <klocale.h>


K3bAudioRipJob::K3bAudioRipJob( K3bJobHandler* hdl, TQObject* parent )
  : K3bJob( hdl, parent )
{
  m_thread = new K3bAudioRipThread();
  m_threadJob = new K3bThreadJob( m_thread, this, this );
  connectSubJob( m_threadJob,
		 TQT_SLOT(slotRippingFinished(bool)),
		 TQT_SIGNAL(newTask(const TQString&)),
		 TQT_SIGNAL(newSubTask(const TQString&)),
		 TQT_SIGNAL(percent(int)),
		 TQT_SIGNAL(subPercent(int)) );
}


K3bAudioRipJob::~K3bAudioRipJob()
{
}


TQString K3bAudioRipJob::jobDescription() const
{
  return m_thread->jobDescription();
}


TQString K3bAudioRipJob::jobDetails() const
{
  return m_thread->jobDetails();
}


void K3bAudioRipJob::start()
{
  jobStarted();
  k3bcore->blockDevice( m_thread->m_device );
  m_threadJob->start();
}


void K3bAudioRipJob::cancel()
{
  m_threadJob->cancel();
}


void K3bAudioRipJob::slotRippingFinished( bool success )
{
  k3bcore->unblockDevice( m_thread->m_device );
  jobFinished( success );
}

#include "k3baudioripjob.moc"