本文整理汇总了C#中TrackData类的典型用法代码示例。如果您正苦于以下问题:C# TrackData类的具体用法?C# TrackData怎么用?C# TrackData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrackData类属于命名空间,在下文中一共展示了TrackData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Print
public void Print(TrackData trackData)
{
const int numberOfTracks = 1;
InitialiseGraphics(numberOfTracks);
RenderTrackSwatch(trackData, numberOfTracks - 1);
SaveSwatchToFile();
}
示例2: Vector3ToTrackData
public static TrackData Vector3ToTrackData(Vector3 vec, TrackData trackData)
{
trackData.x = FloatToInt(vec.x);
trackData.y = FloatToInt(vec.y);
trackData.z = FloatToInt(vec.z);
return trackData;
}
示例3: GameEntityTypeFromTrackData
public static GameEntityType GameEntityTypeFromTrackData(TrackData trackData)
{
GameEntityType entityType;
switch (trackData.entityType) {
case TrackData.EntityType.PLAYER:
entityType = GameEntityType.Player;
break;
case TrackData.EntityType.NPC:
entityType = GameEntityType.Npc;
break;
case TrackData.EntityType.SHIP:
entityType = GameEntityType.Vehicle;
break;
case TrackData.EntityType.OTHER:
entityType = GameEntityType.Other;
break;
default:
entityType = GameEntityType.Other;
break;
}
if (entityType == GameEntityType.Player && trackData.id != NetworkSettings.instance.username) {
entityType = GameEntityType.OtherPlayer;
}
return entityType;
}
示例4: ShouldReadSubFingerprintsByHashBucketsHavingThreshold
public void ShouldReadSubFingerprintsByHashBucketsHavingThreshold()
{
const int Threshold = 5;
TrackData firstTrack = new TrackData("isrc1", "artist", "title", "album", 1986, 200);
var firstTrackReference = modelService.InsertTrack(firstTrack);
TrackData secondTrack = new TrackData("isrc2", "artist", "title", "album", 1986, 200);
var secondTrackReference = modelService.InsertTrack(secondTrack);
long[] firstTrackBuckets = new long[]
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
};
long[] secondTrackBuckets = new long[]
{
2, 2, 4, 5, 6, 7, 7, 9, 10, 11, 12, 13, 14, 14, 16, 17, 18, 19, 20, 20, 22, 23, 24, 25, 26
};
var firstHashData = new HashedFingerprint(GenericSignature, firstTrackBuckets, 1, 0.928);
var secondHashData = new HashedFingerprint(GenericSignature, secondTrackBuckets, 1, 0.928);
modelService.InsertHashDataForTrack(new[] { firstHashData }, firstTrackReference);
modelService.InsertHashDataForTrack(new[] { secondHashData }, secondTrackReference);
// query buckets are similar with 5 elements from first track and 4 elements from second track
long[] queryBuckets = new long[]
{
3, 2, 5, 6, 7, 8, 7, 10, 11, 12, 13, 14, 15, 14, 17, 18, 19, 20, 21, 20, 23, 24, 25, 26, 25
};
var subFingerprints = modelService.ReadSubFingerprintDataByHashBucketsWithThreshold(queryBuckets, Threshold);
Assert.IsTrue(subFingerprints.Count == 1);
Assert.AreEqual(firstTrackReference, subFingerprints[0].TrackReference);
}
示例5: Vector3ToTrackData
public TrackData Vector3ToTrackData(Vector3 vec, TrackData trackData)
{
trackData.x = FloatToInt(vec.x, true);
trackData.y = FloatToInt(vec.z, true);
trackData.z = FloatToInt(vec.y, true);
return trackData;
}
示例6: TestSpectralImagesAreInsertedInDataSource
public void TestSpectralImagesAreInsertedInDataSource()
{
TrackData track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = TrackDao.InsertTrack(track);
var audioSamples = audioService.ReadMonoSamplesFromFile(
PathToMp3, new DefaultFingerprintConfiguration().SampleRate);
var spectralImages = spectrumService.CreateLogSpectrogram(audioSamples, SpectrogramConfig.Default);
var concatenatedSpectralImages = new List<float[]>();
foreach (var spectralImage in spectralImages)
{
var concatenatedSpectralImage = ArrayUtils.ConcatenateDoubleDimensionalArray(spectralImage.Image);
concatenatedSpectralImages.Add(concatenatedSpectralImage);
}
SpectralImageDao.InsertSpectralImages(concatenatedSpectralImages, trackReference);
var readSpectralImages = SpectralImageDao.GetSpectralImagesByTrackId(trackReference);
Assert.AreEqual(concatenatedSpectralImages.Count, readSpectralImages.Count);
foreach (var readSpectralImage in readSpectralImages)
{
var expectedSpectralImage = concatenatedSpectralImages[readSpectralImage.OrderNumber];
for (int i = 0; i < expectedSpectralImage.Length; i++)
{
Assert.AreEqual(
concatenatedSpectralImages[readSpectralImage.OrderNumber][i], expectedSpectralImage[i]);
}
}
}
示例7: SameNumberOfHashBinsIsInsertedInAllTablesWhenFingerprintingEntireSongTest
public void SameNumberOfHashBinsIsInsertedInAllTablesWhenFingerprintingEntireSongTest()
{
const int StaticStride = 5115;
TagInfo tagInfo = this.GetTagInfo();
int releaseYear = tagInfo.Year;
TrackData track = new TrackData(tagInfo.ISRC, tagInfo.Artist, tagInfo.Title, tagInfo.Album, releaseYear, (int)tagInfo.Duration);
var trackReference = TrackDao.InsertTrack(track);
var hashedFingerprints = fingerprintCommandBuilder
.BuildFingerprintCommand()
.From(PathToMp3)
.WithFingerprintConfig(config =>
{
config.SpectrogramConfig.Stride = new IncrementalStaticStride(StaticStride, config.SamplesPerFingerprint);
})
.UsingServices(audioService)
.Hash()
.Result;
InsertHashedFingerprintsForTrack(hashedFingerprints, trackReference);
var hashes = HashBinDao.ReadHashedFingerprintsByTrackReference(track.TrackReference);
Assert.AreEqual(hashedFingerprints.Count, hashes.Count);
foreach (var data in hashes)
{
Assert.AreEqual(25, data.HashBins.Length);
}
}
示例8: Init
public static void Init()
{
// Solo se crea la ventana si existen los datos del circuito
managerData = GameObject.Find("MANAGER_TRACK").GetComponent<TrackData>();
if (managerData == null) {
isActive = false;
return;
}
if (isActive) {
if (tClass != null)
DestroyImmediate(tClass.gameObject);
isActive = false;
}
else if (!isActive) {
isActive = true;
tClass = new GameObject("TRACK EDITOR").AddComponent<TrackDataEditorMono>();
tClass.hideFlags = HideFlags.HideInHierarchy;
// Selecciona el editor
GameObject[] gm = new GameObject[1];
gm[0] = tClass.gameObject;
Selection.objects = gm;
}
}
示例9: DetectEyes
public bool DetectEyes(Image<Gray, byte> input, TrackData trackData)
{
if (input == null)
return false;
return DoEyesRegionExtraction(input, trackData);
}
示例10: ShouldCreateFingerprintsFromAudioSamplesQueryAndGetTheRightResult
public void ShouldCreateFingerprintsFromAudioSamplesQueryAndGetTheRightResult()
{
const int SecondsToProcess = 10;
const int StartAtSecond = 30;
var audioSamples = GetAudioSamples();
var track = new TrackData(string.Empty, audioSamples.Origin, audioSamples.Origin, string.Empty, 1986, audioSamples.Duration);
var trackReference = modelService.InsertTrack(track);
var hashDatas = fingerprintCommandBuilder.BuildFingerprintCommand()
.From(audioSamples)
.UsingServices(audioService)
.Hash()
.Result;
modelService.InsertHashDataForTrack(hashDatas, trackReference);
var querySamples = GetQuerySamples(audioSamples, StartAtSecond, SecondsToProcess);
var queryResult = queryCommandBuilder.BuildQueryCommand()
.From(new AudioSamples(querySamples, string.Empty, audioSamples.SampleRate))
.UsingServices(modelService, audioService)
.Query()
.Result;
Assert.IsTrue(queryResult.ContainsMatches);
Assert.AreEqual(1, queryResult.ResultEntries.Count());
var bestMatch = queryResult.BestMatch;
Assert.AreEqual(trackReference, bestMatch.Track.TrackReference);
Assert.IsTrue(bestMatch.QueryMatchLength > SecondsToProcess - 3, string.Format("QueryMatchLength:{0}", bestMatch.QueryLength));
Assert.AreEqual(StartAtSecond, Math.Abs(bestMatch.TrackStartsAt), 0.1d);
Assert.IsTrue(bestMatch.Confidence > 0.7, string.Format("Confidence:{0}", bestMatch.Confidence));
}
示例11: QuaternionToTrackData
public TrackData QuaternionToTrackData(Quaternion q, TrackData trackData)
{
trackData.rx = FloatToInt(q.x, true);
trackData.ry = FloatToInt(q.y, true);
trackData.rz = FloatToInt(q.z, true);
trackData.rw = FloatToInt(q.w, true);
return trackData;
}
示例12: InsertTrack
public IModelReference InsertTrack(TrackData track)
{
int id = PrepareStoredProcedure(SpInsertTrack)
.WithParametersFromModel(track)
.Execute()
.AsScalar<int>();
return track.TrackReference = new ModelReference<int>(id);
}
示例13: InsertTrackTest
public void InsertTrackTest()
{
TrackData track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = ModelService.InsertTrack(track);
AssertModelReferenceIsInitialized(trackReference);
}
示例14: ReadTrackByTrackReferenceTest
public void ReadTrackByTrackReferenceTest()
{
TrackData expectedTrack = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = ModelService.InsertTrack(expectedTrack);
var actualTrack = ModelService.ReadTrackByReference(trackReference);
AssertTracksAreEqual(expectedTrack, actualTrack);
}
示例15: TrayNotification
/// <summary>
///
/// </summary>
/// <param name="track"></param>
/// <param name="parent"></param>
public TrayNotification(TrackData track, StoffiWindow parent)
{
ParentWindow = parent;
InitializeComponent();
TrackArtist.Text = track.Artist;
TrackTitle.Text = track.Title;
AlbumArt.Source = Utilities.GetImageTag(track);
}