diff options
author | Werner Schweer <ws.seh.de> | 2006-10-24 15:48:33 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-10-24 15:48:33 +0000 |
commit | e1e11546e52d4a87fc25a2a891ee6e74e39bed97 (patch) | |
tree | 38b25e8f277f7b23f3bfbba0d949a42bb4b18528 | |
parent | d813f57ddfeb69ba28c772f7bfc0ae5f7017f71a (diff) |
updates
-rw-r--r-- | muse/muse/audio.cpp | 35 | ||||
-rw-r--r-- | muse/muse/audio.h | 3 | ||||
-rw-r--r-- | muse/muse/driver/jack.cpp | 11 | ||||
-rw-r--r-- | muse/muse/midiseq.cpp | 1 | ||||
-rw-r--r-- | muse/muse/track.cpp | 6 |
5 files changed, 17 insertions, 39 deletions
diff --git a/muse/muse/audio.cpp b/muse/muse/audio.cpp index b3e77213..f88a1934 100644 --- a/muse/muse/audio.cpp +++ b/muse/muse/audio.cpp @@ -108,7 +108,6 @@ Audio::Audio() clicksMeasure = 0; ticksBeat = 0; - syncTime = 0.0; state = STOP; lmark = 0; // left loop position rmark = 0; // right loop position @@ -159,7 +158,6 @@ bool Audio::start() clicksMeasure = 0; ticksBeat = 0; - syncTime = 0.0; msg = 0; _pos.setFrame(~0); // make sure seek is not optimized away @@ -321,7 +319,6 @@ void Audio::process(unsigned frames, int jackState) } if (jackState != state) { -// printf("process %s %s\n", audioStates[state], audioStates[jackState]); if (state == START_PLAY && jackState == PLAY) { startRolling(); if (_bounce) @@ -332,34 +329,23 @@ void Audio::process(unsigned frames, int jackState) seek(newPos); startRolling(); } - else if (isPlaying() && jackState == STOP) { + else if (isPlaying() && jackState == STOP) stopRolling(); - } else if (state == START_PLAY && jackState == STOP) { state = STOP; updateController = true; - if (_bounce) { + if (_bounce) audioDriver->startTransport(); - } - else { + else sendMsgToGui(MSG_STOP); - } } - else if (state == STOP && jackState == PLAY) { + else if (state == STOP && jackState == PLAY) startRolling(); - } - else if (state == LOOP1 && jackState == PLAY) - ; // treat as play - else if (state == LOOP2 && jackState == START_PLAY) - ; // sync cycle, treat as play - else - printf("JACK: state transition %s -> %s ?\n", - audioStates[state], audioStates[jackState]); } OutputList* ol = song->outputs(); if (idle || state == START_PLAY) { - // deliver no audio + // deliver silence for (iAudioOutput i = ol->begin(); i != ol->end(); ++i) (*i)->silence(frames); return; @@ -421,12 +407,6 @@ void Audio::process(unsigned frames, int jackState) } // - // resync with audio interface - // syncTime - corresponding wall clock time - // - syncTime = curTime(); - - // // compute current controller values // (automation) // @@ -569,11 +549,8 @@ void Audio::processMsg() case SEQM_SET_GLOBAL_TEMPO: case SEQM_SET_TEMPO: song->processMsg(msg); - if (isPlaying()) { + if (isPlaying()) _pos.setTick(_curTickPos); -// int framePos = _pos.frame(); - syncTime = curTime(); - } break; case SEQM_IDLE: diff --git a/muse/muse/audio.h b/muse/muse/audio.h index 6934f0db..3a0eacbd 100644 --- a/muse/muse/audio.h +++ b/muse/muse/audio.h @@ -170,9 +170,6 @@ class Audio { int clicksMeasure; int ticksBeat; - double syncTime; // wall clock at last sync point -// unsigned syncFrame; // corresponding frame no. to syncTime - State state; bool updateController; diff --git a/muse/muse/driver/jack.cpp b/muse/muse/driver/jack.cpp index b90958f0..34d33507 100644 --- a/muse/muse/driver/jack.cpp +++ b/muse/muse/driver/jack.cpp @@ -826,14 +826,17 @@ void JackAudio::putEvent(Port port, const MidiEvent& e) unsigned ft; if (transportState == JackTransportRolling) { ft = e.time() - pos.frame; - if (pos.frame > e.time()) + if (pos.frame > e.time()) { +printf("time < 0 -- %d\n", pos.frame - e.time()); ft = 0; - else if (ft >= segmentSize) - ft = segmentSize -1; + } + else if (ft >= segmentSize) { + ft = segmentSize - 1; +printf("time >= segmentSize -- %d\n", segmentSize - ft); + } } else ft = 0; - switch(e.type()) { case ME_NOTEON: case ME_NOTEOFF: diff --git a/muse/muse/midiseq.cpp b/muse/muse/midiseq.cpp index 47d70cb2..3072d784 100644 --- a/muse/muse/midiseq.cpp +++ b/muse/muse/midiseq.cpp @@ -25,6 +25,7 @@ #include "audio.h" #include "driver/mididev.h" #include "driver/audiodev.h" +#include "driver/jackaudio.h" #ifdef __APPLE__ #include "driver/coretimer.h" diff --git a/muse/muse/track.cpp b/muse/muse/track.cpp index f2937450..276585c8 100644 --- a/muse/muse/track.cpp +++ b/muse/muse/track.cpp @@ -39,13 +39,13 @@ // synchronize with TrackType!: const char* Track::_cname[] = { - "Output", "Group", "Wave", "Input", - "Synti", "Midi", "MidiOut", "MidiIn", "M-Ch", "M-Synth" + "AudioOut", "Group", "Wave", "AudioIn", + "Synth", "Midi", "MidiOut", "MidiIn", "M-Ch", "M-Synth" }; const char* Track::_clname[] = { "Audio Output", "Audio Group", "Wave Track", "Audio Input", - "Synti", "Midi Track", "Midi Outport", "Midi Inport", "Midi Channel", + "Synti", "Midi Track", "Midi Output", "Midi Input", "Midi Channel", "Midi Synth" }; |