Beispiel #1
0
 def on_click(self, x, y):
     """ Handles click event. """
     tag_name = super(ScreenDirectory, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'list_letters':
         self.find_first_letter()
     elif tag_name == 'list_directory':
         self.list_item_action()
     elif tag_name == 'btn_root':
         self.components['list_directory'].show_directory("")
         self.letter_list_update()
     elif tag_name == 'btn_up':
         self.components['list_directory'].show_directory_up()
         self.letter_list_update()
Beispiel #2
0
 def on_click(self, x, y):
     """ Handles click event. """
     tag_name = super(ScreenDirectory, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'list_letters':
         self.find_first_letter()
     elif tag_name == 'list_directory':
         self.list_item_action()
     elif tag_name == 'btn_root':
         self.components['list_directory'].show_directory("")
         self.letter_list_update()
     elif tag_name == 'btn_up':
         self.components['list_directory'].show_directory_up()
         self.letter_list_update()
Beispiel #3
0
    def on_click(self, x, y):
        """
        :param x: The horizontal click position.
        :param y: The vertical click position.

        :return: Possibly returns a screen index number to switch to.
        """
        tag_name = super(ScreenRadio, self).on_click(x, y)
        if tag_name == 'btn_player':
            return 0
        elif tag_name == 'btn_playlist':
            return 1
        elif tag_name == 'btn_library':
            return 2
        elif tag_name == 'btn_directory':
            return 3
        elif tag_name == 'btn_radio':
            return 4
        elif tag_name == 'btn_station_add':
            screen_add = ScreenStation(self.screen)
            screen_add.show()
            self.show()
        elif tag_name == 'btn_settings':
            setting_screen = ScreenSettings(self.screen)
            setting_screen.show()
            self.show()
        elif tag_name == 'list_stations':
            self.station_action()
Beispiel #4
0
    def on_click(self, x, y):
        """
        :param x: The horizontal click position.
        :param y: The vertical click position.

        :return: Possibly returns a screen index number to switch to.
        """
        tag_name = super(ScreenPlaylist, self).on_click(x, y)
        if tag_name == 'btn_player':
            return 0
        elif tag_name == 'btn_playlist':
            return 1
        elif tag_name == 'btn_library':
            return 2
        elif tag_name == 'btn_directory':
            return 3
        elif tag_name == 'btn_radio':
            return 4
        elif tag_name == 'btn_settings':
            setting_screen = ScreenSettings(self.screen)
            setting_screen.show()
            self.show()
        elif tag_name == 'btn_play':
            if mpd.player_control_get() == 'play':
                mpd.player_control_set('pause')
                self.components['btn_play'].set_image_file(theme.icon.play)
            else:
                mpd.player_control_set('play')
                self.components['btn_play'].set_image_file(theme.icon.pause)
            self.components['btn_play'].draw()
        elif tag_name == 'btn_stop':
            self.components['btn_play'].set_image_file(theme.icon.play)
            mpd.player_control_set('stop')
        elif tag_name == 'btn_prev':
            mpd.player_control_set('previous')
        elif tag_name == 'btn_next':
            mpd.player_control_set('next')
        elif tag_name == 'btn_volume':
            screen_volume = ScreenVolume(self.screen)
            screen_volume.show()
            self.show()
        elif tag_name == 'list_playing':
            selected_index = self.components[
                'list_playing'].item_selected_index
            if selected_index >= 0:
                mpd.play_playlist_item(selected_index + 1)
                self.components[
                    'list_playing'].active_item_index = selected_index
                self.components['list_playing'].draw()
Beispiel #5
0
    def on_click(self, x, y):
        """
        :param x: The horizontal click position.
        :param y: The vertical click position.

        :return: Possibly returns a screen index number to switch to.
        """
        tag_name = super(ScreenPlaylist, self).on_click(x, y)
        if tag_name == 'btn_player':
            return 0
        elif tag_name == 'btn_playlist':
            return 1
        elif tag_name == 'btn_library':
            return 2
        elif tag_name == 'btn_directory':
            return 3
        elif tag_name == 'btn_radio':
            return 4
        elif tag_name == 'btn_settings':
            setting_screen = ScreenSettings(self.screen)
            setting_screen.show()
            self.show()
        elif tag_name == 'btn_play':
            if mpd.player_control_get() == 'play':
                mpd.player_control_set('pause')
                self.components['btn_play'].set_image_file(theme.icon.play)
            else:
                mpd.player_control_set('play')
                self.components['btn_play'].set_image_file(theme.icon.pause)
            self.components['btn_play'].draw()
        elif tag_name == 'btn_stop':
            self.components['btn_play'].set_image_file(theme.icon.play)
            mpd.player_control_set('stop')
        elif tag_name == 'btn_prev':
            mpd.player_control_set('previous')
        elif tag_name == 'btn_next':
            mpd.player_control_set('next')
        elif tag_name == 'btn_volume':
            screen_volume = ScreenVolume(self.screen)
            screen_volume.show()
            self.show()
        elif tag_name == 'list_playing':
            selected_index = self.components['list_playing'].item_selected_index
            if selected_index >= 0:
                mpd.play_playlist_item(selected_index + 1)
                self.components['list_playing'].active_item_index = selected_index
                self.components['list_playing'].draw()
Beispiel #6
0
 def on_click(self, x, y):
     """ Handles click event. """
     tag_name = super(ScreenLibrary, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'btn_artists':
         self.set_currently_showing('artists')
         self.components['list_library'].show_artists()
         self.letter_list_update()
     elif tag_name == 'btn_albums':
         self.set_currently_showing('albums')
         self.components['list_library'].show_albums()
         self.letter_list_update()
     elif tag_name == 'btn_songs':
         self.set_currently_showing('songs')
         self.components['list_library'].show_songs()
         self.letter_list_update()
     elif tag_name == 'btn_playlists':
         self.set_currently_showing('playlists')
         self.components['list_library'].show_playlists()
         self.letter_list_update()
     elif tag_name == 'btn_search':
         self.find_text()
     elif tag_name == 'list_letters':
         self.find_first_letter()
     elif tag_name == 'list_library':
         self.playlist_action()
Beispiel #7
0
 def on_click(self, x, y):
     """ Handles click event. """
     tag_name = super(ScreenLibrary, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'btn_artists':
         self.set_currently_showing('artists')
         self.components['list_library'].show_artists()
         self.letter_list_update()
     elif tag_name == 'btn_albums':
         self.set_currently_showing('albums')
         self.components['list_library'].show_albums()
         self.letter_list_update()
     elif tag_name == 'btn_songs':
         self.set_currently_showing('songs')
         self.components['list_library'].show_songs()
         self.letter_list_update()
     elif tag_name == 'btn_playlists':
         self.set_currently_showing('playlists')
         self.components['list_library'].show_playlists()
         self.letter_list_update()
     elif tag_name == 'btn_search':
         self.find_text()
     elif tag_name == 'list_letters':
         self.find_first_letter()
     elif tag_name == 'list_library':
         self.playlist_action()
Beispiel #8
0
 def on_click(self, x, y):
     tag_name = super(ScreenPlaying, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'btn_play':
         print "Play pressed"
         if mpd.player_control_get() == 'play':
             mpd.player_control_set('pause')
             self.components['btn_play'].set_image_file(theme.icon.play)
         else:
             mpd.player_control_set('play')
             self.components['btn_play'].set_image_file(theme.icon.pause)
         self.components['btn_play'].draw()
     elif tag_name == 'btn_stop':
         self.components['btn_play'].set_image_file(theme.icon.play)
         mpd.player_control_set('stop')
     elif tag_name == 'btn_prev':
         mpd.player_control_set('previous')
     elif tag_name == 'btn_next':
         mpd.player_control_set('next')
     elif tag_name == 'btn_volume':
         screen_volume = ScreenVolume(self.screen)
         screen_volume.show()
         self.show()
Beispiel #9
0
 def on_click(self, x, y):
     tag_name = super(ScreenPlaying, self).on_click(x, y)
     if tag_name == 'btn_player':
         return 0
     elif tag_name == 'btn_playlist':
         return 1
     elif tag_name == 'btn_library':
         return 2
     elif tag_name == 'btn_directory':
         return 3
     elif tag_name == 'btn_radio':
         return 4
     elif tag_name == 'btn_settings':
         setting_screen = ScreenSettings(self.screen)
         setting_screen.show()
         self.show()
     elif tag_name == 'btn_play':
         print "Play pressed"
         if mpd.player_control_get() == 'play':
             mpd.player_control_set('pause')
             self.components['btn_play'].set_image_file(theme.icon.play)
         else:
             mpd.player_control_set('play')
             self.components['btn_play'].set_image_file(theme.icon.pause)
         self.components['btn_play'].draw()
     elif tag_name == 'btn_stop':
         self.components['btn_play'].set_image_file(theme.icon.play)
         mpd.player_control_set('stop')
     elif tag_name == 'btn_prev':
         mpd.player_control_set('previous')
     elif tag_name == 'btn_next':
         mpd.player_control_set('next')
     elif tag_name == 'btn_volume':
         screen_volume = ScreenVolume(self.screen)
         screen_volume.show()
         self.show()