MATRIC major update is here!

MATRIC major update is here!

I know there weren't many updates in a while, but rest assured, we were hard at work. So what were we up to you might ask?

MATRIC has grown in features signifficantly since it's initial release and we found adding new stuff gets harder and harder to do so we decided to conduct a major effort to make MATRIC easier to develop and maintain.

 

1.50 beta is available in the download section

Here is the change log:

  • User interface enhancements
    We rewrote the UI completely from the scratch throwing away thousands of lines of code, but it was worth it. Do not worry - it is very similar to current one only better and with new useful features added. To give you a few examples:
    • You can make a copy of a page with one click (I know many of you asked for that feature)
    • You can copy a page from one deck to another (hooray!)
    • Settings dialog removes the need for messing around with config file
    • Asynchronous operations - deck export and publish are now interactive, you'll see exactly what is going on. No more UI freeze while deck is being exported/published.
  • Beta Channel
    Now you can choose (in settings) to recieve beta version update notifications in the app itself so if you want to be on the leading edge of MATRIC development you don't have to check MATRIC web or Discord to see what is available.
  • Auto deck switcher
    It switches decks on your devices depending on which application is in the foreground, you don't have to change decks yourself as you switch from one app to another - MATRIC can now do that automatically. You can have your custom context sensitive touch interface similar to Apple's Touch Bar. We believe it will be a very powerful productivity booster. How cool is that?
  • Full support for Material design icons
    Matric now supports both the Google material icons and Material design icons. To make your button display an icon, type the icon name in the text field. For a full list of supported icons go to: 
    https://materialdesignicons.com/ (prefix the icon name with "mdi-") and https://material.io/resources/icons/
  • Play audio on PC action
    You guessed it - plays an audio file on PC, you choose an MP3 or some other compatible audio file and MATRIC will play it on PC. Now you can be a DJ.
  • Open web page action
    While you could make MATRIC open a browser web page, you needed to fiddle with Run App action. Now it is much simpler to do with Open web page. Just enter an address and MATRIC will open it in browser.
     

 

Version 1.30 released

Changes:

  • Expanded OBS Studio integration
    - added volume control for audio sources

Bugfixes:

  • Added workaround for some router compatibility issues
  • Removed library deck preview limit - now every deck is shown completely in library when expanded
  • Added message screen after google login on community gallery
  • Fixed several UI inconsistencies in editor UI

Version 1.28 released

This release brings several new features:

  • Expanded OBS Studio integration
    - added replay buffer and audio input toggle commands
    - requires obs-websocket plugin 4.7. Get the installer here
    - Due to bug in obs-websocket plugin 4.7 switching to studio mode will crash OBS Studio. Workaround is, do not switch to studio mode using MATRIC until the issue in obs-websocket gets fixed
  • Immersive mode support for Android client version 1.28:
    - app header (select server/deck) and Android status and navigation bars will be hidden in this mode until you swipe from screen edge
    - immersive mode is disabled by default but can be enabled in Android client settings
  • Expanded logging capabilities for troubleshooting purposes. Off by default, must be turned on by manually editing config file

Bugfixes:

  • Fixed OBS command start/stop streaming was erroneously mapped to start/stop recording
  • Fixed when executing Run app command, process will now start in target app directory
  • Fixed prevent image duplication when copying buttons

Version 1.26 released

This release brings several new features:

  • Native support for OBS Studio!
    - now you can assign OBS Studio commands to MATRIC buttons
    - requires obs-websocket plugin 4.7. Get the installer here
    - video will be coming shortly
  • Flexible layout editor in Windows app, now it is easier to edit large decks as layout editor expands to fill the available window space. Use the zoom slider on top to adjust the zoom as appropriate.
  • Added new method to integration API SETBUTTONSVISUALSTATE - enables you to simply set button state to on (pressed) or off (not pressed).
    Updated example and docs are available on github
  • Increased the number of available rows and columns to allow for more creative layouts (while it does not make sense to place 400 buttons on a single page, but it does enable more creative freedom)

Bugfixes:

  • Fixed button misalignment when dragging in the editor
  • Fixed sound bug - missing button click sound on pages other then default
  • Fixed bug on some older Android devices causing the client to not load decks

Integrating MATRIC with DCS - proof of concept

 

The Goal

In this tutorial, we will integrate Ka-50 autopilot channel switches with MATRIC so that their state reflects the game state and vice-versa. Although this post might look really long, the procedure itself is not complicated, basically you will change one "false" to "true" and do two copy & paste actions.
Additional info is given in dashed frames.
This is a proof-of-concept and is not ment to teach best coding practices nor represent a bulletproof solution. Some shortcuts have been taken to focus on the important things.

Prerequisites

  • Download and install MATRIC version 1.22 or higher installed on Windows. Version thing is important as the script uses extended integration API introduced in 1.22
  • Install MATRIC for Android from Google Play Store
  • MATRIC DCS demo integration script. Get it here.
  • Ka-50 deck that we will use in the demo. Get it here (just download it and click on it, MATRIC will import it automatically)

1. MATRIC configuration

1.1 Open the config file

We will edit MATRIC configuration file which is in your Documents folder (C:\Users\<your username >\Documents\.matric\config.json).

Open the file in thext editor (like notepad or even better Notepad++)
If we were making a real plugin instead of just a proof of concept demo, of course we would make a setup program which would do these steps.

1.2 Enable integration API

MATRIC provides an API which enables 3rd party apps to control buttons on MATRIC user interface. It is disabled by default and we need to enable it.
Change the line
"EnableIntegrationAPI": false
						
to
"EnableIntegrationAPI": true
						

1.3 Grant the permission to our DCS script

In order for MATRIC to obey our commands, we will have to do another small hack, we will add a permission in config.json like so:
{
	"AuthorizedClients": [
		{
		"Name": "Galaxy A70",
		"IP": "192.168.1.28",
		"Id": "ivUP0l+n06oCAR6XYzZPdclCSURAVjGSyv27b42aT+o=",
		"MatricVersion": 2,
		"LastContact": "2019-10-15T17:40:35.5818578+02:00"
		}
	],
		
	"AuthorizedApps": [
		{
		"appName": "MATRIC4DCS",
		"appPIN": "9087"
		}
	],
	"LastOpenedDeckId": "medium sized gibberish",
	"ApiKey": "medium sized gibberish",
	"MatricWebToken": "some really long gibberish",
	"Author": "The MATRIC Team",
	"LastReadMessageId": 1,
	"EnableIntegrationAPI": true
	}
							
This is another simplification. In general, "by the book way" would be:
  • 1) 3rd party app says "Hey, I'd like to connect!
  • 2) MATRIC shows popup with random PIN
  • 3) You enter that PIN into 3rd party app
  • 4) 3rd party app issues commands indentifying itself with name and PIN
Basically, with the hack above we faked steps 1-3. Full integration demo can be found on Github

1.4 Get the device id we want to use in the demo

If you have already connected to MATRIC with your Android device, you will find something similar to this (if not, then connect at least once):
	"AuthorizedClients": [
	{
	  "Name": "Galaxy A70",
	  "IP": "192.168.1.28",
	  "Id": "ivUP0l+n06oCAR6XYzZPdclCSURAVjGSyv27b42aT+o=",
	  "MatricVersion": 2,
	  "LastContact": "2019-10-15T17:40:35.5818578+02:00"
	},
	...
							

We will need this Id in the next step as we will use this Id to tell MATRIC we want to integrate with this particular device.
Although MATRIC integration API has a method which answers the question "Hey MATRIC, which devices are currently connected?" we will not use it, but will instead just hard-code the client device id in our DCS export script.

1.5 Save config and restart MATRIC

Save the config and restart MATRIC (right click on tray icon, choose "Quit" and the start it again)

2. The DCS side of things

DCS allows you to add code which can read the game data and do something with it. It is done by writing an export script in LUA language.
It is simple, I learned enough of it in an hour to create this proof of concept (and I'm no coding ninja).

2.1 matricka50.lua

Copy the matricka50.lua to your C:\Users\<your username >\Saved Games\DCS\Scripts", open it in notepad and modify the line
	MATRIC.clientId = "some gibberish"
							
You need to paste the Id from the step 1.4 between the "". In our example the Id was ivUP0l+n06oCAR6XYzZPdclCSURAVjGSyv27b42aT+o=
Save matricka50.lua

2.2 Export.lua

This is a script you already have, it gets executed when DCS runs it can also be found in "C:\Users\<your username >\Saved Games\DCS\Scripts". We will just need to add a single line at the end and save it:
	dofile(lfs.writedir()..[[Scripts\matricka50.lua]])						
						

Wrapping it up

Start DCS, open the Ka-50 deck on your smartphone and ADI channel buttons should work like in this video

Further information

More info about MATRIC Integration API and c# example can be found on github: https://github.com/tgudelj/MATRICIntegrationDemo/

Version 1.21 released

This release solves the following issues:

  • fixes a bug related to page navigation (go to page action)

Version 1.20 released

This release solves the following issues:

  • fixes a bug related to button delete

Version 1.19 released

This release solves the following issues:

  • fixes a bug related to editing multipage decks

First public release!

The first public release of MATRIC is out, check it out

Today is a great day for the MATRIC Team, our first public release is out. You can join our discord https://discord.gg/HjEZnfe and ask as anything, we'd be more than happy to receive feedback and answer your questions.

Version 1.18 released

This release solves the following issues:

  • Handle corrupted config file issue
  • Refresh the decks list when new deck is imported