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

Method ReleaseNote

Source/FamiTrackerView.cpp:1838–1866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1836}
1837
1838void CFamiTrackerView::ReleaseNote(std::size_t Index, int MidiNote) const {
1839 if (MidiNote < 0 || MidiNote >= NOTE_COUNT)
1840 return;
1841
1842 // Releases a channel
1843 stChanNote NoteData; // // //
1844
1845 NoteData.Note = note_t::release;
1846 NoteData.Instrument = GetInstrument();
1847
1848 stChannelID Channel = SplitAdjustChannel(TranslateChannel(Index), NoteData);
1849 const CChannelOrder &order = GetSongView()->GetChannelOrder();
1850 if (order.HasChannel(Channel)) {
1851 stChannelID ch = m_pNoteQueue->Cut(MidiNote, Channel);
1852// stChannelID ch = m_pNoteQueue->Release(MidiNote, Channel);
1853 if (order.HasChannel(ch))
1854 FTEnv.GetSoundGenerator()->QueueNote(ch, NoteData, NOTE_PRIO_2);
1855
1856 if (FTEnv.GetSettings()->General.bPreviewFullRow) {
1857 NoteData.Note = note_t::halt;
1858 NoteData.Instrument = MAX_INSTRUMENTS;
1859
1860 order.ForeachChannel([&] (stChannelID i) {
1861 if (i != ch)
1862 FTEnv.GetSoundGenerator()->QueueNote(i, NoteData, NOTE_PRIO_1);
1863 });
1864 }
1865 }
1866}
1867
1868void CFamiTrackerView::HaltNote(std::size_t Index, int MidiNote) const {
1869 if (MidiNote < 0 || MidiNote >= NOTE_COUNT)

Callers 2

ReleaseMIDINoteMethod · 0.45
HandleKeyboardNoteMethod · 0.45

Calls 6

HasChannelMethod · 0.80
CutMethod · 0.80
ForeachChannelMethod · 0.80
QueueNoteMethod · 0.45
GetSoundGeneratorMethod · 0.45
GetSettingsMethod · 0.45

Tested by

no test coverage detected