HAxis sos
This commit is contained in:
commit
510654f8a1
|
@ -0,0 +1,3 @@
|
|||
*.uasset filter=lfs diff=lfs merge=lfs -text
|
||||
*.wmv filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
|
@ -0,0 +1,13 @@
|
|||
*.dll
|
||||
*.pch
|
||||
*.lib
|
||||
*.a
|
||||
*.so
|
||||
|
||||
*.obj
|
||||
*.exp
|
||||
*Intermediate/
|
||||
*Binaries/
|
||||
*.dylib
|
||||
*.pdb
|
||||
*.exe
|
|
@ -0,0 +1,8 @@
|
|||
[UnrealEd.SimpleMap]
|
||||
SimpleMapName=/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap
|
||||
|
||||
[EditoronlyBP]
|
||||
bAllowClassAndBlueprintPinMatching=true
|
||||
bReplaceBlueprintWithClass= true
|
||||
bDontLoadBlueprintOutsideEditor= true
|
||||
bBlueprintIsNotBlueprintType= true
|
|
@ -0,0 +1,40 @@
|
|||
[ContentBrowser]
|
||||
ContentBrowserTab1.SelectedPaths=/Game/ThirdPersonCPP
|
||||
|
||||
[/Script/EditorStyle.EditorStyleSettings]
|
||||
SelectionColor=(R=0.728000,G=0.364000,B=0.003000,A=1.000000)
|
||||
PressedSelectionColor=(R=0.701000,G=0.225000,B=0.003000,A=1.000000)
|
||||
InactiveSelectionColor=(R=0.250000,G=0.250000,B=0.250000,A=1.000000)
|
||||
KeyboardFocusColor=(R=0.000000,G=0.000000,B=0.000000,A=0.000000)
|
||||
ColorVisionDeficiencyPreviewType=CVD_NormalVision
|
||||
bUseSmallToolBarIcons=False
|
||||
bEnableWindowAnimations=False
|
||||
bShowFriendlyNames=True
|
||||
bExpandConfigurationMenus=False
|
||||
bShowProjectMenus=True
|
||||
bShowLaunchMenus=True
|
||||
LogTimestampMode=None
|
||||
bOpenAssetEditorTabsInNewWindow=True
|
||||
|
||||
[/Script/UnrealEd.EditorPerProjectUserSettings]
|
||||
bDisplayUIExtensionPoints=False
|
||||
bDisplayDocumentationLink=False
|
||||
bDisplayActionListItemRefIds=False
|
||||
bAlwaysGatherBehaviorTreeDebuggerData=False
|
||||
bDisplayEngineVersionInBadge=False
|
||||
bShowFrameRateAndMemory=False
|
||||
bThrottleCPUWhenNotForeground=True
|
||||
bMonitorEditorPerformance=True
|
||||
bAutomaticallyHotReloadNewClasses=False
|
||||
bKeepAttachHierarchy=True
|
||||
bUseCurvesForDistributions=False
|
||||
PropertyMatrix_NumberOfPasteOperationsBeforeWarning=20
|
||||
bSCSEditorShowGrid=True
|
||||
bSCSEditorShowFloor=False
|
||||
SCSViewportCameraSpeed=4
|
||||
bAutoloadCheckedOutPackages=False
|
||||
bSuppressFullyLoadPrompt=True
|
||||
bAllowSelectTranslucent=True
|
||||
MaterialQualityLevel=1
|
||||
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
[/Script/EngineSettings.GameMapsSettings]
|
||||
GameDefaultMap=/Game/Assets/Levels/Menu
|
||||
EditorStartupMap=/Game/Assets/Levels/Map_KOTH_Darko
|
||||
GlobalDefaultGameMode="/Script/UnrealProject.DefaultGameMode"
|
||||
GameInstanceClass=/Script/UnrealProject.DefaultGameInstance
|
||||
|
||||
[/Script/Engine.Engine]
|
||||
+ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/UnrealProject")
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_ThirdPerson",NewGameName="/Script/UnrealProject")
|
||||
+ActiveGameNameRedirects=(OldGameName="/Script/GameName",NewGameName="/Script/UnrealProject")
|
||||
|
||||
[Core.Log]
|
||||
LogNet=verbose
|
||||
LogOnline=verbose
|
||||
|
||||
[/Script/Engine.GameEngine]
|
||||
!NetDriverDefinitions=ClearArray
|
||||
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
|
||||
|
||||
[OnlineSubsystem]
|
||||
DefaultPlatformService=Steam
|
||||
PollingIntervalInMs=20
|
||||
|
||||
[OnlineSubsystemSteam]
|
||||
bEnabled=true
|
||||
;SteamDevAppId=233250
|
||||
SteamDevAppId=480
|
||||
GameServerQueryPort=27015
|
||||
bRelaunchInSteam=false
|
||||
GameVersion=1.0.0.0
|
||||
bVACEnabled=1
|
||||
bAllowP2PPacketRelay=true
|
||||
P2PConnectionTimeout=90
|
||||
|
||||
[/Script/OnlineSubsystemSteam.SteamNetDriver]
|
||||
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
|
||||
|
||||
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
||||
TargetedHardwareClass=Desktop
|
||||
AppliedTargetedHardwareClass=Desktop
|
||||
DefaultGraphicsPerformance=Maximum
|
||||
AppliedDefaultGraphicsPerformance=Maximum
|
||||
|
||||
[/Script/Engine.CollisionProfile]
|
||||
-Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision",bCanModify=False)
|
||||
-Profiles=(Name="BlockAll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=,HelpMessage="WorldStatic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
-Profiles=(Name="OverlapAll",CollisionEnabled=QueryOnly,ObjectTypeName="WorldStatic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
-Profiles=(Name="BlockAllDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=,HelpMessage="WorldDynamic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
-Profiles=(Name="OverlapAllDynamic",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
-Profiles=(Name="IgnoreOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that ignores Pawn and Vehicle. All other channels will be set to default.",bCanModify=False)
|
||||
-Profiles=(Name="OverlapOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that overlaps Pawn, Camera, and Vehicle. All other channels will be set to default. ",bCanModify=False)
|
||||
-Profiles=(Name="Pawn",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Pawn",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object. Can be used for capsule of any playerable character or AI. ",bCanModify=False)
|
||||
-Profiles=(Name="Spectator",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="WorldStatic",Response=ECR_Block),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore)),HelpMessage="Pawn object that ignores all other actors except WorldStatic.",bCanModify=False)
|
||||
-Profiles=(Name="CharacterMesh",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object that is used for Character Mesh. All other channels will be set to default.",bCanModify=False)
|
||||
-Profiles=(Name="PhysicsActor",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=,HelpMessage="Simulating actors",bCanModify=False)
|
||||
-Profiles=(Name="Destructible",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Destructible",CustomResponses=,HelpMessage="Destructible actors",bCanModify=False)
|
||||
-Profiles=(Name="InvisibleWall",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldStatic object that is invisible.",bCanModify=False)
|
||||
-Profiles=(Name="InvisibleWallDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that is invisible.",bCanModify=False)
|
||||
-Profiles=(Name="Trigger",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that is used for trigger. All other channels will be set to default.",bCanModify=False)
|
||||
-Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.",bCanModify=False)
|
||||
-Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.",bCanModify=False)
|
||||
-Profiles=(Name="UI",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Block),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision",bCanModify=False)
|
||||
+Profiles=(Name="BlockAll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=,HelpMessage="WorldStatic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="OverlapAll",CollisionEnabled=QueryOnly,ObjectTypeName="WorldStatic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="BlockAllDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=,HelpMessage="WorldDynamic object that blocks all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="OverlapAllDynamic",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="IgnoreOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that ignores Pawn and Vehicle. All other channels will be set to default.",bCanModify=False)
|
||||
+Profiles=(Name="OverlapOnlyPawn",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Pawn",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that overlaps Pawn, Camera, and Vehicle. All other channels will be set to default. ",bCanModify=False)
|
||||
+Profiles=(Name="Pawn",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Pawn",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object. Can be used for capsule of any playerable character or AI. ",bCanModify=False)
|
||||
+Profiles=(Name="Spectator",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="WorldStatic"),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore)),HelpMessage="Pawn object that ignores all other actors except WorldStatic.",bCanModify=False)
|
||||
+Profiles=(Name="CharacterMesh",CollisionEnabled=QueryOnly,ObjectTypeName="Pawn",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore)),HelpMessage="Pawn object that is used for Character Mesh. All other channels will be set to default.",bCanModify=False)
|
||||
+Profiles=(Name="PhysicsActor",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=,HelpMessage="Simulating actors",bCanModify=False)
|
||||
+Profiles=(Name="Destructible",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Destructible",CustomResponses=,HelpMessage="Destructible actors",bCanModify=False)
|
||||
+Profiles=(Name="InvisibleWall",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldStatic object that is invisible.",bCanModify=False)
|
||||
+Profiles=(Name="InvisibleWallDynamic",CollisionEnabled=QueryAndPhysics,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore)),HelpMessage="WorldDynamic object that is invisible.",bCanModify=False)
|
||||
+Profiles=(Name="Trigger",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldDynamic object that is used for trigger. All other channels will be set to default.",bCanModify=False)
|
||||
+Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.",bCanModify=False)
|
||||
+Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.",bCanModify=False)
|
||||
+Profiles=(Name="UI",CollisionEnabled=QueryOnly,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility"),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ",bCanModify=False)
|
||||
+Profiles=(Name="Triggers",CollisionEnabled=QueryOnly,ObjectTypeName="Trigger",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="EngineTraceChannel1",Response=ECR_Ignore),(Channel="EngineTraceChannel2",Response=ECR_Ignore),(Channel="EngineTraceChannel3",Response=ECR_Ignore),(Channel="EngineTraceChannel4",Response=ECR_Ignore),(Channel="EngineTraceChannel5",Response=ECR_Ignore),(Channel="EngineTraceChannel6",Response=ECR_Ignore),(Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Ignore),(Channel="GameTraceChannel7",Response=ECR_Ignore),(Channel="GameTraceChannel8",Response=ECR_Ignore),(Channel="GameTraceChannel9",Response=ECR_Ignore),(Channel="GameTraceChannel10",Response=ECR_Ignore),(Channel="GameTraceChannel11",Response=ECR_Ignore),(Channel="GameTraceChannel12",Response=ECR_Ignore),(Channel="GameTraceChannel13",Response=ECR_Ignore),(Channel="GameTraceChannel14",Response=ECR_Ignore),(Channel="GameTraceChannel15",Response=ECR_Ignore),(Channel="GameTraceChannel16",Response=ECR_Ignore),(Channel="GameTraceChannel17",Response=ECR_Ignore),(Channel="GameTraceChannel18",Response=ECR_Ignore)),HelpMessage="Needs description",bCanModify=True)
|
||||
+Profiles=(Name="Units",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Units",CustomResponses=((Channel="Trigger",Response=ECR_Overlap),(Channel="Projectile",Response=ECR_Overlap),(Channel="ProjectileUnitsOnly",Response=ECR_Overlap)),HelpMessage="Needs description",bCanModify=True)
|
||||
+Profiles=(Name="Projectiles",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Projectile",CustomResponses=((Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="EngineTraceChannel1",Response=ECR_Ignore),(Channel="EngineTraceChannel2",Response=ECR_Ignore),(Channel="EngineTraceChannel3",Response=ECR_Ignore),(Channel="EngineTraceChannel4",Response=ECR_Ignore),(Channel="EngineTraceChannel5",Response=ECR_Ignore),(Channel="EngineTraceChannel6",Response=ECR_Ignore),(Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Ignore),(Channel="GameTraceChannel7",Response=ECR_Ignore),(Channel="GameTraceChannel8",Response=ECR_Ignore),(Channel="GameTraceChannel9",Response=ECR_Ignore),(Channel="GameTraceChannel10",Response=ECR_Ignore),(Channel="GameTraceChannel11",Response=ECR_Ignore),(Channel="GameTraceChannel12",Response=ECR_Ignore),(Channel="GameTraceChannel13",Response=ECR_Ignore),(Channel="GameTraceChannel14",Response=ECR_Ignore),(Channel="GameTraceChannel15",Response=ECR_Ignore),(Channel="GameTraceChannel16",Response=ECR_Ignore),(Channel="GameTraceChannel17",Response=ECR_Ignore),(Channel="GameTraceChannel18",Response=ECR_Ignore)),HelpMessage="for projectiles",bCanModify=True)
|
||||
+Profiles=(Name="PlayerOverlap",CollisionEnabled=QueryOnly,ObjectTypeName="Units",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="EngineTraceChannel1",Response=ECR_Ignore),(Channel="EngineTraceChannel2",Response=ECR_Ignore),(Channel="EngineTraceChannel3",Response=ECR_Ignore),(Channel="EngineTraceChannel4",Response=ECR_Ignore),(Channel="EngineTraceChannel5",Response=ECR_Ignore),(Channel="EngineTraceChannel6",Response=ECR_Ignore),(Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Ignore),(Channel="GameTraceChannel7",Response=ECR_Ignore),(Channel="GameTraceChannel8",Response=ECR_Ignore),(Channel="GameTraceChannel9",Response=ECR_Ignore),(Channel="GameTraceChannel10",Response=ECR_Ignore),(Channel="GameTraceChannel11",Response=ECR_Ignore),(Channel="GameTraceChannel12",Response=ECR_Ignore),(Channel="GameTraceChannel13",Response=ECR_Ignore),(Channel="GameTraceChannel14",Response=ECR_Ignore),(Channel="GameTraceChannel15",Response=ECR_Ignore),(Channel="GameTraceChannel16",Response=ECR_Ignore),(Channel="GameTraceChannel17",Response=ECR_Ignore),(Channel="GameTraceChannel18",Response=ECR_Ignore)),HelpMessage="For Player only Overlap",bCanModify=True)
|
||||
+Profiles=(Name="Players",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Players",CustomResponses=((Channel="Trigger",Response=ECR_Overlap),(Channel="Projectile",Response=ECR_Overlap),(Channel="ProjectileUnitsOnly",Response=ECR_Overlap)),HelpMessage="Players",bCanModify=True)
|
||||
+Profiles=(Name="Ghosts",CollisionEnabled=QueryAndPhysics,ObjectTypeName="Ghost",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Trigger",Response=ECR_Overlap),(Channel="Projectile",Response=ECR_Overlap),(Channel="Players",Response=ECR_Ignore)),HelpMessage="Ghosts",bCanModify=True)
|
||||
+Profiles=(Name="GhostOverlap",CollisionEnabled=QueryOnly,ObjectTypeName="Units",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="EngineTraceChannel1",Response=ECR_Ignore),(Channel="EngineTraceChannel2",Response=ECR_Ignore),(Channel="EngineTraceChannel3",Response=ECR_Ignore),(Channel="EngineTraceChannel4",Response=ECR_Ignore),(Channel="EngineTraceChannel5",Response=ECR_Ignore),(Channel="EngineTraceChannel6",Response=ECR_Ignore),(Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Ignore),(Channel="Ghost",Response=ECR_Overlap),(Channel="GameTraceChannel7",Response=ECR_Ignore),(Channel="GameTraceChannel8",Response=ECR_Ignore),(Channel="GameTraceChannel9",Response=ECR_Ignore),(Channel="GameTraceChannel10",Response=ECR_Ignore),(Channel="GameTraceChannel11",Response=ECR_Ignore),(Channel="GameTraceChannel12",Response=ECR_Ignore),(Channel="GameTraceChannel13",Response=ECR_Ignore),(Channel="GameTraceChannel14",Response=ECR_Ignore),(Channel="GameTraceChannel15",Response=ECR_Ignore),(Channel="GameTraceChannel16",Response=ECR_Ignore),(Channel="GameTraceChannel17",Response=ECR_Ignore),(Channel="GameTraceChannel18",Response=ECR_Ignore)),HelpMessage="For Ghost only Overlap",bCanModify=True)
|
||||
+Profiles=(Name="ProjectileUnitsOnly",CollisionEnabled=QueryAndPhysics,ObjectTypeName="ProjectileUnitsOnly",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="WorldDynamic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="EngineTraceChannel1",Response=ECR_Ignore),(Channel="EngineTraceChannel2",Response=ECR_Ignore),(Channel="EngineTraceChannel3",Response=ECR_Ignore),(Channel="EngineTraceChannel4",Response=ECR_Ignore),(Channel="EngineTraceChannel5",Response=ECR_Ignore),(Channel="EngineTraceChannel6",Response=ECR_Ignore),(Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Ignore),(Channel="GameTraceChannel9",Response=ECR_Ignore),(Channel="GameTraceChannel10",Response=ECR_Ignore),(Channel="GameTraceChannel11",Response=ECR_Ignore),(Channel="GameTraceChannel12",Response=ECR_Ignore),(Channel="GameTraceChannel13",Response=ECR_Ignore),(Channel="GameTraceChannel14",Response=ECR_Ignore),(Channel="GameTraceChannel15",Response=ECR_Ignore),(Channel="GameTraceChannel16",Response=ECR_Ignore),(Channel="GameTraceChannel17",Response=ECR_Ignore),(Channel="GameTraceChannel18",Response=ECR_Ignore)),HelpMessage="Needs description",bCanModify=True)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,Name="Units",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,Name="Trigger",DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,Name="Projectile",DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel4,Name="Players",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel5,Name="Dash",DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel6,Name="Ghost",DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel7,Name="Hover",DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False)
|
||||
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel8,Name="ProjectileUnitsOnly",DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False)
|
||||
+EditProfiles=(Name="OverlapAll",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Overlap)))
|
||||
+EditProfiles=(Name="OverlapAllDynamic",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Overlap)))
|
||||
+EditProfiles=(Name="IgnoreOnlyPawn",CustomResponses=((Channel="Units",Response=ECR_Ignore),(Channel="Players",Response=ECR_Ignore),(Channel="Dash",Response=ECR_Ignore),(Channel="Ghost",Response=ECR_Ignore)))
|
||||
+EditProfiles=(Name="OverlapOnlyPawn",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Overlap)))
|
||||
+EditProfiles=(Name="Spectator",CustomResponses=((Channel="Units",Response=ECR_Ignore),(Channel="Players",Response=ECR_Ignore),(Channel="Dash",Response=ECR_Ignore),(Channel="Ghost",Response=ECR_Ignore)))
|
||||
+EditProfiles=(Name="CharacterMesh",CustomResponses=((Channel="Units",Response=ECR_Ignore),(Channel="Players",Response=ECR_Ignore),(Channel="Ghost",Response=ECR_Ignore)))
|
||||
+EditProfiles=(Name="Trigger",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Overlap)))
|
||||
+EditProfiles=(Name="Ragdoll",CustomResponses=((Channel="Units",Response=ECR_Ignore),(Channel="Players",Response=ECR_Ignore),(Channel="Ghost",Response=ECR_Ignore)))
|
||||
+EditProfiles=(Name="UI",CustomResponses=((Channel="Units",Response=ECR_Overlap),(Channel="Players",Response=ECR_Overlap),(Channel="Ghost",Response=ECR_Overlap)))
|
||||
+EditProfiles=(Name="BlockAll",CustomResponses=((Channel="Projectile"),(Channel="Dash"),(Channel="Hover")))
|
||||
-ProfileRedirects=(OldName="BlockingVolume",NewName="InvisibleWall")
|
||||
-ProfileRedirects=(OldName="InterpActor",NewName="IgnoreOnlyPawn")
|
||||
-ProfileRedirects=(OldName="StaticMeshComponent",NewName="BlockAllDynamic")
|
||||
-ProfileRedirects=(OldName="SkeletalMeshActor",NewName="PhysicsActor")
|
||||
-ProfileRedirects=(OldName="InvisibleActor",NewName="InvisibleWallDynamic")
|
||||
+ProfileRedirects=(OldName="BlockingVolume",NewName="InvisibleWall")
|
||||
+ProfileRedirects=(OldName="InterpActor",NewName="IgnoreOnlyPawn")
|
||||
+ProfileRedirects=(OldName="StaticMeshComponent",NewName="BlockAllDynamic")
|
||||
+ProfileRedirects=(OldName="SkeletalMeshActor",NewName="PhysicsActor")
|
||||
+ProfileRedirects=(OldName="InvisibleActor",NewName="InvisibleWallDynamic")
|
||||
+ProfileRedirects=(OldName="UnitOverlap",NewName="PlayerOverlap")
|
||||
+ProfileRedirects=(OldName="projectiles",NewName="Projectiles")
|
||||
+ProfileRedirects=(OldName="Ghost",NewName="Ghosts")
|
||||
-CollisionChannelRedirects=(OldName="Static",NewName="WorldStatic")
|
||||
-CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic")
|
||||
-CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
|
||||
-CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
|
||||
+CollisionChannelRedirects=(OldName="Static",NewName="WorldStatic")
|
||||
+CollisionChannelRedirects=(OldName="Dynamic",NewName="WorldDynamic")
|
||||
+CollisionChannelRedirects=(OldName="VehicleMovement",NewName="Vehicle")
|
||||
+CollisionChannelRedirects=(OldName="PawnMovement",NewName="Pawn")
|
||||
|
||||
[/Script/Engine.UserInterfaceSettings]
|
||||
RenderFocusRule=Never
|
||||
DefaultCursor=None
|
||||
TextEditBeamCursor=None
|
||||
CrosshairsCursor=None
|
||||
GrabHandCursor=None
|
||||
GrabHandClosedCursor=None
|
||||
SlashedCircleCursor=None
|
||||
ApplicationScale=1.000000
|
||||
UIScaleRule=ShortestSide
|
||||
CustomScalingRuleClass=None
|
||||
UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000)),DefaultValue=340282346638528859811704183484516925440.000000),ExternalCurve=None)
|
||||
|
||||
[/Script/Engine.RendererSettings]
|
||||
r.MobileHDR=True
|
||||
r.MobileNumDynamicPointLights=4
|
||||
r.MobileDynamicPointLightsUseStaticBranch=True
|
||||
r.DiscardUnusedQuality=False
|
||||
r.AllowOcclusionQueries=True
|
||||
r.MinScreenRadiusForLights=0.030000
|
||||
r.MinScreenRadiusForDepthPrepass=0.030000
|
||||
r.MinScreenRadiusForCSMDepth=0.010000
|
||||
r.PrecomputedVisibilityWarning=False
|
||||
r.TextureStreaming=True
|
||||
Compat.UseDXT5NormalMaps=False
|
||||
r.AllowStaticLighting=True
|
||||
r.NormalMapsForStaticLighting=False
|
||||
r.GenerateMeshDistanceFields=True
|
||||
r.GenerateLandscapeGIData=True
|
||||
r.TessellationAdaptivePixelsPerTriangle=48.000000
|
||||
r.SeparateTranslucency=True
|
||||
r.TranslucentSortPolicy=0
|
||||
TranslucentSortAxis=(X=0.000000,Y=-1.000000,Z=0.000000)
|
||||
r.CustomDepth=3
|
||||
r.DefaultFeature.Bloom=True
|
||||
r.DefaultFeature.AmbientOcclusion=True
|
||||
r.DefaultFeature.AmbientOcclusionStaticFraction=True
|
||||
r.DefaultFeature.AutoExposure=True
|
||||
r.DefaultFeature.MotionBlur=True
|
||||
r.DefaultFeature.LensFlare=True
|
||||
r.DefaultFeature.AntiAliasing=2
|
||||
r.EarlyZPass=3
|
||||
r.EarlyZPassMovable=False
|
||||
r.DBuffer=False
|
||||
r.ClearSceneMethod=1
|
||||
r.BasePassOutputsVelocity=False
|
||||
r.SelectiveBasePassOutputs=False
|
||||
vr.InstancedStereo=False
|
||||
r.WireframeCullThreshold=5.000000
|
||||
UIScaleRule=ShortestSide
|
||||
UIScaleCurve=(EditorCurveData=(PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant,Keys=,DefaultValue=340282346638528859811704183484516925440.000000),ExternalCurve=None)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[/Script/EngineSettings.GeneralProjectSettings]
|
||||
ProjectID=D0D6694C4B67A9CEF3373094611BE2F1
|
||||
ProjectName=
|
||||
CopyrightNotice=Project Lab - NHTV Igad
|
||||
|
||||
[/Script/UnrealProject.DefaultPlayer]
|
||||
RespawnDelay = 5.0f
|
||||
[/Script/UnrealProject.KingOfTheHillGameMode]
|
||||
MaxGameScore = 120.0f
|
||||
|
||||
[/Script/UnrealProject.DefaultGameInstance]
|
||||
MenuRevision = 123299
|
||||
|
||||
[/Script/UnrealEd.ProjectPackagingSettings]
|
||||
IncludeCrashReporter=False
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
[/Script/Engine.InputSettings]
|
||||
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
|
||||
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
|
||||
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
|
||||
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
|
||||
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
|
||||
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
|
||||
bAltEnterTogglesFullscreen=True
|
||||
bUseMouseForTouch=False
|
||||
bEnableMouseSmoothing=True
|
||||
bEnableFOVScaling=True
|
||||
FOVScale=0.011110
|
||||
DoubleClickTime=0.200000
|
||||
+ActionMappings=(ActionName="RightMouse",Key=RightMouseButton,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="ToggleMenu",Key=Zero,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="ToggleMenu",Key=Escape,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility1",Key=Q,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility2",Key=W,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility3",Key=E,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="HoldPosition",Key=LeftShift,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility4",Key=R,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility5",Key=One,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility6",Key=Two,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility7",Key=Three,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="CastAbility8",Key=Four,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="LeftMouse",Key=LeftMouseButton,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="ToggleSkillTree",Key=P,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
+ActionMappings=(ActionName="Attack",Key=LeftMouseButton,bShift=False,bCtrl=False,bAlt=False,bCmd=False)
|
||||
bAlwaysShowTouchInterface=False
|
||||
bShowConsoleOnFourFingerTap=True
|
||||
DefaultTouchInterface=None
|
||||
ConsoleKey=None
|
||||
-ConsoleKeys=Tilde
|
||||
+ConsoleKeys=Tilde
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
#ifndef _HEADER_MATCHMAKING
|
||||
#define _HEADER_MATCHMAKING
|
||||
|
||||
#include <string>
|
||||
using std::wstring;
|
||||
|
||||
typedef unsigned long long NetID;
|
||||
typedef signed int ChannelID;
|
||||
|
||||
enum class ConnectionState
|
||||
{
|
||||
Invalid = -1,
|
||||
Disconnected = 0,
|
||||
Connecting = 1,
|
||||
Connected = 2,
|
||||
};
|
||||
|
||||
class MatchMakingImpl;
|
||||
class IMatchMakingInterface
|
||||
{
|
||||
protected:
|
||||
IMatchMakingInterface(NetID netId);
|
||||
|
||||
public:
|
||||
virtual ~IMatchMakingInterface();
|
||||
|
||||
void Tick();
|
||||
|
||||
ConnectionState GetState() const;
|
||||
bool IsConnected() const;
|
||||
|
||||
bool HostMatch(ChannelID channel);
|
||||
bool DestroyMatch();
|
||||
|
||||
virtual void OnConnect() = 0;
|
||||
virtual void OnDisconnect() = 0;
|
||||
virtual void OnForceJoinSession(NetID netId, ChannelID channelID) = 0;
|
||||
|
||||
private:
|
||||
MatchMakingImpl* m_impl;
|
||||
|
||||
IMatchMakingInterface(const IMatchMakingInterface& other) = delete;
|
||||
IMatchMakingInterface& operator=(const IMatchMakingInterface& other) = delete;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"FileVersion": 1,
|
||||
"Version": 1,
|
||||
"VersionName": "1.0",
|
||||
"FriendlyName": "Custom Blueprints Plugin",
|
||||
"Description": "A plugin for ability system blueprint nodes",
|
||||
"Category": "Abilities",
|
||||
"CreatedBy": "Guus Waals",
|
||||
"CreatedByURL": "http://www.tdrz.nl/",
|
||||
"DocsURL": "http://www.tdrz.nl/portfolio.html",
|
||||
"MarketplaceURL": "",
|
||||
"SupportURL": "http://www.tdrz.nl/portfolio.html",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "CustomBlueprintsEditor",
|
||||
"Type": "Developer",
|
||||
"LoadingPhase": "PreDefault"
|
||||
}
|
||||
],
|
||||
"EnabledByDefault": false,
|
||||
"CanContainContent": true,
|
||||
"IsBetaVersion": false,
|
||||
"Installed": false
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -0,0 +1,39 @@
|
|||
namespace UnrealBuildTool.Rules
|
||||
{
|
||||
public class CustomBlueprintsEditor : ModuleRules
|
||||
{
|
||||
public CustomBlueprintsEditor(TargetInfo Target)
|
||||
{
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
"Editor/BlueprintGraph/Private",
|
||||
"Editor/KismetCompiler/Public",
|
||||
}
|
||||
);
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[] {
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"InputCore",
|
||||
"Slate",
|
||||
"EditorStyle",
|
||||
"AIModule",
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[] {
|
||||
"EditorStyle",
|
||||
"KismetCompiler",
|
||||
"UnrealEd",
|
||||
"GraphEditor",
|
||||
"SlateCore",
|
||||
"Kismet",
|
||||
"BlueprintGraph"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
#include "CustomBlueprintsEditor.h"
|
||||
|
||||
class UClass* characterClass = nullptr;
|
||||
class UClass* abilityTriggerClass = nullptr;
|
||||
class UClass* abilityGroupClass = nullptr;
|
||||
class UClass* projectileClass = nullptr;
|
||||
class UClass* modifierClass = nullptr;
|
||||
class UClass* libClass = nullptr;
|
||||
|
||||
void LoadDependencies()
|
||||
{
|
||||
libClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.Lib");
|
||||
characterClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.NetworkCharacter");
|
||||
abilityGroupClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.AbilityEventGroup");
|
||||
abilityTriggerClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.AbilityTriggerBase");
|
||||
projectileClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.ProjectileBase");
|
||||
modifierClass = FindObject<UClass>(ANY_PACKAGE, L"/Script/UnrealProject.Modifier");
|
||||
//printf("\nhoi %p\n%p\n%p\n%p\n%p\n%p\n", libClass, characterClass, abilityGroupClass, abilityTriggerClass, projectileClass, modifierClass);
|
||||
}
|
||||
|
||||
class FCustomBlueprintsEditor : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
/** IModuleInterface implementation */
|
||||
virtual void StartupModule() override
|
||||
{
|
||||
auto module = FModuleManager::LoadModuleChecked<IModuleInterface>("UnrealProject");
|
||||
FModuleManager& moduleManager = FModuleManager::Get();
|
||||
bool ok = moduleManager.DoesLoadedModuleHaveUObjects(L"UnrealProject");
|
||||
|
||||
LoadDependencies();
|
||||
// Class'/Script/UnrealProject.Lib'
|
||||
// Class'/Script/UnrealProject.AbilityEventGroup'
|
||||
// Class'/Script/UnrealProject.AbilityTriggerBase'
|
||||
// Class'/Script/UnrealProject.ProjectileBase'
|
||||
// Class'/Script/UnrealProject.Modifier'
|
||||
|
||||
}
|
||||
virtual void ShutdownModule() override
|
||||
{
|
||||
}
|
||||
private:
|
||||
};
|
||||
|
||||
IMPLEMENT_MODULE(FCustomBlueprintsEditor, CustomBlueprintsEditor)
|
|
@ -0,0 +1,7 @@
|
|||
// Project Lab - NHTV Igad
|
||||
|
||||
#pragma once
|
||||
#include "EngineMinimal.h"
|
||||
#include "ModuleManager.h"
|
||||
|
||||
void LoadDependencies();
|
|
@ -0,0 +1 @@
|
|||
#include "CustomBlueprintsEditor.h"
|
|
@ -0,0 +1,11 @@
|
|||
// Project Lab - NHTV Igad
|
||||
|
||||
#pragma once
|
||||
#include "EngineMinimal.h"
|
||||
|
||||
extern class UClass* characterClass;
|
||||
extern class UClass* abilityTriggerClass;
|
||||
extern class UClass* abilityGroupClass;
|
||||
extern class UClass* projectileClass;
|
||||
extern class UClass* modifierClass;
|
||||
extern class UClass* libClass;
|
|
@ -0,0 +1,560 @@
|
|||
#include "CustomBlueprintsEditor.h"
|
||||
#include "SpawnActorBaseNode.h"
|
||||
#include "Globals.h"
|
||||
#include "BlueprintEditorUtils.h"
|
||||
#include "BlueprintActionDatabaseRegistrar.h"
|
||||
#include "BlueprintNodeSpawner.h"
|
||||
|
||||
struct FK2Node_SpawnActorFromClassHelper
|
||||
{
|
||||
static FString WorldContextPinName;
|
||||
static FString ClassPinName;
|
||||
static FString SpawnTransformPinName;
|
||||
static FString TargetPinName;
|
||||
};
|
||||
|
||||
FString FK2Node_SpawnActorFromClassHelper::WorldContextPinName(TEXT("WorldContextObject"));
|
||||
FString FK2Node_SpawnActorFromClassHelper::ClassPinName(TEXT("Class"));
|
||||
FString FK2Node_SpawnActorFromClassHelper::SpawnTransformPinName(TEXT("SpawnTransform"));
|
||||
FString FK2Node_SpawnActorFromClassHelper::TargetPinName(TEXT("Target"));
|
||||
|
||||
#define FMT_TEXT(__x) FText::FromString(FString() + __x)
|
||||
|
||||
UK2Node_SpawnActorBaseNode::UK2Node_SpawnActorBaseNode(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
NodeTooltip = FMT_TEXT("Oh Nooooos");
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::AllocateDefaultPins()
|
||||
{
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
// Add execution pins
|
||||
CreatePin(EGPD_Input, K2Schema->PC_Exec, TEXT(""), NULL, false, false, K2Schema->PN_Execute);
|
||||
CreatePin(EGPD_Output, K2Schema->PC_Exec, TEXT(""), NULL, false, false, K2Schema->PN_Then);
|
||||
|
||||
// If required add the world context pin
|
||||
if(GetBlueprint()->ParentClass->HasMetaData(FBlueprintMetadata::MD_ShowWorldContextPin))
|
||||
{
|
||||
CreatePin(EGPD_Input, K2Schema->PC_Object, TEXT(""), UObject::StaticClass(), false, false, FK2Node_SpawnActorFromClassHelper::WorldContextPinName);
|
||||
}
|
||||
|
||||
// Add blueprint pin
|
||||
UEdGraphPin* ClassPin = CreatePin(EGPD_Input, K2Schema->PC_Class, TEXT(""), GetActorClass(), false, false, FK2Node_SpawnActorFromClassHelper::ClassPinName);
|
||||
K2Schema->ConstructBasicPinTooltip(*ClassPin, FMT_TEXT("The " + GetObjectName() + " you want to spawn"), ClassPin->PinToolTip);
|
||||
|
||||
// Transform pin
|
||||
if(SpawningFunctionHasTransform())
|
||||
{
|
||||
UScriptStruct* TransformStruct = TBaseStructure<FTransform>::Get();
|
||||
UEdGraphPin* TransformPin = CreatePin(EGPD_Input, K2Schema->PC_Struct, TEXT(""), TransformStruct, false, false, FK2Node_SpawnActorFromClassHelper::SpawnTransformPinName);
|
||||
K2Schema->ConstructBasicPinTooltip(*TransformPin, FMT_TEXT("The transform to spawn the " + GetObjectName() + " with"), TransformPin->PinToolTip);
|
||||
}
|
||||
|
||||
// Result pin
|
||||
UEdGraphPin* ResultPin = CreatePin(EGPD_Output, K2Schema->PC_Object, TEXT(""), GetActorClass(), false, false, K2Schema->PN_ReturnValue);
|
||||
K2Schema->ConstructBasicPinTooltip(*ResultPin, FMT_TEXT("The spawned " + GetObjectName()), ResultPin->PinToolTip);
|
||||
|
||||
RegisterAdditionalPins(K2Schema);
|
||||
|
||||
Super::AllocateDefaultPins();
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::CreatePinsForClass(UClass* InClass, TArray<UEdGraphPin*>& OutClassPins)
|
||||
{
|
||||
check(InClass != NULL);
|
||||
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
const UObject* const ClassDefaultObject = InClass->GetDefaultObject(false);
|
||||
|
||||
for(TFieldIterator<UProperty> PropertyIt(InClass, EFieldIteratorFlags::IncludeSuper); PropertyIt; ++PropertyIt)
|
||||
{
|
||||
UProperty* Property = *PropertyIt;
|
||||
UClass* PropertyClass = CastChecked<UClass>(Property->GetOuter());
|
||||
const bool bIsDelegate = Property->IsA(UMulticastDelegateProperty::StaticClass());
|
||||
const bool bIsExposedToSpawn = UEdGraphSchema_K2::IsPropertyExposedOnSpawn(Property);
|
||||
const bool bIsSettableExternally = !Property->HasAnyPropertyFlags(CPF_DisableEditOnInstance);
|
||||
|
||||
if(bIsExposedToSpawn &&
|
||||
!Property->HasAnyPropertyFlags(CPF_Parm) &&
|
||||
bIsSettableExternally &&
|
||||
Property->HasAllPropertyFlags(CPF_BlueprintVisible) &&
|
||||
!bIsDelegate &&
|
||||
(NULL == FindPin(Property->GetName())))
|
||||
{
|
||||
UEdGraphPin* Pin = CreatePin(EGPD_Input, TEXT(""), TEXT(""), NULL, false, false, Property->GetName());
|
||||
const bool bPinGood = (Pin != NULL) && K2Schema->ConvertPropertyToPinType(Property, Pin->PinType);
|
||||
OutClassPins.Add(Pin);
|
||||
|
||||
if(ClassDefaultObject && Pin != NULL && K2Schema->PinDefaultValueIsEditable(*Pin))
|
||||
{
|
||||
FString DefaultValueAsString;
|
||||
const bool bDefaultValueSet = FBlueprintEditorUtils::PropertyValueToString(Property, reinterpret_cast<const uint8*>(ClassDefaultObject), DefaultValueAsString);
|
||||
check(bDefaultValueSet);
|
||||
K2Schema->TrySetDefaultValue(*Pin, DefaultValueAsString);
|
||||
}
|
||||
|
||||
// Copy tooltip from the property.
|
||||
if(Pin != nullptr)
|
||||
{
|
||||
K2Schema->ConstructBasicPinTooltip(*Pin, Property->GetToolTipText(), Pin->PinToolTip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Change class of output pin
|
||||
UEdGraphPin* ResultPin = GetResultPin();
|
||||
ResultPin->PinType.PinSubCategoryObject = InClass;
|
||||
}
|
||||
UClass* UK2Node_SpawnActorBaseNode::GetClassToSpawn(const TArray<UEdGraphPin*>* InPinsToSearch) const
|
||||
{
|
||||
UClass* UseSpawnClass = nullptr;
|
||||
const TArray<UEdGraphPin*>* PinsToSearch = InPinsToSearch ? InPinsToSearch : &Pins;
|
||||
|
||||
UEdGraphPin* ClassPin = GetClassPin(PinsToSearch);
|
||||
if(ClassPin && ClassPin->DefaultObject != NULL && ClassPin->LinkedTo.Num() == 0)
|
||||
{
|
||||
UseSpawnClass = CastChecked<UClass>(ClassPin->DefaultObject);
|
||||
}
|
||||
else if(ClassPin && (1 == ClassPin->LinkedTo.Num()))
|
||||
{
|
||||
auto SourcePin = ClassPin->LinkedTo[0];
|
||||
UseSpawnClass = SourcePin ? Cast<UClass>(SourcePin->PinType.PinSubCategoryObject.Get()) : nullptr;
|
||||
}
|
||||
|
||||
return UseSpawnClass;
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::ReallocatePinsDuringReconstruction(TArray<UEdGraphPin*>& OldPins)
|
||||
{
|
||||
AllocateDefaultPins();
|
||||
UClass* UseSpawnClass = GetClassToSpawn(&OldPins);
|
||||
|
||||
if(UseSpawnClass != NULL)
|
||||
{
|
||||
// Reassign class pin
|
||||
UEdGraphPin* newClassPin = FindPinChecked(FK2Node_SpawnActorFromClassHelper::ClassPinName);
|
||||
newClassPin->DefaultObject = UseSpawnClass;
|
||||
|
||||
TArray<UEdGraphPin*> ClassPins;
|
||||
CreatePinsForClass(UseSpawnClass, ClassPins);
|
||||
}
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::PostPlacedNewNode()
|
||||
{
|
||||
Super::PostPlacedNewNode();
|
||||
|
||||
UClass* UseSpawnClass = GetClassToSpawn();
|
||||
if(UseSpawnClass != NULL)
|
||||
{
|
||||
TArray<UEdGraphPin*> ClassPins;
|
||||
CreatePinsForClass(UseSpawnClass, ClassPins);
|
||||
}
|
||||
}
|
||||
bool UK2Node_SpawnActorBaseNode::IsSpawnVarPin(UEdGraphPin* Pin)
|
||||
{
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
UEdGraphPin* ParentPin = Pin->ParentPin;
|
||||
while(ParentPin)
|
||||
{
|
||||
if(ParentPin->PinName == FK2Node_SpawnActorFromClassHelper::SpawnTransformPinName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ParentPin = ParentPin->ParentPin;
|
||||
}
|
||||
|
||||
return(Pin->PinName != K2Schema->PN_Execute &&
|
||||
Pin->PinName != K2Schema->PN_Then &&
|
||||
Pin->PinName != K2Schema->PN_ReturnValue &&
|
||||
Pin->PinName != FK2Node_SpawnActorFromClassHelper::ClassPinName &&
|
||||
Pin->PinName != FK2Node_SpawnActorFromClassHelper::WorldContextPinName &&
|
||||
Pin->PinName != FK2Node_SpawnActorFromClassHelper::SpawnTransformPinName &&
|
||||
Pin->PinName != FK2Node_SpawnActorFromClassHelper::TargetPinName &&
|
||||
!IsAdditionalPin(Pin));
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::OnClassPinChanged()
|
||||
{
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
// Remove all pins related to archetype variables
|
||||
TArray<UEdGraphPin*> OldPins = Pins;
|
||||
TArray<UEdGraphPin*> OldClassPins;
|
||||
|
||||
for(int32 i = 0; i < OldPins.Num(); i++)
|
||||
{
|
||||
UEdGraphPin* OldPin = OldPins[i];
|
||||
if(IsSpawnVarPin(OldPin))
|
||||
{
|
||||
Pins.Remove(OldPin);
|
||||
OldClassPins.Add(OldPin);
|
||||
}
|
||||
}
|
||||
|
||||
m_cachedNodeTitle.MarkDirty();
|
||||
|
||||
UClass* UseSpawnClass = GetClassToSpawn();
|
||||
TArray<UEdGraphPin*> NewClassPins;
|
||||
if(UseSpawnClass != NULL)
|
||||
{
|
||||
CreatePinsForClass(UseSpawnClass, NewClassPins);
|
||||
}
|
||||
|
||||
UEdGraphPin* ResultPin = GetResultPin();
|
||||
// Cache all the pin connections to the ResultPin, we will attempt to recreate them
|
||||
TArray<UEdGraphPin*> ResultPinConnectionList = ResultPin->LinkedTo;
|
||||
// Because the archetype has changed, we break the output link as the output pin type will change
|
||||
ResultPin->BreakAllPinLinks();
|
||||
|
||||
// Recreate any pin links to the Result pin that are still valid
|
||||
for(UEdGraphPin* Connections : ResultPinConnectionList)
|
||||
{
|
||||
K2Schema->TryCreateConnection(ResultPin, Connections);
|
||||
}
|
||||
|
||||
K2Schema->ConstructBasicPinTooltip(*ResultPin, FMT_TEXT("The spawned " + GetObjectName()), ResultPin->PinToolTip);
|
||||
|
||||
// Rewire the old pins to the new pins so connections are maintained if possible
|
||||
RewireOldPinsToNewPins(OldClassPins, NewClassPins);
|
||||
|
||||
// Destroy the old pins
|
||||
DestroyPinList(OldClassPins);
|
||||
|
||||
// Refresh the UI for the graph so the pin changes show up
|
||||
UEdGraph* Graph = GetGraph();
|
||||
Graph->NotifyGraphChanged();
|
||||
|
||||
// Mark dirty
|
||||
FBlueprintEditorUtils::MarkBlueprintAsModified(GetBlueprint());
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::PinConnectionListChanged(UEdGraphPin* ChangedPin)
|
||||
{
|
||||
if(ChangedPin && (ChangedPin->PinName == FK2Node_SpawnActorFromClassHelper::ClassPinName))
|
||||
{
|
||||
OnClassPinChanged();
|
||||
}
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::PinDefaultValueChanged(UEdGraphPin* ChangedPin)
|
||||
{
|
||||
if(ChangedPin && (ChangedPin->PinName == FK2Node_SpawnActorFromClassHelper::ClassPinName))
|
||||
{
|
||||
OnClassPinChanged();
|
||||
}
|
||||
}
|
||||
FText UK2Node_SpawnActorBaseNode::GetTooltipText() const
|
||||
{
|
||||
return NodeTooltip;
|
||||
}
|
||||
UEdGraphPin* UK2Node_SpawnActorBaseNode::GetThenPin()const
|
||||
{
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
UEdGraphPin* Pin = FindPinChecked(K2Schema->PN_Then);
|
||||
check(Pin->Direction == EGPD_Output);
|
||||
return Pin;
|
||||
}
|
||||
UEdGraphPin* UK2Node_SpawnActorBaseNode::GetClassPin(const TArray<UEdGraphPin*>* InPinsToSearch) const
|
||||
{
|
||||
const TArray<UEdGraphPin*>* PinsToSearch = InPinsToSearch ? InPinsToSearch : &Pins;
|
||||
|
||||
UEdGraphPin* Pin = NULL;
|
||||
for(auto PinIt = PinsToSearch->CreateConstIterator(); PinIt; ++PinIt)
|
||||
{
|
||||
UEdGraphPin* TestPin = *PinIt;
|
||||
if(TestPin && TestPin->PinName == FK2Node_SpawnActorFromClassHelper::ClassPinName)
|
||||
{
|
||||
Pin = TestPin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
check(Pin == NULL || Pin->Direction == EGPD_Input);
|
||||
return Pin;
|
||||
}
|
||||
UEdGraphPin* UK2Node_SpawnActorBaseNode::GetSpawnTransformPin() const
|
||||
{
|
||||
UEdGraphPin* Pin = FindPinChecked(FK2Node_SpawnActorFromClassHelper::SpawnTransformPinName);
|
||||
check(Pin->Direction == EGPD_Input);
|
||||
return Pin;
|
||||
}
|
||||
UEdGraphPin* UK2Node_SpawnActorBaseNode::GetWorldContextPin() const
|
||||
{
|
||||
UEdGraphPin* Pin = FindPin(FK2Node_SpawnActorFromClassHelper::WorldContextPinName);
|
||||
check(Pin == NULL || Pin->Direction == EGPD_Input);
|
||||
return Pin;
|
||||
}
|
||||
UEdGraphPin* UK2Node_SpawnActorBaseNode::GetResultPin() const
|
||||
{
|
||||
const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();
|
||||
|
||||
UEdGraphPin* Pin = FindPinChecked(K2Schema->PN_ReturnValue);
|
||||
check(Pin->Direction == EGPD_Output);
|
||||
return Pin;
|
||||
}
|
||||
FLinearColor UK2Node_SpawnActorBaseNode::GetNodeTitleColor() const
|
||||
{
|
||||
return Super::GetNodeTitleColor();
|
||||
}
|
||||
FText UK2Node_SpawnActorBaseNode::GetNodeTitle(ENodeTitleType::Type TitleType) const
|
||||
{
|
||||
FText NodeTitle = FMT_TEXT("Spawn " + GetObjectName() + " from Class");
|
||||
if(TitleType != ENodeTitleType::MenuTitle)
|
||||
{
|
||||
if(UEdGraphPin* ClassPin = FindPin(FK2Node_SpawnActorFromClassHelper::ClassPinName))
|
||||
{
|
||||
if(ClassPin->LinkedTo.Num() > 0)
|
||||
{
|
||||
// Blueprint will be determined dynamically, so we don't have the name in this case
|
||||
NodeTitle = FMT_TEXT("Spawn " + GetObjectName());
|
||||
}
|
||||
else if(ClassPin->DefaultObject == nullptr)
|
||||
{
|
||||
NodeTitle = FMT_TEXT("Spawn " + GetObjectName() + " NONE");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_cachedNodeTitle.IsOutOfDate(this))
|
||||
{
|
||||
FText ClassName;
|
||||
if(UClass* PickedClass = Cast<UClass>(ClassPin->DefaultObject))
|
||||
{
|
||||
ClassName = PickedClass->GetDisplayNameText();
|
||||
}
|
||||
|
||||
FFormatNamedArguments Args;
|
||||
Args.Add(TEXT("ClassName"), ClassName);
|
||||
|
||||
// FText::Format() is slow, so we cache this to save on performance
|
||||
m_cachedNodeTitle.SetCachedText(FText::Format(FMT_TEXT("Spawn {ClassName}"), Args), this);
|
||||
}
|
||||
NodeTitle = m_cachedNodeTitle;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NodeTitle = FMT_TEXT(GetObjectName() + " NONE");
|
||||
}
|
||||
}
|
||||
return NodeTitle;
|
||||
}
|
||||
bool UK2Node_SpawnActorBaseNode::IsCompatibleWithGraph(const UEdGraph* TargetGraph) const
|
||||
{
|
||||
UBlueprint* Blueprint = FBlueprintEditorUtils::FindBlueprintForGraph(TargetGraph);
|
||||
return Super::IsCompatibleWithGraph(TargetGraph) && (!Blueprint || FBlueprintEditorUtils::FindUserConstructionScript(Blueprint) != TargetGraph);
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::GetNodeAttributes(TArray<TKeyValuePair<FString, FString>>& OutNodeAttributes) const
|
||||
{
|
||||
UClass* ClassToSpawn = GetClassToSpawn();
|
||||
const FString ClassToSpawnStr = ClassToSpawn ? ClassToSpawn->GetName() : TEXT("InvalidClass");
|
||||
OutNodeAttributes.Add(TKeyValuePair<FString, FString>(TEXT("Type"), FString() + "Spawn" + GetObjectName() + "FromClass"));
|
||||
OutNodeAttributes.Add(TKeyValuePair<FString, FString>(TEXT("Class"), GetClass()->GetName()));
|
||||
OutNodeAttributes.Add(TKeyValuePair<FString, FString>(TEXT("Name"), GetName()));
|
||||
OutNodeAttributes.Add(TKeyValuePair<FString, FString>(TEXT("ActorClass"), ClassToSpawnStr));
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const
|
||||
{
|
||||
// actions get registered under specific object-keys; the idea is that
|
||||
// actions might have to be updated (or deleted) if their object-key is
|
||||
// mutated (or removed)... here we use the node's class (so if the node
|
||||
// type disappears, then the action should go with it)
|
||||
UClass* ActionKey = GetClass();
|
||||
//// to keep from needlessly instantiating a UBlueprintNodeSpawner, first
|
||||
//// check to make sure that the registrar is looking for actions of this type
|
||||
//// (could be regenerating actions for a specific asset, and therefore the
|
||||
//// registrar would only accept actions corresponding to that asset)
|
||||
if(ActionRegistrar.IsOpenForRegistration(ActionKey))
|
||||
{
|
||||
UBlueprintNodeSpawner* NodeSpawner = UBlueprintNodeSpawner::Create(GetClass());
|
||||
check(NodeSpawner != nullptr);
|
||||
|
||||
ActionRegistrar.AddBlueprintAction(ActionKey, NodeSpawner);
|
||||
}
|
||||
}
|
||||
FText UK2Node_SpawnActorBaseNode::GetMenuCategory() const
|
||||
{
|
||||
return FMT_TEXT("Ability");
|
||||
}
|
||||
FNodeHandlingFunctor* UK2Node_SpawnActorBaseNode::CreateNodeHandler(FKismetCompilerContext& CompilerContext) const
|
||||
{
|
||||
return new FNodeHandlingFunctor(CompilerContext);
|
||||
}
|
||||
void UK2Node_SpawnActorBaseNode::ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph)
|
||||
{
|
||||
Super::ExpandNode(CompilerContext, SourceGraph);
|
||||
|
||||
if(!libClass)
|
||||
{
|
||||
LoadDependencies();
|
||||
if(!libClass)
|
||||
{
|
||||
CompilerContext.MessageLog.Error(L"Dependencies not initialized yet");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
FName BeginSpawningBlueprintFuncName = GetBeginSpawningFunction();
|
||||
static FString ActorClassParamName = FString(TEXT("ActorClass"));
|
||||
static FString WorldContextParamName = FString(TEXT("WorldContextObject"));
|
||||
|
||||
FName FinishSpawningFuncName = GetFinishSpawningFunction();
|
||||
static FString ActorParamName = FString(TEXT("Actor"));
|
||||
static FString TransformParamName = FString(TEXT("SpawnTransform"));
|
||||
static FString CollisionHandlingOverrideParamName = FString(TEXT("CollisionHandlingOverride"));
|
||||
static FString OwnerParamName = FString(TEXT("Owner"));
|
||||
|
||||
static FString ObjectParamName = FString(TEXT("Object"));
|
||||
static FString ValueParamName = FString(TEXT("Value"));
|
||||
static FString PropertyNameParamName = FString(TEXT("PropertyName"));
|
||||
|
||||
UK2Node_SpawnActorBaseNode* SpawnNode = this;
|
||||
UEdGraphPin* SpawnNodeExec = SpawnNode->GetExecPin();
|
||||
UEdGraphPin* SpawnWorldContextPin = SpawnNode->GetWorldContextPin();
|
||||
UEdGraphPin* SpawnClassPin = SpawnNode->GetClassPin();
|
||||
UEdGraphPin* SpawnNodeThen = SpawnNode->GetThenPin();
|
||||
UEdGraphPin* SpawnNodeResult = SpawnNode->GetResultPin();
|
||||
|
||||
UClass* SpawnClass = (SpawnClassPin != NULL) ? Cast<UClass>(SpawnClassPin->DefaultObject) : NULL;
|
||||
if((0 == SpawnClassPin->LinkedTo.Num()) && (NULL == SpawnClass))
|
||||
{
|
||||
CompilerContext.MessageLog.Error(L"Spawn node @@ must have a class specified.", SpawnNode);
|
||||
// we break exec links so this is the only error we get, don't want the SpawnActor node being considered and giving 'unexpected node' type warnings
|
||||
SpawnNode->BreakAllNodeLinks();
|
||||
return;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// create 'begin spawn' call node
|
||||
UK2Node_CallFunction* CallBeginSpawnNode = CompilerContext.SpawnIntermediateNode<UK2Node_CallFunction>(SpawnNode, SourceGraph);
|
||||
CallBeginSpawnNode->FunctionReference.SetExternalMember(BeginSpawningBlueprintFuncName, libClass);
|
||||
CallBeginSpawnNode->AllocateDefaultPins();
|
||||
|
||||
UEdGraphPin* CallBeginExec = CallBeginSpawnNode->GetExecPin();
|
||||
UEdGraphPin* CallBeginWorldContextPin = CallBeginSpawnNode->FindPin(WorldContextParamName);
|
||||
if(!CallBeginWorldContextPin)
|
||||
{
|
||||
CompilerContext.MessageLog.Error(L"World Context Pin not found");
|
||||
return;
|
||||
}
|
||||
UEdGraphPin* CallBeginActorClassPin = CallBeginSpawnNode->FindPinChecked(ActorClassParamName);
|
||||
UEdGraphPin* CallBeginTransform = nullptr;
|
||||
UEdGraphPin* CallBeginResult = CallBeginSpawnNode->GetReturnValuePin();
|
||||
|
||||
// Move 'exec' connection from spawn node to 'begin spawn'
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnNodeExec, *CallBeginExec);
|
||||
|
||||
if(SpawnClassPin->LinkedTo.Num() > 0)
|
||||
{
|
||||
// Copy the 'blueprint' connection from the spawn node to 'begin spawn'
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnClassPin, *CallBeginActorClassPin);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy blueprint literal onto begin spawn call
|
||||
CallBeginActorClassPin->DefaultObject = SpawnClass;
|
||||
}
|
||||
|
||||
// Copy the world context connection from the spawn node to 'begin spawn' if necessary
|
||||
if(SpawnWorldContextPin)
|
||||
{
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnWorldContextPin, *CallBeginWorldContextPin);
|
||||
}
|
||||
|
||||
// Copy the 'transform' connection from the spawn node to 'begin spawn'
|
||||
|
||||
if(SpawningFunctionHasTransform())
|
||||
{
|
||||
UEdGraphPin* SpawnNodeTransform = SpawnNode->GetSpawnTransformPin();
|
||||
CallBeginTransform = CallBeginSpawnNode->FindPinChecked(TransformParamName);
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnNodeTransform, *CallBeginTransform);
|
||||
}
|
||||
|
||||
ConnectAdditionalPins(CompilerContext, nullptr, CallBeginSpawnNode);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// create 'finish spawn' call node
|
||||
UK2Node_CallFunction* CallFinishSpawnNode = CompilerContext.SpawnIntermediateNode<UK2Node_CallFunction>(SpawnNode, SourceGraph);
|
||||
CallFinishSpawnNode->FunctionReference.SetExternalMember(FinishSpawningFuncName, libClass);
|
||||
CallFinishSpawnNode->AllocateDefaultPins();
|
||||
|
||||
UEdGraphPin* CallFinishExec = CallFinishSpawnNode->GetExecPin();
|
||||
UEdGraphPin* CallFinishThen = CallFinishSpawnNode->GetThenPin();
|
||||
UEdGraphPin* CallFinishActor = CallFinishSpawnNode->FindPinChecked(ActorParamName);
|
||||
UEdGraphPin* CallFinishResult = CallFinishSpawnNode->GetReturnValuePin();
|
||||
|
||||
// Move 'then' connection from spawn node to 'finish spawn'
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnNodeThen, *CallFinishThen);
|
||||
|
||||
if(SpawningFunctionHasTransform())
|
||||
{
|
||||
// Copy transform connection
|
||||
UEdGraphPin* CallFinishTransform = CallFinishSpawnNode->FindPinChecked(TransformParamName);
|
||||
CompilerContext.CopyPinLinksToIntermediate(*CallBeginTransform, *CallFinishTransform);
|
||||
}
|
||||
|
||||
ConnectAdditionalPins(CompilerContext, nullptr, CallFinishSpawnNode);
|
||||
|
||||
// Connect output actor from 'begin' to 'finish'
|
||||
CallBeginResult->MakeLinkTo(CallFinishActor);
|
||||
|
||||
// Move result connection from spawn node to 'finish spawn'
|
||||
CallFinishResult->PinType = SpawnNodeResult->PinType; // Copy type so it uses the right actor subclass
|
||||
CompilerContext.MovePinLinksToIntermediate(*SpawnNodeResult, *CallFinishResult);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// create 'set var' nodes
|
||||
|
||||
// Get 'result' pin from 'begin spawn', this is the actual actor we want to set properties on
|
||||
UEdGraphPin* LastThen = FKismetCompilerUtilities::GenerateAssignmentNodes(CompilerContext, SourceGraph, CallBeginSpawnNode, SpawnNode, CallBeginResult, GetClassToSpawn());
|
||||
|
||||
// Make exec connection between 'then' on last node and 'finish'
|
||||
LastThen->MakeLinkTo(CallFinishExec);
|
||||
|
||||
// Break any links to the expanded node
|
||||
SpawnNode->BreakAllNodeLinks();
|
||||
}
|
||||
bool UK2Node_SpawnActorBaseNode::HasExternalDependencies(TArray<class UStruct*>* OptionalOutput) const
|
||||
{
|
||||
UClass* SourceClass = GetClassToSpawn();
|
||||
const UBlueprint* SourceBlueprint = GetBlueprint();
|
||||
const bool bResult = (SourceClass != NULL) && (SourceClass->ClassGeneratedBy != SourceBlueprint);
|
||||
if(bResult && OptionalOutput)
|
||||
{
|
||||
OptionalOutput->AddUnique(SourceClass);
|
||||
}
|
||||
const bool bSuperResult = Super::HasExternalDependencies(OptionalOutput);
|
||||
return bSuperResult || bResult;
|
||||
}
|
||||
|
||||
UClass* USpawnGroupNode::GetActorClass() const
|
||||
{
|
||||
return abilityGroupClass;
|
||||
}
|
||||
|
||||
UClass* USpawnTriggerNode::GetActorClass() const
|
||||
{
|
||||
return abilityTriggerClass;
|
||||
}
|
||||
|
||||
UClass* USpawnModifierNode::GetActorClass() const
|
||||
{
|
||||
return modifierClass;
|
||||
}
|
||||
void USpawnModifierNode::RegisterAdditionalPins(const class UEdGraphSchema_K2* K2Schema)
|
||||
{
|
||||
UEdGraphPin* TargetPin = CreatePin(EGPD_Input, K2Schema->PC_Object, TEXT(""), characterClass, false, false, "Target");
|
||||
}
|
||||
bool USpawnModifierNode::IsAdditionalPin(class UEdGraphPin* pin)
|
||||
{
|
||||
return pin->PinName == "Target";
|
||||
}
|
||||
void USpawnModifierNode::ConnectAdditionalPins(class FKismetCompilerContext& CompilerContext, UK2Node* last, UK2Node* dst)
|
||||
{
|
||||
UEdGraphPin* dstPin = dst->FindPin("Target");
|
||||
UEdGraphPin* srcPin = FindPin("Target");
|
||||
if(dstPin && srcPin)
|
||||
CompilerContext.CopyPinLinksToIntermediate(*srcPin, *dstPin);
|
||||
}
|
||||
|
||||
UClass* USpawnProjectileNode::GetActorClass() const
|
||||
{
|
||||
return projectileClass;
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
// Project Lab - NHTV Igad
|
||||
#pragma once
|
||||
|
||||
#include "KismetCompiler.h"
|
||||
#include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"
|
||||
#include "SpawnActorBaseNode.Generated.h"
|
||||
|
||||
UCLASS()
|
||||
class ATestObject : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class UK2Node_SpawnActorBaseNode : public UK2Node
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
// Begin UEdGraphNode interface.
|
||||
virtual void AllocateDefaultPins() override;
|
||||
virtual FLinearColor GetNodeTitleColor() const override;
|
||||
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
||||
virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
|
||||
virtual void PinConnectionListChanged(UEdGraphPin* Pin) override;
|
||||
virtual FText GetTooltipText() const override;
|
||||
virtual void ExpandNode(class FKismetCompilerContext& CompilerContext, UEdGraph* SourceGraph) override;
|
||||
virtual bool HasExternalDependencies(TArray<class UStruct*>* OptionalOutput) const override;
|
||||
virtual FName GetPaletteIcon(FLinearColor& OutColor) const override{ return TEXT("GraphEditor.SpawnActor_16x"); }
|
||||
virtual bool IsCompatibleWithGraph(const UEdGraph* TargetGraph) const override;
|
||||
virtual void PostPlacedNewNode() override;
|
||||
// End UEdGraphNode interface.
|
||||
|
||||
// Begin UK2Node interface
|
||||
virtual bool IsNodeSafeToIgnore() const override { return true; }
|
||||
virtual void ReallocatePinsDuringReconstruction(TArray<UEdGraphPin*>& OldPins) override;
|
||||
virtual void GetNodeAttributes(TArray<TKeyValuePair<FString, FString>>& OutNodeAttributes) const override;
|
||||
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
|
||||
virtual FText GetMenuCategory() const override;
|
||||
virtual class FNodeHandlingFunctor* CreateNodeHandler(class FKismetCompilerContext& CompilerContext) const override;
|
||||
// End UK2Node interface
|
||||
|
||||
|
||||
void CreatePinsForClass(UClass* InClass, TArray<UEdGraphPin*>& OutClassPins);
|
||||
bool IsSpawnVarPin(UEdGraphPin* Pin);
|
||||
|
||||
UEdGraphPin* GetThenPin() const;
|
||||
UEdGraphPin* GetClassPin(const TArray<UEdGraphPin*>* InPinsToSearch = NULL) const;
|
||||
UEdGraphPin* GetWorldContextPin() const;
|
||||
UEdGraphPin* GetSpawnTransformPin() const;
|
||||
UEdGraphPin* GetResultPin() const;
|
||||
|
||||
UClass* GetClassToSpawn(const TArray<UEdGraphPin*>* InPinsToSearch = NULL) const;
|
||||
|
||||
protected:
|
||||
virtual FName GetBeginSpawningFunction() const { return "BeginSpawning2"; }
|
||||
virtual FName GetFinishSpawningFunction() const { return "FinishSpawning2"; }
|
||||
virtual FString GetObjectName() const { return "Custom"; }
|
||||
virtual UClass* GetActorClass() const { return AActor::StaticClass(); }
|
||||
virtual bool SpawningFunctionHasTransform() const { return false; }
|
||||
virtual void RegisterAdditionalPins(const class UEdGraphSchema_K2* K2Schema) {};
|
||||
virtual bool IsAdditionalPin(class UEdGraphPin* pin) { return false; };
|
||||
virtual void ConnectAdditionalPins(class FKismetCompilerContext& CompilerContext, UK2Node* last, UK2Node* dst) {};
|
||||
|
||||
void OnClassPinChanged();
|
||||
|
||||
FText NodeTooltip;
|
||||
|
||||
FNodeTextCache m_cachedNodeTitle;
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class USpawnGroupNode : public UK2Node_SpawnActorBaseNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual FName GetBeginSpawningFunction() const { return "BeginSpawningGroup"; }
|
||||
virtual FName GetFinishSpawningFunction() const { return "FinishSpawningGroup"; }
|
||||
virtual FString GetObjectName() const { return "Group"; }
|
||||
virtual UClass* GetActorClass() const;
|
||||
virtual bool SpawningFunctionHasTransform() const { return false; }
|
||||
};
|
||||
UCLASS()
|
||||
class USpawnModifierNode : public UK2Node_SpawnActorBaseNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual FName GetBeginSpawningFunction() const { return "BeginSpawningModifier"; }
|
||||
virtual FName GetFinishSpawningFunction() const { return "FinishSpawningModifier"; }
|
||||
virtual FString GetObjectName() const { return "Modifier"; }
|
||||
virtual UClass* GetActorClass() const;
|
||||
virtual bool SpawningFunctionHasTransform() const { return false; }
|
||||
|
||||
virtual void RegisterAdditionalPins(const class UEdGraphSchema_K2* K2Schema) override;
|
||||
virtual bool IsAdditionalPin(class UEdGraphPin* pin) override;
|
||||
virtual void ConnectAdditionalPins(class FKismetCompilerContext& CompilerContext, UK2Node* last, UK2Node* dst) override;
|
||||
};
|
||||
UCLASS()
|
||||
class USpawnTriggerNode : public UK2Node_SpawnActorBaseNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual FName GetBeginSpawningFunction() const { return "BeginSpawningTrigger"; }
|
||||
virtual FName GetFinishSpawningFunction() const { return "FinishSpawningTrigger"; }
|
||||
virtual FString GetObjectName() const { return "Trigger"; }
|
||||
virtual UClass* GetActorClass() const;
|
||||
virtual bool SpawningFunctionHasTransform() const { return true; }
|
||||
};
|
||||
|
||||
UCLASS()
|
||||
class USpawnProjectileNode : public UK2Node_SpawnActorBaseNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual FName GetBeginSpawningFunction() const { return "BeginSpawningProjectile"; }
|
||||
virtual FName GetFinishSpawningFunction() const { return "FinishSpawningProjectile"; }
|
||||
virtual FString GetObjectName() const { return "Projectile"; }
|
||||
virtual UClass* GetActorClass() const;
|
||||
virtual bool SpawningFunctionHasTransform() const { return true; }
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5c2640e344ea5943eb62950991b3140ae7158ed1e76f90c897391bbe4b327945
|
||||
size 213809
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"FileVersion" : 3,
|
||||
|
||||
"FriendlyName" : "FMOD Studio Integration",
|
||||
"Version" : 10707,
|
||||
"VersionName" : "1.07.07",
|
||||
"CreatedBy" : "Firelight Technologies",
|
||||
"CreatedByURL" : "http://fmod.com",
|
||||
"EngineVersion" : "4.6.0",
|
||||
"Description" : "FMOD Studio Integration.",
|
||||
"Category" : "Audio",
|
||||
"EnabledByDefault" : true,
|
||||
|
||||
"Modules" :
|
||||
[
|
||||
{
|
||||
"Name" : "FMODStudio",
|
||||
"Type" : "Runtime",
|
||||
"LoadingPhase" : "PreDefault"
|
||||
},
|
||||
{
|
||||
"Name" : "FMODStudioEditor",
|
||||
"Type" : "Editor"
|
||||
}
|
||||
],
|
||||
|
||||
"CanContainContent" : true,
|
||||
"Installed" : true
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAudioComponent.h"
|
||||
#include "FMODAmbientSound.generated.h"
|
||||
|
||||
/** FMOD Ambient Sound.
|
||||
*/
|
||||
UCLASS(AutoExpandCategories=Audio, ClassGroup=Sounds, hidecategories(Collision, Input))
|
||||
class FMODSTUDIO_API AFMODAmbientSound : public AActor
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** The Audio component for this actor */
|
||||
UPROPERTY(Category=Sound, VisibleAnywhere, BlueprintReadOnly,meta=(ExposeFunctionCategories="Sound"))
|
||||
UFMODAudioComponent* AudioComponent;
|
||||
|
||||
// Begin AActor interface.
|
||||
#if WITH_EDITOR
|
||||
virtual void CheckForErrors() override;
|
||||
virtual bool GetReferencedContentObjects( TArray<UObject*>& Objects ) const override;
|
||||
#endif
|
||||
// End AActor interface.
|
||||
};
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Asset.
|
||||
*/
|
||||
UCLASS(BlueprintType)
|
||||
class FMODSTUDIO_API UFMODAsset : public UObject
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** The unique Guid, which matches the one exported from FMOD Studio */
|
||||
UPROPERTY()
|
||||
FGuid AssetGuid;
|
||||
|
||||
/** Whether to show in the content window */
|
||||
UPROPERTY()
|
||||
bool bShowAsAsset;
|
||||
|
||||
/** Force this to be an asset */
|
||||
virtual bool IsAsset() const override { return bShowAsAsset; }
|
||||
|
||||
/** Get tags to show in content view */
|
||||
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Map.h"
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#include "FMODAudioComponent.generated.h"
|
||||
|
||||
/** Used to store callback info from FMOD thread to our event */
|
||||
struct FTimelineMarkerProperties
|
||||
{
|
||||
FString Name;
|
||||
int32 Position;
|
||||
};
|
||||
|
||||
/** Used to store callback info from FMOD thread to our event */
|
||||
struct FTimelineBeatProperties
|
||||
{
|
||||
int32 Bar;
|
||||
int32 Beat;
|
||||
int32 Position;
|
||||
float Tempo;
|
||||
int32 TimeSignatureUpper;
|
||||
int32 TimeSignatureLower;
|
||||
};
|
||||
|
||||
/** called when an event stops, either because it played to completion or because a Stop() call turned it off early */
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnEventStopped);
|
||||
/** called when we reach a named marker on the timeline */
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnTimelineMarker, FString, Name, int32, Position);
|
||||
/** called when we reach a beat on the timeline */
|
||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_SixParams(FOnTimelineBeat, int32, Bar, int32, Beat, int32, Position, float, Tempo, int32, TimeSignatureUpper, int32, TimeSignatureLower);
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
class Sound;
|
||||
|
||||
namespace Studio
|
||||
{
|
||||
class EventDescription;
|
||||
class EventInstance;
|
||||
}
|
||||
}
|
||||
|
||||
struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES;
|
||||
struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES;
|
||||
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Plays FMOD Studio events.
|
||||
*/
|
||||
UCLASS(ClassGroup = (Audio, Common), hidecategories = (Object, ActorComponent, Physics, Rendering, Mobility, LOD), ShowCategories = Trigger, meta = (BlueprintSpawnableComponent))
|
||||
class FMODSTUDIO_API UFMODAudioComponent : public USceneComponent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** The event asset to use for this sound */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Sound)
|
||||
TAssetPtr<class UFMODEvent> Event;
|
||||
|
||||
/** Stored parameters to apply next time we create an instance */
|
||||
TMap<FName, float> StoredParameters;
|
||||
|
||||
/** Enable timeline callbacks for this sound, so that OnTimelineMarker and OnTimelineBeat can be used */
|
||||
UPROPERTY(EditAnywhere, Category=Callbacks)
|
||||
uint32 bEnableTimelineCallbacks:1;
|
||||
|
||||
/** Auto destroy this component on completion */
|
||||
UPROPERTY()
|
||||
uint32 bAutoDestroy:1;
|
||||
|
||||
/** Stop sound when owner is destroyed */
|
||||
UPROPERTY()
|
||||
uint32 bStopWhenOwnerDestroyed:1;
|
||||
|
||||
/** called when an event stops, either because it played to completion or because a Stop() call turned it off early */
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnEventStopped OnEventStopped;
|
||||
|
||||
/** called when we reach a named marker (if bEnableTimelineCallbacks is true) */
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnTimelineMarker OnTimelineMarker;
|
||||
|
||||
/** called when we reach a beat of a tempo (if bEnableTimelineCallbacks is true) */
|
||||
UPROPERTY(BlueprintAssignable)
|
||||
FOnTimelineBeat OnTimelineBeat;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetEvent(UFMODEvent* NewEvent);
|
||||
|
||||
/** Start a sound playing on an audio component */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void Play();
|
||||
|
||||
/** Stop an audio component playing its sound cue, issue any delegates if needed */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void Stop();
|
||||
|
||||
/** Trigger a cue in an event */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void TriggerCue();
|
||||
|
||||
/** @return true if this component is currently playing an event */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
bool IsPlaying();
|
||||
|
||||
/** Set volume on an audio component */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetVolume(float volume);
|
||||
|
||||
/** Set pitch on an audio component */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetPitch(float pitch);
|
||||
|
||||
/** Pause/Unpause an audio component */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetPaused(bool paused);
|
||||
|
||||
/** Set a parameter into the event */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetParameter(FName Name, float Value);
|
||||
|
||||
/** Set a parameter into the event */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
float GetParameter(FName Name);
|
||||
|
||||
/** Set the timeline position in milliseconds */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetTimelinePosition(int32 Time);
|
||||
|
||||
/** Get the timeline position in milliseconds */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
int32 GetTimelinePosition();
|
||||
|
||||
/** Called when the event has finished stopping */
|
||||
void OnPlaybackCompleted();
|
||||
|
||||
/** Update gain and low-pass based on interior volumes */
|
||||
void UpdateInteriorVolumes();
|
||||
|
||||
/** Whether we apply gain and low-pass based on audio zones. */
|
||||
uint32 bApplyAmbientVolumes:1;
|
||||
|
||||
/** Sound name used for programmer sound. Will look up the name in any loaded audio table. */
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Sound)
|
||||
FString ProgrammerSoundName;
|
||||
|
||||
/** Set the sound name to use for programmer sound. Will look up the name in any loaded audio table. */
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|Components")
|
||||
void SetProgrammerSoundName(FString Value);
|
||||
|
||||
/** Set a programmer sound to use for this audio component. Lifetime of sound must exceed that of the audio component. */
|
||||
void SetProgrammerSound(FMOD::Sound* Sound);
|
||||
|
||||
public:
|
||||
|
||||
/** Actual Studio instance handle */
|
||||
FMOD::Studio::EventInstance* StudioInstance;
|
||||
|
||||
void EventCallbackAddMarker(struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES* props);
|
||||
void EventCallbackAddBeat(struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES* props);
|
||||
void EventCallbackCreateProgrammerSound(struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* props);
|
||||
void EventCallbackDestroyProgrammerSound(struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* props);
|
||||
|
||||
// Begin UObject interface.
|
||||
#if WITH_EDITOR
|
||||
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
|
||||
#endif // WITH_EDITOR
|
||||
virtual void PostLoad() override;
|
||||
virtual FString GetDetailedInfoInternal() const override;
|
||||
// End UObject interface.
|
||||
// Begin USceneComponent Interface
|
||||
virtual void Activate(bool bReset=false) override;
|
||||
virtual void Deactivate() override;
|
||||
#if ENGINE_MINOR_VERSION >= 9
|
||||
virtual void OnUpdateTransform(bool bSkipPhysicsMove, ETeleportType Teleport = ETeleportType::None) override;
|
||||
#else
|
||||
virtual void OnUpdateTransform(bool bSkipPhysicsMove) override;
|
||||
#endif
|
||||
// End USceneComponent Interface
|
||||
|
||||
private:
|
||||
|
||||
// Begin ActorComponent interface.
|
||||
#if WITH_EDITORONLY_DATA
|
||||
virtual void OnRegister() override;
|
||||
#endif
|
||||
virtual void OnUnregister() override;
|
||||
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;
|
||||
// End ActorComponent interface.
|
||||
|
||||
#if WITH_EDITORONLY_DATA
|
||||
void UpdateSpriteTexture();
|
||||
#endif
|
||||
|
||||
// Settings for ambient volume effects
|
||||
double InteriorLastUpdateTime;
|
||||
float SourceInteriorVolume;
|
||||
float SourceInteriorLPF;
|
||||
float CurrentInteriorVolume;
|
||||
float CurrentInteriorLPF;
|
||||
|
||||
// Tempo and marker callbacks
|
||||
FCriticalSection CallbackLock;
|
||||
TArray<FTimelineMarkerProperties> CallbackMarkerQueue;
|
||||
TArray<FTimelineBeatProperties> CallbackBeatQueue;
|
||||
|
||||
// Direct assignment of programmer sound from other C++ code
|
||||
FMOD::Sound* ProgrammerSound;
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.h"
|
||||
#include "FMODBank.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Bank Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODBank : public UFMODAsset
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Get tags to show in content view */
|
||||
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
||||
|
||||
/** Descriptive name */
|
||||
virtual FString GetDesc() override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "UnrealString.h"
|
||||
#include "FMODBlueprintStatics.generated.h"
|
||||
|
||||
class UFMODAudioComponent;
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class EventDescription;
|
||||
class EventInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class UFMODAsset;
|
||||
class UFMODEvent;
|
||||
class USceneComponent;
|
||||
|
||||
USTRUCT()
|
||||
struct FFMODEventInstance
|
||||
{
|
||||
GENERATED_USTRUCT_BODY()
|
||||
|
||||
FMOD::Studio::EventInstance* Instance;
|
||||
};
|
||||
|
||||
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODBlueprintStatics : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Plays an event. This returns an FMOD Event Instance. The sound does not travel with any actor.
|
||||
* @param Event - event to play
|
||||
* @param bAutoPlay - Start the event automatically.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", AdvancedDisplay = "2", bAutoPlay = "true", UnsafeDuringActorConstruction = "true"))
|
||||
static FFMODEventInstance PlayEvent2D(UObject* WorldContextObject, UFMODEvent* Event, bool bAutoPlay);
|
||||
|
||||
/** Plays an event at the given location. This returns an FMOD Event Instance. The sound does not travel with any actor.
|
||||
* @param Event - event to play
|
||||
* @param Location - World position to play event at
|
||||
* @param bAutoPlay - Start the event automatically.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", AdvancedDisplay = "2", bAutoPlay = "true", UnsafeDuringActorConstruction = "true"))
|
||||
static FFMODEventInstance PlayEventAtLocation(UObject* WorldContextObject, UFMODEvent* Event, const FTransform& Location, bool bAutoPlay);
|
||||
|
||||
/** Plays an event attached to and following the specified component.
|
||||
* @param Event - event to play
|
||||
* @param AttachComponent - Component to attach to.
|
||||
* @param AttachPointName - Optional named point within the AttachComponent to play the sound at
|
||||
* @param Location - Depending on the value of Location Type this is either a relative offset from the attach component/point or an absolute world position that will be translated to a relative offset
|
||||
* @param LocationType - Specifies whether Location is a relative offset or an absolute world position
|
||||
* @param bStopWhenAttachedToDestroyed - Specifies whether the sound should stop playing when the owner of the attach to component is destroyed.
|
||||
* @param bAutoPlay - Start the event automatically.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(AdvancedDisplay = "2", UnsafeDuringActorConstruction = "true", bAutoPlay = "true"))
|
||||
static class UFMODAudioComponent* PlayEventAttached(UFMODEvent* Event, USceneComponent* AttachToComponent, FName AttachPointName, FVector Location, EAttachLocation::Type LocationType, bool bStopWhenAttachedToDestroyed, bool bAutoPlay);
|
||||
|
||||
/** Find an asset by name.
|
||||
* @param EventName - The asset name
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD")
|
||||
static UFMODAsset* FindAssetByName(const FString& Name);
|
||||
|
||||
/** Find an event by name.
|
||||
* @param EventName - The event name
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD")
|
||||
static UFMODEvent* FindEventByName(const FString& Name);
|
||||
|
||||
/** Loads a bank.
|
||||
* @param Bank - bank to load
|
||||
* @param bBlocking - determines whether the bank will load synchronously
|
||||
* @param bLoadSampleData - determines whether sample data will be preloaded immediately
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void LoadBank(class UFMODBank* Bank, bool bBlocking, bool bLoadSampleData);
|
||||
|
||||
/** Unloads a bank.
|
||||
* @param Bank - bank to unload
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void UnloadBank(class UFMODBank* Bank);
|
||||
|
||||
/** Load bank sample data.
|
||||
* @param Bank - bank to load sample data from
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void LoadBankSampleData(class UFMODBank* Bank);
|
||||
|
||||
/** Unload bank sample data.
|
||||
* @param Bank - bank to unload sample data from
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void UnloadBankSampleData(class UFMODBank* Bank);
|
||||
|
||||
/** Load event sample data. This can be done ahead of time to avoid loading stalls.
|
||||
* @param Event - event to load sample data from.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", UnsafeDuringActorConstruction = "true"))
|
||||
static void LoadEventSampleData(UObject* WorldContextObject, UFMODEvent* Event);
|
||||
|
||||
/** Unload event sample data.
|
||||
* @param Event - event to load sample data from.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", UnsafeDuringActorConstruction = "true"))
|
||||
static void UnloadEventSampleData(UObject* WorldContextObject, UFMODEvent* Event);
|
||||
|
||||
/** Return a list of all event instances that are playing for this event.
|
||||
Be careful using this function because it is possible to find and alter any playing sound, even ones owned by other audio components.
|
||||
* @param Event - event to find instances from.
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", UnsafeDuringActorConstruction = "true"))
|
||||
static TArray<FFMODEventInstance> FindEventInstances(UObject* WorldContextObject, UFMODEvent* Event);
|
||||
|
||||
/** Set fader level on a bus
|
||||
* @param Bus - bus to use
|
||||
* @param Level - fader level
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD|Bus", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void BusSetFaderLevel(class UFMODBus* Bus, float Level);
|
||||
|
||||
/** Pause/Unpause all events going through this bus
|
||||
* @param Bus - bus to use
|
||||
* @param bPaused - paused
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD|Bus", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void BusSetPaused(class UFMODBus* Bus, bool bPaused);
|
||||
|
||||
/** Mute/Unmute this bus
|
||||
* @param Bus - bus to use
|
||||
* @param bMute - mute
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Audio|FMOD|Bus", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void BusSetMute(class UFMODBus* Bus, bool bMute);
|
||||
|
||||
/** Returns whether this FMOD Event Instance is valid. The instance will be invalidated when the sound stops.
|
||||
* @param EventInstance - Event instance
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static bool EventInstanceIsValid(FFMODEventInstance EventInstance);
|
||||
|
||||
/** Set volume on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Value - Volume to set
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceSetVolume(FFMODEventInstance EventInstance, float Volume);
|
||||
|
||||
/** Set pitch on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Value - Volume to set
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceSetPitch(FFMODEventInstance EventInstance, float Pitch);
|
||||
|
||||
/** Pause/Unpause an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Paused - Whether to pause or unpause
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceSetPaused(FFMODEventInstance EventInstance, bool Paused);
|
||||
|
||||
/** Set a parameter on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Name - Name of parameter
|
||||
* @param Value - Value of parameter
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceSetParameter(FFMODEventInstance EventInstance, FName Name, float Value);
|
||||
|
||||
/** Get a parameter on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Name - Name of parameter
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static float EventInstanceGetParameter(FFMODEventInstance EventInstance, FName Name);
|
||||
|
||||
/** Plays a FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstancePlay(FFMODEventInstance EventInstance);
|
||||
|
||||
/** Stops a FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceStop(FFMODEventInstance EventInstance);
|
||||
|
||||
/** Trigger a cue on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceTriggerCue(FFMODEventInstance EventInstance);
|
||||
|
||||
/** Set transform on an FMOD Event Instance.
|
||||
* @param EventInstance - Event instance
|
||||
* @param Location - Location to place event
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category="Audio|FMOD|EventInstance", meta = (UnsafeDuringActorConstruction = "true"))
|
||||
static void EventInstanceSetTransform(FFMODEventInstance EventInstance, const FTransform& Location);
|
||||
};
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.h"
|
||||
#include "FMODBus.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Bus Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODBus : public UFMODAsset
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Get tags to show in content view */
|
||||
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
||||
|
||||
/** Descriptive name */
|
||||
virtual FString GetDesc() override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.h"
|
||||
#include "FMODEvent.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Event Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODEvent : public UFMODAsset
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Get tags to show in content view */
|
||||
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
||||
|
||||
/** Descriptive name */
|
||||
virtual FString GetDesc() override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODSettings.generated.h"
|
||||
|
||||
UENUM()
|
||||
namespace EFMODSpeakerMode
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
// The speakers are stereo
|
||||
Stereo,
|
||||
// 5.1 speaker setup
|
||||
Surround_5_1,
|
||||
// 7.1 speaker setup
|
||||
Surround_7_1
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
UCLASS(config = Engine, defaultconfig)
|
||||
class FMODSTUDIO_API UFMODSettings : public UObject
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Whether to load all banks at startup.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Basic)
|
||||
bool bLoadAllBanks;
|
||||
|
||||
/**
|
||||
* Whether to load all bank sample data into memory at startup.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Basic)
|
||||
bool bLoadAllSampleData;
|
||||
|
||||
/**
|
||||
* Enable live update in non-final builds.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Basic)
|
||||
bool bEnableLiveUpdate;
|
||||
|
||||
/**
|
||||
* Path to find your studio bank output directory, relative to Content directory.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Basic, meta=(RelativeToGameContentDir))
|
||||
FDirectoryPath BankOutputDirectory;
|
||||
|
||||
/** Project Output Format, should match the mode set up for the Studio project. */
|
||||
UPROPERTY(config, EditAnywhere, Category = Basic)
|
||||
TEnumAsByte<EFMODSpeakerMode::Type> OutputFormat;
|
||||
|
||||
/**
|
||||
* Whether to enable vol0virtual, which means voices with low volume will automatically go virtual to save CPU.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
bool bVol0Virtual;
|
||||
|
||||
/**
|
||||
* If vol0virtual is enabled, the signal level at which to make channels virtual.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
float Vol0VirtualLevel;
|
||||
|
||||
/**
|
||||
* Sample rate to use, or 0 to match system rate.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 SampleRate;
|
||||
|
||||
/**
|
||||
* Number of actual software voices that can be used at once.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 RealChannelCount;
|
||||
|
||||
/**
|
||||
* Total number of voices available that can be either real or virtual.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 TotalChannelCount;
|
||||
|
||||
/**
|
||||
* DSP mixer buffer length, or 0 for system default.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 DSPBufferLength;
|
||||
|
||||
/**
|
||||
* DSP mixer buffer count, or 0 for system default.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 DSPBufferCount;
|
||||
|
||||
/**
|
||||
* Studio update period in milliseconds, or 0 for default (which means 20ms).
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = InitSettings)
|
||||
int32 StudioUpdatePeriod;
|
||||
|
||||
/**
|
||||
* Live update port to use, or 0 for default.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
int32 LiveUpdatePort;
|
||||
|
||||
/**
|
||||
* Extra plugin files to load.
|
||||
* The plugin files should sit alongside the FMOD dynamic libraries in the ThirdParty directory.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
TArray<FString> PluginFiles;
|
||||
|
||||
/**
|
||||
* Directory for content to appear in content window. Be careful changing this!
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
FString ContentBrowserPrefix;
|
||||
|
||||
/**
|
||||
* Force platform directory name, or leave empty for automatic (Desktop/Mobile/PS4/XBoxOne)
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
FString ForcePlatformName;
|
||||
|
||||
/**
|
||||
* Name of master bank. The default in Studio is "Master Bank".
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
FString MasterBankName;
|
||||
|
||||
/**
|
||||
* Skip bank files of the given name.
|
||||
* Can be used to load all banks except for a certain set, such as localization banks.
|
||||
*/
|
||||
UPROPERTY(config, EditAnywhere, Category = Advanced)
|
||||
FString SkipLoadBankName;
|
||||
|
||||
/** Is the bank path set up . */
|
||||
bool IsBankPathSet() const { return !BankOutputDirectory.Path.IsEmpty(); }
|
||||
|
||||
/** Get the full bank path. Uses the game's content directory as a base. */
|
||||
FString GetFullBankPath() const;
|
||||
|
||||
/** Get the master bank path. */
|
||||
FString GetMasterBankPath() const;
|
||||
|
||||
/** Get the master strings bank path. */
|
||||
FString GetMasterStringsBankPath() const;
|
||||
|
||||
/** Get all banks in our bank directory excluding the master and strings bank. */
|
||||
void GetAllBankPaths(TArray<FString>& Paths, bool IncludeMasterBank=false) const;
|
||||
};
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODSnapshot.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Snapshot Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODSnapshot : public UFMODEvent
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Descriptive name */
|
||||
virtual FString GetDesc() override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Sound/ReverbEffect.h"
|
||||
#include "FMODSnapshotReverb.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD Event Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODSnapshotReverb : public UReverbEffect
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** The unique Guid, which matches the one exported from FMOD Studio */
|
||||
UPROPERTY()
|
||||
FGuid AssetGuid;
|
||||
|
||||
/** Whether to show in the content window */
|
||||
UPROPERTY()
|
||||
bool bShowAsAsset;
|
||||
|
||||
/** Force this to be an asset */
|
||||
virtual bool IsAsset() const override { return bShowAsAsset; }
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.h"
|
||||
#include "FMODVCA.generated.h"
|
||||
|
||||
/* Purely for doxygen generation */
|
||||
#ifdef GENERATE_DOX
|
||||
#define UCLASS(...)
|
||||
#define UPROPERTY(...) public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* FMOD VCA Asset.
|
||||
*/
|
||||
UCLASS()
|
||||
class FMODSTUDIO_API UFMODVCA : public UFMODAsset
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
/** Get tags to show in content view */
|
||||
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
||||
|
||||
/** Descriptive name */
|
||||
virtual FString GetDesc() override;
|
||||
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,237 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
namespace UnrealBuildTool.Rules
|
||||
{
|
||||
public class FMODStudio : ModuleRules
|
||||
{
|
||||
public FMODStudio(TargetInfo Target)
|
||||
{
|
||||
bFasterWithoutUnity = true;
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] {
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
"FMODStudio/Private",
|
||||
"FMODStudio/Public/FMOD",
|
||||
"FMODStudioOculus/Public",
|
||||
}
|
||||
);
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"Projects"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
}
|
||||
);
|
||||
|
||||
if (UEBuildConfiguration.bBuildEditor == true)
|
||||
{
|
||||
PrivateDependencyModuleNames.Add("AssetRegistry");
|
||||
PrivateDependencyModuleNames.Add("UnrealEd");
|
||||
}
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
}
|
||||
);
|
||||
|
||||
string configName = "";
|
||||
|
||||
if (Target.Configuration != UnrealTargetConfiguration.Shipping)
|
||||
{
|
||||
configName = "L";
|
||||
Definitions.Add("FMODSTUDIO_LINK_LOGGING=1");
|
||||
}
|
||||
else
|
||||
{
|
||||
configName = "";
|
||||
Definitions.Add("FMODSTUDIO_LINK_RELEASE=1");
|
||||
}
|
||||
|
||||
string platformName = Target.Platform.ToString();
|
||||
|
||||
string platformMidName = "";
|
||||
string linkExtension = "";
|
||||
string dllExtension = "";
|
||||
string libPrefix = "";
|
||||
|
||||
// ModuleDirectory points to FMODStudio\source\FMODStudio, need to get back to binaries directory for our libs
|
||||
string BasePath = System.IO.Path.Combine(ModuleDirectory, "../../Binaries", platformName);
|
||||
|
||||
string copyThirdPartyPath = "";
|
||||
bool bDynamicLibraries = true;
|
||||
|
||||
switch (Target.Platform)
|
||||
{
|
||||
case UnrealTargetPlatform.Win32:
|
||||
linkExtension = "_vc.lib";
|
||||
dllExtension = ".dll";
|
||||
break;
|
||||
case UnrealTargetPlatform.Win64:
|
||||
platformMidName = "64";
|
||||
linkExtension = "_vc.lib";
|
||||
dllExtension = ".dll";
|
||||
break;
|
||||
case UnrealTargetPlatform.Mac:
|
||||
linkExtension = dllExtension = ".dylib";
|
||||
libPrefix = "lib";
|
||||
break;
|
||||
case UnrealTargetPlatform.XboxOne:
|
||||
linkExtension = "_vc.lib";
|
||||
dllExtension = ".dll";
|
||||
copyThirdPartyPath = "../XBoxOne"; // XBoxOne still doesn't seem to support plugins with .dlls
|
||||
break;
|
||||
case UnrealTargetPlatform.PS4:
|
||||
linkExtension = "_stub.a";
|
||||
dllExtension = ".prx";
|
||||
libPrefix = "lib";
|
||||
break;
|
||||
case UnrealTargetPlatform.Android:
|
||||
linkExtension = dllExtension = ".so";
|
||||
libPrefix = "lib";
|
||||
WriteAndroidDeploy(System.IO.Path.Combine(BasePath, "deploy.txt"), configName);
|
||||
break;
|
||||
case UnrealTargetPlatform.IOS:
|
||||
linkExtension = "_iphoneos.a";
|
||||
libPrefix = "lib";
|
||||
bDynamicLibraries = false;
|
||||
break;
|
||||
case UnrealTargetPlatform.Linux:
|
||||
BasePath = System.IO.Path.Combine(BasePath, "x86_64");
|
||||
linkExtension = ".so";
|
||||
dllExtension = ".so";
|
||||
libPrefix = "lib";
|
||||
break;
|
||||
case UnrealTargetPlatform.WinRT:
|
||||
case UnrealTargetPlatform.WinRT_ARM:
|
||||
case UnrealTargetPlatform.HTML5:
|
||||
//extName = ".a";
|
||||
throw new System.Exception(System.String.Format("Unsupported platform {0}", Target.Platform.ToString()));
|
||||
//break;
|
||||
}
|
||||
|
||||
//System.Console.WriteLine("FMOD Current path: " + System.IO.Path.GetFullPath("."));
|
||||
//System.Console.WriteLine("FMOD Base path: " + BasePath);
|
||||
|
||||
PublicLibraryPaths.Add(BasePath);
|
||||
|
||||
string fmodLibName = System.String.Format("{0}fmod{1}{2}{3}", libPrefix, configName, platformMidName, linkExtension);
|
||||
string fmodStudioLibName = System.String.Format("{0}fmodstudio{1}{2}{3}", libPrefix, configName, platformMidName, linkExtension);
|
||||
|
||||
string fmodDllName = System.String.Format("{0}fmod{1}{2}{3}", libPrefix, configName, platformMidName, dllExtension);
|
||||
string fmodStudioDllName = System.String.Format("{0}fmodstudio{1}{2}{3}", libPrefix, configName, platformMidName, dllExtension);
|
||||
|
||||
string fmodLibPath = System.IO.Path.Combine(BasePath, fmodLibName);
|
||||
string fmodStudioLibPath = System.IO.Path.Combine(BasePath, fmodStudioLibName);
|
||||
|
||||
string fmodDllPath = System.IO.Path.Combine(BasePath, fmodDllName);
|
||||
string fmodStudioDllPath = System.IO.Path.Combine(BasePath, fmodStudioDllName);
|
||||
|
||||
System.Collections.Generic.List<string> plugins = GetPlugins(BasePath);
|
||||
|
||||
PublicAdditionalLibraries.Add(fmodLibPath);
|
||||
PublicAdditionalLibraries.Add(fmodStudioLibPath);
|
||||
if (bDynamicLibraries)
|
||||
{
|
||||
RuntimeDependencies.Add(new RuntimeDependency(fmodDllPath));
|
||||
RuntimeDependencies.Add(new RuntimeDependency(fmodStudioDllPath));
|
||||
foreach (string plugin in plugins)
|
||||
{
|
||||
string pluginPath = System.IO.Path.Combine(BasePath, plugin + dllExtension);
|
||||
System.Console.WriteLine("Adding reference to FMOD plugin: " + pluginPath);
|
||||
RuntimeDependencies.Add(new RuntimeDependency(pluginPath));
|
||||
}
|
||||
}
|
||||
|
||||
if (copyThirdPartyPath.Length != 0)
|
||||
{
|
||||
string destPath = System.IO.Path.Combine(UEBuildConfiguration.UEThirdPartyBinariesDirectory, copyThirdPartyPath);
|
||||
System.IO.Directory.CreateDirectory(destPath);
|
||||
|
||||
string fmodDllDest = System.IO.Path.Combine(destPath, fmodDllName);
|
||||
string fmodStudioDllDest = System.IO.Path.Combine(destPath, fmodStudioDllName);
|
||||
|
||||
CopyFile(fmodDllPath, fmodDllDest);
|
||||
CopyFile(fmodStudioDllPath, fmodStudioDllDest);
|
||||
}
|
||||
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64 || Target.Platform == UnrealTargetPlatform.XboxOne)
|
||||
{
|
||||
PublicDelayLoadDLLs.AddRange(
|
||||
new string[] {
|
||||
fmodDllName,
|
||||
fmodStudioDllName
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private void CopyFile(string source, string dest)
|
||||
{
|
||||
//System.Console.WriteLine("Copying {0} to {1}", source, dest);
|
||||
if (System.IO.File.Exists(dest))
|
||||
{
|
||||
System.IO.File.SetAttributes(dest, System.IO.File.GetAttributes(dest) & ~System.IO.FileAttributes.ReadOnly);
|
||||
}
|
||||
try
|
||||
{
|
||||
System.IO.File.Copy(source, dest, true);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
System.Console.WriteLine("Failed to copy file: {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void WriteAndroidDeploy(string fileName, string configLetter)
|
||||
{
|
||||
string[] contents = new string[]
|
||||
{
|
||||
"fmod.jar",
|
||||
System.String.Format("libfmod{0}.so", configLetter),
|
||||
System.String.Format("libfmodstudio{0}.so", configLetter)
|
||||
};
|
||||
System.IO.File.WriteAllLines(fileName, contents);
|
||||
}
|
||||
|
||||
private System.Collections.Generic.List<string> GetPlugins(string BasePath)
|
||||
{
|
||||
System.Collections.Generic.List<string> AllPlugins = new System.Collections.Generic.List<string>();
|
||||
string PluginListName = System.IO.Path.Combine(BasePath, "plugins.txt");
|
||||
if (System.IO.File.Exists(PluginListName))
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (string FullEntry in System.IO.File.ReadAllLines(PluginListName))
|
||||
{
|
||||
string Entry = FullEntry.Trim();
|
||||
if (Entry.Length > 0)
|
||||
{
|
||||
AllPlugins.Add(Entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
System.Console.WriteLine("Failed to read plugin list file: {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
return AllPlugins;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODAmbientSound.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "MessageLog.h"
|
||||
#include "UObjectToken.h"
|
||||
#include "MapErrors.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FMODAmbientSound"
|
||||
|
||||
AFMODAmbientSound::AFMODAmbientSound(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
AudioComponent = ObjectInitializer.CreateDefaultSubobject<UFMODAudioComponent>(this, TEXT("FMODAudioComponent0"));
|
||||
|
||||
AudioComponent->bAutoActivate = true;
|
||||
AudioComponent->bStopWhenOwnerDestroyed = true;
|
||||
AudioComponent->Mobility = EComponentMobility::Movable;
|
||||
|
||||
RootComponent = AudioComponent;
|
||||
|
||||
bReplicates = false;
|
||||
bHidden = true;
|
||||
bCanBeDamaged = false;
|
||||
}
|
||||
|
||||
#if WITH_EDITOR
|
||||
|
||||
void AFMODAmbientSound::CheckForErrors( void )
|
||||
{
|
||||
Super::CheckForErrors();
|
||||
|
||||
if (!AudioComponent)
|
||||
{
|
||||
FFormatNamedArguments Arguments;
|
||||
Arguments.Add(TEXT("ActorName"), FText::FromString(GetName()));
|
||||
FMessageLog("MapCheck").Warning()
|
||||
->AddToken(FUObjectToken::Create(this))
|
||||
->AddToken(FTextToken::Create(FText::Format( LOCTEXT( "MapCheck_Message_AudioComponentNull", "{ActorName} : Ambient sound actor has NULL AudioComponent property - please delete" ), Arguments ) ))
|
||||
->AddToken(FMapErrorToken::Create(FMapErrors::AudioComponentNull));
|
||||
}
|
||||
else if (AudioComponent->Event == NULL)
|
||||
{
|
||||
FFormatNamedArguments Arguments;
|
||||
Arguments.Add(TEXT("ActorName"), FText::FromString(GetName()));
|
||||
FMessageLog("MapCheck").Warning()
|
||||
->AddToken(FUObjectToken::Create(this))
|
||||
->AddToken(FTextToken::Create(FText::Format( LOCTEXT( "MapCheck_Message_EventNull", "{ActorName} : Ambient sound actor has NULL Event property" ), Arguments ) ))
|
||||
->AddToken(FMapErrorToken::Create(FMapErrors::SoundCueNull));
|
||||
}
|
||||
}
|
||||
|
||||
bool AFMODAmbientSound::GetReferencedContentObjects( TArray<UObject*>& Objects ) const
|
||||
{
|
||||
if (AudioComponent->Event)
|
||||
{
|
||||
Objects.Add(AudioComponent->Event.Get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODAsset.h"
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
static const TCHAR* FMODAssetTypeStrings[] =
|
||||
{
|
||||
TEXT("Bank"),
|
||||
TEXT("Event"),
|
||||
TEXT("VCA"),
|
||||
TEXT("Bus"),
|
||||
TEXT("Invalid")
|
||||
};
|
||||
|
||||
UFMODAsset::UFMODAsset(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get tags to show in content view */
|
||||
void UFMODAsset::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
|
||||
{
|
||||
Super::GetAssetRegistryTags(OutTags);
|
||||
OutTags.Add(UObject::FAssetRegistryTag("Guid", AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces), UObject::FAssetRegistryTag::TT_Alphabetical));
|
||||
}
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODAssetTable.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODSnapshot.h"
|
||||
#include "FMODSnapshotReverb.h"
|
||||
#include "FMODBank.h"
|
||||
#include "FMODBus.h"
|
||||
#include "FMODVCA.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "FMODSettings.h"
|
||||
#include "FMODFileCallbacks.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
#if WITH_EDITOR
|
||||
#include "AssetRegistryModule.h"
|
||||
#endif
|
||||
|
||||
FFMODAssetTable::FFMODAssetTable()
|
||||
: StudioSystem(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
FFMODAssetTable::~FFMODAssetTable()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void FFMODAssetTable::Create()
|
||||
{
|
||||
Destroy();
|
||||
|
||||
// Create a sandbox system purely for loading and considering banks
|
||||
verifyfmod(FMOD::Studio::System::create(&StudioSystem));
|
||||
FMOD::System* lowLevelSystem = nullptr;
|
||||
verifyfmod(StudioSystem->getLowLevelSystem(&lowLevelSystem));
|
||||
verifyfmod(lowLevelSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND));
|
||||
verifyfmod(lowLevelSystem->setFileSystem(FMODOpen, FMODClose, FMODRead, FMODSeek, 0, 0, 2048));
|
||||
verifyfmod(StudioSystem->initialize(1, FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS, FMOD_INIT_NORMAL, 0));
|
||||
}
|
||||
|
||||
void FFMODAssetTable::Destroy()
|
||||
{
|
||||
if (StudioSystem != nullptr)
|
||||
{
|
||||
verifyfmod(StudioSystem->release());
|
||||
}
|
||||
StudioSystem = nullptr;
|
||||
}
|
||||
|
||||
UFMODAsset* FFMODAssetTable::FindByName(const FString& Name)
|
||||
{
|
||||
TWeakObjectPtr<UFMODAsset>* FoundAsset = FullNameLookup.Find(Name);
|
||||
if (FoundAsset)
|
||||
{
|
||||
return FoundAsset->Get();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void FFMODAssetTable::Refresh()
|
||||
{
|
||||
if (StudioSystem == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const UFMODSettings& Settings = *GetDefault<UFMODSettings>();
|
||||
FString StringPath = Settings.GetMasterStringsBankPath();
|
||||
|
||||
UE_LOG(LogFMOD, Log, TEXT("Loading strings bank: %s"), *StringPath);
|
||||
|
||||
FMOD::Studio::Bank* StudioStringBank;
|
||||
FMOD_RESULT StringResult = StudioSystem->loadBankFile(TCHAR_TO_UTF8(*StringPath), FMOD_STUDIO_LOAD_BANK_NORMAL, &StudioStringBank);
|
||||
if (StringResult == FMOD_OK)
|
||||
{
|
||||
TArray<char> RawBuffer;
|
||||
RawBuffer.SetNum(256); // Initial capacity
|
||||
|
||||
int Count = 0;
|
||||
verifyfmod(StudioStringBank->getStringCount(&Count));
|
||||
for (int StringIdx=0; StringIdx<Count; ++StringIdx)
|
||||
{
|
||||
FMOD_RESULT Result;
|
||||
FMOD::Studio::ID Guid = {0};
|
||||
while (true)
|
||||
{
|
||||
int ActualSize = 0;
|
||||
Result = StudioStringBank->getStringInfo(StringIdx, &Guid, RawBuffer.GetData(), RawBuffer.Num(), &ActualSize);
|
||||
if (Result == FMOD_ERR_TRUNCATED)
|
||||
{
|
||||
RawBuffer.SetNum(ActualSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
verifyfmod(Result);
|
||||
FString AssetName(UTF8_TO_TCHAR(RawBuffer.GetData()));
|
||||
FGuid AssetGuid = FMODUtils::ConvertGuid(Guid);
|
||||
if (!AssetName.IsEmpty())
|
||||
{
|
||||
AddAsset(AssetGuid, AssetName);
|
||||
}
|
||||
}
|
||||
verifyfmod(StudioStringBank->unload());
|
||||
verifyfmod(StudioSystem->update());
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to load strings bank: %s"), *StringPath);
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODAssetTable::AddAsset(const FGuid& AssetGuid, const FString& AssetFullName)
|
||||
{
|
||||
FString AssetPath = AssetFullName;
|
||||
FString AssetType = "";
|
||||
FString AssetShortName = "asset";
|
||||
|
||||
int DelimIndex;
|
||||
if (AssetPath.FindChar(':', DelimIndex))
|
||||
{
|
||||
AssetType = AssetPath.Left(DelimIndex);
|
||||
AssetPath = AssetPath.Right(AssetPath.Len() - DelimIndex - 1);
|
||||
}
|
||||
|
||||
FString FormattedAssetType = "";
|
||||
UClass* AssetClass = UFMODAsset::StaticClass();
|
||||
if (AssetType.Equals(TEXT("event")))
|
||||
{
|
||||
FormattedAssetType = TEXT("Events");
|
||||
AssetClass = UFMODEvent::StaticClass();
|
||||
}
|
||||
else if (AssetType.Equals(TEXT("snapshot")))
|
||||
{
|
||||
FormattedAssetType = TEXT("Snapshots");
|
||||
AssetClass = UFMODSnapshot::StaticClass();
|
||||
}
|
||||
else if (AssetType.Equals(TEXT("bank")))
|
||||
{
|
||||
FormattedAssetType = TEXT("Banks");
|
||||
AssetClass = UFMODBank::StaticClass();
|
||||
}
|
||||
else if (AssetType.Equals(TEXT("bus")))
|
||||
{
|
||||
FormattedAssetType = TEXT("Buses");
|
||||
AssetClass = UFMODBus::StaticClass();
|
||||
}
|
||||
else if (AssetType.Equals(TEXT("vca")))
|
||||
{
|
||||
FormattedAssetType = TEXT("VCAs");
|
||||
AssetClass = UFMODVCA::StaticClass();
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Unknown asset type: %s"), *AssetType);
|
||||
}
|
||||
|
||||
if (AssetPath.FindLastChar('/', DelimIndex))
|
||||
{
|
||||
AssetShortName = AssetPath.Right(AssetPath.Len() - DelimIndex - 1);
|
||||
AssetPath = AssetPath.Left(AssetPath.Len() - AssetShortName.Len() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No path part, all name
|
||||
AssetShortName = AssetPath;
|
||||
AssetPath = TEXT("");
|
||||
}
|
||||
|
||||
if (AssetShortName.IsEmpty() || AssetShortName.Contains(TEXT(".strings")))
|
||||
{
|
||||
UE_LOG(LogFMOD, Log, TEXT("Skipping asset: %s"), *AssetFullName);
|
||||
return;
|
||||
}
|
||||
|
||||
AssetPath = AssetPath.Replace(TEXT(" "), TEXT("_"));
|
||||
AssetShortName = AssetShortName.Replace(TEXT(" "), TEXT("_"));
|
||||
|
||||
const UFMODSettings& Settings = *GetDefault<UFMODSettings>();
|
||||
|
||||
FString FolderPath = Settings.ContentBrowserPrefix;
|
||||
FolderPath += FormattedAssetType;
|
||||
FolderPath += AssetPath;
|
||||
|
||||
FString AssetPackagePath = FolderPath + TEXT("/") + AssetShortName;
|
||||
|
||||
FName AssetPackagePathName(*AssetPackagePath);
|
||||
|
||||
TWeakObjectPtr<UFMODAsset>& ExistingNameAsset = NameMap.FindOrAdd(AssetPackagePathName);
|
||||
TWeakObjectPtr<UFMODAsset>& ExistingGuidAsset = GuidMap.FindOrAdd(AssetGuid);
|
||||
TWeakObjectPtr<UFMODAsset>& ExistingFullNameLookupAsset = FullNameLookup.FindOrAdd(AssetFullName);
|
||||
|
||||
UFMODAsset* AssetNameObject = ExistingNameAsset.Get();
|
||||
if (AssetNameObject == nullptr)
|
||||
{
|
||||
UE_LOG(LogFMOD, Log, TEXT("Constructing asset: %s"), *AssetPackagePath);
|
||||
|
||||
UPackage* NewPackage = CreatePackage(NULL, *AssetPackagePath);
|
||||
if (NewPackage)
|
||||
{
|
||||
#if ENGINE_MINOR_VERSION >= 10
|
||||
NewPackage->SetPackageFlags(PKG_CompiledIn);
|
||||
#else
|
||||
NewPackage->PackageFlags |= PKG_CompiledIn;
|
||||
#endif
|
||||
|
||||
AssetNameObject = NewObject<UFMODAsset>(NewPackage, AssetClass, FName(*AssetShortName), RF_Standalone | RF_Public /* | RF_Transient */);
|
||||
AssetNameObject->AssetGuid = AssetGuid;
|
||||
AssetNameObject->bShowAsAsset = true;
|
||||
|
||||
#if WITH_EDITOR
|
||||
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
|
||||
AssetRegistryModule.Get().AddPath(*FolderPath);
|
||||
FAssetRegistryModule::AssetCreated(AssetNameObject);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to construct package for asset %s"), *AssetPackagePath);
|
||||
}
|
||||
|
||||
if (AssetClass == UFMODSnapshot::StaticClass())
|
||||
{
|
||||
FString ReverbFolderPath = Settings.ContentBrowserPrefix;
|
||||
ReverbFolderPath += TEXT("Reverbs");
|
||||
ReverbFolderPath += AssetPath;
|
||||
|
||||
FString ReverbAssetPackagePath = ReverbFolderPath + TEXT("/") + AssetShortName;
|
||||
|
||||
UPackage* ReverbPackage = CreatePackage(NULL, *ReverbAssetPackagePath);
|
||||
if (ReverbPackage)
|
||||
{
|
||||
#if ENGINE_MINOR_VERSION >= 10
|
||||
ReverbPackage->SetPackageFlags(PKG_CompiledIn);
|
||||
#else
|
||||
ReverbPackage->PackageFlags |= PKG_CompiledIn;
|
||||
#endif
|
||||
UFMODSnapshotReverb* AssetReverb = NewObject<UFMODSnapshotReverb>(ReverbPackage, UFMODSnapshotReverb::StaticClass(), FName(*AssetShortName), RF_Standalone | RF_Public /* | RF_Transient */);
|
||||
AssetReverb->AssetGuid = AssetGuid;
|
||||
AssetReverb->bShowAsAsset = true;
|
||||
|
||||
#if WITH_EDITOR
|
||||
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
|
||||
AssetRegistryModule.Get().AddPath(*ReverbFolderPath);
|
||||
FAssetRegistryModule::AssetCreated(AssetReverb);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UFMODAsset* AssetGuidObject = ExistingGuidAsset.Get();
|
||||
if (AssetGuidObject != nullptr && AssetGuidObject != AssetNameObject)
|
||||
{
|
||||
FString OldPath = AssetGuidObject->GetPathName();
|
||||
UE_LOG(LogFMOD, Log, TEXT("Hiding old asset '%s'"), *OldPath);
|
||||
|
||||
// We had an asset with the same guid but it must have been renamed
|
||||
// We just hide the old asset from the asset table
|
||||
AssetGuidObject->bShowAsAsset = false;
|
||||
|
||||
#if WITH_EDITOR
|
||||
FAssetRegistryModule::AssetRenamed(AssetNameObject, OldPath);
|
||||
#endif
|
||||
}
|
||||
|
||||
ExistingNameAsset = AssetNameObject;
|
||||
ExistingGuidAsset = AssetNameObject;
|
||||
ExistingFullNameLookupAsset = AssetNameObject;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAsset.h"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class System;
|
||||
}
|
||||
}
|
||||
|
||||
class FFMODAssetTable
|
||||
{
|
||||
public:
|
||||
FFMODAssetTable();
|
||||
~FFMODAssetTable();
|
||||
|
||||
void Create();
|
||||
void Destroy();
|
||||
|
||||
void Refresh();
|
||||
|
||||
UFMODAsset* FindByName(const FString& Name);
|
||||
|
||||
private:
|
||||
|
||||
void HandleBanksUpdated();
|
||||
void AddAsset(const FGuid& AssetGuid, const FString& AssetFullName);
|
||||
|
||||
private:
|
||||
FMOD::Studio::System* StudioSystem;
|
||||
TMap< FGuid, TWeakObjectPtr<UFMODAsset> > GuidMap;
|
||||
TMap< FName, TWeakObjectPtr<UFMODAsset> > NameMap;
|
||||
TMap< FString, TWeakObjectPtr<UFMODAsset> > FullNameLookup;
|
||||
};
|
||||
|
|
@ -0,0 +1,647 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODAudioComponent.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODListener.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
UFMODAudioComponent::UFMODAudioComponent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
bAutoDestroy = false;
|
||||
bAutoActivate = true;
|
||||
bEnableTimelineCallbacks = false; // Default OFF for efficiency
|
||||
bStopWhenOwnerDestroyed = true;
|
||||
bNeverNeedsRenderUpdate = true;
|
||||
#if WITH_EDITORONLY_DATA
|
||||
bVisualizeComponent = true;
|
||||
#endif
|
||||
bApplyAmbientVolumes = false;
|
||||
|
||||
PrimaryComponentTick.bCanEverTick = true;
|
||||
PrimaryComponentTick.TickGroup = TG_PrePhysics;
|
||||
|
||||
StudioInstance = nullptr;
|
||||
ProgrammerSound = nullptr;
|
||||
|
||||
InteriorLastUpdateTime = 0.0;
|
||||
SourceInteriorVolume = 0.0f;
|
||||
SourceInteriorLPF = 0.0f;
|
||||
CurrentInteriorVolume = 0.0f;
|
||||
CurrentInteriorLPF = 0.0f;
|
||||
}
|
||||
|
||||
FString UFMODAudioComponent::GetDetailedInfoInternal(void) const
|
||||
{
|
||||
FString Result;
|
||||
|
||||
if(Event)
|
||||
{
|
||||
Result = Event->GetPathName(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = TEXT("No_Event");
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
#if WITH_EDITORONLY_DATA
|
||||
void UFMODAudioComponent::OnRegister()
|
||||
{
|
||||
Super::OnRegister();
|
||||
|
||||
UpdateSpriteTexture();
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::UpdateSpriteTexture()
|
||||
{
|
||||
if (SpriteComponent)
|
||||
{
|
||||
if (bAutoActivate)
|
||||
{
|
||||
SpriteComponent->SetSprite(LoadObject<UTexture2D>(NULL, TEXT("/Engine/EditorResources/AudioIcons/S_AudioComponent_AutoActivate.S_AudioComponent_AutoActivate")));
|
||||
}
|
||||
else
|
||||
{
|
||||
SpriteComponent->SetSprite(LoadObject<UTexture2D>(NULL, TEXT("/Engine/EditorResources/AudioIcons/S_AudioComponent.S_AudioComponent")));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WITH_EDITOR
|
||||
void UFMODAudioComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
|
||||
{
|
||||
if (IsPlaying())
|
||||
{
|
||||
Stop();
|
||||
Play();
|
||||
}
|
||||
|
||||
#if WITH_EDITORONLY_DATA
|
||||
UpdateSpriteTexture();
|
||||
#endif
|
||||
|
||||
Super::PostEditChangeProperty(PropertyChangedEvent);
|
||||
}
|
||||
#endif // WITH_EDITOR
|
||||
|
||||
#if ENGINE_MINOR_VERSION >= 9
|
||||
void UFMODAudioComponent::OnUpdateTransform(bool bSkipPhysicsMove, ETeleportType Teleport)
|
||||
#else
|
||||
void UFMODAudioComponent::OnUpdateTransform(bool bSkipPhysicsMove)
|
||||
#endif
|
||||
{
|
||||
Super::OnUpdateTransform(bSkipPhysicsMove);
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_3D_ATTRIBUTES attr = {{0}};
|
||||
attr.position = FMODUtils::ConvertWorldVector(ComponentToWorld.GetLocation());
|
||||
attr.up = FMODUtils::ConvertUnitVector(ComponentToWorld.GetUnitAxis(EAxis::Z));
|
||||
attr.forward = FMODUtils::ConvertUnitVector(ComponentToWorld.GetUnitAxis(EAxis::X));
|
||||
|
||||
StudioInstance->set3DAttributes(&attr);
|
||||
|
||||
if (bApplyAmbientVolumes)
|
||||
{
|
||||
UpdateInteriorVolumes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Taken mostly from ActiveSound.cpp
|
||||
void UFMODAudioComponent::UpdateInteriorVolumes()
|
||||
{
|
||||
// Result of the ambient calculations to apply to the instance
|
||||
float AmbientVolumeMultiplier = 1.0f;
|
||||
float AmbientHighFrequencyGain = 1.0f;
|
||||
|
||||
FInteriorSettings Ambient;
|
||||
const FVector& Location = GetOwner()->GetTransform().GetTranslation();
|
||||
AAudioVolume* AudioVolume = GetWorld()->GetAudioSettings(Location, NULL, &Ambient);
|
||||
|
||||
const FFMODListener& Listener = IFMODStudioModule::Get().GetNearestListener(Location);
|
||||
if( InteriorLastUpdateTime < Listener.InteriorStartTime )
|
||||
{
|
||||
SourceInteriorVolume = CurrentInteriorVolume;
|
||||
SourceInteriorLPF = CurrentInteriorLPF;
|
||||
InteriorLastUpdateTime = FApp::GetCurrentTime();
|
||||
}
|
||||
|
||||
|
||||
bool bAllowSpatialization = true;
|
||||
if( Listener.Volume == AudioVolume || !bAllowSpatialization )
|
||||
{
|
||||
// Ambient and listener in same ambient zone
|
||||
CurrentInteriorVolume = ( SourceInteriorVolume * ( 1.0f - Listener.InteriorVolumeInterp ) ) + Listener.InteriorVolumeInterp;
|
||||
AmbientVolumeMultiplier *= CurrentInteriorVolume;
|
||||
|
||||
CurrentInteriorLPF = ( SourceInteriorLPF * ( 1.0f - Listener.InteriorLPFInterp ) ) + Listener.InteriorLPFInterp;
|
||||
AmbientHighFrequencyGain *= CurrentInteriorLPF;
|
||||
|
||||
//UE_LOG(LogFMOD, Verbose, TEXT( "Ambient in same volume. Volume *= %g LPF *= %g" ), CurrentInteriorVolume, CurrentInteriorLPF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ambient and listener in different ambient zone
|
||||
if( Ambient.bIsWorldSettings )
|
||||
{
|
||||
// The ambient sound is 'outside' - use the listener's exterior volume
|
||||
CurrentInteriorVolume = ( SourceInteriorVolume * ( 1.0f - Listener.ExteriorVolumeInterp ) ) + ( Listener.InteriorSettings.ExteriorVolume * Listener.ExteriorVolumeInterp );
|
||||
AmbientVolumeMultiplier *= CurrentInteriorVolume;
|
||||
|
||||
CurrentInteriorLPF = ( SourceInteriorLPF * ( 1.0f - Listener.ExteriorLPFInterp ) ) + ( Listener.InteriorSettings.ExteriorLPF * Listener.ExteriorLPFInterp );
|
||||
AmbientHighFrequencyGain *= CurrentInteriorLPF;
|
||||
|
||||
//UE_LOG(LogFMOD, Verbose, TEXT( "Ambient in diff volume, ambient outside. Volume *= %g LPF *= %g" ), CurrentInteriorVolume, CurrentInteriorLPF);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The ambient sound is 'inside' - use the ambient sound's interior volume multiplied with the listeners exterior volume
|
||||
CurrentInteriorVolume = (( SourceInteriorVolume * ( 1.0f - Listener.InteriorVolumeInterp ) ) + ( Ambient.InteriorVolume * Listener.InteriorVolumeInterp ))
|
||||
* (( SourceInteriorVolume * ( 1.0f - Listener.ExteriorVolumeInterp ) ) + ( Listener.InteriorSettings.ExteriorVolume * Listener.ExteriorVolumeInterp ));
|
||||
AmbientVolumeMultiplier *= CurrentInteriorVolume;
|
||||
|
||||
CurrentInteriorLPF = (( SourceInteriorLPF * ( 1.0f - Listener.InteriorLPFInterp ) ) + ( Ambient.InteriorLPF * Listener.InteriorLPFInterp ))
|
||||
* (( SourceInteriorLPF * ( 1.0f - Listener.ExteriorLPFInterp ) ) + ( Listener.InteriorSettings.ExteriorLPF * Listener.ExteriorLPFInterp ));
|
||||
AmbientHighFrequencyGain *= CurrentInteriorLPF;
|
||||
|
||||
//UE_LOG(LogFMOD, Verbose, TEXT( "Ambient in diff volume, ambient inside. Volume *= %g LPF *= %g" ), CurrentInteriorVolume, CurrentInteriorLPF);
|
||||
}
|
||||
}
|
||||
|
||||
StudioInstance->setVolume(AmbientVolumeMultiplier);
|
||||
|
||||
FMOD::ChannelGroup* ChanGroup = nullptr;
|
||||
StudioInstance->getChannelGroup(&ChanGroup);
|
||||
if (ChanGroup)
|
||||
{
|
||||
int NumDSP = 0;
|
||||
ChanGroup->getNumDSPs(&NumDSP);
|
||||
for (int Index=0; Index<NumDSP; ++Index)
|
||||
{
|
||||
FMOD::DSP* ChanDSP = nullptr;
|
||||
ChanGroup->getDSP(Index, &ChanDSP);
|
||||
if (ChanDSP)
|
||||
{
|
||||
FMOD_DSP_TYPE DSPType = FMOD_DSP_TYPE_UNKNOWN;
|
||||
ChanDSP->getType(&DSPType);
|
||||
if (DSPType == FMOD_DSP_TYPE_LOWPASS || DSPType == FMOD_DSP_TYPE_LOWPASS_SIMPLE)
|
||||
{
|
||||
static float MAX_FREQUENCY = 8000.0f;
|
||||
float Frequency = MAX_FREQUENCY * AmbientHighFrequencyGain;
|
||||
ChanDSP->setParameterFloat(FMOD_DSP_LOWPASS_CUTOFF, MAX_FREQUENCY * AmbientHighFrequencyGain);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::OnUnregister()
|
||||
{
|
||||
// Route OnUnregister event.
|
||||
Super::OnUnregister();
|
||||
|
||||
// Don't stop audio and clean up component if owner has been destroyed (default behaviour). This function gets
|
||||
// called from AActor::ClearComponents when an actor gets destroyed which is not usually what we want for one-
|
||||
// shot sounds.
|
||||
AActor* Owner = GetOwner();
|
||||
if (!Owner || bStopWhenOwnerDestroyed )
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
if (StudioInstance)
|
||||
{
|
||||
StudioInstance->setCallback(nullptr);
|
||||
StudioInstance->release();
|
||||
StudioInstance = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
|
||||
{
|
||||
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
|
||||
|
||||
if (bIsActive)
|
||||
{
|
||||
if (bApplyAmbientVolumes && IFMODStudioModule::Get().HasListenerMoved())
|
||||
{
|
||||
UpdateInteriorVolumes();
|
||||
}
|
||||
|
||||
TArray<FTimelineMarkerProperties> LocalMarkerQueue;
|
||||
TArray<FTimelineBeatProperties> LocalBeatQueue;
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
Swap(LocalMarkerQueue, CallbackMarkerQueue);
|
||||
Swap(LocalBeatQueue, CallbackBeatQueue);
|
||||
}
|
||||
|
||||
for(const FTimelineMarkerProperties& EachProps : LocalMarkerQueue)
|
||||
{
|
||||
OnTimelineMarker.Broadcast(EachProps.Name, EachProps.Position);
|
||||
}
|
||||
for(const FTimelineBeatProperties& EachProps : LocalBeatQueue)
|
||||
{
|
||||
OnTimelineBeat.Broadcast(EachProps.Bar, EachProps.Beat, EachProps.Position, EachProps.Tempo, EachProps.TimeSignatureUpper, EachProps.TimeSignatureLower);
|
||||
}
|
||||
|
||||
FMOD_STUDIO_PLAYBACK_STATE state = FMOD_STUDIO_PLAYBACK_STOPPED;
|
||||
StudioInstance->getPlaybackState(&state);
|
||||
if (state == FMOD_STUDIO_PLAYBACK_STOPPED)
|
||||
{
|
||||
OnPlaybackCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetEvent(UFMODEvent* NewEvent)
|
||||
{
|
||||
const bool bPlay = IsPlaying();
|
||||
|
||||
Stop();
|
||||
Event = NewEvent;
|
||||
|
||||
if (bPlay)
|
||||
{
|
||||
Play();
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::PostLoad()
|
||||
{
|
||||
Super::PostLoad();
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::Activate(bool bReset)
|
||||
{
|
||||
if (bReset || ShouldActivate()==true)
|
||||
{
|
||||
Play();
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::Deactivate()
|
||||
{
|
||||
if (ShouldActivate()==false)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
FMOD_RESULT F_CALLBACK UFMODAudioComponent_EventCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters)
|
||||
{
|
||||
UFMODAudioComponent* Component = nullptr;
|
||||
FMOD::Studio::EventInstance* Instance = (FMOD::Studio::EventInstance*)event;
|
||||
if (Instance->getUserData((void**)&Component) == FMOD_OK && Component != nullptr)
|
||||
{
|
||||
if (type == FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER && Component->bEnableTimelineCallbacks)
|
||||
{
|
||||
Component->EventCallbackAddMarker((FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES*)parameters);
|
||||
}
|
||||
else if (type == FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT && Component->bEnableTimelineCallbacks)
|
||||
{
|
||||
Component->EventCallbackAddBeat((FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES*)parameters);
|
||||
}
|
||||
else if (type == FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND)
|
||||
{
|
||||
Component->EventCallbackCreateProgrammerSound((FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES*)parameters);
|
||||
}
|
||||
else if (type == FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND)
|
||||
{
|
||||
Component->EventCallbackDestroyProgrammerSound((FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES*)parameters);
|
||||
}
|
||||
}
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::EventCallbackAddMarker(FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES* props)
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
FTimelineMarkerProperties info;
|
||||
info.Name = props->name;
|
||||
info.Position = props->position;
|
||||
CallbackMarkerQueue.Push(info);
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::EventCallbackAddBeat(FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES* props)
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
FTimelineBeatProperties info;
|
||||
info.Bar = props->bar;
|
||||
info.Beat = props->beat;
|
||||
info.Position = props->position;
|
||||
info.Tempo = props->tempo;
|
||||
info.TimeSignatureUpper = props->timeSignatureUpper;
|
||||
info.TimeSignatureLower = props->timeSignatureLower;
|
||||
CallbackBeatQueue.Push(info);
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::EventCallbackCreateProgrammerSound(FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* props)
|
||||
{
|
||||
// Make sure name isn't being changed as we are reading it
|
||||
FString ProgrammerSoundNameCopy;
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
ProgrammerSoundNameCopy = ProgrammerSoundName;
|
||||
}
|
||||
|
||||
if (ProgrammerSound)
|
||||
{
|
||||
props->sound = (FMOD_SOUND*)ProgrammerSound;
|
||||
props->subsoundIndex = -1;
|
||||
}
|
||||
else if (ProgrammerSoundNameCopy.Len() || strlen(props->name) != 0)
|
||||
{
|
||||
FMOD::Studio::System* System = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
FMOD::System* LowLevelSystem = nullptr;
|
||||
System->getLowLevelSystem(&LowLevelSystem);
|
||||
FString SoundName = ProgrammerSoundNameCopy.Len() ? ProgrammerSoundNameCopy : UTF8_TO_TCHAR(props->name);
|
||||
|
||||
if (SoundName.Contains(TEXT(".")))
|
||||
{
|
||||
// Load via file
|
||||
FString SoundPath = SoundName;
|
||||
if (FPaths::IsRelative(SoundPath))
|
||||
{
|
||||
SoundPath = FPaths::GameContentDir() / SoundPath;
|
||||
}
|
||||
|
||||
FMOD::Sound* Sound = nullptr;
|
||||
if (LowLevelSystem->createSound(TCHAR_TO_UTF8(*SoundPath), FMOD_DEFAULT, nullptr, &Sound) == FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("Creating programmer sound from file '%s'"), *SoundPath);
|
||||
props->sound = (FMOD_SOUND*)Sound;
|
||||
props->subsoundIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to load programmer sound file '%s'"), *SoundPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load via FMOD Studio asset table
|
||||
FMOD_STUDIO_SOUND_INFO SoundInfo = {0};
|
||||
FMOD_RESULT Result = System->getSoundInfo(TCHAR_TO_UTF8(*SoundName), &SoundInfo);
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
FMOD::Sound* Sound = nullptr;
|
||||
Result = LowLevelSystem->createSound(SoundInfo.name_or_data, SoundInfo.mode, &SoundInfo.exinfo, &Sound);
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("Creating programmer sound using audio entry '%s'"), *SoundName);
|
||||
|
||||
props->sound = (FMOD_SOUND*)Sound;
|
||||
props->subsoundIndex = SoundInfo.subsoundIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to load FMOD audio entry '%s'"), *SoundName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to find FMOD audio entry '%s'"), *SoundName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::EventCallbackDestroyProgrammerSound(FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES* props)
|
||||
{
|
||||
if (props->sound && ProgrammerSound == nullptr)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("Destroying programmer sound"));
|
||||
FMOD_RESULT Result = ((FMOD::Sound*)props->sound)->release();
|
||||
verifyfmod(Result);
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetProgrammerSoundName(FString Value)
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
ProgrammerSoundName = Value;
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetProgrammerSound(FMOD::Sound* Sound)
|
||||
{
|
||||
FScopeLock Lock(&CallbackLock);
|
||||
ProgrammerSound = Sound;
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::Play()
|
||||
{
|
||||
Stop();
|
||||
|
||||
if (!FMODUtils::IsWorldAudible(GetWorld()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("UFMODAudioComponent %p Play"), this);
|
||||
|
||||
// Only play events in PIE/game, not when placing them in the editor
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(Event.Get());
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
FMOD_RESULT result = EventDesc->createInstance(&StudioInstance);
|
||||
if (StudioInstance != nullptr)
|
||||
{
|
||||
FMOD_STUDIO_USER_PROPERTY UserProp = {0};
|
||||
if (EventDesc->getUserProperty("Ambient", &UserProp) == FMOD_OK)
|
||||
{
|
||||
if (UserProp.type == FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT) // All numbers are stored as float
|
||||
{
|
||||
bApplyAmbientVolumes = (UserProp.floatValue != 0.0f);
|
||||
}
|
||||
}
|
||||
OnUpdateTransform(true);
|
||||
// Set initial parameters
|
||||
for (auto Kvp : StoredParameters)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setParameterValue(TCHAR_TO_UTF8(*Kvp.Key.ToString()), Kvp.Value);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set initial parameter %s"), *Kvp.Key.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
verifyfmod(StudioInstance->setUserData(this));
|
||||
verifyfmod(StudioInstance->setCallback(UFMODAudioComponent_EventCallback));
|
||||
verifyfmod(StudioInstance->start());
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("Playing component %p"), this);
|
||||
bIsActive = true;
|
||||
SetComponentTickEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::Stop()
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("UFMODAudioComponent %p Stop"), this);
|
||||
if (StudioInstance)
|
||||
{
|
||||
StudioInstance->stop(FMOD_STUDIO_STOP_ALLOWFADEOUT);
|
||||
StudioInstance->setCallback(nullptr);
|
||||
StudioInstance->release();
|
||||
StudioInstance = nullptr;
|
||||
}
|
||||
InteriorLastUpdateTime = 0.0;
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::TriggerCue()
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("UFMODAudioComponent %p TriggerCue"), this);
|
||||
if (StudioInstance)
|
||||
{
|
||||
// Studio only supports a single cue so try to get it
|
||||
FMOD::Studio::CueInstance* Cue = nullptr;
|
||||
StudioInstance->getCueByIndex(0, &Cue);
|
||||
if (Cue)
|
||||
{
|
||||
Cue->trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::OnPlaybackCompleted()
|
||||
{
|
||||
// Mark inactive before calling destroy to avoid recursion
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("UFMODAudioComponent %p PlaybackCompleted"), this);
|
||||
bIsActive = false;
|
||||
SetComponentTickEnabled(false);
|
||||
|
||||
OnEventStopped.Broadcast();
|
||||
|
||||
if (StudioInstance)
|
||||
{
|
||||
StudioInstance->setCallback(nullptr);
|
||||
StudioInstance->release();
|
||||
StudioInstance = nullptr;
|
||||
}
|
||||
|
||||
// Auto destruction is handled via marking object for deletion.
|
||||
if (bAutoDestroy)
|
||||
{
|
||||
DestroyComponent();
|
||||
}
|
||||
}
|
||||
|
||||
bool UFMODAudioComponent::IsPlaying( void )
|
||||
{
|
||||
return bIsActive;
|
||||
}
|
||||
|
||||
|
||||
void UFMODAudioComponent::SetVolume(float Volume)
|
||||
{
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setVolume(Volume);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set volume"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetPitch(float Pitch)
|
||||
{
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setPitch(Pitch);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set pitch"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetPaused(bool Paused)
|
||||
{
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setPaused(Paused);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to pause"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetParameter(FName Name, float Value)
|
||||
{
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setParameterValue(TCHAR_TO_UTF8(*Name.ToString()), Value);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set parameter %s"), *Name.ToString());
|
||||
}
|
||||
}
|
||||
StoredParameters.FindOrAdd(Name) = Value;
|
||||
}
|
||||
|
||||
void UFMODAudioComponent::SetTimelinePosition(int32 Time)
|
||||
{
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->setTimelinePosition(Time);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set timeline position"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int32 UFMODAudioComponent::GetTimelinePosition()
|
||||
{
|
||||
int Time = 0;
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD_RESULT Result = StudioInstance->getTimelinePosition(&Time);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to get timeline position"));
|
||||
}
|
||||
}
|
||||
return Time;
|
||||
}
|
||||
|
||||
|
||||
float UFMODAudioComponent::GetParameter(FName Name)
|
||||
{
|
||||
float Value = 0.0f;
|
||||
float* StoredParam = StoredParameters.Find(Name);
|
||||
if (StoredParam)
|
||||
{
|
||||
Value = *StoredParam;
|
||||
}
|
||||
if (StudioInstance)
|
||||
{
|
||||
FMOD::Studio::ParameterInstance* ParamInst = nullptr;
|
||||
FMOD_RESULT Result = StudioInstance->getParameter(TCHAR_TO_UTF8(*Name.ToString()), &ParamInst);
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
float QueryValue;
|
||||
Result = ParamInst->getValue(&QueryValue);
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
Value = QueryValue;
|
||||
}
|
||||
}
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to get parameter %s"), *Name.ToString());
|
||||
}
|
||||
}
|
||||
return Value;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODBank.h"
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
UFMODBank::UFMODBank(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get tags to show in content view */
|
||||
void UFMODBank::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
|
||||
{
|
||||
Super::GetAssetRegistryTags(OutTags);
|
||||
}
|
||||
|
||||
FString UFMODBank::GetDesc()
|
||||
{
|
||||
return FString::Printf( TEXT( "Bank %s" ), *AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces) );
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODBankUpdateNotifier.h"
|
||||
#include "FMODSettings.h"
|
||||
|
||||
FFMODBankUpdateNotifier::FFMODBankUpdateNotifier()
|
||||
: bUpdateEnabled(true),
|
||||
NextRefreshTime(FDateTime::MinValue())
|
||||
{
|
||||
}
|
||||
|
||||
void FFMODBankUpdateNotifier::SetFilePath(const FString& InPath)
|
||||
{
|
||||
FilePath = InPath;
|
||||
NextRefreshTime = FDateTime::MinValue();
|
||||
FileTime = FDateTime::MinValue();
|
||||
}
|
||||
|
||||
void FFMODBankUpdateNotifier::Update()
|
||||
{
|
||||
if (bUpdateEnabled)
|
||||
{
|
||||
FDateTime CurTime = FDateTime::UtcNow();
|
||||
if (CurTime >= NextRefreshTime)
|
||||
{
|
||||
NextRefreshTime = CurTime + FTimespan(0, 0, 1);
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODBankUpdateNotifier::EnableUpdate(bool bEnable)
|
||||
{
|
||||
bUpdateEnabled = bEnable;
|
||||
|
||||
if (bEnable)
|
||||
{
|
||||
// Refreshing right after update is enabled is not desirable
|
||||
NextRefreshTime = FDateTime::UtcNow() + FTimespan(0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODBankUpdateNotifier::Refresh()
|
||||
{
|
||||
if (!FilePath.IsEmpty())
|
||||
{
|
||||
const FDateTime NewFileTime = IFileManager::Get().GetTimeStamp(*FilePath);
|
||||
if (NewFileTime != FileTime)
|
||||
{
|
||||
FileTime = NewFileTime;
|
||||
UE_LOG(LogFMOD, Log, TEXT("File has changed: %s"), *FilePath);
|
||||
|
||||
BanksUpdatedEvent.Broadcast();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
class FFMODBankUpdateNotifier
|
||||
{
|
||||
public:
|
||||
FFMODBankUpdateNotifier();
|
||||
|
||||
void SetFilePath(const FString& InPath);
|
||||
void Update();
|
||||
|
||||
void EnableUpdate(bool bEnable);
|
||||
|
||||
FSimpleMulticastDelegate BanksUpdatedEvent;
|
||||
|
||||
private:
|
||||
void Refresh();
|
||||
|
||||
bool bUpdateEnabled;
|
||||
FString FilePath;
|
||||
FDateTime NextRefreshTime;
|
||||
FDateTime FileTime;
|
||||
};
|
|
@ -0,0 +1,409 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODBlueprintStatics.h"
|
||||
#include "FMODAudioComponent.h"
|
||||
#include "FMODSettings.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "FMODBank.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODBus.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// UFMODBlueprintStatics
|
||||
|
||||
UFMODBlueprintStatics::UFMODBlueprintStatics(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
FFMODEventInstance UFMODBlueprintStatics::PlayEvent2D(UObject* WorldContextObject, class UFMODEvent* Event, bool bAutoPlay)
|
||||
{
|
||||
return PlayEventAtLocation(WorldContextObject, Event, FTransform(), bAutoPlay);
|
||||
}
|
||||
|
||||
FFMODEventInstance UFMODBlueprintStatics::PlayEventAtLocation(UObject* WorldContextObject, class UFMODEvent* Event, const FTransform& Location, bool bAutoPlay)
|
||||
{
|
||||
FFMODEventInstance Instance;
|
||||
Instance.Instance = nullptr;
|
||||
|
||||
UWorld* ThisWorld = GEngine->GetWorldFromContextObject(WorldContextObject);
|
||||
if (FMODUtils::IsWorldAudible(ThisWorld))
|
||||
{
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(Event);
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
FMOD::Studio::EventInstance* EventInst = nullptr;
|
||||
EventDesc->createInstance(&EventInst);
|
||||
if (EventInst != nullptr)
|
||||
{
|
||||
FMOD_3D_ATTRIBUTES EventAttr = { { 0 } };
|
||||
FMODUtils::Assign(EventAttr, Location);
|
||||
EventInst->set3DAttributes(&EventAttr);
|
||||
|
||||
if (bAutoPlay)
|
||||
{
|
||||
EventInst->start();
|
||||
EventInst->release();
|
||||
}
|
||||
Instance.Instance = EventInst;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Instance;
|
||||
}
|
||||
|
||||
class UFMODAudioComponent* UFMODBlueprintStatics::PlayEventAttached(class UFMODEvent* Event, class USceneComponent* AttachToComponent, FName AttachPointName, FVector Location, EAttachLocation::Type LocationType, bool bStopWhenAttachedToDestroyed, bool bAutoPlay)
|
||||
{
|
||||
if (Event == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
if (AttachToComponent == nullptr)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("UFMODBlueprintStatics::PlayEventAttached: NULL AttachComponent specified!"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AActor* Actor = AttachToComponent->GetOwner();
|
||||
|
||||
// Avoid creating component if we're trying to play a sound on an already destroyed actor.
|
||||
if (Actor && Actor->IsPendingKill())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UFMODAudioComponent* AudioComponent;
|
||||
if( Actor )
|
||||
{
|
||||
// Use actor as outer if we have one.
|
||||
AudioComponent = NewObject<UFMODAudioComponent>(Actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Let engine pick the outer (transient package).
|
||||
AudioComponent = NewObject<UFMODAudioComponent>();
|
||||
}
|
||||
check( AudioComponent );
|
||||
AudioComponent->Event = Event;
|
||||
AudioComponent->bAutoActivate = false;
|
||||
AudioComponent->bAutoDestroy = true;
|
||||
AudioComponent->bStopWhenOwnerDestroyed = bStopWhenAttachedToDestroyed;
|
||||
#if WITH_EDITORONLY_DATA
|
||||
AudioComponent->bVisualizeComponent = false;
|
||||
#endif
|
||||
AudioComponent->RegisterComponentWithWorld(AttachToComponent->GetWorld());
|
||||
|
||||
AudioComponent->AttachTo(AttachToComponent, AttachPointName);
|
||||
if (LocationType == EAttachLocation::KeepWorldPosition)
|
||||
{
|
||||
AudioComponent->SetWorldLocation(Location);
|
||||
}
|
||||
else
|
||||
{
|
||||
AudioComponent->SetRelativeLocation(Location);
|
||||
}
|
||||
|
||||
if (bAutoPlay)
|
||||
{
|
||||
AudioComponent->Play();
|
||||
}
|
||||
return AudioComponent;
|
||||
}
|
||||
|
||||
UFMODAsset* UFMODBlueprintStatics::FindAssetByName(const FString& Name)
|
||||
{
|
||||
return IFMODStudioModule::Get().FindAssetByName(Name);
|
||||
}
|
||||
|
||||
UFMODEvent* UFMODBlueprintStatics::FindEventByName(const FString& Name)
|
||||
{
|
||||
return IFMODStudioModule::Get().FindEventByName(Name);
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::LoadBank(class UFMODBank* Bank, bool bBlocking, bool bLoadSampleData)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bank != nullptr)
|
||||
{
|
||||
UE_LOG(LogFMOD, Log, TEXT("LoadBank %s"), *Bank->GetName());
|
||||
|
||||
const UFMODSettings& Settings = *GetDefault<UFMODSettings>();
|
||||
FString BankPath = Settings.GetFullBankPath() / (Bank->GetName() + TEXT(".bank"));
|
||||
|
||||
FMOD::Studio::Bank* bank = nullptr;
|
||||
FMOD_STUDIO_LOAD_BANK_FLAGS flags = bBlocking ? FMOD_STUDIO_LOAD_BANK_NORMAL : FMOD_STUDIO_LOAD_BANK_NONBLOCKING;
|
||||
FMOD_RESULT result = StudioSystem->loadBankFile(TCHAR_TO_UTF8(*BankPath), flags, &bank);
|
||||
if ( result == FMOD_OK && bank != nullptr && bLoadSampleData )
|
||||
{
|
||||
// Make sure bank is ready to load sample data from
|
||||
StudioSystem->flushCommands();
|
||||
bank->loadSampleData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::UnloadBank(class UFMODBank* Bank)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bank != nullptr)
|
||||
{
|
||||
UE_LOG(LogFMOD, Log, TEXT("UnloadBank %s"), *Bank->GetName());
|
||||
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bank->AssetGuid);
|
||||
FMOD::Studio::Bank* bank = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBankByID(&guid, &bank);
|
||||
if (result == FMOD_OK && bank != nullptr)
|
||||
{
|
||||
bank->unload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::LoadBankSampleData(class UFMODBank* Bank)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bank != nullptr)
|
||||
{
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bank->AssetGuid);
|
||||
FMOD::Studio::Bank* bank = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBankByID(&guid, &bank);
|
||||
if (result == FMOD_OK && bank != nullptr)
|
||||
{
|
||||
bank->loadSampleData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::UnloadBankSampleData(class UFMODBank* Bank)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bank != nullptr)
|
||||
{
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bank->AssetGuid);
|
||||
FMOD::Studio::Bank* bank = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBankByID(&guid, &bank);
|
||||
if (result == FMOD_OK && bank != nullptr)
|
||||
{
|
||||
bank->unloadSampleData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::LoadEventSampleData(UObject* WorldContextObject, class UFMODEvent* Event)
|
||||
{
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(Event);
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
EventDesc->loadSampleData();
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::UnloadEventSampleData(UObject* WorldContextObject, class UFMODEvent* Event)
|
||||
{
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(Event);
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
EventDesc->unloadSampleData();
|
||||
}
|
||||
}
|
||||
|
||||
TArray<FFMODEventInstance> UFMODBlueprintStatics::FindEventInstances(UObject* WorldContextObject, UFMODEvent* Event)
|
||||
{
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(Event);
|
||||
TArray<FFMODEventInstance> Instances;
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
int Capacity = 0;
|
||||
EventDesc->getInstanceCount(&Capacity);
|
||||
TArray<FMOD::Studio::EventInstance*> InstancePointers;
|
||||
InstancePointers.SetNum(Capacity, true);
|
||||
int Count = 0;
|
||||
EventDesc->getInstanceList(InstancePointers.GetData(), Capacity, &Count);
|
||||
Instances.SetNum(Count, true);
|
||||
for (int i=0; i<Count; ++i)
|
||||
{
|
||||
Instances[i].Instance = InstancePointers[i];
|
||||
}
|
||||
}
|
||||
return Instances;
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::BusSetFaderLevel(class UFMODBus* Bus, float Level)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bus != nullptr)
|
||||
{
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bus->AssetGuid);
|
||||
FMOD::Studio::Bus* bus = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBusByID(&guid, &bus);
|
||||
if (result == FMOD_OK && bus != nullptr)
|
||||
{
|
||||
bus->setFaderLevel(Level);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::BusSetPaused(class UFMODBus* Bus, bool bPaused)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bus != nullptr)
|
||||
{
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bus->AssetGuid);
|
||||
FMOD::Studio::Bus* bus = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBusByID(&guid, &bus);
|
||||
if (result == FMOD_OK && bus != nullptr)
|
||||
{
|
||||
bus->setPaused(bPaused);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::BusSetMute(class UFMODBus* Bus, bool bMute)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
|
||||
if (StudioSystem != nullptr && Bus != nullptr)
|
||||
{
|
||||
FMOD::Studio::ID guid = FMODUtils::ConvertGuid(Bus->AssetGuid);
|
||||
FMOD::Studio::Bus* bus = nullptr;
|
||||
FMOD_RESULT result = StudioSystem->getBusByID(&guid, &bus);
|
||||
if (result == FMOD_OK && bus != nullptr)
|
||||
{
|
||||
bus->setMute(bMute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool UFMODBlueprintStatics::EventInstanceIsValid(FFMODEventInstance EventInstance)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
return EventInstance.Instance->isValid();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceSetVolume(FFMODEventInstance EventInstance, float Volume)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->setVolume(Volume);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set event instance volume"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceSetPitch(FFMODEventInstance EventInstance, float Pitch)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->setPitch(Pitch);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set event instance pitch"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceSetPaused(FFMODEventInstance EventInstance, bool Paused)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->setPaused(Paused);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to pause event instance"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceSetParameter(FFMODEventInstance EventInstance, FName Name, float Value)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->setParameterValue(TCHAR_TO_UTF8(*Name.ToString()), Value);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set event instance parameter %s"), *Name.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float UFMODBlueprintStatics::EventInstanceGetParameter(FFMODEventInstance EventInstance, FName Name)
|
||||
{
|
||||
float Value = 0.0f;
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD::Studio::ParameterInstance* ParamInst = nullptr;
|
||||
FMOD_RESULT Result = EventInstance.Instance->getParameter(TCHAR_TO_UTF8(*Name.ToString()), &ParamInst);
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
Result = ParamInst->getValue(&Value);
|
||||
}
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to get event instance parameter %s"), *Name.ToString());
|
||||
}
|
||||
}
|
||||
return Value;
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstancePlay(FFMODEventInstance EventInstance)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->start();
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to play event instance"));
|
||||
}
|
||||
// Once we start playing, allow instance to be cleaned up when it finishes
|
||||
EventInstance.Instance->release();
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceStop(FFMODEventInstance EventInstance)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_RESULT Result = EventInstance.Instance->stop(FMOD_STUDIO_STOP_ALLOWFADEOUT);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to stop event instance"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceTriggerCue(FFMODEventInstance EventInstance)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
// Studio only supports a single cue so try to get it
|
||||
FMOD::Studio::CueInstance* Cue = nullptr;
|
||||
EventInstance.Instance->getCueByIndex(0, &Cue);
|
||||
if (Cue)
|
||||
{
|
||||
Cue->trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UFMODBlueprintStatics::EventInstanceSetTransform(FFMODEventInstance EventInstance, const FTransform& Location)
|
||||
{
|
||||
if (EventInstance.Instance)
|
||||
{
|
||||
FMOD_3D_ATTRIBUTES attr = {{0}};
|
||||
FMODUtils::Assign(attr, Location);
|
||||
FMOD_RESULT Result = EventInstance.Instance->set3DAttributes(&attr);
|
||||
if (Result != FMOD_OK)
|
||||
{
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Failed to set transform on event instance"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODBus.h"
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
UFMODBus::UFMODBus(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get tags to show in content view */
|
||||
void UFMODBus::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
|
||||
{
|
||||
Super::GetAssetRegistryTags(OutTags);
|
||||
}
|
||||
|
||||
FString UFMODBus::GetDesc()
|
||||
{
|
||||
return FString::Printf( TEXT( "Bus %s" ), *AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces) );
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
UFMODEvent::UFMODEvent(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get tags to show in content view */
|
||||
void UFMODEvent::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
|
||||
{
|
||||
Super::GetAssetRegistryTags(OutTags);
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(this, EFMODSystemContext::Auditioning);
|
||||
|
||||
bool bOneshot = false;
|
||||
bool bStream = false;
|
||||
bool b3D = false;
|
||||
if (EventDesc)
|
||||
{
|
||||
EventDesc->isOneshot(&bOneshot);
|
||||
EventDesc->isStream(&bStream);
|
||||
EventDesc->is3D(&b3D);
|
||||
}
|
||||
|
||||
OutTags.Add(UObject::FAssetRegistryTag("Oneshot", bOneshot ? TEXT("True") : TEXT("False"), UObject::FAssetRegistryTag::TT_Alphabetical));
|
||||
OutTags.Add(UObject::FAssetRegistryTag("Streaming", bStream ? TEXT("True") : TEXT("False"), UObject::FAssetRegistryTag::TT_Alphabetical));
|
||||
OutTags.Add(UObject::FAssetRegistryTag("3D", b3D ? TEXT("True") : TEXT("False"), UObject::FAssetRegistryTag::TT_Alphabetical));
|
||||
}
|
||||
|
||||
FString UFMODEvent::GetDesc()
|
||||
{
|
||||
return FString::Printf( TEXT( "Event %s" ), *AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces) );
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODFileCallbacks.h"
|
||||
#include "FMODUtils.h"
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODLogCallback(FMOD_DEBUG_FLAGS flags, const char *file, int line, const char *func, const char *message)
|
||||
{
|
||||
if (flags & FMOD_DEBUG_LEVEL_ERROR)
|
||||
{
|
||||
UE_LOG(LogFMOD, Error, TEXT("%s(%d) - %s"), UTF8_TO_TCHAR(file), line, UTF8_TO_TCHAR(message));
|
||||
}
|
||||
else if (flags & FMOD_DEBUG_LEVEL_WARNING)
|
||||
{
|
||||
FString Message = UTF8_TO_TCHAR(message);
|
||||
UE_LOG(LogFMOD, Warning, TEXT("%s(%d) - %s"), UTF8_TO_TCHAR(file), line, *Message);
|
||||
if (GIsEditor)
|
||||
{
|
||||
int32 StartIndex = Message.Find(TEXT("Missing DSP plugin '"));
|
||||
if (StartIndex != INDEX_NONE)
|
||||
{
|
||||
int32 Len = FString(TEXT("Missing DSP plugin '")).Len();
|
||||
int32 EndIndex;
|
||||
if (Message.FindLastChar('\'', EndIndex) && EndIndex != INDEX_NONE && StartIndex+Len < EndIndex)
|
||||
{
|
||||
FString PluginName = Message.Mid(StartIndex + Len, EndIndex - StartIndex - Len);
|
||||
IFMODStudioModule::Get().AddRequiredPlugin(PluginName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("%s(%d) - %s"), UTF8_TO_TCHAR(file), line, UTF8_TO_TCHAR(message));
|
||||
}
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODOpen(const char *name, unsigned int *filesize, void **handle, void * /*userdata*/)
|
||||
{
|
||||
if (name)
|
||||
{
|
||||
FArchive* Archive = IFileManager::Get().CreateFileReader(UTF8_TO_TCHAR(name));
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FMODOpen Opening '%s' returned archive %p"), UTF8_TO_TCHAR(name), Archive);
|
||||
if (!Archive)
|
||||
{
|
||||
return FMOD_ERR_FILE_NOTFOUND;
|
||||
}
|
||||
*filesize = Archive->TotalSize();
|
||||
*handle = Archive;
|
||||
UE_LOG(LogFMOD, Verbose, TEXT(" TotalSize = %d"), *filesize);
|
||||
}
|
||||
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODClose(void *handle, void * /*userdata*/)
|
||||
{
|
||||
if (!handle)
|
||||
{
|
||||
return FMOD_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
|
||||
FArchive* Archive = (FArchive*)handle;
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FMODClose Closing archive %p"), Archive);
|
||||
delete Archive;
|
||||
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODRead(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void * /*userdata*/)
|
||||
{
|
||||
if (!handle)
|
||||
{
|
||||
return FMOD_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (bytesread)
|
||||
{
|
||||
FArchive* Archive = (FArchive*)handle;
|
||||
|
||||
int64 BytesLeft = Archive->TotalSize() - Archive->Tell();
|
||||
int64 ReadAmount = FMath::Min((int64)sizebytes, BytesLeft);
|
||||
|
||||
Archive->Serialize(buffer, ReadAmount);
|
||||
*bytesread = (unsigned int)ReadAmount;
|
||||
if (ReadAmount < (int64)sizebytes)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT(" -> EOF "));
|
||||
return FMOD_ERR_FILE_EOF;
|
||||
}
|
||||
}
|
||||
|
||||
return FMOD_OK;
|
||||
}
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODSeek(void *handle, unsigned int pos, void * /*userdata*/)
|
||||
{
|
||||
if (!handle)
|
||||
{
|
||||
return FMOD_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
FArchive* Archive = (FArchive*)handle;
|
||||
Archive->Seek(pos);
|
||||
|
||||
return FMOD_OK;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "fmod.h"
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODLogCallback(FMOD_DEBUG_FLAGS flags, const char *file, int line, const char *func, const char *message);
|
||||
FMOD_RESULT F_CALLBACK FMODOpen(const char *name, unsigned int *filesize, void **handle, void * /*userdata*/);
|
||||
FMOD_RESULT F_CALLBACK FMODClose(void *handle, void * /*userdata*/);
|
||||
FMOD_RESULT F_CALLBACK FMODRead(void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void * /*userdata*/);
|
||||
FMOD_RESULT F_CALLBACK FMODSeek(void *handle, unsigned int pos, void * /*userdata*/);
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODListener.h"
|
||||
#include <string.h>
|
||||
|
||||
float FFMODListener::Interpolate( const double EndTime )
|
||||
{
|
||||
if( FApp::GetCurrentTime() < InteriorStartTime )
|
||||
{
|
||||
return( 0.0f );
|
||||
}
|
||||
|
||||
if( FApp::GetCurrentTime() >= EndTime )
|
||||
{
|
||||
return( 1.0f );
|
||||
}
|
||||
|
||||
float InterpValue = ( float )( ( FApp::GetCurrentTime() - InteriorStartTime ) / ( EndTime - InteriorStartTime ) );
|
||||
return( InterpValue );
|
||||
}
|
||||
|
||||
void FFMODListener::UpdateCurrentInteriorSettings()
|
||||
{
|
||||
// Store the interpolation value, not the actual value
|
||||
InteriorVolumeInterp = Interpolate( InteriorEndTime );
|
||||
ExteriorVolumeInterp = Interpolate( ExteriorEndTime );
|
||||
InteriorLPFInterp = Interpolate( InteriorLPFEndTime );
|
||||
ExteriorLPFInterp = Interpolate( ExteriorLPFEndTime );
|
||||
}
|
||||
|
||||
void FFMODListener::ApplyInteriorSettings( class AAudioVolume* InVolume, const FInteriorSettings& Settings )
|
||||
{
|
||||
// Note: FInteriorSettings operator!= is not exported, so just do a memcmp instead
|
||||
if( InVolume != Volume || (0 != memcmp(&Settings, &InteriorSettings, sizeof(FInteriorSettings))) )
|
||||
{
|
||||
// Use previous/ current interpolation time if we're transitioning to the default worldsettings zone.
|
||||
InteriorStartTime = FApp::GetCurrentTime();
|
||||
InteriorEndTime = InteriorStartTime + (Settings.bIsWorldSettings ? InteriorSettings.InteriorTime : Settings.InteriorTime);
|
||||
ExteriorEndTime = InteriorStartTime + (Settings.bIsWorldSettings ? InteriorSettings.ExteriorTime : Settings.ExteriorTime);
|
||||
InteriorLPFEndTime = InteriorStartTime + (Settings.bIsWorldSettings ? InteriorSettings.InteriorLPFTime : Settings.InteriorLPFTime);
|
||||
ExteriorLPFEndTime = InteriorStartTime + (Settings.bIsWorldSettings ? InteriorSettings.ExteriorLPFTime : Settings.ExteriorLPFTime);
|
||||
|
||||
Volume = InVolume;
|
||||
InteriorSettings = Settings;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
/** A direct copy of FListener (which doesn't have external linkage, unfortunately) **/
|
||||
struct FFMODListener
|
||||
{
|
||||
FTransform Transform;
|
||||
FVector Velocity;
|
||||
|
||||
struct FInteriorSettings InteriorSettings;
|
||||
|
||||
/** The volume the listener resides in */
|
||||
class AAudioVolume* Volume;
|
||||
|
||||
/** The times of interior volumes fading in and out */
|
||||
double InteriorStartTime;
|
||||
double InteriorEndTime;
|
||||
double ExteriorEndTime;
|
||||
double InteriorLPFEndTime;
|
||||
double ExteriorLPFEndTime;
|
||||
float InteriorVolumeInterp;
|
||||
float InteriorLPFInterp;
|
||||
float ExteriorVolumeInterp;
|
||||
float ExteriorLPFInterp;
|
||||
|
||||
FVector GetUp() const { return Transform.GetUnitAxis(EAxis::Z); }
|
||||
FVector GetFront() const { return Transform.GetUnitAxis(EAxis::Y); }
|
||||
FVector GetRight() const { return Transform.GetUnitAxis(EAxis::X); }
|
||||
|
||||
/**
|
||||
* Works out the interp value between source and end
|
||||
*/
|
||||
float Interpolate( const double EndTime );
|
||||
|
||||
/**
|
||||
* Gets the current state of the interior settings for the listener
|
||||
*/
|
||||
void UpdateCurrentInteriorSettings();
|
||||
|
||||
/**
|
||||
* Apply the interior settings to ambient sounds
|
||||
*/
|
||||
void ApplyInteriorSettings( class AAudioVolume* Volume, const FInteriorSettings& Settings );
|
||||
|
||||
FFMODListener()
|
||||
: Transform(FTransform::Identity)
|
||||
, Velocity(ForceInit)
|
||||
, Volume(NULL)
|
||||
, InteriorStartTime(0.0)
|
||||
, InteriorEndTime(0.0)
|
||||
, ExteriorEndTime(0.0)
|
||||
, InteriorLPFEndTime(0.0)
|
||||
, ExteriorLPFEndTime(0.0)
|
||||
, InteriorVolumeInterp(0.f)
|
||||
, InteriorLPFInterp(0.f)
|
||||
, ExteriorVolumeInterp(0.f)
|
||||
, ExteriorLPFInterp(0.f)
|
||||
{
|
||||
}
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
#pragma once
|
||||
|
||||
void* FMODPlatformLoadDll(const TCHAR* LibToLoad)
|
||||
{
|
||||
return FPlatformProcess::GetDllHandle(LibToLoad);
|
||||
}
|
||||
|
||||
FMOD_RESULT FMODPlatformSystemSetup()
|
||||
{
|
||||
return FMOD_OK;
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODSettings.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UPaperRuntimeSettings
|
||||
|
||||
UFMODSettings::UFMODSettings(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
MasterBankName = TEXT("Master Bank");
|
||||
BankOutputDirectory.Path = TEXT("FMOD");
|
||||
OutputFormat = EFMODSpeakerMode::Surround_5_1;
|
||||
ContentBrowserPrefix = TEXT("/Game/FMOD/");
|
||||
bLoadAllBanks = true;
|
||||
bLoadAllSampleData = false;
|
||||
bEnableLiveUpdate = true;
|
||||
bVol0Virtual = true;
|
||||
Vol0VirtualLevel = 0.0001f;
|
||||
RealChannelCount = 64;
|
||||
TotalChannelCount = 512;
|
||||
DSPBufferLength = 0;
|
||||
DSPBufferCount = 0;
|
||||
StudioUpdatePeriod = 0;
|
||||
LiveUpdatePort = 0;
|
||||
}
|
||||
|
||||
FString UFMODSettings::GetFullBankPath() const
|
||||
{
|
||||
FString FullPath = BankOutputDirectory.Path;
|
||||
if (FPaths::IsRelative(FullPath))
|
||||
{
|
||||
FullPath = FPaths::GameContentDir() / FullPath;
|
||||
}
|
||||
|
||||
if (ForcePlatformName == TEXT("."))
|
||||
{
|
||||
// Leave path without subdirectory
|
||||
}
|
||||
else if (!ForcePlatformName.IsEmpty())
|
||||
{
|
||||
FullPath = FullPath / ForcePlatformName;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if PLATFORM_IOS || PLATFORM_ANDROID
|
||||
FString PlatformName = "Mobile";
|
||||
#elif PLATFORM_PS4
|
||||
FString PlatformName = "PS4";
|
||||
#elif PLATFORM_XBOXONE
|
||||
FString PlatformName = "XboxOne";
|
||||
#else
|
||||
FString PlatformName = "Desktop";
|
||||
#endif
|
||||
FullPath = FullPath / PlatformName;
|
||||
}
|
||||
return FullPath;
|
||||
}
|
||||
|
||||
FString UFMODSettings::GetMasterBankPath() const
|
||||
{
|
||||
return GetFullBankPath() / (MasterBankName + TEXT(".bank"));
|
||||
}
|
||||
|
||||
FString UFMODSettings::GetMasterStringsBankPath() const
|
||||
{
|
||||
return GetFullBankPath() / (MasterBankName + TEXT(".strings.bank"));
|
||||
}
|
||||
|
||||
void UFMODSettings::GetAllBankPaths(TArray<FString>& Paths, bool IncludeMasterBank) const
|
||||
{
|
||||
FString BankDir = GetFullBankPath();
|
||||
FString SearchDir = BankDir / FString(TEXT("*"));
|
||||
|
||||
TArray<FString> AllFiles;
|
||||
IFileManager::Get().FindFiles(AllFiles, *SearchDir, true, false);
|
||||
for ( FString& CurFile : AllFiles )
|
||||
{
|
||||
if (CurFile.EndsWith(".bank"))
|
||||
{
|
||||
bool IsMaster = (CurFile == MasterBankName + TEXT(".bank") ||
|
||||
CurFile == MasterBankName + TEXT(".strings.bank"));
|
||||
if (IncludeMasterBank || !IsMaster)
|
||||
{
|
||||
Paths.Push(BankDir / CurFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODSnapshot.h"
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
UFMODSnapshot::UFMODSnapshot(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
FString UFMODSnapshot::GetDesc()
|
||||
{
|
||||
return FString::Printf( TEXT( "Snapshot %s" ), *AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces) );
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODSnapshotReverb.h"
|
||||
|
||||
UFMODSnapshotReverb::UFMODSnapshotReverb(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,11 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
#pragma once
|
||||
|
||||
#include "Engine.h"
|
||||
#include "Components/SceneComponent.h"
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#if WITH_EDITOR
|
||||
#include "UnrealEd.h"
|
||||
#endif
|
||||
DECLARE_LOG_CATEGORY_EXTERN(LogFMOD, Log, All);
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioPrivatePCH.h"
|
||||
#include "FMODVCA.h"
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
UFMODVCA::UFMODVCA(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get tags to show in content view */
|
||||
void UFMODVCA::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
|
||||
{
|
||||
Super::GetAssetRegistryTags(OutTags);
|
||||
}
|
||||
|
||||
FString UFMODVCA::GetDesc()
|
||||
{
|
||||
return FString::Printf( TEXT( "VCA %s" ), *AssetGuid.ToString(EGuidFormats::DigitsWithHyphensInBraces) );
|
||||
}
|
||||
|
|
@ -0,0 +1,718 @@
|
|||
/*$ preserve start $*/
|
||||
|
||||
/* ======================================================================================== */
|
||||
/* FMOD Studio Low Level API - C header file. */
|
||||
/* Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016. */
|
||||
/* */
|
||||
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
|
||||
/* callbacks) to develop using C interface. */
|
||||
/* ======================================================================================== */
|
||||
|
||||
#ifndef _FMOD_H
|
||||
#define _FMOD_H
|
||||
|
||||
#include "fmod_common.h"
|
||||
|
||||
/* ========================================================================================== */
|
||||
/* FUNCTION PROTOTYPES */
|
||||
/* ========================================================================================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*
|
||||
FMOD global system functions (optional).
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);
|
||||
FMOD_RESULT F_API FMOD_Memory_GetStats (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);
|
||||
FMOD_RESULT F_API FMOD_Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode, FMOD_DEBUG_CALLBACK callback, const char *filename);
|
||||
FMOD_RESULT F_API FMOD_File_SetDiskBusy (int busy);
|
||||
FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy);
|
||||
|
||||
/*
|
||||
FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system);
|
||||
FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system);
|
||||
|
||||
/*$ preserve end $*/
|
||||
|
||||
/*
|
||||
'System' API
|
||||
*/
|
||||
|
||||
/*
|
||||
Setup functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);
|
||||
FMOD_RESULT F_API FMOD_System_GetOutput (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);
|
||||
FMOD_RESULT F_API FMOD_System_GetNumDrivers (FMOD_SYSTEM *system, int *numdrivers);
|
||||
FMOD_RESULT F_API FMOD_System_GetDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
|
||||
FMOD_RESULT F_API FMOD_System_SetDriver (FMOD_SYSTEM *system, int driver);
|
||||
FMOD_RESULT F_API FMOD_System_GetDriver (FMOD_SYSTEM *system, int *driver);
|
||||
FMOD_RESULT F_API FMOD_System_SetSoftwareChannels (FMOD_SYSTEM *system, int numsoftwarechannels);
|
||||
FMOD_RESULT F_API FMOD_System_GetSoftwareChannels (FMOD_SYSTEM *system, int *numsoftwarechannels);
|
||||
FMOD_RESULT F_API FMOD_System_SetSoftwareFormat (FMOD_SYSTEM *system, int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
|
||||
FMOD_RESULT F_API FMOD_System_GetSoftwareFormat (FMOD_SYSTEM *system, int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
|
||||
FMOD_RESULT F_API FMOD_System_SetDSPBufferSize (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);
|
||||
FMOD_RESULT F_API FMOD_System_GetDSPBufferSize (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);
|
||||
FMOD_RESULT F_API FMOD_System_SetFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
|
||||
FMOD_RESULT F_API FMOD_System_AttachFileSystem (FMOD_SYSTEM *system, FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
|
||||
FMOD_RESULT F_API FMOD_System_SetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API FMOD_System_GetAdvancedSettings (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API FMOD_System_SetCallback (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask);
|
||||
|
||||
/*
|
||||
Plug-in support.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetPluginPath (FMOD_SYSTEM *system, const char *path);
|
||||
FMOD_RESULT F_API FMOD_System_LoadPlugin (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);
|
||||
FMOD_RESULT F_API FMOD_System_UnloadPlugin (FMOD_SYSTEM *system, unsigned int handle);
|
||||
FMOD_RESULT F_API FMOD_System_GetNumPlugins (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);
|
||||
FMOD_RESULT F_API FMOD_System_GetPluginHandle (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
|
||||
FMOD_RESULT F_API FMOD_System_GetPluginInfo (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
|
||||
FMOD_RESULT F_API FMOD_System_SetOutputByPlugin (FMOD_SYSTEM *system, unsigned int handle);
|
||||
FMOD_RESULT F_API FMOD_System_GetOutputByPlugin (FMOD_SYSTEM *system, unsigned int *handle);
|
||||
FMOD_RESULT F_API FMOD_System_CreateDSPByPlugin (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);
|
||||
FMOD_RESULT F_API FMOD_System_GetDSPInfoByPlugin (FMOD_SYSTEM *system, unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
|
||||
FMOD_RESULT F_API FMOD_System_RegisterCodec (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority);
|
||||
FMOD_RESULT F_API FMOD_System_RegisterDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
|
||||
FMOD_RESULT F_API FMOD_System_RegisterOutput (FMOD_SYSTEM *system, const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
|
||||
|
||||
/*
|
||||
Init/Close.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_Init (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
|
||||
FMOD_RESULT F_API FMOD_System_Close (FMOD_SYSTEM *system);
|
||||
|
||||
/*
|
||||
General post-init system functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_Update (FMOD_SYSTEM *system);
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);
|
||||
FMOD_RESULT F_API FMOD_System_GetSpeakerPosition (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);
|
||||
FMOD_RESULT F_API FMOD_System_SetStreamBufferSize (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
|
||||
FMOD_RESULT F_API FMOD_System_GetStreamBufferSize (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
|
||||
FMOD_RESULT F_API FMOD_System_Set3DSettings (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);
|
||||
FMOD_RESULT F_API FMOD_System_Get3DSettings (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);
|
||||
FMOD_RESULT F_API FMOD_System_Set3DNumListeners (FMOD_SYSTEM *system, int numlisteners);
|
||||
FMOD_RESULT F_API FMOD_System_Get3DNumListeners (FMOD_SYSTEM *system, int *numlisteners);
|
||||
FMOD_RESULT F_API FMOD_System_Set3DListenerAttributes (FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API FMOD_System_Get3DListenerAttributes (FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API FMOD_System_Set3DRolloffCallback (FMOD_SYSTEM *system, FMOD_3D_ROLLOFF_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_System_MixerSuspend (FMOD_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_System_MixerResume (FMOD_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_System_GetDefaultMixMatrix (FMOD_SYSTEM *system, FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
|
||||
FMOD_RESULT F_API FMOD_System_GetSpeakerModeChannels (FMOD_SYSTEM *system, FMOD_SPEAKERMODE mode, int *channels);
|
||||
|
||||
/*
|
||||
System information functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_GetVersion (FMOD_SYSTEM *system, unsigned int *version);
|
||||
FMOD_RESULT F_API FMOD_System_GetOutputHandle (FMOD_SYSTEM *system, void **handle);
|
||||
FMOD_RESULT F_API FMOD_System_GetChannelsPlaying (FMOD_SYSTEM *system, int *channels);
|
||||
FMOD_RESULT F_API FMOD_System_GetChannelsReal (FMOD_SYSTEM *system, int *realchannels);
|
||||
FMOD_RESULT F_API FMOD_System_GetCPUUsage (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);
|
||||
FMOD_RESULT F_API FMOD_System_GetSoundRAM (FMOD_SYSTEM *system, int *currentalloced, int *maxalloced, int *total);
|
||||
|
||||
/*
|
||||
Sound/DSP/Channel/FX creation and retrieval.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_CreateSound (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
|
||||
FMOD_RESULT F_API FMOD_System_CreateStream (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);
|
||||
FMOD_RESULT F_API FMOD_System_CreateDSP (FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);
|
||||
FMOD_RESULT F_API FMOD_System_CreateDSPByType (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);
|
||||
FMOD_RESULT F_API FMOD_System_CreateChannelGroup (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);
|
||||
FMOD_RESULT F_API FMOD_System_CreateSoundGroup (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);
|
||||
FMOD_RESULT F_API FMOD_System_CreateReverb3D (FMOD_SYSTEM *system, FMOD_REVERB3D **reverb);
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_PlaySound (FMOD_SYSTEM *system, FMOD_SOUND *sound, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
|
||||
FMOD_RESULT F_API FMOD_System_PlayDSP (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused, FMOD_CHANNEL **channel);
|
||||
FMOD_RESULT F_API FMOD_System_GetChannel (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);
|
||||
FMOD_RESULT F_API FMOD_System_GetMasterChannelGroup (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);
|
||||
FMOD_RESULT F_API FMOD_System_GetMasterSoundGroup (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);
|
||||
|
||||
/*
|
||||
Routing to ports.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_AttachChannelGroupToPort (FMOD_SYSTEM *system, FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL passThru);
|
||||
FMOD_RESULT F_API FMOD_System_DetachChannelGroupFromPort(FMOD_SYSTEM *system, FMOD_CHANNELGROUP *channelgroup);
|
||||
|
||||
/*
|
||||
Reverb API.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetReverbProperties (FMOD_SYSTEM *system, int instance, const FMOD_REVERB_PROPERTIES *prop);
|
||||
FMOD_RESULT F_API FMOD_System_GetReverbProperties (FMOD_SYSTEM *system, int instance, FMOD_REVERB_PROPERTIES *prop);
|
||||
|
||||
/*
|
||||
System level DSP functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_LockDSP (FMOD_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_System_UnlockDSP (FMOD_SYSTEM *system);
|
||||
|
||||
/*
|
||||
Recording API.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_GetRecordNumDrivers (FMOD_SYSTEM *system, int *numdrivers, int *numconnected);
|
||||
FMOD_RESULT F_API FMOD_System_GetRecordDriverInfo (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_System_GetRecordPosition (FMOD_SYSTEM *system, int id, unsigned int *position);
|
||||
FMOD_RESULT F_API FMOD_System_RecordStart (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);
|
||||
FMOD_RESULT F_API FMOD_System_RecordStop (FMOD_SYSTEM *system, int id);
|
||||
FMOD_RESULT F_API FMOD_System_IsRecording (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);
|
||||
|
||||
/*
|
||||
Geometry API.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_CreateGeometry (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);
|
||||
FMOD_RESULT F_API FMOD_System_SetGeometrySettings (FMOD_SYSTEM *system, float maxworldsize);
|
||||
FMOD_RESULT F_API FMOD_System_GetGeometrySettings (FMOD_SYSTEM *system, float *maxworldsize);
|
||||
FMOD_RESULT F_API FMOD_System_LoadGeometry (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);
|
||||
FMOD_RESULT F_API FMOD_System_GetGeometryOcclusion (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
|
||||
|
||||
/*
|
||||
Network functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetNetworkProxy (FMOD_SYSTEM *system, const char *proxy);
|
||||
FMOD_RESULT F_API FMOD_System_GetNetworkProxy (FMOD_SYSTEM *system, char *proxy, int proxylen);
|
||||
FMOD_RESULT F_API FMOD_System_SetNetworkTimeout (FMOD_SYSTEM *system, int timeout);
|
||||
FMOD_RESULT F_API FMOD_System_GetNetworkTimeout (FMOD_SYSTEM *system, int *timeout);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_System_SetUserData (FMOD_SYSTEM *system, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_System_GetUserData (FMOD_SYSTEM *system, void **userdata);
|
||||
|
||||
/*
|
||||
'Sound' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_Release (FMOD_SOUND *sound);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSystemObject (FMOD_SOUND *sound, FMOD_SYSTEM **system);
|
||||
|
||||
/*
|
||||
Standard sound manipulation functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_Lock (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
|
||||
FMOD_RESULT F_API FMOD_Sound_Unlock (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
|
||||
FMOD_RESULT F_API FMOD_Sound_SetDefaults (FMOD_SOUND *sound, float frequency, int priority);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetDefaults (FMOD_SOUND *sound, float *frequency, int *priority);
|
||||
FMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance (FMOD_SOUND *sound, float min, float max);
|
||||
FMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance (FMOD_SOUND *sound, float *min, float *max);
|
||||
FMOD_RESULT F_API FMOD_Sound_Set3DConeSettings (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_Sound_Get3DConeSettings (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);
|
||||
FMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSubSound (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSubSoundParent (FMOD_SOUND *sound, FMOD_SOUND **parentsound);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetName (FMOD_SOUND *sound, char *name, int namelen);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetLength (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetFormat (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetNumSubSounds (FMOD_SOUND *sound, int *numsubsounds);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetNumTags (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetTag (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetOpenState (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);
|
||||
FMOD_RESULT F_API FMOD_Sound_ReadData (FMOD_SOUND *sound, void *buffer, unsigned int lenbytes, unsigned int *read);
|
||||
FMOD_RESULT F_API FMOD_Sound_SeekData (FMOD_SOUND *sound, unsigned int pcm);
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_SetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSoundGroup (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);
|
||||
|
||||
/*
|
||||
Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints (FMOD_SOUND *sound, int *numsyncpoints);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSyncPoint (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
|
||||
FMOD_RESULT F_API FMOD_Sound_AddSyncPoint (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
|
||||
FMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);
|
||||
|
||||
/*
|
||||
Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_SetMode (FMOD_SOUND *sound, FMOD_MODE mode);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetMode (FMOD_SOUND *sound, FMOD_MODE *mode);
|
||||
FMOD_RESULT F_API FMOD_Sound_SetLoopCount (FMOD_SOUND *sound, int loopcount);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetLoopCount (FMOD_SOUND *sound, int *loopcount);
|
||||
FMOD_RESULT F_API FMOD_Sound_SetLoopPoints (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetLoopPoints (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
|
||||
|
||||
/*
|
||||
For MOD/S3M/XM/IT/MID sequenced formats only.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels (FMOD_SOUND *sound, int *numchannels);
|
||||
FMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume (FMOD_SOUND *sound, int channel, float volume);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume (FMOD_SOUND *sound, int channel, float *volume);
|
||||
FMOD_RESULT F_API FMOD_Sound_SetMusicSpeed (FMOD_SOUND *sound, float speed);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetMusicSpeed (FMOD_SOUND *sound, float *speed);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Sound_SetUserData (FMOD_SOUND *sound, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_Sound_GetUserData (FMOD_SOUND *sound, void **userdata);
|
||||
|
||||
/*
|
||||
'Channel' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_GetSystemObject (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);
|
||||
|
||||
/*
|
||||
General control functionality for Channels and ChannelGroups.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_Stop (FMOD_CHANNEL *channel);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetPaused (FMOD_CHANNEL *channel, FMOD_BOOL paused);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetPaused (FMOD_CHANNEL *channel, FMOD_BOOL *paused);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetVolume (FMOD_CHANNEL *channel, float volume);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetVolume (FMOD_CHANNEL *channel, float *volume);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL ramp);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetVolumeRamp (FMOD_CHANNEL *channel, FMOD_BOOL *ramp);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetAudibility (FMOD_CHANNEL *channel, float *audibility);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetPitch (FMOD_CHANNEL *channel, float pitch);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetPitch (FMOD_CHANNEL *channel, float *pitch);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetMute (FMOD_CHANNEL *channel, FMOD_BOOL mute);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetMute (FMOD_CHANNEL *channel, FMOD_BOOL *mute);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetReverbProperties (FMOD_CHANNEL *channel, int instance, float wet);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetReverbProperties (FMOD_CHANNEL *channel, int instance, float *wet);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetLowPassGain (FMOD_CHANNEL *channel, float gain);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetLowPassGain (FMOD_CHANNEL *channel, float *gain);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetMode (FMOD_CHANNEL *channel, FMOD_MODE mode);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetMode (FMOD_CHANNEL *channel, FMOD_MODE *mode);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetCallback (FMOD_CHANNEL *channel, FMOD_CHANNELCONTROL_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_Channel_IsPlaying (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);
|
||||
|
||||
/*
|
||||
Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_SetPan (FMOD_CHANNEL *channel, float pan);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetMixLevelsOutput (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetMixLevelsInput (FMOD_CHANNEL *channel, float *levels, int numlevels);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int outchannels, int inchannels, int inchannel_hop);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetMixMatrix (FMOD_CHANNEL *channel, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
|
||||
|
||||
/*
|
||||
Clock based functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_GetDSPClock (FMOD_CHANNEL *channel, unsigned long long *dspclock, unsigned long long *parentclock);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetDelay (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetDelay (FMOD_CHANNEL *channel, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
|
||||
FMOD_RESULT F_API FMOD_Channel_AddFadePoint (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetFadePointRamp (FMOD_CHANNEL *channel, unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API FMOD_Channel_RemoveFadePoints (FMOD_CHANNEL *channel, unsigned long long dspclock_start, unsigned long long dspclock_end);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetFadePoints (FMOD_CHANNEL *channel, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
|
||||
|
||||
/*
|
||||
DSP effects.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_GetDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP **dsp);
|
||||
FMOD_RESULT F_API FMOD_Channel_AddDSP (FMOD_CHANNEL *channel, int index, FMOD_DSP *dsp);
|
||||
FMOD_RESULT F_API FMOD_Channel_RemoveDSP (FMOD_CHANNEL *channel, FMOD_DSP *dsp);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetNumDSPs (FMOD_CHANNEL *channel, int *numdsps);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int index);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetDSPIndex (FMOD_CHANNEL *channel, FMOD_DSP *dsp, int *index);
|
||||
FMOD_RESULT F_API FMOD_Channel_OverridePanDSP (FMOD_CHANNEL *channel, FMOD_DSP *pan);
|
||||
|
||||
/*
|
||||
3D functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DAttributes (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DAttributes (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance (FMOD_CHANNEL *channel, float mindistance, float maxdistance);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DConeSettings (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DConeSettings (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DOcclusion (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DOcclusion (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DSpread (FMOD_CHANNEL *channel, float angle);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DSpread (FMOD_CHANNEL *channel, float *angle);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DLevel (FMOD_CHANNEL *channel, float level);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DLevel (FMOD_CHANNEL *channel, float *level);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel (FMOD_CHANNEL *channel, float level);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel (FMOD_CHANNEL *channel, float *level);
|
||||
FMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);
|
||||
FMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_SetUserData (FMOD_CHANNEL *channel, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetUserData (FMOD_CHANNEL *channel, void **userdata);
|
||||
|
||||
/*
|
||||
Channel specific control functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_SetFrequency (FMOD_CHANNEL *channel, float frequency);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetFrequency (FMOD_CHANNEL *channel, float *frequency);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetPriority (FMOD_CHANNEL *channel, int priority);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetPriority (FMOD_CHANNEL *channel, int *priority);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetPosition (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetPosition (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetChannelGroup (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetLoopCount (FMOD_CHANNEL *channel, int loopcount);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetLoopCount (FMOD_CHANNEL *channel, int *loopcount);
|
||||
FMOD_RESULT F_API FMOD_Channel_SetLoopPoints (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetLoopPoints (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
|
||||
|
||||
/*
|
||||
Information only functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Channel_IsVirtual (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetCurrentSound (FMOD_CHANNEL *channel, FMOD_SOUND **sound);
|
||||
FMOD_RESULT F_API FMOD_Channel_GetIndex (FMOD_CHANNEL *channel, int *index);
|
||||
|
||||
/*
|
||||
'ChannelGroup' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);
|
||||
|
||||
/*
|
||||
General control functionality for Channels and ChannelGroups.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Stop (FMOD_CHANNELGROUP *channelgroup);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetPaused (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetVolume (FMOD_CHANNELGROUP *channelgroup, float volume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetVolume (FMOD_CHANNELGROUP *channelgroup, float *volume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL ramp);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetVolumeRamp (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *ramp);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetAudibility (FMOD_CHANNELGROUP *channelgroup, float *audibility);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetPitch (FMOD_CHANNELGROUP *channelgroup, float pitch);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetPitch (FMOD_CHANNELGROUP *channelgroup, float *pitch);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetMute (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float wet);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetReverbProperties (FMOD_CHANNELGROUP *channelgroup, int instance, float *wet);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float gain);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetLowPassGain (FMOD_CHANNELGROUP *channelgroup, float *gain);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE mode);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetMode (FMOD_CHANNELGROUP *channelgroup, FMOD_MODE *mode);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetCallback (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELCONTROL_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_IsPlaying (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *isplaying);
|
||||
|
||||
/*
|
||||
Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetPan (FMOD_CHANNELGROUP *channelgroup, float pan);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsOutput (FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixLevelsInput (FMOD_CHANNELGROUP *channelgroup, float *levels, int numlevels);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int outchannels, int inchannels, int inchannel_hop);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetMixMatrix (FMOD_CHANNELGROUP *channelgroup, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
|
||||
|
||||
/*
|
||||
Clock based functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPClock (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock, unsigned long long *parentclock);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end, FMOD_BOOL stopchannels);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetDelay (FMOD_CHANNELGROUP *channelgroup, unsigned long long *dspclock_start, unsigned long long *dspclock_end, FMOD_BOOL *stopchannels);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_AddFadePoint (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetFadePointRamp (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_RemoveFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned long long dspclock_start, unsigned long long dspclock_end);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetFadePoints (FMOD_CHANNELGROUP *channelgroup, unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
|
||||
|
||||
/*
|
||||
DSP effects.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP **dsp);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_AddDSP (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_DSP *dsp);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_RemoveDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumDSPs (FMOD_CHANNELGROUP *channelgroup, int *numdsps);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int index);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetDSPIndex (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, int *index);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_OverridePanDSP (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *pan);
|
||||
|
||||
/*
|
||||
3D functionality.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DAttributes (FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DAttributes (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float mindistance, float maxdistance);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DMinMaxDistance (FMOD_CHANNELGROUP *channelgroup, float *mindistance, float *maxdistance);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeSettings (FMOD_CHANNELGROUP *channelgroup, float *insideconeangle, float *outsideconeangle, float *outsidevolume);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DConeOrientation(FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR *points, int numpoints);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DCustomRolloff (FMOD_CHANNELGROUP *channelgroup, FMOD_VECTOR **points, int *numpoints);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DSpread (FMOD_CHANNELGROUP *channelgroup, float angle);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DSpread (FMOD_CHANNELGROUP *channelgroup, float *angle);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DLevel (FMOD_CHANNELGROUP *channelgroup, float level);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float level);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDopplerLevel (FMOD_CHANNELGROUP *channelgroup, float *level);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Set3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL custom, float customLevel, float centerFreq);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Get3DDistanceFilter (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *custom, float *customLevel, float *centerFreq);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_SetUserData (FMOD_CHANNELGROUP *channelgroup, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetUserData (FMOD_CHANNELGROUP *channelgroup, void **userdata);
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_Release (FMOD_CHANNELGROUP *channelgroup);
|
||||
|
||||
/*
|
||||
Nested channel groups.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_AddGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group, FMOD_BOOL propagatedspclock, FMOD_DSPCONNECTION **connection);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups (FMOD_CHANNELGROUP *channelgroup, int *numgroups);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetGroup (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);
|
||||
|
||||
/*
|
||||
Information only functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetName (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels (FMOD_CHANNELGROUP *channelgroup, int *numchannels);
|
||||
FMOD_RESULT F_API FMOD_ChannelGroup_GetChannel (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);
|
||||
|
||||
/*
|
||||
'SoundGroup' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_Release (FMOD_SOUNDGROUP *soundgroup);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);
|
||||
|
||||
/*
|
||||
SoundGroup control functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int maxaudible);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float speed);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed (FMOD_SOUNDGROUP *soundgroup, float *speed);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_SetVolume (FMOD_SOUNDGROUP *soundgroup, float volume);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetVolume (FMOD_SOUNDGROUP *soundgroup, float *volume);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_Stop (FMOD_SOUNDGROUP *soundgroup);
|
||||
|
||||
/*
|
||||
Information only functions.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetName (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds (FMOD_SOUNDGROUP *soundgroup, int *numsounds);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetSound (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying (FMOD_SOUNDGROUP *soundgroup, int *numplaying);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_SetUserData (FMOD_SOUNDGROUP *soundgroup, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_SoundGroup_GetUserData (FMOD_SOUNDGROUP *soundgroup, void **userdata);
|
||||
|
||||
/*
|
||||
'DSP' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_Release (FMOD_DSP *dsp);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetSystemObject (FMOD_DSP *dsp, FMOD_SYSTEM **system);
|
||||
|
||||
/*
|
||||
Connection / disconnection / input and output enumeration.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_AddInput (FMOD_DSP *dsp, FMOD_DSP *input, FMOD_DSPCONNECTION **connection, FMOD_DSPCONNECTION_TYPE type);
|
||||
FMOD_RESULT F_API FMOD_DSP_DisconnectFrom (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION *connection);
|
||||
FMOD_RESULT F_API FMOD_DSP_DisconnectAll (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetNumInputs (FMOD_DSP *dsp, int *numinputs);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetNumOutputs (FMOD_DSP *dsp, int *numoutputs);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetInput (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetOutput (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);
|
||||
|
||||
/*
|
||||
DSP unit control.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_SetActive (FMOD_DSP *dsp, FMOD_BOOL active);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetActive (FMOD_DSP *dsp, FMOD_BOOL *active);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetBypass (FMOD_DSP *dsp, FMOD_BOOL bypass);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetBypass (FMOD_DSP *dsp, FMOD_BOOL *bypass);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetWetDryMix (FMOD_DSP *dsp, float prewet, float postwet, float dry);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetWetDryMix (FMOD_DSP *dsp, float *prewet, float *postwet, float *dry);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetOutputChannelFormat (FMOD_DSP *dsp, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
|
||||
FMOD_RESULT F_API FMOD_DSP_Reset (FMOD_DSP *dsp);
|
||||
|
||||
/*
|
||||
DSP parameter control.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_SetParameterFloat (FMOD_DSP *dsp, int index, float value);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetParameterInt (FMOD_DSP *dsp, int index, int value);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL value);
|
||||
FMOD_RESULT F_API FMOD_DSP_SetParameterData (FMOD_DSP *dsp, int index, void *data, unsigned int length);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetParameterFloat (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetParameterInt (FMOD_DSP *dsp, int index, int *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetParameterBool (FMOD_DSP *dsp, int index, FMOD_BOOL *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetParameterData (FMOD_DSP *dsp, int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetNumParameters (FMOD_DSP *dsp, int *numparams);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetParameterInfo (FMOD_DSP *dsp, int index, FMOD_DSP_PARAMETER_DESC **desc);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetDataParameterIndex (FMOD_DSP *dsp, int datatype, int *index);
|
||||
FMOD_RESULT F_API FMOD_DSP_ShowConfigDialog (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);
|
||||
|
||||
/*
|
||||
DSP attributes.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_GetInfo (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetType (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetIdle (FMOD_DSP *dsp, FMOD_BOOL *idle);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_SetUserData (FMOD_DSP *dsp, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetUserData (FMOD_DSP *dsp, void **userdata);
|
||||
|
||||
/*
|
||||
Metering.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSP_SetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL inputEnabled, FMOD_BOOL outputEnabled);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetMeteringEnabled (FMOD_DSP *dsp, FMOD_BOOL *inputEnabled, FMOD_BOOL *outputEnabled);
|
||||
FMOD_RESULT F_API FMOD_DSP_GetMeteringInfo (FMOD_DSP *dsp, FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
|
||||
|
||||
/*
|
||||
'DSPConnection' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetInput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetOutput (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_SetMix (FMOD_DSPCONNECTION *dspconnection, float volume);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetMix (FMOD_DSPCONNECTION *dspconnection, float *volume);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_SetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int outchannels, int inchannels, int inchannel_hop);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetMixMatrix (FMOD_DSPCONNECTION *dspconnection, float *matrix, int *outchannels, int *inchannels, int inchannel_hop);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetType (FMOD_DSPCONNECTION *dspconnection, FMOD_DSPCONNECTION_TYPE *type);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_SetUserData (FMOD_DSPCONNECTION *dspconnection, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_DSPConnection_GetUserData (FMOD_DSPCONNECTION *dspconnection, void **userdata);
|
||||
|
||||
/*
|
||||
'Geometry' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Geometry_Release (FMOD_GEOMETRY *geometry);
|
||||
|
||||
/*
|
||||
Polygon manipulation.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Geometry_AddPolygon (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetNumPolygons (FMOD_GEOMETRY *geometry, int *numpolygons);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices (FMOD_GEOMETRY *geometry, int index, int *numvertices);
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);
|
||||
|
||||
/*
|
||||
Object manipulation.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL active);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetActive (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetRotation (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetRotation (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetPosition (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetPosition (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetScale (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetScale (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);
|
||||
FMOD_RESULT F_API FMOD_Geometry_Save (FMOD_GEOMETRY *geometry, void *data, int *datasize);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Geometry_SetUserData (FMOD_GEOMETRY *geometry, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_Geometry_GetUserData (FMOD_GEOMETRY *geometry, void **userdata);
|
||||
|
||||
/*
|
||||
'Reverb3D' API
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_Release (FMOD_REVERB3D *reverb3d);
|
||||
|
||||
/*
|
||||
Reverb manipulation.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_Set3DAttributes (FMOD_REVERB3D *reverb3d, const FMOD_VECTOR *position, float mindistance, float maxdistance);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_Get3DAttributes (FMOD_REVERB3D *reverb3d, FMOD_VECTOR *position, float *mindistance, float *maxdistance);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_SetProperties (FMOD_REVERB3D *reverb3d, const FMOD_REVERB_PROPERTIES *properties);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_GetProperties (FMOD_REVERB3D *reverb3d, FMOD_REVERB_PROPERTIES *properties);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_SetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL active);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_GetActive (FMOD_REVERB3D *reverb3d, FMOD_BOOL *active);
|
||||
|
||||
/*
|
||||
Userdata set/get.
|
||||
*/
|
||||
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_SetUserData (FMOD_REVERB3D *reverb3d, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_Reverb3D_GetUserData (FMOD_REVERB3D *reverb3d, void **userdata);
|
||||
|
||||
/*$ preserve start $*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FMOD_H */
|
||||
|
||||
/*$ preserve end $*/
|
|
@ -0,0 +1,604 @@
|
|||
/* ========================================================================================== */
|
||||
/* FMOD Studio - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
|
||||
/* */
|
||||
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
|
||||
/* callbacks) to develop using C++ classes. */
|
||||
/* ========================================================================================== */
|
||||
|
||||
#ifndef _FMOD_HPP
|
||||
#define _FMOD_HPP
|
||||
|
||||
#include "fmod_common.h"
|
||||
#include "fmod.h"
|
||||
|
||||
/*
|
||||
Constant and defines
|
||||
*/
|
||||
|
||||
/*
|
||||
FMOD Namespace
|
||||
*/
|
||||
namespace FMOD
|
||||
{
|
||||
class System;
|
||||
class Sound;
|
||||
class ChannelControl;
|
||||
class Channel;
|
||||
class ChannelGroup;
|
||||
class SoundGroup;
|
||||
class DSP;
|
||||
class DSPConnection;
|
||||
class Geometry;
|
||||
class Reverb3D;
|
||||
|
||||
/*
|
||||
FMOD global system functions (optional).
|
||||
*/
|
||||
inline FMOD_RESULT Memory_Initialize (void *poolmem, int poollen, FMOD_MEMORY_ALLOC_CALLBACK useralloc, FMOD_MEMORY_REALLOC_CALLBACK userrealloc, FMOD_MEMORY_FREE_CALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
|
||||
inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }
|
||||
inline FMOD_RESULT Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY, FMOD_DEBUG_CALLBACK callback = 0, const char *filename = 0) { return FMOD_Debug_Initialize(flags, mode, callback, filename); }
|
||||
inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); }
|
||||
inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); }
|
||||
|
||||
/*
|
||||
FMOD System factory functions.
|
||||
*/
|
||||
inline FMOD_RESULT System_Create (System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
|
||||
|
||||
/*
|
||||
'System' API
|
||||
*/
|
||||
class System
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a System class. System_Create must be used.
|
||||
System();
|
||||
System(const System &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
|
||||
// Setup functions.
|
||||
FMOD_RESULT F_API setOutput (FMOD_OUTPUTTYPE output);
|
||||
FMOD_RESULT F_API getOutput (FMOD_OUTPUTTYPE *output);
|
||||
FMOD_RESULT F_API getNumDrivers (int *numdrivers);
|
||||
FMOD_RESULT F_API getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
|
||||
FMOD_RESULT F_API setDriver (int driver);
|
||||
FMOD_RESULT F_API getDriver (int *driver);
|
||||
FMOD_RESULT F_API setSoftwareChannels (int numsoftwarechannels);
|
||||
FMOD_RESULT F_API getSoftwareChannels (int *numsoftwarechannels);
|
||||
FMOD_RESULT F_API setSoftwareFormat (int samplerate, FMOD_SPEAKERMODE speakermode, int numrawspeakers);
|
||||
FMOD_RESULT F_API getSoftwareFormat (int *samplerate, FMOD_SPEAKERMODE *speakermode, int *numrawspeakers);
|
||||
FMOD_RESULT F_API setDSPBufferSize (unsigned int bufferlength, int numbuffers);
|
||||
FMOD_RESULT F_API getDSPBufferSize (unsigned int *bufferlength, int *numbuffers);
|
||||
FMOD_RESULT F_API setFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek, FMOD_FILE_ASYNCREAD_CALLBACK userasyncread, FMOD_FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign);
|
||||
FMOD_RESULT F_API attachFileSystem (FMOD_FILE_OPEN_CALLBACK useropen, FMOD_FILE_CLOSE_CALLBACK userclose, FMOD_FILE_READ_CALLBACK userread, FMOD_FILE_SEEK_CALLBACK userseek);
|
||||
FMOD_RESULT F_API setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API setCallback (FMOD_SYSTEM_CALLBACK callback, FMOD_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_SYSTEM_CALLBACK_ALL);
|
||||
|
||||
// Plug-in support.
|
||||
FMOD_RESULT F_API setPluginPath (const char *path);
|
||||
FMOD_RESULT F_API loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0);
|
||||
FMOD_RESULT F_API unloadPlugin (unsigned int handle);
|
||||
FMOD_RESULT F_API getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins);
|
||||
FMOD_RESULT F_API getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);
|
||||
FMOD_RESULT F_API getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);
|
||||
FMOD_RESULT F_API setOutputByPlugin (unsigned int handle);
|
||||
FMOD_RESULT F_API getOutputByPlugin (unsigned int *handle);
|
||||
FMOD_RESULT F_API createDSPByPlugin (unsigned int handle, DSP **dsp);
|
||||
FMOD_RESULT F_API getDSPInfoByPlugin (unsigned int handle, const FMOD_DSP_DESCRIPTION **description);
|
||||
FMOD_RESULT F_API registerCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int *handle, unsigned int priority = 0);
|
||||
FMOD_RESULT F_API registerDSP (const FMOD_DSP_DESCRIPTION *description, unsigned int *handle);
|
||||
FMOD_RESULT F_API registerOutput (const FMOD_OUTPUT_DESCRIPTION *description, unsigned int *handle);
|
||||
|
||||
// Init/Close.
|
||||
FMOD_RESULT F_API init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);
|
||||
FMOD_RESULT F_API close ();
|
||||
|
||||
// General post-init system functions.
|
||||
FMOD_RESULT F_API update (); /* IMPORTANT! CALL THIS ONCE PER FRAME! */
|
||||
|
||||
FMOD_RESULT F_API setSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active);
|
||||
FMOD_RESULT F_API getSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active);
|
||||
FMOD_RESULT F_API setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);
|
||||
FMOD_RESULT F_API getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);
|
||||
FMOD_RESULT F_API set3DSettings (float dopplerscale, float distancefactor, float rolloffscale);
|
||||
FMOD_RESULT F_API get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale);
|
||||
FMOD_RESULT F_API set3DNumListeners (int numlisteners);
|
||||
FMOD_RESULT F_API get3DNumListeners (int *numlisteners);
|
||||
FMOD_RESULT F_API set3DListenerAttributes (int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API get3DListenerAttributes (int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API set3DRolloffCallback (FMOD_3D_ROLLOFF_CALLBACK callback);
|
||||
FMOD_RESULT F_API mixerSuspend ();
|
||||
FMOD_RESULT F_API mixerResume ();
|
||||
FMOD_RESULT F_API getDefaultMixMatrix (FMOD_SPEAKERMODE sourcespeakermode, FMOD_SPEAKERMODE targetspeakermode, float *matrix, int matrixhop);
|
||||
FMOD_RESULT F_API getSpeakerModeChannels (FMOD_SPEAKERMODE mode, int *channels);
|
||||
|
||||
// System information functions.
|
||||
FMOD_RESULT F_API getVersion (unsigned int *version);
|
||||
FMOD_RESULT F_API getOutputHandle (void **handle);
|
||||
FMOD_RESULT F_API getChannelsPlaying (int *channels);
|
||||
FMOD_RESULT F_API getChannelsReal (int *realchannels);
|
||||
FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
|
||||
FMOD_RESULT F_API getSoundRAM (int *currentalloced, int *maxalloced, int *total);
|
||||
|
||||
// Sound/DSP/Channel/FX creation and retrieval.
|
||||
FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
|
||||
FMOD_RESULT F_API createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
|
||||
FMOD_RESULT F_API createDSP (const FMOD_DSP_DESCRIPTION *description, DSP **dsp);
|
||||
FMOD_RESULT F_API createDSPByType (FMOD_DSP_TYPE type, DSP **dsp);
|
||||
FMOD_RESULT F_API createChannelGroup (const char *name, ChannelGroup **channelgroup);
|
||||
FMOD_RESULT F_API createSoundGroup (const char *name, SoundGroup **soundgroup);
|
||||
FMOD_RESULT F_API createReverb3D (Reverb3D **reverb);
|
||||
|
||||
FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel);
|
||||
FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel);
|
||||
FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
|
||||
FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
|
||||
FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);
|
||||
|
||||
// Routing to ports.
|
||||
FMOD_RESULT F_API attachChannelGroupToPort (FMOD_PORT_TYPE portType, FMOD_PORT_INDEX portIndex, ChannelGroup *channelgroup, bool passThru = false);
|
||||
FMOD_RESULT F_API detachChannelGroupFromPort (ChannelGroup *channelgroup);
|
||||
|
||||
// Reverb API.
|
||||
FMOD_RESULT F_API setReverbProperties (int instance, const FMOD_REVERB_PROPERTIES *prop);
|
||||
FMOD_RESULT F_API getReverbProperties (int instance, FMOD_REVERB_PROPERTIES *prop);
|
||||
|
||||
// System level DSP functionality.
|
||||
FMOD_RESULT F_API lockDSP ();
|
||||
FMOD_RESULT F_API unlockDSP ();
|
||||
|
||||
// Recording API.
|
||||
FMOD_RESULT F_API getRecordNumDrivers (int *numdrivers, int *numconnected);
|
||||
FMOD_RESULT F_API getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_DRIVER_STATE *state);
|
||||
FMOD_RESULT F_API getRecordPosition (int id, unsigned int *position);
|
||||
FMOD_RESULT F_API recordStart (int id, Sound *sound, bool loop);
|
||||
FMOD_RESULT F_API recordStop (int id);
|
||||
FMOD_RESULT F_API isRecording (int id, bool *recording);
|
||||
|
||||
// Geometry API.
|
||||
FMOD_RESULT F_API createGeometry (int maxpolygons, int maxvertices, Geometry **geometry);
|
||||
FMOD_RESULT F_API setGeometrySettings (float maxworldsize);
|
||||
FMOD_RESULT F_API getGeometrySettings (float *maxworldsize);
|
||||
FMOD_RESULT F_API loadGeometry (const void *data, int datasize, Geometry **geometry);
|
||||
FMOD_RESULT F_API getGeometryOcclusion (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);
|
||||
|
||||
// Network functions.
|
||||
FMOD_RESULT F_API setNetworkProxy (const char *proxy);
|
||||
FMOD_RESULT F_API getNetworkProxy (char *proxy, int proxylen);
|
||||
FMOD_RESULT F_API setNetworkTimeout (int timeout);
|
||||
FMOD_RESULT F_API getNetworkTimeout (int *timeout);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
/*
|
||||
'Sound' API
|
||||
*/
|
||||
class Sound
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a Sound class. Appropriate Sound creation or retrieval function must be used.
|
||||
Sound();
|
||||
Sound(const Sound &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
FMOD_RESULT F_API getSystemObject (System **system);
|
||||
|
||||
// Standard sound manipulation functions.
|
||||
FMOD_RESULT F_API lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
|
||||
FMOD_RESULT F_API unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
|
||||
FMOD_RESULT F_API setDefaults (float frequency, int priority);
|
||||
FMOD_RESULT F_API getDefaults (float *frequency, int *priority);
|
||||
FMOD_RESULT F_API set3DMinMaxDistance (float min, float max);
|
||||
FMOD_RESULT F_API get3DMinMaxDistance (float *min, float *max);
|
||||
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
|
||||
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
|
||||
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
|
||||
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
|
||||
FMOD_RESULT F_API getSubSound (int index, Sound **subsound);
|
||||
FMOD_RESULT F_API getSubSoundParent (Sound **parentsound);
|
||||
FMOD_RESULT F_API getName (char *name, int namelen);
|
||||
FMOD_RESULT F_API getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype);
|
||||
FMOD_RESULT F_API getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);
|
||||
FMOD_RESULT F_API getNumSubSounds (int *numsubsounds);
|
||||
FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
|
||||
FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
|
||||
FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
|
||||
FMOD_RESULT F_API readData (void *buffer, unsigned int lenbytes, unsigned int *read);
|
||||
FMOD_RESULT F_API seekData (unsigned int pcm);
|
||||
|
||||
FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
|
||||
FMOD_RESULT F_API getSoundGroup (SoundGroup **soundgroup);
|
||||
|
||||
// Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
|
||||
FMOD_RESULT F_API getNumSyncPoints (int *numsyncpoints);
|
||||
FMOD_RESULT F_API getSyncPoint (int index, FMOD_SYNCPOINT **point);
|
||||
FMOD_RESULT F_API getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);
|
||||
FMOD_RESULT F_API addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);
|
||||
FMOD_RESULT F_API deleteSyncPoint (FMOD_SYNCPOINT *point);
|
||||
|
||||
// Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
|
||||
FMOD_RESULT F_API setMode (FMOD_MODE mode);
|
||||
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
|
||||
FMOD_RESULT F_API setLoopCount (int loopcount);
|
||||
FMOD_RESULT F_API getLoopCount (int *loopcount);
|
||||
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
|
||||
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
|
||||
|
||||
// For MOD/S3M/XM/IT/MID sequenced formats only.
|
||||
FMOD_RESULT F_API getMusicNumChannels (int *numchannels);
|
||||
FMOD_RESULT F_API setMusicChannelVolume (int channel, float volume);
|
||||
FMOD_RESULT F_API getMusicChannelVolume (int channel, float *volume);
|
||||
FMOD_RESULT F_API setMusicSpeed (float speed);
|
||||
FMOD_RESULT F_API getMusicSpeed (float *speed);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
'ChannelControl API'. This is a base class for Channel and ChannelGroup so they can share the same functionality. This cannot be used or instansiated explicitly.
|
||||
*/
|
||||
class ChannelControl
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a Control class.
|
||||
ChannelControl();
|
||||
ChannelControl(const ChannelControl &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API getSystemObject (System **system);
|
||||
|
||||
// General control functionality for Channels and ChannelGroups.
|
||||
FMOD_RESULT F_API stop ();
|
||||
FMOD_RESULT F_API setPaused (bool paused);
|
||||
FMOD_RESULT F_API getPaused (bool *paused);
|
||||
FMOD_RESULT F_API setVolume (float volume);
|
||||
FMOD_RESULT F_API getVolume (float *volume);
|
||||
FMOD_RESULT F_API setVolumeRamp (bool ramp);
|
||||
FMOD_RESULT F_API getVolumeRamp (bool *ramp);
|
||||
FMOD_RESULT F_API getAudibility (float *audibility);
|
||||
FMOD_RESULT F_API setPitch (float pitch);
|
||||
FMOD_RESULT F_API getPitch (float *pitch);
|
||||
FMOD_RESULT F_API setMute (bool mute);
|
||||
FMOD_RESULT F_API getMute (bool *mute);
|
||||
FMOD_RESULT F_API setReverbProperties (int instance, float wet);
|
||||
FMOD_RESULT F_API getReverbProperties (int instance, float *wet);
|
||||
FMOD_RESULT F_API setLowPassGain (float gain);
|
||||
FMOD_RESULT F_API getLowPassGain (float *gain);
|
||||
FMOD_RESULT F_API setMode (FMOD_MODE mode);
|
||||
FMOD_RESULT F_API getMode (FMOD_MODE *mode);
|
||||
FMOD_RESULT F_API setCallback (FMOD_CHANNELCONTROL_CALLBACK callback);
|
||||
FMOD_RESULT F_API isPlaying (bool *isplaying);
|
||||
|
||||
// Panning and level adjustment.
|
||||
// Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values.
|
||||
FMOD_RESULT F_API setPan (float pan);
|
||||
FMOD_RESULT F_API setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright);
|
||||
FMOD_RESULT F_API setMixLevelsInput (float *levels, int numlevels);
|
||||
FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
|
||||
FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
|
||||
|
||||
// Clock based functionality.
|
||||
FMOD_RESULT F_API getDSPClock (unsigned long long *dspclock, unsigned long long *parentclock);
|
||||
FMOD_RESULT F_API setDelay (unsigned long long dspclock_start, unsigned long long dspclock_end, bool stopchannels = true);
|
||||
FMOD_RESULT F_API getDelay (unsigned long long *dspclock_start, unsigned long long *dspclock_end, bool *stopchannels = 0);
|
||||
FMOD_RESULT F_API addFadePoint (unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API setFadePointRamp (unsigned long long dspclock, float volume);
|
||||
FMOD_RESULT F_API removeFadePoints (unsigned long long dspclock_start, unsigned long long dspclock_end);
|
||||
FMOD_RESULT F_API getFadePoints (unsigned int *numpoints, unsigned long long *point_dspclock, float *point_volume);
|
||||
|
||||
// DSP effects.
|
||||
FMOD_RESULT F_API getDSP (int index, DSP **dsp);
|
||||
FMOD_RESULT F_API addDSP (int index, DSP *dsp);
|
||||
FMOD_RESULT F_API removeDSP (DSP *dsp);
|
||||
FMOD_RESULT F_API getNumDSPs (int *numdsps);
|
||||
FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index);
|
||||
FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index);
|
||||
FMOD_RESULT F_API overridePanDSP (DSP *pan);
|
||||
|
||||
// 3D functionality.
|
||||
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos = 0);
|
||||
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos = 0);
|
||||
FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
|
||||
FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
|
||||
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
|
||||
FMOD_RESULT F_API get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume);
|
||||
FMOD_RESULT F_API set3DConeOrientation (FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API get3DConeOrientation (FMOD_VECTOR *orientation);
|
||||
FMOD_RESULT F_API set3DCustomRolloff (FMOD_VECTOR *points, int numpoints);
|
||||
FMOD_RESULT F_API get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints);
|
||||
FMOD_RESULT F_API set3DOcclusion (float directocclusion, float reverbocclusion);
|
||||
FMOD_RESULT F_API get3DOcclusion (float *directocclusion, float *reverbocclusion);
|
||||
FMOD_RESULT F_API set3DSpread (float angle);
|
||||
FMOD_RESULT F_API get3DSpread (float *angle);
|
||||
FMOD_RESULT F_API set3DLevel (float level);
|
||||
FMOD_RESULT F_API get3DLevel (float *level);
|
||||
FMOD_RESULT F_API set3DDopplerLevel (float level);
|
||||
FMOD_RESULT F_API get3DDopplerLevel (float *level);
|
||||
FMOD_RESULT F_API set3DDistanceFilter (bool custom, float customLevel, float centerFreq);
|
||||
FMOD_RESULT F_API get3DDistanceFilter (bool *custom, float *customLevel, float *centerFreq);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
/*
|
||||
'Channel' API.
|
||||
*/
|
||||
class Channel : public ChannelControl
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a Channel class. Appropriate Channel creation or retrieval function must be used.
|
||||
Channel();
|
||||
Channel(const Channel &);
|
||||
|
||||
public:
|
||||
|
||||
// Channel specific control functionality.
|
||||
FMOD_RESULT F_API setFrequency (float frequency);
|
||||
FMOD_RESULT F_API getFrequency (float *frequency);
|
||||
FMOD_RESULT F_API setPriority (int priority);
|
||||
FMOD_RESULT F_API getPriority (int *priority);
|
||||
FMOD_RESULT F_API setPosition (unsigned int position, FMOD_TIMEUNIT postype);
|
||||
FMOD_RESULT F_API getPosition (unsigned int *position, FMOD_TIMEUNIT postype);
|
||||
FMOD_RESULT F_API setChannelGroup (ChannelGroup *channelgroup);
|
||||
FMOD_RESULT F_API getChannelGroup (ChannelGroup **channelgroup);
|
||||
FMOD_RESULT F_API setLoopCount (int loopcount);
|
||||
FMOD_RESULT F_API getLoopCount (int *loopcount);
|
||||
FMOD_RESULT F_API setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);
|
||||
FMOD_RESULT F_API getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);
|
||||
|
||||
// Information only functions.
|
||||
FMOD_RESULT F_API isVirtual (bool *isvirtual);
|
||||
FMOD_RESULT F_API getCurrentSound (Sound **sound);
|
||||
FMOD_RESULT F_API getIndex (int *index);
|
||||
};
|
||||
|
||||
/*
|
||||
'ChannelGroup' API
|
||||
*/
|
||||
class ChannelGroup : public ChannelControl
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a ChannelGroup class. Appropriate ChannelGroup creation or retrieval function must be used.
|
||||
ChannelGroup();
|
||||
ChannelGroup(const ChannelGroup &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
|
||||
// Nested channel groups.
|
||||
FMOD_RESULT F_API addGroup (ChannelGroup *group, bool propagatedspclock = true, DSPConnection **connection = 0);
|
||||
FMOD_RESULT F_API getNumGroups (int *numgroups);
|
||||
FMOD_RESULT F_API getGroup (int index, ChannelGroup **group);
|
||||
FMOD_RESULT F_API getParentGroup (ChannelGroup **group);
|
||||
|
||||
// Information only functions.
|
||||
FMOD_RESULT F_API getName (char *name, int namelen);
|
||||
FMOD_RESULT F_API getNumChannels (int *numchannels);
|
||||
FMOD_RESULT F_API getChannel (int index, Channel **channel);
|
||||
};
|
||||
|
||||
/*
|
||||
'SoundGroup' API
|
||||
*/
|
||||
class SoundGroup
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a SoundGroup class. Appropriate SoundGroup creation or retrieval function must be used.
|
||||
SoundGroup();
|
||||
SoundGroup(const SoundGroup &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
FMOD_RESULT F_API getSystemObject (System **system);
|
||||
|
||||
// SoundGroup control functions.
|
||||
FMOD_RESULT F_API setMaxAudible (int maxaudible);
|
||||
FMOD_RESULT F_API getMaxAudible (int *maxaudible);
|
||||
FMOD_RESULT F_API setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior);
|
||||
FMOD_RESULT F_API getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior);
|
||||
FMOD_RESULT F_API setMuteFadeSpeed (float speed);
|
||||
FMOD_RESULT F_API getMuteFadeSpeed (float *speed);
|
||||
FMOD_RESULT F_API setVolume (float volume);
|
||||
FMOD_RESULT F_API getVolume (float *volume);
|
||||
FMOD_RESULT F_API stop ();
|
||||
|
||||
// Information only functions.
|
||||
FMOD_RESULT F_API getName (char *name, int namelen);
|
||||
FMOD_RESULT F_API getNumSounds (int *numsounds);
|
||||
FMOD_RESULT F_API getSound (int index, Sound **sound);
|
||||
FMOD_RESULT F_API getNumPlaying (int *numplaying);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
/*
|
||||
'DSP' API
|
||||
*/
|
||||
class DSP
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a DSP class. Appropriate DSP creation or retrieval function must be used.
|
||||
DSP();
|
||||
DSP(const DSP &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
FMOD_RESULT F_API getSystemObject (System **system);
|
||||
|
||||
// Connection / disconnection / input and output enumeration.
|
||||
FMOD_RESULT F_API addInput (DSP *input, DSPConnection **connection = 0, FMOD_DSPCONNECTION_TYPE type = FMOD_DSPCONNECTION_TYPE_STANDARD);
|
||||
FMOD_RESULT F_API disconnectFrom (DSP *target, DSPConnection *connection = 0);
|
||||
FMOD_RESULT F_API disconnectAll (bool inputs, bool outputs);
|
||||
FMOD_RESULT F_API getNumInputs (int *numinputs);
|
||||
FMOD_RESULT F_API getNumOutputs (int *numoutputs);
|
||||
FMOD_RESULT F_API getInput (int index, DSP **input, DSPConnection **inputconnection);
|
||||
FMOD_RESULT F_API getOutput (int index, DSP **output, DSPConnection **outputconnection);
|
||||
|
||||
// DSP unit control.
|
||||
FMOD_RESULT F_API setActive (bool active);
|
||||
FMOD_RESULT F_API getActive (bool *active);
|
||||
FMOD_RESULT F_API setBypass (bool bypass);
|
||||
FMOD_RESULT F_API getBypass (bool *bypass);
|
||||
FMOD_RESULT F_API setWetDryMix (float prewet, float postwet, float dry);
|
||||
FMOD_RESULT F_API getWetDryMix (float *prewet, float *postwet, float *dry);
|
||||
FMOD_RESULT F_API setChannelFormat (FMOD_CHANNELMASK channelmask, int numchannels, FMOD_SPEAKERMODE source_speakermode);
|
||||
FMOD_RESULT F_API getChannelFormat (FMOD_CHANNELMASK *channelmask, int *numchannels, FMOD_SPEAKERMODE *source_speakermode);
|
||||
FMOD_RESULT F_API getOutputChannelFormat (FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE inspeakermode, FMOD_CHANNELMASK *outmask, int *outchannels, FMOD_SPEAKERMODE *outspeakermode);
|
||||
FMOD_RESULT F_API reset ();
|
||||
|
||||
// DSP parameter control.
|
||||
FMOD_RESULT F_API setParameterFloat (int index, float value);
|
||||
FMOD_RESULT F_API setParameterInt (int index, int value);
|
||||
FMOD_RESULT F_API setParameterBool (int index, bool value);
|
||||
FMOD_RESULT F_API setParameterData (int index, void *data, unsigned int length);
|
||||
FMOD_RESULT F_API getParameterFloat (int index, float *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API getParameterInt (int index, int *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API getParameterBool (int index, bool *value, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API getParameterData (int index, void **data, unsigned int *length, char *valuestr, int valuestrlen);
|
||||
FMOD_RESULT F_API getNumParameters (int *numparams);
|
||||
FMOD_RESULT F_API getParameterInfo (int index, FMOD_DSP_PARAMETER_DESC **desc);
|
||||
FMOD_RESULT F_API getDataParameterIndex (int datatype, int *index);
|
||||
FMOD_RESULT F_API showConfigDialog (void *hwnd, bool show);
|
||||
|
||||
// DSP attributes.
|
||||
FMOD_RESULT F_API getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);
|
||||
FMOD_RESULT F_API getType (FMOD_DSP_TYPE *type);
|
||||
FMOD_RESULT F_API getIdle (bool *idle);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
|
||||
// Metering.
|
||||
FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled);
|
||||
FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled);
|
||||
FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
'DSPConnection' API
|
||||
*/
|
||||
class DSPConnection
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a DSPConnection class. Appropriate DSPConnection creation or retrieval function must be used.
|
||||
DSPConnection();
|
||||
DSPConnection(const DSPConnection &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API getInput (DSP **input);
|
||||
FMOD_RESULT F_API getOutput (DSP **output);
|
||||
FMOD_RESULT F_API setMix (float volume);
|
||||
FMOD_RESULT F_API getMix (float *volume);
|
||||
FMOD_RESULT F_API setMixMatrix (float *matrix, int outchannels, int inchannels, int inchannel_hop = 0);
|
||||
FMOD_RESULT F_API getMixMatrix (float *matrix, int *outchannels, int *inchannels, int inchannel_hop = 0);
|
||||
FMOD_RESULT F_API getType (FMOD_DSPCONNECTION_TYPE *type);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
'Geometry' API
|
||||
*/
|
||||
class Geometry
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a Geometry class. Appropriate Geometry creation or retrieval function must be used.
|
||||
Geometry();
|
||||
Geometry(const Geometry &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
|
||||
// Polygon manipulation.
|
||||
FMOD_RESULT F_API addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);
|
||||
FMOD_RESULT F_API getNumPolygons (int *numpolygons);
|
||||
FMOD_RESULT F_API getMaxPolygons (int *maxpolygons, int *maxvertices);
|
||||
FMOD_RESULT F_API getPolygonNumVertices (int index, int *numvertices);
|
||||
FMOD_RESULT F_API setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex);
|
||||
FMOD_RESULT F_API getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex);
|
||||
FMOD_RESULT F_API setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided);
|
||||
FMOD_RESULT F_API getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided);
|
||||
|
||||
// Object manipulation.
|
||||
FMOD_RESULT F_API setActive (bool active);
|
||||
FMOD_RESULT F_API getActive (bool *active);
|
||||
FMOD_RESULT F_API setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up);
|
||||
FMOD_RESULT F_API setPosition (const FMOD_VECTOR *position);
|
||||
FMOD_RESULT F_API getPosition (FMOD_VECTOR *position);
|
||||
FMOD_RESULT F_API setScale (const FMOD_VECTOR *scale);
|
||||
FMOD_RESULT F_API getScale (FMOD_VECTOR *scale);
|
||||
FMOD_RESULT F_API save (void *data, int *datasize);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
'Reverb' API
|
||||
*/
|
||||
class Reverb3D
|
||||
{
|
||||
private:
|
||||
|
||||
// Constructor made private so user cannot statically instance a Reverb3D class. Appropriate Reverb creation or retrieval function must be used.
|
||||
Reverb3D();
|
||||
Reverb3D(const Reverb3D &);
|
||||
|
||||
public:
|
||||
|
||||
FMOD_RESULT F_API release ();
|
||||
|
||||
// Reverb manipulation.
|
||||
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance);
|
||||
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *position, float *mindistance,float *maxdistance);
|
||||
FMOD_RESULT F_API setProperties (const FMOD_REVERB_PROPERTIES *properties);
|
||||
FMOD_RESULT F_API getProperties (FMOD_REVERB_PROPERTIES *properties);
|
||||
FMOD_RESULT F_API setActive (bool active);
|
||||
FMOD_RESULT F_API getActive (bool *active);
|
||||
|
||||
// Userdata set/get.
|
||||
FMOD_RESULT F_API setUserData (void *userdata);
|
||||
FMOD_RESULT F_API getUserData (void **userdata);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,178 @@
|
|||
/* ======================================================================================================== */
|
||||
/* FMOD Studio - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
|
||||
/* */
|
||||
/* Use this header if you are wanting to develop your own file format plugin to use with */
|
||||
/* FMOD's codec system. With this header you can make your own fileformat plugin that FMOD */
|
||||
/* can register and use. See the documentation and examples on how to make a working plugin. */
|
||||
/* */
|
||||
/* ======================================================================================================== */
|
||||
|
||||
#ifndef _FMOD_CODEC_H
|
||||
#define _FMOD_CODEC_H
|
||||
|
||||
typedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;
|
||||
typedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;
|
||||
|
||||
/*
|
||||
Codec callbacks
|
||||
*/
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPEN_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSE_CALLBACK) (FMOD_CODEC_STATE *codec_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READ_CALLBACK) (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int samples_in, unsigned int *samples_out);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTH_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITION_CALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATE_CALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATA_CALLBACK) (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT_CALLBACK)(FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_CODEC_STATE
|
||||
FMOD_CODEC_WAVEFORMAT
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_CODEC_DESCRIPTION
|
||||
{
|
||||
const char *name; /* [w] Name of the codec. */
|
||||
unsigned int version; /* [w] Plugin writer's version number. */
|
||||
int defaultasstream; /* [w] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample. Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound. Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded. Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category. It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */
|
||||
FMOD_TIMEUNIT timeunits; /* [w] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */
|
||||
FMOD_CODEC_OPEN_CALLBACK open; /* [w] Open callback for the codec for when FMOD tries to open a sound using this codec. */
|
||||
FMOD_CODEC_CLOSE_CALLBACK close; /* [w] Close callback for the codec for when FMOD tries to close a sound using this codec. */
|
||||
FMOD_CODEC_READ_CALLBACK read; /* [w] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */
|
||||
FMOD_CODEC_GETLENGTH_CALLBACK getlength; /* [w] Callback to return the length of the song in whatever format required when Sound::getLength is called. */
|
||||
FMOD_CODEC_SETPOSITION_CALLBACK setposition; /* [w] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */
|
||||
FMOD_CODEC_GETPOSITION_CALLBACK getposition; /* [w] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */
|
||||
FMOD_CODEC_SOUNDCREATE_CALLBACK soundcreate; /* [w] Sound creation callback for the codec when FMOD finishes creating the sound. (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */
|
||||
FMOD_CODEC_GETWAVEFORMAT_CALLBACK getwaveformat; /* [w] Callback to tell FMOD about the waveformat of a particular subsound. This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */
|
||||
} FMOD_CODEC_DESCRIPTION;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Set these values marked to tell fmod what sort of sound to create when the codec open callback is called.<br>
|
||||
The format, channels, frequency and lengthpcm tell FMOD what sort of sound buffer to create when you initialize your code. <br>
|
||||
If you wrote an MP3 codec that decoded to stereo 16bit integer PCM for a 44khz sound, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2, and frequency would be 44100.<br>
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
<br>
|
||||
1.07 Note. 'blockalign' member which was in bytes has been removed. 'pcmblocksize' is now the replacement, and is measured in PCM samples only, not bytes. This is purely to support buffering
|
||||
internal to FMOD for codecs that are not sample accurate.
|
||||
<br>
|
||||
Note: When registering a codec, format, channels, frequency and lengthpcm must be supplied, otherwise there will be an error.<br>
|
||||
This structure is optional if FMOD_CODEC_GETWAVEFORMAT_CALLBACK is specified.<br>
|
||||
An array of these structures may be needed if FMOD_CODEC_STATE::numsubsounds is larger than 1.
|
||||
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_CODEC_STATE
|
||||
FMOD_SOUND_FORMAT
|
||||
FMOD_MODE
|
||||
FMOD_CHANNELMASK
|
||||
FMOD_CHANNELORDER
|
||||
FMOD_CODEC_WAVEFORMAT_VERSION
|
||||
]
|
||||
*/
|
||||
struct FMOD_CODEC_WAVEFORMAT
|
||||
{
|
||||
char name[256]; /* [w] Name of sound. Optional. */
|
||||
FMOD_SOUND_FORMAT format; /* [w] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16. Mandantory - Must be supplied. */
|
||||
int channels; /* [w] Number of channels used by codec, ie mono = 1, stereo = 2. Mandantory - Must be supplied. */
|
||||
int frequency; /* [w] Default frequency in hz of the codec, ie 44100. Mandantory - Must be supplied. */
|
||||
unsigned int lengthbytes; /* [w] Length in bytes of the source data. Used for FMOD_TIMEUNIT_RAWBYTES. Optional. Default = 0. */
|
||||
unsigned int lengthpcm; /* [w] Length in decompressed, PCM samples of the file, ie length in seconds * frequency. Used for Sound::getLength and for memory allocation of static decompressed sample data. Mandantory - Must be supplied. */
|
||||
unsigned int pcmblocksize; /* [w] Minimum, optimal number of decompressed PCM samples codec can handle. 0 or 1 = no buffering. Anything higher means FMOD will allocate a PCM buffer of this size to read in chunks. The codec read callback will be called in multiples of this value. Optional. */
|
||||
int loopstart; /* [w] Loopstart in decompressed, PCM samples of file. Optional. Default = 0. */
|
||||
int loopend; /* [w] Loopend in decompressed, PCM samples of file. Optional. Default = 0. */
|
||||
FMOD_MODE mode; /* [w] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. Optional. Default = FMOD_DEFAULT. */
|
||||
FMOD_CHANNELMASK channelmask; /* [w] Defined channel bitmask to describe which speakers the channels in the codec map to, in order of channel count. See fmod_common.h. Optional. Leave at 0 to map to the speaker layout defined in FMOD_SPEAKER. */
|
||||
FMOD_CHANNELORDER channelorder; /* [w] Defined channel order type, to describe where each sound channel should pan for the number of channels specified. See fmod_common.h. Optional. Leave at 0 to play in default speaker order. */
|
||||
float peakvolume; /* [w] Peak volume of sound. Optional. Default = 0 if not used. */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_CODEC_WAVEFORMAT_VERSION
|
||||
|
||||
[DESCRIPTION]
|
||||
Version number of FMOD_CODEC_WAVEFORMAT structure. Should be set into FMOD_CODEC_STATE in the FMOD_CODEC_OPEN_CALLBACK.
|
||||
|
||||
[REMARKS]
|
||||
Use this for binary compatibility and for future expansion.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_CODEC_STATE
|
||||
FMOD_CODEC_DESCRIPTION
|
||||
FMOD_CODEC_OPEN_CALLBACK
|
||||
]
|
||||
*/
|
||||
#define FMOD_CODEC_WAVEFORMAT_VERSION 2
|
||||
/* [DEFINE_END] */
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Codec plugin structure that is passed into each callback.<br>
|
||||
<br>
|
||||
Optionally set the numsubsounds and waveformat members when called in FMOD_CODEC_OPEN_CALLBACK to tell fmod what sort of sound to create.<br>
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
<br>
|
||||
'numsubsounds' should be 0 if the file is a normal single sound stream or sound. Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>
|
||||
'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself. Examples of these types would be FSB (contains multiple sounds), DLS (contain instruments).<br>
|
||||
The waveformat value should point to an arrays of information based on how many subsounds are in the format. If the number of subsounds is 0 then it should point to 1 waveformat, the same as if the number of subsounds was 1. If subsounds was 100 for example, there should be a pointer to an array of 100 waveformat structures.<br>
|
||||
<br>
|
||||
The waveformat pointer is optional and could be 0, if using FMOD_CODEC_GETWAVEFORMAT_CALLBACK is preferred.<br>
|
||||
<br>
|
||||
When a sound has 1 or more subsounds, the caller must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_CODEC_WAVEFORMAT
|
||||
FMOD_FILE_READ_CALLBACK
|
||||
FMOD_FILE_SEEK_CALLBACK
|
||||
FMOD_CODEC_METADATA_CALLBACK
|
||||
Sound::getSubSound
|
||||
Sound::getNumSubSounds
|
||||
FMOD_CODEC_WAVEFORMAT_VERSION
|
||||
]
|
||||
*/
|
||||
struct FMOD_CODEC_STATE
|
||||
{
|
||||
int numsubsounds; /* [w] Number of 'subsounds' in this sound. Anything other than 0 makes it a 'container' format (ie DLS/FSB etc which contain 1 or more subsounds). For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */
|
||||
FMOD_CODEC_WAVEFORMAT *waveformat; /* [w] Pointer to an array of format structures containing information about each sample. Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT_CALLBACK callback is preferred. The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */
|
||||
void *plugindata; /* [w] Plugin writer created data the codec author wants to attach to this object. */
|
||||
|
||||
void *filehandle; /* [r] This will return an internal FMOD file handle to use with the callbacks provided. */
|
||||
unsigned int filesize; /* [r] This will contain the size of the file in bytes. */
|
||||
FMOD_FILE_READ_CALLBACK fileread; /* [r] This will return a callable FMOD file function to use from codec. */
|
||||
FMOD_FILE_SEEK_CALLBACK fileseek; /* [r] This will return a callable FMOD file function to use from codec. */
|
||||
FMOD_CODEC_METADATA_CALLBACK metadata; /* [r] This will return a callable FMOD metadata function to use from codec. */
|
||||
|
||||
int waveformatversion; /* [w] Must be set to FMOD_CODEC_WAVEFORMAT_VERSION in the FMOD_CODEC_OPEN_CALLBACK. */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,850 @@
|
|||
/* ========================================================================================== */
|
||||
/* FMOD Studio - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
|
||||
/* */
|
||||
/* Use this header if you are interested in delving deeper into the FMOD software mixing / */
|
||||
/* DSP engine. */
|
||||
/* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's */
|
||||
/* dsp system. With this header you can make your own DSP plugin that FMOD can */
|
||||
/* register and use. See the documentation and examples on how to make a working plugin. */
|
||||
/* */
|
||||
/* ========================================================================================== */
|
||||
|
||||
#ifndef _FMOD_DSP_H
|
||||
#define _FMOD_DSP_H
|
||||
|
||||
#include "fmod_dsp_effects.h"
|
||||
|
||||
typedef struct FMOD_DSP_STATE FMOD_DSP_STATE;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for FMOD_DSP_PROCESS_CALLBACK input and output buffers.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_DESCRIPTION
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_BUFFER_ARRAY
|
||||
{
|
||||
int numbuffers; /* [r/w] number of buffers */
|
||||
int *buffernumchannels; /* [r/w] array of number of channels for each buffer */
|
||||
FMOD_CHANNELMASK *bufferchannelmask; /* [r/w] array of channel masks for each buffer */
|
||||
float **buffers; /* [r/w] array of buffers */
|
||||
FMOD_SPEAKERMODE speakermode; /* [r/w] speaker mode for all buffers in the array */
|
||||
} FMOD_DSP_BUFFER_ARRAY;
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Operation type for FMOD_DSP_PROCESS_CALLBACK.
|
||||
|
||||
[REMARKS]
|
||||
A process callback will be called twice per mix for a DSP unit. Once with the FMOD_DSP_PROCESS_QUERY command, then conditionally, FMOD_DSP_PROCESS_PERFORM.<br>
|
||||
FMOD_DSP_PROCESS_QUERY is to be handled only by filling out the outputarray information, and returning a relevant return code.<br>
|
||||
It should not really do any logic besides checking and returning one of the following codes:<br>
|
||||
- FMOD_OK - Meaning yes, it should execute the dsp process function with FMOD_DSP_PROCESS_PERFORM<br>
|
||||
- FMOD_ERR_DSP_DONTPROCESS - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM.<br>
|
||||
- FMOD_ERR_DSP_SILENCE - Meaning no, it should skip the process function and not call it with FMOD_DSP_PROCESS_PERFORM, AND, tell the signal chain to follow that it is now idle, so that no more processing happens down the chain.<br>
|
||||
If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. Mask can be 0.<br>
|
||||
<br>
|
||||
FMOD_DSP_PROCESS_PROCESS is to be handled by reading the data from the input, processing it, and writing it to the output. Always write to the output buffer and fill it fully to avoid unpredictable audio output.<br>
|
||||
Always return FMOD_OK, the return value is ignored from the process stage.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_DESCRIPTION
|
||||
]
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FMOD_DSP_PROCESS_PERFORM, /* Process the incoming audio in 'inbufferarray' and output to 'outbufferarray'. */
|
||||
FMOD_DSP_PROCESS_QUERY /* The DSP is being queried for the expected output format and whether it needs to process audio or should be bypassed. The function should return FMOD_OK, or FMOD_ERR_DSP_DONTPROCESS or FMOD_ERR_DSP_SILENCE if audio can pass through unprocessed. See remarks for more. If audio is to be processed, 'outbufferarray' must be filled with the expected output format, channel count and mask. */
|
||||
} FMOD_DSP_PROCESS_OPERATION;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Complex number structure used for holding FFT frequency domain-data for FMOD_FFTREAL and FMOD_IFFTREAL DSP callbacks.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_COMPLEX
|
||||
{
|
||||
float real; /* Real component */
|
||||
float imag; /* Imaginary component */
|
||||
} FMOD_COMPLEX;
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Flags for the FMOD_DSP_PAN_SUM_SURROUND_MATRIX callback.
|
||||
|
||||
[REMARKS]
|
||||
This functionality is experimental, please contact support@fmod.org for more information.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_STATE_PAN_CALLBACKS
|
||||
]
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FMOD_DSP_PAN_SURROUND_DEFAULT = 0,
|
||||
FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED = 1,
|
||||
|
||||
FMOD_DSP_PAN_SURROUND_FLAGS_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_DSP_PAN_SURROUND_FLAGS;
|
||||
|
||||
/*
|
||||
DSP callbacks
|
||||
*/
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASE_CALLBACK) (FMOD_DSP_STATE *dsp_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESET_CALLBACK) (FMOD_DSP_STATE *dsp_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READ_CALLBACK) (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int *outchannels);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int length, const FMOD_DSP_BUFFER_ARRAY *inbufferarray, FMOD_DSP_BUFFER_ARRAY *outbufferarray, FMOD_BOOL inputsidle, FMOD_DSP_PROCESS_OPERATION op);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITION_CALLBACK) (FMOD_DSP_STATE *dsp_state, unsigned int pos);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SHOULDIPROCESS_CALLBACK) (FMOD_DSP_STATE *dsp_state, FMOD_BOOL inputsidle, unsigned int length, FMOD_CHANNELMASK inmask, int inchannels, FMOD_SPEAKERMODE speakermode);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float value);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int value);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL value);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void *data, unsigned int length);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_FLOAT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_INT_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, int *value, char *valuestr);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_BOOL_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, FMOD_BOOL *value, char *valuestr);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAM_DATA_CALLBACK) (FMOD_DSP_STATE *dsp_state, int index, void **data, unsigned int *length, char *valuestr);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_REGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK) (FMOD_DSP_STATE *dsp_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_MIX_CALLBACK) (FMOD_DSP_STATE *dsp_state, int stage);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETSAMPLERATE) (FMOD_DSP_STATE *dsp_state, int *rate);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETBLOCKSIZE) (FMOD_DSP_STATE *dsp_state, unsigned int *blocksize);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SYSTEM_GETSPEAKERMODE) (FMOD_DSP_STATE *dsp_state, FMOD_SPEAKERMODE *speakermode_mixer, FMOD_SPEAKERMODE *speakermode_output);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DFT_FFTREAL) (FMOD_DSP_STATE* thisdsp, int size, const float *signal, FMOD_COMPLEX* dft, const float *window, int signalhop);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DFT_IFFTREAL) (FMOD_DSP_STATE* thisdsp, int size, const FMOD_COMPLEX *dft, float* signal, const float *window, int signalhop);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_MONO_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, float *matrix);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_STEREO_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_SURROUND_MATRIX) (FMOD_DSP_STATE *dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix, FMOD_DSP_PAN_SURROUND_FLAGS flags);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_MONO_TO_SURROUND_MATRIX) (FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_SUM_STEREO_TO_SURROUND_MATRIX)(FMOD_DSP_STATE *dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, float *matrix);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_PAN_3D_GET_ROLLOFF_GAIN) (FMOD_DSP_STATE *dsp_state, FMOD_DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, float *gain);
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_DSP_GETPARAM_VALUESTR_LENGTH
|
||||
|
||||
[DESCRIPTION]
|
||||
Length in bytes of the buffer pointed to by the valuestr argument of FMOD_DSP_GETPARAM_XXXX_CALLBACK functions.
|
||||
|
||||
[REMARKS]
|
||||
DSP plugins should not copy more than this number of bytes into the buffer or memory corruption will occur.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_GETPARAM_FLOAT_CALLBACK
|
||||
FMOD_DSP_GETPARAM_INT_CALLBACK
|
||||
FMOD_DSP_GETPARAM_BOOL_CALLBACK
|
||||
FMOD_DSP_GETPARAM_DATA_CALLBACK
|
||||
]
|
||||
*/
|
||||
#define FMOD_DSP_GETPARAM_VALUESTR_LENGTH 32
|
||||
/* [DEFINE_END] */
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
DSP parameter types.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FMOD_DSP_PARAMETER_TYPE_FLOAT,
|
||||
FMOD_DSP_PARAMETER_TYPE_INT,
|
||||
FMOD_DSP_PARAMETER_TYPE_BOOL,
|
||||
FMOD_DSP_PARAMETER_TYPE_DATA,
|
||||
|
||||
FMOD_DSP_PARAMETER_TYPE_MAX, /* Maximum number of DSP parameter types. */
|
||||
FMOD_DSP_PARAMETER_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_DSP_PARAMETER_TYPE;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
DSP float parameter mappings. These determine how values are mapped across dials and automation curves.
|
||||
|
||||
[REMARKS]
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO generates a mapping based on range and units. For example, if the units are in Hertz and the range is with-in the audio spectrum, a Bark scale will be chosen. Logarithmic scales may also be generated for ranges above zero spanning several orders of magnitude.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING
|
||||
]
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR, /* Values mapped linearly across range. */
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, /* A mapping is automatically chosen based on range and units. See remarks. */
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, /* Values mapped in a piecewise linear fashion defined by FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR. */
|
||||
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a piecewise linear mapping.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
|
||||
{
|
||||
int numpoints; /* [w] The number of <position, value> pairs in the piecewise mapping (at least 2). */
|
||||
float *pointparamvalues; /* [w] The values in the parameter's units for each point */
|
||||
float *pointpositions; /* [w] The positions along the control's scale (e.g. dial angle) corresponding to each parameter value. The range of this scale is arbitrary and all positions will be relative to the minimum and maximum values (e.g. [0,1,3] is equivalent to [1,2,4] and [2,4,8]). If this array is zero, pointparamvalues will be distributed with equal spacing. */
|
||||
} FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a mapping for a DSP unit's float parameter.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR
|
||||
FMOD_DSP_PARAMETER_DESC_FLOAT
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_FLOAT_MAPPING
|
||||
{
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE type;
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; /* [w] Only required for FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR type mapping. */
|
||||
} FMOD_DSP_PARAMETER_FLOAT_MAPPING;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a float parameter for a DSP unit.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterFloat
|
||||
DSP::getParameterFloat
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_DESC_FLOAT
|
||||
{
|
||||
float min; /* [w] Minimum parameter value. */
|
||||
float max; /* [w] Maximum parameter value. */
|
||||
float defaultval; /* [w] Default parameter value. */
|
||||
FMOD_DSP_PARAMETER_FLOAT_MAPPING mapping; /* [w] How the values are distributed across dials and automation curves (e.g. linearly, exponentially etc). */
|
||||
} FMOD_DSP_PARAMETER_DESC_FLOAT;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a int parameter for a DSP unit.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterInt
|
||||
DSP::getParameterInt
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_DESC_INT
|
||||
{
|
||||
int min; /* [w] Minimum parameter value. */
|
||||
int max; /* [w] Maximum parameter value. */
|
||||
int defaultval; /* [w] Default parameter value. */
|
||||
FMOD_BOOL goestoinf; /* [w] Whether the last value represents infiniy. */
|
||||
const char* const* valuenames; /* [w] Names for each value. There should be as many strings as there are possible values (max - min + 1). Optional. */
|
||||
} FMOD_DSP_PARAMETER_DESC_INT;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a boolean parameter for a DSP unit.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterBool
|
||||
DSP::getParameterBool
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_DESC_BOOL
|
||||
{
|
||||
FMOD_BOOL defaultval; /* [w] Default parameter value. */
|
||||
const char* const* valuenames; /* [w] Names for false and true, respectively. There should be two strings. Optional. */
|
||||
} FMOD_DSP_PARAMETER_DESC_BOOL;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure to define a data parameter for a DSP unit. Use 0 or above for custom types. This parameter will be treated specially by the system if set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterData
|
||||
DSP::getParameterData
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_DESC_DATA
|
||||
{
|
||||
int datatype; /* [w] The type of data for this parameter. Use 0 or above for custom types or set to one of the FMOD_DSP_PARAMETER_DATA_TYPE values. */
|
||||
} FMOD_DSP_PARAMETER_DESC_DATA;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Base Structure for DSP parameter descriptions.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterFloat
|
||||
DSP::getParameterFloat
|
||||
DSP::setParameterInt
|
||||
DSP::getParameterInt
|
||||
DSP::setParameterBool
|
||||
DSP::getParameterBool
|
||||
DSP::setParameterData
|
||||
DSP::getParameterData
|
||||
FMOD_DSP_PARAMETER_DESC_FLOAT
|
||||
FMOD_DSP_PARAMETER_DESC_INT
|
||||
FMOD_DSP_PARAMETER_DESC_BOOL
|
||||
FMOD_DSP_PARAMETER_DESC_DATA
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_DESC
|
||||
{
|
||||
FMOD_DSP_PARAMETER_TYPE type; /* [w] Type of this parameter. */
|
||||
char name[16]; /* [w] Name of the parameter to be displayed (ie "Cutoff frequency"). */
|
||||
char label[16]; /* [w] Short string to be put next to value to denote the unit type (ie "hz"). */
|
||||
const char *description; /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */
|
||||
|
||||
union
|
||||
{
|
||||
FMOD_DSP_PARAMETER_DESC_FLOAT floatdesc; /* [w] Struct containing information about the parameter in floating point format. Use when type is FMOD_DSP_PARAMETER_TYPE_FLOAT. */
|
||||
FMOD_DSP_PARAMETER_DESC_INT intdesc; /* [w] Struct containing information about the parameter in integer format. Use when type is FMOD_DSP_PARAMETER_TYPE_INT. */
|
||||
FMOD_DSP_PARAMETER_DESC_BOOL booldesc; /* [w] Struct containing information about the parameter in boolean format. Use when type is FMOD_DSP_PARAMETER_TYPE_BOOL. */
|
||||
FMOD_DSP_PARAMETER_DESC_DATA datadesc; /* [w] Struct containing information about the parameter in data format. Use when type is FMOD_DSP_PARAMETER_TYPE_DATA. */
|
||||
};
|
||||
} FMOD_DSP_PARAMETER_DESC;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Built-in types for the 'datatype' member of FMOD_DSP_PARAMETER_DESC_DATA. Data parameters of type other than FMOD_DSP_PARAMETER_DATA_TYPE_USER will be treated specially by the system.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DESC_DATA
|
||||
FMOD_DSP_PARAMETER_OVERALLGAIN
|
||||
FMOD_DSP_PARAMETER_3DATTRIBUTES
|
||||
FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
|
||||
FMOD_DSP_PARAMETER_SIDECHAIN
|
||||
]
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_USER = 0, /* The default data type. All user data types should be 0 or above. */
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, /* The data type for FMOD_DSP_PARAMETER_OVERALLGAIN parameters. There should a maximum of one per DSP. */
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES parameters. There should a maximum of one per DSP. */
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, /* The data type for FMOD_DSP_PARAMETER_SIDECHAIN parameters. There should a maximum of one per DSP. */
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_FFT = -4, /* The data type for FMOD_DSP_PARAMETER_FFT parameters. There should a maximum of one per DSP. */
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5, /* The data type for FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI parameters. There should a maximum of one per DSP. */
|
||||
} FMOD_DSP_PARAMETER_DATA_TYPE;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN.
|
||||
A parameter of this type is used in effects that affect the overgain of the signal in a predictable way.
|
||||
This parameter is read by the system to determine the effect's gain for voice virtualization.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_OVERALLGAIN
|
||||
{
|
||||
float linear_gain; /* [r] The overall linear gain of the effect on the direct signal path */
|
||||
float linear_gain_additive; /* [r] Additive gain, for parallel signal paths */
|
||||
} FMOD_DSP_PARAMETER_OVERALLGAIN;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES.
|
||||
A parameter of this type is used in effects that respond to a sound's 3D position.
|
||||
The system will set this parameter automatically if a sound's position changes.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES
|
||||
{
|
||||
FMOD_3D_ATTRIBUTES relative; /* [w] The position of the sound relative to the listener. */
|
||||
FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
|
||||
} FMOD_DSP_PARAMETER_3DATTRIBUTES;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI.
|
||||
A parameter of this type is used in effects that respond to a sound's 3D position, and
|
||||
support multiple listeners.
|
||||
The system will set this parameter automatically if a sound's position changes.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI
|
||||
{
|
||||
int numlisteners; /* [w] The number of listeners. */
|
||||
FMOD_3D_ATTRIBUTES relative[FMOD_MAX_LISTENERS]; /* [w] The position of the sound relative to the listeners. */
|
||||
FMOD_3D_ATTRIBUTES absolute; /* [w] The position of the sound in world coordinates. */
|
||||
} FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN.
|
||||
A parameter of this type is declared for effects which support sidechaining.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_SIDECHAIN
|
||||
{
|
||||
FMOD_BOOL sidechainenable; /* [r/w] Whether sidechains are enabled. */
|
||||
} FMOD_DSP_PARAMETER_SIDECHAIN;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure for data parameters of type FMOD_DSP_PARAMETER_DATA_TYPE_FFT.
|
||||
A parameter of this type is declared for the FMOD_DSP_TYPE_FFT effect.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
<br>
|
||||
Notes on the spectrum data member. Values inside the float buffer are typically between 0 and 1.0.<br>
|
||||
Each top level array represents one PCM channel of data.<br>
|
||||
Address data as spectrum[channel][bin]. A bin is 1 fft window entry.<br>
|
||||
Only read/display half of the buffer typically for analysis as the 2nd half is usually the same data reversed due to the nature of the way FFT works.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
FMOD_DSP_PARAMETER_DATA_TYPE_FFT
|
||||
FMOD_DSP_TYPE
|
||||
FMOD_DSP_FFT
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_PARAMETER_FFT
|
||||
{
|
||||
int length; /* [r] Number of entries in this spectrum window. Divide this by the output rate to get the hz per entry. */
|
||||
int numchannels; /* [r] Number of channels in spectrum. */
|
||||
float *spectrum[32]; /* [r] Per channel spectrum arrays. See remarks for more. */
|
||||
} FMOD_DSP_PARAMETER_FFT;
|
||||
|
||||
|
||||
/*
|
||||
Helpers for declaring parameters in custom DSPSs
|
||||
*/
|
||||
#define FMOD_DSP_INIT_PARAMDESC_FLOAT(_paramstruct, _name, _label, _description, _min, _max, _defaultval) \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
|
||||
strncpy((_paramstruct).name, _name, 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).floatdesc.min = _min; \
|
||||
(_paramstruct).floatdesc.max = _max; \
|
||||
(_paramstruct).floatdesc.defaultval = _defaultval; \
|
||||
(_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO;
|
||||
|
||||
#define FMOD_DSP_INIT_PARAMDESC_FLOAT_WITH_MAPPING(_paramstruct, _name, _label, _description, _defaultval, _values, _positions); \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_FLOAT; \
|
||||
strncpy((_paramstruct).name, _name , 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).floatdesc.min = _values[0]; \
|
||||
(_paramstruct).floatdesc.max = _values[sizeof(_values) / sizeof(float) - 1]; \
|
||||
(_paramstruct).floatdesc.defaultval = _defaultval; \
|
||||
(_paramstruct).floatdesc.mapping.type = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR; \
|
||||
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.numpoints = sizeof(_values) / sizeof(float); \
|
||||
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointparamvalues = _values; \
|
||||
(_paramstruct).floatdesc.mapping.piecewiselinearmapping.pointpositions = _positions;
|
||||
|
||||
#define FMOD_DSP_INIT_PARAMDESC_INT(_paramstruct, _name, _label, _description, _min, _max, _defaultval, _goestoinf, _valuenames) \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
|
||||
strncpy((_paramstruct).name, _name , 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).intdesc.min = _min; \
|
||||
(_paramstruct).intdesc.max = _max; \
|
||||
(_paramstruct).intdesc.defaultval = _defaultval; \
|
||||
(_paramstruct).intdesc.goestoinf = _goestoinf; \
|
||||
(_paramstruct).intdesc.valuenames = _valuenames;
|
||||
|
||||
#define FMOD_DSP_INIT_PARAMDESC_INT_ENUMERATED(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_INT; \
|
||||
strncpy((_paramstruct).name, _name , 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).intdesc.min = 0; \
|
||||
(_paramstruct).intdesc.max = sizeof(_valuenames) / sizeof(char*) - 1; \
|
||||
(_paramstruct).intdesc.defaultval = _defaultval; \
|
||||
(_paramstruct).intdesc.goestoinf = false; \
|
||||
(_paramstruct).intdesc.valuenames = _valuenames;
|
||||
|
||||
#define FMOD_DSP_INIT_PARAMDESC_BOOL(_paramstruct, _name, _label, _description, _defaultval, _valuenames) \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_BOOL; \
|
||||
strncpy((_paramstruct).name, _name , 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).booldesc.defaultval = _defaultval; \
|
||||
(_paramstruct).booldesc.valuenames = _valuenames;
|
||||
|
||||
#define FMOD_DSP_INIT_PARAMDESC_DATA(_paramstruct, _name, _label, _description, _datatype) \
|
||||
memset(&(_paramstruct), 0, sizeof(_paramstruct)); \
|
||||
(_paramstruct).type = FMOD_DSP_PARAMETER_TYPE_DATA; \
|
||||
strncpy((_paramstruct).name, _name , 15); \
|
||||
strncpy((_paramstruct).label, _label, 15); \
|
||||
(_paramstruct).description = _description; \
|
||||
(_paramstruct).datadesc.datatype = _datatype;
|
||||
|
||||
#define FMOD_PLUGIN_SDK_VERSION 107
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
<br>
|
||||
There are 2 different ways to change a parameter in this architecture.<br>
|
||||
One is to use DSP::setParameterFloat / DSP::setParameterInt / DSP::setParameterBool / DSP::setParameterData. This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.<br>
|
||||
The other is to use DSP::showConfigDialog. This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
System::createDSP
|
||||
DSP::setParameterFloat
|
||||
DSP::setParameterInt
|
||||
DSP::setParameterBool
|
||||
DSP::setParameterData
|
||||
FMOD_DSP_STATE
|
||||
FMOD_DSP_CREATE_CALLBACK
|
||||
FMOD_DSP_RELEASE_CALLBACK
|
||||
FMOD_DSP_RESET_CALLBACK
|
||||
FMOD_DSP_READ_CALLBACK
|
||||
FMOD_DSP_PROCESS_CALLBACK
|
||||
FMOD_DSP_SETPOSITION_CALLBACK
|
||||
FMOD_DSP_PARAMETER_DESC
|
||||
FMOD_DSP_SETPARAM_FLOAT_CALLBACK
|
||||
FMOD_DSP_SETPARAM_INT_CALLBACK
|
||||
FMOD_DSP_SETPARAM_BOOL_CALLBACK
|
||||
FMOD_DSP_SETPARAM_DATA_CALLBACK
|
||||
FMOD_DSP_GETPARAM_FLOAT_CALLBACK
|
||||
FMOD_DSP_GETPARAM_INT_CALLBACK
|
||||
FMOD_DSP_GETPARAM_BOOL_CALLBACK
|
||||
FMOD_DSP_GETPARAM_DATA_CALLBACK
|
||||
FMOD_DSP_SHOULDIPROCESS_CALLBACK
|
||||
FMOD_DSP_SYSTEM_REGISTER_CALLBACK
|
||||
FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK
|
||||
FMOD_DSP_SYSTEM_MIX_CALLBACK
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_DESCRIPTION
|
||||
{
|
||||
unsigned int pluginsdkversion; /* [w] The plugin SDK version this plugin is built for. set to this to FMOD_PLUGIN_SDK_VERSION defined above. */
|
||||
char name[32]; /* [w] The identifier of the DSP. This will also be used as the name of DSP and shouldn't change between versions. */
|
||||
unsigned int version; /* [w] Plugin writer's version number. */
|
||||
int numinputbuffers; /* [w] Number of input buffers to process. Use 0 for DSPs that only generate sound and 1 for effects that process incoming sound. */
|
||||
int numoutputbuffers; /* [w] Number of audio output buffers. Only one output buffer is currently supported. */
|
||||
FMOD_DSP_CREATE_CALLBACK create; /* [w] Create callback. This is called when DSP unit is created. Can be null. */
|
||||
FMOD_DSP_RELEASE_CALLBACK release; /* [w] Release callback. This is called just before the unit is freed so the user can do any cleanup needed for the unit. Can be null. */
|
||||
FMOD_DSP_RESET_CALLBACK reset; /* [w] Reset callback. This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state. Use to avoid clicks or artifacts. */
|
||||
FMOD_DSP_READ_CALLBACK read; /* [w] Read callback. Processing is done here. Can be null. */
|
||||
FMOD_DSP_PROCESS_CALLBACK process; /* [w] Process callback. Can be specified instead of the read callback if any channel format changes occur between input and output. This also replaces shouldiprocess and should return an error if the effect is to be bypassed. Can be null. */
|
||||
FMOD_DSP_SETPOSITION_CALLBACK setposition; /* [w] Set position callback. This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source. Can be null. */
|
||||
|
||||
int numparameters; /* [w] Number of parameters used in this filter. The user finds this with DSP::getNumParameters */
|
||||
FMOD_DSP_PARAMETER_DESC **paramdesc; /* [w] Variable number of parameter structures. */
|
||||
FMOD_DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; /* [w] This is called when the user calls DSP::setParameterFloat. Can be null. */
|
||||
FMOD_DSP_SETPARAM_INT_CALLBACK setparameterint; /* [w] This is called when the user calls DSP::setParameterInt. Can be null. */
|
||||
FMOD_DSP_SETPARAM_BOOL_CALLBACK setparameterbool; /* [w] This is called when the user calls DSP::setParameterBool. Can be null. */
|
||||
FMOD_DSP_SETPARAM_DATA_CALLBACK setparameterdata; /* [w] This is called when the user calls DSP::setParameterData. Can be null. */
|
||||
FMOD_DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; /* [w] This is called when the user calls DSP::getParameterFloat. Can be null. */
|
||||
FMOD_DSP_GETPARAM_INT_CALLBACK getparameterint; /* [w] This is called when the user calls DSP::getParameterInt. Can be null. */
|
||||
FMOD_DSP_GETPARAM_BOOL_CALLBACK getparameterbool; /* [w] This is called when the user calls DSP::getParameterBool. Can be null. */
|
||||
FMOD_DSP_GETPARAM_DATA_CALLBACK getparameterdata; /* [w] This is called when the user calls DSP::getParameterData. Can be null. */
|
||||
FMOD_DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; /* [w] This is called before processing. You can detect if inputs are idle and return FMOD_OK to process, or any other error code to avoid processing the effect. Use a count down timer to allow effect tails to process before idling! */
|
||||
void *userdata; /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation. Access via DSP::getUserData. */
|
||||
|
||||
FMOD_DSP_SYSTEM_REGISTER_CALLBACK sys_register; /* [w] Register callback. This is called when DSP unit is loaded/registered. Useful for 'global'/per system object init for plugin. Can be null. */
|
||||
FMOD_DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; /* [w] Deregister callback. This is called when DSP unit is unloaded/deregistered. Useful as 'global'/per system object shutdown for plugin. Can be null. */
|
||||
FMOD_DSP_SYSTEM_MIX_CALLBACK sys_mix; /* [w] System mix stage callback. This is called when the mixer starts to execute or is just finishing executing. Useful for 'global'/per system object once a mix update calls for a plugin. Can be null. */
|
||||
|
||||
} FMOD_DSP_DESCRIPTION;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Struct containing DFT callbacks for plugins, to enable a plugin to perform optimized time-frequency domain conversion.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_STATE_DFTCALLBACKS
|
||||
{
|
||||
FMOD_DSP_DFT_FFTREAL fftreal; /* [r] Callback for performing an FFT on a real signal. */
|
||||
FMOD_DSP_DFT_IFFTREAL inversefftreal; /* [r] Callback for performing an inverse FFT to get a real signal. */
|
||||
} FMOD_DSP_STATE_DFTCALLBACKS;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Struct containing panning helper callbacks for plugins.
|
||||
|
||||
[REMARKS]
|
||||
These are experimental, please contact support@fmod.org for more information.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
FMOD_DSP_PAN_SURROUND_FLAGS
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_STATE_PAN_CALLBACKS
|
||||
{
|
||||
FMOD_DSP_PAN_SUM_MONO_MATRIX summonomatrix;
|
||||
FMOD_DSP_PAN_SUM_STEREO_MATRIX sumstereomatrix;
|
||||
FMOD_DSP_PAN_SUM_SURROUND_MATRIX sumsurroundmatrix;
|
||||
FMOD_DSP_PAN_SUM_MONO_TO_SURROUND_MATRIX summonotosurroundmatrix;
|
||||
FMOD_DSP_PAN_SUM_STEREO_TO_SURROUND_MATRIX sumstereotosurroundmatrix;
|
||||
FMOD_DSP_PAN_3D_GET_ROLLOFF_GAIN getrolloffgain;
|
||||
} FMOD_DSP_STATE_PAN_CALLBACKS;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Struct containing System level callbacks for plugins, to enable a plugin to query information about the system or allocate memory using FMOD's (and therefore possibly the game's) allocators.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_STATE
|
||||
FMOD_DSP_STATE_DFTCALLBACKS
|
||||
FMOD_DSP_STATE_PAN_CALLBACKS
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
{
|
||||
FMOD_MEMORY_ALLOC_CALLBACK alloc; /* [r] Memory allocation callback. Use this for all dynamic memory allocation within the plugin. */
|
||||
FMOD_MEMORY_REALLOC_CALLBACK realloc; /* [r] Memory reallocation callback. */
|
||||
FMOD_MEMORY_FREE_CALLBACK free; /* [r] Memory free callback. */
|
||||
FMOD_DSP_SYSTEM_GETSAMPLERATE getsamplerate; /* [r] Callback for getting the system samplerate. */
|
||||
FMOD_DSP_SYSTEM_GETBLOCKSIZE getblocksize; /* [r] Callback for getting the system's block size. DSPs will be requested to process blocks of varying length up to this size.*/
|
||||
FMOD_DSP_STATE_DFTCALLBACKS *dft; /* [r] Struct containing callbacks for performing FFTs and inverse FFTs. */
|
||||
FMOD_DSP_STATE_PAN_CALLBACKS *pancallbacks; /* [r] Pointer to a structure of callbacks for calculating pan, up-mix and down-mix matrices. */
|
||||
FMOD_DSP_SYSTEM_GETSPEAKERMODE getspeakermode; /* [r] Callback for getting the system's speaker modes. One is the mixer's default speaker mode, the other is the output mode the system is downmixing or upmixing to.*/
|
||||
} FMOD_DSP_STATE_SYSTEMCALLBACKS;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
DSP plugin structure that is passed into each callback.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
<br>
|
||||
'systemobject' is an integer that relates to the System object that created the DSP or registered the DSP plugin. If only 1 System object is created then it should be 0. A second object would be 1 and so on.
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS::getsamplerate/getblocksize/getspeakermode could return different results so it could be relevant to plugin developers to monitor which object is being used.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_DSP_DESCRIPTION
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
]
|
||||
*/
|
||||
struct FMOD_DSP_STATE
|
||||
{
|
||||
FMOD_DSP *instance; /* [r] Handle to the FMOD_DSP object the callback is associated with. Not to be modified. C++ users cast to FMOD::DSP to use. */
|
||||
void *plugindata; /* [r/w] Plugin writer created data the output author wants to attach to this object. */
|
||||
FMOD_CHANNELMASK channelmask; /* [r] Specifies which speakers the DSP effect is active on */
|
||||
FMOD_SPEAKERMODE source_speakermode; /* [r] Specifies which speaker mode the signal originated for information purposes, ie in case panning needs to be done differently. */
|
||||
float *sidechaindata; /* [r] The mixed result of all incoming sidechains is stored at this pointer address. */
|
||||
int sidechainchannels; /* [r] The number of channels of pcm data stored within the sidechain buffer. */
|
||||
FMOD_DSP_STATE_SYSTEMCALLBACKS *callbacks; /* [r] Struct containing callbacks for system level functionality. */
|
||||
int systemobject; /* [r] FMOD::System object index, relating to the System object that created this DSP. */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Macro helpers for accessing FMOD_DSP_STATE_SYSTEMCALLBACKS
|
||||
*/
|
||||
#define FMOD_DSP_STATE_MEMALLOC(_state, _size, _type, _str) (_state)->callbacks->alloc (_size, _type, _str); /* Pass in the FMOD_DSP_STATE handle, size in bytes to alloc, FMOD_MEMORY_TYPE type and optional char * string to identify where the alloc came from. */
|
||||
#define FMOD_DSP_STATE_MEMREALLOC(_state, _ptr, _size, _type, _str) (_state)->callbacks->realloc (_ptr, _size, _type, _str); /* Pass in the FMOD_DSP_STATE handle, optional existing memory pointer, size in bytes to alloc, FMOD_MEMORY_TYPE type and optional char * string to identify where the alloc came from. */
|
||||
#define FMOD_DSP_STATE_MEMFREE(_state, _ptr, _type, _str) (_state)->callbacks->free (_ptr, _type, _str); /* Pass in the FMOD_DSP_STATE handle, existing memory pointer, FMOD_MEMORY_TYPE type and optional char * string to identify where the free came from. */
|
||||
#define FMOD_DSP_STATE_GETSAMPLERATE(_state, _rate) (_state)->callbacks->getsamplerate (_state, _rate); /* Pass in the FMOD_DSP_STATE handle, and the address of an int to receive the system DSP sample rate. */
|
||||
#define FMOD_DSP_STATE_GETBLOCKSIZE(_state, _blocksize) (_state)->callbacks->getblocksize (_state, _blocksize); /* Pass in the FMOD_DSP_STATE handle, and the address of an unsigned int to receive the system DSP block size. */
|
||||
#define FMOD_DSP_STATE_GETSPEAKERMODE(_state, _speakermode_mix, _speakermode_out) (_state)->callbacks->getspeakermode(_state, _speakermode_mix, _speakermode_out); /* Pass in the FMOD_DSP_STATE handle, and the address of an unsigned int to receive the FMOD_SPEAKERMODE for the mixer, and for the mode the system is set to. */
|
||||
#define FMOD_DSP_STATE_FFTREAL(_state, _size, _signal, _dft, _window, _signalhop) (_state)->callbacks->dft->fftreal (_state, _size, _signal, _dft, _window, _signalhop); /* Pass in the FMOD_DSP_STATE handle, size of the signal and its DFT, a float buffer containing the signal and an FMOD_COMPLEX buffer to store the calculated DFT. */
|
||||
#define FMOD_DSP_STATE_IFFTREAL(_state, _size, _dft, _signal, _window, _signalhop) (_state)->callbacks->dft->inversefftreal(_state, _size, _dft, _signal, _window, _signalhop); /* Pass in the FMOD_DSP_STATE handle, size of the DFT and its signal, an FMOD_COMPLEX buffer containing the DFT and a float buffer to store the calculated signal. */
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
DSP metering info used for retrieving metering info with DSP::getMeteringInfo
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_SPEAKER
|
||||
DSP::getMeteringInfo
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_DSP_METERING_INFO
|
||||
{
|
||||
int numsamples; /* [r] The number of samples considered for this metering info. */
|
||||
float peaklevel[32]; /* [r] The peak level per channel. */
|
||||
float rmslevel[32]; /* [r] The rms level per channel. */
|
||||
short numchannels; /* [r] Number of channels. */
|
||||
} FMOD_DSP_METERING_INFO;
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,113 @@
|
|||
/*$ preserve start $*/
|
||||
|
||||
/* ================================================================================================== */
|
||||
/* FMOD Studio - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
|
||||
/* */
|
||||
/* Use this header if you want to store or display a string version / english explanation of */
|
||||
/* the FMOD error codes. */
|
||||
/* */
|
||||
/* ================================================================================================== */
|
||||
|
||||
#ifndef _FMOD_ERRORS_H
|
||||
#define _FMOD_ERRORS_H
|
||||
|
||||
#include "fmod.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
static const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));
|
||||
#endif
|
||||
|
||||
static const char *FMOD_ErrorString(FMOD_RESULT errcode)
|
||||
{
|
||||
switch (errcode)
|
||||
{
|
||||
/*$ preserve end $*/
|
||||
case FMOD_OK: return "No errors.";
|
||||
case FMOD_ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
|
||||
case FMOD_ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
|
||||
case FMOD_ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
|
||||
case FMOD_ERR_DMA: return "DMA Failure. See debug output for more information.";
|
||||
case FMOD_ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
|
||||
case FMOD_ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
|
||||
case FMOD_ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
|
||||
case FMOD_ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
|
||||
case FMOD_ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
|
||||
case FMOD_ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
|
||||
case FMOD_ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
|
||||
case FMOD_ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
|
||||
case FMOD_ERR_FILE_BAD: return "Error loading file.";
|
||||
case FMOD_ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
|
||||
case FMOD_ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
|
||||
case FMOD_ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
|
||||
case FMOD_ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
|
||||
case FMOD_ERR_FILE_NOTFOUND: return "File not found.";
|
||||
case FMOD_ERR_FORMAT: return "Unsupported file or audio format.";
|
||||
case FMOD_ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
|
||||
case FMOD_ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
|
||||
case FMOD_ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
|
||||
case FMOD_ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
|
||||
case FMOD_ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
|
||||
case FMOD_ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
|
||||
case FMOD_ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
|
||||
case FMOD_ERR_INITIALIZED: return "Cannot call this command after System::init.";
|
||||
case FMOD_ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
|
||||
case FMOD_ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
|
||||
case FMOD_ERR_INVALID_HANDLE: return "An invalid object handle was used.";
|
||||
case FMOD_ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
|
||||
case FMOD_ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
|
||||
case FMOD_ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
|
||||
case FMOD_ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
|
||||
case FMOD_ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
|
||||
case FMOD_ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
|
||||
case FMOD_ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
|
||||
case FMOD_ERR_MEMORY: return "Not enough memory or resources.";
|
||||
case FMOD_ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
|
||||
case FMOD_ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
|
||||
case FMOD_ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
|
||||
case FMOD_ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
|
||||
case FMOD_ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
|
||||
case FMOD_ERR_NET_URL: return "The specified URL couldn't be resolved.";
|
||||
case FMOD_ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
|
||||
case FMOD_ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
|
||||
case FMOD_ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
|
||||
case FMOD_ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
|
||||
case FMOD_ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
|
||||
case FMOD_ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
|
||||
case FMOD_ERR_OUTPUT_INIT: return "Error initializing output device.";
|
||||
case FMOD_ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
|
||||
case FMOD_ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
|
||||
case FMOD_ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
|
||||
case FMOD_ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
|
||||
case FMOD_ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
|
||||
case FMOD_ERR_RECORD: return "An error occurred trying to initialize the recording device.";
|
||||
case FMOD_ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
|
||||
case FMOD_ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
|
||||
case FMOD_ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
|
||||
case FMOD_ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
|
||||
case FMOD_ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
|
||||
case FMOD_ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
|
||||
case FMOD_ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
|
||||
case FMOD_ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
|
||||
case FMOD_ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
|
||||
case FMOD_ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
|
||||
case FMOD_ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
|
||||
case FMOD_ERR_VERSION: return "The version number of this file format is not supported.";
|
||||
case FMOD_ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
|
||||
case FMOD_ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
|
||||
case FMOD_ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
|
||||
case FMOD_ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
|
||||
case FMOD_ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found.";
|
||||
case FMOD_ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
|
||||
case FMOD_ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
|
||||
case FMOD_ERR_INVALID_STRING: return "An invalid string was passed to this function.";
|
||||
case FMOD_ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
|
||||
case FMOD_ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
|
||||
case FMOD_ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
|
||||
case FMOD_ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit.";
|
||||
default : return "Unknown error.";
|
||||
/*$ preserve start $*/
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
/*$ preserve end $*/
|
|
@ -0,0 +1,88 @@
|
|||
/* ======================================================================================================== */
|
||||
/* FMOD Studio - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
|
||||
/* */
|
||||
/* Use this header if you are wanting to develop your own output plugin to use with */
|
||||
/* FMOD's output system. With this header you can make your own output plugin that FMOD */
|
||||
/* can register and use. See the documentation and examples on how to make a working plugin. */
|
||||
/* */
|
||||
/* ======================================================================================================== */
|
||||
|
||||
#ifndef _FMOD_OUTPUT_H
|
||||
#define _FMOD_OUTPUT_H
|
||||
|
||||
typedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;
|
||||
|
||||
/*
|
||||
Output callbacks
|
||||
*/
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int *numdrivers);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERINFO_CALLBACK) (FMOD_OUTPUT_STATE *output, int id, char *name, int namelen, FMOD_GUID *guid, int *systemrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INIT_CALLBACK) (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, FMOD_SPEAKERMODE *speakermode, int *speakermodechannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_START_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_STOP_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATE_CALLBACK) (FMOD_OUTPUT_STATE *output_state);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLE_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void **handle);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITION_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCK_CALLBACK) (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
|
||||
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER) (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length); /* This one is called by plugin through FMOD_OUTPUT_STATE, not set by user as a callback. */
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file of this type.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
|
||||
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_OUTPUT_STATE
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_OUTPUT_DESCRIPTION
|
||||
{
|
||||
const char *name; /* [in] Name of the output. */
|
||||
unsigned int version; /* [in] Plugin writer's version number. */
|
||||
int polling; /* [in] If TRUE (non zero), this tells FMOD to start a thread and call getposition / lock / unlock for feeding data. If 0, the output is probably callback based, so all the plugin needs to do is call readfrommixer to the appropriate pointer. */
|
||||
FMOD_OUTPUT_GETNUMDRIVERS_CALLBACK getnumdrivers; /* [in] For sound device enumeration. This callback is to give System::getNumDrivers somthing to return. */
|
||||
FMOD_OUTPUT_GETDRIVERINFO_CALLBACK getdriverinfo; /* [in] For sound device enumeration. This callback is to give System::getDriverName somthing to return. */
|
||||
FMOD_OUTPUT_INIT_CALLBACK init; /* [in] Initialization function for the output device. This is called from System::init. */
|
||||
FMOD_OUTPUT_START_CALLBACK start; /* [in] Initialization function for the output device to start accepting audio data from the FMOD software mixer. This is called from System::init. */
|
||||
FMOD_OUTPUT_STOP_CALLBACK stop; /* [in] Initialization function for the output device to stop accepting audio data from FMOD the software mixer. This is called from System::close. */
|
||||
FMOD_OUTPUT_CLOSE_CALLBACK close; /* [in] Cleanup / close down function for the output device. This is called from System::close. */
|
||||
FMOD_OUTPUT_UPDATE_CALLBACK update; /* [in] Update function that is called once a frame by the user. This is called from System::update. */
|
||||
FMOD_OUTPUT_GETHANDLE_CALLBACK gethandle; /* [in] This is called from System::getOutputHandle. This is just to return a pointer to the internal system device object that the system may be using.*/
|
||||
FMOD_OUTPUT_GETPOSITION_CALLBACK getposition; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This returns a position value in samples so that FMOD knows where and when to fill its buffer. */
|
||||
FMOD_OUTPUT_LOCK_CALLBACK lock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This function provides a pointer to data that FMOD can write to when software mixing. */
|
||||
FMOD_OUTPUT_UNLOCK_CALLBACK unlock; /* [in] This is called from the FMOD software mixer thread if 'polling' = true. This optional function accepts the data that has been mixed and copies it or does whatever it needs to before sending it to the hardware. */
|
||||
} FMOD_OUTPUT_DESCRIPTION;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Output plugin structure that is passed into each callback.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [in] mean the variable can be written to. The user can set the value.<br>
|
||||
Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_OUTPUT_DESCRIPTION
|
||||
]
|
||||
*/
|
||||
struct FMOD_OUTPUT_STATE
|
||||
{
|
||||
void *plugindata; /* [in] Plugin writer created data the output author wants to attach to this object. */
|
||||
FMOD_OUTPUT_READFROMMIXER readfrommixer; /* [out] Function to update mixer and write the result to the provided pointer. Used from callback based output only. Polling based output uses lock/unlock/getposition. */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,233 @@
|
|||
/*$ preserve start $*/
|
||||
|
||||
/*
|
||||
fmod_studio.h - FMOD Studio API
|
||||
Copyright (c), Firelight Technologies Pty, Ltd. 2016.
|
||||
|
||||
This header defines the C API. If you are programming in C++ use fmod_studio.hpp.
|
||||
*/
|
||||
|
||||
#ifndef FMOD_STUDIO_H
|
||||
#define FMOD_STUDIO_H
|
||||
|
||||
#include "fmod_studio_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*
|
||||
Global
|
||||
*/
|
||||
FMOD_RESULT F_API FMOD_Studio_ParseID(const char *idString, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_Create(FMOD_STUDIO_SYSTEM **system, unsigned int headerVersion);
|
||||
|
||||
/*$ preserve end $*/
|
||||
|
||||
/*
|
||||
System
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_System_IsValid(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_SetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetAdvancedSettings(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_Initialize(FMOD_STUDIO_SYSTEM *system, int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_Release(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_Update(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetLowLevelSystem(FMOD_STUDIO_SYSTEM *system, FMOD_SYSTEM **lowLevelSystem);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetEvent(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_EVENTDESCRIPTION **event);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBus(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BUS **bus);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetVCA(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_VCA **vca);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBank(FMOD_STUDIO_SYSTEM *system, const char *pathOrID, FMOD_STUDIO_BANK **bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetEventByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_EVENTDESCRIPTION **event);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBusByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BUS **bus);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetVCAByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_VCA **vca);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBankByID(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, FMOD_STUDIO_BANK **bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetSoundInfo(FMOD_STUDIO_SYSTEM *system, const char *key, FMOD_STUDIO_SOUND_INFO *info);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LookupID(FMOD_STUDIO_SYSTEM *system, const char *path, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LookupPath(FMOD_STUDIO_SYSTEM *system, const FMOD_GUID *id, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetNumListeners(FMOD_STUDIO_SYSTEM *system, int *numlisteners);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_SetNumListeners(FMOD_STUDIO_SYSTEM *system, int numlisteners);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, FMOD_3D_ATTRIBUTES *attributes);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_SetListenerAttributes(FMOD_STUDIO_SYSTEM *system, int index, FMOD_3D_ATTRIBUTES *attributes);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LoadBankFile(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LoadBankMemory(FMOD_STUDIO_SYSTEM *system, const char *buffer, int length, FMOD_STUDIO_LOAD_MEMORY_MODE mode, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LoadBankCustom(FMOD_STUDIO_SYSTEM *system, const FMOD_STUDIO_BANK_INFO *info, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_RegisterPlugin(FMOD_STUDIO_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_UnregisterPlugin(FMOD_STUDIO_SYSTEM *system, const char *name);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_UnloadAll(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_FlushCommands(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_StartCommandCapture(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_StopCommandCapture(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_LoadCommandReplay(FMOD_STUDIO_SYSTEM *system, const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, FMOD_STUDIO_COMMANDREPLAY **replay);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBankCount(FMOD_STUDIO_SYSTEM *system, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBankList(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BANK **array, int capacity, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetCPUUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_CPU_USAGE *usage);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetBufferUsage(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_BUFFER_USAGE *usage);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_ResetBufferUsage(FMOD_STUDIO_SYSTEM *system);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_SetCallback(FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_SetUserData(FMOD_STUDIO_SYSTEM *system, void *userdata);
|
||||
FMOD_RESULT F_API FMOD_Studio_System_GetUserData(FMOD_STUDIO_SYSTEM *system, void **userdata);
|
||||
|
||||
/*
|
||||
EventDescription
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_EventDescription_IsValid(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetID(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetPath(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameterByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetParameter(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserPropertyByIndex(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int index, FMOD_STUDIO_USER_PROPERTY *property);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserProperty(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, const char *name, FMOD_STUDIO_USER_PROPERTY *property);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetLength(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *length);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetMinimumDistance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *distance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetMaximumDistance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *distance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSoundSize(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, float *size);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_IsOneshot(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *oneshot);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_IsStream(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *isStream);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_Is3D(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_BOOL *is3D);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_CreateInstance(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **instance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceCount(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetInstanceList(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENTINSTANCE **array, int capacity, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_LoadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventDesc);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_UnloadSampleData(FMOD_STUDIO_EVENTDESCRIPTION *eventDesc);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetSampleLoadingState(FMOD_STUDIO_EVENTDESCRIPTION *eventDesc, FMOD_STUDIO_LOADING_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_ReleaseAllInstances(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_SetCallback(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_GetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void **userData);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventDescription_SetUserData(FMOD_STUDIO_EVENTDESCRIPTION *eventdescription, void *userData);
|
||||
|
||||
/*
|
||||
EventInstance
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_EventInstance_IsValid(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetDescription(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENTDESCRIPTION **description);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *volume);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetVolume(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float volume);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float *pitch);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPitch(FMOD_STUDIO_EVENTINSTANCE *eventinstance, float pitch);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_Get3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_Set3DAttributes(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_3D_ATTRIBUTES *attributes);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float *value);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetProperty(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_PROPERTY index, float value);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetPaused(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_Start(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_Stop(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_STOP_MODE mode);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int *position);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetTimelinePosition(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int position);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetPlaybackState(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_PLAYBACK_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetChannelGroup(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_CHANNELGROUP **group);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_Release(FMOD_STUDIO_EVENTINSTANCE *eventinstance);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_IsVirtual(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_BOOL *virtualState);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameter(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, FMOD_STUDIO_PARAMETERINSTANCE **parameter);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterByIndex(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, FMOD_STUDIO_PARAMETERINSTANCE **parameter);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetParameterCount(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterValue(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, float value);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetParameterValueByIndex(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, float value);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetCue(FMOD_STUDIO_EVENTINSTANCE *eventinstance, const char *name, FMOD_STUDIO_CUEINSTANCE **cue);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetCueByIndex(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int index, FMOD_STUDIO_CUEINSTANCE **cue);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetCueCount(FMOD_STUDIO_EVENTINSTANCE *eventinstance, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetCallback(FMOD_STUDIO_EVENTINSTANCE *eventinstance, FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_GetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void **userData);
|
||||
FMOD_RESULT F_API FMOD_Studio_EventInstance_SetUserData(FMOD_STUDIO_EVENTINSTANCE *eventinstance, void *userData);
|
||||
|
||||
/*
|
||||
CueInstance
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_CueInstance_IsValid(FMOD_STUDIO_CUEINSTANCE *cueinstance);
|
||||
FMOD_RESULT F_API FMOD_Studio_CueInstance_Trigger(FMOD_STUDIO_CUEINSTANCE *cueinstance);
|
||||
|
||||
/*
|
||||
ParameterInstance
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_ParameterInstance_IsValid(FMOD_STUDIO_PARAMETERINSTANCE *parameterinstance);
|
||||
FMOD_RESULT F_API FMOD_Studio_ParameterInstance_GetDescription(FMOD_STUDIO_PARAMETERINSTANCE *parameterinstance, FMOD_STUDIO_PARAMETER_DESCRIPTION *description);
|
||||
FMOD_RESULT F_API FMOD_Studio_ParameterInstance_GetValue(FMOD_STUDIO_PARAMETERINSTANCE *parameterinstance, float *value);
|
||||
FMOD_RESULT F_API FMOD_Studio_ParameterInstance_SetValue(FMOD_STUDIO_PARAMETERINSTANCE *parameterinstance, float value);
|
||||
|
||||
/*
|
||||
Bus
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_Bus_IsValid(FMOD_STUDIO_BUS *bus);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetID(FMOD_STUDIO_BUS *bus, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetPath(FMOD_STUDIO_BUS *bus, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetFaderLevel(FMOD_STUDIO_BUS *bus, float *level);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_SetFaderLevel(FMOD_STUDIO_BUS *bus, float level);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL *paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_SetPaused(FMOD_STUDIO_BUS *bus, FMOD_BOOL paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL *mute);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_SetMute(FMOD_STUDIO_BUS *bus, FMOD_BOOL mute);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_StopAllEvents(FMOD_STUDIO_BUS *bus, FMOD_STUDIO_STOP_MODE mode);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_LockChannelGroup(FMOD_STUDIO_BUS *bus);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_UnlockChannelGroup(FMOD_STUDIO_BUS *bus);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bus_GetChannelGroup(FMOD_STUDIO_BUS *bus, FMOD_CHANNELGROUP **group);
|
||||
|
||||
/*
|
||||
VCA
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_VCA_IsValid(FMOD_STUDIO_VCA *vca);
|
||||
FMOD_RESULT F_API FMOD_Studio_VCA_GetID(FMOD_STUDIO_VCA *vca, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_VCA_GetPath(FMOD_STUDIO_VCA *vca, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_VCA_GetFaderLevel(FMOD_STUDIO_VCA *vca, float *level);
|
||||
FMOD_RESULT F_API FMOD_Studio_VCA_SetFaderLevel(FMOD_STUDIO_VCA *vca, float level);
|
||||
|
||||
/*
|
||||
Bank
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_Bank_IsValid(FMOD_STUDIO_BANK *bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetID(FMOD_STUDIO_BANK *bank, FMOD_GUID *id);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetPath(FMOD_STUDIO_BANK *bank, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_Unload(FMOD_STUDIO_BANK *bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_LoadSampleData(FMOD_STUDIO_BANK *bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_UnloadSampleData(FMOD_STUDIO_BANK *bank);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetSampleLoadingState(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_LOADING_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetStringCount(FMOD_STUDIO_BANK *bank, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetStringInfo(FMOD_STUDIO_BANK *bank, int index, FMOD_GUID *id, char *path, int size, int *retrieved);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetEventCount(FMOD_STUDIO_BANK *bank, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetEventList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_EVENTDESCRIPTION **array, int capacity, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetBusCount(FMOD_STUDIO_BANK *bank, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetBusList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_BUS **array, int capacity, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetVCACount(FMOD_STUDIO_BANK *bank, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetVCAList(FMOD_STUDIO_BANK *bank, FMOD_STUDIO_VCA **array, int capacity, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_GetUserData(FMOD_STUDIO_BANK *bank, void **userData);
|
||||
FMOD_RESULT F_API FMOD_Studio_Bank_SetUserData(FMOD_STUDIO_BANK *bank, void *userData);
|
||||
|
||||
/*
|
||||
Command playback information
|
||||
*/
|
||||
FMOD_BOOL F_API FMOD_Studio_CommandReplay_IsValid(FMOD_STUDIO_COMMANDREPLAY *replay);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetSystem(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_SYSTEM **system);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetLength(FMOD_STUDIO_COMMANDREPLAY *replay, float *length);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandCount(FMOD_STUDIO_COMMANDREPLAY *replay, int *count);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandInfo(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, FMOD_STUDIO_COMMAND_INFO *info);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandString(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, char *description, int capacity);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCommandAtTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time, int *commandIndex);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetBankPath(FMOD_STUDIO_COMMANDREPLAY *replay, const char *bankPath);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_Start(FMOD_STUDIO_COMMANDREPLAY *replay);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_Stop(FMOD_STUDIO_COMMANDREPLAY *replay);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToTime(FMOD_STUDIO_COMMANDREPLAY *replay, float time);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SeekToCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL *paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetPaused(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_BOOL paused);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetPlaybackState(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_PLAYBACK_STATE *state);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetCurrentCommand(FMOD_STUDIO_COMMANDREPLAY *replay, int *commandIndex, float *currentTime);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_Release(FMOD_STUDIO_COMMANDREPLAY *replay);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetFrameCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY *replay, FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_GetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void **userdata);
|
||||
FMOD_RESULT F_API FMOD_Studio_CommandReplay_SetUserData(FMOD_STUDIO_COMMANDREPLAY *replay, void *userdata);
|
||||
|
||||
/*$ preserve start $*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FMOD_STUDIO_H */
|
||||
|
||||
/*$ preserve end $*/
|
|
@ -0,0 +1,388 @@
|
|||
/*
|
||||
fmod_studio.hpp - FMOD Studio API
|
||||
Copyright (c), Firelight Technologies Pty, Ltd. 2016.
|
||||
|
||||
This header defines the C++ API. If you are programming in C use fmod_studio.h.
|
||||
*/
|
||||
|
||||
#ifndef FMOD_STUDIO_HPP
|
||||
#define FMOD_STUDIO_HPP
|
||||
|
||||
#include "fmod_studio_common.h"
|
||||
#include "fmod_studio.h"
|
||||
|
||||
#include "fmod.hpp"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
|
||||
namespace Studio
|
||||
{
|
||||
typedef FMOD_GUID ID; // Deprecated. Please use FMOD_GUID type.
|
||||
|
||||
class System;
|
||||
class EventDescription;
|
||||
class EventInstance;
|
||||
class CueInstance;
|
||||
class ParameterInstance;
|
||||
class Bus;
|
||||
class VCA;
|
||||
class Bank;
|
||||
class CommandReplay;
|
||||
|
||||
FMOD_RESULT F_API parseID(const char *idString, FMOD_GUID *id);
|
||||
|
||||
class System
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance a System class. System::create must be used.
|
||||
System();
|
||||
System(const System &);
|
||||
|
||||
public:
|
||||
static FMOD_RESULT F_API create(System **system, unsigned int headerVersion = FMOD_VERSION);
|
||||
FMOD_RESULT F_API setAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API getAdvancedSettings(FMOD_STUDIO_ADVANCEDSETTINGS *settings);
|
||||
FMOD_RESULT F_API initialize(int maxchannels, FMOD_STUDIO_INITFLAGS studioflags, FMOD_INITFLAGS flags, void *extradriverdata);
|
||||
FMOD_RESULT F_API release();
|
||||
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Update processing
|
||||
FMOD_RESULT F_API update();
|
||||
FMOD_RESULT F_API flushCommands();
|
||||
|
||||
// Low-level API access
|
||||
FMOD_RESULT F_API getLowLevelSystem(FMOD::System **system) const;
|
||||
|
||||
// Asset retrieval
|
||||
FMOD_RESULT F_API getEvent(const char *path, EventDescription **event) const;
|
||||
FMOD_RESULT F_API getBus(const char *path, Bus **bus) const;
|
||||
FMOD_RESULT F_API getVCA(const char *path, VCA **vca) const;
|
||||
FMOD_RESULT F_API getBank(const char *path, Bank **bank) const;
|
||||
FMOD_RESULT F_API getEventByID(const FMOD_GUID *id, EventDescription **event) const;
|
||||
FMOD_RESULT F_API getBusByID(const FMOD_GUID *id, Bus **bus) const;
|
||||
FMOD_RESULT F_API getVCAByID(const FMOD_GUID *id, VCA **vca) const;
|
||||
FMOD_RESULT F_API getBankByID(const FMOD_GUID *id, Bank **bank) const;
|
||||
FMOD_RESULT F_API getSoundInfo(const char *key, FMOD_STUDIO_SOUND_INFO *info) const;
|
||||
|
||||
// Path lookup
|
||||
FMOD_RESULT F_API lookupID(const char *path, FMOD_GUID *id) const;
|
||||
FMOD_RESULT F_API lookupPath(const FMOD_GUID *id, char *path, int size, int *retrieved) const;
|
||||
|
||||
// Listener control
|
||||
FMOD_RESULT F_API getNumListeners(int *numlisteners);
|
||||
FMOD_RESULT F_API setNumListeners(int numlisteners);
|
||||
FMOD_RESULT F_API getListenerAttributes(int listener, FMOD_3D_ATTRIBUTES *attributes) const;
|
||||
FMOD_RESULT F_API setListenerAttributes(int listener, const FMOD_3D_ATTRIBUTES *attributes);
|
||||
|
||||
// Bank control
|
||||
FMOD_RESULT F_API loadBankFile(const char *filename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank);
|
||||
FMOD_RESULT F_API loadBankMemory(const char *buffer, int length, FMOD_STUDIO_LOAD_MEMORY_MODE mode, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank);
|
||||
FMOD_RESULT F_API loadBankCustom(const FMOD_STUDIO_BANK_INFO *info, FMOD_STUDIO_LOAD_BANK_FLAGS flags, Bank **bank);
|
||||
FMOD_RESULT F_API unloadAll();
|
||||
|
||||
// General functionality
|
||||
FMOD_RESULT F_API getCPUUsage(FMOD_STUDIO_CPU_USAGE *usage) const;
|
||||
FMOD_RESULT F_API getBufferUsage(FMOD_STUDIO_BUFFER_USAGE *usage) const;
|
||||
FMOD_RESULT F_API resetBufferUsage();
|
||||
FMOD_RESULT F_API registerPlugin(const FMOD_DSP_DESCRIPTION *description);
|
||||
FMOD_RESULT F_API unregisterPlugin(const char *name);
|
||||
|
||||
// Enumeration
|
||||
FMOD_RESULT F_API getBankCount(int *count) const;
|
||||
FMOD_RESULT F_API getBankList(Bank **array, int capacity, int *count) const;
|
||||
|
||||
// Command capture and replay
|
||||
FMOD_RESULT F_API startCommandCapture(const char *filename, FMOD_STUDIO_COMMANDCAPTURE_FLAGS flags);
|
||||
FMOD_RESULT F_API stopCommandCapture();
|
||||
FMOD_RESULT F_API loadCommandReplay(const char *filename, FMOD_STUDIO_COMMANDREPLAY_FLAGS flags, CommandReplay **playback);
|
||||
|
||||
// Callbacks
|
||||
FMOD_RESULT F_API setCallback(FMOD_STUDIO_SYSTEM_CALLBACK callback, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE callbackmask = FMOD_STUDIO_SYSTEM_CALLBACK_ALL);
|
||||
FMOD_RESULT F_API getUserData(void **userData) const;
|
||||
FMOD_RESULT F_API setUserData(void *userData);
|
||||
|
||||
};
|
||||
|
||||
class EventDescription
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
EventDescription();
|
||||
EventDescription(const EventDescription &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getID(FMOD_GUID *id) const;
|
||||
FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const;
|
||||
FMOD_RESULT F_API getParameterCount(int *count) const;
|
||||
FMOD_RESULT F_API getParameterByIndex(int index, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const;
|
||||
FMOD_RESULT F_API getParameter(const char *name, FMOD_STUDIO_PARAMETER_DESCRIPTION *parameter) const;
|
||||
FMOD_RESULT F_API getUserPropertyCount(int *count) const;
|
||||
FMOD_RESULT F_API getUserPropertyByIndex(int index, FMOD_STUDIO_USER_PROPERTY *property) const;
|
||||
FMOD_RESULT F_API getUserProperty(const char *name, FMOD_STUDIO_USER_PROPERTY *property) const;
|
||||
FMOD_RESULT F_API getLength(int *length) const;
|
||||
FMOD_RESULT F_API getMinimumDistance(float *distance) const;
|
||||
FMOD_RESULT F_API getMaximumDistance(float *distance) const;
|
||||
FMOD_RESULT F_API getSoundSize(float *size) const;
|
||||
|
||||
FMOD_RESULT F_API isOneshot(bool *oneshot) const;
|
||||
FMOD_RESULT F_API isStream(bool *isStream) const;
|
||||
FMOD_RESULT F_API is3D(bool *is3D) const;
|
||||
|
||||
// Playback control
|
||||
FMOD_RESULT F_API createInstance(EventInstance **instance) const;
|
||||
FMOD_RESULT F_API getInstanceCount(int *count) const;
|
||||
FMOD_RESULT F_API getInstanceList(EventInstance **array, int capacity, int *count) const;
|
||||
|
||||
// Sample data loading control
|
||||
FMOD_RESULT F_API loadSampleData();
|
||||
FMOD_RESULT F_API unloadSampleData();
|
||||
FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const;
|
||||
|
||||
// Convenience functions
|
||||
FMOD_RESULT F_API releaseAllInstances();
|
||||
|
||||
// Callbacks
|
||||
FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL);
|
||||
FMOD_RESULT F_API getUserData(void **userData) const;
|
||||
FMOD_RESULT F_API setUserData(void *userData);
|
||||
};
|
||||
|
||||
class EventInstance
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
EventInstance();
|
||||
EventInstance(const EventInstance &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getDescription(EventDescription **description) const;
|
||||
|
||||
// Playback control
|
||||
FMOD_RESULT F_API getVolume(float *volume) const;
|
||||
FMOD_RESULT F_API setVolume(float volume);
|
||||
|
||||
FMOD_RESULT F_API getPitch(float *pitch) const;
|
||||
FMOD_RESULT F_API setPitch(float pitch);
|
||||
|
||||
FMOD_RESULT F_API get3DAttributes(FMOD_3D_ATTRIBUTES *attributes) const;
|
||||
FMOD_RESULT F_API set3DAttributes(const FMOD_3D_ATTRIBUTES *attributes);
|
||||
|
||||
FMOD_RESULT F_API getProperty(FMOD_STUDIO_EVENT_PROPERTY index, float* value) const;
|
||||
FMOD_RESULT F_API setProperty(FMOD_STUDIO_EVENT_PROPERTY index, float value);
|
||||
|
||||
FMOD_RESULT F_API getPaused(bool *paused) const;
|
||||
FMOD_RESULT F_API setPaused(bool paused);
|
||||
|
||||
FMOD_RESULT F_API start();
|
||||
FMOD_RESULT F_API stop(FMOD_STUDIO_STOP_MODE mode);
|
||||
|
||||
FMOD_RESULT F_API getTimelinePosition(int *position) const;
|
||||
FMOD_RESULT F_API setTimelinePosition(int position);
|
||||
|
||||
FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const;
|
||||
|
||||
FMOD_RESULT F_API getChannelGroup(ChannelGroup **group) const;
|
||||
|
||||
FMOD_RESULT F_API release();
|
||||
|
||||
FMOD_RESULT F_API isVirtual(bool *virtualState) const;
|
||||
|
||||
FMOD_RESULT F_API getParameter(const char *name, ParameterInstance **parameter) const;
|
||||
FMOD_RESULT F_API getParameterByIndex(int index, ParameterInstance **parameter) const;
|
||||
FMOD_RESULT F_API getParameterCount(int *count) const;
|
||||
|
||||
FMOD_RESULT F_API setParameterValue(const char *name, float value);
|
||||
FMOD_RESULT F_API setParameterValueByIndex(int index, float value);
|
||||
|
||||
FMOD_RESULT F_API getCue(const char *name, CueInstance **cue) const;
|
||||
FMOD_RESULT F_API getCueByIndex(int index, CueInstance **cue) const;
|
||||
FMOD_RESULT F_API getCueCount(int *count) const;
|
||||
|
||||
// Callbacks
|
||||
FMOD_RESULT F_API setCallback(FMOD_STUDIO_EVENT_CALLBACK callback, FMOD_STUDIO_EVENT_CALLBACK_TYPE callbackmask = FMOD_STUDIO_EVENT_CALLBACK_ALL);
|
||||
FMOD_RESULT F_API getUserData(void **userData) const;
|
||||
FMOD_RESULT F_API setUserData(void *userData);
|
||||
};
|
||||
|
||||
class CueInstance
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
CueInstance();
|
||||
CueInstance(const CueInstance &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
FMOD_RESULT F_API trigger();
|
||||
};
|
||||
|
||||
class ParameterInstance
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
ParameterInstance();
|
||||
ParameterInstance(const ParameterInstance &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getDescription(FMOD_STUDIO_PARAMETER_DESCRIPTION *description) const;
|
||||
|
||||
// Playback control
|
||||
FMOD_RESULT F_API getValue(float *value) const;
|
||||
FMOD_RESULT F_API setValue(float value);
|
||||
};
|
||||
|
||||
class Bus
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
Bus();
|
||||
Bus(const Bus &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getID(FMOD_GUID *id) const;
|
||||
FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const;
|
||||
|
||||
// Playback control
|
||||
FMOD_RESULT F_API getFaderLevel(float *level) const;
|
||||
FMOD_RESULT F_API setFaderLevel(float level);
|
||||
|
||||
FMOD_RESULT F_API getPaused(bool *paused) const;
|
||||
FMOD_RESULT F_API setPaused(bool paused);
|
||||
|
||||
FMOD_RESULT F_API getMute(bool *paused) const;
|
||||
FMOD_RESULT F_API setMute(bool paused);
|
||||
|
||||
FMOD_RESULT F_API stopAllEvents(FMOD_STUDIO_STOP_MODE mode);
|
||||
|
||||
// Low-level API access
|
||||
FMOD_RESULT F_API lockChannelGroup();
|
||||
FMOD_RESULT F_API unlockChannelGroup();
|
||||
FMOD_RESULT F_API getChannelGroup(FMOD::ChannelGroup **channelgroup) const;
|
||||
};
|
||||
|
||||
class VCA
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
VCA();
|
||||
VCA(const VCA &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getID(FMOD_GUID *id) const;
|
||||
FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const;
|
||||
|
||||
// Playback control
|
||||
FMOD_RESULT F_API getFaderLevel(float *level) const;
|
||||
FMOD_RESULT F_API setFaderLevel(float level);
|
||||
};
|
||||
|
||||
class Bank
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
Bank();
|
||||
Bank(const Bank &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Property access
|
||||
FMOD_RESULT F_API getID(FMOD_GUID *id) const;
|
||||
FMOD_RESULT F_API getPath(char *path, int size, int *retrieved) const;
|
||||
|
||||
// Loading control
|
||||
FMOD_RESULT F_API unload();
|
||||
FMOD_RESULT F_API loadSampleData();
|
||||
FMOD_RESULT F_API unloadSampleData();
|
||||
|
||||
FMOD_RESULT F_API getLoadingState(FMOD_STUDIO_LOADING_STATE *state) const;
|
||||
FMOD_RESULT F_API getSampleLoadingState(FMOD_STUDIO_LOADING_STATE *state) const;
|
||||
|
||||
// Enumeration
|
||||
FMOD_RESULT F_API getStringCount(int *count) const;
|
||||
FMOD_RESULT F_API getStringInfo(int index, FMOD_GUID *id, char *path, int size, int *retrieved) const;
|
||||
FMOD_RESULT F_API getEventCount(int *count) const;
|
||||
FMOD_RESULT F_API getEventList(EventDescription **array, int capacity, int *count) const;
|
||||
FMOD_RESULT F_API getBusCount(int *count) const;
|
||||
FMOD_RESULT F_API getBusList(Bus **array, int capacity, int *count) const;
|
||||
FMOD_RESULT F_API getVCACount(int *count) const;
|
||||
FMOD_RESULT F_API getVCAList(VCA **array, int capacity, int *count) const;
|
||||
|
||||
FMOD_RESULT F_API getUserData(void **userData) const;
|
||||
FMOD_RESULT F_API setUserData(void *userData);
|
||||
};
|
||||
|
||||
class CommandReplay
|
||||
{
|
||||
private:
|
||||
// Constructor made private so user cannot statically instance the class.
|
||||
CommandReplay();
|
||||
CommandReplay(const CommandReplay &);
|
||||
|
||||
public:
|
||||
// Handle validity
|
||||
bool F_API isValid() const;
|
||||
|
||||
// Information query
|
||||
FMOD_RESULT F_API getSystem(System **system) const;
|
||||
FMOD_RESULT F_API getLength(float *length) const;
|
||||
|
||||
FMOD_RESULT F_API getCommandCount(int *count) const;
|
||||
FMOD_RESULT F_API getCommandInfo(int commandIndex, FMOD_STUDIO_COMMAND_INFO *info) const;
|
||||
FMOD_RESULT F_API getCommandString(int commandIndex, char *buffer, int length) const;
|
||||
FMOD_RESULT F_API getCommandAtTime(float time, int *commandIndex) const;
|
||||
|
||||
// Playback
|
||||
FMOD_RESULT F_API setBankPath(const char *bankPath);
|
||||
FMOD_RESULT F_API start();
|
||||
FMOD_RESULT F_API stop();
|
||||
FMOD_RESULT F_API seekToTime(float time);
|
||||
FMOD_RESULT F_API seekToCommand(int commandIndex);
|
||||
FMOD_RESULT F_API getPaused(bool *paused) const;
|
||||
FMOD_RESULT F_API setPaused(bool paused);
|
||||
FMOD_RESULT F_API getPlaybackState(FMOD_STUDIO_PLAYBACK_STATE *state) const;
|
||||
FMOD_RESULT F_API getCurrentCommand(int *commandIndex, float *currentTime) const;
|
||||
|
||||
// Release
|
||||
FMOD_RESULT F_API release();
|
||||
|
||||
// Callbacks
|
||||
FMOD_RESULT F_API setFrameCallback(FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK callback);
|
||||
FMOD_RESULT F_API setLoadBankCallback(FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK callback);
|
||||
FMOD_RESULT F_API setCreateInstanceCallback(FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback);
|
||||
|
||||
FMOD_RESULT F_API getUserData(void **userData) const;
|
||||
FMOD_RESULT F_API setUserData(void *userData);
|
||||
};
|
||||
|
||||
} // namespace Studio
|
||||
|
||||
} // namespace FMOD
|
||||
|
||||
#endif //FMOD_STUDIO_HPP
|
|
@ -0,0 +1,754 @@
|
|||
/*
|
||||
fmod_studio_common.h
|
||||
Copyright (c), Firelight Technologies Pty, Ltd. 2016.
|
||||
|
||||
This header defines common enumerations, structs and callbacks that are shared between the C and C++ interfaces.
|
||||
*/
|
||||
|
||||
#ifndef FMOD_STUDIO_COMMON_H
|
||||
#define FMOD_STUDIO_COMMON_H
|
||||
|
||||
#include "fmod.h"
|
||||
|
||||
|
||||
/*
|
||||
FMOD Studio types.
|
||||
*/
|
||||
|
||||
typedef struct FMOD_STUDIO_SYSTEM FMOD_STUDIO_SYSTEM;
|
||||
typedef struct FMOD_STUDIO_EVENTDESCRIPTION FMOD_STUDIO_EVENTDESCRIPTION;
|
||||
typedef struct FMOD_STUDIO_EVENTINSTANCE FMOD_STUDIO_EVENTINSTANCE;
|
||||
typedef struct FMOD_STUDIO_CUEINSTANCE FMOD_STUDIO_CUEINSTANCE;
|
||||
typedef struct FMOD_STUDIO_PARAMETERINSTANCE FMOD_STUDIO_PARAMETERINSTANCE;
|
||||
typedef struct FMOD_STUDIO_BUS FMOD_STUDIO_BUS;
|
||||
typedef struct FMOD_STUDIO_VCA FMOD_STUDIO_VCA;
|
||||
typedef struct FMOD_STUDIO_BANK FMOD_STUDIO_BANK;
|
||||
typedef struct FMOD_STUDIO_COMMANDREPLAY FMOD_STUDIO_COMMANDREPLAY;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_INITFLAGS
|
||||
|
||||
[DESCRIPTION]
|
||||
Studio System initialization flags.
|
||||
Use them with Studio::System::initialize in the *studioflags* parameter to change various behavior.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::initialize
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_INIT_NORMAL 0x00000000 /* Initialize normally. */
|
||||
#define FMOD_STUDIO_INIT_LIVEUPDATE 0x00000001 /* Enable live update. */
|
||||
#define FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS 0x00000002 /* Load banks even if they reference plugins that have not been loaded. */
|
||||
#define FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE 0x00000004 /* Disable asynchronous processing and perform all processing on the calling thread instead. */
|
||||
#define FMOD_STUDIO_INIT_DEFERRED_CALLBACKS 0x00000008 /* Defer timeline callbacks until the main update. See Studio::EventInstance::setCallback for more information. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_INITFLAGS;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
These values describe the loading status of various objects.
|
||||
|
||||
[REMARKS]
|
||||
Calling Studio::System::loadBankFile, Studio::System::loadBankMemory or Studio::System::loadBankCustom
|
||||
will trigger loading of metadata from the bank.
|
||||
|
||||
Calling Studio::EventDescription::loadSampleData, Studio::EventDescription::createInstance
|
||||
or Studio::Bank::loadSampleData may trigger asynchronous loading of sample data.
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventDescription::getSampleLoadingState
|
||||
Studio::Bank::getLoadingState
|
||||
Studio::Bank::getSampleLoadingState
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_LOADING_STATE
|
||||
{
|
||||
FMOD_STUDIO_LOADING_STATE_UNLOADING, /* Currently unloading. */
|
||||
FMOD_STUDIO_LOADING_STATE_UNLOADED, /* Not loaded. */
|
||||
FMOD_STUDIO_LOADING_STATE_LOADING, /* Loading in progress. */
|
||||
FMOD_STUDIO_LOADING_STATE_LOADED, /* Loaded and ready to play. */
|
||||
FMOD_STUDIO_LOADING_STATE_ERROR, /* Failed to load and is now in error state. */
|
||||
|
||||
FMOD_STUDIO_LOADING_STATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_LOADING_STATE;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Specifies how to use the memory buffer passed to Studio::System::loadBankMemory.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::loadBankMemory
|
||||
Studio::Bank::unload
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_LOAD_MEMORY_MODE
|
||||
{
|
||||
FMOD_STUDIO_LOAD_MEMORY, /* When passed to Studio::System::loadBankMemory, FMOD duplicates the memory into its own buffers. Your buffer can be freed after Studio::System::loadBankMemory returns. */
|
||||
FMOD_STUDIO_LOAD_MEMORY_POINT, /* This differs from FMOD_STUDIO_LOAD_MEMORY in that FMOD uses the memory as is, without duplicating the memory into its own buffers. Cannot not be freed after load, only after calling Studio::Bank::unload. */
|
||||
|
||||
FMOD_STUDIO_LOAD_MEMORY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_LOAD_MEMORY_MODE;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Describes the type of a parameter.
|
||||
|
||||
[REMARKS]
|
||||
There are two primary types of parameters: game controlled and automatic.
|
||||
Game controlled parameters receive their value from the API using
|
||||
Studio::ParameterInstance::setValue. Automatic parameters are updated inside
|
||||
FMOD based on the positional information of the event and listener.
|
||||
|
||||
**Horizontal angle** means the angle between vectors projected onto the
|
||||
listener's XZ plane (for the EVENT_ORIENTATION and DIRECTION parameters)
|
||||
or the global XZ plane (for the LISTENER_ORIENTATION parameter).
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_PARAMETER_DESCRIPTION
|
||||
Studio::ParameterInstance::setValue
|
||||
Studio::EventInstance::set3DAttributes
|
||||
Studio::System::setListenerAttributes
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_PARAMETER_TYPE
|
||||
{
|
||||
FMOD_STUDIO_PARAMETER_GAME_CONTROLLED, /* Controlled via the API using Studio::ParameterInstance::setValue. */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE, /* Distance between the event and the listener. */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE, /* Angle between the event's forward vector and the vector pointing from the event to the listener (0 to 180 degrees). */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION, /* Horizontal angle between the event's forward vector and listener's forward vector (-180 to 180 degrees). */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION, /* Horizontal angle between the listener's forward vector and the vector pointing from the listener to the event (-180 to 180 degrees). */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION, /* Angle between the listener's XZ plane and the vector pointing from the listener to the event (-90 to 90 degrees). */
|
||||
FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION, /* Horizontal angle between the listener's forward vector and the global positive Z axis (-180 to 180 degrees). */
|
||||
|
||||
FMOD_STUDIO_PARAMETER_MAX, /* Maximum number of parameter types supported. */
|
||||
FMOD_STUDIO_PARAMETER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_PARAMETER_TYPE;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Information for loading a bank with Studio::System::loadBankCustom.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::loadBankCustom
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_BANK_INFO
|
||||
{
|
||||
int size; /* The size of this struct (for binary compatibility) */
|
||||
void *userData; /* User data to be passed to the file callbacks */
|
||||
int userDataLength; /* If this is non-zero, userData will be copied internally */
|
||||
FMOD_FILE_OPEN_CALLBACK openCallback; /* Callback for opening this file. */
|
||||
FMOD_FILE_CLOSE_CALLBACK closeCallback; /* Callback for closing this file. */
|
||||
FMOD_FILE_READ_CALLBACK readCallback; /* Callback for reading from this file. */
|
||||
FMOD_FILE_SEEK_CALLBACK seekCallback; /* Callback for seeking within this file. */
|
||||
} FMOD_STUDIO_BANK_INFO;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure describing an event parameter.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventDescription::getParameter
|
||||
FMOD_STUDIO_PARAMETER_TYPE
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_PARAMETER_DESCRIPTION
|
||||
{
|
||||
const char *name; /* Name of the parameter. */
|
||||
float minimum; /* Minimum parameter value. */
|
||||
float maximum; /* Maximum parameter value. */
|
||||
FMOD_STUDIO_PARAMETER_TYPE type; /* Type of the parameter */
|
||||
} FMOD_STUDIO_PARAMETER_DESCRIPTION;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
These definitions describe a user property's type.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_USER_PROPERTY
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_USER_PROPERTY_TYPE
|
||||
{
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER, /* Integer property */
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN, /* Boolean property */
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT, /* Float property */
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE_STRING, /* String property */
|
||||
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_USER_PROPERTY_TYPE;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
These definitions describe built-in event properties.
|
||||
|
||||
[REMARKS]
|
||||
For FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY, a value of -1 uses the priority
|
||||
set in FMOD Studio, while other values override it. This property uses the same
|
||||
system as Channel::setPriority; this means lower values are higher priority
|
||||
(i.e. 0 is the highest priority while 256 is the lowest).
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventInstance::getProperty
|
||||
Studio::EventInstance::setProperty
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_EVENT_PROPERTY
|
||||
{
|
||||
FMOD_STUDIO_EVENT_PROPERTY_CHANNELPRIORITY, /* Priority to set on low-level channels created by this event instance (-1 to 256). */
|
||||
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_DELAY, /* Schedule delay to synchronized playback for multiple tracks in DSP clocks, or -1 for default. */
|
||||
FMOD_STUDIO_EVENT_PROPERTY_SCHEDULE_LOOKAHEAD, /* Schedule look-ahead on the timeline in DSP clocks, or -1 for default. */
|
||||
FMOD_STUDIO_EVENT_PROPERTY_MINIMUM_DISTANCE, /* Override the event's 3D minimum distance, or -1 for default. */
|
||||
FMOD_STUDIO_EVENT_PROPERTY_MAXIMUM_DISTANCE, /* Override the event's 3D maximum distance, or -1 for default. */
|
||||
FMOD_STUDIO_EVENT_PROPERTY_MAX, /* Maximum number of event properties supported. */
|
||||
|
||||
FMOD_STUDIO_EVENT_PROPERTY_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_EVENT_PROPERTY;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Structure describing a user property.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventDescription::getUserProperty
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_USER_PROPERTY
|
||||
{
|
||||
const char *name; /* Name of the user property. */
|
||||
FMOD_STUDIO_USER_PROPERTY_TYPE type; /* Type of the user property. Use this to select one of the following values. */
|
||||
|
||||
union
|
||||
{
|
||||
int intValue; /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER. */
|
||||
FMOD_BOOL boolValue; /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN. */
|
||||
float floatValue; /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT. */
|
||||
const char *stringValue; /* Value of the user property. Only valid when type is FMOD_STUDIO_USER_PROPERTY_TYPE_STRING. */
|
||||
};
|
||||
} FMOD_STUDIO_USER_PROPERTY;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_SYSTEM_CALLBACK_TYPE
|
||||
|
||||
[DESCRIPTION]
|
||||
These callback types are used with Studio::System::setCallback.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_SYSTEM_CALLBACK
|
||||
Studio::System::setCallback
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_SYSTEM_CALLBACK_PREUPDATE 0x00000001 /* Called at the start of the main Studio update. For async mode this will be on its own thread. */
|
||||
#define FMOD_STUDIO_SYSTEM_CALLBACK_POSTUPDATE 0x00000002 /* Called at the end of the main Studio update. For async mode this will be on its own thread. */
|
||||
#define FMOD_STUDIO_SYSTEM_CALLBACK_BANK_UNLOAD 0x00000004 /* Called when bank has just been unloaded, after all resources are freed. CommandData will be the bank handle.*/
|
||||
#define FMOD_STUDIO_SYSTEM_CALLBACK_ALL 0xFFFFFFFF /* Pass this mask to Studio::System::setCallback to receive all callback types. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_SYSTEM_CALLBACK_TYPE;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_EVENT_CALLBACK_TYPE
|
||||
|
||||
[DESCRIPTION]
|
||||
These callback types are used with FMOD_STUDIO_EVENT_CALLBACK.
|
||||
|
||||
[REMARKS]
|
||||
The data passed to the event callback function in the *parameters* argument varies based on the callback type.
|
||||
|
||||
FMOD_STUDIO_EVENT_CALLBACK_STARTED is called when:
|
||||
|
||||
* Studio::EventInstance::start has been called on an event which was not already playing.
|
||||
|
||||
FMOD_STUDIO_EVENT_CALLBACK_RESTARTED is called when:
|
||||
|
||||
* Studio::EventInstance::start has been called on an event which was already playing.
|
||||
|
||||
FMOD_STUDIO_EVENT_CALLBACK_STOPPED is called when:
|
||||
|
||||
* The event has stopped due to Studio::EventInstance::stop being called with FMOD_STUDIO_STOP_IMMEDIATE.
|
||||
* The event has finished fading out after Studio::EventInstance::stop was called with FMOD_STUDIO_STOP_ALLOWFADEOUT.
|
||||
* The event has stopped naturally by reaching the end of the timeline, and no further sounds can be triggered due to
|
||||
parameter changes.
|
||||
|
||||
FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND is called when:
|
||||
|
||||
* A programmer sound is about to play. FMOD expects the callback to provide an FMOD::Sound object for it to use.
|
||||
|
||||
FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND is called when:
|
||||
|
||||
* A programmer sound has stopped playing. At this point it is safe to release the FMOD::Sound object that was used.
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventDescription::setCallback
|
||||
Studio::EventInstance::setCallback
|
||||
FMOD_STUDIO_EVENT_CALLBACK
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_STARTED 0x00000001 /* Called when an instance starts. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_RESTARTED 0x00000002 /* Called when an instance is restarted. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_STOPPED 0x00000004 /* Called when an instance stops. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND 0x00000008 /* Called when a programmer sound needs to be created in order to play a programmer instrument. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND 0x00000010 /* Called when a programmer sound needs to be destroyed. Parameters = FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED 0x00000020 /* Called when a DSP plugin instance has just been created. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED 0x00000040 /* Called when a DSP plugin instance is about to be destroyed. Parameters = FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_CREATED 0x00000080 /* Called when an instance is fully created. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_DESTROYED 0x00000100 /* Called when an instance is just about to be destroyed. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_START_FAILED 0x00000200 /* Called when an instance did not start, e.g. due to polyphony. Parameters = unused. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER 0x00000400 /* Called when the timeline passes a named marker. Parameters = FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT 0x00000800 /* Called when the timeline hits a beat in a tempo section. Parameters = FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES. */
|
||||
#define FMOD_STUDIO_EVENT_CALLBACK_ALL 0xFFFFFFFF /* Pass this mask to Studio::EventDescription::setCallback or Studio::EventInstance::setCallback to receive all callback types. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_EVENT_CALLBACK_TYPE;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
This structure holds information about a programmer sound.
|
||||
|
||||
[REMARKS]
|
||||
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND
|
||||
or FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND.
|
||||
|
||||
To support non-blocking loading of FSB subsounds, you can specify the subsound you want to use by setting the
|
||||
subsoundIndex field. This will cause FMOD to wait until the provided sound is ready and then get the specified
|
||||
subsound from it.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_EVENT_CALLBACK
|
||||
Studio::EventDescription::setCallback
|
||||
Studio::EventInstance::setCallback
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES
|
||||
{
|
||||
const char *name; /* The name of the programmer instrument (set in FMOD Studio). */
|
||||
FMOD_SOUND *sound; /* The programmer-created sound. This should be filled in by the create callback, and cleaned up by the destroy callback. This can be cast to/from FMOD::Sound* type. */
|
||||
int subsoundIndex; /* The index of the subsound to use, or -1 if the provided sound should be used directly. Defaults to -1. */
|
||||
} FMOD_STUDIO_PROGRAMMER_SOUND_PROPERTIES;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
This structure holds information about a DSP plugin instance.
|
||||
|
||||
[REMARKS]
|
||||
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_CREATED
|
||||
or FMOD_STUDIO_EVENT_CALLBACK_PLUGIN_DESTROYED.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_EVENT_CALLBACK
|
||||
Studio::EventDescription::setCallback
|
||||
Studio::EventInstance::setCallback
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES
|
||||
{
|
||||
const char *name; /* The name of the plugin effect or sound (set in FMOD Studio). */
|
||||
FMOD_DSP *dsp; /* The DSP plugin instance. This can be cast to FMOD::DSP* type. */
|
||||
} FMOD_STUDIO_PLUGIN_INSTANCE_PROPERTIES;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
This structure holds information about a marker on the timeline.
|
||||
|
||||
[REMARKS]
|
||||
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_EVENT_CALLBACK
|
||||
Studio::EventDescription::setCallback
|
||||
Studio::EventInstance::setCallback
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES
|
||||
{
|
||||
const char* name; /* The marker name */
|
||||
int position; /* The position of the marker on the timeline in milliseconds. */
|
||||
} FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES;
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
This structure holds information about a beat on the timeline.
|
||||
|
||||
[REMARKS]
|
||||
This data is passed to the event callback function when type is FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT.
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_EVENT_CALLBACK
|
||||
Studio::EventDescription::setCallback
|
||||
Studio::EventInstance::setCallback
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES
|
||||
{
|
||||
int bar; /* The bar number (starting from 1). */
|
||||
int beat; /* The beat number within the bar (starting from 1). */
|
||||
int position; /* The position of the beat on the timeline in milliseconds. */
|
||||
float tempo; /* The current tempo in beats per minute. */
|
||||
int timeSignatureUpper; /* The current time signature upper number (beats per bar). */
|
||||
int timeSignatureLower; /* The current time signature lower number (beat unit). */
|
||||
} FMOD_STUDIO_TIMELINE_BEAT_PROPERTIES;
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
These values describe the playback state of an event instance.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventInstance::getPlaybackState
|
||||
Studio::EventInstance::start
|
||||
Studio::EventInstance::stop
|
||||
Studio::CueInstance::trigger
|
||||
Studio::ParameterInstance::setValue
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_PLAYBACK_STATE
|
||||
{
|
||||
FMOD_STUDIO_PLAYBACK_PLAYING, /* Currently playing. */
|
||||
FMOD_STUDIO_PLAYBACK_SUSTAINING, /* The timeline cursor is paused on a sustain point. */
|
||||
FMOD_STUDIO_PLAYBACK_STOPPED, /* Not playing. */
|
||||
FMOD_STUDIO_PLAYBACK_STARTING, /* Start has been called but the instance is not fully started yet. */
|
||||
FMOD_STUDIO_PLAYBACK_STOPPING, /* Stop has been called but the instance is not fully stopped yet. */
|
||||
|
||||
FMOD_STUDIO_PLAYBACK_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_PLAYBACK_STATE;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Controls how to stop playback of an event instance.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::EventInstance::stop
|
||||
Studio::Bus::stopAllEvents
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_STOP_MODE
|
||||
{
|
||||
FMOD_STUDIO_STOP_ALLOWFADEOUT, /* Allows AHDSR modulators to complete their release, and DSP effect tails to play out. */
|
||||
FMOD_STUDIO_STOP_IMMEDIATE, /* Stops the event instance immediately. */
|
||||
|
||||
FMOD_STUDIO_STOP_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_STOP_MODE;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_LOAD_BANK_FLAGS
|
||||
|
||||
[DESCRIPTION]
|
||||
Flags passed into Studio loadBank commands to control bank load behaviour.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::loadBankFile
|
||||
Studio::System::loadBankMemory
|
||||
Studio::System::loadBankCustom
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_LOAD_BANK_NORMAL 0x00000000 /* Standard behaviour. */
|
||||
#define FMOD_STUDIO_LOAD_BANK_NONBLOCKING 0x00000001 /* Bank loading occurs asynchronously rather than occurring immediately. */
|
||||
#define FMOD_STUDIO_LOAD_BANK_DECOMPRESS_SAMPLES 0x00000002 /* Force samples to decompress into memory when they are loaded, rather than staying compressed. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_LOAD_BANK_FLAGS;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Settings for advanced features like configuring memory and cpu usage.
|
||||
|
||||
[REMARKS]
|
||||
Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.<br>
|
||||
Members marked with [w] mean the variable can be written to. The user can set the value.<br>
|
||||
Members marked with [r/w] are either read or write depending on if you are using System::setAdvancedSettings (w) or System::getAdvancedSettings (r).
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::setAdvancedSettings
|
||||
Studio::System::getAdvancedSettings
|
||||
FMOD_MODE
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_ADVANCEDSETTINGS
|
||||
{
|
||||
int cbSize; /* [w] Size of this structure. Use sizeof(FMOD_STUDIO_ADVANCEDSETTINGS) NOTE: This must be set before calling Studio::System::getAdvancedSettings or Studio::System::setAdvancedSettings! */
|
||||
unsigned int commandQueueSize; /* [r/w] Optional. Specify 0 to ignore. Specify the command queue size for studio async processing. Default 32kB. */
|
||||
unsigned int handleInitialSize; /* [r/w] Optional. Specify 0 to ignore. Specify the initial size to allocate for handles. Memory for handles will grow as needed in pages. Default 8192 * sizeof(void*) */
|
||||
int studioUpdatePeriod; /* [r/w] Optional. Specify 0 to ignore. Specify the update period of Studio when in async mode, in milliseconds. Will be quantised to the nearest multiple of mixer duration. Default is 20ms. */
|
||||
} FMOD_STUDIO_ADVANCEDSETTINGS;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Performance information for FMOD Studio and low level systems.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::getCPUUsage
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_CPU_USAGE
|
||||
{
|
||||
float dspUsage; /* Returns the % CPU time taken by DSP processing on the low level mixer thread. */
|
||||
float streamUsage; /* Returns the % CPU time taken by stream processing on the low level stream thread. */
|
||||
float geometryUsage; /* Returns the % CPU time taken by geometry processing on the low level geometry thread. */
|
||||
float updateUsage; /* Returns the % CPU time taken by low level update, called as part of the studio update. */
|
||||
float studioUsage; /* Returns the % CPU time taken by studio update, called from the studio thread. Does not include low level update time. */
|
||||
} FMOD_STUDIO_CPU_USAGE;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Information for a single buffer in FMOD Studio.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
FMOD_STUDIO_BUFFER_USAGE
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_BUFFER_INFO
|
||||
{
|
||||
int currentUsage; /* Current buffer usage in bytes. */
|
||||
int peakUsage; /* Peak buffer usage in bytes. */
|
||||
int capacity; /* Buffer capacity in bytes. */
|
||||
int stallCount; /* Cumulative number of stalls due to buffer overflow. */
|
||||
float stallTime; /* Cumulative amount of time stalled due to buffer overflow, in seconds. */
|
||||
} FMOD_STUDIO_BUFFER_INFO;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Information for FMOD Studio buffer usage.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::getBufferUsage
|
||||
Studio::System::resetBufferUsage
|
||||
FMOD_STUDIO_BUFFER_INFO
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_BUFFER_USAGE
|
||||
{
|
||||
FMOD_STUDIO_BUFFER_INFO studioCommandQueue; /* Information for the Studio Async Command buffer, controlled by FMOD_STUDIO_ADVANCEDSETTINGS commandQueueSize. */
|
||||
FMOD_STUDIO_BUFFER_INFO studioHandle; /* Information for the Studio handle table, controlled by FMOD_STUDIO_ADVANCEDSETTINGS handleInitialSize. */
|
||||
} FMOD_STUDIO_BUFFER_USAGE;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Information for loading a sound from a sound table.
|
||||
|
||||
[REMARKS]
|
||||
The name_or_data member points into FMOD internal memory, which will become
|
||||
invalid if the sound table bank is unloaded.
|
||||
|
||||
If mode flags such as FMOD_CREATESTREAM or FMOD_NONBLOCKING are required,
|
||||
they should be ORed together with the mode member when calling System::createSound.
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::getSoundInfo
|
||||
System::createSound
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_SOUND_INFO
|
||||
{
|
||||
const char* name_or_data; /* The filename or memory buffer that contains the sound. */
|
||||
FMOD_MODE mode; /* Mode flags required for loading the sound. */
|
||||
FMOD_CREATESOUNDEXINFO exinfo; /* Extra information required for loading the sound. */
|
||||
int subsoundIndex; /* Subsound index for loading the sound. */
|
||||
} FMOD_STUDIO_SOUND_INFO;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_COMMANDCAPTURE_FLAGS
|
||||
|
||||
[DESCRIPTION]
|
||||
Flags passed into Studio::System::startCommandCapture.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::startCommandCapture
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_COMMANDCAPTURE_NORMAL 0x00000000 /* Standard behaviour. */
|
||||
#define FMOD_STUDIO_COMMANDCAPTURE_FILEFLUSH 0x00000001 /* Call file flush on every command. */
|
||||
#define FMOD_STUDIO_COMMANDCAPTURE_SKIP_INITIAL_STATE 0x00000002 /* Normally the initial state of banks and instances is captured, unless this flag is set. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_COMMANDCAPTURE_FLAGS;
|
||||
|
||||
|
||||
/*
|
||||
[DEFINE]
|
||||
[
|
||||
[NAME]
|
||||
FMOD_STUDIO_COMMANDREPLAY_FLAGS
|
||||
|
||||
[DESCRIPTION]
|
||||
Flags passed into Studio::System::loadCommandReplay.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::System::loadCommandReplay
|
||||
]
|
||||
*/
|
||||
#define FMOD_STUDIO_COMMANDREPLAY_NORMAL 0x00000000 /* Standard behaviour. */
|
||||
#define FMOD_STUDIO_COMMANDREPLAY_SKIP_CLEANUP 0x00000001 /* Normally the playback will release any created resources when it stops, unless this flag is set. */
|
||||
/* [DEFINE_END] */
|
||||
|
||||
typedef unsigned int FMOD_STUDIO_COMMANDREPLAY_FLAGS;
|
||||
|
||||
|
||||
/*
|
||||
[ENUM]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Used to distinguish the types used in command replays.
|
||||
|
||||
[REMARKS]
|
||||
|
||||
[SEE_ALSO]
|
||||
]
|
||||
*/
|
||||
typedef enum FMOD_STUDIO_INSTANCETYPE
|
||||
{
|
||||
FMOD_STUDIO_INSTANCETYPE_NONE,
|
||||
FMOD_STUDIO_INSTANCETYPE_SYSTEM,
|
||||
FMOD_STUDIO_INSTANCETYPE_EVENTDESCRIPTION,
|
||||
FMOD_STUDIO_INSTANCETYPE_EVENTINSTANCE,
|
||||
FMOD_STUDIO_INSTANCETYPE_PARAMETERINSTANCE,
|
||||
FMOD_STUDIO_INSTANCETYPE_CUEINSTANCE,
|
||||
FMOD_STUDIO_INSTANCETYPE_BUS,
|
||||
FMOD_STUDIO_INSTANCETYPE_VCA,
|
||||
FMOD_STUDIO_INSTANCETYPE_BANK,
|
||||
FMOD_STUDIO_INSTANCETYPE_COMMANDREPLAY,
|
||||
|
||||
FMOD_STUDIO_INSTANCETYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */
|
||||
} FMOD_STUDIO_INSTANCETYPE;
|
||||
|
||||
|
||||
/*
|
||||
[STRUCTURE]
|
||||
[
|
||||
[DESCRIPTION]
|
||||
Information about a single command in a command replay file.
|
||||
|
||||
[REMARKS]
|
||||
This information has metadata about the command at the given index. Note that the handle fields are
|
||||
from the recorded session, and will no longer correspond to any actual object type in the current
|
||||
system.
|
||||
|
||||
[SEE_ALSO]
|
||||
Studio::CommandReplay::getCommandInfo
|
||||
]
|
||||
*/
|
||||
typedef struct FMOD_STUDIO_COMMAND_INFO
|
||||
{
|
||||
const char* commandName; /* The full name of the API function for this command. */
|
||||
int parentCommandIndex; /* For commands that operate on an instance, this is the command that created the instance. */
|
||||
int frameNumber; /* The frame the command belongs to. */
|
||||
float frameTime; /* The playback time at which this command will be executed. */
|
||||
FMOD_STUDIO_INSTANCETYPE instanceType; /* The type of object that this command uses as an instance. */
|
||||
FMOD_STUDIO_INSTANCETYPE outputType; /* The type of object that this command outputs, if any. */
|
||||
unsigned int instanceHandle; /* The original handle value of the instance. This will no longer correspond to any actual object in playback. */
|
||||
unsigned int outputHandle; /* The original handle value of the command output. This will no longer correspond to any actual object in playback. */
|
||||
} FMOD_STUDIO_COMMAND_INFO;
|
||||
|
||||
|
||||
/*
|
||||
FMOD Studio callbacks.
|
||||
*/
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_SYSTEM_CALLBACK) (FMOD_STUDIO_SYSTEM *system, FMOD_STUDIO_SYSTEM_CALLBACK_TYPE type, void *commanddata, void *userdata);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_EVENT_CALLBACK) (FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE *event, void *parameters);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_FRAME_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, float currentTime, void *userdata);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_LOAD_BANK_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, const FMOD_GUID *bankGuid, const char *bankFilename, FMOD_STUDIO_LOAD_BANK_FLAGS flags, FMOD_STUDIO_BANK **bank, void *userdata);
|
||||
typedef FMOD_RESULT (F_CALLBACK *FMOD_STUDIO_COMMANDREPLAY_CREATE_INSTANCE_CALLBACK) (FMOD_STUDIO_COMMANDREPLAY *replay, int commandIndex, FMOD_STUDIO_EVENTDESCRIPTION *eventDescription, FMOD_STUDIO_EVENTINSTANCE **instance, void *userdata);
|
||||
|
||||
#endif // FMOD_STUDIO_COMMON_H
|
|
@ -0,0 +1,155 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ModuleManager.h"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class System;
|
||||
class EventDescription;
|
||||
class EventInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class UFMODAsset;
|
||||
class UFMODEvent;
|
||||
class UWorld;
|
||||
class AAudioVolume;
|
||||
struct FInteriorSettings;
|
||||
struct FFMODListener; // Currently only for private use, we don't export this type
|
||||
|
||||
// Which FMOD Studio system to use
|
||||
namespace EFMODSystemContext
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
// For use auditioning sounds within the editor
|
||||
Auditioning,
|
||||
|
||||
// For use in PIE and in-game
|
||||
Runtime,
|
||||
|
||||
// Max number of types
|
||||
Max
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The public interface to this module
|
||||
*/
|
||||
class IFMODStudioModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Singleton-like access to this module's interface. This is just for convenience!
|
||||
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
|
||||
*
|
||||
* @return Returns singleton instance, loading the module on demand if needed
|
||||
*/
|
||||
static inline IFMODStudioModule& Get()
|
||||
{
|
||||
return FModuleManager::LoadModuleChecked< IFMODStudioModule >( "FMODStudio" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
|
||||
*
|
||||
* @return True if the module is loaded and ready to use
|
||||
*/
|
||||
static inline bool IsAvailable()
|
||||
{
|
||||
return FModuleManager::Get().IsModuleLoaded( "FMODStudio" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a pointer to the runtime studio system (only valid in-game or in PIE)
|
||||
*/
|
||||
virtual FMOD::Studio::System* GetStudioSystem(EFMODSystemContext::Type Context) = 0;
|
||||
|
||||
/**
|
||||
* Set system paused (for PIE pause)
|
||||
*/
|
||||
virtual void SetSystemPaused(bool paused) = 0;
|
||||
|
||||
/**
|
||||
* Called when user changes any studio settings
|
||||
*/
|
||||
virtual void RefreshSettings() = 0;
|
||||
|
||||
/**
|
||||
* Called when we enter of leave PIE mode
|
||||
*/
|
||||
virtual void SetInPIE(bool bInPIE, bool bSimulating) = 0;
|
||||
|
||||
/**
|
||||
* Look up an asset given its name
|
||||
*/
|
||||
virtual UFMODAsset* FindAssetByName(const FString& Name) = 0;
|
||||
|
||||
/**
|
||||
* Look up an event given its name
|
||||
*/
|
||||
virtual UFMODEvent* FindEventByName(const FString& Name) = 0;
|
||||
|
||||
/**
|
||||
* Get an event description.
|
||||
* The system type can control which Studio system to use, or leave it as System_Max for it to choose automatically.
|
||||
*/
|
||||
virtual FMOD::Studio::EventDescription* GetEventDescription(const UFMODEvent* Event, EFMODSystemContext::Type Context = EFMODSystemContext::Max) = 0;
|
||||
|
||||
/**
|
||||
* Create a single auditioning instance using the auditioning system
|
||||
*/
|
||||
virtual FMOD::Studio::EventInstance* CreateAuditioningInstance(const UFMODEvent* Event) = 0;
|
||||
|
||||
/**
|
||||
* Stop any auditioning instance
|
||||
*/
|
||||
virtual void StopAuditioningInstance() = 0;
|
||||
|
||||
/**
|
||||
* Return whether the listener(s) have moved
|
||||
*/
|
||||
virtual bool HasListenerMoved() = 0;
|
||||
|
||||
/**
|
||||
* Called to change the listener position for editor mode
|
||||
*/
|
||||
virtual void SetListenerPosition(int ListenerIndex, UWorld* World, const FTransform& ListenerTransform, float DeltaSeconds) = 0;
|
||||
|
||||
/**
|
||||
* Called to change the listener position for editor mode
|
||||
*/
|
||||
virtual void FinishSetListenerPosition(int NumListeners, float DeltaSeconds) = 0;
|
||||
|
||||
/**
|
||||
* Return the audio settings for the listener nearest the given location
|
||||
*/
|
||||
virtual const FFMODListener& GetNearestListener(const FVector& Location) = 0;
|
||||
|
||||
/** This event is fired after all banks were reloaded */
|
||||
virtual FSimpleMulticastDelegate& BanksReloadedEvent() = 0;
|
||||
|
||||
/** Return a list of banks that failed to load due to an error */
|
||||
virtual TArray<FString> GetFailedBankLoads(EFMODSystemContext::Type Context) = 0;
|
||||
|
||||
/** Return a list of plugins that appear to be needed */
|
||||
virtual TArray<FString> GetRequiredPlugins() = 0;
|
||||
|
||||
/** Register a plugin that is required */
|
||||
virtual void AddRequiredPlugin(const FString& Plugin) = 0;
|
||||
|
||||
/** Returns whether sound is enabled for the game */
|
||||
virtual bool UseSound() = 0;
|
||||
|
||||
/** Attempts to load a plugin by name */
|
||||
virtual bool LoadPlugin(const TCHAR* ShortName) = 0;
|
||||
|
||||
/** Log a FMOD error */
|
||||
virtual void LogError(int result, const char* function) = 0;
|
||||
|
||||
};
|
|
@ -0,0 +1,190 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "fmod_studio.hpp"
|
||||
#include "fmod.hpp"
|
||||
|
||||
#include "FMODStudioModule.h"
|
||||
|
||||
#define verifyfmod(fn) { FMOD_RESULT _result = (fn); if (_result != FMOD_OK) { FMODUtils::LogError(_result, #fn); } }
|
||||
|
||||
namespace FMODUtils
|
||||
{
|
||||
|
||||
// Unreal defines 1 unit == 1cm, so convert to metres for Studio automatically
|
||||
#define FMOD_VECTOR_SCALE_DEFAULT 0.01f
|
||||
|
||||
// Just call into module
|
||||
inline void LogError(FMOD_RESULT result, const char* function)
|
||||
{
|
||||
IFMODStudioModule::Get().LogError(result, function);
|
||||
}
|
||||
|
||||
inline void Assign(FMOD_VECTOR& Dest, const FVector& Src, float Scale=1.0f)
|
||||
{
|
||||
Dest.x = Src.X * Scale;
|
||||
Dest.y = Src.Y * Scale;
|
||||
Dest.z = Src.Z * Scale;
|
||||
}
|
||||
|
||||
inline void Assign(FMOD_3D_ATTRIBUTES& Dest, const FTransform& Src)
|
||||
{
|
||||
Assign(Dest.position, Src.GetTranslation(), FMOD_VECTOR_SCALE_DEFAULT);
|
||||
Assign(Dest.forward, Src.GetUnitAxis(EAxis::X), 1.0f);
|
||||
Assign(Dest.up, Src.GetUnitAxis(EAxis::Z), 1.0f);
|
||||
}
|
||||
|
||||
inline FMOD_VECTOR ConvertWorldVector(const FVector& Src)
|
||||
{
|
||||
FMOD_VECTOR Dest;
|
||||
Assign(Dest, Src, FMOD_VECTOR_SCALE_DEFAULT);
|
||||
return Dest;
|
||||
}
|
||||
|
||||
inline FMOD_VECTOR ConvertUnitVector(const FVector& Src)
|
||||
{
|
||||
FMOD_VECTOR Dest;
|
||||
Dest.x = Src.X;
|
||||
Dest.y = Src.Y;
|
||||
Dest.z = Src.Z;
|
||||
return Dest;
|
||||
}
|
||||
|
||||
inline float DistanceToUEScale(float FMODDistance)
|
||||
{
|
||||
return FMODDistance / FMOD_VECTOR_SCALE_DEFAULT;
|
||||
}
|
||||
|
||||
inline bool IsWorldAudible(UWorld* World)
|
||||
{
|
||||
if (GEngine && IFMODStudioModule::Get().UseSound())
|
||||
{
|
||||
if (World == nullptr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (World->bAllowAudioPlayback && World->GetNetMode() != NM_DedicatedServer)
|
||||
{
|
||||
if (World->IsGameWorld() || World->WorldType == EWorldType::Preview)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline FMOD::Studio::ID ConvertGuid(const FGuid& UnrealGuid)
|
||||
{
|
||||
// Unreal doesn't follow the usual windows GUID format, instead it parses
|
||||
// them as 4 integers
|
||||
FMOD::Studio::ID StudioGuid;
|
||||
FMemory::Memcpy(&StudioGuid, &UnrealGuid, sizeof(StudioGuid));
|
||||
Swap(StudioGuid.Data2, StudioGuid.Data3);
|
||||
Swap(StudioGuid.Data4[0], StudioGuid.Data4[3]);
|
||||
Swap(StudioGuid.Data4[1], StudioGuid.Data4[2]);
|
||||
Swap(StudioGuid.Data4[4], StudioGuid.Data4[7]);
|
||||
Swap(StudioGuid.Data4[5], StudioGuid.Data4[6]);
|
||||
return StudioGuid;
|
||||
}
|
||||
|
||||
inline FGuid ConvertGuid(const FMOD::Studio::ID& StudioGuid)
|
||||
{
|
||||
// Unreal doesn't follow the usual windows GUID format, instead it parses
|
||||
// them as 4 integers
|
||||
FMOD::Studio::ID CopiedGuid;
|
||||
FMemory::Memcpy(&CopiedGuid, &StudioGuid, sizeof(StudioGuid));
|
||||
Swap(CopiedGuid.Data2, CopiedGuid.Data3);
|
||||
Swap(CopiedGuid.Data4[0], CopiedGuid.Data4[3]);
|
||||
Swap(CopiedGuid.Data4[1], CopiedGuid.Data4[2]);
|
||||
Swap(CopiedGuid.Data4[4], CopiedGuid.Data4[7]);
|
||||
Swap(CopiedGuid.Data4[5], CopiedGuid.Data4[6]);
|
||||
FGuid UnrealGuid;
|
||||
FMemory::Memcpy(&UnrealGuid, &CopiedGuid, sizeof(CopiedGuid));
|
||||
return UnrealGuid;
|
||||
}
|
||||
|
||||
template <class StudioType>
|
||||
inline FGuid GetID(StudioType* Instance)
|
||||
{
|
||||
FMOD::Studio::ID StudioID = {0};
|
||||
verifyfmod(Instance->getID(&StudioID));
|
||||
return FMODUtils::ConvertGuid(StudioID);
|
||||
}
|
||||
|
||||
template <class StudioType>
|
||||
inline FString GetPath(StudioType* Instance)
|
||||
{
|
||||
int ActualSize = 128; // Start with expected enough space
|
||||
TArray<char> RawBuffer;
|
||||
FMOD_RESULT Result;
|
||||
do
|
||||
{
|
||||
RawBuffer.SetNum(ActualSize);
|
||||
Result = Instance->getPath(RawBuffer.GetData(), ActualSize, &ActualSize);
|
||||
}
|
||||
while (Result == FMOD_ERR_TRUNCATED);
|
||||
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
return FString(UTF8_TO_TCHAR(RawBuffer.GetData()));
|
||||
}
|
||||
else
|
||||
{
|
||||
return FString();
|
||||
}
|
||||
}
|
||||
|
||||
inline FString LookupNameFromGuid(FMOD::Studio::System* StudioSystem, const FMOD::Studio::ID& Guid)
|
||||
{
|
||||
int ActualSize = 128; // Start with expected enough space
|
||||
TArray<char> RawBuffer;
|
||||
FMOD_RESULT Result;
|
||||
do
|
||||
{
|
||||
RawBuffer.SetNum(ActualSize);
|
||||
Result = StudioSystem->lookupPath(&Guid, RawBuffer.GetData(), ActualSize, &ActualSize);
|
||||
}
|
||||
while (Result == FMOD_ERR_TRUNCATED);
|
||||
|
||||
if (Result == FMOD_OK)
|
||||
{
|
||||
return FString(UTF8_TO_TCHAR(RawBuffer.GetData()));
|
||||
}
|
||||
else
|
||||
{
|
||||
return FString();
|
||||
}
|
||||
}
|
||||
|
||||
inline FString LookupNameFromGuid(FMOD::Studio::System* StudioSystem, const FGuid& Guid)
|
||||
{
|
||||
return LookupNameFromGuid(StudioSystem, ConvertGuid(Guid));
|
||||
}
|
||||
|
||||
inline FString ParameterTypeToString(FMOD_STUDIO_PARAMETER_TYPE Type)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case FMOD_STUDIO_PARAMETER_GAME_CONTROLLED:
|
||||
return FString("Game Controlled");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_DISTANCE:
|
||||
return FString("Distance (Auto)");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_CONE_ANGLE:
|
||||
return FString("Event Cone Angle (Auto)");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_EVENT_ORIENTATION:
|
||||
return FString("Event Orientation (Auto)");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_DIRECTION:
|
||||
return FString("Direction (Auto)");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_ELEVATION:
|
||||
return FString("Elevation (Auto)");
|
||||
case FMOD_STUDIO_PARAMETER_AUTOMATIC_LISTENER_ORIENTATION:
|
||||
return FString("Listener Orientation (Auto)");
|
||||
}
|
||||
|
||||
return FString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODAmbientSoundActorFactory.generated.h"
|
||||
|
||||
/** FMOD Ambient Sound Actor Factory.
|
||||
*/
|
||||
UCLASS(MinimalAPI, config=Editor, collapsecategories, hidecategories=Object)
|
||||
class UFMODAmbientSoundActorFactory : public UActorFactory
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
// Begin UActorFactory Interface
|
||||
virtual void PostSpawnActor( UObject* Asset, AActor* NewActor ) override;
|
||||
virtual void PostCreateBlueprint( UObject* Asset, AActor* CDO ) override;
|
||||
virtual bool CanCreateActorFrom( const FAssetData& AssetData, FText& OutErrorMsg ) override;
|
||||
virtual UObject* GetAssetFromActorInstance(AActor* ActorInstance) override;
|
||||
// End UActorFactory Interface
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
namespace UnrealBuildTool.Rules
|
||||
{
|
||||
public class FMODStudioEditor : ModuleRules
|
||||
{
|
||||
public FMODStudioEditor(TargetInfo Target)
|
||||
{
|
||||
bFasterWithoutUnity = true;
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] {
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
"FMODStudioEditor/Private",
|
||||
"FMODStudio/Private",
|
||||
}
|
||||
);
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"FMODStudio"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"UnrealEd",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"InputCore",
|
||||
"Settings",
|
||||
"EditorStyle",
|
||||
"LevelEditor",
|
||||
"AssetTools",
|
||||
"AssetRegistry",
|
||||
"PropertyEditor",
|
||||
"WorkspaceMenuStructure",
|
||||
"Sockets"
|
||||
}
|
||||
);
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "AssetTypeActions_Base.h"
|
||||
#include "AssetTypeActions_FMODEvent.h"
|
||||
#include "FMODEventEditor.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODStudioEditorModule.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "AssetTypeActions"
|
||||
|
||||
FAssetTypeActions_FMODEvent::FAssetTypeActions_FMODEvent()
|
||||
: CurrentPreviewEventInstance(nullptr)
|
||||
{
|
||||
BeginPIEDelegateHandle = FEditorDelegates::BeginPIE.AddRaw(this, &FAssetTypeActions_FMODEvent::HandleBeginPIE);
|
||||
IFMODStudioModule::Get().BanksReloadedEvent().AddRaw(this, &FAssetTypeActions_FMODEvent::HandleBanksReloaded);
|
||||
}
|
||||
|
||||
FAssetTypeActions_FMODEvent::~FAssetTypeActions_FMODEvent()
|
||||
{
|
||||
FEditorDelegates::BeginPIE.Remove(BeginPIEDelegateHandle);
|
||||
IFMODStudioModule::Get().BanksReloadedEvent().RemoveAll(this);
|
||||
IFMODStudioModule::Get().StopAuditioningInstance();
|
||||
}
|
||||
|
||||
UClass* FAssetTypeActions_FMODEvent::GetSupportedClass() const
|
||||
{
|
||||
return UFMODEvent::StaticClass();
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
|
||||
{
|
||||
auto Events = GetTypedWeakObjectPtrs<UFMODEvent>(InObjects);
|
||||
|
||||
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODEvent_Play", "Play"),
|
||||
LOCTEXT("FMODEvent_PlayTooltip", "Plays the selected FMOD event."),
|
||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Play"),
|
||||
FUIAction(
|
||||
FExecuteAction::CreateSP(this, &FAssetTypeActions_FMODEvent::ExecutePlay, Events),
|
||||
FCanExecuteAction::CreateSP(this, &FAssetTypeActions_FMODEvent::CanExecutePlayCommand, Events)
|
||||
)
|
||||
);
|
||||
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODEvent_Stop", "Stop"),
|
||||
LOCTEXT("FMODEvent_StopTooltip", "Stops the currently playing FMOD event."),
|
||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Stop"),
|
||||
FUIAction(
|
||||
FExecuteAction::CreateSP(this, &FAssetTypeActions_FMODEvent::ExecuteStop, Events),
|
||||
FCanExecuteAction()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::OpenAssetEditor(const TArray<UObject*>& InObjects, TSharedPtr<IToolkitHost> EditWithinLevelEditor)
|
||||
{
|
||||
EToolkitMode::Type Mode = EditWithinLevelEditor.IsValid() ? EToolkitMode::WorldCentric : EToolkitMode::Standalone;
|
||||
|
||||
for (auto ObjIt = InObjects.CreateConstIterator(); ObjIt; ++ObjIt)
|
||||
{
|
||||
auto Event = Cast<UFMODEvent>(*ObjIt);
|
||||
if (Event != nullptr)
|
||||
{
|
||||
TSharedRef<FFMODEventEditor> NewFMODEventEditor(new FFMODEventEditor());
|
||||
NewFMODEventEditor->InitFMODEventEditor(Mode, EditWithinLevelEditor, Event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool FAssetTypeActions_FMODEvent::CanExecutePlayCommand(TArray<TWeakObjectPtr<UFMODEvent>> Objects) const
|
||||
{
|
||||
return Objects.Num() == 1;
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::AssetsActivated(const TArray<UObject*>& InObjects, EAssetTypeActivationMethod::Type ActivationType)
|
||||
{
|
||||
if (ActivationType == EAssetTypeActivationMethod::Previewed)
|
||||
{
|
||||
for (auto ObjIt = InObjects.CreateConstIterator(); ObjIt; ++ObjIt)
|
||||
{
|
||||
UFMODEvent* Event = Cast<UFMODEvent>(*ObjIt);
|
||||
if (Event != nullptr)
|
||||
{
|
||||
// Only play the first valid event
|
||||
PlayEvent(Event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FAssetTypeActions_Base::AssetsActivated(InObjects, ActivationType);
|
||||
}
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::ExecuteEdit(TArray<TWeakObjectPtr<UFMODEvent>> Objects)
|
||||
{
|
||||
for (auto ObjIt = Objects.CreateConstIterator(); ObjIt; ++ObjIt)
|
||||
{
|
||||
auto Object = (*ObjIt).Get();
|
||||
if (Object != nullptr)
|
||||
{
|
||||
FAssetEditorManager::Get().OpenEditorForAsset(Object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::ExecutePlay(TArray<TWeakObjectPtr<UFMODEvent>> Objects)
|
||||
{
|
||||
for (auto ObjIt = Objects.CreateConstIterator(); ObjIt; ++ObjIt)
|
||||
{
|
||||
UFMODEvent* Event = (*ObjIt).Get();
|
||||
if (Event != nullptr)
|
||||
{
|
||||
// Only play the first valid event
|
||||
PlayEvent(Event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::ExecuteStop(TArray<TWeakObjectPtr<UFMODEvent>> Objects)
|
||||
{
|
||||
IFMODStudioModule::Get().StopAuditioningInstance();
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::PlayEvent(UFMODEvent* Event)
|
||||
{
|
||||
CurrentPreviewEventInstance = IFMODStudioModule::Get().CreateAuditioningInstance(Event);
|
||||
if (CurrentPreviewEventInstance != nullptr)
|
||||
{
|
||||
CurrentPreviewEventInstance->start();
|
||||
}
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::HandleBeginPIE(bool bSimulating)
|
||||
{
|
||||
// Studio module will handle its own auditioning, just clear the handle
|
||||
CurrentPreviewEventInstance = nullptr;
|
||||
}
|
||||
|
||||
void FAssetTypeActions_FMODEvent::HandleBanksReloaded()
|
||||
{
|
||||
// Studio module will handle its own auditioning, just clear the handle
|
||||
CurrentPreviewEventInstance = nullptr;
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AssetTypeActions_Base.h"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class EventInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class UFMODEvent;
|
||||
|
||||
class FAssetTypeActions_FMODEvent : public FAssetTypeActions_Base
|
||||
{
|
||||
public:
|
||||
FAssetTypeActions_FMODEvent();
|
||||
~FAssetTypeActions_FMODEvent();
|
||||
|
||||
// IAssetTypeActions Implementation
|
||||
virtual FText GetName() const override { return NSLOCTEXT("AssetTypeActions", "AssetTypeActions_FMODEvent", "FMOD Event"); }
|
||||
virtual FColor GetTypeColor() const override { return FColor(0, 175, 255); }
|
||||
virtual UClass* GetSupportedClass() const override;
|
||||
virtual bool HasActions(const TArray<UObject*>& InObjects) const override { return true; }
|
||||
virtual void GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder) override;
|
||||
virtual void AssetsActivated(const TArray<UObject*>& InObjects, EAssetTypeActivationMethod::Type ActivationType) override;
|
||||
virtual void OpenAssetEditor(const TArray<UObject*>& InObjects, TSharedPtr<class IToolkitHost> EditWithinLevelEditor = TSharedPtr<IToolkitHost>()) override;
|
||||
virtual bool CanFilter() override { return false; }
|
||||
virtual uint32 GetCategories() override { return EAssetTypeCategories::Sounds; }
|
||||
|
||||
private:
|
||||
/** Returns true if only one event is selected to play */
|
||||
bool CanExecutePlayCommand(TArray<TWeakObjectPtr<UFMODEvent>> Objects) const;
|
||||
|
||||
/** Handler for when Edit is selected */
|
||||
void ExecuteEdit(TArray<TWeakObjectPtr<UFMODEvent>> Objects);
|
||||
|
||||
/** Handler for when Play is selected */
|
||||
void ExecutePlay(TArray<TWeakObjectPtr<UFMODEvent>> Objects);
|
||||
|
||||
/** Handler for when Stop is selected */
|
||||
void ExecuteStop(TArray<TWeakObjectPtr<UFMODEvent>> Objects);
|
||||
|
||||
/** Plays the event */
|
||||
void PlayEvent(UFMODEvent* Event);
|
||||
|
||||
void HandleBeginPIE(bool bSimulating);
|
||||
void HandleBanksReloaded();
|
||||
|
||||
FMOD::Studio::EventInstance* CurrentPreviewEventInstance;
|
||||
FDelegateHandle BeginPIEDelegateHandle;
|
||||
};
|
|
@ -0,0 +1,66 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "AssetData.h"
|
||||
#include "FMODAmbientSoundActorFactory.h"
|
||||
#include "FMODAmbientSound.h"
|
||||
#include "FMODEvent.h"
|
||||
|
||||
UFMODAmbientSoundActorFactory::UFMODAmbientSoundActorFactory(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
DisplayName = NSLOCTEXT("FMOD", "FMODAmbientSoundDisplayName", "FMOD Ambient Sound");
|
||||
NewActorClass = AFMODAmbientSound::StaticClass();
|
||||
}
|
||||
|
||||
bool UFMODAmbientSoundActorFactory::CanCreateActorFrom( const FAssetData& AssetData, FText& OutErrorMsg )
|
||||
{
|
||||
//We allow creating AAmbientSounds without an existing sound asset
|
||||
if ( UActorFactory::CanCreateActorFrom( AssetData, OutErrorMsg ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( AssetData.IsValid() && !AssetData.GetClass()->IsChildOf( UFMODEvent::StaticClass() ) )
|
||||
{
|
||||
OutErrorMsg = NSLOCTEXT("FMOD", "CanCreateActorFrom_NoFMODEventAsset", "A valid FMOD Event asset must be specified.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void UFMODAmbientSoundActorFactory::PostSpawnActor( UObject* Asset, AActor* NewActor)
|
||||
{
|
||||
UFMODEvent* Event = Cast<UFMODEvent>( Asset );
|
||||
|
||||
if ( Event != NULL )
|
||||
{
|
||||
AFMODAmbientSound* NewSound = CastChecked<AFMODAmbientSound>( NewActor );
|
||||
FActorLabelUtilities::SetActorLabelUnique(NewSound, Event->GetName());
|
||||
NewSound->AudioComponent->Event = Event;
|
||||
}
|
||||
}
|
||||
|
||||
UObject* UFMODAmbientSoundActorFactory::GetAssetFromActorInstance(AActor* Instance)
|
||||
{
|
||||
check(Instance->IsA(NewActorClass));
|
||||
AFMODAmbientSound* SoundActor = CastChecked<AFMODAmbientSound>(Instance);
|
||||
|
||||
check(SoundActor->AudioComponent);
|
||||
return SoundActor->AudioComponent->Event.Get();
|
||||
}
|
||||
|
||||
void UFMODAmbientSoundActorFactory::PostCreateBlueprint( UObject* Asset, AActor* CDO )
|
||||
{
|
||||
if (Asset != NULL && CDO != NULL)
|
||||
{
|
||||
UFMODEvent* Event = Cast<UFMODEvent>(Asset);
|
||||
|
||||
if (Event != NULL)
|
||||
{
|
||||
AFMODAmbientSound* NewSound = CastChecked<AFMODAmbientSound>(CDO);
|
||||
NewSound->AudioComponent->Event = Event;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "FMODAmbientSoundDetails.h"
|
||||
#include "Toolkits/AssetEditorManager.h"
|
||||
#include "FMODAmbientSound.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FMODStudio"
|
||||
|
||||
TSharedRef<IDetailCustomization> FFMODAmbientSoundDetails::MakeInstance()
|
||||
{
|
||||
return MakeShareable( new FFMODAmbientSoundDetails );
|
||||
}
|
||||
|
||||
void FFMODAmbientSoundDetails::CustomizeDetails( IDetailLayoutBuilder& DetailBuilder )
|
||||
{
|
||||
const TArray< TWeakObjectPtr<UObject> >& SelectedObjects = DetailBuilder.GetDetailsView().GetSelectedObjects();
|
||||
|
||||
for( int32 ObjectIndex = 0; !AmbientSound.IsValid() && ObjectIndex < SelectedObjects.Num(); ++ObjectIndex )
|
||||
{
|
||||
const TWeakObjectPtr<UObject>& CurrentObject = SelectedObjects[ObjectIndex];
|
||||
if ( CurrentObject.IsValid() )
|
||||
{
|
||||
AmbientSound = Cast<AFMODAmbientSound>(CurrentObject.Get());
|
||||
}
|
||||
}
|
||||
|
||||
DetailBuilder.EditCategory(TEXT("Sound"))
|
||||
.AddCustomRow(FText::GetEmpty())
|
||||
[
|
||||
SNew(SVerticalBox)
|
||||
+ SVerticalBox::Slot()
|
||||
.Padding( 0, 2.0f, 0, 0 )
|
||||
.FillHeight(1.0f)
|
||||
.VAlign( VAlign_Center )
|
||||
[
|
||||
SNew(SHorizontalBox)
|
||||
+SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding( 2.0f, 0.0f )
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.VAlign(VAlign_Center)
|
||||
.OnClicked( this, &FFMODAmbientSoundDetails::OnEditSoundClicked )
|
||||
.Text( LOCTEXT("EditAsset", "Edit") )
|
||||
.ToolTipText( LOCTEXT("EditAssetToolTip", "Edit this sound cue") )
|
||||
]
|
||||
+SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding( 2.0f, 0.0f )
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.VAlign(VAlign_Center)
|
||||
.OnClicked( this, &FFMODAmbientSoundDetails::OnPlaySoundClicked )
|
||||
.Text( LOCTEXT("PlaySoundCue", "Play") )
|
||||
]
|
||||
+SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding( 2.0f, 0.0f )
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.VAlign(VAlign_Center)
|
||||
.OnClicked( this, &FFMODAmbientSoundDetails::OnStopSoundClicked )
|
||||
.Text( LOCTEXT("StopSoundCue", "Stop") )
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
FReply FFMODAmbientSoundDetails::OnEditSoundClicked()
|
||||
{
|
||||
if( AmbientSound.IsValid() )
|
||||
{
|
||||
UFMODEvent* Event = AmbientSound.Get()->AudioComponent->Event.Get();
|
||||
if (Event)
|
||||
{
|
||||
FAssetEditorManager::Get().OpenEditorForAsset(Event);
|
||||
}
|
||||
}
|
||||
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
FReply FFMODAmbientSoundDetails::OnPlaySoundClicked()
|
||||
{
|
||||
if( AmbientSound.IsValid() )
|
||||
{
|
||||
UFMODEvent* Event = AmbientSound.Get()->AudioComponent->Event.Get();
|
||||
if (Event)
|
||||
{
|
||||
FMOD::Studio::EventInstance* Instance = IFMODStudioModule::Get().CreateAuditioningInstance(Event);
|
||||
if (Instance)
|
||||
{
|
||||
Instance->start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
FReply FFMODAmbientSoundDetails::OnStopSoundClicked()
|
||||
{
|
||||
IFMODStudioModule::Get().StopAuditioningInstance();
|
||||
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PropertyEditing.h"
|
||||
#include "PropertyCustomizationHelpers.h"
|
||||
|
||||
class FFMODAmbientSoundDetails : public IDetailCustomization
|
||||
{
|
||||
public:
|
||||
/** Makes a new instance of this detail layout class for a specific detail view requesting it */
|
||||
static TSharedRef<IDetailCustomization> MakeInstance();
|
||||
|
||||
private:
|
||||
/** IDetailCustomization interface */
|
||||
virtual void CustomizeDetails( IDetailLayoutBuilder& DetailBuilder ) override;
|
||||
|
||||
FReply OnEditSoundClicked();
|
||||
FReply OnPlaySoundClicked();
|
||||
FReply OnStopSoundClicked();
|
||||
|
||||
TWeakObjectPtr<class AFMODAmbientSound> AmbientSound;
|
||||
};
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ComponentAssetBroker.h"
|
||||
#include "FMODEvent.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// FFMODAssetBroker
|
||||
|
||||
class FFMODAssetBroker : public IComponentAssetBroker
|
||||
{
|
||||
public:
|
||||
UClass* GetSupportedAssetClass() override
|
||||
{
|
||||
return UFMODEvent::StaticClass();
|
||||
}
|
||||
|
||||
virtual bool AssignAssetToComponent(UActorComponent* InComponent, UObject* InAsset) override
|
||||
{
|
||||
if (UFMODAudioComponent* AudioComp = Cast<UFMODAudioComponent>(InComponent))
|
||||
{
|
||||
UFMODEvent* Event = Cast<UFMODEvent>(InAsset);
|
||||
|
||||
if ((Event != NULL) || (InAsset == NULL))
|
||||
{
|
||||
AudioComp->Event = Event;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual UObject* GetAssetFromComponent(UActorComponent* InComponent) override
|
||||
{
|
||||
if (UFMODAudioComponent* AudioComp = Cast<UFMODAudioComponent>(InComponent))
|
||||
{
|
||||
return AudioComp->Event.Get();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "FMODAudioComponentVisualizer.h"
|
||||
#include "FMODAudioComponent.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
void FFMODAudioComponentVisualizer::DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI)
|
||||
{
|
||||
if (View->Family->EngineShowFlags.AudioRadius)
|
||||
{
|
||||
const UFMODAudioComponent* AudioComp = Cast<const UFMODAudioComponent>(Component);
|
||||
if (AudioComp != nullptr && AudioComp->Event.IsValid())
|
||||
{
|
||||
FMOD::Studio::EventDescription* EventDesc = IFMODStudioModule::Get().GetEventDescription(AudioComp->Event.Get(), EFMODSystemContext::Auditioning);
|
||||
if (EventDesc != nullptr)
|
||||
{
|
||||
bool bIs3D = false;
|
||||
EventDesc->is3D(&bIs3D);
|
||||
if (bIs3D)
|
||||
{
|
||||
const FColor AudioOuterRadiusColor(255, 153, 0);
|
||||
const FColor AudioInnerRadiusColor(216, 130, 0);
|
||||
|
||||
const FTransform& Transform = AudioComp->ComponentToWorld;
|
||||
|
||||
float MinDistance = 0.0f;
|
||||
float MaxDistance = 0.0f;
|
||||
EventDesc->getMinimumDistance(&MinDistance);
|
||||
EventDesc->getMaximumDistance(&MaxDistance);
|
||||
MinDistance = FMODUtils::DistanceToUEScale(MinDistance);
|
||||
MaxDistance = FMODUtils::DistanceToUEScale(MaxDistance);
|
||||
|
||||
DrawWireSphereAutoSides(PDI, Transform.GetTranslation(), AudioOuterRadiusColor, MinDistance, SDPG_World);
|
||||
if (MaxDistance != MinDistance)
|
||||
{
|
||||
DrawWireSphereAutoSides(PDI, Transform.GetTranslation(), AudioInnerRadiusColor, MaxDistance, SDPG_World);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ComponentVisualizer.h"
|
||||
|
||||
class FFMODAudioComponentVisualizer : public FComponentVisualizer
|
||||
{
|
||||
public:
|
||||
// Begin FComponentVisualizer interface
|
||||
virtual void DrawVisualization(const UActorComponent* Component, const FSceneView* View, FPrimitiveDrawInterface* PDI) override;
|
||||
// End FComponentVisualizer interface
|
||||
};
|
|
@ -0,0 +1,187 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "FMODEventEditor.h"
|
||||
#include "FMODEvent.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "SFMODEventEditorPanel.h"
|
||||
#include "SDockTab.h"
|
||||
//#include "WorkspaceMenuStructureModule.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FMODEventEditor"
|
||||
|
||||
DEFINE_LOG_CATEGORY_STATIC(LogFMODEventEditor, Log, All);
|
||||
|
||||
const FName FFMODEventEditor::EventEditorTabId(TEXT("FFMODEventEditor_EventView"));
|
||||
const FName FFMODEventEditor::FMODEventEditorAppIdentifier(TEXT("FMODEventEditorApp"));
|
||||
|
||||
void FFMODEventEditor::RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager)
|
||||
{
|
||||
WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_FMODEventEditor", "FMOD Event Editor"));
|
||||
auto WorkspaceMenuCategoryRef = WorkspaceMenuCategory.ToSharedRef();
|
||||
|
||||
FAssetEditorToolkit::RegisterTabSpawners(TabManager);
|
||||
|
||||
TabManager->RegisterTabSpawner(
|
||||
EventEditorTabId,
|
||||
FOnSpawnTab::CreateSP(this, &FFMODEventEditor::SpawnTab_EventEditor))
|
||||
.SetDisplayName(LOCTEXT("EventTab", "FMOD Event"))
|
||||
.SetGroup(WorkspaceMenuCategoryRef);
|
||||
}
|
||||
|
||||
void FFMODEventEditor::UnregisterTabSpawners(const TSharedRef<class FTabManager>& TabManager)
|
||||
{
|
||||
FAssetEditorToolkit::UnregisterTabSpawners(TabManager);
|
||||
|
||||
TabManager->UnregisterTabSpawner(EventEditorTabId);
|
||||
}
|
||||
|
||||
FFMODEventEditor::FFMODEventEditor()
|
||||
: CurrentPreviewEventInstance(nullptr)
|
||||
{
|
||||
IFMODStudioModule::Get().BanksReloadedEvent().AddRaw(this, &FFMODEventEditor::HandleBanksReloaded);
|
||||
BeginPIEDelegateHandle = FEditorDelegates::BeginPIE.AddRaw(this, &FFMODEventEditor::HandleBeginPIE);
|
||||
}
|
||||
|
||||
FFMODEventEditor::~FFMODEventEditor()
|
||||
{
|
||||
IFMODStudioModule::Get().BanksReloadedEvent().RemoveAll(this);
|
||||
FEditorDelegates::BeginPIE.Remove(BeginPIEDelegateHandle);
|
||||
|
||||
CurrentPreviewEventInstance = nullptr;
|
||||
}
|
||||
|
||||
UFMODEvent* FFMODEventEditor::GetEditedEvent() const
|
||||
{
|
||||
return EditedEvent;
|
||||
}
|
||||
|
||||
FMOD::Studio::EventDescription* FFMODEventEditor::GetEventDescription() const
|
||||
{
|
||||
return IFMODStudioModule::Get().GetEventDescription(EditedEvent, EFMODSystemContext::Auditioning);
|
||||
}
|
||||
|
||||
void FFMODEventEditor::PlayEvent()
|
||||
{
|
||||
CurrentPreviewEventInstance = IFMODStudioModule::Get().CreateAuditioningInstance(EditedEvent);
|
||||
if (CurrentPreviewEventInstance != nullptr)
|
||||
{
|
||||
for (int32 ParamIdx = 0; ParamIdx < ParameterValues.Num(); ParamIdx++)
|
||||
{
|
||||
CurrentPreviewEventInstance->setParameterValueByIndex(ParamIdx, ParameterValues[ParamIdx]);
|
||||
}
|
||||
|
||||
CurrentPreviewEventInstance->start();
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODEventEditor::PauseEvent()
|
||||
{
|
||||
if (CurrentPreviewEventInstance != nullptr)
|
||||
{
|
||||
bool bIsPaused = false;
|
||||
CurrentPreviewEventInstance->getPaused(&bIsPaused);
|
||||
CurrentPreviewEventInstance->setPaused(!bIsPaused);
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODEventEditor::StopEvent()
|
||||
{
|
||||
IFMODStudioModule::Get().StopAuditioningInstance();
|
||||
}
|
||||
|
||||
void FFMODEventEditor::SetParameterValue(int32 ParameterIdx, float Value)
|
||||
{
|
||||
ParameterValues[ParameterIdx] = Value;
|
||||
|
||||
if (CurrentPreviewEventInstance != nullptr)
|
||||
{
|
||||
CurrentPreviewEventInstance->setParameterValueByIndex(ParameterIdx, Value);
|
||||
}
|
||||
}
|
||||
|
||||
TArray<float>& FFMODEventEditor::GetParameterValues()
|
||||
{
|
||||
return ParameterValues;
|
||||
}
|
||||
|
||||
void FFMODEventEditor::InitFMODEventEditor(const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, UFMODEvent* Event)
|
||||
{
|
||||
EditedEvent = Event;
|
||||
|
||||
TSharedRef<FTabManager::FLayout> StandaloneDefaultLayout = FTabManager::NewLayout("Standalone_FMODEventEditor_Layout")
|
||||
->AddArea
|
||||
(
|
||||
FTabManager::NewPrimaryArea()->SetOrientation(Orient_Vertical)
|
||||
->Split
|
||||
(
|
||||
FTabManager::NewStack()
|
||||
->AddTab(EventEditorTabId, ETabState::OpenedTab)->SetHideTabWell(true)
|
||||
)
|
||||
);
|
||||
|
||||
const bool bCreateDefaultStandaloneMenu = true;
|
||||
const bool bCreateDefaultToolbar = false;
|
||||
FAssetEditorToolkit::InitAssetEditor(Mode, InitToolkitHost, FFMODEventEditor::FMODEventEditorAppIdentifier, StandaloneDefaultLayout, bCreateDefaultStandaloneMenu, bCreateDefaultToolbar, Event);
|
||||
}
|
||||
|
||||
FName FFMODEventEditor::GetToolkitFName() const
|
||||
{
|
||||
return FName("FMODEventEditor");
|
||||
}
|
||||
|
||||
FText FFMODEventEditor::GetBaseToolkitName() const
|
||||
{
|
||||
return LOCTEXT("ToolkitName", "FMOD Event Editor");
|
||||
}
|
||||
|
||||
FString FFMODEventEditor::GetWorldCentricTabPrefix() const
|
||||
{
|
||||
return LOCTEXT("WorldCentricTabPrefix", "FMOD Event ").ToString();
|
||||
}
|
||||
|
||||
FLinearColor FFMODEventEditor::GetWorldCentricTabColorScale() const
|
||||
{
|
||||
return FLinearColor(0.0f, 0.0f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
void FFMODEventEditor::CreateInternalWidgets()
|
||||
{
|
||||
FMODEventEditorPanel = SNew(SFMODEventEditorPanel)
|
||||
.FMODEventEditor(SharedThis(this));
|
||||
}
|
||||
|
||||
TSharedRef<SDockTab> FFMODEventEditor::SpawnTab_EventEditor(const FSpawnTabArgs& Args)
|
||||
{
|
||||
check(Args.GetTabId().TabType == EventEditorTabId);
|
||||
|
||||
CreateInternalWidgets();
|
||||
|
||||
return SAssignNew(OwnerTab, SDockTab)
|
||||
.Label(LOCTEXT("EventEditorTitle", "FMOD Event"))
|
||||
.TabColorScale(GetTabColorScale())
|
||||
[
|
||||
FMODEventEditorPanel.ToSharedRef()
|
||||
];
|
||||
}
|
||||
|
||||
void FFMODEventEditor::HandleBanksReloaded()
|
||||
{
|
||||
CurrentPreviewEventInstance = nullptr;
|
||||
|
||||
CreateInternalWidgets();
|
||||
|
||||
if (OwnerTab.IsValid())
|
||||
{
|
||||
OwnerTab->SetContent(FMODEventEditorPanel.ToSharedRef());
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODEventEditor::HandleBeginPIE(bool bSimulating)
|
||||
{
|
||||
CurrentPreviewEventInstance = nullptr;
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
|
@ -0,0 +1,80 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Toolkits/AssetEditorToolkit.h"
|
||||
#include "fmod_studio_common.h"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class EventDescription;
|
||||
class EventInstance;
|
||||
}
|
||||
}
|
||||
|
||||
class FFMODEventEditor : public FAssetEditorToolkit
|
||||
{
|
||||
public:
|
||||
virtual void RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
|
||||
virtual void UnregisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
|
||||
|
||||
/**
|
||||
* Edits the specified event
|
||||
*
|
||||
* @param Mode Asset editing mode for this editor (standalone or world-centric)
|
||||
* @param InitToolkitHost When Mode is WorldCentric, this is the level editor instance to spawn this editor within
|
||||
* @param Event The event to edit
|
||||
*/
|
||||
void InitFMODEventEditor(const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, class UFMODEvent* Event);
|
||||
|
||||
/** Constructor */
|
||||
FFMODEventEditor();
|
||||
|
||||
/** Destructor */
|
||||
virtual ~FFMODEventEditor();
|
||||
|
||||
UFMODEvent* GetEditedEvent() const;
|
||||
FMOD::Studio::EventDescription* GetEventDescription() const;
|
||||
void PlayEvent();
|
||||
void PauseEvent();
|
||||
void StopEvent();
|
||||
void SetParameterValue(int32 ParameterIdx, float Value);
|
||||
TArray<float>& GetParameterValues();
|
||||
|
||||
/** IToolkit interface */
|
||||
virtual FName GetToolkitFName() const override;
|
||||
virtual FText GetBaseToolkitName() const override;
|
||||
virtual FString GetWorldCentricTabPrefix() const override;
|
||||
virtual FLinearColor GetWorldCentricTabColorScale() const override;
|
||||
|
||||
TArray<float> ParameterValues;
|
||||
|
||||
private:
|
||||
|
||||
FMOD::Studio::EventInstance* CurrentPreviewEventInstance;
|
||||
|
||||
void HandlePreBanksReloaded();
|
||||
void HandleBanksReloaded();
|
||||
void HandleBeginPIE(bool bSimulating);
|
||||
|
||||
/** Creates all internal widgets for the tabs to point at */
|
||||
void CreateInternalWidgets();
|
||||
|
||||
/** Spawns the tab with the FMOD event inside */
|
||||
TSharedRef<SDockTab> SpawnTab_EventEditor(const FSpawnTabArgs& Args);
|
||||
|
||||
TSharedPtr<class SFMODEventEditorPanel> FMODEventEditorPanel;
|
||||
TSharedPtr<SDockTab> OwnerTab;
|
||||
|
||||
/** The tab id for the event editor tab */
|
||||
static const FName EventEditorTabId;
|
||||
|
||||
/** FMOD event editor app identifier string */
|
||||
static const FName FMODEventEditorAppIdentifier;
|
||||
|
||||
class UFMODEvent* EditedEvent;
|
||||
|
||||
FDelegateHandle BeginPIEDelegateHandle;
|
||||
};
|
|
@ -0,0 +1,872 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
|
||||
#include "FMODStudioEditorModule.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODStudioStyle.h"
|
||||
#include "FMODAudioComponent.h"
|
||||
#include "FMODAssetBroker.h"
|
||||
#include "FMODSettings.h"
|
||||
#include "FMODUtils.h"
|
||||
|
||||
#include "FMODEventEditor.h"
|
||||
#include "FMODAudioComponentVisualizer.h"
|
||||
#include "FMODAmbientSoundDetails.h"
|
||||
|
||||
#include "SlateBasics.h"
|
||||
#include "AssetTypeActions_FMODEvent.h"
|
||||
#include "NotificationManager.h"
|
||||
#include "SNotificationList.h"
|
||||
#include "ISettingsModule.h"
|
||||
#include "ISettingsSection.h"
|
||||
#include "Editor.h"
|
||||
#include "SceneViewport.h"
|
||||
#include "LevelEditor.h"
|
||||
#include "SocketSubsystem.h"
|
||||
#include "Sockets.h"
|
||||
#include "IPAddress.h"
|
||||
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FMODStudio"
|
||||
|
||||
DEFINE_LOG_CATEGORY(LogFMOD);
|
||||
|
||||
class FFMODStudioLink
|
||||
{
|
||||
public:
|
||||
FFMODStudioLink()
|
||||
: SocketSubsystem(nullptr),
|
||||
Socket(nullptr)
|
||||
{
|
||||
SocketSubsystem = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM);
|
||||
}
|
||||
|
||||
~FFMODStudioLink()
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
bool Connect()
|
||||
{
|
||||
if (!SocketSubsystem) return false;
|
||||
|
||||
Disconnect();
|
||||
Socket = SocketSubsystem->CreateSocket(NAME_Stream, TEXT("FMOD Studio Connection"), false);
|
||||
|
||||
TSharedRef<FInternetAddr> Addr = SocketSubsystem->CreateInternetAddr();
|
||||
bool Valid = false;
|
||||
Addr->SetIp(TEXT("127.0.0.1"), Valid);
|
||||
if (!Valid) return false;
|
||||
|
||||
Addr->SetPort(3663);
|
||||
return Socket->Connect(*Addr);
|
||||
}
|
||||
|
||||
void Disconnect()
|
||||
{
|
||||
if (SocketSubsystem && Socket)
|
||||
{
|
||||
SocketSubsystem->DestroySocket(Socket);
|
||||
Socket = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool Execute(const TCHAR* Message, FString& OutMessage)
|
||||
{
|
||||
OutMessage = TEXT("");
|
||||
if (!Socket)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UE_LOG(LogFMOD, Log, TEXT("Sent studio message: %s"), Message);
|
||||
|
||||
FTCHARToUTF8 MessageChars(Message);
|
||||
int32 BytesSent = 0;
|
||||
if (!Socket->Send((const uint8*)MessageChars.Get(), MessageChars.Length(), BytesSent))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
FString BackMessage;
|
||||
if (!ReadMessage(BackMessage))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
UE_LOG(LogFMOD, Log, TEXT("Received studio message: %s"), *BackMessage);
|
||||
if (BackMessage.StartsWith(TEXT("out(): ")))
|
||||
{
|
||||
OutMessage = BackMessage.Mid(7).TrimTrailing();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Keep going
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
bool ReadMessage(FString& OutMessage)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
for (int32 i=0; i<ReceivedMessage.Num(); ++i)
|
||||
{
|
||||
if (ReceivedMessage[i] == '\0')
|
||||
{
|
||||
OutMessage = FString(UTF8_TO_TCHAR(ReceivedMessage.GetData()));
|
||||
ReceivedMessage.RemoveAt(0, i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int32 ExtraSpace = 64;
|
||||
int32 CurrentSize = ReceivedMessage.Num();
|
||||
ReceivedMessage.SetNum(CurrentSize + ExtraSpace);
|
||||
int32 ActualRead = 0;
|
||||
if (!Socket->Wait(ESocketWaitConditions::WaitForRead, FTimespan::FromSeconds(10)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!Socket->Recv((uint8*)ReceivedMessage.GetData() + CurrentSize, ExtraSpace, ActualRead))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ReceivedMessage.SetNum(CurrentSize + ActualRead);
|
||||
}
|
||||
}
|
||||
|
||||
ISocketSubsystem* SocketSubsystem;
|
||||
FSocket* Socket;
|
||||
TArray<char> ReceivedMessage;
|
||||
};
|
||||
|
||||
class FFMODStudioEditorModule : public IFMODStudioEditorModule
|
||||
{
|
||||
public:
|
||||
/** IModuleInterface implementation */
|
||||
FFMODStudioEditorModule() :
|
||||
bSimulating(false),
|
||||
bIsInPIE(false),
|
||||
bRegisteredComponentVisualizers(false)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void StartupModule() override;
|
||||
virtual void PostLoadCallback() override;
|
||||
virtual void ShutdownModule() override;
|
||||
|
||||
bool HandleSettingsSaved();
|
||||
|
||||
/** Called after all banks were reloaded by the studio module */
|
||||
void HandleBanksReloaded();
|
||||
|
||||
/** Show notification */
|
||||
void ShowNotification(const FText& Text, SNotificationItem::ECompletionState State);
|
||||
|
||||
void BeginPIE(bool simulating);
|
||||
void EndPIE(bool simulating);
|
||||
void PausePIE(bool simulating);
|
||||
void ResumePIE(bool simulating);
|
||||
|
||||
void ViewportDraw(UCanvas* Canvas, APlayerController*);
|
||||
|
||||
bool Tick( float DeltaTime );
|
||||
|
||||
/** Add extensions to menu */
|
||||
void AddHelpMenuExtension(FMenuBuilder& MenuBuilder);
|
||||
void AddFileMenuExtension(FMenuBuilder& MenuBuilder);
|
||||
|
||||
/** Show FMOD version */
|
||||
void ShowVersion();
|
||||
/** Open CHM */
|
||||
void OpenCHM();
|
||||
/** Open web page to online docs */
|
||||
void OpenOnlineDocs();
|
||||
/** Open Video tutorials page */
|
||||
void OpenVideoTutorials();
|
||||
/** Set Studio build path */
|
||||
void ValidateFMOD();
|
||||
|
||||
/** Reload banks */
|
||||
void ReloadBanks();
|
||||
|
||||
TArray<FName> RegisteredComponentClassNames;
|
||||
void RegisterComponentVisualizer(FName ComponentClassName, TSharedPtr<FComponentVisualizer> Visualizer);
|
||||
|
||||
/** The delegate to be invoked when this profiler manager ticks. */
|
||||
FTickerDelegate OnTick;
|
||||
|
||||
/** Handle for registered delegates. */
|
||||
FDelegateHandle TickDelegateHandle;
|
||||
FDelegateHandle BeginPIEDelegateHandle;
|
||||
FDelegateHandle EndPIEDelegateHandle;
|
||||
FDelegateHandle PausePIEDelegateHandle;
|
||||
FDelegateHandle ResumePIEDelegateHandle;
|
||||
FDelegateHandle HandleBanksReloadedDelegateHandle;
|
||||
|
||||
/** Hook for drawing viewport */
|
||||
FDebugDrawDelegate ViewportDrawingDelegate;
|
||||
FDelegateHandle ViewportDrawingDelegateHandle;
|
||||
|
||||
TSharedPtr<IComponentAssetBroker> AssetBroker;
|
||||
|
||||
/** The extender to pass to the level editor to extend it's window menu */
|
||||
TSharedPtr<FExtender> MainMenuExtender;
|
||||
|
||||
/** Asset type actions for events (edit, play, stop) */
|
||||
TSharedPtr<FAssetTypeActions_FMODEvent> FMODEventAssetTypeActions;
|
||||
|
||||
bool bSimulating;
|
||||
bool bIsInPIE;
|
||||
bool bRegisteredComponentVisualizers;
|
||||
};
|
||||
|
||||
IMPLEMENT_MODULE( FFMODStudioEditorModule, FMODStudioEditor )
|
||||
|
||||
void FFMODStudioEditorModule::StartupModule()
|
||||
{
|
||||
UE_LOG(LogFMOD, Log, TEXT("FFMODStudioEditorModule startup"));
|
||||
|
||||
AssetBroker = MakeShareable(new FFMODAssetBroker);
|
||||
FComponentAssetBrokerage::RegisterBroker(AssetBroker, UFMODAudioComponent::StaticClass(), true, true);
|
||||
|
||||
if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings"))
|
||||
{
|
||||
ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "FMODStudio",
|
||||
LOCTEXT("FMODStudioSettingsName", "FMOD Studio"),
|
||||
LOCTEXT("FMODStudioDescription", "Configure the FMOD Studio plugin"),
|
||||
GetMutableDefault<UFMODSettings>()
|
||||
);
|
||||
|
||||
if (SettingsSection.IsValid())
|
||||
{
|
||||
SettingsSection->OnModified().BindRaw(this, &FFMODStudioEditorModule::HandleSettingsSaved);
|
||||
}
|
||||
}
|
||||
|
||||
// Register the details customizations
|
||||
{
|
||||
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
||||
PropertyModule.RegisterCustomClassLayout("FMODAmbientSound", FOnGetDetailCustomizationInstance::CreateStatic(&FFMODAmbientSoundDetails::MakeInstance));
|
||||
PropertyModule.NotifyCustomizationModuleChanged();
|
||||
}
|
||||
|
||||
// Need to load the editor module since it gets created after us, and we can't re-order ourselves otherwise our asset registration stops working!
|
||||
// It only works if we are running the editor, not a commandlet
|
||||
if (!IsRunningCommandlet())
|
||||
{
|
||||
MainMenuExtender = MakeShareable(new FExtender);
|
||||
MainMenuExtender->AddMenuExtension("HelpBrowse", EExtensionHook::After, NULL, FMenuExtensionDelegate::CreateRaw(this, &FFMODStudioEditorModule::AddHelpMenuExtension));
|
||||
MainMenuExtender->AddMenuExtension("FileLoadAndSave", EExtensionHook::After, NULL, FMenuExtensionDelegate::CreateRaw(this, &FFMODStudioEditorModule::AddFileMenuExtension));
|
||||
|
||||
FLevelEditorModule* LevelEditor = FModuleManager::LoadModulePtr<FLevelEditorModule>(TEXT("LevelEditor"));
|
||||
if (LevelEditor)
|
||||
{
|
||||
LevelEditor->GetMenuExtensibilityManager()->AddExtender(MainMenuExtender);
|
||||
}
|
||||
}
|
||||
|
||||
// Register AssetTypeActions
|
||||
IAssetTools& AssetTools = FModuleManager::GetModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
||||
|
||||
FMODEventAssetTypeActions = MakeShareable(new FAssetTypeActions_FMODEvent);
|
||||
AssetTools.RegisterAssetTypeActions(FMODEventAssetTypeActions.ToSharedRef());
|
||||
|
||||
// Register slate style overrides
|
||||
FFMODStudioStyle::Initialize();
|
||||
|
||||
BeginPIEDelegateHandle = FEditorDelegates::BeginPIE.AddRaw(this, &FFMODStudioEditorModule::BeginPIE);
|
||||
EndPIEDelegateHandle = FEditorDelegates::EndPIE.AddRaw(this, &FFMODStudioEditorModule::EndPIE);
|
||||
PausePIEDelegateHandle = FEditorDelegates::PausePIE.AddRaw(this, &FFMODStudioEditorModule::PausePIE);
|
||||
ResumePIEDelegateHandle = FEditorDelegates::ResumePIE.AddRaw(this, &FFMODStudioEditorModule::ResumePIE);
|
||||
|
||||
ViewportDrawingDelegate = FDebugDrawDelegate::CreateRaw(this, &FFMODStudioEditorModule::ViewportDraw);
|
||||
ViewportDrawingDelegateHandle = UDebugDrawService::Register(TEXT("Editor"), ViewportDrawingDelegate);
|
||||
|
||||
OnTick = FTickerDelegate::CreateRaw( this, &FFMODStudioEditorModule::Tick );
|
||||
TickDelegateHandle = FTicker::GetCoreTicker().AddTicker( OnTick );
|
||||
|
||||
// This module is loaded after FMODStudioModule
|
||||
HandleBanksReloadedDelegateHandle = IFMODStudioModule::Get().BanksReloadedEvent().AddRaw(this, &FFMODStudioEditorModule::HandleBanksReloaded);
|
||||
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::AddHelpMenuExtension(FMenuBuilder& MenuBuilder)
|
||||
{
|
||||
MenuBuilder.BeginSection("FMODHelp", LOCTEXT("FMODHelpLabel", "FMOD Help"));
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODVersionMenuEntryTitle", "About FMOD Studio"),
|
||||
LOCTEXT("FMODVersionMenuEntryToolTip", "Shows the informationa about FMOD Studio."),
|
||||
FSlateIcon(),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::ShowVersion)));
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODHelpCHMTitle", "FMOD Documentation..."),
|
||||
LOCTEXT("FMODHelpCHMToolTip", "Opens the local FMOD documentation."),
|
||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BrowseAPIReference"),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::OpenCHM)));
|
||||
#endif
|
||||
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODHelpOnlineTitle", "FMOD Online Documentation..."),
|
||||
LOCTEXT("FMODHelpOnlineToolTip", "Go to the online FMOD documentation."),
|
||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BrowseDocumentation"),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::OpenOnlineDocs)));
|
||||
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODHelpVideosTitle", "FMOD Tutorial Videos..."),
|
||||
LOCTEXT("FMODHelpVideosToolTip", "Go to the online FMOD tutorial videos."),
|
||||
FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tutorials"),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::OpenVideoTutorials)));
|
||||
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODSetStudioBuildTitle", "Validate FMOD"),
|
||||
LOCTEXT("FMODSetStudioBuildToolTip", "Verifies that FMOD and FMOD Studio are working as expected."),
|
||||
FSlateIcon(),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::ValidateFMOD)));
|
||||
|
||||
MenuBuilder.EndSection();
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::AddFileMenuExtension(FMenuBuilder& MenuBuilder)
|
||||
{
|
||||
MenuBuilder.BeginSection("FMODFile", LOCTEXT("FMODFileLabel", "FMOD"));
|
||||
MenuBuilder.AddMenuEntry(
|
||||
LOCTEXT("FMODFileMenuEntryTitle", "Reload Banks"),
|
||||
LOCTEXT("FMODFileMenuEntryToolTip", "Force a manual reload of all FMOD Studio banks."),
|
||||
FSlateIcon(),
|
||||
FUIAction(FExecuteAction::CreateRaw(this, &FFMODStudioEditorModule::ReloadBanks)));
|
||||
MenuBuilder.EndSection();
|
||||
}
|
||||
|
||||
unsigned int GetDLLVersion()
|
||||
{
|
||||
// Just grab it from the audition context which is always valid
|
||||
unsigned int DLLVersion = 0;
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Auditioning);
|
||||
if (StudioSystem)
|
||||
{
|
||||
FMOD::System* LowLevelSystem = nullptr;
|
||||
if (StudioSystem->getLowLevelSystem(&LowLevelSystem) == FMOD_OK)
|
||||
{
|
||||
LowLevelSystem->getVersion(&DLLVersion);
|
||||
}
|
||||
}
|
||||
return DLLVersion;
|
||||
}
|
||||
unsigned int StripPatch(unsigned int FullVersion)
|
||||
{
|
||||
return FullVersion & ~0xFF;
|
||||
}
|
||||
FString VersionToString(unsigned int FullVersion)
|
||||
{
|
||||
return FString::Printf(TEXT("%x.%02x.%02x"), (FullVersion>>16), (FullVersion>>8) & 0xFF, FullVersion & 0xFF);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ShowVersion()
|
||||
{
|
||||
unsigned int HeaderVersion = FMOD_VERSION;
|
||||
unsigned int DLLVersion = GetDLLVersion();
|
||||
|
||||
FText VersionMessage = FText::Format(
|
||||
LOCTEXT("FMODStudio_About", "FMOD Studio\n\nBuilt Version: {0}\nDLL Version: {1}\n\nCopyright Firelight Technologies Pty Ltd"),
|
||||
FText::FromString(VersionToString(HeaderVersion)),
|
||||
FText::FromString(VersionToString(DLLVersion)));
|
||||
FMessageDialog::Open(EAppMsgType::Ok, VersionMessage);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::OpenCHM()
|
||||
{
|
||||
FString APIPath = FPaths::Combine(*FPaths::EngineDir(), TEXT("Plugins/FMODStudio/Docs/FMOD UE4 Integration.chm"));
|
||||
if( IFileManager::Get().FileSize( *APIPath ) != INDEX_NONE )
|
||||
{
|
||||
FString AbsoluteAPIPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*APIPath);
|
||||
FPlatformProcess::LaunchFileInDefaultExternalApplication(*AbsoluteAPIPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, NSLOCTEXT("Documentation", "CannotFindFMODIntegration", "Cannot open FMOD Studio Integration CHM reference; help file not found."));
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::OpenOnlineDocs()
|
||||
{
|
||||
FPlatformProcess::LaunchFileInDefaultExternalApplication(TEXT("http://www.fmod.org/documentation"));
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::OpenVideoTutorials()
|
||||
{
|
||||
FPlatformProcess::LaunchFileInDefaultExternalApplication(TEXT("http://www.youtube.com/user/FMODTV"));
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ValidateFMOD()
|
||||
{
|
||||
int ProblemsFound = 0;
|
||||
|
||||
FFMODStudioLink StudioLink;
|
||||
bool Connected = StudioLink.Connect();
|
||||
if (!Connected)
|
||||
{
|
||||
if (EAppReturnType::No == FMessageDialog::Open(EAppMsgType::YesNo, LOCTEXT("SetStudioBuildStudioNotRunning", "FMODStudio does not appear to be running. Only some validation will occur. Do you want to continue anyway?")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
unsigned int HeaderVersion = FMOD_VERSION;
|
||||
unsigned int DLLVersion = GetDLLVersion();
|
||||
unsigned int StudioVersion = 0;
|
||||
if (Connected)
|
||||
{
|
||||
FString StudioVersionString;
|
||||
if (StudioLink.Execute(TEXT("studio.version"), StudioVersionString))
|
||||
{
|
||||
int Super = 0;
|
||||
int Major = 0;
|
||||
int Minor = 0;
|
||||
sscanf(TCHAR_TO_UTF8(*StudioVersionString), "Version %x.%x.%x", &Super, &Major, &Minor);
|
||||
StudioVersion = (Super<<16) | (Major<<8) | Minor;
|
||||
}
|
||||
}
|
||||
if (StripPatch(HeaderVersion) != StripPatch(DLLVersion))
|
||||
{
|
||||
FText VersionMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_Status", "The FMOD DLL version is different to the version the integration was built against. This may cause problems running the game.\nBuilt Version: {0}\nDLL Version: {1}\n"),
|
||||
FText::FromString(VersionToString(HeaderVersion)),
|
||||
FText::FromString(VersionToString(DLLVersion)));
|
||||
FMessageDialog::Open(EAppMsgType::Ok, VersionMessage);
|
||||
ProblemsFound++;
|
||||
}
|
||||
if (StudioVersion > DLLVersion)
|
||||
{
|
||||
FText VersionMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_Version", "The Studio tool is newer than the version the integration was built against. The integration may not be able to load the banks that the tool builds.\n\nBuilt Version: {0}\nDLL Version: {1}\nStudio Version: {2}\n\nWe recommend using the Studio tool that matches the integration.\n\nDo you want to continue with the validation?"),
|
||||
FText::FromString(VersionToString(HeaderVersion)),
|
||||
FText::FromString(VersionToString(DLLVersion)),
|
||||
FText::FromString(VersionToString(StudioVersion)));
|
||||
if (EAppReturnType::No == FMessageDialog::Open(EAppMsgType::YesNo, VersionMessage))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ProblemsFound++;
|
||||
}
|
||||
|
||||
const UFMODSettings& Settings = *GetDefault<UFMODSettings>();
|
||||
FString FullBankPath = Settings.BankOutputDirectory.Path;
|
||||
if (FPaths::IsRelative(FullBankPath))
|
||||
{
|
||||
FullBankPath = FPaths::GameContentDir() / FullBankPath;
|
||||
}
|
||||
FString PlatformBankPath = Settings.GetFullBankPath();
|
||||
FullBankPath = FPaths::ConvertRelativePathToFull(FullBankPath);
|
||||
PlatformBankPath = FPaths::ConvertRelativePathToFull(PlatformBankPath);
|
||||
|
||||
if (Connected)
|
||||
{
|
||||
// File path was added in FMOD Studio 1.07.00
|
||||
FString StudioProjectPath;
|
||||
FString StudioProjectDir;
|
||||
if (StudioVersion >= 0x00010700)
|
||||
{
|
||||
StudioLink.Execute(TEXT("studio.project.filePath"), StudioProjectPath);
|
||||
if (StudioProjectPath.IsEmpty() || StudioProjectPath == TEXT("undefined"))
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_NewProject", "FMOD Studio has an empty project. Please go to FMOD Studio, and press Save to create your new project."));
|
||||
// Just try to save anyway
|
||||
FString Result;
|
||||
StudioLink.Execute(TEXT("studio.project.save()"), Result);
|
||||
}
|
||||
StudioLink.Execute(TEXT("studio.project.filePath"), StudioProjectPath);
|
||||
if (StudioProjectPath != TEXT("undefined"))
|
||||
{
|
||||
StudioProjectDir = FPaths::GetPath(StudioProjectPath);
|
||||
}
|
||||
}
|
||||
|
||||
FString StudioPathString;
|
||||
StudioLink.Execute(TEXT("studio.project.workspace.builtBanksOutputDirectory"), StudioPathString);
|
||||
if (StudioPathString == TEXT("undefined"))
|
||||
{
|
||||
StudioPathString = TEXT("");
|
||||
}
|
||||
|
||||
FString CanonicalBankPath = FullBankPath;
|
||||
FPaths::CollapseRelativeDirectories(CanonicalBankPath);
|
||||
FPaths::NormalizeDirectoryName(CanonicalBankPath);
|
||||
FPaths::RemoveDuplicateSlashes(CanonicalBankPath);
|
||||
FPaths::NormalizeDirectoryName(CanonicalBankPath);
|
||||
|
||||
FString CanonicalStudioPath = StudioPathString;
|
||||
if (FPaths::IsRelative(CanonicalStudioPath) && !StudioProjectDir.IsEmpty() && !StudioPathString.IsEmpty())
|
||||
{
|
||||
CanonicalStudioPath = FPaths::Combine(*StudioProjectDir, *CanonicalStudioPath);
|
||||
}
|
||||
FPaths::CollapseRelativeDirectories(CanonicalStudioPath);
|
||||
FPaths::NormalizeDirectoryName(CanonicalStudioPath);
|
||||
FPaths::RemoveDuplicateSlashes(CanonicalStudioPath);
|
||||
FPaths::NormalizeDirectoryName(CanonicalStudioPath);
|
||||
if (!FPaths::IsSamePath(CanonicalBankPath, CanonicalStudioPath))
|
||||
{
|
||||
FString BankPathToSet = FullBankPath;
|
||||
// Extra logic - if we have put the studio project inside the game project, then make it relative
|
||||
if (!StudioProjectDir.IsEmpty())
|
||||
{
|
||||
FString GameBaseDir = FPaths::ConvertRelativePathToFull(FPaths::GameDir());
|
||||
FString BankPathFromGameProject = FullBankPath;
|
||||
FString StudioProjectFromGameProject = StudioProjectDir;
|
||||
if (FPaths::MakePathRelativeTo(BankPathFromGameProject, *GameBaseDir) && !BankPathFromGameProject.Contains(TEXT("..")) &&
|
||||
FPaths::MakePathRelativeTo(StudioProjectFromGameProject, *GameBaseDir) && !StudioProjectFromGameProject.Contains(TEXT("..")))
|
||||
{
|
||||
FPaths::MakePathRelativeTo(BankPathToSet, *(StudioProjectDir + TEXT("/")));
|
||||
}
|
||||
}
|
||||
ProblemsFound++;
|
||||
|
||||
FText AskMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_Ask", "FMOD Studio build path should be set up.\n\nCurrent Studio build path: {0}\nNew build path: {1}\n\nDo you want to fix up the project now?"),
|
||||
FText::FromString(StudioPathString),
|
||||
FText::FromString(BankPathToSet));
|
||||
if (EAppReturnType::Yes == FMessageDialog::Open(EAppMsgType::YesNo, AskMessage))
|
||||
{
|
||||
FString Result;
|
||||
StudioLink.Execute(*FString::Printf(TEXT("studio.project.workspace.builtBanksOutputDirectory = \"%s\";"), *BankPathToSet), Result);
|
||||
StudioLink.Execute(TEXT("studio.project.workspace.builtBanksOutputDirectory"), Result);
|
||||
if (Result != BankPathToSet)
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_Save", "Failed to set bank directory. Please go to FMOD Studio, and set the bank path in FMOD Studio project settings."));
|
||||
}
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_Save", "Please go to FMOD Studio, save your project and build banks."));
|
||||
// Just try to do it again anyway
|
||||
StudioLink.Execute(TEXT("studio.project.save()"), Result);
|
||||
StudioLink.Execute(TEXT("studio.project.build()"), Result);
|
||||
// Pretend settings have changed which will force a reload
|
||||
IFMODStudioModule::Get().RefreshSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
bool AnyBankFiles = false;
|
||||
|
||||
if (!FPaths::DirectoryExists(FullBankPath) || !FPaths::DirectoryExists(PlatformBankPath))
|
||||
{
|
||||
FText DirMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_Dir", "The FMOD Content directory does not exist. Please make sure FMOD Studio is exporting banks into the correct location.\n\nBanks should be exported to: {0}\nBanks files should exist in: {1}\n"),
|
||||
FText::FromString(FullBankPath),
|
||||
FText::FromString(PlatformBankPath));
|
||||
FMessageDialog::Open(EAppMsgType::Ok, DirMessage);
|
||||
ProblemsFound++;
|
||||
}
|
||||
else
|
||||
{
|
||||
TArray<FString> BankFiles;
|
||||
Settings.GetAllBankPaths(BankFiles, true);
|
||||
if (BankFiles.Num() != 0)
|
||||
{
|
||||
AnyBankFiles = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FText EmptyBankDirMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_EmptyBankDir", "The FMOD Content directory does not have any bank files in them. Please make sure FMOD Studio is exporting banks into the correct location.\n\nBanks should be exported to: {0}\nBanks files should exist in: {1}\n"),
|
||||
FText::FromString(FullBankPath),
|
||||
FText::FromString(PlatformBankPath));
|
||||
FMessageDialog::Open(EAppMsgType::Ok, EmptyBankDirMessage);
|
||||
ProblemsFound++;
|
||||
}
|
||||
}
|
||||
if (AnyBankFiles)
|
||||
{
|
||||
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Auditioning);
|
||||
int BankCount = 0;
|
||||
StudioSystem->getBankCount(&BankCount);
|
||||
TArray<FString> FailedBanks = IFMODStudioModule::Get().GetFailedBankLoads(EFMODSystemContext::Auditioning);
|
||||
if (BankCount == 0 || FailedBanks.Num() != 0)
|
||||
{
|
||||
FString CombinedBanks;
|
||||
for (auto Bank : FailedBanks)
|
||||
{
|
||||
CombinedBanks += Bank;
|
||||
CombinedBanks += TEXT("\n");
|
||||
}
|
||||
FText BankLoadMessage;
|
||||
if (BankCount == 0 && FailedBanks.Num() == 0)
|
||||
{
|
||||
BankLoadMessage = LOCTEXT("SetStudioBuildStudio_BankLoad", "Failed to load banks\n");
|
||||
}
|
||||
else if (BankCount == 0)
|
||||
{
|
||||
BankLoadMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_BankLoad", "Failed to load banks:\n{0}\n"),
|
||||
FText::FromString(CombinedBanks));
|
||||
}
|
||||
else
|
||||
{
|
||||
BankLoadMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_BankLoad", "Some banks failed to load:\n{0}\n"),
|
||||
FText::FromString(CombinedBanks));
|
||||
}
|
||||
FMessageDialog::Open(EAppMsgType::Ok, BankLoadMessage);
|
||||
ProblemsFound++;
|
||||
}
|
||||
else
|
||||
{
|
||||
int TotalEventCount = 0;
|
||||
TArray<FMOD::Studio::Bank*> Banks;
|
||||
Banks.SetNum(BankCount);
|
||||
StudioSystem->getBankList(Banks.GetData(), BankCount, &BankCount);
|
||||
for (FMOD::Studio::Bank* Bank : Banks)
|
||||
{
|
||||
int EventCount = 0;
|
||||
Bank->getEventCount(&EventCount);
|
||||
TotalEventCount += EventCount;
|
||||
}
|
||||
if (TotalEventCount == 0)
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_NoEvents", "Banks have been loaded but they didn't have any events in them. Please make sure you have added some events to banks."));
|
||||
ProblemsFound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
TArray<FString> RequiredPlugins = IFMODStudioModule::Get().GetRequiredPlugins();
|
||||
if (RequiredPlugins.Num() != 0 && Settings.PluginFiles.Num() == 0)
|
||||
{
|
||||
FString CombinedPlugins;
|
||||
for (auto Name : RequiredPlugins)
|
||||
{
|
||||
CombinedPlugins += Name;
|
||||
CombinedPlugins += TEXT("\n");
|
||||
}
|
||||
FText PluginMessage = FText::Format(
|
||||
LOCTEXT("SetStudioBuildStudio_Plugins", "The banks require the following plugins, but no plugin filenames are listed in the settings:\n{0}\n"),
|
||||
FText::FromString(CombinedPlugins));
|
||||
FMessageDialog::Open(EAppMsgType::Ok, PluginMessage);
|
||||
ProblemsFound++;
|
||||
}
|
||||
|
||||
if (ProblemsFound)
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_FinishedBad", "Finished validation. Problems were detected.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("SetStudioBuildStudio_FinishedGood", "Finished validation. No problems detected.\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ReloadBanks()
|
||||
{
|
||||
// Pretend settings have changed which will force a reload
|
||||
IFMODStudioModule::Get().RefreshSettings();
|
||||
}
|
||||
|
||||
bool FFMODStudioEditorModule::Tick( float DeltaTime )
|
||||
{
|
||||
if (!bRegisteredComponentVisualizers && GUnrealEd != nullptr)
|
||||
{
|
||||
// Register component visualizers (GUnrealED is required for this, but not initialized before this module loads, so we have to wait until GUnrealEd is available)
|
||||
RegisterComponentVisualizer(UFMODAudioComponent::StaticClass()->GetFName(), MakeShareable(new FFMODAudioComponentVisualizer));
|
||||
|
||||
bRegisteredComponentVisualizers = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::BeginPIE(bool simulating)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule BeginPIE: %d"), simulating);
|
||||
bSimulating = simulating;
|
||||
bIsInPIE = true;
|
||||
IFMODStudioModule::Get().SetInPIE(true, simulating);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::EndPIE(bool simulating)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule EndPIE: %d"), simulating);
|
||||
bSimulating = false;
|
||||
bIsInPIE = false;
|
||||
IFMODStudioModule::Get().SetInPIE(false, simulating);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::PausePIE(bool simulating)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule PausePIE%d"));
|
||||
IFMODStudioModule::Get().SetSystemPaused(true);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ResumePIE(bool simulating)
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule ResumePIE"));
|
||||
IFMODStudioModule::Get().SetSystemPaused(false);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::PostLoadCallback()
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule PostLoadCallback"));
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ViewportDraw(UCanvas* Canvas, APlayerController*)
|
||||
{
|
||||
// Only want to update based on viewport in simulate mode.
|
||||
// In PIE/game, we update from the player controller instead.
|
||||
if (!bSimulating)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const FSceneView* View = Canvas->SceneView;
|
||||
|
||||
if (View->Drawer == GCurrentLevelEditingViewportClient)
|
||||
{
|
||||
UWorld* World = GCurrentLevelEditingViewportClient->GetWorld();
|
||||
const FVector& ViewLocation = GCurrentLevelEditingViewportClient->GetViewLocation();
|
||||
|
||||
FMatrix CameraToWorld = View->ViewMatrices.ViewMatrix.InverseFast();
|
||||
FVector ProjUp = CameraToWorld.TransformVector(FVector(0, 1000, 0));
|
||||
FVector ProjRight = CameraToWorld.TransformVector(FVector(1000, 0, 0));
|
||||
|
||||
FTransform ListenerTransform(FRotationMatrix::MakeFromZY(ProjUp, ProjRight));
|
||||
ListenerTransform.SetTranslation(ViewLocation);
|
||||
ListenerTransform.NormalizeRotation();
|
||||
|
||||
IFMODStudioModule::Get().SetListenerPosition(0, World, ListenerTransform, 0.0f);
|
||||
IFMODStudioModule::Get().FinishSetListenerPosition(1, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ShutdownModule()
|
||||
{
|
||||
UE_LOG(LogFMOD, Verbose, TEXT("FFMODStudioEditorModule shutdown"));
|
||||
|
||||
if (UObjectInitialized())
|
||||
{
|
||||
// Unregister tick function.
|
||||
FTicker::GetCoreTicker().RemoveTicker(TickDelegateHandle);
|
||||
|
||||
FEditorDelegates::BeginPIE.Remove(BeginPIEDelegateHandle);
|
||||
FEditorDelegates::EndPIE.Remove(EndPIEDelegateHandle);
|
||||
FEditorDelegates::PausePIE.Remove(PausePIEDelegateHandle);
|
||||
FEditorDelegates::ResumePIE.Remove(ResumePIEDelegateHandle);
|
||||
|
||||
if (ViewportDrawingDelegate.IsBound())
|
||||
{
|
||||
UDebugDrawService::Unregister(ViewportDrawingDelegateHandle);
|
||||
}
|
||||
|
||||
FComponentAssetBrokerage::UnregisterBroker(AssetBroker);
|
||||
|
||||
if (MainMenuExtender.IsValid())
|
||||
{
|
||||
FLevelEditorModule* LevelEditorModule = FModuleManager::GetModulePtr<FLevelEditorModule>( "LevelEditor" );
|
||||
if (LevelEditorModule)
|
||||
{
|
||||
LevelEditorModule->GetMenuExtensibilityManager()->RemoveExtender(MainMenuExtender);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings"))
|
||||
{
|
||||
SettingsModule->UnregisterSettings("Project", "Plugins", "FMODStudio");
|
||||
}
|
||||
|
||||
// Unregister AssetTypeActions
|
||||
if (FModuleManager::Get().IsModuleLoaded("AssetTools"))
|
||||
{
|
||||
IAssetTools& AssetTools = FModuleManager::GetModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
||||
|
||||
AssetTools.UnregisterAssetTypeActions(FMODEventAssetTypeActions.ToSharedRef());
|
||||
}
|
||||
|
||||
// Unregister component visualizers
|
||||
if (GUnrealEd != nullptr)
|
||||
{
|
||||
// Iterate over all class names we registered for
|
||||
for (FName ClassName : RegisteredComponentClassNames)
|
||||
{
|
||||
GUnrealEd->UnregisterComponentVisualizer(ClassName);
|
||||
}
|
||||
}
|
||||
|
||||
IFMODStudioModule::Get().BanksReloadedEvent().Remove(HandleBanksReloadedDelegateHandle);
|
||||
}
|
||||
|
||||
bool FFMODStudioEditorModule::HandleSettingsSaved()
|
||||
{
|
||||
IFMODStudioModule::Get().RefreshSettings();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::HandleBanksReloaded()
|
||||
{
|
||||
// Show a reload notification
|
||||
TArray<FString> FailedBanks = IFMODStudioModule::Get().GetFailedBankLoads(EFMODSystemContext::Auditioning);
|
||||
FText Message;
|
||||
SNotificationItem::ECompletionState State;
|
||||
if (FailedBanks.Num() == 0)
|
||||
{
|
||||
Message = LOCTEXT("FMODBanksReloaded", "Reloaded FMOD Banks\n");
|
||||
State = SNotificationItem::CS_Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
FString CombinedMessage = "Problem loading FMOD Banks:";
|
||||
for (auto Entry : FailedBanks)
|
||||
{
|
||||
CombinedMessage += TEXT("\n");
|
||||
CombinedMessage += Entry;
|
||||
|
||||
UE_LOG(LogFMOD, Warning, TEXT("Problem loading FMOD Bank: %s"), *Entry);
|
||||
}
|
||||
|
||||
Message = FText::Format(
|
||||
LOCTEXT("FMODBanksReloaded", "{0}"),
|
||||
FText::FromString(CombinedMessage));
|
||||
State = SNotificationItem::CS_Fail;
|
||||
}
|
||||
ShowNotification(Message, State);
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::ShowNotification(const FText& Text, SNotificationItem::ECompletionState State)
|
||||
{
|
||||
FNotificationInfo Info(Text);
|
||||
Info.Image = FEditorStyle::GetBrush(TEXT("NoBrush"));
|
||||
Info.FadeInDuration = 0.1f;
|
||||
Info.FadeOutDuration = 0.5f;
|
||||
Info.ExpireDuration = State == SNotificationItem::CS_Fail ? 6.0f : 1.5f;
|
||||
Info.bUseThrobber = false;
|
||||
Info.bUseSuccessFailIcons = true;
|
||||
Info.bUseLargeFont = true;
|
||||
Info.bFireAndForget = false;
|
||||
Info.bAllowThrottleWhenFrameRateIsLow = false;
|
||||
auto NotificationItem = FSlateNotificationManager::Get().AddNotification(Info);
|
||||
NotificationItem->SetCompletionState(State);
|
||||
NotificationItem->ExpireAndFadeout();
|
||||
|
||||
if (GCurrentLevelEditingViewportClient)
|
||||
{
|
||||
// Refresh any 3d event visualization
|
||||
GCurrentLevelEditingViewportClient->bNeedsRedraw = true;
|
||||
}
|
||||
}
|
||||
|
||||
void FFMODStudioEditorModule::RegisterComponentVisualizer(FName ComponentClassName, TSharedPtr<FComponentVisualizer> Visualizer)
|
||||
{
|
||||
if (GUnrealEd != nullptr)
|
||||
{
|
||||
GUnrealEd->RegisterComponentVisualizer(ComponentClassName, Visualizer);
|
||||
}
|
||||
|
||||
RegisteredComponentClassNames.Add(ComponentClassName);
|
||||
|
||||
if (Visualizer.IsValid())
|
||||
{
|
||||
Visualizer->OnRegister();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
#pragma once
|
||||
|
||||
#include "Engine.h"
|
||||
#include "UnrealEd.h"
|
||||
#include "Components/SceneComponent.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(LogFMOD, Log, All);
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "FMODStudioStyle.h"
|
||||
#include "SlateStyle.h"
|
||||
#include "EditorStyle.h"
|
||||
|
||||
#define IMAGE_BRUSH(RelativePath, ...) FSlateImageBrush(Style.RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__)
|
||||
#define BOX_BRUSH(RelativePath, ...) FSlateBoxBrush(Style.RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// FFMODStudioStyle
|
||||
|
||||
TSharedPtr<FSlateStyleSet> FFMODStudioStyle::StyleInstance = NULL;
|
||||
|
||||
void FFMODStudioStyle::Initialize()
|
||||
{
|
||||
if (!StyleInstance.IsValid())
|
||||
{
|
||||
StyleInstance = Create();
|
||||
}
|
||||
|
||||
SetStyle(StyleInstance.ToSharedRef());
|
||||
}
|
||||
|
||||
void FFMODStudioStyle::Shutdown()
|
||||
{
|
||||
ResetToDefault();
|
||||
ensure(StyleInstance.IsUnique());
|
||||
StyleInstance.Reset();
|
||||
}
|
||||
|
||||
TSharedRef<FSlateStyleSet> FFMODStudioStyle::Create()
|
||||
{
|
||||
IEditorStyleModule& EditorStyle = FModuleManager::LoadModuleChecked<IEditorStyleModule>(TEXT("EditorStyle"));
|
||||
TSharedRef< FSlateStyleSet > StyleRef = EditorStyle.CreateEditorStyleInstance();
|
||||
FSlateStyleSet& Style = StyleRef.Get();
|
||||
|
||||
const FVector2D Icon20x20(20.0f, 20.0f);
|
||||
const FVector2D Icon40x40(40.0f, 40.0f);
|
||||
|
||||
Style.Set( "ClassIcon.FMODAmbientSound", new IMAGE_BRUSH( "Icons/AssetIcons/AmbientSound_16x", FVector2D(16.0f, 16.0f) ) );
|
||||
Style.Set( "ClassThumbnail.FMODAmbientSound", new IMAGE_BRUSH( "Icons/AssetIcons/AmbientSound_64x", FVector2D(64.0f, 64.0f) ) );
|
||||
|
||||
Style.Set( "ClassIcon.FMODAudioComponent", new IMAGE_BRUSH( "Icons/ActorIcons/SoundActor_16x", FVector2D(16.0f, 16.0f) ) );
|
||||
//Style.Set( "ClassThumbnail.FMODAudioComponent", new IMAGE_BRUSH( "Icons/ActorIcons/SoundActor_64x", FVector2D(64.0f, 64.0f) ) );
|
||||
|
||||
Style.Set( "ClassIcon.FMODAsset", new IMAGE_BRUSH( "Icons/ActorIcons/SoundActor_16x", FVector2D(16.0f,16.0f) ) );
|
||||
//Style.Set( "ClassThumbnail.FMODAsset", new IMAGE_BRUSH( "Icons/ActorIcons/SoundActor_64x", FVector2D(64.0f, 64.0f) ) );
|
||||
|
||||
return StyleRef;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef IMAGE_BRUSH
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
class FFMODStudioStyle : public FEditorStyle
|
||||
{
|
||||
public:
|
||||
static void Initialize();
|
||||
|
||||
static void Shutdown();
|
||||
|
||||
private:
|
||||
static TSharedRef<class FSlateStyleSet> Create();
|
||||
|
||||
private:
|
||||
static TSharedPtr<class FSlateStyleSet> StyleInstance;
|
||||
|
||||
private:
|
||||
FFMODStudioStyle() {}
|
||||
};
|
|
@ -0,0 +1,375 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#include "FMODStudioEditorPrivatePCH.h"
|
||||
#include "SFMODEventEditorPanel.h"
|
||||
#include "FMODStudioModule.h"
|
||||
#include "FMODUtils.h"
|
||||
#include "Input/Reply.h"
|
||||
#include "SNumericEntryBox.h"
|
||||
#include "SExpandableArea.h"
|
||||
#include "fmod_studio.hpp"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FMODEventEditor"
|
||||
|
||||
SFMODEventEditorPanel::~SFMODEventEditorPanel()
|
||||
{
|
||||
}
|
||||
|
||||
void SFMODEventEditorPanel::Construct(const FArguments& InArgs)
|
||||
{
|
||||
FMODEventEditorPtr = InArgs._FMODEventEditor;
|
||||
|
||||
FMOD::Studio::EventDescription* EventDescription = FMODEventEditorPtr.Pin()->GetEventDescription();
|
||||
|
||||
TSharedRef<SBorder> ToolbarBorder = ConstructToolbar(EventDescription);
|
||||
TSharedRef<SExpandableArea> InfoArea = ConstructInfo(EventDescription);
|
||||
TSharedRef<SExpandableArea> ParametersArea = ConstructParameters(EventDescription);
|
||||
TSharedRef<SExpandableArea> UserPropertiesArea = ConstructUserProperties(EventDescription);
|
||||
|
||||
TSharedRef<SVerticalBox> ChildWidget =
|
||||
SNew(SVerticalBox)
|
||||
+ SVerticalBox::Slot()
|
||||
.AutoHeight()
|
||||
.Padding(0.0f, 3.0f)
|
||||
[
|
||||
InfoArea
|
||||
]
|
||||
+ SVerticalBox::Slot()
|
||||
.AutoHeight()
|
||||
.Padding(0.0f, 3.0f)
|
||||
[
|
||||
ParametersArea
|
||||
]
|
||||
+ SVerticalBox::Slot()
|
||||
.AutoHeight()
|
||||
.Padding(0.0f, 3.0f)
|
||||
[
|
||||
UserPropertiesArea
|
||||
];
|
||||
|
||||
ChildSlot
|
||||
[
|
||||
SNew(SVerticalBox)
|
||||
+ SVerticalBox::Slot()
|
||||
.AutoHeight()
|
||||
.Padding(0.0f, 3.0f)
|
||||
[
|
||||
ToolbarBorder
|
||||
]
|
||||
+ SVerticalBox::Slot()
|
||||
.FillHeight(1.0f)
|
||||
[
|
||||
SNew(SScrollBox)
|
||||
+ SScrollBox::Slot()
|
||||
.Padding(0.0f)
|
||||
[
|
||||
SNew(SVerticalBox)
|
||||
+ SVerticalBox::Slot()
|
||||
.AutoHeight()
|
||||
.Padding(0.0f)
|
||||
[
|
||||
ChildWidget
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
TSharedRef<SBorder> SFMODEventEditorPanel::ConstructToolbar(FMOD::Studio::EventDescription* EventDescription)
|
||||
{
|
||||
float MinDistance = 0.0f;
|
||||
float MaxDistance = 0.0f;
|
||||
int32 EventLengthMS = 0;
|
||||
bool bIsOneshot = false, bIsStream = false, bIs3D = false;
|
||||
if (EventDescription != nullptr)
|
||||
{
|
||||
EventDescription->getMinimumDistance(&MinDistance);
|
||||
EventDescription->getMaximumDistance(&MaxDistance);
|
||||
EventDescription->getLength(&EventLengthMS);
|
||||
EventDescription->isOneshot(&bIsOneshot);
|
||||
EventDescription->isStream(&bIsStream);
|
||||
EventDescription->is3D(&bIs3D);
|
||||
}
|
||||
|
||||
const FTimespan EventLength = FTimespan::FromMilliseconds((double)EventLengthMS);
|
||||
const FString EventLengthString = EventLength.GetHours() <= 0 ? EventLength.ToString(TEXT("%m:%s.%f")) : EventLength.ToString(TEXT("%h:%m:%s.%f"));
|
||||
|
||||
const FText RadiusText = FText::Format(LOCTEXT("RadiusFormat", "Distance Attenuation: {0}m to {1}m"), FText::AsNumber(MinDistance), FText::AsNumber(MaxDistance));
|
||||
const FText LengthText = FText::Format(LOCTEXT("LengthFormat", "Length: {0}"), FText::FromString(EventLengthString));
|
||||
|
||||
FText EventInfoText;
|
||||
if (bIs3D && bIsOneshot)
|
||||
{
|
||||
EventInfoText = FText::Format(LOCTEXT("RadiusLengthFormat", "{0} - {1}"), RadiusText, LengthText);
|
||||
}
|
||||
else if (!bIs3D && bIsOneshot)
|
||||
{
|
||||
EventInfoText = LengthText;
|
||||
}
|
||||
else if (bIs3D && !bIsOneshot)
|
||||
{
|
||||
EventInfoText = RadiusText;
|
||||
}
|
||||
|
||||
return SNew(SBorder)
|
||||
.BorderImage(FEditorStyle::Get().GetBrush("ToolPanel.GroupBorder"))
|
||||
.Padding(6.0f)
|
||||
.Content()
|
||||
[
|
||||
SNew(SHorizontalBox)
|
||||
+ SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding(0.0f, 0.0f, 2.0f, 0.0f)
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.VAlign(VAlign_Center)
|
||||
.Text(LOCTEXT("Play", "Play"))
|
||||
.ContentPadding(4)
|
||||
.OnClicked(this, &SFMODEventEditorPanel::OnClickedPlay)
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding(2.0f, 0.0f)
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.Text(LOCTEXT("Pause", "Pause"))
|
||||
.ContentPadding(4)
|
||||
.OnClicked(this, &SFMODEventEditorPanel::OnClickedPause)
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
.AutoWidth()
|
||||
.Padding(2.0f, 0.0f)
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Left)
|
||||
[
|
||||
SNew(SButton)
|
||||
.VAlign(VAlign_Center)
|
||||
.Text(LOCTEXT("Stop", "Stop"))
|
||||
.ContentPadding(4)
|
||||
.OnClicked(this, &SFMODEventEditorPanel::OnClickedStop)
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
.FillWidth(1.0f)
|
||||
.Padding(2.0f, 0.0f)
|
||||
.VAlign(VAlign_Center)
|
||||
.HAlign(HAlign_Right)
|
||||
[
|
||||
SNew(STextBlock)
|
||||
.Text(EventInfoText)
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
void AddTextField(TSharedRef<SVerticalBox>& InfoBox, const TCHAR* Name, const FText& Value)
|
||||
{
|
||||
InfoBox->AddSlot()
|
||||
.Padding(4.0f, 3.0f)
|
||||
[
|
||||
SNew(SHorizontalBox)
|
||||
+ SHorizontalBox::Slot()
|
||||
.FillWidth(0.3f)
|
||||
[
|
||||
SNew(STextBlock)
|
||||
.Text(FText::FromString(Name))
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
[
|
||||
SNew(SEditableText)
|
||||
.Text(Value)
|
||||
.IsReadOnly(true)
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
void AddBoolField(TSharedRef<SVerticalBox>& InfoBox, const TCHAR* Name, bool bValue)
|
||||
{
|
||||
AddTextField(InfoBox, Name, bValue ? LOCTEXT("True","True") : LOCTEXT("False","False"));
|
||||
}
|
||||
|
||||
void AddFloatField(TSharedRef<SVerticalBox>& InfoBox, const TCHAR* Name, float Value)
|
||||
{
|
||||
AddTextField(InfoBox, Name, FText::AsNumber(Value));
|
||||
}
|
||||
|
||||
TSharedRef<SExpandableArea> MakeBox(TSharedRef<SVerticalBox>& InfoBox, const FText& Value)
|
||||
{
|
||||
return SNew(SExpandableArea)
|
||||
.AreaTitle(Value)
|
||||
.InitiallyCollapsed(false)
|
||||
.BodyContent()
|
||||
[
|
||||
SNew(SBorder)
|
||||
.BorderImage(FCoreStyle::Get().GetBrush("NoBorder"))
|
||||
.Padding(4.0f)
|
||||
.Content()
|
||||
[
|
||||
InfoBox
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
TSharedRef<SExpandableArea> SFMODEventEditorPanel::ConstructInfo(FMOD::Studio::EventDescription* EventDescription)
|
||||
{
|
||||
TSharedRef<SVerticalBox> InfoBox = SNew(SVerticalBox);
|
||||
|
||||
if (EventDescription != nullptr)
|
||||
{
|
||||
FString EventPath = FMODUtils::GetPath(EventDescription);
|
||||
FGuid Guid = FMODUtils::GetID(EventDescription);
|
||||
|
||||
int Length = 0.0f;
|
||||
float MinDist = 0.0f;
|
||||
float MaxDist = 0.0f;
|
||||
EventDescription->getLength(&Length);
|
||||
EventDescription->getMinimumDistance(&MinDist);
|
||||
EventDescription->getMaximumDistance(&MaxDist);
|
||||
|
||||
bool bOneShot = false;
|
||||
bool bStream = false;
|
||||
bool b3D = false;
|
||||
EventDescription->isOneshot(&bOneShot);
|
||||
EventDescription->isStream(&bStream);
|
||||
EventDescription->is3D(&b3D);
|
||||
|
||||
AddTextField(InfoBox, TEXT("Path"), FText::FromString(EventPath));
|
||||
AddTextField(InfoBox, TEXT("Guid"), FText::FromString(Guid.ToString(EGuidFormats::DigitsWithHyphensInBraces)));
|
||||
AddBoolField(InfoBox, TEXT("OneShot"), bOneShot);
|
||||
AddBoolField(InfoBox, TEXT("Streaming"), bStream);
|
||||
AddBoolField(InfoBox, TEXT("3D"), b3D);
|
||||
|
||||
AddFloatField(InfoBox, TEXT("Length"), static_cast<float>(Length));
|
||||
if (b3D)
|
||||
{
|
||||
AddFloatField(InfoBox, TEXT("Min Dist"), MinDist);
|
||||
AddFloatField(InfoBox, TEXT("Max Dist"), MaxDist);
|
||||
}
|
||||
}
|
||||
|
||||
return MakeBox(InfoBox, LOCTEXT("EventInfo", "Event Info"));
|
||||
}
|
||||
|
||||
TSharedRef<SExpandableArea> SFMODEventEditorPanel::ConstructParameters(FMOD::Studio::EventDescription* EventDescription)
|
||||
{
|
||||
auto EventEditor = FMODEventEditorPtr.Pin();
|
||||
TSharedRef<SVerticalBox> ParametersBox = SNew(SVerticalBox);
|
||||
|
||||
FNumberFormattingOptions Options;
|
||||
Options.MinimumFractionalDigits = 1;
|
||||
|
||||
if (EventDescription != nullptr)
|
||||
{
|
||||
int32 ParameterCount;
|
||||
EventDescription->getParameterCount(&ParameterCount);
|
||||
for (int32 ParamIdx = 0; ParamIdx < ParameterCount; ParamIdx++)
|
||||
{
|
||||
FMOD_STUDIO_PARAMETER_DESCRIPTION Parameter;
|
||||
EventDescription->getParameterByIndex(ParamIdx, &Parameter);
|
||||
|
||||
EventEditor->GetParameterValues().Add(Parameter.minimum);
|
||||
|
||||
const FString ParameterName = Parameter.type == FMOD_STUDIO_PARAMETER_GAME_CONTROLLED ? FString(UTF8_TO_TCHAR(Parameter.name)) : FMODUtils::ParameterTypeToString(Parameter.type);
|
||||
const FText ToolTipText = FText::Format(LOCTEXT("ParameterTooltipFormat", "{0} (Min Value: {1} - Max Value: {2})"),
|
||||
FText::FromString(ParameterName), FText::AsNumber(Parameter.minimum, &Options), FText::AsNumber(Parameter.maximum, &Options));
|
||||
|
||||
ParametersBox->AddSlot()
|
||||
.Padding(4.0f, 2.0f)
|
||||
[
|
||||
SNew(SHorizontalBox)
|
||||
.ToolTipText(ToolTipText)
|
||||
+ SHorizontalBox::Slot()
|
||||
.FillWidth(0.3f)
|
||||
[
|
||||
SNew(STextBlock)
|
||||
.Text(FText::FromString(ParameterName))
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
.MaxWidth(200.0f)
|
||||
[
|
||||
SNew(SNumericEntryBox<float>)
|
||||
.Value(this, &SFMODEventEditorPanel::GetParameterValue, ParamIdx)
|
||||
.OnValueChanged(this, &SFMODEventEditorPanel::OnParameterValueChanged, ParamIdx)
|
||||
.AllowSpin(true)
|
||||
.MinValue(Parameter.minimum)
|
||||
.MaxValue(Parameter.maximum)
|
||||
.MinSliderValue(Parameter.minimum)
|
||||
.MaxSliderValue(Parameter.maximum)
|
||||
.Delta(0.01f)
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return MakeBox(ParametersBox, LOCTEXT("EventParameters", "Event Parameters"));
|
||||
}
|
||||
|
||||
TSharedRef<SExpandableArea> SFMODEventEditorPanel::ConstructUserProperties(FMOD::Studio::EventDescription* EventDescription)
|
||||
{
|
||||
TSharedRef<SVerticalBox> UserPropertiesBox = SNew(SVerticalBox);
|
||||
|
||||
if (EventDescription != nullptr)
|
||||
{
|
||||
int32 UserPropertyCount;
|
||||
EventDescription->getUserPropertyCount(&UserPropertyCount);
|
||||
for (int32 PropertyIdx = 0; PropertyIdx < UserPropertyCount; PropertyIdx++)
|
||||
{
|
||||
FMOD_STUDIO_USER_PROPERTY UserProperty;
|
||||
EventDescription->getUserPropertyByIndex(PropertyIdx, &UserProperty);
|
||||
|
||||
FText PropertyText;
|
||||
switch (UserProperty.type)
|
||||
{
|
||||
case FMOD_STUDIO_USER_PROPERTY_TYPE_INTEGER:
|
||||
PropertyText = FText::AsNumber(UserProperty.intValue);
|
||||
break;
|
||||
case FMOD_STUDIO_USER_PROPERTY_TYPE_BOOLEAN:
|
||||
PropertyText = UserProperty.boolValue ? LOCTEXT("True", "True") : LOCTEXT("False", "False");
|
||||
break;
|
||||
case FMOD_STUDIO_USER_PROPERTY_TYPE_FLOAT:
|
||||
PropertyText = FText::AsNumber(UserProperty.floatValue);
|
||||
break;
|
||||
case FMOD_STUDIO_USER_PROPERTY_TYPE_STRING:
|
||||
PropertyText = FText::FromString(UTF8_TO_TCHAR(UserProperty.stringValue));
|
||||
break;
|
||||
}
|
||||
|
||||
FString UserName(UTF8_TO_TCHAR(UserProperty.name));
|
||||
AddTextField(UserPropertiesBox, *UserName, PropertyText);
|
||||
}
|
||||
}
|
||||
|
||||
return MakeBox(UserPropertiesBox, LOCTEXT("EventUserProperties", "Event User Properties"));
|
||||
}
|
||||
|
||||
FReply SFMODEventEditorPanel::OnClickedPlay()
|
||||
{
|
||||
FMODEventEditorPtr.Pin()->PlayEvent();
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
FReply SFMODEventEditorPanel::OnClickedStop()
|
||||
{
|
||||
FMODEventEditorPtr.Pin()->StopEvent();
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
FReply SFMODEventEditorPanel::OnClickedPause()
|
||||
{
|
||||
FMODEventEditorPtr.Pin()->PauseEvent();
|
||||
return FReply::Handled();
|
||||
}
|
||||
|
||||
void SFMODEventEditorPanel::OnParameterValueChanged(float NewValue, int32 ParameterIdx)
|
||||
{
|
||||
FMODEventEditorPtr.Pin()->SetParameterValue(ParameterIdx, NewValue);
|
||||
}
|
||||
|
||||
TOptional<float> SFMODEventEditorPanel::GetParameterValue(int32 ParameterIdx) const
|
||||
{
|
||||
return FMODEventEditorPtr.Pin()->GetParameterValues()[ParameterIdx];
|
||||
}
|
||||
|
||||
#undef LOC_NAMESPACE
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FMODEventEditor.h"
|
||||
|
||||
namespace FMOD
|
||||
{
|
||||
namespace Studio
|
||||
{
|
||||
class EventDescription;
|
||||
}
|
||||
}
|
||||
|
||||
class SFMODEventEditorPanel : public SCompoundWidget
|
||||
{
|
||||
public:
|
||||
|
||||
SLATE_BEGIN_ARGS(SFMODEventEditorPanel)
|
||||
{}
|
||||
SLATE_ARGUMENT(TWeakPtr<FFMODEventEditor>, FMODEventEditor)
|
||||
SLATE_END_ARGS()
|
||||
|
||||
~SFMODEventEditorPanel();
|
||||
|
||||
/** SCompoundWidget interface */
|
||||
void Construct(const FArguments& InArgs);
|
||||
|
||||
private:
|
||||
|
||||
TSharedRef<SBorder> ConstructToolbar(FMOD::Studio::EventDescription* EventDescription);
|
||||
TSharedRef<SExpandableArea> ConstructInfo(FMOD::Studio::EventDescription* EventDescription);
|
||||
TSharedRef<SExpandableArea> ConstructParameters(FMOD::Studio::EventDescription* EventDescription);
|
||||
TSharedRef<SExpandableArea> ConstructUserProperties(FMOD::Studio::EventDescription* EventDescription);
|
||||
|
||||
/** Editor that owns this panel */
|
||||
TWeakPtr<FFMODEventEditor> FMODEventEditorPtr;
|
||||
|
||||
FReply OnClickedPlay();
|
||||
FReply OnClickedStop();
|
||||
FReply OnClickedPause();
|
||||
|
||||
TOptional<float> GetParameterValue(int32 ParameterIdx) const;
|
||||
void OnParameterValueChanged(float NewValue, int32 ParameterIdx);
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c), Firelight Technologies Pty, Ltd. 2012-2016.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ModuleManager.h"
|
||||
|
||||
/**
|
||||
* The public interface to this module
|
||||
*/
|
||||
class IFMODStudioEditorModule : public IModuleInterface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Singleton-like access to this module's interface. This is just for convenience!
|
||||
* Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
|
||||
*
|
||||
* @return Returns singleton instance, loading the module on demand if needed
|
||||
*/
|
||||
static inline IFMODStudioEditorModule& Get()
|
||||
{
|
||||
return FModuleManager::LoadModuleChecked< IFMODStudioEditorModule >( "FMODStudioEditor" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
|
||||
*
|
||||
* @return True if the module is loaded and ready to use
|
||||
*/
|
||||
static inline bool IsAvailable()
|
||||
{
|
||||
return FModuleManager::Get().IsModuleLoaded( "FMODStudioEditor" );
|
||||
}
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"FileVersion": 3,
|
||||
"Version": 1,
|
||||
"VersionName": "1.0",
|
||||
"FriendlyName": "Mantis Plugin",
|
||||
"Description": "A plugin to add an interface in Unreal for Mantis bug reports.",
|
||||
"Category": "Bugs",
|
||||
"CreatedBy": "Yoshi van Belkom",
|
||||
"CreatedByURL": "http://www.yoshivanbelkom.com/",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "Mantis",
|
||||
"Type": "Developer",
|
||||
"LoadingPhase": "PreDefault"
|
||||
}
|
||||
],
|
||||
"EnabledByDefault": true,
|
||||
"CanContainContent": true,
|
||||
"IsBetaVersion": true,
|
||||
"Installed": false
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
#include "Engine/EngineTypes.h"
|
||||
#include "MantisSettings.generated.h"
|
||||
|
||||
USTRUCT()
|
||||
struct FBatchBinding
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
/* Initialize the struct using a string from the config file. */
|
||||
FBatchBinding( FString& InString )
|
||||
{
|
||||
FString CleanString = InString.Mid( 1, InString.Len() - 2 );
|
||||
|
||||
TArray<FString> VariableStrings;
|
||||
CleanString.ParseIntoArray( VariableStrings, TEXT(",") );
|
||||
|
||||
TMap<FString, FString> Variables;
|
||||
for ( int32 i = 0; i < VariableStrings.Num(); i++ )
|
||||
{
|
||||
TArray<FString> VariableString;
|
||||
VariableStrings[i].ParseIntoArray( VariableString, TEXT( "=" ) );
|
||||
if ( VariableString.Num() != 2 ) continue;
|
||||
Variables.Add( VariableString[0], VariableString[1].TrimQuotes() );
|
||||
}
|
||||
|
||||
FString* FieldIDValue = Variables.Find( "FieldID" );
|
||||
if ( FieldIDValue != nullptr ) FieldID = *FieldIDValue;
|
||||
FString* BatchPathValue = Variables.Find( "BatchPath" );
|
||||
if ( BatchPathValue != nullptr ) BatchPath = *BatchPathValue;
|
||||
}
|
||||
|
||||
/* Default constructor. */
|
||||
FBatchBinding() {}
|
||||
|
||||
/*
|
||||
* The ID of the field.
|
||||
* e.g. category_id
|
||||
*/
|
||||
UPROPERTY( Config, EditAnywhere )
|
||||
FString FieldID;
|
||||
|
||||
/*
|
||||
* The path to the batch script. This is can be a relative path from the project folder (where the .uproject is located) or an absolute path.
|
||||
* Relative e.g. /Scripts/GetCategory.bat
|
||||
* Absolute e.g. C:/Perforce/Scripts/GetCategory.bat
|
||||
*/
|
||||
UPROPERTY( Config, EditAnywhere )
|
||||
FString BatchPath;
|
||||
};
|
||||
|
||||
UCLASS(config=Engine)
|
||||
class UMantisSettings : public UObject
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
public:
|
||||
/*
|
||||
* This is the root url of the Mantis.
|
||||
* e.g. if the login url is: http://bugs.yourdomain.com/login_page.php
|
||||
* this would be http://bugs.youdomain.com/
|
||||
*/
|
||||
UPROPERTY( Config, EditAnywhere, Category = General )
|
||||
FString HostURL;
|
||||
|
||||
/*
|
||||
* A list of batch scrips you want to use to load data for certain fields in the crash report.
|
||||
*/
|
||||
UPROPERTY( Config, EditAnywhere, Category = Advanced )
|
||||
TArray<FBatchBinding> ScriptBindings;
|
||||
};
|
|
@ -0,0 +1,29 @@
|
|||
//////////////////////////////////////////
|
||||
// Author: Yoshi van Belkom - 130118
|
||||
//////////////////////////////////////////
|
||||
// The Mantis Editor Module Settings.
|
||||
//////////////////////////////////////////
|
||||
|
||||
namespace UnrealBuildTool.Rules
|
||||
{
|
||||
public class Mantis : ModuleRules
|
||||
{
|
||||
public Mantis(TargetInfo Target)
|
||||
{
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[] {
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"UnrealEd"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePathModuleNames.AddRange(
|
||||
new string[] {
|
||||
"Settings"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,332 @@
|
|||
// Project Lab - NHTV IGAD
|
||||
//////////////////////////////////////////
|
||||
// Author: Yoshi van Belkom - 130118
|
||||
//////////////////////////////////////////
|
||||
|
||||
#include "MantisPrivatePCH.h"
|
||||
#include "ISettingsModule.h"
|
||||
#include "MantisSettings.h"
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#if PLATFORM_WINDOWS
|
||||
#include <Winver.h>
|
||||
#pragma comment( lib, "version.lib" )
|
||||
#endif
|
||||
|
||||
//defines
|
||||
#define LOCTEXT_NAMESPACE "Mantis"
|
||||
#define STRINGIZE_(x) #x
|
||||
#define STRINGIZE(x) STRINGIZE_(x)
|
||||
#define PlatformFile FPlatformFileManager::Get().GetPlatformFile()
|
||||
|
||||
class FMantis : public IMantis
|
||||
{
|
||||
public:
|
||||
/* IModuleInterface implementation */
|
||||
virtual void StartupModule() override;
|
||||
virtual void ShutdownModule() override;
|
||||
/* End IModuleInterface implementation */
|
||||
FString GetEngineCrashClientPath();
|
||||
FString GetMantisCrashClientPath();
|
||||
void RegisterSettings();
|
||||
void UnregisterSettings();
|
||||
int32 IsMantisExe( FString FilePath );
|
||||
void UpdateMantis();
|
||||
bool MakeBackup( FString Original, FString Backup, bool bOverwrite = false );
|
||||
};
|
||||
|
||||
DEFINE_LOG_CATEGORY(LogMantis);
|
||||
|
||||
//Get the path of the Engine Crash Report
|
||||
FString FMantis::GetEngineCrashClientPath()
|
||||
{
|
||||
//Get Engine root path.
|
||||
FString EnginePath = FPaths::RootDir();
|
||||
FPaths::NormalizeDirectoryName(EnginePath);
|
||||
TArray< FString > EnginePathDirs;
|
||||
EnginePath.ParseIntoArray(EnginePathDirs, TEXT("/"), 1);
|
||||
|
||||
//Get the path to the CrashReportClient.exe
|
||||
FString EngineCrashClientPath;
|
||||
EnginePathDirs.Push(TEXT("Engine"));
|
||||
EnginePathDirs.Push(TEXT("Binaries"));
|
||||
EnginePathDirs.Push(TEXT("Win64"));
|
||||
EnginePathDirs.Push(TEXT("CrashReportClient.exe"));
|
||||
EngineCrashClientPath = FString::Join(EnginePathDirs, TEXT("/"));
|
||||
|
||||
//Check if file exists.
|
||||
if (FPaths::FileExists(EngineCrashClientPath))
|
||||
{
|
||||
UE_LOG(LogMantis, Log, TEXT("Engine Crash Report file found!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogMantis, Warning, TEXT("Engine Crash Report file not found!"));
|
||||
}
|
||||
|
||||
return EngineCrashClientPath;
|
||||
}
|
||||
|
||||
FString FMantis::GetMantisCrashClientPath()
|
||||
{
|
||||
//Get the path of the Project File
|
||||
FString ProjectPath = FPaths::GetPath( FPaths::GetProjectFilePath() );
|
||||
FPaths::NormalizeDirectoryName( ProjectPath );
|
||||
//Get the path to the Mantis Crash Report
|
||||
TArray< FString > ProjectPathDirs;
|
||||
ProjectPath.ParseIntoArray( ProjectPathDirs, TEXT( "/" ), 1 );
|
||||
FString MantisCrashClientPath;
|
||||
ProjectPathDirs.Push( TEXT( "Plugins" ) );
|
||||
ProjectPathDirs.Push( TEXT( "Mantis" ) );
|
||||
ProjectPathDirs.Push( TEXT( "Resources" ) );
|
||||
ProjectPathDirs.Push( TEXT( "CrashReporter" ) );
|
||||
ProjectPathDirs.Push( TEXT( STRINGIZE( ENGINE_MAJOR_VERSION ) "." STRINGIZE( ENGINE_MINOR_VERSION ) ) );
|
||||
#if PLATFORM_64BITS
|
||||
ProjectPathDirs.Push( TEXT( "Win64" ) );
|
||||
#else
|
||||
ProjectPathDirs.Push( TEXT( "Win32" ) );
|
||||
#endif
|
||||
ProjectPathDirs.Push( TEXT( "CrashReportClient.exe" ) );
|
||||
MantisCrashClientPath = FString::Join( ProjectPathDirs, TEXT( "/" ) );
|
||||
return MantisCrashClientPath;
|
||||
}
|
||||
|
||||
void FMantis::RegisterSettings()
|
||||
{
|
||||
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
|
||||
|
||||
if (SettingsModule != nullptr)
|
||||
{
|
||||
SettingsModule->RegisterSettings("Project", "Plugins", "MantisPlugin",
|
||||
LOCTEXT("MantisSettingsName", "Mantis Plugin"),
|
||||
LOCTEXT("MantisSettingsDescription", "Set the setting for the Mantis Plugin."),
|
||||
GetMutableDefault<UMantisSettings>()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogMantis, Log, TEXT("SettingsModule is null!"));
|
||||
}
|
||||
}
|
||||
|
||||
void FMantis::UnregisterSettings()
|
||||
{
|
||||
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
|
||||
if (SettingsModule != nullptr)
|
||||
{
|
||||
SettingsModule->UnregisterSettings("Project", "Plugins", "MantisPlugin");
|
||||
}
|
||||
}
|
||||
|
||||
void FMantis::UpdateMantis()
|
||||
{
|
||||
//Get the path of the Engine Crash Report
|
||||
FString EngineCrashClientPath = GetEngineCrashClientPath();
|
||||
FString EngineCrashClientBackupPath = EngineCrashClientPath + ".ue";
|
||||
FString EngineCrashClientTmpPath = EngineCrashClientPath + ".tmp";
|
||||
|
||||
//Get the path to the Mantis Crash Report
|
||||
FString MantisCrashClientPath = GetMantisCrashClientPath();
|
||||
UE_LOG( LogMantis, Log, TEXT( "MantisCrashClientPath: %s" ), *MantisCrashClientPath );
|
||||
if ( FPaths::FileExists( MantisCrashClientPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Mantis Crash Report file found!" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Mantis Crash Report file not found!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Removing the read-only tag
|
||||
PlatformFile.SetReadOnly( *EngineCrashClientPath, false );
|
||||
|
||||
if ( IsMantisExe( EngineCrashClientPath ) == 1 )
|
||||
{
|
||||
FDateTime EngineTimestamp = PlatformFile.GetTimeStamp( *EngineCrashClientPath );
|
||||
FDateTime MantisTimestamp = PlatformFile.GetTimeStamp( *MantisCrashClientPath );
|
||||
if ( EngineTimestamp >= MantisTimestamp )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Crash Report Client is up-to-date!" ) );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Crash Report Client is out-of-date!" ) );
|
||||
}
|
||||
}
|
||||
|
||||
//Make temporary backup
|
||||
if ( !MakeBackup( EngineCrashClientPath, EngineCrashClientTmpPath, true ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Couldn't make temporary Crash Report Client backup!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Delete current file.
|
||||
if ( !PlatformFile.DeleteFile( *EngineCrashClientPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Failed to delete the current Crash Report Client." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Copy file if out of date.
|
||||
if ( PlatformFile.CopyFile( *EngineCrashClientPath, *MantisCrashClientPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Crash Report Client is updated!" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 errorNum = FPlatformMisc::GetLastError();
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Failed to update Crash Report Client! (Error: %i)" ), errorNum );
|
||||
|
||||
if ( PlatformFile.CopyFile( *EngineCrashClientPath, *EngineCrashClientPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Restored Crash Report Client." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
errorNum = FPlatformMisc::GetLastError();
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Failed to restore Crash Report Client! (Error: %i)" ), errorNum );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//Delete temporary backup file.
|
||||
if ( !PlatformFile.DeleteFile( *EngineCrashClientTmpPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Failed to delete the current Crash Report Client." ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Removing the read-only tag
|
||||
PlatformFile.SetReadOnly( *EngineCrashClientPath, false );
|
||||
}
|
||||
|
||||
bool FMantis::MakeBackup( FString Original, FString Backup, bool bOverwrite )
|
||||
{
|
||||
//Delete backup if it already exists.
|
||||
if ( bOverwrite && FPaths::FileExists( Backup ) )
|
||||
{
|
||||
PlatformFile.DeleteFile( *Backup );
|
||||
}
|
||||
|
||||
//Make backup.
|
||||
if ( PlatformFile.CopyFile( *Backup, *Original ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Made a backup." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 errorNum = FPlatformMisc::GetLastError();
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Original path: %s" ), *Original );
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Backup path: %s" ), *Backup );
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Failed to make a backup! (Error: %i)" ), errorNum );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void FMantis::StartupModule()
|
||||
{
|
||||
//Register the settings in the editor.
|
||||
RegisterSettings();
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
//Get the path of the Engine Crash Report
|
||||
FString EngineCrashClientPath = GetEngineCrashClientPath();
|
||||
FString EngineCrashClientBackupPath = EngineCrashClientPath + ".ue";
|
||||
|
||||
int32 Result = IsMantisExe( EngineCrashClientPath );
|
||||
if ( Result == 1 )
|
||||
{
|
||||
UpdateMantis();
|
||||
}
|
||||
else if ( Result == 0 )
|
||||
{
|
||||
MakeBackup( EngineCrashClientPath, EngineCrashClientBackupPath, true );
|
||||
UpdateMantis();
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void FMantis::ShutdownModule()
|
||||
{
|
||||
//Unregister the settings in the editor.
|
||||
UnregisterSettings();
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
//Get the path of the Engine Crash Report
|
||||
FString EngineCrashClientPath = GetEngineCrashClientPath();
|
||||
FString EngineCrashClientBackupPath = EngineCrashClientPath + ".ue";
|
||||
|
||||
//Can't restore if there is no backup.
|
||||
if ( !FPaths::FileExists( EngineCrashClientBackupPath ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Backup file not found!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Check if backup is valid
|
||||
if ( IsMantisExe( EngineCrashClientBackupPath ) == 1 )
|
||||
{
|
||||
UE_LOG( LogMantis, Warning, TEXT( "Backup file is not from Unreal!" ) );
|
||||
return;
|
||||
}
|
||||
|
||||
//Check if client is valid
|
||||
int32 Result = IsMantisExe( EngineCrashClientPath );
|
||||
if ( Result == 1 )
|
||||
{
|
||||
MakeBackup( EngineCrashClientBackupPath, EngineCrashClientPath, true );
|
||||
}
|
||||
#endif
|
||||
// This function may be called during shutdown to clean up the module. For modules that support dynamic reloading,
|
||||
// this function gets called before unloading the module.
|
||||
}
|
||||
|
||||
int32 FMantis::IsMantisExe( FString FilePath )
|
||||
{
|
||||
#if PLATFORM_WINDOWS
|
||||
// get the filename of the executable containing the version resource
|
||||
LPWSTR FilePathW = (WCHAR*) *FilePath;
|
||||
|
||||
// allocate a block of memory for the version info
|
||||
uint32 dummy;
|
||||
uint32 dwSize = GetFileVersionInfoSize( FilePathW, (LPDWORD)&dummy );
|
||||
if ( dwSize == 0 )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "GetFileVersionInfoSize failed with error %d\n" ), FPlatformMisc::GetLastError() );
|
||||
return -1;
|
||||
}
|
||||
|
||||
TArray<BYTE> data;
|
||||
data.SetNum( dwSize );
|
||||
// load the version info
|
||||
if ( !GetFileVersionInfo( FilePathW, NULL, dwSize, &data[0] ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "GetFileVersionInfo failed with error %d\n" ), FPlatformMisc::GetLastError() );
|
||||
return -1;
|
||||
}
|
||||
|
||||
LPVOID pvFileDescription = NULL;
|
||||
uint32 FileDescriptionLen = 0;
|
||||
|
||||
if ( !VerQueryValue( &data[0], _T( "\\StringFileInfo\\040904b0\\FileDescription" ), &pvFileDescription, &FileDescriptionLen ) )
|
||||
{
|
||||
UE_LOG( LogMantis, Log, TEXT( "Can't obtain ProductName and ProductVersion from resources\n" ) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
FString MantisClientName = TEXT( "MantisCrashReportClient" );
|
||||
TCHAR* ClientNameW = (TCHAR*)pvFileDescription;
|
||||
FString ClientName = ClientNameW;
|
||||
return ( ClientName == MantisClientName ) ? 1 : 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
IMPLEMENT_MODULE( FMantis, Mantis )
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
|
@ -0,0 +1,12 @@
|
|||
// Project Lab - NHTV IGAD
|
||||
//////////////////////////////////////////
|
||||
// Author: Yoshi van Belkom - 130118
|
||||
//////////////////////////////////////////
|
||||
// The Mantis Module Pre Compiled Header.
|
||||
//////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IMantis.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(LogMantis, Log, All);
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "MantisPrivatePCH.h"
|
||||
#include "MantisSettings.h"
|
||||
|
||||
UMantisSettings::UMantisSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer), HostURL(TEXT(""))
|
||||
{}
|
|
@ -0,0 +1,27 @@
|
|||
// Project Lab - NHTV IGAD
|
||||
//////////////////////////////////////////
|
||||
// Author: Yoshi van Belkom - 130118
|
||||
//////////////////////////////////////////
|
||||
// The Mantis Editor Module Interface.
|
||||
//////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ModuleManager.h"
|
||||
|
||||
class IMantis : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
//Function to Get the Singleton of this Module if it's loaded.
|
||||
static inline IMantis& Get()
|
||||
{
|
||||
return FModuleManager::LoadModuleChecked< IMantis >( "Mantis" );
|
||||
}
|
||||
|
||||
//Function to check if the Module is loaded.
|
||||
static inline bool IsAvailable()
|
||||
{
|
||||
return FModuleManager::Get().IsModuleLoaded( "Mantis" );
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"FileVersion": 3,
|
||||
"Version": 1,
|
||||
"VersionName": "1.0",
|
||||
"FriendlyName": "Polish Buildings",
|
||||
"Description": "A plugin to polish the buildings.",
|
||||
"Category": "2D",
|
||||
"CreatedBy": "Yoshi van Belkom",
|
||||
"CreatedByURL": "http://www.yoshivanbelkom.com/",
|
||||
"DocsURL": "",
|
||||
"MarketplaceURL": "",
|
||||
"SupportURL": "",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "PolishBuildings",
|
||||
"Type": "Editor",
|
||||
"LoadingPhase": "PreDefault"
|
||||
}
|
||||
],
|
||||
"EnabledByDefault": false,
|
||||
"CanContainContent": true,
|
||||
"IsBetaVersion": false,
|
||||
"Installed": false
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
|
@ -0,0 +1,54 @@
|
|||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class PolishBuildings : ModuleRules
|
||||
{
|
||||
public PolishBuildings(TargetInfo Target)
|
||||
{
|
||||
PrivateIncludePaths.AddRange(
|
||||
new string[] {
|
||||
"Private",
|
||||
"Private/PolishBuildingsTool",
|
||||
"Private/BuildingsProxyTool"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateIncludePathModuleNames.AddRange(
|
||||
new string[] {
|
||||
"AssetRegistry",
|
||||
"ContentBrowser",
|
||||
"Documentation",
|
||||
"LevelEditor",
|
||||
"MeshUtilities",
|
||||
"PropertyEditor",
|
||||
"RawMesh",
|
||||
"WorkspaceMenuStructure"
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[] {
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"InputCore",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"EditorStyle",
|
||||
"UnrealEd",
|
||||
}
|
||||
);
|
||||
|
||||
DynamicallyLoadedModuleNames.AddRange(
|
||||
new string[] {
|
||||
"AssetRegistry",
|
||||
"ContentBrowser",
|
||||
"Documentation",
|
||||
"LevelEditor",
|
||||
"MeshUtilities",
|
||||
"PropertyEditor"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "PolishBuildingsPrivatePCH.h"
|
||||
#include "BuildingsProxyTool.h"
|
||||
#include "SBuildingsProxyDialog.h"
|
||||
#include "MeshUtilities.h"
|
||||
#include "ContentBrowserModule.h"
|
||||
#include "AssetRegistryModule.h"
|
||||
#include "Engine/StaticMeshActor.h"
|
||||
#include "Engine/StaticMesh.h"
|
||||
#include "Engine/Selection.h"
|
||||
|
||||
|
||||
#define LOCTEXT_NAMESPACE "BuildingsProxyTool"
|
||||
|
||||
|
||||
TSharedRef<SWidget> FBuildingsProxyTool::GetWidget()
|
||||
{
|
||||
return SNew(SBuildingsProxyDialog, this);
|
||||
}
|
||||
|
||||
|
||||
FText FBuildingsProxyTool::GetTooltipText() const
|
||||
{
|
||||
return LOCTEXT("BuildingsProxyToolTooltip", "Harvest geometry from selected actors and merge them into single mesh.");
|
||||
}
|
||||
|
||||
|
||||
FString FBuildingsProxyTool::GetDefaultPackageName() const
|
||||
{
|
||||
FString PackageName;
|
||||
|
||||
USelection* SelectedActors = GEditor->GetSelectedActors();
|
||||
|
||||
// Iterate through selected actors and find first static mesh asset
|
||||
// Use this static mesh path as destination package name for a merged mesh
|
||||
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
|
||||
{
|
||||
AActor* Actor = Cast<AActor>(*Iter);
|
||||
if (Actor)
|
||||
{
|
||||
TInlineComponentArray<UStaticMeshComponent*> SMComponets;
|
||||
Actor->GetComponents<UStaticMeshComponent>(SMComponets);
|
||||
for (UStaticMeshComponent* Component : SMComponets)
|
||||
{
|
||||
if (Component->StaticMesh)
|
||||
{
|
||||
PackageName = FPackageName::GetLongPackagePath(Component->StaticMesh->GetOutermost()->GetName());
|
||||
PackageName += FString(TEXT("/PROXY_")) + Component->StaticMesh->GetName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!PackageName.IsEmpty())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (PackageName.IsEmpty())
|
||||
{
|
||||
PackageName = FPackageName::FilenameToLongPackageName(FPaths::GameContentDir() + TEXT("PROXY"));
|
||||
PackageName = MakeUniqueObjectName(NULL, UPackage::StaticClass(), *PackageName).ToString();
|
||||
}
|
||||
|
||||
return PackageName;
|
||||
}
|
||||
|
||||
|
||||
bool FBuildingsProxyTool::RunMerge(const FString& PackageName)
|
||||
{
|
||||
TArray<AActor*> Actors;
|
||||
TArray<UObject*> AssetsToSync;
|
||||
|
||||
//Get the module for the proxy mesh utilities
|
||||
IMeshUtilities& MeshUtilities = FModuleManager::Get().LoadModuleChecked<IMeshUtilities>("MeshUtilities");
|
||||
|
||||
USelection* SelectedActors = GEditor->GetSelectedActors();
|
||||
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter)
|
||||
{
|
||||
AActor* Actor = Cast<AActor>(*Iter);
|
||||
if (Actor)
|
||||
{
|
||||
Actors.Add(Actor);
|
||||
}
|
||||
}
|
||||
|
||||
if (Actors.Num())
|
||||
{
|
||||
GWarn->BeginSlowTask(LOCTEXT("BuildingsProxy_CreatingProxy", "Creating Mesh Proxy"), true);
|
||||
GEditor->BeginTransaction(LOCTEXT("BuildingsProxy_Create", "Creating Mesh Proxy"));
|
||||
|
||||
FVector ProxyLocation = FVector::ZeroVector;
|
||||
|
||||
FCreateProxyDelegate ProxyDelegate;
|
||||
ProxyDelegate.BindLambda(
|
||||
[]( const FGuid Guid, TArray<UObject*>& InAssetsToSync )
|
||||
{
|
||||
//Update the asset registry that a new static mash and material has been created
|
||||
if ( InAssetsToSync.Num() )
|
||||
{
|
||||
FAssetRegistryModule& AssetRegistry = FModuleManager::Get().LoadModuleChecked<FAssetRegistryModule>( "AssetRegistry" );
|
||||
int32 AssetCount = InAssetsToSync.Num();
|
||||
for ( int32 AssetIndex = 0; AssetIndex < AssetCount; AssetIndex++ )
|
||||
{
|
||||
AssetRegistry.AssetCreated( InAssetsToSync[AssetIndex] );
|
||||
GEditor->BroadcastObjectReimported( InAssetsToSync[AssetIndex] );
|
||||
}
|
||||
|
||||
//Also notify the content browser that the new assets exists
|
||||
FContentBrowserModule& ContentBrowserModule = FModuleManager::Get().LoadModuleChecked<FContentBrowserModule>( "ContentBrowser" );
|
||||
ContentBrowserModule.Get().SyncBrowserToAssets( InAssetsToSync, true );
|
||||
}
|
||||
} );
|
||||
|
||||
FGuid JobGuid = FGuid::NewGuid();
|
||||
MeshUtilities.CreateProxyMesh( Actors, ProxySettings, NULL, PackageName, JobGuid, ProxyDelegate );
|
||||
|
||||
GEditor->EndTransaction();
|
||||
GWarn->EndSlowTask();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue