Changeset 473
- Timestamp:
- 01/22/07 22:57:42 (2 years ago)
- Files:
-
- sweep/branches/sweep-info-panel/Makefile.am (modified) (1 diff)
- sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/src/info-panel.c (modified) (5 diffs)
- sweep/branches/sweep-info-panel/src/sample-display.c (modified) (18 diffs)
- sweep/branches/sweep-info-panel/src/sweep_marker.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/branches/sweep-info-panel/Makefile.am
r465 r473 16 16 pixmaps/marker-add-ico.png \ 17 17 pixmaps/undo-revall-ico.png \ 18 pixmaps/undo-rev-ico.png 18 pixmaps/undo-rev-ico.png \ 19 pixmaps/marker-img0.png \ 20 pixmaps/marker-img1.png \ 21 pixmaps/marker-img2.png \ 22 pixmaps/marker-img3.png \ 23 pixmaps/marker-img4.png \ 24 pixmaps/marker-img5.png \ 25 pixmaps/marker-img6.png \ 26 pixmaps/marker-img7.png \ 27 pixmaps/marker-img8.png \ 28 pixmaps/marker-img9.png \ 29 pixmaps/marker-img10.png 19 30 20 31 sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h
r465 r473 72 72 perform_marker_finish_op (sw_sample * sample, sw_op_instance * inst); 73 73 74 /* 75 * Max number of predefined marker colors 76 */ 77 #define MARKER_IMG_NUMBER 11 78 79 80 void 81 sweep_load_marker_icons (void); 82 74 83 #endif /* __SWEEP_MARKER_H__ */ sweep/branches/sweep-info-panel/src/info-panel.c
r470 r473 93 93 #endif 94 94 95 extern gint mark_colors[]; 96 extern GdkPixbuf *mark_icons[]; 95 97 96 98 GdkPixbuf * … … 347 349 marker_del_icon = info_panel_load_icon ("marker-del-ico.png"); 348 350 351 sweep_load_marker_icons (); 352 349 353 return GTK_TREE_MODEL (treestore); 350 354 } … … 878 882 INFO_PANEL_MARKERS_COL_NAME, 879 883 mark->name ? mark->name : buf, 884 INFO_PANEL_MARKERS_COL_ICON, mark_icons[mark->color], 880 885 INFO_PANEL_MARKERS_COL_VALUE, mtime, 881 886 INFO_PANEL_MARKERS_COL_POINTER, gl, … … 2454 2459 { 2455 2460 info_panel_error_dialog (view->window, 2456 _ 2457 ("Invalid parameter specification...")); 2461 _("Invalid parameter specification...")); 2458 2462 return; 2459 2463 } … … 2461 2465 // INFO_PANEL_MARKERS_COL_VALUE, new_text); 2462 2466 2463 mark = (sw_mark *) gl->data; 2464 2465 markdata = g_malloc0 (sizeof (MarkerData)); 2466 2467 markdata->mark_data.frame = mark->frame; 2468 markdata->mark_data.color = color; 2469 markdata->mark_data.type = mark->type; 2470 markdata->mark_data.name = mark->name; 2471 2472 markdata->mark_modify = mark; 2473 2474 perform_marker_op (view->sample, _("Modify marker"), 2475 (SweepFilter) info_panel_marker_modify, NULL, 2476 markdata); 2477 2467 if (color < MARKER_IMG_NUMBER){ 2468 2469 mark = (sw_mark *) gl->data; 2470 2471 markdata = g_malloc0 (sizeof (MarkerData)); 2472 2473 markdata->mark_data.frame = mark->frame; 2474 markdata->mark_data.color = color; 2475 markdata->mark_data.type = mark->type; 2476 markdata->mark_data.name = mark->name; 2477 2478 markdata->mark_modify = mark; 2479 2480 perform_marker_op (view->sample, _("Modify marker"), 2481 (SweepFilter) info_panel_marker_modify, NULL, 2482 markdata); 2483 } 2478 2484 } 2479 2485 break; sweep/branches/sweep-info-panel/src/sample-display.c
r470 r473 68 68 extern GdkCursor *sweep_cursors[]; 69 69 70 extern gint mark_colors[]; 71 extern GdkPixbuf *mark_icons[]; 72 73 70 74 /* 71 75 * Maximum number of samples to consider per pixel … … 131 135 extern sw_view *last_tmp_view; 132 136 133 static int last_button; /* button index which started the last137 static gint last_button; /* button index which started the last 134 138 * selection; This is global to allow 135 139 * comparison for last_tmp_view */ … … 137 141 #if 1 138 142 139 static const int default_colors[] = {143 static const gint default_colors[] = { 140 144 200, 200, 193, /* bg */ 141 145 199, 203, 158, /* fg */ … … 162 166 #else 163 167 164 static const int default_colors[] = {168 static const gint default_colors[] = { 165 169 #if 0 166 170 86, 86, 80, /* bg */ … … 188 192 #endif 189 193 190 static const int bg_colors[] = {194 static const gint bg_colors[] = { 191 195 250, 250, 237, /* black bg */ 192 196 200, 200, 193, /* red bg */ … … 203 207 }; 204 208 205 static const int fg_colors[] = {209 static const gint fg_colors[] = { 206 210 80, 80, 60, /* black fg */ 207 211 220, 80, 40, /* red fg */ … … 214 218 }; 215 219 216 static const int mark_colors[] = {217 0, 255, 255,218 0, 255, 0,219 0, 0, 255,220 255, 0, 255,221 0, 0, 255,222 0, 0, 255,223 0, 0, 255,224 };225 226 // extern const int mark_colors[];227 extern GdkPixbuf *mark_icons[];228 220 229 221 /* … … 700 692 701 693 static void 702 sample_display_init_display (SampleDisplay * s, int w,int h)694 sample_display_init_display (SampleDisplay * s, gint w, gint h) 703 695 { 704 696 GdkWindow *window; … … 992 984 sample_display_draw_data_channel (GdkDrawable * win, 993 985 const SampleDisplay * s, 994 int x, 995 int y, int width, int height, int channel) 986 gint x, gint y, 987 gint width, gint height, 988 gint channel) 996 989 { 997 990 GList *gl; 998 991 GdkGC *gc, *fg_gc; 999 992 sw_sel *sel; 1000 int x1, x2, y1;993 gint x1, x2, y1; 1001 994 sw_audio_t vhigh, vlow; 1002 995 sw_audio_intermediate_t totpos, totneg; … … 1005 998 sw_framecount_t i, step, nr_frames, nr_pos, nr_neg; 1006 999 sw_sample *sample; 1007 const int channels = s->view->sample->sounddata->format->channels;1000 const gint channels = s->view->sample->sounddata->format->channels; 1008 1001 1009 1002 sample = s->view->sample; … … 1088 1081 #ifdef LEGACY_DRAW_MODE 1089 1082 { 1090 int py, ty;1083 gint py, ty; 1091 1084 sw_audio_t peak; 1092 1085 … … 1210 1203 static void 1211 1204 sample_display_draw_data (GdkDrawable * win, const SampleDisplay * s, 1212 int x,int width)1213 { 1214 const int sh = s->height;1205 gint x, gint width) 1206 { 1207 const gint sh = s->height; 1215 1208 int start_x, end_x, i, cy, cheight, cerr; 1216 const int channels = s->view->sample->sounddata->format->channels;1209 const gint channels = s->view->sample->sounddata->format->channels; 1217 1210 1218 1211 if (width == 0) … … 1328 1321 sample_display_draw_crossing_vector (GdkDrawable * win, 1329 1322 GdkGC * gc, 1330 const SampleDisplay * s, int x) 1323 const SampleDisplay * s, 1324 gint x) 1331 1325 { 1332 1326 sw_sample *sample = s->view->sample; 1333 const int sh = s->height;1334 int cx1, cx2, cy1, cy2;1327 const gint sh = s->height; 1328 gint cx1, cx2, cy1, cy2; 1335 1329 1336 1330 #define VRAD 8 … … 1368 1362 SampleDisplay *s = (SampleDisplay *) data; 1369 1363 GdkGC *gc = s->sel_gc; 1370 static int dash_offset = 0;1364 static gint dash_offset = 0; 1371 1365 1372 1366 gdk_gc_set_dashes (gc, dash_offset, sel_dash_list, 2); … … 1550 1544 static void 1551 1545 sample_display_draw_marks (GdkDrawable * win, 1552 const SampleDisplay * s, int x_min,int x_max)1546 const SampleDisplay * s, gint x_min, gint x_max) 1553 1547 { 1554 1548 sw_sample *sample = s->view->sample; 1555 1549 GList *gl; 1556 1550 sw_mark *mark; 1557 GdkPoint poly[5]; 1558 int x, x1, x2; 1551 gint x, x1, x2; 1559 1552 PangoLayout *layout; 1560 1553 PangoRectangle logical_rect, ink_rect; 1561 1554 1555 /* XXX: Hardcoded marker ico width !!!! */ 1556 #define MARKER_ICO_WIDTH 8 1557 1562 1558 layout = gtk_widget_create_pango_layout (GTK_WIDGET (s), NULL); 1563 1559 … … 1569 1565 x = OFFSET_TO_XPOS (mark->frame); 1570 1566 1571 x1 = x - 3;1567 x1 = x - MARKER_ICO_WIDTH / 2; 1572 1568 1573 1569 if (mark->name != NULL) … … 1575 1571 pango_layout_set_text (layout, mark->name, -1); 1576 1572 pango_layout_get_extents (layout, &ink_rect, &logical_rect); 1577 x2 = x + 3+ PANGO_PIXELS (ink_rect.width);1573 x2 = x + MARKER_ICO_WIDTH / 2 + PANGO_PIXELS (ink_rect.width); 1578 1574 } 1579 1575 else 1580 1576 { 1581 x2 = x + 3; 1582 } 1583 1584 // g_print("xmin: %d xmax:%d x1:%d x2:%d\n", x_min, x_max, x1, 1585 // x2); 1577 x2 = x + MARKER_ICO_WIDTH / 2; 1578 } 1586 1579 1587 1580 if (((x1 >= x_min) && (x1 <= x_max)) || … … 1590 1583 { 1591 1584 /* 1592 * x1 = CLAMP (x1, x_min, x_max); x2 = CLAMP (x + 3, x_min,1593 *x_max);1585 * x1 = CLAMP (x1, x_min, x_max); 1586 * x2 = CLAMP (x + 3, x_min, x_max); 1594 1587 */ 1595 x2 = x + 3; 1596 1597 gdk_draw_line (win, s->marks_gcs[mark->color], x, 8, x, s->height); 1598 1599 poly[0].x = x1; 1600 poly[1].x = x2 + 1; 1601 poly[2].x = x2 + 1; 1602 poly[3].x = x; 1603 poly[4].x = x1; 1604 1605 poly[0].y = 0; 1606 poly[1].y = 0; 1607 poly[2].y = 7; 1608 poly[3].y = 10; 1609 poly[4].y = 7; 1610 1611 gdk_draw_polygon (win, s->marks_gcs[mark->color], TRUE, poly, 5); 1612 1613 poly[1].x = x2; 1614 poly[2].x = x2; 1615 1616 gdk_draw_polygon (win, s->marks_relief_gc, FALSE, poly, 5); 1617 1618 if (mark->name != NULL) 1588 1589 gdk_draw_line (win, s->marks_gcs[mark->color], x, 0, x, s->height); 1590 1591 gdk_draw_pixbuf (win, s->marks_gcs[mark->color], mark_icons[mark->color], 1592 0, 0, 1593 x - MARKER_ICO_WIDTH / 2, 0, 1594 -1, -1, GDK_RGB_DITHER_NONE, 0, 0); 1595 1596 if (mark->name != NULL) 1619 1597 { 1620 gdk_draw_layout (win, s->mark_text_gc, x 2 + 2, 0, layout);1598 gdk_draw_layout (win, s->mark_text_gc, x + MARKER_ICO_WIDTH / 2 + 2, 0, layout); 1621 1599 } 1622 1600 } sweep/branches/sweep-info-panel/src/sweep_marker.c
r470 r473 42 42 #include "undo_dialog.h" 43 43 44 #define MARKER_IMG_NUMBER 11 45 46 static const int mark_colors[] = { 44 /* 45 * As long as we have prepared colors markers icons 46 * as long we have to has predefined colors 47 */ 48 gint mark_colors[] = { 47 49 255, 0, 0, 48 50 0, 255, 0, … … 58 60 }; 59 61 60 staticGdkPixbuf *mark_icons[] = {62 GdkPixbuf *mark_icons[] = { 61 63 NULL, 62 64 NULL,
