本文整理汇总了C#中ITrack类的典型用法代码示例。如果您正苦于以下问题:C# ITrack类的具体用法?C# ITrack怎么用?C# ITrack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITrack类属于命名空间,在下文中一共展示了ITrack类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WaitForIsLoaded
private static void WaitForIsLoaded(ITrack track, CancellationToken cancellationToken)
{
while (!track.IsLoaded() || cancellationToken.IsCancellationRequested)
{
Task.Delay(250, cancellationToken);
}
}
开发者ID:kfazi,项目名称:SpotifyHeadlessPlayer,代码行数:7,代码来源:TrackExtensions.cs
示例2: Reorder
private static void Reorder(ITrack track)
{
for (var i = 0; i < track.MediaItems.Count; i++)
{
track.MediaItems[i].Order = i;
}
}
开发者ID:AugustinasNomicas,项目名称:MultitrackPlayer,代码行数:7,代码来源:MediaItemsReorder.cs
示例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);
}
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:25,代码来源:IInterval.cs
示例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);
}
开发者ID:krikelin,项目名称:torshify-client,代码行数:8,代码来源:Track.cs
示例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);
}
开发者ID:vidstige,项目名称:URT,代码行数:8,代码来源:Car.cs
示例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);
}
开发者ID:torshy,项目名称:torshify-client,代码行数:9,代码来源:Track.cs
示例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";
}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:9,代码来源:TrackViewModel.cs
示例8: PlayOrQueue
public void PlayOrQueue(ITrack track)
{
Append(track);
if (Index < 0)
{
Index = 0;
Play();
}
}
开发者ID:TilmannBach,项目名称:cloudmusic2upnp,代码行数:10,代码来源:Playlist.cs
示例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;
}
}
开发者ID:jmazouri,项目名称:Picofy,代码行数:10,代码来源:PicofyDiscord.cs
示例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;
}
开发者ID:jpmarr,项目名称:kookbox,代码行数:10,代码来源:TrackStarted.cs
示例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;
}
开发者ID:skomski,项目名称:SpotiFire,代码行数:10,代码来源:Track.cs
示例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);
}
开发者ID:langhuihui,项目名称:csharprtmp,代码行数:11,代码来源:Movie.cs
示例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;
}
}
开发者ID:kring,项目名称:Voodoo-Voice,代码行数:13,代码来源:iTunesTrack.cs
示例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;
}
开发者ID:AugustinasNomicas,项目名称:MultitrackPlayer,代码行数:14,代码来源:MultitrackPlayerController.cs
示例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;
}
开发者ID:chinnisuraj1984,项目名称:navigational,代码行数:14,代码来源:Services.cs
示例16: GenerateArguments
protected String GenerateArguments(String tmpFilePath, ITrack track)
{
if (tmpFilePath == null)
{
throw new ArgumentNullException("tmpFilePath");
}
if (track == null)
{
throw new ArgumentNullException("track");
}
StringBuilder builder = new StringBuilder();
PropertyMetaData prop;
if (track.Args.HasArgument("inputpath"))
{
builder.AppendFormat("-i \"{0}\" ", track.Args.ArgumentValue("inputpath"));
}
else
{
prop = track["INPUTPATH"];
if (prop != null)
{
builder.AppendFormat("-i \"{0}\" ", prop);
}
}
prop = track["TitleChapter"];
if (prop != null)
{
builder.AppendFormat("{0} ", prop);
}
builder.AppendFormat("-o \"{0}\" ", tmpFilePath);
prop = track["HANDBRAKEOPTIONS"];
if (prop != null)
{
builder.Append(prop);
}
if (log.IsDebugEnabled)
{
log.DebugFormat("HandBrake Options {0}", builder);
}
return builder.ToString();
}
开发者ID:holtsoftware,项目名称:HandBrakeRunner,代码行数:50,代码来源:HandBrakeEncoder.cs
示例17: GetAcceleration
public double GetAcceleration(Car car, Car next, ITrack track)
{
var distance = track.Distance(car, next);
if (distance < ComfortDistance)
{
_targetVelocity = next.Velocity / 2;
}
if (distance > ComfortDistance * 5)
{
_targetVelocity = _comfortVelocity;
}
var a = (_targetVelocity - car.Velocity);
if (a > MaxAceleration) a = MaxAceleration;
if (a < -MaxAceleration) a = -MaxAceleration;
return a;
}
开发者ID:vidstige,项目名称:URT,代码行数:16,代码来源:StupidDriver.cs
示例18: IndexOf
public int IndexOf(ITrack track)
{
iTunesTrack typeTrack = track as iTunesTrack;
if (typeTrack == null)
{
return -1;
}
for (int i = 0; i < m_playlist.Tracks.Count; ++i)
{
if (m_playlist.Tracks[i + 1].TrackDatabaseID == typeTrack.InternalTrack.TrackDatabaseID)
{
return i;
}
}
return -1;
}
开发者ID:kring,项目名称:Voodoo-Voice,代码行数:17,代码来源:iTunesPlaylist.cs
示例19: GetFileExt
public String GetFileExt(ITrack track)
{
if (track == null)
{
throw new ArgumentNullException("track");
}
var value = track["hbfileext"];
if (value != null)
{
if (log.IsDebugEnabled)
{
log.DebugFormat("HandBrake File Extension {0}", value);
}
return value;
}
value = track["fileext"];
if (value != null)
{
if (log.IsDebugEnabled)
{
log.DebugFormat("HandBrake File Extension {0}", value);
}
return value;
}
value = track["filename"];
if (value != null)
{
FileInfo fi = new FileInfo(value);
if (log.IsDebugEnabled)
{
log.DebugFormat("HandBrake File Extension {0}", fi.Extension);
}
return fi.Extension;
}
if (log.IsDebugEnabled)
{
log.Debug("HandBrake File Extension .mp4");
}
return ".mp4";
}
开发者ID:holtsoftware,项目名称:HandBrakeRunner,代码行数:44,代码来源:HandBrakeEncoder.cs
示例20: SampleNumbers
public long[] SampleNumbers(ITrack track)
{
var segmentStartSamples =new List<long>() {1};
var sampleDurations = track.SampleDurations;
var syncSamples = track.SyncSamples;
long timescale = track.TrackMetaData.Timescale;
double time = 0;
for (uint i = 0; i < sampleDurations.Length; i++)
{
time += (double)sampleDurations[i] / timescale;
if (time >= _fragmentLength &&
(syncSamples == null || syncSamples.Contains(i+1)))
{
if (i > 0)
{
segmentStartSamples.Add(i+1);
}
time = 0;
}
}
return segmentStartSamples.ToArray();
}
开发者ID:langhuihui,项目名称:csharprtmp,代码行数:22,代码来源:TimeBasedFragmenter.cs
注:本文中的ITrack类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论