Ejemplo n.º 1
0
    def __init__(self, mmv, **kwargs) -> None:
        
        debug_prefix = "[MMVSkiaProgressionBarVectorial.__init__]"
        
        self.mmv = mmv
        self.config = {}

        self.utils = Utils()

        self.path = {}

        self.x = 0
        self.y = 0
        self.size = 1
        self.is_deletable = False
        self.offset = [0, 0]

        self.image = Frame()

        # General Configuration

        self.config["type"] = kwargs.get("bar_type", "rectangle")
        self.config["position"] = kwargs.get("position", "bottom")
        self.config["shake_scalar"] = kwargs.get("shake_scalar", 14)

        # We have different files with different classes of ProgressionBars

        # Simple, rectangle bar
        if self.config["type"] == "rectangle":
            print(debug_prefix, "Builder is MMVSkiaProgressionBarRectangle")
            self.builder = MMVSkiaProgressionBarRectangle(self, self.mmv)
        
        else:
            raise RuntimeError(debug_prefix, "No valid builder set, kwargs:", kwargs, "config:", self.config)
Ejemplo n.º 2
0
    def __init__(self, context, config: dict, skia_object) -> None:
        
        debug_prefix = "[MMVMusicBars.__init__]"
        
        self.context = context
        self.config = config
        self.skia = skia_object

        self.fit_transform_index = FitIndex()
        self.functions = Functions()
        self.utils = Utils()

        self.path = {}

        self.x = 0
        self.y = 0
        self.size = 1
        self.is_deletable = False
        self.offset = [0, 0]
        self.polar = PolarCoordinates()

        self.current_fft = {}

        self.image = Frame()

        # We use separate file and classes for each type of visualizer

        # Circle, radial visualizer
        if self.config["type"] == "circle":
            self.builder = MMVMusicBarsCircle(self, self.context, self.skia)
    def __init__(self, context, config: dict, skia_object) -> None:

        debug_prefix = "[MMVMusicBars.__init__]"

        self.context = context
        self.config = config
        self.skia = skia_object

        self.utils = Utils()

        self.path = {}

        self.x = 0
        self.y = 0
        self.size = 1
        self.is_deletable = False
        self.offset = [0, 0]

        self.image = Frame()

        # We have different files with different classes of ProgressionBars

        # Simple, rectangle bar
        if self.config["type"] == "rectangle":
            self.builder = MMVProgressionBarRectangle(self, self.context,
                                                      self.skia)
    def __init__(self, mmv) -> None:
        self.mmv = mmv

        # The "animation" and path this object will follow
        self.animation = {}

        # Create classes
        self.configure = MMVImageConfigure(self, self.mmv)
        self.image = Frame()

        self.x = 0
        self.y = 0
        self.size = 1
        self.rotate_value = 0
        self.current_animation = 0
        self.current_step = -1
        self.is_deletable = False
        self.is_vectorial = False
        self.type = "mmvimage"
        self.overlay_mode = "composite"  # composite and copy

        # If we want to get the images from a video, be sure to match the fps!!
        self.video = None

        # Offset is the animations and motions this frame offset
        self.offset = [0, 0]

        self.ROUND = 3

        self._reset_effects_variables()
Ejemplo n.º 5
0
    def __init__(self,
                 mmvskia_main,
                 depth=LOG_NO_DEPTH,
                 from_generator=False) -> None:
        debug_prefix = "[MMVSkiaImage.__init__]"
        ndepth = depth + LOG_NEXT_DEPTH
        self.mmvskia_main = mmvskia_main
        self.preludec = self.mmvskia_main.prelude["mmvimage"]

        # Log the creation of this class
        if self.preludec["log_creation"] and not from_generator:
            logging.info(
                f"{depth}{debug_prefix} Created new MMVSkiaImage object, getting unique identifier for it"
            )

        # Get an unique identifier for this MMVSkiaImage object
        self.identifier = self.mmvskia_main.utils.get_unique_id(
            purpose="MMVSkiaImage object",
            depth=ndepth,
            silent=self.preludec["log_get_unique_id"] and from_generator)

        # The "animation" and path this object will follow
        self.animation = {}

        # Create classes
        self.configure = MMVSkiaImageConfigure(mmvskia_main=self.mmvskia_main,
                                               mmvimage_object=self)
        self.image = Frame()

        self.x = 0
        self.y = 0
        self.size = 1
        self.rotate_value = 0
        self.current_animation = 0
        self.current_step = -1
        self.is_deletable = False
        self.is_vectorial = False
        self.type = "mmvimage"

        # If we want to get the images from a video, be sure to match the fps!!
        self.video = None

        # Offset is the animations and motions this frame offset
        self.offset = [0, 0]

        self.ROUND = 3

        self._reset_effects_variables(depth=ndepth)
Ejemplo n.º 6
0
    def __init__(self, mmv, **kwargs) -> None:
        self.mmv = mmv

        debug_prefix = "[MMVSkiaMusicBars.__init__]"

        self.kwargs = kwargs

        self.functions = Functions()
        self.utils = Utils()

        self.path = {}

        self.x = 0
        self.y = 0
        self.size = 1
        self.is_deletable = False
        self.offset = [0, 0]
        self.polar = PolarCoordinates()

        self.current_fft = {}

        self.image = Frame()

        # Configuration

        self.kwargs["fourier"] = {
            "interpolation":
            MMVSkiaInterpolation(
                self.mmv,
                function="remaining_approach",
                ratio=self.kwargs.get("bar_responsiveness", 0.25),
            ),
        }

        # # We use separate file and classes for each type of visualizer

        # Circle, radial visualizer
        if self.kwargs["type"] == "circle":
            self.builder = MMVSkiaMusicBarsCircle(self.mmv, self,
                                                  **self.kwargs)