o
    e                     @   s@   d dl T d dlmZmZmZmZmZmZmZ G dd deZ	dS )    )*)PlivoXMLElementmap_typeBreakElementEmphasisElementLangElementPElementPhonemeElementc                       sP  e Zd ZdZg dZedd Zejdd Zee	e
jgddd Zed	d
 Zejdd
 Zee	e
jgddd Zedd Zejdd Zee	e
jgddd Z				d, fdd	Zdd Z		d-ddZ	d.ddZ	d.ddZdd Z		d-d d!Z			d/d"d#Zd$d% Z		d-d&d'Z	d.d(d)Z	d.d*d+Z  ZS )0ProsodyElementprosody)
breakemphasislangpphonemer   szsay-assubwc                 C      | j S N)_ProsodyElement__volumeself r   K/var/www/html/venv/lib/python3.10/site-packages/plivo/xml/prosodyElement.pyvolume      zProsodyElement.volumec                 C   "   |d urt || _d S d | _d S r   )six	text_typer   r   valuer   r   r   r          
)r!   c                 C   
   || _ | S r   )r   r    r   r   r   
set_volume%      zProsodyElement.set_volumec                 C   r   r   )_ProsodyElement__rater   r   r   r   rate,   r   zProsodyElement.ratec                 C   r   r   )r   r   r&   r    r   r   r   r'   0   r"   c                 C   r#   r   )r'   r    r   r   r   set_rate5   r%   zProsodyElement.set_ratec                 C   r   r   )_ProsodyElement__pitchr   r   r   r   pitch<   r   zProsodyElement.pitchc                 C   r   r   )r   r   r)   r    r   r   r   r*   @   r"   c                 C   r#   r   )r*   r    r   r   r   	set_pitchE   r%   zProsodyElement.set_pitchNc                    s*   t t|   || _|| _|| _|| _d S r   )superr
   __init__contentr   r'   r*   r   r.   r   r'   r*   	__class__r   r   r-   L   s
   
zProsodyElement.__init__c                 C   s$   | j | j| jd}dd | D S )N)r   r'   r*   c                 S   s(   i | ]\}}|d ur|t t|qS r   )r   r   r   ).0kvr   r   r   
<dictcomp>`   s    z*ProsodyElement.to_dict.<locals>.<dictcomp>)r   r'   r*   items)r   dr   r   r   to_dictY   s   zProsodyElement.to_dictc                 C      |  t||d | S )N)strengthtime)addr   )r   r:   r;   r   r   r   	add_breake      zProsodyElement.add_breakc                 C   r9   )N)r.   level)r<   r   )r   r.   r?   r   r   r   add_emphasisq   r>   zProsodyElement.add_emphasisc                 C   r9   )N)r.   xmllang)r<   r   )r   r.   rA   r   r   r   add_lang}   r>   zProsodyElement.add_langc                 C   s   |  t|d | S )Nr.   )r<   r   )r   r.   r   r   r   add_p   s   zProsodyElement.add_pc                 C   s   |  t|||d | S )N)r.   alphabetph)r<   r	   )r   r.   rE   rF   r   r   r   add_phoneme   s   zProsodyElement.add_phonemec                 C   s   |  t||||d | S )N)r.   r   r'   r*   )r<   r
   r/   r   r   r   add_prosody   s   zProsodyElement.add_prosodyc                 C   s    ddl m} | ||d | S )N   )SElementrC   )sElementrJ   r<   )r   r.   rJ   r   r   r   add_s   s   zProsodyElement.add_sc                 C   s$   ddl m} | ||||d | S )NrI   )SayAsElement)r.   interpret_asformat)sayAsElementrM   r<   )r   r.   rN   rO   rM   r   r   r   
add_say_as   s   zProsodyElement.add_say_asc                 C   "   ddl m} | |||d | S )NrI   )
SubElement)r.   alias)
subElementrS   r<   )r   r.   rT   rS   r   r   r   add_sub      zProsodyElement.add_subc                 C   rR   )NrI   )WElement)r.   role)wElementrX   r<   )r   r.   rY   rX   r   r   r   add_w   rW   zProsodyElement.add_w)NNNN)NNr   )NNN)__name__
__module____qualname___name	_nestablepropertyr   settervalidate_argsof_typer   r   r$   r'   r(   r*   r+   r-   r8   r=   r@   rB   rD   rG   rH   rL   rQ   rV   r[   __classcell__r   r   r0   r   r
      sp    


















r
   N)
plivo.utils.validators	plivo.xmlr   r   r   r   r   r   r	   r
   r   r   r   r   <module>   s    $