public void SetNetworkData(object data) { HClientInformation client = (HClientInformation)data; if (this.client != null) { this.client.RateUpdated -= RateUpdatedHandler; this.client.SilentReceived -= SilentSignal; this.client.SetConverter(null); } this.client = client; if (client != null) { this.Guid = client.Guid; this.Name = client.Name; State = ConnectionState.Connected; client.RateUpdated += RateUpdatedHandler; client.SilentReceived += SilentSignal; client.SetConverter(new PCMToFloatConverter(VolumeConverter)); } else { State = ConnectionState.Disconnected; } }
public TServerProfile(HClientInformation client, Mixer mixer) { dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; DataOutput = new BranchingConverter(mixer); VolumeConverter = new ScalingConverter(DataOutput, 0.5f); Volume = 50; SetNetworkData(client); }
async void server_ProfileRequest(object sender, HClientInformation client) { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { TServerProfile profile = new TServerProfile(client, mixer); if (NewProfile != null) { NewProfile(this, profile); } }); }