Mercurial > hg > audiodb
comparison bindings/java/src/org/omras2/AudioDB.java @ 722:56e97aa9d0ae
Switched over to using build.xml - much simpler, and keeps generated code separate.
author | mas01mj |
---|---|
date | Wed, 14 Jul 2010 15:54:58 +0000 |
parents | |
children | 11fd16e1d8b3 |
comparison
equal
deleted
inserted
replaced
721:70542745f473 | 722:56e97aa9d0ae |
---|---|
1 package org.omras2; | |
2 | |
3 import java.io.File; | |
4 | |
5 public class AudioDB | |
6 { | |
7 public native boolean audiodb_create(String path, int datasize, int ntracks, int datadim); | |
8 public native boolean audiodb_open(String path, Mode mode); | |
9 public native void audiodb_status(); | |
10 | |
11 public native void insert(); | |
12 public native void query(); | |
13 public native void status(); | |
14 | |
15 public enum Mode { O_RDONLY, O_RDRW } | |
16 | |
17 private File path; | |
18 | |
19 public AudioDB(File path) | |
20 { | |
21 this.path = path; | |
22 } | |
23 | |
24 public boolean create(int datasize, int ntracks, int datadim) | |
25 { | |
26 return audiodb_create(path.toString(), datasize, ntracks, datadim); | |
27 } | |
28 | |
29 public boolean open(Mode mode) | |
30 { | |
31 return audiodb_open(path.toString(), mode); | |
32 } | |
33 | |
34 public void getStatus() | |
35 { | |
36 audiodb_status(); | |
37 } | |
38 | |
39 static { | |
40 System.loadLibrary("AudioDB_JNI"); | |
41 } | |
42 | |
43 | |
44 public static void main(String args[]) | |
45 { | |
46 AudioDB testDB = new AudioDB(new File("test.adb")); | |
47 testDB.create(5, 5, 12); | |
48 testDB.open(Mode.O_RDRW); | |
49 // testDB.getStatus(); | |
50 } | |
51 } | |
52 | |
53 |