*
*/
+#ifndef _AGC_H
+#define _AGC_H
+
#define AGC_OFF 0
#define AGC_LONG 1
#define AGC_SLOW 2
#define AGC_MEDIUM 3
#define AGC_FAST 4
+#endif
*
*/
+#ifndef _ALEX_H
+#define _ALEX_H
+
#define ALEX_RX_ANTENNA_NONE 0x00000000
#define ALEX_RX_ANTENNA_XVTR 0x00000900
#define ALEX_RX_ANTENNA_EXT1 0x00000A00
#define ALEX_BYPASS_HPF 0x00000800
#define ALEX_6M_PREAMP 0x00000008
+
+#endif
*
*/
+#ifndef _AUDIO_H
+#define _AUDIO_H
+
extern int audio;
extern int audio_buffer_size;
/*
void audio_write(double *buffer,int samples);
*/
+
+#endif
*
*/
+#ifndef _BAND_H
+#define _BAND_H
+
#include <gtk/gtk.h>
#include "bandstack.h"
XVTR_ENTRY* getXvtrEntry(int i);
*/
+#endif
*
*/
-#ifndef BANDSTACK_H
-#define BANDSTACK_H
+#ifndef _BANDSTACK_H
+#define _BANDSTACK_H
+
/* --------------------------------------------------------------------------*/
/**
* @brief Bandstack definition
*
*/
+#ifndef _CHANNEL_H
+#define _CHANNEL_H
+
#define CHANNEL_RX0 0
#define CHANNEL_RX1 1
#define CHANNEL_RX2 2
#define CHANNEL_PSK 11
#endif
+#endif
+
*/
+#ifndef _CONFIGURE_H
+#define _CONFIGURE_H
+
#ifdef INCLUDE_GPIO
void configure_gpio(GtkWidget *parent);
#endif
+
+#endif
*
*/
+#ifndef _DISCOVERED_H
+#define _DISCOVERED_H
+
#include <netinet/in.h>
#ifdef LIMESDR
#include <SoapySDR/Device.h>
extern int devices;
extern DISCOVERED discovered[MAX_DEVICES];
+#endif
*
*/
+#ifndef _FILTER_H
+#define _FILTER_H
+
#include "mode.h"
// disable Var1 and Var2 (change to 12 to enable)
FILTER *filters[MODES];
+#endif
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef _FREEDV_H
+#define _FREEDV_H
+
extern int n_speech_samples;
extern int n_max_modem_samples;
extern short *demod_in;
int mod_sample_freedv(short sample);
void reset_freedv_tx_text_index();
+#endif
*
*/
-//
-// frequency.h
-//
+#ifndef _FREQUENCY_H
+#define _FREQUENCY_H
/* --------------------------------------------------------------------------*/
/**
char* getFrequencyInfo(long long frequency);
int getBand(long long frequency);
int canTransmit();
+
+#endif
*
*/
+#ifndef _GPIO_H
+#define _GPIO_H
+
extern int ENABLE_VFO_ENCODER;
extern int ENABLE_VFO_PULLUP;
extern int VFO_ENCODER_A;
int filter_get_state();
int noise_get_state();
int mox_get_state();
+
+#endif
+/* Copyright (C)
+* 2015 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef _LIME_DISCOVERY_H
+#define _LIME_DISCOVERY_H
+
void lime_discovery();
+
+#endif
+/* Copyright (C)
+* 2015 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef _LIME_PROTOCOL_H
+#define _LIME_PROTOCOL_H
+
#define BUFFER_SIZE 1024
void lime_protocol_init(int rx,int pixels);
void lime_protocol_set_frequency(long long f);
void lime_protocol_set_antenna(int ant);
void lime_protocol_set_attenuation(int attenuation);
+
+#endif
DISCOVERED *d=&discovered[selected_device];
double constant1=3.3;
- double constant2=0.09;
+ double constant2=0.095;
if(d->protocol==ORIGINAL_PROTOCOL) {
switch(d->device) {
case DEVICE_METIS:
+ constant1=3.3;
+ constant2=0.09;
break;
case DEVICE_HERMES:
- //constant2=0.095; HERMES 2
+ constant1=3.3;
+ constant2=0.095;
break;
case DEVICE_ANGELIA:
+ constant1=3.3;
+ constant2=0.095;
break;
case DEVICE_ORION:
constant1=5.0;
}
}
-//fprintf(stderr,"drive=%d tune_drive=%d alex_forward_power=%d alex_reverse_power=%d exciter_power=%d fwd=%f rev=%f exciter=%f\n",
-// drive, tune_drive, alex_forward_power, alex_reverse_power, exciter_power, fwd, rev, exciter);
+/*
+fprintf(stderr,"alex_forward_power=%d alex_reverse_power=%d exciter_power=%d fwd=%f rev=%f exciter=%f\n",
+ alex_forward_power, alex_reverse_power, exciter_power, fwd, rev, exciter);
meter_update(POWER,fwd,rev,exciter,alc);
+*/
}
return TRUE;
*
*/
+#ifndef _MAIN_H
+#define _MAIN_H
+
#include <sys/utsname.h>
extern struct utsname unameData;
void reconfigure_display();
void show_waterfall();
#endif
+#endif
*/
+#ifndef _MENU_H
+#define _MENU_H
+
GtkWidget* menu_init(int width,int height,GtkWidget *parent);
+
+#endif
*
*/
+#ifndef _METER_H
+#define _METER_H
+
#define SMETER 0
#define POWER 1
#ifdef PSK
GtkWidget* meter_init(int width,int height,GtkWidget *parent);
void meter_update(int meter_type,double value,double reverse,double exciter,double alc);
+
+#endif
*
*/
+#ifndef _MODE_H
+#define _MODE_H
+
#define modeLSB 0
#define modeUSB 1
#define modeDSB 2
char *mode_string[MODES];
+#endif
*
*/
+#ifndef _NEW_DISCOVERY_H
+#define _NEW_DISCOVERY_H
void new_discovery(void);
+
+#endif
static int psk_resample=6; // convert from 48000 to 8000
#endif
-static void new_protocol_high_priority(int run,int tx,double drive);
+static void new_protocol_high_priority(int run);
static void* new_protocol_thread(void* arg);
static void* new_protocol_timer_thread(void* arg);
static void process_iq_data(unsigned char *buffer);
}
void new_protocol_new_sample_rate(int rate) {
- new_protocol_high_priority(0,0,0);
+ new_protocol_high_priority(0);
sample_rate=rate;
new_protocol_calc_buffers();
wdsp_new_sample_rate(rate);
- new_protocol_high_priority(1,0,drive);
+ new_protocol_high_priority(1);
}
static void new_protocol_general() {
// use defaults apart from
buffer[37]=0x08; // phase word (not frequency)
buffer[38]=0x01; // enable hardware timer
- //buffer[58]=pa; // enable PA 0x01
+
buffer[58]=0x01; // enable PA 0x01
- //if((filter_board==APOLLO) && tune) {
+
if(filter_board==APOLLO) {
- buffer[58]|=0x02;
+ buffer[58]|=0x02; // enable APOLLO tuner
}
if(filter_board==ALEX) {
general_sequence++;
}
-static void new_protocol_high_priority(int run,int tx,double drive) {
+static void new_protocol_high_priority(int run) {
unsigned char buffer[1444];
BAND *band=band_get_current_band();
-//fprintf(stderr,"new_protocol_high_priority: run=%d tx=%d drive=%f\n", run, tx, drive);
+fprintf(stderr,"new_protocol_high_priority: run=%d\n", run);
memset(buffer, 0, sizeof(buffer));
buffer[0]=high_priority_sequence>>24;
buffer[2]=high_priority_sequence>>8;
buffer[3]=high_priority_sequence;
- buffer[4]=run|(tx<<1);
+ buffer[4]=run;
+ if(mode==modeCWU || mode==modeCWL) {
+ if(tune) {
+ buffer[4]|=0x02;
+ }
+ } else {
+ if(isTransmitting()) {
+ buffer[4]|=0x02;
+ }
+ }
long rxFrequency=ddsFrequency;
if(mode==modeCWU) {
buffer[331]=phase>>8;
buffer[332]=phase;
-
- double d=drive*((double)band->pa_calibration/100.0);
+ double d=drive;
+ if(tune) {
+ d=tune_drive;
+ }
+ d=d*((double)band->pa_calibration/100.0);
int power=(int)(d*255.0);
buffer[345]=power&0xFF;
+fprintf(stderr,"power=%d\n",power);
if(isTransmitting()) {
buffer[1401]=band->OCtx;
//filters|=alex_attenuation;
- if(tx) {
+ //if(isTransmitting() || mode==modeCWU || mode==modeCWL) {
+ if(isTransmitting()) {
filters|=0x08000000;
}
-/*
- buffer[1420]=filters>>24;
- buffer[1421]=filters>>16;
- buffer[1422]=filters>>8;
- buffer[1423]=filters;
-*/
-
buffer[1432]=filters>>24;
buffer[1433]=filters>>16;
buffer[1434]=filters>>8;
buffer[4]=1; // 1 DAC
buffer[5]=0; // default no CW
- if(cw_keyer_internal) {
+ if(cw_keyer_internal && (mode==modeCWU || mode==modeCWL)) {
buffer[5]|=0x02;
}
if(cw_keys_reversed) {
}
buffer[51]=0x7F; // Line in gain
-
if(sendto(data_socket,buffer,sizeof(buffer),0,(struct sockaddr*)&transmitter_addr,transmitter_addr_length)<0) {
fprintf(stderr,"sendto socket failed for tx specific\n");
exit(1);
}
void new_protocol_stop() {
- new_protocol_high_priority(0,0,0);
+ new_protocol_high_priority(0);
running=0;
sleep(1);
}
new_protocol_general();
new_protocol_start();
- new_protocol_high_priority(1,0,drive);
+ new_protocol_high_priority(1);
while(running) {
bytesread=recvfrom(data_socket,buffer,sizeof(buffer),0,(struct sockaddr*)&addr,&length);
sem_wait(&send_high_priority_sem);
if(send_high_priority==1) {
- new_protocol_high_priority(1,isTransmitting(),tune==0?drive:tune_drive);
+ new_protocol_high_priority(1);
send_high_priority=0;
}
sem_post(&send_high_priority_sem);
//fprintf(stderr,"samples per frame %d\n",samplesperframe);
- if(!isTransmitting()) {
+ //if(!isTransmitting()) {
b=16;
int i;
for(i=0;i<samplesperframe;i++) {
samples=0;
}
}
- }
+ //}
}
static void process_command_response(unsigned char *buffer) {
fprintf(stderr,"dash=%d\n",dash);
}
pll_locked=(buffer[4]>>3)&0x01;
+
+
adc_overload=buffer[5]&0x01;
exciter_power=((buffer[6]&0xFF)<<8)|(buffer[7]&0xFF);
alex_forward_power=((buffer[14]&0xFF)<<8)|(buffer[15]&0xFF);
supply_volts=((buffer[49]&0xFF)<<8)|(buffer[50]&0xFF);
if(previous_ptt!=ptt) {
- //send_high_priority=1;
- previous_ptt=ptt;
g_idle_add(ptt_update,(gpointer)ptt);
}
int j;
int demod_samples;
for(j=0;j<outputsamples;j++) {
- leftaudiosample=(short)(audiooutputbuffer[j*2]*32767.0*volume);
- rightaudiosample=(short)(audiooutputbuffer[(j*2)+1]*32767.0*volume);
- demod_samples=demod_sample_freedv(leftaudiosample);
- if(demod_samples!=0) {
- int s;
- int t;
- for(s=0;s<demod_samples;s++) {
- if(freedv_sync) {
- leftaudiosample=rightaudiosample=(short)((double)speech_out[s]*volume);
- } else {
- leftaudiosample=rightaudiosample=0;
- }
- for(t=0;t<6;t++) { // 8k to 48k
- if(local_audio) {
- audio_write(leftaudiosample,rightaudiosample);
+ if(freedv_samples==0) {
+ leftaudiosample=(short)(audiooutputbuffer[j*2]*32767.0*volume);
+ rightaudiosample=(short)(audiooutputbuffer[(j*2)+1]*32767.0*volume);
+ demod_samples=demod_sample_freedv(leftaudiosample);
+ if(demod_samples!=0) {
+ int s;
+ int t;
+ for(s=0;s<demod_samples;s++) {
+ if(freedv_sync) {
+ leftaudiosample=rightaudiosample=(short)((double)speech_out[s]*volume);
+ } else {
+ leftaudiosample=rightaudiosample=0;
}
- audiobuffer[audioindex++]=leftaudiosample>>8;
- audiobuffer[audioindex++]=leftaudiosample;
- audiobuffer[audioindex++]=rightaudiosample>>8;
- audiobuffer[audioindex++]=rightaudiosample;
- if(audioindex>=sizeof(audiobuffer)) {
- // insert the sequence
- audiobuffer[0]=audiosequence>>24;
- audiobuffer[1]=audiosequence>>16;
- audiobuffer[2]=audiosequence>>8;
- audiobuffer[3]=audiosequence;
- // send the buffer
- if(sendto(data_socket,audiobuffer,sizeof(audiobuffer),0,(struct sockaddr*)&audio_addr,audio_addr_length)<0) {
- fprintf(stderr,"sendto socket failed for audio\n");
- exit(1);
+ for(t=0;t<6;t++) { // 8k to 48k
+ if(local_audio) {
+ audio_write(leftaudiosample,rightaudiosample);
+ }
+ audiobuffer[audioindex++]=leftaudiosample>>8;
+ audiobuffer[audioindex++]=leftaudiosample;
+ audiobuffer[audioindex++]=rightaudiosample>>8;
+ audiobuffer[audioindex++]=rightaudiosample;
+ if(audioindex>=sizeof(audiobuffer)) {
+ // insert the sequence
+ audiobuffer[0]=audiosequence>>24;
+ audiobuffer[1]=audiosequence>>16;
+ audiobuffer[2]=audiosequence>>8;
+ audiobuffer[3]=audiosequence;
+ // send the buffer
+ if(sendto(data_socket,audiobuffer,sizeof(audiobuffer),0,(struct sockaddr*)&audio_addr,audio_addr_length)<0) {
+ fprintf(stderr,"sendto socket failed for audio\n");
+ exit(1);
+ }
+ audioindex=4;
+ audiosequence++;
}
- audioindex=4;
- audiosequence++;
}
}
}
+ freedv_samples++;
+ if(freedv_samples==freedv_resample) {
+ freedv_samples=0;
+ }
}
}
}
int error;
fexchange0(CHANNEL_RX0, iqinputbuffer, audiooutputbuffer, &error);
+ switch(mode) {
#ifdef PSK
- if(mode!=modePSK) {
+ case modePSK:
+ break;
#endif
- Spectrum0(1, CHANNEL_RX0, 0, 0, iqinputbuffer);
-#ifdef PSK
+ default:
+ Spectrum0(1, CHANNEL_RX0, 0, 0, iqinputbuffer);
+ break;
}
-#endif
+ switch(mode) {
#ifdef FREEDV
- if(mode==modeFREEDV) {
- process_freedv_rx_buffer();
- return;
- }
+ case modeFREEDV:
+ process_freedv_rx_buffer();
+ break;
#endif
- process_rx_buffer();
+ default:
+ process_rx_buffer();
+ break;
+ }
}
static void full_tx_buffer() {
*
*/
+#ifndef _NEW_PROTOCOL_H
+#define _NEW_PROTOCOL_H
// port definitions from host
#define GENERAL_REGISTERS_FROM_HOST_PORT 1024
int getTune();
int isTransmitting();
+#endif
*
*/
+#ifndef _OLD_DISCOVERY_H
+#define _OLD_DISCOVERY_H
+
void old_discovery(void);
+
+#endif
*
*/
+#ifndef _OLD_PROTOCOL_H
+#define _OLD_PROTOCOL_H
+
#define BUFFER_SIZE 1024
void old_protocol_stop();
void old_protocol_init(int rx,int pixels);
void old_protocol_new_sample_rate(int rate);
void schedule_frequency_changed();
+
+#endif
*
*/
+#ifndef _PANADAPTER_H
+#define _PANADAPTER_H
+
void panadapter_update(float* data,int tx);
GtkWidget* panadapter_init(int width,int height);
+
+
+#endif
*
*/
+#ifndef _PROPERTY_H
+#define _PROPERTY_H
+
typedef struct _PROPERTY PROPERTY;
/* --------------------------------------------------------------------------*/
char* getProperty(char* name);
void setProperty(char* name,char* value);
+#endif
gtk_label_set_width_chars (GTK_LABEL(psk_label), 80);
gtk_label_set_lines (GTK_LABEL(psk_label), TEXT_LINES);
gtk_label_set_line_wrap (GTK_LABEL(psk_label), TRUE);
- gtk_misc_set_alignment (GTK_MISC(psk_label), 0, 0);
+ //gtk_misc_set_alignment (GTK_MISC(psk_label), 0, 0);
+ gtk_widget_set_halign(psk_label,GTK_ALIGN_START);
+ gtk_widget_set_valign(psk_label,GTK_ALIGN_START);
return psk_label;
}
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef _PSK_H
+#define _PSK_H
+
#define PSK_BUFFER_SIZE 1024
#define PSK_RX_TEXT_SIZE 2048
extern int psk_get_frequency();
extern int psk_get_signal_level();
extern int psk_demod(double sample);
+
+#endif
*
*/
+#ifndef _PSK_WATERFALL_H
+#define _PSK_WATERFALL_H
void psk_waterfall_update(float *data);
GtkWidget* psk_waterfall_init(int width,int height);
+
+#endif
*
*/
+#ifndef _RADIO_H
+#define _RADIO_H
+
+#include "discovered.h"
#define NEW_MIC_IN 0x00
#define NEW_LINE_IN 0x01
extern void radioSaveState();
extern void calculate_display_average();
+
+#endif
*
*/
+#ifndef _SIGNAL_H
+#define _SIGNAL_H
+
double sineWave(double* buf, int samples, double sinphase, double freq);
double cosineWave(double* buf, int samples, double cosphase, double freq);
+
+#endif
*
*/
+#ifndef _SLIDERS_H
+#define _SLIDERS_H
+
void set_agc_gain(double value);
void set_af_gain(double value);
void set_mic_gain(double value);
void set_tune(double tune);
void set_attenuation_value(double attenuation);
GtkWidget *sliders_init(int my_width, int my_height, GtkWidget* parent);
+
+#endif
*/
+#ifndef _SPLASH_H
+#define _SPLASH_H
+
extern GtkWidget* splash_window;
void splash_close(void);
void splash_show(char *image_name,int time,int width,int height);
void splash_status(char *text);
+
+#endif
static GdkRGBA white;
static GdkRGBA gray;
+static void set_button_text_color(GtkWidget *widget,char *color) {
+ GtkStyleContext *style_context;
+ GtkCssProvider *provider = gtk_css_provider_new ();
+ gchar tmp[64];
+ style_context = gtk_widget_get_style_context(widget);
+ gtk_style_context_add_provider(style_context, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_snprintf(tmp, sizeof tmp, "GtkButton, GtkLabel { color: %s; }", color);
+ gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider), tmp, -1, NULL);
+ g_object_unref (provider);
+}
+
void update_toolbar_labels() {
if(toolbar_dialog_buttons) {
gtk_button_set_label(GTK_BUTTON(sim_band),"Band");
} else {
BAND* band=band_set_current(b);
entry=bandstack_entry_get_current();
- gtk_widget_override_background_color(last_band, GTK_STATE_NORMAL, &white);
+ set_button_text_color(last_band,"black");
last_band=widget;
- gtk_widget_override_background_color(last_band, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(last_band,"orange");
}
setMode(entry->mode);
FILTER* band_filters=filters[entry->mode];
#endif
BAND* band=band_get_band(i);
GtkWidget *b=gtk_button_new_with_label(band->title);
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &white);
+ set_button_text_color(b,"black");
//gtk_widget_override_font(b, pango_font_description_from_string("Arial 20"));
if(i==band_get_current()) {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(b,"orange");
last_band=b;
}
gtk_widget_show(b);
bandstack->current_entry=b;
- gtk_widget_override_background_color(last_bandstack, GTK_STATE_NORMAL, &white);
+ set_button_text_color(last_bandstack,"black");
last_bandstack=widget;
- gtk_widget_override_background_color(last_bandstack, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(last_bandstack,"orange");
BANDSTACK_ENTRY *entry;
entry=&(bandstack->entry[b]);
BANDSTACK_ENTRY *entry=&bandstack->entry[i];
sprintf(label,"%lld %s",entry->frequencyA,mode_string[entry->mode]);
GtkWidget *b=gtk_button_new_with_label(label);
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &white);
+ set_button_text_color(b,"black");
//gtk_widget_override_font(b, pango_font_description_from_string("Arial 20"));
if(i==bandstack->current_entry) {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(b,"orange");
last_bandstack=b;
}
gtk_widget_show(b);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
- gtk_widget_override_background_color(last_mode, GTK_STATE_NORMAL, &white);
+ set_button_text_color(last_mode,"black");
last_mode=widget;
- gtk_widget_override_background_color(last_mode, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(last_mode,"orange");
vfo_update(NULL);
}
for(i=0;i<MODES;i++) {
GtkWidget *b=gtk_button_new_with_label(mode_string[i]);
if(i==entry->mode) {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(b,"orange");
last_mode=b;
} else {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &white);
+ set_button_text_color(b,"black");
}
//gtk_widget_override_font(b, pango_font_description_from_string("Arial 20"));
gtk_widget_show(b);
FILTER* band_filters=filters[entry->mode];
FILTER* band_filter=&band_filters[entry->filter];
setFilter(band_filter->low,band_filter->high);
- gtk_widget_override_background_color(last_filter, GTK_STATE_NORMAL, &white);
+ set_button_text_color(last_filter,"black");
last_filter=widget;
- gtk_widget_override_background_color(last_filter, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(last_filter,"orange");
vfo_update(NULL);
}
GtkWidget *b=gtk_button_new_with_label(band_filters[i].title);
//gtk_widget_override_font(b, pango_font_description_from_string("Arial 20"));
if(i==entry->filter) {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &gray);
+ set_button_text_color(b,"orange");
last_filter=b;
} else {
- gtk_widget_override_background_color(b, GTK_STATE_NORMAL, &white);
+ set_button_text_color(b,"black");
}
gtk_widget_show(b);
gtk_grid_attach(GTK_GRID(grid),b,i%5,i/5,1,1);
int ptt_update(void *data) {
fprintf(stderr,"ptt_update\n");
- if(mode!=modeCWU && mode!=modeCWL) {
+ if(protocol==NEW_PROTOCOL || (mode!=modeCWU && mode!=modeCWL)) {
mox_cb(NULL,NULL);
}
fprintf(stderr,"ptt_update: mox=%d ptt=%d tune=%d\n",mox,ptt,tune);
*
*/
+#ifndef _TOOLBAR_H
+#define _TOOLBAR_H
+
extern int function;
void update_toolbar_labels();
void sim_function_cb(GtkWidget *widget, gpointer data);
GtkWidget *toolbar_init(int my_width, int my_height, GtkWidget* parent);
+
+#endif
*
*/
+#ifndef _VERSION_H
+#define _VERSION_H
+
extern char build_version[];
extern char build_date[];
+#endif
*
*/
+#ifndef _VFO_H
+#define _VFO_H
GtkWidget* vfo_init(int width,int height,GtkWidget *parent);
void vfo_step(int steps);
void vfo_move(int hz);
int vfo_update(void*);
+
+#endif
*
*/
+#ifndef _WATERFALL_H
+#define _WATERFALL_H
void waterfall_update(float *data);
GtkWidget* waterfall_init(int width,int height);
+
+#endif
*
*/
+#ifndef _WDSP_INIT_H
+#define _WDSP_INIT_H
+
extern void wdsp_set_input_rate(double rate);
extern void wdsp_set_offset(long long offset);
extern void setMode(int m);
extern void wdsp_init(int rx,int pixels,int protocol);
extern void wdsp_new_sample_rate(int rate);
extern void wdsp_set_agc(int rx, int agc);
+
+#endif
*
*/
+#ifndef _XVTR_H
+#define _XVTR_H
+
/* --------------------------------------------------------------------------*/
/**
* @brief XVTR definition
typedef struct _XVTR_ENTRY XVTR_ENTRY;
+#endif