libcdio  0.90
audio.h
Go to the documentation of this file.
00001 /* -*- c -*-
00002     Copyright (C) 2005, 2007, 2008 Rocky Bernstein <rocky@gnu.org>
00003 
00004     This program is free software: you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation, either version 3 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00024 #ifndef CDIO_AUDIO_H_
00025 #define CDIO_AUDIO_H_
00026 
00027 #include <cdio/types.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif /* __cplusplus */
00032 
00034   typedef struct cdio_subchannel_s 
00035   {
00036     uint8_t format;
00037     uint8_t audio_status;
00038     uint8_t address:    4;
00039     uint8_t control:    4;
00040     uint8_t track;
00041     uint8_t index;
00042     msf_t   abs_addr;
00043     msf_t   rel_addr;
00044   } cdio_subchannel_t;
00045   
00047   typedef struct cdio_audio_volume_s
00048   {
00049     uint8_t level[4];
00050   } cdio_audio_volume_t;
00051   
00052 
00054   typedef struct cdio_track_index_s
00055   {
00056     uint8_t     i_start_track;  
00057     uint8_t     i_start_index;  
00058     uint8_t     i_end_track;    
00059     uint8_t     i_end_index;    
00060   } cdio_track_index_t;
00061 
00072   driver_return_code_t cdio_audio_get_volume (CdIo_t *p_cdio,  /*out*/
00073                                               cdio_audio_volume_t *p_volume);
00074 
00078   uint32_t cdio_audio_get_msf_seconds(msf_t *p_msf);
00079 
00085   driver_return_code_t cdio_audio_pause (CdIo_t *p_cdio);
00086 
00094   driver_return_code_t cdio_audio_play_msf (CdIo_t *p_cdio, 
00095                                             /*in*/msf_t *p_start_msf,
00096                                             /*in*/ msf_t *p_end_msf);
00097 
00104   driver_return_code_t cdio_audio_play_track_index 
00105   ( CdIo_t *p_cdio,  cdio_track_index_t *p_track_index);
00106 
00113   driver_return_code_t cdio_audio_read_subchannel (CdIo_t *p_cdio, 
00114                                                    /*out*/ cdio_subchannel_t *p_subchannel);
00115 
00122   driver_return_code_t cdio_audio_resume (CdIo_t *p_cdio);
00123 
00131   driver_return_code_t cdio_audio_set_volume (CdIo_t *p_cdio, /*out*/
00132                                               cdio_audio_volume_t *p_volume);
00133 
00140   driver_return_code_t cdio_audio_stop (CdIo_t *p_cdio);
00141 
00142 #ifdef __cplusplus
00143 }
00144 #endif /* __cplusplus */
00145 
00146 #endif /* CDIO_AUDIO_H_ */