Mercurial > hg > audiodb
view bindings/java/AudioDB.java @ 719:e3f1cf653c30
wooo! direct insert works! at least for the rather limited cases I've tests.
Bad news is that I seem to have found a rather nasty bug in the query code I wrote back in september.
(segfaults around line 471 if the query returns no results...)
author | map01bf |
---|---|
date | Fri, 25 Jun 2010 09:08:56 +0000 |
parents | 10d3692e0b06 |
children |
line wrap: on
line source
import java.io.File; public class AudioDB { public native boolean audiodb_create(String path, int datasize, int ntracks, int datadim); public native boolean audiodb_open(String path, Mode mode); public native void insert(); public native void query(); public native void status(); public enum Mode { O_RDONLY, O_RDRW } private File path; public AudioDB(File path) { this.path = path; } public boolean create(int datasize, int ntracks, int datadim) { return audiodb_create(path.toString(), datasize, ntracks, datadim); } public boolean open(Mode mode) { return audiodb_open(path.toString(), mode); } static { System.loadLibrary("AudioDB_JNI"); } public static void main(String args[]) { AudioDB testDB = new AudioDB(new File("test.adb")); testDB.create(5, 5, 12); testDB.open(Mode.O_RDRW); } }