A few simple questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

A few simple questions

jon bondy
I had to add "Uses Math" in uos_bs2b at line 240 to get the player to compile.

I am running on Windows 11 with freshly installed Lazarus and UOS.

When the sample player runs, a big black window appears and then the actual application appears.  It is almost as if a DOS window pops up and the application runs from the DOS window.  Is there any way to eliminate the big black window?

Every time I run the player, it shows me all of the library paths and asks me if that is OK.  Is there any way to eliminate that pop-up?

Thank you!

Jon
Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

fredvs
Administrator
Hello Jon and welcome to uos forum.

> I had to add "Uses Math" in uos_bs2b at line 240 to get the player to compile.

Ooops, indeed, I recently changed round() by floor() that needs math unit (or you may change with round()).

Thank to note it, I will fix it asap.

>When the sample player runs, a big black window appears and then the actual application appears.  It is almost as if a DOS window pops up and the application runs from the DOS window.  Is there any way to eliminate the big black window?

I have to find a Windows 11 system but, at first feeling, it seems it is because the -WG (Specify graphic type application (Windows)) fpc parameter was not set for Windows OS.

I suppose that you are using SimplePlayer.lpi demo.

Could you try to add the  -WG parameter in Lazarus menu Project/Project Options/Compiler Options/Custom Options and see if it helps?

Thanks.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

jon bondy
Fre;D

Thanks for your rapid and helpful response!

The -WG parameter did indeed remove the big black box.  Thank you!

How do I remove the initial dialog asking about library paths, please?


I tried revise the code so that clicking on the progress bar (rather than dragging it) would move to a different part of the audio clip, but I guess I don't understand how to do that correctly.  I tried the following (I have no idea what the "tag" does, obviously: I was flailing):

var
  pos : integer;
begin
  TrackBar2.Tag := 1;
  with TrackBar2 do
    pos := round(100 * x / Width);
  uos_InputSeek(PlayerIndex1, InputIndex1, pos);
  TrackBar2.Tag := 0;  

but that does not work.  I thought I needed to deliver an integer between 0 and 100, but I guess that is not the case.

Thanks, again.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

fredvs
Administrator
Hello Jon.

>How do I remove the initial dialog asking about library paths, please?

Not sure to understand.
Are you talking about the initial dialog of the SimplePlayer demo?
If so, it was done by design, so people can use custom compiled-libraries.
But if you dont want it, take a look at all consolexxx demos, they dont have dialogs.

>I tried revise the code so that clicking on the progress bar (rather than dragging it) would move to a different part of the audio clip, but I guess I don't understand how to do that correctly.  I tried the following (I have no idea what the "tag" does, obviously: I was flailing):

Sorry but I dont know well how LCL-Lazarus works maybe you may ask at Lazarus-forum how progress bar works.
But the principle is this: get the ratio of the position of the progress bar, for example ratio = 0.333 ( end position = 1 ).
And to set the position of the song, use:

 uos_InputSeek(theplayer, InputIndex, ratio * uos_InputLength(PlayerIndex, InputIndex))  
 



Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

fredvs
Administrator
Re-hello.

I just have checked the SimplePlayer demo.

There is this:

trackbar2.Max := uos_InputLength(PlayerIndex1, InputIndex1);

So position of Trackbar2 should be ok:

  uos_InputSeek(PlayerIndex1, InputIndex1, Trackbar2.position);

But how to set the Trackbar position with clicking somewhere, I dont know, maybe Lazarus-forum knows it.
( I mainly use MSEgui widgetset and there it is easy to do).
Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

jon bondy
In reply to this post by fredvs
Fre;D

Turns out the initial popup dialog is actually the main form with different components visible and with a different size.  Once you click the bottom button, the form component visibilities are altered, the form size is altered, and you think the program proper is running.

A quick hack to bypass the "popup" is to call Button1Click at the end of FormActivate.

Better design would have been two separate forms which were Shown appropriately.

I am all set now.

Thank you!

Jon
Reply | Threaded
Open this post in threaded view
|

Re: A few simple questions

fredvs
Administrator
This post was updated on .
Hello.

Yes, all the demos, mainly for Lazarus, are only there to show how to use uos.
Indeed, I should use 2 windows or panels.