Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
willie68 committed Jun 5, 2021
2 parents 05426be + d45b10c commit eb360ea
Show file tree
Hide file tree
Showing 47 changed files with 1,496 additions and 261 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ integrations/streamdeck/StreamDeckService.2.zip
integrations/streamdeck/StreamDeckService.zip

3rd party/PSTools.zip

integrations/streamdeck/StreamDeckService/StreamDeckService.csproj.user
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ On the other side there are two Web applications, build on top of VUE as the mai
Features:

- Control Audio Volumes and Mic Gain.
- controlling your obs, profiles, scene collections, scenes and streaming/recording functions
- Execute Browser, File explorer and other Apps
- Showing Date and Time with nice faces
- Counting something, with persistence
Expand Down Expand Up @@ -801,6 +802,80 @@ parameters:
command: start
```

##### OBS - Open Broadcaster Software

This is a set of commands to control your obs installation.

###### OBS Start/Stop

Start/Stop recording or streaming

`type`: `OBSSTARTSTOP`

Parameter:
`mode`: the mode to start/stop, recording or streaming

```yaml
type: OBSSTARTSTOP
name: OBSStartStop
parameters:
mode: recording
```

###### OBS Profile

switching the profile of obs

`type`: `OBSPROFILE`

Parameter:
`profile`: the name of the profile to switch to

```yaml
type: OBSPROFILE
name: OBSProfile
parameters:
profile: GTA
```

###### OBS Scene Collection

switching the scene collection of obs

`type`: `OBSSCENECOLLECTION`

Parameter:
`scenecollection`: the name of the scene collection to switch to

```yaml
type: OBSSCENECOLLECTION
name: OBSSceneCollection
parameters:
scenecollection: CrewVideo
```

###### OBS Scene

switching the scene of obs with different commands.

`type`: `OBSSCENE`

Parameter:
`scenecommand`: the command to execute, possible commands are:

- `next`: switching to the next scene in the scene list, at the end it will roll over to the first scene
- `previous`: switching to the previous scene in the scene list, at the end it will roll over to the last scene
- `first, last`: switching to the first/last scene in the scene list
- `switch`: switching to a named scene in the scene list

```yaml
type: OBSSCENE
name: OBSScene
parameters:
scenecommand: switch
scenename: blurredVideo
```

##### Page

Switch to another page.
Expand Down Expand Up @@ -1213,6 +1288,16 @@ extconfig:
Second you have to add the xmlapi addon to your homematic.
https://github.com/homematic-community/XML-API

### OBS - Open Broadcaster Software

With ReCoS you can control some parts of your OBS Software. This integration supports the OBS Studio. First you have to install the obs-websocket plugin. At the moment only the version 4.9.0 is supported. (https://github.com/Palakis/obs-websocket/releases/tag/4.9.0)

To activate the integration simply go to the settings page.

![image-20210605120558644](C:\e-platte\daten\git-sourcen\ReCoS-Remote-Command-Service\documentation\assets\obs_01.png)The host is the pc where the obs is installed. Normally this is the same pc, so 127.0.0.1 should work. The default port is 4444. (If you don't change it in the settings of the plugin) On the password field use the password you setup in the plugin settings (or leave it empty, if no password was been set.)

Thats all for setting up the integration.

# Thanks

Thanks goes to iconshock for the great icons set.
7 changes: 7 additions & 0 deletions build_all.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
@echo off
".\3rd party\GoVersionSetter.exe" -i
".\3rd party\GoVersionSetter.exe" -e npm -f ./webclient/recosadmin/package.json
".\3rd party\GoVersionSetter.exe" -e npm -f ./webclient/RecosUI/package.json
".\3rd party\GoVersionSetter.exe" -e iss -f ./install/setup.iss -o MyAppVersion
".\3rd party\GoVersionSetter.exe" -e vs -f ./integrations/streamdeck/StreamDeckService/StreamDeckService.csproj
".\3rd party\GoVersionSetter.exe" -e gores -f ./service/winres/winres.json -o RT_MANIFEST/#1/0409/identity/version,RT_VERSION/#1/0000/fixed/file_version,RT_VERSION/#1/0000/fixed/product_version,RT_VERSION/#1/0000/info/0409/ProductVersion,RT_VERSION/#1/0000/info/0409/FileVersion

call sync_assets.cmd

echo build web client
Expand Down
13 changes: 11 additions & 2 deletions comment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,14 @@ https://github.com/PaesslerAG/gval
Homematic
XML-API

Streamdeck core
https://github.com/VVEIRD/StreamDeckCore/
StreamdeckSharp
https://github.com/OpenMacroBoard/StreamDeckSharp

OBS WebSocket
https://github.com/Palakis/obs-websocket/releases
Port 4444; Password: akteon00

OBS WebSocket Client
https://github.com/christopher-dG/go-obs-websocket (V 4.4)
https://github.com/muesli/go-obs-websocket (V 4.7)

Binary file modified documentation/README.pdf
Binary file not shown.
Binary file added documentation/assets/obs_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions general/assets/backgrounds.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions general/assets/camcoder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions general/assets/scene.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions general/assets/scene2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion install/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "ReCoS"
#define MyAppVersion "0.68.0"
;version number set by GoVersionSetter.
#define MyAppVersion "0.0.79"
#define MyAppPublisher "MCS Media Computer Software"
#define MyAppURL "https://www.wk-music.de"
#define MyAppExeName "recos-service.exe"
Expand Down
165 changes: 165 additions & 0 deletions integrations/streamdeck/StreamDeckService/ColorExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
using System;
using System.Drawing;

namespace StreamDeckService
{
public static class ColorExtensions
{
static Random _randomizer = new Random();
public static Color GetContrast(this Color Source, bool PreserveOpacity)
{
Color inputColor = Source;
//if RGB values are close to each other by a diff less than 10%, then if RGB values are lighter side, decrease the blue by 50% (eventually it will increase in conversion below), if RBB values are on darker side, decrease yellow by about 50% (it will increase in conversion)
byte avgColorValue = (byte)((Source.R + Source.G + Source.B) / 3);
int diff_r = Math.Abs(Source.R - avgColorValue);
int diff_g = Math.Abs(Source.G - avgColorValue);
int diff_b = Math.Abs(Source.B - avgColorValue);
if (diff_r < 20 && diff_g < 20 && diff_b < 20) //The color is a shade of gray
{
if (avgColorValue < 123) //color is dark
{
inputColor = Color.FromArgb(Source.A, 220, 230, 50);
}
else
{
inputColor = Color.FromArgb(Source.A, 255, 255, 50);
}
}
byte sourceAlphaValue = Source.A;
if (!PreserveOpacity)
{
sourceAlphaValue = Math.Max(Source.A, (byte)127); //We don't want contrast color to be more than 50% transparent ever.
}
RGB rgb = new RGB { R = inputColor.R, G = inputColor.G, B = inputColor.B };
HSB hsb = ConvertToHSB(rgb);
hsb.H = hsb.H < 180 ? hsb.H + 180 : hsb.H - 180;
//_hsb.B = _isColorDark ? 240 : 50; //Added to create dark on light, and light on dark
rgb = ConvertToRGB(hsb);
return Color.FromArgb((int)sourceAlphaValue, (int)rgb.R, (int)rgb.G, (int)rgb.B);
}

#region Code from MSDN
internal static RGB ConvertToRGB(HSB hsb)
{
// Following code is taken as it is from MSDN. See link below.
// By: <a href="http://blogs.msdn.com/b/codefx/archive/2012/02/09/create-a-color-picker-for-windows-phone.aspx" title="MSDN" target="_blank">Yi-Lun Luo</a>
double chroma = hsb.S * hsb.B;
double hue2 = hsb.H / 60;
double x = chroma * (1 - Math.Abs(hue2 % 2 - 1));
double r1 = 0d;
double g1 = 0d;
double b1 = 0d;
if (hue2 >= 0 && hue2 < 1)
{
r1 = chroma;
g1 = x;
}
else if (hue2 >= 1 && hue2 < 2)
{
r1 = x;
g1 = chroma;
}
else if (hue2 >= 2 && hue2 < 3)
{
g1 = chroma;
b1 = x;
}
else if (hue2 >= 3 && hue2 < 4)
{
g1 = x;
b1 = chroma;
}
else if (hue2 >= 4 && hue2 < 5)
{
r1 = x;
b1 = chroma;
}
else if (hue2 >= 5 && hue2 <= 6)
{
r1 = chroma;
b1 = x;
}
double m = hsb.B - chroma;
return new RGB()
{
R = r1 + m,
G = g1 + m,
B = b1 + m
};
}
internal static HSB ConvertToHSB(RGB rgb)
{
// Following code is taken as it is from MSDN. See link below.
// By: <a href="http://blogs.msdn.com/b/codefx/archive/2012/02/09/create-a-color-picker-for-windows-phone.aspx" title="MSDN" target="_blank">Yi-Lun Luo</a>
double r = rgb.R;
double g = rgb.G;
double b = rgb.B;

double max = Max(r, g, b);
double min = Min(r, g, b);
double chroma = max - min;
double hue2 = 0d;
if (chroma != 0)
{
if (max == r)
{
hue2 = (g - b) / chroma;
}
else if (max == g)
{
hue2 = (b - r) / chroma + 2;
}
else
{
hue2 = (r - g) / chroma + 4;
}
}
double hue = hue2 * 60;
if (hue < 0)
{
hue += 360;
}
double brightness = max;
double saturation = 0;
if (chroma != 0)
{
saturation = chroma / brightness;
}
return new HSB()
{
H = hue,
S = saturation,
B = brightness
};
}
private static double Max(double d1, double d2, double d3)
{
if (d1 > d2)
{
return Math.Max(d1, d3);
}
return Math.Max(d2, d3);
}
private static double Min(double d1, double d2, double d3)
{
if (d1 < d2)
{
return Math.Min(d1, d3);
}
return Math.Min(d2, d3);
}
internal struct RGB
{
internal double R;
internal double G;
internal double B;
}
internal struct HSB
{
internal double H;
internal double S;
internal double B;
}
#endregion //Code from MSDN
}
}
Loading

0 comments on commit eb360ea

Please sign in to comment.