Re: [MSEide-MSEgui-talk] About MSE TSlider.
> or better Huh, to not loose the last position in the tlabel ? Yes, but it is done just after button is released by the audio thread. But ok, it is better ;-) Now the test: Perfect, smooth, direct, no delay, no "scratch". So, this works perfectly: - audio thread event to TSlider: if not TrackBar.clicked then .value:= sender.value; - user event using TSlider: .value:= sender.value; if akind = sbe_thumbposition then := sender.value; Many thanks Martin. Fre;D -- Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
On Monday 02 October 2017 16:23:20 Martin Schreiber wrote: > > Use tslider.scrollbar.onafterevent and > " > procedure tmainfo.aftereventev(const sender: tcustomscrollbar; >const akind: scrolleventty; const avalue: Real); > begin > if akind = sbe_thumbposition then begin > := sender.value; > end > else begin > .value:= sender.value; > end; > end; > " > or better " procedure tmainfo.aftereventev(const sender: tcustomscrollbar; const akind: scrolleventty; const avalue: Real); begin .value:= sender.value; if akind = sbe_thumbposition then begin := sender.value; end; end; " Martin -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
On Monday 02 October 2017 15:44:32 fredvs wrote: > > >Sorry, I still do not catch ;-( > > > > And I don^t understand what you want to achieve > > OK, we are both then. :-). > > Imagine that a song is playing. > > So the audio thread sent, at each reading of the buffer, some data to the > main thread, like position in the sound. > > Then there is a synchro: the button slider is set at the position given by > the audio thread. > > If I change the position manually while the song is playing, now, the > position is changed everytime while moving the slider-button. > > It is not what I want, I would prefer that the position change only when I > release the button, and when the button is not released, only calculate the > "virtual position" and give it in the label-position.. > Use tslider.scrollbar.onafterevent and " procedure tmainfo.aftereventev(const sender: tcustomscrollbar; const akind: scrolleventty; const avalue: Real); begin if akind = sbe_thumbposition then begin := sender.value; end else begin .value:= sender.value; end; end; " Martin -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
> >Sorry, I still do not catch ;-( > And I don^t understand what you want to achieve OK, we are both then. :-). Imagine that a song is playing. So the audio thread sent, at each reading of the buffer, some data to the main thread, like position in the sound. Then there is a synchro: the button slider is set at the position given by the audio thread. If I change the position manually while the song is playing, now, the position is changed everytime while moving the slider-button. It is not what I want, I would prefer that the position change only when I release the button, and when the button is not released, only calculate the "virtual position" and give it in the label-position.. (and it is why I did a "custom" TSlider with some public mouse-event that you did not like). I hope you did understand. Fre;D -- Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
On Sunday 01 October 2017 17:45:33 fredvs wrote: > > The purpose of "accept" is to reject a value. Set it to false if you > > don't > > accept the value. > > Sorry, I still do not catch ;-( > And I don^t understand what you want to achieve. :-) Please explain the goal. Martin -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
> The purpose of "accept" is to reject a value. Set it to false if you don't accept the value. Sorry, I still do not catch ;-( Concretely, what must I change in code ? What Tslider event? And ainfo.eventkind = ek_buttonrelease, what Tslider event gives ainfo data? Thanks. Fre;D -- Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/ -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] About MSE TSlider.
On Sunday 01 October 2017 12:26:19 fredvs wrote: > > I want to assign a event only when the button is released. > > I did try with this tslider.onsetvalue: > > procedure tsongplayer2fo.changepos(const Sender: TObject; var avalue: > realty; var accept: boolean); > begin > if accept then > uos_InputSeek(theplayer, Inputindex, trunc(avalue * Inputlen)); > end; > > But that way, "accept" is always true, even when the button is not > released. > The purpose of "accept" is to reject a value. Set it to false if you don't accept the value. Right button click is normally used to show a popup menu. It is possible to "preview" all mouse messages by tform.onchildmouseevent, check for " (sender = ) and (ainfo.eventkind = ek_buttonrelease) and (ainfo.button = mb_right); " Martin -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk