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

Function GetNoteString

Source/NoteName.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45} // namespace
46
47std::string GetNoteString(note_t note, int octave) {
48 using namespace std::string_literals;
49
50 switch (note) {
51 case note_t::none:
52 return "..."s;
53 case note_t::halt:
54 return "---"s;
55 case note_t::release:
56 return "==="s;
57 case note_t::echo:
58 return "^-"s + std::to_string(octave);
59 default:
60 if (is_note(note))
61#ifndef AFL_FUZZ_ENABLED
62 return std::string((FTEnv.GetSettings()->Appearance.bDisplayFlats ? NOTE_NAME_FLAT : NOTE_NAME)[value_cast(note) - 1]) + std::to_string(octave);
63#else
64 return std::string((NOTE_NAME)[value_cast(note) - 1]) + std::to_string(octave);
65#endif
66 return "..."s;
67 }
68}
69
70std::string GetNoteString(const stChanNote &note) {
71 return GetNoteString(note.Note, note.Octave);

Callers 6

ToStringMethod · 0.85
DrawRangeMethod · 0.85
AddResultMethod · 0.85
GetPitchTextFunction · 0.85
ExportCellTextMethod · 0.85
OnInitDialogMethod · 0.85

Calls 3

is_noteFunction · 0.85
value_castFunction · 0.85
GetSettingsMethod · 0.45

Tested by

no test coverage detected