from yta_general_utils.programming.enum import YTAEnum as Enum


class _Field(Enum):
    """
    Enum class to represent the names of the
    fields we are able to handle in the app.

    This has been built to have all the names
    centralized in one place and to reuse in
    any app part in which it is needed.

    For internal use only. Use a more specific
    Enum class to interact with the different
    field names.
    """

    TYPE = 'type'
    """
    The type of some specific element. See the 
    specific type Enum classes.
    """
    TEXT = 'text'
    """
    The text that has to be written in some 
    segment with text content.
    """
    VOICE_NARRATION = 'voice_narration'
    """
    The dictionary that holds the information
    about the voice narration that will be
    used within the content we are creating.
    It can be loaded from a local file,
    created from zero, or not used.
    """
    MUSIC = 'music'
    """
    The dictionary that holds the information
    about the music that will be used within
    the content we are creating. It can be 
    loaded from a local file, created from
    scratch, downloaded from an external
    source or not used.
    """
    FILENAME = 'filename'
    """
    The local filename of the file that has to
    be included as part (or the whole) content 
    of the element.
    """
    URL = 'url'
    """
    The url from which we can obtain a resource
    that has to be included as part (or the
    whole) content of the element.
    """
    KEYWORDS = 'keywords'
    """
    The terms or sentence to make a search on
    Youtube, to create the specific premade, etc.
    Keywords to identify the expected behaviour.
    """
    TEXT = 'text'
    """
    The text that must be used and included in
    some kind of elements to be successfully
    generated.
    """
    DURATION = 'duration'
    """
    The length of time that the element being
    referenced will be displayed or occurring.
    """
    ENHANCEMENTS = 'enhancements'
    """
    The enhancements that have to be built for the
    content.
    """
    EXTRA_PARAMS = 'extra_params'
    """
    The extra parameters we need to build some of the
    content.
    """
    # Subfields (fields inside main fields)
    ENGINE = 'engine'
    """
    The engine that has to be used to generate some
    specific content.
    """
    LANGUAGE = 'language'
    """
    The language that has to be used to generate the
    voice narration.
    """
    NARRATOR_NAME = 'narrator_name'
    """
    The name of the voice that must narrate the text
    that must be narrated.
    """
    SPEED = 'speed'
    """
    The speed of the voice narration.
    """
    EMOTION = 'emotion'
    """
    The emotion we expect to be shown when narrating
    the text.
    """
    PITCH = 'pitch'
    """
    The pitch we expect to be shown when narrating
    the text.
    """
    # Other fields
    STATUS = 'status'
    """
    The status of an element, that will tell us
    if it is being constructed, waiting for it,
    etc.
    """
    SEGMENTS = 'segments'
    """
    The segments that a project includes and have
    to be built.
    """
    ENHANCEMENTS = 'enhancements'
    """
    The enhancements a Segment of a Project can
    have.
    """
    START = 'start'
    """
    The time moment in which the content has to start.
    """
    MODE = 'mode'
    """
    The mode in which the content has to be included.
    """
    # Building fields below
    TRANSCRIPTION = 'transcription'
    """
    The transcription of the audio narration if 
    existing.
    """
    SHORTCODES = 'shortcodes'
    """
    The shortcodes found in an audio narration.
    """
    AUDIO_FILENAME = 'audio_filename'
    """
    The filename of the audio that has been 
    generated by the system and has to be used
    as the audio content part.
    """
    AUDIO_CLIP = 'audio_clip'
    """
    The clip generated from the 'audio_filename'.
    """
    VIDEO_FILENAME = 'video_filename'
    """
    The filename of the video part that has 
    been generated by the system and has to be
    used as the video content part.
    """
    VIDEO_CLIP = 'video_clip'
    """
    The clip generated from the 'video_filename'.
    """
    FULL_FILENAME = 'full_filename'
    """
    The filename of the video and audio part put
    together, generated by the system, and that
    is the whole segment content with the effects
    and everything appliedo n it.
    """
    FULL_CLIP = 'full_clip'
    """
    The clip generated from the 'full_filename'.
    """

class ProjectField(Enum):
    """
    Enum class to represent the names of the
    fields related to a Project.
    """

    STATUS = _Field.STATUS.value
    """
    The status of an element, that will tell us
    if it is being constructed, waiting for it,
    etc.

    See ProjectStatus Enum class.
    """
    SEGMENTS = _Field.SEGMENTS.value
    """
    The segments that a project includes and have
    to be built.
    """

class SegmentField(Enum):
    """
    Enum class to represent the names of the
    fields related to a Segment (which belongs
    to a Project).
    """

    TYPE = _Field.TYPE.value
    """
    The type of a segment, that determins what
    kind of content will be used to fulfill that
    segment.
    """
    VOICE_NARRATION = _Field.VOICE_NARRATION.value
    MUSIC = _Field.MUSIC.value
    FILENAME = _Field.FILENAME.value
    URL = _Field.URL.value
    KEYWORDS = _Field.KEYWORDS.value
    TEXT = _Field.TEXT.value
    DURATION = _Field.DURATION.value
    ENHANCEMENTS = _Field.ENHANCEMENTS.value
    EXTRA_PARAMS = _Field.EXTRA_PARAMS.value

class EnhancementField(Enum):
    """
    Enum class to represent the names of the
    fields related to an Enhancement (which
    belongs to a Project Segment).
    """

    TYPE = _Field.TYPE.value
    VOICE_NARRATION = _Field.VOICE_NARRATION.value
    MUSIC = _Field.MUSIC.value
    FILENAME = _Field.FILENAME.value
    URL = _Field.URL.value
    KEYWORDS = _Field.KEYWORDS.value
    TEXT = _Field.TEXT.value
    DURATION = _Field.DURATION.value
    START = _Field.START.value
    """
    The time moment in which the content has to start.
    """
    MODE = _Field.MODE.value
    """
    The mode in which the content has to be included.
    """
    EXTRA_PARAMS = _Field.EXTRA_PARAMS.value

class ShortcodeField(Enum):
    """
    Enum class to represent the names of the
    fields related to a Shortcode (which
    was detected within a Segment or Enhancement
    text).
    """

    TYPE = _Field.TYPE.value
    VOICE_NARRATION = _Field.VOICE_NARRATION.value
    MUSIC = _Field.MUSIC.value
    FILENAME = _Field.FILENAME.value
    URL = _Field.URL.value
    KEYWORDS = _Field.KEYWORDS.value
    TEXT = _Field.TEXT.value
    DURATION = _Field.DURATION.value
    START = _Field.START.value
    """
    The time moment in which the content has to start.
    """
    MODE = _Field.MODE.value
    """
    The mode in which the content has to be included.
    """
    EXTRA_PARAMS = _Field.EXTRA_PARAMS.value

class ProjectBuildingField(Enum):
    """
    The fields of a Project that are used when its
    content is being built and doesn't come from
    the original json source.
    """

    STATUS = _Field.STATUS.value
    """
    The status of the Project, that will tell us
    if it is being constructed, waiting for it,
    etc.
    """

class SegmentBuildingField(Enum):
    """
    The fields that are used when building the
    Segment and are not provided by the user in
    the initial json data.
    """

    STATUS = _Field.STATUS.value
    """
    The status of the Segment, that will tell us
    if it is being constructed, waiting for it,
    etc.
    """
    TRANSCRIPTION = _Field.TRANSCRIPTION.value
    """
    The transcription of the audio narration of
    the segment if existing.
    """
    SHORTCODES = _Field.SHORTCODES.value
    """
    The shortcodes that have been found in the
    audio narration.
    """
    AUDIO_FILENAME = _Field.AUDIO_FILENAME.value
    """
    The filename of the audio that has been 
    generated by the system and has to be used
    as the audio content part.
    """
    AUDIO_CLIP = _Field.AUDIO_CLIP.value
    """
    The clip generated from the 'audio_filename'.
    """
    VIDEO_FILENAME = _Field.VIDEO_FILENAME.value
    """
    The filename of the video part that has 
    been generated by the system and has to be
    used as the video content part.
    """
    VIDEO_CLIP = _Field.VIDEO_CLIP.value
    """
    The clip generated from the 'video_filename'.
    """
    FULL_FILENAME = _Field.FULL_FILENAME.value
    """
    The filename of the video and audio part put
    together, generated by the system, and that
    is the whole segment content with the effects
    and everything appliedo n it.
    """
    FULL_CLIP = _Field.FULL_CLIP.value
    """
    The clip generated from the 'full_filename'.
    """

class EnhancementBuildingField(Enum):
    """
    The fields that are used when building the 
    Enhancement and are not provided by the user
    in the initial json data.
    """

    STATUS = _Field.STATUS.value
    """
    The status of the Segment, that will tell us
    if it is being constructed, waiting for it,
    etc.
    """
    TRANSCRIPTION = _Field.TRANSCRIPTION.value
    """
    The transcription of the audio narration of
    the segment if existing.
    """
    SHORTCODES = _Field.SHORTCODES.value
    """
    The shortcodes that have been found in the
    audio narration.
    """
    AUDIO_FILENAME = _Field.AUDIO_FILENAME.value
    """
    The filename of the audio that has been 
    generated by the system and has to be used
    as the audio content part.
    """
    AUDIO_CLIP = _Field.AUDIO_CLIP.value
    """
    The clip generated from the 'audio_filename'.
    """
    VIDEO_FILENAME = _Field.VIDEO_FILENAME.value
    """
    The filename of the video part that has 
    been generated by the system and has to be
    used as the video content part.
    """
    VIDEO_CLIP = _Field.VIDEO_CLIP.value
    """
    The clip generated from the 'video_filename'.
    """
    FULL_FILENAME = _Field.FULL_FILENAME.value
    """
    The filename of the video and audio part put
    together, generated by the system, and that
    is the whole segment content with the effects
    and everything appliedo n it.
    """
    FULL_CLIP = _Field.FULL_CLIP.value
    """
    The clip generated from the 'full_filename'.
    """

class VoiceNarrationField(Enum):
    """
    The fields that are included within the
    'voice_narration' dict.
    """
    FILENAME = _Field.FILENAME.value
    TEXT = _Field.TEXT.value
    ENGINE = _Field.ENGINE.value
    LANGUAGE = _Field.LANGUAGE.value
    NARRATOR_NAME = _Field.NARRATOR_NAME.value
    SPEED = _Field.SPEED.value
    EMOTION = _Field.EMOTION.value
    PITCH = _Field.PITCH.value

class MusicField(Enum):
    """
    The fields that are included within the
    'music' dict.
    """
    FILENAME = _Field.FILENAME.value
    URL = _Field.URL.value
    ENGINE = _Field.ENGINE.value
    KEYWORDS = _Field.KEYWORDS.value