//#include "gui_event_list.h" enum toolbar_pos { TOOLBAR_LEFT, TOOLBAR_RIGHT, TOOLBAR_TOP, TOOLBAR_BOTTOM, TOOLBAR_NONE }; enum ui_mode { UI_MODE_SSA, UI_MODE_ASS, UI_MODE_SRT, UI_MODE_KARAOKE, UI_MODE_NONE }; enum karaoke_mode { KARAOKE_MODE_OFF, KARAOKE_MODE_BOX, KARAOKE_MODE_LINE }; enum notebook_page { NOTEBOOK_PAGE_AUDIO, NOTEBOOK_PAGE_VIDEO }; enum status_bar_colors { STATUS_COLOR_SUCCESS, STATUS_COLOR_ERROR, STATUS_COLOR_UNSAVED, STATUS_COLOR_COUNT }; enum control_widget_type { CONTROLS_TABLE, CONTROLS_HBOX, CONTROLS_VBOX }; GdkPixbuf *gui_main_load_image(int identifier); void gui_main_create(); char *gui_main_open_file(char *title, char **filters); char *gui_main_save_file(char *title, char **filters, char *default_extension, char *filename = NULL); void gui_main_title_update(); void gui_main_update_sensitivity(); void gui_main_error_sound(); GtkToolbar *gui_main_create_list_toolbar(gboolean horizontal); GtkToolbar *gui_main_create_wave_toolbar(gboolean horizontal); void gui_main_disable_seek(); void gui_main_enable_seek(gboolean enable); void gui_main_register_extensions(GtkWidget *widget, int callback_action); void gui_warning(char *format, ...); void gui_main_marker_changed_cb(KryMarker *marker, long position); gboolean gui_main_key_press(GtkWidget *widget, GdkEventKey *event, gpointer button); gboolean gui_main_scroll_press(GtkWidget *widget, GdkEvent *event, gpointer button); int gui_main_select_font(struct fontsel_info * fontsel_info); void gui_main_hbox_color_map_cb(GtkWidget *widget, GtkWidget *w2); void gui_error(char *format, ...); void gui_error(GtkWindow *parent, char *format, ...); gboolean gui_question_yes_no(char *format, ...); gboolean gui_question_yes_no(GtkWindow *window, char *format, ...); void gui_main_sync_point_set(GtkWidget *widget, int action, gpointer data); void gui_main_sync_point_sync(GtkWidget *widget, int action, gpointer data); gboolean gui_warning_yes_no(char *format, ...); double gui_spin_button_get_value(GtkSpinButton *button); gboolean gui_main_error_dialog_show(char *header, char *footer, kryList *error_list); GtkWidget *gui_main_create_text_editor(); GtkWidget *gui_main_create_event_editor(); void gui_main_focus_on_wave(); void gui_main_notebook_page_changed(GtkNotebook *notebook, GtkNotebookPage *page_unused, enum notebook_page page, gpointer data_unused); void gui_main_sync_event_to_wave(GtkWidget *widget, int action, gpointer data); void gui_karaoke_set_selected_event(kryEvent *event_generic); void gui_main_color_fill(GtkDrawingArea *area, kryColor *color, gboolean border); void gui_main_disable(); void gui_main_enable(); GtkWidget *gui_main_create_control_toolbar(control_widget_type type); void gui_main_entry_style_changed_cb(GtkWidget *widget, gpointer data); gboolean gui_main_is_enabled();; unsigned int update_crc(unsigned int crc_accum, char *data_blk_ptr, int data_blk_size); void gen_crc_table(); #ifdef _WINDOWS void gui_win32_print_last_error(LPTSTR lpszFunction); #endif struct recent_info { GtkMenuItem *parent; GList **list; }; struct gui_main_style_editor { GtkComboBox *combo_style; //GtkCombo *combo_align; GtkRadioButton *button_align[9]; GtkSpinButton *spin_font_size; GtkEntry *entry_font_name; GtkToggleButton *button_font_bold; GtkToggleButton *button_font_italic; GtkToggleButton *button_font_underline; GtkToggleButton *button_font_strikethrough; GtkSpinButton *spin_margin_left; GtkSpinButton *spin_margin_right; GtkSpinButton *spin_margin_vertical; GtkSpinButton *spin_angle; GtkComboBox *combo_border; GtkSpinButton *spin_border_size; GtkSpinButton *spin_shadow_size; GtkSpinButton *spin_scalex; GtkSpinButton *spin_scaley; GtkSpinButton *spin_spacing; GtkLabel *label_tertiary; GtkLabel *label_outline; GtkLabel *label_shadow; GtkLabel *label_back; GtkButton *button_tertiary; GtkButton *button_outline; GtkButton *button_shadow; GtkButton *button_back; GtkDrawingArea *draw_primary; GtkDrawingArea *draw_secondary; GtkDrawingArea *draw_tertiary; GtkDrawingArea *draw_outline; GtkDrawingArea *draw_shadow; GtkDrawingArea *draw_back; GtkFrame *frame_style_font; kryStyle *current; }; struct gui_main_tab_options_color { GtkLabel *label_no_color; GtkHBox *hbox_editor; GtkDrawingArea *area; kryColor *active_color; GtkTreeView *color_view; }; struct gui_main_tab_video { struct video_ffmpeg *video; AVPicture pict; KryMarker *marker_start; KryMarker *marker_start_prev; /*long mark_start_mili; long mark_start_mili_prev; /// *only* used for video*/ int posx; int posy; int orgx; int orgy; GdkRectangle subRect; gboolean doMove; gboolean doUpdate; gboolean showGrid; int grid_interval_x; int grid_interval_y; int grid_snap_distance; GtkEntry *entry_time; GtkProgressBar *progress_bar; gboolean sync_audio; GtkButton *button_back1; GtkButton *button_forward1; GtkButton *button_back10; GtkButton *button_forward10; GtkButton *button_lock; GtkButton *button_video; GtkButton *button_solid; GtkButton *button_jump_start; GtkButton *button_jump_end; GtkWidget *vbox_notebook; GtkToggleButton *button_hide; unsigned int color_solid; double zoomf; }; struct sabbu_options { gboolean format_script; gboolean join_2spaces; gboolean two_button_mode; gboolean enable_logging; gboolean disable_collisions; gboolean text_editor_top; gboolean video_disabled; gboolean enable_drag_selection; gboolean disable_automatic_wave_jump; gboolean play_selection_stop; gboolean theme_warning_shown; gboolean peak_files; gboolean enable_marker_dragging; gboolean save_utf16; gboolean advanced_waveform_ui; gboolean controls_as_toolbar; gboolean show_only_first_channel; double default_zoom; int time_advance; int leadin; int leadout; }; struct gui_menu_script { GtkMenuItem *open_recent; GtkMenuItem *save_as_utf16; GtkMenuItem *close; GtkMenuItem *open_recent_workspace; GtkMenuItem *save_workspace_as; GtkMenuItem *close_workspace; }; struct gui_menu_audio { GtkMenuItem *open_recent; GtkMenuItem *close; GtkMenuItem *grab_times; GtkMenuItem *play_from_start_marker; GtkMenuItem *play_previous_row; GtkMenuItem *play_current_row; GtkMenuItem *play_next_row; GtkMenuItem *advance_selection; GtkMenuItem *save_selection_as_wav; }; struct gui_menu_video { GtkMenuItem *open_recent; GtkMenuItem *close; }; struct gui_menu_event { GtkMenuItem *me; GtkMenuItem *type; GtkMenuItem *add_blank_above; GtkMenuItem *add_blank_below; GtkMenuItem *add_separator_above; GtkMenuItem *add_separator_below; GtkMenuItem *event_delete; GtkMenuItem *find_spelling_mistake; GtkMenuItem *spellcheck_language; GtkMenuItem *join; GtkMenuItem *shift_times; GtkMenuItem *split_at_cursor; GtkMenuItem *split; GtkMenuItem *copy; GtkMenuItem *cut; GtkMenuItem *paste_above; GtkMenuItem *paste_below; GtkMenuItem *number_events; }; struct gui_menu_karaoke { GtkMenuItem *me; GtkMenuItem *box_mode; GtkMenuItem *script_mode; GtkMenuItem *save_changes; GtkMenuItem *turn_off; //GtkMenuItem *add_silence_before; //GtkMenuItem *add_silence_after; GtkMenuItem *split_part; GtkMenuItem *previous_part; GtkMenuItem *next_part; }; struct gui_menu_sync { GtkMenuItem *me; }; struct gui_menu { GtkMenuBar *me; struct gui_menu_script script; struct gui_menu_audio audio; struct gui_menu_video video; struct gui_menu_event event; struct gui_menu_karaoke karaoke; struct gui_menu_sync sync; }; struct gui_pixbufs { GdkPixbuf *show; GdkPixbuf *hide; GdkPixbuf *gear; GdkPixbuf *syntax; GdkPixbuf *syntax_off; GdkPixbuf *karaoke_box; GdkPixbuf *karaoke_line; GdkPixbuf *search_indicator; GdkPixbuf *margin_left; GdkPixbuf *margin_right; GdkPixbuf *margin_vertical; GdkPixbuf *angle; GdkPixbuf *scalex; GdkPixbuf *scaley; GdkPixbuf *spacing; GdkPixbuf *time_left; GdkPixbuf *time_left2; GdkPixbuf *time_right; GdkPixbuf *time_right2; GdkPixbuf *sarrow_up_left; GdkPixbuf *sarrow_up; GdkPixbuf *sarrow_up_right; GdkPixbuf *sarrow_left; GdkPixbuf *sarrow_center; GdkPixbuf *sarrow_right; GdkPixbuf *sarrow_down_left; GdkPixbuf *sarrow_down; GdkPixbuf *sarrow_down_right; GdkPixbuf *sync_scroll; GdkPixbuf *sync_zoom; GdkPixbuf *sync_scale; GdkPixbuf *play; GdkPixbuf *play_last; GdkPixbuf *play_selection; GdkPixbuf *play_stop; GdkPixbuf *grab_times; GdkPixbuf *focus_selected; GdkPixbuf *show_time; GdkPixbuf *show_keyframes; GdkPixbuf *leadin; GdkPixbuf *leadout; GdkPixbuf *leadboth; }; struct gui_main_struct { struct gui_menu menu; struct gui_main_tab_video tab_video; struct gui_main_tab_options_color tab_options_color; struct gui_pixbufs pixbufs; struct gui_main_style_editor style_editor; struct AspellSpeller *speller; GtkAccelGroup *menu_accel_group; krySignal signal_progress; GtkListStore *name_store; GtkTreeModel *name_store_sorted; int name_store_rows; GtkListStore *style_store; struct KryEventList *event_list; struct KryTextEditor *text_editor; GtkCellRenderer *renderer_text; GtkWindow *window; GtkWindow *window_focus; GtkLabel *label_zoom; GtkSpinButton *spin_zoom; GtkLabel *label_scale; GtkSpinButton *spin_scale; GtkTable *table_event_editor; GtkToolbar *play_toolbar; GtkHBox *hbox_play_toolbar; GList *list_play_toolbar; GtkButton *wave_grab_times; GtkButton *wave_play_selected; GtkWidget *search_indicator_style; GtkWidget *search_indicator_name; GtkWidget *search_indicator_text; GtkWidget *time_start; GtkWidget *time_end; GtkWidget *time_dur; GtkWidget *box_time_start; GtkWidget *box_time_end; GdkColor box_orig_color; GtkTooltips *tooltips; GtkPaned *wave_pane; struct KryStatusBar *status_bar; GtkNotebook *notebook; GtkWidget *tab_audio_widget; GtkWidget *tab_video_widget; GtkLabel *tab_audio_label; GtkLabel *tab_video_label; GtkHBox *hbox_hide_channels; GtkHBox *hbox_wave; GtkVBox *vbox_sub_wave; GtkWidget *toolbar_wave; GtkHBox *hbox_list; GtkVBox *vbox_sub_list; GtkToolbar *toolbar_list; GtkButton *tool_play_start; GtkButton *tool_play_stop; enum toolbar_pos toolbar_location; enum ui_mode ui_mode; struct sound_info *sound_info; /*** RECENT FILES RELATED ***/ GList *list_recent_scripts; GList *list_recent_workspaces; GList *list_recent_audio; GList *list_recent_videos; GCallback cb_recent_scripts; GCallback cb_recent_workspaces; GCallback cb_recent_audio; GCallback cb_recent_videos; /*** RECENT FILES RELATED ***/ // marker for the entire event KryMarker *marker_event_start; KryMarker *marker_event_end; KryMarker *marker_current; // marker for the active event. // will either be set to the event markers for normal mode // or to the current karaoke part for the karaoke mode KryMarker *marker_active_start; KryMarker *marker_active_end; enum karaoke_mode karaoke_mode; kryEvent *karaoke_parent_event; kryEventKaraokeText *karaoke_selection; kryEventKaraokeText *karaoke_start; kryEventKaraokeText *karaoke_end; kryList *karaoke_parts; KryMarker *marker_karaoke_start; KryMarker *marker_karaoke_end; GtkComboBox *karaoke_type_combo; KryRegionFixedList *region_list; KryWaveformGroup *waveform_group; GtkVBox *vbox_waves; enum sound_play_status sound_play_status; //gboolean is_playing; // only used for 'Play from Start Marker' command GtkDrawingArea *video_area; GtkLabel *label_name; GtkComboBox *combo_name; GtkLabel *label_style; GtkComboBox *combo_style; GtkLabel *label_layer; GtkSpinButton *spin_layer; gboolean autosave; GtkHBox *hbox_start_1; GtkHBox *hbox_end_1; GtkButton *button_start_less_10; GtkButton *button_start_more_10; GtkButton *button_start_less_1; GtkButton *button_start_more_1; kryList clipboard_events; //kryScript *line_copy; gboolean time_modified; //enum text_highlight_mode text_highlight_mode; //GtkVBox *karaoke_vbox_separator; GtkHBox *karaoke_hbox_switch; GtkVBox *karaoke_vbox_switch; GtkVBox *karaoke_vbox_toolbar; GtkButton *karaoke_button_box; GtkButton *karaoke_button_line; GtkWidget *karaoke_toolbar_split; GtkHBox *hbox_karaoke; GtkLayout *karaoke_container; GtkWidget *event_editor; GtkFrame *frame_controls; GtkVBox *vbox_event_edit; GtkVBox *vbox_list_super; GtkPaned *paned_notebook; GtkPaned *paned_list; GtkWidget *hbox_color; GdkColor color_bg; GdkColor colors_waveform[WAVEFORM_COLOR_COUNT]; KryWaveform *wave_preview; kryColorTable *waveform_color_table; kryColorTable *list_color_table; kryColorTable *style_color_table; kryColorTable *status_bar_color_table; kryColorTable *highlight_color_table; struct hold_button_callback_info *info_start_less1; struct hold_button_callback_info *info_start_less10; struct hold_button_callback_info *info_start_more1; struct hold_button_callback_info *info_start_more10; struct hold_button_callback_info *info_end_less1; struct hold_button_callback_info *info_end_less10; struct hold_button_callback_info *info_end_more1; struct hold_button_callback_info *info_end_more10; gboolean video_drawing; int pane_video_pos; int pane_other_pos; int play_speed; //GList *event_list_columns; GList *rc_files; }; typedef void (*kryButtonCallback)(GdkEventButton *, gpointer); struct hold_button_callback_info { GtkWidget *widget; kryButtonCallback func; gpointer data; gboolean released; int running; int id; GdkEventButton event; }; enum recent_id { RECENT_SCRIPTS, RECENT_WORKSPACES, RECENT_AUDIO, RECENT_VIDEOS }; static char *file_filter_audio[] = { "WAV (*.wav)", "*.wav", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_script_ssa[] = { _("FileFilter|All Supported Formats (*.ssa; *.ass)"), "*.ass;*.ssa;", "SubStation Alpha (*.ssa)", "*.ssa", "Advanced SubStation (*.ass)", "*.ass", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_script[] = { _("FileFilter|All Supported Formats (*.ssa; *.ass; *.srt; *.txt)"), "*.ass;*.ssa;*.txt;*.srt;", "SubStation Alpha (*.ssa)", "*.ssa", "Advanced SubStation (*.ass)", "*.ass", "SubRip (*.srt)", "*.srt", _("FileFilter|Text File (*.txt)"), "*.txt", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_workspace[] = { _("FileFilter|Sabbu Workspace (*.sabbu)"), "*.sabbu", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_keyframe[] = { _("FileFilter|Keyframes (*.keyframes)"), "*.keyframes", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_video[] = { "AVI (*.avi)", "*.avi", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_export_txt[] = { _("FileFilter|Text File (*.txt)"), "*.txt", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_export_encore[] = { "Adobe Encore File (*.txt)", "*.txt", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_script_s_ass[] = { "Advanced SubStation (*.ass)", "*.ass", "SubStation Alpha (*.ssa)", "*.ssa", "SubRip (*.srt)", "*.srt", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_script_s_ssa[] = { "SubStation Alpha (*.ssa)", "*.ssa", "Advanced SubStation (*.ass)", "*.ass", "SubRip (*.srt)", "*.srt", _("FileFilter|All Files (*.*)"), "*.*", NULL }; static char *file_filter_script_s_srt[] = { "SubRip (*.srt)", "*.srt", "SubStation Alpha (*.ssa)", "*.ssa", "Advanced SubStation (*.ass)", "*.ass", _("FileFilter|All Files (*.*)"), "*.*", NULL }; void gui_main_entry_name_changed_cb(GtkWidget *widget, GtkComboBox *combo); gboolean gui_main_hold_button_press(GtkWidget *widget, GdkEventButton *event, struct hold_button_callback_info *info); gboolean gui_main_hold_button_release(GtkWidget *widget, struct hold_button_callback_info *info); void gui_main_layer_style_changed_cb(GtkWidget *widget, gpointer data); gboolean gui_combo_box_set_text(GtkComboBox *combo, char *text, gboolean numeric = FALSE); void gui_combo_box_add_text(GtkComboBox *combo, char *text, gboolean numeric = FALSE); void gui_main_script_modified(gboolean modified); void gui_main_recent_list_add(GtkMenuItem *parent, GList **list, GCallback cb, char *filename); void gui_main_recent_list_save(GList *list, char *key); void gui_main_menu_script_openrecent(GtkWidget *widget, gpointer callback_data); void gui_main_update_pane_position(int page); void gui_main_set_ui_mode(enum ui_mode ui_mode); void gui_main_check_theme(); void gui_main_set_time_modified(gboolean val); GtkComboBoxEntry *gui_combo_box_fps_new(gboolean ntsc_pal_only = FALSE); void gui_main_text_paned_move_cb(GtkPaned *paned, GParamSpec *spec, gpointer data); void gui_main_waveform_toolbar_advanced(struct waveform_info *info); void gui_main_advanced_waveform_ui_switch(gboolean val); gboolean gui_main_time_box_key_press_cb(GtkWidget *widget, GdkEventKey *key, gpointer data); void gui_main_focus();