public UserInfoDlg(TeamTalk tt, int userid) { ttclient = tt; InitializeComponent(); this.userid = userid; UpdateUser(); }
public HotKeyDlg(TeamTalk tt) { ttclient = tt; InitializeComponent(); ttclient.OnHotKeyTest += new TeamTalk.HotKeyTest(ttclient_OnHotKeyTest); }
public MessageDlg(TeamTalk tt, int userid) { ttclient = tt; this.userid = userid; InitializeComponent(); this.CenterToScreen(); }
public FileTransferDlg(TeamTalk tt, int transferid) { this.ttclient = tt; this.transferid = transferid; InitializeComponent(); ttclient.OnFileTransfer += new TeamTalk.FileTransferUpdate(ttclient_OnFileTransfer); UpdateFileTransfer(); }
private void timer1_Tick(object sender, EventArgs e) { deskwnd = ttclient.AcquireUserDesktopWindow(userid); if (deskwnd.nSessionID <= 0) { this.Close(); return; } if (ClientSize.Height != deskwnd.nHeight || ClientSize.Width != deskwnd.nWidth) { ClientSize = new Size(deskwnd.nWidth, deskwnd.nHeight); //int width_diff = deskwnd.nWidth - ClientSize.Width; //int height_diff = deskwnd.nHeight - ClientSize.Height; //this.Size.Width += width_diff; //this.Size.Height += height_diff; } if (bmp != null) { bmp.Dispose(); } bmp = null; switch (deskwnd.bmpFormat) { case BitmapFormat.BMP_RGB8_PALETTE: bmp = new Bitmap(deskwnd.nWidth, deskwnd.nHeight, deskwnd.nBytesPerLine, PixelFormat.Format8bppIndexed, deskwnd.frameBuffer); ColorPalette pal = bmp.Palette; for (int i = 0; i < 256; i++) { pal.Entries[i] = TeamTalk.Palette_GetColorTable(BitmapFormat.BMP_RGB8_PALETTE, i); } bmp.Palette = pal; break; case BitmapFormat.BMP_RGB16_555: bmp = new Bitmap(deskwnd.nWidth, deskwnd.nHeight, deskwnd.nBytesPerLine, PixelFormat.Format16bppRgb555, deskwnd.frameBuffer); break; case BitmapFormat.BMP_RGB24: bmp = new Bitmap(deskwnd.nWidth, deskwnd.nHeight, deskwnd.nBytesPerLine, PixelFormat.Format24bppRgb, deskwnd.frameBuffer); break; case BitmapFormat.BMP_RGB32: bmp = new Bitmap(deskwnd.nWidth, deskwnd.nHeight, deskwnd.nBytesPerLine, PixelFormat.Format32bppRgb, deskwnd.frameBuffer); break; } Invalidate(); }
public DesktopDlg(TeamTalk tt, int userid) { ttclient = tt; this.userid = userid; InitializeComponent(); this.CenterToScreen(); ttclient.OnUserDesktopWindow += new TeamTalk.NewDesktopWindow(ttclient_OnUserDesktopWindow); }
public ServerStatsDlg(TeamTalk tt) { InitializeComponent(); ttclient = tt; ttclient.OnCmdServerStatistics += new TeamTalk.ServerStats(ttclient_OnCmdServerStatistics); cmd_id = ttclient.DoQueryServerStats(); this.CenterToScreen(); }
public ConnectDlg(TeamTalk tt, Settings settings) { ttclient = tt; this.settings = settings; InitializeComponent(); ipaddrComboBox.Text = settings.server.ipaddr; tcpportNumericUpDown.Value = settings.server.tcpport; udpportNumericUpDown.Value = settings.server.udpport; cryptCheckBox.Checked = settings.server.encrypted; }
public LoginDlg(TeamTalk tt, Settings settings) { ttclient = tt; this.settings = settings; InitializeComponent(); nickTextBox.Text = settings.nickname; usernameTextBox.Text = settings.server.username; passwdTextBox.Text = settings.server.password; ttclient.OnCmdProcessing += new TeamTalk.CommandProcessing(ttclient_OnCmdProcessing); ttclient.OnCmdError += new TeamTalk.CommandError(ttclient_OnCmdError); }
public FilesView(TeamTalk tt, ListView list) { this.ttclient = tt; this.listview = list; listview.Columns.Add("File ID"); listview.Columns.Add("Filename"); listview.Columns.Add("Size"); listview.Columns.Add("Owner"); ttclient.OnCmdFileNew += new TeamTalk.FileUpdate(ttclient_OnCmdFileNew); ttclient.OnCmdFileRemove += new TeamTalk.FileUpdate(ttclient_OnCmdFileRemove); ttclient.OnCmdUserJoinedChannel += new TeamTalk.UserUpdate(ttclient_OnCmdUserJoinedChannel); }
public ChannelsView(TeamTalk tt, TreeView tree) { ttclient = tt; treeview = tree; ttclient.OnCmdChannelNew += new TeamTalk.ChannelUpdate(ttclient_OnCmdChannelNew); ttclient.OnCmdChannelUpdate += new TeamTalk.ChannelUpdate(ttclient_OnCmdChannelUpdate); ttclient.OnCmdChannelRemove += new TeamTalk.ChannelUpdate(ttclient_OnCmdChannelRemove); ttclient.OnCmdUserJoinedChannel += new TeamTalk.UserUpdate(ttclient_OnCmdUserJoinedChannel); ttclient.OnCmdUserUpdate += new TeamTalk.UserUpdate(ttclient_OnCmdUserUpdate); ttclient.OnCmdUserLeftChannel += new TeamTalk.UserUpdate(ttclient_OnCmdUserLeftChannel); ttclient.OnUserStateChange += new TeamTalk.UserUpdate(ttclient_OnUserStateChange); ttclient.OnVoiceActivation += new TeamTalk.VoiceActivation(ttclient_OnVoiceActivation); }
public UsersView(TeamTalk tt, ListView list) { ttclient = tt; listview = list; listview.Columns.Add("ID"); listview.Columns.Add("Nickname"); listview.Columns.Add("Username"); listview.Columns.Add("Channel"); listview.Columns.Add("IP-Address"); listview.Columns.Add("StatusMsg"); listview.Columns.Add("User Type"); listview.Columns.Add("UserData"); ttclient.OnCmdUserLoggedIn += new TeamTalk.UserUpdate(ttclient_OnCmdUserLoggedIn); ttclient.OnCmdUserLoggedOut += new TeamTalk.UserUpdate(ttclient_OnCmdUserLoggedOut); ttclient.OnCmdUserUpdate += new TeamTalk.UserUpdate(ttclient_OnCmdUserUpdate); }
public PreferencesDlg(TeamTalk tt, Settings settings) { ttclient = tt; this.settings = settings; InitializeComponent(); this.CenterToScreen(); dsoundRadioButton.Checked = settings.soundsystem == SoundSystem.SOUNDSYSTEM_DSOUND; winmmRadioButton.Checked = settings.soundsystem == SoundSystem.SOUNDSYSTEM_WINMM; UpdateSoundSystem(null, null); vidcodecComboBox.SelectedIndex = 0; this.vidbitrateNumericUpDown.Value = settings.codec.webm_vp8.nRcTargetBitrate; UpdateVideoCaptureDevices(); fwCheckBox.Checked = WindowsFirewall.AppExceptionExists(Application.ExecutablePath); }
public VideoDlg(TeamTalk tt, int userid) { ttclient = tt; this.userid = userid; InitializeComponent(); this.CenterToScreen(); User user = new User(); if (userid > 0 && ttclient.GetUser(userid, ref user)) { this.Text = "Video - " + user.szNickname; } else { this.Text = "Local Video"; } ttclient.OnUserVideoCapture += new TeamTalk.UserVideoFrame(ttclient_OnUserVideoFrame); }
private void UpdateVideoCaptureDevices() { if (!TeamTalk.GetVideoCaptureDevices(out videodevs) || videodevs.Length == 0) { return; } foreach (VideoCaptureDevice dev in videodevs) { int index = viddevComboBox.Items.Add(dev.szDeviceName); if (dev.szDeviceID == settings.videoid) { viddevComboBox.SelectedIndex = index; } } if (viddevComboBox.SelectedIndex < 0) { viddevComboBox.SelectedIndex = 0; } }
private void openButton_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.RestoreDirectory = true; openFileDialog1.Filter = "All files (*.*)|*.*"; if (openFileDialog1.ShowDialog() != DialogResult.OK) { return; } textBox1.Text = openFileDialog1.FileName; if (TeamTalk.GetMediaFileInfo(openFileDialog1.FileName, ref info)) { if (info.audioFmt.nAudioFmt != AudioFileFormat.AFF_NONE) { audioLabel.Text = String.Format("{0} Hz, {1}", info.audioFmt.nSampleRate, (info.audioFmt.nChannels == 1 ? "Mono" : "Stereo")); } else { audioLabel.Text = "Unknown"; } if (info.videoFmt.picFourCC != FourCC.FOURCC_NONE) { videoLabel.Text = String.Format("{0}x{1} FPS: {2}", info.videoFmt.nWidth, info.videoFmt.nHeight, info.videoFmt.nFPS_Numerator); } else { videoLabel.Text = "Unknown"; } } else { info = new MediaFileInfo(); } }
public UserAccountsDlg(TeamTalk tt) { ttclient = tt; create_cmdid = 0; del_cmdid = 0; InitializeComponent(); this.CenterToScreen(); listView1.Columns.Add("Username"); listView1.Columns.Add("Password"); listView1.Columns.Add("User Type"); listView1.Columns.Add("UserData"); listView1.Columns.Add("Note"); Channel[] channels; if (ttclient.GetServerChannels(out channels)) { foreach (Channel chan in channels) { string channel = ""; //auto-op only works for static channels if (chan.uChannelType.HasFlag(ChannelType.CHANNEL_PERMANENT) && ttclient.GetChannelPath(chan.nChannelID, ref channel)) { availchanListBox.Items.Add(channel); } } } ttclient.OnCmdProcessing += new TeamTalk.CommandProcessing(ttclient_OnCmdProcessing); ttclient.OnCmdError += new TeamTalk.CommandError(ttclient_OnCmdError); ttclient.OnCmdSuccess += new TeamTalk.CommandSuccess(ttclient_OnCmdSuccess); ttclient.OnCmdUserAccount += new TeamTalk.ListUserAccount(ttclient_OnCmdUserAccount); //hopefully you have less than 100000 accounts list_cmdid = ttclient.DoListUserAccounts(0, 100000); }
public ServerPropertiesDlg(TeamTalk tt) { ttclient = tt; InitializeComponent(); ttclient.GetServerProperties(ref prop); srvnameTextBox.Text = prop.szServerName; maxusersNumericUpDown.Value = prop.nMaxUsers; motdTextBox.Text = prop.szMOTD; motdrawTextBox.Text = prop.szMOTDRaw; tcpportNumericUpDown.Value = prop.nTcpPort; udpportNumericUpDown.Value = prop.nUdpPort; usertimeoutNumericUpDown.Value = prop.nUserTimeout; autosaveCheckBox.Checked = prop.bAutoSave; voiceNumericUpDown1.Value = prop.nMaxVoiceTxPerSecond / 1024; vidcapNumericUpDown5.Value = prop.nMaxVideoCaptureTxPerSecond / 1024; mediafileNumericUpDown2.Value = prop.nMaxMediaFileTxPerSecond / 1024; desktopNumericUpDown3.Value = prop.nMaxDesktopTxPerSecond / 1024; totalNumericUpDown4.Value = prop.nMaxTotalTxPerSecond / 1024; versionTextBox.Text = prop.szServerVersion; }
private void sndTestCheckBox_CheckedChanged(object sender, EventArgs e) { ItemData input = (ItemData)sndinputComboBox.SelectedItem; ItemData output = (ItemData)sndoutputComboBox.SelectedItem; if (sndTestCheckBox.Checked) { //Extract input device and get its default samplerate. //WASAPI devices only support one sample rate so it's important to use the correct one. SoundDevice[] devs; TeamTalk.GetSoundDevices(out devs); int in_samplerate = 0; foreach (SoundDevice dev in devs) { if (dev.nDeviceID == input.id) { in_samplerate = dev.nDefaultSampleRate; } } SpeexDSP spxdsp = new SpeexDSP(true); spxdsp.bEnableAGC = true; spxdsp.bEnableDenoise = true; spxdsp.bEnableEchoCancellation = echocancelCheckBox.Checked; soundloop = TeamTalk.StartSoundLoopbackTest(input.id, output.id, in_samplerate, 1, duplexCheckBox.Checked, spxdsp); if (soundloop == IntPtr.Zero) { MessageBox.Show("Failed to test selected device"); sndTestCheckBox.Checked = false; } } else { TeamTalk.CloseSoundLoopbackTest(soundloop); } }
private void UpdateSelectedSoundDevices(object sender, EventArgs e) { if (sndinputComboBox.SelectedItem == null || sndoutputComboBox.SelectedItem == null) { return; } int inputid = ((ItemData)sndinputComboBox.SelectedItem).id; int outputid = ((ItemData)sndoutputComboBox.SelectedItem).id; SoundDevice[] devs; TeamTalk.GetSoundDevices(out devs); int in_samplerate = 0, out_samplerate = 0; foreach (SoundDevice dev in devs) { if (dev.nDeviceID == inputid) { in_samplerate = dev.nDefaultSampleRate; } if (dev.nDeviceID == outputid) { out_samplerate = dev.nDefaultSampleRate; } } //for duplex mode both input and output sound device must support the same sample rate duplexCheckBox.Enabled = in_samplerate == out_samplerate; if (in_samplerate != out_samplerate) { duplexCheckBox.Checked = false; echocancelCheckBox.Checked = false; } echocancelCheckBox.Enabled = duplexCheckBox.Checked; }
void UpdateSoundSystem(object sender, EventArgs e) { sndinputComboBox.Items.Clear(); sndoutputComboBox.Items.Clear(); SoundDevice[] devs; TeamTalk.GetSoundDevices(out devs); SoundSystem soundsystem = SoundSystem.SOUNDSYSTEM_WASAPI; if (dsoundRadioButton.Checked) { soundsystem = SoundSystem.SOUNDSYSTEM_DSOUND; Debug.WriteLine("DirectSound devices"); } else if (winmmRadioButton.Checked) { soundsystem = SoundSystem.SOUNDSYSTEM_WINMM; Debug.WriteLine("WinMM devices"); } else { Debug.WriteLine("WASAPI devices"); } Debug.WriteLine("INPUT DEVICES"); foreach (SoundDevice dev in devs) { if (dev.nSoundSystem != soundsystem) { continue; } Debug.WriteLine("Name " + dev.szDeviceName); Debug.WriteLine("\tID #" + dev.nDeviceID); Debug.WriteLine("\tUnique ID #" + dev.szDeviceID); Debug.WriteLine("\tWaveDeviceID #" + dev.nWaveDeviceID); string tmp = ""; if (WindowsMixer.GetWaveInName(dev.nWaveDeviceID, ref tmp)) { Debug.WriteLine("\tMixer name: " + tmp); } for (int i = 0; i < WindowsMixer.GetWaveInControlCount(dev.nWaveDeviceID); i++) { if (WindowsMixer.GetWaveInControlName(dev.nWaveDeviceID, i, ref tmp)) { Debug.WriteLine("\t\tControl name: " + tmp); Debug.WriteLine("\t\tSelected: " + WindowsMixer.GetWaveInControlSelected(dev.nWaveDeviceID, i)); } } if (dev.nMaxInputChannels > 0) { int index = sndinputComboBox.Items.Add(new ItemData(dev.szDeviceName, dev.nDeviceID)); if (dev.nDeviceID == settings.sndinputid) { sndinputComboBox.SelectedIndex = index; } } if (dev.nMaxOutputChannels > 0) { int index = sndoutputComboBox.Items.Add(new ItemData(dev.szDeviceName, dev.nDeviceID)); if (dev.nDeviceID == settings.sndoutputid) { sndoutputComboBox.SelectedIndex = index; } } } if (sndinputComboBox.SelectedIndex < 0 && sndinputComboBox.Items.Count > 0) { sndinputComboBox.SelectedIndex = 0; } if (sndoutputComboBox.SelectedIndex < 0 && sndoutputComboBox.Items.Count > 0) { sndoutputComboBox.SelectedIndex = 0; } }
private void PreferencesDlg_FormClosing(object sender, FormClosingEventArgs e) { TeamTalk.CloseSoundLoopbackTest(soundloop); }
public MediaFileDlg(TeamTalk ttclient) { this.ttclient = ttclient; InitializeComponent(); }
public ChannelDlg(TeamTalk tt, ChannelDlgType dlgtype, int channelid, int parentid) { ttclient = tt; this.dlgtype = dlgtype; InitializeComponent(); if (channelid > 0 && ttclient.GetChannel(channelid, ref chan)) { string path = ""; ttclient.GetChannelPath(channelid, ref path); chanpathTextBox.Text = path; channameTextBox.Text = chan.szName; topicTextBox.Text = chan.szTopic; passwdTextBox.Text = chan.szPassword; maxusersNumericUpDown.Value = chan.nMaxUsers; diskquotaNumericUpDown.Value = chan.nDiskQuota / 1024; permchannelCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_PERMANENT); singletxCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_SOLO_TRANSMIT); classroomCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_CLASSROOM); oprecvonlyCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_OPERATOR_RECVONLY); novoiceactCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_NO_VOICEACTIVATION); norecordCheckBox.Checked = chan.uChannelType.HasFlag(ChannelType.CHANNEL_NO_RECORDING); switch (chan.audiocodec.nCodec) { case Codec.SPEEX_CODEC: tabControl1.SelectedIndex = (int)CodecTabs.SPEEX_CBR_TAB; speexnbRadioButton.Checked = chan.audiocodec.speex.nBandmode == 0; speexwbRadioButton.Checked = chan.audiocodec.speex.nBandmode == 1; speexuwbRadioButton.Checked = chan.audiocodec.speex.nBandmode == 2; speexqualityTrackBar.Value = chan.audiocodec.speex.nQuality; speexTxInterval.Value = chan.audiocodec.speex.nTxIntervalMSec; speexstereoCheckBox.Checked = chan.audiocodec.speex.bStereoPlayback; break; case Codec.SPEEX_VBR_CODEC: tabControl1.SelectedIndex = (int)CodecTabs.SPEEX_VBR_TAB; speexvbrnbRadioButton.Checked = chan.audiocodec.speex_vbr.nBandmode == 0; speexvbrwbRadioButton.Checked = chan.audiocodec.speex_vbr.nBandmode == 1; speexvbruwbRadioButton.Checked = chan.audiocodec.speex_vbr.nBandmode == 2; speexvbrqualityTrackBar.Value = chan.audiocodec.speex_vbr.nQuality; speexvbrbitrateNumericUpDown.Value = chan.audiocodec.speex_vbr.nBitRate; speexvbrmaxbrNumericUpDown.Value = chan.audiocodec.speex_vbr.nMaxBitRate; speexvbrTxInterval.Value = chan.audiocodec.speex_vbr.nTxIntervalMSec; speexvbrdtxCheckBox.Checked = chan.audiocodec.speex_vbr.bDTX; speexvbrstereoCheckBox.Checked = chan.audiocodec.speex_vbr.bStereoPlayback; break; case Codec.OPUS_CODEC: tabControl1.SelectedIndex = (int)CodecTabs.OPUS_TAB; int i = opussamplerateComboBox.FindString(chan.audiocodec.opus.nSampleRate.ToString()); if (i < 0) { i = 0; } opussamplerateComboBox.SelectedIndex = i; opuschannelsComboBox.SelectedIndex = chan.audiocodec.opus.nChannels - 1; switch (chan.audiocodec.opus.nApplication) { case OpusConstants.OPUS_APPLICATION_AUDIO: opusaudioRadioButton.Checked = true; break; case OpusConstants.OPUS_APPLICATION_VOIP: opusvoipRadioButton.Checked = true; break; default: opusvoipRadioButton.Checked = true; break; } opuscomplexityNumericUpDown.Value = chan.audiocodec.opus.nComplexity; opusfecCheckBox.Checked = chan.audiocodec.opus.bFEC; opusdtxCheckBox.Checked = chan.audiocodec.opus.bDTX; opusvbrCheckBox.Checked = chan.audiocodec.opus.bVBR; opusvbrconstraintCheckBox.Checked = chan.audiocodec.opus.bVBRConstraint; opusbitrateNumericUpDown.Value = chan.audiocodec.opus.nBitRate / 1000; opusTxIntervalNumericUpDown.Value = chan.audiocodec.opus.nTxIntervalMSec; break; } agcCheckBox.Checked = chan.audiocfg.bEnableAGC; gainlevelTrackBar.Value = chan.audiocfg.nGainLevel; } else { string path = ""; ttclient.GetChannelPath(parentid, ref path); chanpathTextBox.Text = path; chan.nParentID = parentid; } UserType usertype = ttclient.GetMyUserType(); switch (dlgtype) { case ChannelDlgType.JOIN_CHANNEL: //when joining a channel 'disk quota' and 'max users' are set to server's default values diskquotaNumericUpDown.ReadOnly = true; maxusersNumericUpDown.ReadOnly = true; goto case ChannelDlgType.CREATE_CHANNEL; case ChannelDlgType.CREATE_CHANNEL: opussamplerateComboBox.SelectedIndex = 0; opuschannelsComboBox.SelectedIndex = 0; opuschannelsComboBox.SelectedIndex = 0; //only admins can change static channel property permchannelCheckBox.Enabled = ttclient.UserRights.HasFlag(UserRight.USERRIGHT_MODIFY_CHANNELS); diskquotaNumericUpDown.ReadOnly = !ttclient.UserRights.HasFlag(UserRight.USERRIGHT_MODIFY_CHANNELS); agcCheckBox.Checked = true; gainlevelTrackBar.Value = 8000; break; case ChannelDlgType.UPDATE_CHANNEL: break; case ChannelDlgType.VIEW_CHANNEL: channameTextBox.ReadOnly = true; topicTextBox.ReadOnly = true; passwdTextBox.ReadOnly = true; oppasswdTextBox.ReadOnly = true; maxusersNumericUpDown.ReadOnly = true; diskquotaNumericUpDown.ReadOnly = true; permchannelCheckBox.Enabled = false; singletxCheckBox.Enabled = false; classroomCheckBox.Enabled = false; oprecvonlyCheckBox.Enabled = false; novoiceactCheckBox.Enabled = false; norecordCheckBox.Enabled = false; agcCheckBox.Enabled = false; gainlevelTrackBar.Enabled = false; tabControl1.Enabled = false; break; } }