Help - Search - Members - Calendar
Full Version: problem with abort_callback
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
carmenm
in two projects i am trying to port i have to convert get_raw_data(write_config_callback * out)
Looking at the foobar2000 SDK i have to replace it by
get_data_raw(stream_writer * p_stream,abort_callback & p_abort)

But i dont know how to deal with the abort_callback. Not sure how to declare it and to use it.
Could someone give me an example of code of how to use abort_callback
oshah
Are you still trying to port that cfg_view_list class from foo_uie_lyrics? Try using a cfg_structlist_t<T> class instead. This class resides in foobar2000_sdk_helpers:cfg_structlist.h (that's the Visual studio path, the actual path is at SDK/helpers/cfg_structlist.h). BTW, cfg_structlist<> also contains example code that shows how an abort_callback should be used.
In most cases, you don't declare an abort_callback. You are almost always supplied an abort_callback whenever you come up to a function which may perform IO. In this case, you just pass the supplied abort_callback to the foobar2000 IO functions (you are using Foobar2000's file IO APIs and not some other API to write files right?).
If abort_callback throws an exception, you can either catch the exception in an exception handler, or ignore it and let the core fix it. You should only catch exceptions if you can guarantee you can fix the problem (otherwise you may end up compounding the problem).
carmenm
Ok tried qs you said looking at cfg_structlist, and it seems to be working.
And yeah it is with foo_uie_lyrics but also with open_with. I am giving Nausea some help because he doesnt have time.

I am trying to understand the sdk. My biggest problems are to deal with classes or functions which does not exist anymore in 0.9. Sometimes hard to find what to replace it with or how to get the same result.wink.gif

I am looking at every project so i can to learn a lot and find my way through porting...
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.