Skip to content

Commit

Permalink
update GUI docs and remove System Alert Window support.
Browse files Browse the repository at this point in the history
part of #158
  • Loading branch information
atsushieno committed Aug 10, 2023
1 parent cef1410 commit 3266267
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 731 deletions.
24 changes: 6 additions & 18 deletions androidaudioplugin/src/main/cpp/android/AAPJniFacade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ namespace aap {
j_method_port_get_direction,
j_method_port_get_content,
j_method_port_get_minimum_size_in_bytes,
j_method_create_gui,
j_method_show_gui,
j_method_hide_gui,
j_method_destroy_gui,
j_method_remote_plugin_instance_create_from_native;

void AAPJniFacade::initializeJNIMetadata() {
Expand All @@ -73,8 +69,6 @@ namespace aap {
java_enumeration_information_class = env->FindClass(
java_enumeration_information_class_name),
java_port_information_class = env->FindClass(java_port_information_class_name),
java_audio_plugin_service_helper_class = env->FindClass(
java_audio_plugin_service_class_name),
java_native_remote_plugin_instance_class = env->FindClass(
java_native_remote_plugin_instance_class_name);

Expand Down Expand Up @@ -172,18 +166,6 @@ namespace aap {
j_method_port_get_minimum_size_in_bytes = env->GetMethodID(java_port_information_class,
"getMinimumSizeInBytes",
"()I");
j_method_create_gui = env->GetStaticMethodID(java_audio_plugin_service_helper_class,
"createSystemAlertView",
"(Landroid/content/Context;Ljava/lang/String;I)Lorg/androidaudioplugin/AudioPluginSystemAlertView;");
j_method_show_gui = env->GetStaticMethodID(java_audio_plugin_service_helper_class,
"showGui",
"(Landroid/content/Context;Ljava/lang/String;ILorg/androidaudioplugin/AudioPluginSystemAlertView;)V");
j_method_hide_gui = env->GetStaticMethodID(java_audio_plugin_service_helper_class,
"hideGui",
"(Landroid/content/Context;Ljava/lang/String;ILorg/androidaudioplugin/AudioPluginSystemAlertView;)V");
j_method_destroy_gui = env->GetStaticMethodID(java_audio_plugin_service_helper_class,
"destroyGui",
"(Landroid/content/Context;Ljava/lang/String;ILorg/androidaudioplugin/AudioPluginSystemAlertView;)V");
j_method_remote_plugin_instance_create_from_native = env->GetStaticMethodID(java_native_remote_plugin_instance_class,
"fromNative",
"(IJ)Lorg/androidaudioplugin/hosting/NativeRemotePluginInstance;");
Expand Down Expand Up @@ -416,6 +398,7 @@ namespace aap {
protected:
void handleMessage() {
usingContext<int>([&](JNIEnv* env, jclass cls, jobject context) {
/*
auto pluginIdJString = env->NewStringUTF(gui_instance->pluginId.c_str());
auto ret = env->CallStaticObjectMethod(cls, j_method_create_gui, context, pluginIdJString,
gui_instance->instanceId);
Expand All @@ -428,6 +411,8 @@ namespace aap {
}
gui_instance->view = env->NewGlobalRef(ret);
callback();
*/
assert(false); // FIXME: implement?
return 0;
});
}
Expand Down Expand Up @@ -459,6 +444,7 @@ namespace aap {
protected:
void handleMessage() {
usingContext<int32_t>([&](JNIEnv* env, jclass cls, jobject context) {
/*
if (!gui_instance->view) {
// it must be assigned at create() state.
gui_instance->lastError = "createGui() was either not invoked or not successful. No further operation is performed.";
Expand All @@ -483,6 +469,8 @@ namespace aap {
env->ExceptionClear();
}
callback();
*/
assert(false); // FIXME: implement?
return 0;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,4 @@ object AudioPluginServiceHelper {
val factory = cls.newInstance() as AudioPluginViewFactory
return factory.createView(context, pluginId, instanceId)
}

@OptIn(DelicateCoroutinesApi::class)
@JvmStatic
fun createSystemAlertView(context: Context, pluginId: String, instanceId: Int) : AudioPluginSystemAlertView {
val audioPluginView = AudioPluginSystemAlertView(context)
// content is asynchronously filled
Dispatchers.Main.dispatch(GlobalScope.coroutineContext) {
val view = createNativeView(context, pluginId, instanceId)
audioPluginView.addView(view)
}
return audioPluginView
}

@OptIn(DelicateCoroutinesApi::class)
@JvmStatic
fun showGui(context: Context, pluginId: String, instanceId: Int, view: AudioPluginSystemAlertView) {
Dispatchers.Main.dispatch(GlobalScope.coroutineContext) {
view.showOverlay()
}
}

@OptIn(DelicateCoroutinesApi::class)
@JvmStatic
fun hideGui(context: Context, pluginId: String, instanceId: Int, view: AudioPluginSystemAlertView) {
Dispatchers.Main.dispatch(GlobalScope.coroutineContext) {
view.hideOverlay(false)
}
}

@JvmStatic
fun destroyGui(context: Context, pluginId: String, instanceId: Int, view: AudioPluginSystemAlertView) {
}
}

This file was deleted.

Loading

0 comments on commit 3266267

Please sign in to comment.