this is it...
player.removeAtPos(d.getValue('Pos')-1);
it's simple, I think to difficult.
regards,
john
I learn scripting
-
- Posts: 713
- Joined: 30. Sep 08, 14:00
- Location: Netherlands [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
- djjb
- Posts: 128
- Joined: 15. Nov 05, 13:41
- Location: Geldrop / Holland [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: I learn scripting
Hi friends,
I'm working on a script that can move a track from position in the playlist. So I can call this script when I want to move nr:24 to nr:10.
But....as allways,
I'm stucked. I don't know if it's even possible but this is what I've done.
function playlistCallback()
{
var d = new Dialog;
d.addStaticText("pick and drop");
d.addTextCtrl('Pick','nr to pick up','');
d.addTextCtrl('Drop','move to position','');
if( d.showModal() == 'ok' )
{
player.addAtPos(d.getValue('Drop')-1),(d.getValue('Pick')-1);
}
}
program.addMenuEntry('Z08 pick and drop', playlistCallback);
Can someone please give me the answer.
Thanks
Best regards,
John
I'm working on a script that can move a track from position in the playlist. So I can call this script when I want to move nr:24 to nr:10.
But....as allways,
I'm stucked. I don't know if it's even possible but this is what I've done.
function playlistCallback()
{
var d = new Dialog;
d.addStaticText("pick and drop");
d.addTextCtrl('Pick','nr to pick up','');
d.addTextCtrl('Drop','move to position','');
if( d.showModal() == 'ok' )
{
player.addAtPos(d.getValue('Drop')-1),(d.getValue('Pick')-1);
}
}
program.addMenuEntry('Z08 pick and drop', playlistCallback);
Can someone please give me the answer.
Thanks
Best regards,
John
- djjb
- Posts: 128
- Joined: 15. Nov 05, 13:41
- Location: Geldrop / Holland [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: I learn scripting
thanks Skinner,
the removeAtPos don't work correctly, because the position in the playlist is changed after the pick and drop.
It will delete the track before or after the pickPos.
I'm sure there is a answer for this.(hmm...but what..)
Regards,
John
the removeAtPos don't work correctly, because the position in the playlist is changed after the pick and drop.
It will delete the track before or after the pickPos.
I'm sure there is a answer for this.(hmm...but what..)
Regards,
John
- djjb
- Posts: 128
- Joined: 15. Nov 05, 13:41
- Location: Geldrop / Holland [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: I learn scripting
Hi again,
This is getting a long topic, but i think other people can use this information to.
But I'm not here for just to say that. No..
I have a question that I can't find in the sdk manual.
When i create a password dialog, it asks for a password.
I have set a password in the script now and it works, but it would be better that users can choose one of there own. Something like:
When silverjuke starts it asks for the password and a "yes or no" to show the dialog each time sj starts.
The password must be saved somewhere.
once a password is given, other scripts who asks for a password, matches the given password with the saved one.
Can this be done?
Well a few minutes later I have this made:
function silverjukeLoaded()
{
var p = new Dialog;
p.addStaticText("Hallo,\nIn deze skin is voor sommige functies een wachtwoord vereist.\nKies hieronder een wachtwoord.");
p.addPasswordCtrl('p','');
p.addStaticText("Herhaal je wachtwoord");
p.addPasswordCtrl('c','');
if( p.showModal() == 'ok' )
{
if(p.getValue('c')==p.getValue('p'))
{
program.iniWrite("myPassword",p.getValue('p'));
}
else
{
alert("fout!!")
p.setValue('p',"");
p.setValue('c',"");
p.show();
}
}
}
program.onLoad = silverjukeLoaded;
if the password doesn't match it gives you another change.
But after doing it wrong for the second time you have no password.
How can i call the first action back?
Best regards,
John
This is getting a long topic, but i think other people can use this information to.
But I'm not here for just to say that. No..
I have a question that I can't find in the sdk manual.
When i create a password dialog, it asks for a password.
I have set a password in the script now and it works, but it would be better that users can choose one of there own. Something like:
When silverjuke starts it asks for the password and a "yes or no" to show the dialog each time sj starts.
The password must be saved somewhere.
once a password is given, other scripts who asks for a password, matches the given password with the saved one.
Can this be done?
Well a few minutes later I have this made:
function silverjukeLoaded()
{
var p = new Dialog;
p.addStaticText("Hallo,\nIn deze skin is voor sommige functies een wachtwoord vereist.\nKies hieronder een wachtwoord.");
p.addPasswordCtrl('p','');
p.addStaticText("Herhaal je wachtwoord");
p.addPasswordCtrl('c','');
if( p.showModal() == 'ok' )
{
if(p.getValue('c')==p.getValue('p'))
{
program.iniWrite("myPassword",p.getValue('p'));
}
else
{
alert("fout!!")
p.setValue('p',"");
p.setValue('c',"");
p.show();
}
}
}
program.onLoad = silverjukeLoaded;
if the password doesn't match it gives you another change.
But after doing it wrong for the second time you have no password.
How can i call the first action back?
Best regards,
John
-
- Posts: 713
- Joined: 30. Sep 08, 14:00
- Location: Netherlands [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable