PDA

View Full Version : Using the WMP plugin and ComboBox


Ham
04-13-2006, 11:47 AM
For so far i know how to use them BUT
the prob is that i want to use more FILE functions.

Example:
I use this code (thanks to Mina) On Show


-- :: Get the selected item ::
tSelected = ComboBox.GetSelected("ComboBox1");
if tSelected then
-- i.e. tSelected == true (boolean)
File = ComboBox.GetItemData("ComboBox1", tSelected);
StatusDlg.SetTitle("whatever..");
StatusDlg.SetStatusText("loading.");
StatusDlg.Show(MB_ICONNONE, false);

MediaPlayer.Load("Plugin1", File);

StatusDlg.SetMessage("loaded!");
StatusDlg.Hide();
-- When loading is finished:
MediaPlayer.Play("Plugin1");
-- Note that the loading time depends on your connection speed.
else
-- If tSelected == false, then there is nothing selected
Dialog.Message("Error", "bla bla.");
end

If you see the File is in use by: File = ComboBox.GetItemData("ComboBox1", tSelected);

I want to use the File.OpenURL and some others but can't because then you get a error. On index globlal File thingy.

So i wanna know is there a way to code it in a way it doesn't make a scene.

I use a ComboBox for the data but i have only 1 stream needed for the app.
I think that a ComboBox is overkill for 1 item.

Thanks in advance:yes

Mina
04-14-2006, 06:32 AM
Hi
Since you have only 1 url to play, you could code something like
StreamFile = {}
StreamFile[1] == --add url here. (ex. "http://www.fiercefm.co.uk/fiercefm.asx")
StatusDlg.SetTitle("whatever..");
StatusDlg.SetStatusText("loading.");
StatusDlg.Show(MB_ICONNONE, false);

MediaPlayer.Load("Plugin1", StreamFile[1]);

StatusDlg.SetMessage("loaded!");
StatusDlg.Hide();
-- When loading is finished:
MediaPlayer.Play("Plugin1");
-- Note that the loading time depends on your connection speed.
else
-- If tSelected == false, then there is nothing selected
Dialog.Message("Error", "bla bla.");
end

Ham
04-14-2006, 06:52 AM
Thanks Mina

I test it and it works 100%

Thanks again:yes