<?xml version="1.0" encoding="utf-8"?>
<audio-profiles>
  <profiles>
    <profile id="lame-mp3">
      <_name>MP3 (LAME Encoder)</_name>
      <_description>A proprietary and older, but also popular, lossy audio format that produces larger files at lower bitrates.</_description>
      <output-file-extension>mp3</output-file-extension>
      <mimetype>audio/mp3</mimetype>
      <mimetype>taglib/mp3</mimetype>
      <mimetype>audio/mpeg3</mimetype>
      <mimetype>audio/x-mpeg-3</mimetype>
      <mimetype>audio/x-mpeg</mimetype>
      <mimetype>audio/mpeg</mimetype>
      <mimetype>application/x-id3</mimetype>
      <mimetype>audio/x-mp3</mimetype>
      <pipeline>
        <process id="gstreamer">
        <![CDATA[
            (gst-construct-pipeline
                "audioconvert"
                (gst-construct-element "lamemp3enc"
                        (if (= encoding_mode 0)
                                ("bitrate" bitrate "target" 1)
                                (if (= encoding_mode 4)
                                        ("quality" (- 9 vbr_quality) "target" 0)
                                )
                        )
                )
                (if (and 
                    (!= encoding_mode 0)
                    (gst-element-is-available "xingmux")) 
                        "xingmux" 
                        "")
                (if (gst-element-is-available "id3v2mux")
                    "id3v2mux"
                    "id3mux"))
        ]]>
        </process>
        <variable id="encoding_mode">
          <_name>Encoding Mode</_name>
          <control-type>combo</control-type>
          <default-value>0</default-value>
          <possible-values>
            <_value value="0" disables="vbr_quality" enables="bitrate" >Constant Bitrate</_value>
            <_value value="4" disables="bitrate" enables="vbr_quality">Variable Bitrate</_value>
          </possible-values>
        </variable>
        <variable id="vbr_quality">
          <_name>VBR Quality</_name>
          <control-type>slider</control-type>
          <min-value>0</min-value>
          <_min-label>Worst</_min-label>
          <max-value>9</max-value>
          <_max-label>Best</_max-label>
          <step-value>1</step-value>
          <default-value>7</default-value>
        </variable>
        <variable id="bitrate">
          <_name>Bitrate</_name>
          <control-type>combo</control-type>
          <default-value>128</default-value>
          <possible-values>
            <value value="64">64 Kbps</value>
            <value value="96">96 Kbps</value>
            <value value="128">128 Kbps</value>
            <value value="160">160 Kbps</value>
            <value value="192">192 Kbps</value>
            <value value="256">256 Kbps</value>
            <value value="320">320 Kbps</value>
          </possible-values>
        </variable>
      </pipeline>
    </profile>
  </profiles>
</audio-profiles>
