Skip to main content
Topic: Few question before starting developing (Read 5701 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Few question before starting developing

Ok, i am just a few hours from starting to develop.
My goal is to try to port the foo_uie_lyrics(the one with download) to 0.9 and to add download support to foo_uie_albumart.
First a little question about visual studio; I am quite afraid to install it. I worked with .NET a lot and each i wanted to get rid of it i had to wipe out my HD. The problem is the debugger, it is causing a lot of problem on my coptuer. does anyone knows a way to install visual without the debugger for windows. I dont it to try to debug each of my applicatins when they dont reply.

Other questions are about plugins. First i would like to know if there is things to know when trying to port a plugin from 0.83 to 0.9?

About albumart i was thinking about using a version of albumart for 0.83 that had a download feature. I would like to use its code and change the search to use the script to get albumart on itunes; Yet the problem is that i cant find the source about that version , i cant even find the plugin. Someone knows where to find it?

Thanks

Few question before starting developing

Reply #1
Ok, i am just a few hours from starting to develop.
My goal is to try to port the foo_uie_lyrics(the one with download) to 0.9 and to add download support to foo_uie_albumart.
First a little question about visual studio; I am quite afraid to install it. I worked with .NET a lot and each i wanted to get rid of it i had to wipe out my HD. The problem is the debugger, it is causing a lot of problem on my coptuer. does anyone knows a way to install visual without the debugger for windows. I dont it to try to debug each of my applicatins when they dont reply.


I've never found this to be much of a problem. I certainly prefer the JIT dialogue to that stupid 'report to microsoft' thing. Anyway, here's how to disable it (from the MSDN):
Code: [Select]
Procedure
To enable/disable Just-In-Time debugging

   1.

      On the Tools menu, click Options.
   2.

      In the Options dialog box, select the Debugging folder.
   3.

      In the Debugging folder, select the Just-In-Time page.
   4.

      In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types: Managed, Native, or Script.

      To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time debugging sets a registry key, and Administrator privileges are required to change that key.
   5.

      Click OK.


Quote
Other questions are about plugins. First i would like to know if there is things to know when trying to port a plugin from 0.83 to 0.9?

About albumart i was thinking about using a version of albumart for 0.83 that had a download feature. I would like to use its code and change the search to use the script to get albumart on itunes; Yet the problem is that i cant find the source about that version , i cant even find the plugin. Someone knows where to find it?

Thanks


I believe I released the version of foo_uie_albumart with downloading. However I the actual downloading was done by a seperate module, CoverDownloader.dll for which I never released the source. I still have that project floating around somewhere, the last modification I did was to add support for python scripting, which really makes it very easy and fun to add new sources for covers. It is however a bit buggy and I haven't touched it for ages. Might look into it again tonight.
Integration into the uie_albumart plugin was quite simple, using virtual interfaces and event handlers that call back into uie_albumart when something happens. Altogether I probably added about 50 lines to uie_albumart.

I could send you the sources if you really want it, just send me an email.

Few question before starting developing

Reply #2
ok, thanks david_dl for the tips for JIt, hope it will work

i tried to compil foo_uie_lyrics, here is my first error message:
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\sdk\foobar2000.h(5) : fatal error C1189: #error :  Only UNICODE environment supported.
what can i do to make my environment unicode?

Few question before starting developing

Reply #3
ok, thanks david_dl for the tips for JIt, hope it will work

i tried to compil foo_uie_lyrics, here is my first error message:
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\sdk\foobar2000.h(5) : fatal error C1189: #error :  Only UNICODE environment supported.
what can i do to make my environment unicode?

Project menu -> "foo_uie_lyrics properties"
Select "Configuration Properties" on the left, and set Character Set to "Use Unicode Character Set"

Few question before starting developing

Reply #4
thanks G-Lite it worked, now i am trying to get over with all the error messages.

For example, i have
string8 debug_log = "\xEF\xBB\xBF";

string8 seems not to be used anymore, so after looking in pfc i decided to try with string but i am not sure. Compyling this line now pass with string but it might be still wrong and if i correct everything that way it might compil but not work, and after that it will be very difficult to debug.
So i am guessing wrong? and of bothering you a lot is there a page or something that would refer the changes made from 0.83 to 0.9?

EDIT: oups string does not work too... but pfc::string_base seems to be good

EDIT2: Damn it seems that it was only pfc::string8 ....

Few question before starting developing

Reply #5
managed to solved a lot  of errors but now i am stuck with 3 errors

Code: [Select]
cfg_view_list_t(const char * name) : cfg_var(name) { reset(); }
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\foo_uie_lyrics_src_0237\config.h(155) : error C2664: 'cfg_var::cfg_var(const GUID &)' : cannot convert parameter 1 from 'const char *' to 'const GUID &'

I dont really understand how i have o correct this one :$

Code: [Select]
virtual bool get_raw_data(write_config_callback * out);
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\foo_uie_lyrics_src_0237\config.h(157) : error C2061: syntax error : identifier 'write_config_callback'


seemed to exist in cfg_var but not anymore and dont find anything to replace it

Code: [Select]
mem_block_list_t<HWND> wnd_page_list;
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\foo_uie_lyrics_src_0237\config.h(51) : error C2143: syntax error : missing ';' before '<'


Found no trace of mem_block_list_t anywhere ...

Few question before starting developing

Reply #6
I dont really understand how i have o correct this one :$
Use a GUID instead of a string as name. You can create one with guidgen.exe.

seemed to exist in cfg_var but not anymore and dont find anything to replace it
See the set_data_raw() and get_data_raw() virtual methods in cfg-var.

Found no trace of mem_block_list_t anywhere ...
Just use pfc::list_t instead.

Few question before starting developing

Reply #7
thanks a lot foosion.
About GUID
in config.cpp i have things like
Code: [Select]
cfg_string            cfg_lyric_tag("lyric_tag_value", "%LYRICS%;%LYRIC%");


i have to replace them by
Code: [Select]
// {8CF98680-163C-42ce-AA8D-5520D0FC28AB}
static const GUID guid_cfg_lyric_tag =
{ 0x8cf98680, 0x163c, 0x42ce, { 0xaa, 0x8d, 0x55, 0x20, 0xd0, 0xfc, 0x28, 0xab } };
cfg_string            cfg_lyric_tag(guid_cfg_lyric_tag, "%LYRICS%;%LYRIC%");


Am i wrong here?

Few question before starting developing

Reply #8
No (unless you copied that GUID from someone else's code instead of using guidgen). By the way, use of cfg_var classes is also explained in my component tutorial.

Few question before starting developing

Reply #9
No (unless you copied that GUID from someone else's code instead of using guidgen). By the way, use of cfg_var classes is also explained in my component tutorial.

Yeah i am currently using it
but seeing that almost 30 of those cfg_string ....
I just wanted to be sure

Few question before starting developing

Reply #10
There's also uuidgen.exe - a command line tool that can generate multiple GUIDs at once.

Few question before starting developing

Reply #11
i have another problem with GUID.
I have a class
Code: [Select]
class cfg_view_list_t : public cfg_var
{
private:
    struct entry
    {
        pfc::string8 name;
        pfc::string8 value;
        entry(const char * p_name,const char * p_value) : name(p_name), value(p_value) {}
        entry() {}
    };
    pfc::ptr_list_t<entry> data;

public:
    cfg_view_list_t(GUID & name) : cfg_var(name) { reset(); }
    ~cfg_view_list_t() {data.delete_all();}
    virtual bool get_data_raw(stream_writer * out);
    virtual void set_data_raw(const void * pdata,int psize);
    virtual void reset();
    const char * get_name(unsigned idx) const;
    const char * get_value(unsigned idx) const;
    unsigned find_item(const char * name) const;
    inline unsigned add_item(const char * name,const char * value) { return data.add_item(new entry(name,value)); }
    inline void remove_item(unsigned idx) { data.delete_by_idx(idx); }
    inline void modify_item(unsigned idx,const char * value) { data[idx]->value = value; }
    inline unsigned get_count() const {return data.get_count();}
    inline void swap(unsigned idx1,unsigned idx2) {data.swap_items(idx1,idx2);}
    void format_display(unsigned n,pfc::string_base & out) const;
};


and an instantiation here
Code: [Select]
// {86099687-5436-482d-BF21-1AD69B3B948A}
static const GUID guid_cfg_view_list =
{ 0x86099687, 0x5436, 0x482d, { 0xbf, 0x21, 0x1a, 0xd6, 0x9b, 0x3b, 0x94, 0x8a } };
cfg_view_list_t        cfg_view_list(guid_cfg_view_list);


i have this error
Code: [Select]
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\foo_uie_lyrics_src_0237\config.cpp(160) : error C2259: 'cfg_view_list_t' : cannot instantiate abstract class
1>        due to following members:
1>        'void cfg_var::get_data_raw(foobar2000_io::stream_writer *,foobar2000_io::abort_callback &)' : is abstract
1>        c:\program files\microsoft visual studio 8\sdk\foobar2000\sdk\cfg_var.h(14) : see declaration of 'cfg_var::get_data_raw'
1>        'void cfg_var::set_data_raw(foobar2000_io::stream_reader *,t_size,foobar2000_io::abort_callback &)' : is abstract
1>        c:\program files\microsoft visual studio 8\sdk\foobar2000\sdk\cfg_var.h(18) : see declaration of 'cfg_var::set_data_raw'
1>c:\program files\microsoft visual studio 8\sdk\foobar2000\foo_uie_lyrics_src_0237\config.cpp(160) : error C2664: 'cfg_view_list_t::cfg_view_list_t(GUID &)' : cannot convert parameter 1 from 'const GUID' to 'GUID &'
1>        Conversion loses qualifiers


i tried a few things but nothing works....

Few question before starting developing

Reply #12
Match up the function names, note the missing function parameters. Maybe you should read up on the stock cfg_var implementations and see how they work all over again, yes?

Few question before starting developing

Reply #13
Match up the function names, note the missing function parameters. Maybe you should read up on the stock cfg_var implementations and see how they work all over again, yes?

just realised that i didn t explain myself clearly, i know about the parameter but the problem is that before in the code there was no abort_callback, so it seems that it didn t need one and i dont really know if i should create a "useless" one or try to do without the abort_callback.
That s why i quote the code that way

Few question before starting developing

Reply #14
As I understand it, abort_callback allows you to detect when the user aborts the current operation so that you can return immediately.
Useful if you're doing lengthy processing/reading from a file or something.

Few question before starting developing

Reply #15
As I understand it, abort_callback allows you to detect when the user aborts the current operation so that you can return immediately.
Useful if you're doing lengthy processing/reading from a file or something.

That is also what i thought, but apparently here it is not something that the user shoulb able to cancel so i ll have to find a way not to use an abort callback here

 
SimplePortal 1.0.0 RC1 © 2008-2019