IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

Can't for the life of me figure out how to set up the SDK with vis
paulb39
post Jan 2 2013, 03:24
Post #1





Group: Members
Posts: 19
Joined: 20-August 10
Member No.: 83216



Can someone give me a step by step guide to setting up the foobar SDK with visual studio 2010? The tutorials I found are either completely out of date, or just say "to do, write tutorial".

I have no experience with setting up SDKs and I can't seem to figure it out. All I'm trying to figure out is how to set up the SDK and compile a plugin that says "it works" when its installed.
Go to the top of the page
+Quote Post
 
Start new topic
Replies
emilles
post Jan 11 2013, 18:00
Post #2





Group: Members
Posts: 11
Joined: 29-March 06
Member No.: 28950



Since the SDK did not provide all the VS2008 project files necessary, I had to do a little bit of legwork to get the sample component working. You should be able to convert my project file to a VS2010 project pretty easily. Here is what I did; it is a bit unorthodox, but it cut out all the guesswork as to whether I should include helpers, ATLHelpers, etc. and saves me from managing several projects. I set up the following file structure (my solution contains other project files, hence the extra directory layer):

<basedir>\foobar2k.vcproj -- .vcxproj for VS2010 and up
<basedir>\foobar2k\
<basedir>\foobar2k\sdk\ -- unzip the SDK into this directory in its entirety
<basedir>\foobar2k\src\
<basedir>\foobar2k\src\Main.cpp
<basedir>\foobar2k\src\Resources.h
<basedir>\foobar2k\src\Resources.rc
<basedir>\foobar2k\src\StdAfx.cpp
<basedir>\foobar2k\src\StdAfx.h

foobar2k.vcproj looks like the following for me. You could easily add the sample sources and build the sample component instead.
CODE
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="foobar2k"
ProjectGUID="{85FBFD09-0099-4FE9-9DB6-78DB6F60F817}"
RootNamespace="foobar2k"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ProjectName)\out"
IntermediateDirectory="$(ProjectName)\obj"
ConfigurationType="2"
CharacterSet="1"
DeleteExtensionsOnClean=""
ExcludeBuckets="5;6;8;10;13;14;15;16;18"
>
<Tool
Name="VCPreBuildEventTool"
Description="Deleting $(TargetFileName) from player directory..."
CommandLine="ERASE /F /Q &quot;C:\Program Files\foobar2000\components\$(TargetFileName)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(ProjectName)\sdk"
PreprocessorDefinitions="NOMINMAX;WIN32;_WIN32_WINNT=0x501"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="4"
DebugInformationFormat="3"
DisableSpecificWarnings="4652"
ErrorReporting="0"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="shared.lib shell32.lib user32.lib $(NOINHERIT)"
OutputFile="$(OutDir)\foo_sample.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="$(ProjectName)\sdk\foobar2000\shared"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
ErrorReporting="0"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying $(TargetFileName) to player directory..."
CommandLine="COPY /B /Y &quot;$(TargetPath)&quot; &quot;C:\Program Files\foobar2000\components\&quot;"
/>
</Configuration>
</Configurations>
<Files>
<File
RelativePath=".\foobar2k\src\Main.cpp"
>
</File>
<File
RelativePath=".\foobar2k\src\Resources.h"
>
</File>
<File
RelativePath=".\foobar2k\src\Resources.rc"
>
</File>
<File
RelativePath=".\foobar2k\src\StdAfx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
WarningLevel="3"
DisableSpecificWarnings="4995;4996"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\foobar2k\src\StdAfx.h"
>
</File>
</Files>
</VisualStudioProject>

Main.cpp is where the component is defined and initquit lives. It starts out like this:
CODE
#include "StdAfx.h"

#include <foobar2000/foobar2000_component_client/component_client.cpp>

DECLARE_COMPONENT_VERSION(...);

class Main : public initquit
{
public:
void on_init();
void on_quit();
};

static const initquit_factory_t<Main> initquit_factory_g;
...


Resources.h and Resources.rc are standard resource files for version, dialog, etc.

StdAfx.h is the precompiled header. It pulls in all the foobar2000 SDK headers like so:
CODE
#include <foobar2000/ATLHelpers/ATLHelpers.h> // includes all foobar2000 headers


StdAfx.cpp is marked as the file for generating the precompiled headers and also imports all foobar2000 SDK sources like so:
CODE
#include "StdAfx.h"

#include <foobar2000/SDK/abort_callback.cpp>
#include <foobar2000/SDK/advconfig.cpp>
#include <foobar2000/SDK/album_art.cpp>
#include <foobar2000/SDK/app_close_blocker.cpp>
#include <foobar2000/SDK/audio_chunk.cpp>
#include <foobar2000/SDK/audio_chunk_channel_config.cpp>
#include <foobar2000/SDK/cfg_var.cpp>
#include <foobar2000/SDK/chapterizer.cpp>
#include <foobar2000/SDK/commandline.cpp>
#include <foobar2000/SDK/completion_notify.cpp>
#include <foobar2000/SDK/config_object.cpp>
#include <foobar2000/SDK/console.cpp>
#include <foobar2000/SDK/dsp.cpp>
#include <foobar2000/SDK/dsp_manager.cpp>
#include <foobar2000/SDK/file_info.cpp>
#include <foobar2000/SDK/file_info_impl.cpp>
#include <foobar2000/SDK/file_info_merge.cpp>
#include <foobar2000/SDK/file_operation_callback.cpp>
#include <foobar2000/SDK/filesystem.cpp>
#include <foobar2000/SDK/filesystem_helper.cpp>
#include <foobar2000/SDK/guids.cpp>
#include <foobar2000/SDK/hasher_md5.cpp>
#include <foobar2000/SDK/input.cpp>
#include <foobar2000/SDK/input_file_type.cpp>
#include <foobar2000/SDK/link_resolver.cpp>
#include <foobar2000/SDK/mainmenu.cpp>
#include <foobar2000/SDK/mem_block_container.cpp>
#include <foobar2000/SDK/menu_helpers.cpp>
#include <foobar2000/SDK/menu_item.cpp>
#include <foobar2000/SDK/menu_manager.cpp>
#include <foobar2000/SDK/metadb.cpp>
#include <foobar2000/SDK/metadb_handle.cpp>
#include <foobar2000/SDK/metadb_handle_list.cpp>
#include <foobar2000/SDK/packet_decoder.cpp>
#include <foobar2000/SDK/playable_location.cpp>
#include <foobar2000/SDK/playback_control.cpp>
#include <foobar2000/SDK/playlist.cpp>
#include <foobar2000/SDK/playlist_loader.cpp>
#include <foobar2000/SDK/popup_message.cpp>
#include <foobar2000/SDK/preferences_page.cpp>
#include <foobar2000/SDK/replaygain.cpp>
#include <foobar2000/SDK/replaygain_info.cpp>
#include <foobar2000/SDK/service.cpp>
#include <foobar2000/SDK/tag_processor.cpp>
#include <foobar2000/SDK/tag_processor_id3v2.cpp>
#include <foobar2000/SDK/threaded_process.cpp>
#include <foobar2000/SDK/titleformat.cpp>
#include <foobar2000/SDK/ui.cpp>
#include <foobar2000/SDK/ui_element.cpp>

#include <foobar2000/helpers/clipboard.cpp>
#include <foobar2000/helpers/create_directory_helper.cpp>
#include <foobar2000/helpers/cue_creator.cpp>
#include <foobar2000/helpers/cue_parser.cpp>
#include <foobar2000/helpers/cue_parser_embedding.cpp>
#include <foobar2000/helpers/cuesheet_index_list.cpp>
#include <foobar2000/helpers/dialog_resize_helper.cpp>
#include <foobar2000/helpers/dropdown_helper.cpp>
#include <foobar2000/helpers/dynamic_bitrate_helper.cpp>
#include <foobar2000/helpers/file_info_const_impl.cpp>
#include <foobar2000/helpers/file_list_helper.cpp>
#include <foobar2000/helpers/file_move_helper.cpp>
#include <foobar2000/helpers/file_wrapper_simple.cpp>
//#include <foobar2000/helpers/filetimetools.cpp>
#include <foobar2000/helpers/IDataObjectUtils.cpp>
#include <foobar2000/helpers/input_helpers.cpp>
#include <foobar2000/helpers/listview_helper.cpp>
#include <foobar2000/helpers/metadb_io_hintlist.cpp>
#include <foobar2000/helpers/mp3_utils.cpp>
#include <foobar2000/helpers/seekabilizer.cpp>
#include <foobar2000/helpers/stream_buffer_helper.cpp>
#include <foobar2000/helpers/text_file_loader.cpp>
#include <foobar2000/helpers/VisUtils.cpp>
#include <foobar2000/helpers/wildcard.cpp>
#include <foobar2000/helpers/win32_dialog.cpp>
#include <foobar2000/helpers/win32_misc.cpp>
#include <foobar2000/helpers/window_placement_helper.cpp>

#include <foobar2000/ATLHelpers/AutoComplete.cpp>
#include <foobar2000/ATLHelpers/CDialogResizeHelper.cpp>
#include <foobar2000/ATLHelpers/inplace_edit.cpp>
#include <foobar2000/ATLHelpers/inplace_edit_v2.cpp>
#include <foobar2000/ATLHelpers/misc.cpp>

#include <pfc/base64.cpp>
#include <pfc/bsearch.cpp>
#include <pfc/guid.cpp>
#include <pfc/other.cpp>
#include <pfc/pathUtils.cpp>
#include <pfc/printf.cpp>
#include <pfc/profiler.cpp>
#include <pfc/selftest.cpp>
#include <pfc/sort.cpp>
#include <pfc/string.cpp>
#include <pfc/string_conv.cpp>
#include <pfc/stringNew.cpp>
#include <pfc/threads.cpp>
#include <pfc/utf8.cpp>

There was a conflict between one of the cue file sources and filetimetools, so I had to comment one of the two out. A simple edit to either would alleviate the problem, but I wanted to be able to take the SDK in with zero edits.

Cry foul if you like, but it builds my component DLL successfully and I don't need to fuss with any of the SDK project files.

This post has been edited by db1989: Jan 19 2013, 03:36
Reason for edit: Put large items in [codebox]es, not [code]. People can scroll through them if they want, without being forced to as before.
Go to the top of the page
+Quote Post
paulb39
post Jan 19 2013, 02:13
Post #3





Group: Members
Posts: 19
Joined: 20-August 10
Member No.: 83216



Thank you for taking the time to help me, I really appreciate it. I did all the above and the compile error I am getting is
"Error 1 error C2857: '#include' statement specified with the /YcStdAfx.h command-line option was not found in the source file c:\users\paul\documents\visual studio 2010\foobar2k\sdk\pfc\avltree.h 98"
Googleing that shows that its caused by the program not being set up to work with precompiled headers, and the suggestion is to go to the properties of StdAfx.cpp, and in precompiled header, select "Create (/Yc)". But it is already set to that. Any idea on how to fix this problem?

Also, just so I understand, all the code for the component should be written in the Main.cpp? What would that main.cpp code you showed me do?

This post has been edited by db1989: Jan 19 2013, 03:38
Reason for edit: Did you not think about removing that pointless full quote of that entire post, huge [code]s and all?
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st December 2014 - 20:49