Skip to content

Commit

Permalink
Create a gst-object% base class for other gst objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Sep 25, 2017
1 parent ffca81d commit c96c04a
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions gstreamer/gst.rkt
@@ -1,7 +1,37 @@
#lang racket/base

(require ffi/unsafe/introspection)
(require (except-in ffi/unsafe/introspection
send get-field set-field! field-bound? is-a? is-a?/c)
racket/class
racket/contract)

(provide gst)
(provide (contract-out [gst
gi-repository?]
[gst-object%
(class/c
[get-name
(->m string?)]
[get-parent
(->m (or/c gobject? #f))]
[has-as-parent?
(->m gobject? boolean?)]
[get-path-string
(->m string?)])]
[gst-version
(-> string?)]))

(define gst (introspection 'Gst))

(define gst-object-mixin
(make-gobject-delegate get-name
get-parent
[has-as-parent? 'has_as_parent]
get-path-string))

(define gst-object%
(class (gst-object-mixin gobject%)
(super-new)
(inherit-field pointer)))

(define gst-version
(gst 'version_string))

0 comments on commit c96c04a

Please sign in to comment.