Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an Interface for Configuration #7

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d21fc4b
Creating project and the Form
solvingproblemswithtechnology Sep 14, 2020
aaa1f88
Initial ConfigurationFormLayour
solvingproblemswithtechnology Sep 14, 2020
ab19547
Interface changes
solvingproblemswithtechnology Sep 15, 2020
5cd327f
Ignore new project folder
solvingproblemswithtechnology Sep 15, 2020
1230410
OBS Sspport
solvingproblemswithtechnology Sep 15, 2020
1135d18
Powerpoint support
solvingproblemswithtechnology Sep 15, 2020
1bd8bb9
Move project to its parent folder (bad creation)
solvingproblemswithtechnology Sep 15, 2020
30046dd
Inital changes for saving configuration and load at startup.
solvingproblemswithtechnology Sep 15, 2020
3547a4a
Fix exception handling code
skipishere Sep 16, 2020
d47f0d0
Remove dependencies from the Form.
solvingproblemswithtechnology Sep 16, 2020
b75603b
Github Action
solvingproblemswithtechnology Sep 16, 2020
f6b515e
Github Action
solvingproblemswithtechnology Sep 16, 2020
730ca39
Rename
solvingproblemswithtechnology Sep 16, 2020
b975bf8
Rename error
solvingproblemswithtechnology Sep 16, 2020
9e2bbeb
Update release-action.yml
solvingproblemswithtechnology Sep 16, 2020
a64c961
Update release-action.yml
solvingproblemswithtechnology Sep 16, 2020
7392b13
Github Action
solvingproblemswithtechnology Sep 16, 2020
bc02717
Using good old nuget instead of COM for CI...
solvingproblemswithtechnology Sep 16, 2020
21e01cc
Using good old nuget instead of COM for CI...
solvingproblemswithtechnology Sep 16, 2020
8c29fe4
Merge branch 'main' of https://github.com/smartcodinghub/PowerPointTo…
solvingproblemswithtechnology Sep 16, 2020
dac3aaf
Merge pull request #5 from skipishere/main
shanselman Sep 17, 2020
205882b
Add special commands to start and stop recording; allow multiple comm…
bparks Sep 17, 2020
bc13238
Avoid crashing if recording is already started/stopped and start/stop…
bparks Sep 17, 2020
9e01859
Fix comment
bparks Sep 17, 2020
d2eddad
Merge pull request #8 from bparks/control-start-stop
shanselman Sep 18, 2020
11dc855
Creating project and the Form
solvingproblemswithtechnology Sep 14, 2020
6980d23
Initial ConfigurationFormLayour
solvingproblemswithtechnology Sep 14, 2020
9396bf6
Interface changes
solvingproblemswithtechnology Sep 15, 2020
e00cff8
Ignore new project folder
solvingproblemswithtechnology Sep 15, 2020
050da9f
OBS Sspport
solvingproblemswithtechnology Sep 15, 2020
83fd305
Powerpoint support
solvingproblemswithtechnology Sep 15, 2020
e9f3064
Move project to its parent folder (bad creation)
solvingproblemswithtechnology Sep 15, 2020
b7c3e53
Inital changes for saving configuration and load at startup.
solvingproblemswithtechnology Sep 15, 2020
aa7e63d
Remove dependencies from the Form.
solvingproblemswithtechnology Sep 16, 2020
f506ac8
Github Action
solvingproblemswithtechnology Sep 16, 2020
b6ecda1
Rename error
solvingproblemswithtechnology Sep 16, 2020
a755f88
Update release-action.yml
solvingproblemswithtechnology Sep 16, 2020
772ac38
Update release-action.yml
solvingproblemswithtechnology Sep 16, 2020
c6f4a71
Github Action
solvingproblemswithtechnology Sep 16, 2020
a263ad4
Using good old nuget instead of COM for CI...
solvingproblemswithtechnology Sep 16, 2020
3286b24
Using good old nuget instead of COM for CI...
solvingproblemswithtechnology Sep 16, 2020
12b8233
Refactor to Console+Winforms app.
solvingproblemswithtechnology Sep 20, 2020
f37cdfc
Start/Stop feature.
solvingproblemswithtechnology Sep 20, 2020
5a6867c
Add new project for generating an dll embed with the PowerPoint COMRe…
solvingproblemswithtechnology Sep 20, 2020
bdccf2b
Rebasing
solvingproblemswithtechnology Sep 20, 2020
ad39e6d
Creating a console project for optional GUI.
solvingproblemswithtechnology Sep 20, 2020
10e1775
Fix spelling for action
solvingproblemswithtechnology Sep 20, 2020
92e7c36
Fix dotnet warp output name.
solvingproblemswithtechnology Sep 20, 2020
beade18
dotnet warp can't create a path...
solvingproblemswithtechnology Sep 20, 2020
0752889
Exclude project directory.
solvingproblemswithtechnology Sep 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-warp": {
"version": "1.1.0",
"commands": [
"dotnet-warp"
]
}
}
}
79 changes: 79 additions & 0 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release PresentationObsSceneSwitcher

on:
push:
tags:
- 'v*'

jobs:

build:
runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on

env:
Solution_Name: PresentationObsSceneSwitcherConsole
ProjectDirectory: PresentationObsSceneSwitcherConsole
FileName: PresentationObsSceneSwitcher
ProjectPath: PresentationObsSceneSwitcherConsole\PresentationObsSceneSwitcherConsole.csproj

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101

# Restore tools
- name: Restore tools
run: dotnet tool restore

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: dotnet restore $env:ProjectPath

# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Build
run: |
mkdir ${{ env.ProjectDirectory }}\publish
dotnet warp $env:ProjectPath -o ${{ env.ProjectDirectory }}\publish\${{ env.FileName }}.exe

# Publish
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: Exe
path: ${{ env.ProjectDirectory }}\publish

# Zip
- name: Zip
run: |
cd ${{ env.ProjectDirectory }}\publish
Compress-Archive -DestinationPath ${{ env.FileName }} -Path .\*

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ env.ProjectDirectory }}\publish\PresentationObsSceneSwitcher.zip
asset_name: PresentationObsSceneSwitcher.zip
asset_content_type: application/zip
14 changes: 14 additions & 0 deletions OBS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ public bool ChangeScene(string scene)
return true;
}

public bool StartRecording()
{
try { _OBS.Api.StartRecording(); }
catch { /* Recording already started */ }
return true;
}

public bool StopRecording()
{
try { _OBS.Api.StopRecording(); }
catch { /* Recording already stopped */ }
return true;
}

protected virtual void Dispose(bool disposing)
{
if (!_DisposedValue)
Expand Down
27 changes: 27 additions & 0 deletions PowerPointInterop/PowerPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.Office.Interop.PowerPoint;
using System;
using System.Threading.Tasks;

namespace PowerPointInterop
{
/// <summary>
/// This projects allows you to compile a .dll with an embed COM Reference.
/// Used to add compilation support using dotnet cli as it doesn't allow you to use COMReference.
/// </summary>
public static class PowerPoint
{
private static Application powerPoint = new Application();

public static void SubscribeSlideShowNextSlide(Func<string, Task> subscription)
{
powerPoint.SlideShowNextSlide += async (SlideShowWindow Wn) =>
{
var command = String.Empty;
try { command = Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text; }
catch { /*no notes*/ }

await subscription(command);
};
}
}
}
19 changes: 19 additions & 0 deletions PowerPointInterop/PowerPointInterop.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.PowerPoint">
<Guid>{91493440-5a91-11cf-8700-00aa0060263b}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>12</VersionMinor>
<WrapperTool>primary</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions PowerPointInterop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This projects allows you to compile a .dll with an embed COM Reference. Used to add compilation support using dotnet cli as it doesn't allow you to use COMReference.
60 changes: 36 additions & 24 deletions PowerPointToOBSSceneSwitcher.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.PowerPoint">
<Guid>{91493440-5a91-11cf-8700-00aa0060263b}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>12</VersionMinor>
<WrapperTool>primary</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="OBS.WebSocket.NET" Version="4.7.2" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Remove="PowerPointInterop\**" />
<Compile Remove="PresentationObsSceneSwitcherConsole\**" />
<Compile Remove="PresentationObsSceneSwitcher\**" />
<EmbeddedResource Remove="PowerPointInterop\**" />
<EmbeddedResource Remove="PresentationObsSceneSwitcherConsole\**" />
<EmbeddedResource Remove="PresentationObsSceneSwitcher\**" />
<None Remove="PowerPointInterop\**" />
<None Remove="PresentationObsSceneSwitcherConsole\**" />
<None Remove="PresentationObsSceneSwitcher\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="OBS.WebSocket.NET" Version="4.7.2" />
</ItemGroup>

<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.PowerPoint">
<Guid>{91493440-5a91-11cf-8700-00aa0060263b}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>12</VersionMinor>
<WrapperTool>primary</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>

</Project>
74 changes: 49 additions & 25 deletions PowerPointToOBSSceneSwitcher.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30428.66
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerPointToOBSSceneSwitcher", "PowerPointToOBSSceneSwitcher.csproj", "{8A844363-5A92-403B-90CD-BFCB30ED5054}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {515C02C0-0CF2-4890-A1FB-4D6A5F115CD6}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30428.66
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerPointToOBSSceneSwitcher", "PowerPointToOBSSceneSwitcher.csproj", "{8A844363-5A92-403B-90CD-BFCB30ED5054}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationObsSceneSwitcher", "PresentationObsSceneSwitcher\PresentationObsSceneSwitcher.csproj", "{5B07EF15-11D6-4646-8322-965BD7D4ADEE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{76FD753E-6BFA-477C-BA87-23D96C053DC5}"
ProjectSection(SolutionItems) = preProject
.config\dotnet-tools.json = .config\dotnet-tools.json
.github\workflows\release-action.yml = .github\workflows\release-action.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerPointInterop", "PowerPointInterop\PowerPointInterop.csproj", "{6D327EF6-B794-4441-8893-3EFD05DA682F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PresentationObsSceneSwitcherConsole", "PresentationObsSceneSwitcherConsole\PresentationObsSceneSwitcherConsole.csproj", "{557DE28E-D0A2-4DFB-82F7-D7A32EB96C0C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A844363-5A92-403B-90CD-BFCB30ED5054}.Release|Any CPU.Build.0 = Release|Any CPU
{5B07EF15-11D6-4646-8322-965BD7D4ADEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B07EF15-11D6-4646-8322-965BD7D4ADEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B07EF15-11D6-4646-8322-965BD7D4ADEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B07EF15-11D6-4646-8322-965BD7D4ADEE}.Release|Any CPU.Build.0 = Release|Any CPU
{6D327EF6-B794-4441-8893-3EFD05DA682F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6D327EF6-B794-4441-8893-3EFD05DA682F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D327EF6-B794-4441-8893-3EFD05DA682F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D327EF6-B794-4441-8893-3EFD05DA682F}.Release|Any CPU.Build.0 = Release|Any CPU
{557DE28E-D0A2-4DFB-82F7-D7A32EB96C0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{557DE28E-D0A2-4DFB-82F7-D7A32EB96C0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{557DE28E-D0A2-4DFB-82F7-D7A32EB96C0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{557DE28E-D0A2-4DFB-82F7-D7A32EB96C0C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {515C02C0-0CF2-4890-A1FB-4D6A5F115CD6}
EndGlobalSection
EndGlobal
Loading