#!/usr/bin/env python




##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
    import builtins as builtin
except ImportError:
    import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import *
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings

##################################################
## MODULE CONSTANTS
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.4.4'
__CHEETAH_versionTuple__ = (2, 4, 4, 'development', 0)
__CHEETAH_genTime__ = 1644610943.88026
__CHEETAH_genTimestamp__ = 'Fri Feb 11 20:22:23 2022'
__CHEETAH_src__ = '/home/nonsolosat/openpli-dreambox-oe-core/build/tmp/work/dm7080-oe-linux/enigma2-plugin-extensions-openwebif/gitAUTOINC+81b15e17ab-r0/git/plugin/controllers/views/responsive/ajax/webtv.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Feb 11 20:05:52 2022'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class webtv(Template):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        super(webtv, self).__init__(*args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def respond(self, trans=None):



        ## CHEETAH: main method generated for this template
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        _orig_filter_81290457 = _filter
        filterName = u'WebSafe'
        if self._CHEETAH__filters.has_key("WebSafe"):
            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
        else:
            _filter = self._CHEETAH__currentFilter = \
			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
        write(u'''
<link rel="stylesheet" type="text/css" href="/css/chosen.min.css">
<link rel="stylesheet" type="text/css" href="/vxg/vxgplayer-1.8.51.min.css">

<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
\t<div class="card">
\t\t<div class="header">
\t\t\t<div class="row clearfix">
\t\t\t\t<div class="col-xs-12 col-sm-6">
\t\t\t\t\t<h2 id="configtitle">
\t\t\t\t\t\t<i class="material-icons material-icons-centered">tv</i>
\t\t\t\t\t\tWebTV
\t\t\t\t\t</h2>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<div class="body" >
\t\t\t<div id="content_main">
\t\t\t\t<div class="row clearfix id="info">
\t\t\t\t\t<div class="row clearfix">
\t\t\t\t\t\t<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
\t\t\t\t\t\t\t<div id="vlcPlayer" style="margin:0 auto 0 auto;width:640px;height:400px;display:none;">
\t\t\t\t\t\t\t\t<embed type="application/x-vlc-plugin" pluginspage="https://www.videolan.org/vlc/" version="VideoLAN.VLCPlugin.2" width="640px" height="360px" id="vlc"></embed>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div id="htmlPlayer" style="margin:0 auto 0 auto;width:640px;height:400px;display:none;">
\t\t\t\t\t\t\t\t<video id="htmlp" width="640" height="360" controls></video>
\t\t\t\t\t\t\t</div>
''')
        if VFFSL(SL,"vxgenabled",True): # generated from line 30, col 7
            write(u'''\t\t\t\t\t\t\t\t<div id="vxgPlayer" style="margin:0 auto 0 auto;width:640px;height:500px;display:none;"></div>
''')
        write(u'''\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t\t<div class="row clearfix">
\t\t\t\t\t\t<div class="col-xs-12 align-center">
\t\t\t\t\t\t\t<input type="radio" name="plbtn_html" id="plbtn_html" class="radio-vti radio--skinned">
\t\t\t\t\t\t\t<label for="plbtn_html">HTML</label>
\t\t\t\t\t\t\t<input type="radio" name="plbtn_vlc" id="plbtn_vlc" class="radio-vti radio--skinned">
\t\t\t\t\t\t\t<label for="plbtn_vlc">VLC</label>
''')
        if VFFSL(SL,"vxgenabled",True): # generated from line 41, col 1
            write(u'''\t\t\t\t\t\t\t<input type="radio" name="plbtn_vxg" id="plbtn_vxg" class="radio-vti radio--skinned">
\t\t\t\t\t\t\t<label for="plbtn_vxg">VXG</label>
''')
        write(u'''\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t\t<div style="display:inline-block;margin-left:10px;">
\t\t\t\t\t\t<span id="Deinterlace"><!-- TODO: i10n -->
\t\t\t\t\t\t\tDeinterlace: <select id="deinterlace">
\t\t\t\t\t\t\t\t<option value="off">Off</option>
\t\t\t\t\t\t\t\t<option value="blend">Blend</option>
\t\t\t\t\t\t\t\t<option value="bob">Bob</option>
\t\t\t\t\t\t\t\t<option value="discard">Discard</option>
\t\t\t\t\t\t\t\t<option value="linear">Linear</option>
\t\t\t\t\t\t\t\t<option value="mean">Mean</option>
\t\t\t\t\t\t\t\t<option value="x">X</option>
\t\t\t\t\t\t\t\t<option value="yadif">Yadif</option>
\t\t\t\t\t\t\t\t<option value="yadif2x">Yadif2x</option>
\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t</span>
\t\t\t\t\t\t<div style="display:inline-block;margin-left:10px;">
\t\t\t\t\t\t\t<label for="wautoplay">Autoplay</label><!-- TODO: i10n -->
\t\t\t\t\t\t\t<input type="checkbox" name="wautoplay" id="wautoplay">
\t\t\t\t\t\t\t<label id="wtranscodingl" for="wtranscoding">Transcoding</label>
\t\t\t\t\t\t\t<input type="checkbox" name="wtranscoding" id="wtranscoding" data-port="''')
        _v = VFFSL(SL,"transcoder_port",True) # u'$transcoder_port' on line 65, col 80
        if _v is not None: write(_filter(_v, rawExpr=u'$transcoder_port')) # from line 65, col 80.
        write(u'''" name="wtranscoding">
\t\t\t\t\t\t\t<button id="btnstop" style="margin-left:5px;">Stop</button>
\t\t\t\t\t\t\t<button id="btnplay" style="margin-left:5px;">Play</button>
\t\t\t\t\t\t</div>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t\t<div style="display:table;margin-top:10px;margin-bottom:10px;width: 95%;">
\t\t\t\t\t<div style="display:table;margin:10 auto 10 auto;">
\t\t\t\t\t\t<span id="srcbuttons" style="margin-right:10px;">
\t\t\t\t\t\t\t<input type="radio" name="srcbutton" id="sbtn0" class="radio--skinned" checked="checked">
\t\t\t\t\t\t\t<label for="sbtn0">''')
        _v = VFFSL(SL,"tstrings",True)['channels'] # u"$tstrings['channels']" on line 75, col 27
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['channels']")) # from line 75, col 27.
        write(u'''</label>
\t\t\t\t\t\t\t<input type="radio" id="sbtn1" name="srcbutton" class="radio--skinned">
\t\t\t\t\t\t\t<label for="sbtn1">''')
        _v = VFFSL(SL,"tstrings",True)['movies'] # u"$tstrings['movies']" on line 77, col 27
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['movies']")) # from line 77, col 27.
        write(u'''</label>
\t\t\t\t\t\t</span>
\t\t\t\t\t\t<span style="display:inline-block;">
\t\t\t\t\t\t\t<select name="streamchannels" id="streamchannels" tabindex="16"></select>
\t\t\t\t\t\t\t<select name="streamrecordings" id="streamrecordings" tabindex="10"></select>
\t\t\t\t\t\t\t<select id="moviesort">
''')
        count = 0
        da = VFFSL(SL,"tstrings",True)['date']
        na = VFFSL(SL,"tstrings",True)['name']
        sortnames = [VFFSL(SL,"na",True),VFFSL(SL,"na",True),VFFSL(SL,"da",True),VFFSL(SL,"da",True)]
        sorttypes = ['name','named','date','dated']
        sortimg = ['fa-sort-alpha-asc','fa-sort-alpha-desc','fa-sort-numeric-asc','fa-sort-numeric-desc']
        for title in VFFSL(SL,"sortnames",True): # generated from line 89, col 8
            write(u'''\t\t\t\t\t\t\t\t<option value="''')
            _v = VFFSL(SL,"sorttypes",True)[VFFSL(SL,"count",True)] # u'$sorttypes[$count]' on line 90, col 24
            if _v is not None: write(_filter(_v, rawExpr=u'$sorttypes[$count]')) # from line 90, col 24.
            write(u'''" data-class="''')
            _v = VFFSL(SL,"sortimg",True)[VFFSL(SL,"count",True)] # u'$sortimg[$count]' on line 90, col 56
            if _v is not None: write(_filter(_v, rawExpr=u'$sortimg[$count]')) # from line 90, col 56.
            write(u'''">''')
            _v = VFFSL(SL,"title",True) # u'$title' on line 90, col 74
            if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 90, col 74.
            write(u'''</option>
''')
            count += 1
        write(u'''\t\t\t\t\t\t\t</select>
\t\t\t\t\t\t</span>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t</div>
\t\t</div>
\t</div>
</div>

''')
        if VFFSL(SL,"vxgenabled",True): # generated from line 102, col 1
            write(u'''<script src="/vxg/vxgplayer-1.8.51.min.js"></script>
''')
        write(u'''
<script src="/webtv/webtv.js"></script>
<script>
\tjQuery(function() {
\t\tvar playerObj = new PlayerObj();
\t\tplayerObj.setup((\'''')
        _v = VFFSL(SL,"vxgenabled",True) # u'$vxgenabled' on line 110, col 21
        if _v is not None: write(_filter(_v, rawExpr=u'$vxgenabled')) # from line 110, col 21.
        write(u"""' === 'True'), '""")
        _v = VFFSL(SL,"auth",True) # u'$auth' on line 110, col 48
        if _v is not None: write(_filter(_v, rawExpr=u'$auth')) # from line 110, col 48.
        write(u"""', '""")
        _v = VFFSL(SL,"streaming_port",True) # u'$streaming_port' on line 110, col 57
        if _v is not None: write(_filter(_v, rawExpr=u'$streaming_port')) # from line 110, col 57.
        write(u"""');
\t});
</script>

""")
        _filter = self._CHEETAH__currentFilter = _orig_filter_81290457
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_webtv= 'respond'

## END CLASS DEFINITION

if not hasattr(webtv, '_initCheetahAttributes'):
    templateAPIClass = getattr(webtv, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(webtv)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=webtv()).run()


