     public var playerDidStart: function?
     public var playerDidStop: function?
 
+    // Delegate
+    weak var delegate: ColiseuPlayerDelegate? {
+        willSet {
+            let viewController = newValue as! UIViewController
+
+            if newValue == nil {
+                UIApplication.sharedApplication().endReceivingRemoteControlEvents()
+                viewController.resignFirstResponder()
+            }
+            else {
+                UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
+                viewController.becomeFirstResponder()
+            }
+        }
+    }
+
     public override init()
     {
         // Inherited


    internal func remoteControlInfo(song: AudioFile)
    {
        // Remote Control info - ?
        let songInfo = [MPMediaItemPropertyTitle: "Coliseu",
            MPMediaItemPropertyArtist: song.title,
            //MPNowPlayingInfoPropertyElapsedPlaybackTime:  time + 30,
            MPMediaItemPropertyPlaybackDuration: audioPlayer!.duration] as [String : AnyObject]

        MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo = songInfo

        }
        self.audioPlayer!.delegate = self
        self.audioPlayer!.prepareToPlay()

        remoteControlInfo(song)

