FSoundPlayingColumn.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #include "FSoundPlayingColumn.h"
  16. #include "WwiseUEFeatures.h"
  17. #include "EditorStyleSet.h"
  18. #include "SWwiseBrowser.h"
  19. #include "WaapiPicker/WwiseTreeItem.h"
  20. #define LOCTEXT_NAMESPACE "AkAudio"
  21. FSoundPlayingColumn::FSoundPlayingColumn(SWwiseBrowser& WwiseBrowser)
  22. : WwiseBrowserWeak(StaticCastSharedRef<SWwiseBrowser>(WwiseBrowser.AsShared()))
  23. {
  24. }
  25. FName FSoundPlayingColumn::GetColumnId()
  26. {
  27. return FName("SoundPlaying");
  28. }
  29. const TSharedRef<SWidget> FSoundPlayingColumn::ConstructRowWidget(FWwiseTreeItemPtr TreeItem,
  30. const STableRow<FWwiseTreeItemPtr>& Row)
  31. {
  32. auto WwiseBrowser = WwiseBrowserWeak.Pin();
  33. return SNew(SImage)
  34. #if UE_5_0_OR_LATER
  35. .Image(FAkAppStyle::Get().GetBrush("ClassIcon.AmbientSound"))
  36. #else
  37. .Image(FEditorStyle::Get().GetBrush("Sequencer.Tracks.Audio"))
  38. #endif
  39. .Visibility_Raw(WwiseBrowser.Get(), &SWwiseBrowser::IsItemPlaying, TreeItem->ItemId);
  40. }
  41. SHeaderRow::FColumn::FArguments FSoundPlayingColumn::ConstructHeaderRowColumn()
  42. {
  43. SHeaderRow::FColumn::FArguments PlayingStatusColumnHeader = SHeaderRow::Column(GetColumnId());
  44. TAttribute<FText> StatusLabel;
  45. PlayingStatusColumnHeader.DefaultLabel(LOCTEXT("SoundPlayingColumnLabel", ""));
  46. PlayingStatusColumnHeader.DefaultTooltip(LOCTEXT("SoundplayingColumn_Tooltip", "Is the Sound Playing in Wwise?"));
  47. PlayingStatusColumnHeader.FixedWidth(20.f);
  48. return PlayingStatusColumnHeader;
  49. }
  50. #undef LOCTEXT_NAMESPACE