Divers improvements

1) prevent crashes : I got in debug mode assert failures with "Detach()" function (index out of range) .
This patch correct it
2) add the possibility to set the loop starting point at the top of file or at the current date (#FS1240)
also correct divers dysfunctions in when playing with buttons previous , next and play/stop