LiVES
3.2.0
|
#include <fcntl.h>
#include <glib.h>
#include "main.h"
#include "callbacks.h"
#include "resample.h"
#include "effects.h"
#include "audio.h"
#include "htmsocket.h"
#include "cvirtual.h"
#include "interface.h"
Go to the source code of this file.
Macros | |
#define | AUDIO_FRAMES_TO_READ 100 |
#define | SECOND_STOP_TIME 0.1 |
#define | STOP_GIVE_UP_TIME 1.0 |
#define | _RELOAD(field) sfile->field = loaded->field |
#define | _RELOAD_STRING(field, len) lives_snprintf(sfile->field, len, "%s", loaded->field) |
#define | DSIZE_MAX 100000 |
Functions | |
boolean | _start_playback (livespointer data) |
LIVES_GLOBAL_INLINE boolean | start_playback (int type) |
LIVES_GLOBAL_INLINE void | start_playback_async (int type) |
boolean | save_clip_values (int which) |
boolean | read_file_details (const char *file_name, boolean is_audio, boolean is_img) |
const char * | get_deinterlace_string (void) |
ulong | deduce_file (const char *file_name, double start, int end) |
ulong | open_file (const char *file_name) |
void | pad_init_silence (void) |
ulong | open_file_sel (const char *file_name, double start, int frames) |
boolean | get_handle_from_info_file (int index) |
void | save_frame (LiVESMenuItem *menuitem, livespointer user_data) |
LIVES_GLOBAL_INLINE void | set_default_comment (lives_clip_t *sfile, const char *extrat) |
void | save_file (int clip, int start, int end, const char *filename) |
char * | prep_audio_player (char *com2, char *com3, frames_t audio_end, int arate, int asigned, int aendian) |
void | play_file (void) |
play the current clip from 'mainw->play_start' to 'mainw->play_end' More... | |
int | close_temp_handle (int new_clip) |
close cfile and switch to new clip (may be -1) More... | |
boolean | get_temp_handle (int index) |
get a temp "handle" from disk. More... | |
lives_clip_t * | create_cfile (int new_file, const char *handle, boolean is_loaded) |
set default values for a clip (in memory) More... | |
LIVES_GLOBAL_INLINE char * | get_untitled_name (int number) |
int | create_nullvideo_clip (const char *handle) |
boolean | get_new_handle (int index, const char *name) |
boolean | add_file_info (const char *check_handle, boolean aud_only) |
boolean | save_file_comments (int fileno) |
void | wait_for_stop (const char *stop_command) |
boolean | save_frame_inner (int clip, int frame, const char *file_name, int width, int height, boolean from_osc) |
void | backup_file (int clip, int start, int end, const char *file_name) |
boolean | write_headers (lives_clip_t *file) |
boolean | read_headers (int fileno, const char *dir, const char *file_name) |
void | open_set_file (int clipnum) |
void | reload_subs (int fileno) |
ulong | restore_file (const char *file_name) |
int | save_event_frames (void) |
void | add_to_ascrap_mb (uint64_t bytes) |
boolean | open_scrap_file (void) |
boolean | open_ascrap_file (void) |
boolean | load_from_scrap_file (weed_layer_t *layer, int frame) |
boolean | check_for_disk_space (boolean fullcheck) |
int | save_to_scrap_file (weed_layer_t *layer) |
void | close_scrap_file (boolean remove) |
void | close_ascrap_file (boolean remove) |
void | recover_layout_map (int numclips) |
boolean | reload_clip (int fileno, int maxframe) |
boolean | restore_clip_binfmt (int clipno) |
lives_clip_t * | clip_forensic (int clipno) |
boolean | recover_files (char *recovery_file, boolean auto_recover) |
void | add_to_recovery_file (const char *handle) |
boolean | rewrite_recovery_file (void) |
boolean | check_for_recovery_files (boolean auto_recover) |
#define _RELOAD | ( | field | ) | sfile->field = loaded->field |
Definition at line 5945 of file saveplay.c.
#define _RELOAD_STRING | ( | field, | |
len | |||
) | lives_snprintf(sfile->field, len, "%s", loaded->field) |
Definition at line 5946 of file saveplay.c.
#define AUDIO_FRAMES_TO_READ 100 |
Definition at line 307 of file saveplay.c.
#define DSIZE_MAX 100000 |
Definition at line 5948 of file saveplay.c.
#define SECOND_STOP_TIME 0.1 |
#define STOP_GIVE_UP_TIME 1.0 |
boolean _start_playback | ( | livespointer | data | ) |
normal play
triggered by generator
play selection
play stream
osc playall
< request notifiction of success
osc playsel
< request notifiction of success
clipboard
yuv4mpeg
do nothing
Definition at line 19 of file saveplay.c.
Referenced by start_playback(), and start_playback_async().
Definition at line 3870 of file saveplay.c.
void add_to_ascrap_mb | ( | uint64_t | bytes | ) |
Definition at line 5225 of file saveplay.c.
void add_to_recovery_file | ( | const char * | handle | ) |
Definition at line 6460 of file saveplay.c.
Referenced by after_foreign_play(), do_effect(), on_paste_as_new_activate(), on_render_activate(), on_toy_activate(), open_ascrap_file(), open_scrap_file(), and render_to_clip().
void backup_file | ( | int | clip, |
int | start, | ||
int | end, | ||
const char * | file_name | ||
) |
Definition at line 4264 of file saveplay.c.
fullcheck == FALSE, we MAY check ds used, and we WILL check free ds using cached value fullcheck == TRUE, we WILL update free ds
value is in BYTES
Definition at line 5416 of file saveplay.c.
CRITICAL: make sure this gets called even on system failure and abort
may fail -> abort
Definition at line 6550 of file saveplay.c.
lives_clip_t* clip_forensic | ( | int | clipno | ) |
Definition at line 6029 of file saveplay.c.
void close_ascrap_file | ( | boolean | remove | ) |
Definition at line 5612 of file saveplay.c.
Referenced by check_for_layout_del(), on_save_set_activate(), and wipe_layout().
void close_scrap_file | ( | boolean | remove | ) |
Definition at line 5583 of file saveplay.c.
Referenced by check_for_layout_del(), on_save_set_activate(), and wipe_layout().
int close_temp_handle | ( | int | new_clip | ) |
close cfile and switch to new clip (may be -1)
note this only closes the disk and basic resources, it does not affect the interface (c.f. close_current_file()) returns new_clip
Definition at line 3498 of file saveplay.c.
Referenced by close_ascrap_file(), close_current_file(), close_file(), on_capture_activate(), on_import_proj_activate(), on_recaudclip_ok_clicked(), and on_utube_select().
lives_clip_t* create_cfile | ( | int | new_file, |
const char * | handle, | ||
boolean | is_loaded | ||
) |
set default values for a clip (in memory)
if new_file == -1 we create (malloc) a new clip and switch to it
if new_file != -1 the parameter "handle" is ignored, and we switch to new_file, without mallocing anything
default values are then set for the clip
WARNING: on success, returns the clip, and changes the value of mainw->current_file !! returns NULL if: new_file is out of range or points to a NULL clip; new_file is -1 and all free clips are in use (unlikely), or malloc fails.
Definition at line 3656 of file saveplay.c.
Referenced by after_foreign_play(), create_nullvideo_clip(), get_new_handle(), open_ascrap_file(), open_scrap_file(), and weed_generator_start().
int create_nullvideo_clip | ( | const char * | handle | ) |
Definition at line 3808 of file saveplay.c.
ulong deduce_file | ( | const char * | file_name, |
double | start, | ||
int | end | ||
) |
Definition at line 238 of file saveplay.c.
Referenced by on_toy_activate().
const char* get_deinterlace_string | ( | void | ) |
Definition at line 230 of file saveplay.c.
boolean get_handle_from_info_file | ( | int | index | ) |
Definition at line 1163 of file saveplay.c.
boolean get_new_handle | ( | int | index, |
const char * | name | ||
) |
Definition at line 3821 of file saveplay.c.
Referenced by init_clipboard(), on_fx_pre_activate(), on_live_tvcard_activate(), on_load_cdtrack_ok_clicked(), on_open_yuv4m_activate(), on_paste_as_new_activate(), on_recaudclip_ok_clicked(), on_render_activate(), prepare_to_play_foreign(), and render_to_clip().
boolean get_temp_handle | ( | int | index | ) |
get a temp "handle" from disk.
Call this to get a temp handle for returning info from the backend (this is deprecated for simple data, use lives_popen() instead whenever possible)
This function is also called from get_new_handle() to create a permanent handle for an opened file.
there are two special instances when this is called with an index != -1:
otherwise, index should be passed in as -1 (the normal case) – handle will be fetched and a directory created in workdir. – clip_type is set to CLIP_TYPE_TEMP. call close_temp_handle() on it after use, then restore mainw->current_file
function returns FALSE if write to workdir fails.
WARNING: this function changes mainw->current_file, unless it returns FALSE (could not create cfile)
get_new_handle() calls this with the index value passed to it, which should not be -1, sets defaults for the clip, and also sets the clip name and filename. That function should be used instead to create permanent clips.
Definition at line 3571 of file saveplay.c.
Referenced by get_new_handle(), on_capture_activate(), on_import_proj_activate(), and on_utube_select().
LIVES_GLOBAL_INLINE char* get_untitled_name | ( | int | number | ) |
Definition at line 3802 of file saveplay.c.
Referenced by open_set_file(), render_to_clip(), and set_main_title().
boolean load_from_scrap_file | ( | weed_layer_t * | layer, |
int | frame | ||
) |
boolean open_ascrap_file | ( | void | ) |
Definition at line 5278 of file saveplay.c.
Referenced by on_record_perf_activate().
ulong open_file | ( | const char * | file_name | ) |
Definition at line 261 of file saveplay.c.
Referenced by on_utube_select(), and switch_to_file().
ulong open_file_sel | ( | const char * | file_name, |
double | start, | ||
int | frames | ||
) |
probe the file to see what it might be...
insert blank frames
Definition at line 309 of file saveplay.c.
Referenced by do_effect(), and on_opensel_range_ok_clicked().
boolean open_scrap_file | ( | void | ) |
Definition at line 5230 of file saveplay.c.
Referenced by load_frame_image().
void open_set_file | ( | int | clipnum | ) |
Definition at line 4864 of file saveplay.c.
void pad_init_silence | ( | void | ) |
Definition at line 293 of file saveplay.c.
Referenced by after_foreign_play().
void play_file | ( | void | ) |
play the current clip from 'mainw->play_start' to 'mainw->play_end'
from now on we can only switch at the designated SWITCH POINT
enable the freeze button
disable ctrl-q since it can be activated by user error
set performance at right place
these values are only relevant for non-realtime audio players (e.g. sox)
play performance data
if we are opening audio or looping we just play to the end of audio, otherwise...
blank the background if asked to
show the frame in the main window
plug the plug into the playframe socket if we need to
create a separate window for the internal player if requested
needed
this doesn't get called if we don't call resize_play_window()
deinit any active real time effects
stop the players before the cache thread, else the players may try to play from a non-existent file
< necessary
kill the separate play window
or resize it back to single size
create the preview in the sepwin
free the last frame image
disable the freeze key
free any pre-cached frame
pop up error dialog if badly sized frames were detected
end record performance
we got an error recording audio
update screen for internal players
need to do this here, in case we want to preview with only a generator and no other clips (which will close to -1)
re-enable generic clip switching
Definition at line 2213 of file saveplay.c.
Referenced by _start_playback(), on_capture2_activate(), on_playsel_activate(), play_all(), and play_sel().
char* prep_audio_player | ( | char * | com2, |
char * | com3, | ||
frames_t | audio_end, | ||
int | arate, | ||
int | asigned, | ||
int | aendian | ||
) |
Definition at line 2133 of file saveplay.c.
Definition at line 207 of file saveplay.c.
boolean read_headers | ( | int | fileno, |
const char * | dir, | ||
const char * | file_name | ||
) |
ascrap_file now uses a different header name; this is to facilitate diskspace cleanup otherwise it may be wrongly classified as a recoverable clip
need to maintain mainw->hdrs_cache in this case, as it may be
mainw->hdrs_cache never set
Definition at line 4465 of file saveplay.c.
dont write an entry yet, in case of the unklikely chance we were assigned the same pid as the recovery file, otherwise we will end up in am endless loop of reloading the same set and appending it to the recovery file in any case, the old file is still there and we will create a fresh recovery file after a succesful reload
reset to original value
reset to original value
load single file
create a new cfile and fill in the details
get file details; this will cache the header in mainw->hdrs_cache
see function reload_set() for detailed comments
CLIP_TYPE_FILE
CLIP_TYPE_DISK
not really from a set, but let's pretend to get the details read the playback fps, play frame, and name
NEED TO maintain mainw->hdrs_cache when entering the function, else it will be considered a legacy file load
Definition at line 6033 of file saveplay.c.
void recover_layout_map | ( | int | numclips | ) |
check for missing frames and audio in layouts
Definition at line 5632 of file saveplay.c.
Referenced by reload_set().
boolean reload_clip | ( | int | fileno, |
int | maxframe | ||
) |
< retain original order to restore for freshly opened clips
Definition at line 5735 of file saveplay.c.
void reload_subs | ( | int | fileno | ) |
Definition at line 4942 of file saveplay.c.
Referenced by reload_clip().
boolean restore_clip_binfmt | ( | int | clipno | ) |
Definition at line 6022 of file saveplay.c.
ulong restore_file | ( | const char * | file_name | ) |
Definition at line 4964 of file saveplay.c.
boolean rewrite_recovery_file | ( | void | ) |
Definition at line 6473 of file saveplay.c.
Referenced by close_ascrap_file(), and remove_from_clipmenu().
boolean save_clip_values | ( | int | which | ) |
Definition at line 103 of file saveplay.c.
Referenced by after_foreign_play(), do_effect(), do_header_write_error(), on_paste_as_new_activate(), on_recaudclip_ok_clicked(), on_redo_activate(), on_render_activate(), on_resaudio_ok_clicked(), on_toy_activate(), and render_to_clip().
int save_event_frames | ( | void | ) |
Definition at line 5121 of file saveplay.c.
void save_file | ( | int | clip, |
int | start, | ||
int | end, | ||
const char * | filename | ||
) |
get extra parameters for saving
re-read values in case they were resampled
flush last of stdout/stderr from plugin
flush last of stdout/stderr from plugin
show iochan (encoder) details
replace letterboxed frames with maxspect frames
save was successful TODO - check for size < 0 !!!
get size of file and show it
TODO - handle file errors !!!!!
Definition at line 1260 of file saveplay.c.
Referenced by on_save_as_activate(), on_save_selection_activate(), on_save_textview_clicked(), and on_vppa_save_clicked().
boolean save_file_comments | ( | int | fileno | ) |
Definition at line 4100 of file saveplay.c.
void save_frame | ( | LiVESMenuItem * | menuitem, |
livespointer | user_data | ||
) |
Definition at line 1186 of file saveplay.c.
Referenced by frame_context().
boolean save_frame_inner | ( | int | clip, |
int | frame, | ||
const char * | file_name, | ||
int | width, | ||
int | height, | ||
boolean | from_osc | ||
) |
Definition at line 4170 of file saveplay.c.
Referenced by save_frame().
int save_to_scrap_file | ( | weed_layer_t * | layer | ) |
Definition at line 5569 of file saveplay.c.
LIVES_GLOBAL_INLINE void set_default_comment | ( | lives_clip_t * | sfile, |
const char * | extrat | ||
) |
Definition at line 1251 of file saveplay.c.
Referenced by on_paste_as_new_activate().
LIVES_GLOBAL_INLINE boolean start_playback | ( | int | type | ) |
Definition at line 94 of file saveplay.c.
Referenced by on_playall_activate(), on_playclip_activate(), and on_playsel_activate().
LIVES_GLOBAL_INLINE void start_playback_async | ( | int | type | ) |
Definition at line 96 of file saveplay.c.
void wait_for_stop | ( | const char * | stop_command | ) |
Definition at line 4139 of file saveplay.c.
boolean write_headers | ( | lives_clip_t * | file | ) |
Definition at line 4394 of file saveplay.c.