Beispiel #1
0
        protected virtual void OnReceivedSource(ReceivedAudioSourceEventArgs e)
        {
            var received = this.ReceivedAudioSource;

            if (received != null)
            {
                received(this, e);
            }
        }
Beispiel #2
0
 protected virtual void OnReceivedSource(ReceivedAudioSourceEventArgs e)
 {
     var received = this.ReceivedAudioSource;
     if (received != null)
         received (this, e);
 }
Beispiel #3
0
		void SourcesReceivedSource (object sender, ReceivedAudioSourceEventArgs e)
		{
			if (e.Result == SourceResult.Succeeded)
			{
				if (e.Source.Name == VoiceName)
				{
					voiceSource = e.Source;
					SetupVoiceCapture();
				}
				else if (e.Source.Name == MusicName)
				{
					musicSource = e.Source;
					gablarski.Audio.Attach (musicprovider, musicSource,
					                        new AudioEngineCaptureOptions { Mode = AudioEngineCaptureMode.Explicit });
					gablarski.Audio.BeginCapture (musicSource, gablarski.CurrentChannel);
				}

				users.Update (gablarski.Channels, gablarski.Users, gablarski.Sources);
			}
			else if (e.Result == SourceResult.NewSource)
			{
				AttachSource (e.Source);
			}
			else
			{
				string reason;
				switch (e.Result)
				{
					case SourceResult.FailedPermissions:
						reason = "Insufficient permissions";
						break;

					case SourceResult.FailedLimit:
						reason = "You or the server are at source capacity";
						break;

					default:
						reason = e.Result.ToString();
						break;
				}

				BeginInvoke ((Action)(() => MessageBox.Show (this, "Source '" + e.SourceName + "' request failed: " + reason, "Source Request", MessageBoxButtons.OK, MessageBoxIcon.Error)));
			}
		}