clock.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GSTREAMERMM_CLOCK_H
00004 #define _GSTREAMERMM_CLOCK_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00010 
00011 /* gstreamermm - a C++ wrapper for gstreamer
00012  *
00013  * Copyright 2008 The gstreamermm Development Team
00014  *
00015  * This library is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU Library General Public
00017  * License as published by the Free Software Foundation; either
00018  * version 2 of the License, or (at your option) any later version.
00019  *
00020  * This library is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00023  * Library General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU Library General Public
00026  * License along with this library; if not, write to the Free
00027  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00028  */
00029 
00030 #include <gst/gstclock.h>
00031 #include <gstreamermm/object.h>
00032 
00033 
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GstClock GstClock;
00036 typedef struct _GstClockClass GstClockClass;
00037 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00038 
00039 
00040 namespace Gst
00041 { class Clock_Class; } // namespace Gst
00042 namespace Gst
00043 {
00044 
00045 class Clock;
00046 
00049 typedef GstClockTime ClockTime;
00050 
00053 typedef GstClockTimeDiff ClockTimeDiff;
00054 
00057 const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
00058 
00061 const ClockTime SECOND = GST_SECOND;
00062 
00065 const ClockTime MILLI_SECOND = GST_MSECOND;
00066 
00069 const ClockTime MICRO_SECOND = GST_USECOND;
00070 
00073 const ClockTime NANO_SECOND = GST_NSECOND;
00074 
00080 enum ClockEntryType
00081 {
00082   CLOCK_ENTRY_SINGLE,
00083   CLOCK_ENTRY_PERIODIC
00084 };
00085 
00086 } // namespace Gst
00087 
00088 
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090 namespace Glib
00091 {
00092 
00093 template <>
00094 class Value<Gst::ClockEntryType> : public Glib::Value_Enum<Gst::ClockEntryType>
00095 {
00096 public:
00097   static GType value_type() G_GNUC_CONST;
00098 };
00099 
00100 } // namespace Glib
00101 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00102 
00103 
00104 namespace Gst
00105 {
00106 
00110 enum ClockReturn
00111 {
00112   CLOCK_OK,
00113   CLOCK_EARLY,
00114   CLOCK_UNSCHEDULED,
00115   CLOCK_BUSY,
00116   CLOCK_BADTIME,
00117   CLOCK_ERROR,
00118   CLOCK_UNSUPPORTED
00119 };
00120 
00121 } // namespace Gst
00122 
00123 
00124 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00125 namespace Glib
00126 {
00127 
00128 template <>
00129 class Value<Gst::ClockReturn> : public Glib::Value_Enum<Gst::ClockReturn>
00130 {
00131 public:
00132   static GType value_type() G_GNUC_CONST;
00133 };
00134 
00135 } // namespace Glib
00136 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00137 
00138 
00139 namespace Gst
00140 {
00141 
00145 enum ClockFlags
00146 {
00147   CLOCK_FLAG_CAN_DO_SINGLE_SYNC = GST_OBJECT_FLAG_LAST << 0,
00148   CLOCK_FLAG_CAN_DO_SINGLE_ASYNC = GST_OBJECT_FLAG_LAST << 1,
00149   CLOCK_FLAG_CAN_DO_PERIODIC_SYNC = GST_OBJECT_FLAG_LAST << 2,
00150   CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC = GST_OBJECT_FLAG_LAST << 3,
00151   CLOCK_FLAG_CAN_SET_RESOLUTION = GST_OBJECT_FLAG_LAST << 4,
00152   CLOCK_FLAG_CAN_SET_MASTER = GST_OBJECT_FLAG_LAST << 5,
00153   CLOCK_FLAG_LAST = GST_OBJECT_FLAG_LAST << 8
00154 };
00155 
00156 } // namespace Gst
00157 
00158 
00159 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00160 namespace Glib
00161 {
00162 
00163 template <>
00164 class Value<Gst::ClockFlags> : public Glib::Value_Enum<Gst::ClockFlags>
00165 {
00166 public:
00167   static GType value_type() G_GNUC_CONST;
00168 };
00169 
00170 } // namespace Glib
00171 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00172 
00173 
00174 namespace Gst
00175 {
00176 
00177 
00181 class ClockID
00182 {
00183   public:
00184 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00185   typedef ClockID CppObjectType;
00186   typedef GstClockEntry BaseObjectType;
00187 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00188 
00189 
00190   // For use with Glib::RefPtr<> only.
00191   void reference()   const;
00192   void unreference() const;
00193 
00195   GstClockEntry*       gobj();
00196 
00198   const GstClockEntry* gobj() const;
00199 
00201   GstClockEntry* gobj_copy() const;
00202 
00203 protected:
00204   // Do not derive this.  Gst::ClockID can neither be constructed nor deleted.
00205   ClockID();
00206   void operator delete(void*, size_t);
00207 
00208 private:
00209   // noncopyable
00210   ClockID(const ClockID&);
00211   ClockID& operator=(const ClockID&);
00212 
00213 
00214 public:
00220   typedef sigc::slot< bool, const Glib::RefPtr<Clock>&, ClockTime, const Glib::RefPtr<ClockID>& > SlotClock;
00221 
00222   
00228   ClockTime get_time() const;
00229 
00230   
00252   ClockReturn wait(ClockTimeDiff& jitter);
00253   ClockReturn wait();
00254 
00263   ClockReturn wait_async(const SlotClock& slot);
00264 
00265   
00273   void unschedule();
00274 
00275 
00276 };
00277 
00282 guint get_hours(ClockTime time);
00283 
00288 guint get_minutes(ClockTime time);
00289 
00294 guint get_seconds(ClockTime time);
00295 
00300 guint get_milliseconds(ClockTime time);
00301 
00306 guint get_microseconds(ClockTime time);
00307 
00312 guint get_nanoseconds(ClockTime time);
00313 
00318 guint get_fractional_seconds(ClockTime time);
00319 
00395 class Clock : public Object
00396 {
00397   
00398 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00399 
00400 public:
00401   typedef Clock CppObjectType;
00402   typedef Clock_Class CppClassType;
00403   typedef GstClock BaseObjectType;
00404   typedef GstClockClass BaseClassType;
00405 
00406 private:  friend class Clock_Class;
00407   static CppClassType clock_class_;
00408 
00409 private:
00410   // noncopyable
00411   Clock(const Clock&);
00412   Clock& operator=(const Clock&);
00413 
00414 protected:
00415   explicit Clock(const Glib::ConstructParams& construct_params);
00416   explicit Clock(GstClock* castitem);
00417 
00418 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00419 
00420 public:
00421   virtual ~Clock();
00422 
00423 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00424   static GType get_type()      G_GNUC_CONST;
00425   static GType get_base_type() G_GNUC_CONST;
00426 #endif
00427 
00429   GstClock*       gobj()       { return reinterpret_cast<GstClock*>(gobject_); }
00430 
00432   const GstClock* gobj() const { return reinterpret_cast<GstClock*>(gobject_); }
00433 
00435   GstClock* gobj_copy();
00436 
00437 private:
00438 
00439 
00440 public:
00441   
00460   bool add_observation(ClockTime slave_time, ClockTime master_time, gdouble* result);
00461   
00479   bool set_master(const Clock& master_clock);
00480   
00488   Glib::RefPtr<Clock> get_master();
00489   
00498   ClockTime set_resolution(ClockTime resolution);
00499   
00506   ClockTime get_resolution() const;
00507   
00516   ClockTime get_time() const;
00517   
00526   Glib::RefPtr<ClockID> create_single_shot_id(ClockTime time);
00527   
00538   Glib::RefPtr<ClockID> create_periodic_id(ClockTime start_time, ClockTime intervals);
00539   
00547   ClockTime get_internal_time() const;
00548   
00558   ClockTime adjust_unlocked(ClockTime internal_time);
00559   
00571   ClockTime unadjust_unlocked(ClockTime external_time);
00572   
00585   void get_calibration(ClockTime& internal, ClockTime& external, ClockTime& rate_num, ClockTime& rate_denom);
00586   
00616   void set_calibration(ClockTime internal, ClockTime external, ClockTime rate_num, ClockTime rate_denom);
00617   
00618 
00619   #ifdef GLIBMM_PROPERTIES_ENABLED
00620 
00626   Glib::PropertyProxy<bool> property_stats() ;
00627 #endif //#GLIBMM_PROPERTIES_ENABLED
00628 
00629 #ifdef GLIBMM_PROPERTIES_ENABLED
00630 
00636   Glib::PropertyProxy_ReadOnly<bool> property_stats() const;
00637 #endif //#GLIBMM_PROPERTIES_ENABLED
00638 
00639   #ifdef GLIBMM_PROPERTIES_ENABLED
00640 
00646   Glib::PropertyProxy<guint64> property_timeout() ;
00647 #endif //#GLIBMM_PROPERTIES_ENABLED
00648 
00649 #ifdef GLIBMM_PROPERTIES_ENABLED
00650 
00656   Glib::PropertyProxy_ReadOnly<guint64> property_timeout() const;
00657 #endif //#GLIBMM_PROPERTIES_ENABLED
00658 
00659   #ifdef GLIBMM_PROPERTIES_ENABLED
00660 
00666   Glib::PropertyProxy<int> property_window_size() ;
00667 #endif //#GLIBMM_PROPERTIES_ENABLED
00668 
00669 #ifdef GLIBMM_PROPERTIES_ENABLED
00670 
00676   Glib::PropertyProxy_ReadOnly<int> property_window_size() const;
00677 #endif //#GLIBMM_PROPERTIES_ENABLED
00678 
00679   #ifdef GLIBMM_PROPERTIES_ENABLED
00680 
00686   Glib::PropertyProxy<int> property_window_threshold() ;
00687 #endif //#GLIBMM_PROPERTIES_ENABLED
00688 
00689 #ifdef GLIBMM_PROPERTIES_ENABLED
00690 
00696   Glib::PropertyProxy_ReadOnly<int> property_window_threshold() const;
00697 #endif //#GLIBMM_PROPERTIES_ENABLED
00698 
00699 
00703   #ifdef GLIBMM_VFUNCS_ENABLED
00704   virtual ClockTime change_resolution_vfunc(ClockTime old_resolution, ClockTime new_resolution);
00705 #endif //GLIBMM_VFUNCS_ENABLED
00706 
00707 
00710   #ifdef GLIBMM_VFUNCS_ENABLED
00711   virtual ClockTime get_resolution_vfunc();
00712 #endif //GLIBMM_VFUNCS_ENABLED
00713 
00714 
00717   #ifdef GLIBMM_VFUNCS_ENABLED
00718   virtual ClockTime get_internal_time_vfunc();
00719 #endif //GLIBMM_VFUNCS_ENABLED
00720 
00721 
00724   #ifdef GLIBMM_VFUNCS_ENABLED
00725   virtual ClockReturn wait_async_vfunc(const Glib::RefPtr<ClockID>& id);
00726 #endif //GLIBMM_VFUNCS_ENABLED
00727 
00728 
00731   #ifdef GLIBMM_VFUNCS_ENABLED
00732   virtual void unschedule_vfunc(const Glib::RefPtr<ClockID>& id);
00733 #endif //GLIBMM_VFUNCS_ENABLED
00734 
00735 
00739   #ifdef GLIBMM_VFUNCS_ENABLED
00740   virtual ClockReturn wait_jitter_vfunc(const Glib::RefPtr<ClockID>& id, ClockTimeDiff& jitter);
00741 #endif //GLIBMM_VFUNCS_ENABLED
00742 
00743 
00744 public:
00745 
00746 public:
00747   //C++ methods used to invoke GTK+ virtual functions:
00748 #ifdef GLIBMM_VFUNCS_ENABLED
00749 #endif //GLIBMM_VFUNCS_ENABLED
00750 
00751 protected:
00752   //GTK+ Virtual Functions (override these to change behaviour):
00753 #ifdef GLIBMM_VFUNCS_ENABLED
00754 #endif //GLIBMM_VFUNCS_ENABLED
00755 
00756   //Default Signal Handlers::
00757 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00758 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00759 
00760 
00761 };
00762 
00763 } //namespace Gst
00764 
00765 
00766 namespace Glib
00767 {
00768 
00777   Glib::RefPtr<Gst::ClockID> wrap(GstClockEntry* object, bool take_copy = false);
00778 
00779 } // namespace Glib
00780 
00781 
00782 namespace Glib
00783 {
00792   Glib::RefPtr<Gst::Clock> wrap(GstClock* object, bool take_copy = false);
00793 }
00794 
00795 
00796 #endif /* _GSTREAMERMM_CLOCK_H */
00797 

Generated on Sun Jul 27 17:07:20 2008 for gstreamermm by  doxygen 1.5.4