Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-12-21 05:26:21 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-12-21 05:26:21 (GMT)
commit580c6780fb0ee011b13e33d5a41e91ee70de60e2 (patch)
tree34d623d647ce18ea7a6a62d410979a5ba525db2f
parent7adcc780f3f0f41637c7f5f22f149e2dd1b00723 (diff)
untested way of doing notify active
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/48@986 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
-rwxr-xr-xrecord.py3
-rw-r--r--ui.py38
2 files changed, 35 insertions, 6 deletions
diff --git a/record.py b/record.py
index c1b3ae4..82baad7 100755
--- a/record.py
+++ b/record.py
@@ -63,7 +63,8 @@ class Record(activity.Activity):
Constants(self)
self.modify_bg( gtk.STATE_NORMAL, Constants.colorBlack.gColor )
- self.connect( "notify::active", self._activeCb )
+ #self.connect( "notify::active", self._activeCb )
+
#wait a moment so that our debug console capture mistakes
gobject.idle_add( self._initme, None )
diff --git a/ui.py b/ui.py
index e8acb2a..b460b4f 100644
--- a/ui.py
+++ b/ui.py
@@ -73,6 +73,10 @@ class UI:
def __init__( self, pca ):
self.ca = pca
+ self.ACTIVE = False
+ self.LAUNCHING = False
+ self.ca.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
+ self.ca.connect("visibility-notify-event", self._visibleNotifyCb)
self.inset = self.__class__.dim_INSET
self.pgdh = self.__class__.dim_PGDH
@@ -327,7 +331,6 @@ class UI:
self.resetWidgetFadeTimer()
self.showLiveVideoTags()
-
self.photoToolbar.set_sensitive( True )
self.videoToolbar.set_sensitive( True )
self.audioToolbar.set_sensitive( True )
@@ -339,9 +342,10 @@ class UI:
def finalSetUp( self ):
+ self.LAUNCHING = False
self.updateVideoComponents()
- print("finalSetupUp... play!")
- self.ca.glive.play()
+ if (self.ACTIVE):
+ self.ca.glive.play()
def setUpWindows( self ):
@@ -412,13 +416,37 @@ class UI:
self.addToWindowStack( self.infWindow, self.windowStack[len(self.windowStack)-1] )
self.hideAllWindows()
-
self.MAP_EVENT_ID = self.liveVideoWindow.connect_after("map-event", self._mapEventCb)
-
for i in range (0, len(self.windowStack)):
+ self.windowStack[i].add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
+ self.windowStack[i].connect("visibility-notify-event", self._visibleNotifyCb)
self.windowStack[i].show_all()
+ def _visibleNotifyCb( self, widget, event ):
+ temp_ACTIVE = True
+
+ #here we determine if the record activity is 'active' or not
+ if (widget == self.ca):
+ if (not self.FULLSCREEN):
+ if (event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED):
+ temp_ACTIVE = False
+ elif (widget == self.livePhotoWindow and self.ca.MODE == Constants.MODE_PHOTO and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED):
+ temp_ACTIVE = False
+ elif (widget == self.liveVideoWindow and (self.ca.MODE == Constants.MODE_PHOTO or self.ca.MODE == Constants.MODE_VIDEO) and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED):
+ temp_ACTIVE = False
+ elif (widget == self.playOggWindow and self.ca.MODE == Constants.MODE_VIDEO and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED):
+ temp_ACTIVE = False
+
+ if (temp_ACTIVE != self.ACTIVE):
+ self.ACTIVE = temp_ACTIVE
+ if (not self.LAUNCHING):
+ if (self.ACTIVE):
+ self.ca.startPipes()
+ else:
+ self.ca.stopPipes()
+
+
def setUpWindowsSizes( self ):
pipDim = self.getPipDim(False)
eyeDim = self.getEyeDim(False)