import os, sys, importlib, glob, inspect

from ffx.track_disposition import TrackDisposition
from .disposition_combinator_3 import DispositionCombinator3


class DispositionCombinator34(DispositionCombinator3):

    VARIANT = 'D101'


    def __init__(self, context = None,
                    createPresets: bool = False):
        super().__init__(context)

        self.__createPresets = createPresets

    def getVariant(self):
        return DispositionCombinator34.VARIANT


    def getPayload(self):

        subtrack0 = set([TrackDisposition.DEFAULT])
        subtrack1 = set()
        subtrack2 = set([TrackDisposition.DEFAULT])

        #NOTE: Current ffmpeg version will not set most of the dispositions on arbitrary tracks
        # so some checks for preserved dispositions are omitted for now
        if self.__createPresets:
            subtrack0.add(TrackDisposition.FORCED) # COMMENT
            # subtrack1.add(TrackDisposition.DESCRIPTIONS) # DESCRIPTIONS
            # subtrack2.add(TrackDisposition.HEARING_IMPAIRED) # HEARING_IMPAIRED

        return (subtrack0,
                subtrack1,
                subtrack2)

    #TODO: tmpdb cases
    def createAssertFunc(self):
        def f(assertObj: dict = {}):
            pass
        return f

    def shouldFail(self):
        return True
