[mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

View: New views
19 Messages — Rating Filter:   Alert me  

[mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
---------------------------+------------------------------------------------
 Reporter:  nxisgod        |       Owner:  nxisgod
     Type:  bug            |      Status:  new    
 Priority:  normal         |   Milestone:        
Component:  Picard Tagger  |     Version:        
 Keywords:                 |          Os:        
  Browser:                 |  
---------------------------+------------------------------------------------
 Windows Explorer/ Windows Media Player/ MCE write the emails in their tags
 as... Windows Media Player 9 Series. However, Picard fails to recognize
 those, even though Windows Media Player, etc... can read the tags Picard
 writes. There are cases as well where Picard writes duplicate POPM tags,
 breaking reading of rating by Windows Media Player, etc...

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by outsidecontext):

 See http://code.google.com/p/mutagen/issues/detail?id=33.

 For some reason I did not get WMP to read the ratings generated by Picard.
 I set the E-Mail string to "Windows Media Player 9 Series" and it
 generates a POPM frame similar to the one generated by WMP itself, just 4
 null bytes longer (the empty play count). I even manually fixed the frame
 length and removed the trailing 4 null bytes, but WMP still did not read
 the tags.

 With your Mutagen patch at least Picard can read the WMP tags.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:1>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by murdos):

 It's a bit off topic, but you might be interested by a discussion that is
 happening between the main open-source players about the best way to store
 ratings. It has been mentioned there:
 https://bugzilla.gnome.org/show_bug.cgi?id=532650#c36 and then discussion
 moved somewhere else (just ask on the hijacked ticket and I'm sure you'll
 get the information).

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:2>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by outsidecontext):

 @murdos: Thanks for the pointer. Very interesting and important. Picard
 should be involved in this.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:3>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 ID3v2 specifies a frame called "Popularimeter" (or POPM) which holds three
 values:
 1) A unique string which identifies the creator of the tag
     Examples: "Banshee" (used by this patch), "Windows Media Player 9
 Series"
 (used by WMP and Vista's Windows Explorer), "no@email" (used by
 MediaMonkey)
 2) A rating between 0-255 (0=unrated, 1=worst, 255=best)
 3) A play count

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:4>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 [MM3.1.0.1256's POPM and Rating]

 POPM=0 → Rating=0
 POPM=1 → Rating=1
 POPM=2-8 → Rating=0
 POPM=9-18 → Rating=0.5
 POPM=19-28 → Rating=1 (MM2.5:Rating=0.5 → POPM=28) (MM3.0:Rating=0.5 →
 POPM=26)
 POPM=29 → Rating=1.5
 POPM=30-39 → Rating=0.5
 POPM=40-49 → Rating=1
 POPM=50-59 → Rating=1.5 (MM2.5:Rating=1 → POPM=53) (MM3.0:Rating=1 →
 POPM=51)
 POPM=60-69 → Rating=2
 POPM=70-90 → Rating=1.5
 POPM=91-113 → Rating=2
 POPM=114-123 → Rating=2.5
 POPM=124-133 → Rating=3 (MM2.5:Rating=2.5 → POPM=129) (MM3.0:Rating=2.5 →
 POPM=128)
 POPM=134-141 → Rating=2.5
 POPM=142-167 → Rating=3
 POPM=168-191 → Rating=3.5
 POPM=192-218 → Rating=4
 POPM=219-247 → Rating=4.5
 POPM=248-255 → Rating=5


 [WMP11's Rating and POPM]

 Raing=0 → POPM=0
 Raing=1 → POPM=1
 Raing=2 → POPM=64
 Raing=3 → POPM=128
 Raing=4 → POPM=196
 Raing=5 → POPM=255

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:5>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 we'll also have to have our popm values mapped correctly
 I suggest we go with wmp11 for writing,
 it's simple to have those in binary values
 0000 0000 = 0
 0000 0001 = 1
 0100 0000 = 64
 1000 0000 = 128
 1100 0000 = 196
 1111 1111 = 255

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:6>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 POPM=0,2-8 → Rating=0

 POPM=1,9-28,30-49,50-53 → Rating=1

 POPM=29,54-59,60-113 → Rating=2

 POPM=114-167 → Rating=3

 POPM=168-218 → Rating=4

 POPM=219-255 → Rating=5

 This should be our reading list.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:7>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 oops... 196 : 1100 0100

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:8>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 we write:
 ~211 for rating -> 5
 ~169 for rating -> 4
 ~126 for rating -> 3
 ~84 for rating -> 2
 ~41 for rating -> 1

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:9>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 so this would be our compat list so far:
 POPM=0,2-8 → Rating=0

 POPM=1,9-28,30-49,50-53 → Rating=1

 POPM=29,54-59,60-113 → Rating=2

 POPM=114-167 → Rating=3

 POPM=168-210 → Rating=4

 POPM=211-255 → Rating=5

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:10>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 [http://www.mediamonkey.com/forum/viewtopic.php?f=7&t=40532&p=226587]

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:11>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by outsidecontext):

 I think those lists are a completely different issue and not related to
 the problem with reading the POPM tag. We currently map the ratings in a
 linear way.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:12>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 In a linear way? No, we aren't really caring about other apps that will
 use the rating set. There is no way to write perfectly linear values. All
 of ours are weird and rounded up. Besides, we aren't even conforming to
 the ID3v2 spec! to quote: "The email is a terminated string. '''The rating
 is 1-255 where 1 is worst and 255 is best'''. 0 is unknown. If no personal
 counter is wanted it '''may be omitted'''. When the counter reaches all
 one's, one byte is inserted in front of the counter thus making the
 counter eight bits bigger in the same away as the play counter ("PCNT").
 There may be more than one "POPM" frame in each tag, but only one with the
 same email address. "

 so, you may agree with me that 255 == 5 star. 1 == 1 star. Using my table
 to read ratings mean:
 1. We read the right rating, whether written by us or Media Monkey, or a
 MS app.
 2. Sticking to WMP11 ratings means lesser compatibility issues. Later on
 we can figure out which values are used by other apps and update this
 list.
 3. The MS values are more or less linear too:
 255-59 = 196
 196-68 = 128
 128-64 =  64
 64-63  =   1
 Since those values are 2^whatever rounded, this makes sense.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:13>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 ok, not exactly 2^watever rounded. but since we need to alter our
 algorithm a little:
 so to get the right rating as per id3 spec:
 if rating > 0:
     value = int((rating-1)*254/4+1)
 else
     value = 0

 This produces: PERFECTLY LINEAR VALUES.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:14>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 >>> int(4*254/4+1)
 255
 >>> int(3*254/4+1)
 191
 >>> int(2*254/4+1)
 128
 >>> int(1*254/4+1)
 64
 >>> int(0*254/4+1)
 1

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:15>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by outsidecontext):

 Just to get that clear: The current implementation also matches the
 ratings in a linear way, but it matches the ratings 0-5 to 0-255 (doesn't
 give round values, but results in the ints 0, 51, 102, 153, 204, 255).
 Your (or WMP's) implementation treat 0 as a special case (according to the
 spec it is) and match the ratings 1-5 linearly to 1-255.

 But makes more sense this way, you are right. Reading would then be done
 accordingly with:
 rating = round(value / 254 * 4 + 1)

 Unfortunately with this shift the old values for ratings 1 and 2 would be
 read as 2 and 3. Let's see what the discussion in the above banshee ticket
 will bring, if possible we should conform whatever gets decided there.

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:16>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 banshee code:
 +        // Converts Banshee rating to ID3v2 POPM rating
 +        private static byte BansheeToPopm (int banshee_rating)
 +        {
 +            switch (banshee_rating) {
 +            case 1:
 +                return 0x1;
 +            case 2:
 +                return 0x40;// 64
 +            case 3:
 +                return 0x80;// 128
 +            case 4:
 +                return 0xC0;// 192
 +            case 5:
 +                return 0xFF;// 255
 +            default:
 +                return 0x0;// unrated/unknown
 +            }
 +        }
 +

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:17>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs

Re: [mb-bugs] [MusicBrainz Bug Tracker] #5471: POPM tags and Windows

by MusicBrainz Bug Tracker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#5471: POPM tags and Windows
----------------------------+-----------------------------------------------
  Reporter:  nxisgod        |       Owner:  nxisgod
      Type:  bug            |      Status:  new    
  Priority:  normal         |   Milestone:        
 Component:  Picard Tagger  |     Version:        
Resolution:                 |    Keywords:        
        Os:                 |     Browser:        
----------------------------+-----------------------------------------------
Comment (by nxisgod):

 +        // What we call ourselves in POPM tags.
 +        private static string POPM_our_creator_name = "Banshee";
 +
 +        // Ordered list of ID3v2 POPM authors to attempt when importing.
 +        // Banshee must be listed first, to ensure that we give priority
 to our own ratings.
 +        // If new entries are added to this list, also make sure that
 +        // PopmToBanshee and BansheeToPopm are still accurate.
 +        private static string[] POPM_known_creator_list = {
 +            POPM_our_creator_name,// This item must be first
 +            "quodlibet@...",// Quod Libet (their
 default)
 +            "Windows Media Player 9 Series",// WMP/Vista
 +            "no@email",// MediaMonkey
 +            "mcored@..." // iTSfv
 +        };
 +
 +        // Converts ID3v2 POPM rating to Banshee rating
 +        private static int PopmToBanshee (byte popm_rating)
 +        {
 +            // The following schemes are used by the other POPM-
 compatible players:
 +            // WMP/Vista: "Windows Media Player 9 Series" ratings:
 +            //   1 = 1, 2 = 64, 3=128, 4=196 (not 192), 5=255
 +            // MediaMonkey: "no@email" ratings:
 +            //   0.5=26, 1=51, 1.5=76, 2=102, 2.5=128,
 +            //   3=153, 3.5=178, 4=204, 4.5=230, 5=255
 +            // Quod Libet: "quodlibet@..." ratings
 +            //   (but that email can be changed):
 +            //   arbitrary scale from 0-255
 +            // Compatible with all these rating scales (what we'll use):
 +            //   unrated=0, 1=1-63, 2=64-127, 3=128-191, 4=192-254, 5=255
 +            if (popm_rating == 0x0)// unrated
 +                return 0;
 +            if (popm_rating < 0x40)// 1-63
 +                return 1;
 +            if (popm_rating < 0x80)// 64-127
 +                return 2;
 +            if (popm_rating < 0xC0)// 128-191
 +                return 3;
 +            if (popm_rating < 0xFF)// 192-254
 +                return 4;
 +            return 5;// 255
 +        }
 +
 +        // Converts Banshee rating to ID3v2 POPM rating
 +        private static byte BansheeToPopm (int banshee_rating)
 +        {
 +            switch (banshee_rating) {
 +            case 1:
 +                return 0x1;
 +            case 2:
 +                return 0x40;// 64
 +            case 3:
 +                return 0x80;// 128
 +            case 4:
 +                return 0xC0;// 192
 +            case 5:
 +                return 0xFF;// 255
 +            default:
 +                return 0x0;// unrated/unknown
 +            }
 +        }

--
Ticket URL: <http://bugs.musicbrainz.org/ticket/5471#comment:18>
MusicBrainz Bug Tracker <http://musicbrainz.org>
MusicBrainz -- the music metadatabase
_______________________________________________
Musicbrainz-bugs mailing list
Musicbrainz-bugs@...
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-bugs