Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: 1 standard generic callback system

Re: 1 standard generic callback system

From: Michael Sevakis <jethead71_at_sbcglobal.net>
Date: Tue, 5 Jun 2007 21:23:53 -0400

It obviously depends and if an interface need be rather complete as a rule,
it should reduce code size since only one struct pointer need be passed one
time. A messaging model would make expansion easier since other code would
probably not need modifying and can ignore the new notification. Only the
source and receiver of the new message would need changing. One registration
for a related group of events like passing a "struct playback_events" or a
playback_event_notification_callback should definitely reduce size and
complexity as a rule. As of now we've got a separate callback and
registration for each individual event which is messy.

----- Original Message -----
From: "Jonathan Gordon" <jdgordy_at_gmail.com>
To: "Rockbox development" <rockbox-dev_at_cool.haxx.se>
Sent: Tuesday, June 05, 2007 9:01 PM
Subject: Re: 1 standard generic callback system


> On 06/06/07, Michael Sevakis <jethead71_at_sbcglobal.net> wrote:
> > I really think it's best to avoid a separate callback function for each
> > particular things and instead just go with an interface model that
groups of
> > related callbacks and functions. If you want audio events, provide a
pointer
> > to some sort of audio events interface. Any receiver of events can just
> > ignore what it doesn't care about and a tendency towards a single call
with
> > an event id parameter and an intptr_t parameter to pass data or pointers
to
> > data can keep the number of functions to a minimum. Some more
specialized
> > functions in the interface can be declared if needed of course.
> >
>
> well a pointer is passed to the callbacks and it could be anything, so
> this could be done, but wouldnt it make smaller code if we only ever
> pass useful data? (as apposed t a struct which would have absolutly
> everything?)
Received on 2007-06-06

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy