playTrack on SDK in GUI app?

Discussion in 'iOS Development' started by allbrokeup, Oct 19, 2008.

  1. allbrokeup

    allbrokeup New Member

    Joined:
    Mar 7, 2008
    Messages:
    51
    Likes Received:
    0
    Could someone post instructions on how to implement the source code to SkylarEC's playTrack into an SDK-based app, and have buttons to send those functions to the binary on your device? It would be fantastic and a wonderful way to really pee-off Apple by controlling MobileMusicPlayer in an "UnAppleThentic" way.

    Please Register or Log in to view images

    Please Register or Log in to view images

    Please Register or Log in to view images



    Pretty, Pwetty, Pweeeeze?

    Cheers!
  2. Nickll9009

    Nickll9009 New Member

    Joined:
    Sep 19, 2007
    Messages:
    1,367
    Likes Received:
    8
    Device:
    iPod touch
    There is, but don't make an app that does this. PwnPlayer + A bunch of other apps already do this, and PwnPlayer will be 10x better than any app made that has 3 functions.
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    i believe that "playTrack" is linked against SkylarEC's PocketTouch framework. so unless you want to have your app dependant on that framework, you will have to write code yourself. however, if you are comfortable with linking against his framework, then i believe he has made his headers available for it
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    just wondering how do you create a framework
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    at your stage, there is no need for one. but just for knowledge, a framework is a dynamic library ||basically||.
  6. allbrokeup

    allbrokeup New Member

    Joined:
    Mar 7, 2008
    Messages:
    51
    Likes Received:
    0
    Thanks, I would really like some help on creating an app that has Play, Pause, Back, Next or whatever, strictly for personal use after a bad experience with a repo and some pretty mean emails. I can't upload it to AppStore cause I can't afford it. (Only 14 people

    Please Register or Log in to view images

    Please Register or Log in to view images

    )...

    Soo, a tutorial on what to implement and where? please? thanks....

    Please Register or Log in to view images



    Cheers!
  7. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    It wouldn't work because you'd also have to distribute the playTrack binary and the PocketTouch framework with the AppStore application, and that is a huge NO from Apple. Plus, even if it were okay, the framework would need to be recompiled to work within the application bundle, as opposed to its location in the frameworks directory. [Hex editing it would be just as effective, and just as easy, if you want to go that route]


    playTrack is open source, feel free to expand it as you will. The PocketTouch framework can do /most/ everything that the app does. I put as much of PocketTouch into the framework as possibly, but the app itself has to handle some of the work, such as touch events. Work those out, allot for all the options PocketTouch has, and someone could rebuild PocketTouch very easily using the framework I've set up.


    http://www.touchrepo.com/source/


    You create a framework the same way you create an app, you just have to compile it as a dynamic code, and be WAY more tight with the memory usage.



    If you're creating the app for yourself:
    1. If you haven't already, download the PocketTouch framework from within Cydia. You don't need to download the app as well.
    2. Download the headers for the PocketTouch framework and place them with the rest of your headers, in a directory called PocketTouch.
    3. In your app, create a PTMusicController object.
    4. In your code, create a bunch of buttons.
    5. Assign those buttons selectors using their action property.
    6. Within those selectors, have the music controller do its thing. ex:
      Code:
      [musicController playNextTrack]; //Whereas musicController is your PTMusicController object
  8. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Thanks skylar your great
  9. allbrokeup

    allbrokeup New Member

    Joined:
    Mar 7, 2008
    Messages:
    51
    Likes Received:
    0
    Hey thanks, just one little thing...

    Im using the SDK, so, this is what I did:

    Imported the PocketTouch Headers into my App. Created an Object in Interface Builder called PTMusicController. Added 4 actions, Play Pause Back and Next.

    Wrote class files into Xcode

    Opened up Xcode and added the [PTMusicController playNextTrack]; tidbit and changed it for Back with [PTMusicController playPreviousTrack]; in the Back action.

    When I compile for either iPhoneOS or iPhoneSimulator, I get two warnings:

    Warning: PTMusicController may not respond to +playNextTrack!
    Warning: PTMusicController may not respond to +playPreviousTrack!

    Is there something I am doing wrong? If it's for the toolchain, then thats why

    Please Register or Log in to view images

    ....


    Cheers!
  10. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    warnings appear for almost everything compiling it with the toolchain as long as you dont get anything with error: then it should be fine!

Share This Page