Пример #1
0
 /// <summary>
 /// Retrieves the speaker configuration of the device.
 /// </summary>
 /// <param name="speakerSet" />
 /// <param name="geometry" />
 public void GetSpeakerConfiguration(out SpeakerConfiguration speakerSet, out SpeakerGeometry geometry)
 {
     int speakerConfig;
     GetSpeakerConfiguration(out speakerConfig);
     speakerSet = (SpeakerConfiguration)(speakerConfig & 0xFFFF);
     geometry = (SpeakerGeometry)(speakerConfig >> 16);
 }
Пример #2
0
        /// <summary>
        /// Retrieves the speaker configuration of the device.
        /// </summary>
        /// <param name="speakerSet" />
        /// <param name="geometry" />
        public void GetSpeakerConfiguration(out SpeakerConfiguration speakerSet, out SpeakerGeometry geometry)
        {
            int speakerConfig;

            GetSpeakerConfiguration(out speakerConfig);
            speakerSet = (SpeakerConfiguration)(speakerConfig & 0xFFFF);
            geometry   = (SpeakerGeometry)(speakerConfig >> 16);
        }
Пример #3
0
        public void Open(string scriptPath)
        {
            lock (locker)
            {
                try
                {
                    script = scriptPath;
                    LoadAviSynth();

                    if (IsError || IsAborted)
                    {
                        return;
                    }

                    if (HasVideo)
                    {
                        try
                        {
                            //Framework 3.0 с SP1+
                            CreateInteropBitmap();
                        }
                        catch (TypeLoadException)
                        {
                            //Framework 3.0 без SP1
                            CreateWriteableBitmap();
                        }
                    }

                    if (HasAudio)
                    {
                        SetUpAudioDevice();
                    }

                    #region ShowPictureViewInfo
                    if (HasVideo && reader.GetVarBoolean("ShowPictureViewInfo", false))
                    {
                        SpeakerConfiguration conf = 0; SpeakerGeometry geom = 0;
                        if (HasAudio)
                        {
                            AudioDevice.GetSpeakerConfiguration(out conf, out geom);
                        }

                        Stopwatch sw = Stopwatch.StartNew();
                        for (int i = 0; i < 100; i++)
                        {
                            Thread.Sleep(1);
                        }
                        sw.Stop();

                        Message mes = new Message(Owner);
                        mes.ShowMessage("Video\r\n  Resolution: " + reader.Width + "x" + reader.Height + ", FrameRate: " + reader.Framerate + ", Format: " +
                                        reader.Clip.OriginalColorspace + ((reader.Clip.OriginalColorspace != AviSynthColorspace.RGB32) ? "->RGB32" : "") + " \r\n  Output: " +
                                        ((IsInterop) ? "InteropBitmap" : "WriteableBitmap (Install SP1 for .NET Framework 3.0!)") + "\r\n\r\nAudio\r\n" +
                                        ((HasAudio) ? "  Bits: " + BufferDesc.Format.BitsPerSample + ((reader.Clip.SampleType == AudioSampleType.FLOAT) ? " FLOAT" : "") +
                                         ", SampleRate: " + BufferDesc.Format.SampleRate + ", Channels: " + BufferDesc.Format.Channels + ((BufferDesc.Format.Encoding == WaveFormatEncoding.Extensible) ?
                                                                                                                                          ", Mask: " + ((WaveFormatExtensible)BufferDesc.Format).ChannelMask + " (" + (int)((WaveFormatExtensible)BufferDesc.Format).ChannelMask + ")" : "") +
                                         "\r\n  PrimaryBuffers: " + AudioDevice.Capabilities.PrimaryBuffers + ", MixingBuffers: " + AudioDevice.Capabilities.MaxHardwareMixingAllBuffers +
                                         " (" + AudioDevice.Capabilities.FreeHardwareMixingAllBuffers + "), 3DBuffers: " + AudioDevice.Capabilities.MaxHardware3DAllBuffers + " (" +
                                         AudioDevice.Capabilities.FreeHardware3DAllBuffers + "), MemBytes: " + AudioDevice.Capabilities.TotalHardwareMemBytes + " (" +
                                         AudioDevice.Capabilities.FreeHardwareMemBytes + "), SampleRate: " + AudioDevice.Capabilities.MinSecondarySampleRate + " - " +
                                         AudioDevice.Capabilities.MaxSecondarySampleRate + (((AudioDevice.Capabilities.Flags & CapabilitiesFlags.ContinousRate) > 0) ? " (continuous)" : "") +
                                         "\r\n  SpeakerConfiguration: " + conf + ", SpeakerGeometry: " + geom + "\r\n" : "  None" + ((!EnableAudio) ? " (disabled)" : "") + "\r\n") +
                                        "\r\nTimers\r\n  Sleep(100): " + sw.ElapsedMilliseconds + ", HighResolutionStopwatch: " + Stopwatch.IsHighResolution, Languages.Translate("Info"));
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    SetError(ex);
                }
            }
        }
Пример #4
0
 /// <summary>
 /// Sets the speaker configuration of the device.
 /// </summary>
 /// <param name="speakerSet" />
 /// <param name="geometry" />
 public void SetSpeakerConfiguration(SpeakerConfiguration speakerSet, SpeakerGeometry geometry)
 {
     SetSpeakerConfiguration(((int)speakerSet) | (((int)geometry) << 16));
 }
Пример #5
0
 /// <summary>
 /// Sets the speaker configuration of the device.
 /// </summary>
 /// <param name="speakerSet" />
 /// <param name="geometry" />
 public void SetSpeakerConfiguration(SpeakerConfiguration speakerSet, SpeakerGeometry geometry)
 {
     SetSpeakerConfiguration(((int)speakerSet) | (((int)geometry) << 16));
 }