Пример #1
0
        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();
                }
            }
        }
Пример #2
0
 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();
 }
Пример #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();
 }
Пример #4
0
        // HELPER FUNCTIONS

        private void genericVoiceSnippetAddHandler(string dbTable, string baseDir, bool hasIntonation)
        {
            GenericVoiceSnippetForm f = new GenericVoiceSnippetForm(backend, dbTable, baseDir, hasIntonation);

            f.StartPosition = FormStartPosition.CenterParent;
            f.parentForm    = this;
            f.ShowDialog();
            VoiceSnippet result = f.SelectedSnippet;

            if (result.HasValue)
            {
                addVoiceSnippet(result);
                updateButtonEnableStates();
            }
        }
Пример #5
0
        private void miStationName_Click(object sender, EventArgs e)
        {
            StationNameForm f = new StationNameForm(backend, addBaseDir("ziele"));

            f.StartPosition = FormStartPosition.CenterParent;
            f.parentForm    = this;
            f.ShowDialog();
            VoiceSnippet result = f.SelectedStation;

            if (result.HasValue)
            {
                addVoiceSnippet(result);
                updateButtonEnableStates();
            }
        }
Пример #6
0
 private void addVoiceSnippet(VoiceSnippet snippet)
 {
     lbVoiceSnippets.Items.Add(snippet);
 }