| 1793 | ////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 1794 | |
| 1795 | void CFamiTrackerView::PlayNote(std::size_t Index, int MidiNote, unsigned int Velocity) const { // // // |
| 1796 | if (MidiNote < 0 || MidiNote >= NOTE_COUNT) |
| 1797 | return; |
| 1798 | |
| 1799 | // Play a note in a channel |
| 1800 | stChanNote NoteData; // // // |
| 1801 | |
| 1802 | NoteData.Note = ft0cc::doc::pitch_from_midi(MidiNote); |
| 1803 | NoteData.Octave = ft0cc::doc::oct_from_midi(MidiNote); |
| 1804 | NoteData.Instrument = GetInstrument(); |
| 1805 | if (FTEnv.GetSettings()->Midi.bMidiVelocity) |
| 1806 | NoteData.Vol = Velocity / 8; |
| 1807 | /* |
| 1808 | if (FTEnv.GetSettings()->General.iEditStyle == edit_style_t::IT) |
| 1809 | NoteData.Instrument = m_LastNote.Instrument; |
| 1810 | else |
| 1811 | NoteData.Instrument = GetInstrument(); |
| 1812 | */ |
| 1813 | const CChannelOrder &order = GetSongView()->GetChannelOrder(); |
| 1814 | const CSongData &song = GetSongView()->GetSong(); |
| 1815 | |
| 1816 | stChannelID Channel = SplitAdjustChannel(TranslateChannel(Index), NoteData); |
| 1817 | if (order.HasChannel(Channel)) { |
| 1818 | stChannelID ret = m_pNoteQueue->Trigger(MidiNote, Channel); |
| 1819 | if (order.HasChannel(ret)) { |
| 1820 | SplitKeyboardAdjust(NoteData, ret); |
| 1821 | FTEnv.GetSoundGenerator()->QueueNote(ret, NoteData, NOTE_PRIO_2); // // // |
| 1822 | FTEnv.GetSoundGenerator()->ForceReloadInstrument(ret); // // // |
| 1823 | } |
| 1824 | } |
| 1825 | |
| 1826 | if (FTEnv.GetSettings()->General.bPreviewFullRow) { |
| 1827 | int Frame = GetSelectedFrame(); |
| 1828 | int Row = GetSelectedRow(); |
| 1829 | |
| 1830 | order.ForeachChannel([&] (stChannelID i) { |
| 1831 | if (!IsChannelMuted(i) && i != Channel) |
| 1832 | FTEnv.GetSoundGenerator()->QueueNote(i, song.GetActiveNote(i, Frame, Row), |
| 1833 | (i == Channel) ? NOTE_PRIO_2 : NOTE_PRIO_1); // // // |
| 1834 | }); |
| 1835 | } |
| 1836 | } |
| 1837 | |
| 1838 | void CFamiTrackerView::ReleaseNote(std::size_t Index, int MidiNote) const { |
| 1839 | if (MidiNote < 0 || MidiNote >= NOTE_COUNT) |
nothing calls this directly
no test coverage detected