Skip to content

Commit

Permalink
Added notifcation sound
Browse files Browse the repository at this point in the history
  • Loading branch information
dtchiong committed Aug 10, 2018
1 parent be87240 commit d4287da
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
18 changes: 9 additions & 9 deletions Form1.Designer.cs

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

11 changes: 9 additions & 2 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand All @@ -20,7 +21,7 @@ public partial class Form1 : Form {
public Form1() {
InitializeComponent();

Text = "Derek's Online Order Printer v1.2.0";
Text = "Derek's Online Order Printer v1.3.0";

//Initialize dgv columns and properties
//Prevents columns from auto populating with OrderContainer fields.
Expand Down Expand Up @@ -83,8 +84,14 @@ public partial class Form1 : Form {
OrderContainer orderCon = new OrderContainer(order);
OrderList.Add(orderCon); //Add the OrderContainer to the OrderList for tracking unprinted orders

//Update the Item List in the GUI to match the selected row
//Update the Item List in the GUI to match the selected row
UpdateOrderUI();
PlayNotificationSound(); //play the nofication sound
}

private void PlayNotificationSound() {
SoundPlayer notificationSound = new SoundPlayer(Program.NotificationSoundPath);
notificationSound.Play();
}

/* Updates the UI to match the order in the selected row by
Expand Down
3 changes: 0 additions & 3 deletions Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@
<metadata name="itemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="itemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>287, 17</value>
</metadata>
Expand Down
2 changes: 2 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Program {

public static string ErrorLogDir = Path.Combine(AppWorkingDir, "Error-Logs");

public static string NotificationSoundPath = Path.Combine(AppWorkingDir, "Sounds", "notification.wav");

/* Example order ids to test from
* GrubHub:
* 16496c1551e4bdb6 - delivery
Expand Down

0 comments on commit d4287da

Please sign in to comment.