Esempio n. 1
0
 def play(self):
     #Only play if the movie is not already playing
     if not self._playing:
         #Create a movie object
         self._movie = pygame.movie.Movie(filemanager.find_movie(self._file))
         #Read the movies size, and adjust the rect
         self._rect.size = self._movie.get_size()
         #Create the output surface for the movie
         self._areasurface = pygame.Surface(self._rect.size)
         #Set the movie to render to the output surface
         self._movie.set_display(self._areasurface)
         #Make the movie visible
         self._visible = 1
         #Add this movie to the list of playing movies
         globals.playing.append(self)
         #Set the internal "playing" flag
         self._playing = 1
         #Play the movie (loop if requested)
         print 'play movie size',self._movie.get_size()
         print 'play movie length',self._movie.get_length()
         print 'play movie audio',self._movie.has_audio()
         print 'play movie video',self._movie.has_video()
         self._movie.play()
         #If this movie disables the cursor, do so
         if self._cursor == 0:
             globals.curcursor.disable()
         #If this is the only movie, start the engine timer for movies
         if len(globals.playing) == 1:
             pygame.time.set_timer(globals.MOVIEEVENT, parameters.getmovieinterval())
Esempio n. 2
0
 def play(self):
     #pygame.mixer for music deactivation
     if(pygame.mixer):
         pygame.mixer.quit()
     if (not self._playing):
         self._movie = pygame.movie.Movie(filemanager.find_movie(self._file))
         if (self._rect.size == (0,0,)):
             self._rect.size = self._movie.get_size()
         self._areasurface = pygame.Surface(self._rect.size)
         self._movie.set_display(globals.screensurface, self._rect)
         self._visible = 1
         globals.playing.append(self)
         self._playing = 1
         self._movie.play(self._looping)
         if (self._cursor == 0):
             globals.curcursor.disable()
         if (len(globals.playing) == 1):
             pygame.time.set_timer(globals.MOVIEEVENT, parameters.getmovieinterval())