Updates for VC++ 2008:

Updated vcproj files for glib/gthread and new .c/.h files.
Moved inline functions in fluid_event_queue.c to .h header.
Moved inclusion of winsock2.h and ws2tcpip.h to fluidsynth_priv.h and before windows.h (fixes redefinition errors).
Fixed some other minor build errors and warnings.
This commit is contained in:
Josh Green 2009-10-26 06:43:18 +00:00
parent 2a367ab6a0
commit 50f185a143
14 changed files with 1124 additions and 666 deletions

View file

@ -266,7 +266,7 @@ fluid_chorus_set(fluid_chorus_t* chorus, int set, int nr, float level,
if (set & FLUID_CHORUS_SET_DEPTH) chorus->new_depth_ms = depth_ms;
if (set & FLUID_CHORUS_SET_TYPE) chorus->new_type = type;
return fluid_chorus_update (chorus);
fluid_chorus_update (chorus);
}
/* Purpose:

View file

@ -19,7 +19,6 @@
*/
#ifdef WIN32
#include <windows.h>
#include "fluidsynth_priv.h"
#include "fluid_sys.h"

View file

@ -26,7 +26,6 @@
#include "fluid_sys.h"
#include "fluid_adriver.h"
#include "fluid_settings.h"
#include <windows.h>
#include <mmsystem.h>
#include <dsound.h>

View file

@ -86,70 +86,3 @@ fluid_event_queue_free (fluid_event_queue_t *queue)
FLUID_FREE (queue->array);
FLUID_FREE (queue);
}
/**
* Get pointer to next input array element in queue.
* @param queue Lockless queue instance
* @return Pointer to array element in queue to store data to or NULL if queue is full
*
* This function along with fluid_queue_next_inptr() form a queue "push"
* operation and is split into 2 functions to avoid an element copy. Note that
* the returned array element pointer may contain the data of a previous element
* if the queue has wrapped around. This can be used to reclaim pointers to
* allocated memory, etc.
*/
FLUID_INLINE fluid_event_queue_elem_t *
fluid_event_queue_get_inptr (fluid_event_queue_t *queue)
{
return fluid_atomic_int_get (&queue->count) == queue->totalcount ? NULL
: queue->array + queue->in;
}
/**
* Advance the input queue index to complete a "push" operation.
* @param queue Lockless queue instance
*
* This function along with fluid_queue_get_inptr() form a queue "push"
* operation and is split into 2 functions to avoid element copy.
*/
FLUID_INLINE void
fluid_event_queue_next_inptr (fluid_event_queue_t *queue)
{
fluid_atomic_int_inc (&queue->count);
if (++queue->in == queue->totalcount)
queue->in = 0;
}
/**
* Get pointer to next output array element in queue.
* @param queue Lockless queue instance
* @return Pointer to array element data in the queue or NULL if empty, can only
* be used up until fluid_queue_next_outptr() is called.
*
* This function along with fluid_queue_next_outptr() form a queue "pop"
* operation and is split into 2 functions to avoid an element copy.
*/
FLUID_INLINE fluid_event_queue_elem_t *
fluid_event_queue_get_outptr (fluid_event_queue_t *queue)
{
return fluid_atomic_int_get (&queue->count) == 0 ? NULL
: queue->array + queue->out;
}
/**
* Advance the output queue index to complete a "pop" operation.
* @param queue Lockless queue instance
*
* This function along with fluid_queue_get_outptr() form a queue "pop"
* operation and is split into 2 functions to avoid an element copy.
*/
FLUID_INLINE void
fluid_event_queue_next_outptr (fluid_event_queue_t *queue)
{
fluid_atomic_int_add (&queue->count, -1);
if (++queue->out == queue->totalcount)
queue->out = 0;
}

View file

@ -157,9 +157,71 @@ typedef struct
fluid_event_queue_t *fluid_event_queue_new (int count);
void fluid_event_queue_free (fluid_event_queue_t *queue);
fluid_event_queue_elem_t *fluid_event_queue_get_inptr (fluid_event_queue_t *queue);
void fluid_event_queue_next_inptr (fluid_event_queue_t *queue);
fluid_event_queue_elem_t *fluid_event_queue_get_outptr (fluid_event_queue_t *queue);
void fluid_event_queue_next_outptr (fluid_event_queue_t *queue);
/**
* Get pointer to next input array element in queue.
* @param queue Lockless queue instance
* @return Pointer to array element in queue to store data to or NULL if queue is full
*
* This function along with fluid_queue_next_inptr() form a queue "push"
* operation and is split into 2 functions to avoid an element copy. Note that
* the returned array element pointer may contain the data of a previous element
* if the queue has wrapped around. This can be used to reclaim pointers to
* allocated memory, etc.
*/
static FLUID_INLINE fluid_event_queue_elem_t *
fluid_event_queue_get_inptr (fluid_event_queue_t *queue)
{
return fluid_atomic_int_get (&queue->count) == queue->totalcount ? NULL
: queue->array + queue->in;
}
/**
* Advance the input queue index to complete a "push" operation.
* @param queue Lockless queue instance
*
* This function along with fluid_queue_get_inptr() form a queue "push"
* operation and is split into 2 functions to avoid element copy.
*/
static FLUID_INLINE void
fluid_event_queue_next_inptr (fluid_event_queue_t *queue)
{
fluid_atomic_int_inc (&queue->count);
if (++queue->in == queue->totalcount)
queue->in = 0;
}
/**
* Get pointer to next output array element in queue.
* @param queue Lockless queue instance
* @return Pointer to array element data in the queue or NULL if empty, can only
* be used up until fluid_queue_next_outptr() is called.
*
* This function along with fluid_queue_next_outptr() form a queue "pop"
* operation and is split into 2 functions to avoid an element copy.
*/
static FLUID_INLINE fluid_event_queue_elem_t *
fluid_event_queue_get_outptr (fluid_event_queue_t *queue)
{
return fluid_atomic_int_get (&queue->count) == 0 ? NULL
: queue->array + queue->out;
}
/**
* Advance the output queue index to complete a "pop" operation.
* @param queue Lockless queue instance
*
* This function along with fluid_queue_get_outptr() form a queue "pop"
* operation and is split into 2 functions to avoid an element copy.
*/
static FLUID_INLINE void
fluid_event_queue_next_outptr (fluid_event_queue_t *queue)
{
fluid_atomic_int_add (&queue->count, -1);
if (++queue->out == queue->totalcount)
queue->out = 0;
}
#endif /* _FLUID_EVENT_QUEUE_H */

View file

@ -1024,9 +1024,6 @@ int delete_fluid_server_socket(fluid_server_socket_t* server_socket)
#define WIN32_LEAN_AND_MEAN
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
fluid_istream_t fluid_socket_get_istream (fluid_socket_t sock)
{
return sock | WIN32_SOCKET_FLAG;

View file

@ -1582,9 +1582,11 @@ int fluid_voice_modulate_all(fluid_voice_t* voice)
int
fluid_voice_noteoff(fluid_voice_t* voice)
{
unsigned int at_tick;
fluid_profile(FLUID_PROF_VOICE_NOTE, voice->ref);
unsigned int at_tick = fluid_channel_get_min_note_length_ticks(voice->channel);
at_tick = fluid_channel_get_min_note_length_ticks (voice->channel);
if (at_tick > voice->ticks) {
/* Delay noteoff */

View file

@ -37,7 +37,6 @@
#include "fluid_midi.h"
#include "fluid_mdriver.h"
#include "fluid_settings.h"
#include <windows.h>
#define MIDI_SYSEX_MAX_SIZE 512
#define MIDI_SYSEX_BUF_COUNT 16

View file

@ -33,10 +33,6 @@
#include <getopt.h>
#endif
#if defined(WIN32)
#include <windows.h>
#endif
#include "fluidsynth.h"
#if defined(WIN32) && !defined(MINGW32)

View file

@ -113,6 +113,8 @@
#endif
#if HAVE_WINDOWS_H
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#endif

View file

@ -1,38 +1,34 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fluidsynth", "fluidsynth\fluidsynth.vcproj", "{8150EAA4-CF92-448B-972A-01A423B3A23D}"
ProjectSection(ProjectDependencies) = postProject
{A52C4164-8C82-4E38-A70B-6D0E836D6644} = {A52C4164-8C82-4E38-A70B-6D0E836D6644}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fluidsynth_dll", "fluidsynth_dll\fluidsynth_dll.vcproj", "{A52C4164-8C82-4E38-A70B-6D0E836D6644}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fluidsynth_lib", "fluidsynth_lib\fluidsynth_lib.vcproj", "{CD7D1A45-9970-4958-BD8F-7F42B083093C}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Debug.ActiveCfg = Debug|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Debug.Build.0 = Debug|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Release.ActiveCfg = Release|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Release.Build.0 = Release|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Debug.ActiveCfg = Debug|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Debug.Build.0 = Debug|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Release.ActiveCfg = Release|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Release.Build.0 = Release|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Debug.ActiveCfg = Debug|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Debug.Build.0 = Debug|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Release.ActiveCfg = Release|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Release.Build.0 = Release|Win32
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Debug|Win32.ActiveCfg = Debug|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Debug|Win32.Build.0 = Debug|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Release|Win32.ActiveCfg = Release|Win32
{8150EAA4-CF92-448B-972A-01A423B3A23D}.Release|Win32.Build.0 = Release|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Debug|Win32.ActiveCfg = Debug|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Debug|Win32.Build.0 = Debug|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Release|Win32.ActiveCfg = Release|Win32
{A52C4164-8C82-4E38-A70B-6D0E836D6644}.Release|Win32.Build.0 = Release|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Debug|Win32.ActiveCfg = Debug|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Debug|Win32.Build.0 = Debug|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Release|Win32.ActiveCfg = Release|Win32
{CD7D1A45-9970-4958-BD8F-7F42B083093C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -1,23 +1,46 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Version="9.00"
Name="fluidsynth"
SccProjectName=""
SccLocalPath="">
ProjectGUID="{8150EAA4-CF92-448B-972A-01A423B3A23D}"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"/>
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/fluidsynth.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
@ -25,135 +48,180 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug\fluidsynth.pch"
AssemblerListingLocation=".\Debug\"
ObjectFile=".\Debug\"
ProgramDataBaseFileName=".\Debug\"
WarningLevel="3"
SuppressStartupBanner="TRUE"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"/>
CompileAs="0"
/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib dsound.lib winmm.lib"
OutputFile="../fluidsynth_debug.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/fluidsynth_debug.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/fluidsynth.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
Culture="1033"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib winmm.lib dsound.lib ws2_32.lib glib-2.0.lib gthread-2.0.lib"
OutputFile="../fluidsynth_debug.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/fluidsynth_debug.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCWebDeploymentTool"/>
Name="VCALinkTool"
/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/fluidsynth.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=""
AssemblerListingLocation=".\Release\"
ObjectFile=".\Release\"
ProgramDataBaseFileName=".\Release\"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCCustomBuildTool"/>
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib dsound.lib"
OutputFile="../fluidsynth.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/fluidsynth.pdb"
SubSystem="1"
TargetMachine="1"/>
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/fluidsynth.tlb"
HeaderFileName=""/>
Name="VCALinkTool"
/>
<Tool
Name="VCPostBuildEventTool"/>
Name="VCManifestTool"
/>
<Tool
Name="VCPreBuildEventTool"/>
Name="VCXDCMakeTool"
/>
<Tool
Name="VCPreLinkEventTool"/>
Name="VCBscMakeTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
Name="VCFxCopTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
Name="VCAppVerifierTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\..\src\fluidsynth.c">
RelativePath="..\..\src\fluidsynth.c"
>
<FileConfiguration
Name="Debug|Win32">
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
</Files>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff