[haiku-development] Re: New Diff to Media player

> Fredrik Modéen <fredrik@xxxxxxxxx> wrote:
>> I hope my diffs aren't to small and that I should wait until making
>> more
>> changes.
>
> +/*static*/ BString
> +Playlist::_ReturnMiMEString(const BEntry *entry)
> +{
> +     BFile file(entry, B_READ_ONLY);
> +     BNodeInfo nodeInfo(&file);
> +     char mimeString[B_MIME_TYPE_LENGTH];
> +     if (nodeInfo.GetType(mimeString) == B_OK)
> +             return BString(mimeString);
> +     else
> +             return NULL;
> +}
>
> Three things:
> 1) it's either MIME or Mime, but not MiME - it stands for Multipurpose
> Internet Mail Extensions
> 2) You didn't take the GuessMimeType() into account as I proposed
> earlier; this would prevent the player from accepting files on CDs and
> DVDs, for example.
> 3) it makes more sense to pass a BString reference to this method, as
> you'll then save an unnecessary copy.
and perhaps to _IsMedia and _IsPlayList aswell as I only are sending them
to ReturnMIMEString.

My Question are if making a BString are better than sending an existing
entry_ref? I need the path to the file and the only way I found getting
that was to make a BPath() and then call Path() to get a string. Can
change
ReturnMIMEString,  _IsMedia and _IsPlayList to take const char* insted of
a BString.

>
> Bye,
>    Axel.
>
>
>


-- 
MVH
Fredrik Modéen



Other related posts: