void comboBoxChanged(juce::ComboBox *comboBoxThatHasChanged) override
{
if (comboBoxThatHasChanged == &voicingSelector)
{
controls.clear();
int comboBoxSelectedIndex = comboBoxThatHasChanged->getSelectedId();
if(comboBoxSelectedIndex != 0)
{
DBG("comboBoxSelectedIndex " << comboBoxSelectedIndex);
auto selectorIdParam = valueTreeState.getParameterAsValue(selectorIdString);
// need to cast to juce::var type in order to persist the value in Host...
selectorIdParam.setValue(juce::var(comboBoxSelectedIndex));
}
}
}
復習ですが、ComboBoxの基本的な使い方は以下。。。
// add the parent Component as a listener
// you should remove the listener in the deconstructor
comboBox.addListener(this);
// sets selector id
comboBox.setSelectedId(id, juce::dontSendNotification);
struct Voicing {
Voicing() {}
Voicing(int i, juce::StringRef name, juce::StringRef quality, std::vector<int> voices)
: index(i), name(name), quality(quality), voices(voices) {}
int index;
juce::String name;
juce::String quality;
std::vector<int> voices;
};
struct compare {
inline bool operator() (const Voicing& v1, const Voicing& v2)
{
// Define the ordering of the quality values
const std::array<juce::String, 4> qualityOrder = {MINOR_NAME, MAJOR_NAME, MINOR_MAJOR_NAME, DOMINANT_NAME};
// Compare the quality values
auto lhsQualityIndex = std::distance(qualityOrder.begin(), std::find(qualityOrder.begin(), qualityOrder.end(), v1.quality));
auto rhsQualityIndex = std::distance(qualityOrder.begin(), std::find(qualityOrder.begin(), qualityOrder.end(), v2.quality));
if (lhsQualityIndex != qualityOrder.size() && rhsQualityIndex != qualityOrder.size()) {
// If both qualities are in the qualityOrder array, compare their indices
return lhsQualityIndex < rhsQualityIndex;
} else if (lhsQualityIndex == qualityOrder.size() && rhsQualityIndex == qualityOrder.size()) {
// If both qualities are not in the qualityOrder array, compare them alphabetically
return v1.quality < v2.quality;
} else if (lhsQualityIndex != rhsQualityIndex) {
// If only one quality is in the qualityOrder array, it is considered greater than the other
return lhsQualityIndex < rhsQualityIndex;
} else {
// If the quality values are the same, compare the indices
return v1.index < v2.index;
}
}
};
CertificateはDeveloper ID InstallerとDeveloper ID Applicationのふたつが必要です。
Keychain AccessからSigning requestを発行します。*このプロセスは有効期限内のCertificationがある場合はスキップ出来ます。むしろ、同じ名前のCertificationが二つ以上あると認証が上手く出来ません。(Updated 28 Feb 2024)
Keychain Access -> Certificate Assistant -> Request a Certificate From a Certificate Authority…Emailと、入手したいCertificateに適当な名前をつけます。Saved to diskを選択すると、選択したフォルダにrequestが作成されます。Show in Finderをクリックするとどこに保存されたのかを示してくれます。Developer ID Installerを選択 -> ContinueG2 Sub-CAを選択し、Choose Fileで先ほど作成したRequestを選択、-> Continue
以下のコマンドでDeveloper ID Application 証書で codesignをします。
codesign --force -s "Developer ID Application: Your Team (XXXXXXXXXX)" ./ChordGenius.vst3 --timestamp --options runtime
codesign --force -s "Developer ID Application: Your Team (XXXXXXXXXX)" ./ChordGenius.component --timestamp --options runtime
sign済のファイルに対して 以下のpkgbuildコマンドでDeveloper ID Installer 証書を使って pkgファイルを作成します。
pkgbuild --root /Users/<your_user_name>/<path>/ChordGenius.vst3 --identifier app.kobito.ChordGenius --install-location /Library/Audio/Plug-Ins/VST3/ChordGenius.vst3 --version 1.0.0 --sign "Developer ID Installer: Your Team (XXXXXXXXXX)" --timestamp /Users/<your_user_name>/<path>/ChordGeniusVST3.pkg
pkgbuild --root /Users/<your_user_name>/<path>/ChordGenius.component --identifier app.kobito.ChordGenius.ChordGeniusAUv3 --install-location /Library/Audio/Plug-Ins/Components/ChordGenius.component --version 1.0.0 --sign "Developer ID Installer: Your Team (XXXXXXXXXX)" --timestamp /Users/<your_user_name>/<path>/ChordGeniusAUv3.pkg
xcrun altool --list-providers -u "<your_email_address"
// paste the app-specific password
// you'll get the Team ID information
パスワードをKeychainに登録します。
xcrun notarytool store-credentials --apple-id "<your_email_address>" --password "xxxx-xxxx-xxxx-xxxx" --team-id "XXXXXXXXXX"
// prompts to enter a profile name. can be any name.