2 #include <glib-object.h>
3 #include <glib/gstdio.h>
10 const gchar *widget_name;
11 const gchar *dep_name;
12 const gchar *enable_value;
13 const gboolean disable_if_equal;
17 static dependency_t dep_map[] =
19 {"title", "queue_add", "none", TRUE, FALSE},
20 {"title", "queue_add_menu", "none", TRUE, FALSE},
21 {"title", "show_picture", "none", TRUE, FALSE},
22 {"title", "show_preview_menu", "none", TRUE, FALSE},
23 {"title", "preview_frame", "none", TRUE, FALSE},
24 {"title", "picture_label", "none", TRUE, FALSE},
25 {"title", "picture_tab", "none", TRUE, FALSE},
26 {"title", "chapters_label", "none", TRUE, FALSE},
27 {"title", "chapters_tab", "none", TRUE, FALSE},
28 {"title", "start_chapter", "none", TRUE, FALSE},
29 {"title", "end_chapter", "none", TRUE, FALSE},
30 {"title", "angle", "none", TRUE, FALSE},
31 {"use_dvdnav", "angle", "FALSE", TRUE, TRUE},
32 {"use_dvdnav", "angle_label", "FALSE", TRUE, TRUE},
33 {"vquality_type_bitrate", "VideoAvgBitrate", "TRUE", FALSE, FALSE},
34 {"vquality_type_target", "VideoTargetSize", "TRUE", FALSE, FALSE},
35 {"vquality_type_constant", "VideoQualitySlider", "TRUE", FALSE, FALSE},
36 {"vquality_type_constant", "constant_rate_factor", "TRUE", FALSE, FALSE},
37 {"vquality_type_constant", "VideoTwoPass", "TRUE", TRUE, FALSE},
38 {"vquality_type_constant", "VideoTurboTwoPass", "TRUE", TRUE, FALSE},
39 {"VideoTwoPass", "VideoTurboTwoPass", "TRUE", FALSE, FALSE},
40 {"FileFormat", "Mp4LargeFile", "mp4", FALSE, TRUE},
41 {"FileFormat", "Mp4HttpOptimize", "mp4", FALSE, TRUE},
42 {"FileFormat", "Mp4iPodCompatible", "mp4", FALSE, TRUE},
43 {"PictureDecomb", "PictureDeinterlace", "none", FALSE, FALSE},
44 {"PictureDecomb", "PictureDeinterlaceCustom", "none", FALSE, TRUE},
45 {"PictureDeinterlace", "PictureDeinterlaceCustom", "custom", FALSE, TRUE},
46 {"PictureDenoise", "PictureDenoiseCustom", "custom", FALSE, TRUE},
47 {"PictureDecomb", "PictureDecombCustom", "custom", FALSE, TRUE},
48 {"PictureDetelecine", "PictureDetelecineCustom", "custom", FALSE, TRUE},
49 {"PictureAutoCrop", "PictureTopCrop", "FALSE", FALSE, FALSE},
50 {"PictureAutoCrop", "PictureBottomCrop", "FALSE", FALSE, FALSE},
51 {"PictureAutoCrop", "PictureLeftCrop", "FALSE", FALSE, FALSE},
52 {"PictureAutoCrop", "PictureRightCrop", "FALSE", FALSE, FALSE},
53 {"VideoEncoder", "x264_tab", "x264", FALSE, FALSE},
54 {"VideoEncoder", "x264_tab_label", "x264", FALSE, FALSE},
55 {"VideoEncoder", "Mp4iPodCompatible", "x264", FALSE, FALSE},
56 {"AudioEncoder", "AudioBitrate", "ac3|dts|auto", TRUE, FALSE},
57 {"AudioEncoder", "AudioSamplerate", "ac3|dts|auto", TRUE, FALSE},
58 {"AudioEncoder", "AudioMixdown", "ac3|dts|auto", TRUE, FALSE},
59 {"AudioEncoder", "AudioTrackDRCSlider", "ac3|dts|auto", TRUE, FALSE},
60 {"AudioEncoder", "drc_label", "ac3|dts|auto", TRUE, FALSE},
61 {"x264_bframes", "x264_weighted_bframes", "0", TRUE, FALSE},
62 {"x264_bframes", "x264_bpyramid", "<2", TRUE, FALSE},
63 {"x264_bframes", "x264_direct", "0", TRUE, FALSE},
64 {"x264_bframes", "x264_b_adapt", "0", TRUE, FALSE},
65 {"x264_refs", "x264_mixed_refs", "<2", TRUE, FALSE},
66 {"x264_cabac", "x264_trellis", "TRUE", FALSE, FALSE},
67 {"x264_subme", "x264_psy_rd", "<6", TRUE, FALSE},
68 {"x264_subme", "x264_psy_trell", "<6", TRUE, FALSE},
69 {"x264_cabac", "x264_psy_trell", "TRUE", FALSE, FALSE},
70 {"x264_trellis", "x264_psy_trell", "0", TRUE, FALSE},
71 {"ChapterMarkers", "chapters_list", "TRUE", FALSE, FALSE},
72 {"use_source_name", "chapters_in_destination", "TRUE", FALSE, FALSE},
73 {"use_source_name", "title_no_in_destination", "TRUE", FALSE, FALSE},
77 main(gint argc, gchar *argv[])
81 gint count = sizeof(dep_map) / sizeof(dependency_t);
85 top = ghb_dict_value_new();
86 for (ii = 0; ii < count; ii++)
91 name = dep_map[ii].widget_name;
92 if (ghb_dict_lookup(top, name))
94 array = ghb_array_value_new(8);
95 for (jj = 0; jj < count; jj++)
97 if (strcmp(name, dep_map[jj].widget_name) == 0)
99 ghb_array_append(array,
100 ghb_value_dup(ghb_string_value(dep_map[jj].dep_name)));
103 ghb_dict_insert(top, g_strdup(name), array);
105 ghb_plist_write_file("widget.deps", top);
108 top = ghb_dict_value_new();
109 for (ii = 0; ii < count; ii++)
114 name = dep_map[ii].dep_name;
115 if (ghb_dict_lookup(top, name))
117 array = ghb_array_value_new(8);
118 for (jj = 0; jj < count; jj++)
120 if (strcmp(name, dep_map[jj].dep_name) == 0)
123 data = ghb_array_value_new(3);
124 ghb_array_append(data, ghb_value_dup(
125 ghb_string_value(dep_map[jj].widget_name)));
126 ghb_array_append(data, ghb_value_dup(
127 ghb_string_value(dep_map[jj].enable_value)));
128 ghb_array_append(data, ghb_value_dup(
129 ghb_boolean_value(dep_map[jj].disable_if_equal)));
130 ghb_array_append(data, ghb_value_dup(
131 ghb_boolean_value(dep_map[jj].hide)));
132 ghb_array_append(array, data);
135 ghb_dict_insert(top, g_strdup(name), array);
137 ghb_plist_write_file("widget_reverse.deps", top);