Esempio n. 1
0
        public HostApiItem(PortAudio.PaHostApiInfo hostApiInfo, IUpdatableControl updatableControl)
        {
            this.hostApiInfo = hostApiInfo;

                int deviceCount = PortAudio.Pa_GetDeviceCount();
                int selectedHostApiDeviceCount = 0;
                for (int i = 0; i < deviceCount; i++) {
                    PortAudio.PaDeviceInfo paDeviceInfo = PortAudio.Pa_GetDeviceInfo(i);
                    PortAudio.PaHostApiInfo paHostApi = PortAudio.Pa_GetHostApiInfo(paDeviceInfo.hostApi);
                    if (paHostApi.type == hostApiInfo.type) { selectedHostApiDeviceCount++; }
                }

                if (selectedHostApiDeviceCount > 0) {
                    switch(hostApiInfo.type) {
                    case PortAudio.PaHostApiTypeId.paMME:
                        hostApiDeviceControl = new MMEDeviceControl(hostApiInfo, updatableControl);
                        break;
                    case PortAudio.PaHostApiTypeId.paDirectSound:
                        hostApiDeviceControl = new DirectSoundDeviceControl(hostApiInfo, updatableControl);
                        break;
                    case PortAudio.PaHostApiTypeId.paASIO:
                        hostApiDeviceControl = new ASIODeviceControl(hostApiInfo, updatableControl);
                        break;
                    case PortAudio.PaHostApiTypeId.paALSA:
                        hostApiDeviceControl = new ALSADeviceControl(hostApiInfo, updatableControl);
                        break;
                    }
                } else {
                    hostApiDeviceControl = new NoDevicesDeviceControl(hostApiInfo, updatableControl);
                }
        }
Esempio n. 2
0
        /// <summary>
        /// This method needs to be called by custom controls that want their innerHTML to be automatically updated on the client pages during
        /// call backs. Call this at the bottom of the Render override.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parentTagName"></param>
        /// <param name="control"></param>
        public static void WriteEndControlMarker(HtmlTextWriter writer, string parentTagName, Control control)
        {
            IUpdatableControl updatableControl = control as IUpdatableControl;

            if (updatableControl != null && updatableControl.UpdateAfterCallBack && IsCallBack)
            {
                writer.Write(Markers.ControlEnd + GetUniqueIDWithDollars(control) + "-->");
            }

            writer.Write("</{0}>", parentTagName);
        }
Esempio n. 3
0
        /// <summary>
        /// This method needs to be called by custom controls that want their innerHTML to be automatically updated on the client pages during
        /// call backs. Call this at the top of the Render override. The parentTagName argument should be "div" or "span" depending on the
        /// type of control. It's this parent element that actually gets its innerHTML updated after call backs.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parentTagName"></param>
        /// <param name="control"></param>
        public static void WriteBeginControlMarker(HtmlTextWriter writer, string parentTagName, Control control)
        {
            writer.Write("<{0} id=\"{1}\">", parentTagName, "Anthem_" + control.ClientID + "__");

            IUpdatableControl updatableControl = control as IUpdatableControl;

            if (updatableControl != null && updatableControl.UpdateAfterCallBack && IsCallBack)
            {
                writer.Write(Markers.ControlBegin + GetUniqueIDWithDollars(control) + "-->");
            }
        }
Esempio n. 4
0
        public AudioSettingsControl(IUpdatableControl updatableControl)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.updatableControl = updatableControl;
            this.deviceControl    = null;
        }
        public MMEDeviceControl(PortAudio.PaHostApiInfo paHostApiInfo, IUpdatableControl updatableControl)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.paHostApiInfo = paHostApiInfo;
            this.updatableControl = updatableControl;
        }
Esempio n. 6
0
        public NoDevicesDeviceControl(PortAudio.PaHostApiInfo paHostApiInfo, IUpdatableControl updatableControl)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.paHostApiInfo    = paHostApiInfo;
            this.updatableControl = updatableControl;
        }
        public AudioSettingsControl(IUpdatableControl updatableControl)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this.updatableControl = updatableControl;
            this.deviceControl = null;
        }
Esempio n. 8
0
        public HostApiItem(PortAudio.PaHostApiInfo hostApiInfo, IUpdatableControl updatableControl)
        {
            this.hostApiInfo = hostApiInfo;

            int deviceCount = PortAudio.Pa_GetDeviceCount();
            int selectedHostApiDeviceCount = 0;

            for (int i = 0; i < deviceCount; i++)
            {
                PortAudio.PaDeviceInfo  paDeviceInfo = PortAudio.Pa_GetDeviceInfo(i);
                PortAudio.PaHostApiInfo paHostApi    = PortAudio.Pa_GetHostApiInfo(paDeviceInfo.hostApi);
                if (paHostApi.type == hostApiInfo.type)
                {
                    selectedHostApiDeviceCount++;
                }
            }

            if (selectedHostApiDeviceCount > 0)
            {
                switch (hostApiInfo.type)
                {
                case PortAudio.PaHostApiTypeId.paMME:
                    hostApiDeviceControl = new MMEDeviceControl(hostApiInfo, updatableControl);
                    break;

                case PortAudio.PaHostApiTypeId.paDirectSound:
                    hostApiDeviceControl = new DirectSoundDeviceControl(hostApiInfo, updatableControl);
                    break;

                case PortAudio.PaHostApiTypeId.paASIO:
                    hostApiDeviceControl = new ASIODeviceControl(hostApiInfo, updatableControl);
                    break;

                case PortAudio.PaHostApiTypeId.paALSA:
                    hostApiDeviceControl = new ALSADeviceControl(hostApiInfo, updatableControl);
                    break;
                }
            }
            else
            {
                hostApiDeviceControl = new NoDevicesDeviceControl(hostApiInfo, updatableControl);
            }
        }