public void SetSpeexOutput(ref VFSpeexOutput speexOutput)
        {
            if (speexSettingsDialog == null)
            {
                speexSettingsDialog = new SpeexSettingsDialog();
            }

            speexSettingsDialog.SaveSettings(ref speexOutput);
        }
        private void Dispose(bool disposing)
        {
            ReleaseUnmanagedResources();

            if (disposing)
            {
                if (mfSettingsDialog != null)
                {
                    mfSettingsDialog.Dispose();
                    mfSettingsDialog = null;
                }

                if (ffmpegDLLSettingsDialog != null)
                {
                    ffmpegDLLSettingsDialog.Dispose();
                    ffmpegDLLSettingsDialog = null;
                }

                if (webmSettingsDialog != null)
                {
                    webmSettingsDialog.Dispose();
                    webmSettingsDialog = null;
                }

                if (pcmSettingsDialog != null)
                {
                    pcmSettingsDialog.Dispose();
                    pcmSettingsDialog = null;
                }

                if (mp3SettingsDialog != null)
                {
                    mp3SettingsDialog.Dispose();
                    mp3SettingsDialog = null;
                }

                if (dvSettingsDialog != null)
                {
                    dvSettingsDialog.Dispose();
                    dvSettingsDialog = null;
                }

                if (wmaSettingsDialog != null)
                {
                    wmaSettingsDialog.Dispose();
                    wmaSettingsDialog = null;
                }

                if (wmvSettingsDialog != null)
                {
                    wmvSettingsDialog.Dispose();
                    wmvSettingsDialog = null;
                }

                if (mkvSettingsDialog != null)
                {
                    mkvSettingsDialog.Dispose();
                    mkvSettingsDialog = null;
                }

                if (aviSettingsDialog != null)
                {
                    aviSettingsDialog.Dispose();
                    aviSettingsDialog = null;
                }

                if (mp4V10SettingsDialog != null)
                {
                    mp4V10SettingsDialog.Dispose();
                    mp4V10SettingsDialog = null;
                }

                if (gifSettingsDialog != null)
                {
                    gifSettingsDialog.Dispose();
                    gifSettingsDialog = null;
                }

                if (m4aSettingsDialog != null)
                {
                    m4aSettingsDialog.Dispose();
                    m4aSettingsDialog = null;
                }

                if (speexSettingsDialog != null)
                {
                    speexSettingsDialog.Dispose();
                    speexSettingsDialog = null;
                }

                if (oggVorbisSettingsDialog != null)
                {
                    oggVorbisSettingsDialog.Dispose();
                    oggVorbisSettingsDialog = null;
                }

                if (customFormatSettingsDialog != null)
                {
                    customFormatSettingsDialog.Dispose();
                    customFormatSettingsDialog = null;
                }

                if (flacSettingsDialog != null)
                {
                    flacSettingsDialog.Dispose();
                    flacSettingsDialog = null;
                }

                if (ffmpegEXESettingsDialog != null)
                {
                    ffmpegEXESettingsDialog.Dispose();
                    ffmpegEXESettingsDialog = null;
                }
            }
        }
        public void ShowDialog(VFVideoCaptureOutputFormat format, IWin32Window parent, VideoCaptureCore core)
        {
            switch (format)
            {
            case VFVideoCaptureOutputFormat.AVI:
            {
                if (aviSettingsDialog == null)
                {
                    aviSettingsDialog = new AVISettingsDialog(core.Video_Codecs().ToArray(), core.Audio_Codecs().ToArray());
                }

                aviSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.WMV:
            {
                if (wmvSettingsDialog == null)
                {
                    wmvSettingsDialog = new WMVSettingsDialog(core);
                }

                wmvSettingsDialog.WMA = false;
                wmvSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.DV:
            {
                if (dvSettingsDialog == null)
                {
                    dvSettingsDialog = new DVSettingsDialog();
                }

                dvSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.MKVv1:
            {
                if (mkvSettingsDialog == null)
                {
                    mkvSettingsDialog = new AVISettingsDialog(core.Video_Codecs().ToArray(), core.Audio_Codecs().ToArray());
                }

                mkvSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.PCM_ACM:
            {
                if (pcmSettingsDialog == null)
                {
                    pcmSettingsDialog = new PCMSettingsDialog(core.Audio_Codecs().ToArray());
                }

                pcmSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.WMA:
            {
                if (wmaSettingsDialog == null)
                {
                    wmaSettingsDialog = new WMVSettingsDialog(core);
                }

                wmaSettingsDialog.WMA = true;
                wmaSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.MP3:
            {
                if (mp3SettingsDialog == null)
                {
                    mp3SettingsDialog = new MP3SettingsDialog();
                }

                mp3SettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.Custom:
            {
                if (customFormatSettingsDialog == null)
                {
                    customFormatSettingsDialog = new CustomFormatSettingsDialog(core.Video_Codecs().ToArray(), core.Audio_Codecs().ToArray(), core.DirectShow_Filters().ToArray());
                }

                customFormatSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureDV:
            case VFVideoCaptureOutputFormat.DirectCaptureMPEG:
            case VFVideoCaptureOutputFormat.DirectCaptureAVI:
            case VFVideoCaptureOutputFormat.DirectCaptureMKV:
            {
                MessageBox.Show("No settings available for selected output format.");

                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_DLL:
            {
                if (ffmpegDLLSettingsDialog == null)
                {
                    ffmpegDLLSettingsDialog = new FFMPEGDLLSettingsDialog();
                }

                ffmpegDLLSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.WebM:
            {
                if (webmSettingsDialog == null)
                {
                    webmSettingsDialog = new WebMSettingsDialog();
                }

                webmSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMP4_GDCL:
            case VFVideoCaptureOutputFormat.DirectCaptureMP4_Monogram:
            {
                MessageBox.Show("No settings available for selected output format.");

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureCustom:
            {
                if (customFormatSettingsDialog == null)
                {
                    customFormatSettingsDialog = new CustomFormatSettingsDialog(core.Video_Codecs().ToArray(), core.Audio_Codecs().ToArray(), core.DirectShow_Filters().ToArray());
                }

                customFormatSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.MP4_CUDA:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                mp4V10SettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v8v10:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                mp4V10SettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v11:
            {
                if (mfSettingsDialog == null)
                {
                    mfSettingsDialog = new MFSettingsDialog(MFSettingsDialogMode.MP4v11);
                }

                mfSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.Encrypted:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                mp4V10SettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.FLAC:
            {
                if (flacSettingsDialog == null)
                {
                    flacSettingsDialog = new FLACSettingsDialog();
                }

                flacSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.OggVorbis:
            {
                if (oggVorbisSettingsDialog == null)
                {
                    oggVorbisSettingsDialog = new OggVorbisSettingsDialog();
                }

                oggVorbisSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.Speex:
            {
                if (speexSettingsDialog == null)
                {
                    speexSettingsDialog = new SpeexSettingsDialog();
                }

                speexSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_EXE:
            {
                if (ffmpegEXESettingsDialog == null)
                {
                    ffmpegEXESettingsDialog = new FFMPEGEXESettingsDialog();
                }

                ffmpegEXESettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.M4A:
            {
                if (m4aSettingsDialog == null)
                {
                    m4aSettingsDialog = new M4ASettingsDialog();
                }

                m4aSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.AnimatedGIF:
            {
                if (gifSettingsDialog == null)
                {
                    gifSettingsDialog = new GIFSettingsDialog();
                }

                gifSettingsDialog.ShowDialog(parent);

                break;
            }

            case VFVideoCaptureOutputFormat.VLC_EXE:
            {
                MessageBox.Show("No settings available for selected output format.");

                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
            }
        }