MCPcopy Create free account
hub / github.com/ddnet/ddnet / DoToolbarSounds

Method DoToolbarSounds

src/game/editor/editor.cpp:716–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void CEditor::DoToolbarSounds(CUIRect ToolBar)
717{
718 CUIRect ToolBarTop, ToolBarBottom;
719 ToolBar.HSplitMid(&ToolBarTop, &ToolBarBottom, 5.0f);
720
721 std::shared_ptr<CEditorSound> pSelectedSound = Map()->SelectedSound();
722 if(pSelectedSound != nullptr)
723 {
724 if(pSelectedSound->m_SoundId != m_ToolbarPreviewSound && m_ToolbarPreviewSound >= 0 && Sound()->IsPlaying(m_ToolbarPreviewSound))
725 Sound()->Stop(m_ToolbarPreviewSound);
726 m_ToolbarPreviewSound = pSelectedSound->m_SoundId;
727 }
728 else
729 {
730 m_ToolbarPreviewSound = -1;
731 }
732
733 if(m_ToolbarPreviewSound >= 0)
734 {
735 static int s_PlayPauseButton, s_StopButton, s_SeekBar = 0;
736 DoAudioPreview(ToolBarBottom, &s_PlayPauseButton, &s_StopButton, &s_SeekBar, m_ToolbarPreviewSound);
737 }
738}
739
740static void Rotate(const CPoint *pCenter, CPoint *pPoint, float Rotation)
741{

Callers

nothing calls this directly

Calls 6

MapFunction · 0.85
HSplitMidMethod · 0.80
SelectedSoundMethod · 0.80
SoundFunction · 0.70
IsPlayingMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected