51 #ifndef HAS_LIVES_MAIN_H
52 #define HAS_LIVES_MAIN_H
60 #include <gdk/gdkkeysyms.h>
62 #if GTK_CHECK_VERSION(3,0,0)
82 #define O_SYNC (FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH)
88 #ifndef GDK_WINDOWING_WIN32
89 #define GDK_WINDOWING_WIN32
96 #ifndef GDK_WINDOWING_X11
97 #define GDK_WINDOWING_X11
110 #ifdef GDK_WINDOWING_WIN32
111 #include <gdk/gdkwin32.h>
113 #ifndef GDK_IS_WIN32_DISPLAY
114 #define GDK_IS_WIN32_DISPLAY(display) (TRUE)
117 #endif //GDK_WINDOWING_WIN32
119 #ifdef GDK_WINDOWING_X11
124 #include <gdk/gdkx.h>
126 #ifndef GDK_IS_X11_DISPLAY
127 #define GDK_IS_X11_DISPLAY(display) (TRUE)
130 #ifndef GDK_IS_WIN32_DISPLAY
131 #define GDK_IS_WIN32_DISPLAY(display) (FALSE)
137 #ifndef GDK_IS_X11_DISPLAY
138 #define GDK_IS_X11_DISPLAY(display) (FALSE)
141 #endif // GDK_WINDOWING_X11
154 #define __STDC_CONSTANT_MACROS
158 #define QUOTEME(x) #x
162 #define MAX_FILES 65535
166 #ifndef PREFIX_DEFAULT
168 #define PREFIX_DEFAULT "/usr"
171 #define PREFIX_DEFAULT "C:\\Program Files\\LiVES"
177 #define PREFIX PREFIX_DEFAULT
183 #define DOC_DIR "/share/doc/lives-"
185 #define THEME_DIR "/share/lives/themes/"
186 #define PLUGIN_SCRIPTS_DIR "/share/lives/plugins/"
187 #define PLUGIN_COMPOUND_DIR "/share/lives/plugins/"
188 #define PLUGIN_EXEC_DIR "/lives/plugins/"
189 #define ICON_DIR "/share/lives/icons/"
190 #define DESKTOP_ICON_DIR "/share/app-install/icons/"
191 #define DATA_DIR "/share/lives/"
192 #define LIVES_CONFIG_DIR ".lives-dir/"
193 #define LIVES_TMP_NAME "livestmp"
196 #define DOC_DIR "\\Documents/"
198 #define THEME_DIR "\\Themes/"
199 #define PLUGIN_SCRIPTS_DIR "\\Plugins/"
200 #define PLUGIN_COMPOUND_DIR "\\Plugins/"
201 #define PLUGIN_EXEC_DIR "\\Plugins/"
202 #define ICON_DIR "\\Icons/"
203 #define DATA_DIR "\\Data/"
204 #define LIVES_CONFIG_DIR "\\Config/"
205 #define LIVES_TMP_NAME "livescache"
208 #define LIVES_DEVICE_DIR "/dev/"
211 #define LIVES_MANUAL_URL "http://lives.sourceforge.net/manual/"
212 #define LIVES_MANUAL_FILENAME "LiVES_manual.html"
213 #define LIVES_AUTHOR_EMAIL "mailto:salsaman@gmail.com"
214 #define LIVES_DONATE_URL "https://sourceforge.net/donate/index.php?group_id=64341"
215 #define LIVES_BUG_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507139"
216 #define LIVES_FEATURE_URL "http://sourceforge.net/tracker/?group_id=64341&atid=507142"
217 #define LIVES_TRANSLATE_URL "https://translations.launchpad.net/lives/trunk"
221 #define off64_t off_t
224 #define lseek64 lseek
228 #define DEF_FILE_PERMS S_IRUSR|S_IWUSR
229 #define DEF_FILE_UMASK (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)^( DEF_FILE_PERMS )
233 #define WARN_FILE_SIZE 500
238 #define MAX_FRAME_WIDTH 100000.
239 #define MAX_FRAME_HEIGHT 100000.
241 #define ENABLE_DVD_GRAB
245 #ifdef HAVE_MJPEGTOOLS
246 #define HAVE_YUV4MPEG
250 #include <liboil/liboil.h>
254 #define LIVES_INLINE inline
263 #define PATH_MAX MAX_PATH
265 #define PATH_MAX 4096
270 # define WARN_UNUSED __attribute__((warn_unused_result))
276 #define LIVES_LOG "lives.log"
281 typedef void *(*fn_ptr) (
void *ptr);
315 #include <weed/weed.h>
316 #include <weed/weed-events.h>
318 #include "../libweed/weed.h"
319 #include "../libweed/weed-events.h"
446 #define AFORM_SIGNED 0
447 #define AFORM_LITTLE_ENDIAN 0
449 #define AFORM_UNSIGNED 1
450 #define AFORM_BIG_ENDIAN (1<<1)
451 #define AFORM_UNKNOWN 65536
505 #define LIVES_CLIP_HEADER_VERSION 100
621 #define FX_FRAME_PUMP_VAL 200
623 #define IMG_BUFF_SIZE 4096
631 gchar mime_type[256];
699 gchar startup_msg[256];
720 #define LIVES_LITTLE_ENDIAN G_LITTLE_ENDIAN
721 #define LIVES_BIG_ENDIAN G_BIG_ENDIAN
731 #ifdef HAVE_JACK_JACK_H
735 #define __STDC_FORMAT_MACROS
736 #include <inttypes.h>
741 #if defined __x86_64__
742 # define __WORDSIZE 64
743 #ifndef __WORDSIZE_COMPAT32
744 # define __WORDSIZE_COMPAT32 1
747 # define __WORDSIZE 32
751 #ifndef __PRI64_PREFIX
752 # if __WORDSIZE == 64
753 # define __PRI64_PREFIX "l"
755 # define __PRI64_PREFIX "ll"
759 # define PRId64 __PRI64_PREFIX "d"
760 # define PRIu64 __PRI64_PREFIX "u"
761 #endif // ifndef PRI64d
777 #include <sys/time.h>
826 gchar *
choose_file(gchar *dir, gchar *fname, gchar **filt, lives_file_chooser_action_t act,
const char *title, GtkWidget *extra);
844 GtkWindow *transient);
862 gchar *
ds_warning_msg(const gchar *dir, guint64 dsval, guint64 cwarn, guint64 nwarn);
884 boolean rdet_suggest_values (
int width,
int height,
double fps,
int fps_num,
int fps_denom,
int arate,
885 int asigned,
boolean swap_endian,
boolean anr,
boolean ignore_fps);
887 int arate,
int asigned,
boolean swap_endian,
boolean anr,
boolean save_all);
951 void response_ok (GtkButton *button, gpointer user_data);
968 boolean add_file_info(const gchar *check_handle,
boolean aud_only);
971 void deduce_file(const gchar *filename,
double start_time,
int end);
973 void open_file_sel(const gchar *file_name,
double start_time,
int frames);
979 void save_file (
int clip,
int start,
int end, const
char *filename);
981 void save_frame (GtkMenuItem *menuitem, gpointer user_data);
982 boolean save_frame_inner(
int clip,
int frame, const gchar *file_name,
int width,
int height,
boolean from_osc);
992 void backup_file(
int clip,
int start,
int end, const gchar *filename);
1030 boolean pull_frame(weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc);
1031 boolean pull_frame_at_size (weed_plant_t *layer, const gchar *image_ext, weed_timecode_t tc,
1032 int width,
int height,
int target_palette);
1034 int width,
int height, LiVESInterpType interp);
1035 LiVESPixbuf *
pull_lives_pixbuf(
int clip,
int frame, const
char *image_ext, weed_timecode_t tc);
1038 int quality,
boolean do_chmod, GError **gerrorptr);
1049 void resize (gdouble scale);
1052 void set_main_title(const gchar *filename, gint or_untitled_number);
1068 void splash_msg(const gchar *msg,
double pct);
1071 #if GTK_CHECK_VERSION(3,0,0)
1072 void calibrate_sepwin_size(
void);
1073 boolean expose_pim (GtkWidget *widget, lives_painter_t *cr, gpointer user_data);
1074 boolean expose_sim (GtkWidget *widget, lives_painter_t *cr, gpointer user_data);
1075 boolean expose_eim (GtkWidget *widget, lives_painter_t *cr, gpointer user_data);
1078 int lives_system(
const char *com,
boolean allow_error);
1080 ssize_t
lives_write(
int fd,
const void *buf,
size_t count,
boolean allow_fail);
1081 ssize_t
lives_write_le(
int fd,
const void *buf,
size_t count,
boolean allow_fail);
1082 ssize_t
lives_read(
int fd,
void *buf,
size_t count,
boolean allow_less);
1083 ssize_t
lives_read_le(
int fd,
void *buf,
size_t count,
boolean allow_less);
1084 int lives_chdir(
const char *path,
boolean allow_fail);
1086 char *
lives_fgets(
char *s,
int size, FILE *stream);
1094 boolean lives_win32_suspend_resume_process(DWORD pid,
boolean suspend);
1095 boolean lives_win32_kill_subprocesses(DWORD pid,
boolean kill_parent);
1096 int lives_win32_get_num_logical_cpus(
void);
1102 ssize_t
lives_readlink(
const char *path,
char *buf,
size_t bufsiz);
1103 boolean lives_setenv(
const char *name,
const char *value);
1123 gchar *
get_dir(
const gchar *filename);
1129 void d_print(
const gchar *text);
1134 void get_location(
const gchar *exe, gchar *val,
int maxlen);
1136 void set_menu_text(GtkWidget *menu,
const gchar *text,
boolean use_mnemonic);
1153 boolean check_file(
const gchar *file_name,
boolean check_exists);
1163 void activate_url (GtkAboutDialog *about,
const gchar *link, gpointer data);
1173 void calc_maxspect(gint rwidth, gint rheight, gint *cwidth, gint *cheight);
1179 gint clipno, gint frameno, gdouble atime, gboolean affects_current);
1183 gchar *
repl_tmpdir(
const gchar *entry, gboolean fwd);
1196 void add_to_recent(
const gchar *filename, gdouble start, gint frames,
const gchar *file_open_params);
1198 void set_undoable (
const gchar *what, gboolean sensitive);
1199 void set_redoable (
const gchar *what, gboolean sensitive);
1206 gchar *
g_strappend (gchar *
string, gint len,
const gchar *newbit);
1211 void minimise_aspect_delta (gdouble allowed_aspect,gint hblock,gint vblock,gint hsize,gint vsize,gint *width,gint *height);
1222 gchar *
subst (
const gchar *
string,
const gchar *from,
const gchar *to);
1225 gint
hextodec (
const gchar *
string);
1245 gboolean
dirchange_callback (GtkAccelGroup *, GObject *, guint, GdkModifierType, gpointer user_data);
1255 void get_pref(
const gchar *key, gchar *val,
int maxlen);
1256 void get_pref_utf8(
const gchar *key, gchar *val,
int maxlen);
1262 void set_pref (
const gchar *key,
const gchar *value);
1281 void *
lives_memcpy(
void *dest,
const void *src,
size_t n);
1295 gboolean
save_sub_subtitles(file *sfile,
double start_time,
double end_time,
double offset_time,
const char *filename);
1296 gboolean
save_srt_subtitles(file *sfile,
double start_time,
double end_time,
double offset_time,
const char *filename);
1300 gboolean lives_osc_init(guint osc_udp_port);
1301 gint lives_osc_poll(gpointer data);
1302 void lives_osc_end(
void);
1303 gboolean lives_osc_notify(
int msgtype,
const char *msgstring);
1304 void lives_osc_notify_success (
const gchar *msg);
1305 void lives_osc_notify_failure (
void);
1306 void lives_osc_notify_cancel (
void);
1314 #define CAM_FORMAT_DV 0
1315 #define CAM_FORMAT_HDV 1
1320 #define cfile mainw->files[mainw->current_file]
1321 #define clipboard mainw->files[0]
1323 #define U82L(String) ( g_locale_from_utf8 (String,-1,NULL,NULL,NULL) )
1324 #define L2U8(String) ( g_locale_to_utf8 (String,-1,NULL,NULL,NULL) )
1327 #define PREFS_TIMEOUT 10000000
1329 #define LIVES_TV_CHANNEL1 "http://www.serverwillprovide.com/sorteal/livestvclips/livestv.ogm"
1333 #define CEIL(a,b) ((int)(((double)a+(double)b-.000000001)/((double)b))*b)
1338 #define LIVES_NO_DEBUG
1340 #ifndef LIVES_NO_DEBUG
1341 #define LIVES_DEBUG(x) fprintf(stderr, "LiVES debug: %s\n", x)
1342 #else // LIVES_NO_DEBUG
1343 #define LIVES_DEBUG(x) dummychar = x
1344 #endif // LIVES_NO_DEBUG
1345 #endif // LIVES_DEBUG
1348 #ifndef LIVES_NO_INFO
1349 #define LIVES_INFO(x) fprintf(stderr, "LiVES info: %s\n", x)
1350 #else // LIVES_NO_INFO
1351 #define LIVES_INFO(x) dummychar = x
1352 #endif // LIVES_NO_INFO
1353 #endif // LIVES_INFO
1356 #ifndef LIVES_NO_WARN
1357 #define LIVES_WARN(x) fprintf(stderr, "LiVES warning: %s\n", x)
1358 #else // LIVES_NO_WARN
1359 #define LIVES_WARN(x) dummychar = x
1360 #endif // LIVES_NO_WARN
1361 #endif // LIVES_WARN
1364 #ifndef LIVES_NO_ERROR
1365 #define LIVES_ERROR(x) fprintf(stderr, "LiVES error: %s\n", x)
1366 #else // LIVES_NO_ERROR
1367 #define LIVES_ERROR(x) dummychar = x
1368 #endif // LIVES_NO_ERROR
1369 #endif // LIVES_ERROR
1372 #ifndef LIVES_NO_FATAL
1373 #define LIVES_FATAL(x) {fprintf(stderr, "LiVES fatal: %s\n", x); raise (LIVES_SIGSEGV);}
1374 #else // LIVES_NO_FATAL
1375 #define LIVES_FATAL(x) dummychar = x
1376 #endif // LIVES_NO_FATAL
1377 #endif // LIVES_FATAL
1380 #endif // #ifndef HAS_LIVES_MAIN_H