mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
112 lines
3.1 KiB
C++
112 lines
3.1 KiB
C++
#ifndef INCLUDE_CHANNELMARKER_H
|
|
#define INCLUDE_CHANNELMARKER_H
|
|
|
|
#include <QObject>
|
|
#include <QColor>
|
|
#include <QByteArray>
|
|
|
|
#include "settings/serializable.h"
|
|
#include "export.h"
|
|
|
|
class SDRBASE_API ChannelMarker : public QObject, public Serializable {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
typedef enum sidebands_e
|
|
{
|
|
dsb,
|
|
lsb,
|
|
usb,
|
|
vusb, //!< USB with vestigial LSB
|
|
vlsb //!< LSB with vestigial USB
|
|
} sidebands_t;
|
|
|
|
typedef enum frequencyScaleDisplay_e
|
|
{
|
|
FScaleDisplay_freq,
|
|
FScaleDisplay_title,
|
|
FScaleDisplay_addressSend,
|
|
FScaleDisplay_addressReceive,
|
|
FScaleDisplay_none
|
|
} frequencyScaleDisplay_t;
|
|
|
|
ChannelMarker(QObject* parent = NULL);
|
|
|
|
void emitChangedByAPI();
|
|
|
|
void setTitle(const QString& title);
|
|
const QString& getTitle() const { return m_title; }
|
|
|
|
void setCenterFrequency(int centerFrequency);
|
|
void setCenterFrequencyByCursor(int centerFrequency);
|
|
int getCenterFrequency() const { return m_centerFrequency; }
|
|
|
|
void setBandwidth(int bandwidth);
|
|
int getBandwidth() const { return m_bandwidth; }
|
|
|
|
void setOppositeBandwidth(int bandwidth);
|
|
int getOppositeBandwidth() const { return m_oppositeBandwidth; }
|
|
|
|
void setLowCutoff(int lowCutoff);
|
|
int getLowCutoff() const { return m_lowCutoff; }
|
|
|
|
void setSidebands(sidebands_t sidebands);
|
|
sidebands_t getSidebands() const { return m_sidebands; }
|
|
|
|
void setVisible(bool visible);
|
|
bool getVisible() const { return m_visible; }
|
|
|
|
void setHighlighted(bool highlighted);
|
|
void setHighlightedByCursor(bool highlighted);
|
|
bool getHighlighted() const { return m_highlighted; }
|
|
|
|
void setColor(const QColor& color);
|
|
const QColor& getColor() const { return m_color; }
|
|
|
|
void setMovable(bool movable) { m_movable = movable; }
|
|
bool getMovable() const { return m_movable; }
|
|
|
|
void setFrequencyScaleDisplayType(frequencyScaleDisplay_t type) { m_fScaleDisplayType = type; }
|
|
frequencyScaleDisplay_t getFrequencyScaleDisplayType() const { return m_fScaleDisplayType; }
|
|
|
|
const QString& getDisplayAddressSend() const { return m_displayAddressSend; }
|
|
const QString& getDisplayAddressReceive() const { return m_displayAddressReceive; }
|
|
|
|
void setSourceOrSinkStream(bool sourceOrSinkStream) { m_sourceOrSinkStream = sourceOrSinkStream; }
|
|
bool getSourceOrSinkStream() const { return m_sourceOrSinkStream; }
|
|
void setStreamIndex(int streamIndex) { m_streamIndex = streamIndex; }
|
|
int getStreamIndex() const { return m_streamIndex; }
|
|
|
|
virtual QByteArray serialize() const;
|
|
virtual bool deserialize(const QByteArray& data);
|
|
|
|
protected:
|
|
static QRgb m_colorTable[];
|
|
static int m_nextColor;
|
|
|
|
QString m_title;
|
|
QString m_displayAddressSend;
|
|
QString m_displayAddressReceive;
|
|
int m_centerFrequency;
|
|
int m_bandwidth;
|
|
int m_oppositeBandwidth;
|
|
int m_lowCutoff;
|
|
sidebands_t m_sidebands;
|
|
bool m_visible;
|
|
bool m_highlighted;
|
|
QColor m_color;
|
|
bool m_movable;
|
|
frequencyScaleDisplay_t m_fScaleDisplayType;
|
|
bool m_sourceOrSinkStream;
|
|
int m_streamIndex;
|
|
|
|
void resetToDefaults();
|
|
|
|
signals:
|
|
void changedByAPI();
|
|
void changedByCursor();
|
|
void highlightedByCursor();
|
|
};
|
|
|
|
#endif // INCLUDE_CHANNELMARKER_H
|