00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef HAS_MAIN_H
00053 #define HAS_MAIN_H
00054
00055 #include <gtk/gtk.h>
00056 #include <gdk/gdkx.h>
00057 #include <gdk/gdkkeysyms.h>
00058
00059 #include <stdlib.h>
00060 #include <stdio.h>
00061 #include <unistd.h>
00062 #include <string.h>
00063 #include <signal.h>
00064 #include <assert.h>
00065
00068 #define BOOTSTRAP_NAME "/tmp/.smogrify"
00069
00071 #define MAX_FILES 65535
00072
00075 #ifndef PREFIX_DEFAULT
00076 #define PREFIX_DEFAULT "/usr"
00077 #endif
00078
00080 #ifndef PREFIX
00081 #define PREFIX PREFIX_DEFAULT
00082 #endif
00083
00084
00085
00086 #define DOC_DIR "/share/doc/lives-"
00087
00088 #define THEME_DIR "/share/lives/themes/"
00089 #define PLUGIN_SCRIPTS_DIR "/share/lives/plugins/"
00090 #define PLUGIN_EXEC_DIR "/lives/plugins/"
00091 #define ICON_DIR "/share/lives/icons/"
00092 #define DATA_DIR "/share/lives/"
00093 #define LIVES_CONFIG_DIR ".lives-dir/"
00094
00095 #define LIVES_DEVICE_DIR "/dev/"
00096
00097
00098 #define LIVES_MANUAL_URL "http://lives.sourceforge.net/manual/"
00099 #define LIVES_MANUAL_FILENAME "LiVES_manual.html"
00100 #define LIVES_AUTHOR_EMAIL "mailto:salsaman@xs4all.nl"
00101 #define LIVES_DONATE_URL "https://sourceforge.net/donate/index.php?group_id=64341"
00102 #define LIVES_BUG_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507139"
00103 #define LIVES_FEATURE_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507142"
00104 #define LIVES_TRANSLATE_URL "https://translations.launchpad.net/lives/trunk"
00105
00106 #ifdef IS_DARWIN
00107 #ifndef off64_t
00108 #define off64_t off_t
00109 #endif
00110 #ifndef lseek64
00111 #define lseek64 lseek
00112 #endif
00113 #endif
00114
00117 #define WARN_FILE_SIZE 500
00118
00121 #define FPS_MAX 200.
00122
00123 #define ENABLE_DVD_GRAB
00124
00125 #define FP_BITS 16 /// max fp bits [apparently 16 is faster]
00126
00127 #ifdef HAVE_MJPEGTOOLS
00128 #define HAVE_YUV4MPEG
00129 #endif
00130
00131 #ifdef ENABLE_OIL
00132 #include <liboil/liboil.h>
00133 #endif
00134
00135 #ifndef IS_SOLARIS
00136 #define LIVES_INLINE inline
00137 #else
00138 #define LIVES_INLINE
00139 #endif
00140
00141 #include <limits.h>
00142
00143 #ifndef PATH_MAX
00144 #define PATH_MAX 4096
00145 #endif
00146
00147 #ifdef __GNUC__
00148 # define WARN_UNUSED __attribute__((warn_unused_result))
00149 #else
00150 # define WARN_UNUSED
00151 #endif
00152
00153
00154
00157 typedef struct {
00158 gint value;
00159 gint64 reltime;
00160 } event;
00161
00162 typedef struct {
00163 GtkWidget *processing;
00164 GtkWidget *progressbar;
00165 GtkWidget *label;
00166 GtkWidget *label2;
00167 GtkWidget *label3;
00168 GtkWidget *stop_button;
00169 GtkWidget *pause_button;
00170 GtkWidget *preview_button;
00171 GtkWidget *cancel_button;
00172 GtkWidget *scrolledwindow;
00173 guint frames_done;
00174 } process;
00175
00176
00177
00178
00179 typedef struct {
00180 int afile;
00181 double seek;
00182 double vel;
00183 } lives_audio_track_state_t;
00184
00185
00186 #include "../libweed/weed.h"
00187 #include "../libweed/weed-events.h"
00188
00189
00190
00191
00192
00194 #include "events.h"
00195
00196
00197 typedef enum {
00198 UNDO_NONE=0,
00199 UNDO_EFFECT,
00200 UNDO_RESIZABLE,
00201 UNDO_MERGE,
00202 UNDO_RESAMPLE,
00203 UNDO_TRIM_AUDIO,
00204 UNDO_CHANGE_SPEED,
00205 UNDO_AUDIO_RESAMPLE,
00206 UNDO_APPEND_AUDIO,
00207 UNDO_INSERT,
00208 UNDO_CUT,
00209 UNDO_DELETE,
00210 UNDO_DELETE_AUDIO,
00211 UNDO_INSERT_SILENCE,
00212 UNDO_NEW_AUDIO,
00213
00215 UNDO_ATOMIC_RESAMPLE_RESIZE,
00216
00218 UNDO_RENDER,
00219
00220 UNDO_FADE_AUDIO,
00221
00223 UNDO_REC_AUDIO,
00224
00225 UNDO_INSERT_WITH_AUDIO
00226 } lives_undo_t;
00227
00228
00230 typedef enum {
00231 NEVER_STOP=0,
00232 STOP_ON_VID_END,
00233 STOP_ON_AUD_END
00234 } lives_whentostop_t;
00235
00236
00238 typedef enum {
00240 CANCEL_NONE=0,
00241
00243 CANCEL_USER=1,
00244
00246 CANCEL_NO_PROPOGATE=2,
00247
00249 CANCEL_PREVIEW_FINISHED=3,
00250
00252 CANCEL_APP_QUIT=4,
00253
00255 CANCEL_NO_MORE_PREVIEW=5,
00256
00258 CANCEL_CAPTURE_ERROR=6,
00259
00261 CANCEL_EVENT_LIST_END=7,
00262
00264 CANCEL_VID_END=8,
00265
00267 CANCEL_GENERATOR_END=9,
00268
00270 CANCEL_KEEP=10,
00271
00273 CANCEL_AUD_END=11,
00274
00276 CANCEL_ERROR=12,
00277
00279 CANCEL_USER_PAUSED=13,
00280
00282 CANCEL_KEEP_LOOPING=100
00283
00284 } lives_cancel_t;
00285
00286
00287 typedef enum {
00288 CANCEL_KILL=0,
00289 CANCEL_SOFT
00290 } lives_cancel_type_t;
00291
00292
00293
00294
00295 typedef enum {
00296 CLIP_TYPE_DISK,
00297 CLIP_TYPE_YUV4MPEG,
00298 CLIP_TYPE_GENERATOR,
00299 CLIP_TYPE_FILE,
00300 CLIP_TYPE_LIVES2LIVES,
00301 CLIP_TYPE_VIDEODEV
00302 } lives_clip_type_t;
00303
00304
00305 typedef enum {
00306 IMG_TYPE_UNKNOWN=(1<<0),
00307 IMG_TYPE_JPEG=(1<<1),
00308 IMG_TYPE_PNG=(1<<2)
00309 } lives_image_type_t;
00310
00311
00312
00313 #define AFORM_SIGNED 0
00314 #define AFORM_LITTLE_ENDIAN 0
00315
00316 #define AFORM_UNSIGNED 1
00317 #define AFORM_BIG_ENDIAN (1<<1)
00318 #define AFORM_UNKNOWN 65536
00319
00320
00321 typedef struct {
00322 gshort red;
00323 gshort green;
00324 gshort blue;
00325 } lives_colRGB24_t;
00326
00327 typedef struct {
00328 gshort red;
00329 gshort green;
00330 gshort blue;
00331 gshort alpha;
00332 } lives_colRGBA32_t;
00333
00334
00335 typedef enum {
00336 LIVES_INTERLACE_NONE=0,
00337 LIVES_INTERLACE_BOTTOM_FIRST=1,
00338 LIVES_INTERLACE_TOP_FIRST=2
00339 } lives_interlace_t;
00340
00341
00342 #include "pangotext.h"
00343
00345 typedef struct {
00346
00347 gint bpp;
00348 gdouble fps;
00349 gint hsize;
00350 gint vsize;
00351 gint arps;
00352 guint signed_endian;
00353
00354 gint arate;
00355 gint64 unique_id;
00356 gint achans;
00357 gint asampsize;
00358
00360 gint frames;
00361 gchar title[256];
00362 gchar author[256];
00363 gchar comment[256];
00364 gchar keywords[256];
00366
00367 lives_interlace_t interlace;
00368
00369
00370 gint header_version;
00371
00372 #define LIVES_CLIP_HEADER_VERSION 100
00373
00374 gint rowstride;
00375
00377 process *proc_ptr;
00378
00379 gchar handle[256];
00380 gint ohsize;
00381 gint ovsize;
00382 glong f_size;
00383 glong afilesize;
00384 gint old_frames;
00385 gchar file_name[256];
00386 gchar info_file[256];
00387 gchar name[256];
00388 gchar save_file_name[256];
00389 gchar type[40];
00390 gint start;
00391 gint end;
00392 gint insert_start;
00393 gint insert_end;
00394 gint progress_start;
00395 gint progress_end;
00396 gboolean changed;
00397 GtkWidget *menuentry;
00398 gboolean orig_file_name;
00399 gboolean was_renamed;
00400 gboolean is_untitled;
00401 gdouble pb_fps;
00402 gdouble freeze_fps;
00403 gboolean play_paused;
00404
00405
00406 gboolean opening;
00407 gboolean opening_audio;
00408 gboolean opening_only_audio;
00409 gboolean opening_loc;
00410 gboolean restoring;
00411 gboolean is_loaded;
00412
00414 gboolean nopreview;
00415
00417 gboolean nokeep;
00418
00419
00420 gdouble total_time;
00421 gdouble video_time;
00422 gdouble laudio_time;
00423 gdouble raudio_time;
00424 gdouble pointer_time;
00425
00426
00427 gint frameno;
00428 gint last_frameno;
00429
00430
00431
00433
00434
00435
00436
00437 event *events[1];
00438
00439 weed_plant_t *event_list;
00440 weed_plant_t *event_list_back;
00441 weed_plant_t *next_event;
00442
00443 GList *layout_map;
00445
00447 lives_undo_t undo_action;
00448
00449 gint undo_start;
00450 gint undo_end;
00451 gchar undo_text[32];
00452 gchar redo_text[32];
00453 gboolean undoable;
00454 gboolean redoable;
00455
00456
00457 gint undo1_int;
00458 gint undo2_int;
00459 gint undo3_int;
00460 gint undo4_int;
00461 guint undo1_uint;
00462 gdouble undo1_dbl;
00463 gdouble undo2_dbl;
00464 gboolean undo1_boolean;
00465 gboolean undo2_boolean;
00466 gboolean undo3_boolean;
00467
00468 gint undo_arate;
00469 guint undo_signed_endian;
00470 gint undo_achans;
00471 gint undo_asampsize;
00472 gint undo_arps;
00473
00474 lives_clip_type_t clip_type;
00475
00476 void *ext_src;
00477
00482 int *frame_index;
00483
00484 int *frame_index_back;
00485
00486 gint fx_frame_pump;
00487
00488 #define FX_FRAME_PUMP_VAL 100 ///< how many frames at a time to pump to rfx
00489
00490 #define IMG_BUFF_SIZE 4096 ///< chunk size for reading images
00491
00492 gboolean ratio_fps;
00493
00494 glong aseek_pos;
00495
00496
00497
00498 gchar mime_type[256];
00499
00500
00501 gboolean deinterlace;
00502
00503 lives_image_type_t img_type;
00504
00506 gint stored_layout_frame;
00507 gint stored_layout_idx;
00508 gdouble stored_layout_audio;
00509 gdouble stored_layout_fps;
00510
00511 lives_subtitles_t *subt;
00512
00513
00514 } file;
00515
00516
00517 typedef struct {
00518
00519 gboolean has_smogrify;
00520 gboolean smog_version_correct;
00521 gboolean can_read_from_config;
00522 gboolean can_write_to_config;
00523 gboolean can_write_to_tmp;
00524 gboolean can_write_to_tempdir;
00525
00526
00527 gboolean has_xmms;
00528 gboolean has_dvgrab;
00529 gboolean has_sox;
00530 gboolean has_mplayer;
00531 gboolean has_convert;
00532 gboolean has_composite;
00533 gboolean has_cdda2wav;
00534 gboolean has_midistartstop;
00535 gboolean has_jackd;
00536 gboolean has_pulse_audio;
00537 gboolean has_xwininfo;
00538 gboolean has_gdb;
00539
00541 gchar home_dir[256];
00542
00544 gchar startup_msg[256];
00545
00546
00547 gboolean has_encoder_plugins;
00548
00549 gboolean has_python;
00550
00551 gshort cpu_bits;
00552
00553 gchar *myname_full;
00554 gchar *myname;
00555
00556 gboolean has_stderr;
00557
00558 } capability;
00559
00560
00562 extern capability *capable;
00563
00564 #ifdef HAVE_JACK_JACK_H
00565 #include "jack.h"
00566 #endif
00567
00568 #include <inttypes.h>
00569
00570
00571 #include "plugins.h"
00572 #include "colourspace.h"
00573 #include "paramspecial.h"
00574 #include "multitrack.h"
00575 #include "mainwindow.h"
00576 #include "keyboard.h"
00577 #include "preferences.h"
00578
00579 extern mainwindow *mainw;
00580
00581
00582
00583 #include <sys/time.h>
00584 struct timeval tv;
00585
00586
00588 extern size_t sizint, sizdbl, sizshrt;
00589
00590
00591
00592 typedef enum {
00593 CLIP_DETAILS_BPP,
00594 CLIP_DETAILS_FPS,
00595 CLIP_DETAILS_PB_FPS,
00596 CLIP_DETAILS_WIDTH,
00597 CLIP_DETAILS_HEIGHT,
00598 CLIP_DETAILS_UNIQUE_ID,
00599 CLIP_DETAILS_ARATE,
00600 CLIP_DETAILS_PB_ARATE,
00601 CLIP_DETAILS_ACHANS,
00602 CLIP_DETAILS_ASIGNED,
00603 CLIP_DETAILS_AENDIAN,
00604 CLIP_DETAILS_ASAMPS,
00605 CLIP_DETAILS_FRAMES,
00606 CLIP_DETAILS_TITLE,
00607 CLIP_DETAILS_AUTHOR,
00608 CLIP_DETAILS_COMMENT,
00609 CLIP_DETAILS_PB_FRAMENO,
00610 CLIP_DETAILS_FILENAME,
00611 CLIP_DETAILS_CLIPNAME,
00612 CLIP_DETAILS_HEADER_VERSION,
00613 CLIP_DETAILS_KEYWORDS,
00614 CLIP_DETAILS_INTERLACE
00615 } lives_clip_details_t;
00616
00617
00618 typedef enum {
00619 LIVES_CURSOR_NORMAL=0,
00620 LIVES_CURSOR_BLOCK,
00621 LIVES_CURSOR_AUDIO_BLOCK,
00622 LIVES_CURSOR_BUSY,
00623 LIVES_CURSOR_FX_BLOCK
00624 } lives_cursor_t;
00625
00626
00627
00628
00629
00630
00631
00632 void create_LiVES (void);
00633 void enable_record (void);
00634 void toggle_record (void);
00635 void disable_record (void);
00636
00637
00638 process* create_processing (const gchar *text);
00639 void add_to_winmenu(void);
00640 void remove_from_winmenu(void);
00641 void make_play_window(void);
00642 void resize_play_window (void);
00643 void kill_play_window (void);
00644 void make_preview_box (void);
00645 void add_to_playframe (void);
00646 GtkWidget* create_cdtrack_dialog (gint type, gpointer user_data);
00647 GtkTextView *create_output_textview(void);
00648 gchar *choose_file(gchar *dir, gchar *fname, gchar **filt, GtkFileChooserAction act, GtkWidget *extra);
00649
00650
00651
00652 gboolean do_progress_dialog(gboolean visible, gboolean cancellable, const gchar *text);
00653 gboolean do_warning_dialog(const gchar *text);
00654 gboolean do_warning_dialog_with_check(const gchar *text, gint warn_mask_number);
00655 gboolean do_warning_dialog_with_check_transient(const gchar *text, gint warn_mask_number, GtkWindow *transient);
00656 gboolean do_yesno_dialog(const gchar *text);
00657 void do_error_dialog(const gchar *text);
00658 void do_error_dialog_with_check(const gchar *text, gint warn_mask_number);
00659 void do_blocking_error_dialog(const gchar *text);
00660 void do_error_dialog_with_check_transient(const gchar *text, gboolean is_blocking,gint warn_mask_number, GtkWindow *transient);
00661 void add_warn_check (GtkBox *box, gint warn_mask_number);
00662 void do_memory_error_dialog (void);
00663 void too_many_files(void);
00664 void tempdir_warning (void);
00665 void do_audio_import_error(void);
00666 void do_mt_backup_space_error(lives_mt *, gint memreq_mb);
00667
00668 gboolean do_clipboard_fps_warning(void);
00669 void perf_mem_warning(void);
00670 void do_dvgrab_error(void);
00671 gboolean do_comments_dialog (file *sfile, gchar *filename);
00672 void do_auto_dialog(const gchar *text, gint type);
00673 void do_encoder_acodec_error (void);
00674 void do_encoder_sox_error(void);
00675 gboolean rdet_suggest_values (gint width, gint height, gdouble fps, gint fps_num, gint fps_denom, gint arate, gint asigned, gboolean anr, gboolean ignore_fps);
00676 gboolean do_encoder_restrict_dialog (gint width, gint height, gdouble fps, gint fps_num, gint fps_denom, gint arate, gint asigned, gboolean anr);
00677 void do_keys_window (void);
00678 void do_mt_keys_window (void);
00679 void do_messages_window (void);
00680 void do_firstever_dialog (void);
00681 void do_upgrade_error_dialog(void);
00682 void do_no_mplayer_sox_error(void);
00683 void do_aud_during_play_error(void);
00684 void do_rendered_fx_dialog(void);
00685 void do_layout_scrap_file_error(void);
00686 void do_set_load_lmap_error(void);
00687 gboolean do_set_duplicate_warning (const gchar *new_set);
00688 gboolean do_set_rename_old_layouts_warning(const gchar *new_set);
00689 gboolean do_layout_alter_frames_warning(void);
00690 gboolean do_layout_alter_audio_warning(void);
00691 gboolean do_yuv4m_open_warning(void);
00692 void do_mt_undo_mem_error(void);
00693 void do_mt_undo_buf_error(void);
00694 void do_mt_set_mem_error(gboolean has_mt, gboolean trans);
00695 void do_mt_audchan_error(gint warn_mask);
00696 void do_mt_no_audchan_error(void);
00697 void do_mt_no_jack_error(gint warn_mask);
00698 gboolean do_mt_rect_prompt(void);
00699 void do_audrate_error_dialog(void);
00700 gboolean do_event_list_warning(void);
00701 void do_nojack_rec_error(void);
00702 void do_vpp_palette_error (void);
00703 void do_vpp_fps_error (void);
00704 void do_decoder_palette_error (void);
00705 void do_rmem_max_error (gint size);
00706 gboolean do_original_lost_warning(const gchar *fname);
00707 void do_no_decoder_error(const gchar *fname);
00708 void do_jack_noopen_warn(void);
00709 void do_jack_noopen_warn2(void);
00710 void do_jack_noopen_warn3(void);
00711 void do_jack_noopen_warn4(void);
00712 void do_file_perm_error(const gchar *file_name);
00713 void do_dir_perm_error(const gchar *dir_name);
00714 void do_encoder_img_ftm_error(render_details *rdet);
00715 void do_after_crash_warning (void);
00716 void do_bad_layout_error(void);
00717 void do_card_in_use_error(void);
00718 void do_dev_busy_error(const gchar *devstr);
00719 gboolean do_existing_subs_warning(void);
00720 void do_invalid_subs_error(void);
00721 gboolean do_erase_subs_warning(void);
00722 gboolean do_sub_type_warning(const gchar *ext, const gchar *type_ext);
00723 gboolean do_move_tmpdir_dialog(void);
00724 void do_set_locked_warning (const gchar *setname);
00725 void do_no_in_vdevs_error(void);
00726 void do_locked_in_vdevs_error(void);
00727 void do_do_not_close_d (void);
00728
00729 gboolean process_one (gboolean visible);
00730 void do_threaded_dialog(const gchar *text, gboolean has_cancel);
00731 void end_threaded_dialog(void);
00732 void response_ok (GtkButton *button, gpointer user_data);
00733 void response_cancel (GtkButton *button, gpointer user_data);
00734 void pump_io_chan(GIOChannel *iochan);
00735
00736 void do_splash_progress(void);
00737
00738
00739
00740 void d_print_cancelled(void);
00741 void d_print_failed(void);
00742 void d_print_done(void);
00743 void d_print_file_error_failed(void);
00744
00745
00746 void do_text_window (const gchar *title, const gchar *text);
00747
00748
00749 gboolean add_file_info(const gchar *check_handle, gboolean aud_only);
00750 void save_file_comments (int fileno);
00751 void reget_afilesize (int fileno);
00752 void deduce_file(const gchar *filename, gdouble start_time, gint end);
00753 void open_file (const gchar *filename);
00754 void open_file_sel(const gchar *file_name,gdouble start_time, gint frames);
00755 void open_fw_device (void);
00756 gboolean get_new_handle(gint index, const gchar *name);
00757 gboolean get_temp_handle(gint index, gboolean create);
00758 void get_handle_from_info_file(gint index);
00759 void create_cfile(void);
00760 void save_file (gboolean existing, gchar *n_file_name);
00761 void play_file (void);
00762 gboolean save_frame(gint clip, gint frame, const gchar *file_name, gint width, gint height);
00763 void wait_for_stop (const gchar *stop_command);
00764 void save_clip_values(gint which_file);
00765 void add_to_recovery_file (const gchar *handle);
00766 void rewrite_recovery_file(void);
00767 gboolean check_for_recovery_files (gboolean auto_recover);
00768 void recover_layout_map(gint numclips);
00769 const gchar *get_deinterlace_string(void);
00770
00771
00772 void backup_file(const gchar *filename);
00773 gint save_event_frames(void);
00774 void write_headers (file *file);
00775
00776
00777 void restore_file(const gchar *filename);
00778 gboolean read_headers(const gchar *file_name);
00779
00780
00781 void open_set_file (const gchar *set_name, gint clipnum);
00782
00783
00784
00785 gboolean open_scrap_file (void);
00786 gint save_to_scrap_file (weed_plant_t *layer);
00787 gboolean load_from_scrap_file(weed_plant_t *layer, int frame);
00788 void close_scrap_file (void);
00789
00790
00791
00792 void catch_sigint(int signum);
00793 gboolean startup_message_fatal(const gchar *msg);
00794 gboolean startup_message_nonfatal(const gchar *msg);
00795 gboolean startup_message_nonfatal_dismissable(const gchar *msg, gint warning_mask);
00796 capability *get_capabilities(void);
00797 void get_monitors(void);
00798 void load_start_image(gint frame);
00799 void load_end_image(gint frame);
00800 void load_preview_image(gboolean update_always);
00801
00802 gboolean pull_frame(weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc);
00803 gboolean pull_frame_at_size (weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc, int width, int height, int target_palette);
00804 GdkPixbuf *pull_gdk_pixbuf_at_size(gint clip, gint frame, const gchar *image_ext, weed_timecode_t tc, gint width, gint height, GdkInterpType interp);
00805
00806 void load_frame_image(gint frame);
00807 void sensitize(void);
00808 void desensitize(void);
00809 void procw_desensitize(void);
00810 void close_current_file (gint file_to_switch_to);
00811 void get_next_free_file(void);
00812 void switch_to_file(gint old_file, gint new_file);
00813 void do_quick_switch (gint new_file);
00814 void resize (gdouble scale);
00815 GdkPixbuf *lives_scale_simple (GdkPixbuf *, gint width, gint height);
00816 gboolean read_file_details(const gchar *file_name, gboolean only_check_for_audio);
00817 void do_start_messages(void);
00818 void set_palette_colours (void);
00819 void set_main_title(const gchar *filename, gint or_untitled_number);
00820 void set_record (void);
00821
00822
00823 weed_plant_t *weed_layer_new_from_video(gint fnum, gint frame);
00824
00825
00826 void fade_background(void);
00827 void unfade_background(void);
00828 void block_expose (void);
00829 void unblock_expose (void);
00830 void frame_size_update(void);
00831 void splash_init(void);
00832 void splash_end(void);
00833 void splash_msg(const gchar *msg, gdouble pct);
00834
00835
00836 #ifdef IS_IRIX
00837 void setenv(const char *name, const char *val, int _xx);
00838 #endif
00839
00840 LIVES_INLINE float LEFloat_to_BEFloat(float f);
00841 int lives_10pow(int pow);
00842 int get_approx_ln(guint val);
00843 void lives_free(gpointer ptr);
00844 void lives_free_with_check(gpointer ptr);
00845 LIVES_INLINE gint myround(gdouble n);
00846 void get_dirname(gchar *filename);
00847 void get_basename(gchar *filename);
00848 void get_filename(gchar *filename, gboolean strip_dir);
00849 gchar *get_extension(const gchar *filename);
00850 void d_print(const gchar *text);
00851 void init_clipboard(void);
00852 void cache_file_contents(const gchar *filename);
00853 gchar *get_val_from_cached_list(const gchar *key, size_t maxlen);
00854 void get_pref(const gchar *key, gchar *val, gint maxlen);
00855 void get_pref_utf8(const gchar *key, gchar *val, gint maxlen);
00856 void get_pref_default(const gchar *key, gchar *val, gint maxlen);
00857 gboolean get_boolean_pref(const gchar *key);
00858 gdouble get_double_pref(const gchar *key);
00859 gint get_int_pref(const gchar *key);
00860 void get_location(const gchar *exe, gchar *val, gint maxlen);
00861 void set_pref (const gchar *key, const gchar *value);
00862 void set_boolean_pref(const gchar *key, gboolean value);
00863 void set_double_pref(const gchar *key, gdouble value);
00864 void set_int_pref(const gchar *key, gboolean value);
00865 gboolean apply_prefs(gboolean skip_warnings);
00866 void save_future_prefs(void);
00867 void set_menu_text(GtkWidget *menu, const gchar *text, gboolean use_mnemonic);
00868 void get_menu_text(GtkWidget *menu, gchar *text);
00869 void get_menu_text_long(GtkWidget *menuitem, gchar *text);
00870 gint get_box_child_index (GtkBox *box, GtkWidget *tchild);
00871 void reset_clip_menu (void);
00872 void get_play_times(void);
00873 void get_total_time (file *file);
00874 guint get_signed_endian (gboolean is_signed, gboolean little_endian);
00875 void fullscreen_internal(void);
00876 void unhide_cursor(GdkWindow *window);
00877 void hide_cursor(GdkWindow *window);
00878 void set_alwaysontop(GtkWidget *window, gboolean ontop);
00879 void colour_equal(GdkColor *c1, const GdkColor *c2);
00880 void switch_to_int_player(void);
00881 void switch_to_mplayer(void);
00882 void switch_aud_to_sox(void);
00883 gboolean switch_aud_to_jack(void);
00884 gboolean switch_aud_to_pulse(void);
00885 void switch_aud_to_mplayer(void);
00886 void prepare_to_play_foreign(void);
00887 gboolean after_foreign_play(void);
00888 gboolean check_file(const gchar *file_name, gboolean check_exists);
00889 gboolean check_dir_access (const gchar *dir);
00890 gulong get_file_size(int fd);
00891 gulong sget_file_size(const gchar *name);
00892 gulong get_fs_free(const gchar *dir);
00893 gboolean ensure_isdir(gchar *fname);
00894 gchar *ensure_extension(const gchar *fname, const gchar *ext) WARN_UNUSED;
00895 gboolean check_dev_busy(gchar *devstr);
00896 void activate_url_inner(const gchar *link);
00897 void activate_url (GtkAboutDialog *about, const gchar *link, gpointer data);
00898 void show_manual_section (const gchar *lang, const gchar *section);
00899
00900 LIVES_INLINE gdouble calc_time_from_frame (gint clip, gint frame);
00901 LIVES_INLINE gint calc_frame_from_time (gint filenum, gdouble time);
00902 LIVES_INLINE gint calc_frame_from_time2 (gint filenum, gdouble time);
00903 LIVES_INLINE gint calc_frame_from_time3 (gint filenum, gdouble time);
00904
00905 gboolean check_for_ratio_fps (gdouble fps);
00906 gdouble get_ratio_fps(const gchar *string);
00907 void calc_maxspect(gint rwidth, gint rheight, gint *cwidth, gint *cheight);
00908
00909 gchar *remove_trailing_zeroes(gdouble val);
00910 void toggle_button_toggle (GtkToggleButton *tbutton);
00911 void remove_layout_files(GList *lmap);
00912 gboolean add_lmap_error(lives_lmap_error_t lerror, const gchar *name, gpointer user_data, gint clipno, gint frameno, gdouble atime, gboolean affects_current);
00913 void clear_lmap_errors(void);
00914 gboolean prompt_remove_layout_files(void);
00915 gboolean is_legal_set_name(const gchar *set_name, gboolean allow_dupes);
00916 gchar *repl_tmpdir(const gchar *entry, gboolean fwd);
00917 gboolean get_clip_value(int which, lives_clip_details_t, void *retval, size_t maxlen);
00918 void save_clip_value(int which, lives_clip_details_t, void *val);
00919 gboolean check_frame_count(gint idx);
00920 void get_frame_count(gint idx);
00921 gint count_resampled_frames (gint in_frames, gdouble orig_fps, gdouble resampled_fps);
00922 gboolean int_array_contains_value(int *array, int num_elems, int value);
00923 gboolean check_for_lock_file(const gchar *set_name, gint type);
00924 void g_list_free_strings(GList *list);
00925 void gtk_tooltips_copy(GtkWidget *dest, GtkWidget *source);
00926 void adjustment_configure(GtkAdjustment *adjustment, gdouble value, gdouble lower, gdouble upper, gdouble step_increment, gdouble page_increment, gdouble page_size);
00927 gboolean create_event_space(gint length_in_eventsb);
00928 void add_to_recent(const gchar *filename, gdouble start, gint frames, const gchar *file_open_params);
00929 gint verhash (gchar *version);
00930 void set_undoable (const gchar *what, gboolean sensitive);
00931 void set_redoable (const gchar *what, gboolean sensitive);
00932 void zero_spinbuttons (void);
00933 void draw_little_bars (gdouble ptrtime);
00934 void set_sel_label (GtkWidget *label);
00935 void clear_mainw_msg (void);
00936 gint get_token_count (const gchar *string, int delim);
00937 GdkPixmap* gdk_pixmap_copy (GdkPixmap *pixmap);
00938 GdkPixbuf *gdk_pixbuf_new_blank(gint width, gint height, int palette);
00939 void get_border_size (GtkWidget *win, gint *bx, gint *by);
00940 gchar *g_strappend (gchar *string, gint len, const gchar *new);
00941 GList *g_list_append_unique(GList *xlist, const gchar *add);
00942 void find_when_to_stop (void);
00943 gint calc_new_playback_position(gint fileno, gint64 otc, gint64 *ntc);
00944 void minimise_aspect_delta (gdouble allowed_aspect,gint hblock,gint vblock,gint hsize,gint vsize,gint *width,gint *height);
00945 LIVES_INLINE gint get_interp_value(gshort quality);
00946 LIVES_INLINE GList *g_list_move_to_first(GList *list, GList *item) WARN_UNUSED;
00947
00948
00949 GList *get_set_list(const gchar *dir);
00950 void combo_set_popdown_strings (GtkCombo *combo, GList *list);
00951
00952 gchar *subst (const gchar *string, const gchar *from, const gchar *to);
00953
00954 gint hextodec (const gchar *string);
00955 gint get_hex_digit (const gchar *c);
00956
00957 guint32 fastrand(void);
00958 void fastsrand(guint32 seed);
00959
00960 gint lives_list_index (GList *list, const gchar *data);
00961
00962 void set_fg_colour(gint red, gint green, gint blue);
00963 gboolean label_act_toggle (GtkWidget *, GdkEventButton *, GtkToggleButton *);
00964 gboolean widget_act_toggle (GtkWidget *, GtkToggleButton *);
00965
00966 void lives_set_cursor_style(lives_cursor_t cstyle, GdkWindow *window);
00967
00968
00969 gchar *text_view_get_text(GtkTextView *textview);
00970 void text_view_set_text(GtkTextView *textview, const gchar *text);
00971
00972
00973 GList *get_external_window_hints(lives_rfx_t *rfx);
00974 gboolean check_encoder_restrictions (gboolean get_extension, gboolean user_audio);
00975
00976
00977 void lives_exit (void);
00978 void on_check_clicked(void);
00979 void on_fileread_clicked (GtkFileChooser *fch, gpointer widget);
00980 gboolean dirchange_callback (GtkAccelGroup *, GObject *, guint, GdkModifierType, gpointer user_data);
00981
00982
00983 gboolean mt_framedraw(lives_mt *, GdkPixbuf *);
00984
00985
00986 void add_fill_to_box (GtkBox *);
00987
00988
00989 void refresh_rte_window (void);
00990
00991
00992 void *w_memcpy (void *dest, const void *src, size_t n);
00993
00994
00995 gboolean subtitles_init(file *sfile, char * fname, lives_subtitle_type_t);
00996 void subtitles_free(file *sfile);
00997 gboolean get_srt_text(file *sfile, double xtime);
00998 gboolean get_sub_text(file *sfile, double xtime);
00999 gboolean save_sub_subtitles(file *sfile, double start_time, double end_time, double offset_time, const char *filename);
01000 gboolean save_srt_subtitles(file *sfile, double start_time, double end_time, double offset_time, const char *filename);
01001
01002
01003 #ifdef ENABLE_OSC
01004 gboolean lives_osc_init(guint osc_udp_port);
01005 gint lives_osc_poll(gpointer data);
01006 void lives_osc_end(void);
01007 gboolean lives_osc_notify(int msgtype, const char *msgstring);
01008 void lives_osc_notify_success (const gchar *msg);
01009 void lives_osc_notify_failure (void);
01010 void lives_osc_notify_cancel (void);
01011 #include "osc_notify.h"
01012 #endif
01013
01014
01015 #ifdef HAVE_LDVGRAB
01016 void on_open_fw_activate (GtkMenuItem *menuitem, gpointer format);
01017
01018 #define CAM_FORMAT_DV 0
01019 #define CAM_FORMAT_HDV 1
01020
01021 #endif
01022
01023 int dummyvar;
01024 char *dummychar;
01025
01026
01027 #define cfile mainw->files[mainw->current_file]
01028 #define clipboard mainw->files[0]
01029
01030 #define U82L(String) ( g_locale_from_utf8 (String,-1,NULL,NULL,NULL) )
01031 #define L2U8(String) ( g_locale_to_utf8 (String,-1,NULL,NULL,NULL) )
01032
01033
01034 #define PREFS_TIMEOUT 10000000 ///< 10 seconds // TODO !
01035
01036 #define LIVES_TV_CHANNEL1 "http://www.serverwillprovide.com/sorteal/livestvclips/livestv.ogm"
01037
01038
01039 #endif // #ifndef HAS_MAIN_H