How to navigate the timeline buttons?

Discussion of plugin / script development for XBMC4Xbox
Post Reply
chris0147
Posts: 24
Joined: Thu Jun 19, 2014 4:48 pm

How to navigate the timeline buttons?

Post by chris0147 »

Hi there,

I need your help, I have added the list of buttons for the channels and programs in the EPG. When I added the buttons, I have one yellow image in the channel and the program buttons. I want to know how I can navigate the timeline with up/down/left/right buttons in the tv guide when I press on the arrow buttons of the keyboard??

Here is the screenshot:

Image



Here is the code:

Code: Select all

#get actioncodes from keyboard.xml
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_UP = 3
ACTION_MOVE_DOWN = 4

def Channels(self):
    for row in programs:
        program = row[1].encode('ascii'), str(row[2]), str(row[3])
        title = row[1].encode('ascii')
        program_start_date = str(row[2])
        program_end_date = str(row[3])                       

        #convert the date formats into minutes
        minutes_start = self.parseDateTimeToMinutesSinceEpoch(program_start_date)
        minutes_end = self.parseDateTimeToMinutesSinceEpoch(program_end_date)
        minutes_length = minutes_end - minutes_start

        program_length = minutes_length
        program_notification = program
        programs_top = 315
        program_height = 34.5
        program_gap = 2.5
        position_start = start_pos
        position_top = programs_top + channel_index * (program_height + program_gap)


        if 10 <= program_length < 60:
            program_width = 342.5
        elif 60 <= program_length < 90:
            program_width = 690
        elif 90 <= program_length < 105:
            program_width = 1050
        elif 105 <= program_length < 120:
            program_width = 1400
        elif 120 <= program_length < 150:
            program_width = 1750
        elif 150 <= program_length < 180:
            program_width = 2100
        elif 180 <= program_length < 210:
            program_width = 2450
        elif 210 <= program_length < 240:
            program_width = 2800
        elif 240 <= program_length < 270:
            program_width = 3150
        elif 270 <= program_length < 300:
            program_width = 3500
        elif 300 <= program_length < 330:
            program_width = 3850
        elif 330 <= program_length < 360:
            program_width = 4200
        elif 360 <= program_length < 390:
            program_width = 3250
        elif 390 <= program_length < 420:
            program_width = 4550
        elif 420 <= program_length < 450:
            program_width = 4900
        elif 450 <= program_length < 480:
            program_width = 5250

        start_pos += program_width + 2 * program_gap

        if program_width > 1:
            if yellow_flag:
                if program_notification:
                    button_nofocus = 'changelang_yellow.png'
                    button_focus = 'channels_bar1.png'
                else:
                    button_nofocus = 'changelang_yellow.png'
                    button_focus = 'channels_bar1.png'
                    yellow_flag = False
                    text_color = '0xFF000000'

            else:
                if program_notification:
                    button_nofocus = 'channels_bar1.png'
                    button_focus = 'channels_yellow.png'
                else:
                    button_nofocus = 'channels_bar1.png'
                    button_focus = 'channels_yellow.png'
                text_color = '0xFFFFFFFF'

                if program_width < 1:
                    program_title = ''
                else:
                    program_title = '[B]' + title + '[/B]'


                    program_controls = xbmcgui.ControlButton(
                            position_start, 
                            position_top, 
                            program_width, 
                            program_height, 
                            program_title,
                            textColor = text_color,
                            focusTexture = button_focus, 
                            noFocusTexture = button_nofocus
                    )
                    self.addControl(program_controls)


def onAction(self, action):
    if action == ACTION_MOVE_LEFT:



    if action == ACTION_MOVE_RIGHT:



    if action == ACTION_MOVE_UP:



    if action == ACTION_MOVE_DOWN:

Do you know how I can navigate the timeline with up/down/left/right buttons in the EPG??

Any advice would be much appreciated.
chris0147
Posts: 24
Joined: Thu Jun 19, 2014 4:48 pm

Re: How to navigate the timeline buttons?

Post by chris0147 »

does anyone know how I can navigate the timeline with up/down/left/right buttons in the EPG??
chris0147
Posts: 24
Joined: Thu Jun 19, 2014 4:48 pm

Re: How to navigate the timeline buttons?

Post by chris0147 »

anyone????????????
Post Reply