Finally rebuilding my component for 0.7. I haven't been able to keep up with the .7 development so I'm just going to ask some questions that may have already been covered.
1. Are there API calls for every enum that used to be supported by play_control::command() ?
for example I see the obvious ones ->>> play_control::get()->get_volume() for play_control::VOLUME_GET
are all of the rest covered somewhere?
2. How do I use the utf8api.dll? When I compile I get
Linking...
Creating library Debug/foo_WSGUI_d.lib and object Debug/foo_WSGUI_d.exp
foobar2000_SDK.lib(metadb_handle.obj) : error LNK2001: unresolved external symbol __imp__uSortStringCreate
foobar2000_SDK.lib(metadb_handle.obj) : error LNK2001: unresolved external symbol __imp__uSortStringCompare
foobar2000_SDK.lib(metadb_handle.obj) : error LNK2001: unresolved external symbol __imp__uSortStringFree
../foobar2000/foo_WSGUI_d.dll : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
foo_WSGUI_d.dll - 4 error(s), 0 warning(s)
I didn't see a uti8api.lib in the SDK and I couldn't get that project to compile so I'm wondering about the proper way to link.
3. The .7 way to do keyboard shortcuts?
Thanks in advance for answers (unless you tell me to look in the header files or the sample projects )
To get utf8api to compile, it depends on PFC. If you use the "dependencies" thing in VC++, it's pretty simple to get it all working together.
2. How do I use the utf8api.dll?
Make SDK depend on utf8api and utf8api depend on pfc.
You mean include the .dsp for utf8api.dll in my project (project->insert project into workspace) is the same manner as I've done for PFC and SDK?
The way I made use of shortcuts in 0.7x was to extend "menu_item_main_single". You can then associate it with a menu item heading (such as Playlist/"your feature").
Users will then see this in the shortcuts list in their prefs and can then link a keyboard shortcut to it. This works fine for me, but does mean that it will end up somewhere within the menu structure.
You mean include the .dsp for utf8api.dll in my project (project->insert project into workspace) is the same manner as I've done for PFC and SDK?
Yep. Then set the dependencies as Case said.
This works fine for me, but does mean that it will end up somewhere within the menu structure.
Not necessarily.
Override this:
virtual enabled_state get_enabled_state(int idx) {return MENU_DEFAULT_ON;}
MENU_DEFAULT_OFF will hide it by default, and MENU_FORCE_OFF will keep it hidden.
Cool, thanks for the info.
You mean include the .dsp for utf8api.dll in my project (project->insert project into workspace) is the same manner as I've done for PFC and SDK?
Yep. Then set the dependencies as Case said.
OK, link errors are resolved - thanks.
Now I have a compiled dll and found a new problem - it doesn't run even though I haven't changed anything from my 0.6 version except for using .7 vs. .6 API calls.
Are there changes to the init/quit etc. that I'm not aware of?
Very strange...
Define "doesn't run".
Define "doesn't run".
Yeah, sorry.
It gets into some kind of error loop and I just discovered it is spitting our error files.
failure.txt
___________
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 1021916Fh
Access violation, operation: read, address: 6F636573h
Module: "MSVCRTD", loaded at 10200000h - 1026C000h
Symbol: "wcslen" (+0000000Fh)
Additional info: main message loop
This is the first crash logged by this instance.
Code bytes:
1021914Fh: 0C 85 D2 74 02 EB D4 8B 45 08 8B E5 5D C3 CC CC
1021915Fh: CC 55 8B EC 51 8B 45 08 89 45 FC 8B 4D FC 33 D2
1021916Fh: 66 8B 11 8B 45 FC 83 C0 02 89 45 FC 85 D2 74 02
1021917Fh: EB E9 8B 45 FC 2B 45 08 D1 F8 83 E8 01 8B E5 5D
Version info:
foobar2000 v0.7 RC8
UNICODE
_______________
This is in the code that loads the look file which has not changed at all from the .6 version.
Any suggestions?
Looks like you have written code that crashes. Are you expecting detailed instructions how to use debugger or someone to come and fix your code ?
Looks like you have written code that crashes. Are you expecting detailed instructions how to use debugger or someone to come and fix your code ?
No, I'm saying all I changed in my .6 code was to use the new play_control API, removed the deprectated APIs (keyboard_shortcuts, etc.) and now code that wasn't modified at all seems to crash - I don't even call wsclen directly in my code so I don't know what's going on since the crash doesn't appear to be in my source code.
I thought that was strange is all.
If you want to fly out and have a look let me know but otherwise I was just seeking any insight into why this might have happened.
Well, I thought it would take less mental effort for some people to run problematic code under debugger and see what happens, rather than write more pointless posts.
From quick search, it looks like you have been passing invalid parameters to string conversion routines, which were possibly tolered before but they no longer are.
Well, I thought it would take less mental effort for some people to run problematic code under debugger and see what happens, rather than write more pointless posts.
From quick search, it looks like you have been passing invalid parameters to string conversion routines, which were possibly tolered before but they no longer are.
Things go bad as soon as I call
SetWindowPos(
NULL,0,0,
m_SkinSize.Width + extraWidth,
m_SkinSize.Height + extraHeight,SWP_NOMOVE | SWP_NOZORDER);
}
That function never returns and I can't debug it.
I don't immediately see how this calls wsclen. Could I have some strange mix of unicode vs non-unicode?
Erm, if you are sure that it's inside SetWindowPos(), then check message handlers for the window you are calling it on.
Erm, if you are sure that it's inside SetWindowPos(), then check message handlers for the window you are calling it on.
I not sure what you mean - I don't have any message handlers specific to calling SetWindowPos. I noticed if I skip over the SetWindowPos, the program goes a little farther but then I get the same error later on but I haven't found exactly where. I'm guessing some other Win32 API call. I don't get any call stack when this occurs since the program seems to be looping in the main thread (calling the dump_failure_txt method).
Truly, I'm not sure what is going on and not trying to waste any mental power.
Are you running debug version of windows core so win32 api functions call msvcrtd.dll wcslen() ? I don't think you are.
Are you running debug version of windows core so win32 api functions call msvcrtd.dll wcslen() ? I don't think you are.
No, standard VC++ 6.0 setup on Windows XP. I noticed that utf8app debug project settings don't define UNICODE preprocessor macro and use _MBCS - is that correct (changing it didn't seem to help my problem - just wondering).
Then it does not crash inside SetWindowPos, some code you compiled calls wcslen. Sorry, I'm getting bored with this thread.
Erm, if you are sure that it's inside SetWindowPos(), then check message handlers for the window you are calling it on.
I not sure what you mean - I don't have any message handlers specific to calling SetWindowPos. I noticed if I skip over the SetWindowPos, the program goes a little farther but then I get the same error later on but I haven't found exactly where. I'm guessing some other Win32 API call. I don't get any call stack when this occurs since the program seems to be looping in the main thread (calling the dump_failure_txt method).
Truly, I'm not sure what is going on and not trying to waste any mental power.
danZ: If you can get on IRC, you might try the fb2k irc channel: #foobar2000 on irc.freenode.net
I've never gotten on it, but it would probably be a lot easier for someone to try to help you debug this on IRC then through the forums.
Then it does not crash inside SetWindowPos, some code you compiled calls wcslen. Sorry, I'm getting bored with this thread.
Sorry to bore you - doesn't seem to be that hard to do
I fixed the problem and thought someone might at least be curious.
First I'm never calling wsclen directly - the call was being made by std::string which is used in one of my libraries.
Second, since the call was being made in response to various windows messages it was very hard to track down because the error would not be caught in the debugger. Instead the program would just start looping and spitting out the failure.txt files. If I would break in the debugger during this I didn't get any useful stack information.
So, the final cause of the problem - a single missing _T() wrapper around one string constant in my code. Like Z^7 said, apparently tolerated in .6.
Anyway, problem solved, .7 upgrade back on track.
Now back to my other questions.
1. Will I find API equivalents for all the former play_control::command() calls?
PLAYBACK_NEXT, PLAYBACK_PREV,PLAYBACK_REPEAT,PLAYBACK_SHUFFLE - don't immediately see how to do those in .7.
2. In another component I'm working on I was creating my own console service
static service_factory_single_t<console,mTVUIConsole> mTVUIConsole_instance;
This results in an error now at run time regarding duplicated core service.
To answer (1), have a look at play_control.h. The API is quite different, so you will have to make some changes in your code, but you can achieve the same things. For example, to go to the next track you need something like
play_control::get()->play_start(play_control::TRACK_COMMAND_NEXT);
'hope this helps...
To answer (1), have a look at play_control.h. The API is quite different, so you will have to make some changes in your code, but you can achieve the same things. For example, to go to the next track you need something like
play_control::get()->play_start(play_control::TRACK_COMMAND_NEXT);
'hope this helps...
Yeah, thanks.
0. Debug / Exceptions, set all to "stop always"
1. play_control has most of those, playback order control explained here: http://www.hydrogenaudio.org/show.php/showtopic/11110 (http://www.hydrogenaudio.org/show.php/showtopic/11110)
2. If you want to add a new console service, you need to replace/remove existing one; otherwise the one getting console messages will depend on dll loading order.
First I'm never calling wsclen directly - the call was being made by std::string which is used in one of my libraries.
Use string8, which is part of PFC. :B
So, the final cause of the problem - a single missing _T() wrapper around one string constant in my code. Like Z^7 said, apparently tolerated in .6.
You shouldn't need _T() or UNICODE, as you are now using utf8api and all string constants should be UTF-8.
First I'm never calling wsclen directly - the call was being made by std::string which is used in one of my libraries.
Use string8, which is part of PFC. :B
So, the final cause of the problem - a single missing _T() wrapper around one string constant in my code. Like Z^7 said, apparently tolerated in .6.
You shouldn't need _T() or UNICODE, as you are now using utf8api and all string constants should be UTF-8.
I wish it were so simple
I have reuseable code in this project that I wrote for other projects and is used in all sorts of different applications and environments. Therefore, I can't use foobar's string implementation exclusively.
I have a mix of std::string from shared code and foobar's string stuff.
are their analogs for the following v6 play_control enums in v7 - I don't see them.
FOOBAR2000_ALWAYSONTOP
FOOBAR2000_CONFIG,
FOOBAR2000_EXIT,
Edit
Also for hide/show etc. I'm doing this:
user_interface::g_find("Default User Interface")->activate();
How can I make this generic for whichever UI is currently active?
/Edit
FOOBAR2000_CONFIG,
look into play_control.h:
play_control::g_show_config(page_name)
HI all,
does anyone know why, the new version of foobar0.7 has so many dll errors when someone is trying to play mp3's.
is there any solution to this. thanx in advance .
FOOBAR2000_ALWAYSONTOP
FOOBAR2000_EXIT,
See all of the menu items/actions on the main and context menu sections in the config?
menu_manager::run_command()
ie. menu_manager::run_command("Foobar2000/Titleformatting help") for a "help" button you can place on any dialog that features a title formatting editor.
FOOBAR2000_ALWAYSONTOP
FOOBAR2000_EXIT,
See all of the menu items/actions on the main and context menu sections in the config?
menu_manager::run_command()
ie. menu_manager::run_command("Foobar2000/Titleformatting help") for a "help" button you can place on any dialog that features a title formatting editor.
Ah, that's cool - thanks.