# Path: procgame/config.py
# def value_for_key_path(keypath, default=None):
# def load():


from dmd import *
from procgame import config
from random import randrange
    from movie import capPropId, getColorProp
    from movie import Movie
    from procgame.dmd import font, AnimFont, layers
import hdfont
import logging
    import cv2
    import cv2 as cv
    import time 
    import dmd
    import sdl2
    import procgame
        if(cv2 is None):
            raise ValueError, "MP4 is unavailable as OpenCV is not installed"
        # self.logger = logging.getLogger('movie_layer')

        super(MovieLayer, self).__init__(opaque)
        self.hold = hold
        self.repeat = repeat
        
        if(movie is None and movie_file_path is None):
            raise ValueError, "MovieLayer requires either a movie_file_path argument -or- an instantiated movie object"
        elif(movie_file_path is not None):
            movie = Movie(movie_file_path)

        self.movie = movie

        if self.movie.vc == None:
            raise ValueError, "OpenCV failed to handle this movie"
            pass  #something bad has happened, need to decide how to handle

        # print("movie loaded: frame count = %d." % self.movie.frame_count)
        
        self.frame_time = frame_time # Number of frames each frame should be displayed for before moving to the next.
        self.frame_time_counter = self.frame_time
        
        self.frame_listeners = []
        self.frame_pointer = 0

        self.composite_op = transparency_op
        
        self.frame = Frame(self.movie.width, self.movie.height)

# Path: procgame/config.py
# def value_for_key_path(keypath, default=None):
# def load():


# Path: procgame/dmd/layers.py
from dmd import *
from procgame import config
from random import randrange
    from movie import capPropId, getColorProp
    from movie import Movie
    from procgame.dmd import font, AnimFont, layers
import hdfont
import logging
    import cv2
    import cv2 as cv
    import time 
    import dmd
    import sdl2
    import procgame

        if(cv2 is None):
            raise ValueError, "MP4 is unavailable as OpenCV is not installed"
        # self.logger = logging.getLogger('movie_layer')

        super(MovieLayer, self).__init__(opaque)
        self.hold = hold
        self.repeat = repeat
        
        if(movie is None and movie_file_path is None):
            raise ValueError, "MovieLayer requires either a movie_file_path argument -or- an instantiated movie object"
        elif(movie_file_path is not None):
            movie = Movie(movie_file_path)

        self.movie = movie

        if self.movie.vc == None:
            raise ValueError, "OpenCV failed to handle this movie"
            pass  #something bad has happened, need to decide how to handle

        # print("movie loaded: frame count = %d." % self.movie.frame_count)
        
        self.frame_time = frame_time # Number of frames each frame should be displayed for before moving to the next.
        self.frame_time_counter = self.frame_time
        
        self.frame_listeners = []
        self.frame_pointer = 0

        self.composite_op = transparency_op
        
        self.frame = Frame(self.movie.width, self.movie.height)

        self.fps = config.value_for_key_path('dmd_framerate', None) 