Mercurial > hg > audiodb
comparison soap.cpp @ 328:7ff56cce3297
Added WS support for Radius search by featureFileName via adb__sequenceQueryByKey(). Added relative path support for non-large ADB.
author | mas01mc |
---|---|
date | Sat, 30 Aug 2008 13:41:50 +0000 |
parents | c93be2f3a674 |
children | 8f11ea4d9cd2 |
comparison
equal
deleted
inserted
replaced
327:cb53c45718e6 | 328:7ff56cce3297 |
---|---|
49 soap_end(&soap); | 49 soap_end(&soap); |
50 soap_done(&soap); | 50 soap_done(&soap); |
51 } | 51 } |
52 | 52 |
53 // WS_QUERY_BY_KEY (CLIENT SIDE) | 53 // WS_QUERY_BY_KEY (CLIENT SIDE) |
54 void audioDB::ws_query_by_key(const char*dbName, const char *trackKey, const char* hostport){ | 54 void audioDB::ws_query_by_key(const char*dbName, const char *trackKey, const char* featureFileName, const char* hostport){ |
55 struct soap soap; | 55 struct soap soap; |
56 adb__queryResponse adbQueryResponse; | 56 adb__queryResponse adbQueryResponse; |
57 /* JUST TRY TO USE A DATA STRUCTURE WITH PHP | 57 /* JUST TRY TO USE A DATA STRUCTURE WITH PHP |
58 adb__sequenceQueryParms asqp; | 58 adb__sequenceQueryParms asqp; |
59 asqp.keyList = (char*)trackFileName; | 59 asqp.keyList = (char*)trackFileName; |
70 */ | 70 */ |
71 | 71 |
72 soap_init(&soap); | 72 soap_init(&soap); |
73 if(queryType==O2_SEQUENCE_QUERY || queryType==O2_N_SEQUENCE_QUERY){ | 73 if(queryType==O2_SEQUENCE_QUERY || queryType==O2_N_SEQUENCE_QUERY){ |
74 if(soap_call_adb__sequenceQueryByKey(&soap,hostport,NULL, | 74 if(soap_call_adb__sequenceQueryByKey(&soap,hostport,NULL, |
75 (char*)dbName, | 75 (char*)dbName, |
76 (char*)trackKey, | 76 (char*)trackKey, |
77 queryType, | 77 (char*)featureFileName, |
78 (char*)trackFileName, | 78 queryType, |
79 (char*)timesFileName, | 79 (char*)trackFileName, // this means keyFileName |
80 (char*)timesFileName, | |
80 queryPoint, | 81 queryPoint, |
81 pointNN, | 82 pointNN, |
82 trackNN, | 83 trackNN, |
83 sequenceLength, | 84 sequenceLength, |
84 radius, | 85 radius, |
85 absolute_threshold, | 86 absolute_threshold, |
86 usingQueryPoint, | 87 usingQueryPoint, |
87 lsh_exact, | 88 lsh_exact, |
88 adbQueryResponse)==SOAP_OK){ | 89 adbQueryResponse)==SOAP_OK){ |
89 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; | 90 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; |
90 for(int i=0; i<adbQueryResponse.result.__sizeRlist; i++) | 91 for(int i=0; i<adbQueryResponse.result.__sizeRlist; i++) |
91 std::cout << adbQueryResponse.result.Rlist[i] << " " << adbQueryResponse.result.Dist[i] | 92 std::cout << adbQueryResponse.result.Rlist[i] << " " << adbQueryResponse.result.Dist[i] |
177 } | 178 } |
178 } | 179 } |
179 | 180 |
180 int adb__sequenceQueryByKey(struct soap* soap,xsd__string dbName, | 181 int adb__sequenceQueryByKey(struct soap* soap,xsd__string dbName, |
181 xsd__string trackKey, | 182 xsd__string trackKey, |
183 xsd__string featureFileName, | |
182 xsd__int queryType, | 184 xsd__int queryType, |
183 xsd__string trackFileName, | 185 xsd__string keyFileName, |
184 xsd__string timesFileName, | 186 xsd__string timesFileName, |
185 xsd__int queryPoint, | 187 xsd__int queryPoint, |
186 xsd__int pointNN, | 188 xsd__int pointNN, |
187 xsd__int trackNN, | 189 xsd__int trackNN, |
188 xsd__int sequenceLength, | 190 xsd__int sequenceLength, |
220 "./audioDB", | 222 "./audioDB", |
221 COM_QUERY, | 223 COM_QUERY, |
222 qtypeStr, | 224 qtypeStr, |
223 COM_DATABASE, | 225 COM_DATABASE, |
224 dbName, | 226 dbName, |
225 COM_QUERYKEY, | 227 strlen(trackKey)?COM_QUERYKEY:COM_FEATURES, |
226 ENSURE_STRING(trackKey), | 228 strlen(trackKey)?ENSURE_STRING(trackKey):ENSURE_STRING(featureFileName), |
227 COM_KEYLIST, | 229 COM_KEYLIST, |
228 ENSURE_STRING(trackFileName), | 230 ENSURE_STRING(keyFileName), |
229 usingQueryPoint?COM_QPOINT:COM_EXHAUSTIVE, | 231 usingQueryPoint?COM_QPOINT:COM_EXHAUSTIVE, |
230 usingQueryPoint?qPosStr:"", | 232 usingQueryPoint?qPosStr:"", |
231 COM_POINTNN, | 233 COM_POINTNN, |
232 pointNNStr, | 234 pointNNStr, |
233 COM_TRACKNN, | 235 COM_TRACKNN, |