private void confirmSelection()
 {
     if (lbVoiceSnippets.SelectedIndex != -1)
     {
         t_DatabaseRecord snippet = filteredVoiceSnippets[lbVoiceSnippets.SelectedIndex];
         if (hasIntonation)
         {
             SelectedSnippet = new VoiceSnippet
             {
                 FileName    = Path.Combine(baseDir, rbIntonationHigh.Checked ? "hoch" : "tief", snippet.FileName),
                 DisplayText = snippet.ContentLong,
                 HasValue    = true
             };
         }
         else
         {
             SelectedSnippet = new VoiceSnippet
             {
                 FileName    = Path.Combine(baseDir, snippet.FileName),
                 DisplayText = snippet.ContentLong,
                 HasValue    = true
             };
         }
     }
     Close();
 }
        private void btnPlay_Click(object sender, EventArgs e)
        {
            if (lbVoiceSnippets.SelectedIndex != -1)
            {
                t_DatabaseRecord snippet = filteredVoiceSnippets[lbVoiceSnippets.SelectedIndex];
                if (hasIntonation)
                {
                    VoiceSnippet vSnippet = new VoiceSnippet
                    {
                        FileName    = Path.Combine(baseDir, rbIntonationHigh.Checked ? "hoch" : "tief", snippet.FileName),
                        DisplayText = snippet.ContentLong,
                        HasValue    = true
                    };

                    string      filename = parentForm.addBaseDir(vSnippet.FileName);
                    SoundPlayer player   = new SoundPlayer(filename);
                    player.PlaySync();
                }
                else
                {
                    VoiceSnippet vSnippet = new VoiceSnippet
                    {
                        FileName    = Path.Combine(baseDir, snippet.FileName),
                        DisplayText = snippet.ContentLong,
                        HasValue    = true
                    };

                    string      filename = parentForm.addBaseDir(vSnippet.FileName);
                    SoundPlayer player   = new SoundPlayer(filename);
                    player.PlaySync();
                }
            }
        }
Beispiel #3
0
 private void confirmSelection()
 {
     if (lbStationNames.SelectedIndex != -1)
     {
         t_DatabaseRecord station = filteredStationNames[lbStationNames.SelectedIndex];
         SelectedStation = new VoiceSnippet
         {
             FileName    = Path.Combine("ziele", rbFullName.Checked ? "variante2" : "variante1", rbIntonationHigh.Checked ? "hoch" : "tief", station.FileName),
             DisplayText = rbFullName.Checked ? station.ContentLong : station.ContentShort,
             HasValue    = true
         };
     }
     Close();
 }