Beatmup
wrapper_core.cpp File Reference
#include "wrapper.h"
#include "include/Beatmup_Object.h"
#include "include/Beatmup_Visual_Android_BasicDisplay.h"
#include "include/Beatmup_Context.h"
#include "include/Beatmup_Android_Context.h"
#include "include/Beatmup_Pipelining_CustomPipeline.h"
#include "include/Beatmup_Pipelining_Multitask.h"
#include "include/Beatmup_Pipelining_TaskHolder.h"
#include "include/Beatmup_Utils_Callback.h"
#include "include/Beatmup_Utils_ChunkAsset.h"
#include "include/Beatmup_Utils_ChunkCollection.h"
#include "include/Beatmup_Utils_ChunkFile.h"
#include "include/Beatmup_Utils_VariablesBundle.h"
#include "include/Beatmup_Sequence.h"
#include "android/context.h"
#include "context_event_listener.h"
#include "callback_task.h"
#include <android/asset_manager_jni.h>
#include <android/native_window_jni.h>
#include <core/bitmap/tools.h>
#include <core/pipelining/custom_pipeline.h>
#include <core/pipelining/multitask.h>
#include <core/fragments/sequence.h>
#include <core/gpu/variables_bundle.h>
#include <core/gpu/swapper.h>
#include <core/gpu/display_switch.h>
#include <core/utils/android/asset.h>

Go to the source code of this file.

Functions

 JNIMETHOD (void, disposeNative, Java_Beatmup_Object, disposeNative)(JNIEnv *jenv
 
 if (nativeObj)
 
 JNIMETHOD (jboolean, bindSurfaceToContext, Java_Beatmup_Visual_Android_BasicDisplay, bindSurfaceToContext)(JNIEnv *jenv
 
 if (surface)
 
 JNIMETHOD (jlong, attachEventListener, Java_Beatmup_Context, attachEventListener)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::Context, ctx, hCtx)
 
 if (listener) delete listener
 
ctx setEventListener (listener)
 
return() jlong (listener)
 
 JNIMETHOD (void, detachEventListener, Java_Beatmup_Context, detachEventListener)(JNIEnv *jenv
 
 JNIMETHOD (jlong, getTotalRam, Java_Beatmup_Context, getTotalRam)(JNIEnv *jenv
 
 return (JNIEnv *jenv, jobject, jlong hCtx, jint poolIdx, jobject jTask)
 
 BEATMUP_OBJ (Beatmup::Android::Context, ctx, hCtx)
 
 BEATMUP_OBJ (Beatmup::AbstractTask, task, jTask)
 
 BEATMUP_CATCH ({ return(jint) ctx->submitTask(*task,(Beatmup::PoolIndex) poolIdx);})
 
 BEATMUP_CATCH ({ return ctx->submitPersistentTask(*task,(Beatmup::PoolIndex) poolIdx);})
 
 BEATMUP_CATCH ({ ctx->repeatTask(*task, abort==JNI_TRUE,(Beatmup::PoolIndex) poolIdx);})
 
 BEATMUP_CATCH ({ ctx->waitForJob(job,(Beatmup::PoolIndex) poolIdx);})
 
 BEATMUP_CATCH ({ return ctx->abortJob(job,(Beatmup::PoolIndex) poolIdx) ? JNI_TRUE :JNI_FALSE;})
 
 BEATMUP_CATCH ({ ctx->wait((Beatmup::PoolIndex) poolIdx);})
 
 BEATMUP_CATCH ({ return ctx->busy((Beatmup::PoolIndex) poolIdx) ? JNI_TRUE :JNI_FALSE;})
 
 BEATMUP_CATCH ({ ctx->check((Beatmup::PoolIndex) poolIdx);})
 
 JNIMETHOD (jlong, renderChessboard, Java_Beatmup_Context, renderChessboard)(JNIEnv *jenv
 
return(jlong) Beatmup JNIMETHOD (jlong, copyBitmap, Java_Beatmup_Context, copyBitmap)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::AbstractBitmap, bitmap, jBitmap)
 
 BEATMUP_REFERENCE (jCtx, copy)
 
 return (jlong) copy
 
 JNIMETHOD (jobject, scanlineSearchInt, Java_Beatmup_Context, scanlineSearchInt)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::AbstractBitmap, bitmap, hBitmap)
 
return $pool factory makeIntPoint (jenv, result)
 
 JNIMETHOD (jobject, scanlineSearchFloat, Java_Beatmup_Context, scanlineSearchFloat)(JNIEnv *jenv
 
return ctx maxAllowedWorkerCount ((Beatmup::PoolIndex) poolIdx)
 
ctx limitWorkerCount (Beatmup::AbstractTask::validThreadCount(count),(Beatmup::PoolIndex) poolIdx)
 
 JNIMETHOD (jboolean, isGpuQueried, Java_Beatmup_Context, isGpuQueried)(JNIEnv *jenv
 
 return (jboolean) ctx -> isGpuQueried()
 
 JNIMETHOD (jboolean, isGpuReady, Java_Beatmup_Context, isGpuReady)(JNIEnv *jenv
 
 JNIMETHOD (void, recycleGPUGarbage, Java_Beatmup_Context, recycleGPUGarbage)(JNIEnv *jenv
 
ctx getGpuRecycleBin () -> emptyBin()
 
 JNIMETHOD (jlong, newContext, Java_Beatmup_Android_Context, newContext)(JNIEnv *jenv
 
return(jlong) new Beatmup JNIMETHOD (void, setInteger1, Java_Beatmup_Utils_VariablesBundle, setInteger1)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::GL::VariablesBundle, vars, hInstance)
 
 BEATMUP_STRING (name)
 
vars setInteger (nameStr, val)
 
 JNIMETHOD (void, setInteger2, Java_Beatmup_Utils_VariablesBundle, setInteger2)(JNIEnv *jenv
 
vars setInteger (nameStr, x, y)
 
 JNIMETHOD (void, setInteger3, Java_Beatmup_Utils_VariablesBundle, setInteger3)(JNIEnv *jenv
 
vars setInteger (nameStr, x, y, z)
 
 JNIMETHOD (void, setInteger4, Java_Beatmup_Utils_VariablesBundle, setInteger4)(JNIEnv *jenv
 
vars setInteger (nameStr, x, y, z, w)
 
 JNIMETHOD (void, setFloat1, Java_Beatmup_Utils_VariablesBundle, setFloat1)(JNIEnv *jenv
 
vars setFloat (nameStr, val)
 
 JNIMETHOD (void, setFloat2, Java_Beatmup_Utils_VariablesBundle, setFloat2)(JNIEnv *jenv
 
vars setFloat (nameStr, x, y)
 
 JNIMETHOD (void, setFloat3, Java_Beatmup_Utils_VariablesBundle, setFloat3)(JNIEnv *jenv
 
vars setFloat (nameStr, x, y, z)
 
 JNIMETHOD (void, setFloat4, Java_Beatmup_Utils_VariablesBundle, setFloat4)(JNIEnv *jenv
 
vars setFloat (nameStr, x, y, z, w)
 
 JNIMETHOD (void, setFloatMatrix, Java_Beatmup_Utils_VariablesBundle, setFloatMatrix)(JNIEnv *jenv
 
 switch (count)
 
jenv ReleaseFloatArrayElements (array, arrayData, JNI_ABORT)
 
 JNIMETHOD (void, setFloatMatrixFromColorMatrix, Java_Beatmup_Utils_VariablesBundle, setFloatMatrixFromColorMatrix)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::Color::Matrix, mat, jMat)
 
vars setFloatMatrix4 (nameStr, *mat)
 
 JNIMETHOD (jint, getTaskCount, Java_Beatmup_Pipelining_CustomPipeline, getTaskCount)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::CustomPipeline, pipeline, hInst)
 
 return (jint) pipeline -> getTaskCount()
 
 JNIMETHOD (jobject, getTask, Java_Beatmup_Pipelining_CustomPipeline, getTask)(JNIEnv *jenv
 
return $pool getJavaReferencepipeline (index)
 
 JNIMETHOD (jint, getTaskIndex, Java_Beatmup_Pipelining_CustomPipeline, getTaskIndex)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::CustomPipeline::TaskHolder, taskHolder, hHolder)
 
 JNIMETHOD (jlong, addTask, Java_Beatmup_Pipelining_CustomPipeline, addTask)(JNIEnv *jenv
 
 BEATMUP_REFERENCE (jHolder, newbie)
 
return() jlong (newbie)
 
 BEATMUP_OBJ (Beatmup::CustomPipeline::TaskHolder, where, hWhere)
 
 JNIMETHOD (jboolean, removeTask, Java_Beatmup_Pipelining_CustomPipeline, removeTask)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::CustomPipeline::TaskHolder, what, hHolder)
 
 if (result) BEATMUP_DELETE_REFERENCE(what)
 
 JNIMETHOD (void, measure, Java_Beatmup_Pipelining_CustomPipeline, measure)(JNIEnv *jenv
 
pipeline measure ()
 
 JNIMETHOD (jlong, newMultitask, Java_Beatmup_Pipelining_Multitask, newMultitask)(JNIEnv *jenv
 
return() jlong (new Beatmup::Multitask())
 
 JNIMETHOD (jint, getRepetitionPolicy, Java_Beatmup_Pipelining_Multitask, getRepetitionPolicy)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::Multitask, multitask, hInst)
 
 BEATMUP_CATCH ({ return static_cast< jint >(multitask->getRepetitionPolicy(*taskHolder));})
 
 JNIMETHOD (void, setRepetitionPolicy, Java_Beatmup_Pipelining_Multitask, setRepetitionPolicy)(JNIEnv *jenv
 
 BEATMUP_CATCH ({ multitask->setRepetitionPolicy(*taskHolder, static_cast< Beatmup::Multitask::RepetitionPolicy >(policy));})
 
 JNIMETHOD (jfloat, getRunTime, Java_Beatmup_Pipelining_TaskHolder, getRunTime)(JNIEnv *jenv
 
 return (jfloat) taskHolder -> getRunTime()
 
 JNIMETHOD (jlong, copy, Java_Beatmup_Sequence, copy)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::Fragments::Sequence, seq, hSeq)
 
 JNIMETHOD (void, insert, Java_Beatmup_Sequence, insert)(JNIEnv *jenv
 
 BEATMUP_OBJ (Beatmup::Fragments::Sequence, destSeq, hDestSeq)
 
 BEATMUP_OBJ (Beatmup::Fragments::Sequence, insSeq, hInsertSeq)
 
 JNIMETHOD (void, remove, Java_Beatmup_Sequence, remove)(JNIEnv *jenv
 
seq remove (start, end)
 
 JNIMETHOD (void, shrink, Java_Beatmup_Sequence, shrink)(JNIEnv *jenv
 
seq shrink (start, end)
 
 BEATMUP_OBJ (Beatmup::ChunkCollection, collection, hCollection)
 
 catch (Beatmup::Exception &ex)
 
collection close ()
 
 BEATMUP_STRING (id)
 
return collection chunkExists (JNIEnv *jenv, jobject, jlong hCollection, jstring id)
 
 BEATMUP_STRING (filename)
 
collection save (filenameStr, append==JNI_TRUE)
 
return jenv NewStringUTF (content.c_str())
 
 BEATMUP_REFERENCE (jAssetManager, instance)
 
 return (JNIEnv *jenv, jobject jTask)
 

Variables

BeatmupJavaObjectPool $pool
 
jobject jObj
 
 jobject
 
jobject jCtx
 
jobject jobject surface
 
Beatmup::Contextctx = $pool.getObject<Beatmup::Context>(jenv, jCtx)
 
 else
 
return JNI_FALSE
 
 jclass
 
jlong hCtx
 
Beatmup::Context::EventListenerlistener = ctx->getEventListener()
 
jlong h
 
JNIEnv * jenv
 
JNIEnv jlong jint poolIdx
 
JNIEnv jlong jint jobject jTask
 
 return
 
JNIEnv jlong jint jobject jboolean abort
 
JNIEnv jlong jint jint job
 
jlong jint width
 
jlong jint jint height
 
jlong jint jint jint cell
 
jlong jint jint jint jint pixelFormat
 
return(jlong) Beatmup jobject jobject jBitmap
 
Beatmup::AbstractBitmapcopy = Beatmup::BitmapTools::makeCopy(*bitmap, (Beatmup::PixelFormat)pixelFormat)
 
jobject jlong hBitmap
 
jobject jlong jint x = x
 
jobject jlong jint jint y
 
jobject jlong jint jint jint r
 
jobject jlong jint jint jint jint g
 
jobject jlong jint jint jint jint jint b
 
jobject jlong jint jint jint jint jint jint a
 
Beatmup::IntPoint result
 
JNIEnv jlong jint jint count
 
jint poolCount
 
 BEATMUP_ENTER
 
return(jlong) new Beatmup jlong hInstance
 
return(jlong) new Beatmup jlong jstring name
 
return(jlong) new Beatmup jlong jstring jint val
 
jlong jstring jint jint jint z
 
jlong jstring jint jint jint jint w
 
jlong jstring jfloatArray array
 
jfloat * arrayData = jenv->GetFloatArrayElements(array, JNI_FALSE)
 
jlong jstring jobject jMat
 
jlong hInst
 
jlong jint index
 
jlong jlong hHolder
 
return pipeline getTaskIndex * taskHolder
 
jlong jobject jHolder
 
Beatmup::CustomPipeline::TaskHoldernewbie = &pipeline->addTask(*task)
 
JNIEnv jlong jobject jobject jlong hWhere
 
jlong jlong jint policy
 
jlong hSeq
 
jlong jint start
 
jlong jint jint end
 
jlong hDestSeq
 
jlong jlong hInsertSeq
 
jlong jlong jint time
 
destSeq insert * insSeq
 
JNIEnv jlong hCollection
 
 try
 
JNIEnv jlong jstring id
 
JNIEnv jlong jstring filename
 
JNIEnv jlong jstring jboolean append
 
std::string content = collection->template read<std::string>(idStr)
 
JNIEnv jobject jAssetManager
 
JNIEnv jstring jboolean openNow
 

Function Documentation

◆ JNIMETHOD() [1/37]

JNIMETHOD ( void  ,
disposeNative  ,
Java_Beatmup_Object  ,
disposeNative   
)

◆ if() [1/4]

if ( nativeObj  )

Definition at line 65 of file wrapper_core.cpp.

65  {
68  delete nativeObj;
69  }
void nullifyHandle(JNIEnv *jenv, jobject obj)
Sets a handle of a java object to null.
Definition: objectpool.h:97
void removeAllJavaReferences(JNIEnv *jenv, const Beatmup::Object *bobj)
Removes all Java references to depending objects.
Definition: objectpool.h:127
jobject jObj
JNIEnv * jenv
BeatmupJavaObjectPool $pool

◆ JNIMETHOD() [2/37]

JNIMETHOD ( jboolean  ,
bindSurfaceToContext  ,
Java_Beatmup_Visual_Android_BasicDisplay  ,
bindSurfaceToContext   
)

◆ if() [2/4]

if ( surface  )

Definition at line 83 of file wrapper_core.cpp.

83  {
84  // bind the new one
85  ANativeWindow *wnd = ANativeWindow_fromSurface(jenv, surface);
86  if (!wnd) {
87  LOG_E("Empty surface window got when switching GL display.");
88  return JNI_FALSE;
89  }
90 
92  const bool result = Beatmup::DisplaySwitch::run(*ctx, wnd);
93  ANativeWindow_release(wnd);
94  return result ? JNI_TRUE : JNI_FALSE;
95  });
96  }
static bool run(Context &ctx, void *switchingData=nullptr)
#define LOG_E(...)
Definition: log.h:24
return JNI_FALSE
jobject jobject surface
Beatmup::Context * ctx
BEATMUP_CATCH({ return(jint) ctx->submitTask(*task,(Beatmup::PoolIndex) poolIdx);})
Beatmup::IntPoint result

◆ JNIMETHOD() [3/37]

JNIMETHOD ( jlong  ,
attachEventListener  ,
Java_Beatmup_Context  ,
attachEventListener   
)

◆ BEATMUP_OBJ() [1/16]

BEATMUP_OBJ ( Beatmup::Context  ,
ctx  ,
hCtx   
)

◆ if() [3/4]

if ( listener  )

◆ setEventListener()

ctx setEventListener ( listener  )

◆ jlong() [1/3]

return() jlong ( listener  )

◆ JNIMETHOD() [4/37]

JNIMETHOD ( void  ,
detachEventListener  ,
Java_Beatmup_Context  ,
detachEventListener   
)

◆ JNIMETHOD() [5/37]

JNIMETHOD ( jlong  ,
getTotalRam  ,
Java_Beatmup_Context  ,
getTotalRam   
)

◆ return() [1/6]

return ( JNIEnv *  jenv,
jobject  ,
jlong  hCtx,
jint  poolIdx,
jobject  jTask 
)

Definition at line 131 of file wrapper_core.cpp.

136 {
140  BEATMUP_CATCH({
142  });
143  return -1;
144 }
Task: an operation that can be executed by multiple threads in parallel.
Definition: parallelism.h:90
Android context.
Definition: context.h:32
float performTask(AbstractTask &task, const PoolIndex pool=DEFAULT_POOL)
Performs a given task.
Definition: context.cpp:240
unsigned char PoolIndex
number of tread pools or a pool index
Definition: parallelism.h:67
JNIEnv jlong jint jobject jTask
jlong hCtx
JNIEnv jlong jint poolIdx
BEATMUP_ENTER
BEATMUP_OBJ(Beatmup::Context, ctx, hCtx)
Beatmup::NNets::InferenceTask * task

◆ BEATMUP_OBJ() [2/16]

BEATMUP_OBJ ( Beatmup::Android::Context  ,
ctx  ,
hCtx   
)

◆ BEATMUP_OBJ() [3/16]

BEATMUP_OBJ ( Beatmup::AbstractTask  ,
task  ,
jTask   
)

◆ BEATMUP_CATCH() [1/10]

BEATMUP_CATCH ( { return(jint) ctx->submitTask(*task,(Beatmup::PoolIndex) poolIdx);}  )

◆ BEATMUP_CATCH() [2/10]

BEATMUP_CATCH ( { return ctx->submitPersistentTask(*task,(Beatmup::PoolIndex) poolIdx);}  )

◆ BEATMUP_CATCH() [3/10]

BEATMUP_CATCH ( { ctx->repeatTask(*task, abort==JNI_TRUE,(Beatmup::PoolIndex) poolIdx);}  )

◆ BEATMUP_CATCH() [4/10]

BEATMUP_CATCH ( { ctx->waitForJob(job,(Beatmup::PoolIndex) poolIdx);}  )

◆ BEATMUP_CATCH() [5/10]

BEATMUP_CATCH ( { return ctx->abortJob(job,(Beatmup::PoolIndex) poolIdx) ? JNI_TRUE :JNI_FALSE;}  )

◆ BEATMUP_CATCH() [6/10]

BEATMUP_CATCH ( { ctx->wait((Beatmup::PoolIndex) poolIdx);}  )

◆ BEATMUP_CATCH() [7/10]

BEATMUP_CATCH ( { return ctx->busy((Beatmup::PoolIndex) poolIdx) ? JNI_TRUE :JNI_FALSE;}  )

◆ BEATMUP_CATCH() [8/10]

BEATMUP_CATCH ( { ctx->check((Beatmup::PoolIndex) poolIdx);}  )

◆ JNIMETHOD() [6/37]

JNIMETHOD ( jlong  ,
renderChessboard  ,
Java_Beatmup_Context  ,
renderChessboard   
)

◆ JNIMETHOD() [7/37]

return (jlong) Beatmup JNIMETHOD ( jlong  ,
copyBitmap  ,
Java_Beatmup_Context  ,
copyBitmap   
)

◆ BEATMUP_OBJ() [4/16]

BEATMUP_OBJ ( Beatmup::AbstractBitmap  ,
bitmap  ,
jBitmap   
)

◆ BEATMUP_REFERENCE() [1/3]

BEATMUP_REFERENCE ( jCtx  ,
copy   
)

◆ return() [2/6]

return ( jlong  )

◆ JNIMETHOD() [8/37]

JNIMETHOD ( jobject  ,
scanlineSearchInt  ,
Java_Beatmup_Context  ,
scanlineSearchInt   
)

◆ BEATMUP_OBJ() [5/16]

BEATMUP_OBJ ( Beatmup::AbstractBitmap  ,
bitmap  ,
hBitmap   
)

◆ makeIntPoint()

return $pool factory makeIntPoint ( jenv  ,
result   
)

◆ JNIMETHOD() [9/37]

JNIMETHOD ( jobject  ,
scanlineSearchFloat  ,
Java_Beatmup_Context  ,
scanlineSearchFloat   
)

◆ maxAllowedWorkerCount()

return ctx maxAllowedWorkerCount ( (Beatmup::PoolIndex poolIdx)

◆ limitWorkerCount()

ctx limitWorkerCount ( Beatmup::AbstractTask::validThreadCount(count ,
(Beatmup::PoolIndex poolIdx 
)

◆ JNIMETHOD() [10/37]

JNIMETHOD ( jboolean  ,
isGpuQueried  ,
Java_Beatmup_Context  ,
isGpuQueried   
)

◆ return() [3/6]

return ( jboolean  ) -> isGpuQueried()

◆ JNIMETHOD() [11/37]

JNIMETHOD ( jboolean  ,
isGpuReady  ,
Java_Beatmup_Context  ,
isGpuReady   
)

◆ JNIMETHOD() [12/37]

JNIMETHOD ( void  ,
recycleGPUGarbage  ,
Java_Beatmup_Context  ,
recycleGPUGarbage   
)

◆ getGpuRecycleBin()

ctx getGpuRecycleBin ( ) -> emptyBin()

◆ JNIMETHOD() [13/37]

JNIMETHOD ( jlong  ,
newContext  ,
Java_Beatmup_Android_Context  ,
newContext   
)

◆ JNIMETHOD() [14/37]

return (jlong) new Beatmup JNIMETHOD ( void  ,
setInteger1  ,
Java_Beatmup_Utils_VariablesBundle  ,
setInteger1   
)
new

◆ BEATMUP_OBJ() [6/16]

BEATMUP_OBJ ( Beatmup::GL::VariablesBundle  ,
vars  ,
hInstance   
)

◆ BEATMUP_STRING() [1/3]

BEATMUP_STRING ( name  )

◆ setInteger() [1/4]

vars setInteger ( nameStr  ,
val   
)

◆ JNIMETHOD() [15/37]

JNIMETHOD ( void  ,
setInteger2  ,
Java_Beatmup_Utils_VariablesBundle  ,
setInteger2   
)

◆ setInteger() [2/4]

vars setInteger ( nameStr  ,
x  ,
y   
)

◆ JNIMETHOD() [16/37]

JNIMETHOD ( void  ,
setInteger3  ,
Java_Beatmup_Utils_VariablesBundle  ,
setInteger3   
)

◆ setInteger() [3/4]

vars setInteger ( nameStr  ,
x  ,
y  ,
z   
)

◆ JNIMETHOD() [17/37]

JNIMETHOD ( void  ,
setInteger4  ,
Java_Beatmup_Utils_VariablesBundle  ,
setInteger4   
)

◆ setInteger() [4/4]

vars setInteger ( nameStr  ,
x  ,
y  ,
z  ,
w   
)

◆ JNIMETHOD() [18/37]

JNIMETHOD ( void  ,
setFloat1  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloat1   
)

◆ setFloat() [1/4]

vars setFloat ( nameStr  ,
val   
)

◆ JNIMETHOD() [19/37]

JNIMETHOD ( void  ,
setFloat2  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloat2   
)

◆ setFloat() [2/4]

vars setFloat ( nameStr  ,
x  ,
y   
)

◆ JNIMETHOD() [20/37]

JNIMETHOD ( void  ,
setFloat3  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloat3   
)

◆ setFloat() [3/4]

vars setFloat ( nameStr  ,
x  ,
y  ,
z   
)

◆ JNIMETHOD() [21/37]

JNIMETHOD ( void  ,
setFloat4  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloat4   
)

◆ setFloat() [4/4]

vars setFloat ( nameStr  ,
x  ,
y  ,
z  ,
w   
)

◆ JNIMETHOD() [22/37]

JNIMETHOD ( void  ,
setFloatMatrix  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloatMatrix   
)

◆ switch()

switch ( count  )

Definition at line 401 of file wrapper_core.cpp.

401  {
402  case 9:
403  vars->setFloatMatrix3(nameStr, arrayData);
404  break;
405  case 16:
406  vars->setFloatMatrix4(nameStr, arrayData);
407  break;
408  default:
409  $pool.throwToJava(jenv, "Invalid matrix size");
410  }
static void throwToJava(JNIEnv *jenv, const char *exceptionClass, const char *message)
Throws a specific exception.
Definition: objectpool.h:156
jfloat * arrayData

◆ ReleaseFloatArrayElements()

jenv ReleaseFloatArrayElements ( array  ,
arrayData  ,
JNI_ABORT   
)

◆ JNIMETHOD() [23/37]

JNIMETHOD ( void  ,
setFloatMatrixFromColorMatrix  ,
Java_Beatmup_Utils_VariablesBundle  ,
setFloatMatrixFromColorMatrix   
)

◆ BEATMUP_OBJ() [7/16]

BEATMUP_OBJ ( Beatmup::Color::Matrix  ,
mat  ,
jMat   
)

◆ setFloatMatrix4()

vars setFloatMatrix4 ( nameStr  ,
mat 
)

◆ JNIMETHOD() [24/37]

JNIMETHOD ( jint  ,
getTaskCount  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
getTaskCount   
)

◆ BEATMUP_OBJ() [8/16]

BEATMUP_OBJ ( Beatmup::CustomPipeline  ,
pipeline  ,
hInst   
)

◆ return() [4/6]

return ( jint  ) -> getTaskCount()

◆ JNIMETHOD() [25/37]

JNIMETHOD ( jobject  ,
getTask  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
getTask   
)

◆ pipeline()

return $pool getJavaReference& pipeline ( index  )

◆ JNIMETHOD() [26/37]

JNIMETHOD ( jint  ,
getTaskIndex  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
getTaskIndex   
)

◆ BEATMUP_OBJ() [9/16]

◆ JNIMETHOD() [27/37]

JNIMETHOD ( jlong  ,
addTask  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
addTask   
)

◆ BEATMUP_REFERENCE() [2/3]

BEATMUP_REFERENCE ( jHolder  ,
newbie   
)

◆ jlong() [2/3]

return() jlong ( newbie  )

◆ BEATMUP_OBJ() [10/16]

BEATMUP_OBJ ( Beatmup::CustomPipeline::TaskHolder  ,
where  ,
hWhere   
)

◆ JNIMETHOD() [28/37]

JNIMETHOD ( jboolean  ,
removeTask  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
removeTask   
)

◆ BEATMUP_OBJ() [11/16]

BEATMUP_OBJ ( Beatmup::CustomPipeline::TaskHolder  ,
what  ,
hHolder   
)

◆ if() [4/4]

if ( result  )

◆ JNIMETHOD() [29/37]

JNIMETHOD ( void  ,
measure  ,
Java_Beatmup_Pipelining_CustomPipeline  ,
measure   
)

◆ measure()

pipeline measure ( )

◆ JNIMETHOD() [30/37]

JNIMETHOD ( jlong  ,
newMultitask  ,
Java_Beatmup_Pipelining_Multitask  ,
newMultitask   
)

◆ jlong() [3/3]

return() jlong ( new   Beatmup::Multitask())

◆ JNIMETHOD() [31/37]

JNIMETHOD ( jint  ,
getRepetitionPolicy  ,
Java_Beatmup_Pipelining_Multitask  ,
getRepetitionPolicy   
)

◆ BEATMUP_OBJ() [12/16]

BEATMUP_OBJ ( Beatmup::Multitask  ,
multitask  ,
hInst   
)

◆ BEATMUP_CATCH() [9/10]

BEATMUP_CATCH ( { return static_cast< jint >(multitask->getRepetitionPolicy(*taskHolder));}  )

◆ JNIMETHOD() [32/37]

JNIMETHOD ( void  ,
setRepetitionPolicy  ,
Java_Beatmup_Pipelining_Multitask  ,
setRepetitionPolicy   
)

◆ BEATMUP_CATCH() [10/10]

BEATMUP_CATCH ( { multitask->setRepetitionPolicy(*taskHolder, static_cast< Beatmup::Multitask::RepetitionPolicy >(policy));}  )

◆ JNIMETHOD() [33/37]

JNIMETHOD ( jfloat  ,
getRunTime  ,
Java_Beatmup_Pipelining_TaskHolder  ,
getRunTime   
)

◆ return() [5/6]

return ( jfloat  ) -> getRunTime()

◆ JNIMETHOD() [34/37]

JNIMETHOD ( jlong  ,
copy  ,
Java_Beatmup_Sequence  ,
copy   
)

◆ BEATMUP_OBJ() [13/16]

BEATMUP_OBJ ( Beatmup::Fragments::Sequence  ,
seq  ,
hSeq   
)

◆ JNIMETHOD() [35/37]

JNIMETHOD ( void  ,
insert  ,
Java_Beatmup_Sequence  ,
insert   
)

◆ BEATMUP_OBJ() [14/16]

BEATMUP_OBJ ( Beatmup::Fragments::Sequence  ,
destSeq  ,
hDestSeq   
)

◆ BEATMUP_OBJ() [15/16]

BEATMUP_OBJ ( Beatmup::Fragments::Sequence  ,
insSeq  ,
hInsertSeq   
)

◆ JNIMETHOD() [36/37]

JNIMETHOD ( void  ,
remove  ,
Java_Beatmup_Sequence  ,
remove   
)

◆ remove()

seq remove ( start  ,
end   
)

◆ JNIMETHOD() [37/37]

JNIMETHOD ( void  ,
shrink  ,
Java_Beatmup_Sequence  ,
shrink   
)

◆ shrink()

seq shrink ( start  ,
end   
)

◆ BEATMUP_OBJ() [16/16]

BEATMUP_OBJ ( Beatmup::ChunkCollection  ,
collection  ,
hCollection   
)

◆ catch()

catch ( Beatmup::Exception ex)

Definition at line 573 of file wrapper_core.cpp.

573 { $pool.throwToJava(jenv, "java/io/IOError", ex.what()); }
virtual const char * what() const NOEXCEPT override
Definition: exception.h:56

◆ close()

collection close ( )

◆ BEATMUP_STRING() [2/3]

BEATMUP_STRING ( id  )

◆ chunkExists()

return collection chunkExists ( JNIEnv *  jenv,
jobject  ,
jlong  hCollection,
jstring  id 
)

Definition at line 601 of file wrapper_core.cpp.

607 {
610  BEATMUP_STRING(id);
611  return (jlong)collection->chunkSize(idStr);
612 }
A key-value pair set storing pieces of arbitrary data (chunks) under string keys.
Definition: chunkfile.h:36
return() jlong(listener)
JNIEnv jlong hCollection
BEATMUP_STRING(name)

◆ BEATMUP_STRING() [3/3]

BEATMUP_STRING ( filename  )

◆ save()

collection save ( filenameStr  ,
append  = =JNI_TRUE 
)

◆ NewStringUTF()

return jenv NewStringUTF ( content.  c_str())

◆ BEATMUP_REFERENCE() [3/3]

BEATMUP_REFERENCE ( jAssetManager  ,
instance   
)

◆ return() [6/6]

return ( JNIEnv *  jenv,
jobject  jTask 
)
new

Definition at line 678 of file wrapper_core.cpp.

683 {
686  task->setCallbackObject(jenv, jTask);
687 }
Task calling method of a Java object.
Definition: callback_task.h:28

Variable Documentation

◆ $pool

Definition at line 54 of file wrapper_core.cpp.

◆ jObj

jobject jObj
Initial value:
{
Object * getObject(JNIEnv *jenv, jlong handle)
Retrieves native object by its handle.
Definition: objectpool.h:68
Beatmup object base class
Definition: basic_types.h:67

Definition at line 60 of file wrapper_core.cpp.

◆ jobject

JNIEnv jobject

Definition at line 76 of file wrapper_core.cpp.

◆ jCtx

jobject jCtx
Initial value:

Definition at line 76 of file wrapper_core.cpp.

◆ surface

jobject jobject surface
Initial value:

Definition at line 76 of file wrapper_core.cpp.

◆ ctx

Beatmup::Context* ctx = $pool.getObject<Beatmup::Context>(jenv, jCtx)

Definition at line 80 of file wrapper_core.cpp.

◆ else

else
Initial value:
{
return Beatmup::DisplaySwitch::run(*ctx, nullptr) ? JNI_TRUE : JNI_FALSE;
})

Definition at line 99 of file wrapper_core.cpp.

◆ JNI_FALSE

return JNI_FALSE

Definition at line 105 of file wrapper_core.cpp.

◆ jclass

JNIEnv jclass
Initial value:

Definition at line 112 of file wrapper_core.cpp.

◆ hCtx

jlong hCtx
Initial value:

Definition at line 112 of file wrapper_core.cpp.

◆ listener

delete listener = ctx->getEventListener()

Definition at line 115 of file wrapper_core.cpp.

◆ h

JNIEnv jlong jfloat h
Initial value:

Definition at line 123 of file wrapper_core.cpp.

◆ jenv

JNIEnv* jenv

Definition at line 147 of file wrapper_core.cpp.

◆ poolIdx

JNIEnv jlong jint poolIdx
Initial value:

Definition at line 147 of file wrapper_core.cpp.

◆ jTask

JNIEnv jlong jobject jobject jTask
Initial value:

Definition at line 147 of file wrapper_core.cpp.

◆ return

return
new
Initial value:

Definition at line 155 of file wrapper_core.cpp.

◆ abort

JNIEnv jlong jint jobject jboolean abort
Initial value:

Definition at line 171 of file wrapper_core.cpp.

◆ job

JNIEnv jlong jint jint job
Initial value:

Definition at line 182 of file wrapper_core.cpp.

◆ width

jlong jint width
Initial value:

Definition at line 235 of file wrapper_core.cpp.

◆ height

jlong jint jint height
Initial value:

Definition at line 235 of file wrapper_core.cpp.

◆ cell

jlong jint jint jint cell

Definition at line 235 of file wrapper_core.cpp.

◆ pixelFormat

return (jlong) Beatmup jobject jobject jint pixelFormat
Initial value:

Definition at line 235 of file wrapper_core.cpp.

◆ jBitmap

return (jlong) Beatmup jobject jobject jBitmap

Definition at line 243 of file wrapper_core.cpp.

◆ copy

◆ hBitmap

jlong hBitmap
Initial value:

Definition at line 253 of file wrapper_core.cpp.

◆ x

jlong jint x = x

Definition at line 253 of file wrapper_core.cpp.

◆ y

jlong jint jint y
Initial value:

Definition at line 253 of file wrapper_core.cpp.

◆ r

JNIEnv jlong jfloat r

Definition at line 253 of file wrapper_core.cpp.

◆ g

JNIEnv jlong jfloat jfloat g

Definition at line 253 of file wrapper_core.cpp.

◆ b

JNIEnv jlong jfloat jfloat jfloat b

Definition at line 253 of file wrapper_core.cpp.

◆ a

JNIEnv jlong jint jfloat jfloat jfloat jfloat jfloat a
Initial value:

Definition at line 253 of file wrapper_core.cpp.

◆ result

return result
Initial value:
)
IntPoint scanlineSearch(AbstractBitmap &source, pixint4 val, const IntPoint &startFrom)
Goes through a bitmap in scanline order (left to right, top to bottom) until a pixel of a given color...
Definition: tools.cpp:195
4-channel integer arithmetic
jobject jlong jint jint jint jint g
jobject jlong jint jint jint jint jint b
jobject jlong jint jint y
jobject jlong jint jint jint r
jobject jlong jint jint jint jint jint jint a
jobject jlong jint x
Beatmup::InternalBitmap * bitmap

Definition at line 256 of file wrapper_core.cpp.

◆ count

int count
Initial value:

Definition at line 287 of file wrapper_core.cpp.

◆ poolCount

jint poolCount
Initial value:
{
LOG_I("Beatmup is starting up...")
#define LOG_I(...)
Definition: log.h:23

Definition at line 320 of file wrapper_core.cpp.

◆ BEATMUP_ENTER

BEATMUP_ENTER

Definition at line 323 of file wrapper_core.cpp.

◆ hInstance

JNIEnv jlong hInstance
Initial value:

Definition at line 331 of file wrapper_core.cpp.

◆ name

jlong jstring name
Initial value:

Definition at line 331 of file wrapper_core.cpp.

◆ val

jlong jstring jfloat val
Initial value:

Definition at line 331 of file wrapper_core.cpp.

◆ z

jlong jstring jfloat jfloat jfloat z
Initial value:

Definition at line 347 of file wrapper_core.cpp.

◆ w

jlong jstring jfloat jfloat jfloat jfloat w
Initial value:

Definition at line 355 of file wrapper_core.cpp.

◆ array

jlong jstring jfloatArray array
Initial value:

Definition at line 395 of file wrapper_core.cpp.

◆ arrayData

jfloat* arrayData = jenv->GetFloatArrayElements(array, JNI_FALSE)

Definition at line 399 of file wrapper_core.cpp.

◆ jMat

jlong jobject jMat
Initial value:

Definition at line 415 of file wrapper_core.cpp.

◆ hInst

jlong hInst
Initial value:

Definition at line 427 of file wrapper_core.cpp.

◆ index

JNIEnv jlong jobject jlong jint index
Initial value:

Definition at line 434 of file wrapper_core.cpp.

◆ hHolder

jlong hHolder
Initial value:

Definition at line 441 of file wrapper_core.cpp.

◆ taskHolder

return pipeline getTaskIndex* taskHolder

Definition at line 445 of file wrapper_core.cpp.

◆ jHolder

JNIEnv jlong jobject jHolder

Definition at line 449 of file wrapper_core.cpp.

◆ newbie

Beatmup::Scene::Layer * newbie = &pipeline->addTask(*task)

Definition at line 453 of file wrapper_core.cpp.

◆ hWhere

JNIEnv jlong jobject jobject jlong hWhere
Initial value:

Definition at line 460 of file wrapper_core.cpp.

◆ policy

jlong jlong jint policy
Initial value:

Definition at line 509 of file wrapper_core.cpp.

◆ hSeq

jlong hSeq

Definition at line 534 of file wrapper_core.cpp.

◆ start

jlong jint start

Definition at line 534 of file wrapper_core.cpp.

◆ end

jlong jint jint end
Initial value:

Definition at line 534 of file wrapper_core.cpp.

◆ hDestSeq

jlong hDestSeq

Definition at line 540 of file wrapper_core.cpp.

◆ hInsertSeq

jlong jlong hInsertSeq

Definition at line 540 of file wrapper_core.cpp.

◆ time

jlong jlong jint time
Initial value:

Definition at line 540 of file wrapper_core.cpp.

◆ insSeq

destSeq insert* insSeq

Definition at line 544 of file wrapper_core.cpp.

◆ hCollection

JNIEnv jlong hCollection
Initial value:

Definition at line 566 of file wrapper_core.cpp.

◆ try

try
Initial value:
{
collection->open()

Definition at line 570 of file wrapper_core.cpp.

◆ id

JNIEnv jlong jstring id
Initial value:

Definition at line 596 of file wrapper_core.cpp.

◆ filename

JNIEnv jstring filename
Initial value:
{
AAssetManager *assetManager = AAssetManager_fromJava(jenv, jAssetManager)
JNIEnv jobject jAssetManager

Definition at line 616 of file wrapper_core.cpp.

◆ append

JNIEnv jlong jstring jboolean append
Initial value:

Definition at line 616 of file wrapper_core.cpp.

◆ content

std::string content = collection->template read<std::string>(idStr)

Definition at line 631 of file wrapper_core.cpp.

◆ jAssetManager

JNIEnv jobject jAssetManager

Definition at line 640 of file wrapper_core.cpp.

◆ openNow

JNIEnv jstring jboolean openNow
Initial value:

Definition at line 659 of file wrapper_core.cpp.