Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Feb 7, 2025
1 parent 5d9c6f4 commit 9124f99
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/applications/gqrx/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ MainWindow::MainWindow(const QString& cfgfile, bool edit_conf, QWidget *parent)

// I/Q playback
connect(iq_tool, SIGNAL(startRecording(QString, QString)), this, SLOT(startIqRecording(QString, QString)));
connect(iq_tool, SIGNAL(startRecording(QString)), remote, SLOT(startIqRecorder(QString)));
connect(iq_tool, SIGNAL(startRecording(QString, QString)), remote, SLOT(startIqRecorder(QString, QString)));
connect(iq_tool, SIGNAL(stopRecording()), this, SLOT(stopIqRecording()));
connect(iq_tool, SIGNAL(stopRecording()), remote, SLOT(stopIqRecorder()));
connect(iq_tool, SIGNAL(startPlayback(QString,float,qint64)), this, SLOT(startIqPlayback(QString,float,qint64)));
Expand Down
27 changes: 12 additions & 15 deletions src/applications/gqrx/remote_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,13 @@ void RemoteControl::stopAudioRecorder()
audio_recorder_status = false;
}

/*! \brief Start iq recorder (from another window). */
void RemoteControl::startIqRecorder(QString unused)
/*! \brief Start IQ recorder (from another window). */
void RemoteControl::startIqRecorder(QString unused1, QString unused2)
{
iq_recorder_status = true;
}

/*! \brief Stop iq recorder (from another window). */
/*! \brief Stop IQ recorder (from another window). */
void RemoteControl::stopIqRecorder()
{
iq_recorder_status = false;
Expand Down Expand Up @@ -775,7 +775,7 @@ QString RemoteControl::cmd_get_func(QStringList cmdlist)
QString func = cmdlist.value(1, "");

if (func == "?")
answer = QString("RECORD DSP RDS MUTE\n");
answer = QString("RECORD IQRECORD DSP RDS MUTE\n");
else if (func.compare("RECORD", Qt::CaseInsensitive) == 0)
answer = QString("%1\n").arg(audio_recorder_status);
else if (func.compare("IQRECORD", Qt::CaseInsensitive) == 0)
Expand All @@ -802,7 +802,7 @@ QString RemoteControl::cmd_set_func(QStringList cmdlist)

if (func == "?")
{
answer = QString("RECORD DSP RDS MUTE\n");
answer = QString("RECORD IQRECORD DSP RDS MUTE\n");
}
else if ((func.compare("RECORD", Qt::CaseInsensitive) == 0) && ok)
{
Expand All @@ -822,21 +822,18 @@ QString RemoteControl::cmd_set_func(QStringList cmdlist)
}
else if ((func.compare("IQRECORD", Qt::CaseInsensitive) == 0) && ok)
{
iq_recorder_status = status;
if (status)
if (!receiver_running)
{
if (receiver_running)
{
emit startIqRecorderEvent();
answer = QString("RPRT 0\n");
}
else
answer = QString("RPRT 1\n"); // Seend error
answer = QString("RPRT 1\n");
}
else
{
emit stopIqRecorderEvent();
answer = QString("RPRT 0\n");
iq_recorder_status = status;
if (status)
emit startIqRecorderEvent();
else
emit stopIqRecorderEvent();
}
}
else if ((func.compare("DSP", Qt::CaseInsensitive) == 0) && ok)
Expand Down
6 changes: 3 additions & 3 deletions src/applications/gqrx/remote_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public slots:
void setAudioMuted(bool muted);
void startAudioRecorder(QString unused);
void stopAudioRecorder();
void startIqRecorder(QString unused);
void startIqRecorder(QString unused1, QString unused2);
void stopIqRecorder();
bool setGain(QString name, double gain);
void setRDSstatus(bool enabled);
Expand Down Expand Up @@ -147,8 +147,8 @@ private slots:
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 iq_recorder_status; /*!< Iq Recording enabled */
bool audio_recorder_status; /*!< Audio recording enabled */
bool iq_recorder_status; /*!< IQ recording enabled */
bool receiver_running; /*!< Whether the receiver is running or not */
bool hamlib_compatible;
gain_list_t gains; /*!< Possible and current gain settings */
Expand Down
8 changes: 4 additions & 4 deletions src/qtgui/iq_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,23 @@ void CIqTool::on_recButton_clicked(bool checked)
}
}

/*! Public slot to trig iq recording by external events (e.g. remote control).
/*! Public slot to start IQ recording by external events (e.g. remote control).
*
* If a recording is already in progress we ignore the event.
*/
void CIqTool::startIqRecorder(void)
{
if (ui->recButton->isChecked())
{
qDebug() << __func__ << "An iq recording is already in progress";
qDebug() << __func__ << "An IQ recording is already in progress";
return;
}

// emulate a button click
ui->recButton->click();
}

/*! Public slot to stop stop recording by external events (e.g. remote control).
/*! Public slot to stop IQ recording by external events (e.g. remote control).
*
* The event is ignored if no recording is in progress.
*/
Expand All @@ -210,7 +210,7 @@ void CIqTool::stopIqRecorder(void)
if (ui->recButton->isChecked())
ui->recButton->click(); // emulate a button click
else
qDebug() << __func__ << "No iq recording in progress";
qDebug() << __func__ << "No IQ recording in progress";
}

/*! \brief Cancel a recording.
Expand Down
4 changes: 2 additions & 2 deletions src/qtgui/iq_tool.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class CIqTool : public QDialog
public slots:
void cancelRecording();
void cancelPlayback();
void startIqRecorder(void); /*!< Used if Iq Recorder is started e.g from remote control */
void stopIqRecorder(void); /*!< Used if Iq Recorder is stopped e.g. from remote control */
void startIqRecorder(void); /*!< Used if IQ Recorder is started e.g. from remote control */
void stopIqRecorder(void); /*!< Used if IQ Recorder is stopped e.g. from remote control */

private slots:
void on_recDirEdit_textChanged(const QString &text);
Expand Down

0 comments on commit 9124f99

Please sign in to comment.