public void MoveToChannel(Channel channel) { Connection.Self.MoveTo(channel); // Sound feedback SoundFeedbackHelper.PlaySoundFromString("channel_switched.wav"); }
public void UnmuteMicrophone() { Connection.Self.InputMuted = false; // Sound feedback SoundFeedbackHelper.PlaySoundFromString("mic_activated.wav"); }
public void UnmuteSpeakers() { Connection.Self.OutputMuted = false; // Sound feedback SoundFeedbackHelper.PlaySoundFromString("sound_resumed.wav"); }
public void SetUnreadMessageCount(int count) { this.Invoke(new MethodInvoker(delegate() { if (int.Parse(pictureBoxUnreadMessage.Tag.ToString()) < count) { // New message so play sound SoundFeedbackHelper.PlaySoundFromString("chat_message_inbound.wav"); } pictureBoxUnreadMessage.Tag = count.ToString(); })); }
public void MoveToChannel(string channelName) { // Get the channel foreach (Channel channel in Connection.AllChannels) { if (channel.Name.ToLower() == channelName.ToLower()) { Connection.Self.MoveTo(channel); // Sound feedback SoundFeedbackHelper.PlaySoundFromString("channel_switched.wav"); } } }
private static void Connection_ClientTimeout(Client client, Channel oldChannel, Channel newChannel, TeamSpeak.Sdk.Visibility visibility, string message) { Console.WriteLine($"{client.Nickname} timeouts with message {message}"); if (client != Connection.Self) { // Check if client is in same channel as self if (oldChannel == Connection.Self.Channel) { // Play sound SoundFeedbackHelper.PlaySoundFromString("neutral_connection_connectionlost_currentchannel.wav"); } // Client disconnected, remove from channel list mainForm.channelList.RemoveClient(client, oldChannel, client.Nickname == Connection.Self.Nickname); } }
private static void Connection_StatusChanged(Connection connection, ConnectStatus newStatus, Error error) { Console.WriteLine($"Connect status changed: {connection.ID} {newStatus} {error}"); if (newStatus == ConnectStatus.Disconnected && error == Error.FailedConnectionInitialisation) { Console.WriteLine("Looks like there is no server running."); } else if (newStatus == ConnectStatus.ConnectionEstablished) { // Sound feedback SoundFeedbackHelper.PlaySoundFromString("connected.wav"); // Loading screen mainForm.timerLoadingScreen.Start(); // End of Loading screen // Try to move client to default channel // Get the channel bool clientDefaultChannelFound = false; foreach (Channel channel in Connection.AllChannels) { if (channel.Name.ToLower() == Properties.Settings.Default.DefaultChannel.ToLower()) { Connection.Self.MoveTo(channel); // Display channel's ChannelHeader mainForm.ShowChannelHeader(channel); // Initialize the clientChatBrowser list mainForm.InitializeClientChatBrowserListWithClients(); // Initialize the chatbrowser list mainForm.InitializeChatBrowserListWithChannels(); // Initialize channel's chat bool success = mainForm.InitializeChatBrowser(channel); if (success) { // Display channel's chat mainForm.ShowChatBrowser(channel, true); mainForm.ApplySettingsValues(); clientDefaultChannelFound = true; break; } else { // Nothing } } } if (!clientDefaultChannelFound) { if (mainForm.channelList == null) { DisplayAllChannelsOnForm(); } // Display channel's ChannelHeader mainForm.ShowChannelHeader(connection.Self.Channel); // Initialize the clientChatBrowser list mainForm.InitializeClientChatBrowserListWithClients(); // Initialize the chatbrowser list mainForm.InitializeChatBrowserListWithChannels(); // Initialize channel's chat bool success = mainForm.InitializeChatBrowser(connection.Self.Channel); if (success) { // Display channel's chat mainForm.ShowChatBrowser(connection.Self.Channel, true); mainForm.ApplySettingsValues(); clientDefaultChannelFound = true; } else { // Nothing } } } }
private static void Connection_ClientMoved(Client client, Channel oldChannel, Channel newChannel, TeamSpeak.Sdk.Visibility visibility, Client invoker, string message) { Console.WriteLine($"{client.Nickname} moves from channel {oldChannel?.Name ?? "nowhere"} to {newChannel?.Name ?? "nowhere"} with message {message}"); try { List <Channel> channels = Connection.AllChannels.ToList(); if (mainForm.channelList == null) { DisplayAllChannelsOnForm(); } else { if (oldChannel != null && newChannel != null) { // Move the client label mainForm.channelList.MoveClient(client, oldChannel, newChannel, client.Nickname == Connection.Self.Nickname); } else if (newChannel == null) { // Client disconnected, remove from channel list mainForm.channelList.RemoveClient(client, oldChannel, client.Nickname == Connection.Self.Nickname); } else if (oldChannel == null) { // Client connected, add to channel list mainForm.channelList.RemoveClient(client, newChannel, client.Nickname == Connection.Self.Nickname); // Allow whispers from client Connection.AllowWhispersFrom(client); // Initialize clients chatbrowser mainForm.AddClientChatBrowser(client); } } // Check if client = self if (client.Nickname == Connection.Self.Nickname) { // Self, so update the channelName label next to the application logo mainForm.UpdateCurrentChannelLabel(newChannel); // Update clients icon in channel list updateClientIconBasedOnActivity(client, SelfTalkStatus); // Update aplication icon UpdateApplicationIconBasedOnActivity(SelfTalkStatus); } else { // Check whether the client joined or left the self clients channel if (oldChannel == Connection.Self.Channel) { if (newChannel == null) { // Client disconnected, play disconnected sound SoundFeedbackHelper.PlaySoundFromString("neutral_connection_disconnected_currentchannel.wav"); } else { // Sound feedback SoundFeedbackHelper.PlaySoundFromString("neutral_switched_awayfromcurrentchannel.wav"); } } else if (newChannel == Connection.Self.Channel) { // Sound feedback SoundFeedbackHelper.PlaySoundFromString("neutral_switched_tocurrentchannel.wav"); } } } catch (TeamSpeak.Sdk.TeamSpeakException) { // Do nothing, client disconnected } }