Changeset 531
- Timestamp:
- 01/12/08 01:53:20 (8 months ago)
- Files:
-
- sweep/trunk/src/Makefile.am (modified) (1 diff)
- sweep/trunk/src/sweep_app.h (modified) (1 diff)
- sweep/trunk/src/view.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/trunk/src/Makefile.am
r521 r531 56 56 sample-display.c sample-display.h \ 57 57 samplerate.c \ 58 scroll-pane.c scroll-pane.h \ 58 59 sw_chooser.c sw_chooser.h \ 59 60 sweep_filter.c \ sweep/trunk/src/sweep_app.h
r438 r531 102 102 103 103 GtkWidget * follow_toggle; 104 GtkWidget * play_pos; 104 GtkWidget * play_pos_time; 105 GtkWidget * play_pos_frame; 105 106 GtkWidget * loop_toggle; 106 107 GtkWidget * playrev_toggle; sweep/trunk/src/view.c
r521 r531 61 61 #include "head.h" 62 62 #include "view_pixmaps.h" 63 #include "scroll-pane.h" 63 64 64 65 /*#define DEBUG*/ … … 2250 2251 G_CALLBACK(view_rate_zeroed_cb), view); 2251 2252 2252 /* scroll bar*/2253 /* scroll pane */ 2253 2254 step = ((gfloat)(end - start)) / 10.0; 2254 2255 if (step < 1.0) step = 1.0; … … 2267 2268 g_signal_connect (G_OBJECT(view->adj), "changed", 2268 2269 G_CALLBACK(adj_changed_cb), view); 2269 2270 scrollbar = gtk_hscrollbar_new(GTK_ADJUSTMENT(view->adj)); 2271 gtk_table_attach (GTK_TABLE(table), scrollbar, 2272 1, 2, 2, 3, 2273 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 2274 0, 0); 2270 GtkWidget *scroll_frame; 2271 2272 scroll_frame = gtk_frame_new (NULL); 2273 gtk_frame_set_shadow_type (GTK_FRAME (scroll_frame), GTK_SHADOW_IN); 2274 gtk_table_attach (GTK_TABLE(table), scroll_frame, 2275 1, 2, 2, 3, 2276 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 2277 0, 0); 2278 gtk_widget_show (scroll_frame); 2279 scrollbar = scroll_pane_new(GTK_ADJUSTMENT(view->adj)); 2280 view->scrollbar = scrollbar; 2281 2282 gtk_container_add (GTK_CONTAINER (scroll_frame), scrollbar); 2283 2284 scroll_pane_set_view(SCROLL_PANE(scrollbar), view); 2275 2285 gtk_widget_show(scrollbar); 2276 2277 2286 2278 2287 /* playback toolbar */ … … 2339 2348 gtk_widget_show (pixmap); 2340 2349 gtk_box_pack_end (GTK_BOX(imagebox), pixmap, FALSE, FALSE, 0); 2350 2351 imagebox = gtk_hbox_new (FALSE, 0); 2352 gtk_box_pack_start (GTK_BOX(tool_hbox), imagebox, TRUE, FALSE, 0); 2353 gtk_widget_show (imagebox); 2354 2355 label = gtk_label_new ("TIME:"); 2356 gtk_box_pack_start (GTK_BOX(imagebox), label, FALSE, FALSE, 0); 2357 gtk_widget_show (label); 2358 2359 label = gtk_label_new ("00:00:00.000"); 2360 gtk_box_pack_start (GTK_BOX(imagebox), label, TRUE, TRUE, 12); 2361 gtk_widget_show (label); 2362 view->play_pos_time = label; 2341 2363 2342 label = gtk_label_new (" 00:00:00.000");2343 gtk_box_pack_start (GTK_BOX( tool_hbox), label, TRUE, TRUE, 0);2364 label = gtk_label_new ("FRAME:"); 2365 gtk_box_pack_start (GTK_BOX(imagebox), label, FALSE, FALSE, 0); 2344 2366 gtk_widget_show (label); 2345 view->play_pos = label; 2367 2368 label = gtk_label_new ("00000000"); 2369 gtk_box_pack_start (GTK_BOX(imagebox), label, TRUE, TRUE, 12); 2370 gtk_widget_show (label); 2371 view->play_pos_frame = label; 2346 2372 2347 2373 imagebox = gtk_vbox_new (FALSE, 0); … … 2364 2390 gtk_box_pack_start (GTK_BOX(hbox), entry, TRUE, TRUE, 0); 2365 2391 gtk_widget_show (entry); 2366 view->play_pos = entry;2392 view->play_pos_time = entry; 2367 2393 #endif 2368 2394 … … 3263 3289 { 3264 3290 SampleDisplay * sd = SAMPLE_DISPLAY(view->display); 3291 ScrollPane * sc = SCROLL_PANE(view->scrollbar); 3265 3292 sw_sample * sample = view->sample; 3266 3293 sw_framecount_t offset; … … 3277 3304 snprint_time (buf, BUF_LEN, 3278 3305 frames_to_time (sample->sounddata->format, offset)); 3306 3307 /* FIXME: this is bad */ 3279 3308 /* cheesy rate limiter. ugly in operation. limits pango damage */ 3280 3309 if (rate_limit >= 3) { 3281 3310 rate_limit=0; 3282 3311 #ifdef PLAYPOS_LABEL 3283 gtk_label_set_text (GTK_LABEL(view->play_pos), buf); 3312 gtk_label_set_text (GTK_LABEL(view->play_pos_time), buf); 3313 3314 snprintf (buf, BUF_LEN, "%08d", offset ); 3315 gtk_label_set_text (GTK_LABEL(view->play_pos_frame), buf); 3284 3316 #else 3285 gtk_entry_set_text (GTK_ENTRY(view->play_pos ), buf);3317 gtk_entry_set_text (GTK_ENTRY(view->play_pos_time), buf); 3286 3318 #endif 3287 3319 … … 3292 3324 sample_display_refresh_play_marker (sd); 3293 3325 sample_display_refresh_user_marker (sd); 3326 // scroll_pane_refresh(sc); 3294 3327 3295 3328 if (view->following) { … … 3551 3584 { 3552 3585 SampleDisplay * sd = SAMPLE_DISPLAY(v->display); 3586 ScrollPane * sc = SCROLL_PANE(v->scrollbar); 3553 3587 3554 3588 sample_display_refresh(sd); 3589 scroll_pane_refresh(sc); 3555 3590 } 3556 3591
