| 714 | } |
| 715 | |
| 716 | void 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 | |
| 740 | static void Rotate(const CPoint *pCenter, CPoint *pPoint, float Rotation) |
| 741 | { |