Mercurial > hg > audiodb
comparison query-indexed.cpp @ 589:9119f2fa3efe
Header file rearrangement
Make it so that lshlib.h is slightly more like a header file to include
to use the LSH ("class G") class, and slightly less a header file for
developing that class, by removing all the #includes and moving them to
the one-file lshlib.cpp instead.
Make audioDB-internals.h slightly more of a project header file, by
including there all the headers we actually need.
Remove some assert()s (which do nothing) and some Uns32Ts (-> uint32_t)
author | mas01cr |
---|---|
date | Tue, 11 Aug 2009 21:42:13 +0000 |
parents | 57e459f62788 |
children | e21a3db643af |
comparison
equal
deleted
inserted
replaced
588:638e1647b199 | 589:9119f2fa3efe |
---|---|
1 extern "C" { | 1 extern "C" { |
2 #include "audioDB_API.h" | 2 #include "audioDB_API.h" |
3 } | 3 } |
4 #include "audioDB-internals.h" | 4 #include "audioDB-internals.h" |
5 #include "lshlib.h" | |
5 | 6 |
6 /* | 7 /* |
7 * Routines and datastructures which are specific to indexed queries. | 8 * Routines and datastructures which are specific to indexed queries. |
8 */ | 9 */ |
9 typedef struct adb_qcallback { | 10 typedef struct adb_qcallback { |
38 | 39 |
39 delete[] indexName; | 40 delete[] indexName; |
40 return true; | 41 return true; |
41 } | 42 } |
42 | 43 |
43 void audiodb_index_add_point_approximate(void *user_data, Uns32T pointID, Uns32T qpos, float dist) { | 44 void audiodb_index_add_point_approximate(void *user_data, uint32_t pointID, uint32_t qpos, float dist) { |
44 adb_qcallback_t *data = (adb_qcallback_t *) user_data; | 45 adb_qcallback_t *data = (adb_qcallback_t *) user_data; |
45 adb_t *adb = data->adb; | 46 adb_t *adb = data->adb; |
46 adb_qstate_internal_t *qstate = data->qstate; | 47 adb_qstate_internal_t *qstate = data->qstate; |
47 uint32_t trackID = audiodb_index_to_track_id(adb, pointID); | 48 uint32_t trackID = audiodb_index_to_track_id(adb, pointID); |
48 uint32_t spos = audiodb_index_to_track_pos(adb, trackID, pointID); | 49 uint32_t spos = audiodb_index_to_track_pos(adb, trackID, pointID); |
57 } | 58 } |
58 } | 59 } |
59 | 60 |
60 // Maintain a queue of points to pass to audiodb_query_queue_loop() | 61 // Maintain a queue of points to pass to audiodb_query_queue_loop() |
61 // for exact evaluation | 62 // for exact evaluation |
62 void audiodb_index_add_point_exact(void *user_data, Uns32T pointID, Uns32T qpos, float dist) { | 63 void audiodb_index_add_point_exact(void *user_data, uint32_t pointID, uint32_t qpos, float dist) { |
63 adb_qcallback_t *data = (adb_qcallback_t *) user_data; | 64 adb_qcallback_t *data = (adb_qcallback_t *) user_data; |
64 adb_t *adb = data->adb; | 65 adb_t *adb = data->adb; |
65 adb_qstate_internal_t *qstate = data->qstate; | 66 adb_qstate_internal_t *qstate = data->qstate; |
66 uint32_t trackID = audiodb_index_to_track_id(adb, pointID); | 67 uint32_t trackID = audiodb_index_to_track_id(adb, pointID); |
67 uint32_t spos = audiodb_index_to_track_pos(adb, trackID, pointID); | 68 uint32_t spos = audiodb_index_to_track_pos(adb, trackID, pointID); |