[Player-dev] Re: [Midplayer-private-dev] Resend-CR: [#8085] Fixing a series of bugs accompanying cursor disappears after deleting a song when another song is playing back
Rusty Lynch rusty.lynch at intel.comLooks good to me
--rusty
On Tue, 2008-09-23 at 17:45 -0700, Kinson Liu wrote:
> Notice this is a bit different than the initial CR in that I fixed a
> glitch in my early solution.
>
> Modified by: kliu at real.com
> Date: 9/23/2008
> Project: RealPlayer for MID
> Bug Number: 8085
> Bug URL: https://bugs.helixcommunity.org/show_bug.cgi?id=8085
>
> Synopsis: Fixing a series of bugs accompanying cursor disappears after
> deleting a song when another song is playing back
>
> Overview: This patch fixes couples issues.
> 1. The program uses the same variable pl.selected_index to denote two
> states: a) the audio playing back and b) the audio selected. Because
> the two states are different things, such a mix-up causes the playback
> icon to be attached to the selected audio instead of the one playing
> back after deletion. As the selected audio is already deleted, the
> playback icon is unseen.
> 2. Audios inside a playlist are structured like an arraylist and the
> audio playing back is referenced by its index in the arraylist. When
> an audio is deleted, all audios after it move up by one slot.
> However, the program does not update the playback audio index
> accordingly, leaving it pointing to the old slot. The playback icon
> will not be attached to the correct audio for cases like that.
> 3. By nature, the player has to highlight the selected audio, but that
> is not true after an audio is deleted. Because the variable
> pl.selected_index is also used to denote the playing back audio, what
> actually gets highlighted is the playing back one instead of the
> selected one.
> 4. The player does not highlight any audio after audio deletion under
> the Online Music mode when another audio under the All Songs mode is
> playing back.
>
> The fixes are using different variables for the two states. Since
> self.item_selected is already there for that purpose, we will keep
> using it. Since the two states are separated, we can decrement
> pl.selected_index whenever an audio above the playback one is deleted
> as the solution for #2 without affecting other variables/aspects.
> Then for #3, we can set the highlight according to self.item_selected
> instead of pl.selected_index, which remains as the index of the
> current playback audio. Finally, the update_radio_list_status_pixmap
> function is modified such that set_cursor is still being executed even
> though self.cur_playlist != self.view_playlist because we have such a
> use case. At the same time, the function index_of is added to
> playlist.py to smooth the execution of self.item_selected, and the
> function selected__set() and the try-except blocks insider on_del_song
> are refactored.
>
> Files Added:
> None
>
> Files Modified:
> player/mid/src/music_view.py
> player/mid/src/playlist.py
>
> Image Size and Heap Use impact (Client -Only):
> None
>
> Platforms and Profiles Affected:
> Platform: linux-2.2-libc6-gcc32-i586
> Profile: Helix-client-moblin
>
> Distribution Libraries Affected:
> None
>
> Distribution library impact and planned action:
> None
>
> Platforms and Profiles Build Verified:
> Platform: linux-2.2-libc6-gcc32-i586
> Profile: Helix-client-moblin
>
> Platforms and Profiles Functionality verified:
> Platform: linux-2.2-libc6-gcc32-i586
> Profile: Helix-client-moblin
>
> Branch: hxclient_3_4_1_atlas_restricted
>
> Copyright assignment: I am a RealNetworks employee or contractor
> --
>
> ______________________________________________________________________
> Kinson Liu | Software Development Engineer | RealNetworks, Inc. |
> kliu at real.com | 206.892.6177