shots += para_slider-2004-12.png sdl_gui.jpg para_krell-2005-02.png
shots := $(patsubst %,web/sync/%,$(shots))
web_pics := web/sync/paraslash.png web/sync/paraslash.ico
-web_misc := demo-script overview.pdf versions/paraslash-git.tar.bz2 PUBLIC_KEY key.anonymous para.css doc
+web_misc := overview.pdf versions/paraslash-git.tar.bz2 PUBLIC_KEY key.anonymous para.css doc
web_misc := $(patsubst %,web/sync/%,$(web_misc))
autocrap := config.h.in configure
cp $< $@
web/sync/%.ico: pics/web/%.ico web/sync
cp $< $@
-web/sync/demo-script: scripts/demo-script web/sync
- cp $< $@
web/sync/para.css: web/para.css web/sync
cp $< $@
web/sync/versions/paraslash-git.tar.bz2: paraslash-git.tar.bz2 web/sync
static int open_tcp_port(int port)
{
+ int ret;
+
server_fd = init_tcp_socket(port);
if (server_fd < 0) {
http_shutdown_clients();
self->status = SENDER_OFF;
return server_fd;
}
+ ret = mark_fd_nonblock(server_fd);
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
+ exit(EXIT_FAILURE);
+ }
self->status = SENDER_ON;
add_close_on_fork_list(server_fd);
return 1;
* @param buf the buffer to be encrypted and sent
* @param len the length of \a buf
*
- * Check if encrytion is available. If yes, encrypt the given buffer. Send out
+ * Check if encrytpion is available. If yes, encrypt the given buffer. Send out
* the buffer, encrypted or not, and try to resend the remaing part in case of
* short writes.
*
* @param buf the buffer to write the decrypted data to
* @param size the size of @param buf
*
- * Receive at most \a size bytes from filedescriptor fd. If encrytion is
+ * Receive at most \a size bytes from filedescriptor fd. If encryption is
* available, decrypt the received buffer.
*
* @return the number of bytes received on success. On receive errors, -E_RECV
struct osx_buffer *next;
};
+/** data specific to the osx writer */
struct private_osx_write_data {
- long size;
- AudioUnit output;
+ /** the main control structure for audio data manipulation */
+ AudioUnit audio_unit;
+ /** non-zero if playback has started */
char play;
- struct osx_buffer *from; /* Current buffers */
+ /** callback reads audio data from this buffer */
+ struct osx_buffer *from;
+ /* the post_select writes audio data here */
struct osx_buffer *to;
+ /** sample rate of the current audio stream */
unsigned samplerate;
+ /** number of channels of the current audio stream */
unsigned channels;
};
if (!comp)
goto e0;
ret = -E_OPEN_COMP;
- if (OpenAComponent(comp, &powd->output))
+ if (OpenAComponent(comp, &powd->audio_unit))
goto e0;
ret = -E_UNIT_INIT;
- if (AudioUnitInitialize(powd->output))
+ if (AudioUnitInitialize(powd->audio_unit))
goto e1;
- powd->size = 0;
powd->play = 0;
/* Hmmm, let's choose PCM format */
/* We tell the Output Unit what format we're going to supply data to it.
/* one of the most constant constants of the whole computer history */
format.mBitsPerChannel = sizeof(float) * 8;
ret = -E_STREAM_FORMAT;
- if (AudioUnitSetProperty(powd->output, kAudioUnitProperty_StreamFormat,
+ if (AudioUnitSetProperty(powd->audio_unit, kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input, 0, &format,
sizeof(AudioStreamBasicDescription)))
goto e2;
init_buffers(wn);
ret = -E_ADD_CALLBACK;
- if (AudioUnitSetProperty(powd->output, kAudioUnitProperty_SetRenderCallback,
+ if (AudioUnitSetProperty(powd->audio_unit, kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input, 0, &inputCallback,
sizeof(inputCallback)) < 0)
goto e3;
e3:
destroy_buffers(powd);
e2:
- AudioUnitUninitialize(powd->output);
+ AudioUnitUninitialize(powd->audio_unit);
e1:
- CloseComponent(powd->output);
+ CloseComponent(powd->audio_unit);
e0:
return ret;
}
struct private_osx_write_data *powd = wn->private_data;
PARA_INFO_LOG("closing writer node %p\n", wn);
- AudioOutputUnitStop(powd->output);
- AudioUnitUninitialize(powd->output);
- CloseComponent(powd->output);
+ AudioOutputUnitStop(powd->audio_unit);
+ AudioUnitUninitialize(powd->audio_unit);
+ CloseComponent(powd->audio_unit);
destroy_buffers(powd);
free(powd);
}
powd->to = powd->to->next;
wn->written = *wng->loaded;
if (!powd->play) {
- if (AudioOutputUnitStart(powd->output))
+ if (AudioOutputUnitStart(powd->audio_unit))
return -E_UNIT_START;
powd->play = 1;
}
return 1;
}
+/** the init function of the osx writer */
void osx_write_init(struct writer *w)
{
w->open = osx_write_open;
+++ /dev/null
-#!/bin/bash
-
-bin="para_client para_audioc para_audiod para_gui" # the binaries we need
-log="`pwd`/demo-log.$$.log"
-dir="$HOME/.paraslash"
-client_conf="$dir/client.conf"
-audioc_conf="$dir/audioc.conf"
-server=www.paraslash.org
-proj=paraslash-0.2.13
-df=$proj.tar.bz2 # download file
-url=http://$server/versions/$df
-kf="$dir/key.anonymous" # key file
-key_url=http://$server/key.anonymous
-socket="$dir/socket"
-receiver_opts="mp3:http -i $server -p 8009"
-audiod_log="$dir/audiod.log"
-audiod_opts="-FDd -L $audiod_log -s $socket"
-msg()
-{
- echo "`date`: $1"
-}
-
-go()
-{
- msg "downloading $df"
- wget -N -q $url || return 1
- msg "decompressing"
- rm -rf $proj; tar xjf $df
- cd $proj || return 1
- msg "configuring (be patient, ignore warnings but not errors)"
- ./configure --prefix "$HOME" >> "$log"
- msg "building $bin"
- make $bin >> "$log"
- msg "installing"
- mkdir -p $HOME/bin && install -c -s -m 755 $bin $HOME/bin || return 1
- export PATH=$HOME/bin:$PATH
- msg "retrieving anonymous key"
- mkdir -p $dir || return 1
- wget -q --directory-prefix=$dir $key_url || return 1
- msg "writing $client_conf"
- cat << EOF > "$client_conf"
- user "anonymous"
- hostname "$server"
- key_file "$kf"
-EOF
- msg "writing $audioc_conf"
- echo "socket \"$socket\"" > "$audioc_conf"
- (para_audioc term; killall para_audiod para_client) >> "$log" 2>&1
- msg "para_audiod $audiod_opts -r '$receiver_opts'"
- para_audiod $audiod_opts -r "$receiver_opts" -w "mp3:mpg123 -"
- echo "hit return to start para_gui, hit ctrl+c to abort"
- read
- para_gui
-}
-
-go
static unsigned init_network(void)
{
- int sockfd = init_tcp_socket(conf.port_arg);
+ int fd, ret = init_tcp_socket(conf.port_arg);
- if (sockfd < 0)
- exit(EXIT_FAILURE);
- return sockfd;
+ if (ret < 0)
+ goto err;
+ fd = ret;
+ ret = mark_fd_nonblock(fd);
+ if (ret < 0)
+ goto err;
+ return fd;
+err:
+ PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
+ exit(EXIT_FAILURE);
}
static void init_random_seed(void)
You can listen to the stream with any mp3 player that supports
-http streaming. Both </p>
+http streaming.</p>
<p>mpg123 -Z http://www.paraslash.org:8009/</p>
-and
<p>xmms http://www.paraslash.org:8009/</p>
-<p> are known to work.</p>
-
-<p> Moreover, there is an anonymous paraslash account
-available which you can use to have a look at paraslash
-without configuring and running para_server on your own box.
-Just download and run
-
- <a href="demo-script">this shell script</a>
-
-on your Unix system. No root-privileges are required.</p>
-
+<p>and iTunes are known to work.</p>
+
+<p> Moreover, there is an anonymous paraslash account available which you can
+use to have a look at paraslash without configuring and running para_server on
+your own box. There's no need to install the paraslash package and no
+root-privileges are required for the demo. </p>
+
+<p>Download the
+
+ <a href="key.anonymous">public key</a>
+
+for the anonymous user and the latest paraslash
+
+ <a href="versions">tarball</a>
+or the
+ <a href="versions/paraslash-git.tar.bz2">current snapshot</a>.
+
+Next, compile para_audiod (./configure && make para_audiod) and use the
+following configuration options:</p>
+<ul>
+ <li> ~/.paraslash/client.conf:
+ <ul>
+ <li>user anonymous</li>
+ <li>hostname www.paraslash.org</li>
+ <li>key_file key.anonymous</li>
+ </ul>
+ <li> ~/.paraslash/audiod.conf:</li>
+ <ul>
+ <li>receiver "mp3:http -i www.paraslash.org -p 8009"</li>
+ <li>loglevel 1</li>
+ </ul>
+</ul>
+<p>Finally, type "./para_audiod" to start streaming. If this works, try out
+para_client, para_gui and para_audioc. Otherwise, use para_recv, para_filter
+and para_write to find out why.</p>