Help - Search - Members - Calendar
Full Version: [0.8]handle_update_info impos. in callback: where?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
Rasqual
Hello,
I want to add meta information (set a %tag% item) dynamically when a playlist item is loaded (or manually reloaded).

Therefore, when I tried adding the field by calling
CODE
pTrackHandle->handle_update_info(&fileInfo, true);
//(with pTrackHandle being a locked metadb_handle *)

from a metadb_callback derived class (on_info_reloaded overloaded method)


I obtain the following error
QUOTE
ERROR (CORE) : Can't modify database from inside callbacks !


How should I do?
I thought about using a timer, however I want scripts/columns ui/etc. to be able use the tag. Same remark for using play_callback::on_playback_new_track

I think foo_tunes and foo_quicktag_sql implemented such a system (or was it manual sync?), but I've never succeeded in seeing it in action.
foosion
Create an invisible/message-only window and use PostMessage from within the callback.
Rasqual
QUOTE(foosion @ Jan 4 2006, 02:32 PM)
Create an invisible/message-only window and use PostMessage from within the callback.
*



Thank you for the suggestion.

I created a window to do the job. The only problems are:

1/ When I click the "update" button in either the standard or special file info box, the change won't be noticeable in the box until I close and reopen it. By design?
Note that on_info_edited() is called, but I don't know if it's the case for the modifier component.
I would like to add meta info that would only be available at runtime, and not stored physically in the music file. Is this concept wrong to begin with?

2/ I have another problem. The callback is not called when adding a file to the playlist, only when restoring a playlist or pressing "Update". Is there a handler for that event?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.