/* * test_audio.c - Test program for new API * * Copyright (C) 2000 Ralph Metzler * & Marcus Metzler for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include int audioStop(int fd) { int ans; if ((ans = ioctl(fd,AUDIO_STOP,0)) < 0) { perror("AUDIO STOP: "); return -1; } return 0; } int audioPlay(int fd) { int ans; if ((ans = ioctl(fd,AUDIO_PLAY)) < 0) { perror("AUDIO PLAY: "); return -1; } return 0; } int audioPause(int fd) { int ans; if ((ans = ioctl(fd,AUDIO_PAUSE)) < 0) { perror("AUDIO PAUSE: "); return -1; } return 0; } int audioContinue(int fd) { int ans; if ((ans = ioctl(fd,AUDIO_CONTINUE)) < 0) { perror("AUDIO CONTINUE: "); return -1; } return 0; } int audioSelectSource(int fd, audio_stream_source_t source) { int ans; if ((ans = ioctl(fd,AUDIO_SELECT_SOURCE, source)) < 0) { perror("AUDIO SELECT SOURCE: "); return -1; } return 0; } int audioSetMute(int fd, boolean state) { int ans; if ((ans = ioctl(fd,AUDIO_SET_MUTE, state)) < 0) { perror("AUDIO SET MUTE: "); return -1; } return 0; } int audioSetAVSync(int fd,boolean state) { int ans; if ((ans = ioctl(fd,AUDIO_SET_AV_SYNC, state)) < 0) { perror("AUDIO SET AV SYNC: "); return -1; } return 0; } int audioSetBypassMode(int fd,boolean mode) { int ans; if ((ans = ioctl(fd,AUDIO_SET_BYPASS_MODE, mode)) < 0) { printf("AUDIO SET BYPASS MODE not implemented?\n"); return -1; } return 0; } int audioChannelSelect(int fd, audio_channel_select_t select) { int ans; if ((ans = ioctl(fd,AUDIO_CHANNEL_SELECT, select)) < 0) { perror("AUDIO CHANNEL SELECT: "); return -1; } return 0; } int audioGetStatus(int fd) { struct audio_status stat; int ans; if ((ans = ioctl(fd,AUDIO_GET_STATUS, &stat)) < 0) { perror("AUDIO GET STATUS: "); return -1; } printf("Audio Status:\n"); printf(" Sync State : %s\n", (stat.AV_sync_state ? "SYNC" : "NO SYNC")); printf(" Mute State : %s\n", (stat.mute_state ? "muted" : "not muted")); printf(" Play State : "); switch ((int)stat.play_state){ case AUDIO_STOPPED: printf("STOPPED (%d)\n",stat.play_state); break; case AUDIO_PLAYING: printf("PLAYING (%d)\n",stat.play_state); break; case AUDIO_PAUSED: printf("PAUSED (%d)\n",stat.play_state); break; default: printf("unknown (%d)\n",stat.play_state); break;
# SBS 6 @ 74W
# freq pol sr fec

S 11744000 H 06616000 AUTO