<?php
// $Id$

/**
 *  Implementation of hook_mapi_extensions()
 */
function mapi_audio_mapi_extensions($op, $name, &$data, $read) {
  $list = array(
    'mp3' => 'audio/mpeg'
  );

  switch ($op) {
    case 'list':
      return array_keys($list);
    case 'mime':
      return $list[$name];
    case 'metadata':
      // NEEDS WORK: Get the metadata information for the MP3
      break;
    case 'dimensions':
      // NEEDS WORK: Get the dimensional details for the MP3
      break;
  }
}

/**
 *  Implementation of hook_mapi_types()
 */
function mapi_audio_mapi_types($op, $type = null, $edit = null) {
  switch ($op) {
    // list of defined types for the module
    case 'list':
      return array('audio');
      
    // list of extensions for the particular type
    case 'extensions':
      return array('mp3');
      
    // information regarding the type
    case 'info':
      return array(
        'audio' => array(
          'title' => t('Audio'),
          'description' => t('These are audio files.'),
        ),
      );
      
    // provides the form details for the type
    case 'configure':
      break;
      
    // validates the form details from configure
    case 'validate':
      break;
    
    // allows intervention to convert form return values into something more appropriate for storage
    case 'save':
      break;
  }  
}
