foo_spider_monkey_panel
foo_spider_monkey_panel copied to clipboard
SetPlaylistLockedActions blocks playback
Using this method, whenever you lock a playlists (with any lock type), you can not play any of the tracks from it.
"use strict";
const lockedActions = ['AddItems','RemoveItems','ReorderItems','ReplaceItems','RenamePlaylist','RemovePlaylist','ExecuteDefaultAction',''];
function on_mouse_lbtn_up(x, y) {
console.log(lockedActions[0] ? lockedActions[0] : 'no lock');
plman.SetPlaylistLockedActions(plman.ActivePlaylist, lockedActions[0] ? [lockedActions[0]] : []);
lockedActions.rotate(1);
}
Array.prototype.rotate = (function() {
const unshift = Array.prototype.unshift, splice = Array.prototype.splice;
return function(count) {
const len = this.length >>> 0;
count = count >> 0;
unshift.apply(this, splice.call(this, count % len, len));
return this;
};
})();
Try it yourself, playback doesn't work except when the playlist is locked 'ExecuteDefaultAction' or no lock is used.