Skip to content

Commit

Permalink
Fixed bug when clicking new and playing song. Modified log path and r…
Browse files Browse the repository at this point in the history
…esources.
  • Loading branch information
AugustoRuiz committed Mar 19, 2016
1 parent 2e17138 commit a866f40
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 17 deletions.
7 changes: 4 additions & 3 deletions WYZTracker.Core/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ static Logger()

public static string FileName { get; set; }

private static string logPath
public static string LogPath
{
get
{
return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), FileName);
return System.IO.Path.Combine(Environment.CurrentDirectory, FileName);
//return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), FileName);
}
}

Expand All @@ -28,7 +29,7 @@ public static void Log(string format, params object[] parameters)
Environment.NewLine,
string.Format(format, parameters));

System.IO.File.AppendAllText(logPath, finalText);
System.IO.File.AppendAllText(LogPath, finalText);
#if DEBUG
System.Diagnostics.Debug.WriteLine(finalText);
#endif
Expand Down
3 changes: 2 additions & 1 deletion WYZTracker.Core/Player/PlaybackStreamer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public static bool IsAudioAvailable()
IList<string> devices = OpenTK.Audio.AudioContext.AvailableDevices;
result = true;
}
catch
catch (Exception e)
{
Logger.Log(e.ToString());
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion WYZTracker.Core/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private double[] getTick()
if (this.effectPosition >= 0)
{
this.effectPosition++;
if (effectPosition >= this.currentEffect.Volumes.Length)
if (this.currentEffect == null || effectPosition >= this.currentEffect.Volumes.Length)
{
effectPosition = int.MinValue;
}
Expand Down
24 changes: 17 additions & 7 deletions WYZTracker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ static void Main(string[] args)
{
Logger.Log(ex.ToString());

string errorMessage = string.Format(WYZTracker.Properties.Resources.ApplicationError, Logger.LogPath);

MessageBox.Show(WYZTracker.Properties.Resources.ApplicationError,
WYZTracker.Properties.Resources.Error,
MessageBoxButtons.OK,
Expand Down Expand Up @@ -131,16 +133,24 @@ private static bool installOpenAL()
MessageBoxButtons.YesNo,
MessageBoxIcon.Error) == DialogResult.Yes)
{
if (isMono)
try
{
Process.Start("http://www.openal.org/creative-installers/");
if (isMono)
{
Process.Start("http://www.openal.org/creative-installers/");
}
else
{
ProcessStartInfo pInfo = new ProcessStartInfo("oalinst.exe");
Process setupProcess = Process.Start(pInfo);
setupProcess.WaitForExit();
result = true;
}
}
else
catch (Exception e)
{
ProcessStartInfo pInfo = new ProcessStartInfo("oalinst.exe");
Process setupProcess = Process.Start(pInfo);
setupProcess.WaitForExit();
result = true;
Logger.Log("OpenAL couldn't be installed properly.\nPlease install OpenAL before running WYZTracker.");
Logger.Log(e.ToString());
}
}
return result;
Expand Down
4 changes: 2 additions & 2 deletions WYZTracker/Properties/Resources.Designer.cs

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

2 changes: 1 addition & 1 deletion WYZTracker/Properties/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ApplicationError" xml:space="preserve">
<value>Ein Fehler ist aufgetreten. Bitte reichen Sie die Datei [My Documents]\WYZTracker.log ein, an:
<value>Ein Fehler ist aufgetreten. Bitte reichen Sie die Datei {0} ein, an:
augusto.ruiz@gmail.com.
Vielen Dank!</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion WYZTracker/Properties/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ApplicationError" xml:space="preserve">
<value>An error has occurred. Please, submit the file [My Documents]\WYZTracker.log to:
<value>An error has occurred. Please, submit the file {0} to:
augusto.ruiz@gmail.com.
Thank you!</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion WYZTracker/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
<value>WYZTracker2 - {0}</value>
</data>
<data name="ApplicationError" xml:space="preserve">
<value>Se ha producido un error en la aplicación. Por favor, envíe el fichero [Mis Documentos]\WYZTracker.log a:
<value>Se ha producido un error en la aplicación. Por favor, envíe el fichero {0} a:
augusto.ruiz@gmail.com.
¡Gracias!</value>
</data>
Expand Down
Binary file modified bin/WYZTracker.2.0.0.0.7z
Binary file not shown.
Binary file modified docs/imgs/efectos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a866f40

Please sign in to comment.