FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

WMPlayer - Searching

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
bohrsatom
Newbie


Joined: 02 Dec 2005
Posts: 12

PostPosted: Thu Dec 15, 2005 10:28 pm    Post subject: WMPlayer - Searching Reply with quote

Hi Jonas,

I am looking at scripting the 'search' feature that iTunes has inside media player. I have a working script, but unfortunately it takes quite a while to execute (this is also the case inside windows media player) and so I was wondering if it was possible to pop-up the "loading" screen (or something like that) whilst the search takes place? If so, how would I do this? My script to gather input looks like this:

[code:1]
function launchWidget() {

// Find by name
var textField = CreateTextFieldDialog( "findArtist_");

textField.name = "More menu find name text field";
textField.title = "Find by Artist Name";
textField.prompt = "Find:";

theTerminal.Push(textField);

}


function findArtist_OK(textfield)
{
...... findArtist code. would like to pop up a loading screen then display results.
}

[/code:1]

One quick further question - what is the default settingsPath? I would like to see the lifecycle of the artists.txt file. How frequently is it deleted and repopulated? I can't even find it on my computer! Perhaps it is possible to implement a better search algorithm, but given the regexp-style search i have implemented that isn't as easy.

Regards,

bohrsatom
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Mon Dec 19, 2005 11:40 pm    Post subject: Reply with quote

Hi,

There is currently no really convenient way to do a "waiting screen". Sorry.

The settingsPath value depends on your script. It's based on the script's UUID. You can log it, if you want to see the path. Try this:

Log( settingsPath );

The standard WMP scripts cache the artists list, as it's expensive to pull out of WMP. It's recomputed when the number of tracks change; a reasonable approximation, I think.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bohrsatom
Newbie


Joined: 02 Dec 2005
Posts: 12

PostPosted: Tue Dec 20, 2005 11:22 am    Post subject: Reply with quote

Hi Jonas,

thanks for the reply :).

I have come up with a 'different' searching idea, but unfortunately the search box is only 10 characters :-(. Is that a restriction to keep the midlet as cross-phone as possible or is there a way of setting the 'size' of a TextFieldDialog?

Regards,

bohrsatom
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Tue Dec 20, 2005 12:09 pm    Post subject: Reply with quote

Hi,

Glad to hear it. You can set the maxLength property of the TextFieldDialog object to change the "size" of the field. 300 might be max, though.

Best.
--
Jonas

[quote="bohrsatom"]Hi Jonas,

thanks for the reply :).

I have come up with a 'different' searching idea, but unfortunately the search box is only 10 characters :-(. Is that a restriction to keep the midlet as cross-phone as possible or is there a way of setting the 'size' of a TextFieldDialog?

Regards,

bohrsatom[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bohrsatom
Newbie


Joined: 02 Dec 2005
Posts: 12

PostPosted: Thu Dec 29, 2005 8:18 pm    Post subject: Reply with quote

And here's the script :).

It lets you search for an artist in WMP (useful if you have a lot of artists in your playlist). If it finds more than one artist that matches your search string, it will let you choose the specific artist; otherwise it will just display the albums from that artist.

It should be quite easy to let the user search for tracks, but pulling lots of data out of WMP is quite processor intensive. I plan to look at this in the future but it ought to be possible to modify the source to do a title search.

You need to change MediaPlayer.js in the MediaPlayer Remote and add the following lines:

below
[code:1] moreMenuItems[7] = "Set Sound Balance"; [/code:1]
add
[code:1]moreMenuItems[8] = "Search Artists"; [/code:1]

below
[code:1]moreMenuItemUUIDs[7] = "A5EAB91F-0FEA-4c23-84A6-62F6D5DBDBA1"; // Set Sound Balance[/code:1]
add
[code:1]moreMenuItemUUIDs[8] = "02921780-6d9e-11da-8cd6-0800200c9a66"; // Search artist by Rob W[/code:1].

Then extract the Zip file to your scripts directory :). Search Artists is visible on the MediaPlayer remote screen.

Regards,

bohrsatom.



MediaPlayer Search Artists.rar
 Description:

Download
 Filename:  MediaPlayer Search Artists.rar
 Filesize:  3.33 KB
 Downloaded:  1192 Time(s)

Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Fri Dec 30, 2005 12:43 am    Post subject: Reply with quote

Perhaps it'll be easier to install this if you make a copy of the WMP Remote script, make your changes to it, and bundle with the extra items?

This way, the user doesn't have to make changes to the default script.

Best.
--
Jonas

PS. Making copies like this, for use with Salling Clicker, is ok with me as long as you don't claim it as yours. Also, it's probably wise to change the UUID.

[quote="bohrsatom"]And here's the script :).

It lets you search for an artist in WMP (useful if you have a lot of artists in your playlist). If it finds more than one artist that matches your search string, it will let you choose the specific artist; otherwise it will just display the albums from that artist.

It should be quite easy to let the user search for tracks, but pulling lots of data out of WMP is quite processor intensive. I plan to look at this in the future but it ought to be possible to modify the source to do a title search.

You need to change MediaPlayer.js in the MediaPlayer Remote and add the following lines:

below
[code:1] moreMenuItems[7] = "Set Sound Balance"; [/code:1]
add
[code:1]moreMenuItems[8] = "Search Artists"; [/code:1]

below
[code:1]moreMenuItemUUIDs[7] = "A5EAB91F-0FEA-4c23-84A6-62F6D5DBDBA1"; // Set Sound Balance[/code:1]
add
[code:1]moreMenuItemUUIDs[8] = "02921780-6d9e-11da-8cd6-0800200c9a66"; // Search artist by Rob W[/code:1].

Then extract the Zip file to your scripts directory :). Search Artists is visible on the MediaPlayer remote screen.

Regards,

bohrsatom.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group