1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 /* 25 * Conversion parameters: 26 * inFile = GstSystemClock.html 27 * outPack = gstreamer 28 * outFile = SystemClock 29 * strct = GstSystemClock 30 * realStrct= 31 * ctorStrct= 32 * clss = SystemClock 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_system_clock_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gstreamer.Clock 48 * structWrap: 49 * - GstClock* -> Clock 50 * - GstSystemClock* -> SystemClock 51 * module aliases: 52 * local aliases: 53 * overrides: 54 */ 55 56 module gstreamer.SystemClock; 57 58 public import gstreamerc.gstreamertypes; 59 60 private import gstreamerc.gstreamer; 61 private import glib.ConstructionException; 62 private import gobject.ObjectG; 63 64 65 private import glib.Str; 66 private import gstreamer.Clock; 67 68 69 70 private import gstreamer.Clock; 71 72 /** 73 * Description 74 * The GStreamer core provides a GstSystemClock based on the system time. 75 * Asynchronous callbacks are scheduled from an internal thread. 76 * Clock implementors are encouraged to subclass this systemclock as it 77 * implements the async notification. 78 * Subclasses can however override all of the important methods for sync and 79 * async notifications to implement their own callback methods or blocking 80 * wait operations. 81 * Last reviewed on 2006-03-08 (0.10.4) 82 */ 83 public class SystemClock : Clock 84 { 85 86 /** the main Gtk struct */ 87 protected GstSystemClock* gstSystemClock; 88 89 90 public GstSystemClock* getSystemClockStruct() 91 { 92 return gstSystemClock; 93 } 94 95 96 /** the main Gtk struct as a void* */ 97 protected override void* getStruct() 98 { 99 return cast(void*)gstSystemClock; 100 } 101 102 /** 103 * Sets our main struct and passes it to the parent class 104 */ 105 public this (GstSystemClock* gstSystemClock) 106 { 107 super(cast(GstClock*)gstSystemClock); 108 this.gstSystemClock = gstSystemClock; 109 } 110 111 protected override void setStruct(GObject* obj) 112 { 113 super.setStruct(obj); 114 gstSystemClock = cast(GstSystemClock*)obj; 115 } 116 117 /** 118 */ 119 120 /** 121 * Get a handle to the default system clock. The refcount of the 122 * clock will be increased so you need to unref the clock after 123 * usage. 124 * Returns: the default clock. MT safe. 125 */ 126 public static Clock obtain() 127 { 128 // GstClock* gst_system_clock_obtain (void); 129 auto p = gst_system_clock_obtain(); 130 131 if(p is null) 132 { 133 return null; 134 } 135 136 return ObjectG.getDObject!(Clock)(cast(GstClock*) p); 137 } 138 }