-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
466 additions
and
4 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
PowerToysPlugin/Commands/MeasureTool/MeasureToolCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Loupedeck.PowerToysPlugin.Models.MeasureTool; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.MeasureTool | ||
{ | ||
//TODO: Icons | ||
class MeasureToolCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private MeasureToolService _service; | ||
private MeasureToolSettings _currentSettings; | ||
|
||
public MeasureToolCommand() | ||
: base("Enable Screen Ruler", | ||
"Enable Screen Ruler", | ||
"MeasureTool") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.MeasureToolService; | ||
if (_service is null) | ||
return false; | ||
|
||
_currentSettings = _service.GetSettings(); | ||
_service.SettingsUpdated += ServiceOnSettingsUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnSettingsUpdated(object sender, MeasureToolSettings e) | ||
{ | ||
_currentSettings = e; | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
PowerToysPlugin/Commands/TextExtractor/TextExtractorCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Loupedeck.PowerToysPlugin.Models.TextExtractor; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.TextExtractor | ||
{ | ||
//TODO: Icons | ||
class TextExtractorCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private TextExtractorService _service; | ||
private TextExtractorSettings _currentSettings; | ||
|
||
public TextExtractorCommand() | ||
: base("Enable Text Extractor", | ||
"Enable Text Extractor", | ||
"TextExtractor") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.TextExtractorService; | ||
if (_service is null) | ||
return false; | ||
|
||
_currentSettings = _service.GetSettings(); | ||
_service.SettingsUpdated += ServiceOnSettingsUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnSettingsUpdated(object sender, TextExtractorSettings e) | ||
{ | ||
_currentSettings = e; | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(); | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
PowerToysPlugin/Commands/VideoConference/MuteCameraAndMicrophoneCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Loupedeck.PowerToysPlugin.Models.VideoConference; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.VideoConference | ||
{ | ||
//TODO: Icons | ||
//TODO: Does not work | ||
class MuteCameraAndMicrophoneCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private VideoConferenceService _service; | ||
private VideoConferenceSettings _currentSettings; | ||
|
||
public MuteCameraAndMicrophoneCommand() | ||
: base("Toggle Mute Camera & Microphone", | ||
"Toggles Mute Camera & Microphone", | ||
"VideoConference") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.VideoConferenceService; | ||
if (_service is null) | ||
return false; | ||
|
||
_currentSettings = _service.GetSettings(); | ||
_service.SettingsUpdated += ServiceOnSettingsUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnSettingsUpdated(object sender, VideoConferenceSettings e) | ||
{ | ||
_currentSettings = e; | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(MuteOptions.CameraMicrophone); | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
PowerToysPlugin/Commands/VideoConference/MuteCameraCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using Loupedeck.PowerToysPlugin.Models.VideoConference; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.VideoConference | ||
{ | ||
//TODO: Icons | ||
//TODO: Does not work | ||
class MuteCameraCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private VideoConferenceService _service; | ||
private VideoConferenceSettings _currentSettings; | ||
|
||
public MuteCameraCommand() | ||
: base("Toggle Mute Camera", | ||
"Toggles Mute Camera", | ||
"VideoConference") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.VideoConferenceService; | ||
if (_service is null) | ||
return false; | ||
|
||
_currentSettings = _service.GetSettings(); | ||
_service.SettingsUpdated += ServiceOnSettingsUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnSettingsUpdated(object sender, VideoConferenceSettings e) | ||
{ | ||
_currentSettings = e; | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(MuteOptions.Camera); | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
PowerToysPlugin/Commands/VideoConference/MuteMicrophoneCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Loupedeck.PowerToysPlugin.Models.VideoConference; | ||
using Loupedeck.PowerToysPlugin.Services; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Commands.VideoConference | ||
{ | ||
//TODO: Icons | ||
class MuteMicrophoneCommand : PluginDynamicCommand | ||
{ | ||
private PowerToysPlugin _plugin; | ||
private VideoConferenceService _service; | ||
private VideoConferenceSettings _currentSettings; | ||
|
||
public MuteMicrophoneCommand() | ||
: base("Toggle Mute Microphone", | ||
"Toggles Mute Microphone", | ||
"VideoConference") | ||
{ | ||
// | ||
} | ||
|
||
protected override bool OnLoad() | ||
{ | ||
_plugin = base.Plugin as PowerToysPlugin; | ||
if (_plugin is null) | ||
return false; | ||
|
||
_service = _plugin.VideoConferenceService; | ||
if (_service is null) | ||
return false; | ||
|
||
_currentSettings = _service.GetSettings(); | ||
_service.SettingsUpdated += ServiceOnSettingsUpdated; | ||
|
||
return true; | ||
} | ||
|
||
private void ServiceOnSettingsUpdated(object sender, VideoConferenceSettings e) | ||
{ | ||
_currentSettings = e; | ||
base.ActionImageChanged(); | ||
} | ||
|
||
protected override void RunCommand(string actionParameter) | ||
{ | ||
_service.Activate(MuteOptions.Microphone); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,4 @@ public class AwakeSettings | |
[JsonProperty("version")] | ||
public string Version { get; set; } | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class ActivationShortcut : IKeyboardShortcut | ||
{ | ||
[JsonProperty("win")] | ||
public bool Win { get; set; } | ||
|
||
[JsonProperty("ctrl")] | ||
public bool Ctrl { get; set; } | ||
|
||
[JsonProperty("alt")] | ||
public bool Alt { get; set; } | ||
|
||
[JsonProperty("shift")] | ||
public bool Shift { get; set; } | ||
|
||
[JsonProperty("code")] | ||
public int Code { get; set; } | ||
|
||
[JsonProperty("key")] | ||
public string Key { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class BoolValue | ||
{ | ||
[JsonProperty("value")] | ||
public bool Value { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class IntValue | ||
{ | ||
[JsonProperty("value")] | ||
public int Value { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class MeasureToolSettings | ||
{ | ||
[JsonProperty("properties")] | ||
public Properties Properties { get; set; } | ||
|
||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("version")] | ||
public string Version { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class Properties | ||
{ | ||
[JsonProperty("ActivationShortcut")] | ||
public ActivationShortcut ActivationShortcut { get; set; } | ||
|
||
[JsonProperty("ContinuousCapture")] | ||
public BoolValue ContinuousCapture { get; set; } | ||
|
||
[JsonProperty("DrawFeetOnCross")] | ||
public BoolValue DrawFeetOnCross { get; set; } | ||
|
||
[JsonProperty("PerColorChannelEdgeDetection")] | ||
public BoolValue PerColorChannelEdgeDetection { get; set; } | ||
|
||
[JsonProperty("UnitsOfMeasure")] | ||
public IntValue UnitsOfMeasure { get; set; } | ||
|
||
[JsonProperty("PixelTolerance")] | ||
public IntValue PixelTolerance { get; set; } | ||
|
||
[JsonProperty("MeasureCrossColor")] | ||
public StringValue MeasureCrossColor { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.MeasureTool | ||
{ | ||
public class StringValue | ||
{ | ||
[JsonProperty("value")] | ||
public string Value { get; set; } | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
PowerToysPlugin/Models/TextExtractor/ActivationShortcut.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Loupedeck.PowerToysPlugin.Models.TextExtractor | ||
{ | ||
public class ActivationShortcut : IKeyboardShortcut | ||
{ | ||
[JsonProperty("win")] | ||
public bool Win { get; set; } | ||
|
||
[JsonProperty("ctrl")] | ||
public bool Ctrl { get; set; } | ||
|
||
[JsonProperty("alt")] | ||
public bool Alt { get; set; } | ||
|
||
[JsonProperty("shift")] | ||
public bool Shift { get; set; } | ||
|
||
[JsonProperty("code")] | ||
public int Code { get; set; } | ||
|
||
[JsonProperty("key")] | ||
public string Key { get; set; } | ||
} | ||
} |
Oops, something went wrong.