1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

AudioCATSISO: adapt to newer versions of Hamlib. Fixes #1919

This commit is contained in:
f4exb 2023-12-15 21:40:50 +01:00
parent 86a1d15eba
commit bb406ca9a8
2 changed files with 14 additions and 4 deletions

View File

@ -17,7 +17,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <hamlib/rig.h>
#include "audiocatsisohamlib.h"
AudioCATSISOHamlib::AudioCATSISOHamlib()
@ -31,7 +30,7 @@ AudioCATSISOHamlib::~AudioCATSISOHamlib()
{
}
int AudioCATSISOHamlib::hash_model_list(const struct rig_caps *caps, void *data)
int AudioCATSISOHamlib::hash_model_list(HAMLIB_RIG_CAPS *caps, void *data)
{
AudioCATSISOHamlib *hamlibHandler = (AudioCATSISOHamlib*) data;
hamlibHandler->m_rigModels[caps->rig_model] = caps->model_name;

View File

@ -21,8 +21,19 @@
#define _AUDIOCATSISO_AUDIOCATSISOHAMLIB_H_
#include <QMap>
#include <hamlib/rig.h>
struct rig_caps;
#ifdef RIGCAPS_NOT_CONST
/* Since this commit:
* https://github.com/Hamlib/Hamlib/commit/ed941939359da9f8734dbdf4a21a9b01622a1a6e
* a 'struct rig_caps' is no longer constant (as passed to 'rig_list_foreach()' etc.).
*/
#define HAMLIB_RIG_CAPS struct rig_caps
#else
#define HAMLIB_RIG_CAPS const struct rig_caps
#endif
class AudioCATSISOHamlib
{
@ -36,7 +47,7 @@ public:
private:
QMap<uint32_t, QString> m_rigModels;
QMap<QString, uint32_t> m_rigNames;
static int hash_model_list(const struct rig_caps *caps, void *data);
static int hash_model_list(HAMLIB_RIG_CAPS *caps, void *data);
};