MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
LinkBack Thread Tools Display Modes
Old 2006-05-01, 03:57   #1 (permalink)
Portal Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via AIM to jimbruskalski
Default Trying to Read Tags from mp3's

Hi, I am not really sure which classes are meant to read from music files, but I am trying to write a simple plugin that will display the file's tag information. It is more for me to learn how to use everything than for its functionality. However, I have tried many different combinations and am unable to get it to read any tags or say that it supports the file I give it. I know the mp3's have filled tag information. Thanks.
__________________
James Andrew Smith
jimbruskalski is offline   Reply With Quote
Old 2006-05-01, 09:37   #2 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Here you go:
Code:
tag = TagReader.TagReader.ReadTag(strPathSong);
where strPathSong is the path to the music file, and tag is the musictag object that's returned by the function containing all the tag information.

Sam
samuel337 is offline   Reply With Quote
Old 2006-05-02, 01:41   #3 (permalink)
Portal Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via AIM to jimbruskalski
Default

This is what I have and it is not working:

"protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
{
if (control == buttonOne)
{
MusicTag tag = TagReader.ReadTag("M\\:\\Document and Settings\\Andrew\\My Documents\\final music final\\Adore\\03 Perfect.mp3");

string str = "didn't work, sorry...";
str = tag.Album;

GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWi ndow.Window.WINDOW_DIALOG_OK);
dlg.SetHeading("Button has been pressed");
dlg.SetLine(1, str);
dlg.SetLine(2, String.Empty);
dlg.SetLine(3, String.Empty);
dlg.DoModal(GUIWindowManager.ActiveWindow);
}
lblOne.Label = "You changed the text!";
lblOne.UpdateLayout();
base.OnClicked(controlId, control, actionType);
}"


The dialog box does not come up with this; however, if I take this line out (" MusicTag tag = TagReader.ReadTag("M\\:\\Document and Settings\\Andrew\\My Documents\\final music final\\Adore\\03 Perfect.mp3");") it does show the dialog box. Why is this? What am I doing wrong? Thank you so much.
__________________
James Andrew Smith
jimbruskalski is offline   Reply With Quote
Old 2006-05-02, 01:49   #4 (permalink)
Portal Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via AIM to jimbruskalski
Default

I am sorry, there was a mistake in my previous post. If I leave that line in there (the one I said wouldnt work; the creation of the music tag) it still works. It is only when I assign the variable str to tag.Artist or any member of tag that it doesnt work. It is like it is not reading the file. The string location I pass it is correct and I know for a fact the mp3 has tags with information in them.
__________________
James Andrew Smith
jimbruskalski is offline   Reply With Quote
Old 2006-05-02, 02:02   #5 (permalink)
Portal Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


Send a message via AIM to jimbruskalski
Default

Hi, I figured out my problem. I was using "M\\:\\..." instead of "M:\\". I originally had it write, but when that didnt work, I tried the first thinking that might be the problem. When you gave me the solution, I didnt change it back to the original and so it still didnt work. Now that I have used your solution and changed the location string back the original, it works. Thanks so much for your help!
__________________
James Andrew Smith
jimbruskalski is offline   Reply With Quote
Reply

Bookmarks

Tags
mp3, read, tags

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Errors reading WMA tags samundsen Support 22 2007-03-09 16:09
Getting Data from the Web James General Development (no feature request here!) 11 2007-01-07 16:38
WavPack and FLAC tags andreassb General Support 0 2006-11-25 13:08
Pictures and Tags pavelr Improvement Suggestions 2 2006-03-25 13:04
TagReader: Track number from ID3v2 not read hwahrmann The old Bugreport Forum 6 2006-02-21 11:58


All times are GMT +1. The time now is 06:52.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress