From: <pst...@us...> - 2010-04-25 03:22:11
|
Revision: 749 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=749&view=rev Author: pstieber Date: 2010-04-25 03:22:05 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Changed curly bracket placement. Modified Paths: -------------- trunk/jazz/src/AlsaThru.cpp Modified: trunk/jazz/src/AlsaThru.cpp =================================================================== --- trunk/jazz/src/AlsaThru.cpp 2010-04-25 03:17:18 UTC (rev 748) +++ trunk/jazz/src/AlsaThru.cpp 2010-04-25 03:22:05 UTC (rev 749) @@ -83,20 +83,23 @@ snd_seq_port_subscribe_alloca(&subs); snd_seq_port_subscribe_set_sender(subs, &src); snd_seq_port_subscribe_set_dest(subs, &dest); - if (snd_seq_unsubscribe_port(handle, subs) < 0) { + if (snd_seq_unsubscribe_port(handle, subs) < 0) + { perror("unsubscribe"); } } void tAlsaThru::initialize() { - if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0 ) < 0) { + if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0 ) < 0) + { perror("open"); exit(1); } tAlsaPlayer::set_client_info(handle, "Jazz++ Midi Thru"); - if (snd_seq_nonblock(handle, 0) < 0) { + if (snd_seq_nonblock(handle, 0) < 0) + { perror("blocking mode"); exit(1); } @@ -113,7 +116,8 @@ #ifdef USE_DIRECT_CONNECTION void tAlsaThru::Start() { - if (! running) { + if (! running) + { initialize(); connect(source, destin); running = 1; @@ -138,8 +142,10 @@ void tAlsaThru::loop() { snd_seq_event_t *ev; - while (snd_seq_event_input(handle, &ev) >= 0 && ev != 0) { - if (ev->source.client == source.client && ev->source.port == source.port) { + while (snd_seq_event_input(handle, &ev) >= 0 && ev != 0) + { + if (ev->source.client == source.client && ev->source.port == source.port) + { ev->flags &= ~SND_SEQ_TIME_STAMP_MASK; ev->flags |= SND_SEQ_TIME_STAMP_TICK; ev->time.tick = 0; @@ -202,13 +208,16 @@ void tAlsaThru::Start() { - if (!running) { + if (!running) + { worker = fork(); - if (worker < 0) { + if (worker < 0) + { perror("fork"); exit(1); } - if (worker == 0) { + if (worker == 0) + { signal(SIGHUP, stopworker); initialize(); loop(); @@ -223,7 +232,8 @@ void tAlsaThru::Stop() { - if (running) { + if (running) + { int status = 0; kill(worker, SIGHUP); wait(&status); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |