用VB.NET + WinForms检查音乐文件的评级 [英] Check music file rating with VB.NET + WinForms
问题描述
但是我想编辑文件等级,与文件的URL,就像当你使用Windows属性对话框或Windows资源管理器。
但是,我已经在网上搜索,在StackOverflow ,但我什么也没找到。
Cumps,
Scorch
这是一个简单的代码,说明如何将特定的mp3的评级设置为5星。
Dim PopM As TagLib.Id3v2.PopularimeterFrame = TagLib.Id3v2.PopularimeterFrame.Get(tag,WindowsUser,True)
PopM.Rating = 255
Fi.Save()
Fi.Dispose()
<评分是一个字节,所以你需要去这样的事情来得到你的星相当于计算:
$ b
unrated = 0 ,1 = 1-63,2 = 64-127,3 = 128-191,4 = 192-254,5 = 255
正如你所提到的,并不是所有的东西都能读取标签中的评分,例如我相信iTunes使用元数据。但它不是一个窗口的具体功能。
本文档可能有用,即使它已经过时了。
I'm developing an application for editing the MP3 tags, such as title, album, etc...
But I wanted to make possible to edit the file rating, with the file URL, just like it is when you use the windows properties dialog or the windows explorer.
However, I have looked in the web, searched in StackOverflow, but I have found nothing.
Cumps,
Scorch
In taglib-Sharp there is a class called PopularmeterFrame. You will need to use that to edit ratings.
This is simple code illustrating how to set the rating of a specific mp3 to 5 stars.
Dim Fi As TagLib.File = TagLib.File.Create("E:\SomeSong.mp3")
Dim tag As TagLib.Tag = Fi.GetTag(TagLib.TagTypes.Id3v2)
Dim PopM As TagLib.Id3v2.PopularimeterFrame = TagLib.Id3v2.PopularimeterFrame.Get(tag, "WindowsUser", True)
PopM.Rating = 255
Fi.Save()
Fi.Dispose()
The rating is is a byte so you will need to go with something like this to get your star equivalent calculated:
unrated=0, 1=1-63, 2=64-127, 3=128-191, 4=192-254, 5=255
As you mentioned not everything reads the ratings in tags, for example I believe iTunes uses metadata instead. But it is not a windows specific feature.
This Documentation may be useful even though it is somewhat out of date.
这篇关于用VB.NET + WinForms检查音乐文件的评级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!