Issues when losing Window Focus

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

Issues when losing Window Focus

Epaminondas Kranias
I apologize if the problem is already solved, but when navigating from my uos music application window (I am using Lazarus) to another window or desktop, music is instantly paused and when the event finishes it continues normally. Is there any method of eliminating such interferences?

Thank you very much for your time.

Epaminondas Kranias

P.S. I tried to encapsulate uos music methods to a separate thread with no luck
Reply | Threaded
Open this post in threaded view
|

Re: Issues when losing Window Focus

fredvs
Administrator
Hello Epaminondas Kranias.

What OS are you using (Windows or Unix) ?
With what widget-set (LCL, fpGUI, MSEgui) ?

Do you use the last uos commit ?
https://github.com/fredvs/uos

Sorry but I cannot reproduce this with uos demos.

Do you have the same problem with StrumPract?
https://github.com/fredvs/strumpract/releases

If you could give a demo of that problem, it would be much easier to help you.

Thanks.

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

Re: Issues when losing Window Focus

fredvs
Administrator
In reply to this post by Epaminondas Kranias
> P.S. I tried to encapsulate uos music methods to a separate thread with no luck

Hello.

Each uos_player is a thread, you should not encapsulate one uos_player into a parent thread.

But maybe I do not understand ok, could you give more details of what you want to do?

Thanks.

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

Re: Issues when losing Window Focus

fredvs
Administrator
This post was updated on .
In reply to this post by Epaminondas Kranias
Re-hello.

And with what fpc version (fpc 3.0.2 or fpc 3.0.4)?

[EDIT] I guess you are using Windows 10 because here on Linux and Windows via wine/Linux no problem to switch to a other desktop.

I do not have a Windows 10 machine right now.

What would be interesting is to run uos SimplePlayer demo to see if there is also that problem when switching.

uos SimplePlayer uses LCL widget-set and fpc-thread.

And then compare with StrumPract (see previous post) that uses MSEgui and MSEthread to see if there is also the same problem.

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

Re: Issues when losing Window Focus

Epaminondas Kranias
In reply to this post by fredvs
Thank you very much for your immediate answer,

I am using a Windows VISTA notebook for my experements, I 'll transfer it to other systems also to see what happens.

I am using LCL. Lazarus v2.0.0

I downloaded last commit, no change.

But StrumPract is not doing this effect, also demos are not doing this effect, although I loaded the same music files, so I conclude that it is my fault.

I'll give it a try and I will ask again with a demo if I can't make it.

Your libraries are top anyway.

Thanks again,

Epaminondas Kranias
Reply | Threaded
Open this post in threaded view
|

Re: Issues when losing Window Focus

Epaminondas Kranias
Hi again,

It seems that TTrackBar is involved in this problem.

When it is not visible (no problem at all).

When it is visible and has the focus, with enabled

uos_InputSetPositionEnable(PlayerIndex1,InputIndex1,1);

and on Changed (yes this is the problem sorry I currently saw the technique in demo with MouseDown and MouseUp TTrackBar events and Tag toggle value from 0 to 1 and backwards).

So, it was indeed my fault.

Use of onChanged event is causing recursive calls and problems appear.

Thank you very much for your kind interest.

Best regards,

Epaminondas Kranias
Reply | Threaded
Open this post in threaded view
|

Re: Issues when losing Window Focus

fredvs
Administrator
Hello Epaminondas Kranias.

Nice that you have found the problem.

> So, it was indeed my fault.

Huh, no, IMHO it is the fault of TTrackBar, it should not have that behavior.

Fre;D