summaryrefslogtreecommitdiffstats
path: root/gtk/src/makedeps.py
blob: f070b63b1de99baf90a8476feef83139b0b8521d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env python

import collections
import sys
import json

DepEntry = collections.namedtuple('DepEntry', 'widget dep enable die hide')
dep_map = (
    DepEntry("title", "preview_frame", "none", True, False),
    DepEntry("title", "chapters_tab", "none", True, False),
    DepEntry("title", "start_point", "none", True, False),
    DepEntry("title", "end_point", "none", True, False),
    DepEntry("title", "angle", "none", True, False),
    DepEntry("title", "angle_label", "none", True, False),
    DepEntry("angle_count", "angle", "1", True, True),
    DepEntry("angle_count", "angle_label", "1", True, True),
    DepEntry("vquality_type_bitrate", "VideoAvgBitrate", "1", False, False),
    DepEntry("vquality_type_constant", "VideoQualitySlider", "1", False, False),
    DepEntry("vquality_type_constant", "VideoTwoPass", "1", True, False),
    DepEntry("vquality_type_constant", "VideoTurboTwoPass", "1", True, False),
    DepEntry("VideoFramerate", "VideoFrameratePFR", "auto", True, True),
    DepEntry("VideoFramerate", "VideoFramerateVFR", "auto", False, True),
    DepEntry("VideoTwoPass", "VideoTurboTwoPass", "1", False, False),
    DepEntry("PictureCombDetectPreset", "PictureCombDetectCustom", "custom", False, True),
    DepEntry("PictureDeinterlaceFilter", "PictureDeinterlacePreset", "off", True, True),
    DepEntry("PictureDeinterlaceFilter", "PictureDeinterlacePresetLabel", "off", True, True),
    DepEntry("PictureDeinterlaceFilter", "PictureDeinterlaceCustom", "off", True, True),
    DepEntry("PictureDeinterlacePreset", "PictureDeinterlaceCustom", "custom", False, True),
    DepEntry("PictureDeblockPreset", "PictureDeblockTune", "off|custom", True, True),
    DepEntry("PictureDeblockPreset", "PictureDeblockTuneLabel", "off|custom", True, True),
    DepEntry("PictureDeblockPreset", "PictureDeblockCustom", "custom", False, True),
    DepEntry("PictureDenoiseFilter", "PictureDenoisePreset", "off", True, True),
    DepEntry("PictureDenoiseFilter", "PictureDenoisePresetLabel", "off", True, True),
    DepEntry("PictureDenoiseFilter", "PictureDenoiseTune", "nlmeans", False, True),
    DepEntry("PictureDenoiseFilter", "PictureDenoiseTuneLabel", "nlmeans", False, True),
    DepEntry("PictureDenoiseFilter", "PictureDenoiseCustom", "off", True, True),
    DepEntry("PictureDenoisePreset", "PictureDenoiseCustom", "custom", False, True),
    DepEntry("PictureDenoisePreset", "PictureDenoiseTune", "custom", True, True),
    DepEntry("PictureDenoisePreset", "PictureDenoiseTuneLabel", "custom", True, True),

    DepEntry("PictureSharpenFilter", "PictureSharpenPreset", "off", True, True),
    DepEntry("PictureSharpenFilter", "PictureSharpenPresetLabel", "off", True, True),
    DepEntry("PictureSharpenFilter", "PictureSharpenTune", "off", True, True),
    DepEntry("PictureSharpenFilter", "PictureSharpenTuneLabel", "off", True, True),
    DepEntry("PictureSharpenFilter", "PictureSharpenCustom", "off", True, True),
    DepEntry("PictureSharpenPreset", "PictureSharpenCustom", "custom", False, True),
    DepEntry("PictureSharpenPreset", "PictureSharpenTune", "custom", True, True),
    DepEntry("PictureSharpenPreset", "PictureSharpenTuneLabel", "custom", True, True),
    DepEntry("PictureDetelecine", "PictureDetelecineCustom", "custom", False, True),
    DepEntry("PictureWidthEnable", "PictureWidth", "1", False, False),
    DepEntry("PictureHeightEnable", "PictureHeight", "1", False, False),
    DepEntry("PictureAutoCrop", "PictureTopCrop", "0", False, False),
    DepEntry("PictureAutoCrop", "PictureBottomCrop", "0", False, False),
    DepEntry("PictureAutoCrop", "PictureLeftCrop", "0", False, False),
    DepEntry("PictureAutoCrop", "PictureRightCrop", "0", False, False),
    DepEntry("VideoEncoder", "x264FastDecode", "x264|x264_10bit", False, True),
    DepEntry("VideoEncoder", "VideoOptionExtraWindow", "x264|x264_10bit|x265|x265_10bit|x265_12bit|x265_16bit|mpeg4|mpeg2|VP8|VP9|nvenc_h264|nvenc_hevc|vaapi_h264|vaapi_hevc|vaapi_vp8|vaapi_vp9", False, True),
    DepEntry("VideoEncoder", "VideoOptionExtraLabel", "x264|x264_10bit|x265|x265_10bit|x265_12bit|x265_16bit|mpeg4|mpeg2|VP8|VP9|nvenc_h264|nvenc_hevc|vaapi_h264|vaapi_hevc|vaapi_vp8|vaapi_vp9", False, True),
    DepEntry("auto_name", "autoname_box", "1", False, False),
    DepEntry("PresetCategory", "PresetCategoryName", "new", False, True),
    DepEntry("PresetCategory", "PresetCategoryEntryLabel", "new", False, True),
    )

def main():

    try:
        depsfile = open("widget.deps", "w")
    except Exception as err:
        print >> sys.stderr, ( "Error: %s"  % str(err) )
        sys.exit(1)

    try:
        revfile = open("widget_reverse.deps", "w")
    except Exception as err:
        print >> sys.stderr, ( "Error: %s"  % str(err))
        sys.exit(1)

    top = dict()
    for ii in dep_map:
        if ii.widget in top:
            continue
        deps = list()
        for jj in dep_map:
            if jj.widget == ii.widget:
                deps.append(jj.dep)
        top[ii.widget] = deps
    json.dump(top, depsfile, indent=4)

    top = dict()
    for ii in dep_map:
        if ii.dep in top:
            continue
        deps = list()
        for jj in dep_map:
            if ii.dep == jj.dep:
                rec = list()
                rec.append(jj.widget)
                rec.append(jj.enable)
                rec.append(jj.die)
                rec.append(jj.hide)
                deps.append(rec)
        top[ii.dep] = deps
    json.dump(top, revfile, indent=4)

main()