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 17:15:03 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-12-21 17:15:03 (GMT)
commit8f95271101b02d65d178db9ccfcb45374117bc16 (patch)
tree71ac3f36b1c0b2f26d072491d2ac1abac9094cea
parent580c6780fb0ee011b13e33d5a41e91ee70de60e2 (diff)
testing active notifications with success on joyride!
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/48@987 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
-rw-r--r--glive.py15
-rwxr-xr-xrecord.py8
-rw-r--r--ui.py38
3 files changed, 36 insertions, 25 deletions
diff --git a/glive.py b/glive.py
index 35e5056..291508e 100644
--- a/glive.py
+++ b/glive.py
@@ -110,8 +110,8 @@ class Glive:
def play(self):
self.pipe().set_state(gst.STATE_PLAYING)
self.playing = True
- import time
- print("play...", int(time.time()))
+ #import time
+ #print("play...", int(time.time()))
def pause(self):
@@ -129,8 +129,8 @@ class Glive:
self._nextPipe()
self._NEXT_PIPETYPE = -1
- import time
- print("stop...", int(time.time()))
+ #import time
+ #print("stop...", int(time.time()))
def is_playing(self):
@@ -525,13 +525,6 @@ class Glive:
print "MESSAGE ERROR: %s" % err, debug
- def showLiveVideo(self):
- self.el('audioTee').unlink(self.el('audioWavenc'))
- self.el('videoTee').unlink(self.el('movieQueue'))
- self.el('videoTee').unlink(self.el('picQueue'))
- self.pipe().set_state(gst.STATE_PLAYED)
-
-
def isXv(self):
return self._PIPETYPE == self.PIPETYPE_XV_VIDEO_DISPLAY_RECORD
diff --git a/record.py b/record.py
index 82baad7..0095e46 100755
--- a/record.py
+++ b/record.py
@@ -55,16 +55,14 @@ class Record(activity.Activity):
#flags for controlling the writing to the datastore
self.I_AM_CLOSING = False
self.I_AM_SAVED = False
- self.JUST_LAUNCHED = True
+ #self.JUST_LAUNCHED = True
+ #self.connect( "notify::active", self._activeCb )
self.props.enable_fullscreen_mode = False
-
Instance(self)
Constants(self)
self.modify_bg( gtk.STATE_NORMAL, Constants.colorBlack.gColor )
- #self.connect( "notify::active", self._activeCb )
-
#wait a moment so that our debug console capture mistakes
gobject.idle_add( self._initme, None )
@@ -143,6 +141,7 @@ class Record(activity.Activity):
def stopPipes(self):
+ print("stopPipes")
self.gplay.stop()
self.ui.doMouseListener( False )
@@ -154,6 +153,7 @@ class Record(activity.Activity):
def restartPipes(self):
+ print("restartPipes")
self.ui.updateModeChange( )
self.ui.doMouseListener( True )
diff --git a/ui.py b/ui.py
index b460b4f..7706ed4 100644
--- a/ui.py
+++ b/ui.py
@@ -74,7 +74,7 @@ class UI:
def __init__( self, pca ):
self.ca = pca
self.ACTIVE = False
- self.LAUNCHING = False
+ self.LAUNCHING = True
self.ca.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
self.ca.connect("visibility-notify-event", self._visibleNotifyCb)
@@ -343,10 +343,14 @@ class UI:
def finalSetUp( self ):
self.LAUNCHING = False
+ print("finalSetUp 1 ", self.ACTIVE)
self.updateVideoComponents()
if (self.ACTIVE):
+ print("active play!")
self.ca.glive.play()
+ print("finalSetUp 2")
+
def setUpWindows( self ):
#image windows
@@ -360,6 +364,8 @@ class UI:
self.livePhotoCanvas = PhotoCanvas()
self.livePhotoWindow.add(self.livePhotoCanvas)
self.livePhotoWindow.connect("button_release_event", self._mediaClickedForPlayback)
+ self.livePhotoWindow.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
+ self.livePhotoWindow.connect("visibility-notify-event", self._visibleNotifyCb)
#border behind
self.pipBgdWindow = gtk.Window()
@@ -372,6 +378,8 @@ class UI:
self.liveVideoWindow.set_glive(self.ca.glive)
self.liveVideoWindow.set_events(gtk.gdk.BUTTON_RELEASE_MASK)
self.liveVideoWindow.connect("button_release_event", self._liveButtonReleaseCb)
+ self.liveVideoWindow.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
+ self.liveVideoWindow.connect("visibility-notify-event", self._visibleNotifyCb)
#video playback windows
self.playOggWindow = PlayVideoWindow(Constants.colorBlack.gColor)
@@ -380,6 +388,8 @@ class UI:
self.ca.gplay.window = self.playOggWindow
self.playOggWindow.set_events(gtk.gdk.BUTTON_RELEASE_MASK)
self.playOggWindow.connect("button_release_event", self._mediaClickedForPlayback)
+ self.playOggWindow.add_events(gtk.gdk.VISIBILITY_NOTIFY_MASK)
+ self.playOggWindow.connect("visibility-notify-event", self._visibleNotifyCb)
#border behind
self.pipBgdWindow2 = gtk.Window()
@@ -418,31 +428,39 @@ class UI:
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].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
+ if (self.LAUNCHING):
+ return
- #here we determine if the record activity is 'active' or not
+ temp_ACTIVE = True
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):
+ print("a")
+
+ elif (widget == self.livePhotoWindow and self.ca.m.MODE == Constants.MODE_PHOTO and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED and not self.LIVEMODE):
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):
+ print("b")
+ elif (widget == self.liveVideoWindow and (self.ca.m.MODE == Constants.MODE_PHOTO or self.ca.m.MODE == Constants.MODE_VIDEO) and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED and self.LIVEMODE):
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):
+ print("c")
+ elif (widget == self.playOggWindow and self.ca.m.MODE == Constants.MODE_VIDEO and self.FULLSCREEN and event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED and not self.LIVEMODE):
temp_ACTIVE = False
+ print("d")
+
+ print("hrm...", temp_ACTIVE, self.ACTIVE, self.FULLSCREEN)
if (temp_ACTIVE != self.ACTIVE):
self.ACTIVE = temp_ACTIVE
if (not self.LAUNCHING):
if (self.ACTIVE):
- self.ca.startPipes()
+ self.ca.restartPipes()
else:
self.ca.stopPipes()
@@ -926,6 +944,7 @@ class UI:
def doFullscreen( self ):
+ print("doFullscreen")
self.FULLSCREEN = not self.FULLSCREEN
self.updateVideoComponents()
@@ -2182,7 +2201,6 @@ class ProgressWindow(gtk.Window):
self.progBar.set_fraction( 0 )
-
class PhotoToolbar(gtk.Toolbar):
def __init__(self):
gtk.Toolbar.__init__(self)