Changeset 464
- Timestamp:
- 01/09/07 07:32:19 (2 years ago)
- Files:
-
- sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h (modified) (4 diffs)
- sweep/branches/sweep-info-panel/include/sweep/sweep_sample.h (modified) (3 diffs)
- sweep/branches/sweep-info-panel/include/sweep/sweep_selection.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/include/sweep/sweep_sounddata.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/plugins/byenergy/byenergy.c (modified) (2 diffs)
- sweep/branches/sweep-info-panel/src/info-panel.c (modified) (6 diffs)
- sweep/branches/sweep-info-panel/src/sample-display.c (modified) (6 diffs)
- sweep/branches/sweep-info-panel/src/sweep_app.h (modified) (1 diff)
- sweep/branches/sweep-info-panel/src/sweep_marker.c (modified) (7 diffs)
- sweep/branches/sweep-info-panel/src/sweep_sample.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/branches/sweep-info-panel/include/sweep/sweep_marker.h
r457 r464 24 24 25 25 sw_mark * 26 mark_new (sw_framecount_t frame, sw_mark_type_t type, g char * name);26 mark_new (sw_framecount_t frame, sw_mark_type_t type, gint color, gchar * name); 27 27 28 28 sw_mark * … … 33 33 34 34 GList * 35 marks_add_marker_1 (GList * marks, sw_framecount_t frame, sw_mark_type_t type, gchar * name); 35 marks_add_marker_1 (GList * marks, sw_framecount_t frame, sw_mark_type_t type, gint color, gchar * name); 36 37 void 38 marks_destroy (GList * marks); 36 39 37 40 /* … … 43 46 gint 44 47 mark_cmp (sw_mark * m1, sw_mark * m2); 48 49 GList * 50 marks_resort (GList * marks); 45 51 46 52 /* … … 56 62 sw_param_set pset, gpointer custom_data); 57 63 64 sw_op_instance * 65 perform_marker_start_op (sw_sample * sample, gchar * desc); 66 67 void 68 perform_marker_finish_op (sw_sample * sample, sw_op_instance * inst); 69 58 70 #endif /* __SWEEP_MARKER_H__ */ sweep/branches/sweep-info-panel/include/sweep/sweep_sample.h
r124 r464 149 149 sw_sel * 150 150 sample_add_selection_1 (sw_sample * s, 151 sw_framecount_t start, sw_framecount_t end );151 sw_framecount_t start, sw_framecount_t end, gchar * name); 152 152 153 153 void … … 156 156 sw_sel * 157 157 sample_set_selection_1 (sw_sample * s, 158 sw_framecount_t start, sw_framecount_t end );158 sw_framecount_t start, sw_framecount_t end, gchar * name); 159 159 160 160 … … 162 162 void 163 163 sample_selection_modify (sw_sample * s, sw_sel * sel, 164 sw_framecount_t new_start, sw_framecount_t new_end );164 sw_framecount_t new_start, sw_framecount_t new_end, gchar * name); 165 165 166 166 void sweep/branches/sweep-info-panel/include/sweep/sweep_selection.h
r455 r464 34 34 sels_add_selection_1 (GList * sels, sw_framecount_t start, sw_framecount_t end, gchar * name); 35 35 36 void 37 sels_destroy (GList * sels); 38 36 39 /* 37 40 * sel_cmp (s1, s2) sweep/branches/sweep-info-panel/include/sweep/sweep_sounddata.h
r124 r464 52 52 sw_sel * 53 53 sounddata_add_selection_1 (sw_sounddata * sounddata, 54 sw_framecount_t start, sw_framecount_t end );54 sw_framecount_t start, sw_framecount_t end, gchar * name); 55 55 56 56 sw_sel * 57 57 sounddata_set_selection_1 (sw_sounddata * sounddata, 58 sw_framecount_t start, sw_framecount_t end );58 sw_framecount_t start, sw_framecount_t end, gchar * name); 59 59 60 60 guint sweep/branches/sweep-info-panel/plugins/byenergy/byenergy.c
r124 r464 201 201 if (loc - end > max_interruption) { 202 202 if (end - start > min_duration) { 203 sounddata_add_selection_1 (sounddata, start +1, end-1);203 sounddata_add_selection_1 (sounddata, start + 1, end - 1, NULL); 204 204 } 205 205 end = start = -1; … … 214 214 if (start != -1) { 215 215 if (end - start > min_duration) { 216 sounddata_add_selection_1 (sounddata, start, end );216 sounddata_add_selection_1 (sounddata, start, end, NULL); 217 217 } 218 218 } sweep/branches/sweep-info-panel/src/info-panel.c
r463 r464 1305 1305 g_mutex_lock (s->sounddata->marks_mutex); 1306 1306 1307 mark = mark_new ((view->end - view->start) / 2 + view->start, SWEEP_MARK_TYPE_SIMPLE, NULL);1307 mark = mark_new ((view->end - view->start) / 2 + view->start, SWEEP_MARK_TYPE_SIMPLE, 0, NULL); 1308 1308 1309 1309 view->sample->sounddata->marks = marks_add_marker (view->sample->sounddata->marks, mark); … … 1593 1593 } 1594 1594 1595 static sw_sample * info_panel_selection_modify (sw_sample * s, sw_param_set unused, SelectionData * seldata) 1595 static sw_sample * 1596 info_panel_selection_modify (sw_sample * s, sw_param_set unused, SelectionData * seldata) 1596 1597 { 1597 1598 g_mutex_lock (s->sounddata->sels_mutex); … … 1608 1609 } 1609 1610 1610 void info_panel_selections_edited_name_cb (GtkCellRendererText *cell, gchar *path_string, gchar *new_text, sw_view * view) 1611 void 1612 info_panel_selections_edited_name_cb (GtkCellRendererText *cell, gchar *path_string, gchar *new_text, sw_view * view) 1611 1613 { 1612 1614 GtkTreeModel * model; … … 1656 1658 } 1657 1659 1660 static sw_sample * 1661 info_panel_marker_modify (sw_sample * s, sw_param_set unused, MarkerData * markdata) 1662 { 1663 g_mutex_lock (s->sounddata->marks_mutex); 1664 1665 markdata->mark_modify->name = markdata->mark_data.name; 1666 markdata->mark_modify->frame = markdata->mark_data.frame; 1667 markdata->mark_modify->color = markdata->mark_data.color; 1668 markdata->mark_modify->type = markdata->mark_data.type; 1669 1670 g_mutex_unlock (s->sounddata->marks_mutex); 1671 1672 g_free(markdata); 1673 1674 return s; 1675 } 1676 1658 1677 void info_panel_markers_edited_name_cb (GtkCellRendererText *cell, gchar *path_string, gchar *new_text, sw_view * view) 1659 1678 { … … 1663 1682 sw_mark * mark; 1664 1683 GList * gl; 1665 // SelectionData * seldata;1684 MarkerData * markdata; 1666 1685 gchar * name; 1667 1686 … … 1689 1708 info_panel_row_update_str(model, path_string, INFO_PANEL_MARKERS_COL_NAME, new_text); 1690 1709 1691 mark->name = g_strdup(new_text);1692 /* 1693 seldata = g_malloc0(sizeof(SelectionData));1694 1695 seldata->sel_data.name = g_strdup(new_text);1696 1697 seldata->sel_data.sel_start = sel->sel_start;1698 seldata->sel_data.sel_end = sel->sel_end;1699 1700 seldata->sel_modify = sel; 1701 1702 perform_selection_op (view->sample, _("Set sel name"), (SweepFilter)info_panel_selection_modify, NULL, seldata); 1703 */ 1710 // mark->name = g_strdup(new_text); 1711 1712 markdata = g_malloc0 ( sizeof (SelectionData) ); 1713 1714 /* TODO: change direct coping date into function mark_copy */ 1715 markdata->mark_data.name = g_strdup(new_text); 1716 markdata->mark_data.frame = mark->frame; 1717 markdata->mark_data.color = mark->color; 1718 markdata->mark_data.type = mark->type; 1719 1720 markdata->mark_modify = mark; 1721 1722 perform_marker_op (view->sample, _("Set marker name"), (SweepFilter)info_panel_marker_modify, NULL, markdata); 1704 1723 } 1705 1724 sweep/branches/sweep-info-panel/src/sample-display.c
r463 r464 2112 2112 } 2113 2113 2114 #if 02115 typedef struct _MarkerData MarkerData;2116 struct _MarkerData2117 {2118 sw_framecount_t offset;2119 sw_mark * mark_modify;2120 };2121 2122 static void2123 sample_display_mod_marker (sw_sample * s, sw_param_set unused, MarkerData * markdata)2124 {2125 /* pointer into moving marker */2126 s->tmp_mark = markdata->mark_modify;2127 2128 /* modify data */2129 s->tmp_mark->frame = markdata->offset;2130 2131 g_free(markdata);2132 }2133 #endif2134 2135 2114 static void 2136 2115 sample_display_handle_marker_motion (SampleDisplay * s, int x, int y) … … 2141 2120 sw_framecount_t offset, off1, off2; 2142 2121 gboolean mod = FALSE; 2143 //MarkerData * markdata;2144 2122 2145 2123 offset = XPOS_TO_OFFSET(x); … … 2160 2138 2161 2139 if ( (mark->frame >= off1) && (mark->frame <= off2) ){ 2140 /* start modifing operation */ 2141 sample->tmp_mark_inst = perform_marker_start_op (sample, _("Modify Time marker")); 2142 2162 2143 /* pointer into moving marker */ 2163 2144 sample->tmp_mark = mark; … … 2472 2453 break; 2473 2454 2474 case TOOL_HAND:2475 s->selecting = SELECTING_HAND;2476 s->view->hand_offset = x;2477 SET_CURSOR(widget, HAND_CLOSE);2478 sample_display_handle_hand_motion (s, x, y);2455 case TOOL_HAND: 2456 s->selecting = SELECTING_HAND; 2457 s->view->hand_offset = x; 2458 SET_CURSOR(widget, HAND_CLOSE); 2459 sample_display_handle_hand_motion (s, x, y); 2479 2460 break; 2480 2461 2481 case TOOL_MARKER:2482 s->selecting = SELECTING_MARKER;2483 sample_display_handle_marker_motion (s, x, y);2462 case TOOL_MARKER: 2463 s->selecting = SELECTING_MARKER; 2464 sample_display_handle_marker_motion (s, x, y); 2484 2465 break; 2485 2466 … … 2568 2549 "selection-changed"); 2569 2550 } 2570 }2571 2572 static sw_sample * sample_display_marker_mod (sw_sample * s, sw_param_set unused, sw_view * view)2573 {2574 2575 2576 2577 2551 } 2578 2552 … … 2637 2611 2638 2612 case TOOL_MARKER: 2639 s->view->sample->tmp_mark = NULL;2640 2641 2613 s->view->sample->sounddata->marks = 2642 2614 marks_resort(s->view->sample->sounddata->marks); 2643 2615 2644 perform_marker_ op (s->view->sample, _("Modify Time marker"), (SweepFilter)sample_display_marker_mod, NULL, s->view);2616 perform_marker_finish_op (s->view->sample, s->view->sample->tmp_mark_inst); 2645 2617 2646 2618 info_panel_markers_info_update (s->view->sample); 2619 2620 s->view->sample->tmp_mark = NULL; 2621 s->view->sample->tmp_mark_inst = NULL; 2647 2622 2648 2623 break; sweep/branches/sweep-info-panel/src/sweep_app.h
r463 r464 250 250 sw_sel * tmp_sel; /* Temporary selection, used while selecting */ 251 251 sw_mark * tmp_mark; /* Temp marker, used while moving */ 252 sw_op_instance * tmp_mark_inst; /* instance of modified marker */ 252 253 253 254 /* Operations; lock on scheduling */ sweep/branches/sweep-info-panel/src/sweep_marker.c
r463 r464 101 101 102 102 sw_mark * 103 mark_new (sw_framecount_t frame, sw_mark_type_t type, g char * name)103 mark_new (sw_framecount_t frame, sw_mark_type_t type, gint color, gchar * name) 104 104 { 105 105 sw_mark * mark; 106 106 107 mark = g_malloc0 ( sizeof ( sw_mark) );107 mark = g_malloc0 ( sizeof (sw_mark) ); 108 108 mark->frame = frame; 109 109 mark->type = type; 110 mark->color = 0;110 mark->color = color; 111 111 112 112 if (name != NULL) … … 150 150 sw_mark * nmark; 151 151 152 nmark = mark_new (mark->frame, mark->type, mark-> name);152 nmark = mark_new (mark->frame, mark->type, mark->color, mark->name); 153 153 154 154 return nmark; … … 203 203 204 204 GList * 205 marks_add_marker_1 (GList * marks, sw_framecount_t frame, sw_mark_type_t type, g char * name)205 marks_add_marker_1 (GList * marks, sw_framecount_t frame, sw_mark_type_t type, gint color, gchar * name) 206 206 { 207 207 sw_mark * mark; 208 208 209 mark = mark_new (frame, type, name);209 mark = mark_new (frame, type, color, name); 210 210 211 211 return marks_add_marker (marks, mark); … … 305 305 306 306 /* 307 * function preform immediate operation, so no threading, no asynchronous 308 * operations, clean and easy. 309 */ 310 void 311 perform_marker_immediate_op (sw_sample * sample, gchar * desc, SweepFilter func, 312 sw_param_set pset, gpointer custom_data) 307 * functions used for starting and finishing marker modification operation 308 * where operation thread is user interaction 309 */ 310 sw_op_instance * 311 perform_marker_start_op (sw_sample * sample, gchar * desc) 313 312 { 314 313 sw_op_instance * inst; … … 316 315 317 316 inst = sw_op_instance_new (sample, desc, &marker_op); 318 inst->do_data = custom_data; 317 /* inst->do_data = custom_data; */ 319 318 320 319 /* marks, "copied for undo data" */ … … 322 321 inst->undo_data = mark_replace_data_new (marks); 323 322 set_active_op (sample, inst); 324 323 #if 0 325 324 func (sample, pset, custom_data); 326 325 … … 332 331 333 332 undo_dialog_refresh_history (sample); 334 } 335 333 #endif 334 return inst; 335 } 336 337 void 338 perform_marker_finish_op (sw_sample * sample, sw_op_instance * inst) 339 { 340 GList * marks; 341 #if 0 342 inst = sw_op_instance_new (sample, desc, &marker_op); 343 inst->do_data = custom_data; 344 345 /* marks, "copied for undo data" */ 346 marks = marks_copy (sample->sounddata->marks); 347 inst->undo_data = mark_replace_data_new (marks); 348 set_active_op (sample, inst); 349 350 func (sample, pset, custom_data); 351 #endif 352 /* marks, "copied for redo data" */ 353 marks = marks_copy (sample->sounddata->marks); 354 inst->redo_data = mark_replace_data_new (marks); 355 356 register_operation (sample, inst); 357 358 undo_dialog_refresh_history (sample); 359 } 360 sweep/branches/sweep-info-panel/src/sweep_sample.c
r463 r464 152 152 153 153 s->tmp_sel = NULL; 154 s->tmp_mark = NULL; 155 s->tmp_mark_inst = NULL; 154 156 155 157 s->playmarker_tag = 0;
