Commit 741ae3a3 authored by Geoffrey Métais's avatar Geoffrey Métais

Imlement new start() method

parent 63d93037
......@@ -61,6 +61,12 @@ AndroidMediaLibrary::initML(const std::string& dbPath, const std::string& thumbs
return p_ml->initialize(dbPath, thumbsPath, this);
}
void
AndroidMediaLibrary::start()
{
p_ml->start();
}
bool
AndroidMediaLibrary::addDevice(const std::string& uuid, const std::string& path, bool removable)
{
......
......@@ -29,6 +29,7 @@ public:
~AndroidMediaLibrary();
bool initML(const std::string& dbPath, const std::string& thumbsPath);
void start();
bool addDevice(const std::string& uuid, const std::string& path, bool removable);
std::vector<std::tuple<std::string, std::string, bool>> devices();
bool removeDevice(const std::string& uuid);
......
......@@ -40,7 +40,14 @@ init(JNIEnv* env, jobject thiz, jstring dbPath, jstring thumbsPath)
return m_IsInitialized;
}
void release(JNIEnv* env, jobject thiz)
void
start(JNIEnv* env, jobject thiz)
{
MediaLibrary_getInstance(env, thiz)->start();
}
void
release(JNIEnv* env, jobject thiz)
{
LOGD("/!\\ release medialib. /!\\");
AndroidMediaLibrary *aml = MediaLibrary_getInstance(env, thiz);
......@@ -743,6 +750,7 @@ playlistDelete(JNIEnv* env, jobject thiz, jobject medialibrary, jlong playlistId
static JNINativeMethod methods[] = {
{"nativeSetup", "()V", (void*)setup },
{"nativeInit", "(Ljava/lang/String;Ljava/lang/String;)Z", (void*)init },
{"nativeStart", "()V", (void*)start },
{"nativeRelease", "()V", (void*)release },
{"nativeAddDevice", "(Ljava/lang/String;Ljava/lang/String;Z)Z", (void*)addDevice },
{"nativeDevices", "()[Ljava/lang/String;", (void*)devices },
......
......@@ -74,6 +74,10 @@ public class Medialibrary {
return mIsInitiated;
}
public void start() {
nativeStart();
}
public void banFolder(String path) {
if (mIsInitiated && new File(path).exists())
nativeBanFolder(Tools.encodeVLCMrl(path));
......@@ -536,6 +540,7 @@ public class Medialibrary {
// Native methods
private native void nativeSetup();
private native boolean nativeInit(String dbPath, String thumbsPath);
private native void nativeStart();
private native void nativeRelease();
private native void nativeBanFolder(String path);
private native boolean nativeAddDevice(String uuid, String path, boolean removable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment