kwave  18.07.70
SelectRangeDialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  SelectRangeDialog.cpp - dialog for selecting a range of samples
3  -------------------
4  begin : Sat Jun 15 2002
5  copyright : (C) 2002 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "config.h"
19 #include <math.h>
20 
21 #include <QPushButton>
22 #include <QRadioButton>
23 #include <QSlider>
24 #include <QSpinBox>
25 
26 #include <KHelpClient>
27 #include <KLocalizedString>
28 
29 #include "libkwave/String.h"
30 
31 #include "SelectRangeDialog.h"
32 
33 //***************************************************************************
35  Mode start_mode, Mode range_mode, unsigned int range, double sample_rate,
36  sample_index_t offset, sample_index_t signal_length)
37  :QDialog(widget), Ui::SelectRangeDlg()
38 {
39  setupUi(this);
40  setModal(true);
41 
42  if (select_start) {
43  select_start->init(Kwave::SelectTimeWidget::bySamples, offset,
44  sample_rate, 0, signal_length);
45  select_start->setTitle(i18n("Start"));
46  select_start->setMode(start_mode);
47  }
48 
49  if (select_range) select_range->init(
50  range_mode, range, sample_rate, offset, signal_length);
51 
52  connect(select_start, SIGNAL(valueChanged(sample_index_t)),
53  select_range, SLOT(setOffset(sample_index_t)));
54 
55  setMinimumSize(sizeHint());
56  setFixedSize(sizeHint());
57 
58  connect(btHelp->button(QDialogButtonBox::Help), SIGNAL(clicked()),
59  this, SLOT(invokeHelp()));
60 
61  // set the focus onto the "OK" button
62  buttonBox->button(QDialogButtonBox::Ok)->setFocus();
63 }
64 
65 //***************************************************************************
67 {
68 }
69 
70 //***************************************************************************
72 {
73  if (select_range) select_range->setMode(new_mode);
74 }
75 
76 
77 //***************************************************************************
79 {
80  KHelpClient::invokeHelp(_("plugin_sect_selectrange"));
81 }
82 
83 //***************************************************************************
84 //***************************************************************************
SelectRangeDialog(QWidget *widget, Mode start_mode, Mode range_mode, unsigned int range, double sample_rate, sample_index_t offset, sample_index_t signal_length)
quint64 sample_index_t
Definition: Sample.h:28
bool connect(Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
Definition: Connect.cpp:48
void setMode(Kwave::SelectTimeWidget::Mode new_mode)
#define _(m)
Definition: memcpy.c:66