Skip to content

Commit

Permalink
Fix enabling go button on completion of generation
Browse files Browse the repository at this point in the history
  • Loading branch information
CaffeineAU committed Aug 18, 2016
1 parent ffe589d commit 1e652a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Translator/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ private void DownloaderWorker_RunWorkerCompleted(object sender, RunWorkerComplet
WorkerFinished = true;
DownloadProgress = DownloadCount;
TaskbarItemInfo.ProgressValue = 1.0;
WordsListView.Focus();
//TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;

}
Expand All @@ -242,7 +243,6 @@ public static BitmapImage LoadImage(string fileName)

private void DownloaderWorker_DoWork(object sender, DoWorkEventArgs e)
{
int i = 0;
try
{
foreach (var item in PhraseItems)
Expand All @@ -258,6 +258,7 @@ private void DownloaderWorker_DoWork(object sender, DoWorkEventArgs e)
}
else
{
e.Result = true;
break;
}
}
Expand All @@ -267,7 +268,7 @@ private void DownloaderWorker_DoWork(object sender, DoWorkEventArgs e)
{
MessageBox.Show("Couldn't download audio\r\n\r\n" + Ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
while (PhraseItems.Count(n => n.DownloadComplete) < PhraseItems.Count)
while (PhraseItems.Count(n => n.DownloadComplete) < PhraseItems.Count(n=> !String.IsNullOrEmpty(n.Phrase)))
{
if (!DownloaderWorker.CancellationPending)
{
Expand Down
4 changes: 2 additions & 2 deletions Translator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("2.1.0.1")]
[assembly: AssemblyFileVersion("2.1.0.1")]
8 changes: 5 additions & 3 deletions Translator/TTSProvider/MicrosoftTTSProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public override void DownloadItem(PhraseItem item, string folder, Boolean? conve
ms.Seek(0, SeekOrigin.Begin);
using (WaveFileReader wav = new WaveFileReader(ms))// String.Format("{0}\\wav22050\\{1}\\{2}.wav", folder, item.Folder, item.FileName)))
{
FileStream fs = new FileStream(String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName), FileMode.Create);
using (var writer = new LameMP3FileWriter(fs, wav.WaveFormat, 128))
using (FileStream fs = new FileStream(String.Format("{0}\\mp3\\{1}\\{2}.mp3", folder, item.Folder, item.FileName), FileMode.Create))
{
wav.CopyTo(writer);
using (var writer = new LameMP3FileWriter(fs, wav.WaveFormat, 128))
{
wav.CopyTo(writer);
}
}
}
ms.Seek(0, SeekOrigin.Begin);
Expand Down

0 comments on commit 1e652a0

Please sign in to comment.