diff --git a/RDFPlugin/HiddenWindow.cpp b/RDFPlugin/HiddenWindow.cpp index 3fe6a48..0b540bd 100644 --- a/RDFPlugin/HiddenWindow.cpp +++ b/RDFPlugin/HiddenWindow.cpp @@ -1,29 +1,29 @@ -#include "stdafx.h" -#include "HiddenWindow.h" -#include "CRDFPlugin.h" - - -CRDFPlugin* rdfPlugin; - -LRESULT CALLBACK HiddenWindow(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_CREATE: { - rdfPlugin = reinterpret_cast(reinterpret_cast(lParam)->lpCreateParams); - return TRUE; - } - case WM_COPYDATA: { - COPYDATASTRUCT* data = reinterpret_cast(lParam); - - if (data != nullptr && data->dwData == 666 && data->lpData != nullptr && rdfPlugin != nullptr) { - rdfPlugin->ProcessAFVMessage(reinterpret_cast(data->lpData)); - } - return TRUE; - } - } - - return DefWindowProc(hwnd, msg, wParam, lParam); -} - - +#include "stdafx.h" +#include "HiddenWindow.h" +#include "CRDFPlugin.h" + + +CRDFPlugin* rdfPlugin; + +LRESULT CALLBACK HiddenWindow(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_CREATE: { + rdfPlugin = reinterpret_cast(reinterpret_cast(lParam)->lpCreateParams); + return TRUE; + } + case WM_COPYDATA: { + COPYDATASTRUCT* data = reinterpret_cast(lParam); + + if (data != nullptr && data->dwData == 666 && data->lpData != nullptr && rdfPlugin != nullptr) { + rdfPlugin->ProcessAFVMessage(reinterpret_cast(data->lpData)); + } + return TRUE; + } + } + + return DefWindowProc(hwnd, msg, wParam, lParam); +} + + \ No newline at end of file diff --git a/RDFPlugin/HiddenWindow.h b/RDFPlugin/HiddenWindow.h index 58e1278..061d260 100644 --- a/RDFPlugin/HiddenWindow.h +++ b/RDFPlugin/HiddenWindow.h @@ -1,5 +1,5 @@ -#pragma once - -#include "stdafx.h" - +#pragma once + +#include "stdafx.h" + LRESULT CALLBACK HiddenWindow(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); \ No newline at end of file diff --git a/RDFPlugin/RDFPlugin.aps b/RDFPlugin/RDFPlugin.aps index a70acab..d56dcd3 100644 Binary files a/RDFPlugin/RDFPlugin.aps and b/RDFPlugin/RDFPlugin.aps differ diff --git a/RDFPlugin/RDFPlugin.rc b/RDFPlugin/RDFPlugin.rc index bb66870..3d1c0bb 100644 Binary files a/RDFPlugin/RDFPlugin.rc and b/RDFPlugin/RDFPlugin.rc differ diff --git a/RDFPlugin/RDFPlugin.vcxproj.user b/RDFPlugin/RDFPlugin.vcxproj.user index 264edd6..32225eb 100644 --- a/RDFPlugin/RDFPlugin.vcxproj.user +++ b/RDFPlugin/RDFPlugin.vcxproj.user @@ -1,13 +1,13 @@ - - - - C:\Program Files (x86)\EuroScope\EuroScope.exe - \\Mac\Home\Documents\EuroScope - WindowsLocalDebugger - - - C:\Program Files (x86)\EuroScope\EuroScope.exe - \\Mac\Home\Documents\EuroScope - WindowsLocalDebugger - + + + + C:\Program Files (x86)\EuroScope\EuroScope.exe + \\Mac\Home\Documents\EuroScope + WindowsLocalDebugger + + + C:\Program Files (x86)\EuroScope\EuroScope.exe + \\Mac\Home\Documents\EuroScope + WindowsLocalDebugger + \ No newline at end of file diff --git a/README.md b/README.md index 0375160..ec48051 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # RDF -## Support VectorAudio/0.5.0 +## Support VectorAudio/0.5.0+ [VectorAudio](https://github.com/pierr3/VectorAudio) is an Audio-For-VATSIM ATC client for macOS and Linux. It provides better audio quality when EuroScope is running in a Windows virtual machine. This improved RDF plugin utilizes VectorAudio's SDK and sends HTTP GET request every second to get transmitting pilots *and controllers*. @@ -12,34 +12,57 @@ ## Configurations -So far the only way to configure the plugin is by modifying the settings file. The following is its format and default values. +There are two ways to modify the plugin settings - by settings file and by commandline functions. -``` +This table shows all configurable items. + +|Entry Name|Command Line Keyword|Default Value| +|-|-|-| +|VectorAudioAddress|ADDRESS|127.0.0.1:49080| +|VectorAudioTimeout|TIMEOUT|300| +|VectorAudioRetryInterval|INTERVAL|5| +|RGB|RGB|255:255:255| +|ConcurrentTransmissionRGB|CTRGB|255:0:0| +|Radius|RADIUS|20| +|Threshold|THRESHOLD|-1| +|Precision|PRECISION|0| +|DrawControllers|CONTROLLER|0| + +E.g. In settings files the default is like the following: + +```text PLUGINS -RDF Plugin for Euroscope:VectorAudioAddress:xxx.xxx.xxx.xxx:xxxxx +RDF Plugin for Euroscope:VectorAudioAddress:127.0.0.1:49080 RDF Plugin for Euroscope:VectorAudioTimeout:300 RDF Plugin for Euroscope:VectorAudioRetryInterval:5 RDF Plugin for Euroscope:RGB:255:255:255 RDF Plugin for Euroscope:ConcurrentTransmissionRGB:255:0:0 RDF Plugin for Euroscope:Radius:20 +RDF Plugin for Euroscope:Threshold:-1 RDF Plugin for Euroscope:Precision:0 RDF Plugin for Euroscope:DrawControllers:0 END ``` -+ **VectorAudioAddress** should include address and port only. E.g. 127.0.0.1:49080 or localhost:49080. ++ **VectorAudioAddress** should include address and port only. E.g. 127.0.0.1:49080 or localhost:49080, etc. + **VectorAudioTimeout** is in milliseconds. If any request takes longer time than it, the plugin will seize sending requests to VectorAudio until after a specified interval. + **VectorAudioRetryInterval** is in seconds. If the plugin disconnets from VectorAudio, it will attempt to re-establish connection every 5 seconds by default. + **RGB, ConcurrentTransmissionRGB**, see *Readme for Previous Version* below. -+ **Radius** is now in nautical miles. The circle will get bigger and smaller when zooming in and out. ++ **Radius** is in nautical miles (if **Threshold**>0). The circle will get bigger and smaller when zooming in and out. ++ **Threshold** determines the behaviour of drawing. If radius (to draw in pixel) is smaller than **Threshold**, it won't be drawn into a circle but a direction line (same as the situation when the target is outside of displayed area). If **Threshold**<0, there won't be any zooming effect, but instead a fixed **Radius** in pixel. + **Precision** is in nautical miles. It is the double of standard deviation in a normal distrubution, which means 97.72% of offset won't be farther than **Precision**. Using 0 means no random offset at all. + **DrawControllers** is compatible with both VectorAudio and AFV. It is used to cover OBS pilots especially in shared cockpit. Other transimitting controllers will be circled as well but without offset. 0 means OFF and other numeric value means ON. When EuroScope is running, you can reload settings in *Settings File Setup* and then enter ***".RDF RELOAD"*** (case-insensitive) in command line. +For command line configurations, use ***".RDF KEYWORD VALUE"***, e.g. ***".RDF CTRGB 0:255:255"***. Also all command line functions are case-insensitive. + ## Credits ++ [pierr3/VectorAudio](https://github.com/pierr3/VectorAudio): initiative. ++ [LeoChen98](https://github.com/LeoChen98), [websterzh](https://github.com/websterzh): idea of using HTTP requests. ++ [chembergj/RDF](https://github.com/chembergj/RDF): basic drawings. + [vaccfr/CoFrance](https://github.com/vaccfr/CoFrance), [yhirose/cpp-httplib](https://github.com/yhirose/cpp-httplib): methods to make asynchronous http requests. # Readme for Previous Version (until 1.2.4)