[Julius-cvs 494] CVS update: julius4/msvc/SampleApp

アーカイブの一覧に戻る

sumom****@users***** sumom****@users*****
2009年 11月 6日 (金) 13:47:47 JST


Index: julius4/msvc/SampleApp/Julius.cpp
diff -u julius4/msvc/SampleApp/Julius.cpp:1.5 julius4/msvc/SampleApp/Julius.cpp:1.6
--- julius4/msvc/SampleApp/Julius.cpp:1.5	Tue Oct 27 23:56:58 2009
+++ julius4/msvc/SampleApp/Julius.cpp	Fri Nov  6 13:47:47 2009
@@ -44,10 +44,13 @@
 	size_t size = 0;
 	WPARAM wparam = 0;
 	_locale_t locale;
+	unsigned int code;
 
 	r = j->getRecog()->process_list;
 	if (! r->live) return;
+
 	if (r->result.status < 0) {      /* no results obtained */
+
 		switch(r->result.status) {
 		case J_RESULT_STATUS_REJECT_POWER:
 			strcpy(str, "<input rejected by power>");
@@ -68,15 +71,18 @@
 			strcpy(str, "<search failed>");
 			break;
 		}
-		return;
-    }
+		code = (- r->result.status);
 
-    winfo = r->lm->winfo;
-	s = &(r->result.sent[0]);
-	seq = s->word;
-	seqnum = s->word_num;
-	str[0] = '\0';
-	for(i=0;i<seqnum;i++) strcat(str, winfo->woutput[seq[i]]);
+	} else {
+
+	    winfo = r->lm->winfo;
+		s = &(r->result.sent[0]);
+		seq = s->word;
+		seqnum = s->word_num;
+		str[0] = '\0';
+		for(i=0;i<seqnum;i++) strcat(str, winfo->woutput[seq[i]]);
+		code = 0;
+	}
 
 	// convert to wide char
 	//mbstowcs_s( &size, wstr, str, strlen(str)+1);
@@ -86,7 +92,7 @@
 
 
 	// set status parameter
-	wparam = (r->result.status << 16) + JEVENT_RESULT_FINAL;
+	wparam = (code << 16) + JEVENT_RESULT_FINAL;
 
 	// send message
 	SendMessage(j->getWindow(), WM_JULIUS, wparam, (LPARAM)wstr);
Index: julius4/msvc/SampleApp/SampleApp.cpp
diff -u julius4/msvc/SampleApp/SampleApp.cpp:1.3 julius4/msvc/SampleApp/SampleApp.cpp:1.4
--- julius4/msvc/SampleApp/SampleApp.cpp:1.3	Fri Oct 23 09:31:12 2009
+++ julius4/msvc/SampleApp/SampleApp.cpp	Fri Nov  6 13:47:47 2009
@@ -182,7 +182,7 @@
 		case JEVENT_RESULT_PASS1:	DebugOut(hWnd, L"Result Pass1"); break;
 		case JEVENT_RESULT_FINAL:	DebugOut(hWnd, L"Result Final");
 			jResultId = HIWORD(wParam);
-			if (jResultId < 0) {
+			if (jResultId != 0) {
 				DebugOut(hWnd, L"No result");
 			} else {
 				DebugOut(hWnd, (wchar_t *)lParam);



Julius-cvs メーリングリストの案内
アーカイブの一覧に戻る