本文整理汇总了C#中ITrack类的典型用法代码示例。如果您正苦于以下问题:C# ITrack类的具体用法?C# ITrack怎么用?C# ITrack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITrack类属于命名空间,在下文中一共展示了ITrack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WaitForIsLoaded
private static void WaitForIsLoaded(ITrack track, CancellationToken cancellationToken)
{
while (!track.IsLoaded() || cancellationToken.IsCancellationRequested)
{
Task.Delay(250, cancellationToken);
}
}
示例2: Reorder
private static void Reorder(ITrack track)
{
for (var i = 0; i < track.MediaItems.Count; i++)
{
track.MediaItems[i].Order = i;
}
}
示例3: SetTrack
/// <summary>
/// Sets the interval's track</summary>
/// <param name="interval">Interval to move to a new track</param>
/// <param name="newTrack">New track that becomes the owner of this interval,
/// or null if there is no new owning track</param>
/// <remarks>
/// SetTrack DOES NOT by itself set the interval's Track property!
/// This happens indirectly and only if ITrack is implemented correctly.
///
/// If the interval and new track are DomNodes AND Intervals are DOM-children of their track,
/// you can implement the Track property like this:
/// public ITrack Track { get { return GetParentAs<ITrack>(); } }
///
/// Otherwise, use an ObservableCollection for your Intervals list,
/// monitor changes and update the interval's Track property when
/// intervals are being added to or removed from a Track.
/// </remarks>
public static void SetTrack(this IInterval interval, ITrack newTrack)
{
ITrack currentTrack = interval.Track;
if (currentTrack != null)
currentTrack.Intervals.Remove(interval);
if (newTrack != null)
newTrack.Intervals.Add(interval);
}
示例4: Track
public Track(ITrack track, Dispatcher dispatcher)
{
InternalTrack = track;
_album = new Lazy<Album>(() => new Album(InternalTrack.Album, dispatcher));
_artists = new Lazy<IEnumerable<Artist>>(() => InternalTrack.Artists.Select(artist => new Artist(artist, dispatcher)));
_duration = new Lazy<TimeSpan>(() => InternalTrack.Duration);
}
示例5: Update
public void Update(TimeSpan dt, ITrack track)
{
_position += _velocity * dt.TotalSeconds;
while (_position > track.Length) _position -= track.Length;
var tmp = PositionUpdated;
if (tmp != null) tmp(this);
}
示例6: Track
public Track(ITrack track, Dispatcher dispatcher)
{
_dispatcher = dispatcher;
InternalTrack = track;
_album = new Lazy<Album>(() => new Album(InternalTrack.Album, _dispatcher));
_artists = new Lazy<IEnumerable<Artist>>(GetArtists);
_duration = new Lazy<TimeSpan>(() => InternalTrack.Duration);
}
示例7: GetIcon
private static object GetIcon(ITrack track)
{
//if (track.TargetType == MediaType.AudioMpeg)
//{
// return "pack://application:,,,/Images/File Audio MP3-01.png";
//}
return "pack://application:,,,/Images/File Audio-01.png";
}
示例8: PlayOrQueue
public void PlayOrQueue(ITrack track)
{
Append(track);
if (Index < 0)
{
Index = 0;
Play();
}
}
示例9: SongPlay
public override void SongPlay(ITrack track)
{
if (_client != null)
{
var foundChannel = CurrentServer?.TextChannels.First(d => d.Name == "bot_tests");
foundChannel.SendMessage("Now Playing: " + track.Name + " by " + track.Artists[0].Name);
_providerConverted = null;
}
}
示例10: TrackStarted
public TrackStarted(IRoom room, ITrack track)
{
if (room == null)
throw new ArgumentNullException(nameof(room));
if (track == null)
throw new ArgumentNullException(nameof(track));
TrackId = track.Id;
RoomId = room.Id;
}
示例11: Track
public Track(ITrack track)
{
Name = track.Name;
Artists = track.Artists.Select(a => new Artist(a)).ToArray();
Album = track.Album.Name;
Length = track.Duration;
IsAvailable = track.IsAvailable;
Popularity = track.Popularity;
IsStarred = track.IsStarred;
}
示例12: AddTrack
public void AddTrack(ITrack nuTrack)
{
// do some checking
// perhaps the movie needs to get longer!
if (GetTrackByTrackId(nuTrack.TrackMetaData.TrackId) != null)
{
// We already have a track with that trackId. Create a new one
nuTrack.TrackMetaData.TrackId = GetNextTrackId();
}
Tracks.Add(nuTrack);
}
示例13: Equals
public bool Equals(ITrack track)
{
iTunesTrack typeTrack = track as iTunesTrack;
if (typeTrack != null &&
typeTrack.m_track.TrackDatabaseID == m_track.TrackDatabaseID)
{
return true;
}
else
{
return false;
}
}
示例14: BuildMediaItemsTimelineTrackViewModel
private TrackViewModel BuildMediaItemsTimelineTrackViewModel(ITrack track, MediaItemsTimelineViewModel mediaItemsTimelineViewModel)
{
var trackViewModel = new TrackViewModel {
MediaItems = new ObservableCollection<MediaItemViewModel>(),
Track = track
};
trackViewModel.DropHandler = new TrackViewModelDropHandler(trackViewModel);
CollectionObserver.BindCollection(trackViewModel.MediaItems,
track.MediaItems,
mediaItem => BuildMediaItemsTimelineMediaItemViewModel(mediaItem, mediaItemsTimelineViewModel, trackViewModel));
return trackViewModel;
}
示例15: TrackSimplifier
public ITrack TrackSimplifier(ITrack track)
{
List<ITrackSegment> simplifiedSegmnet = new List<ITrackSegment>();
foreach (ITrackSegment segment in track.TrackSegments)
{
simplifiedSegmnet.Add(SimplifySegment(segment));
}
track.TrackSegments.Clear();
foreach (ITrackSegment segmnet in simplifiedSegmnet)
{
track.TrackSegments.Add(segmnet);
}
return track;
}