1 /* -*- c++ -*- */
2 /*
3  * Gqrx SDR: Software defined radio receiver powered by GNU Radio and Qt
4  *           https://gqrx.dk/
5  *
6  * Copyright 2011-2013 Alexandru Csete OZ9AEC.
7  *
8  * Gqrx is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3, or (at your option)
11  * any later version.
12  *
13  * Gqrx is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Gqrx; see the file COPYING.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street,
21  * Boston, MA 02110-1301, USA.
22  */
23 #ifndef DEMOD_OPTIONS_H
24 #define DEMOD_OPTIONS_H
25 
26 #include <QDialog>
27 #include <QCloseEvent>
28 
29 namespace Ui {
30     class CDemodOptions;
31 }
32 
33 
34 /*! \brief Widget for adjusting demodulator options.
35  *
36  */
37 class CDemodOptions : public QDialog
38 {
39     Q_OBJECT
40 
41 public:
42 
43     /*! \brief Index in the QStackedWidget. */
44     enum page {
45         PAGE_NO_OPT = 0,
46         PAGE_FM_OPT = 1,
47         PAGE_AM_OPT = 2,
48         PAGE_CW_OPT = 3,
49         PAGE_AMSYNC_OPT = 4,
50         PAGE_NUM    = 5
51     };
52 
53     explicit CDemodOptions(QWidget *parent = 0);
54     ~CDemodOptions();
55 
56     void closeEvent(QCloseEvent *event);
57 
58     void setCurrentPage(int index);
59     int  currentPage() const;
60 
61     void setCwOffset(int offset);
62     int  getCwOffset(void) const;
63 
64     void setMaxDev(float max_dev);
65     float getMaxDev(void) const;
66 
67     void setEmph(double tau);
68     double getEmph(void) const;
69 
70     void setPllBw(float pll_bw);
71     float getPllBw(void) const;
72 
73 signals:
74     /*! \brief Signal emitted when new FM deviation is selected. */
75     void fmMaxdevSelected(float max_dev);
76 
77     /*! \brief Signal emitted when new FM de-emphasis constant is selected. */
78     void fmEmphSelected(double tau);
79 
80     /*! \brief Signal emitted when AM DCR is toggled. */
81     void amDcrToggled(bool enabled);
82 
83     /*! \brief CW offset changed. */
84     void cwOffsetChanged(int offset);
85 
86     /*! \brief Signal emitted when AM-Sync DCR is toggled. */
87     void amSyncDcrToggled(bool enabled);
88 
89     /*! \brief Signal emitted when new PLL BW is selected. */
90     void amSyncPllBwSelected(float pll_bw);
91 
92 private slots:
93     void on_maxdevSelector_activated(int index);
94     void on_emphSelector_activated(int index);
95     void on_dcrCheckBox_toggled(bool checked);
96     void on_cwOffsetSpin_valueChanged(int value);
97     void on_syncdcrCheckBox_toggled(bool checked);
98     void on_pllBwSelector_activated(int index);
99 
100 private:
101     Ui::CDemodOptions *ui;
102 };
103 
104 #endif // DEMOD_OPTIONS_H
105