<div dir="ltr"><div>It looks like i found the correct points to insert my code, now it seems quite obvious to me. The patch is attached to this mail (again) and I already did some testing. You can find the results here:</div>
<div><br></div><a href="https://gist.github.com/W4RH4WK/6827230">https://gist.github.com/W4RH4WK/6827230</a><div><br></div><div>This patch shuffles the playlist ether when it automatically advances and reaches the end, or when the end / beginning is reached by using next / prev. The Gist shows the according log output for each of the 3 cases. You can observe reshuffling after all songs have been played exactly once.</div>
<div><br></div><div>Might this patch work for you and resolve this issue? ;)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 11:39 PM, Alex Warhawk <span dir="ltr"><<a href="mailto:ax.warhawk@gmail.com" target="_blank">ax.warhawk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">there is no simple way to check whether all elements have been played, it would require me keep track of everything as well as managing adding / removing elements from the playlist.<div>
<br></div><div>my patch does the following: when the NextItem function is invoked as result of automatically advancing. it checks if the last element has been played and if so: shuffles the playlist and restarts with element 0.</div>

<div><br></div><div>when using the next button the NextItem function works different. instead of simply increment i_current_index it uses the p_sys->request mechanism to figure out which element to play next. firstly i am afraid of breaking stuff when i alter the code to much (i'm not very familiar with the source code). secondly when i add shuffle the same way i did on the other part, there won't be a guarantee every element is played once before shuffling again.</div>

<div><br></div><div>reason: NextItem gets told which element to play next. if i reshuffle the playlist this next element which should be played might not be the first element of the new order, hence some elements are not played before the last one is reached.</div>

<div>if i override the element request in any way i might break the whole request mechanism.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 11:22 PM, Jean-Baptiste Kempf <span dir="ltr"><<a href="mailto:jb@videolan.org" target="_blank">jb@videolan.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 30 Sep, Alex Warhawk wrote :<br>
</div><div>> i agree with you, but i only found a way to integrate this for<br>
> automatically advancing to the next element.<br>
> the code which gets executed when hitting the next button is totally<br>
> different hence i was unable to find the right spot to put my code in<br>
> without breaking something or achieving the task fully.<br>
><br>
> example, letting vlc play for ever<br>
> A -> C -> B -(reshuffle)-> B -> C -> A -(reshuffle)-> C -> B -> A etc<br>
><br>
> example, hitting next over and over gain<br>
> A -> C -> B -> A -> C -> B -> A -> C -> B -> etc.<br>
<br>
</div>Why no reshuffle when all of the elements have been played once?<br>
<div><br>
--<br>
Jean-Baptiste Kempf<br>
<a href="http://www.jbkempf.com/" target="_blank">http://www.jbkempf.com/</a> - <a href="tel:%2B33%20672%20704%20734" value="+33672704734" target="_blank">+33 672 704 734</a><br>
Sent from my Electronic Device<br>
</div><div><div>_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>