diff options
-rw-r--r-- | CMakeLists.txt | 24 | ||||
-rw-r--r-- | apps/samples/put-that-there/put-that-there.scxml | 19 |
2 files changed, 34 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index facdd3d..30187d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -740,18 +740,26 @@ if (NOT AUDIOTOOLBOX_FOUND) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_STATIC}) endif() -find_package(MILES) +find_package(MILES COMPONENTS audio video core) if (MILES_FOUND) + # openal is only needed for miles find_package(OpenAL) find_package(JPEG) - list (APPEND MILES_LIBRARIES "iconv") - list (APPEND MILES_LIBRARIES ${JPEG_LIBRARIES}) - list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - - include_directories (${MILES_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) - # list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + find_package(ICONV) + + if (OPENAL_FOUND AND ICONV_FOUND AND JPEG_FOUND) + include_directories (${MILES_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) + include_directories (${ICONV_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) + include_directories (${JPEG_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${JPEG_LIBRARIES}) + include_directories (${OPENAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + else() + set(MILES_FOUND OFF) + endif() endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) diff --git a/apps/samples/put-that-there/put-that-there.scxml b/apps/samples/put-that-there/put-that-there.scxml index 43a6b37..301e34b 100644 --- a/apps/samples/put-that-there/put-that-there.scxml +++ b/apps/samples/put-that-there/put-that-there.scxml @@ -2,6 +2,11 @@ xmlns="http://www.w3.org/2005/07/scxml" xmlns:scenegraph="http://uscxml.tk.informatik.tu-darmstadt.de/scenegraph.xsd"> <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" /> + + <datamodel> + <data id="foo">This is foo!</data> + </datamodel> + <state id="start"> <invoke type="scenegraph"> <content> @@ -27,8 +32,10 @@ </content> </invoke> <state id="main"> + <transition event="http" target="main" type="internal" - cond="_event.data.pathComponent[1] === 'basichttp' && _event.data.pathComponent[2] === 'query'" > + cond="_event.data.path Component[1] === 'basichttp' && + _event.data.pathComponent[2] === 'query'" > <!-- a request for /ptt/basichttp/query --> <script>dump(_event);</script> <if cond="_event.data.header['X-XPath']"> @@ -41,6 +48,11 @@ _event.reply = "No nodes!"; } </script> + <elseif cond="_event.data.header['X-ECMAPath']" /> + <script> + // an ecmascript expression evaluate and set reply on event + _event.reply = eval(_event.data.header['X-ECMAPath']); + </script> </if> <send type="basichttp" targetexpr="_event.data.header['X-Reply-To']"> <content expr="_event.reply" /> @@ -61,6 +73,11 @@ _event.reply = "No nodes!"; } </script> + <elseif cond="_event.data.header['X-ECMAPath']" /> + <script> + // an ecmascript expression evaluate and set reply on event + _event.reply = eval(_event.data.header['X-ECMAPath']); + </script> </if> <respond to="_event.origin"> <content expr="_event.reply" /> |