comparison bindings/java/AudioDB.java @ 698:10d3692e0b06

* Initial commit of Java bindings. * Currently supports creation of db. More to come!
author mas01mj
date Mon, 26 Apr 2010 17:17:07 +0000
parents
children
comparison
equal deleted inserted replaced
697:2741bbda39d7 698:10d3692e0b06
1 import java.io.File;
2
3 public class AudioDB
4 {
5 public native boolean audiodb_create(String path, int datasize, int ntracks, int datadim);
6 public native boolean audiodb_open(String path, Mode mode);
7
8 public native void insert();
9 public native void query();
10 public native void status();
11
12 public enum Mode { O_RDONLY, O_RDRW }
13
14 private File path;
15
16 public AudioDB(File path)
17 {
18 this.path = path;
19 }
20
21 public boolean create(int datasize, int ntracks, int datadim)
22 {
23 return audiodb_create(path.toString(), datasize, ntracks, datadim);
24 }
25
26 public boolean open(Mode mode)
27 {
28 return audiodb_open(path.toString(), mode);
29 }
30
31 static {
32 System.loadLibrary("AudioDB_JNI");
33 }
34
35
36 public static void main(String args[])
37 {
38 AudioDB testDB = new AudioDB(new File("test.adb"));
39 testDB.create(5, 5, 12);
40 testDB.open(Mode.O_RDRW);
41 }
42 }
43
44