return 0;
}
+int ext_vfo_id_step(void *data) {
+ int *ip=(int *) data;
+ int id=ip[0];
+ int step=ip[1];
+ vfo_id_step(id,step);
+ free(data);
+ return 0;
+}
+
int ext_set_mic_gain(void * data) {
double d=*(double *)data;
set_mic_gain(d);
}
update_toolbar_labels();
vfo_update();
+ return 0;
}
#endif
int ext_vfo_step(void *data);
+int ext_vfo_id_step(void *data);
int ext_vfo_mode_changed(void *data);
int ext_set_af_gain(void *data);
int ext_set_mic_gain(void *data);
MIDI_TUNE, // toggle "tune" state
TX_DRIVE, // RF output power
VFO, // change VFO frequency
+ VFOA, // change VFO-A frequency
+ VFOB, // change VFO-B frequency
VFO_A2B, // VFO A -> B
VFO_B2A, // VFO B -> A
VOX // VOX on/off
{ MIDI_TUNE, "TUNE"},
{ TX_DRIVE, "RFPOWER"},
{ VFO, "VFO"},
+ { VFOA, "VFOA"},
+ { VFOB, "VFOB"},
{ VFO_A2B, "VFOA2B"},
{ VFO_B2A, "VFOB2A"},
{ VOX, "VOX"},
int new;
double dnew;
double *dp;
+ int *ip;
switch (action) {
case SWAP_VFO: // only key supported
g_idle_add(ext_vfo_step, GINT_TO_POINTER(val));
}
break;
+ case VFOA: // only wheel supported
+ case VFOB: // only wheel supported
+ if (type == MIDI_WHEEL) {
+ ip=malloc(2*sizeof(int));
+ *ip = (action == VFOA) ? 0 : 1; // could use (action - VFOA) to support even more VFOs
+ *(ip+1)=val;
+ g_idle_add(ext_vfo_id_step, ip);
+ }
+ break;
case MIDI_TUNE: // only key supported
if (type == MIDI_KEY) {
new = !tune;
g_idle_add(ext_vfo_update,NULL);
}
}
+//
+// DL1YCF: essentially a duplicate of vfo_step but
+// changing a specific VFO freq instead of
+// changing the VFO of the active receiver
+//
+void vfo_id_step(int id, int steps) {
+ if(!locked) {
+ if(vfo[id].ctun) {
+ vfo[id].ctun_frequency=vfo[id].ctun_frequency+(steps*step);
+ } else {
+ vfo[id].frequency=vfo[id].frequency+(steps*step);
+ }
+ receiver_frequency_changed(active_receiver);
+#ifdef INCLUDED
+ BANDSTACK_ENTRY* entry=bandstack_entry_get_current();
+ setFrequency(active_receiver->frequency+(steps*step));
+#endif
+ g_idle_add(ext_vfo_update,NULL);
+ }
+}
void vfo_move(long long hz) {
int id=active_receiver->id;
extern GtkWidget* vfo_init(int width,int height,GtkWidget *parent);
extern void vfo_step(int steps);
+extern void vfo_id_step(int id, int steps);
extern void vfo_move(long long hz);
extern void vfo_move_to(long long hz);
extern void vfo_update();