-
Notifications
You must be signed in to change notification settings - Fork 0
/
Subscene.lua
141 lines (125 loc) · 3.12 KB
/
Subscene.lua
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
local dialog = nil
local statusBar = nil
local subtitleList = nil
local userInput = {}
local languages = {
{'alb', 'Albanian', 1},
{'ara', 'Arabic', 2},
{'arm', 'Armenian', 73},
{'baq', 'Basque', 74},
{'ben', 'Bengali', 54},
{'bos', 'Bosnian'},
{'bre', 'Breton'},
{'bul', 'Bulgarian'},
{'bur', 'Burmese'},
{'cat', 'Catalan'},
{'chi', 'Chinese'},
{'hrv', 'Croatian'},
{'cze', 'Czech'},
{'dan', 'Danish', 10},
{'dut', 'Dutch', 11},
{'eng', 'English', 13},
{'epo', 'Esperanto'},
{'est', 'Estonian'},
{'fin', 'Finnish', 17},
{'fre', 'French'},
{'glg', 'Galician'},
{'geo', 'Georgian'},
{'ger', 'German'},
{'ell', 'Greek'},
{'heb', 'Hebrew', 22},
{'hin', 'Hindi'},
{'hun', 'Hungarian'},
{'ice', 'Icelandic'},
{'ind', 'Indonesian', 44},
{'ita', 'Italian'},
{'jpn', 'Japanese'},
{'kaz', 'Kazakh'},
{'khm', 'Khmer'},
{'kor', 'Korean'},
{'lav', 'Latvian'},
{'lit', 'Lithuanian'},
{'ltz', 'Luxembourgish'},
{'mac', 'Macedonian'},
{'may', 'Malay', 50},
{'mal', 'Malayalam'},
{'mon', 'Mongolian'},
{'nor', 'Norwegian', 30},
{'oci', 'Occitan'},
{'per', 'Persian', 46},
{'pob', 'Brazilian Portuguese', 4},
{'pol', 'Polish'},
{'por', 'Portuguese'},
{'rum', 'Romanian', 33},
{'rus', 'Russian'},
{'scc', 'Serbian'},
{'sin', 'Sinhalese'},
{'slo', 'Slovak'},
{'slv', 'Slovenian'},
{'spa', 'Spanish', 38},
{'swa', 'Swahili'},
{'swe', 'Swedish', 39},
{'syr', 'Syriac'},
{'tgl', 'Tagalog'},
{'tel', 'Telugu'},
{'tha', 'Thai'},
{'tur', 'Turkish', 41},
{'ukr', 'Ukrainian'},
{'urd', 'Urdu'},
{'vie', 'Vietnamese', 45}
}
function descriptor()
return {
title = "Subscene",
version = "1.0",
author = "mkp246",
capabilities = {"menu"}
}
end
local app = descriptor()
function activate()
vlc.msg.dbg("[Subs] welcome")
showMainDialog()
end
function deactivate()
if dlg ~= nil then
dialog:hide()
end
dialog = nil
vlc.msg.dbg("[Subs] bye bye")
vlc.deactivate()
end
function close()
deactivate()
end
function menu()
return {
"Search",
"Config",
"Help"
}
end
function showMainDialog()
dialog = vlc.dialog(app.title.." "..app.version)
dialog:add_label("Language:", 1, 1, 1, 1)
dialog:add_label("Title:", 1, 2, 1, 1)
dialog:add_label("Season:", 1, 3, 1, 1)
dialog:add_label("Episode:", 1, 4, 1, 1)
userInput["language"] = dialog:add_dropdown(2, 1, 2, 1)
userInput["title"] = dialog:add_text_input("", 2, 2, 2, 1)
userInput["season"] = dialog:add_text_input("", 2, 3, 2, 1)
userInput["episode"] = dialog:add_text_input("", 2, 4, 2, 1)
dialog:add_button("Search by hash", dummy, 4, 1, 1, 1)
dialog:add_button("Search by name", dummy, 4, 2, 1, 1)
dialog:add_dropdown(4, 3, 1, 1)
dialog:add_button("Feeling Lucky", dummy, 4, 4, 1, 1)
subtitleList = dialog:add_list(1, 5, 4, 8)
statusBar = dialog:add_label(string.rep( " ", 125), 1, 13, 4, 1)
dialog:add_button("Help", dummy, 1, 14, 1, 1)
dialog:add_button("Configuration", dummy, 2, 14, 1, 1)
dialog:add_button("Download", dummy, 3, 14, 1, 1)
dialog:add_button("Close", close, 4, 14, 1, 1)
dialog:show()
end
function dummy()
end