javazoom.jl.decoder.OutputChannels.fromInt C# (CSharp) Method

fromInt() public static method

Creates an OutputChannels instance corresponding to the given channel code.
public static fromInt ( int code ) : OutputChannels
code int one of the OutputChannels channel code constants. /// /// @throws IllegalArgumentException if code is not a valid /// channel code. /// ///
return OutputChannels
        public static OutputChannels fromInt(int code)
        {
            switch (code)
            {

                case (int)OutputChannelsEnum.LEFT_CHANNEL:
                    return LEFT;

                case (int)OutputChannelsEnum.RIGHT_CHANNEL:
                    return RIGHT;

                case (int)OutputChannelsEnum.BOTH_CHANNELS:
                    return BOTH;

                case (int)OutputChannelsEnum.DOWNMIX_CHANNELS:
                    return DOWNMIX;

                default:
                    throw new System.ArgumentException("Invalid channel code: " + code);

            }
        }