/
__init__.py
2666 lines (2452 loc) · 124 KB
/
__init__.py
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2008 Chris Longo <cal@chrislongo.net> and Tobias Arrskog (topfs2)
#
# This file is a plugin for EventGhost.
#
# EventGhost is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# EventGhost is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with EventGhost; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from xbmcclient import *
import urllib2
import json
import ast
import xml.dom.minidom
from xml.dom.minidom import Node
import socket
import base64
from urlparse import urlparse
import os
import pickle
from threading import Event, Thread
# expose some information about the plugin through an eg.PluginInfo subclass
eg.RegisterPlugin(
name = "XBMC2",
author = "Joni Boren",
version = "0.6.35",
kind = "program",
guid = "{8C8B850C-773F-4583-AAD9-A568262B7933}",
canMultiLoad = True,
createMacrosOnAdd = True,
url = "http://www.eventghost.net/forum/viewtopic.php?f=10&t=1562",
description = "Adds actions buttons to control <a href='http://www.xbmc.org/'>XBMC</a>.",
icon = (
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA"
"BGdBTUEAALGeYUxB9wAAACBjSFJNAAB6fAAAfosAAPoBAACHPAAAbUoAAPFDAAA2IAAAHlNX4WK7"
"AAACYElEQVR42tTTPW8ScQDH8d/9n44HESgFKQjFWku1rUYdTEAT0sGHSU10cHZz0piYjqYxbia6"
"+hB3Y0w3kzq0scaojdZqYiMp1dQWAlLg4A7ugbvzRXTy8wK+21dyXRe7QbBLuw6wG3ceJnJnLuTL"
"279DrutySBIhEnUopSbjtMsYVzkXLSFEU5Y9dY/XW5Nlr207DpRWE+zzp6VHxWLpstpWKaEA5RT9"
"XgCcC/jDDihjOpWI6vF4WkLweigULgdD4R/p4ZH30X1Dr6XhbK4i/OH43qSKVikJLhhGz26AEo61"
"+Qz0roWR8RDWixtIJKP4/mUVA5EgkvvjOHEy/1FKj+XnwpHMxdipIhJH29C2o0hMVmH1KJQyxWTw"
"FuKhKYCbaDUVOI4LwzKxOD8PAvkrMazOW1uSUH43ilCqgUYphvJyBitzKUyfLiCVBe7PPkVzp4l7"
"dx9g+lwB5T9bePPqJTIjB4v0uqmVi4cHbx67UkFteRjRAx30mgEcym9iZz2NpRcyfAM6Om0Nruui"
"sr2F8SNZuIQjEhl6Lj0LAY8Hcwtq6nwhStuQJB8sWOh3fTClBgIDOhj1wDAtcEFRq/5FW+shPRRF"
"diyTYJNe4Kr1bfaJHiv0qAtBKTgX4D6CAJXAbQIhaYhyG16iIxvpwEfW0BITM75YrsJm3Ah6SnfB"
"kCtzWmLikmabYLYAIRxO34Zp6nAs9VdX6xSVRn2lb7QWe2b3w9RxplwLy2AL8AOMIa5s3vb6gzUm"
"+5mh1XXL0Lq2pVRVQ2z66J6fpLdaMqu6KjwUXo8XnFH0+w6k/3+mfwMAzwT87LI0qNEAAAAASUVO"
"RK5CYII="
),
)
"""
'http://www.xbmc.org/'
'http://wiki.xbmc.org/index.php?title=Web_Server_HTTP_API'
http://xbmc.org/wiki/?title=Window_IDs
http://xbmc.org/wiki/?title=Action_IDs#General_actions_available_throughout_most_of_XBMC
'http://wiki.xbmc.org/?title=Action_IDs'
'https://raw.githubusercontent.com/xbmc/xbmc/master/xbmc/input/ButtonTranslator.cpp'
"""
# from threading import Event, Thread
# Windows availible in XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Window_IDs http://kodi.wiki/view/Window_IDs
"""
"""
WINDOWS = (
(eg.ActionGroup, "Windows", "Windows", None, (
("MyMovies", "Show Movies Screen", "Show Movies screen.", "Activatewindow(MyVideoLibrary,movietitles,return)"),
("MyTVShows", "Show TV Shows Screen", "Show TV Shows screen.", "Activatewindow(MyVideoLibrary,tvshowtitles,return)"),
("ShutdownMenu", "Show Shutdown Menu", "Show the shutdown Menu.", "Activatewindow(ShutdownMenu)"),
("Home", "Home", "WINDOW_HOME", "Activatewindow(Home)"),
("Programs", "Programs", "WINDOW_PROGRAMS", "Activatewindow(Programs)"),
("Pictures", "Pictures", "WINDOW_PICTURES", "Activatewindow(Pictures)"),
("Files", "Files", "WINDOW_FILES\nbackward compat", "Activatewindow(Files)"),
("Settings", "Settings", "WINDOW_SETTINGS_MENU", "Activatewindow(Settings)"),
("Music", "Music", "WINDOW_MUSIC", "Activatewindow(Music)"),
("Musicfiles", "Musicfiles", "WINDOW_MUSIC_FILES", "Activatewindow(Musicfiles)"),
("Musiclibrary", "Musiclibrary", "WINDOW_MUSIC_NAV", "Activatewindow(Musiclibrary)"),
("Musicplaylist", "Musicplaylist", "WINDOW_MUSIC_PLAYLIST", "Activatewindow(Musicplaylist)"),
("Musicplaylisteditor", "Musicplaylisteditor", "WINDOW_MUSIC_PLAYLIST_EDITOR", "Activatewindow(Musicplaylisteditor)"),
("Musicinformation", "Musicinformation", "WINDOW_DIALOG_MUSIC_INFO", "Activatewindow(Musicinformation)"),
("Video", "Video", "WINDOW_VIDEOS", "Activatewindow(Video)"),
("Videofiles", "Videofiles", "WINDOW_VIDEO_FILES", "Activatewindow(Videofiles)"),
("Videolibrary", "Videolibrary", "WINDOW_VIDEO_NAV", "Activatewindow(Videolibrary)"),
("Videoplaylist", "Videoplaylist", "WINDOW_VIDEO_PLAYLIST", "Activatewindow(Videoplaylist)"),
("Systeminfo", "Systeminfo", "WINDOW_SYSTEM_INFORMATION", "Activatewindow(Systeminfo)"),
("Guicalibration", "Guicalibration", "WINDOW_SCREEN_CALIBRATION\nbackward compat", "Activatewindow(Guicalibration)"),
("Screencalibration", "Screencalibration", "WINDOW_SCREEN_CALIBRATION", "Activatewindow(Screencalibration)"),
("Picturessettings", "Picturessettings", "WINDOW_SETTINGS_MYPICTURES", "Activatewindow(Picturessettings)"),
("Programssettings", "Programssettings", "WINDOW_SETTINGS_MYPROGRAMS", "Activatewindow(Programssettings)"),
("Weathersettings", "Weathersettings", "WINDOW_SETTINGS_MYWEATHER", "Activatewindow(Weathersettings)"),
("Musicsettings", "Musicsettings", "WINDOW_SETTINGS_MYMUSIC", "Activatewindow(Musicsettings)"),
("Systemsettings", "Systemsettings", "WINDOW_SETTINGS_SYSTEM", "Activatewindow(Systemsettings)"),
("Videossettings", "Videossettings", "WINDOW_SETTINGS_MYVIDEOS", "Activatewindow(Videossettings)"),
("Networksettings", "Networksettings", "WINDOW_SETTINGS_NETWORK", "Activatewindow(Networksettings)"),
("Appearancesettings", "Appearancesettings", "WINDOW_SETTINGS_APPEARANCE", "Activatewindow(Appearancesettings)"),
("Scripts", "Scripts", "WINDOW_PROGRAMS\nbackward compat", "Activatewindow(Scripts)"),
("Gamesaves", "Gamesaves", "Gamesaves", "Activatewindow(Gamesaves)"),
("Profiles", "Profiles", "WINDOW_SETTINGS_PROFILES", "Activatewindow(Profiles)"),
("Virtualkeyboard", "Virtualkeyboard", "WINDOW_DIALOG_KEYBOARD", "Activatewindow(Virtualkeyboard)"),
("Volumebar", "Volumebar", "WINDOW_DIALOG_VOLUME_BAR", "Activatewindow(Volumebar)"),
("Favourites", "Favourites", "WINDOW_DIALOG_FAVOURITES", "Activatewindow(Favourites)"),
("Musicosd", "Musicosd", "WINDOW_DIALOG_MUSIC_OSD", "Activatewindow(Musicosd)"),
("Visualisationsettings", "Visualisationsettings", "WINDOW_DIALOG_ADDON_SETTINGS\nbackward compat", "Activatewindow(Visualisationsettings)"),
("Visualisationpresetlist", "Visualisationpresetlist", "WINDOW_DIALOG_VIS_PRESET_LIST", "Activatewindow(Visualisationpresetlist)"),
("Osdvideosettings", "Osdvideosettings", "WINDOW_DIALOG_VIDEO_OSD_SETTINGS", "Activatewindow(Osdvideosettings)"),
("Osdaudiosettings", "Osdaudiosettings", "WINDOW_DIALOG_AUDIO_OSD_SETTINGS", "Activatewindow(Osdaudiosettings)"),
("Videobookmarks", "Videobookmarks", "WINDOW_DIALOG_VIDEO_BOOKMARKS", "Activatewindow(Videobookmarks)"),
("Profilesettings", "Profilesettings", "WINDOW_DIALOG_PROFILE_SETTINGS", "Activatewindow(Profilesettings)"),
("Locksettings", "Locksettings", "WINDOW_DIALOG_LOCK_SETTINGS", "Activatewindow(Locksettings)"),
("Contentsettings", "Contentsettings", "WINDOW_DIALOG_CONTENT_SETTINGS", "Activatewindow(Contentsettings)"),
("Networksetup", "Networksetup", "WINDOW_DIALOG_NETWORK_SETUP", "Activatewindow(Networksetup)"),
("Smartplaylisteditor", "Smartplaylisteditor", "WINDOW_DIALOG_SMART_PLAYLIST_EDITOR", "Activatewindow(Smartplaylisteditor)"),
("Smartplaylistrule", "Smartplaylistrule", "WINDOW_DIALOG_SMART_PLAYLIST_RULE", "Activatewindow(Smartplaylistrule)"),
("Movieinformation", "Movieinformation", "WINDOW_DIALOG_VIDEO_INFO", "Activatewindow(Movieinformation)"),
("Scriptsdebuginfo", "Scriptsdebuginfo", "Scriptsdebuginfo", "Activatewindow(Scriptsdebuginfo)"),
("Fullscreenvideo", "Fullscreenvideo", "WINDOW_FULLSCREEN_VIDEO", "Activatewindow(Fullscreenvideo)"),
("Visualisation", "Visualisation", "WINDOW_VISUALISATION", "Activatewindow(Visualisation)"),
("Slideshow", "Slideshow", "WINDOW_SLIDESHOW", "Activatewindow(Slideshow)"),
("Filestackingdialog", "Filestackingdialog", "WINDOW_DIALOG_FILESTACKING", "Activatewindow(Filestackingdialog)"),
("Weather", "Weather", "WINDOW_WEATHER", "Activatewindow(Weather)"),
("Screensaver", "Screensaver", "WINDOW_SCREENSAVER", "Activatewindow(Screensaver)"),
("Videoosd", "Videoosd", "WINDOW_DIALOG_VIDEO_OSD", "Activatewindow(Videoosd)"),
("Videomenu", "Videomenu", "WINDOW_VIDEO_MENU", "Activatewindow(Videomenu)"),
("Filebrowser", "Filebrowser", "WINDOW_DIALOG_FILE_BROWSER", "Activatewindow(Filebrowser)"),
("Startup", "Startup", "WINDOW_STARTUP_ANIM", "Activatewindow(Startup)"),
("Startwindow", "Startwindow", "WINDOW_START", "Activatewindow(Startwindow)"),
("Loginscreen", "Loginscreen", "WINDOW_LOGIN_SCREEN", "Activatewindow(Loginscreen)"),
("Musicoverlay", "Musicoverlay", "WINDOW_DIALOG_MUSIC_OVERLAY", "Activatewindow(Musicoverlay)"),
("Videooverlay", "Videooverlay", "WINDOW_DIALOG_VIDEO_OVERLAY", "Activatewindow(Videooverlay)"),
("Pictureinfo", "Pictureinfo", "WINDOW_DIALOG_PICTURE_INFO", "Activatewindow(Pictureinfo)"),
("Pluginsettings", "Pluginsettings", "Pluginsettings", "Activatewindow(Pluginsettings)"),
("Fullscreeninfo", "Fullscreeninfo", "WINDOW_DIALOG_FULLSCREEN_INFO", "Activatewindow(Fullscreeninfo)"),
("PlayerControls", "Player Controls", "WINDOW_DIALOG_PLAYER_CONTROLS", "Activatewindow(Playercontrols)"),
)),
)
# actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#General_actions_available_throughout_most_of_XBMC http://kodi.wiki/view/Action_IDs#General_actions_available_throughout_most_of_XBMC
GENERAL_ACTIONS = (
(eg.ActionGroup, "General", "General", None, (
("Left", "Left", "Move left off a control.", "left"),
("Right", "Right", "Move right off a control.", "right"),
("Up", "Up", "Move up off a control.", "up"),
("Down", "Down", "Move down off a control.", "down"),
("PageUp", "PageUp", "Scroll up on page in a list, thumb, or text view.", "pageup"),
("PageDown", "PageDown", "Scroll down on page in a list, thumb, or text view.", "pagedown"),
("Select", "Select", "Select a button, or an item from a list of thumb view.", "select"),
("Highlight", "Highlight", "Highlight an item in a list or thumb view.", "highlight"),
('Parentfolder', 'Parentfolder', 'Go up a folder to the parent folder.', 'parentfolder'),
('Back', 'Back', '', 'back'),
("ParentDir", "ParentDir", "Go up a folder to the parent folder.\n// backward compatibility", "parentdir"),
("PreviousMenu", "PreviousMenu", "Go back to the previous menu screen.", "previousmenu"),
("Info", "Info", "Show the information about the currently highlighted item, or currently playing item.", "info"),
("Screenshot", "Screenshot", "Take a screenshot of the current screen.", "screenshot"),
("PowerOff", "PowerOff", "Shutdown and power off.", "poweroff"),
("VolumeUp", "VolumeUp", "Increase the volume of playback.", "volumeup"),
("VolumeDown", "VolumeDown", "Decrease the volume of playback.", "volumedown"),
("Mute", "Mute", "Mute the volume.", "mute"),
("ContextMenu", "ContextMenu", "Pops up a contextual menu", "contextmenu"),
("ScrollUp", "ScrollUp", "Variable speed scroll up for analog keys (stick or triggers)", "scrollup"),
("ScrollDown", "ScrollDown", "Variable speed scroll down for analog keys (stick or triggers)", "scrolldown"),
("Close", "Close", "Used to close a dialog", "close"),
("Number0", "Number0", "Used to input the number 0", "number0"),
("Number1", "Number1", "Used to input the number 1", "number1"),
("Number2", "Number2", "Used to input the number 2", "number2"),
("Number3", "Number3", "Used to input the number 3", "number3"),
("Number4", "Number4", "Used to input the number 4", "number4"),
("Number5", "Number5", "Used to input the number 5", "number5"),
("Number6", "Number6", "Used to input the number 6", "number6"),
("Number7", "Number7", "Used to input the number 7", "number7"),
("Number8", "Number8", "Used to input the number 8", "number8"),
("Number9", "Number9", "Used to input the number 9", "number9"),
)),
)
# actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#General_actions_available_while_video_or_music_are_playing http://kodi.wiki/view/Action_IDs#General_actions_available_while_video_or_music_are_playing
MEDIA_PLAYING_ACTIONS = (
(eg.ActionGroup, "MediaPlaying", "Media playing", None, (
("Play", "Play", "Play the selected item (or folder of items), or unpause a paused item.", "play"),
("Pause", "Pause", "Pause the currently playing item.", "pause"),
("Stop", "Stop", "Stop the currently playing item.", "stop"),
("FastForward", "FastForward", "Toggle the fastforward speed between normal play, 2x, 4x, 8x, 16x, and 32x.", "fastforward"),
("Rewind", "Rewind", "Toggle the rewind speed between normal play, 2x, 4x, 8x, 16x, and 32x.", "rewind"),
("SkipNext", "SkipNext", "Skip to the next item in a playlist or scene in a video.", "skipnext"),
("SkipPrevious", "SkipPrevious", "Skip to the previous item in a playlist or scene in a video.", "skipprevious"),
("FullScreen", "FullScreen", "Toggles fullscreen modes (either visualisation or video playback)", "fullscreen"),
("CodecInfo", "CodecInfo", "Show codec information about the currently playing item (during video or visualisation playback)", "codecinfo"),
("AnalogSeekForward", "AnalogSeekForward", "Variable speed seeking for analog keys (stick or triggers)", "analogseekforward"),
("AnalogSeekBack", "AnalogSeekBack", "Variable speed seeking for analog keys (stick or triggers)", "analogseekback"),
("AnalogFastForward", "AnalogFastForward", "Variable speed fast forward for analog keys (stick or triggers)", "analogfastforward"),
("AnalogRewind", "AnalogRewind", "Variable speed rewind for analog keys (stick or triggers)", "analogrewind"),
("PartyMode", "Party Mode", "Party mode.", "playercontrol(partymode)"),
("Random", "Random", "Toggles random playback", "playercontrol(Random,Notify)"),
("Repeat", "Repeat", "Cycles through the repeat modes", "playercontrol(Repeat,Notify)"),
("UpdateVideoLibrary", "Update Video Library", "Update the video library.", "updatelibrary(video)"),
("UpdateMusicLibrary", "Update Music Library", "Update the music library.", "updatelibrary(music)"),
("IncreaseRating", "IncreaseRating", "Unused.", "increaserating"),
("DecreaseRating", "DecreaseRating", "Unused .", "decreaserating"),
("EjectTray", "EjectTray", "Close or open the DVD tray", "EjectTray"),
("Record", "Record", "Starts recording.", "record"),
("PlayDVD", "PlayDVD", "Plays the inserted CD or DVD media from the DVD-ROM Drive!", "PlayDVD"),
("LastFMLove", "LastFM.Love", "Add the current playing last.fm radio track to the last.fm loved tracks", "LastFM.Love"),
("LastFMBan", "LastFM.Ban", "Ban the current playing last.fm radio track", "LastFM.Ban"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_only_in_Music_and_Videos_windows_only http://kodi.wiki/view/Action_IDs#Actions_available_only_in_Music_and_Videos_windows_only
PLAYLIST_ACTIONS = (
(eg.ActionGroup, "Playlist", "Playlist", None, (
("Playlist", "Playlist", "Toggle to playlist view from My Music or My Videos", "playlist"),
("Queue", "Queue", "Queue the item to the current playlist", "queue"),
("MoveItemUp", "MoveItemUp", "Used to rearrange playlists", "moveitemup"),
("MoveItemDown", "MoveItemDown", "Used to rearrange playlists", "moveitemdown"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_only_in_Full_Screen_Video http://kodi.wiki/view/Action_IDs#Actions_available_only_in_Full_Screen_Video
FULLSCREEN_VIDEO_ACTIONS = (
(eg.ActionGroup, "FullscreenVideo", "FullScreen Video", None, (
("StepForward", "StepForward", "Step forward 1% in the movie.", "stepforward"),
("StepBack", "StepBack", "Step back 1% in the movie.", "stepback"),
("BigStepForward", "BigStepForward", "Step forward 10% in the movie.", "bigstepforward"),
("BigStepBack", "BigStepBack", "Step back 10% in the movie.", "bigstepback"),
("SmallStepBack", "SmallStepBack", "Step back 7 seconds in the current video.", "smallstepback"),
("OSD", "OSD", "Toggles the OSD while playing an item.", "osd"),
("AspectRatio", "AspectRatio", "Toggle through the various aspect ratio modes (Normal is the preferred option).", "aspectratio"),
("ShowSubtitles", "ShowSubtitles", "Toggles whether subtitles are shown or not.", "showsubtitles"),
("NextSubtitle", "NextSubtitle", "Change to the next subtitle language, if there is more than one.", "nextsubtitle"),
('Subtitledelay', 'SubtitleDelay', 'Show subtitle delay slider', 'subtitledelay'),
("SubtitleDelayMinus", "SubtitleDelayMinus", "Decrease the delay amount of subtitles (use if subtitles are displaying too late)", "subtitledelayminus"),
("SubtitleDelayPlus", "SubtitleDelayPlus", "Increase the delay amount of subtitles (use if subtitles are displaying too early)", "subtitledelayplus"),
('Audiodelay', 'AudioDelay', 'Show audio delay slider', 'audiodelay'),
("AudioDelayMinus", "AudioDelayMinus", "Decrease the delay amount of audio (use if audio is being heard too early)", "audiodelayminus"),
("AudioDelayPlus", "AudioDelayPlus", "Increase the delay amount of audio (use if audio is being heard too late)", "audiodelayplus"),
("AudioNextLanguage", "AudioNextLanguage", "Change to the next audio track in a video with multiple audio tracks.", "audionextlanguage"),
("mplayerosd", "MplayerOSD", "Show Mplayer's OSD", "mplayerosd"),
("ShowTime", "ShowTime", "Used to show the current play time in music + video playback", "showtime"),
("ShowVideoMenu", "ShowVideoMenu", "Go to the DVD Video menu when playing a DVD.", "showvideomenu"),
('Increasepar', 'IncreasePAR', 'Used in video fullscreen to increase the pixel aspect ratio (stretch).', 'increasepar'),
('Decreasepar', 'DecreasePAR', 'Used in video fullscreen to decrease the pixel aspect ratio (stretch).', 'decreasepar'),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_during_a_picture_slideshow http://kodi.wiki/view/Action_IDs#Actions_available_during_a_picture_slideshow
SLIDESHOW_ACTIONS = (
(eg.ActionGroup, "PictureSlideshow", "Picture slideshow", None, (
("NextPicture", "NextPicture", "Move to the next picture in a slideshow.", "nextpicture"),
("PreviousPicture", "PreviousPicture", "Move to the previous picture in a slideshow.", "previouspicture"),
("ZoomOut", "ZoomOut", "Used in picture, slideshow or video fullscreen to zoom out of the current image/video.", "zoomout"),
("ZoomIn", "ZoomIn", "Used in picture, slideshow or video fullscreen to zoom in to the current image/video.", "zoomin"),
("ZoomNormal", "ZoomNormal", "Normal (fullscreen) viewing in My Pictures", "zoomnormal"),
("ZoomLevel1", "ZoomLevel1", "Zoom to 120% in My Pictures", "zoomlevel1"),
("ZoomLevel2", "ZoomLevel2", "Zoom to 150% in My Pictures", "zoomlevel2"),
("ZoomLevel3", "ZoomLevel3", "Zoom to 200% in My Pictures", "zoomlevel3"),
("ZoomLevel4", "ZoomLevel4", "Zoom to 280% in My Pictures", "zoomlevel4"),
("ZoomLevel5", "ZoomLevel5", "Zoom to 400% in My Pictures", "zoomlevel5"),
("ZoomLevel6", "ZoomLevel6", "Zoom to 600% in My Pictures", "zoomlevel6"),
("ZoomLevel7", "ZoomLevel7", "Zoom to 900% in My Pictures", "zoomlevel7"),
("ZoomLevel8", "ZoomLevel8", "Zoom to 1350% in My Pictures", "zoomlevel8"),
("ZoomLevel9", "ZoomLevel9", "Zoom to 2000% in My Pictures", "zoomlevel9"),
("AnalogMove", "AnalogMove", "Move in the calibration screens, and while zoomed in My Pictures.", "analogmove"),
("Rotate", "Rotate", "Rotate a picture in My Pictures", "rotate"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_in_screen_calibration http://kodi.wiki/view/Action_IDs#Actions_available_in_screen_calibration
CALIBRATION_ACTIONS = (
(eg.ActionGroup, "ScreenCalibration", "Screen calibration", None, (
("NextCalibration", "NextCalibration", "Used in Video + GUI calibration", "nextcalibration"),
("ResetCalibration", "ResetCalibration", "Used in Video + GUI calibration", "resetcalibration"),
("AnalogMove", "AnalogMove", "Move in the calibration screens, and while zoomed in My Pictures.", "analogmove"),
("NextResolution", "NextResolution", "Used in Video calibration", "nextresolution"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_in_the_File_Manager http://kodi.wiki/view/Action_IDs#Actions_available_in_the_File_Manager
FILEMANAGER_ACTIONS = (
(eg.ActionGroup, "FileManager", "File Manager", None, (
("Delete", "Delete", "Used in My Files to delete a file.", "delete"),
("Copy", "Copy", "Used in My Files to copy a file.", "copy"),
("Move", "Move", "Used in My Files to move a file.", "move"),
("Rename", "Rename", "Used in My Files to rename a file.", "rename"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_in_the_on-screen_keyboard http://kodi.wiki/view/Action_IDs#Actions_available_in_the_on-screen_keyboard
ON_SCREEN_KEYBOARD_ACTIONS = (
(eg.ActionGroup, "On-screenKeyboard", "On-screen keyboard", None, (
("BackSpace", "BackSpace", "Used in the virtual keyboards to delete one letter.", "backspace"),
("Shift", "Shift", "Used in Virtual Keyboard to switch to upper or lower case letters", "shift"),
("Symbols", "Symbols", "Used in Virtual Keyboard to switch to or from symbols mode", "symbols"),
("CursorLeft", "CursorLeft", "Used in Virtual Keyboard to move the current cursor point to the left", "cursorleft"),
("CursorRight", "CursorRight", "Used in Virtual Keyboard to move the current cursor point to the right", "cursorright"),
)),
)
# Actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#Actions_available_during_a_music_visualisation http://kodi.wiki/view/Action_IDs#Actions_available_during_a_music_visualisation
VISUALISATION_ACTIONS = (
(eg.ActionGroup, "MusicVisualisation", "Music visualisation", None, (
("OSD", "OSD", "Toggles the OSD while playing an item.", "osd"),
("ShowPreset", "ShowPreset", "Shows the current visualisation preset (milkdrop/spectrum)", "showpreset"),
("PresetList", "PresetList", "Pops up the visualisation preset list (milkdrop/spectrum)", "presetlist"),
("NextPreset", "NextPreset", "Next visualisation preset", "nextpreset"),
("PreviousPreset", "PreviousPreset", "Previous visualisation preset", "previouspreset"),
("LockPreset", "LockPreset", "Lock the current visualisation preset", "lockpreset"),
("RandomPreset", "RandomPreset", "Switch to a new random preset", "randompreset"),
("increasevisrating", "IncreaseVisRating", "", "increasevisrating"),
("decreasevisrating", "DecreaseVisRating", "", "decreasevisrating"),
)),
)
SHUTDOWN_ACTIONS = (
(eg.ActionGroup, "ShutdownRelated", "Shutdown related", None, (
("Quit", "Quit", "Quit XBMC", "Quit"),
("RestartApp", "RestartApp", "Restart XBMC", "RestartApp"),
("Reset", "Reset Computer", "Reset the computer.", "reset"),
("Shutdown", "Shutdown Computer", "Trigger default Shutdown action defined in System Settings, Default Quit on Windows.", "shutdown"),
("Powerdown", "Powerdown", "Powerdown system", "Powerdown"),
("Suspend", "Suspend", "Suspends the system", "Suspend"),
("Hibernate", "Hibernate", "Hibernates the system", "Hibernate"),
("Reboot", "Reboot Computer", "Cold reboots the system (power cycle).", "reboot"),
("Restart", "Restart Computer", "Cold reboots the system (power cycle).", "restart"),
)),
)
UNCATEGORIZED_ACTIONS = (
(eg.ActionGroup, "UncategorizedActions", "Uncategorized actions", None, (
("JumpSMS2", "JumpSMS2", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms2"),
("JumpSMS3", "JumpSMS3", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms3"),
("JumpSMS4", "JumpSMS4", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms4"),
("JumpSMS5", "JumpSMS5", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms5"),
("JumpSMS6", "JumpSMS6", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms6"),
("JumpSMS7", "JumpSMS7", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms7"),
("JumpSMS8", "JumpSMS8", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms8"),
("JumpSMS9", "JumpSMS9", "Jump through a list using SMS-style input (eg press 2 twice to jump to the B's.)", "jumpsms9"),
("FilterClear", "FilterClear", "", "filterclear"),
("FilterSMS2", "FilterSMS2", "Filter a list in music or videos using SMS-style input.", "filtersms2"),
("FilterSMS3", "FilterSMS3", "Filter a list in music or videos using SMS-style input.", "filtersms3"),
("FilterSMS4", "FilterSMS4", "Filter a list in music or videos using SMS-style input.", "filtersms4"),
("FilterSMS5", "FilterSMS5", "Filter a list in music or videos using SMS-style input.", "filtersms5"),
("FilterSMS6", "FilterSMS6", "Filter a list in music or videos using SMS-style input.", "filtersms6"),
("FilterSMS7", "FilterSMS7", "Filter a list in music or videos using SMS-style input.", "filtersms7"),
("FilterSMS8", "FilterSMS8", "Filter a list in music or videos using SMS-style input.", "filtersms8"),
("FilterSMS9", "FilterSMS9", "Filter a list in music or videos using SMS-style input.", "filtersms9"),
("FirstPage", "FirstPage", "", "firstpage"),
("LastPage", "LastPage", "", "lastpage"),
("HideSubMenu", "HideSubMenu", "<depreciated>", "hidesubmenu"),
("ToggleSource", "ToggleSource", "", "togglesource"),
("Remove", "Remove", "", "remove"),
("AudioToggleDigital", "AudioToggleDigital", "", "audiotoggledigital"),
("OSDLeft", "OSDLeft", "", "osdleft"),
("OSDRight", "OSDRight", "", "osdright"),
("OSDUp", "OSDUp", "", "osdup"),
("OSDDown", "OSDDown", "", "osddown"),
("OSDSelect", "OSDSelect", "", "osdselect"),
("OSDValuePlus", "OSDValuePlus", "", "osdvalueplus"),
("OSDValueMinus", "OSDValueMinus", "", "osdvalueminus"),
("ToggleWatched", "ToggleWatched", "Toggles watched/unwatched status for Videos", "togglewatched"),
("ScanItem", "ScanItem", "", "scanitem"),
("Enter", "Enter", "", "enter"),
("IncreaseRating", "IncreaseRating", "Unused", "increaserating"),
("DecreaseRating", "DecreaseRating", "Unused", "decreaserating"),
("ToggleFullScreen", "ToggleFullScreen", "", "togglefullscreen"),
("NextScene", "NextScene", "", "nextscene"),
("PreviousScene", "PreviousScene", "", "previousscene"),
("NextLetter", "NextLetter", "Move to the next letter in a list or thumb panel. Note that SHIFT-B on the keyboard will take you to the B's.", "nextletter"),
("PrevLetter", "PrevLetter", "Move to the previous letter in a list or thumb panel. Note that SHIFT-Z on the keyboard will take you to the Z's.", "prevletter"),
('Verticalshiftup', 'VerticalShiftUp', '', 'verticalshiftup'),
('Verticalshiftdown', 'VerticalShiftDown', '', 'verticalshiftdown'),
('Playpause', 'PlayPause', '', 'playpause'),
('Reloadkeymaps', 'ReloadKeymaps', '', 'reloadkeymaps'),
('Guiprofile', 'GuiProfile', '', 'guiprofile'),
('Red', 'Red', '', 'red'),
('Green', 'Green', '', 'green'),
('Yellow', 'Yellow', '', 'yellow'),
('Blue', 'Blue', '', 'blue'),
('Subtitleshiftup', 'Subtitleshiftup', '', 'subtitleshiftup'),
('Subtitleshiftdown', 'Subtitleshiftdown', '', 'subtitleshiftdown'),
('Subtitlealign', 'Subtitlealign', '', 'subtitlealign'),
('Help', 'Help', 'This help message', 'Help'),
('Minimize', 'Minimize', 'Minimize XBMC', 'Minimize'),
('Mastermode', 'Mastermode', 'Control master mode', 'Mastermode'),
('TakeScreenshot', 'TakeScreenshot', 'Takes a Screenshot', 'TakeScreenshot'),
('ReloadSkin', 'ReloadSkin', "Reload XBMC's skin", 'ReloadSkin'),
('UnloadSkin', 'UnloadSkin', "Unload XBMC's skin", 'UnloadSkin'),
('RefreshRSS', 'RefreshRSS', 'Reload RSS feeds from RSSFeeds.xml', 'RefreshRSS'),
('Playlist.Clear', 'Playlist.Clear', 'Clear the current playlist', 'Playlist.Clear'),
('RipCD', 'RipCD', 'Rip the currently inserted audio CD', 'RipCD'),
('Skin.ResetSettings', 'Skin.ResetSettings', 'Resets all skin settings', 'Skin.ResetSettings'),
('System.LogOff', 'System.LogOff', 'Log off current user', 'System.LogOff'),
('Container.Refresh', 'Container.Refresh', 'Refresh current listing', 'Container.Refresh'),
('Container.Update', 'Container.Update', 'Update current listing. Send Container.Update(path,replace) to reset the path history', 'Container.Update'),
('Container.NextViewMode', 'Container.NextViewMode', 'Move to the next view type (and refresh the listing)', 'Container.NextViewMode'),
('Container.PreviousViewMode', 'Container.PreviousViewMode', 'Move to the previous view type (and refresh the listing)', 'Container.PreviousViewMode'),
('Container.NextSortMethod', 'Container.NextSortMethod', 'Change to the next sort method', 'Container.NextSortMethod'),
('Container.PreviousSortMethod', 'Container.PreviousSortMethod', 'Change to the previous sort method', 'Container.PreviousSortMethod'),
('Container.SortDirection', 'Container.SortDirection', 'Toggle the sort direction', 'Container.SortDirection'),
('UpdateAddonRepos', 'UpdateAddonRepos', 'Check add-on repositories for updates', 'UpdateAddonRepos'),
('UpdateLocalAddons', 'UpdateLocalAddons', 'Check for local add-on changes', 'UpdateLocalAddons'),
('ToggleDPMS', 'ToggleDPMS', 'Toggle DPMS mode manually', 'ToggleDPMS'),
('Weather.Refresh', 'Weather.Refresh', 'Force weather data refresh', 'Weather.Refresh'),
('Weather.LocationNext', 'Weather.LocationNext', 'Switch to next weather location', 'Weather.LocationNext'),
('Weather.LocationPrevious', 'Weather.LocationPrevious', 'Switch to previous weather location', 'Weather.LocationPrevious'),
('LIRC.Stop', 'LIRC.Stop', 'Removes XBMC as LIRC client', 'LIRC.Stop'),
('LIRC.Start', 'LIRC.Start', 'Adds XBMC as LIRC client', 'LIRC.Start'),
('LCD.Suspend', 'LCD.Suspend', 'Suspends LCDproc', 'LCD.Suspend'),
('LCD.Resume', 'LCD.Resume', 'Resumes LCDproc', 'LCD.Resume'),
)),
)
# Remote buttons handled by XBMC. For a list of all buttons see: http://wiki.xbmc.org/?title=Keymap.xml#Remote_Section http://kodi.wiki/view/Keymap.xml#Remotes
REMOTE_BUTTONS = (
(eg.ActionGroup, "Remote", "Remote", None, (
("RemoteLeft", "Left", "", "left"),
("RemoteRight", "Right", "", "right"),
("RemoteUp", "Up", "", "up"),
("RemoteDown", "Down", "", "down"),
("RemoteSelect", "Select", "", "select"),
("RemoteBack", "Back", "", "back"),
("RemoteMenu", "Menu", "", "menu"),
("RemoteInfo", "Info", "", "info"),
("RemoteDisplay", "Display", "", "display"),
("RemoteTitle", "Title", "", "title"),
("RemotePlay", "Play", "", "play"),
("RemotePause", "Pause", "", "pause"),
("RemoteReverse", "Reverse", "", "reverse"),
("RemoteForward", "Forward", "", "forward"),
("RemoteSkipPlus", "Skip +", "", "skipplus"),
("RemoteSkipMinus", "Skip -", "", "skipminus"),
("RemoteStop", "Stop", "", "stop"),
("Remote0", "0", "", "zero"),
("Remote1", "1", "", "one"),
("Remote2", "2", "", "two"),
("Remote3", "3", "", "three"),
("Remote4", "4", "", "four"),
("Remote5", "5", "", "five"),
("Remote6", "6", "", "six"),
("Remote7", "7", "", "seven"),
("Remote8", "8", "", "eight"),
("Remote9", "9", "", "nine"),
("RemotePower", "Power", "", "power"),
("RemoteMyTV", "My TV", "", "mytv"),
("RemoteMyMusic", "My Music", "", "mymusic"),
("RemoteMyPictures", "My Pictures", "", "mypictures"),
("RemoteMyVideo", "My Video", "", "myvideo"),
("RemoteRecord", "Record", "", "record"),
("RemoteStart", "Start", "", "start"),
("RemoteVolPlus", "Vol +", "", "volumeplus"),
("RemoteVolMinus", "Vol -", "", "volumeminus"),
("Remotechannelplus", "CH +", "", "channelplus"),
("Remotechannelminus", "CH -", "", "channelminus"),
("Remotepageplus", "PG +", "", "pageplus"),
("Remotepageminus", "PG -", "", "pageminus"),
("RemoteMute", "Mute", "", "mute"),
("RemoteRecordedTV", "Recorded TV", "", "recordedtv"),
("RemoteLiveTV", "Live TV", "", "livetv"),
("RemoteStar", "*", "", "star"),
("Remote#", "#", "", "hash"),
("RemoteClear", "Clear", "", "clear"),
("Remoteguide", "Guide", "", "guide"),
("Remoteenter", "Enter", "", "enter"),
("Remotexbox", "Xbox", "", "xbox"),
("Remoteteletext", "Teletext", "", "teletext"),
("Remotered", "Red", "", "red"),
("Remotegreen", "Green", "", "green"),
("Remoteyellow", "Yellow", "", "yellow"),
("Remoteblue", "Blue", "", "blue"),
("Remotesubtitle", "Subtitle", "", "subtitle"),
("Remotelanguage", "Language", "", "language"),
)),
)
# Remote buttons handled by XBMC. For a list of all buttons see: http://wiki.xbmc.org/?title=Keymap.xml#Gamepad_Section http://kodi.wiki/view/Keymap.xml#Gamepads
GAMEPAD_BUTTONS = (
(eg.ActionGroup, "Gamepad", "Gamepad", None, (
("GamepadA", "A", "", "a"),
("GamepadB", "B", "", "b"),
("GamepadX", "X", "", "x"),
("GamepadY", "Y", "", "y"),
("GamepadWhite", "White", "", "white"),
("GamepadBlack", "Black", "", "black"),
("GamepadStart", "Start", "", "start"),
("GamepadBack", "Back", "", "back"),
("GamepadLeftThumbButton", "LeftThumbButton", "", "leftthumbbutton"),
("GamepadRightThumbButton", "RightThumbButton", "", "rightthumbbutton"),
("GamepadLeftThumbStick", "LeftThumbStick", "", "leftthumbstick"),
("GamepadLeftThumbStickUp", "LeftThumbStickUp", "", "leftthumbstickup"),
("GamepadLeftThumbStickDown", "LeftThumbStickDown", "", "leftthumbstickdown"),
("GamepadLeftThumbStickLeft", "LeftThumbStickLeft", "", "leftthumbstickleft"),
("GamepadLeftThumbStickRight", "LeftThumbStickRight", "", "leftthumbstickright"),
("GamepadRightThumbStick", "RightThumbStick", "", "rightthumbstick"),
("GamepadRightThumbStickUp", "RightThumbStickUp", "", "rightthumbstickup"),
("GamepadRightThumbStickDown", "RightThumbStickDown", "", "rightthumbstickdown"),
("GamepadRightThumbStickLeft", "RightThumbStickLeft", "", "rightthumbstickleft"),
("GamepadRightThumbStickRight", "RightThumbStickRight", "", "rightthumbstickright"),
("GamepadLeftTrigger", "LeftTrigger", "", "lefttrigger"),
("GamepadRightTrigger", "RightTrigger", "", "righttrigger"),
("GamepadLeftAnalogTrigger", "LeftAnalogTrigger", "", "leftanalogtrigger"),
("GamepadRightAnalogTrigger", "RightAnalogTrigger", "", "rightanalogtrigger"),
("GamepadDpadLeft", "DpadLeft", "", "dpadleft"),
("GamepadDpadRight", "DpadRight", "", "dpadright"),
("GamepadDpadUp", "DpadUp", "", "dpadup"),
("GamepadDpadDown", "DpadDown", "", "dpaddown"),
)),
)
# Remote buttons handled by XBMC. For a list of all buttons see: http://wiki.xbmc.org/?title=Keymap.xml#Custom_Joystick_Configuration http://kodi.wiki/view/Keymap.xml#Custom_Joystick_Configuration
APPLEREMOTE_BUTTONS = (
(eg.ActionGroup, "AppleRemote", "AppleRemote", None, (
("AppleRemote1", "plus", "AppleRemote", 1),
("AppleRemote2", "minus", "AppleRemote", 2),
("AppleRemote3", "left", "AppleRemote", 3),
("AppleRemote4", "right", "AppleRemote", 4),
("AppleRemote5", "center", "AppleRemote", 5),
("AppleRemote6", "menu", "AppleRemote", 6),
("AppleRemote7", "hold center", "AppleRemote", 7),
("AppleRemote8", "hold menu", "AppleRemote", 8),
#<!-- old buttons for ATV1 <2.2, used on OSX -->
("AppleRemote9", "hold left", "AppleRemote:\nold buttons for ATV1 <2.2, used on OSX", 9),
("AppleRemote10", "hold right", "AppleRemote:\nold buttons for ATV1 <2.2, used on OSX", 10),
#<!-- new aluminium remote buttons -->
("AppleRemote12", "play/pause", "AppleRemote:\nnew aluminium remote buttons", 12),
#<!-- Additional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen-->
("AppleRemote13", "pageup", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 13),
("AppleRemote14", "pagedown", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 14),
("AppleRemote15", "pause", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 15),
("AppleRemote16", "play2", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 16),
("AppleRemote17", "stop", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 17),
("AppleRemote18", "fast fwd", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 18),
("AppleRemote19", "rewind", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 19),
("AppleRemote20", "skip fwd", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 20),
("AppleRemote21", "skip back", "AppleRemote:\nAdditional buttons via Harmony Apple TV remote profile - these are also the learned buttons on Apple TV 2gen", 21),
#<!-- Learned remote buttons (ATV1 >2.3) -->
("AppleRemote70", "Play", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 70),
("AppleRemote71", "Pause", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 71),
("AppleRemote72", "Stop", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 72),
("AppleRemote73", "Previous", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 73),
("AppleRemote74", "Next", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 74),
("AppleRemote75", "Rewind", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 75),
("AppleRemote76", "Forward", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 76),
("AppleRemote77", "Return", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 77),
("AppleRemote78", "Enter", "AppleRemote:\nLearned remote buttons (ATV1 >2.3)", 78),
#<!-- few gestures from Apple's iPhone Remote (ATV1 > 2.3 ?) -->
("AppleRemote80", "SwipeLeft", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 80),
("AppleRemote81", "SwipeRight", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 81),
("AppleRemote82", "SwipeUp", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 82),
("AppleRemote83", "SwipeDown", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 83),
("AppleRemote85", "FlickLeft", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 85),
("AppleRemote86", "FlickRight", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 86),
("AppleRemote87", "FlickUp", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 87),
("AppleRemote88", "FlickDown", "AppleRemote:\nfew gestures from Apple's iPhone Remote (ATV1 > 2.3 ?)", 88),
)),
)
# Keyboard keys handled by XBMC. For a list of all keys see: http://wiki.xbmc.org/index.php?title=List_of_XBMC_keynames http://kodi.wiki/view/List_of_XBMC_keynames
KEYBOARD_KEYS = (
(eg.ActionGroup, "Keyboard", "Keyboard", None, (
("KeyboardBackspace", "Backspace", "", "backspace"),
("KeyboardEnter", "Enter", "", "enter"),
("KeyboardTab", "Tab", "", "tab"),
)),
)
# Support functions
def ParseString2(text, filterFunc=None):
start = 0
chunks = []
last = len(text) - 1
while 1:
pos = text.find('{{', start)
if pos < 0:
break
if pos == last:
break
chunks.append(text[start:pos])
start = pos + 2
end = text.find('}}', start)
if end == -1:
raise SyntaxError("unmatched bracket")
word = text[start:end]
res = None
if filterFunc:
res = filterFunc(word)
if res is None:
res = eval(word, {}, eg.globals.__dict__)
chunks.append(unicode(res))
start = end + 2
chunks.append(text[start:])
return "".join(chunks)
class ActionPrototype(eg.ActionClass):
def __call__(self):
try:
self.plugin.xbmc.send_action(self.value, ACTION_BUTTON)
except:
raise self.Exceptions.ProgramNotRunning
# actions handled by XBMC. For a list of all actions see: http://xbmc.org/wiki/?title=Action_IDs#General_actions_available_throughout_most_of_XBMC
"""
CONFIGURABLE_ACTIONS = (
(eg.ActionGroup, "General", "General", None, (
("UpdateLibrary", "UpdateLibrary", "UpdateLibrary", "UpdateLibrary(Video)"),
)),
)
"""
class UpdateLibrary(eg.ActionBase):
def __call__(self, libraryType="Video", updatePath=""):
parameterString = libraryType
if not updatePath == "":
parameterString += "," + updatePath
print repr(parameterString)
try:
#self.plugin.xbmc.send_action("UpdateLibrary("+libraryType+","+updatePath+")", ACTION_BUTTON)
#self.plugin.xbmc.send_action("UpdateLibrary(video,\\\\MYTHTV\\Media\\Multimedia\\Movies\\Anime TV\\Mikagura Gakuen Kumikyoku)", ACTION_BUTTON)
self.plugin.xbmc.send_action("UpdateLibrary(" + str(parameterString) + ")")
except:
raise self.Exceptions.ProgramNotRunning
def Configure(self, libraryType="Video", updatePath="" ):
panel = eg.ConfigPanel()
textControl1 = wx.TextCtrl(panel, -1, libraryType)
textControl2 = wx.TextCtrl(panel, -1, updatePath)
panel.sizer.Add(textControl1, 1, wx.EXPAND)
panel.sizer.Add(textControl2, 1, wx.EXPAND)
while panel.Affirmed():
panel.SetResult(textControl1.GetValue(), textControl2.GetValue())
class BuiltInFunctions(eg.ActionBase):
def __call__(self, Function="Help", Parameters=""):
try:
self.plugin.xbmc.send_action(Function + "(" + str(eg.ParseString(Parameters)) + ")")
except:
raise self.Exceptions.ProgramNotRunning
def Configure(self, Function="Help", Parameters=""):
import os, contextlib, pickle
BuiltInFunctionList = {}
def UpdateFunctions():
def GetFunctions():
try:
with contextlib.closing(urllib2.urlopen(urllib2.Request('https://raw.githubusercontent.com/xbmc/xbmc/Isengard/xbmc/interfaces/Builtins.cpp'))) as Builtinscpp:
Builtinslines = Builtinscpp.read().splitlines(False)
except (urllib2.HTTPError, urllib2.URLError):
eg.PrintError('XBMC2: Error: Can\'t connect to "https://raw.githubusercontent.com/xbmc/xbmc/Isengard/xbmc/interfaces/Builtins.cpp" to update "BuiltInFunctions".')
raise
else:
Builtinslist = Builtinslines[Builtinslines.index("const BUILT_IN commands[] = {") + 1:Builtinslines.index("};")]
FunctionList = []
for Function in Builtinslist:
try:
FunctionList.append((Function.strip(' {},').split(',')[0].strip('" '), True if Function.strip(' {},').split(',')[1].strip('" ') == 'true' else False, Function.strip(' {},').split(',')[2].strip('" ')))
except IndexError:
pass
return FunctionList
def GetSyntax():
def XMLText(Node):
text = ''
#print "Info:", Node.nodeValue, Node.nodeName
try:
for n in Node.childNodes:
text += n.nodeValue if n.nodeName == '#text' else XMLText(n)
#print "Text:", text
except:
print "Try:", Node.nodeValue, Node.nodeName
return text
URL = 'http://kodi.wiki/view/List_of_built-in_functions'
UserAgent = 'XBMC2 EventGhost plugin'
hdr = {'User-Agent': UserAgent}
request = urllib2.Request(URL, headers=hdr)
try:
w = urllib2.urlopen(request)
except (urllib2.HTTPError, urllib2.URLError):
eg.PrintError('XBMC2: Error: Can\'t connect to "http://kodi.wiki/view/List_of_built-in_functions" to update "BuiltInFunctions".')
raise
else:
Page2 = w.read()
ActionDict = {}
for table in xml.dom.minidom.parseString(Page2).getElementsByTagName("table")[1:2]:
for tr in table.getElementsByTagName("tr"):
for code in tr.getElementsByTagName("code")[0:1]:
ActionDict[XMLText(code).strip().split('(')[0]] = (XMLText(code).strip(), XMLText(code.parentNode.nextSibling.nextSibling).strip())
#print XMLText(code).strip().split('(')[0]
return ActionDict
try:
FunctionsList = GetFunctions()
except (urllib2.HTTPError, urllib2.URLError):
BuiltInFunctionList['Help'] = {'Syntax': 'Help', 'Description': "", 'Parameters': False}
else:
try:
SyntaxList = GetSyntax()
except (urllib2.HTTPError, urllib2.URLError):
SyntaxList = {}
for Function, Parameters, Description in sorted(FunctionsList):
try:
SyntaxList[Function]
Syntax = SyntaxList[Function][0]
Description = SyntaxList[Function][1]
except KeyError:
Syntax = Function
BuiltInFunctionList[Function] = {'Syntax': Syntax, 'Description': Description, 'Parameters': Parameters}
"""
if not os.path.exists(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2')):
os.makedirs(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2'))
with open(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2', 'BuiltInFunctions.dat'), 'wb') as f:
pickle.dump(BuiltInFunctionList, f, 1)
print 'XBMC2: Builtin functions updated.'
"""
try:
writeData('BuiltInFunctions.dat', BuiltInFunctionList)
except IOError:
pass
else:
print 'XBMC2: Builtin functions updated.'
"""
def loadfile():
try:
with open(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2', 'BuiltInFunctions.dat'), 'rb') as f:
return pickle.load(f)
except IOError:
print 'XBMC2: Warning: Failed to open: BuiltInFunctions.dat'
raise
"""
def OnUpdate(event):
UpdateFunctions()
def OnFunctionChange(event):
if event.GetEventObject() == panel.combo_box_function:
if not BuiltInFunctionList[panel.combo_box_function.GetValue()]['Parameters']:
panel.text_ctrl_parameters.Disable()
else:
panel.text_ctrl_parameters.Enable()
panel.text_ctrl_syntax.SetValue(BuiltInFunctionList[panel.combo_box_function.GetValue()]['Syntax'])
panel.label_description.SetLabel(BuiltInFunctionList[panel.combo_box_function.GetValue()]['Description'])
def initPanel(self):
self.combo_box_function = wx.ComboBox(self, wx.ID_ANY, value=Function, choices=sorted(BuiltInFunctionList.keys()), style=wx.CB_READONLY)
self.sizer_function_staticbox = wx.StaticBox(self, wx.ID_ANY, "Function")
self.label_left = wx.StaticText(self, wx.ID_ANY, "(")
self.text_ctrl_parameters = wx.TextCtrl(self, wx.ID_ANY, Parameters)
self.label_right = wx.StaticText(self, wx.ID_ANY, ")")
self.sizer_parameter_staticbox = wx.StaticBox(self, wx.ID_ANY, "Parameter(s)")
self.text_ctrl_syntax = wx.TextCtrl(self, wx.ID_ANY, BuiltInFunctionList[Function]['Syntax'], style=wx.TE_READONLY | wx.BORDER_NONE)
self.sizer_syntax_staticbox = wx.StaticBox(self, wx.ID_ANY, "Syntax")
self.label_description = wx.TextCtrl(self, wx.ID_ANY, BuiltInFunctionList[Function]['Description'], style=wx.TE_MULTILINE | wx.TE_READONLY | wx.BORDER_NONE | wx.TE_RICH)
self.sizer_description_staticbox = wx.StaticBox(self, wx.ID_ANY, "Description")
self.button_update = wx.Button(self, wx.ID_ANY, "Update")
if not BuiltInFunctionList[Function]['Parameters']:
self.text_ctrl_parameters.Disable()
setPanelProperties(self)
doPanelLayout(self)
self.Bind(wx.EVT_COMBOBOX, OnFunctionChange, self.combo_box_function)
self.button_update.Bind(wx.EVT_BUTTON, OnUpdate)
def setPanelProperties(self):
self.label_left.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
self.label_right.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
self.button_update.SetToolTipString("Update \"BuiltInFunctions\" form Kodis website.")
def doPanelLayout(self):
sizer_main = wx.BoxSizer(wx.VERTICAL)
self.sizer_description_staticbox.Lower()
sizer_description = wx.StaticBoxSizer(self.sizer_description_staticbox, wx.HORIZONTAL)
self.sizer_syntax_staticbox.Lower()
sizer_syntax = wx.StaticBoxSizer(self.sizer_syntax_staticbox, wx.HORIZONTAL)
sizer_functionparameter = wx.BoxSizer(wx.HORIZONTAL)
self.sizer_parameter_staticbox.Lower()
sizer_parameter = wx.StaticBoxSizer(self.sizer_parameter_staticbox, wx.HORIZONTAL)
self.sizer_function_staticbox.Lower()
sizer_function = wx.StaticBoxSizer(self.sizer_function_staticbox, wx.HORIZONTAL)
sizer_function.Add(self.combo_box_function, 0, 0, 0)
sizer_functionparameter.Add(sizer_function, 0, 0, 0)
sizer_parameter.Add(self.label_left, 0, 0, 0)
sizer_parameter.Add(self.text_ctrl_parameters, 1, wx.EXPAND, 0)
sizer_parameter.Add(self.label_right, 0, 0, 0)
sizer_functionparameter.Add(sizer_parameter, 1, 0, 0)
sizer_main.Add(sizer_functionparameter, 0, wx.EXPAND, 0)
sizer_syntax.Add(self.text_ctrl_syntax, 1, 0, 0)
sizer_main.Add(sizer_syntax, 0, wx.EXPAND, 0)
sizer_description.Add(self.label_description, 1, wx.EXPAND, 0)
sizer_main.Add(sizer_description, 1, wx.EXPAND, 0)
sizer_main.Add(self.button_update, 0, wx.ALIGN_RIGHT, 0)
self.sizer.Add(sizer_main, 1, wx.EXPAND, 0)
panel = eg.ConfigPanel()
try:
#BuiltInFunctionList = loadfile()
BuiltInFunctionList = readData('BuiltInFunctions.dat')
except IOError:
UpdateFunctions()
initPanel(panel)
while panel.Affirmed():
panel.SetResult(str(panel.combo_box_function.GetValue()), str(panel.text_ctrl_parameters.GetValue()))
class ButtonPrototype(eg.ActionClass):
def __call__(self):
try:
packet = PacketBUTTON(map_name=str("R1"), button_name=str(self.value), repeat=0)
packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
except:
raise self.Exceptions.ProgramNotRunning
class GamepadPrototype(eg.ActionClass):
def __call__(self):
try:
packet = PacketBUTTON(map_name=str("XG"), button_name=str(self.value), repeat=0)
packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
except:
raise self.Exceptions.ProgramNotRunning
class AppleRemotePrototype(eg.ActionClass):
def __call__(self):
try:
packet = PacketBUTTON(map_name=str("JS0:AppleRemote"), code=self.value, repeat=0)
packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
except:
raise self.Exceptions.ProgramNotRunning
class KeyboardPrototype(eg.ActionClass):
def __call__(self):
try:
packet = PacketBUTTON(map_name=str("KB"), button_name=str(self.value), repeat=0)
packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
except:
raise self.Exceptions.ProgramNotRunning
class XBMC_HTTP_API:
def __init__(self):
pass
def connect(self, ip="127.0.0.1", port="80", username='', password=''):
self.ip = ip
self.port = port
self.base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
print 'HTTP API connected'
def send(self, method, params = ""):
request = urllib2.Request('http://'+self.ip+':'+self.port+'/xbmcCmds/xbmcHttp?command='+method+'('+urllib2.quote(eg.ParseString(params), ':\\')+')')
request.add_header("Authorization", "Basic %s" % self.base64string)
try:
responce = urllib2.urlopen(request).readlines()
except IOError:
#eg.PrintError('HTTP API connection error:'+' http://'+self.ip+':'+self.port+'\n'+method+'('+urllib2.quote(eg.ParseString(params), ':\\')+')')
raise
else:
if (''.join(responce).find('<html>') != -1):
responce2 = {}
for lines in responce:
if (lines.find('<html>') != -1): lines = lines[lines.find('<html>')+6:]
if (lines.find('</html>') != -1): lines = lines[:lines.find('</html>')]
if (lines.find('<li>') != -1):
if (lines.find('OK') != -1):
responce2 = 'OK'
elif (lines.find('ERROR') != -1):
responce2 = lines[4:].rstrip('\n').split(':', 1)
elif (lines.find(':') != -1):
lines = lines[4:].rstrip('\n').split(':', 1)
responce2[lines[0]] = lines[1]
else:
responce2 = lines[4:].rstrip('\n')
else:
if (lines.rstrip('\n') != ''):
responce2 = lines.rstrip('\n')
return responce2
def close(self):
print 'HTTP API connection closed'
class XBMC_JSON_RPC:
def __init__(self):
self.jsoninit = {'jsonrpc':'2.0', 'id':1}
def connect(self, ip="127.0.0.1", port=80, username='', password=''):
self.ip = ip
self.port = str(port)
self.base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
print 'JSON-RPC connected'
def send(self, method, params = None, wait=True):
self.jsoninit['method'] = method
if params:
self.jsoninit['params'] = params
else:
if self.jsoninit.has_key('params'):
del self.jsoninit['params']
request = urllib2.Request('http://'+self.ip+':'+self.port+'/jsonrpc',json.dumps(self.jsoninit))
request.add_header("Authorization", "Basic %s" % self.base64string)
request.add_header('Content-Type', 'application/json')
try:
#responce = urllib2.urlopen(request, timeout=5).read()
responce = urllib2.urlopen(request, timeout=(60 if wait else 1)).read()
except urllib2.HTTPError as e:
#print 'HTTPError', e.args
#if hasattr(e, 'reason'): # <--
# print 'We failed to reach a server.'
# print 'Reason: ', e.reason
#if hasattr(e, 'code'): # <--
# print 'The server couldn\'t fulfill the request.'
# import BaseHTTPServer
# print 'Error code: ', e.code, BaseHTTPServer.BaseHTTPRequestHandler.responses[e.code]
raise
except urllib2.URLError as e:
#print 'URLError', e.reason, e.args
if type(e.reason) == socket.timeout:
return {'noresult': None}
else:
#print 'URLError', e.reason, e.args
raise
#URLError: <urlopen error timed out>
#URLError timed out (timeout('timed out',),)
#URLError <class 'socket.timeout'> (timeout('timed out',),)
except:
#eg.PrintError('JSON-RPC connect error: ')
#import sys, traceback
#traceback.print_exc()
raise
#except IOError:
#eg.PrintError('JSON-RPC connection error:'+' http://'+self.ip+':'+self.port+'\n'+json.dumps(self.jsoninit))
else:
try:
#print responce
return json.loads(responce)
except ValueError as e:
#eg.PrintError("Server responded but didn't provide valid JSON data: ")
#import sys, traceback
#traceback.print_exc()
#eg.PrintError("Error data: " + str(e)+': "'+str(responce)+'"')
raise
def close(self):
print 'JSON-RPC connection closed'
class GetCurrentlyPlayingFilename(eg.ActionClass):
description = "Get filename of currently playing file"
def __call__(self):
responce = self.plugin.JSON_RPC.send('Player.GetActivePlayers')
if (responce != None):
Method = None
if (responce['result']['picture']): Method = 'Picture'
elif (responce['result']['video']): Method = 'Video'
elif (responce['result']['audio']): Method = 'Audio'
if Method:
print 'Method: ', Method
if (Method != 'Picture'):
responce = self.plugin.JSON_RPC.send(Method+'Playlist.GetItems')
# print 'eg.result: ', responce['items'][responce['current']]['file']
return responce['result']['items'][responce['result']['current']]['file']
else:
responce = self.plugin.HTTP_API.send('getcurrentlyplaying')
if responce:
if (responce['result']['Filename'] == ''):