Lisp HUG Maillist Archive

LWM Objc question

Hello,

Is it possible to get a numeric 64 bit value from objective-c (for instance
:long-long) ? Many structures use this kind of value but the "invoke" and
"invoke-into" functions don't accept it ("raw64 not yet implemented")...
Does it exist an alternative ?

Thanks by advance

Denis



-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------


Re: LWM Objc question

Unable to parse email body. Email id is 6826

Re: LWM Objc question

Re: LWM Objc question Here is an example of the problem :

(fli:register-module :QTKit
                 :real-name "/System/Library/Frameworks/QTKit..framework/QTKit"
                 :connection-style :immediate)


(defvar *QTmovie-path* "foo.mov") ;<-- a path to a Quicktime Movie
(defvar *QTmovie* nil)

;this create the Quicktime Movie Pane
(defvar *QTmovie-pane*
  (capi:contain (make-instance
            'capi:cocoa-view-pane :view-class "QTMovieView"
            :init-function #'(lambda (pane view) (declare (ignore pane))
                               (setf view (objc:invoke view "initWithFrame:" (coerce (list 0 0 400 300) 'vector)))
                               (let ((movie (objc:invoke "QTMovie" "movie")))
                                 (setf *QTmovie* (objc:invoke movie "initWithFile:error:" *QTmovie-path* nil))
                                 (objc:invoke view "setMovie:" *QTmovie*)
                                 (objc:invoke view "setPreservesAspectRatio:" t)
                                 view)))))

;play and stop programmaticaly
(objc:invoke *QTmovie* "play")
(objc:invoke *QTmovie* "stop")

;the problem is here (to get the current time code):

(objc:invoke *QTmovie* "currentTime")

;the method return a QTTime structure of this type :

(objc:define-objc-struct (QTTime (:foreign-name "QTTime"))
   (timeValue :long-long)
   (timeScale :long)
   (flags :long))

;so I try with invoke-into, but the problem is the same :

(fli:with-dynamic-foreign-objects ((ptr QTTime))
  (objc:invoke-into ptr *QTmovie* "currentTime"))


;this other method need a QTTime structure as his only argument (to set the time code)

(fli:with-dynamic-foreign-objects ((ptr QTTime))
    (setf (fli:foreign-slot-value ptr 'timeValue) 0) ;<-- impossible to set the :long-long slot of the structure
   (objc:invoke *QTmovie* "setCurrentTime" ptr))


Best

Denis

Le 20/07/07 21:23, « [NOM] » <[ADRESSE]> a écrit :

>
>>>>>> On Fri, 20 Jul 2007 16:19:27 +0200, Denis Pousseur said:
>>
>> Hello,
>>
>> Is it possible to get a numeric 64 bit value from objective-c (for instance
>> :long-long) ? Many structures use this kind of value but the "invoke" and
>> "invoke-into" functions don't accept it ("raw64 not yet implemented")...
>> Does it exist an alternative ?
>
> Do you have an example interface and method?  Which processor are you using?
>
> Calling NSNumber's longLongValue method worked for me on an Intel Mac.

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------
Updated at: 2020-12-10 08:45 UTC