Changeset 457
- Timestamp:
- 01/05/07 01:05:20 (2 years ago)
- Files:
-
- sweep/branches/sweep-info-panel/AUTHORS (modified) (1 diff)
- sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/include/sweep/sweep_types.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/pixmaps/marker-add-ico.png (added)
- sweep/branches/sweep-info-panel/pixmaps/marker-del-ico.png (added)
- sweep/branches/sweep-info-panel/pixmaps/marker.png (modified) (previous)
- sweep/branches/sweep-info-panel/pixmaps/select-add-ico.png (added)
- sweep/branches/sweep-info-panel/pixmaps/select-del-ico.png (added)
- sweep/branches/sweep-info-panel/po/pl.po (modified) (1 diff)
- sweep/branches/sweep-info-panel/src/db_ruler.c (modified) (6 diffs)
- sweep/branches/sweep-info-panel/src/info-panel.c (modified) (23 diffs)
- sweep/branches/sweep-info-panel/src/info-panel.h (modified) (3 diffs)
- sweep/branches/sweep-info-panel/src/sample-display.c (modified) (6 diffs)
- sweep/branches/sweep-info-panel/src/sweep_sample.c (modified) (4 diffs)
- sweep/branches/sweep-info-panel/src/sweep_selection.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/branches/sweep-info-panel/AUTHORS
r373 r457 39 39 40 40 Peter Shorthose 41 gtk2 port and various tweaks/bug fixes41 gtk2 port and various tweaks/bug fixes 42 42 43 43 Daniel Dreschers 44 ALSA 1.0 updates 44 ALSA 1.0 updates 45 46 Radoslaw Korzeniewski <radoslaw@korzeniewski.net> 47 Info Panel 48 Named Selections 49 TagLib Support (reading and writting) 50 Markers 45 51 46 52 Borrowed Code sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h
r455 r457 24 24 25 25 sw_mark * 26 mark s_new (sw_framecount_t frame, sw_mark_type_t type, gchar * name);26 mark_new (sw_framecount_t frame, sw_mark_type_t type, gchar * name); 27 27 28 28 sw_mark * sweep/branches/sweep-info-panel/include/sweep/sweep_types.h
r455 r457 102 102 */ 103 103 typedef enum { 104 SWEEP_MARK_TYPE_S TEP,104 SWEEP_MARK_TYPE_SIMPLE, 105 105 SWEEP_MARK_TYPE_LOOP, 106 106 SWEEP_MARK_TYPE_END sweep/branches/sweep-info-panel/po/pl.po
r445 r457 1386 1386 #: src/info-panel.c:540 1387 1387 msgid "Add Selection..." 1388 msgstr "Dodaj zaznaczenie "1388 msgstr "Dodaj zaznaczenie..." 1389 1389 1390 1390 #: src/info-panel.c:548 sweep/branches/sweep-info-panel/src/db_ruler.c
r340 r457 239 239 else 240 240 y = event->y; 241 241 #if 0 242 242 if (DB_RULER(widget)->dragging && (state & GDK_BUTTON1_MASK)) { 243 244 g_print("Jestem ale nie wiem co robie!!!!\n"); 245 243 246 ydelta = DB_RULER(widget)->y - y; 244 247 … … 252 255 gtk_ruler_draw_ticks (ruler); 253 256 } 254 257 #endif 255 258 DB_RULER(widget)->y = y; 256 259 … … 327 330 DB_RULER(widget)->dragging = FALSE; 328 331 332 g_print("db_ruler_leave_notify\n"); 333 329 334 return TRUE; 330 335 } … … 390 395 height - ythickness); 391 396 392 upper = ruler->upper / ruler->metric->pixels_per_unit;393 lower = ruler->lower / ruler->metric->pixels_per_unit;397 upper = ruler->upper / ruler->metric->pixels_per_unit; 398 lower = ruler->lower / ruler->metric->pixels_per_unit; 394 399 395 400 // upper = ruler->upper; … … 403 408 404 409 // * strlen (unit_str) 405 text_height = digit_height + 1;410 text_height = digit_height + 1; 406 411 407 412 for (scale = 0; scale < MAXIMUM_SCALES; scale++) 408 413 /* if (ruler->metric->ruler_scale[scale] * fabs(increment) > 2 * text_height) 409 414 break;*/ 410 if (ruler_scale[scale] * abs_increment > 2 * digit_height)415 if (ruler_scale[scale] * abs_increment > 2 * digit_height) 411 416 break; 417 412 418 if (scale == MAXIMUM_SCALES) 413 419 scale = MAXIMUM_SCALES - 1; … … 421 427 ruler->backing_store, 422 428 GTK_WIDGET_STATE (widget), 423 FALSE,429 FALSE, 424 430 NULL, 425 431 widget, 426 432 "vruler", 427 433 2, 428 (digit_height /2),434 (digit_height / 2), 429 435 layout); 430 436 sweep/branches/sweep-info-panel/src/info-panel.c
r456 r457 35 35 #include <sweep/sweep_undo.h> 36 36 #include <sweep/sweep_selection.h> 37 #include <sweep/sweep_marker.h> 37 38 38 39 #include "sweep_app.h" … … 74 75 75 76 76 GdkPixbuf * done_icon; 77 GdkPixbuf * revert_icon; 77 static GdkPixbuf * sample_icon = NULL; 78 static GdkPixbuf * select_icon = NULL; 79 static GdkPixbuf * select_add_icon = NULL; 80 static GdkPixbuf * select_del_icon = NULL; 81 static GdkPixbuf * undo_icon = NULL; 82 static GdkPixbuf * done_icon = NULL; 83 static GdkPixbuf * marker_icon = NULL; 84 static GdkPixbuf * marker_add_icon = NULL; 85 static GdkPixbuf * marker_del_icon = NULL; 86 87 #ifdef INFO_PANEL_REVERT 88 static GdkPixbuf * revert_icon = NULL; 89 #endif 78 90 79 91 … … 99 111 } 100 112 113 GtkWidget * info_panel_menu_item_new_with_ico_label (const gchar * text, GdkPixbuf * icon) 114 { 115 GtkWidget *menuitem; 116 GtkWidget *hbox, *label, *image; 117 118 menuitem = gtk_menu_item_new(); 119 120 hbox = gtk_hbox_new(FALSE, 6); 121 122 label = gtk_label_new(text); 123 124 image = gtk_image_new_from_pixbuf( icon ); 125 126 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(image), FALSE, FALSE, 0); 127 gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0); 128 129 gtk_container_add(GTK_CONTAINER(menuitem), hbox); 130 131 return menuitem; 132 } 133 101 134 GtkTreeModel * info_panel_create_sample_model (void) 102 135 { 103 136 GtkTreeStore * treestore; 104 137 GtkTreeIter toplevel, child; 105 GdkPixbuf * icon;106 138 107 139 /* sample_info */ … … 115 147 116 148 // toplevel 117 icon = info_panel_load_icon("sample.png"); 149 if (sample_icon == NULL) 150 sample_icon = info_panel_load_icon("sample.png"); 118 151 gtk_tree_store_append(treestore, &toplevel, NULL); 119 152 gtk_tree_store_set(treestore, &toplevel, 120 153 INFO_PANEL_SAMPLE_COL_NAME, _("Sample info"), 121 154 INFO_PANEL_SAMPLE_COL_TYPE, INFO_PANEL_SAMPLE, 122 INFO_PANEL_SAMPLE_COL_ICON, icon,155 INFO_PANEL_SAMPLE_COL_ICON, sample_icon, 123 156 -1); 124 157 … … 204 237 GtkTreeStore * treestore; 205 238 GtkTreeIter toplevel; 206 GdkPixbuf * icon;207 239 208 240 treestore = gtk_tree_store_new(INFO_PANEL_SELECTIONS_NUM_COLS, … … 216 248 ); 217 249 218 icon = info_panel_load_icon("select.png"); 250 if (select_icon == NULL) 251 select_icon = info_panel_load_icon("select.png"); 219 252 gtk_tree_store_append(treestore, &toplevel, NULL); 220 253 gtk_tree_store_set(treestore, &toplevel, 221 254 INFO_PANEL_SELECTIONS_COL_NAME, _("Selections"), 222 255 INFO_PANEL_SELECTIONS_COL_TYPE, INFO_PANEL_SELECTIONS, 223 INFO_PANEL_SELECTIONS_COL_ICON, icon,256 INFO_PANEL_SELECTIONS_COL_ICON, select_icon, 224 257 -1); 225 258 259 if (select_add_icon == NULL) 260 select_add_icon = info_panel_load_icon("select-add-ico.png"); 261 if (select_del_icon == NULL) 262 select_del_icon = info_panel_load_icon("select-del-ico.png"); 263 226 264 return GTK_TREE_MODEL(treestore); 227 265 } … … 231 269 GtkTreeStore * treestore; 232 270 GtkTreeIter toplevel, child; 233 GdkPixbuf * icon;234 271 235 272 treestore = gtk_tree_store_new(INFO_PANEL_UNDOS_NUM_COLS, … … 242 279 ); 243 280 244 done_icon = info_panel_load_icon("done.png"); 281 if (done_icon == NULL) 282 done_icon = info_panel_load_icon("done.png"); 245 283 246 284 #ifdef INFO_PANEL_REVERT 247 revert_icon = info_panel_load_icon("revert.png"); 285 if (revert_icon == NULL) 286 revert_icon = info_panel_load_icon("revert.png"); 248 287 #endif 249 288 250 icon = info_panel_load_icon("undo.png"); 289 if (undo_icon == NULL) 290 undo_icon = info_panel_load_icon("undo.png"); 251 291 gtk_tree_store_append(treestore, &toplevel, NULL); 252 292 gtk_tree_store_set(treestore, &toplevel, 253 293 INFO_PANEL_UNDOS_COL_NAME, _("Undo"), 254 294 INFO_PANEL_UNDOS_COL_TYPE, INFO_PANEL_UNDOS, 255 INFO_PANEL_UNDOS_COL_ICON, icon,295 INFO_PANEL_UNDOS_COL_ICON, undo_icon, 256 296 -1); 257 297 … … 270 310 GtkTreeStore * treestore; 271 311 GtkTreeIter toplevel, child; 272 GdkPixbuf * icon;312 // GdkPixbuf * icon; 273 313 274 314 treestore = gtk_tree_store_new(INFO_PANEL_MARKERS_NUM_COLS, … … 276 316 G_TYPE_UINT, // type 277 317 GDK_TYPE_PIXBUF, // icon 278 G_TYPE_STRING // value 318 G_TYPE_STRING, // value 319 G_TYPE_UINT, // color 320 G_TYPE_UINT, // mtype 321 G_TYPE_BOOLEAN, // ed_name 322 G_TYPE_BOOLEAN // ed_value 279 323 ); 280 324 281 325 282 icon = info_panel_load_icon("marker.png"); 326 if (marker_icon == NULL) 327 marker_icon = info_panel_load_icon("marker.png"); 283 328 gtk_tree_store_append(treestore, &toplevel, NULL); 284 329 gtk_tree_store_set(treestore, &toplevel, 285 330 INFO_PANEL_MARKERS_COL_NAME, _("Markers"), 286 331 INFO_PANEL_MARKERS_COL_TYPE, INFO_PANEL_MARKERS, 287 INFO_PANEL_MARKERS_COL_ICON, icon,332 INFO_PANEL_MARKERS_COL_ICON, marker_icon, 288 333 -1); 334 335 if (marker_add_icon == NULL) 336 marker_add_icon = info_panel_load_icon("marker-add-ico.png"); 337 if (marker_del_icon == NULL) 338 marker_del_icon = info_panel_load_icon("marker-del-ico.png"); 289 339 290 340 return GTK_TREE_MODEL(treestore); … … 307 357 308 358 309 icon = info_panel_load_icon(" marker.png");359 icon = info_panel_load_icon("plugin.png"); 310 360 gtk_tree_store_append(treestore, &toplevel, NULL); 311 361 gtk_tree_store_set(treestore, &toplevel, … … 445 495 nsel++; 446 496 447 /* more selections then available data slots */ 497 /* 498 * more selections then available data slots 499 * so we have to add some data slots 500 */ 448 501 if (nsel > n){ 449 502 … … 453 506 454 507 gtk_tree_store_set(GTK_TREE_STORE(info_panel), &child, 455 INFO_PANEL_SELECTIONS_COL_TYPE, INFO_PANEL_SELECTION _ITEM,508 INFO_PANEL_SELECTIONS_COL_TYPE, INFO_PANEL_SELECTIONS_NAME, 456 509 -1); 457 510 } 458 511 459 512 } else 460 /* more data slots then selections */ 513 /* 514 * more data slots then selections 515 * we have to remove some of data slots 516 */ 461 517 if (nsel < n){ 462 518 … … 844 900 } 845 901 846 847 902 void info_panel_selection_popup_menu (GtkWidget *treeview, GdkEventButton *event, sw_view * view, gboolean del) 848 903 { … … 851 906 menu = gtk_menu_new(); 852 907 853 menuitem = gtk_menu_item_new_with_label(_("Add Selection..."));908 menuitem = info_panel_menu_item_new_with_ico_label(_("Add Selection..."), select_add_icon); 854 909 855 910 g_signal_connect(menuitem, "activate", … … 859 914 860 915 if (del){ 861 menuitem = gtk_menu_item_new_with_label(_("Delete All Selections..."));916 menuitem = info_panel_menu_item_new_with_ico_label(_("Delete All Selections"), select_del_icon); 862 917 863 918 g_signal_connect(menuitem, "activate", … … 885 940 menu = gtk_menu_new(); 886 941 887 menuitem = gtk_menu_item_new_with_label(_("Delete Selection"));942 menuitem = info_panel_menu_item_new_with_ico_label(_("Delete Selection"), select_del_icon); 888 943 889 944 data = g_malloc(sizeof(PopupData)); … … 988 1043 989 1044 } 1045 1046 void info_panel_add_markers_cb (GtkWidget * menuitem, sw_view * view) 1047 { 1048 GtkWidget * dialog; 1049 GtkWidget * table; 1050 GtkWidget * label; 1051 GtkWidget * entry; 1052 GtkWidget * spin; 1053 1054 dialog = gtk_dialog_new_with_buttons ( _("Add time marker"), 1055 GTK_WINDOW(view->window), 1056 GTK_DIALOG_MODAL, 1057 GTK_STOCK_OK, 1058 GTK_RESPONSE_ACCEPT, 1059 GTK_STOCK_CANCEL, 1060 GTK_RESPONSE_REJECT, 1061 NULL); 1062 g_signal_connect_swapped (dialog, 1063 "response", 1064 G_CALLBACK (gtk_widget_destroy), 1065 dialog); 1066 1067 table = gtk_table_new (4, 2, TRUE); 1068 1069 label = gtk_label_new(_("Marker time")); 1070 gtk_table_attach (GTK_TABLE(table), label, 1071 0, 1, 0, 1, 1072 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1073 6, 6); 1074 entry = gtk_entry_new_with_max_length (14); 1075 gtk_entry_set_text (GTK_ENTRY(entry), "00:00:00.000"); 1076 gtk_table_attach (GTK_TABLE(table), entry, 1077 1, 2, 0, 1, 1078 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1079 6, 6); 1080 1081 label = gtk_label_new(_("Marker frame")); 1082 gtk_table_attach (GTK_TABLE(table), label, 1083 0, 1, 1, 2, 1084 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1085 6, 6); 1086 spin = gtk_spin_button_new_with_range (0, 10000, 1); 1087 gtk_table_attach (GTK_TABLE(table), spin, 1088 1, 2, 1, 2, 1089 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1090 0, 0); 1091 #if 0 1092 label = gtk_label_new(_("End of selection")); 1093 gtk_table_attach (GTK_TABLE(table), label, 1094 0, 1, 2, 3, 1095 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1096 6, 6); 1097 entry = gtk_entry_new_with_max_length (14); 1098 gtk_entry_set_text (GTK_ENTRY(entry), "00:00:01.000"); 1099 gtk_table_attach (GTK_TABLE(table), entry, 1100 1, 2, 2, 3, 1101 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1102 6, 6); 1103 1104 label = gtk_label_new(_("End frame")); 1105 gtk_table_attach (GTK_TABLE(table), label, 1106 0, 1, 3, 4, 1107 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1108 6, 6); 1109 spin = gtk_spin_button_new_with_range (0, 10000, 1); 1110 gtk_table_attach (GTK_TABLE(table), spin, 1111 1, 2, 3, 4, 1112 GTK_EXPAND|GTK_FILL|GTK_SHRINK, GTK_FILL, 1113 0, 0); 1114 #endif 1115 gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), 1116 table); 1117 1118 gtk_widget_show_all (dialog); 1119 } 1120 1121 void info_panel_add_markers_1_cb (GtkWidget * menuitem, sw_view * view) 1122 { 1123 sw_mark * mark; 1124 1125 mark = mark_new( 100, SWEEP_MARK_TYPE_SIMPLE, "TEST1" ); 1126 1127 view->sample->sounddata->marks = marks_add_marker( view->sample->sounddata->marks, mark ); 1128 1129 } 1130 1131 void info_panel_markers_popup_menu (GtkWidget *treeview, GdkEventButton *event, sw_view * view, gboolean del) 1132 { 1133 GtkWidget *menu, *menuitem; 1134 1135 menu = gtk_menu_new(); 1136 1137 menuitem = info_panel_menu_item_new_with_ico_label(_("Add Time Marker..."), marker_add_icon); 1138 1139 g_signal_connect(menuitem, "activate", 1140 (GCallback) info_panel_add_markers_1_cb, view); 1141 1142 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); 1143 1144 if (del){ 1145 menuitem = info_panel_menu_item_new_with_ico_label(_("Delete All Time Markers"), marker_del_icon); 1146 1147 // g_signal_connect(menuitem, "activate", 1148 // (GCallback) info_panel_delete_all_selections_cb, view); 1149 1150 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); 1151 } 1152 1153 gtk_widget_show_all(menu); 1154 1155 /* Note: event can be NULL here when called from view_onPopupMenu; 1156 * gdk_event_get_time() accepts a NULL argument */ 1157 1158 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 1159 (event != NULL) ? event->button : 0, 1160 gdk_event_get_time((GdkEvent*)event)); 1161 1162 } 1163 1164 void info_panel_markers_item_popup_menu (GtkWidget *treeview, GdkEventButton *event, sw_view * view) 1165 { 1166 #if 0 1167 GtkWidget *menu, *menuitem; 1168 PopupData * data; 1169 1170 menu = gtk_menu_new(); 1171 1172 menuitem = gtk_menu_item_new_with_label(_("Delete Selection")); 1173 1174 data = g_malloc(sizeof(PopupData)); 1175 1176 data->view = view; 1177 data->treeview = GTK_TREE_VIEW(treeview); 1178 1179 g_signal_connect(menuitem, "activate", 1180 (GCallback) info_panel_delete_selection_cb, data); 1181 1182 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); 1183 1184 gtk_widget_show_all(menu); 1185 1186 /* Note: event can be NULL here when called from view_onPopupMenu; 1187 * gdk_event_get_time() accepts a NULL argument */ 1188 1189 gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 1190 (event != NULL) ? event->button : 0, 1191 gdk_event_get_time((GdkEvent*)event)); 1192 #endif 1193 } 1194 990 1195 991 1196 gboolean info_panel_selections_bpress_cb (GtkWidget *treeview, GdkEventButton *event, sw_view * view) … … 1024 1229 1025 1230 break; 1026 case INFO_PANEL_SELECTION _ITEM:1231 case INFO_PANEL_SELECTIONS_NAME: 1027 1232 1028 1233 info_panel_selection_item_popup_menu(treeview, event, view); … … 1140 1345 #endif 1141 1346 1347 gboolean info_panel_markers_bpress_cb (GtkWidget *treeview, GdkEventButton *event, sw_view * view) 1348 { 1349 GtkTreeSelection * selection; 1350 GtkTreeModel * model; 1351 GtkTreePath * path; 1352 GtkTreeIter iter; 1353 gint type; 1354 1355 if (event->type == GDK_BUTTON_PRESS && event->button == 3){ 1356 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); 1357 1358 if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(treeview), 1359 (gint) event->x, 1360 (gint) event->y, 1361 &path, NULL, NULL, NULL)) 1362 { 1363 gtk_tree_selection_unselect_all(selection); 1364 gtk_tree_selection_select_path(selection, path); 1365 1366 model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview)); 1367 1368 gtk_tree_model_get_iter(model, &iter, path); 1369 1370 gtk_tree_model_get(model, &iter, INFO_PANEL_SELECTIONS_COL_TYPE, &type, -1); 1371 1372 switch (type){ 1373 case INFO_PANEL_MARKERS: 1374 1375 if (gtk_tree_model_iter_n_children(model, &iter)){ 1376 info_panel_markers_popup_menu(treeview, event, view, TRUE); 1377 } else { 1378 info_panel_markers_popup_menu(treeview, event, view, FALSE); 1379 } 1380 1381 break; 1382 case INFO_PANEL_MARKERS_NAME: 1383 1384 info_panel_markers_item_popup_menu(treeview, event, view); 1385 1386 break; 1387 } 1388 gtk_tree_path_free(path); 1389 } 1390 return TRUE; 1391 } 1392 1393 return FALSE; 1394 } 1395 1142 1396 static sw_sample * info_panel_selection_modify (sw_sample * s, sw_param_set unused, SelectionData * seldata) 1143 1397 { … … 1174 1428 1175 1429 switch (type){ 1176 case INFO_PANEL_SELECTION _ITEM:1430 case INFO_PANEL_SELECTIONS_NAME: 1177 1431 gtk_tree_model_get(model, &iter, INFO_PANEL_SELECTIONS_COL_NAME, &name, INFO_PANEL_SELECTIONS_COL_POINTER, &gl, -1); 1178 1432 … … 1466 1720 1467 1721 switch (type){ 1468 case INFO_PANEL_SELECTION _ITEM:1722 case INFO_PANEL_SELECTIONS_NAME: 1469 1723 gtk_tree_model_get(model, &iter, INFO_PANEL_SELECTIONS_COL_VALUE, ¶m, INFO_PANEL_SELECTIONS_COL_POINTER, &gl, -1); 1470 1724 … … 1725 1979 renderer = gtk_cell_renderer_pixbuf_new(); 1726 1980 gtk_tree_view_column_pack_start(col, renderer, FALSE); 1727 gtk_tree_view_column_set_attributes(col, renderer, "pixbuf", INFO_PANEL_ SELECTIONS_COL_ICON, NULL);1981 gtk_tree_view_column_set_attributes(col, renderer, "pixbuf", INFO_PANEL_MARKERS_COL_ICON, NULL); 1728 1982 1729 1983 renderer = gtk_cell_renderer_text_new(); 1730 1984 gtk_tree_view_column_pack_start(col, renderer, FALSE); 1731 gtk_tree_view_column_add_attribute(col, renderer, "text", INFO_PANEL_ SELECTIONS_COL_NAME);1732 /* gtk_tree_view_column_add_attribute(col, renderer, "editable", INFO_PANEL_SELECTIONS_COL_EDITABLE_NAME);1733 g_signal_connect(renderer, "edited", (GCallback) info_panel_selections_edited_name_cb, view);1734 */ 1985 gtk_tree_view_column_add_attribute(col, renderer, "text", INFO_PANEL_MARKERS_COL_NAME); 1986 gtk_tree_view_column_add_attribute(col, renderer, "editable", INFO_PANEL_MARKERS_COL_EDITABLE_NAME); 1987 //g_signal_connect(renderer, "edited", (GCallback) info_panel_markers_edited_name_cb, view); 1988 1735 1989 renderer = gtk_cell_renderer_text_new(); 1736 1990 gtk_tree_view_column_pack_start(col, renderer, FALSE); 1737 gtk_tree_view_column_add_attribute(col, renderer, "text", INFO_PANEL_ SELECTIONS_COL_VALUE);1738 /* gtk_tree_view_column_add_attribute(col, renderer, "editable", INFO_PANEL_SELECTIONS_COL_EDITABLE_VALUE);1739 1740 g_signal_connect(renderer, "edited", (GCallback) info_panel_selections_edited_value_cb, view);1741 g_signal_connect(treeview, "button-press-event", (GCallback) info_panel_ selections_bpress_cb, view);1742 */ 1991 gtk_tree_view_column_add_attribute(col, renderer, "text", INFO_PANEL_MARKERS_COL_VALUE); 1992 gtk_tree_view_column_add_attribute(col, renderer, "editable", INFO_PANEL_MARKERS_COL_EDITABLE_VALUE); 1993 1994 //g_signal_connect(renderer, "edited", (GCallback) info_panel_markers_edited_value_cb, view); 1995 g_signal_connect(treeview, "button-press-event", (GCallback) info_panel_markers_bpress_cb, view); 1996 1743 1997 return treeview; 1744 1998 } 1745 1746 1999 1747 2000 sweep/branches/sweep-info-panel/src/info-panel.h
r456 r457 72 72 { 73 73 INFO_PANEL_SELECTIONS = 1, 74 INFO_PANEL_SELECTION_ITEM 74 INFO_PANEL_SELECTIONS_NAME, 75 INFO_PANEL_SELECTIONS_START, 76 INFO_PANEL_SELECTIONS_END 75 77 } info_panel_selections_type_t; 76 78 … … 113 115 { 114 116 INFO_PANEL_MARKERS = 1, 115 INFO_PANEL_MARKER_ITEM 117 INFO_PANEL_MARKERS_NAME, 118 INFO_PANEL_MARKERS_FRAME, 119 INFO_PANEL_MARKERS_TYPE, 120 INFO_PANEL_MARKERS_COLOR 116 121 } info_panel_markers_type_t; 117 122 … … 123 128 INFO_PANEL_MARKERS_COL_ICON, 124 129 INFO_PANEL_MARKERS_COL_VALUE, 130 INFO_PANEL_MARKERS_COL_COLOR, 131 INFO_PANEL_MARKERS_COL_MTYPE, 132 INFO_PANEL_MARKERS_COL_EDITABLE_NAME, 133 INFO_PANEL_MARKERS_COL_EDITABLE_VALUE, 125 134 INFO_PANEL_MARKERS_NUM_COLS 126 135 } info_panel_markers_t; sweep/branches/sweep-info-panel/src/sample-display.c
r456 r457 1281 1281 1282 1282 static void 1283 sample_display_draw_mark (GdkDrawable * win,1283 sample_display_draw_marks (GdkDrawable * win, 1284 1284 const SampleDisplay * s, 1285 1285 int x_min, int x_max) … … 1295 1295 mark = (sw_mark *)gl->data; 1296 1296 1297 g_print("MARK: DRAW\n");1298 1297 1299 1298 x = OFFSET_TO_XPOS(mark->frame); … … 1302 1301 1303 1302 x1 = CLAMP (x - 3, x_min, x_max); 1304 x2 = CLAMP (x + 3, x_min, x_max);1305 1306 gdk_draw_line(win, s-> user_gc,1303 x2 = CLAMP (x + 4, x_min, x_max); 1304 1305 gdk_draw_line(win, s->rec_gc, 1307 1306 x, 8, 1308 1307 x, s->height); … … 1316 1315 poly[0].y = 0; 1317 1316 poly[1].y = 0; 1318 poly[2].y = 5;1319 poly[3].y = 8;1320 poly[4].y = 5;1321 1322 gdk_draw_polygon (win, s-> user_gc, TRUE, poly, 5);1317 poly[2].y = 7; 1318 poly[3].y = 10; 1319 poly[4].y = 7; 1320 1321 gdk_draw_polygon (win, s->rec_gc, TRUE, poly, 5); 1323 1322 1324 1323 } … … 1608 1607 1609 1608 /* draw markers */ 1610 sample_display_draw_mark (drawable, s, x_min, x_max);1609 sample_display_draw_marks (drawable, s, x_min, x_max); 1611 1610 1612 1611 /* draw the offset cursors */ … … 1655 1654 1656 1655 /*** EVENT HANDLERS ***/ 1657 1658 1656 1659 1657 static gint sweep/branches/sweep-info-panel/src/sweep_sample.c
r456 r457 1611 1611 sample_clear_tmp_sel (sw_sample * s) 1612 1612 { 1613 if (s->tmp_sel) g_free (s->tmp_sel); 1613 if (s->tmp_sel != NULL){ 1614 if (s->tmp_sel->name != NULL) 1615 g_free (s->tmp_sel->name); 1616 g_free (s->tmp_sel); 1617 } 1614 1618 s->tmp_sel = NULL; 1615 1619 last_tmp_view = NULL; … … 1660 1664 } 1661 1665 1662 /* For convenience, as the tmp_sel handling is internal to the application, 1666 /* 1667 * For convenience, as the tmp_sel handling is internal to the application, 1663 1668 * we pass the actual sw_sample pointer to the tmp_sel handling ops. 1664 1669 */ … … 1700 1705 n = snprintf (buf, BUF_LEN, _("Insert selection")); 1701 1706 1702 g_mutex_lock (s->sounddata->sels_mutex);1707 // g_mutex_lock (s->sounddata->sels_mutex); 1703 1708 1704 1709 sel = sel_copy (s->tmp_sel); 1705 1706 s->tmp_sel = NULL; 1707 last_tmp_view = NULL; 1708 1709 g_mutex_unlock (s->sounddata->sels_mutex); 1710 1711 sample_clear_tmp_sel (s); 1712 // s->tmp_sel = NULL; 1713 // last_tmp_view = NULL; 1714 1715 // g_mutex_unlock (s->sounddata->sels_mutex); 1710 1716 1711 1717 perform_selection_op (s, buf, ssits, NULL, sel); … … 1753 1759 n += snprintf (buf+n, BUF_LEN-n, "]"); 1754 1760 1755 g_mutex_lock (s->sounddata->sels_mutex);1761 // g_mutex_lock (s->sounddata->sels_mutex); 1756 1762 1757 1763 sel = sel_copy (s->tmp_sel); 1758 1764 1759 s->tmp_sel = NULL; 1760 last_tmp_view = NULL; 1761 1762 g_mutex_unlock (s->sounddata->sels_mutex); 1765 sample_clear_tmp_sel (s); 1766 // s->tmp_sel = NULL; 1767 // last_tmp_view = NULL; 1768 1769 // g_mutex_unlock (s->sounddata->sels_mutex); 1763 1770 1764 1771 perform_selection_op (s, buf, sssts, NULL, sel); sweep/branches/sweep-info-panel/src/sweep_selection.c
r455 r457 51 51 if (name != NULL) 52 52 sel->name = g_strdup(name); 53 else 54 sel->name = NULL; 53 55 54 56 return sel;
