more sed renaming of variables

pull/5/head
Oona 2013-01-13 21:52:31 +02:00
rodzic f7eed66052
commit c7577aab50
5 zmienionych plików z 45 dodań i 45 usunięć

Wyświetl plik

@ -29,10 +29,10 @@ pthread_t thread1;
GuiObjs gui; GuiObjs gui;
GdkPixbuf *RxPixbuf = NULL; GdkPixbuf *pixbuf_rx = NULL;
GdkPixbuf *DispPixbuf = NULL; GdkPixbuf *pixbuf_disp = NULL;
GdkPixbuf *pixbufPWR = NULL; GdkPixbuf *pixbuf_PWR = NULL;
GdkPixbuf *pixbufSNR = NULL; GdkPixbuf *pixbuf_SNR = NULL;
GtkListStore *savedstore = NULL; GtkListStore *savedstore = NULL;
@ -122,8 +122,8 @@ void evt_changeDevices() {
// Clear received picture & metadata // Clear received picture & metadata
void evt_clearPix() { void evt_clearPix() {
gdk_pixbuf_fill (DispPixbuf, 0); gdk_pixbuf_fill (pixbuf_disp, 0);
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), DispPixbuf); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), pixbuf_disp);
gtk_label_set_markup (GTK_LABEL(gui.label_fskid), ""); gtk_label_set_markup (GTK_LABEL(gui.label_fskid), "");
gtk_label_set_markup (GTK_LABEL(gui.label_utc), ""); gtk_label_set_markup (GTK_LABEL(gui.label_utc), "");
gtk_label_set_markup (GTK_LABEL(gui.label_lastmode), ""); gtk_label_set_markup (GTK_LABEL(gui.label_lastmode), "");

Wyświetl plik

@ -56,10 +56,10 @@ struct _GuiObjs {
}; };
extern GuiObjs gui; extern GuiObjs gui;
extern GdkPixbuf *pixbufPWR; extern GdkPixbuf *pixbuf_PWR;
extern GdkPixbuf *pixbufSNR; extern GdkPixbuf *pixbuf_SNR;
extern GdkPixbuf *RxPixbuf; extern GdkPixbuf *pixbuf_rx;
extern GdkPixbuf *DispPixbuf; extern GdkPixbuf *pixbuf_disp;
extern GtkListStore *savedstore; extern GtkListStore *savedstore;
@ -102,27 +102,27 @@ typedef struct ModeSpecDef {
extern ModeSpecDef ModeSpec[]; extern ModeSpecDef ModeSpec[];
void evt_AbortRx ();
void evt_changeDevices ();
void evt_chooseDir ();
void evt_clearPix ();
guchar clip (double a); guchar clip (double a);
void createGUI (); void createGUI ();
double deg2rad (double Deg); double deg2rad (double Deg);
void evt_deletewindow ();
double FindSync (guchar Mode, double Rate, int *Skip); double FindSync (guchar Mode, double Rate, int *Skip);
void evt_GetAdaptive ();
void GetFSK (char *dest); void GetFSK (char *dest);
bool GetVideo (guchar Mode, double Rate, int Skip, bool Redraw); bool GetVideo (guchar Mode, double Rate, int Skip, bool Redraw);
guchar GetVIS (); guchar GetVIS ();
guint GetBin (double Freq, guint FFTLen); guint GetBin (double Freq, guint FFTLen);
int initPcmDevice (); int initPcmDevice ();
void *Listen (); void *Listen ();
void evt_ManualStart ();
void populateDeviceList (); void populateDeviceList ();
void readPcm (gint numsamples); void readPcm (gint numsamples);
void setNewRxDir ();
void setVU (short int PcmValue, double SNRdB); void setVU (short int PcmValue, double SNRdB);
void evt_show_about();
void evt_AbortRx ();
void evt_changeDevices ();
void evt_chooseDir ();
void evt_clearPix ();
void evt_deletewindow ();
void evt_GetAdaptive ();
void evt_ManualStart ();
void evt_show_about ();
#endif #endif

24
gui.c
Wyświetl plik

@ -58,13 +58,13 @@ void createGUI() {
savedstore = GTK_LIST_STORE(gtk_icon_view_get_model(GTK_ICON_VIEW(gui.iconview))); savedstore = GTK_LIST_STORE(gtk_icon_view_get_model(GTK_ICON_VIEW(gui.iconview)));
RxPixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 320, 256); pixbuf_rx = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 320, 256);
gdk_pixbuf_fill(RxPixbuf, 0x000000ff); gdk_pixbuf_fill(pixbuf_rx, 0x000000ff);
DispPixbuf = gdk_pixbuf_scale_simple (RxPixbuf, 500, 400, GDK_INTERP_BILINEAR); pixbuf_disp = gdk_pixbuf_scale_simple (pixbuf_rx, 500, 400, GDK_INTERP_BILINEAR);
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), DispPixbuf); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), pixbuf_disp);
pixbufPWR = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 100, 20); pixbuf_PWR = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 100, 20);
pixbufSNR = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 100, 20); pixbuf_SNR = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 100, 20);
gtk_combo_box_set_active(GTK_COMBO_BOX(gui.combo_mode), 0); gtk_combo_box_set_active(GTK_COMBO_BOX(gui.combo_mode), 0);
@ -88,11 +88,11 @@ void setVU (short int PcmValue, double SNRdB) {
guchar *pixelsPWR, *pixelsSNR, *pPWR, *pSNR; guchar *pixelsPWR, *pixelsSNR, *pPWR, *pSNR;
unsigned int rowstridePWR,rowstrideSNR; unsigned int rowstridePWR,rowstrideSNR;
rowstridePWR = gdk_pixbuf_get_rowstride (pixbufPWR); rowstridePWR = gdk_pixbuf_get_rowstride (pixbuf_PWR);
pixelsPWR = gdk_pixbuf_get_pixels (pixbufPWR); pixelsPWR = gdk_pixbuf_get_pixels (pixbuf_PWR);
rowstrideSNR = gdk_pixbuf_get_rowstride (pixbufSNR); rowstrideSNR = gdk_pixbuf_get_rowstride (pixbuf_SNR);
pixelsSNR = gdk_pixbuf_get_pixels (pixbufSNR); pixelsSNR = gdk_pixbuf_get_pixels (pixbuf_SNR);
for (y=0; y<20; y++) { for (y=0; y<20; y++) {
for (x=0; x<100; x++) { for (x=0; x<100; x++) {
@ -127,8 +127,8 @@ void setVU (short int PcmValue, double SNRdB) {
} }
gdk_threads_enter(); gdk_threads_enter();
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_pwr), pixbufPWR); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_pwr), pixbuf_PWR);
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_snr), pixbufSNR); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_snr), pixbuf_SNR);
gdk_threads_leave(); gdk_threads_leave();
} }

Wyświetl plik

@ -174,7 +174,7 @@ void *Listen() {
HasSync = NULL; HasSync = NULL;
// Add thumbnail to iconview // Add thumbnail to iconview
thumbbuf = gdk_pixbuf_scale_simple (RxPixbuf, 100, thumbbuf = gdk_pixbuf_scale_simple (pixbuf_rx, 100,
100.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_HYPER); 100.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_HYPER);
gdk_threads_enter (); gdk_threads_enter ();
gtk_list_store_prepend (savedstore, &iter); gtk_list_store_prepend (savedstore, &iter);
@ -202,7 +202,7 @@ void *Listen() {
// Save the received image as PNG // Save the received image as PNG
GdkPixbuf *scaledpb; GdkPixbuf *scaledpb;
scaledpb = gdk_pixbuf_scale_simple (RxPixbuf, ModeSpec[Mode].ImgWidth, scaledpb = gdk_pixbuf_scale_simple (pixbuf_rx, ModeSpec[Mode].ImgWidth,
ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_HYPER); ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_HYPER);
ensure_dir_exists(g_key_file_get_string(keyfile,"slowrx","rxdir",NULL)); ensure_dir_exists(g_key_file_get_string(keyfile,"slowrx","rxdir",NULL));
@ -262,7 +262,7 @@ int main(int argc, char *argv[]) {
fwrite(confdata,1,(size_t)keylen,ConfFile); fwrite(confdata,1,(size_t)keylen,ConfFile);
fclose(ConfFile); fclose(ConfFile);
g_object_unref(RxPixbuf); g_object_unref(pixbuf_rx);
free(StoredLum); free(StoredLum);
return (EXIT_SUCCESS); return (EXIT_SUCCESS);

22
video.c
Wyświetl plik

@ -80,21 +80,21 @@ bool GetVideo(guchar Mode, double Rate, int Skip, bool Redraw) {
// Initialize pixbuffer // Initialize pixbuffer
if (!Redraw) { if (!Redraw) {
g_object_unref(RxPixbuf); g_object_unref(pixbuf_rx);
RxPixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, ModeSpec[Mode].ImgWidth, ModeSpec[Mode].ImgHeight); pixbuf_rx = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, ModeSpec[Mode].ImgWidth, ModeSpec[Mode].ImgHeight);
gdk_pixbuf_fill(RxPixbuf, 0); gdk_pixbuf_fill(pixbuf_rx, 0);
} }
int rowstride = gdk_pixbuf_get_rowstride (RxPixbuf); int rowstride = gdk_pixbuf_get_rowstride (pixbuf_rx);
guchar *pixels, *p; guchar *pixels, *p;
pixels = gdk_pixbuf_get_pixels(RxPixbuf); pixels = gdk_pixbuf_get_pixels(pixbuf_rx);
g_object_unref(DispPixbuf); g_object_unref(pixbuf_disp);
DispPixbuf = gdk_pixbuf_scale_simple(RxPixbuf, 500, pixbuf_disp = gdk_pixbuf_scale_simple(pixbuf_rx, 500,
500.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_BILINEAR); 500.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_BILINEAR);
gdk_threads_enter(); gdk_threads_enter();
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), DispPixbuf); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), pixbuf_disp);
gdk_threads_leave(); gdk_threads_leave();
Length = ModeSpec[Mode].LineLen * ModeSpec[Mode].ImgHeight * 44100; Length = ModeSpec[Mode].LineLen * ModeSpec[Mode].ImgHeight * 44100;
@ -373,12 +373,12 @@ bool GetVideo(guchar Mode, double Rate, int Skip, bool Redraw) {
if (!Redraw || LineNum % 5 == 0 || LineNum == ModeSpec[Mode].ImgHeight-1) { if (!Redraw || LineNum % 5 == 0 || LineNum == ModeSpec[Mode].ImgHeight-1) {
// Scale and update image // Scale and update image
g_object_unref(DispPixbuf); g_object_unref(pixbuf_disp);
DispPixbuf = gdk_pixbuf_scale_simple(RxPixbuf, 500, pixbuf_disp = gdk_pixbuf_scale_simple(pixbuf_rx, 500,
500.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_BILINEAR); 500.0/ModeSpec[Mode].ImgWidth * ModeSpec[Mode].ImgHeight * ModeSpec[Mode].YScale, GDK_INTERP_BILINEAR);
gdk_threads_enter(); gdk_threads_enter();
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), DispPixbuf); gtk_image_set_from_pixbuf(GTK_IMAGE(gui.image_rx), pixbuf_disp);
gdk_threads_leave(); gdk_threads_leave();
} }
} }