-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsteamvideo.lisp
25 lines (20 loc) · 1.21 KB
/
steamvideo.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(in-package #:org.shirakumo.fraf.steamworks)
(defclass steamvideo (interface)
())
(defmethod initialize-instance :after ((interface steamvideo) &key (version T) steamworks)
(setf (handle interface) (get-interface-handle steamworks 'steam::client-get-isteam-video
(handle (user steamworks)) (handle (pipe steamworks))
(t-or version STEAM::STEAMVIDEO-INTERFACE-VERSION))))
(define-interface-method steamvideo request-opf-settings (steam::video-get-opfsettings id))
(define-interface-method steamvideo request-video-url (steam::video-get-video-url id))
(defmethod viewer-count ((video steamvideo))
(cffi:with-foreign-object (count :int)
(if (steam::video-is-broadcasting (handle video) count)
(cffi:mem-ref count :int)
0)))
(defmethod opf-string ((video steamvideo) id)
(cffi:with-foreign-object (size :int32)
(setf (cffi:mem-ref size :int32) 0)
(steam::video-get-opfstring-for-app (handle video) id (cffi:null-pointer) size)
(cffi:with-foreign-object (buffer :char (cffi:mem-ref size :int32))
(with-invalid-check NIL (steam::video-get-opfstring-for-app (handle video) id buffer size)))))