| 1077 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 1078 | |
| 1079 | void CFamiTrackerView::OnInitialUpdate() |
| 1080 | { |
| 1081 | // |
| 1082 | // Called when the view is first attached to a document, |
| 1083 | // when a file is loaded or new document is created. |
| 1084 | // |
| 1085 | |
| 1086 | CFamiTrackerDoc* pDoc = GetDocument(); |
| 1087 | CFamiTrackerModule *pModule = GetModuleData(); |
| 1088 | |
| 1089 | CMainFrame *pMainFrame = GetMainFrame(); // // // |
| 1090 | |
| 1091 | CFrameEditor *pFrameEditor = GetFrameEditor(); |
| 1092 | |
| 1093 | TRACE(L"View: OnInitialUpdate (%s)\n", (LPCWSTR)pDoc->GetTitle()); |
| 1094 | |
| 1095 | // Setup order window |
| 1096 | pFrameEditor->AssignView(*this); // // // |
| 1097 | m_pPatternEditor->SetDocument(pModule, this); |
| 1098 | |
| 1099 | // Always start with first track |
| 1100 | pMainFrame->SelectTrack(0); |
| 1101 | UpdateSongView(); // // // |
| 1102 | |
| 1103 | // Notify the pattern view about new document & view |
| 1104 | m_pPatternEditor->ResetCursor(); |
| 1105 | pFrameEditor->ResetCursor(); // // // |
| 1106 | |
| 1107 | // Update mainframe with new document settings |
| 1108 | pMainFrame->UpdateInstrumentList(); |
| 1109 | pMainFrame->SetSongInfo(*pModule); // // // |
| 1110 | pMainFrame->UpdateTrackBox(); |
| 1111 | pMainFrame->DisplayOctave(); |
| 1112 | pMainFrame->UpdateControls(); |
| 1113 | pMainFrame->ResetUndo(); |
| 1114 | pMainFrame->ResizeFrameWindow(); |
| 1115 | |
| 1116 | // Fetch highlight |
| 1117 | m_pPatternEditor->SetHighlight(pModule->GetHighlight(0)); // // // |
| 1118 | pMainFrame->SetHighlightRows(pModule->GetHighlight(0)); |
| 1119 | |
| 1120 | // Follow mode |
| 1121 | SetFollowMode(FTEnv.GetSettings()->bFollowMode); |
| 1122 | |
| 1123 | // Setup speed/tempo (TODO remove?) |
| 1124 | FTEnv.GetSoundGenerator()->AssignModule(*pModule); // // // |
| 1125 | FTEnv.GetSoundGenerator()->ResetState(); |
| 1126 | FTEnv.GetSoundGenerator()->ResetTempo(); |
| 1127 | FTEnv.GetSoundGenerator()->SetMeterDecayRate(FTEnv.GetSettings()->bFastMeterDecayRate ? decay_rate_t::Fast : decay_rate_t::Slow); // // // 050B |
| 1128 | FTEnv.GetSoundGenerator()->DocumentPropertiesChanged(pDoc); // // // |
| 1129 | |
| 1130 | // Default |
| 1131 | SetInstrument(0); |
| 1132 | |
| 1133 | UnmuteAllChannels(); // // // |
| 1134 | |
| 1135 | UpdateNoteQueues(); // // // |
| 1136 |
no test coverage detected