私はPHPプログラマーであり、PHPのコマンドラインを介してVSTを介してMIDIファイルを処理できるMissWatsonの単純な代替手段を開発することにより、C++に突入することを決定しました。
Steinberg VST SDKから始めて、次のMIDIライブラリを使用しています:https ://ccrma.stanford.edu/software/stk/index.html 。
私はベクトル、特にMIDIイベントを格納するベクトルに固執しています。クリーンアップするコードの最後のビットは次のとおりです(私はC ++に完全に精通しており、おそらくこれのほとんどを間違って行っていることに注意してください):
std::string midiPath = "C:\\creative\\midi\\m1.mid";
if (argc > 1) {
midiPath = argv[1];
}
//MidiFileIn::MidiFileIn(midiPath);
stk::MidiFileIn::MidiFileIn(midiPath);
//std::vector<_Ty> * midiEvents;
std::vector<_Ty> midiEvents(200);
stk::MidiFileIn::getNextEvent(midiEvents, 0);
//char* midiEvents[200];
//VstEvents* midiEvents;
//processMidi(effect, VstEvents*);
const char* wavPath = argv[2];
//processAudio(effect, 0, x, x);
そしてここにエラーがあります:
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2065: '_Ty' : undeclared identifier
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(370): error C2514: 'std::vector' : class has no constructors
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(480) : see declaration of 'std::vector'
1>c:\users\andrew\downloads\vst_sdk2_4_rev2\vstsdk2.4\public.sdk\samples\vst2.x\minihost\source\score.cpp(372): error C2664: 'stk::MidiFileIn::getNextEvent' : cannot convert parameter 1 from 'std::vector' to 'std::vector<_Ty> *'
1> with
1> [
1> _Ty=unsigned char
1> ]
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>
では、どうすれば_Tyコンストラクターを使用できますか?私は正しい方向に進んでいますか、それともただ狂っていますか?