public MainForm() { //UnprotectConfig(); settings = Properties.Settings.Default; InitializeComponent(); currentChat = EndPoint.TwitchTV; lastMessageSent = new Message("", EndPoint.Console); adminCommands = new List<AdminCommand>(); chatAliases = new List<ChatAlias>(); lastMessagePerEndpoint = new List<Message>(); adminCommands.Add(new AdminCommand(@"^/r\s*([^\s]*)\s*(.*)", ReplyCommand)); chatAliases.Add(new ChatAlias(settings.twitchChatAlias, EndPoint.TwitchTV)); chatAliases.Add(new ChatAlias(settings.sc2tvChatAlias, EndPoint.Sc2Tv)); chatAliases.Add(new ChatAlias(settings.steamChatAlias, EndPoint.Steam)); chatAliases.Add(new ChatAlias(settings.skypeChatAlias, EndPoint.Skype)); chatAliases.Add(new ChatAlias(settings.battlelogChatAlias, EndPoint.Battlelog)); chatAliases.Add(new ChatAlias(settings.gohaChatAlias, EndPoint.Gohatv)); chatAliases.Add(new ChatAlias(settings.empireAlias, EndPoint.Empiretv)); chatAliases.Add(new ChatAlias(settings.goodgameChatAlias, EndPoint.Goodgame)); chatAliases.Add(new ChatAlias("@all", EndPoint.All)); sc2tv = new Sc2Chat(settings.sc2LoadHistory); sc2tv.Logon += OnSc2TvLogin; sc2tv.ChannelList += OnSc2TvChannelList; sc2tv.MessageReceived += OnSc2TvMessageReceived; sc2tv.channelList = new Channels(); sc2ChannelId = 0; twitchIrc = new IrcClient(); twitchIrc.Connected += OnTwitchConnect; twitchIrc.Registered += OnTwitchRegister; twitchIrc.Disconnected += OnTwitchDisconnect; gohaIrc = new IrcClient(); gohaIrc.Connected += OnGohaConnect; gohaIrc.Registered += OnGohaRegister; gohaIrc.Disconnected += OnGohaDisconnect; log = new Log(textMessages); checkMark = new StatusImage(Properties.Resources.checkMarkGreen, Properties.Resources.checkMarkRed); streamStatus = new StatusImage(Properties.Resources.streamOnline, Properties.Resources.streamOffline); steamBot = new SteamAPISession(); steamBot.Logon += OnSteamLogin; steamBot.NewMessage += OnNewSteamMessage; steamBot.FriendStateChange += OnSteamFriendStatusChange; steamBot.Typing += OnSteamTyping; statusServer = new StatusServer(); battlelog = new Battlelog(); steamBW = new BGWorker(ConnectSteamBot, null); sc2BW = new BGWorker(ConnectSc2tv, null); twitchBW = new BGWorker(ConnectTwitchIRC, null); gohaBW = new BGWorker(ConnectGohaIRC, null); twitchTV = new BGWorker(ConnectTwitchChannel, null); skypeBW = new BGWorker(ConnectSkype, null); goodgameBW = new BGWorker(ConnectGoodgame, null); battlelogBW = new BGWorker(ConnectBattlelog, null); if (settings.enableXSplitStats) { xsplit = new XSplit(); xsplit.OnFrameDrops += OnXSplitFrameDrops; xsplit.OnStatusRefresh += OnXSplitStatusRefresh; } if (settings.enableStatusServer) { statusServer.Start(); } gohaTVstream = new GohaTV(); gohaStreamBW = new BGWorker(ConnectGohaStream, null); empireTV = new EmpireTV(); empireBW = new BGWorker(ConnectEmpireTV, null); }
public MainForm() { //UnprotectConfig(); settings = Properties.Settings.Default; try { if (String.IsNullOrEmpty(settings.currentProfile)) { settings.currentProfile = "Default"; } if (settings.chatProfiles == null) { settings.chatProfiles = new ChatProfiles(); settings.chatProfiles.WriteProfile(settings.currentProfile, settings); } else if (!settings.chatProfiles.Profiles.Any(p => p.Name.Equals(settings.currentProfile))) { settings.chatProfiles.WriteProfile(settings.currentProfile, settings); } } catch { } InitializeComponent(); endpointList = new ChannelList(); endpointListBS = new BindingSource(); if( settings.globalDebug ) debugForm = new DebugForm(); //RefreshChatProperties(); log = new Log(textMessages); chatUsers = new List<ChatUser>(); Enum.TryParse<EndPoint>(settings.globalDefaultChat, out currentChat); lastMessageSent = new UbiMessage("", EndPoint.Console); adminCommands = new List<AdminCommand>(); chatAliases = new List<ChatAlias>(); lastMessagePerEndpoint = new List<UbiMessage>(); adminCommands.Add(new AdminCommand(@"^/r\s*([^\s]*)\s*(.*)", ReplyCommand)); adminCommands.Add(new AdminCommand(@"^/stream$", StartStopStreamsCommand)); adminCommands.Add(new AdminCommand(@"^/gohaconfirm\s*(.*)", GohaConfirmCommand)); adminCommands.Add(new AdminCommand(@"^/gohasetpass", GohaUpdatePassword)); adminCommands.Add(new AdminCommand(@"^/width\s*(.*)", SetFormWidth)); adminCommands.Add(new AdminCommand(@"^/height\s*(.*)", SetFormHeight)); adminCommands.Add(new AdminCommand(@"^/scene\s*(.*)", SetOBSScene)); chatAliases.Add(new ChatAlias(settings.twitchChatAlias, EndPoint.TwitchTV, ChatIcon.TwitchTv, settings.TwitchUser.ToLower())); chatAliases.Add(new ChatAlias(settings.sc2tvChatAlias, EndPoint.Sc2Tv, ChatIcon.Sc2Tv, settings.Sc2tvUser)); chatAliases.Add(new ChatAlias(settings.steamChatAlias, EndPoint.Steam, ChatIcon.Steam)); chatAliases.Add(new ChatAlias(settings.skypeChatAlias, EndPoint.Skype, ChatIcon.Skype)); // chatAliases.Add(new ChatAlias(settings.battlelogChatAlias, EndPoint.Battlelog, ChatIcon.Battlelog)); chatAliases.Add(new ChatAlias(settings.gohaChatAlias, EndPoint.Gohatv, ChatIcon.Goha, settings.GohaUser)); chatAliases.Add(new ChatAlias(settings.empireAlias, EndPoint.Empiretv, ChatIcon.Empire, settings.empireUser.ToLower())); chatAliases.Add(new ChatAlias(settings.goodgameChatAlias, EndPoint.Goodgame, ChatIcon.Goodgame, settings.goodgameUser.ToLower())); chatAliases.Add(new ChatAlias(settings.cyberAlias, EndPoint.Cybergame, ChatIcon.Cybergame, settings.cyberUser.ToLower())); chatAliases.Add(new ChatAlias(settings.hashdAlias, EndPoint.Hashd, ChatIcon.Hashd, settings.hashdUser.ToLower())); chatAliases.Add(new ChatAlias(settings.youtubeAlias, EndPoint.Youtube, ChatIcon.Youtube)); chatAliases.Add(new ChatAlias(settings.gmtvAlias, EndPoint.GamersTV, ChatIcon.GamersTv)); chatAliases.Add(new ChatAlias(settings.jetsetAlias, EndPoint.JetSet, ChatIcon.JetSet)); chatAliases.Add(new ChatAlias(settings.hitboxAlias, EndPoint.HitBox, ChatIcon.HitBox)); chatAliases.Add(new ChatAlias("@all", EndPoint.All, ChatIcon.Default)); var switchTo = chatAliases.FirstOrDefault( c => c.Endpoint == currentChat ); if( switchTo != null ) SwitchToChat(switchTo.Alias,false); uint.TryParse(settings.Sc2tvId, out sc2ChannelId); Debug.Print(String.Format("Sc2tv Channel ID: {0}",sc2ChannelId)); sc2tv = new Sc2Chat(settings.sc2LastMsgId + 1); sc2tv.Logon += OnSc2TvLogin; sc2tv.ChannelList += OnSc2TvChannelList; sc2tv.MessageReceived += OnSc2TvMessageReceived; sc2tv.channelList = new Channels(); gohaIrc = new IrcClient(); gohaIrc.Connected += OnGohaConnect; gohaIrc.Registered += OnGohaRegister; gohaIrc.Disconnected += OnGohaDisconnect; checkMark = new StatusImage(Properties.Resources.checkMarkGreen, Properties.Resources.checkMarkRed); streamStatus = new StatusImage(Properties.Resources.streamOnline, Properties.Resources.streamOffline); statusServer = new StatusServer(); //battlelog = new Battlelog(); steamBW = new BGWorker(ConnectSteamBot, null); sc2BW = new BGWorker(ConnectSc2tv, null); twitchBW = new BGWorker(ConnectTwitchIRC, null); gohaBW = new BGWorker(ConnectGohaIRC, null); twitchTV = new BGWorker(ConnectTwitchChannel, null); skypeBW = new BGWorker(ConnectSkype, null); cyberBW = new BGWorker(ConnectCybergame, null); hashdBW = new BGWorker(ConnectHashd, null); youtubeBW = new BGWorker(ConnectYoutube, null); gamerstvBW = new BGWorker(ConnectGamersTV, null ); jetsetBW = new BGWorker(ConnectJetSet, null); hitboxBW = new BGWorker(ConnectHitBox, null); goodgameBW = new BGWorker(ConnectGoodgame, null); // battlelogBW = new BGWorker(ConnectBattlelog, null); if (settings.enableXSplitStats) { xsplit = new XSplit(); xsplit.OnFrameDrops += OnXSplitFrameDrops; xsplit.OnStatusRefresh += OnXSplitStatusRefresh; } if (settings.enableStatusServer) { statusServer.Start(); } gohaTVstream = new GohaTV(); gohaStreamBW = new BGWorker(ConnectGohaStream, null); empireTV = new EmpireTV(); empireBW = new BGWorker(ConnectEmpireTV, null); obsremoteBW = new BGWorker(ConnectOBSRemote, null); settings.PropertyChanged += new PropertyChangedEventHandler(settings_PropertyChanged); settings.SettingsSaving += new SettingsSavingEventHandler(settings_SettingsSaving); fontDialog = new FontDialog(); forceCloseTimer = new System.Threading.Timer(new TimerCallback(ForceClose), null, Timeout.Infinite, Timeout.Infinite); obsChatSourceSwitch = new System.Threading.Timer(new TimerCallback(OBSChatSwitch), null, Timeout.Infinite, Timeout.Infinite); if (settings.webEnable) { int port; int.TryParse(settings.webPort, out port); try { webChat = new WebChat(port); } catch (Exception e) { SendMessage(new UbiMessage("Web server error: " + e.Message, EndPoint.Error)); } } if (settings.lastFmEnable && !String.IsNullOrEmpty(settings.lastFmLogin) && !String.IsNullOrEmpty(settings.lastFmPassword)) { try { lastFm = new ULastFm(); lastFm.OnLogin += new EventHandler<EventArgs>(lastFm_OnLogin); lastFm.OnTrackChange += new EventHandler<LastFmArgs>(lastFm_OnTrackChange); ThreadPool.QueueUserWorkItem(t => lastFm.Authenticate(settings.lastFmLogin, settings.lastFmPassword)); } catch (Exception ex) { Debug.Print(ex.Message + " " + ex.StackTrace); } } //@Debug.Print("Config is here:" + ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath); #region Set tooltips ToolTip fullScreenDblClk = new ToolTip(); fullScreenDblClk.AutoPopDelay = 2000; fullScreenDblClk.InitialDelay = 100; fullScreenDblClk.ReshowDelay = 100; fullScreenDblClk.ShowAlways = false; // Set up the ToolTip text for the Button and Checkbox. fullScreenDblClk.SetToolTip(textMessages, "DblClick - switch mode, Hold RMB - move window"); viewersTooltip = new ToolTip(); viewersTooltip.AutoPopDelay = 2000; viewersTooltip.InitialDelay = 0; viewersTooltip.ReshowDelay = 0; viewersTooltip.ShowAlways = false; viewersTooltip.SetToolTip(labelViewers, String.Format("Twitch.tv: {0}, Cybergame.tv: {0}, Hashd.tv: {0}", 0)); var tooltip = new ToolTip(); tooltip.AutoPopDelay = 2000; tooltip.InitialDelay = 0; tooltip.ReshowDelay = 0; tooltip.ShowAlways = false; tooltip.SetToolTip(buttonStreamStartStop, "Click to start/stop streaming in OBS"); #endregion }
private void button1_Click(object sender, EventArgs e) { xsplit = new XSplit(); MessageBox.Show(String.Format("{0}", xsplit.Encoded)); }
private void button1_Click(object sender, EventArgs e) { xsplit = new XSplit(); MessageBox.Show( String.Format("{0}",xsplit.Encoded ) ); }