| 217 | //const int SEQ_SUNSOFT_NOISE = sequence_t::DutyCycle + 1; |
| 218 | |
| 219 | void CSequenceEditor::SelectSequence(std::shared_ptr<CSequence> pSequence, int InstrumentType) // // // |
| 220 | { |
| 221 | // Select a sequence to edit |
| 222 | m_pSequence = std::move(pSequence); |
| 223 | m_iInstrumentType = InstrumentType; |
| 224 | |
| 225 | DestroyGraphEditor(); |
| 226 | |
| 227 | CRect GraphRect; |
| 228 | GetClientRect(GraphRect); |
| 229 | GraphRect.bottom -= DPI::SY(BOTTOM_MARGIN); // // // |
| 230 | |
| 231 | CGraphEditorFactory factory; // // // |
| 232 | m_pGraphEditor = factory.Make(this, GraphRect, m_pSequence, InstrumentType, m_iMaxVol, m_iMaxDuty); |
| 233 | |
| 234 | m_pSetting->SelectSequence(m_pSequence, InstrumentType); |
| 235 | |
| 236 | m_pGraphEditor->UpdateWindow(); |
| 237 | m_pGraphEditor->ShowWindow(SW_SHOW); |
| 238 | |
| 239 | m_pSizeEditor->SetValue(m_pSequence->GetItemCount()); |
| 240 | |
| 241 | Invalidate(); |
| 242 | RedrawWindow(); |
| 243 | |
| 244 | // Update sequence string |
| 245 | SequenceChangedMessage(false); |
| 246 | } |
| 247 | |
| 248 | BOOL CSequenceEditor::DestroyWindow() |
| 249 | { |
no test coverage detected