MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / PeriodicUpdate

Method PeriodicUpdate

Source/FamiTrackerView.cpp:791–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791void 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
837void CFamiTrackerView::UpdateSongView() { // // //
838 song_view_ = GetModuleData()->MakeSongView(GetMainFrame()->GetSelectedTrack(),

Callers

nothing calls this directly

Calls 11

IsBackgroundTaskMethod · 0.80
GetPlayerTicksMethod · 0.80
SetIndicatorTimeMethod · 0.80
GetPlayerPosMethod · 0.80
SetIndicatorPosMethod · 0.80
GetSoundGeneratorMethod · 0.45
GetFrameRateMethod · 0.45
IsFileLoadedMethod · 0.45
GetChannelCountMethod · 0.45
GetChannelNoteMethod · 0.45
ChangeNoteStateMethod · 0.45

Tested by

no test coverage detected