-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
要議論実行する前に議論が必要そうなもの実行する前に議論が必要そうなもの
Description
内容
#276 (comment) , #274 (comment) によりvoicevox_coreの C APIをオブジェクト指向に寄せたAPIにする必要が出てきて、そのための議論をしたいと考えています。
個人的には以下のようなクラスでC APIを考えてるのですがいかがでしょうか?
またpython APIについてもこのissueで議論したクラス設計を元にAPI設計を作りたいと考えてます。
今考えてるものとしてはversion,metas,supported_devices情報の取得はVoicevoxCoreクラスのstaticメンバ関数として実装しようと考えています。
struct VoicevoxCore;
VoicevoxCore* voicevox_core_new();
VoicevoxResultCode voicevox_core_initialize(VoicevoxCore* voicevox_core, VoicevoxCoreInitializeOptions options);
void voicevox_core_delete(VoicevoxCore* voicevox_core);
// staticメンバ関数のためVoicevoxCore のオブジェクトpointerは不要
char* voicevox_core_get_version();
// staticメンバ関数のためVoicevoxCore のオブジェクトpointerは不要
char* voicevox_core_get_metas_json();
// staticメンバ関数のためVoicevoxCore のオブジェクトpointerは不要
char* voicevox_core_get_supported_devices_json();
VoicevoxResultCode voicevox_core_load_model(VoicevoxCore* voicevox_core,uint32_t speaker_id);
bool voicevox_core_is_gpu_mode(const VoicevoxCore* voicevox_core);
//以下、同様にオブジェクト指向的にC APIを定義していく
voicevox_core_newとvoicevox_core_initializeは一緒にするべきかもしれませんがresultcodeの関係上分けようかと思ってます。
また現在のvoicevox_coreの関数のprefixは voicevox
ですが、これもきちんとオブジェクト指向的な名前にすると voicevox_core
にprefixがなると思い、 prefix を voicevox_core
にしようと考えています。
その他
@sevenc-nanashi @shigobu お二人はvoicevox_coreのwrapperを作成されているように見受けられますのでぜひご意見をいただきたいです。
shigobuHiroshiba
Metadata
Metadata
Assignees
Labels
要議論実行する前に議論が必要そうなもの実行する前に議論が必要そうなもの