Re: Recording widget motion



Thanks for the reply!

That is pretty much what I'm doing currently, although your idea of
using a GSList is a much better solution than the weird struct I'm
using now :-). Also, I wasn't sure whether to use g_timeout_add or to
make another thread to update the slider; I thought g_timeout_add
would cause timing to be off (it would unsynchronize over time), but
using a GTimer fixed it. The problem I'm currently having is this: I'd
like to know when the user is "holding" the slider, that is, has the
mouse button pressed on the slider itself, not in the "trough", so
that the user can record "over" his previous recording. This is kinda
hard to explain, and I'm not sure if it's a good idea from a UI point
of view... I've managed to get this by digging into the private struct
adjustment->layout->mouse_location, but that is hackish and not
stable.... Anyways, I'm just rambling, it works now :-)

Now I just need to hook this up to a GstController... but that's a
topic for another list, and I have to read up more anyways. Thanks :-)

Cheers,
Samuel Cormier-Iijima

On 9/7/06, David Nečas (Yeti) <yeti physics muni cz> wrote:
On Thu, Sep 07, 2006 at 08:59:13AM -0400, Samuel Cormier-Iijima wrote:
> This is for music editing software I'm thinking about writing.
> Basically, the user should be able to "record" the volume during
> playback by sliding the GtkHScale around. When he plays it back the
> next time, the volume should change according to the way he recorded
> it (i.e. it'll wiggle around by itself during the song playback).

Connect to the "value-changed" signal of the corresponding
adjustment.  In the callback, note the current time and
value and add it for example to a GSList (using prepend, not
append to keep it O(1)).  Disconnect when done.

For replay revert the list, set up a periodically called
func with g_timeout_add().  When the function is called it
gets the current time, finds the value to set (if you save
the current position in the list it can be done with simple
forward search quite efficiently) and sets it, possibly with
interpolation.  Remove the func when you hit the end.

This is quite obvious so, although I could probably patent
it, what I missed in the requirements?

Yeti


--
Anonyms eat their boogers.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]