Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbosch-inversion committed Sep 8, 2023
1 parent c1c2e42 commit 0419e6e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Mutation/MutationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
using CognitiveSupport;
using CognitiveSupport.Extensions;
using NAudio.Wave;
using Newtonsoft.Json.Linq;
using OpenAI.ObjectModels;
using OpenAI.ObjectModels.RequestModels;
using ScreenCapturing;
using StringExtensionLibrary;
using System.ComponentModel;
using System.Drawing.Imaging;
using static OpenAI.ObjectModels.SharedModels.IOpenAiModels;

namespace Mutation
{
public partial class MutationForm : Form
{
public enum InsertOption
public enum DictationInsertOption
{
[Description("Don't insert into 3rd party application")]
DoNotInsert,
Expand Down Expand Up @@ -83,7 +81,7 @@ public MutationForm()
InitializeLlmReviewListView();

cmbInsertInto3rdPartyApplication.DropDownStyle = ComboBoxStyle.DropDownList;
foreach (InsertOption option in Enum.GetValues(typeof(InsertOption)))
foreach (DictationInsertOption option in Enum.GetValues(typeof(DictationInsertOption)))
{
string description = GetEnumDescription(option);
cmbInsertInto3rdPartyApplication.Items.Add(new { Text = description, Value = option });
Expand Down Expand Up @@ -631,15 +629,15 @@ private async Task FormatSpeechToTextTranscriptWithRules()

if (selectedInsertOptionValue is not null)
{
InsertOption selectedOption = (InsertOption)((dynamic)selectedInsertOptionValue).Value;
DictationInsertOption selectedOption = (DictationInsertOption)((dynamic)selectedInsertOptionValue).Value;

switch (selectedOption)
{
case InsertOption.SendKeys:
case DictationInsertOption.SendKeys:
BeepStart();
SendKeys.Send(text);
break;
case InsertOption.Paste:
case DictationInsertOption.Paste:
Thread.Sleep(200); // Wait for text to arrive on clipboard.
BeepStart();
SendKeys.SendWait("^v");
Expand Down

0 comments on commit 0419e6e

Please sign in to comment.