tx->current_fg=&tx->fg;
tx->current_bg=&tx->bg;
+
+ tx->spp=1;
+ tx->lastmute=-1;
+ tx->zoom=0;
+ tx->cursor_pos=0;
+ tx->cursor_x_pos=0;
}
GtkWidget *gtk_tx_new(int16_t * wavdata, int wavsamples) {
g_return_if_fail(object != NULL);
g_return_if_fail(GTK_IS_TX(object));
+ GtkTx *tx=GTK_TX(object);
+
+ if (tx->disp_data) { free(tx->disp_data); tx->disp_data=NULL; }
+
if (GTK_OBJECT_CLASS(parent_class)->destroy) {
(*GTK_OBJECT_CLASS(parent_class)->destroy) (object);
- }
+ }
}
#define MAX_ZOOM_WIDTH 500000.0
tx->yc = widget->allocation.height / 2;
- if (tx->disp_data) free(tx->disp_data);
+ if (tx->disp_data) { free(tx->disp_data); tx->disp_data=NULL; }
if (tx->data) {
int max_spp=tx->samples/widget->allocation.width;
} else {
tx->disp_data = NULL;
}
+
+ tx->cursor_pos=-1;
+ tx->lastmute=-1;
+
//tX_warning("spp: %i samples: %i width %i x %i", tx->spp, tx->samples, tx->display_width, x);
}
gtk_widget_draw(GTK_WIDGET(tx), NULL);
}
-void gtk_tx_prepare_pos_display(GtkTx * tx) {
- tx->cursor_pos=-1;
- tx->lastmute=-1;
-}
-
void gtk_tx_update_pos_display(GtkTx * tx, int sample, int mute) {
GtkWidget *widget;
GdkWindow *window;
//current_x = sample / tx->spp + FR_SIZE;
current_pos = sample / tx->spp;
- if ((current_pos == tx->cursor_pos) && (tx->lastmute == mute)) return;
+ if ((current_pos == tx->cursor_pos) &&
+ (tx->lastmute == mute)) return;
tx->lastmute = mute;
/* speedup + easyness */
ymax = widget->allocation.height-1;
/* clean up last pos */
-
+
x = tx->cursor_x_pos;
if (x >= 0) {