Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Neodym
  1.    #1  
    Hi guys,

    I hacked together a sleep timer feature for the stock musicplayer app, which pauses the player after a given time. No shutdown, no standby - just pause the current song.
    The patch is a bit messy, but it works on my Touchpad with WebOS 3.0.5 and the unpatched com.palm.app.musicplayer version 3.0.8000.

    Before applying this patch in /media/cryptofs/apps/usr/palm/applications/com.palm.app.musicplayer, please make a backup in case it screws your app up.
    This is my first patch, so there's no guarantee.

    Implementation details:
    I first tried to use window.setTimeout but this only did the job when the musicplayer was still focused.
    Then I set an alarm which worked quite well as long as the window did not have the focus.
    The patch now combines these approaches.

    Bugs:
    I suppose that if the device is shut off or powers down while the sleep timer is enabled, then the player will launch when it is powered on again. This is due to the fact, that in this case the alarm is still active. I have logic in place to prevent this, but there is something wrong with it as I had to bypass the check to make it work.

    I am sorry, but as my time is quite limited I will probably not do much support.
    Therefore, please feel free to improve or modify the patch!

    Sincerely yours,
    Neodym
    Attached Images Attached Images
    Attached Files Attached Files
    carldc likes this.
  2. carldc's Avatar
    Posts
    441 Posts
    Global Posts
    508 Global Posts
    #2  
    Great idea!

    Two suggestions for you or whoever might run with this:
    1) Stop play rather than pause (or even better -- select stop or pause); and
    2) A patch for webOS 2.x (i.e. phones).

    Kudos for your efforts!
    -carldc

    m500>T3>T|X>Treo 755p>Pre>Pixi>Pre 3>Galaxy S4 Mini>Galaxy Alpha>Galaxy S8
    ..........................................TouchPad............Surface Pro
    PalmOS-------------------webOS-------------------Android (just waiting for webOS to rise again!)

Tags for this Thread

Posting Permissions