Skip to content

Commit

Permalink
BroadCast Frequenices
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Ranta committed Jul 24, 2023
1 parent 14b537c commit 57d3325
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions Classes/CWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#define M_SCAN 6
#define M_SEND2 7

struct GlobalFrequency{
int broadCastFrequency;
};

class CWindow{
public:
CWindow(struct Scene *scene);
Expand Down
6 changes: 5 additions & 1 deletion MainSource/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void control_cb(int control);

static void control_cb2(int control);

char *ProgramVersion=(char *)"SdrGlut-1161";
char *ProgramVersion=(char *)"SdrGlut-1162";

extern "C" struct Scene *sceneRoot(void);

Expand Down Expand Up @@ -78,6 +78,8 @@ int WriteToHelpTop();
static GLUI_EditText *edittext1;
static char text1[255];

struct GlobalFrequency gf;

int mainClean(void)
{
struct SceneList *list;
Expand Down Expand Up @@ -416,6 +418,8 @@ static void control_cb2(int control)
}
int main (int argc, char *argv[]) {

gf.broadCastFrequency=1;

SoapyNetSDR_SocketInit socket_init;

fprintf(stderr,"LIQUID_VERSION_NUMBER %d\n",LIQUID_VERSION_NUMBER);
Expand Down
4 changes: 4 additions & 0 deletions Radio/DialogRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extern "C" int doFFT2(double *x,double *y,long length,int direction);
#define Mode_Buttons 180




int Radio::doVoiceControl(struct Scene *scene)
{
if(!scene)return 1;
Expand Down Expand Up @@ -548,6 +550,8 @@ int Radio::dialogRadio(struct Scene *scene)
dd.lowpass->set_float_limits( 300, 14000 );

dd.lowpass->set_speed(1);

check_box = new GLUI_Checkbox( dd.glui, "Broadcast Frequencies", &gf.broadCastFrequency, 777, control_cb );

dd.sub_window=glutGetWindow();

Expand Down
12 changes: 7 additions & 5 deletions Radio/Radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,8 +1272,8 @@ int Radio::BackGroundEvents(struct Scene *scene)
}

if(rx->matchFrequencies){
// fprintf(stderr,"matchFrequencies this %p\n",this);
RadioWindowSetFrequency(rx);
//fprintf(stderr,"matchFrequencies this %p gf.broadCastFrequency %d\n",this,gf.broadCastFrequency);
if(gf.broadCastFrequency)RadioWindowSetFrequency(rx);
rx->matchFrequencies=0;
}

Expand Down Expand Up @@ -2695,6 +2695,7 @@ static void getMousel(int button, int state, int x, int y)
sdr->rx->fc=fl;
}
sdr->setFrequency2(sdr->rx);
sdr->rx->matchFrequencies=1;
break;
}
}
Expand Down Expand Up @@ -2788,8 +2789,6 @@ void Radio::getMouse(int button, int state, int x, int y)
rx->matchFrequencies=1;

}


adjustView(0);
return;
}else if(button == 4 && state == 0){
Expand Down Expand Up @@ -2852,7 +2851,10 @@ void Radio::getMouse(int button, int state, int x, int y)

// printf("fclick %f button %d state %d x %d y %d\n",fclick,button,state,x,y);
}else{
if(fsave != rx->fv) setFrequency2(rx);
if(fsave != rx->fv){
setFrequency2(rx);
}
rx->matchFrequencies=1;
}
adjustView(0);
}
Expand Down
1 change: 1 addition & 0 deletions Radio/Radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ using namespace std;
#include "paletteDraw.h"
#include "DialogSave.h"

extern struct GlobalFrequency gf;

class GLUIAPI GLUI_TextBox3 : public GLUI_TextBox
{
Expand Down
Binary file not shown.

0 comments on commit 57d3325

Please sign in to comment.