You are here

function getid3_metadata_audio_sample_rate::render in getID3() 7.2

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides getid3_metadata_handler::render

File

includes/handlers/getid3_metadata_audio_sample_rate.inc, line 37

Class

getid3_metadata_audio_sample_rate
Field handler to render audio_sample_rate

Code

function render($values) {
  $rendered_values = parent::render($values);
  $value = $rendered_values['audio_sample_rate'];

  // Check to see if hiding should happen before adding prefix and suffix.
  if ($this->options['hide_empty'] && empty($value) && ($value !== 0 || $this->options['empty_zero'])) {
    return '';
  }
  switch ($this->options['format']) {
    case 'raw':
      $output = $value;
      break;
    default:
      $output = theme('getid3_sample_rate', array(
        'sample_rate' => $value,
      ));
  }
  return $this
    ->sanitize_value($this->options['prefix']) . $output . $this
    ->sanitize_value($this->options['suffix']);
}