protected internal ClientSourceManager(IGablarskiClientContext context) { if (context == null) throw new ArgumentNullException ("context"); this.context = context; }
public void TearDown() { this.provider = null; this.source = null; this.receiver = null; this.sender = null; this.context = null; }
protected internal ClientSourceManager(IGablarskiClientContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.context = context; }
protected internal ClientChannelManager(IGablarskiClientContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.context = context; this.context.RegisterMessageHandler <ChannelListMessage> (OnChannelListReceivedMessage); }
public MediaController(IGablarskiClientContext context, IEnumerable <IMediaPlayer> mediaPlayers) { this.context = context; this.mediaPlayers = mediaPlayers; this.context.Audio.SourceFinished += OnSourceFinished; this.context.Sources.ReceivedAudio += OnReceivedAudio; this.context.Sources.AudioSourceStarted += OnAudioSourceStarted; this.context.Sources.AudioSourceStopped += OnAudioSourceStopped; playerTimer = new Timer(Pulse, null, 0, 2500); }
public MediaController(IGablarskiClientContext context, IEnumerable<IMediaPlayer> mediaPlayers) { this.context = context; this.mediaPlayers = mediaPlayers; this.context.Audio.SourceFinished += OnSourceFinished; this.context.Sources.ReceivedAudio += OnReceivedAudio; this.context.Sources.AudioSourceStarted += OnAudioSourceStarted; this.context.Sources.AudioSourceStopped += OnAudioSourceStopped; playerTimer = new Timer (Pulse, null, 0, 2500); }
public void Setup() { this.provider = new MockAudioCaptureProvider(); this.source = AudioSourceTests.GetTestSource(); var c = new MockConnectionProvider(GablarskiProtocol.Instance).GetClientConnection(); var client = new MockClientContext(c); this.context = client; this.sender = new ClientSourceHandler(client, new ClientSourceManager(client)); this.receiver = (IAudioReceiver)this.sender; }
internal CurrentUser(IGablarskiClientContext context, int userId, string nickname, int currentChannelId) : this(context) { if (userId == 0) throw new ArgumentException ("userId"); if (nickname.IsNullOrWhitespace()) throw new ArgumentNullException ("nickname", "nickname is null or empty."); if (currentChannelId < 0) throw new ArgumentOutOfRangeException ("currentChannelId"); this.UserId = userId; this.Nickname = nickname; this.CurrentChannelId = currentChannelId; }
public CurrentUser(IGablarskiClientContext context) { if (context == null) throw new ArgumentNullException ("context"); this.context = context; this.context.RegisterMessageHandler<UserChangedChannelMessage> (OnUserChangedChannelMessage); this.context.RegisterMessageHandler<UserUpdatedMessage> (OnUserUpdatedMessage); this.context.RegisterMessageHandler<LoginResultMessage> (OnLoginResultMessage); this.context.RegisterMessageHandler<JoinResultMessage> (OnJoinResultMessage); this.context.RegisterMessageHandler<PermissionsMessage> (OnPermissionsMessage); this.context.RegisterMessageHandler<UserKickedMessage> (OnUserKickedMessage); this.context.RegisterMessageHandler<RegisterResultMessage> (OnRegisterResultMessage); }
public CurrentUser(IGablarskiClientContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.context = context; this.context.RegisterMessageHandler <UserChangedChannelMessage> (OnUserChangedChannelMessage); this.context.RegisterMessageHandler <UserUpdatedMessage> (OnUserUpdatedMessage); this.context.RegisterMessageHandler <LoginResultMessage> (OnLoginResultMessage); this.context.RegisterMessageHandler <JoinResultMessage> (OnJoinResultMessage); this.context.RegisterMessageHandler <PermissionsMessage> (OnPermissionsMessage); this.context.RegisterMessageHandler <UserKickedMessage> (OnUserKickedMessage); this.context.RegisterMessageHandler <RegisterResultMessage> (OnRegisterResultMessage); }
protected internal ClientSourceHandler(IGablarskiClientContext context, IClientSourceManager manager) { if (context == null) throw new ArgumentNullException ("context"); if (manager == null) throw new ArgumentNullException ("manager"); this.context = context; this.manager = manager; this.context.RegisterMessageHandler<SourceListMessage> (OnSourceListReceivedMessage); this.context.RegisterMessageHandler<SourcesRemovedMessage> (OnSourcesRemovedMessage); this.context.RegisterMessageHandler<SourceResultMessage> (OnSourceResultMessage); this.context.RegisterMessageHandler<ServerAudioDataMessage> (OnServerAudioDataMessage); this.context.RegisterMessageHandler<AudioSourceStateChangeMessage> (OnAudioSourceStateChangedMessage); this.context.RegisterMessageHandler<SourceMutedMessage> (OnSourceMutedMessage); }
internal CurrentUser(IGablarskiClientContext context, int userId, string nickname, int currentChannelId) : this(context) { if (userId == 0) { throw new ArgumentException("userId"); } if (nickname.IsNullOrWhitespace()) { throw new ArgumentNullException("nickname", "nickname is null or empty."); } if (currentChannelId < 0) { throw new ArgumentOutOfRangeException("currentChannelId"); } this.UserId = userId; this.Nickname = nickname; this.CurrentChannelId = currentChannelId; }
protected internal ClientSourceHandler(IGablarskiClientContext context, IClientSourceManager manager) { if (context == null) { throw new ArgumentNullException("context"); } if (manager == null) { throw new ArgumentNullException("manager"); } this.context = context; this.manager = manager; this.context.RegisterMessageHandler <SourceListMessage> (OnSourceListReceivedMessage); this.context.RegisterMessageHandler <SourcesRemovedMessage> (OnSourcesRemovedMessage); this.context.RegisterMessageHandler <SourceResultMessage> (OnSourceResultMessage); this.context.RegisterMessageHandler <ServerAudioDataMessage> (OnServerAudioDataMessage); this.context.RegisterMessageHandler <AudioSourceStateChangeMessage> (OnAudioSourceStateChangedMessage); this.context.RegisterMessageHandler <SourceMutedMessage> (OnSourceMutedMessage); }
protected internal ClientUserHandler(IGablarskiClientContext context, IClientUserManager manager) { if (context == null) { throw new ArgumentNullException("context"); } if (manager == null) { throw new ArgumentNullException("manager"); } this.context = context; this.manager = manager; this.context.RegisterMessageHandler <UserInfoListMessage> (OnUserListReceivedMessage); this.context.RegisterMessageHandler <UserUpdatedMessage> (OnUserUpdatedMessage); this.context.RegisterMessageHandler <UserChangedChannelMessage> (OnUserChangedChannelMessage); this.context.RegisterMessageHandler <ChannelChangeResultMessage> (OnChannelChangeResultMessage); this.context.RegisterMessageHandler <UserJoinedMessage> (OnUserJoinedMessage); this.context.RegisterMessageHandler <UserDisconnectedMessage> (OnUserDisconnectedMessage); this.context.RegisterMessageHandler <UserMutedMessage> (OnUserMutedMessage); this.context.RegisterMessageHandler <UserKickedMessage> (OnUserKickedMessage); }
public void Setup() { this.provider = new MockAudioCaptureProvider(); this.source = AudioSourceTests.GetTestSource(); var c = new MockConnectionProvider (GablarskiProtocol.Instance).GetClientConnection(); var client = new MockClientContext (c); this.context = client; this.sender = new ClientSourceHandler (client, new ClientSourceManager (client)); this.receiver = (IAudioReceiver)this.sender; }
public void ManagerSetup() { this.provider = new MockConnectionProvider (GablarskiProtocol.Instance); this.provider.Start (MessageTypes.All); var connections = this.provider.GetConnections (GablarskiProtocol.Instance); this.server = new ConnectionBuffer (connections.Item2); this.client = connections.Item1; MockClientContext c; this.context = c = new MockClientContext (this.client); var channels = new ClientChannelManager (context); ClientChannelManagerTests.PopulateChannels (channels, server); c.Users = new ClientUserHandler (context, new ClientUserManager()); c.Channels = channels; c.CurrentUser = new CurrentUser (context, 1, "Foo", channels.First().ChannelId); this.manager = new ClientSourceManager (context); this.handler = new ClientSourceHandler (context, manager); }
protected internal ClientUserHandler(IGablarskiClientContext context, IClientUserManager manager) { if (context == null) throw new ArgumentNullException ("context"); if (manager == null) throw new ArgumentNullException ("manager"); this.context = context; this.manager = manager; this.context.RegisterMessageHandler<UserInfoListMessage> (OnUserListReceivedMessage); this.context.RegisterMessageHandler<UserUpdatedMessage> (OnUserUpdatedMessage); this.context.RegisterMessageHandler<UserChangedChannelMessage> (OnUserChangedChannelMessage); this.context.RegisterMessageHandler<ChannelChangeResultMessage> (OnChannelChangeResultMessage); this.context.RegisterMessageHandler<UserJoinedMessage> (OnUserJoinedMessage); this.context.RegisterMessageHandler<UserDisconnectedMessage> (OnUserDisconnectedMessage); this.context.RegisterMessageHandler<UserMutedMessage> (OnUserMutedMessage); this.context.RegisterMessageHandler<UserKickedMessage> (OnUserKickedMessage); }
public static IChannelInfo GetCurrentChannel(this IGablarskiClientContext self) { return(self.Channels[self.CurrentUser.CurrentChannelId]); }