本文整理汇总了C#中TrackData类的典型用法代码示例。如果您正苦于以下问题:C# TrackData类的具体用法?C# TrackData怎么用?C# TrackData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TrackData类属于命名空间,在下文中一共展示了TrackData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Print
public void Print(TrackData trackData)
{
const int numberOfTracks = 1;
InitialiseGraphics(numberOfTracks);
RenderTrackSwatch(trackData, numberOfTracks - 1);
SaveSwatchToFile();
}
开发者ID:EJLarcs,项目名称:chromesthesia,代码行数:7,代码来源:SwatchOutputType.cs
示例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;
}
开发者ID:gamemachine,项目名称:gamemachine,代码行数:7,代码来源:GmUtil.cs
示例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;
}
开发者ID:tiger0-0,项目名称:gamemachine,代码行数:27,代码来源:GameEntity.cs
示例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);
}
开发者ID:AddictedCS,项目名称:soundfingerprinting.solr,代码行数:32,代码来源:SolrModelServiceIntTest.cs
示例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;
}
开发者ID:tiger0-0,项目名称:gamemachine,代码行数:7,代码来源:Util.cs
示例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]);
}
}
}
开发者ID:modulexcite,项目名称:soundfingerprinting,代码行数:28,代码来源:AbstractSpectralImageDaoTest.cs
示例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);
}
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:27,代码来源:AbstractHashBinDaoTest.cs
示例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;
}
}
开发者ID:Arafo,项目名称:Syncopia,代码行数:25,代码来源:TrackDataEditor.cs
示例9: DetectEyes
public bool DetectEyes(Image<Gray, byte> input, TrackData trackData)
{
if (input == null)
return false;
return DoEyesRegionExtraction(input, trackData);
}
开发者ID:vegazrelli,项目名称:GazeTracker2.0,代码行数:7,代码来源:Eyestracker.cs
示例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));
}
开发者ID:AddictedCS,项目名称:soundfingerprinting,代码行数:31,代码来源:FingerprintCommandBuilderNativeIntTest.cs
示例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;
}
开发者ID:tiger0-0,项目名称:gamemachine,代码行数:8,代码来源:Util.cs
示例12: InsertTrack
public IModelReference InsertTrack(TrackData track)
{
int id = PrepareStoredProcedure(SpInsertTrack)
.WithParametersFromModel(track)
.Execute()
.AsScalar<int>();
return track.TrackReference = new ModelReference<int>(id);
}
开发者ID:gaborp,项目名称:soundfingerprinting.sql,代码行数:8,代码来源:TrackDao.cs
示例13: InsertTrackTest
public void InsertTrackTest()
{
TrackData track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = ModelService.InsertTrack(track);
AssertModelReferenceIsInitialized(trackReference);
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:8,代码来源:ModelServiceTest.cs
示例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);
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:9,代码来源:ModelServiceTest.cs
示例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);
}
开发者ID:Erls-Corporation,项目名称:YAMA,代码行数:14,代码来源:TrayNotification.xaml.cs
示例16: TrackdataToQuaternion
public Quaternion TrackdataToQuaternion(TrackData trackData)
{
float x = (trackData.rx / 100f) - settings.worldOffset;
float y = (trackData.ry / 100f) - settings.worldOffset;
float z = (trackData.rz / 100f) - settings.worldOffset;
float w = (trackData.rw / 100f) - settings.worldOffset;
return new Quaternion(x, y, z,w);
}
开发者ID:tiger0-0,项目名称:gamemachine,代码行数:9,代码来源:Util.cs
示例17: InsertTest
public void InsertTest()
{
TrackData track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = TrackDao.InsertTrack(track);
var subFingerprintReference = SubFingerprintDao.InsertSubFingerprint(GenericSignature, 123, 0.928, trackReference);
AssertModelReferenceIsInitialized(subFingerprintReference);
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:9,代码来源:AbstractSubFingerprintDaoTest.cs
示例18: InsertTest
public void InsertTest()
{
TrackData track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = TrackDao.InsertTrack(track);
var fingerprintReference = FingerprintDao.InsertFingerprint(new FingerprintData(GenericFingerprint, trackReference));
AssertModelReferenceIsInitialized(fingerprintReference);
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:9,代码来源:AbstractFingerprintDaoTest.cs
示例19: InsertFingerprintTest
public void InsertFingerprintTest()
{
var track = new TrackData("isrc", "artist", "title", "album", 1986, 200);
var trackReference = modelService.InsertTrack(track);
var fingerprint = new FingerprintData(GenericFingerprint(), trackReference);
modelService.InsertFingerprint(fingerprint);
AssertModelReferenceIsInitialized(fingerprint.FingerprintReference);
}
开发者ID:AddictedCS,项目名称:soundfingerprinting,代码行数:10,代码来源:InMemoryModelServiceTest.cs
示例20: ReadTrackByISRCTest
public void ReadTrackByISRCTest()
{
const string ISRC = "isrc";
TrackData expectedTrack = new TrackData(ISRC, "artist", "title", "album", 1986, 200);
ModelService.InsertTrack(expectedTrack);
var actualTrack = ModelService.ReadTrackByISRC(ISRC);
AssertTracksAreEqual(expectedTrack, actualTrack);
}
开发者ID:gaborp,项目名称:soundfingerprinting,代码行数:10,代码来源:ModelServiceTest.cs
注:本文中的TrackData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论