public UpdateUrlMessage(long id, string web, string local, TrackType type) { Id = id; Web = web; Local = local; Type = type; }
public Track(string trackName, string trackExtension, long trackLength, TrackType type) { this.trackName = trackName; this.trackExtension = trackExtension; this.trackLength = trackLength; this.type = type; }
public Distance(double distance, TrackType tt, FractionType fractionToUseAsFirst, FractionType fractionToUseAsSecond) { _distance = distance; _tt = tt; _fractionToUseAsFirst = fractionToUseAsFirst; _fractionToUseAsSecond = fractionToUseAsSecond; }
public Track(string title, TrackType trackType, string trackPath, TimeSpan duration) { this.title = title; this.trackType = trackType; this.trackPath = trackPath; if (duration != TimeSpan.Zero) this.duration = duration; else { this.duration = TimeSpan.Zero; if (File.Exists(trackPath)) { Thread thread = new Thread(new ThreadStart(GetDuration)); thread.Start(); } } }
public static bool FileToDateTime(string fileName, out DateTime date, out TrackType trackType) { string s = Path.GetFileNameWithoutExtension(fileName); date = DateTime.MinValue; trackType = TrackType.All; if (s.StartsWith("all_")) { s = s.Substring(4); } else if (s.StartsWith("event_")) { s = s.Substring(6); trackType = TrackType.Event; } else { return false; } date = ParseDate(s); return true; }
public void JumpTrack(TrackType track) { if (track == cTrackType) { return; } switch (track) { case TrackType.LEFT: cTrackType = TrackType.LEFT; break; case TrackType.MIDDLE: cTrackType = TrackType.MIDDLE; break; case TrackType.RIGHT: cTrackType = TrackType.RIGHT; break; default: Debug.LogError("Function JumpTrack() in Train.cs: Not a valid Track type."); break; } }
internal abstract TrackBase InternalGetTrackInfo(TrackType trackType, int trackIndex, ref bool isActiveTrack);
internal abstract int InternalGetTrackCount(TrackType trackType);
/// <summary> /// 获取媒体的基本编码器的说明 /// </summary> /// <param name="type">由 <see cref="MediaTrack.Type" /> 得来</param> /// <param name="codec">由 <see cref="MediaTrack.Codec" /> 得来</param> /// <returns>返回媒体的基本编码器的说明</returns> public static String GetCodecDescription(TrackType type, int codec) { return(InteropHelper.PtrToString(_getCodecDescriptionFunction.Delegate(type, codec))); }
private void TrackTypeMenuItemOnClick(ListViewItem listViewItem, TrackType trackType) { var track = listViewItem.Tag as Track; if (track != null) track.Type = trackType; foreach (var subItem in listViewItem.SubItems.OfType<ListViewItem.ListViewSubItem>().Where(subItem => subItem.Tag is TrackType)) { subItem.Tag = trackType; subItem.Text = trackType.ToString(); } NotifyPlaylistReconfigured(); }
public MediaTrack() { TrackType = TrackType.Unknown; }
public void SetTrackMessageAndEnable(TrackType type, ITrackMessage message, ActionSequence seq) { queues.EnqueueSyncTask(type, () => SetTrackMessageAndEnable(type, message), seq); }
/// <summary> /// 获取媒体的基本编码器的说明 /// </summary> /// <param name="type">由 <see cref="MediaTrack.Type"/> 得来</param> /// <param name="codec">由 <see cref="MediaTrack.Codec"/> 得来</param> /// <returns>返回媒体的基本编码器的说明</returns> public static String GetCodecDescription(TrackType type,int codec) { return InteropHelper.PtrToString(GetCodecDescriptionFunction.Delegate(type, codec)); }
public Entry(Severity Severity, string Message, TrackType Type) { this.Severity = Severity; this.Message = Message; this.Type = Type; }
public void AddEntry(Severity Severity, string Message, TrackType Type) { _records.Add(new Entry(Severity, Message, Type)); }
public TrackEventArg(TrackType TrackType) : base() { this.TrackType = TrackType; }
public bool InWptList(TrackType t) => GetHandler(t).InWptList;
private void InvokeStatusChanged(TrackType t) { StatusChanged?.Invoke(this, new TrackEventArg(t)); }
public void DownloadAndEnableTracks(TrackType type, ActionSequence seq) { queues.EnqueueTask(type, async() => await DownloadAndEnableTracks(type), seq); }
public void CreateTrackData() { List <TrackType> tTypes = new List <TrackType>(); tTypes.Add(TrackType.E); mTrackPlaceData.Clear(); bool tIsStartRoad = false; bool tIsEndRoad = false; for (int i = 0; i < mTileCount - 1;) { TrackType addTrack = tTypes[UnityEngine.Random.Range(0, tTypes.Count)]; mTrackPlaceData.Add(addTrack); if (CurrentPFTracks.ContainsKey(addTrack)) { i += CurrentPFTracks[addTrack].TileCount; } else { i++; } if (tIsStartRoad == false && i >= 5) { tIsStartRoad = true; List <TrackType> tTrackDiffcultyList = null; #if DIFFCULTY tTrackDiffcultyList = mTrackData.DiffcultyList[Mathf.Clamp(mStageIndex, 0, mTrackData.DiffcultyList.Count - 1)].TypeList; #elif LOW tTrackDiffcultyList = new List <TrackType>(); for (int start = (int)TrackType.A; start <= (int)TrackType.F; start++) { tTrackDiffcultyList.Add((TrackType)start); } #elif MEDIUM tTrackDiffcultyList = new List <TrackType>(); for (int start = (int)TrackType.A; start <= (int)TrackType.P; start++) { tTrackDiffcultyList.Add((TrackType)start); } #endif tTypes.AddRange(tTrackDiffcultyList); } else if (tIsEndRoad == false && i >= mTileCount - 5) { tIsEndRoad = true; tTypes.Clear(); tTypes.Add(TrackType.EMPTY); } } mTrackPlaceData.Add(TrackType.END); for (int i = 0; i < 3; i++) { mTrackPlaceData.Add(TrackType.EMPTY); } }
public TrackerPower(Dictionary<string, string> args) { this.type = (TrackType)Enum.Parse(typeof(TrackType), args["TrackerType"]); }
/// <summary> /// Updates the information about the currently loaded track /// </summary> public void UpdateInfo() { TrackData t = SettingsManager.CurrentTrack; TrackType type = MediaManager.GetType(t); if (t == null || (type == TrackType.File && !File.Exists(t.Path))) { InfoName.Text = U.T("PlaybackEmpty"); InfoTimeMinus.Content = "N/A"; InfoTimePlus.Content = "N/A"; SongProgress.ValueChanged -= new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); SongProgress.Value = 0; SongProgress.SecondValueWidth = 0; SongProgress.ValueChanged += new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); } else { if (type == TrackType.WebRadio) { InfoName.Text = t.Title; InfoTimeMinus.Content = "N/A"; InfoTimePlus.Content = "N/A"; SongProgress.ValueChanged -= new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); SongProgress.Value = 0; SongProgress.SecondValueWidth = 0; SongProgress.ValueChanged += new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); } else { InfoName.Text = t.Artist + " - " + t.Title; double pos = MediaManager.Position; double len = MediaManager.Length; if (pos < 0) { pos = 0; } if (len < 0) { len = 0; } TimeSpan timePlus = new TimeSpan(0, 0, (int)pos); TimeSpan timeMinus = new TimeSpan(0, 0, (int)(len - pos)); if (timePlus.TotalSeconds < 0) { InfoTimePlus.Content = "N/A"; } else if (timePlus.TotalSeconds >= 0) { InfoTimePlus.Content = U.TimeSpanToString(timePlus); } if (timeMinus.TotalSeconds < 0) { InfoTimeMinus.Content = "N/A"; } else if (timeMinus.TotalSeconds > 0) { InfoTimeMinus.Content = "-" + U.TimeSpanToString(timeMinus); } double seek = SettingsManager.Seek * (SongProgress.Maximum / 10.0); if (timePlus.Seconds < 0 || Double.IsNaN(seek) || Double.IsInfinity(seek)) { seek = 0; } if (seek > 0 || SettingsManager.MediaState != MediaState.Playing) { SongProgress.ValueChanged -= new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); SongProgress.Value = seek; SongProgress.ValueChanged += new RoutedPropertyChangedEventHandler <double>(SongProgress_ValueChanged); } } } }
/// <summary> /// Makes the common starting base of an add-item message. /// </summary> /// <param name="channelId">The ID of the channel to which we are adding.</param> /// <param name="trackType">The type of track we are adding.</param> /// <returns>A message, to which we can add type-specific arguments.</returns> private static MessageBuilder MakeAddItemBase(byte channelId, TrackType trackType) { return(new MessageBuilder(MakeAddItemCommand(channelId)).Add((uint)trackType)); }
internal static extern IntPtr LibvlcMediaGetCodecDescription(TrackType type, uint codec);
public Track(TrackType t,string datamsg) { id = string.Empty; tag = string.Empty; data = datamsg; date = Util.ToTLDate(); time = Util.ToTLTime(); type = t; }
/// <summary>Get a media's codec description</summary> /// <param name="type">The type of the track</param> /// <param name="codec">the codec or fourcc</param> /// <returns>the codec description</returns> public string CodecDescription(TrackType type, uint codec) => Native.LibvlcMediaGetCodecDescription(type, codec).FromUtf8() !;
void SwitchTrackTypeVisual(TrackType To) { try { MediaElement me = null; var hasme = VisualTreeHelper.FindElementsInHostCoordinates(new Point(gridMediaDisplay.ActualWidth / 2, gridMediaDisplay.ActualHeight / 2), gridMediaDisplay). Where(uie => uie is MediaElement).FirstOrDefault(); if (hasme != null) { me = hasme as MediaElement; if (me.Parent is Panel && To == TrackType.AUDIO && (me.Parent as Panel).Children.Count() > (me.Parent as Panel).Children.IndexOf(me) + 1 && (me.Parent as Panel).Children[(me.Parent as Panel).Children.IndexOf(me) + 1] == gridAudioOnly) return; } else { if (To == TrackType.AUDIO) { gridAudioOnly.Visibility = Visibility.Visible; } else { gridAudioOnly.Visibility = Visibility.Collapsed; } } //if we switched to an audio only stream - show poster if (To == TrackType.AUDIO) { if (me != null) { if (me.Parent is Panel) { Grid gridAudioOnly = new Grid() { Name = "appAudioOnly", HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch, VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Stretch, Background = new SolidColorBrush(Windows.UI.Colors.DarkGray) }; gridAudioOnly.Children.Add(new Image() { Width = 200, Height = 200, Stretch = Stretch.Fill, HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center, VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center, Source = new BitmapImage(new Uri("ms-appx:///assets/audioonly.png")) }); (me.Parent as Panel).Children.Insert((me.Parent as Panel).Children.IndexOf(me) + 1, gridAudioOnly); } } } else if (To == TrackType.BOTH) //else hide poster if poster was being displayed { if (me != null) { if (me.Parent is Panel) (me.Parent as Panel).Children.RemoveAt((me.Parent as Panel).Children.IndexOf(me) + 1); } } } catch (Exception Ex) { } }
/// <summary> /// track an event /// </summary> /// <param name="type"></param> public void Track(TrackType type) { Track(type, string.Empty); }
public TrackedEffect(Actor tracker,TrackType type) : base(tracker) { this.type = type; this.Duration = 1; }
/// <summary> /// track a numeric event /// </summary> /// <param name="t"></param> /// <param name="val"></param> public void Track(TrackType t, decimal val) { Track(t, val.ToString("F2")); }
internal abstract bool InternalIsChangedTracks(TrackType trackType);
/// <summary>Reads the TOC, processes it, returns the track list and last sector</summary> /// <param name="blockSize">Size of the read sector in bytes</param> /// <param name="dev">Device</param> /// <param name="dskType">Disc type</param> /// <param name="dumpLog">Dump log</param> /// <param name="force">Force dump enabled</param> /// <param name="lastSector">Last sector number</param> /// <param name="leadOutStarts">Lead-out starts</param> /// <param name="mediaTags">Media tags</param> /// <param name="stoppingErrorMessage">Stopping error message handler</param> /// <param name="subType">Track subchannel type</param> /// <param name="toc">Full CD TOC</param> /// <param name="trackFlags">Track flags</param> /// <param name="updateStatus">Update status handler</param> /// <returns>List of tracks</returns> public static Track[] GetCdTracks(ref uint blockSize, Device dev, MediaType dskType, DumpLog dumpLog, bool force, out long lastSector, Dictionary <int, long> leadOutStarts, Dictionary <MediaTagType, byte[]> mediaTags, ErrorMessageHandler stoppingErrorMessage, TrackSubchannelType subType, out FullTOC.CDFullTOC?toc, Dictionary <byte, byte> trackFlags, UpdateStatusHandler updateStatus) { byte[] cmdBuf = null; // Data buffer const uint sectorSize = 2352; // Full sector size bool sense = true; // Sense indicator List <Track> trackList = new List <Track>(); // Tracks in disc byte[] tmpBuf; // Temporary buffer toc = null; lastSector = 0; TrackType leadoutTrackType = TrackType.Audio; // We discarded all discs that falsify a TOC before requesting a real TOC // No TOC, no CD (or an empty one) dumpLog?.WriteLine("Reading full TOC"); updateStatus?.Invoke("Reading full TOC"); sense = dev.ReadRawToc(out cmdBuf, out _, 0, dev.Timeout, out _); if (!sense) { toc = FullTOC.Decode(cmdBuf); if (toc.HasValue) { tmpBuf = new byte[cmdBuf.Length - 2]; Array.Copy(cmdBuf, 2, tmpBuf, 0, cmdBuf.Length - 2); mediaTags?.Add(MediaTagType.CD_FullTOC, tmpBuf); } } updateStatus?.Invoke("Building track map..."); dumpLog?.WriteLine("Building track map..."); if (toc.HasValue) { FullTOC.TrackDataDescriptor[] sortedTracks = toc.Value.TrackDescriptors.OrderBy(track => track.POINT).ToArray(); foreach (FullTOC.TrackDataDescriptor trk in sortedTracks.Where(trk => trk.ADR == 1 || trk.ADR == 4)) { if (trk.POINT >= 0x01 && trk.POINT <= 0x63) { trackList.Add(new Track { TrackSequence = trk.POINT, TrackSession = trk.SessionNumber, TrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack || (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental ? TrackType.Data : TrackType.Audio, TrackStartSector = (ulong)(((trk.PHOUR * 3600 * 75) + (trk.PMIN * 60 * 75) + (trk.PSEC * 75) + trk.PFRAME) - 150), TrackBytesPerSector = (int)sectorSize, TrackRawBytesPerSector = (int)sectorSize, TrackSubchannelType = subType }); trackFlags?.Add(trk.POINT, trk.CONTROL); } else if (trk.POINT == 0xA2) { int phour, pmin, psec, pframe; if (trk.PFRAME == 0) { pframe = 74; if (trk.PSEC == 0) { psec = 59; if (trk.PMIN == 0) { pmin = 59; phour = trk.PHOUR - 1; } else { pmin = trk.PMIN - 1; phour = trk.PHOUR; } } else { psec = trk.PSEC - 1; pmin = trk.PMIN; phour = trk.PHOUR; } } else { pframe = trk.PFRAME - 1; psec = trk.PSEC; pmin = trk.PMIN; phour = trk.PHOUR; } lastSector = ((phour * 3600 * 75) + (pmin * 60 * 75) + (psec * 75) + pframe) - 150; leadOutStarts?.Add(trk.SessionNumber, lastSector + 1); } else if (trk.POINT == 0xA0 && trk.ADR == 1) { switch (trk.PSEC) { case 0x10: dskType = MediaType.CDI; break; case 0x20: if (dskType == MediaType.CD || dskType == MediaType.CDROM) { dskType = MediaType.CDROMXA; } break; } leadoutTrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack || (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental ? TrackType.Data : TrackType.Audio; } } } else { updateStatus?.Invoke("Cannot read RAW TOC, requesting processed one..."); dumpLog?.WriteLine("Cannot read RAW TOC, requesting processed one..."); sense = dev.ReadToc(out cmdBuf, out _, false, 0, dev.Timeout, out _); TOC.CDTOC?oldToc = TOC.Decode(cmdBuf); if ((sense || !oldToc.HasValue) && !force) { dumpLog?.WriteLine("Could not read TOC, if you want to continue, use force, and will try from LBA 0 to 360000..."); stoppingErrorMessage?. Invoke("Could not read TOC, if you want to continue, use force, and will try from LBA 0 to 360000..."); return(null); } foreach (TOC.CDTOCTrackDataDescriptor trk in oldToc. Value.TrackDescriptors.OrderBy(t => t.TrackNumber). Where(trk => trk.ADR == 1 || trk.ADR == 4)) { if (trk.TrackNumber >= 0x01 && trk.TrackNumber <= 0x63) { trackList.Add(new Track { TrackSequence = trk.TrackNumber, TrackSession = 1, TrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack || (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental ? TrackType.Data : TrackType.Audio, TrackStartSector = trk.TrackStartAddress, TrackBytesPerSector = (int)sectorSize, TrackRawBytesPerSector = (int)sectorSize, TrackSubchannelType = subType }); trackFlags?.Add(trk.TrackNumber, trk.CONTROL); } else if (trk.TrackNumber == 0xAA) { leadoutTrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack || (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental ? TrackType.Data : TrackType.Audio; lastSector = trk.TrackStartAddress - 1; } } } if (trackList.Count == 0) { updateStatus?.Invoke("No tracks found, adding a single track from 0 to Lead-Out"); dumpLog?.WriteLine("No tracks found, adding a single track from 0 to Lead-Out"); trackList.Add(new Track { TrackSequence = 1, TrackSession = 1, TrackType = leadoutTrackType, TrackStartSector = 0, TrackBytesPerSector = (int)sectorSize, TrackRawBytesPerSector = (int)sectorSize, TrackSubchannelType = subType }); trackFlags?.Add(1, (byte)(leadoutTrackType == TrackType.Audio ? 0 : 4)); } if (lastSector == 0) { sense = dev.ReadCapacity16(out cmdBuf, out _, dev.Timeout, out _); if (!sense) { byte[] temp = new byte[8]; Array.Copy(cmdBuf, 0, temp, 0, 8); Array.Reverse(temp); lastSector = (long)BitConverter.ToUInt64(temp, 0); blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]); } else { sense = dev.ReadCapacity(out cmdBuf, out _, dev.Timeout, out _); if (!sense) { lastSector = (cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]; blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]); } } if (lastSector <= 0) { if (!force) { stoppingErrorMessage?. Invoke("Could not find Lead-Out, if you want to continue use force option and will continue until 360000 sectors..."); dumpLog?. WriteLine("Could not find Lead-Out, if you want to continue use force option and will continue until 360000 sectors..."); return(null); } updateStatus?. Invoke("WARNING: Could not find Lead-Out start, will try to read up to 360000 sectors, probably will fail before..."); dumpLog?.WriteLine("WARNING: Could not find Lead-Out start, will try to read up to 360000 sectors, probably will fail before..."); lastSector = 360000; } } return(trackList.ToArray()); }
internal abstract bool InternalSetActiveTrack(TrackType trackType, int trackUid);
public bool CanPurchaseTrackOfType(TrackType type) { return(unlockedTracksMap.ContainsKey(type) && unlockedTracksMap[type]); }
public TrackPainter(TrackType trackType, HSVColor hsvColor) { this.trackType = trackType; this.hsvColor = hsvColor; }
public void UnlockTrackType(TrackType type) { unlockedTracksMap.Add(type, true); }
public TrackerPower(TrackType type) { this.type = type; }
public PickupPatternLevel GetPickupPattern(TrackType track, int level) { var group = this.pickupPatterns.Find(g => g.Track == track); return(group == null ? null : group.GetPatterns(level)); }
public TrackRange(TrackType type) { this.TrackType = type; }
public async void OnTrackDeleted(TrackType type, int trackId) { if (type == TrackType.Unknown || type == TrackType.Video) return; List<DictionaryKeyValue> target; if (type == TrackType.Audio) target = _audioTracks; else target = _subtitlesTracks; target.RemoveAll((t) => t.Id == trackId); if (target.Count > 0) return; if (type == TrackType.Subtitle) { _currentSubtitle = -1; await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => OnPropertyChanged("CurrentSubtitle")); } else { _currentAudioTrack = -1; await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => OnPropertyChanged("CurrentAudioTrack")); } }
public Track(string title, TrackType trackType, string trackPath) : this(title, trackType, trackPath, TimeSpan.Zero) { }
/// <summary> /// track an event with custom data /// </summary> /// <param name="type"></param> /// <param name="data"></param> public void Track(TrackType type, string data) { // get clicked item name Track t = new Track(type, data); t.id = Auth.GetNetworkAddress(); t.tag = Program; debug(_tc.ToString() + " " + t.ToString()); if (SendTrackEvent != null) SendTrackEvent(t); if (!TrackEnabled) return; _tc++; _untrackedqueue.Write(t); }
public async void OnTrackAdded(TrackType type, int trackId) { if (type == TrackType.Unknown || type == TrackType.Video) return; List<DictionaryKeyValue> target; IList<TrackDescription> source; if (type == TrackType.Audio) { target = _audioTracks; source = ((VLCService)_mediaService).MediaPlayer.audioTrackDescription(); } else { target = _subtitlesTracks; source = ((VLCService)_mediaService).MediaPlayer.spuDescription(); } target.Clear(); foreach (var t in source) { target.Add(new DictionaryKeyValue() { Id = t.id(), Name = t.name(), }); } // This assumes we have a "Disable" track for both subtitles & audio if (type == TrackType.Subtitle && CurrentSubtitle == null && _subtitlesTracks.Count > 1) { _currentSubtitle = 1; await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => OnPropertyChanged("CurrentSubtitle")); } else if (type == TrackType.Audio && CurrentAudioTrack == null && _audioTracks.Count > 1) { _currentAudioTrack = 1; await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => OnPropertyChanged("CurrentAudioTrack")); } }
public ITrackMessage GetTrackMessage(TrackType type) => GetHandler(type).Message;
public MusicTrack(HIRCObject ParentObject, BinaryReader br, int iType) { Type = iType; Parent = ParentObject; uint Length = br.ReadUInt32(); long initPos = br.BaseStream.Position; ID = br.ReadUInt32(); MusicFlags = br.ReadByte(); TrackSources = new List <TrackSource>(); uint numSources = br.ReadUInt32(); for (int i = 0; i < numSources; i++) { TrackSources.Add(new TrackSource(br)); } TrackPlaylist = new List <TrackItem>(); uint numTracks = br.ReadUInt32(); for (int i = 0; i < numTracks; i++) { TrackPlaylist.Add(new TrackItem(br)); } if (numTracks != 0) { SubtrackCount = br.ReadUInt32(); } AutomationItems = new List <AutomationItem>(); uint numAutomationItems = br.ReadUInt32(); for (int i = 0; i < numAutomationItems; i++) { AutomationItems.Add(new AutomationItem(br)); } NodeBase = new NodeBase(br, ParentObject); TrackType = br.ReadByte(); if (TrackType == 0 || TrackType == 1 || TrackType == 2) { } else if (TrackType == 3) { SwitchGroupType = br.ReadByte(); SwitchGroupID = br.ReadUInt32(); DefaultSwitch = br.ReadUInt32(); SwitchAssoc = new List <uint>(); uint numSwitchAssoc = br.ReadUInt32(); for (int i = 0; i < numSwitchAssoc; i++) { SwitchAssoc.Add(br.ReadUInt32()); } SourceFadeTransitionTime = br.ReadUInt32(); SourceFadeCurve = br.ReadUInt32(); SourceFadeOffset = br.ReadUInt32(); TransitionSyncType = br.ReadUInt32(); TransitionCueFilterHash = br.ReadUInt32(); DestinationFadeTransitionTime = br.ReadUInt32(); DestinationFadeCurve = br.ReadUInt32(); DestinationFadeOffset = br.ReadUInt32(); } else { MessageBox.Show("Detected unknown Type 11 track Type at: " + br.BaseStream.Position.ToString("X") + " Type: " + TrackType.ToString()); } LookAheadTime = br.ReadUInt32(); }
public void FadeTrackTo(TrackType trackType, string trackName) { if ((!MainTrackFadeInProgress && trackType == TrackType.Main) || (!OverlayTrackFadeInProgress && trackType == TrackType.Overlay)) { if (outputDevice.PlaybackState == PlaybackState.Playing) { float speed = fadeSpeed; Timer timer = new Timer() { Interval = fadeInterval }; VolumeSampleProvider fadeIn = null; VolumeSampleProvider fadeOut = null; string[] trackTypes = { "ins", "voc" }; foreach (var item in volumeSampleProviders) { var vsp = item.Value; if (item.Key.StartsWith(trackTypes[(int)trackType])) { if (item.Key == trackName) { if (vsp.Volume < 1.0f) { fadeIn = vsp; } else { break; } } if (vsp.Volume > 0.0f) { fadeOut = vsp; } } } if (fadeIn != null) { fadeIn.Volume = 0.0f; } if (fadeOut != null) { fadeOut.Volume = 1.0f; } timer.Elapsed += (sndr, evt) => { if (fadeIn != null) { fadeIn.Volume += speed; if (fadeIn.Volume >= 1.0f) { fadeIn.Volume = 1.0f; } if (trackType == TrackType.Main) { MainTrackFadeVolume = fadeIn.Volume; MainTrackFadeInProgress = true; } else if (trackType == TrackType.Overlay) { OverlayTrackFadeVolume = fadeIn.Volume; OverlayTrackFadeInProgress = true; } } if (fadeOut != null) { fadeOut.Volume -= speed; if (fadeOut.Volume <= 0.0f) { fadeOut.Volume = 0.0f; } if (trackType == TrackType.Main) { MainTrackFadeVolume = fadeOut.Volume; MainTrackFadeInProgress = true; } else if (trackType == TrackType.Overlay) { OverlayTrackFadeVolume = fadeOut.Volume; OverlayTrackFadeInProgress = true; } } if (fadeIn?.Volume == 1.0f || fadeOut?.Volume == 0.0f) { if (trackType == TrackType.Main) { MainTrackFadeInProgress = false; } else if (trackType == TrackType.Overlay) { OverlayTrackFadeInProgress = false; } timer.Enabled = false; timer.Dispose(); } }; if (fadeIn != null || fadeOut != null) { timer.Enabled = true; } } else { InitVolumes(trackName, trackName); } } }
/// <summary> /// Get the track number of the first track of a specific type /// </summary> /// <remarks> /// <para>In FFMS2, the equivalent is <c>FFMS_GetFirstTrackOfType</c>.</para> /// </remarks> /// <param name="type">Track type</param> /// <returns>Track number</returns> /// <seealso cref="GetFirstIndexedTrackOfType"/> /// <exception cref="System.Collections.Generic.KeyNotFoundException">Trying to find a type of track that doesn't exist in the media file.</exception> public int GetFirstTrackOfType(TrackType type) { var err = new FFMS_ErrorInfo { BufferSize = 1024, Buffer = new String((char) 0, 1024) }; var track = NativeMethods.FFMS_GetFirstTrackOfType(_handle, (int)type, ref err); if (track >= 0) return track; if (err.ErrorType == FFMS_Errors.FFMS_ERROR_INDEX && err.SubType == FFMS_Errors.FFMS_ERROR_NOT_AVAILABLE) throw new System.Collections.Generic.KeyNotFoundException(err.Buffer); throw new NotImplementedException(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Unknown FFMS2 error encountered: ({0}, {1}, '{2}'). Please report this issue on FFMSSharp's GitHub.", err.ErrorType, err.SubType, err.Buffer)); }
internal MediaPlayerESDeletedEventArgs(string id, TrackType type) { Id = id; Type = type; }
public TrackEntry(TrackType trackType, byte[] infoBytes, CodecID codecID, byte[] codecPrivate) { this.TrackType = trackType; this.InfoBytes = infoBytes; this.CodecID = codecID; this.CodecPrivate = codecPrivate; }
public DbTrackType(TrackType trackType) { TrackTypeAsByte = (byte)trackType; }
private void TrackTypeMenuItemOnClick(ListViewItem[] listViewItems, TrackType trackType) { foreach (var listViewItem in listViewItems) { TrackTypeMenuItemOnClick(listViewItem, trackType); } }
private static void AddAnimData(AnimBone animBone, SBKeyGroup <float> keys, ControlType ctype, TrackType ttype) { AnimData d = new AnimData(); d.controlType = ctype; d.type = ttype; if (IsAngular(ctype)) { d.output = OutputType.angular; } float value = 0; if (keys.Keys.Count > 0) { value = keys.Keys[0].Value; } bool IsConstant = true; foreach (var key in keys.Keys) { if (key.Value != value) { IsConstant = false; break; } } foreach (var key in keys.Keys) { AnimKey animKey = new AnimKey() { input = key.Frame + 1, output = IsAngular(ctype) ? (MayaSettings.UseRadians ? key.Value : (float)(key.Value * (180 / Math.PI))) : key.Value, }; if (key.InterpolationType == InterpolationType.Hermite) { animKey.intan = "fixed"; animKey.outtan = "fixed"; animKey.t1 = key.InTan; animKey.t2 = key.OutTan; } d.keys.Add(animKey); if (IsConstant) { break; } } if (d.keys.Count > 0) { animBone.atts.Add(d); } }
internal MediaPlayerESSelectedEventArgs(int id, TrackType type) { Id = id; Type = type; }
public void SetTrackType(TrackType t) { trackType = t; switch (t) { case TrackType.Drum: trackPlane.GetComponent<MeshRenderer> ().material = drumMat; sequenceTxt = drumSequenceTxt; source.clip = drumClip; source.volume = 1.0f; break; case TrackType.Drum2: trackPlane.GetComponent<MeshRenderer> ().material = drumMat; sequenceTxt = drum2SequenceTxt; source.clip = drum2Clip; source.volume = 1.0f; break; case TrackType.Bass: trackPlane.GetComponent<MeshRenderer> ().material = bassMat; sequenceTxt = bassSequenceTxt; source.clip = bassClip; source.volume = 0.7f; break; case TrackType.Synth: trackPlane.GetComponent<MeshRenderer> ().material = synthMat; sequenceTxt = synthSequenceTxt; source.clip = synthClip; source.volume = 0.5f; break; case TrackType.Pad: trackPlane.GetComponent<MeshRenderer> ().material = padMat; sequenceTxt = padSequenceTxt; source.clip = padClip; source.volume = 0.8f; break; } Init (); }