/* * audio_dummy.cpp - Audio support, dummy implementation * * Basilisk II (C) 1997-2000 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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 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 "sysdeps.h" #include "prefs.h" #include "audio.h" #include "audio_defs.h" #define DEBUG 0 #include "debug.h" // Supported sample rates, sizes and channels int audio_num_sample_rates = 1; uint32 audio_sample_rates[] = {44100 << 16}; int audio_num_sample_sizes = 1; uint16 audio_sample_sizes[] = {16}; int audio_num_channel_counts = 1; uint16 audio_channel_counts[] = {2}; /* * Initialization */ void AudioInit(void) { // Init audio status and feature flags AudioStatus.sample_rate = audio_sample_rates[0]; AudioStatus.sample_size = audio_sample_sizes[0]; AudioStatus.channels = audio_channel_counts[0]; AudioStatus.mixer = 0; AudioStatus.num_sources = 0; audio_component_flags = cmpWantsRegisterMessage | kStereoOut | k16BitOut; // Sound disabled in prefs? Then do nothing if (PrefsFindBool("nosound")) return; // Audio not available audio_open = false; } /* * Deinitialization */ void AudioExit(void) { } /* * First source added, start audio stream */ void audio_enter_stream() { } /* * Last source removed, stop audio stream */ void audio_exit_stream() { } /* * MacOS audio interrupt, read next data block */ void AudioInterrupt(void) { D(bug("AudioInterrupt\n")); } /* * Set sampling parameters * "index" is an index into the audio_sample_rates[] etc. arrays * It is guaranteed that AudioStatus.num_sources == 0 */ void audio_set_sample_rate(int index) { } void audio_set_sample_size(int index) { } void audio_set_channels(int index) { } /* * Get/set volume controls (volume values received/returned have the left channel * volume in the upper 16 bits and the right channel volume in the lower 16 bits; * both volumes are 8.8 fixed point values with 0x0100 meaning "maximum volume")) */ bool audio_get_main_mute(void) { return false; } uint32 audio_get_main_volume(void) { return 0x01000100; } bool audio_get_speaker_mute(void) { return false; } uint32 audio_get_speaker_volume(void) { return 0x01000100; } void audio_set_main_mute(bool mute) { } void audio_set_main_volume(uint32 vol) { } void audio_set_speaker_mute(bool mute) { } void audio_set_speaker_volume(uint32 vol) { }