Ejemplo n.º 1
0
def show_tv_shows_view(modelMap, window):
    window.getControl(200).setVisible(False)
    window.getControl(400).setVisible(False)
    window.getControl(600).setVisible(False)
    window.getControl(800).setVisible(False)
    window.getControl(900).setVisible(False)
    window.getControl(100).setVisible(False)
    window.getControl(1000).setVisible(False)
    window.getControl(1100).setVisible(False)
    window.getControl(1200).setVisible(False)
    window.getControl(300).setVisible(True)
    window.getControl(305).setEnabled(True)
    logging.getLogger().debug('total tv shows: %s' % str(len(modelMap['tv_show_items'])))
    window.getControl(305).reset()
    window.getControl(305).addItems(modelMap['tv_show_items'])
    window.setFocusId(305)
    if modelMap.has_key('selected_tv_show_item'):
        window.getControl(305).selectItem(modelMap['selected_tv_show_item'])
    
    window.getControl(303).setLabel(modelMap['channel_name'])
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=modelMap['channel_image'], aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    CacheManager().put('channel_image', modelMap['channel_image'])
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    logging.getLogger().debug('Inside VIEWS:list of temp controls to add size : %s' % str(len(controls)))
Ejemplo n.º 2
0
def show_tv_channel_episode_videos_list_view(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(500).setVisible(False)
    system.hide_busy_dialog()
    window.getControl(600).setVisible(False)
    window.getControl(1000).setVisible(False)

    window.getControl(804).reset()
    logging.getLogger().debug(
        'Channel name in show_tv_show_episode_videos_list_view = %s' %
        modelMap['channel-name'])
    window.getControl(801).setLabel(modelMap['channel-name'])
    window.getControl(802).setLabel(modelMap['tv-show-name'])
    window.getControl(803).setLabel(modelMap['episode-name'])
    window.getControl(804).addItems(modelMap['videos-item-list'])
    window.getControl(800).setVisible(True)
    window.setFocusId(804)
Ejemplo n.º 3
0
def show_tv_show_options(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(True)
        window.getControl(305).setEnabled(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        window.getControl(502).setPercent(100)
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(502).setPercent(0)
        logging.getLogger().debug(len(modelMap['tv-show-images']))
        window.getControl(901).reset()
        
        window.getControl(901).addItems(modelMap['tv-show-images'])
        window.getControl(900).setVisible(True)
        window.getControl(305).setEnabled(False)
        window.setFocusId(901)
        logging.getLogger().debug('list visible')
Ejemplo n.º 4
0
def show_refresh_view(modelMap, window):
    logging.getLogger().debug('Refresh cache attribute: %s' % str(modelMap['refresh_cache']))
    if modelMap['refresh_cache']:
        window.getControl(201).setVisible(False)
        window.getControl(202).setVisible(False)
        window.getControl(203).setVisible(False)
        window.getControl(204).setVisible(False)
        window.getControl(300).setVisible(False)
        window.getControl(100).setVisible(False)
        window.getControl(400).setVisible(False)
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(False)
        window.getControl(800).setVisible(False)
        window.getControl(900).setVisible(False)
        window.getControl(1000).setVisible(False)
        window.getControl(1100).setVisible(False)
        window.getControl(1200).setVisible(False)
        
        window.getControl(201).setVisible(True)
        window.getControl(202).setVisible(True)
        window.getControl(203).setVisible(False)
        window.getControl(204).setVisible(False)
        window.getControl(206).setPercent(0)
        window.getControl(206).setVisible(True)
        window.getControl(205).setLabel("LOADING TV SHOWS...")
        window.getControl(200).setVisible(True)
        modelMap['progress_control'] = window.getControl(206)
        image = xbmcgui.ControlImage(440, 320, 118, 100, filename="", aspectRatio=0, colorDiffuse='0xFFF7F7F7')
        window.addControl(image)
        image.setVisible(False)
        controls = CacheManager().get('controls_to_be_deleted')
        controls.append(image)
        modelMap['channel_image_control'] = image
Ejemplo n.º 5
0
def show_tv_show_options(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)

    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)

    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(True)
        window.getControl(305).setEnabled(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        window.getControl(502).setPercent(100)
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(502).setPercent(0)
        logging.getLogger().debug(len(modelMap['tv-show-images']))
        window.getControl(901).reset()

        window.getControl(901).addItems(modelMap['tv-show-images'])
        window.getControl(900).setVisible(True)
        window.getControl(305).setEnabled(False)
        window.setFocusId(901)
        logging.getLogger().debug('list visible')
Ejemplo n.º 6
0
def show_tv_channel_episodes_view(modelMap, window):
    window.getControl(200).setVisible(False)
    window.getControl(300).setVisible(False)
    window.getControl(400).setVisible(False)
    window.getControl(600).setVisible(False)
    window.getControl(800).setVisible(False)
    window.getControl(900).setVisible(False)
    window.getControl(100).setVisible(False)
    window.getControl(1001).setLabel(modelMap['channel_name'])
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=modelMap['channel_image'], aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    CacheManager().put('channel_image', modelMap['channel_image'])
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    system.hide_busy_dialog()
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        logging.getLogger().debug('total tv show episodes: %s' % str(len(modelMap['tv_show_episode_items'])))
        window.getControl(1002).reset()
        window.getControl(1002).addItems(modelMap['tv_show_episode_items'])
        window.getControl(1000).setVisible(True)
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(False)
        window.setFocusId(1002)
Ejemplo n.º 7
0
def play_video_streams(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(500).setVisible(False)
    system.hide_busy_dialog()
    logging.getLogger().debug('play video streams found')
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        video_items = modelMap['video_streams']
        logging.getLogger().debug('total video streams found = %s' %
                                  str(len(video_items)))
        for video_item in video_items:
            playlist.add(url=video_item.getProperty('streamLink'),
                         listitem=video_item)
        logging.getLogger().debug('Playlist size = %s ' % str(playlist.size()))
        xbmc.Player().play(playlist)
Ejemplo n.º 8
0
def show_tv_show_episodes_view(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFD1EEFC')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        logging.getLogger().debug('total tv show episodes: %s' %
                                  str(len(modelMap['tv_show_episode_items'])))
        window.getControl(305).setEnabled(False)
        window.getControl(401).reset()
        window.getControl(401).addItems(modelMap['tv_show_episode_items'])
        window.getControl(400).setVisible(True)
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(False)
        window.setFocusId(401)
Ejemplo n.º 9
0
def show_tv_shows_view(modelMap, window):
    window.getControl(200).setVisible(False)
    window.getControl(400).setVisible(False)
    window.getControl(600).setVisible(False)
    window.getControl(800).setVisible(False)
    window.getControl(900).setVisible(False)
    window.getControl(100).setVisible(False)
    window.getControl(1000).setVisible(False)
    window.getControl(1100).setVisible(False)
    window.getControl(300).setVisible(True)
    window.getControl(305).setEnabled(True)
    logging.getLogger().debug('total tv shows: %s' %
                              str(len(modelMap['tv_show_items'])))
    window.getControl(305).reset()
    window.getControl(305).addItems(modelMap['tv_show_items'])
    window.setFocusId(305)
    if modelMap.has_key('selected_tv_show_item'):
        window.getControl(305).selectItem(modelMap['selected_tv_show_item'])

    window.getControl(303).setLabel(modelMap['channel_name'])
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=modelMap['channel_image'],
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    CacheManager().put('channel_image', modelMap['channel_image'])
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    logging.getLogger().debug(
        'Inside VIEWS:list of temp controls to add size : %s' %
        str(len(controls)))
Ejemplo n.º 10
0
def hide_tv_show_options(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(901).reset()

    window.getControl(900).setVisible(False)
    window.getControl(305).setEnabled(True)
    window.setFocusId(305)
Ejemplo n.º 11
0
def hide_tv_channel_episode_videos_list_view(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(800).setVisible(False)
    window.getControl(1000).setVisible(True)
    window.getControl(600).setVisible(False)
    window.getControl(500).setVisible(False)
    system.hide_busy_dialog()
    window.setFocusId(1002)
Ejemplo n.º 12
0
def show_tv_show_episode_videos_view(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFD1EEFC')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        modelMap['progress_control'] = window.getControl(502)
        window.getControl(501).setLabel('RESOLVING VIDEOS TO BE PLAYED, PLEASE WAIT...')
Ejemplo n.º 13
0
def hide_tv_show_options(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(901).reset()

    window.getControl(900).setVisible(False)
    window.getControl(305).setEnabled(True)
    window.setFocusId(305)
Ejemplo n.º 14
0
def hide_tv_channel_episode_videos_list_view(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(800).setVisible(False)
    window.getControl(1000).setVisible(True)
    window.getControl(600).setVisible(False)
    window.getControl(500).setVisible(False)
    system.hide_busy_dialog()
    window.setFocusId(1002)
Ejemplo n.º 15
0
def show_tv_channel_episode_videos_list_view(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(500).setVisible(False)
    system.hide_busy_dialog()
    window.getControl(600).setVisible(False)
    window.getControl(1000).setVisible(False)
    
    window.getControl(804).reset()
    logging.getLogger().debug('Channel name in show_tv_show_episode_videos_list_view = %s' % modelMap['channel-name'])
    window.getControl(801).setLabel(modelMap['channel-name'])
    window.getControl(802).setLabel(modelMap['tv-show-name'])
    window.getControl(803).setLabel(modelMap['episode-name'])
    window.getControl(804).addItems(modelMap['videos-item-list'])
    window.getControl(800).setVisible(True)
    window.setFocusId(804)
Ejemplo n.º 16
0
def show_tv_show_episodes_view(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFD1EEFC')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        logging.getLogger().debug('total tv show episodes: %s' % str(len(modelMap['tv_show_episode_items'])))
        window.getControl(305).setEnabled(False)
        window.getControl(401).reset()
        window.getControl(401).addItems(modelMap['tv_show_episode_items'])
        window.getControl(400).setVisible(True)
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(False)
        window.setFocusId(401)
Ejemplo n.º 17
0
def play_video_streams(modelMap, window):
    image = xbmcgui.ControlImage(30, 30, 174, 147, filename=CacheManager().get('channel_image'), aspectRatio=0, colorDiffuse='0xFFD1EEFC')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    window.getControl(500).setVisible(False)
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
        playlist.clear()
        video_items = modelMap['video_streams']
        logging.getLogger().debug('total video streams found = %s' % str(len(video_items)))
        for video_item in video_items:
            playlist.add(url=video_item.getProperty('streamLink'), listitem=video_item)
        logging.getLogger().debug('Playlist size = %s ' % str(playlist.size()))
        xbmc.Player().play(playlist)
Ejemplo n.º 18
0
def show_tv_show_episode_videos_view(modelMap, window):
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=CacheManager().get('channel_image'),
                                 aspectRatio=0,
                                 colorDiffuse='0xFFD1EEFC')
    window.addControl(image)
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        modelMap['progress_control'] = window.getControl(502)
        window.getControl(501).setLabel(
            'RESOLVING VIDEOS TO BE PLAYED, PLEASE WAIT...')
Ejemplo n.º 19
0
def show_refresh_view(modelMap, window):
    logging.getLogger().debug('Refresh cache attribute: %s' %
                              str(modelMap['refresh_cache']))
    if modelMap['refresh_cache']:
        window.getControl(201).setVisible(False)
        window.getControl(202).setVisible(False)
        window.getControl(203).setVisible(False)
        window.getControl(204).setVisible(False)
        window.getControl(300).setVisible(False)
        window.getControl(100).setVisible(False)
        window.getControl(400).setVisible(False)
        window.getControl(500).setVisible(False)
        window.getControl(600).setVisible(False)
        window.getControl(800).setVisible(False)
        window.getControl(900).setVisible(False)
        window.getControl(1000).setVisible(False)
        window.getControl(1100).setVisible(False)
        window.getControl(1200).setVisible(False)

        window.getControl(201).setVisible(True)
        window.getControl(202).setVisible(True)
        window.getControl(203).setVisible(False)
        window.getControl(204).setVisible(False)
        window.getControl(206).setPercent(0)
        window.getControl(206).setVisible(True)
        window.getControl(205).setLabel("LOADING TV SHOWS...")
        window.getControl(200).setVisible(True)
        modelMap['progress_control'] = window.getControl(206)
        image = xbmcgui.ControlImage(440,
                                     320,
                                     118,
                                     100,
                                     filename="",
                                     aspectRatio=0,
                                     colorDiffuse='0xFFF7F7F7')
        window.addControl(image)
        image.setVisible(False)
        controls = CacheManager().get('controls_to_be_deleted')
        controls.append(image)
        modelMap['channel_image_control'] = image
Ejemplo n.º 20
0
def show_tv_channel_episodes_view(modelMap, window):
    window.getControl(200).setVisible(False)
    window.getControl(300).setVisible(False)
    window.getControl(400).setVisible(False)
    window.getControl(600).setVisible(False)
    window.getControl(800).setVisible(False)
    window.getControl(900).setVisible(False)
    window.getControl(100).setVisible(False)
    window.getControl(1001).setLabel(modelMap['channel_name'])
    image = xbmcgui.ControlImage(30,
                                 30,
                                 174,
                                 147,
                                 filename=modelMap['channel_image'],
                                 aspectRatio=0,
                                 colorDiffuse='0xFFF7F7F7')
    window.addControl(image)
    CacheManager().put('channel_image', modelMap['channel_image'])
    controls = CacheManager().get('controls_to_be_deleted')
    controls.append(image)
    system.hide_busy_dialog()
    if modelMap.has_key('error-occurred') and modelMap['error-occurred']:
        logging.getLogger().debug('found an error message...')
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(True)
        logging.getLogger().exception(modelMap['error'])
    else:
        logging.getLogger().debug('total tv show episodes: %s' %
                                  str(len(modelMap['tv_show_episode_items'])))
        window.getControl(1002).reset()
        window.getControl(1002).addItems(modelMap['tv_show_episode_items'])
        window.getControl(1000).setVisible(True)
        window.getControl(500).setVisible(False)
        system.hide_busy_dialog()
        window.getControl(600).setVisible(False)
        window.setFocusId(1002)