]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/mac/misc.py
Added some more docstrings, and also a few little tweaks along the way.
[wxWidgets.git] / wxPython / src / mac / misc.py
index baef1315cb23b88a4ef103c3bd1ae7f7eedd2a56..648441cf5311a1be5343d30d17993375b2cda058 100644 (file)
@@ -2012,43 +2012,69 @@ EVT_JOYSTICK_EVENTS = wx.PyEventBinder([ wxEVT_JOY_BUTTON_DOWN,
 
 #---------------------------------------------------------------------------
 
-class Wave(object):
+SOUND_SYNC = _misc.SOUND_SYNC
+SOUND_ASYNC = _misc.SOUND_ASYNC
+SOUND_LOOP = _misc.SOUND_LOOP
+class Sound(object):
     def __repr__(self):
-        return "<%s.%s; proxy of C++ wxWave instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
-    def __init__(self, *args, **kwargs):
-        """__init__(String fileName, bool isResource=False) -> Wave"""
-        newobj = _misc.new_Wave(*args, **kwargs)
+        return "<%s.%s; proxy of C++ wxSound instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+    def __init__(self, *args):
+        """
+        __init__() -> Sound
+        __init__(String fileName, bool isResource=false) -> Sound
+        __init__(int size, wxByte data) -> Sound
+        """
+        newobj = _misc.new_Sound(*args)
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
-    def __del__(self, destroy=_misc.delete_Wave):
+    def __del__(self, destroy=_misc.delete_Sound):
         """__del__()"""
         try:
             if self.thisown: destroy(self)
         except: pass
 
+    def Create(*args):
+        """
+        Create(String fileName, bool isResource=false) -> bool
+        Create(int size, wxByte data) -> bool
+        """
+        return _misc.Sound_Create(*args)
+
     def IsOk(*args, **kwargs):
         """IsOk() -> bool"""
-        return _misc.Wave_IsOk(*args, **kwargs)
+        return _misc.Sound_IsOk(*args, **kwargs)
 
-    def Play(*args, **kwargs):
-        """Play(bool async=True, bool looped=False) -> bool"""
-        return _misc.Wave_Play(*args, **kwargs)
+    def Play(*args):
+        """Play(unsigned int flags=SOUND_ASYNC) -> bool"""
+        return _misc.Sound_Play(*args)
 
+    def PlaySound(*args):
+        """PlaySound(String filename, unsigned int flags=SOUND_ASYNC) -> bool"""
+        return _misc.Sound_PlaySound(*args)
+
+    PlaySound = staticmethod(PlaySound)
+    def Stop(*args, **kwargs):
+        """Stop()"""
+        return _misc.Sound_Stop(*args, **kwargs)
+
+    Stop = staticmethod(Stop)
     def __nonzero__(self): return self.IsOk() 
 
-class WavePtr(Wave):
+class SoundPtr(Sound):
     def __init__(self, this):
         self.this = this
         if not hasattr(self,"thisown"): self.thisown = 0
-        self.__class__ = Wave
-_misc.Wave_swigregister(WavePtr)
+        self.__class__ = Sound
+_misc.Sound_swigregister(SoundPtr)
 
-def WaveData(*args, **kwargs):
-    """WaveData(String data) -> Wave"""
-    val = _misc.new_WaveData(*args, **kwargs)
-    val.thisown = 1
-    return val
+def Sound_PlaySound(*args):
+    """Sound_PlaySound(String filename, unsigned int flags=SOUND_ASYNC) -> bool"""
+    return _misc.Sound_PlaySound(*args)
+
+def Sound_Stop(*args, **kwargs):
+    """Sound_Stop()"""
+    return _misc.Sound_Stop(*args, **kwargs)
 
 #---------------------------------------------------------------------------
 
@@ -3173,6 +3199,8 @@ class DateTime(object):
         """IsValid() -> bool"""
         return _misc.DateTime_IsValid(*args, **kwargs)
 
+    Ok = IsValid 
+    def __nonzero__(self): return self.Ok() 
     def GetTicks(*args, **kwargs):
         """GetTicks() -> time_t"""
         return _misc.DateTime_GetTicks(*args, **kwargs)
@@ -3335,7 +3363,7 @@ class DateTime(object):
         return _misc.DateTime_ParseRfc822Date(*args, **kwargs)
 
     def ParseFormat(*args, **kwargs):
-        """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=wxDefaultDateTime) -> int"""
+        """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=DefaultDateTime) -> int"""
         return _misc.DateTime_ParseFormat(*args, **kwargs)
 
     def ParseDateTime(*args, **kwargs):
@@ -4015,6 +4043,7 @@ class DataFormatPtr(DataFormat):
         if not hasattr(self,"thisown"): self.thisown = 0
         self.__class__ = DataFormat
 _misc.DataFormat_swigregister(DataFormatPtr)
+DefaultDateTime = cvar.DefaultDateTime
 
 def CustomDataFormat(*args, **kwargs):
     """CustomDataFormat(String format) -> DataFormat"""
@@ -4131,9 +4160,7 @@ class DataObjectComposite(DataObject):
         del newobj.thisown
     def Add(*args, **kwargs):
         """Add(DataObjectSimple dataObject, int preferred=False)"""
-        val = _misc.DataObjectComposite_Add(*args, **kwargs)
-        args[1].thisown = 0
-        return val
+        return _misc.DataObjectComposite_Add(*args, **kwargs)
 
 
 class DataObjectCompositePtr(DataObjectComposite):
@@ -4421,7 +4448,6 @@ class DropTarget(object):
         self.this = newobj.this
         self.thisown = 1
         del newobj.thisown
-        if args: args[0].thisown = 0;
         self._setCallbackInfo(self, DropTarget)
 
     def _setCallbackInfo(*args, **kwargs):
@@ -4440,9 +4466,7 @@ class DropTarget(object):
 
     def SetDataObject(*args, **kwargs):
         """SetDataObject(DataObject dataObject)"""
-        val = _misc.DropTarget_SetDataObject(*args, **kwargs)
-        args[1].thisown = 0
-        return val
+        return _misc.DropTarget_SetDataObject(*args, **kwargs)
 
     def base_OnEnter(*args, **kwargs):
         """base_OnEnter(int x, int y, int def) -> int"""