swift
soundcardsampleprovider.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_AFV_AUDIO_SOUNDCARDSAMPLEPROVIDER_H
7 #define SWIFT_CORE_AFV_AUDIO_SOUNDCARDSAMPLEPROVIDER_H
8 
9 #include <QAudioFormat>
10 #include <QObject>
11 
16 
17 namespace swift::core::afv::audio
18 {
21  {
22  Q_OBJECT
23 
24  public:
26  CSoundcardSampleProvider(int sampleRate, const QVector<quint16> &transceiverIDs, QObject *parent = nullptr);
27 
29  const QAudioFormat &waveFormat() const { return m_waveFormat; }
30 
32  void setBypassEffects(bool value);
33 
35  void pttUpdate(bool active, const QVector<TxTransceiverDto> &txTransceivers);
36 
38  int readSamples(QVector<float> &samples, qint64 count) override;
39 
41  void addOpusSamples(const IAudioDto &audioDto, const QVector<RxTransceiverDto> &rxTransceivers);
42 
44  void updateRadioTransceivers(const QVector<TransceiverDto> &radioTransceivers);
45 
47  QString getReceivingCallsignsString(quint16 transceiverID) const;
48 
51 
53  bool setGainRatioForTransceiver(quint16 transceiverID, double gainRatio);
54 
55  signals:
58 
59  private:
60  QAudioFormat m_waveFormat;
62  QVector<CReceiverSampleProvider *> m_receiverInputs;
63  QVector<quint16> m_receiverIDs;
64  };
65 
66 } // namespace swift::core::afv::audio
67 
68 #endif // SWIFT_CORE_AFV_AUDIO_SOUNDCARDSAMPLEPROVIDER_H
int readSamples(QVector< float > &samples, qint64 count)
Read samples.
bool setGainRatioForTransceiver(quint16 transceiverID, double gainRatio)
Setting gain for specified receiver.
swift::misc::aviation::CCallsignSet getReceivingCallsigns(quint16 transceiverID) const
Receiving callsign as single string.
void receivingCallsignsChanged(const TransceiverReceivingCallsignsChangedArgs &args)
Changed callsigns.
void updateRadioTransceivers(const QVector< TransceiverDto > &radioTransceivers)
Update all tranceivers.
QString getReceivingCallsignsString(quint16 transceiverID) const
Receiving callsign as single string.
void pttUpdate(bool active, const QVector< TxTransceiverDto > &txTransceivers)
Update PTT.
const QAudioFormat & waveFormat() const
Wave format.
CSoundcardSampleProvider(int sampleRate, const QVector< quint16 > &transceiverIDs, QObject *parent=nullptr)
Ctor.
void addOpusSamples(const IAudioDto &audioDto, const QVector< RxTransceiverDto > &rxTransceivers)
Add OPUS samples.
Value object for a set of callsigns.
Definition: callsignset.h:26