Fixes issue with ACE displaying only banks (#1427)

Updates to some AzCore functions a while ago made some path functions
strip off a trailing slash, which caused bad paths to be used when
loading middleware data.  Updated the code to use better path APIs.
main
Eric Phister 5 years ago committed by GitHub
parent 530573abf3
commit 22ff37ecda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,6 +17,7 @@
#include <AzCore/std/smart_ptr/make_shared.h> #include <AzCore/std/smart_ptr/make_shared.h>
#include <AzCore/std/string/conversions.h> #include <AzCore/std/string/conversions.h>
#include <AzCore/StringFunc/StringFunc.h> #include <AzCore/StringFunc/StringFunc.h>
#include <AzCore/Utils/Utils.h>
#include <ACETypes.h> #include <ACETypes.h>
#include <AudioSystemControl_wwise.h> #include <AudioSystemControl_wwise.h>
@ -540,11 +541,10 @@ namespace AudioControls
} }
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
AZStd::string CAudioSystemEditor_wwise::GetDataPath() const AZ::IO::FixedMaxPath CAudioSystemEditor_wwise::GetDataPath() const
{ {
AZStd::string path(Path::GetEditingGameDataFolder()); auto projectPath = AZ::IO::FixedMaxPath{ AZ::Utils::GetProjectPath() };
AZ::StringFunc::Path::Join(path.c_str(), "sounds/wwise_project/", path); return (projectPath / "sounds" / "wwise_project");
return path;
} }
} // namespace AudioControls } // namespace AudioControls

@ -86,7 +86,7 @@ namespace AudioControls
const AZStd::string_view GetTypeIcon(TImplControlType type) const override; const AZStd::string_view GetTypeIcon(TImplControlType type) const override;
const AZStd::string_view GetTypeIconSelected(TImplControlType type) const override; const AZStd::string_view GetTypeIconSelected(TImplControlType type) const override;
AZStd::string GetName() const override; AZStd::string GetName() const override;
AZStd::string GetDataPath() const; AZ::IO::FixedMaxPath GetDataPath() const override;
void DataSaved() override {} void DataSaved() override {}
void ConnectionRemoved(IAudioSystemControl* control) override; void ConnectionRemoved(IAudioSystemControl* control) override;
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////

@ -54,12 +54,12 @@ namespace AudioControls
void CAudioWwiseLoader::Load(CAudioSystemEditor_wwise* audioSystemImpl) void CAudioWwiseLoader::Load(CAudioSystemEditor_wwise* audioSystemImpl)
{ {
m_audioSystemImpl = audioSystemImpl; m_audioSystemImpl = audioSystemImpl;
const AZStd::string wwiseProjectFullPath(m_audioSystemImpl->GetDataPath()); const AZ::IO::FixedMaxPath wwiseProjectFullPath{ m_audioSystemImpl->GetDataPath() };
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::GameParametersFolder); LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::GameParametersFolder }.Native());
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::GameStatesFolder); LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::GameStatesFolder }.Native());
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::SwitchesFolder); LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::SwitchesFolder }.Native());
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::EventsFolder); LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::EventsFolder }.Native());
LoadControlsInFolder(wwiseProjectFullPath + WwiseStrings::EnvironmentsFolder); LoadControlsInFolder(AZ::IO::FixedMaxPath{ wwiseProjectFullPath / WwiseStrings::EnvironmentsFolder }.Native());
LoadSoundBanks(Audio::Wwise::GetBanksRootPath(), "", false); LoadSoundBanks(Audio::Wwise::GetBanksRootPath(), "", false);
} }

@ -14,6 +14,7 @@
#pragma once #pragma once
#include <AzCore/EBus/EBus.h> #include <AzCore/EBus/EBus.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/std/string/string_view.h> #include <AzCore/std/string/string_view.h>
#include <ACETypes.h> #include <ACETypes.h>
@ -151,7 +152,7 @@ namespace AudioControls
//! Gets the folder where the implementation specific controls data are stored. //! Gets the folder where the implementation specific controls data are stored.
//! This is used by the ACE to update if controls are changed while the editor is open. //! This is used by the ACE to update if controls are changed while the editor is open.
//! @return String with the path to the folder where the implementation specific controls are stored. //! @return String with the path to the folder where the implementation specific controls are stored.
virtual AZStd::string GetDataPath() const = 0; virtual AZ::IO::FixedMaxPath GetDataPath() const = 0;
//! Informs the plugin that the ACE has saved the data in case it needs to do any clean up. //! Informs the plugin that the ACE has saved the data in case it needs to do any clean up.
virtual void DataSaved() = 0; virtual void DataSaved() = 0;

@ -218,7 +218,7 @@ namespace AudioControls
IAudioSystemEditor* pAudioSystemImpl = CAudioControlsEditorPlugin::GetAudioSystemEditorImpl(); IAudioSystemEditor* pAudioSystemImpl = CAudioControlsEditorPlugin::GetAudioSystemEditorImpl();
if (pAudioSystemImpl) if (pAudioSystemImpl)
{ {
StartWatchingFolder(pAudioSystemImpl->GetDataPath()); StartWatchingFolder(pAudioSystemImpl->GetDataPath().LexicallyNormal().Native());
m_pMiddlewareDockWidget->setWindowTitle(QString(pAudioSystemImpl->GetName().c_str()) + " Controls"); m_pMiddlewareDockWidget->setWindowTitle(QString(pAudioSystemImpl->GetName().c_str()) + " Controls");
} }
} }

Loading…
Cancel
Save