diff options
author | IOhannes m zmölnig <zmoelnig@umlautQ.umlaeute.mur.at> | 2016-01-25 11:25:59 +0100 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@umlautQ.umlaeute.mur.at> | 2016-01-25 11:25:59 +0100 |
commit | 110d59c341b8c50c04f30d90e85e9b8f6f329a0e (patch) | |
tree | 174afbe2ded41ae03923b93a0c4e6975e3163ad5 /snd-1.h | |
parent | e5328e59987b90c4e98959510b810510e384650d (diff) |
Imported Upstream version 16.1
Diffstat (limited to 'snd-1.h')
-rw-r--r-- | snd-1.h | 812 |
1 files changed, 399 insertions, 413 deletions
@@ -1,64 +1,65 @@ #ifndef SND_1_H #define SND_1_H -#define ASSERT_SOUND(Origin, Snd, Offset) \ - if (!((XEN_INTEGER_P(Snd)) || (XEN_SOUND_P(Snd)) || (XEN_FALSE_P(Snd)) || (XEN_NOT_BOUND_P(Snd)))) \ - XEN_WRONG_TYPE_ARG_ERROR(Origin, Offset, Snd, "a sound object, an integer (sound index), or " PROC_FALSE); +#define WITH_RELATIVE_PANES (USE_MOTIF && (XmVERSION > 1)) -#define ASSERT_CHANNEL(Origin, Snd, Chn, Offset) \ - if (!((XEN_INTEGER_P(Snd)) || (XEN_SOUND_P(Snd)) || (XEN_FALSE_P(Snd)) || (XEN_NOT_BOUND_P(Snd)))) \ - XEN_WRONG_TYPE_ARG_ERROR(Origin, Offset, Snd, "a sound object, an integer (sound index), or " PROC_FALSE); \ +#define Snd_assert_sound(Origin, Snd, Offset) \ + if (!((Xen_is_integer(Snd)) || (xen_is_sound(Snd)) || (Xen_is_false(Snd)) || (!Xen_is_bound(Snd)))) \ + Xen_wrong_type_arg_error(Origin, Offset, Snd, "a sound object, an integer (sound index), or " PROC_FALSE); + +#define Snd_assert_channel(Origin, Snd, Chn, Offset) \ + if (!((Xen_is_integer(Snd)) || (xen_is_sound(Snd)) || (Xen_is_false(Snd)) || (!Xen_is_bound(Snd)))) \ + Xen_wrong_type_arg_error(Origin, Offset, Snd, "a sound object, an integer (sound index), or " PROC_FALSE); \ else \ - if (!((XEN_INTEGER_P(Chn)) || (XEN_FALSE_P(Chn)) || (XEN_NOT_BOUND_P(Chn)))) \ - XEN_WRONG_TYPE_ARG_ERROR(Origin, Offset + 1, Chn, "an integer (0-based channel number) or " PROC_FALSE); + if (!((Xen_is_integer(Chn)) || (Xen_is_false(Chn)) || (!Xen_is_bound(Chn)))) \ + Xen_wrong_type_arg_error(Origin, Offset + 1, Chn, "an integer (0-based channel number) or " PROC_FALSE); + -/* these macros fix up argument order for setter procs in Scheme: (set! (proc a b) c) */ -/* snd-edits has a 5 and a 10 case */ #if HAVE_SCHEME +/* these macros fix up argument order for setter procs in Scheme: (set! (proc a b) c) */ -#define WITH_TWO_SETTER_ARGS(name_reversed, name) \ +#define with_two_setter_args(name_reversed, name) \ static s7_pointer name_reversed(s7_scheme *sc, s7_pointer args) \ { \ - if (XEN_NULL_P(XEN_CDR(args))) \ - return(name(XEN_CAR(args), XEN_UNDEFINED)); \ - return(name(XEN_CADR(args), XEN_CAR(args))); \ + if (Xen_is_null(Xen_cdr(args))) \ + return(name(Xen_car(args), Xen_undefined)); \ + return(name(Xen_cadr(args), Xen_car(args))); \ } -#define WITH_THREE_SETTER_ARGS(name_reversed, name) \ +#define with_three_setter_args(name_reversed, name) \ static s7_pointer name_reversed(s7_scheme *sc, s7_pointer args) \ { \ - if (XEN_NULL_P(XEN_CDR(args))) \ - return(name(XEN_CAR(args), XEN_UNDEFINED, XEN_UNDEFINED)); \ + if (Xen_is_null(Xen_cdr(args))) \ + return(name(Xen_car(args), Xen_undefined, Xen_undefined)); \ else { \ - if (XEN_NULL_P(XEN_CDDR(args))) \ - return(name(XEN_CADR(args), XEN_CAR(args), XEN_UNDEFINED)); \ - else return(name(XEN_CADDR(args), XEN_CAR(args), XEN_CADR(args))); \ + if (Xen_is_null(Xen_cddr(args))) \ + return(name(Xen_cadr(args), Xen_car(args), Xen_undefined)); \ + else return(name(Xen_caddr(args), Xen_car(args), Xen_cadr(args))); \ }} -#define WITH_FOUR_SETTER_ARGS(name_reversed, name) \ +#define with_four_setter_args(name_reversed, name) \ static s7_pointer name_reversed(s7_scheme *sc, s7_pointer args) \ { \ - if (XEN_NULL_P(XEN_CDR(args))) \ - return(name(XEN_CAR(args), XEN_UNDEFINED, XEN_UNDEFINED, XEN_UNDEFINED)); \ + if (Xen_is_null(Xen_cdr(args))) \ + return(name(Xen_car(args), Xen_undefined, Xen_undefined, Xen_undefined)); \ else { \ - if (XEN_NULL_P(XEN_CDDR(args))) \ - return(name(XEN_CADR(args), XEN_CAR(args), XEN_UNDEFINED, XEN_UNDEFINED)); \ + if (Xen_is_null(Xen_cddr(args))) \ + return(name(Xen_cadr(args), Xen_car(args), Xen_undefined, Xen_undefined)); \ else { \ - if (XEN_NULL_P(XEN_CDDDR(args))) \ - return(name(XEN_CADDR(args), XEN_CAR(args), XEN_CADR(args), XEN_UNDEFINED)); \ - else return(name(XEN_CADDDR(args), XEN_CAR(args), XEN_CADR(args), XEN_CADDR(args))); \ + if (Xen_is_null(Xen_cdddr(args))) \ + return(name(Xen_caddr(args), Xen_car(args), Xen_cadr(args), Xen_undefined)); \ + else return(name(Xen_cadddr(args), Xen_car(args), Xen_cadr(args), Xen_caddr(args))); \ }}} #else -/* 10 case in snd-edits for set-samples and a 5 case for set-sample */ -#define WITH_TWO_SETTER_ARGS(name_reversed, name) -#define WITH_THREE_SETTER_ARGS(name_reversed, name) -#define WITH_FOUR_SETTER_ARGS(name_reversed, name) +#define with_two_setter_args(name_reversed, name) +#define with_three_setter_args(name_reversed, name) +#define with_four_setter_args(name_reversed, name) #endif -#define ASSERT_SAMPLE_TYPE(Origin, Beg, Offset) \ - XEN_ASSERT_TYPE(XEN_NUMBER_P(Beg) || XEN_FALSE_P(Beg) || XEN_NOT_BOUND_P(Beg), Beg, Offset, Origin, "a number or " PROC_FALSE) +#define Snd_assert_sample_type(Origin, Beg, Offset) \ + Xen_check_type(Xen_is_integer(Beg) || Xen_is_false(Beg) || (!Xen_is_bound(Beg)), Beg, Offset, Origin, "an integer or " PROC_FALSE) typedef struct { char **values; @@ -77,20 +78,20 @@ typedef struct { typedef struct snd_io snd_io; typedef struct { - char *name; /* full name */ - mus_long_t samples; /* total samples = chans * frames */ + char *name; /* full name */ + mus_long_t samples; /* total samples = chans * framples */ mus_long_t data_location; /* bytes */ int srate; int chans; - int format; /* data format (mus_bshort etc) */ - int type; /* header type (mus_aifc etc) */ - char *comment; /* output case, not input */ + mus_sample_t sample_type; /* sample type (mus_bshort etc) */ + mus_header_t type; /* header type (mus_aifc etc) */ + char *comment; /* output case, not input */ int *loops; } file_info; typedef struct { snd_data_file_t type; - mus_sample_t *buffered_data; + mus_float_t *buffered_data; snd_io *io; char *filename; file_info *hdr; @@ -113,12 +114,12 @@ typedef struct { mus_long_t beg, len; /* beg and len of changed portion */ char *origin; edit_t edit_type; - int sound_location, ptree_location; + int sound_location; mus_long_t selection_beg, selection_end; /* selection needs to follow edit list */ mus_float_t maxamp, selection_maxamp; mus_long_t maxamp_position, selection_maxamp_position; int edpos; - bool ptree_env_too, backed_up; + bool backed_up; mus_long_t samples, cursor; int mark_size, mark_ctr; mark **marks; /* mark positions */ @@ -126,7 +127,7 @@ typedef struct { enved_fft *fft; /* overall fft data for envelope editor */ void *readers; /* current readers of this edit (g++ stupidity forces us to use void* here -- type is sf_info, snd-edits.c) */ void *mixes; - XEN properties; + Xen properties; int properties_gc_loc; } ed_list; @@ -139,7 +140,7 @@ typedef struct snd_fd { int cbi; read_direction_t direction; bool at_eof, freed; - mus_sample_t *data; + mus_float_t *data; snd_data *current_sound; mus_long_t initial_samp; struct chan_info *cp; @@ -148,7 +149,7 @@ typedef struct snd_fd { mus_long_t frag_pos; int edit_ctr, region; reader_t type; - void *ptrees, *ramps, *mixes; + void *ramps, *mixes; } snd_fd; typedef struct {mus_float_t freq; mus_float_t amp;} fft_peak; @@ -193,15 +194,6 @@ typedef struct { int index; /* cp->sounds index (src writes a new temp file) */ } mix_state; -typedef struct fam_info { - FAMRequest *rp; - void (*action)(struct fam_info *fp, FAMEvent *fe); - void *data; -#if MUS_DEBUGGING - char *filename; -#endif -} fam_info; - typedef struct env_editor { int *current_xs; int *current_ys; @@ -210,7 +202,7 @@ typedef struct env_editor { oclock_t down_time; bool env_dragged; int env_pos; - bool click_to_delete, in_dB, with_dots, clip_p; + bool click_to_delete, in_dB, with_dots, clipping; bool edited; } env_editor; @@ -238,28 +230,29 @@ typedef struct { mus_float_t scale; } sono_info; +typedef struct { + int chans, fields; + double *axis_data; + bool *fftp, *wavep; +} axes_data; + typedef struct chan_info { int chan; /* which chan are we */ - bool graph_transform_p; /* f button state */ - bool graph_time_p; /* w button state */ - bool graph_lisp_p; /* is lisp graph active */ + bool graph_transform_on; /* f button state */ + bool graph_time_on; /* w button state */ + bool graph_lisp_on; /* is lisp graph active */ struct lisp_grf *lisp_info; /* defined in snd-chn.c */ bool cursor_on; /* channel's cursor */ bool cursor_visible, fft_cursor_visible; /* for XOR decisions */ int cursor_size; cursor_style_t cursor_style, tracking_cursor_style; - int cx, cy, fft_cx, old_cy; /* graph-relative cursor loc (for XOR in Motif, erase-via-overwrite in cairo) */ + int cx, cy, fft_cx; /* , old_cy; */ /* graph-relative cursor loc (for XOR in Motif, erase-via-overwrite in cairo) */ int edit_ctr; /* channel's edit history */ int edit_size; /* current edit list size */ ed_list **edits; /* the edit list */ int sound_size; /* edit_list associated temp sound buffers */ int sound_ctr; /* current location in sounds list */ snd_data **sounds; /* the associated temp buffer/file/struct list */ - int ptree_size; /* ditto for ptrees */ - int ptree_ctr; - struct ptree **ptrees; - XEN *ptree_inits; - int *init_locs, *init_args; fft_info *fft; /* possibly null fft data */ struct snd_info *sound; /* containing sound */ axis_info *axis; /* time domain axis */ @@ -269,7 +262,6 @@ typedef struct chan_info { struct env_state *peak_env_state; graphics_context *ax; bool selected; - int current_hourglass; mus_float_t progress_pct; #if USE_GTK @@ -278,7 +270,12 @@ typedef struct chan_info { GdkCursor *current_cursor; slist *edhist_list; color_info *combined_data_color; +#if CAIRO_HAS_RECORDING_SURFACE && (0) + cairo_surface_t *fft_pix; + bool fft_pix_ready; +#endif #endif + #if USE_MOTIF Widget *chan_widgets; Pixmap fft_pix; @@ -312,7 +309,7 @@ typedef struct chan_info { mus_float_t spectro_x_scale, spectro_y_scale, spectro_z_scale, spectro_z_angle, spectro_x_angle, spectro_y_angle; mus_float_t spectrum_end, spectrum_start; mus_float_t lin_dB, min_dB, fft_window_alpha, fft_window_beta, beats_per_minute, grid_density; - bool show_y_zero, show_marks, verbose_cursor; + bool show_y_zero, show_marks, with_verbose_cursor; with_grid_t show_grid; int wavo_hop, wavo_trace, zero_pad, wavelet_type, max_transform_peaks, beats_per_measure; x_axis_style_t x_axis_style; @@ -326,17 +323,16 @@ typedef struct chan_info { fft_normalize_t transform_normalization; int transform_type, spectro_hop, edhist_base; bool show_mix_waveforms, graphs_horizontal; - XEN edit_hook; - XEN undo_hook; - XEN cursor_proc; - XEN after_edit_hook; - XEN properties; + Xen edit_hook; + Xen undo_hook; + Xen cursor_proc; + Xen after_edit_hook; + Xen properties; int cursor_proc_loc, edit_hook_loc, undo_hook_loc, after_edit_hook_loc, properties_loc; bool selection_visible; channel_state_t active; int old_x0, old_x1; mus_float_t *amp_control; /* local amp controls in snd-dac; should it be extended to other controls? */ - search_result_t last_search_result; bool just_zero, new_peaks, editable, updating; struct inset_graph_info_t *inset_graph; /* defined in snd-chn.c */ #if HAVE_GL @@ -344,18 +340,18 @@ typedef struct chan_info { #endif } chan_info; -#define CURRENT_SAMPLES(Cp) (Cp)->edits[(Cp)->edit_ctr]->samples -#define CURSOR(Cp) (Cp)->edits[(Cp)->edit_ctr]->cursor +#define current_samples(Cp) (Cp)->edits[(Cp)->edit_ctr]->samples +#define cursor_sample(Cp) (Cp)->edits[(Cp)->edit_ctr]->cursor typedef struct snd_info { sound_inuse_t inuse; int index; int playing; int sync, previous_sync; - bool expand_control_p; - bool contrast_control_p; - bool reverb_control_p; - bool filter_control_p, filter_control_in_dB, filter_control_in_hz; + bool expand_control_on; + bool contrast_control_on; + bool reverb_control_on; + bool filter_control_on, filter_control_in_dB, filter_control_in_hz; mus_float_t amp_control; mus_float_t speed_control; int speed_control_direction, speed_control_tones, speed_control_numerator, speed_control_denominator; @@ -378,21 +374,9 @@ typedef struct snd_info { char *filename; char *short_filename; int nchans; - struct ptree *search_tree; - XEN search_proc; - XEN prompt_callback; - XEN properties; - int search_proc_loc, prompt_callback_loc, properties_loc; - bool raw_prompt, remembering; - char *search_expr; - mus_long_t marking; - int search_count, amp_count; /* search_count = number of times to search before return, amp_count = amp env samps if not 1 (= full dur) */ - sp_filing_t filing; - char *filing_filename; - bool prompting, loading, finding_mark, selectioning; - printing_t printing; - mus_long_t macro_count; - minibuffer_choice_t minibuffer_on; + Xen properties; + int properties_loc; + bool remembering; read_only_t user_read_only, file_read_only; chan_info **chans; @@ -403,16 +387,13 @@ typedef struct snd_info { int num_progress_widgets; Widget tab; Widget dialog; - Dimension minibuffer_height; - bool minibuffer_watcher; + int bomb_ctr; #endif #if USE_GTK GtkWidget **snd_widgets; GtkAdjustment **snd_adjs; GtkWidget *dialog; int page; - bool mini_active; - gulong minibuffer_watcher; graphics_context *name_pix_ax, *stop_pix_ax, *speed_arrow_ax, *filter_ax; graphics_context **clock_pix_ax; GtkWidget **clock_widgets; @@ -423,28 +404,23 @@ typedef struct snd_info { #endif file_info *hdr; /* header of file that would be affected if we were to save current edits */ - int bomb_ctr; time_t write_date, update_warning_write_date; /* check for change behind back while editing */ bool need_update, file_unreadable; /* current in-core data does not match actual file (someone wrote it behind our back) */ channel_style_t channel_style; int allocated_chans, selectpos; struct region *edited_region; - struct dialog_play_info *delete_me; + void *delete_me; chan_info *lacp; struct ctrl_state *saved_controls; bool apply_ok, applying; - struct mini_history *minibuffer_history, *filter_history; bool active; char *name_string; - fam_info *file_watcher; + void *file_watcher; bool writing, bomb_in_progress; -#if HAVE_PTHREADS - mus_lock_t *starred_name_lock, *stop_sign_lock, *edit_history_lock; -#endif } snd_info; -#define SND_SRATE(Sp) (((Sp)->hdr)->srate) -#define HAS_WIDGETS(Sp) ((Sp) && ((Sp)->snd_widgets)) +#define snd_srate(Sp) (((Sp)->hdr)->srate) +#define has_widgets(Sp) ((Sp) && ((Sp)->snd_widgets)) typedef struct snd_state { int selected_sound; /* NO_SELECTION = none selected = which sound is currently receiving user's attention */ @@ -452,10 +428,9 @@ typedef struct snd_state { int channel_min_height; snd_info **sounds; char *search_expr, *startup_title, *startup_errors; - struct ptree *search_tree; - XEN search_proc; + Xen search_proc; int file_sorters_size, file_filters_size; - XEN file_sorters, file_filters; + Xen file_sorters, file_filters; int search_proc_loc, local_errno, local_open_errno; int position_slider_width, zoom_slider_width, toggle_size, channel_sash_indent, sash_size, channel_sash_size, sash_indent; int max_sounds, sound_sync_max; @@ -468,6 +443,7 @@ typedef struct snd_state { int init_window_width, init_window_height; int init_window_x, init_window_y; bool graph_hook_active, lisp_graph_hook_active; + bool Show_Transform_Peaks, Show_Y_Zero, Show_Marks; with_grid_t Show_Grid; bool Fft_Log_Frequency, Fft_Log_Magnitude, Fft_With_Phases; @@ -478,19 +454,21 @@ typedef struct snd_state { char *Eps_File, *Temp_Dir, *Save_Dir, *Ladspa_Dir, *Peak_Env_Dir; char *Listener_Font, *Axis_Label_Font, *Axis_Numbers_Font, *Tiny_Font, *Peaks_Font, *Bold_Peaks_Font; char *orig_listener_font, *orig_axis_label_font, *orig_axis_numbers_font, *orig_tiny_font, *orig_peaks_font, *orig_bold_peaks_font; - bool Verbose_Cursor, Trap_Segfault, With_Inset_Graph, With_Pointer_Focus, With_Smpte_Label; + bool With_Verbose_Cursor, With_Inset_Graph, With_Pointer_Focus, With_Smpte_Label, With_Interrupts; int Enved_Filter_Order; mus_float_t Eps_Left_Margin, Eps_Bottom_Margin, Eps_Size, Log_Freq_Start; mus_float_t Spectro_X_Scale, Spectro_Y_Scale, Spectro_Z_Scale, Spectro_Z_Angle, Spectro_X_Angle, Spectro_Y_Angle; mus_float_t Spectrum_End, Spectrum_Start; - int Default_Output_Header_Type, Default_Output_Data_Format, Default_Output_Chans, Default_Output_Srate; - int Spectro_Hop, Color_Map, Color_Map_Size, Wavelet_Type, Transform_Type, Optimization; + mus_header_t Default_Output_Header_Type; + mus_sample_t Default_Output_Sample_Type; + int Default_Output_Chans, Default_Output_Srate; + int Spectro_Hop, Color_Map, Color_Map_Size, Wavelet_Type, Transform_Type; int Dot_Size; int Zero_Pad, Wavo_Hop, Wavo_Trace; mus_long_t Transform_Size; mus_fft_window_t Fft_Window; graph_type_t Transform_Graph_Type, Time_Graph_Type; - bool Ask_Before_Overwrite, Ask_About_Unsaved_Edits, Show_Full_Duration, Remember_Sound_State; + bool Ask_Before_Overwrite, Ask_About_Unsaved_Edits, Show_Full_Duration, Show_Full_Range, Remember_Sound_State; bool Save_As_Dialog_Src, Save_As_Dialog_Auto_Comment, With_Toolbar, With_Tooltips, With_Menu_Icons; mus_float_t Fft_Window_Alpha, Fft_Window_Beta, Grid_Density, Initial_Beg, Initial_Dur; mus_float_t Color_Scale, Color_Cutoff, Beats_Per_Minute; @@ -503,15 +481,14 @@ typedef struct snd_state { graph_style_t Graph_Style, Region_Graph_Style; bool Auto_Resize, Auto_Update; int Max_Regions, Max_Transform_Peaks; - int Audio_Output_Device, Audio_Input_Device; - bool Show_Backtrace, With_GL, With_Relative_Panes; + bool With_GL, With_Relative_Panes; int Print_Length, Dac_Size, View_Files_Sort; bool Dac_Combines_Channels, Show_Selection_Transform, With_Mix_Tags, Selection_Creates_Region; char *Save_State_File, *Listener_Prompt; mus_float_t Enved_Base, Enved_Power, Auto_Update_Interval; - bool Enved_Wave_p, Graphs_Horizontal, With_Background_Processes, With_File_Monitor; + bool Enved_With_Wave, Graphs_Horizontal, With_Background_Processes, With_File_Monitor; env_type_t Enved_Style; - int Graph_Cursor, Mix_Tag_Width, Mix_Tag_Height, Mark_Tag_Height, Mark_Tag_Width, Minibuffer_History_Length; + int Graph_Cursor, Mix_Tag_Width, Mix_Tag_Height, Mark_Tag_Height, Mark_Tag_Width; enved_target_t Enved_Target; bool Clipping, Show_Indices, Just_Sounds; int Cursor_Size; @@ -530,13 +507,77 @@ typedef struct snd_state { mus_float_t Min_dB; bool Show_Controls; tracking_cursor_t With_Tracking_Cursor; + char *HTML_Dir, *HTML_Program, *Open_File_Dialog_Directory; + +#if HAVE_SCHEME + s7_pointer show_transform_peaks_symbol, show_y_zero_symbol, show_marks_symbol, + show_grid_symbol, + fft_log_frequency_symbol, fft_log_magnitude_symbol, fft_with_phases_symbol, + channel_style_symbol, + sync_style_symbol, + show_axes_symbol, + eps_file_symbol, temp_dir_symbol, save_dir_symbol, ladspa_dir_symbol, peak_env_dir_symbol, + listener_font_symbol, axis_label_font_symbol, axis_numbers_font_symbol, tiny_font_symbol, peaks_font_symbol, bold_peaks_font_symbol, + with_verbose_cursor_symbol, with_inset_graph_symbol, with_pointer_focus_symbol, with_smpte_label_symbol, with_interrupts_symbol, + enved_filter_order_symbol, + eps_left_margin_symbol, eps_bottom_margin_symbol, eps_size_symbol, log_freq_start_symbol, + spectro_x_scale_symbol, spectro_y_scale_symbol, spectro_z_scale_symbol, spectro_z_angle_symbol, spectro_x_angle_symbol, spectro_y_angle_symbol, + spectrum_end_symbol, spectrum_start_symbol, + default_output_header_type_symbol, default_output_sample_type_symbol, default_output_chans_symbol, default_output_srate_symbol, + spectro_hop_symbol, color_map_symbol, color_map_size_symbol, wavelet_type_symbol, transform_type_symbol, + dot_size_symbol, + zero_pad_symbol, wavo_hop_symbol, wavo_trace_symbol, + transform_size_symbol, + fft_window_symbol, + transform_graph_type_symbol, time_graph_type_symbol, + ask_before_overwrite_symbol, ask_about_unsaved_edits_symbol, show_full_duration_symbol, show_full_range_symbol, remember_sound_state_symbol, + save_as_dialog_src_symbol, save_as_dialog_auto_comment_symbol, with_toolbar_symbol, with_tooltips_symbol, with_menu_icons_symbol, + fft_window_alpha_symbol, fft_window_beta_symbol, grid_density_symbol, initial_beg_symbol, initial_dur_symbol, + color_scale_symbol, color_cutoff_symbol, beats_per_minute_symbol, + color_inverted_symbol, show_mix_waveforms_symbol, + mix_waveform_height_symbol, beats_per_measure_symbol, + transform_normalization_symbol, + sinc_width_symbol, + x_axis_style_symbol, + zoom_focus_style_symbol, + graph_style_symbol, region_graph_style_symbol, + auto_resize_symbol, auto_update_symbol, + max_regions_symbol, max_transform_peaks_symbol, + with_gl_symbol, with_relative_panes_symbol, + print_length_symbol, dac_size_symbol, view_files_sort_symbol, + dac_combines_channels_symbol, show_selection_transform_symbol, with_mix_tags_symbol, selection_creates_region_symbol, + save_state_file_symbol, listener_prompt_symbol, + enved_base_symbol, enved_power_symbol, auto_update_interval_symbol, + enved_with_wave_symbol, graphs_horizontal_symbol, with_background_processes_symbol, with_file_monitor_symbol, + enved_style_symbol, + graph_cursor_symbol, mix_tag_width_symbol, mix_tag_height_symbol, mark_tag_height_symbol, mark_tag_width_symbol, + enved_target_symbol, + clipping_symbol, show_indices_symbol, just_sounds_symbol, + cursor_size_symbol, + cursor_style_symbol, tracking_cursor_style_symbol, + filter_control_in_db_symbol, filter_control_in_hz_symbol, show_sonogram_cursor_symbol, + speed_control_tones_symbol, + speed_control_style_symbol, + expand_control_length_symbol, expand_control_ramp_symbol, expand_control_hop_symbol, expand_control_jitter_symbol, + contrast_control_amp_symbol, + reverb_control_feedback_symbol, reverb_control_lowpass_symbol, + reverb_control_decay_symbol, cursor_update_interval_symbol, + filter_control_order_symbol, cursor_location_offset_symbol, play_arrow_size_symbol, + min_db_symbol, + show_controls_symbol, + with_tracking_cursor_symbol, +#if USE_GTK + listener_colorized_symbol, +#endif + html_dir_symbol, html_program_symbol, open_file_dialog_directory_symbol; +#endif + bool tracking; - XEN cursor_proc; + Xen cursor_proc; int cursor_proc_loc, listener_prompt_length; - XEN zoom_focus_proc; + Xen zoom_focus_proc; int zoom_focus_proc_loc; mus_float_t lin_dB; - char *HTML_Dir, *HTML_Program, *Open_File_Dialog_Directory; char *io_error_info; int deferred_regions; open_requestor_t open_requestor; @@ -545,8 +586,7 @@ typedef struct snd_state { bool jump_ok, exiting; env_editor *enved; oclock_t click_time; - bool fam_ok, cg_seen, C_g_typed; - FAMConnection *fam_connection; + bool file_monitor_ok, C_g_typed, squelch_mark_drag_info; void (*snd_error_handler)(const char *error_msg, void *data); void *snd_error_data; void (*snd_warning_handler)(const char *warning_msg, void *data); @@ -559,12 +599,11 @@ typedef struct snd_state { #if HAVE_GL && WITH_GL2PS bool gl_printing; #endif - XEN mus_error_hook; - XEN snd_error_hook; - XEN snd_warning_hook; - XEN snd_open_file_hook; - XEN snd_selection_hook; - XEN effects_hook; + Xen mus_error_hook; + Xen snd_error_hook; + Xen snd_warning_hook; + Xen snd_open_file_hook; + Xen effects_hook; #if USE_MOTIF XtAppContext mainapp; @@ -585,7 +624,7 @@ typedef struct snd_state { xm_font_t tiny_fontlist; XFontStruct *tiny_fontstruct; - Pixel white, black, red, yellow, green, light_blue, lighter_blue; + Pixel white, black, red, yellow, green, blue, light_blue, lighter_blue; Pixel data_color, selected_data_color, mark_color, graph_color, selected_graph_color, listener_color, listener_text_color; Pixel basic_color, selection_color, zoom_color, position_color, highlight_color, enved_waveform_color, cursor_color; Pixel text_focus_color, filter_control_waveform_color, mix_color, sash_color; @@ -604,18 +643,20 @@ typedef struct snd_state { Widget listener_pane; Widget *dialogs; int num_dialogs, dialogs_size; - Cursor graph_cursor, wait_cursor, bounds_cursor, play_cursor, loop_play_cursor; + Cursor graph_cursor, wait_cursor, bounds_cursor, play_cursor, loop_play_cursor, yaxis_cursor; Widget requestor_dialog; #if HAVE_GL +#if USE_MOTIF GLXContext cx; #endif - XtInputId fam_port; +#endif Widget *mw; bool axis_color_set; #endif #if USE_GTK cairo_t *cr; + double line_width; GtkWidget *mainshell; GtkWidget *mainpane; GtkWidget *soundpane; @@ -630,7 +671,7 @@ typedef struct snd_state { PangoFontDescription *peaks_fnt; PangoFontDescription *bold_peaks_fnt; - color_info *white, *black, *red, *yellow, *green, *light_blue, *lighter_blue; + color_info *white, *black, *red, *yellow, *green, *blue, *light_blue, *lighter_blue; color_info *data_color, *selected_data_color, *mark_color, *graph_color, *selected_graph_color, *listener_color, *listener_text_color, *cursor_color; color_info *basic_color, *selection_color, *zoom_color, *position_color, *highlight_color, *enved_waveform_color; color_info *text_focus_color, *filter_control_waveform_color, *mix_color, *sash_color; @@ -653,15 +694,16 @@ typedef struct snd_state { GtkWidget *requestor_dialog; mus_float_t bg_gradient; - GdkCursor *arrow_cursor, *wait_cursor, *graph_cursor, *bounds_cursor, *play_cursor, *loop_play_cursor; - gint fam_port; + GdkCursor *arrow_cursor, *wait_cursor, *graph_cursor, *bounds_cursor, *play_cursor, *loop_play_cursor, *yaxis_cursor; GtkWidget **mw; bool axis_color_set; + + glistener *listener; #endif #if USE_NO_GUI int data_color, selected_data_color, mix_color, basic_color, grid_color, selected_grid_color, mark_color, axis_color; - int white, black, red, yellow, green, light_blue; + int white, black, red, yellow, green, blue, light_blue; int fltenv_basic_gc, fltenv_data_gc; int basic_gc, selected_basic_gc, combined_basic_gc; int cursor_gc, selected_cursor_gc; @@ -669,12 +711,19 @@ typedef struct snd_state { int erase_gc, selected_erase_gc; int mark_gc, selected_mark_gc; int mix_gc; - struct dialog_play_info *ignore_me; /* for the compiler's benefit */ + void *ignore_me; int requestor_dialog; bool axis_color_set; - int bounds_cursor, graph_cursor, play_cursor, loop_play_cursor; + int bounds_cursor, graph_cursor, play_cursor, loop_play_cursor, yaxis_cursor; +#endif +#if HAVE_SCHEME + s7_pointer data_color_symbol, selected_data_color_symbol, mark_color_symbol, graph_color_symbol, + selected_graph_color_symbol, listener_color_symbol, listener_text_color_symbol, + basic_color_symbol, selection_color_symbol, zoom_color_symbol, position_color_symbol, + highlight_color_symbol, enved_waveform_color_symbol, cursor_color_symbol, + text_focus_color_symbol, filter_control_waveform_color_symbol, mix_color_symbol, + sash_color_symbol, axis_color_symbol; #endif - } snd_state; extern snd_state *ss; @@ -711,9 +760,10 @@ io_error_t move_file(const char *oldfile, const char *newfile); int snd_open_read(const char *arg); int snd_reopen_write(const char *arg); -io_error_t snd_write_header(const char *name, int type, int srate, int chans, mus_long_t samples, int format, const char *comment, int *loops); +io_error_t snd_write_header(const char *name, mus_header_t type, int srate, int chans, mus_long_t samples, + mus_sample_t sample_type, const char *comment, int *loops); io_error_t sndlib_error_to_snd(int sndlib_err); -int snd_file_open_descriptors(int tfd, const char *name, int format, mus_long_t location, int chans, int type); +int snd_file_open_descriptors(int tfd, const char *name, mus_sample_t sample_type, mus_long_t location, int chans, mus_header_t type); snd_io *make_file_state(int fd, file_info *hdr, int chan, mus_long_t beg, int suggested_bufsize); void file_buffers_forward(mus_long_t ind0, mus_long_t ind1, mus_long_t indx, snd_fd *sf, snd_data *cur_snd); void file_buffers_back(mus_long_t ind0, mus_long_t ind1, mus_long_t indx, snd_fd *sf, snd_data *cur_snd); @@ -725,15 +775,14 @@ void forget_temps(void); snd_data *make_snd_data_file(const char *name, snd_io *io, file_info *hdr, file_delete_t temp, int ctr, int temp_chan); snd_data *copy_snd_data(snd_data *sd, mus_long_t beg, int bufsize); snd_data *free_snd_data(snd_data *sf); -snd_data *make_snd_data_buffer(mus_sample_t *data, int len, int ctr); +snd_data *make_snd_data_buffer(mus_float_t *data, int len, int ctr); snd_data *make_snd_data_buffer_for_simple_channel(int len); int open_temp_file(const char *ofile, int chans, file_info *hdr, io_error_t *err); -io_error_t close_temp_file(const char *filename, int ofd, int type, mus_long_t bytes); +io_error_t close_temp_file(const char *filename, int ofd, mus_header_t type, mus_long_t bytes); void set_up_snd_io(chan_info *cp, int i, int fd, const char *filename, file_info *hdr, bool post_close); mus_long_t io_beg(snd_io *io); mus_long_t io_end(snd_io *io); -int io_filed(snd_io *io); /* io_fd is in use already */ @@ -751,7 +800,6 @@ void marks_help(void); void mix_help(void); void sound_files_help(void); void init_file_help(void); -void recording_help(void); void region_help(void); void selection_help(void); void colors_help(void); @@ -773,11 +821,11 @@ void insert_file_dialog_help(void); void save_as_dialog_help(void); char* word_wrap(const char *text, int widget_len); void g_init_help(void); -XEN g_snd_help_with_search(XEN text, int widget_wid, bool search); -XEN g_snd_help(XEN text, int widget_wid); +Xen g_snd_help_with_search(Xen text, int widget_wid, bool search); +Xen g_snd_help(Xen text, int widget_wid); const char *snd_url(const char *name); void set_html_dir(char *new_dir); -void key_binding_help(void); +void key_help(void); void play_help(void); void save_help(void); void reverb_help(void); @@ -815,29 +863,6 @@ int handle_next_startup_arg(int auto_open_ctr, char **auto_open_file_names, bool void g_init_main(void); -/* --------- snd-error.c -------- */ - -const char *io_error_name(io_error_t err); -#ifdef __GNUC__ - void snd_error(const char *format, ...) __attribute__ ((format (printf, 1, 2))); - void snd_warning(const char *format, ...) __attribute__ ((format (printf, 1, 2))); -#else - void snd_error(const char *format, ...); - void snd_warning(const char *format, ...); -#endif -void snd_error_without_format(const char *msg); -void snd_warning_without_format(const char *msg); -bool run_snd_error_hook(const char *msg); -void g_init_errors(void); - -#ifdef SND_AS_WIDGET - void set_error_display(void (*func)(const char *msg)); -#endif -void redirect_snd_error_to(void (*handler)(const char *error_msg, void *ufd), void *data); -void redirect_snd_warning_to(void (*handler)(const char *warning_msg, void *ufd), void *data); - - - /* -------- snd-completion.c -------- */ char *expression_completer(widget_t w, const char *text, void *data); @@ -859,11 +884,12 @@ char *filename_completer(widget_t w, const char *text, void *data); char *sound_filename_completer(widget_t w, const char *text, void *data); char *srate_completer(widget_t w, const char *text, void *data); char *list_completer(widget_t w, const char *text, void *data); -char *info_completer(widget_t w, const char *text, void *data); char *complete_listener_text(char *old_text, int end, bool *try_completion, char **to_file_text); -bool separator_char_p(char c); void add_srate_to_completion_list(int srate); char *direct_completions(const char *str); +#if HAVE_FORTH || HAVE_RUBY + void call_read_hook_or_eval(const char *text); +#endif @@ -911,7 +937,6 @@ mark *add_mark(mus_long_t samp, const char *name, chan_info *cp); bool delete_mark_samp(mus_long_t samp, chan_info *cp); void free_mark_list(ed_list *ed); bool goto_mark(chan_info *cp, int count); -void goto_named_mark(chan_info *cp, const char *name); mark *active_mark(chan_info *cp); mus_long_t mark_beg(chan_info *cp); void display_channel_marks(chan_info *cp); @@ -928,13 +953,12 @@ void *sound_store_marks(snd_info *sp); void sound_restore_marks(snd_info *sp, void *marks); mus_long_t mark_id_to_sample(int id); -XEN new_xen_mark(int n); -bool xen_mark_p(XEN obj); -#define XEN_MARK_P(arg) xen_mark_p(arg) -int xen_mark_to_int(XEN n); -#define XEN_MARK_TO_C_INT(n) xen_mark_to_int(n) -XEN g_mark_sync(XEN mark_n); -XEN g_set_mark_sync(XEN mark_n, XEN sync_n); +Xen new_xen_mark(int n); +bool xen_is_mark(Xen obj); +int xen_mark_to_int(Xen n); +#define Xen_mark_to_C_int(n) xen_mark_to_int(n) +Xen g_mark_sync(Xen mark_n); +Xen g_set_mark_sync(Xen mark_n, Xen sync_n); @@ -963,6 +987,7 @@ void for_each_separate_chan(void (*func)(chan_info *ncp)); bool map_over_sound_chans(snd_info *sp, bool (*func)(chan_info *ncp)); bool snd_ok(snd_info *sp); int active_channels(virtual_channels_t count_virtual_channels); +int syncd_channels(int sync); int find_free_sound_slot(int desired_chans); int find_free_sound_slot_for_channel_display(void); snd_info *selected_sound(void); @@ -977,7 +1002,6 @@ sync_info *snd_sync(int sync); sync_info *sync_to_chan(chan_info *cp); sync_info *make_simple_sync(chan_info *cp, mus_long_t beg); snd_info *find_sound(const char *name, int nth); -void display_info(snd_info *sp); void mix_display_during_drag(int mix_id, mus_long_t drag_beg, mus_long_t drag_end); void g_init_data(void); @@ -985,6 +1009,9 @@ void g_init_data(void); /* -------- snd-edits.c -------- */ +mus_float_t channel_maxamp(chan_info *cp, int edpos); +mus_long_t channel_maxamp_position(chan_info *cp, int edpos); +mus_float_t channel_maxamp_and_position(chan_info *cp, int edpos, mus_long_t *maxpos); ed_list *initial_ed_list(mus_long_t beg, mus_long_t end); snd_info *sound_is_silence(snd_info *sp); mus_long_t edit_changes_begin_at(chan_info *cp, int edpos); @@ -997,56 +1024,52 @@ void free_edit_list(chan_info *cp); void backup_edit_list(chan_info *cp); void as_one_edit(chan_info *cp, int one_edit); void free_sound_list(chan_info *cp); -void free_ptree_list(chan_info *cp); void after_edit(chan_info *cp); bool extend_with_zeros(chan_info *cp, mus_long_t beg, mus_long_t num, int edpos, const char *origin); -bool insert_samples(mus_long_t beg, mus_long_t num, mus_sample_t *vals, chan_info *cp, const char *origin, int edpos); +bool insert_samples(mus_long_t beg, mus_long_t num, mus_float_t *vals, chan_info *cp, const char *origin, int edpos); bool file_insert_samples(mus_long_t beg, mus_long_t num, const char *tempfile, chan_info *cp, int chan, file_delete_t auto_delete, const char *origin, int edpos); bool insert_complete_file_at_cursor(snd_info *sp, const char *filename); bool insert_complete_file(snd_info *sp, const char *str, mus_long_t chan_beg, file_delete_t auto_delete); bool delete_samples(mus_long_t beg, mus_long_t num, chan_info *cp, int edpos); -bool change_samples(mus_long_t beg, mus_long_t num, mus_sample_t *vals, chan_info *cp, const char *origin, int edpos); +bool change_samples(mus_long_t beg, mus_long_t num, mus_float_t *vals, chan_info *cp, const char *origin, int edpos, mus_float_t mx); bool file_change_samples(mus_long_t beg, mus_long_t num, const char *tempfile, chan_info *cp, int chan, file_delete_t auto_delete, const char *origin, int edpos); bool file_override_samples(mus_long_t num, const char *tempfile, chan_info *cp, int chan, file_delete_t auto_delete, const char *origin); mus_float_t chn_sample(mus_long_t samp, chan_info *cp, int pos); -void check_saved_temp_file(const char *type, XEN filename, XEN date_and_length); -bool editable_p(chan_info *cp); -file_delete_t xen_to_file_delete_t(XEN auto_delete, const char *caller); +void check_saved_temp_file(const char *type, Xen filename, Xen date_and_length); +bool is_editable(chan_info *cp); +file_delete_t xen_to_file_delete_t(Xen auto_delete, const char *caller); snd_fd *free_snd_fd(snd_fd *sf); char *sampler_to_string(snd_fd *fd); -bool sampler_p(XEN obj); -snd_fd *xen_to_sampler(XEN obj); +bool is_sampler(Xen obj); +snd_fd *xen_to_sampler(Xen obj); snd_fd *free_snd_fd_almost(snd_fd *sf); bool scale_channel(chan_info *cp, mus_float_t scaler, mus_long_t beg, mus_long_t num, int pos, bool in_as_one_edit); bool scale_channel_with_origin(chan_info *cp, mus_float_t scl, mus_long_t beg, mus_long_t num, int pos, bool in_as_one_edit, const char *origin); bool ramp_channel(chan_info *cp, double start, double incr, mus_long_t beg, mus_long_t num, int pos, bool in_as_one_edit); bool xramp_channel(chan_info *cp, double start, double incr, double scaler, double offset, mus_long_t beg, mus_long_t num, int pos, bool in_as_one_edit, mus_any *e, int xramp_seg_loc); -void ptree_channel(chan_info *cp, struct ptree *tree, mus_long_t beg, mus_long_t num, int pos, bool env_it, XEN init_func, const char *origin); snd_fd *init_sample_read(mus_long_t samp, chan_info *cp, read_direction_t direction); snd_fd *init_sample_read_any(mus_long_t samp, chan_info *cp, read_direction_t direction, int edit_position); snd_fd *init_sample_read_any_with_bufsize(mus_long_t samp, chan_info *cp, read_direction_t direction, int edit_position, int bufsize); void read_sample_change_direction(snd_fd *sf, read_direction_t dir); +void sampler_set_safe(snd_fd *sf, mus_long_t dur); bool unrampable(chan_info *cp, mus_long_t beg, mus_long_t dur, int pos, bool is_xramp); -bool ptree_or_sound_fragments_in_use(chan_info *cp, int pos); -bool unptreeable(chan_info *cp, mus_long_t beg, mus_long_t dur, int pos); -#define read_sample_to_mus_sample(Sf) MUS_FLOAT_TO_SAMPLE((*((Sf)->runf))(Sf)) +bool sound_fragments_in_use(chan_info *cp, int pos); #define read_sample(Sf) (*((Sf)->runf))(Sf) -mus_float_t protected_next_sample(snd_fd *sf); -mus_float_t protected_previous_sample(snd_fd *sf); mus_float_t channel_local_maxamp(chan_info *cp, mus_long_t beg, mus_long_t num, int edpos, mus_long_t *maxpos); bool undo_edit_with_sync(chan_info *cp, int count); bool redo_edit_with_sync(chan_info *cp, int count); bool undo_edit(chan_info *cp, int count); bool redo_edit(chan_info *cp, int count); io_error_t save_channel_edits(chan_info *cp, const char *ofile, int pos); -io_error_t channel_to_file_with_settings(chan_info *cp, const char *new_name, int type, int format, int srate, const char *comment, int pos); +io_error_t channel_to_file_with_settings(chan_info *cp, const char *new_name, int srate, + mus_sample_t samp_type, mus_header_t hd_type, const char *comment, int pos); io_error_t save_edits(snd_info *sp); io_error_t save_edits_without_asking(snd_info *sp); -void save_edits_with_prompt(snd_info *sp); io_error_t save_edits_and_update_display(snd_info *sp); -io_error_t save_edits_without_display(snd_info *sp, const char *new_name, int type, int format, int srate, const char *comment, int pos); +io_error_t save_edits_without_display(snd_info *sp, const char *new_name, mus_header_t type, + mus_sample_t sample_type, int srate, const char *comment, int pos); void revert_edits(chan_info *cp); mus_long_t current_location(snd_fd *sf); void g_init_edits(void); @@ -1061,10 +1084,7 @@ mus_long_t ed_selection_maxamp_position(chan_info *cp); void copy_then_swap_channels(chan_info *cp0, chan_info *cp1, int pos0, int pos1); void reflect_file_change_in_label(chan_info *cp); void reflect_file_change_in_title(void); - -bool snd_to_sample_p(mus_any *ptr); -mus_float_t snd_to_sample_read(mus_any *ptr, mus_long_t frame, int chan); -int mix_buffer_with_tag(chan_info *cp, mus_sample_t *data, mus_long_t beg, mus_long_t num, const char *origin); +int mix_buffer_with_tag(chan_info *cp, mus_float_t *data, mus_long_t beg, mus_long_t num, const char *origin); int mix_file_with_tag(chan_info *cp, const char *filename, int chan, mus_long_t beg, file_delete_t auto_delete, const char *origin); void unmix(chan_info *cp, mix_state *ms); @@ -1074,10 +1094,10 @@ bool virtual_mix_ok(chan_info *cp, int edpos); bool begin_mix_op(chan_info *cp, mus_long_t old_beg, mus_long_t old_len, mus_long_t new_beg, mus_long_t new_len, int edpos, const char *caller); void end_mix_op(chan_info *cp, mus_long_t old_beg, mus_long_t old_len); void prepare_sound_list(chan_info *cp); -XEN g_sampler_file_name(XEN obj); - -vct *run_samples_to_vct(mus_long_t beg, mus_long_t len, chan_info *cp, int pos); +Xen g_sampler_file_name(Xen obj); char *edit_list_to_function(chan_info *cp, int start_pos, int end_pos); +vct *samples_to_vct(mus_long_t beg, mus_long_t len, chan_info *cp, int pos, mus_float_t *buf, snd_fd *reader); +vct *samples_to_vct_with_reader(mus_long_t len, mus_float_t *buf, snd_fd *reader); @@ -1112,47 +1132,57 @@ int transform_position_to_type(int pos); int transform_type_to_position(int type); int max_transform_type(void); void set_transform_position(int i, int j); -bool transform_p(int type); +bool is_transform(int type); -XEN new_xen_transform(int n); -bool xen_transform_p(XEN obj); -int xen_transform_to_int(XEN n); -#define XEN_TRANSFORM_P(arg) xen_transform_p(arg) -#define C_INT_TO_XEN_TRANSFORM(Val) new_xen_transform(Val) -#define XEN_TRANSFORM_TO_C_INT(n) xen_transform_to_int(n) +Xen new_xen_transform(int n); +bool xen_is_transform(Xen obj); +int xen_transform_to_int(Xen n); +#define C_int_to_Xen_transform(Val) new_xen_transform(Val) +#define Xen_transform_to_C_int(n) xen_transform_to_int(n) /* -------- snd-xen.c -------- */ +const char *io_error_name(io_error_t err); +#ifdef __GNUC__ + void snd_error(const char *format, ...) __attribute__ ((format (printf, 1, 2))); + void snd_warning(const char *format, ...) __attribute__ ((format (printf, 1, 2))); +#else + void snd_error(const char *format, ...); + void snd_warning(const char *format, ...); +#endif +void snd_error_without_format(const char *msg); +void snd_warning_without_format(const char *msg); +void redirect_snd_error_to(void (*handler)(const char *error_msg, void *ufd), void *data); +void redirect_snd_warning_to(void (*handler)(const char *warning_msg, void *ufd), void *data); + +char *stdin_check_for_full_expression(const char *newstr); +void stdin_free_str(void); + void redirect_xen_error_to(void (*handler)(const char *msg, void *ufd), void *data); -void redirect_snd_print_to(void (*handler)(const char *msg, void *ufd), void *data); void redirect_errors_to(void (*handler)(const char *msg, void *ufd), void *data); void redirect_everything_to(void (*handler)(const char *msg, void *ufd), void *data); -XEN snd_catch_any(XEN_CATCH_BODY_TYPE body, void *body_data, const char *caller); -XEN snd_throw(XEN key, XEN args); -XEN snd_no_such_file_error(const char *caller, XEN filename); -XEN snd_no_such_channel_error(const char *caller, XEN snd, XEN chn); -XEN snd_bad_arity_error(const char *caller, XEN errstr, XEN proc); -XEN snd_no_active_selection_error(const char *caller); +Xen snd_catch_any(Xen_catch_t body, void *body_data, const char *caller); +Xen snd_throw(Xen key, Xen args); +Xen snd_no_such_file_error(const char *caller, Xen filename); +Xen snd_no_such_channel_error(const char *caller, Xen snd, Xen chn); +Xen snd_bad_arity_error(const char *caller, Xen errstr, Xen proc); +Xen snd_no_active_selection_error(const char *caller); void g_xen_initialize(void); -XEN eval_str_wrapper(void *data); -XEN eval_form_wrapper(void *data); -XEN string_to_form(const char *data); -XEN g_c_make_sampler(snd_fd *fd); -char *procedure_ok(XEN proc, int args, const char *caller, const char *arg_name, int argn); -bool procedure_arity_ok(XEN proc, int args); -int snd_protect(XEN obj); +Xen eval_str_wrapper(void *data); +Xen g_c_make_sampler(snd_fd *fd); +char *procedure_ok(Xen proc, int args, const char *caller, const char *arg_name, int argn); +bool procedure_arity_ok(Xen proc, int args); +int snd_protect(Xen obj); void snd_unprotect_at(int loc); -XEN snd_protected_at(int loc); -XEN run_or_hook(XEN hook, XEN args, const char *caller); -XEN run_progn_hook(XEN hook, XEN args, const char *caller); -XEN run_hook(XEN hook, XEN args, const char *caller); -bool listener_print_p(const char *msg); +Xen run_or_hook(Xen hook, Xen args, const char *caller); +Xen run_progn_hook(Xen hook, Xen args, const char *caller); +Xen run_hook(Xen hook, Xen args, const char *caller); void check_features_list(const char *features); #if (!USE_NO_GUI) - mus_float_t check_color_range(const char *caller, XEN val); + mus_float_t check_color_range(const char *caller, Xen val); #endif void set_basic_color(color_t color); void set_highlight_color(color_t color); @@ -1169,14 +1199,14 @@ char *output_comment(file_info *hdr); void snd_load_init_file(bool nog, bool noi); void snd_load_file(const char *filename); void snd_display_result(const char *str, const char *endstr); -void snd_report_result(XEN result, const char *buf); -void snd_report_listener_result(XEN form); +void snd_report_result(Xen result, const char *buf); +void snd_report_listener_result(Xen form); void snd_eval_stdin_str(const char *buf); void clear_stdin(void); #if HAVE_RUBY - void snd_rb_raise(XEN type, XEN info); + void snd_rb_raise(Xen type, Xen info); #endif -bool source_file_p(const char *name); +bool is_source_file(const char *name); void save_added_source_file_extensions(FILE *fd); @@ -1209,19 +1239,17 @@ bool delete_selection(cut_selection_regraph_t regraph); void move_selection(chan_info *cp, int x); void finish_selection_creation(void); int select_all(chan_info *cp); -io_error_t save_selection(const char *ofile, int type, int format, int srate, const char *comment, int chan); +io_error_t save_selection(const char *ofile, int srate, mus_sample_t samp_type, mus_header_t head_type, const char *comment, int chan); bool selection_creation_in_progress(void); void add_selection_or_region(int reg, chan_info *cp); void insert_selection_from_menu(void); -void insert_selection_or_region(int reg, chan_info *cp); void cancel_selection_watch(void); void show_selection(void); -bool xen_selection_p(XEN obj); -#define XEN_SELECTION_P(arg) xen_selection_p(arg) -XEN g_selection_chans(void); -XEN g_selection_srate(void); -XEN g_selection_maxamp(XEN snd, XEN chn); -XEN g_selection_frames(XEN snd, XEN chn); +bool xen_is_selection(Xen obj); +Xen g_selection_chans(void); +Xen g_selection_srate(void); +Xen g_selection_maxamp(Xen snd, Xen chn); +Xen g_selection_framples(Xen snd, Xen chn); void g_init_selection(void); @@ -1248,7 +1276,7 @@ snd_fd *init_region_read(mus_long_t beg, int n, int chan, read_direction_t direc void cleanup_region_temp_files(void); int snd_regions(void); void save_regions(FILE *fd); -io_error_t save_region(int rg, const char *name, int type, int format, const char *comment); +io_error_t save_region(int rg, const char *name, mus_sample_t samp_type, mus_header_t head_type, const char *comment); void region_edit(int reg); void clear_region_backpointer(snd_info *sp); void save_region_backpointer(snd_info *sp); @@ -1258,17 +1286,17 @@ void for_each_region_chan_with_refint(void (*func)(chan_info *ncp, int *val), in mus_long_t region_current_location(snd_fd *fd); char *region_description(int rg); -XEN new_xen_region(int n); -bool xen_region_p(XEN obj); -int xen_region_to_int(XEN n); -#define XEN_REGION_P(arg) xen_region_p(arg) -#define C_INT_TO_XEN_REGION(Val) new_xen_region(Val) -#define XEN_REGION_TO_C_INT(n) xen_region_to_int(n) -XEN g_region_srate(XEN n); -XEN g_region_chans(XEN n); -XEN g_region_frames(XEN n, XEN chan); -XEN g_region_maxamp(XEN n); -XEN g_play_region(XEN n, play_process_t back, XEN stop_proc); +Xen new_xen_region(int n); +bool xen_is_region(Xen obj); +int xen_region_to_int(Xen n); +#define C_int_to_Xen_region(Val) new_xen_region(Val) +#define Xen_region_to_C_int(n) xen_region_to_int(n) +Xen g_region_srate(Xen n); +Xen g_region_chans(Xen n); +Xen g_region_framples(Xen n, Xen chan); +Xen g_region_maxamp(Xen n); +Xen g_play_region(Xen n, play_process_t back, Xen stop_proc); +Xen g_region_to_vct(Xen reg_n, Xen beg_n, Xen num, Xen chn_n, Xen v); @@ -1279,7 +1307,7 @@ env *free_env(env *e); char *env_to_string(env *e); env *make_envelope_with_offset_and_scaler(mus_float_t *env_buffer, int len, mus_float_t offset, mus_float_t scaler); env *default_env(mus_float_t x1, mus_float_t y); -bool default_env_p(env *e); +bool is_default_env(env *e); bool envs_equal(env *e1, env *e2); env_editor *new_env_editor(void); void env_editor_button_motion_with_xy(env_editor *edp, int evx, int evy, oclock_t motion_time, env *e, mus_float_t *new_x, mus_float_t *new_y); @@ -1300,7 +1328,7 @@ void revert_env_edit(void); int enved_all_envs_top(void); char *enved_all_names(int n); void set_enved_env_list_top(int n); -env *enved_all_envs(int pos); +/* env *enved_all_envs(int pos); */ void alert_envelope_editor(const char *name, env *val); void enved_show_background_waveform(axis_info *ap, axis_info *gray_ap, bool apply_to_selection, bool show_fft, printing_t printing); void save_envelope_editor_state(FILE *fd); @@ -1310,13 +1338,13 @@ env *string_to_env(const char *str); void add_or_edit_symbol(const char *name, env *val); env* name_to_env(const char *str); env *position_to_env(int pos); -void delete_envelope(const char *name); +/* void delete_envelope(const char *name); */ enved_fft *free_enved_fft(enved_fft *ef); void reflect_enved_fft_change(chan_info *cp); -XEN env_to_xen(env *e); -env *xen_to_env(XEN res); -env *get_env(XEN e, const char *origin); +Xen env_to_xen(env *e); +env *xen_to_env(Xen res); +env *get_env(Xen e, const char *origin); void g_init_env(void); @@ -1329,18 +1357,18 @@ void stop_playing_sound_no_toggle(snd_info *sp, play_stop_t reason); void stop_playing_all_sounds(play_stop_t reason); void stop_playing_region(int n, play_stop_t reason); void play_region(int n, play_process_t background); -void play_region_1(int region, play_process_t background, XEN stop_proc); +void play_region_1(int region, play_process_t background, Xen stop_proc); void play_channel(chan_info *cp, mus_long_t start, mus_long_t end); void play_channel_with_sync(chan_info *cp, mus_long_t start, mus_long_t end); void play_sound(snd_info *sp, mus_long_t start, mus_long_t end); void play_channels(chan_info **cps, int chans, mus_long_t *starts, mus_long_t *ur_ends, - play_process_t background, XEN edpos, bool selection, const char *caller, int arg_pos); + play_process_t background, Xen edpos, bool selection, const char *caller, int arg_pos); void play_selection(play_process_t background); void loop_play_selection(void); bool add_mix_to_play_list(mix_state *ms, chan_info *cp, mus_long_t beg_within_mix, bool start_playing); void toggle_dac_pausing(void); /* snd-dac.c */ bool play_in_progress(void); -void initialize_apply(snd_info *sp, int chans, mus_long_t beg, mus_long_t frames); +void initialize_apply(snd_info *sp, int chans, mus_long_t beg, mus_long_t framples); void finalize_apply(snd_info *sp); int run_apply(int ofd); mus_float_t *sample_linear_env(env *e, int order); @@ -1348,11 +1376,10 @@ mus_float_t *sample_linear_env(env *e, int order); void g_init_dac(void); void clear_players(void); -bool xen_player_p(XEN obj); -#define XEN_PLAYER_P(arg) xen_player_p(arg) -#define IS_PLAYER_SOUND(Sp) ((Sp) && ((Sp)->index < 0)) -snd_info *get_player_sound(XEN player); -XEN no_such_player_error(const char *caller, XEN player); +bool xen_is_player(Xen obj); +#define is_player_sound(Sp) ((Sp) && ((Sp)->index < 0)) +snd_info *get_player_sound(Xen player); +Xen no_such_player_error(const char *caller, Xen player); void dac_set_expand(snd_info *sp, mus_float_t newval); void dac_set_expand_length(snd_info *sp, mus_float_t newval); @@ -1366,10 +1393,9 @@ void dac_set_reverb_lowpass(snd_info *sp, mus_float_t newval); /* -------- snd-chn.c -------- */ -bool graph_style_p(int grf); -chan_info *get_cp(XEN snd_n, XEN chn_n, const char *caller); -snd_info *make_simple_channel_display(int srate, int initial_length, fw_button_t with_arrows, - graph_style_t grf_style, widget_t container, bool with_events); +bool is_graph_style(int grf); +chan_info *get_cp(Xen snd_n, Xen chn_n, const char *caller); +snd_info *make_simple_channel_display(int srate, int initial_length, fw_button_t with_arrows, graph_style_t grf_style, widget_t container, bool with_events); axis_info *lisp_info_axis(chan_info *cp); void free_lisp_info(chan_info *cp); void zx_incremented(chan_info *cp, double amount); @@ -1407,26 +1433,25 @@ void update_graph(chan_info *cp); void update_graph_or_warn(chan_info *cp); void make_partial_graph(chan_info *cp, mus_long_t beg, mus_long_t end); void add_channel_data(char *filename, chan_info *cp, channel_graph_t graphed); -void add_channel_data_1(chan_info *cp, int srate, mus_long_t frames, channel_graph_t graphed); +bool add_channel_data_1(chan_info *cp, int srate, mus_long_t framples, channel_graph_t graphed); void set_x_bounds(axis_info *ap); void set_show_axes(show_axes_t val); void display_channel_data(chan_info *cp); void display_channel_fft_data(chan_info *cp); void display_channel_time_data(chan_info *cp); void show_cursor_info(chan_info *cp); -void apply_x_axis_change(axis_info *ap, chan_info *cp); -void apply_y_axis_change(axis_info *ap, chan_info *cp); +void apply_x_axis_change(chan_info *cp); +void apply_y_axis_change(chan_info *cp); void sx_incremented(chan_info *cp, double amount); -int move_axis(chan_info *cp, axis_info *ap, int x); +int move_axis(chan_info *cp, int x); void set_axes(chan_info *cp, double x0, double x1, mus_float_t y0, mus_float_t y1); -void focus_x_axis_change(axis_info *ap, chan_info *cp, int focus_style); -bool key_press_callback(chan_info *ur_cp, int x, int y, int key_state, int keysym); +void focus_x_axis_change(chan_info *cp, int focus_style); +void key_press_callback(chan_info *ur_cp, int x, int y, int key_state, int keysym); void graph_button_press_callback(chan_info *cp, void *ev, int x, int y, int key_state, int button, oclock_t time); void graph_button_release_callback(chan_info *cp, int x, int y, int key_state, int button); void graph_button_motion_callback(chan_info *cp, int x, int y, oclock_t time); void channel_resize(chan_info *cp); void edit_history_select(chan_info *cp, int row); -int make_graph(chan_info *cp); int make_background_graph(chan_info *cp, int srate, bool *two_sided); int make_dragged_marks_graph(chan_info *cp); void reset_spectro(void); @@ -1440,9 +1465,10 @@ void set_show_mix_waveforms(bool val); void clear_inset_graph(chan_info *cp); void free_inset_graph(chan_info *cp); void draw_inset_line_cursor(chan_info *cp, graphics_context *ax); +void make_sonogram(chan_info *cp); void g_init_chn(void); -XEN make_graph_data(chan_info *cp, int edit_pos, mus_long_t losamp, mus_long_t hisamp); +Xen make_graph_data(chan_info *cp, int edit_pos, mus_long_t losamp, mus_long_t hisamp); void draw_graph_data(chan_info *cp, mus_long_t losamp, mus_long_t hisamp, int data_size, mus_float_t *data, mus_float_t *data1, graphics_context *ax, graph_style_t style); void fftb(chan_info *cp, bool on); @@ -1459,12 +1485,12 @@ graphics_context *cursor_context(chan_info *cp); void calculate_fft(chan_info *cp); void set_min_db(mus_float_t db); void set_x_axis_style(x_axis_style_t val); -void set_verbose_cursor(bool val); +void set_with_verbose_cursor(bool val); void set_graph_style(graph_style_t val); void set_show_marks(bool val); void set_show_y_zero(bool val); -XEN g_frames(XEN snd_n, XEN chn_n, XEN edpos); +Xen g_framples(Xen snd_n, Xen chn_n, Xen edpos); void check_cursor_shape(chan_info *cp, int x, int y); widget_t channel_to_widget(chan_info *cp); chan_info *channel_to_chan(chan_info *cp); @@ -1473,8 +1499,8 @@ chan_info *channel_to_chan(chan_info *cp); /* -------- snd-axis.c -------- */ -bool x_axis_style_p(int n); -bool show_axes_p(int n); +bool is_x_axis_style(int n); +bool shows_axes(int n); axis_info *free_axis_info(axis_info *ap); char *x_axis_location_to_string(chan_info *cp, double loc); int grf_x(double val, axis_info *ap); @@ -1503,7 +1529,7 @@ void set_numbers_font(graphics_context *ax, printing_t printing, bool use_tiny_f /* -------- snd-snd.c -------- */ -snd_info *get_sp(XEN snd_n); +snd_info *get_sp(Xen snd_n); peak_env_info *free_peak_env(chan_info *cp, int pos); void free_peak_env_state(chan_info *cp); peak_env_info *free_peak_env_info(peak_env_info *ep); @@ -1513,21 +1539,19 @@ void finish_peak_env(chan_info *cp); bool peak_env_maxamp_ok(chan_info *cp, int edpos); mus_float_t peak_env_maxamp(chan_info *cp, int edpos); bool peak_env_usable(chan_info *cp, mus_float_t samples_per_pixel, mus_long_t hisamp, bool start_new, int edit_pos, bool finish_env); -int peak_env_graph(chan_info *cp, axis_info *ap, mus_float_t samples_per_pixel, int srate); -int peak_env_partial_graph(chan_info *cp, axis_info *ap, mus_long_t beg, mus_long_t end, mus_float_t samples_per_pixel, int srate); +int peak_env_graph(chan_info *cp, mus_float_t samples_per_pixel, int srate); +int peak_env_partial_graph(chan_info *cp, mus_long_t beg, mus_long_t end, mus_float_t samples_per_pixel, int srate); char *shortname(snd_info *sp); char *shortname_indexed(snd_info *sp); void add_sound_data(char *filename, snd_info *sp, channel_graph_t graphed); mus_float_t speed_changed(mus_float_t ival, char *srcbuf, speed_style_t style, int tones, int srcbuf_size); -void sp_name_click(snd_info *sp); +char *sp_name_click(snd_info *sp); void free_controls(snd_info *sp); void save_controls(snd_info *sp); void restore_controls(snd_info *sp); void reset_controls(snd_info *sp); void set_show_controls(bool val); void stop_applying(snd_info *sp); -void menu_apply_controls(snd_info *sp); -void menu_reset_controls(snd_info *sp); void expand_control_set_hop(mus_float_t hop); void expand_control_set_length(mus_float_t hop); void expand_control_set_ramp(mus_float_t hop); @@ -1538,38 +1562,36 @@ void reverb_control_set_feedback(mus_float_t hop); void amp_env_env(chan_info *cp, mus_float_t *brkpts, int npts, int pos, mus_float_t base, mus_float_t scaler, mus_float_t offset); peak_env_info *copy_peak_env_info(peak_env_info *old_ep, bool reversed); void amp_env_env_selection_by(chan_info *cp, mus_any *e, mus_long_t beg, mus_long_t num, int pos); -void peak_env_ptree(chan_info *cp, struct ptree *pt, int pos, XEN init_func); -void peak_env_ptree_selection(chan_info *cp, struct ptree *pt, mus_long_t beg, mus_long_t num, int pos, XEN init_func); void peak_env_insert_zeros(chan_info *cp, mus_long_t beg, mus_long_t num, int pos); -snd_info *snd_new_file(const char *newname, int header_type, int data_format, int srate, int chans, const char *new_comment, mus_long_t samples); +snd_info *snd_new_file(const char *newname, int chans, int srate, mus_sample_t sample_type, + mus_header_t header_type, const char *new_comment, mus_long_t samples); #if XEN_HAVE_RATIOS void snd_rationalize(mus_float_t a, int *num, int *den); #endif +#ifdef __GNUC__ + void status_report(snd_info *sp, const char *format, ...) __attribute__ ((format (printf, 2, 3))); +#else + void status_report(snd_info *sp, const char *format, ...); +#endif +void errors_to_status_area(const char *msg, void *data); +void printout_to_status_area(const char *msg, void *data); +void clear_status_area(snd_info *sp);; void g_init_snd(void); -XEN snd_no_such_sound_error(const char *caller, XEN n); +Xen snd_no_such_sound_error(const char *caller, Xen n); void peak_env_scale_by(chan_info *cp, mus_float_t scl, int pos); void peak_env_scale_selection_by(chan_info *cp, mus_float_t scl, mus_long_t beg, mus_long_t num, int pos); peak_env_info *peak_env_copy(chan_info *cp, bool reversed, int edpos); peak_env_info *peak_env_section(chan_info *cp, mus_long_t beg, mus_long_t num, int edpos); void pick_one_bin(peak_env_info *ep, int bin, mus_long_t cursamp, chan_info *cp, int edpos); -void remember_mini_string(snd_info *sp, const char *str); -void restore_mini_string(snd_info *s, bool back); -void clear_mini_strings(snd_info *sp); -void remember_filter_string(snd_info *sp, const char *str); -void restore_filter_string(snd_info *s, bool back); -void clear_filter_strings(snd_info *sp); -void remember_listener_string(const char *str); -void restore_listener_string(bool back); void set_channel_style(channel_style_t val); -XEN new_xen_sound(int n); -bool xen_sound_p(XEN obj); -int xen_sound_to_int(XEN n); -#define XEN_SOUND_P(arg) xen_sound_p(arg) -#define C_INT_TO_XEN_SOUND(Val) new_xen_sound(Val) -#define XEN_SOUND_TO_C_INT(n) xen_sound_to_int(n) +Xen new_xen_sound(int n); +bool xen_is_sound(Xen obj); +int xen_sound_to_int(Xen n); +#define C_int_to_Xen_sound(Val) new_xen_sound(Val) +#define Xen_sound_to_C_int(n) xen_sound_to_int(n) const char *read_peak_env_info_file(chan_info *cp); bool write_peak_env_info_file(chan_info *cp); @@ -1579,49 +1601,47 @@ void delete_peak_env_info_file(chan_info *cp); /* -------- snd-file -------- */ -void *free_axes_data(void *sa); -void *make_axes_data(snd_info *sp); -void restore_axes_data(snd_info *sp, void *sa, mus_float_t new_duration, bool need_edit_history_update); +axes_data *free_axes_data(axes_data *sa); +axes_data *make_axes_data(snd_info *sp); +void restore_axes_data(snd_info *sp, axes_data *sa, mus_float_t new_duration, bool need_edit_history_update); mus_long_t disk_kspace(const char *filename); time_t file_write_date(const char *filename); -bool link_p(const char *filename); +bool is_link_file(const char *filename); int recent_files_size(void); char **recent_files(void); -bool directory_p(const char *filename); +bool is_directory(const char *filename); file_info *make_file_info(const char *fullname, read_only_t read_only, bool selected); file_info *free_file_info(file_info *hdr); file_info *copy_header(const char *fullname, file_info *ohdr); file_info *make_temp_header(const char *fullname, int srate, int chans, mus_long_t samples, const char *caller); -bool sound_file_p(const char *name); +bool is_sound_file(const char *name); void init_sound_file_extensions(void); void save_added_sound_file_extensions(FILE *fd); +const char **get_sound_file_extensions(void); +int sound_file_extensions_length(void); snd_info *snd_open_file(const char *filename, read_only_t read_only); void snd_close_file(snd_info *sp); snd_info *make_sound_readable(const char *filename, bool post_close); snd_info *snd_update(snd_info *sp); snd_info *snd_update_within_xen(snd_info *sp, const char *caller); -int snd_decode(int type, const char *input_filename, const char *output_filename); +int snd_decode(mus_header_t type, const char *input_filename, const char *output_filename); void set_fallback_srate(int sr); void set_fallback_chans(int ch); -void set_fallback_format(int fr); +void set_fallback_sample_type(mus_sample_t fr); void set_with_tooltips(bool val); void run_after_save_as_hook(snd_info *sp, const char *already_saved_as_name, bool from_save_as_dialog); -bool run_before_save_as_hook(snd_info *sp, const char *save_as_filename, bool selection, int srate, int type, int format, const char *comment); +bool run_before_save_as_hook(snd_info *sp, const char *save_as_filename, bool selection, int srate, + mus_sample_t smp_type, mus_header_t hd_type, const char *comment); void during_open(int fd, const char *file, open_reason_t reason); void after_open(snd_info *sp); -char *output_name(const char *current_name); -void save_view_files_dialogs(FILE *fd); -widget_t start_view_files_dialog(bool managed, bool make_new); -void view_files_unplay(void); -void view_files_add_directory(widget_t dialog, const char *dirname); -char *view_files_find_any_directory(void); -int view_files_dialog_list_length(void); -char **view_files_dialog_titles(void); -void view_files_start_dialog_with_title(const char *title); void set_with_toolbar_and_display(bool val); +#if (!USE_NO_GUI) + void display_info(snd_info *sp); +#endif void g_init_file(void); -void initialize_format_lists(void); +void initialize_sample_type_lists(void); void set_with_menu_icons(bool val); +Xen g_expand_vector(Xen vector, int new_size); @@ -1642,7 +1662,6 @@ bool snd_feq(mus_float_t val1, mus_float_t val2); mus_float_t in_dB(mus_float_t min_dB, mus_float_t lin_dB, mus_float_t val); #endif -int snd_mkdir(const char *filename); char *snd_local_time(void); char *snd_io_strerror(void); char *snd_open_strerror(void); @@ -1660,38 +1679,25 @@ char *file_to_string(const char *filename); char *snd_strftime(const char *format, time_t date); #endif -disk_space_t disk_space_p(mus_long_t bytes, const char *filename); +disk_space_t disk_has_space(mus_long_t bytes, const char *filename); char *prettyf(double num, int tens); char *shorter_tempnam(const char *dir, const char *prefix); char *snd_tempnam(void); void snd_exit(int val); void g_init_utils(void); -fam_info *fam_monitor_file(const char *filename, - void *data, - void (*action)(struct fam_info *fp, FAMEvent *fe)); -fam_info *fam_monitor_directory(const char *dir_name, - void *data, - void (*action)(struct fam_info *fp, FAMEvent *fe)); -fam_info *fam_unmonitor_file(const char *filename, fam_info *fp); -fam_info *fam_unmonitor_directory(const char *filename, fam_info *fp); - /* -------- snd-listener -------- */ -void backup_listener_to_previous_expression(void); -void listener_return(widget_t w, int last_prompt); -bool is_prompt(const char *str, int beg); -bool within_prompt(const char *str, int beg, int end); -char *listener_prompt_with_cr(void); +void g_init_listener(void); +#if HAVE_SCHEME +void listener_begin_hook(s7_scheme *sc, bool *val); +#endif void set_listener_prompt(const char *new_prompt); -int check_balance(const char *expr, int start, int end, bool in_listener); -int find_matching_paren(const char *str, int parens, int pos, int *highlight_pos); bool listener_is_visible(void); -void g_init_listener(void); -char *trim(char *orig); -void listener_help_at_cursor(char *buf, int name_curpos, int len, int prompt_pos); +Xen run_read_hook(char *str); +bool have_read_hook(void); @@ -1719,18 +1725,17 @@ void delete_any_remaining_mix_temp_files_at_exit(chan_info *cp); int mix_sync_from_id(int id); int mix_set_sync_from_id(int id, int new_sync); void set_mix_waveform_height(int new_val); -XEN new_xen_mix(int n); -XEN g_make_mix_sampler(XEN mix_id, XEN ubeg); -bool xen_mix_p(XEN obj); -#define XEN_MIX_P(arg) xen_mix_p(arg) -snd_fd *xen_mix_to_snd_fd(XEN obj); -int xen_mix_to_int(XEN n); -#define XEN_MIX_TO_C_INT(n) xen_mix_to_int(n) -XEN g_mix_length(XEN n); -XEN g_mix_sync(XEN n); -XEN g_set_mix_sync(XEN n, XEN val); -XEN g_mix_maxamp(XEN mix_id); -double mix_maxamp(int mix_id); +Xen new_xen_mix(int n); +Xen g_make_mix_sampler(Xen mix_id, Xen ubeg); +bool xen_is_mix(Xen obj); +snd_fd *xen_mix_to_snd_fd(Xen obj); +int xen_mix_to_int(Xen n); +#define Xen_mix_to_C_int(n) xen_mix_to_int(n) +Xen g_mix_length(Xen n); +Xen g_mix_sync(Xen n); +Xen g_set_mix_sync(Xen n, Xen val); +Xen g_mix_maxamp(Xen mix_id); +Xen g_mix_to_vct(Xen mix_n, Xen beg_n, Xen num); mus_long_t mix_position_from_id(int id); mus_long_t mix_length_from_id(int id); @@ -1771,12 +1776,12 @@ int mix_complete_file(snd_info *sp, mus_long_t beg, const char *fullname, bool w int mix_complete_file_at_cursor(snd_info *sp, const char *str); int mix_file(mus_long_t beg, mus_long_t num, int chans, chan_info **cps, const char *mixinfile, file_delete_t temp, const char *origin, bool with_tag, int start_chan); -bool mix_sampler_p(XEN obj); -XEN g_copy_mix_sampler(XEN obj); -XEN g_mix_sampler_home(XEN obj); -XEN g_mix_sampler_at_end_p(XEN obj); -XEN g_mix_sampler_position(XEN obj); -XEN g_free_mix_sampler(XEN obj); +bool is_mix_sampler(Xen obj); +Xen g_copy_mix_sampler(Xen obj); +Xen g_mix_sampler_home(Xen obj); +Xen g_mix_sampler_is_at_end(Xen obj); +Xen g_mix_sampler_position(Xen obj); +Xen g_free_mix_sampler(Xen obj); char *edit_list_mix_init(chan_info *cp); void channel_set_mix_tags_erased(chan_info *cp); void color_mixes(color_t color); @@ -1788,58 +1793,42 @@ int prepare_mix_dialog_waveform(int mix_id, axis_info *ap, bool *two_sided); void display_channel_mixes(chan_info *cp); bool play_mix_from_id(int mix_id); -XEN g_play_mix(XEN num, mus_long_t beg); +Xen g_play_mix(Xen num, mus_long_t beg); void drag_and_drop_mix_at_x_y(int data, const char *filename, int x, int y); +snd_fd *mf_to_snd_fd(void *p); /* -------- snd-find.c -------- */ -char *global_search(read_direction_t direction); -void cursor_search(chan_info *cp, int count); -void clear_sound_search_procedure(snd_info *sp, bool clear_expr_too); -void clear_global_search_procedure(bool clear_expr_too); - +#if HAVE_EXTENSION_LANGUAGE && (!USE_NO_GUI) + void find_dialog_find(char *str, read_direction_t direction, chan_info *cp); +#endif void g_init_find(void); /* -------- snd-trans.c -------- */ -int snd_translate(const char *oldname, const char *newname, int type); +int snd_translate(const char *oldname, const char *newname, mus_header_t type); /* -------- snd.c -------- */ -void mus_error_to_snd(int type, char *msg); void snd_set_global_defaults(bool need_cleanup); -#if SND_AS_WIDGET - snd_state *snd_main(int argc, char **argv); -#endif void g_init_base(void); /* -------- snd-kbd.c -------- */ -void save_macro_state(FILE *fd); - -#ifdef __GNUC__ - void report_in_minibuffer(snd_info *sp, const char *format, ...) __attribute__ ((format (printf, 2, 3))); -#else - void report_in_minibuffer(snd_info *sp, const char *format, ...); -#endif -void string_to_minibuffer(snd_info *sp, const char *buf); -void errors_to_minibuffer(const char *msg, void *data); -void printout_to_minibuffer(const char *msg, void *data); -void clear_minibuffer(snd_info *sp); -void clear_minibuffer_prompt(snd_info *sp); -void snd_minibuffer_activate(snd_info *sp, int keysym, bool with_meta); -int in_user_keymap(int key, int state, bool cx_extended); -void set_keymap_entry(int key, int state, int args, XEN func, bool cx_extended, const char *origin, const char *prefs_info); -char *key_binding_description(int key, int state, bool cx_extended); +int in_keymap(int key, int state, bool cx_extended); +void set_keymap_entry(int key, int state, int args, Xen func, bool cx_extended, const char *origin, const char *prefs_info); +char *key_description(int key, int state, bool cx_extended); char *make_key_name(char *buf, int buf_size, int key, int state, bool extended); -void map_over_key_bindings(bool (*func)(int key, int state, bool cx, XEN xf)); -key_info *find_prefs_key_binding(const char *prefs_name); +void map_over_keys(bool (*func)(int key, int state, bool cx, Xen xf)); +key_info *find_prefs_key(const char *prefs_name); + +void save_edits_from_kbd(snd_info *sp); void keyboard_command(chan_info *cp, int keysym, int state); void control_g(snd_info *sp); void g_init_kbd(void); @@ -1849,14 +1838,12 @@ void g_init_kbd(void); void scale_by(chan_info *cp, mus_float_t *scalers, int len, bool selection); bool scale_to(snd_info *sp, chan_info *cp, mus_float_t *scalers, int len, bool selection); -mus_float_t channel_maxamp(chan_info *cp, int edpos); -mus_long_t channel_maxamp_position(chan_info *cp, int edpos); void src_env_or_num(chan_info *cp, env *e, mus_float_t ratio, bool just_num, - const char *origin, bool over_selection, mus_any *gen, XEN edpos, int arg_pos); + const char *origin, bool over_selection, mus_any *gen, Xen edpos, int arg_pos); void apply_filter(chan_info *ncp, int order, env *e, const char *caller, const char *origin, - bool over_selection, mus_float_t *ur_a, mus_any *gen, XEN edpos, int arg_pos, bool truncate); + bool over_selection, mus_float_t *ur_a, mus_any *gen, Xen edpos, int arg_pos, bool truncate); void apply_env(chan_info *cp, env *e, mus_long_t beg, mus_long_t dur, bool over_selection, - const char *origin, mus_any *gen, XEN edpos, int arg_pos); + const char *origin, mus_any *gen, Xen edpos, int arg_pos); void cos_smooth(chan_info *cp, mus_long_t beg, mus_long_t num, bool over_selection); void display_frequency_response(env *e, axis_info *ap, graphics_context *gax, int order, bool dBing); void cursor_delete(chan_info *cp, mus_long_t count); @@ -1864,15 +1851,18 @@ void cursor_zeros(chan_info *cp, mus_long_t count, bool over_selection); void cursor_insert(chan_info *cp, mus_long_t beg, mus_long_t count); void cut_and_smooth(chan_info *cp); void src_file(const char *file, double ratio); +mus_long_t scan_channel(chan_info *cp, mus_long_t start, mus_long_t end, Xen proc); void g_init_sig(void); -int to_c_edit_position(chan_info *cp, XEN edpos, const char *caller, int arg_pos); -mus_long_t to_c_edit_samples(chan_info *cp, XEN edpos, const char *caller, int arg_pos); -mus_long_t beg_to_sample(XEN beg, const char *caller); -mus_long_t dur_to_samples(XEN dur, mus_long_t beg, chan_info *cp, int edpos, int argn, const char *caller); +int to_c_edit_position(chan_info *cp, Xen edpos, const char *caller, int arg_pos); +mus_long_t to_c_edit_samples(chan_info *cp, Xen edpos, const char *caller, int arg_pos); +mus_long_t beg_to_sample(Xen beg, const char *caller); +mus_long_t dur_to_samples(Xen dur, mus_long_t beg, chan_info *cp, int edpos, int argn, const char *caller); +#if USE_MOTIF char *scale_and_src(char **files, int len, int max_chans, mus_float_t amp, mus_float_t speed, env *amp_env, bool *err); -XEN g_scale_selection_by(XEN scalers); -void reverse_sound(chan_info *ncp, bool over_selection, XEN edpos, int arg_pos); +#endif +Xen g_scale_selection_by(Xen scalers); +void reverse_sound(chan_info *ncp, bool over_selection, Xen edpos, int arg_pos); /* -------- snd-draw.c -------- */ @@ -1887,17 +1877,13 @@ void draw_both_grf_points(int dot_size, graphics_context *ax, int j, graph_style void g_init_draw(void); void set_dialog_widget(snd_dialog_t which, widget_t wid); void run_new_widget_hook(widget_t w); -bool foreground_color_ok(XEN color, graphics_context *ax); +bool foreground_color_ok(Xen color, graphics_context *ax); #if HAVE_GL void sgl_save_currents(void); void sgl_set_currents(bool with_dialogs); #endif -#if USE_GTK - void recolor_everything(widget_t w, gpointer color); -#endif - /* -------- snd-ladspa.c -------- */ #if HAVE_LADSPA |