Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
geomtech committed Apr 25, 2024
1 parent 70572c4 commit 4352c9b
Show file tree
Hide file tree
Showing 75 changed files with 415 additions and 336 deletions.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\C:\\Users\\dacru\\Source\\Repos\\VocalConnect",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/VocalConnect/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .vs/VocalConnect/v17/.futdcache.v2
Binary file not shown.
Binary file added .vs/VocalConnect/v17/.suo
Binary file not shown.
Binary file added .vs/VocalConnect/v17/.wsuo
Binary file not shown.
111 changes: 111 additions & 0 deletions .vs/VocalConnect/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|c:\\users\\dacru\\source\\repos\\vocalconnect\\mainform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|solutionrelative:mainform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|c:\\users\\dacru\\source\\repos\\vocalconnect\\mainform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|solutionrelative:mainform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|c:\\users\\dacru\\source\\repos\\vocalconnect\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|c:\\users\\dacru\\source\\repos\\vocalconnect\\settingsform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|solutionrelative:settingsform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|c:\\users\\dacru\\source\\repos\\vocalconnect\\settingsform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{8AAA92FD-18A3-4BDD-9E65-7E4E252E9208}|VocalConnect.csproj|solutionrelative:settingsform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:0:0:{269a02dc-6af8-11d3-bdc4-00c04f688e50}"
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "MainForm.cs",
"DocumentMoniker": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\MainForm.cs",
"RelativeDocumentMoniker": "MainForm.cs",
"ToolTip": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\MainForm.cs",
"RelativeToolTip": "MainForm.cs",
"ViewState": "AQIAAF0AAAAAAAAAAAAowCEAAAAfAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-25T23:06:23.957Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "MainForm.cs [Conception]",
"DocumentMoniker": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\MainForm.cs",
"RelativeDocumentMoniker": "MainForm.cs",
"ToolTip": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\MainForm.cs [Conception]",
"RelativeToolTip": "MainForm.cs [Conception]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-25T23:06:21.859Z",
"EditorCaption": " [Conception]"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\Program.cs",
"RelativeDocumentMoniker": "Program.cs",
"ToolTip": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\Program.cs",
"RelativeToolTip": "Program.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-25T23:06:17.226Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "SettingsForm.cs",
"DocumentMoniker": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\SettingsForm.cs",
"RelativeDocumentMoniker": "SettingsForm.cs",
"ToolTip": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\SettingsForm.cs",
"RelativeToolTip": "SettingsForm.cs",
"ViewState": "AQIAAAwAAAAAAAAAAAAxwCAAAAAJAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-25T23:04:58.561Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "SettingsForm.cs [Conception]",
"DocumentMoniker": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\SettingsForm.cs",
"RelativeDocumentMoniker": "SettingsForm.cs",
"ToolTip": "C:\\Users\\dacru\\source\\repos\\VocalConnect\\SettingsForm.cs [Conception]",
"RelativeToolTip": "SettingsForm.cs [Conception]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-25T23:04:51.849Z",
"EditorCaption": " [Conception]"
}
]
}
]
}
]
}
10 changes: 7 additions & 3 deletions MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

115 changes: 87 additions & 28 deletions MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,49 @@
using System;
using System.Diagnostics;
using System.Security.Policy;
using System.Speech.Recognition;
using System.Windows.Forms;

namespace VocalConnect
{
public partial class MainForm : Form
{
private bool wantZoom = false;
private bool inZoom = false;
private System.Media.SoundPlayer bienvenuePlayer = new System.Media.SoundPlayer(Properties.Resources.bienvenue);
private System.Media.SoundPlayer errorPlayer = new System.Media.SoundPlayer(Properties.Resources.erreur);
private System.Media.SoundPlayer unknownCommandPlayer = new System.Media.SoundPlayer(Properties.Resources.commande_non_reconnue);
private System.Media.SoundPlayer closingPlayer = new System.Media.SoundPlayer(Properties.Resources.fermeture);
private System.Media.SoundPlayer connectPlayer = new System.Media.SoundPlayer(Properties.Resources.connexion);
private System.Media.SoundPlayer missingSettingsPlayer = new System.Media.SoundPlayer(Properties.Resources.parametres_manquants);

public MainForm()
{
InitializeComponent();
}

private void MainForm_Load(object sender, EventArgs e)
{
// start audio from ressources
bienvenuePlayer.Play();

timer1.Interval = 60000;
timer1.Start();
timer1.Tick += (s, ev) =>
{
if (wantZoom == false)
{
bienvenuePlayer.Play();
}
};

// Créer un objet SpeechRecognitionEngine
SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("fr-FR"));

recognizer.SetInputToDefaultAudioDevice();

// Ajouter une grammaire de reconnaissance
Choices commands = new Choices(new string[] { "Bonjour", "Aurevoir", "Il est quelle heure", "Salle du royaume", "Réunion", "la salle", "RPP", "prédication", "week-end", "réunion de pascal", "réunion alexy", "groupe" });
Choices commands = new Choices(new string[] { "Zoom", "Stop", "réunion", "prédication", "groupe" });
GrammarBuilder grammarBuilder = new GrammarBuilder(commands);
Grammar grammar = new Grammar(grammarBuilder);

Expand All @@ -29,34 +52,59 @@ private void MainForm_Load(object sender, EventArgs e)
// Gérer l'événement de reconnaissance
recognizer.SpeechRecognized += (sender, e) =>
{
try
if (wantZoom == false)
{
switch (e.Result.Text)
try
{
case "Salle du royaume":
case "la salle":
case "Réunion":
OpenZoomMeeting(Properties.Settings.Default.kHZoomID, Properties.Settings.Default.kHZoomCode);
break;
case "RPP":
case "prédication":
case "réunion pour la prédication":
OpenZoomMeeting(Properties.Settings.Default.ministryZoomID, Properties.Settings.Default.ministryZoomCode);
break;
case "week-end":
case "réunion de pascal":
case "réunion alexy":
case "groupe":
OpenZoomMeeting(Properties.Settings.Default.groupZoomID, Properties.Settings.Default.groupZoomCode);
break;
default:
// Commande non reconnue
break;
switch (e.Result.Text)
{
case "Zoom":
wantZoom = true;
connectPlayer.Play();
break;
case "Stop":
closingPlayer.Play();
Application.Exit();
break;
default:
break;
}
}
}
catch (Exception ex)
catch (Exception)
{
errorPlayer.Play();
}
}
else
{
MessageBox.Show("Une erreur est survenue : " + ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (inZoom == false)
{
try
{
switch (e.Result.Text)
{
case "réunion":
OpenZoomMeeting(Properties.Settings.Default.kHZoomID, Properties.Settings.Default.kHZoomCode);
break;
case "prédication":
OpenZoomMeeting(Properties.Settings.Default.ministryZoomID, Properties.Settings.Default.ministryZoomCode);
break;
case "groupe":
OpenZoomMeeting(Properties.Settings.Default.groupZoomID, Properties.Settings.Default.groupZoomCode);
break;
case "Stop":
closingPlayer.Play();
Application.Exit();
break;
default:
break;
}
}
catch (Exception)
{
errorPlayer.Play();
}
}
}
};

Expand All @@ -72,14 +120,25 @@ private void settingsButton_Click(object sender, EventArgs e)

private void OpenZoomMeeting(string meetingID, string meetingCode)
{
inZoom = true;

Properties.Settings.Default.Reload();

if (string.IsNullOrEmpty(meetingID) || string.IsNullOrEmpty(meetingCode))
{
MessageBox.Show("Les paramètres pour l'ID de la réunion ou le code sont manquants.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
missingSettingsPlayer.Play();
return;
}

string zoomURLPath = meetingID + "?pwd=" + meetingCode;
Process.Start("https://zoom.us/j/" + zoomURLPath);
string zoomURL = "zoommtg://zoom.us/join?action=join&confno=" + meetingID + "&pwd=" + meetingCode;

Process.Start(new ProcessStartInfo
{
FileName = zoomURL,
UseShellExecute = true
});

Application.Exit();
}
}
}
3 changes: 3 additions & 0 deletions MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
Loading

0 comments on commit 4352c9b

Please sign in to comment.