34c34,36
< #include <gnome.h>
---
> #include "gwc.h"
> #include <libgnome/libgnome.h>
> #include <libgnomeui/libgnomeui.h>
38d39
< #include "gwc.h"
40,42c41
< #include "soundfile.h"
< #include "audio_edit.h"
< #include <sndfile.h>
---
> #include "sndfile.h"
62,64c61
< #ifndef TRUNCATE_OLD
< #include "icons/silence.xpm"
< #endif
---
> 
109a107,112
> #ifdef HAVE_ALSA
> char audio_device[256]="plughw:0,0";
> #else
> char audio_device[256]="/dev/dsp";
> #endif
> 
175,184d177
< #ifndef TRUNCATE_OLD
< static int is_region_selected(void)
< {
<     if (!audio_view.selection_region) {
<         info("Please select a region of audio data.");
<         return 0;
<     }
<     return 1;
< }
< #endif /* !TRUNCATE_OLD */
332a326,330
> #ifdef HAVE_ALSA
>     strcpy(audio_device, gnome_config_get_string("audio_device=plughw:0,0"));
> #else
>     strcpy(audio_device, gnome_config_get_string("audio_device=/dev/dsp"));
> #endif
361a360
>     gnome_config_set_string("audio_device", audio_device);
745d743
< #ifdef TRUNCATE_OLD
759,835d756
< #else /* !TRUNCATE_OLD */
<         if (is_region_selected()) {
<             long first, last;
<             get_region_of_interest(&first, &last, &audio_view);
< 
<             if (first == 0 && last == prefs.n_samples - 1) {
<                 info("Can't cut ALL audio data from file.");
<             } else {
<                 file_processing = TRUE;
<                 audioedit_cut_selection(&audio_view);
<                 main_redraw(FALSE, TRUE);
<                 file_processing = FALSE;
<             }
<         }
< #endif /* !TRUNCATE_OLD */
<     }
< }
< #ifndef TRUNCATE_OLD
< void copy_callback(GtkWidget * widget, gpointer data)
< {
<     if ((file_processing == FALSE) && (file_is_open == TRUE)
< 	&& (audio_playback == FALSE) && (cursor_playback == FALSE)) {
<         if (is_region_selected()) {
<             file_processing = TRUE;
<             audioedit_copy_selection(&audio_view);
<             file_processing = FALSE;
<         }
<     }
< }
< 
< void paste_callback(GtkWidget * widget, gpointer data)
< {
<     if ((file_processing == FALSE) && (file_is_open == TRUE)
< 	&& (audio_playback == FALSE) && (cursor_playback == FALSE)) {
<         if (is_region_selected()) {
<             if (audioedit_has_clipdata()) {
<                 file_processing = TRUE;
<                 audioedit_paste_selection(&audio_view);
<                 main_redraw(FALSE, TRUE);
<                 file_processing = FALSE;
<             } else {
<                 info("No audio data in internal clipboard.");
<             }
<         }
<     }
< }
< 
< void delete_callback(GtkWidget * widget, gpointer data)
< {
<     if ((file_processing == FALSE) && (file_is_open == TRUE)
< 	&& (audio_playback == FALSE) && (cursor_playback == FALSE)) {
<         if (is_region_selected()) {
<             long first, last;
<             get_region_of_interest(&first, &last, &audio_view);
< 
<             if (first == 0 && last == prefs.n_samples - 1) {
<                 info("Can't delete ALL audio data from file.");
<             } else {
<                 file_processing = TRUE;
<                 audioedit_delete_selection(&audio_view);
<                 main_redraw(FALSE, TRUE);
<                 file_processing = FALSE;
<             }
<         }
<     }
< }
< 
< void silence_callback(GtkWidget * widget, gpointer data)
< {
<     if ((file_processing == FALSE) && (file_is_open == TRUE)
< 	&& (audio_playback == FALSE) && (cursor_playback == FALSE)) {
<         if (is_region_selected()) {
<             file_processing = TRUE;
<             audioedit_insert_silence(&audio_view);
<             main_redraw(FALSE, TRUE);
<             file_processing = FALSE;
<         }
838d758
< #endif /* !TRUNCATE_OLD */
984c904
< 	    start_playback("/dev/dsp", &audio_view, &prefs, 0.10, 0.25);
---
> 	    start_playback(audio_device, &audio_view, &prefs, 0.10, 0.25);
1127,1148d1046
< void adjust_marker_positions(long pos, long delta)
< {
<     int i,j;
< 
<     i = 0;
<     while (i < n_markers) {
<         if (markers[i] >= pos) {
<             markers[i] += delta;
<             if (markers[i] <= pos || markers[i] >= prefs.n_samples) {
<                 for (j = i; j < n_markers - 1; j++) {
<                     markers[j] = markers[j+1];
<                 }
<                 n_markers--;
<             } else {
<                 i++;
<             }
<         } else {
<             i++;
<         }
<     }
< }
< 
1359c1257
<     const gchar *authors[] = { "Jeffrey J. Welty", NULL };
---
>     const gchar *authors[] = { "Jeffrey J. Welty", "Other to be listes", NULL };
1362,1363c1260
< 				    "Copyright 2001,2002,2003 Redhawk.org",
< 				    authors,
---
> 				    "Copyright 2001,2002,2003,2004 Redhawk.org",
1365c1262,1264
< 				    "Redhawk.org"));
---
> 				    authors,
> 				    NULL,
> 				    NULL,NULL));
1420d1318
< #ifdef TRUNCATE_OLD
1423d1320
< #endif /* TRUNCATE_OLD */
1715d1611
< #ifdef TRUNCATE_OLD
1719,1722c1615
< #else
<     GNOMEUIINFO_ITEM_STOCK("    Amplify", "Amplify the current view or selection",
< 		     amplify, GNOME_STOCK_PIXMAP_VOLUME),
< #endif
---
> 
1750c1643
< #ifdef TRUNCATE_OLD
---
> 
1753,1765d1645
< #else
<     GNOMEUIINFO_ITEM("    Silence", "Insert silence with size of current selection to audio data",
< 		     silence_callback, silence_xpm),
<     GNOMEUIINFO_SEPARATOR,
<     GNOMEUIINFO_ITEM_STOCK("    Cut", "Cut current selection to internal clipboard",
<                            cut_callback, GNOME_STOCK_PIXMAP_CUT),
<     GNOMEUIINFO_ITEM_STOCK("    Copy", "Copy current selection to internal clipboard",
<                            copy_callback, GNOME_STOCK_PIXMAP_COPY),
<     GNOMEUIINFO_ITEM_STOCK("    Paste", "Insert internal clipboard at begin of current selection",
<                            paste_callback, GNOME_STOCK_PIXMAP_PASTE),
<     GNOMEUIINFO_ITEM_STOCK("    Delete", "Delete current selection from audio data",
<                            delete_callback, GNOME_STOCK_PIXMAP_TRASH),
< #endif
1902d1781
< #ifdef TRUNCATE_OLD
1908,1910d1786
< #else
<     GNOMEUIINFO_ITEM_STOCK("Undo", "Undo the last edit action",
<                            undo_callback, GNOME_STOCK_PIXMAP_UNDO),
1912,1914d1787
<     GNOMEUIINFO_ITEM_STOCK("Amplify", "Amplify the current view or selection",
< 		     amplify, GNOME_STOCK_PIXMAP_VOLUME),
< #endif
1943d1815
< #ifdef TRUNCATE_OLD
1946,1958c1818
< #else
<     GNOMEUIINFO_ITEM("Silence", "Insert silence with size of current selection to audio data",
< 		     silence_callback, silence_xpm),
<     GNOMEUIINFO_SEPARATOR,
<     GNOMEUIINFO_ITEM_STOCK("Cut", "Cut current selection to internal clipboard",
<                            cut_callback, GNOME_STOCK_PIXMAP_CUT),
<     GNOMEUIINFO_ITEM_STOCK("Copy", "Copy current selection to internal clipboard",
<                            copy_callback, GNOME_STOCK_PIXMAP_COPY),
<     GNOMEUIINFO_ITEM_STOCK("Paste", "Insert internal clipboard at begin of current selection",
<                            paste_callback, GNOME_STOCK_PIXMAP_PASTE),
<     GNOMEUIINFO_ITEM_STOCK("Delete", "Delete current selection from audio data",
<                            delete_callback, GNOME_STOCK_PIXMAP_TRASH),
< #endif
---
> 
1973c1833
< 	gnome_appbar_set_progress(GNOME_APPBAR(status_bar), percentage);
---
> 	gnome_appbar_set_progress_percentage(GNOME_APPBAR(status_bar), percentage);
1993c1853
< 	gnome_appbar_set_progress(GNOME_APPBAR(status_bar), percentage);
---
> 	gnome_appbar_set_progress_percentage(GNOME_APPBAR(status_bar), percentage);
2186d2045
< #ifdef TRUNCATE_OLD
2193,2201d2051
< #else
< 	    audio_view.selected_first_sample = time_to_sample(argv[4],&prefs);
< 	    audio_view.selected_last_sample = time_to_sample(argv[5],&prefs);
< 	    audio_view.selection_region = TRUE;
< 	    g_print("Truncating.  Keeping samples %ld to %ld\n",
<                     audio_view.selected_first_sample,
<                     audio_view.selected_last_sample);
< 	    truncate_wavfile(&audio_view, 0); /* 0 == don't save undo data */
< #endif
2229c2079,2086
<     gnome_init("Gnome Wave Cleaner", VERSION, argc, argv);
---
> #define PREFIX "."
> #define SYSCONFDIR "."
> #define DATADIR "."
> #define LIBDIR "."
> 
>     gnome_program_init("Gnome_Wave_Cleaner", VERSION, LIBGNOMEUI_MODULE, argc, argv,
>                        GNOME_PARAM_POPT_TABLE, NULL,
> 		       GNOME_PROGRAM_STANDARD_PROPERTIES, NULL);
2294c2151
< 	gtk_drawing_area_size(GTK_DRAWING_AREA(audio_drawing_area), 600,
---
> 	gtk_widget_set_size_request(GTK_WIDGET(audio_drawing_area), 600,
2341,2343c2198
< 	transport_toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
< 					    GTK_TOOLBAR_ICONS);
< /*  	gtk_toolbar_set_button_relief (GTK_TOOLBAR (transport_toolbar), GTK_RELIEF_HALF);  */
---
> 	edit_toolbar = gtk_toolbar_new() ;
2345,2346c2200,2201
< 	gnome_app_fill_toolbar(GTK_TOOLBAR(transport_toolbar),
< 			       transport_toolbar_info, NULL);
---
> 	gnome_app_fill_toolbar(GTK_TOOLBAR(edit_toolbar),
> 			       edit_toolbar_info, NULL);
2349,2351c2204,2205
< 			      GTK_TOOLBAR(transport_toolbar),
< 			      "Playback/selection tools",
< 			      GNOME_DOCK_ITEM_BEH_NORMAL, GNOME_DOCK_TOP,
---
> 			      GTK_TOOLBAR(edit_toolbar), "Edit tools",
> 			      BONOBO_DOCK_ITEM_BEH_NORMAL, BONOBO_DOCK_TOP,
2352a2207
> 	gtk_toolbar_set_style(GTK_TOOLBAR(edit_toolbar), GTK_TOOLBAR_ICONS) ;
2354,2358c2209
< /*  	gtk_toolbar_set_style(GTK_TOOLBAR(transport_toolbar), GTK_TOOLBAR_BOTH) ;  */
< 
< 	edit_toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
< 				       GTK_TOOLBAR_ICONS);
< /*  	gtk_toolbar_set_button_relief (GTK_TOOLBAR (edit_toolbar), GTK_RELIEF_HALF);  */
---
> 	transport_toolbar = gtk_toolbar_new() ;
2360,2361c2211,2212
< 	gnome_app_fill_toolbar(GTK_TOOLBAR(edit_toolbar),
< 			       edit_toolbar_info, NULL);
---
> 	gnome_app_fill_toolbar(GTK_TOOLBAR(transport_toolbar),
> 			       transport_toolbar_info, NULL);
2364,2365c2215,2217
< 			      GTK_TOOLBAR(edit_toolbar), "Edit tools",
< 			      GNOME_DOCK_ITEM_BEH_NORMAL, GNOME_DOCK_TOP,
---
> 			      GTK_TOOLBAR(transport_toolbar),
> 			      "Playback/selection tools",
> 			      BONOBO_DOCK_ITEM_BEH_NORMAL, BONOBO_DOCK_TOP,
2366a2219
> 	gtk_toolbar_set_style(GTK_TOOLBAR(transport_toolbar), GTK_TOOLBAR_ICONS) ;
2368d2220
< /*  	gtk_toolbar_set_style(GTK_TOOLBAR(edit_toolbar), GTK_TOOLBAR_BOTH) ;  */
2418c2270
< /*   start_monitor("/dev/dsp") ;  */
---
> /*   start_monitor(audio_device) ;  */
