So Cedric and I disagree on Emotion thing, what a thing :-) But I had
an idea that could help make the application's developer lives easier.
Basically what Cedric have in Emotion is:
- on load, get xattr value
- on position changed (smart callback), save xattr value
IMO there is not much of work to do or replicate in applications in
this regard, but there is few annoyances:
- all operations are async, need proper cancel for load so the
"get" return is not applied to another file if it changes
- need to convert to/from string and numbers
That said, how about if we add few helpers in Eio:
- synchronous xattr_get, as it shouldn't take long and you're
likely to do it very rarely (correct would be to do a single one at
time per application)
- xattr_get variants (sync/async) with primitive types: double,
int64, uint64, string (should cover all cases)
- xattr_set variants (just async) with primitive types
If those were available the application would have to do:
void play(const char *file) {
double position;
/* existing code */
emotion_object_file_set(o, file);
if (eio_file_xattr_sync_get(file, &position)) /* shouldn't block
much, and at this point it shouldn't matter a lot anyway */
emotion_object_position_set(o, position);
}
void stop(void) {
double position = emotion_object_position_get(o);
const char *file = emotion_object_file_get(o);
eio_file_xattr_double_set(file, "user.e.time_seek", position,
EIO_XATTR_INSERT, NULL, NULL, NULL);
/* existing code */
emotion_object_play_set(o, 0);
}
I still think very few applications should do this and they must
provide alternative solutions for non-xattr filesystems and remote
media that supports seek. But it's a helper and useful in other
places.
--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel