@@ -602,7 +602,11 @@ EMSCRIPTEN_BINDINGS(Vortex) {
602602 .function (" parseJson" , &Vortex::parseJson)
603603 .function (" setLockEnabled" , &Vortex::setLockEnabled)
604604 .function (" lockEnabled" , &Vortex::lockEnabled)
605- .function (" engine" , &Vortex::engine);
605+ .function (" engine" , &Vortex::engine)
606+ .function (" getVersion" , &Vortex::getVersion)
607+ .function (" getVersionMajor" , &Vortex::getVersionMajor)
608+ .function (" getVersionMinor" , &Vortex::getVersionMinor)
609+ .function (" getVersionBuild" , &Vortex::getVersionBuild);
606610
607611 function (" getDataArray" , &getDataArray);
608612 function (" getRawDataArray" , &getRawDataArray);
@@ -1991,6 +1995,24 @@ string Vortex::getStorageFilename()
19911995 return m_engine.storage ().getStorageFilename ();
19921996}
19931997
1998+ // get the engine version as a string
1999+ std::string Vortex::getVersion () const {
2000+ return VORTEX_VERSION;
2001+ }
2002+
2003+ // get the version as separated integers
2004+ uint8_t Vortex::getVersionMajor () const {
2005+ return VORTEX_VERSION_MAJOR;
2006+ }
2007+
2008+ uint8_t Vortex::getVersionMinor () const {
2009+ return VORTEX_VERSION_MINOR;
2010+ }
2011+
2012+ uint8_t Vortex::getVersionBuild () const {
2013+ return VORTEX_BUILD_NUMBER;
2014+ }
2015+
19942016json Vortex::modeToJson (const Mode *mode)
19952017{
19962018 if (!mode) {
@@ -2216,6 +2238,7 @@ json Vortex::saveToJson()
22162238
22172239 saveJson[" version_major" ] = static_cast <uint8_t >(VORTEX_VERSION_MAJOR);
22182240 saveJson[" version_minor" ] = static_cast <uint8_t >(VORTEX_VERSION_MINOR);
2241+ saveJson[" version_build" ] = static_cast <uint8_t >(VORTEX_BUILD_NUMBER);
22192242 saveJson[" global_flags" ] = m_engine.modes ().globalFlags ();
22202243 saveJson[" brightness" ] = static_cast <uint8_t >(m_engine.leds ().getBrightness ());
22212244
0 commit comments