Skip to content

Commit

Permalink
AudioCATSISO: adapt to newer versions of Hamlib. Fixes #1919
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Dec 15, 2023
1 parent 86a1d15 commit bb406ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions plugins/samplemimo/audiocatsiso/audiocatsisohamlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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;
Expand Down
15 changes: 13 additions & 2 deletions plugins/samplemimo/audiocatsiso/audiocatsisohamlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -36,7 +47,7 @@ class AudioCATSISOHamlib
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);
};


Expand Down

0 comments on commit bb406ca

Please sign in to comment.