1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2007-2019 Andreas Persson |
* Copyright (C) 2007-2020 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
148 |
return (caseSensitive) ? (sub == needle) : (!strcasecmp(sub.c_str(), needle.c_str())); |
return (caseSensitive) ? (sub == needle) : (!strcasecmp(sub.c_str(), needle.c_str())); |
149 |
} |
} |
150 |
|
|
151 |
|
inline int getIndexOf(gig::Instrument* instrument) { |
152 |
|
gig::File* file = (gig::File*) instrument->GetParent(); |
153 |
|
for (int i = 0; true ; ++i) { |
154 |
|
gig::Instrument* instr = file->GetInstrument(i); |
155 |
|
if (!instr) break; |
156 |
|
if (instr == instrument) return i; |
157 |
|
} |
158 |
|
return -1; |
159 |
|
} |
160 |
|
|
161 |
inline int getDimensionIndex(gig::dimension_t type, gig::Region* rgn) { |
inline int getDimensionIndex(gig::dimension_t type, gig::Region* rgn) { |
162 |
for (uint i = 0; i < rgn->Dimensions; ++i) |
for (uint i = 0; i < rgn->Dimensions; ++i) |
163 |
if (rgn->pDimensionDefinitions[i].dimension == type) |
if (rgn->pDimensionDefinitions[i].dimension == type) |