summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-09-01 20:44:18 +0000
committerTim E. Real <termtech@rogers.com>2011-09-01 20:44:18 +0000
commit538afdda358cc49cac4554c1ce24ad2f50383907 (patch)
treed8a8c240ee9b8aa604b5c0cbeab6748b1f74351a /muse2/muse
parent1414d8185ca9bc0b078cff7512482f013e28bde3 (diff)
Fixed tough old skeleton: Selecting 'previous/next event' in Song::execAutomationCtlPopup now
moves cursor with exact frame resolution. Reverted controls to full speed (again): Removed too-cautious msgSetVolume, msgSetPan, msgSetPluginCtrlVal. Reviewing some other possibly unneeded too-cautious msgXXX audio messages :) TODO: Fix current automation values (the 'off' value). Removed unused PanKnob from mixer CMakeLists.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/audio.cpp22
-rw-r--r--muse2/muse/audio.h10
-rw-r--r--muse2/muse/audiotrack.cpp15
-rw-r--r--muse2/muse/ctrl.cpp15
-rw-r--r--muse2/muse/ctrl.h4
-rw-r--r--muse2/muse/globals.cpp2
-rw-r--r--muse2/muse/main.cpp2
-rw-r--r--muse2/muse/mixer/CMakeLists.txt2
-rw-r--r--muse2/muse/mixer/astrip.cpp61
-rw-r--r--muse2/muse/mixer/panknob.cpp8
-rw-r--r--muse2/muse/plugin.cpp28
-rw-r--r--muse2/muse/seqmsg.cpp4
-rw-r--r--muse2/muse/song.cpp51
13 files changed, 151 insertions, 73 deletions
diff --git a/muse2/muse/audio.cpp b/muse2/muse/audio.cpp
index 668c2a30..e6d8f251 100644
--- a/muse2/muse/audio.cpp
+++ b/muse2/muse/audio.cpp
@@ -68,11 +68,11 @@ const char* seqMsgList[] = {
"MIDI_SHOW_INSTR_NATIVE_GUI",
"AUDIO_RECORD",
"AUDIO_ROUTEADD", "AUDIO_ROUTEREMOVE", "AUDIO_REMOVEROUTES",
- "AUDIO_VOL", "AUDIO_PAN",
+ //"AUDIO_VOL", "AUDIO_PAN",
"AUDIO_ADDPLUGIN",
"AUDIO_SET_SEG_SIZE",
"AUDIO_SET_PREFADER", "AUDIO_SET_CHANNELS",
- "AUDIO_SET_PLUGIN_CTRL_VAL",
+ //"AUDIO_SET_PLUGIN_CTRL_VAL",
"AUDIO_SWAP_CONTROLLER_IDX",
"AUDIO_CLEAR_CONTROLLER_EVENTS",
"AUDIO_SEEK_PREV_AC_EVENT",
@@ -632,12 +632,12 @@ void Audio::processMsg(AudioMsg* msg)
case AUDIO_REMOVEROUTES: // p3.3.55
removeAllRoutes(msg->sroute, msg->droute);
break;
- case AUDIO_VOL:
- msg->snode->setVolume(msg->dval);
- break;
- case AUDIO_PAN:
- msg->snode->setPan(msg->dval);
- break;
+ //case AUDIO_VOL:
+ // msg->snode->setVolume(msg->dval);
+ // break;
+ //case AUDIO_PAN:
+ // msg->snode->setPan(msg->dval);
+ // break;
case SEQM_SET_AUX:
msg->snode->setAuxSend(msg->ival, msg->dval);
break;
@@ -650,11 +650,11 @@ void Audio::processMsg(AudioMsg* msg)
case AUDIO_ADDPLUGIN:
msg->snode->addPlugin(msg->plugin, msg->ival);
break;
- case AUDIO_SET_PLUGIN_CTRL_VAL:
+ //case AUDIO_SET_PLUGIN_CTRL_VAL:
//msg->plugin->track()->setPluginCtrlVal(msg->ival, msg->dval);
// p3.3.43
- msg->snode->setPluginCtrlVal(msg->ival, msg->dval);
- break;
+ // msg->snode->setPluginCtrlVal(msg->ival, msg->dval);
+ // break;
case AUDIO_SWAP_CONTROLLER_IDX:
msg->snode->swapControllerIDX(msg->a, msg->b);
break;
diff --git a/muse2/muse/audio.h b/muse2/muse/audio.h
index ea9986c3..12d87ade 100644
--- a/muse2/muse/audio.h
+++ b/muse2/muse/audio.h
@@ -62,11 +62,11 @@ enum {
MIDI_SHOW_INSTR_NATIVE_GUI,
AUDIO_RECORD,
AUDIO_ROUTEADD, AUDIO_ROUTEREMOVE, AUDIO_REMOVEROUTES,
- AUDIO_VOL, AUDIO_PAN,
+ //AUDIO_VOL, AUDIO_PAN,
AUDIO_ADDPLUGIN,
AUDIO_SET_SEG_SIZE,
AUDIO_SET_PREFADER, AUDIO_SET_CHANNELS,
- AUDIO_SET_PLUGIN_CTRL_VAL,
+ //AUDIO_SET_PLUGIN_CTRL_VAL,
AUDIO_SWAP_CONTROLLER_IDX,
AUDIO_CLEAR_CONTROLLER_EVENTS,
AUDIO_SEEK_PREV_AC_EVENT,
@@ -230,8 +230,8 @@ class Audio {
void msgAddRoute1(Route, Route);
void msgAddPlugin(AudioTrack*, int idx, PluginI* plugin);
void msgSetMute(AudioTrack*, bool val);
- void msgSetVolume(AudioTrack*, double val);
- void msgSetPan(AudioTrack*, double val);
+ //void msgSetVolume(AudioTrack*, double val);
+ //void msgSetPan(AudioTrack*, double val);
void msgAddSynthI(SynthI* synth);
void msgRemoveSynthI(SynthI* synth);
void msgSetSegSize(int, int);
@@ -246,7 +246,7 @@ class Audio {
void msgResetMidiDevices();
void msgIdle(bool);
void msgBounce();
- void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
+ //void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
void msgSwapControllerIDX(AudioTrack*, int, int);
void msgClearControllerEvents(AudioTrack*, int);
void msgSeekPrevACEvent(AudioTrack*, int);
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index 42229111..23484141 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -23,6 +23,7 @@
#include "audiodev.h"
#include "synth.h"
#include "dssihost.h"
+#include "app.h"
bool AudioAux::_isVisible=true;
bool AudioInput::_isVisible=true;
@@ -606,10 +607,13 @@ void AudioTrack::seekPrevACEvent(int id)
if(cl->empty())
return;
- iCtrl s = cl->lower_bound(song->cPos().frame());
+ //iCtrl s = cl->lower_bound(song->cPos().frame());
+ iCtrl s = cl->lower_bound(audio->pos().frame()); // p4.0.33
if(s != cl->begin())
--s;
- song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+
+ //song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ song->setPos(Song::CPOS, Pos(s->second.frame, false), false, true, false); // p4.0.33
return;
}
@@ -627,13 +631,16 @@ void AudioTrack::seekNextACEvent(int id)
if(cl->empty())
return;
- iCtrl s = cl->upper_bound(song->cPos().frame());
+ //iCtrl s = cl->upper_bound(song->cPos().frame());
+ iCtrl s = cl->upper_bound(audio->pos().frame()); // p4.0.33
+
if(s == cl->end())
{
--s;
}
- song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ //song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ song->setPos(Song::CPOS, Pos(s->second.frame, false), false, true, false); // p4.0.33
return;
}
diff --git a/muse2/muse/ctrl.cpp b/muse2/muse/ctrl.cpp
index 0a863423..2793c434 100644
--- a/muse2/muse/ctrl.cpp
+++ b/muse2/muse/ctrl.cpp
@@ -20,7 +20,7 @@
#include "globals.h"
#include "ctrl.h"
#include "xml.h"
-// #include "audio.h"
+#include "audio.h"
void CtrlList::initColor(int i)
{
@@ -82,7 +82,7 @@ CtrlList::CtrlList()
// value
//---------------------------------------------------------
-double CtrlList::value(int frame)
+double CtrlList::value(int frame) const
{
// Changed by Tim. p4.0.32...
@@ -166,6 +166,17 @@ double CtrlList::value(int frame)
return rv;
}
+//---------------------------------------------------------
+// curVal
+// returns the value at the current audio position
+//---------------------------------------------------------
+double CtrlList::curVal() const
+{
+ //double v = value(Pos(audio->tickPos()).frame()); // p4.0.33
+ //double v = value(audio->pos().frame()); // Try this.
+ //return v;
+ return _curVal;
+}
//---------------------------------------------------------
// setCurVal
diff --git a/muse2/muse/ctrl.h b/muse2/muse/ctrl.h
index 14f23643..ceae8d8a 100644
--- a/muse2/muse/ctrl.h
+++ b/muse2/muse/ctrl.h
@@ -104,7 +104,7 @@ class CtrlList : public std::map<int, CtrlVal, std::less<int> > {
void setMode(Mode m) { _mode = m; }
double getDefault() const { return _default; }
void setDefault(double val) { _default = val; }
- double curVal() const { return _curVal; }
+ double curVal() const; /* { return _curVal; } */
void setCurVal(double val); // { _curVal = val; }
int id() const { return _id; }
QString name() const { return _name; }
@@ -120,7 +120,7 @@ class CtrlList : public std::map<int, CtrlVal, std::less<int> > {
CtrlValueType valueType() const { return _valueType; }
void setValueType(CtrlValueType t) { _valueType = t; }
- double value(int frame);
+ double value(int frame) const;
void add(int frame, double value);
void del(int frame);
void read(Xml& xml);
diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp
index 7f346f87..26a2a9b1 100644
--- a/muse2/muse/globals.cpp
+++ b/muse2/muse/globals.cpp
@@ -323,7 +323,7 @@ QAction* recordAction;
QAction* panicAction;
//AudioMixerApp* audioMixer;
-MusE* muse;
+MusE* muse = 0;
int preMeasures = 2;
unsigned char measureClickNote = 63;
diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp
index 192c0bd3..bddd6d80 100644
--- a/muse2/muse/main.cpp
+++ b/muse2/muse/main.cpp
@@ -230,7 +230,7 @@ int main(int argc, char* argv[])
undoSetuid();
getCapabilities();
int noAudio = false;
-
+
museUser = QString(getenv("HOME"));
museGlobalLib = QString(LIBDIR);
museGlobalShare = QString(SHAREDIR);
diff --git a/muse2/muse/mixer/CMakeLists.txt b/muse2/muse/mixer/CMakeLists.txt
index 3d76ebd6..92c3642d 100644
--- a/muse2/muse/mixer/CMakeLists.txt
+++ b/muse2/muse/mixer/CMakeLists.txt
@@ -26,7 +26,6 @@ QT4_WRAP_CPP ( mixer_mocs
astrip.h
auxknob.h
mstrip.h
- panknob.h
rack.h
routedialog.h
strip.h
@@ -48,7 +47,6 @@ file (GLOB mixer_source_files
astrip.cpp
auxknob.cpp
mstrip.cpp
- panknob.cpp
rack.cpp
routedialog.cpp
strip.cpp
diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp
index 97ddc98c..00477a26 100644
--- a/muse2/muse/mixer/astrip.cpp
+++ b/muse2/muse/mixer/astrip.cpp
@@ -26,11 +26,12 @@
#include <QVariant>
#include <QAction>
#include <QGridLayout>
+//#include <QLinearGradient>
#include "app.h"
#include "globals.h"
#include "audio.h"
-#include "driver/audiodev.h"
+//#include "driver/audiodev.h"
#include "song.h"
#include "slider.h"
#include "knob.h"
@@ -210,19 +211,32 @@ void AudioStrip::songChanged(int val)
autoType->blockSignals(true);
autoType->setCurrentItem(track->automationType());
QPalette palette;
+ //QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft());
if(track->automationType() == AUTO_TOUCH || track->automationType() == AUTO_WRITE)
{
palette.setColor(QPalette::Button, QColor(Qt::red));
+ //QColor c(Qt::red);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else if(track->automationType() == AUTO_READ)
{
palette.setColor(QPalette::Button, QColor(Qt::green));
+ //QColor c(Qt::green);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else
{
palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
+ //QColor c(qApp->palette().color(QPalette::Active, QPalette::Background));
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
@@ -398,9 +412,10 @@ void AudioStrip::volumeChanged(double val)
else
vol = pow(10.0, val/20.0);
volume = vol;
- audio->msgSetVolume((AudioTrack*)track, vol);
+ //audio->msgSetVolume((AudioTrack*)track, vol);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(vol);
+ ((AudioTrack*)track)->setVolume(vol);
+ song->controllerChange(track);
((AudioTrack*)track)->recordAutomation(AC_VOLUME, vol);
@@ -427,9 +442,10 @@ void AudioStrip::volumePressed()
else
vol = pow(10.0, val/20.0);
volume = vol;
- audio->msgSetVolume((AudioTrack*)track, volume);
+ //audio->msgSetVolume((AudioTrack*)track, volume);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(volume);
+ ((AudioTrack*)track)->setVolume(volume);
+ song->controllerChange(track);
((AudioTrack*)track)->startAutoRecord(AC_VOLUME, volume);
}
@@ -473,9 +489,10 @@ void AudioStrip::volLabelChanged(double val)
vol = pow(10.0, val/20.0);
volume = vol;
slider->setValue(val);
- audio->msgSetVolume((AudioTrack*)track, vol);
+ //audio->msgSetVolume((AudioTrack*)track, vol);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(vol);
+ ((AudioTrack*)track)->setVolume(vol);
+ song->controllerChange(track);
((AudioTrack*)track)->startAutoRecord(AC_VOLUME, vol);
}
@@ -491,9 +508,10 @@ void AudioStrip::panChanged(double val)
track->enablePanController(false);
panVal = val;
- audio->msgSetPan(((AudioTrack*)track), val);
+ //audio->msgSetPan(((AudioTrack*)track), val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(val);
+ ((AudioTrack*)track)->setPan(val);
+ song->controllerChange(track);
((AudioTrack*)track)->recordAutomation(AC_PAN, val);
}
@@ -509,9 +527,11 @@ void AudioStrip::panPressed()
track->enablePanController(false);
panVal = pan->value();
- audio->msgSetPan(((AudioTrack*)track), panVal);
+ //audio->msgSetPan(((AudioTrack*)track), panVal);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(panVal);
+ ((AudioTrack*)track)->setPan(panVal);
+ song->controllerChange(track);
+
((AudioTrack*)track)->startAutoRecord(AC_PAN, panVal);
}
@@ -546,9 +566,11 @@ void AudioStrip::panLabelChanged(double val)
panVal = val;
pan->setValue(val);
- audio->msgSetPan((AudioTrack*)track, val);
+ //audio->msgSetPan((AudioTrack*)track, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(val);
+ ((AudioTrack*)track)->setPan(val);
+ song->controllerChange(track);
+
((AudioTrack*)track)->startAutoRecord(AC_PAN, val);
}
@@ -941,19 +963,32 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
autoType->setCurrentItem(t->automationType());
QPalette palette;
+ //QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft());
if(t->automationType() == AUTO_TOUCH || t->automationType() == AUTO_WRITE)
{
palette.setColor(QPalette::Button, QColor(Qt::red));
+ //QColor c(Qt::red);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else if(t->automationType() == AUTO_READ)
{
palette.setColor(QPalette::Button, QColor(Qt::green));
+ //QColor c(Qt::green);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else
{
palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
+ //QColor c(qApp->palette().color(QPalette::Active, QPalette::Background));
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
diff --git a/muse2/muse/mixer/panknob.cpp b/muse2/muse/mixer/panknob.cpp
index 598bf5bf..9963d171 100644
--- a/muse2/muse/mixer/panknob.cpp
+++ b/muse2/muse/mixer/panknob.cpp
@@ -6,7 +6,8 @@
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
//=========================================================
-#include "../audio.h"
+//#include "../audio.h"
+#include "song.h"
#include "panknob.h"
#include "track.h"
@@ -27,9 +28,10 @@ PanKnob::PanKnob(QWidget* parent, AudioTrack* s)
void PanKnob::valueChanged(double val)
{
- audio->msgSetPan(src, val);
+ //audio->msgSetPan(src, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //src->setPan(val);
+ src->setPan(val);
+ song->controllerChange(src);
}
diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp
index e6027c6f..c3cfbdf1 100644
--- a/muse2/muse/plugin.cpp
+++ b/muse2/muse/plugin.cpp
@@ -1754,9 +1754,9 @@ void PluginI::updateControllers()
for(unsigned long i = 0; i < controlPorts; ++i)
//audio->msgSetPluginCtrlVal(this, genACnum(_id, i), controls[i].val);
// p3.3.43
- audio->msgSetPluginCtrlVal(_track, genACnum(_id, i), controls[i].val);
+ //audio->msgSetPluginCtrlVal(_track, genACnum(_id, i), controls[i].val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //_track->setPluginCtrlVal(genACnum(_id, i), controls[i].val); // TODO A faster bulk message
+ _track->setPluginCtrlVal(genACnum(_id, i), controls[i].val); // TODO A faster bulk message
}
//---------------------------------------------------------
@@ -3764,9 +3764,9 @@ void PluginGui::ctrlPressed(int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
@@ -3783,9 +3783,9 @@ void PluginGui::ctrlPressed(int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
@@ -3877,9 +3877,9 @@ void PluginGui::sliderChanged(double val, int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->recordAutomation(id, val);
}
@@ -3921,9 +3921,9 @@ void PluginGui::labelChanged(double val, int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
@@ -4323,9 +4323,9 @@ void PluginGui::guiParamChanged(int idx)
//if(track)
//{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
switch(type)
{
@@ -4459,9 +4459,9 @@ void PluginGui::guiSliderPressed(int idx)
//audio->msgSetPluginCtrlVal(((PluginI*)plugin), id, val);
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
diff --git a/muse2/muse/seqmsg.cpp b/muse2/muse/seqmsg.cpp
index 035ee949..2c29b182 100644
--- a/muse2/muse/seqmsg.cpp
+++ b/muse2/muse/seqmsg.cpp
@@ -326,6 +326,7 @@ void Audio::msgSetRecord(AudioTrack* node, bool val)
sendMsg(&msg);
}
+/*
//---------------------------------------------------------
// msgSetVolume
//---------------------------------------------------------
@@ -355,6 +356,7 @@ void Audio::msgSetPan(AudioTrack* node, double val)
//muse->arranger->controllerChanged(node);
song->controllerChange(node);
}
+*/
//---------------------------------------------------------
// msgSetPrefader
@@ -498,6 +500,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n)
sendMsg(&msg);
}
+/*
//---------------------------------------------------------
// msgSetPluginCtrlVal
//---------------------------------------------------------
@@ -517,6 +520,7 @@ void Audio::msgSetPluginCtrlVal(AudioTrack* track, int param, double val)
//muse->arranger->controllerChanged(track);
song->controllerChange(track);
}
+*/
//---------------------------------------------------------
// msgSwapControllerIDX
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp
index e4749d19..ecbfa0a7 100644
--- a/muse2/muse/song.cpp
+++ b/muse2/muse/song.cpp
@@ -49,7 +49,7 @@
extern void clearMidiTransforms();
extern void clearMidiInputTransforms();
-Song* song;
+Song* song = 0;
/*
//---------------------------------------------------------
@@ -1332,20 +1332,29 @@ void Song::setPos(int idx, const Pos& val, bool sig,
// idx, sig, isSeek, adjustScrollbar);
// val.dump(0);
// printf("\n");
-
- // p3.3.23
- //printf("Song::setPos before audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
- if (pos[idx] == val)
- return;
+ //printf("Song::setPos before audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
+
+ // If seeking audio, ensure frame resolution CAN be kept throughout. This compares apples and oranges. Moved below. p4.0.33
+ //if (pos[idx] == val)
+ // return;
if (idx == CPOS) {
_vcpos = val;
- if (isSeek && !extSyncFlag.value()) {
+ if (isSeek && !extSyncFlag.value()) {
+ if (val == audio->pos())
+ {
+ //printf("Song::setPos seek audio->pos already == val tick:%d frame:%d\n", val.tick(), val.frame());
+ return;
+ }
audio->msgSeek(val);
- // p3.3.23
- //printf("Song::setPos after audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
+ //printf("Song::setPos after audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
return;
}
}
+ if (val == pos[idx])
+ {
+ //printf("Song::setPos song->pos already == val tick:%d frame:%d\n", val.tick(), val.frame());
+ return;
+ }
pos[idx] = val;
bool swap = pos[LPOS] > pos[RPOS];
if (swap) { // swap lpos/rpos if lpos > rpos
@@ -1683,10 +1692,13 @@ void Song::beat()
}
- int tick = audio->tickPos();
+ //int tick = audio->tickPos();
if (audio->isPlaying())
- setPos(0, tick, true, false, true);
-
+ {
+ //Pos tick(audio->tickPos());
+ //setPos(0, tick, true, false, true);
+ setPos(0, audio->tickPos(), true, false, true);
+ }
// p3.3.40 Update synth native guis at the heartbeat rate.
for(ciSynthI is = _synthIs.begin(); is != _synthIs.end(); ++is)
(*is)->guiHeartBeat();
@@ -2518,9 +2530,18 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a
{
CtrlList *cl = icl->second;
canAdd = true;
- int frame = pos[0].frame();
- ctlval = cl->curVal();
- //ctlval = cl->value(frame); // p4.0.32
+
+ //int frame = pos[0].frame();
+ int frame = audio->pos().frame(); // Try this. p4.0.33
+
+ //printf("pos[0]:%d f:%d tickPos:%d f:%d\n", pos[0].tick(), pos[0].frame(), audio->tickPos(), Pos(audio->tickPos(), true).frame());
+
+ //ctlval = cl->curVal();
+ //AutomationType at = track->automationType();
+ //if(!automation || track->automationType() == AUTO_OFF)
+ ctlval = cl->curVal();
+ //else
+ // ctlval = cl->value(frame);
count = cl->size();
if(count)
{