OSDN Git Service

LinGui: adjust the width of the subtitle list
[handbrake-jp/handbrake-jp-git.git] / gtk / src / presets.c
index 43babd1..fe6493d 100644 (file)
  * any later version.
  * 
  */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
 #include <glib.h>
 #include <glib-object.h>
 #include <glib/gstdio.h>
@@ -1112,6 +1116,28 @@ load_plist(const gchar *name)
        return plist;
 }
 
+gboolean
+ghb_lock_file(const gchar *name)
+{
+#if !defined(_WIN32)
+       gchar *config, *path;
+       int fd, lock = 0;
+
+       config = ghb_get_user_config_dir(NULL);
+       path = g_strdup_printf ("%s/%s", config, name);
+       fd = open(path, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
+       if (fd >= 0)
+               lock = lockf(fd, F_TLOCK, 0);
+       if (lock)
+               close(fd);
+       g_free(config);
+       g_free(path);
+       return !lock;
+#else
+       return 1;
+#endif
+}
+
 static void
 remove_plist(const gchar *name)
 {
@@ -1855,7 +1881,7 @@ value_map_t mix_xlat[] =
 
 value_map_t deint_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "fast"},
        {"3", "slow"},
@@ -1865,7 +1891,7 @@ value_map_t deint_xlat[] =
 
 value_map_t denoise_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "weak"},
        {"3", "medium"},
@@ -1875,7 +1901,7 @@ value_map_t denoise_xlat[] =
 
 value_map_t detel_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "default"},
        {NULL, NULL}
@@ -1883,7 +1909,7 @@ value_map_t detel_xlat[] =
 
 value_map_t decomb_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "default"},
        {NULL, NULL}