| 789 | } |
| 790 | |
| 791 | void CFamiTrackerView::PeriodicUpdate() |
| 792 | { |
| 793 | // Called periodically by an background timer |
| 794 | |
| 795 | CMainFrame *pMainFrm = GetMainFrame(); // // // |
| 796 | |
| 797 | if (const CSoundGen *pSoundGen = FTEnv.GetSoundGenerator()) { |
| 798 | // Skip updates when doing background tasks (WAV render for example) |
| 799 | if (!pSoundGen->IsBackgroundTask()) { |
| 800 | |
| 801 | int PlayTicks = pSoundGen->GetPlayerTicks(); |
| 802 | int PlayTime = (PlayTicks * 10) / GetModuleData()->GetFrameRate(); |
| 803 | |
| 804 | // Play time |
| 805 | int Min = PlayTime / 600; |
| 806 | int Sec = (PlayTime / 10) % 60; |
| 807 | int mSec = PlayTime % 10; |
| 808 | |
| 809 | pMainFrm->SetIndicatorTime(Min, Sec, mSec); |
| 810 | |
| 811 | auto [Frame, Row] = pSoundGen->GetPlayerPos(); // // // |
| 812 | |
| 813 | pMainFrm->SetIndicatorPos(Frame, Row); |
| 814 | |
| 815 | if (GetDocument()->IsFileLoaded()) { |
| 816 | UpdateMeters(); |
| 817 | // // // |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | if (GetSongView()->GetChannelOrder().GetChannelCount()) { // // // |
| 822 | int Note = pSoundGen->GetChannelNote(GetSelectedChannelID()); // // // |
| 823 | if (m_iLastNoteState != Note) { |
| 824 | pMainFrm->ChangeNoteState(Note); |
| 825 | m_iLastNoteState = Note; |
| 826 | } |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | // Switch instrument |
| 831 | if (m_iSwitchToInstrument != -1) { |
| 832 | SetInstrument(m_iSwitchToInstrument); |
| 833 | m_iSwitchToInstrument = -1; |
| 834 | } |
| 835 | } |
| 836 | |
| 837 | void CFamiTrackerView::UpdateSongView() { // // // |
| 838 | song_view_ = GetModuleData()->MakeSongView(GetMainFrame()->GetSelectedTrack(), |
nothing calls this directly
no test coverage detected