Esempio n. 1
0
            public AudioSinkBin(string elementName) : base(elementName)
            {
                hw_audio_sink = SelectAudioSink();
                Add(hw_audio_sink);
                first = hw_audio_sink;

                // Our audio sink is a tee, so plugins can attach their own pipelines
                audiotee = ElementFactory.Make("tee", "audiotee") as Tee;
                if (audiotee == null)
                {
                    Log.Error("Can not create audio tee!");
                }
                else
                {
                    Add(audiotee);
                }

                volume = FindVolumeProvider(hw_audio_sink);
                if (volume != null)
                {
                    // If the sink provides its own volume property we assume that it will
                    // also save that value across program runs.  Pulsesink has this behaviour.
                    VolumeNeedsSaving = false;
                }
                else
                {
                    volume            = ElementFactory.Make("volume", "volume");
                    VolumeNeedsSaving = true;
                    Add(volume);
                    volume.Link(hw_audio_sink);
                    first = volume;
                }

                equalizer = ElementFactory.Make("equalizer-10bands", "equalizer-10bands");
                if (equalizer != null)
                {
                    Element eq_audioconvert  = ElementFactory.Make("audioconvert", "audioconvert");
                    Element eq_audioconvert2 = ElementFactory.Make("audioconvert", "audioconvert2");
                    preamp = ElementFactory.Make("volume", "preamp");

                    Add(eq_audioconvert, preamp, equalizer, eq_audioconvert2);
                    Element.Link(eq_audioconvert, preamp, equalizer, eq_audioconvert2, first);

                    first = eq_audioconvert;
                    Log.Debug("Built and linked Equalizer");
                }

                // Link the first tee pad to the primary audio sink queue
                Pad sinkpad = first.GetStaticPad("sink");
                Pad pad     = audiotee.GetRequestPad("src%d");

                audiotee.AllocPad = pad;
                pad.Link(sinkpad);
                first = audiotee;

                visible_sink = new GhostPad("sink", first.GetStaticPad("sink"));
                AddPad(visible_sink);
            }
Esempio n. 2
0
 public Pad RequestTeePad()
 {
     return(audiotee.GetRequestPad("src%d"));
 }