Results 1 to 2 of 2

Thread: Fixes for OMLinPlayer

  1. #1
    Variable Bitrate
    Join Date
    Jun 2008
    Location
    Seattle, WA
    Posts
    365

    Fixes for OMLinPlayer

    This patch addresses a problem where the metadata wouldn't be displayed at the top of the screen, nor the current position or duration.

    Code:
    Index: MyClass.cs
    ===================================================================
    --- MyClass.cs  (revision 627)
    +++ MyClass.cs  (working copy)
    @@ -75,19 +75,21 @@
             }
     
             MainLoop loop;
    -        public bool play (int instance, string url, OpenMobile.eMediaType type)
    +        public bool play (int instance, string location, OpenMobile.eMediaType type)
             {
                 error=false;
                 stop(instance);
    +            string url;
                 switch(type)
                 {
                     case eMediaType.Local:
    -                    url="file://"+url;
    +                    url="file://"+location;
                         break;
                     case eMediaType.DVD:
                         url="dvd://";
                         break;
                     case eMediaType.AudioCD:
    +                    url=location;
                         break;
                     default:
                         return false;
    @@ -105,9 +107,9 @@
                 player.SetState(State.Playing);
                 if (type==eMediaType.Local)
                 {
    -                nowPlaying=TagReader.getInfo(url);
    +                nowPlaying=TagReader.getInfo(location);
                     if (nowPlaying == null)
    -                    nowPlaying = new mediaInfo(url);
    +                    nowPlaying = new mediaInfo(location);
                     nowPlaying.Type = eMediaType.Local;
                     if (nowPlaying.coverArt == null)
                         nowPlaying.coverArt = TagReader.getCoverFromDB(nowPlaying.Artist, nowPlaying.Album, theHost);
    @@ -115,7 +117,7 @@
                         nowPlaying.coverArt = TagReader.getFolderImage(nowPlaying.Location);
                     if (nowPlaying.coverArt == null)
                         nowPlaying.coverArt = TagReader.getLastFMImage(nowPlaying.Artist, nowPlaying.Album);
    -                if (nowPlaying.Length==0)
    +                if (nowPlaying.Length<=0)
                         setDuration();
                 }else
                 {
    @@ -128,7 +130,7 @@
                     }
                     if (nowPlaying==null)
                         nowPlaying=new mediaInfo(url);
    -                if (nowPlaying.Length==0)
    +                if (nowPlaying.Length<=0)
                         setDuration();
                     if (string.IsNullOrEmpty(nowPlaying.Name))
                         nowPlaying.Name=url;
    The main problem was TagLib doesn't like "file://" at the beginning of filenames. Also, nowPlaying.Length would be -1, not 0 in that case, causing setDuration to not be called. So I changed the == 0 comparison to <= 0.

    -- Kevin

  2. #2
    Maximum Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    443
    Nice, thanks again. I'll update the code.
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

Similar Threads

  1. RR 07-03-05 .. Fixes ...
    By guino in forum Road Runner
    Replies: 35
    Last Post: 07-16-2005, 02:21 PM
  2. RR 06-21-05 ... Improvements and Fixes..
    By guino in forum Road Runner
    Replies: 32
    Last Post: 06-28-2005, 11:35 AM
  3. RR 03-02-05... Fixes only..
    By guino in forum Road Runner
    Replies: 77
    Last Post: 03-07-2005, 01:18 PM
  4. RR 2-20-05 ... Bug Fixes ...
    By guino in forum Road Runner
    Replies: 123
    Last Post: 03-01-2005, 01:27 AM
  5. Fixes your LCD issues... well, some.
    By Gruneun in forum LCD/Display
    Replies: 0
    Last Post: 01-18-2002, 07:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •