Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
name_compare.h
1
/*
2
* Copyright © 2014-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include <cstdint>
21
22
struct
ComparativeNoteNumber
{
23
int32_t noteNumber;
24
int32_t stringLength;
25
};
26
27
// You must set this at some point before calling strcmpspecial. This isn't implemented as an argument because
28
// sometimes you want to set it way up the call tree, and passing it all the way down is a pain.
29
extern
bool
shouldInterpretNoteNames;
30
31
extern
bool
octaveStartsFromA;
// You must set this if setting shouldInterpretNoteNames to true.
32
33
// Returns 100000 if the string is not a note name.
34
// The returned number is *not* a MIDI note. It's arbitrary, used for comparisons only.
35
// noteChar has been made lowercase, which is why we can't just take it from the string.
36
ComparativeNoteNumber
getComparativeNoteNumberFromChars(
char
const
*
string
,
char
noteChar,
bool
octaveStartsFromA);
37
40
// Returns positive if first > second
41
// Returns negative if first < second
42
int32_t strcmpspecial(
char
const
* first,
char
const
* second);
ComparativeNoteNumber
Definition
name_compare.h:22