summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11/sound.c
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2006-08-12 10:28:30 +0000
committerDan Everton <dan@iocaine.org>2006-08-12 10:28:30 +0000
commit9d2929b79b22765701e9db240d967877d7f7bab8 (patch)
tree0829913b3e58ce5d1886358395d42c5cee80ce6c /uisimulator/x11/sound.c
parent509ee3d42cfe0660a107ae169a11cef9c0604b1f (diff)
downloadrockbox-9d2929b79b22765701e9db240d967877d7f7bab8.tar.gz
rockbox-9d2929b79b22765701e9db240d967877d7f7bab8.tar.bz2
rockbox-9d2929b79b22765701e9db240d967877d7f7bab8.zip
Remove Win32 and X11 simulator sources. They've been deprecated for a while in favour of the SDL sim. Time to go.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10543 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11/sound.c')
-rw-r--r--uisimulator/x11/sound.c140
1 files changed, 0 insertions, 140 deletions
diff --git a/uisimulator/x11/sound.c b/uisimulator/x11/sound.c
deleted file mode 100644
index 06d9c014ff..0000000000
--- a/uisimulator/x11/sound.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2005 by Daniel Stenberg <daniel@haxx.se>
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-#include "autoconf.h"
-
-#ifdef ROCKBOX_HAS_SIMSOUND /* play sound in sim enabled */
-
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/soundcard.h>
-
-#include "sound.h"
-
-static bool playing = false;
-
-int sim_sound_init(void)
-{
- int fd;
- int pcmbits;
- int rc;
- int channels;
- int rate;
-
- fd = open("/dev/dsp", O_WRONLY);
- if(-1 == fd)
- return 1;
-
- pcmbits = 16;
- rc = ioctl(fd, SOUND_PCM_WRITE_BITS, &pcmbits);
- rc = ioctl(fd, SOUND_PCM_READ_BITS, &pcmbits);
-
- channels = 2; /* Number of channels, 1=mono */
- rc = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &channels);
- rc = ioctl(fd, SOUND_PCM_READ_CHANNELS, &channels);
-
- rate = 44100; /* Yeah. sampling rate */
- rc = ioctl(fd, SOUND_PCM_WRITE_RATE, &rate);
- rc = ioctl(fd, SOUND_PCM_READ_RATE, &rate);
-
- return fd;
-}
-
-void sim_sound_play(int soundfd, char *buffer, long len)
-{
- write(soundfd, buffer, len);
-}
-
-void sound_playback_thread(void)
-{
- int soundfd = sim_sound_init();
- unsigned char *buf;
- long size;
-
- while(-1 == soundfd)
- sleep(100000); /* wait forever, can't play sound! */
-
- do {
-
- while(!sound_get_pcm)
- /* TODO: fix a fine thread-synch mechanism here */
- usleep(10000);
-
- do {
- sound_get_pcm(&buf, &size);
- if(!size) {
- sound_get_pcm = NULL;
- break;
- }
- sim_sound_play(soundfd, (char *)buf, size);
- usleep(10000);
- } while(size);
-
- } while(1);
-
-}
-
-/* Stubs for PCM audio playback. */
-bool pcm_is_playing(void)
-{
- return playing;
-}
-
-void pcm_mute(bool state)
-{
- (void)state;
-}
-
-void pcm_play_pause(bool state)
-{
- (void)state;
-}
-
-bool pcm_is_paused(void)
-{
- return false;
-}
-
-void pcm_play_stop(void)
-{
- playing = false;
-}
-
-void pcm_init(void)
-{
-}
-
-void (*sound_get_pcm)(unsigned char** start, long* size);
-void pcm_play_data(void (*get_more)(unsigned char** start, long* size))
-{
- sound_get_pcm = get_more;
- playing = true;
-}
-
-long pcm_get_bytes_waiting(void)
-{
- return 0;
-}
-
-#endif /* ROCKBOX_HAS_SIMSOUND */