예제 #1
0
		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));
		}
예제 #2
0
		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));
		}