diff options
author | Robert Jonsson <spamatica@gmail.com> | 2011-09-15 12:14:55 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2011-09-15 12:14:55 +0000 |
commit | b0546e5e7f7044019892543c6c82029db8d564a7 (patch) | |
tree | 1b96a6260900f3fbf3513fb48a5a72aa89052dc8 /attic/muse_qt4_evolution/muse/audiowriteback.cpp | |
parent | 583c73d1a07154d3d2672d65d8cce6495f490454 (diff) |
moved attic to a branch of it's own
Diffstat (limited to 'attic/muse_qt4_evolution/muse/audiowriteback.cpp')
-rw-r--r-- | attic/muse_qt4_evolution/muse/audiowriteback.cpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/attic/muse_qt4_evolution/muse/audiowriteback.cpp b/attic/muse_qt4_evolution/muse/audiowriteback.cpp deleted file mode 100644 index 391c89bd..00000000 --- a/attic/muse_qt4_evolution/muse/audiowriteback.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// 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., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#include <poll.h> - -#include "audiowriteback.h" -#include "globals.h" -#include "audio.h" -#include "song.h" - -AudioWriteback* audioWriteback; - -//--------------------------------------------------------- -// AudioWriteback -//--------------------------------------------------------- - -AudioWriteback::AudioWriteback(const char* name) - : Thread(name) - { - counter = 0; - } - -//--------------------------------------------------------- -// readMsg -//--------------------------------------------------------- - -static void readMsgP(void* p, void*) - { - AudioWriteback* at = (AudioWriteback*)p; - at->readMsg1(1); - } - -//--------------------------------------------------------- -// start -//--------------------------------------------------------- - -void AudioWriteback::start(int priority) - { - clearPollFd(); - addPollFd(toThreadFdr, POLLIN, ::readMsgP, this, 0); - Thread::start(priority); - } - -//--------------------------------------------------------- -// processMsg -//--------------------------------------------------------- - -void AudioWriteback::processMsg1(const void*) - { - while (counter) { - //q_atomic_decrement(&counter); - --counter; - - OutputList* ol = song->outputs(); - if (!ol->empty()) { - AudioOutput* ao = ol->front(); - if (ao->recordFlag()) - ao->record(); - } - WaveTrackList* tl = song->waves(); - for (iWaveTrack t = tl->begin(); t != tl->end(); ++t) { - WaveTrack* track = *t; - if (track->recordFlag()) - track->record(); - } - } - } - -//--------------------------------------------------------- -// trigger -// trigger audio writeback loop -//--------------------------------------------------------- - -void AudioWriteback::trigger() - { - // q_atomic_increment(&counter); - ++counter; - if (counter < 2) { - if (sendMsg1("0", 1)) { - printf("AudioWriteback::msgTick(): send failed!\n"); - } - } - } - |