51 #ifndef HAS_LIVES_MAIN_H
52 #define HAS_LIVES_MAIN_H
59 #include <gdk/gdkkeysyms.h>
63 #undef GDK_WINDOWING_X11
74 #define O_SYNC (FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH)
79 #include <gdk/gdkwin32.h>
89 #ifdef GDK_WINDOWING_X11
108 #define __STDC_CONSTANT_MACROS
112 #define QUOTEME(x) #x
116 #define MAX_FILES 65535
120 #ifndef PREFIX_DEFAULT
122 #define PREFIX_DEFAULT "/usr"
125 #define PREFIX_DEFAULT "C:\\Program Files\\LiVES"
131 #define PREFIX PREFIX_DEFAULT
137 #define DOC_DIR "/share/doc/lives-"
139 #define THEME_DIR "/share/lives/themes/"
140 #define PLUGIN_SCRIPTS_DIR "/share/lives/plugins/"
141 #define PLUGIN_EXEC_DIR "/lives/plugins/"
142 #define ICON_DIR "/share/lives/icons/"
143 #define DATA_DIR "/share/lives/"
144 #define LIVES_CONFIG_DIR ".lives-dir/"
145 #define LIVES_TMP_NAME "livestmp"
148 #define DOC_DIR "\\Documents/"
150 #define THEME_DIR "\\Themes/"
151 #define PLUGIN_SCRIPTS_DIR "\\Plugins/"
152 #define PLUGIN_EXEC_DIR "\\Plugins/"
153 #define ICON_DIR "\\Icons/"
154 #define DATA_DIR "\\Data/"
155 #define LIVES_CONFIG_DIR "\\Config/"
156 #define LIVES_TMP_NAME "livescache"
159 #define LIVES_DEVICE_DIR "/dev/"
162 #define LIVES_MANUAL_URL "http://lives.sourceforge.net/manual/"
163 #define LIVES_MANUAL_FILENAME "LiVES_manual.html"
164 #define LIVES_AUTHOR_EMAIL "mailto:salsaman@gmail.com"
165 #define LIVES_DONATE_URL "https://sourceforge.net/donate/index.php?group_id=64341"
166 #define LIVES_BUG_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507139"
167 #define LIVES_FEATURE_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507142"
168 #define LIVES_TRANSLATE_URL "https://translations.launchpad.net/lives/trunk"
172 #define off64_t off_t
175 #define lseek64 lseek
179 #define DEF_FILE_PERMS S_IRUSR|S_IWUSR
180 #define DEF_FILE_UMASK (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)^( DEF_FILE_PERMS )
184 #define WARN_FILE_SIZE 500
189 #define ENABLE_DVD_GRAB
193 #ifdef HAVE_MJPEGTOOLS
194 #define HAVE_YUV4MPEG
198 #include <liboil/liboil.h>
202 #define LIVES_INLINE inline
211 #define PATH_MAX MAX_PATH
213 #define PATH_MAX 4096
218 # define WARN_UNUSED __attribute__((warn_unused_result))
224 #define LIVES_LOG "lives.log"
229 typedef void *(*fn_ptr) (
void *ptr);
263 #include <weed/weed.h>
264 #include <weed/weed-events.h>
266 #include "../libweed/weed.h"
267 #include "../libweed/weed-events.h"
394 #define AFORM_SIGNED 0
395 #define AFORM_LITTLE_ENDIAN 0
397 #define AFORM_UNSIGNED 1
398 #define AFORM_BIG_ENDIAN (1<<1)
399 #define AFORM_UNKNOWN 65536
453 #define LIVES_CLIP_HEADER_VERSION 100
569 #define FX_FRAME_PUMP_VAL 200
571 #define IMG_BUFF_SIZE 4096
579 gchar mime_type[256];
645 gchar startup_msg[256];
666 #define LIVES_LITTLE_ENDIAN G_LITTLE_ENDIAN
667 #define LIVES_BIG_ENDIAN G_BIG_ENDIAN
677 #ifdef HAVE_JACK_JACK_H
681 #define __STDC_FORMAT_MACROS
682 #include <inttypes.h>
687 #if defined __x86_64__
688 # define __WORDSIZE 64
689 #ifndef __WORDSIZE_COMPAT32
690 # define __WORDSIZE_COMPAT32 1
693 # define __WORDSIZE 32
697 #ifndef __PRI64_PREFIX
698 # if __WORDSIZE == 64
699 # define __PRI64_PREFIX "l"
701 # define __PRI64_PREFIX "ll"
705 # define PRId64 __PRI64_PREFIX "d"
706 # define PRIu64 __PRI64_PREFIX "u"
707 #endif // ifndef PRI64d
723 #include <sys/time.h>
771 gchar *
choose_file(gchar *dir, gchar *fname, gchar **filt, GtkFileChooserAction act,
const char *title, GtkWidget *extra);
776 gboolean
do_progress_dialog(gboolean visible, gboolean cancellable,
const gchar *text);
786 GtkWindow *transient);
803 gchar *
ds_warning_msg(const gchar *dir, guint64 dsval, guint64 cwarn, guint64 nwarn);
825 gboolean
rdet_suggest_values (gint width, gint height, gdouble fps, gint fps_num, gint fps_denom, gint arate,
826 gint asigned, gboolean swap_endian, gboolean anr, gboolean ignore_fps);
828 gint arate, gint asigned, gboolean swap_endian, gboolean anr, gboolean save_all);
891 void response_ok (GtkButton *button, gpointer user_data);
908 gboolean
add_file_info(const gchar *check_handle, gboolean aud_only);
911 void deduce_file(const gchar *filename, gdouble start_time, gint end);
913 void open_file_sel(const gchar *file_name,gdouble start_time, gint frames);
919 void save_file (
int clip,
int start,
int end, const
char *filename);
921 void save_frame (GtkMenuItem *menuitem, gpointer user_data);
922 gboolean
save_frame_inner(gint clip, gint frame, const gchar *file_name, gint width, gint height, gboolean auto_overwrite);
932 void backup_file(
int clip,
int start,
int end, const gchar *filename);
964 gboolean
pull_frame(weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc);
965 gboolean
pull_frame_at_size (weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc,
966 int width,
int height,
int target_palette);
968 int width,
int height, LiVESInterpType interp);
970 int quality, gboolean do_chmod, GError **gerrorptr);
980 void resize (gdouble scale);
981 gboolean
read_file_details(const gchar *file_name, gboolean only_check_for_audio);
984 void set_main_title(const gchar *filename, gint or_untitled_number);
1001 void splash_msg(const gchar *msg, gdouble pct);
1006 int lives_system(const
char *com, gboolean allow_error);
1008 ssize_t
lives_write(
int fd, const
void *buf,
size_t count, gboolean allow_fail);
1009 ssize_t
lives_write_le(
int fd, const
void *buf,
size_t count, gboolean allow_fail);
1010 ssize_t
lives_read(
int fd,
void *buf,
size_t count, gboolean allow_less);
1011 ssize_t
lives_read_le(
int fd,
void *buf,
size_t count, gboolean allow_less);
1012 int lives_chdir(const
char *path, gboolean allow_fail);
1014 char *
lives_fgets(
char *s,
int size, FILE *stream);
1022 gboolean lives_win32_suspend_resume_process(DWORD pid, gboolean suspend);
1023 gboolean lives_win32_kill_subprocesses(DWORD pid, gboolean kill_parent);
1024 int lives_win32_get_num_logical_cpus(
void);
1030 ssize_t
lives_readlink(
const char *path,
char *buf,
size_t bufsiz);
1031 boolean lives_setenv(
const char *name,
const char *value);
1051 gchar *
get_dir(
const gchar *filename);
1053 void get_filename(gchar *filename, gboolean strip_dir);
1056 void d_print(
const gchar *text);
1060 void get_pref(
const gchar *key, gchar *val, gint maxlen);
1061 void get_pref_utf8(
const gchar *key, gchar *val, gint maxlen);
1067 void get_location(
const gchar *exe, gchar *val, gint maxlen);
1068 void set_pref (
const gchar *key,
const gchar *value);
1077 void set_menu_text(GtkWidget *menu,
const gchar *text, gboolean use_mnemonic);
1095 gboolean
check_file(
const gchar *file_name, gboolean check_exists);
1105 void activate_url (GtkAboutDialog *about,
const gchar *link, gpointer data);
1115 void calc_maxspect(gint rwidth, gint rheight, gint *cwidth, gint *cheight);
1121 gint clipno, gint frameno, gdouble atime, gboolean affects_current);
1125 gchar *
repl_tmpdir(
const gchar *entry, gboolean fwd);
1137 void add_to_recent(
const gchar *filename, gdouble start, gint frames,
const gchar *file_open_params);
1139 void set_undoable (
const gchar *what, gboolean sensitive);
1140 void set_redoable (
const gchar *what, gboolean sensitive);
1147 gchar *
g_strappend (gchar *
string, gint len,
const gchar *newbit);
1152 void minimise_aspect_delta (gdouble allowed_aspect,gint hblock,gint vblock,gint hsize,gint vsize,gint *width,gint *height);
1163 gchar *
subst (
const gchar *
string,
const gchar *from,
const gchar *to);
1166 gint
hextodec (
const gchar *
string);
1184 gboolean
dirchange_callback (GtkAccelGroup *, GObject *, guint, GdkModifierType, gpointer user_data);
1201 void *
lives_memcpy(
void *dest,
const void *src,
size_t n);
1214 gboolean
save_sub_subtitles(file *sfile,
double start_time,
double end_time,
double offset_time,
const char *filename);
1215 gboolean
save_srt_subtitles(file *sfile,
double start_time,
double end_time,
double offset_time,
const char *filename);
1219 gboolean lives_osc_init(guint osc_udp_port);
1220 gint lives_osc_poll(gpointer data);
1221 void lives_osc_end(
void);
1222 gboolean lives_osc_notify(
int msgtype,
const char *msgstring);
1223 void lives_osc_notify_success (
const gchar *msg);
1224 void lives_osc_notify_failure (
void);
1225 void lives_osc_notify_cancel (
void);
1233 #define CAM_FORMAT_DV 0
1234 #define CAM_FORMAT_HDV 1
1239 #define cfile mainw->files[mainw->current_file]
1240 #define clipboard mainw->files[0]
1242 #define U82L(String) ( g_locale_from_utf8 (String,-1,NULL,NULL,NULL) )
1243 #define L2U8(String) ( g_locale_to_utf8 (String,-1,NULL,NULL,NULL) )
1246 #define PREFS_TIMEOUT 10000000
1248 #define LIVES_TV_CHANNEL1 "http://www.serverwillprovide.com/sorteal/livestvclips/livestv.ogm"
1252 #define CEIL(a,b) ((int)(((double)a+(double)b-.000000001)/((double)b))*b)
1257 #define LIVES_NO_DEBUG
1259 #ifndef LIVES_NO_DEBUG
1260 #define LIVES_DEBUG(x) fprintf(stderr, "LiVES debug: %s\n", x)
1261 #else // LIVES_NO_DEBUG
1262 #define LIVES_DEBUG(x) dummychar = x
1263 #endif // LIVES_NO_DEBUG
1264 #endif // LIVES_DEBUG
1267 #ifndef LIVES_NO_INFO
1268 #define LIVES_INFO(x) fprintf(stderr, "LiVES info: %s\n", x)
1269 #else // LIVES_NO_INFO
1270 #define LIVES_INFO(x) dummychar = x
1271 #endif // LIVES_NO_INFO
1272 #endif // LIVES_INFO
1275 #ifndef LIVES_NO_WARN
1276 #define LIVES_WARN(x) fprintf(stderr, "LiVES warning: %s\n", x)
1277 #else // LIVES_NO_WARN
1278 #define LIVES_WARN(x) dummychar = x
1279 #endif // LIVES_NO_WARN
1280 #endif // LIVES_WARN
1283 #ifndef LIVES_NO_ERROR
1284 #define LIVES_ERROR(x) fprintf(stderr, "LiVES error: %s\n", x)
1285 #else // LIVES_NO_ERROR
1286 #define LIVES_ERROR(x) dummychar = x
1287 #endif // LIVES_NO_ERROR
1288 #endif // LIVES_ERROR
1291 #ifndef LIVES_NO_FATAL
1292 #define LIVES_FATAL(x) {fprintf(stderr, "LiVES fatal: %s\n", x); raise (LIVES_SIGSEGV);}
1293 #else // LIVES_NO_FATAL
1294 #define LIVES_FATAL(x) dummychar = x
1295 #endif // LIVES_NO_FATAL
1296 #endif // LIVES_FATAL
1299 #endif // #ifndef HAS_LIVES_MAIN_H