Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Nov 8, 2024
1 parent 46bd90b commit d9727bd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
4 changes: 4 additions & 0 deletions resources/remote-control.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Supported commands:
Set the value of the gain setting with the name <gain_name> to <value>
p RDS_PI
Get the RDS PI code (in hexadecimal). Returns 0000 if not applicable.
p RDS_PS_NAME
Get the RDS Program Service (PS) name
p RDS_RADIOTEXT
Get the RDS RadioText message
u RECORD
Get status of audio recorder
U RECORD <status>
Expand Down
1 change: 0 additions & 1 deletion src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)
// enable frequency tooltips on FFT plot
ui->plotter->setTooltipsEnabled(true);


// Create list of input devices. This must be done before the configuration is
// restored because device probing might change the device configuration
CIoConfig::getDeviceList(devList);
Expand Down
23 changes: 12 additions & 11 deletions src/applications/gqrx/remote_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ RemoteControl::RemoteControl(QObject *parent) :
rc_passband_lo = 0;
rc_passband_hi = 0;
rc_program_id = "0000";
rds_station = QString("");
rds_radiotext = QString("");
rds_status = false;
signal_level = -200.0;
squelch_level = -150.0;
audio_gain = -6.0;
audio_recorder_status = false;
receiver_running = false;
hamlib_compatible = false;
rds_station = QString("");
rds_radiotext = QString("");

rc_port = DEFAULT_RC_PORT;
rc_allowed_hosts.append(DEFAULT_RC_ALLOWED_HOSTS);
Expand Down Expand Up @@ -419,20 +419,20 @@ void RemoteControl::setRDSstatus(bool enabled)
{
rds_status = enabled;
rc_program_id = "0000";
rds_station = "RDS OFF";
rds_radiotext = "RDS OFF";
rds_station = "";
rds_radiotext = "";
}

/*! \brief Set RDS program service (station) name. */
void RemoteControl::setRdsStation(QString name)
{
rds_station = name.trimmed();
rds_station = name;
}

/*! \brief Set RDS Radiotext. */
void RemoteControl::setRdsRadiotext(QString text)
{
rds_radiotext = text.trimmed();
rds_radiotext = text;
}


Expand Down Expand Up @@ -831,10 +831,10 @@ QString RemoteControl::cmd_get_param(QStringList cmdlist)
answer = QString("RDS_PI RDS_PS_NAME RDS_RADIOTEXT\n");
else if (func.compare("RDS_PI", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(rc_program_id);
else if (func.compare("RDS_PS_NAME", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(rds_station);
else if (func.compare("RDS_RADIOTEXT", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(rds_radiotext);
else if (func.compare("RDS_PS_NAME", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(rds_station);
else if (func.compare("RDS_RADIOTEXT", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(rds_radiotext);
else
answer = QString("RPRT 1\n");

Expand Down Expand Up @@ -878,7 +878,7 @@ QString RemoteControl::cmd_set_split_vfo()
/* Get info */
QString RemoteControl::cmd_get_info() const
{
return QString("Gqrx %1 rdsapi\n").arg(VERSION);
return QString("Gqrx %1\n").arg(VERSION);
};

/* Gpredict / Gqrx specific command: AOS - satellite AOS event */
Expand Down Expand Up @@ -922,6 +922,7 @@ QString RemoteControl::cmd_lnb_lo(QStringList cmdlist)
return QString("%1\n").arg((qint64)(rc_lnb_lo_mhz * 1e6));
}
}

/*
* '\dump_state' used by hamlib clients, e.g. xdx, fldigi, rigctl and etc
* More info:
Expand Down
6 changes: 2 additions & 4 deletions src/applications/gqrx/remote_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ private slots:
double squelch_level; /*!< Squelch level in dBFS */
float audio_gain; /*!< Audio gain in dB */
QString rc_program_id; /*!< RDS Program identification */
QString rds_station; /*!< RDS program service (station) name */
QString rds_radiotext; /*!< RDS Radiotext */
bool audio_recorder_status; /*!< Recording enabled */
bool receiver_running; /*!< Whether the receiver is running or not */
bool hamlib_compatible;
gain_list_t gains; /*!< Possible and current gain settings */
QString rds_station; /*!< RDS program service (station) name */
QString rds_radiotext; /*!< RDS Radiotext */

void setNewRemoteFreq(qint64 freq);
int modeStrToInt(QString mode_str);
Expand All @@ -168,8 +168,6 @@ private slots:
QString cmd_AOS();
QString cmd_LOS();
QString cmd_lnb_lo(QStringList cmdlist);
QString cmd_rds_station();
QString cmd_rds_radiotext();
QString cmd_dump_state() const;
};

Expand Down
13 changes: 4 additions & 9 deletions src/qtgui/dockrds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ void DockRDS::updateRDS(QString text, int type)
case 0:
if (text != ui->program_information->text()) {
// Clear the display if PI has changed
ui->station_name->setText("");
ui->program_type->setText("");
ui->flags->setText("");
ui->radiotext->setText("");
ui->clocktime->setText("");
ui->alt_freq->setText("");
ClearTextFields();
}
emit rdsPI(text);
ui->program_information->setText(text);
Expand Down Expand Up @@ -112,10 +107,10 @@ void DockRDS::ClearTextFields()
ui->radiotext->setText("");
ui->clocktime->setText("");
ui->alt_freq->setText("");
emit radiotextChanged("");

emit rdsPI("0000");
emit stationChanged("");
emit rdsPI("");
emit radiotextChanged("");
}

void DockRDS::showEnabled()
Expand Down

0 comments on commit d9727bd

Please sign in to comment.