Esempio n. 1
0
        public float GetLevel(VoicemeeterLevelType type, VoicemeeterChannels channel)
        {
            float res;
            int   rep = VBVMR_GetLevel.Invoke((int)type, (int)channel, &res);

            if (rep == 0)
            {
                return(res);
            }
            if (rep == -1)
            {
                throw new ConnectionException("Can not get client");
            }
            if (rep == -2)
            {
                throw new ConnectionException("Unexpected login (logout was excepted before");
            }
            if (rep == -3)
            {
                throw new ArgumentException("No level availible");
            }
            if (rep == -4)
            {
                throw new ArgumentOutOfRangeException("Channel " + channel + " is out of range for type");
            }
            throw new Exception("Unknown error");
        }
 public VoicemeeterLevel(VoicemeeterLevelType type, VoicemeeterChannel channel, Single value)
 {
     this.type    = type;
     this.channel = channel;
     m_value      = value;
 }
 public VoicemeeterLevel(VoicemeeterLevelType type, VoicemeeterChannel channel)
 {
     this.type    = type;
     this.channel = channel;
     m_value      = 0;
 }
Esempio n. 4
0
 /// <param name="type">What type of level to read</param>
 /// <param name="channel">Audio channel</param>
 /// <param name="val">The variable receiving the wanted value.</param>
 /// <inheritdoc cref="GetLevel(ref VoicemeeterLevel)"/>
 public Int32 GetLevel(VoicemeeterLevelType type, VoicemeeterChannel channel, out Single val)
 {
     return(GetLevel((int)type, (int)channel, out val));
 }