summaryrefslogtreecommitdiffstats
path: root/rtlfmradiotunercontrol.h
blob: f00bfa4d7e577b267d5d6a388a41bf39228af15b (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
/* Copyright (C) 2016, The Qt Company Ltd. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef RTLFMRADIOTUNERCONTROL_H
#define RTLFMRADIOTUNERCONTROL_H

#include <QtMultimedia/QRadioTunerControl>

class RtlFmRadioTunerControl : public QRadioTunerControl
{
    Q_OBJECT
public:
    RtlFmRadioTunerControl(QObject *parent = 0);
    ~RtlFmRadioTunerControl();

    QRadioTuner::State state() const;

    QRadioTuner::Band band() const;
    void setBand(QRadioTuner::Band band);
    bool isBandSupported(QRadioTuner::Band band) const;

    int frequency() const;
    int frequencyStep(QRadioTuner::Band band) const;
    QPair<int,int> frequencyRange(QRadioTuner::Band band) const;
    void setFrequency(int frequency);

    bool isStereo() const;
    QRadioTuner::StereoMode stereoMode() const;
    void setStereoMode(QRadioTuner::StereoMode stereoMode);

    int signalStrength() const;

    int volume() const;
    void setVolume(int volume);

    bool isMuted() const;
    void setMuted(bool muted);

    bool isSearching() const;

    bool isAntennaConnected() const { return true; }

    void searchForward();
    void searchBackward();
    void searchAllStations(QRadioTuner::SearchMode searchMode = QRadioTuner::SearchFast);
    void cancelSearch();
private:
    void setSearching(bool searching);

public:
    void start();
    void stop();

    QRadioTuner::Error error() const;
    QString errorString() const;

private:
    void setError(QRadioTuner::Error error, const QString &errorString);

private:
    class Private;
    Private *d;
};

#endif // RTLFMRADIOTUNERCONTROL_H