#ifndef FD_xtuner_h_ #define FD_xtuner_h_ /* Includes */ #ifdef _HAVE_PARAM_H # include #endif #if (defined(BSD) && (BSD >= 199306)) # include # include # include #ifdef __FreeBSD__ # include #else # include #endif #else # include # include #endif #include "X11/forms.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Global defines */ #define FCODE(f) ((int)(((float)(f)-88.0)*40)+0xf6c) #if (defined(BSD) && (BSD >= 199306)) # define OUTW(word,port) outw(port,word) # define OUTB(byte,port) outb(port,byte) #else # define OUTW(word,port) outw(word,port) # define OUTB(byte,port) outb(byte,port) #endif #if (defined(BSD) && (BSD >= 199306)) int fpiopl; #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define ON 1 #define OFF 0 #define AUTOON 2 #define AUTOOFF 3 #define UPDATE 4 #define TONE 1 #define NORM 0 #define BASS_DOWN 0 #define BASS_UP 1 #define TREBLE_DOWN 2 #define TREBLE_UP 3 /* Ioctl data direction flags */ #define IOC_DATA_NONE 0 #define IOC_DATA_IN 1 #define IOC_DATA_OUT 2 #define HOMEDIR "/root/.radiorc" Pixmap happypixmap; typedef struct { int timeofday; int on_hours; int on_mins; int off_hours; int off_mins; float freq; float vol_level; float MemCh[10]; unsigned long rport; } xtuner_data_t; typedef struct { int dev_fd; int bass_level; int treble_level; int volume_level; int mixer_supp; int devmask; int caps; } mixer_data_t; /* flags */ typedef struct { int disp_type_f; int set_type_f; int radio_f; int set_f; int mute_f; int auto_f; int miltime_f; int preset_f; int mixer_f; int tuned_f; } flags_t; /* 1's correspond to LED segments begin active */ static int LCD[10][7] = {1,1,1,0,1,1,1, 0,0,0,0,0,1,1, 0,1,1,1,1,1,0, 0,0,1,1,1,1,1, 1,0,0,1,0,1,1, 1,0,1,1,1,0,1, 1,1,1,1,1,0,1, 1,0,1,0,0,1,1, 1,1,1,1,1,1,1, 1,0,1,1,0,1,1}; /**** Forms and Objects ****/ typedef struct { FL_FORM *xtuner; FL_OBJECT *volume; FL_OBJECT *volumeup; FL_OBJECT *volumedn; FL_OBJECT *presets; FL_OBJECT *left_tune; FL_OBJECT *right_tune; FL_OBJECT *mem1; FL_OBJECT *mem2; FL_OBJECT *mem3; FL_OBJECT *mem4; FL_OBJECT *mem5; FL_OBJECT *mem6; FL_OBJECT *mem7; FL_OBJECT *mem8; FL_OBJECT *setmem; FL_OBJECT *exit; FL_OBJECT *but; FL_OBJECT *canvas; FL_OBJECT *off_timer; FL_OBJECT *on_timer; FL_OBJECT *update_timer; FL_OBJECT *on_timer_but; FL_OBJECT *auto_but; FL_OBJECT *mute_but; FL_OBJECT *power_but; FL_OBJECT *fine_text; FL_OBJECT *vol_text; FL_OBJECT *fine_frame; FL_OBJECT *vol_frame; FL_OBJECT *fine_up; FL_OBJECT *fine_down; void *vdata; long ldata; } FD_xtuner; typedef struct { FL_FORM *quitform; FL_OBJECT *yes; FL_OBJECT *no; FL_FORM *quitform2; FL_OBJECT *sp; FL_OBJECT *dp; FL_FORM *set_time; FL_OBJECT *hrs_up; FL_OBJECT *mins_dn; FL_OBJECT *hrs_dn; FL_OBJECT *mins_up; FL_OBJECT *hours; FL_OBJECT *mins; FL_OBJECT *done; void *vdata; long ldata; } FD_misc; /* Prototypes */ void radioon(int ch, int p2); void radiooff(void); void volumeup(void); void volumedn(void); void init_radio(); void write_file(void); void update(void); void do_exit(void); void init_canvasGC(FD_xtuner *); int is_tuned(void); extern FD_xtuner * create_form_xtuner(void); extern FD_misc * create_form_misc(void); /**** Callback routines ****/ extern void set_presets(FL_OBJECT *, long); extern void adjust_volume(FL_OBJECT *, long); extern void tuner(FL_OBJECT *, long); extern void preset(FL_OBJECT *, long); extern void power(FL_OBJECT *, long); extern void mute(FL_OBJECT *, long); extern void do_timer(FL_OBJECT *, long); extern void set_timer(FL_OBJECT *, long); extern void do_set_time(FL_OBJECT *, long); extern void mixer(FL_OBJECT *, long); #endif /* FD_xtuner_h_ */