Changeset 431
- Timestamp:
- 08/29/06 17:15:44 (5 years ago)
- Files:
-
- sweep/branches/sweep-info-panel/src/info-panel.c (modified) (10 diffs)
- sweep/branches/sweep-info-panel/src/info-panel.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/branches/sweep-info-panel/src/info-panel.c
r430 r431 40 40 #include "sample.h" 41 41 42 42 /* XXX Warning!!!! 43 * 44 * This is development code so it isnt fully tested. 45 * Application may crash or corupt your data, You have been warned! 46 * 47 * OK, it's not so bad :) 48 * Things to be done/resolved: 49 * - show/edit sample type (ogg, mp3, wav, etc.) 50 * - treeview doesn't catch all keyboards signals, so editing cells is almost useless 51 * - implement: 52 * - changing sampling rate 53 * - changing number of channels 54 * - implement markers 55 */ 43 56 44 57 typedef struct _PopupData PopupData; … … 65 78 66 79 if (error) { 67 g_warning (_("Could not load icon: %s\n"), error->message);80 g_warning("%s: %s: %s\n", G_STRLOC, _("Could not load icon"), error->message); 68 81 g_error_free(error); 69 82 error = NULL; … … 125 138 INFO_PANEL_COL_TYPE, INFO_PANEL_SAMPLE_MEMORY, 126 139 -1); 140 /* if someone implement idtag's we'll support them :) */ 127 141 #if 0 128 142 gtk_tree_store_append(treestore, &child, &toplevel); … … 188 202 INFO_PANEL_COL_ICON, done_icon, 189 203 -1); 190 204 /* if someone implement markers we'll support them :) */ 205 #if 0 191 206 /* markers_info */ 192 207 icon = info_panel_load_icon("marker.png"); … … 197 212 INFO_PANEL_COL_ICON, icon, 198 213 -1); 199 214 #endif 200 215 return GTK_TREE_MODEL(treestore); 201 216 } … … 342 357 INFO_PANEL_COL_POINTER, gl, 343 358 INFO_PANEL_COL_EDITABLE_NAME, TRUE, 359 INFO_PANEL_COL_EDITABLE_PARAM, TRUE, 344 360 -1); 345 361 … … 383 399 nsel++; 384 400 385 // g_print("SELECTIONS: n:%i nsel:%i\n",n,nsel);386 387 401 /* more selections then available data slots */ 388 402 if (nsel > n){ … … 709 723 GList * gl; 710 724 711 g_print("name edited: %s [%s]\n", path_string, new_text);725 // g_print("name edited: %s [%s]\n", path_string, new_text); 712 726 713 727 gtk_tree_model_get_iter_from_string(model, &iter, path_string); … … 731 745 gint type; 732 746 gchar * name; 733 734 g_print("param edited: %s [%s]\n", path_string, new_text); 747 gchar sstr[256], estr[256]; 748 gint error = 0; 749 gdouble ssec, esec; 750 sw_sel * sel; 751 GList * gl; 752 sw_framecount_t sel_start, sel_end; 753 754 // g_print("param edited: %s [%s]\n", path_string, new_text); 735 755 736 756 gtk_tree_model_get_iter_from_string(model, &iter, path_string); … … 740 760 switch (type){ 741 761 case INFO_PANEL_SAMPLE_FILENAME: 762 742 763 name = g_build_filename(g_path_get_dirname(view->sample->pathname), new_text, NULL); 764 743 765 info_panel_row_update_str(model, path_string, INFO_PANEL_COL_PARAM1, new_text); 766 744 767 sample_set_pathname(view->sample, name); 745 g_print("%s\n", name); 768 // g_print("%s\n", name); 769 746 770 g_free(name); 771 772 break; 773 case INFO_PANEL_SELECTION_ITEM: 774 775 error = sscanf(new_text, "%s - %s", sstr, estr); 776 777 if (error < 2){ 778 g_warning("%s: %s\n", G_STRLOC, _("Unable to convert timespec...")); 779 return; 780 } 781 782 ssec = strtime_to_seconds (sstr); 783 esec = strtime_to_seconds (estr); 784 785 if (ssec == -1 || esec == -1){ 786 g_warning("%s: %s\n", G_STRLOC, _("Invalid time specification...")); 787 return; 788 } 789 790 sel_start = (sw_framecount_t) (ssec * view->sample->sounddata->format->rate); 791 sel_end = (sw_framecount_t) (esec * view->sample->sounddata->format->rate); 792 793 if (sel_start < 0 || 794 sel_end < 0 || 795 sel_start > view->sample->sounddata->nr_frames || 796 sel_end > view->sample->sounddata->nr_frames || 797 sel_start >= sel_end) 798 { 799 g_warning("%s: %s\n", G_STRLOC, _("Invalid time specification (out of bounds)...")); 800 return; 801 } 802 803 gtk_tree_model_get(model, &iter, INFO_PANEL_COL_POINTER, &gl, -1); 804 805 sel = (sw_sel *)gl->data; 806 807 g_mutex_lock(view->sample->sounddata->sels_mutex); 808 809 sel->sel_start = sel_start; 810 sel->sel_end = sel_end; 811 812 g_mutex_unlock(view->sample->sounddata->sels_mutex); 813 814 g_signal_emit_by_name(GTK_OBJECT(view->display), "selection-changed"); 815 747 816 break; 748 817 } sweep/branches/sweep-info-panel/src/info-panel.h
r427 r431 63 63 INFO_PANEL_UNDO, 64 64 INFO_PANEL_UNDO_ITEM, 65 INFO_PANEL_PLUGINS, 66 INFO_PANEL_PLUGIN_ITEM, 65 67 INFO_PANEL_MARKERS, 66 68 INFO_PANEL_MARKERS_ITEM
