custom GtkCellRendereds to pack the icons nicely + initial black screen

pull/5/head
Oona 2013-01-13 13:45:33 +02:00
rodzic bb6fad1bc9
commit ce8eb4942d
4 zmienionych plików z 30 dodań i 20 usunięć

7
gui.c
Wyświetl plik

@ -57,13 +57,10 @@ void createGUI() {
g_signal_connect (gui.cardcombo, "changed", G_CALLBACK(changeDevices), NULL);
g_signal_connect (gui.browsebtn, "clicked", G_CALLBACK(chooseDir), NULL);
savedstore = gtk_list_store_new (2, GDK_TYPE_PIXBUF, G_TYPE_STRING);
gtk_icon_view_set_model (GTK_ICON_VIEW(iconview), GTK_TREE_MODEL(savedstore));
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW(iconview), 0);
gtk_icon_view_set_text_column (GTK_ICON_VIEW(iconview), 1);
savedstore = GTK_LIST_STORE(gtk_icon_view_get_model(GTK_ICON_VIEW(iconview)));
RxPixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, false, 8, 320, 256);
gdk_pixbuf_fill(RxPixbuf, 0x666666ff);
gdk_pixbuf_fill(RxPixbuf, 0x000000ff);
DispPixbuf = gdk_pixbuf_scale_simple (RxPixbuf, 500, 400, GDK_INTERP_BILINEAR);
gtk_image_set_from_pixbuf(GTK_IMAGE(gui.RxImage), DispPixbuf);

Wyświetl plik

@ -121,7 +121,7 @@ void *Listen() {
gtk_label_set_markup (GTK_LABEL(gui.lastmodelabel), ModeSpec[Mode].Name);
gtk_label_set_markup (GTK_LABEL(gui.utclabel), rctime);
gdk_threads_leave ();
printf(" getvideo @ %.1f Hz, Skip %d, HedrShift %d Hz\n", 44100.0, 0, HedrShift);
printf(" getvideo @ %.1f Hz, Skip %d, HedrShift %+d Hz\n", 44100.0, 0, HedrShift);
Finished = GetVideo(Mode, 44100, 0, false);
@ -161,7 +161,7 @@ void *Listen() {
gdk_threads_enter ();
gtk_statusbar_push (GTK_STATUSBAR(gui.statusbar), 0, "Redrawing..." );
gdk_threads_leave ();
printf(" getvideo @ %.1f Hz, Skip %d, HedrShift %d Hz\n", Rate, Skip, HedrShift);
printf(" getvideo @ %.1f Hz, Skip %d, HedrShift %+d Hz\n", Rate, Skip, HedrShift);
GetVideo(Mode, Rate, Skip, true);
}
@ -180,7 +180,7 @@ void *Listen() {
pngfilename = g_string_new(g_key_file_get_string(keyfile,"slowrx","rxdir",NULL));
g_string_append_printf(pngfilename, "/%s_%s.png", timestr, ModeSpec[Mode].ShortName);
printf(" \"%s\"\n", pngfilename->str);
printf(" Saving to %s\n", pngfilename->str);
gdk_threads_enter ();
gtk_statusbar_push (GTK_STATUSBAR(gui.statusbar), 0, "Saving..." );

Wyświetl plik

@ -933,20 +933,30 @@
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">always</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkIconView" id="SavedIconView">
<property name="width_request">110</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscroll_policy">natural</property>
<property name="vscroll_policy">natural</property>
<property name="selection_mode">none</property>
<property name="columns">1</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<property name="model">savedstore</property>
<property name="item_padding">0</property>
<child>
<object class="GtkCellRendererPixbuf" id="pbrenderer1"/>
<attributes>
<attribute name="pixbuf">0</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="textrenderer1">
<property name="alignment">center</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
@ -1009,4 +1019,12 @@
</object>
</child>
</object>
<object class="GtkListStore" id="savedstore">
<columns>
<!-- column-name GdkPixbuf1 -->
<column type="GdkPixbuf"/>
<!-- column-name gchararray1 -->
<column type="gchararray"/>
</columns>
</object>
</interface>

7
vis.c
Wyświetl plik

@ -24,7 +24,6 @@ guchar GetVIS () {
//gushort MaxPcm = 0;
guint FFTLen = 2048, i=0, j=0, k=0, MaxBin = 0;
double Power[2048] = {0}, HedrBuf[100] = {0}, tone[100] = {0}, Hann[882] = {0};
char infostr[60] = {0};
bool gotvis = false;
guchar Bit[8] = {0}, ParityBit = 0;
@ -110,7 +109,7 @@ guchar GetVIS () {
(Bit[5] << 5) + (Bit[6] << 6);
ParityBit = Bit[7];
printf(" VIS %d (%02Xh) @ %d Hz\n", VIS, VIS, HedrShift);
printf(" VIS %d (%02Xh) @ %+d Hz\n", VIS, VIS, HedrShift);
Parity = Bit[0] ^ Bit[1] ^ Bit[2] ^ Bit[3] ^ Bit[4] ^ Bit[5] ^ Bit[6];
@ -121,11 +120,7 @@ guchar GetVIS () {
gotvis = false;
} else if (VISmap[VIS] == UNKNOWN) {
printf(" Unknown VIS\n");
snprintf(infostr, sizeof(infostr)-1, "How to decode image with VIS %d (%02Xh)?", VIS, VIS);
gotvis = false;
gdk_threads_enter();
// gtk_label_set_markup(GTK_LABEL(infolabel), infostr);
gdk_threads_leave();
} else {
gdk_threads_enter();
gtk_combo_box_set_active (GTK_COMBO_BOX(gui.modecombo), VISmap[VIS]-1);