private void apiRunLiveStreamer() { PluginAPI current = GetCurrentPlugin(); if (!Uri.IsWellFormedUriString(tbOutputUrl.Text, UriKind.Absolute)) return; if (tbLivestreamerPath.Text == string.Empty) { MessageBox.Show("Livestreamer path is not set"); return; } if (current == null) return; var metadata = current.GetVideoMedatada(); RunLivestreamer(metadata); current.StreamStarted(); int io = ad.FindIndex(p => p.url == metadata.CanonicalUrl); if (io == -1) ad.Add(new ConfigurationDatabase.AutocompleteData(metadata.CanonicalUrl)); else { var tmp = ad[io]; ad[io] = new ConfigurationDatabase.AutocompleteData(tmp.url, tmp.count + 1); } tbInputUrl.AutoCompleteCustomSource.Clear(); tbInputUrl.AutoCompleteCustomSource.AddRange(ad.Rewrite(r => r.url)); }
public void StreamStarted() { int io = ad.FindIndex(p => p.url == StreamName); if (io == -1) ad.Add(new ConfigurationDatabase.AutocompleteData(StreamName)); else { var tmp = ad[io]; ad[io] = new ConfigurationDatabase.AutocompleteData(tmp.url, tmp.count + 1); } layoutTextBoxChannel.AutoCompleteCustomSource.Clear(); layoutTextBoxChannel.AutoCompleteCustomSource.AddRange(ad.Rewrite(r => r.url)); }