~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to kaudiocreator/encodefileimp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * This file is part of the KAudioCreator package
 
3
 * Copyright (C) 2003 Benjamin C Meyer (ben+kaudiocreator at meyerhome dot net)
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Library General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Library General Public License
 
16
 * along with this library; see the file COPYING.LIB.  If not, write to
 
17
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#include "encodefileimp.h"
 
22
#include "job.h"
 
23
 
 
24
#include <qspinbox.h>
 
25
#include <qlineedit.h>
 
26
#include <kurlrequester.h>
 
27
#include <qcombobox.h>
 
28
#include <kmessagebox.h>
 
29
 
 
30
EncodeFileImp::EncodeFileImp(QWidget* parent,
 
31
                const char* name) : EncodeFile(parent, name), m_genres(KCDDB::Genres()) {
 
32
  genre->insertStringList(m_genres.i18nList());
 
33
  // Specify to only accept wav files
 
34
  file->setFilter("*.wav|Wav Files");
 
35
}
 
36
 
 
37
/**
 
38
 * When the user presses the encode button create a job with all of the current
 
39
 * selection options and emit a signal with it.
 
40
 */
 
41
void EncodeFileImp::encode(){
 
42
  Job *newJob = new Job();
 
43
 
 
44
  newJob->location = file->url();
 
45
 
 
46
  newJob->album = album->text();
 
47
  newJob->genre = m_genres.i18n2cddb(genre->currentText());
 
48
  if(newJob->genre.isEmpty())
 
49
     newJob->genre = "Pop";
 
50
  newJob->group = artist->text();
 
51
  newJob->comment = comment->text();
 
52
  newJob->year = year->value();
 
53
  newJob->track = track->value();
 
54
 
 
55
  newJob->track_title = track_title->text();
 
56
  newJob->track_artist = track_artist->text();
 
57
  newJob->track_comment = track_comment->text();
 
58
 
 
59
  emit(startJob(newJob));
 
60
 
 
61
  // Same message and *strings* from tracksimp.cpp
 
62
  int counter(1);
 
63
  KMessageBox::information(this,
 
64
  i18n("%1 Job(s) have been started.  You can watch their progress in the " \
 
65
          "jobs section.").arg(counter),
 
66
 i18n("Jobs have started"), i18n("Jobs have started"));
 
67
}
 
68
 
 
69
 
 
70
#include "encodefileimp.moc"