LiVES
3.2.0
|
#include <fcntl.h>
#include <dirent.h>
#include <sys/statvfs.h>
#include "main.h"
#include "interface.h"
#include "audio.h"
#include "resample.h"
#include "callbacks.h"
#include "cvirtual.h"
Go to the source code of this file.
Macros | |
#define | ASPECT_ALLOWANCE 0.005 |
#define | AUTOTUNE |
#define | O_DSYNC O_SYNC |
#define | NO_O_DSYNC |
#define | WRITE_ALL |
#define | VER_MAJOR_MULT 1000000 |
#define | VER_MINOR_MULT 1000 |
#define | VER_MICRO_MULT 1 |
#define | BSIZE (8) |
#define | INITSIZE 32 |
#define | BL_LIM 128 |
Functions | |
char * | filename_from_fd (char *val, int fd) |
: return filename from an open fd, freeing val first More... | |
LIVES_GLOBAL_INLINE int | lives_open3 (const char *pathname, int flags, mode_t mode) |
LIVES_GLOBAL_INLINE int | lives_open2 (const char *pathname, int flags) |
LIVES_GLOBAL_INLINE ssize_t | lives_readlink (const char *path, char *buf, size_t bufsiz) |
LIVES_GLOBAL_INLINE boolean | lives_fsync (int fd) |
LIVES_GLOBAL_INLINE void | lives_sync (int times) |
LIVES_GLOBAL_INLINE boolean | lives_setenv (const char *name, const char *value) |
LIVES_GLOBAL_INLINE boolean | lives_unsetenv (const char *name) |
int | lives_system (const char *com, boolean allow_error) |
ssize_t | lives_popen (const char *com, boolean allow_error, char *buff, ssize_t buflen) |
lives_pgid_t | lives_fork (const char *com) |
ssize_t | lives_write (int fd, const void *buf, ssize_t count, boolean allow_fail) |
ssize_t | lives_write_le (int fd, const void *buf, ssize_t count, boolean allow_fail) |
int | lives_fputs (const char *s, FILE *stream) |
char * | lives_fgets (char *s, int size, FILE *stream) |
size_t | lives_fread (void *ptr, size_t size, size_t nmemb, FILE *stream) |
size_t | lives_fread_string (char *buff, size_t stlen, const char *fname) |
lives_file_buffer_t * | find_in_file_buffers (int fd) |
lives_file_buffer_t * | find_in_file_buffers_by_pathname (const char *pathname) |
ssize_t | lives_read (int fd, void *buf, ssize_t count, boolean allow_less) |
ssize_t | lives_read_le (int fd, void *buf, ssize_t count, boolean allow_less) |
void | lives_invalidate_all_file_buffers (void) |
LIVES_GLOBAL_INLINE int | lives_open_buffered_rdonly (const char *pathname) |
boolean | _lives_buffered_rdonly_slurp (int fd, off_t skip) |
void | lives_buffered_rdonly_slurp (int fd, off_t skip) |
LIVES_GLOBAL_INLINE boolean | lives_buffered_rdonly_set_reversed (int fd, boolean val) |
LIVES_GLOBAL_INLINE int | lives_create_buffered (const char *pathname, int mode) |
LIVES_GLOBAL_INLINE int | lives_create_buffered_nosync (const char *pathname, int mode) |
int | lives_open_buffered_writer (const char *pathname, int mode, boolean append) |
int | lives_close_buffered (int fd) |
size_t | get_read_buff_size (int sztype) |
off_t | lives_lseek_buffered_rdonly (int fd, off_t offset) |
off_t | lives_lseek_buffered_rdonly_absolute (int fd, off_t offset) |
ssize_t | lives_read_buffered (int fd, void *buf, ssize_t count, boolean allow_less) |
ssize_t | lives_read_le_buffered (int fd, void *buf, ssize_t count, boolean allow_less) |
boolean | lives_read_buffered_eof (int fd) |
ssize_t | lives_write_buffered (int fd, const char *buf, ssize_t count, boolean allow_fail) |
ssize_t | lives_buffered_write_printf (int fd, boolean allow_fail, const char *fmt,...) |
ssize_t | lives_write_le_buffered (int fd, const void *buf, ssize_t count, boolean allow_fail) |
off_t | lives_lseek_buffered_writer (int fd, off_t offset) |
off_t | lives_buffered_offset (int fd) |
size_t | lives_buffered_orig_size (int fd) |
int | lives_chdir (const char *path, boolean no_error_dlg) |
LIVES_GLOBAL_INLINE boolean | lives_freep (void **ptr) |
LIVES_GLOBAL_INLINE int | lives_kill (lives_pid_t pid, int sig) |
LIVES_GLOBAL_INLINE int | lives_killpg (lives_pgid_t pgrp, int sig) |
LIVES_GLOBAL_INLINE void | clear_mainw_msg (void) |
LIVES_GLOBAL_INLINE uint64_t | lives_10pow (int pow) |
LIVES_GLOBAL_INLINE double | lives_fix (double val, int decimals) |
LIVES_GLOBAL_INLINE uint32_t | get_approx_ln (uint32_t x) |
LIVES_GLOBAL_INLINE uint64_t | get_approx_ln64 (uint64_t x) |
LIVES_GLOBAL_INLINE uint64_t | get_near2pow (uint64_t val) |
void | reset_playback_clock (void) |
ticks_t | lives_get_current_playback_ticks (int64_t origsecs, int64_t orignsecs, lives_time_source_t *time_source) |
LIVES_GLOBAL_INLINE lives_alarm_t | lives_alarm_reset (lives_alarm_t alarm_handle, ticks_t ticks) |
lives_alarm_t | lives_alarm_set (ticks_t ticks) |
set alarm for now + delta ticks (10 nanosec) param ticks (10 nanoseconds) is the offset when we want our alarm to trigger returns int handle or -1 call lives_get_alarm(handle) to test if time arrived More... | |
ticks_t | lives_alarm_check (lives_alarm_t alarm_handle) |
boolean | lives_alarm_clear (lives_alarm_t alarm_handle) |
LIVES_GLOBAL_INLINE float | LEFloat_to_BEFloat (float f) |
LIVES_GLOBAL_INLINE double | calc_time_from_frame (int clip, int frame) |
LIVES_GLOBAL_INLINE int | calc_frame_from_time (int filenum, double time) |
nearest frame [1, frames] More... | |
LIVES_GLOBAL_INLINE int | calc_frame_from_time2 (int filenum, double time) |
nearest frame [1, frames+1] More... | |
LIVES_GLOBAL_INLINE int | calc_frame_from_time3 (int filenum, double time) |
nearest frame rounded down, [1, frames+1] More... | |
LIVES_GLOBAL_INLINE int | calc_frame_from_time4 (int filenum, double time) |
nearest frame, no maximum More... | |
void | calc_aframeno (int fileno) |
frames_t | calc_new_playback_position (int fileno, ticks_t otc, ticks_t *ntc) |
void | calc_maxspect (int rwidth, int rheight, int *cwidth, int *cheight) |
void | calc_minspect (int rwidth, int rheight, int *cwidth, int *cheight) |
void | calc_midspect (int rwidth, int rheight, int *cwidth, int *cheight) |
void | init_clipboard (void) |
weed_plant_t * | get_nth_info_message (int n) |
char * | dump_messages (int start, int end) |
int | free_n_msgs (int frval) |
int | add_messages_to_list (const char *text) |
boolean | d_print_urgency (double timeout, const char *fmt,...) |
boolean | d_print_overlay (double timeout, const char *fmt,...) |
void | d_print (const char *fmt,...) |
LIVES_GLOBAL_INLINE void | d_print_cancelled (void) |
LIVES_GLOBAL_INLINE void | d_print_failed (void) |
LIVES_GLOBAL_INLINE void | d_print_done (void) |
LIVES_GLOBAL_INLINE void | d_print_file_error_failed (void) |
LIVES_GLOBAL_INLINE void | d_print_enough (int frames) |
void | buffer_lmap_error (lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current) |
void | unbuffer_lmap_errors (boolean add) |
boolean | add_lmap_error (lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current) |
void | clear_lmap_errors (void) |
boolean | check_for_lock_file (const char *set_name, int type) |
check for set lock file do this via the back-end (smogrify) this allows for the locking scheme to be more flexible More... | |
boolean | do_std_checks (const char *type_name, const char *type, size_t maxlen, const char *nreject) |
boolean | is_legal_set_name (const char *set_name, boolean allow_dupes, boolean leeway) |
LIVES_GLOBAL_INLINE const char * | get_image_ext_for_type (lives_img_type_t imgtype) |
LIVES_GLOBAL_INLINE lives_img_type_t | lives_image_ext_to_img_type (const char *img_ext) |
LIVES_GLOBAL_INLINE const char * | image_ext_to_lives_image_type (const char *img_ext) |
LIVES_GLOBAL_INLINE lives_img_type_t | lives_image_type_to_img_type (const char *lives_img_type) |
LIVES_GLOBAL_INLINE char * | make_image_file_name (lives_clip_t *sfile, frames_t frame, const char *img_ext) |
lives_image_type can be a string, lives_img_type_t is an enumeration More... | |
boolean | check_frame_count (int idx, boolean last_checked) |
check number of frames is correct for files of type CLIP_TYPE_DISK More... | |
int | get_frame_count (int idx, int start) |
sets mainw->files[idx]->frames with current framecount More... | |
boolean | get_frames_sizes (int fileno, int frame, int *hsize, int *vsize) |
boolean | lives_string_ends_with (const char *string, const char *fmt,...) |
void | get_dirname (char *filename) |
char * | get_dir (const char *filename) |
LIVES_GLOBAL_INLINE void | get_basename (char *filename) |
LIVES_GLOBAL_INLINE void | get_filename (char *filename, boolean strip_dir) |
LIVES_GLOBAL_INLINE char * | lives_get_filename (char *uri) |
return filename (no dir, no .ext) More... | |
char * | get_extension (const char *filename) |
char * | ensure_extension (const char *fname, const char *ext) |
LIVES_GLOBAL_INLINE char * | lives_ellipsize (char *txt, size_t maxlen, LiVESEllipsizeMode mode) |
LIVES_GLOBAL_INLINE char * | lives_pad (char *txt, size_t minlen, int align) |
LIVES_GLOBAL_INLINE char * | lives_pad_ellipsize (char *txt, size_t fixlen, int palign, LiVESEllipsizeMode emode) |
boolean | ensure_isdir (char *fname) |
boolean | dirs_equal (const char *dira, const char *dirb) |
void | get_location (const char *exe, char *val, int maxlen) |
LIVES_LOCAL_INLINE lives_presence_t | has_executable (const char *exe) |
boolean | check_for_executable (lives_checkstatus_t *cap, const char *exec) |
uint64_t | get_version_hash (const char *exe, const char *sep, int piece) |
uint64_t | make_version_hash (const char *ver) |
char * | unhash_version (uint64_t version) |
char * | repl_workdir (const char *entry, boolean fwd) |
void | remove_layout_files (LiVESList *map) |
LIVES_GLOBAL_INLINE void | get_play_times (void) |
recalculate video / audio lengths and draw the timer bars More... | |
void | update_play_times (void) |
like get_play_times, but will force redraw of audio waveforms More... | |
void | get_total_time (lives_clip_t *file) |
calculate laudio, raudio and video time (may be deprecated and replaced with macros) More... | |
void | find_when_to_stop (void) |
void | minimise_aspect_delta (double aspect, int hblock, int vblock, int hsize, int vsize, int *width, int *height) |
void | zero_spinbuttons (void) |
boolean | switch_aud_to_jack (boolean set_in_prefs) |
boolean | switch_aud_to_pulse (boolean set_in_prefs) |
boolean | switch_aud_to_sox (boolean set_in_prefs) |
void | switch_aud_to_none (boolean set_in_prefs) |
boolean | prepare_to_play_foreign (void) |
boolean | after_foreign_play (void) |
LIVES_GLOBAL_INLINE boolean | int_array_contains_value (int *array, int num_elems, int value) |
void | reset_clipmenu (void) |
boolean | check_file (const char *file_name, boolean check_existing) |
check if file exists More... | |
int | lives_rmdir (const char *dir, boolean force) |
int | lives_rmdir_with_parents (const char *dir) |
int | lives_rm (const char *file) |
int | lives_rmglob (const char *files) |
int | lives_cp (const char *from, const char *to) |
int | lives_cp_recursive (const char *from, const char *to, boolean incl_dir) |
int | lives_cp_keep_perms (const char *from, const char *to) |
int | lives_mv (const char *from, const char *to) |
int | lives_touch (const char *tfile) |
int | lives_ln (const char *from, const char *to) |
int | lives_chmod (const char *target, const char *mode) |
int | lives_cat (const char *from, const char *to, boolean append) |
int | lives_echo (const char *text, const char *to, boolean append) |
void | lives_kill_subprocesses (const char *dirname, boolean kill_parent) |
void | lives_suspend_resume_process (const char *dirname, boolean suspend) |
boolean | check_dir_access (const char *dir, boolean leaveit) |
void | activate_url_inner (const char *link) |
void | activate_url (LiVESAboutDialog *about, const char *link, livespointer data) |
void | show_manual_section (const char *lang, const char *section) |
void | wait_for_bg_audio_sync (int fileno) |
boolean | create_event_space (int length) |
int | lives_list_strcmp_index (LiVESList *list, livesconstpointer data, boolean case_sensitive) |
void | add_to_recent (const char *filename, double start, frames_t frames, const char *extra_params) |
int | verhash (char *xv) |
void | set_undoable (const char *what, boolean sensitive) |
void | set_redoable (const char *what, boolean sensitive) |
void | set_sel_label (LiVESWidget *sel_label) |
LIVES_GLOBAL_INLINE void | lives_list_free_strings (LiVESList *list) |
LIVES_GLOBAL_INLINE void | lives_slist_free_all (LiVESSList **list) |
LIVES_GLOBAL_INLINE void | lives_list_free_all (LiVESList **list) |
LIVES_GLOBAL_INLINE void | cached_list_free (LiVESList **list) |
void | print_cache (LiVESList *cache) |
LiVESList * | cache_file_contents (const char *filename) |
char * | get_val_from_cached_list (const char *key, size_t maxlen, LiVESList *cache) |
char * | clip_detail_to_string (lives_clip_details_t what, size_t *maxlenp) |
boolean | get_clip_value (int which, lives_clip_details_t what, void *retval, size_t maxlen) |
boolean | save_clip_value (int which, lives_clip_details_t what, void *val) |
LiVESList * | get_set_list (const char *dir, boolean utf8) |
boolean | check_for_ratio_fps (double fps) |
double | get_ratio_fps (const char *string) |
char * | remove_trailing_zeroes (double val) |
uint32_t | get_signed_endian (boolean is_signed, boolean little_endian) |
produce bitmapped value More... | |
size_t | get_token_count (const char *string, int delim) |
char * | get_nth_token (const char *string, const char *delim, int pnumber) |
int | lives_utf8_strcasecmp (const char *s1, const char *s2) |
LIVES_GLOBAL_INLINE int | lives_utf8_strcmp (const char *s1, const char *s2) |
LIVES_GLOBAL_INLINE LiVESList * | lives_list_sort_alpha (LiVESList *list, boolean fwd) |
char * | subst (const char *xstring, const char *from, const char *to) |
char * | insert_newlines (const char *text, int maxwidth) |
LIVES_GLOBAL_INLINE int | hextodec (const char *string) |
boolean | is_writeable_dir (const char *dir) |
boolean | lives_make_writeable_dir (const char *newdir) |
LIVES_GLOBAL_INLINE LiVESInterpType | get_interp_value (short quality, boolean low_for_mt) |
LIVES_GLOBAL_INLINE LiVESList * | buff_to_list (const char *buffer, const char *delim, boolean allow_blanks, boolean strip) |
LIVES_GLOBAL_INLINE LiVESList * | lives_list_append_unique (LiVESList *xlist, const char *add) |
LIVES_GLOBAL_INLINE LiVESList * | lives_list_move_to_first (LiVESList *list, LiVESList *item) |
LiVESList * | lives_list_delete_string (LiVESList *list, const char *string) |
LIVES_GLOBAL_INLINE LiVESList * | lives_list_copy_strings (LiVESList *list) |
boolean | string_lists_differ (LiVESList *alist, LiVESList *blist) |
#define WRITE_ALL |
boolean _lives_buffered_rdonly_slurp | ( | int | fd, |
off_t | skip | ||
) |
Definition at line 641 of file utils.c.
Referenced by lives_buffered_rdonly_slurp().
void activate_url | ( | LiVESAboutDialog * | about, |
const char * | link, | ||
livespointer | data | ||
) |
Definition at line 4624 of file utils.c.
Referenced by on_about_activate().
void activate_url_inner | ( | const char * | link | ) |
Definition at line 4607 of file utils.c.
Referenced by activate_url(), donate_activate(), email_author_activate(), help_translate_activate(), report_bug_activate(), show_manual_section(), and suggest_feature_activate().
boolean add_lmap_error | ( | lives_lmap_error_t | lerror, |
const char * | name, | ||
livespointer | user_data, | ||
int | clipno, | ||
int | frameno, | ||
double | atime, | ||
boolean | affects_current | ||
) |
Definition at line 2673 of file utils.c.
Referenced by on_close_activate(), recover_layout_map(), and unbuffer_lmap_errors().
int add_messages_to_list | ( | const char * | text | ) |
void add_to_recent | ( | const char * | filename, |
double | start, | ||
frames_t | frames, | ||
const char * | extra_params | ||
) |
boolean after_foreign_play | ( | void | ) |
Definition at line 4193 of file utils.c.
Referenced by on_capture_activate().
LIVES_GLOBAL_INLINE LiVESList* buff_to_list | ( | const char * | buffer, |
const char * | delim, | ||
boolean | allow_blanks, | ||
boolean | strip | ||
) |
void buffer_lmap_error | ( | lives_lmap_error_t | lerror, |
const char * | name, | ||
livespointer | user_data, | ||
int | clipno, | ||
int | frameno, | ||
double | atime, | ||
boolean | affects_current | ||
) |
LiVESList* cache_file_contents | ( | const char * | filename | ) |
Definition at line 4909 of file utils.c.
Referenced by reload_clip().
LIVES_GLOBAL_INLINE void cached_list_free | ( | LiVESList ** | list | ) |
Definition at line 4881 of file utils.c.
Referenced by reload_clip(), and reload_set().
void calc_aframeno | ( | int | fileno | ) |
Definition at line 1845 of file utils.c.
Referenced by calc_new_playback_position().
LIVES_GLOBAL_INLINE int calc_frame_from_time | ( | int | filenum, |
double | time | ||
) |
nearest frame [1, frames]
Definition at line 1759 of file utils.c.
Referenced by all_expose_overlay(), do_quick_switch(), on_hrule_reset(), on_hrule_set(), on_hrule_update(), on_mouse_sel_start(), on_mouse_sel_update(), play_all(), and play_sel().
LIVES_GLOBAL_INLINE int calc_frame_from_time2 | ( | int | filenum, |
double | time | ||
) |
nearest frame [1, frames+1]
Definition at line 1768 of file utils.c.
Referenced by on_mouse_sel_start(), and on_mouse_sel_update().
LIVES_GLOBAL_INLINE int calc_frame_from_time3 | ( | int | filenum, |
double | time | ||
) |
nearest frame rounded down, [1, frames+1]
Definition at line 1778 of file utils.c.
Referenced by on_mouse_sel_start(), and on_mouse_sel_update().
LIVES_GLOBAL_INLINE int calc_frame_from_time4 | ( | int | filenum, |
double | time | ||
) |
nearest frame, no maximum
Definition at line 1788 of file utils.c.
Referenced by lives_ce_update_timeline(), play_all(), render_events(), storeclip_callback(), and update_sel_menu().
void calc_maxspect | ( | int | rwidth, |
int | rheight, | ||
int * | cwidth, | ||
int * | cheight | ||
) |
Definition at line 2174 of file utils.c.
Referenced by get_letterbox_sizes(), and get_player_size().
void calc_midspect | ( | int | rwidth, |
int | rheight, | ||
int * | cwidth, | ||
int * | cheight | ||
) |
void calc_minspect | ( | int | rwidth, |
int | rheight, | ||
int * | cwidth, | ||
int * | cheight | ||
) |
if we are scratching we do the following: the time since the last call is considered to have happened at an increased fps (fwd or back) we recalculate the frame at ntc as if we were at the faster framerate.
the frame number changed, but we will recalulate the value using mainw->deltaticks
retain the fractional part for next time
or subtracted from the selection end (backwards) [if we started backwards then the boundary crossing will be with the
must set norecurse, otherwise we can end up in an infinite loop since dirchange_callback calls this function
????
LIVES_GLOBAL_INLINE double calc_time_from_frame | ( | int | clip, |
int | frame | ||
) |
Definition at line 1756 of file utils.c.
Referenced by event_list_close_gaps(), find_when_to_stop(), lives_ce_update_timeline(), and set_sel_label().
Definition at line 4542 of file utils.c.
Referenced by check_workdir_valid(), lives_make_writeable_dir(), on_utube_select(), and send_to_trash().
boolean check_for_executable | ( | lives_checkstatus_t * | cap, |
const char * | exec | ||
) |
Definition at line 3434 of file utils.c.
Referenced by activate_x11_window(), check_snap(), explain_missing_activate(), get_capabilities(), get_dir_size(), get_wid_for_name(), get_x11_visible(), hide_x11_window(), on_open_utube_activate(), on_utube_select(), open_ascrap_file(), open_scrap_file(), run_youtube_dialog(), send_to_trash(), sensitize(), trash_rb(), and unhide_x11_window().
boolean check_for_lock_file | ( | const char * | set_name, |
int | type | ||
) |
check for set lock file do this via the back-end (smogrify) this allows for the locking scheme to be more flexible
smogrify indicates a lock very simply by by writing > 0 bytes to stdout we read this via popen
type == 0 for load, type == 1 for save
Definition at line 2894 of file utils.c.
Referenced by is_legal_set_name(), and reload_set().
boolean check_for_ratio_fps | ( | double | fps | ) |
Definition at line 5361 of file utils.c.
Referenced by add_to_clipmenu(), and on_resample_vid_ok().
check number of frames is correct for files of type CLIP_TYPE_DISK
use a "goldilocks" algorithm (just the right frames, not too few and not too many)
ignores gaps
make sure nth frame is there...
...make sure n + 1 th frame is not
too many frames
just right
void clear_lmap_errors | ( | void | ) |
Definition at line 2858 of file utils.c.
Referenced by on_lerrors_clear_clicked().
LIVES_GLOBAL_INLINE void clear_mainw_msg | ( | void | ) |
Definition at line 1435 of file utils.c.
Referenced by check_for_lock_file(), do_auto_dialog(), load_rfx_preview(), on_cancel_keep_button_clicked(), on_encoder_entry_changed(), realfx_progress(), reload_set(), and render_events().
char* clip_detail_to_string | ( | lives_clip_details_t | what, |
size_t * | maxlenp | ||
) |
Definition at line 4980 of file utils.c.
Referenced by do_header_missing_detail_error(), get_clip_value(), and save_clip_value().
boolean create_event_space | ( | int | length | ) |
Definition at line 4660 of file utils.c.
Referenced by event_list_to_block().
void d_print | ( | const char * | fmt, |
... | |||
) |
Definition at line 2542 of file utils.c.
Referenced by add_file_info(), build_init_config(), camready(), check_rfx_for_lives(), close_current_file(), d_print_urgency(), do_audio_import_error(), do_effect(), do_read_failed_error_s(), do_set_noclips_error(), do_system_failed_error(), do_write_failed_error_s(), dprint_recneg(), get_best_audio(), lives2lives_read_stream(), lives_exit(), load_decoders(), load_event_list(), load_rte_defs(), load_vpp_defaults(), mt_change_vals_activate(), mt_clear_timeline(), on_capture_activate(), on_change_speed_ok_clicked(), on_del_node_clicked(), on_delete_rfx_activate(), on_effects_paused(), on_erase_subs_activate(), on_export_proj_activate(), on_export_rfx_activate(), on_fade_audio_activate(), on_import_proj_activate(), on_import_rfx_activate(), on_import_theme_activate(), on_load_cdtrack_ok_clicked(), on_load_subs_activate(), on_normalise_audio_activate(), on_paste_as_new_activate(), on_promote_rfx_activate(), on_rebuild_rfx_activate(), on_recaudclip_ok_clicked(), on_record_perf_activate(), on_redo_activate(), on_render_activate(), on_resample_vid_ok(), on_resaudio_ok_clicked(), on_rev_clipboard_activate(), on_save_rte_defs_activate(), on_undo_activate(), on_vj_realize_activate(), on_vppa_save_clicked(), open_decoder_plugin(), open_raw1394(), open_vid_playback_plugin(), pad_init_silence(), play_file(), print_layout_wiped(), remove_layout_files(), render_to_clip(), resample_clipboard(), resize_message_area(), resize_widgets_for_monitor(), rfxbuilder_to_script(), and start_render_effect_events().
LIVES_GLOBAL_INLINE void d_print_cancelled | ( | void | ) |
Definition at line 2610 of file utils.c.
Referenced by d_print_enough(), do_effect(), on_cancel_keep_button_clicked(), on_normalise_audio_activate(), on_recaudclip_ok_clicked(), on_utube_select(), and reload_set().
LIVES_GLOBAL_INLINE void d_print_done | ( | void | ) |
Definition at line 2620 of file utils.c.
Referenced by add_file_info(), do_effect(), load_rte_defs(), load_vpp_defaults(), on_delete_rfx_activate(), on_export_proj_activate(), on_export_rfx_activate(), on_fade_audio_activate(), on_import_proj_activate(), on_import_rfx_activate(), on_import_theme_activate(), on_load_cdtrack_ok_clicked(), on_normalise_audio_activate(), on_paste_as_new_activate(), on_promote_rfx_activate(), on_rebuild_rfx_activate(), on_recaudclip_ok_clicked(), on_redo_activate(), on_rev_clipboard_activate(), on_save_rte_defs_activate(), on_vj_realize_activate(), on_vppa_save_clicked(), pad_init_silence(), render_to_clip(), and rfxbuilder_to_script().
LIVES_GLOBAL_INLINE void d_print_enough | ( | int | frames | ) |
Definition at line 2630 of file utils.c.
Referenced by add_file_info(), on_cancel_keep_button_clicked(), and on_vj_realize_activate().
LIVES_GLOBAL_INLINE void d_print_failed | ( | void | ) |
Definition at line 2615 of file utils.c.
Referenced by apply_rte_audio_init(), do_effect(), lives2lives_read_stream(), load_vpp_defaults(), on_delete_rfx_activate(), on_export_proj_activate(), on_export_rfx_activate(), on_fade_audio_activate(), on_import_proj_activate(), on_import_rfx_activate(), on_import_theme_activate(), on_load_cdtrack_ok_clicked(), on_normalise_audio_activate(), on_paste_as_new_activate(), on_promote_rfx_activate(), on_recaudclip_ok_clicked(), on_redo_activate(), on_rev_clipboard_activate(), on_utube_select(), on_vj_realize_activate(), render_to_clip(), resample_clipboard(), rfxbuilder_to_script(), and start_render_effect_events().
LIVES_GLOBAL_INLINE void d_print_file_error_failed | ( | void | ) |
Definition at line 2625 of file utils.c.
Referenced by load_rte_defs(), load_vpp_defaults(), on_save_rte_defs_activate(), on_save_set_activate(), and rfxbuilder_to_script().
boolean d_print_overlay | ( | double | timeout, |
const char * | fmt, | ||
... | |||
) |
Definition at line 2523 of file utils.c.
Referenced by on_volch_pressed(), and show_sync_callback().
boolean d_print_urgency | ( | double | timeout, |
const char * | fmt, | ||
... | |||
) |
boolean dirs_equal | ( | const char * | dira, |
const char * | dirb | ||
) |
boolean do_std_checks | ( | const char * | type_name, |
const char * | type, | ||
size_t | maxlen, | ||
const char * | nreject | ||
) |
Definition at line 2929 of file utils.c.
Referenced by is_legal_set_name(), and on_import_theme_activate().
char* dump_messages | ( | int | start, |
int | end | ||
) |
Definition at line 2338 of file utils.c.
Referenced by do_messages_window().
char* ensure_extension | ( | const char * | fname, |
const char * | ext | ||
) |
boolean ensure_isdir | ( | char * | fname | ) |
Definition at line 3346 of file utils.c.
Referenced by check_workdir_valid(), and dirs_equal().
char* filename_from_fd | ( | char * | val, |
int | fd | ||
) |
: return filename from an open fd, freeing val first
in case of error function returns val
if fd is a buffered file then the function just returns the known name, else the name is procured from /proc
call like: foo = filename_from_fd(foo,fd); lives_free(foo); input param foo can be NULL or some (non-const) string buffer if non-NULL the old value will be freed, so e.g
char *badfile = NULL; while (condition) { .... if (failed) badfile = filename_from_fd(badfile, fd); } if (badfile != NULL) lives_free(badfile);
or:
char *badfile = NULL; badfile = filename_from_fd(badfile, fd); if (badfile == NULL) // error getting filename
Definition at line 60 of file utils.c.
Referenced by lives_write().
lives_file_buffer_t* find_in_file_buffers | ( | int | fd | ) |
Definition at line 401 of file utils.c.
Referenced by _lives_buffered_rdonly_slurp(), filename_from_fd(), get_file_size(), lives_buffered_offset(), lives_buffered_orig_size(), lives_buffered_rdonly_set_reversed(), lives_buffered_rdonly_slurp(), lives_close_buffered(), lives_lseek_buffered_rdonly(), lives_lseek_buffered_rdonly_absolute(), lives_lseek_buffered_writer(), lives_read_buffered(), lives_read_buffered_eof(), and lives_write_buffered().
lives_file_buffer_t* find_in_file_buffers_by_pathname | ( | const char * | pathname | ) |
void find_when_to_stop | ( | void | ) |
Definition at line 3722 of file utils.c.
Referenced by on_loop_cont_activate(), and on_loop_video_activate().
int free_n_msgs | ( | int | frval | ) |
Definition at line 2381 of file utils.c.
Referenced by pref_factory_int().
LIVES_GLOBAL_INLINE uint32_t get_approx_ln | ( | uint32_t | x | ) |
LIVES_GLOBAL_INLINE uint64_t get_approx_ln64 | ( | uint64_t | x | ) |
Definition at line 1458 of file utils.c.
Referenced by get_near2pow().
LIVES_GLOBAL_INLINE void get_basename | ( | char * | filename | ) |
Definition at line 3194 of file utils.c.
Referenced by get_filename(), on_filesel_button_clicked(), on_import_rfx_activate(), on_save_subs_activate(), and reload_clip().
boolean get_clip_value | ( | int | which, |
lives_clip_details_t | what, | ||
void * | retval, | ||
size_t | maxlen | ||
) |
ascrap_file now uses a different header name; this is to facilitate diskspace cleanup otherwise it may be wrongly classified as a recoverable clip (here this is largely academic, since the values are only read during crash recovery, and the header should have been cached)
Definition at line 5039 of file utils.c.
Referenced by get_decoder_cdata(), open_set_file(), and reload_clip().
char* get_dir | ( | const char * | filename | ) |
Definition at line 3185 of file utils.c.
Referenced by get_capabilities(), and on_filesel_button_clicked().
void get_dirname | ( | char * | filename | ) |
Definition at line 3167 of file utils.c.
Referenced by do_write_failed_error_s(), do_write_failed_error_s_with_retry(), get_dir(), on_filesel_button_clicked(), on_ok_file_open_clicked(), on_save_subs_activate(), reload_clip(), and save_frame().
char* get_extension | ( | const char * | filename | ) |
Definition at line 3217 of file utils.c.
Referenced by do_comments_dialog(), and on_filesel_button_clicked().
LIVES_GLOBAL_INLINE void get_filename | ( | char * | filename, |
boolean | strip_dir | ||
) |
Definition at line 3205 of file utils.c.
Referenced by create_comments_dialog(), and on_load_subs_activate().
int get_frame_count | ( | int | idx, |
int | start | ||
) |
sets mainw->files[idx]->frames with current framecount
calls smogrify which physically finds the last frame using a (fast) O(log n) binary search method for CLIP_TYPE_DISK only (CLIP_TYPE_FILE should use the decoder plugin frame count)
Definition at line 3109 of file utils.c.
Referenced by add_file_info(), check_for_bad_ffmpeg(), do_effect(), load_frame_image(), and on_toy_activate().
boolean get_frames_sizes | ( | int | fileno, |
int | frame, | ||
int * | hsize, | ||
int * | vsize | ||
) |
LIVES_GLOBAL_INLINE const char* get_image_ext_for_type | ( | lives_img_type_t | imgtype | ) |
Definition at line 3025 of file utils.c.
Referenced by add_file_info(), check_clip_integrity(), check_for_bad_ffmpeg(), check_frame_count(), clean_images_from_virtual(), deorder_frames(), do_effect(), do_encoder_img_fmt_error(), do_imgfmts_error(), get_frames_sizes(), insert_blank_frames(), load_frame_image(), load_rfx_preview(), make_image_file_name(), on_cancel_keep_button_clicked(), on_capture_activate(), on_paste_as_new_activate(), on_redo_activate(), on_rev_clipboard_activate(), render_events(), reorder_frames(), resample_clipboard(), resolve_img_type(), save_frame(), and virtual_to_images().
LIVES_GLOBAL_INLINE LiVESInterpType get_interp_value | ( | short | quality, |
boolean | low_for_mt | ||
) |
void get_location | ( | const char * | exe, |
char * | val, | ||
int | maxlen | ||
) |
Definition at line 3407 of file utils.c.
Referenced by autolives_toggle(), check_builder_programs(), get_capabilities(), and on_utube_select().
LIVES_GLOBAL_INLINE uint64_t get_near2pow | ( | uint64_t | val | ) |
char* get_nth_token | ( | const char * | string, |
const char * | delim, | ||
int | pnumber | ||
) |
LIVES_GLOBAL_INLINE void get_play_times | ( | void | ) |
recalculate video / audio lengths and draw the timer bars
Definition at line 3672 of file utils.c.
Referenced by load_frame_image(), on_filechooser_cancel_clicked(), on_record_perf_activate(), on_select_all_activate(), on_select_from_start_activate(), on_select_invert_activate(), on_select_last_activate(), on_select_new_activate(), on_select_to_end_activate(), switch_to_file(), and update_play_times().
double get_ratio_fps | ( | const char * | string | ) |
Definition at line 5379 of file utils.c.
Referenced by on_vppa_ok_clicked(), and open_vid_playback_plugin().
LiVESList* get_set_list | ( | const char * | dir, |
boolean | utf8 | ||
) |
Definition at line 5305 of file utils.c.
Referenced by create_rename_dialog().
produce bitmapped value
Definition at line 5408 of file utils.c.
Referenced by add_file_info(), on_ins_silence_details_clicked(), on_recaudclip_ok_clicked(), and on_resaudio_ok_clicked().
size_t get_token_count | ( | const char * | string, |
int | delim | ||
) |
Definition at line 5430 of file utils.c.
Referenced by add_file_info(), add_to_special(), after_foreign_play(), buff_to_list(), do_effect(), drag_from_outside(), feeds_to_audio_filters(), feeds_to_video_filters(), get_best_audio(), get_colour_pref(), get_cpu_load(), get_disk_load(), get_distro_dets(), get_list_pref(), get_mountpoint_for(), get_nth_token(), get_theme_colour_pref(), handle_backend_errors(), layout_audio_is_affected(), lives_parse_font_string(), load_rfx_preview(), make_version_hash(), on_capture_activate(), on_encoder_entry_changed(), on_encoder_ofmt_changed(), on_vpp_advanced_clicked(), on_vppa_ok_clicked(), open_vid_playback_plugin(), perform_rfxbuilder_checks(), render_fx_get_params(), rfxbuilder_to_script(), and script_to_rfxbuilder().
void get_total_time | ( | lives_clip_t * | file | ) |
calculate laudio, raudio and video time (may be deprecated and replaced with macros)
Definition at line 3690 of file utils.c.
Referenced by start_render_effect_events().
char* get_val_from_cached_list | ( | const char * | key, |
size_t | maxlen, | ||
LiVESList * | cache | ||
) |
Definition at line 4966 of file utils.c.
Referenced by get_clip_value(), and get_theme_colour_pref().
uint64_t get_version_hash | ( | const char * | exe, |
const char * | sep, | ||
int | piece | ||
) |
LIVES_LOCAL_INLINE lives_presence_t has_executable | ( | const char * | exe | ) |
Definition at line 3421 of file utils.c.
Referenced by check_for_executable().
LIVES_GLOBAL_INLINE int hextodec | ( | const char * | string | ) |
Definition at line 5694 of file utils.c.
Referenced by prepare_to_play_foreign(), and script_to_rfxbuilder().
LIVES_GLOBAL_INLINE const char* image_ext_to_lives_image_type | ( | const char * | img_ext | ) |
Definition at line 3039 of file utils.c.
Referenced by do_imgfmts_error(), and lives_image_ext_to_img_type().
void init_clipboard | ( | void | ) |
Definition at line 2238 of file utils.c.
Referenced by do_effect().
char* insert_newlines | ( | const char * | text, |
int | maxwidth | ||
) |
< we will insert a nl here
Definition at line 5591 of file utils.c.
Referenced by do_system_failed_error(), ds_critical_msg(), and ds_warning_msg().
LIVES_GLOBAL_INLINE boolean int_array_contains_value | ( | int * | array, |
int | num_elems, | ||
int | value | ||
) |
Definition at line 4284 of file utils.c.
Referenced by get_best_audio().
Definition at line 2975 of file utils.c.
Referenced by idle_reload_set(), on_export_proj_activate(), on_import_proj_activate(), on_load_set_activate(), on_quit_activate(), on_save_set_activate(), and set_new_set_name().
boolean is_writeable_dir | ( | const char * | dir | ) |
Definition at line 5701 of file utils.c.
Referenced by check_workdir_valid(), get_ds_free(), and get_storage_status().
LIVES_GLOBAL_INLINE float LEFloat_to_BEFloat | ( | float | f | ) |
LIVES_GLOBAL_INLINE uint64_t lives_10pow | ( | int | pow | ) |
Definition at line 1438 of file utils.c.
Referenced by lives_fix(), lives_format_storage_space_string(), lives_spin_button_get_snapval(), render_fx_get_params(), and weed_params_to_rfx().
ticks_t lives_alarm_check | ( | lives_alarm_t | alarm_handle | ) |
guard against long interrupts (when debugging for example)
Definition at line 1687 of file utils.c.
Referenced by do_auto_dialog(), load_frame_image(), load_rfx_preview(), on_fade_audio_activate(), preview_audio(), start_audio_stream(), switch_audio_clip(), and wait_for_bg_audio_sync().
boolean lives_alarm_clear | ( | lives_alarm_t | alarm_handle | ) |
Definition at line 1732 of file utils.c.
Referenced by do_auto_dialog(), load_frame_image(), load_rfx_preview(), on_fade_audio_activate(), preview_audio(), start_audio_stream(), switch_audio_clip(), and wait_for_bg_audio_sync().
LIVES_GLOBAL_INLINE lives_alarm_t lives_alarm_reset | ( | lives_alarm_t | alarm_handle, |
ticks_t | ticks | ||
) |
Definition at line 1618 of file utils.c.
Referenced by d_print_overlay(), and lives_alarm_set().
lives_alarm_t lives_alarm_set | ( | ticks_t | ticks | ) |
set alarm for now + delta ticks (10 nanosec) param ticks (10 nanoseconds) is the offset when we want our alarm to trigger returns int handle or -1 call lives_get_alarm(handle) to test if time arrived
Definition at line 1643 of file utils.c.
Referenced by d_print_urgency(), do_auto_dialog(), load_frame_image(), load_rfx_preview(), on_fade_audio_activate(), preview_audio(), start_audio_stream(), switch_audio_clip(), and wait_for_bg_audio_sync().
off_t lives_buffered_offset | ( | int | fd | ) |
Definition at line 1364 of file utils.c.
Referenced by save_srt_subtitles(), and save_sub_subtitles().
LIVES_GLOBAL_INLINE boolean lives_buffered_rdonly_set_reversed | ( | int | fd, |
boolean | val | ||
) |
Definition at line 681 of file utils.c.
Referenced by changed_fps_during_pb().
void lives_buffered_rdonly_slurp | ( | int | fd, |
off_t | skip | ||
) |
Definition at line 671 of file utils.c.
Referenced by load_event_list(), and migrate_layouts().
ssize_t lives_buffered_write_printf | ( | int | fd, |
boolean | allow_fail, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1316 of file utils.c.
Referenced by save_sub_subtitles().
int lives_cat | ( | const char * | from, |
const char * | to, | ||
boolean | append | ||
) |
int lives_chdir | ( | const char * | path, |
boolean | no_error_dlg | ||
) |
returns 0 on success on failure pops up an error dialog, unless no_error_dlg is TRUE
Definition at line 1393 of file utils.c.
Referenced by cd_to_plugin_dir(), close_clip_decoder(), reload_clip(), weed_call_deinit_func(), and weed_call_init_func().
int lives_close_buffered | ( | int | fd | ) |
Definition at line 716 of file utils.c.
Referenced by apply_rte_audio_end(), backup_recording(), lives_exit(), load_frame_index(), load_layout_map(), load_rte_defs(), on_save_rte_defs_activate(), save_frame_index(), save_layout_map(), subtitles_free(), and write_backup_layout_numbering().
int lives_cp | ( | const char * | from, |
const char * | to | ||
) |
Definition at line 4414 of file utils.c.
Referenced by build_init_config(), load_frame_index(), on_export_rfx_activate(), on_import_rfx_activate(), on_load_subs_activate(), on_utube_select(), save_clip_values(), and save_frame_index().
int lives_cp_keep_perms | ( | const char * | from, |
const char * | to | ||
) |
int lives_cp_recursive | ( | const char * | from, |
const char * | to, | ||
boolean | incl_dir | ||
) |
Definition at line 4423 of file utils.c.
Referenced by build_init_config().
LIVES_GLOBAL_INLINE int lives_create_buffered | ( | const char * | pathname, |
int | mode | ||
) |
Definition at line 698 of file utils.c.
Referenced by backup_recording(), lives_exit(), on_save_rte_defs_activate(), save_frame_index(), save_layout_map(), save_srt_subtitles(), save_sub_subtitles(), and write_backup_layout_numbering().
LIVES_GLOBAL_INLINE int lives_create_buffered_nosync | ( | const char * | pathname, |
int | mode | ||
) |
int lives_echo | ( | const char * | text, |
const char * | to, | ||
boolean | append | ||
) |
Definition at line 4500 of file utils.c.
Referenced by add_to_recovery_file().
LIVES_GLOBAL_INLINE char* lives_ellipsize | ( | char * | txt, |
size_t | maxlen, | ||
LiVESEllipsizeMode | mode | ||
) |
eg. txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_END -> txt == "...gh" + NUL txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_START -> txt == "ab..." + NUL txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_MIDDLE -> txt == "a...h" + NUL
Definition at line 3262 of file utils.c.
Referenced by lives_pad_ellipsize().
char* lives_fgets | ( | char * | s, |
int | size, | ||
FILE * | stream | ||
) |
Definition at line 368 of file utils.c.
Referenced by load_rfx_preview(), and reload_set().
LIVES_GLOBAL_INLINE double lives_fix | ( | double | val, |
int | decimals | ||
) |
Definition at line 1446 of file utils.c.
Referenced by changed_fps_during_pb().
lives_pgid_t lives_fork | ( | const char * | com | ) |
Definition at line 288 of file utils.c.
Referenced by autolives_toggle(), rec(), and start_audio_stream().
int lives_fputs | ( | const char * | s, |
FILE * | stream | ||
) |
Definition at line 359 of file utils.c.
Referenced by rfxbuilder_to_script(), and save_clip_value().
size_t lives_fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
FILE * | stream | ||
) |
Definition at line 379 of file utils.c.
Referenced by do_auto_dialog().
size_t lives_fread_string | ( | char * | buff, |
size_t | stlen, | ||
const char * | fname | ||
) |
Definition at line 388 of file utils.c.
Referenced by check_backend_return(), and on_cancel_keep_button_clicked().
LIVES_GLOBAL_INLINE boolean lives_freep | ( | void ** | ptr | ) |
Definition at line 1411 of file utils.c.
Referenced by add_to_clipmenu(), ask_permission_dialog_complex(), backup_recording(), close_current_file(), close_temp_handle(), close_vid_playback_plugin(), d_print_overlay(), d_print_urgency(), del_frame_index(), do_auto_dialog(), do_comments_dialog(), do_rfx_cleanup(), do_warning_dialog_with_check(), do_workdir_query(), do_yesno_dialog_with_check(), enabled_in_channels(), enabled_out_channels(), end_fs_preview(), fill_abuffer_from(), fill_param_vals_to(), get_audio_channel_in(), get_audio_frame_clip(), get_audio_frame_seek(), get_audio_frame_vel(), get_external_window_hints(), get_frame_event_clip(), get_frame_event_frame(), get_monitors(), has_audio_chans_in(), has_audio_chans_out(), has_video_chans_in(), has_video_chans_out(), init_clipboard(), init_event_is_relevant(), insert_audio_event_at(), insert_frames(), interpolate_param(), is_audio_channel_in(), is_audio_channel_out(), lives_ce_update_timeline(), lives_exit(), lives_general_button_clicked(), lives_list_free_strings(), load_frame_image(), load_frame_index(), move_event_left(), mt_change_vals_activate(), multitrack(), num_alpha_channels(), num_in_params(), on_cancel_keep_button_clicked(), on_capture2_activate(), on_capture_activate(), on_effects_paused(), on_export_proj_activate(), on_fade_audio_activate(), on_ins_silence_details_clicked(), on_load_set_activate(), on_multitrack_activate(), on_open_utube_activate(), on_paste_as_new_activate(), on_prefs_close_clicked(), on_recaudclip_ok_clicked(), on_redo_activate(), on_resaudio_ok_clicked(), on_rte_info_clicked(), on_utube_select(), pre_analyse(), prep_audio_player(), pump_io_chan(), reload_clip(), render_events(), render_to_clip(), restore_frame_index_back(), rfx_free(), rfx_free_all(), rfx_params_free(), rte_set_defs_activate(), rte_set_defs_cancel(), sample_silence_stream(), save_event_frames(), send_to_trash(), set_copy_to(), set_new_set_name(), set_string_param(), show_sync_callback(), startup_message_fatal(), stored_event_list_free_undos(), subtitles_free(), switch_to_file(), update_play_times(), weed_apply_audio_instance(), weed_filter_in_paramtmpl(), weed_parameter_has_variable_elements_strict(), and weed_params_to_rfx().
LIVES_GLOBAL_INLINE boolean lives_fsync | ( | int | fd | ) |
ticks_t lives_get_current_playback_ticks | ( | int64_t | origsecs, |
int64_t | orignsecs, | ||
lives_time_source_t * | time_source | ||
) |
synchronised timing it can be helpful to imagine a virtual clock which is at currrent time: clock time - cadjticks = virtual time = other time + adjticks cadjticks and adjticks are only set when we switch from one source to another, i.e the virtual clock will run @ different rates depending on the source. This is fine as it enables sync with the clock source, provided the time doesn't jump when moving from one source to another. when the source changes we then alter either cadjticks or adjticks so that the initial timing matches e.g when switching to clock source, cadjticks and adjticks will have diverged. So we want to set new cadjtick s.t: clock ticks - cadjticks == source ticks + adjticks. i.e cadjticks = clock ticks - (source ticks + adjticks). we use the delta calculated the last time, since the other source may longer be available. this should not be a concern since this function is called very frequently recalling cadjticks_new = clock_ticks - (source_ticks + adjticks), and substituting for delta we get:
conversely, when switching from clock to source, adjticks_new = clock_ticks - cadjticks - source_ticks again, this just delta + adjticks; in this case we can use current delta since it is assumed that the system clock is always available
this scheme does, however introduce a small problem, which is that when the sources are switched, we assume that the time on both clocks is equivalent. This can lead to a problem when switching clips, since temporarily we switch to system time and then back to soundcard. However, this can cause some updates to the timer to be missed, i.e the audio is playing but the samples are not counted, however we cannot simply add these to the soundcard timer, as they will be lost due to the resync. hence we need mainw->syncticks --> a global adjustment which is independant of the clock source. This is similar to mainw->deltaticks for the player, however, deltaticks is a temporary impulse, whereas syncticks is a permanent adjustment.
Definition at line 1481 of file utils.c.
Referenced by aud_lock_callback(), avsync_force(), changed_fps_during_pb(), and resync_audio().
LIVES_GLOBAL_INLINE char* lives_get_filename | ( | char * | uri | ) |
LIVES_GLOBAL_INLINE lives_img_type_t lives_image_ext_to_img_type | ( | const char * | img_ext | ) |
LIVES_GLOBAL_INLINE lives_img_type_t lives_image_type_to_img_type | ( | const char * | lives_img_type | ) |
Definition at line 3046 of file utils.c.
Referenced by lives_image_ext_to_img_type().
LIVES_GLOBAL_INLINE int lives_kill | ( | lives_pid_t | pid, |
int | sig | ||
) |
void lives_kill_subprocesses | ( | const char * | dirname, |
boolean | kill_parent | ||
) |
Definition at line 4516 of file utils.c.
Referenced by close_file(), end_fs_preview(), lives_exit(), on_cancel_keep_button_clicked(), on_paramwindow_button_clicked(), on_stop_clicked(), and on_utube_select().
LIVES_GLOBAL_INLINE int lives_killpg | ( | lives_pgid_t | pgrp, |
int | sig | ||
) |
Definition at line 1432 of file utils.c.
Referenced by autolives_toggle(), on_camstop_clicked(), and stop_audio_stream().
LIVES_GLOBAL_INLINE LiVESList* lives_list_append_unique | ( | LiVESList * | xlist, |
const char * | add | ||
) |
Definition at line 5776 of file utils.c.
Referenced by add_lmap_error(), layout_audio_is_affected(), load_layout_map(), on_close_activate(), and widget_helper_init().
LIVES_GLOBAL_INLINE LiVESList* lives_list_copy_strings | ( | LiVESList * | list | ) |
LiVESList* lives_list_delete_string | ( | LiVESList * | list, |
const char * | string | ||
) |
LIVES_GLOBAL_INLINE void lives_list_free_all | ( | LiVESList ** | list | ) |
Definition at line 4873 of file utils.c.
Referenced by close_current_file(), do_onchange_init(), filter_encoders_by_img_ext(), free_pkg_list(), lives_exit(), on_close_activate(), on_encoder_entry_changed(), on_encoder_ofmt_changed(), on_fx_pre_activate(), on_merge_cancel_clicked(), on_ok_file_open_clicked(), on_prefs_close_clicked(), on_prefs_revert_clicked(), on_render_fx_activate(), on_vpp_advanced_clicked(), prompt_for_script_name(), recover_layout_map(), render_fx_get_params(), reset_ttable(), rfx_free(), rfx_params_free(), script_to_rfxbuilder(), set_rfx_param_by_name_string(), update_visual_params(), and widget_helper_init().
LIVES_GLOBAL_INLINE void lives_list_free_strings | ( | LiVESList * | list | ) |
Definition at line 4860 of file utils.c.
Referenced by lives_list_free_all(), and lives_slist_free_all().
LIVES_GLOBAL_INLINE LiVESList* lives_list_move_to_first | ( | LiVESList * | list, |
LiVESList * | item | ||
) |
Definition at line 5789 of file utils.c.
Referenced by get_decoder_cdata().
LIVES_GLOBAL_INLINE LiVESList* lives_list_sort_alpha | ( | LiVESList * | list, |
boolean | fwd | ||
) |
stable sort, so input list should NOT be freed handles utf-8 strings
Definition at line 5474 of file utils.c.
Referenced by create_rename_dialog().
int lives_list_strcmp_index | ( | LiVESList * | list, |
livesconstpointer | data, | ||
boolean | case_sensitive | ||
) |
Definition at line 4678 of file utils.c.
Referenced by after_string_list_changed(), on_decplug_advanced_clicked(), pkg_in_list(), pref_factory_string_choice(), and set_param_from_list().
off_t lives_lseek_buffered_rdonly | ( | int | fd, |
off_t | offset | ||
) |
Definition at line 895 of file utils.c.
Referenced by read_filter_defaults(), and read_generator_sizes().
off_t lives_lseek_buffered_rdonly_absolute | ( | int | fd, |
off_t | offset | ||
) |
Definition at line 907 of file utils.c.
Referenced by get_float_audio_val_at_time(), and render_events().
boolean lives_make_writeable_dir | ( | const char * | newdir | ) |
create a directory (including parents) and ensure we can actually write to it
Definition at line 5721 of file utils.c.
Referenced by build_init_config(), on_save_set_activate(), and on_utube_select().
int lives_mv | ( | const char * | from, |
const char * | to | ||
) |
Definition at line 4446 of file utils.c.
Referenced by insert_blank_frames(), on_utube_select(), and rewrite_recovery_file().
LIVES_GLOBAL_INLINE int lives_open2 | ( | const char * | pathname, |
int | flags | ||
) |
Definition at line 99 of file utils.c.
Referenced by after_foreign_play(), check_dir_access(), load_layout_map(), load_vpp_defaults(), open_set_file(), send_to_trash(), and start_audio_stream().
LIVES_GLOBAL_INLINE int lives_open3 | ( | const char * | pathname, |
int | flags, | ||
mode_t | mode | ||
) |
Definition at line 94 of file utils.c.
Referenced by save_vpp_defaults().
LIVES_GLOBAL_INLINE int lives_open_buffered_rdonly | ( | const char * | pathname | ) |
Definition at line 636 of file utils.c.
Referenced by load_event_list(), load_frame_index(), load_from_scrap_file(), load_rte_defs(), migrate_layouts(), and subtitles_init().
int lives_open_buffered_writer | ( | const char * | pathname, |
int | mode, | ||
boolean | append | ||
) |
LIVES_GLOBAL_INLINE char* lives_pad | ( | char * | txt, |
size_t | minlen, | ||
int | align | ||
) |
Definition at line 3303 of file utils.c.
Referenced by lives_pad_ellipsize().
LIVES_GLOBAL_INLINE char* lives_pad_ellipsize | ( | char * | txt, |
size_t | fixlen, | ||
int | palign, | ||
LiVESEllipsizeMode | emode | ||
) |
ssize_t lives_popen | ( | const char * | com, |
boolean | allow_error, | ||
char * | buff, | ||
ssize_t | buflen | ||
) |
Definition at line 194 of file utils.c.
Referenced by check_for_lock_file(), get_best_audio(), get_handle_from_info_file(), get_md5sum(), get_num_cpus(), get_plugin_result(), on_import_proj_activate(), and on_render_activate().
ssize_t lives_read | ( | int | fd, |
void * | buf, | ||
ssize_t | count, | ||
boolean | allow_less | ||
) |
Definition at line 460 of file utils.c.
Referenced by check_dir_access(), lives_read_buffered(), lives_read_le(), load_vpp_defaults(), and open_set_file().
ssize_t lives_read_buffered | ( | int | fd, |
void * | buf, | ||
ssize_t | count, | ||
boolean | allow_less | ||
) |
function can be called with buf == NULL to preload a buffer with at least (count) bytes
buffer used up
Definition at line 924 of file utils.c.
Referenced by apply_rte_audio(), get_float_audio_val_at_time(), lives_read_le_buffered(), load_layout_map(), load_rte_defs(), read_filter_defaults(), and read_generator_sizes().
ssize_t lives_read_le | ( | int | fd, |
void * | buf, | ||
ssize_t | count, | ||
boolean | allow_less | ||
) |
Definition at line 486 of file utils.c.
Referenced by load_vpp_defaults(), and open_set_file().
ssize_t lives_read_le_buffered | ( | int | fd, |
void * | buf, | ||
ssize_t | count, | ||
boolean | allow_less | ||
) |
Definition at line 1158 of file utils.c.
Referenced by load_frame_index(), load_layout_map(), read_filter_defaults(), and read_generator_sizes().
LIVES_GLOBAL_INLINE ssize_t lives_readlink | ( | const char * | path, |
char * | buf, | ||
size_t | bufsiz | ||
) |
Definition at line 104 of file utils.c.
Referenced by filename_from_fd().
int lives_rm | ( | const char * | file | ) |
Definition at line 4395 of file utils.c.
Referenced by add_file_info(), after_foreign_play(), backup_recording(), check_dir_access(), clean_images_from_virtual(), clear_audio_stream(), del_frame_index(), deorder_frames(), do_auto_dialog(), do_effect(), init_clipboard(), lives_exit(), lives_yuv_stream_stop_read(), load_vpp_defaults(), mt_load_recovery_layout(), on_cancel_keep_button_clicked(), on_delete_rfx_activate(), on_erase_subs_activate(), on_export_proj_activate(), on_live_tvcard_activate(), on_load_cdtrack_ok_clicked(), on_playclip_activate(), on_redo_activate(), on_render_activate(), on_resaudio_ok_clicked(), on_rev_clipboard_activate(), on_save_set_activate(), on_send_lives2lives_activate(), on_utube_select(), play_all(), prep_audio_player(), recover_layout_cancelled(), remove_layout_files(), render_to_clip(), resample_clipboard(), rewrite_recovery_file(), rfx_clean_exe(), save_clip_values(), save_event_frames(), save_file_comments(), save_layout_map(), save_vpp_defaults(), stop_audio_stream(), and unlock_set_file().
int lives_rmdir | ( | const char * | dir, |
boolean | force | ||
) |
Definition at line 4366 of file utils.c.
Referenced by check_dir_access(), do_write_failed_error_s(), do_write_failed_error_s_with_retry(), get_ds_free(), get_eload_filename(), on_delete_rfx_activate(), on_import_theme_activate(), on_open_utube_activate(), on_promote_rfx_activate(), on_utube_select(), open_ascrap_file(), open_scrap_file(), and save_layout_map().
int lives_rmdir_with_parents | ( | const char * | dir | ) |
Definition at line 4386 of file utils.c.
Referenced by remove_layout_files().
LIVES_GLOBAL_INLINE boolean lives_setenv | ( | const char * | name, |
const char * | value | ||
) |
LIVES_GLOBAL_INLINE void lives_slist_free_all | ( | LiVESSList ** | list | ) |
boolean lives_string_ends_with | ( | const char * | string, |
const char * | fmt, | ||
... | |||
) |
Definition at line 3143 of file utils.c.
Referenced by open_set_file().
void lives_suspend_resume_process | ( | const char * | dirname, |
boolean | suspend | ||
) |
Definition at line 4527 of file utils.c.
Referenced by on_effects_paused(), and on_stop_clicked().
LIVES_GLOBAL_INLINE void lives_sync | ( | int | times | ) |
Definition at line 115 of file utils.c.
Referenced by do_effect(), reget_afilesize_inner(), and wait_for_bg_audio_sync().
int lives_system | ( | const char * | com, |
boolean | allow_error | ||
) |
Definition at line 145 of file utils.c.
Referenced by activate_url_inner(), add_file_info(), add_to_clipmenu(), adjust_clip_volume(), apply_rte_audio_init(), close_current_file(), close_temp_handle(), deorder_frames(), do_effect(), do_rfx_cleanup(), end_fs_preview(), init_clipboard(), lazy_startup_checks(), lives_cat(), lives_chmod(), lives_cp(), lives_cp_keep_perms(), lives_cp_recursive(), lives_echo(), lives_exit(), lives_kill_subprocesses(), lives_ln(), lives_mv(), lives_notify(), lives_rm(), lives_rmdir(), lives_rmdir_with_parents(), lives_rmglob(), lives_suspend_resume_process(), lives_touch(), mini_run(), on_cancel_keep_button_clicked(), on_capture_activate(), on_effects_paused(), on_eject_cd_activate(), on_export_proj_activate(), on_fade_audio_activate(), on_import_proj_activate(), on_import_theme_activate(), on_load_cdtrack_ok_clicked(), on_normalise_audio_activate(), on_paste_as_new_activate(), on_rebuild_rfx_activate(), on_recaudclip_ok_clicked(), on_redo_activate(), on_resaudio_ok_clicked(), on_rev_clipboard_activate(), on_toy_activate(), on_utube_select(), prep_audio_player(), reload_set(), remove_from_clipmenu(), render_to_clip(), resample_clipboard(), save_clip_value(), set_theme_colour_pref(), set_theme_pref(), start_render_effect_events(), stop_audio_stream(), and wait_for_stop().
int lives_touch | ( | const char * | tfile | ) |
Definition at line 4455 of file utils.c.
Referenced by close_current_file(), close_temp_handle(), end_fs_preview(), init_clipboard(), lives_exit(), lock_set_file(), and remove_layout_files().
LIVES_GLOBAL_INLINE boolean lives_unsetenv | ( | const char * | name | ) |
int lives_utf8_strcasecmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 5458 of file utils.c.
Referenced by after_vpp_changed(), lives_list_append_unique(), lives_list_delete_string(), lives_list_strcmp_index(), remove_layout_files(), set_vpp(), and string_lists_differ().
LIVES_GLOBAL_INLINE int lives_utf8_strcmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 5469 of file utils.c.
Referenced by reload_clip().
ssize_t lives_write | ( | int | fd, |
const void * | buf, | ||
ssize_t | count, | ||
boolean | allow_fail | ||
) |
TODO ****: this needs to be threadsafe
Definition at line 309 of file utils.c.
Referenced by check_dir_access(), lives_write_buffered(), and lives_write_le().
ssize_t lives_write_buffered | ( | int | fd, |
const char * | buf, | ||
ssize_t | count, | ||
boolean | allow_fail | ||
) |
Definition at line 1226 of file utils.c.
Referenced by backup_recording(), lives_buffered_write_printf(), lives_exit(), lives_write_le_buffered(), on_save_rte_defs_activate(), save_layout_map(), and write_backup_layout_numbering().
ssize_t lives_write_le | ( | int | fd, |
const void * | buf, | ||
ssize_t | count, | ||
boolean | allow_fail | ||
) |
ssize_t lives_write_le_buffered | ( | int | fd, |
const void * | buf, | ||
ssize_t | count, | ||
boolean | allow_fail | ||
) |
LIVES_GLOBAL_INLINE char* make_image_file_name | ( | lives_clip_t * | sfile, |
frames_t | frame, | ||
const char * | img_ext | ||
) |
lives_image_type can be a string, lives_img_type_t is an enumeration
Definition at line 3053 of file utils.c.
Referenced by check_clip_integrity(), check_for_bad_ffmpeg(), check_frame_count(), clean_images_from_virtual(), do_effect(), get_frames_sizes(), insert_blank_frames(), load_frame_image(), load_from_scrap_file(), and resolve_img_type().
uint64_t make_version_hash | ( | const char * | ver | ) |
convert a version to uint64_t hash, for comparing
Definition at line 3500 of file utils.c.
Referenced by do_effect(), and script_to_rfxbuilder().
void minimise_aspect_delta | ( | double | aspect, |
int | hblock, | ||
int | vblock, | ||
int | hsize, | ||
int | vsize, | ||
int * | width, | ||
int * | height | ||
) |
boolean prepare_to_play_foreign | ( | void | ) |
Definition at line 4055 of file utils.c.
Referenced by on_capture2_activate().
void remove_layout_files | ( | LiVESList * | map | ) |
Definition at line 3559 of file utils.c.
Referenced by on_clear_event_list_activate(), and on_lerrors_delete_clicked().
char* remove_trailing_zeroes | ( | double | val | ) |
Definition at line 5395 of file utils.c.
Referenced by on_vpp_advanced_clicked().
char* repl_workdir | ( | const char * | entry, |
boolean | fwd | ||
) |
Definition at line 3534 of file utils.c.
Referenced by load_layout_map(), remove_layout_files(), and save_layout_map().
void reset_clipmenu | ( | void | ) |
Definition at line 4290 of file utils.c.
Referenced by on_render_activate(), reload_set(), and switch_to_file().
boolean save_clip_value | ( | int | which, |
lives_clip_details_t | what, | ||
void * | val | ||
) |
ascrap_file now uses a different header name; this is to facilitate diskspace cleanup otherwise it may be wrongly classified as a recoverable clip
Definition at line 5175 of file utils.c.
Referenced by do_comments_dialog(), do_effect(), lives_exit(), on_change_speed_ok_clicked(), on_ins_silence_details_clicked(), on_load_cdtrack_ok_clicked(), on_rename_clip_name(), on_vj_reset_activate(), reget_afilesize(), reload_clip(), render_to_clip(), and save_clip_values().
void set_sel_label | ( | LiVESWidget * | sel_label | ) |
Definition at line 4838 of file utils.c.
Referenced by close_current_file(), do_quick_switch(), mt_init_start_end_spins(), and switch_to_file().
void set_undoable | ( | const char * | what, |
boolean | sensitive | ||
) |
Definition at line 4784 of file utils.c.
Referenced by do_effect(), on_change_speed_ok_clicked(), on_cut_activate(), on_fade_audio_activate(), on_fx_pre_activate(), on_load_cdtrack_ok_clicked(), on_normalise_audio_activate(), on_recaudclip_ok_clicked(), on_render_activate(), on_resaudio_ok_clicked(), render_to_clip(), and start_render_effect_events().
void show_manual_section | ( | const char * | lang, |
const char * | section | ||
) |
Definition at line 4629 of file utils.c.
Referenced by show_manual_activate().
boolean string_lists_differ | ( | LiVESList * | alist, |
LiVESList * | blist | ||
) |
char* subst | ( | const char * | xstring, |
const char * | from, | ||
const char * | to | ||
) |
Definition at line 5484 of file utils.c.
Referenced by argv_to_marshalled_list(), array_to_string_list(), drag_from_outside(), ensure_isdir(), param_marshall(), reload_clip(), rfxbuilder_to_script(), script_to_rfxbuilder(), set_rfx_param_by_name_string(), and update_visual_params().
Definition at line 3819 of file utils.c.
Referenced by pref_factory_string().
void switch_aud_to_none | ( | boolean | set_in_prefs | ) |
Definition at line 4001 of file utils.c.
Referenced by handle_audio_timeout(), and pref_factory_string().
Definition at line 3884 of file utils.c.
Referenced by pref_factory_string().
Definition at line 3944 of file utils.c.
Referenced by pref_factory_string().
void unbuffer_lmap_errors | ( | boolean | add | ) |
Definition at line 2656 of file utils.c.
Referenced by on_append_audio_activate(), on_cut_activate(), on_fade_audio_activate(), on_load_cdtrack_ok_clicked(), on_realfx_activate(), on_resaudio_ok_clicked(), and popup_lmap_errors().
char* unhash_version | ( | uint64_t | version | ) |
Definition at line 3522 of file utils.c.
Referenced by do_gamma_import_warn().
void update_play_times | ( | void | ) |
like get_play_times, but will force redraw of audio waveforms
Definition at line 3677 of file utils.c.
Referenced by on_load_cdtrack_ok_clicked(), pref_change_colours(), pref_change_xcolours(), and reget_afilesize().
int verhash | ( | char * | xv | ) |
Definition at line 4755 of file utils.c.
Referenced by do_effect().
void wait_for_bg_audio_sync | ( | int | fileno | ) |
Definition at line 4644 of file utils.c.
Referenced by add_file_info().
void zero_spinbuttons | ( | void | ) |
Definition at line 3807 of file utils.c.
Referenced by close_current_file(), and switch_to_file().