summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-09-30 18:02:05 +0000
committerWerner Schweer <ws.seh.de>2006-09-30 18:02:05 +0000
commit2e6a0d57ebadfd5d21df28099c103d4b5c858b3c (patch)
tree8f20022b105e40e591d8e1e7266018f061a23fe7
parent2cd11ebb24f2b33d117dc3148f38a4edc0cad5d6 (diff)
fix song reload
-rw-r--r--muse/muse/audio.cpp18
-rw-r--r--muse/muse/marker/markerview.cpp21
-rw-r--r--muse/muse/marker/markerview.h3
-rw-r--r--muse/muse/muse.cpp6
4 files changed, 39 insertions, 9 deletions
diff --git a/muse/muse/audio.cpp b/muse/muse/audio.cpp
index bf86cf9c..32bf208d 100644
--- a/muse/muse/audio.cpp
+++ b/muse/muse/audio.cpp
@@ -153,6 +153,21 @@ bool Audio::start()
{
TrackList* tl = song->tracks();
+ _curTickPos = 0;
+ _nextTickPos = 0;
+
+ midiClick = 0;
+ clickno = 0;
+ clicksMeasure = 0;
+ ticksBeat = 0;
+
+ syncTime = 0.0;
+ syncFrame = 0;
+ frameOffset = 0;
+
+ msg = 0;
+ _pos.setFrame(~0); // make sure seek is not optimized away
+
//
// init marker for synchronous loop processing
//
@@ -377,6 +392,7 @@ void Audio::process(unsigned frames)
//
// invalidate audio prefetch buffer
//
+printf("invalidate prefetch buffer\n");
audioPrefetch->getFifo()->clear();
audioPrefetch->msgSeek(framePos);
lmark = llmark;
@@ -384,6 +400,8 @@ void Audio::process(unsigned frames)
}
}
+// printf("---%d %d \n", state == PLAY, state);
+
if (isPlaying()) {
if (_bounce == 1 && _pos >= song->rPos()) {
_bounce = 2;
diff --git a/muse/muse/marker/markerview.cpp b/muse/muse/marker/markerview.cpp
index da522404..398b15c6 100644
--- a/muse/muse/marker/markerview.cpp
+++ b/muse/muse/marker/markerview.cpp
@@ -176,7 +176,8 @@ MarkerView::MarkerView()
table->header()->resizeSection(2, 50);
table->header()->resizeSection(3, 200);
// table->header()->resizeSection(mnWidthMode(3, QTreeWidget::Maximum);
- connect(table, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(markerSelectionChanged(QTreeWidgetItem*)));
+ connect(table, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(currentChanged(QTreeWidgetItem*)));
+ connect(table, SIGNAL(itemSelectionChanged()), SLOT(selectionChanged()));
connect(table, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(clicked(QTreeWidgetItem*)));
QGroupBox* props = new QGroupBox(tr("Marker Properties"));
@@ -274,11 +275,12 @@ void MarkerView::updateList()
}
//---------------------------------------------------------
-// markerSelected
+// currentChanged
//---------------------------------------------------------
-void MarkerView::markerSelectionChanged(QTreeWidgetItem* i)
+void MarkerView::currentChanged(QTreeWidgetItem* i)
{
+printf("current changed\n");
MarkerItem* item = (MarkerItem*)i;
if (item == 0) { // never triggered
editTick->setValue(0);
@@ -303,11 +305,21 @@ void MarkerView::markerSelectionChanged(QTreeWidgetItem* i)
}
//---------------------------------------------------------
+// selectionChanged
+//---------------------------------------------------------
+
+void MarkerView::selectionChanged()
+ {
+printf("selection changed\n");
+ }
+
+//---------------------------------------------------------
// clicked
//---------------------------------------------------------
void MarkerView::clicked(QTreeWidgetItem* i)
{
+printf("clicked\n");
MarkerItem* item = (MarkerItem*)i;
if (item == 0) {
table->clearSelection();
@@ -377,7 +389,8 @@ void MarkerView::markerChanged(int val)
for (int k = 0; k < n; ++k) {
MarkerItem* item = (MarkerItem*)(table->topLevelItem(k));
if (item->marker() == &i->second) {
- table->setCurrentItem(item);
+ ((QTreeWidgetItem*)item)->setSelected(true);
+// table->setCurrentItem(item);
return;
}
}
diff --git a/muse/muse/marker/markerview.h b/muse/muse/marker/markerview.h
index e9940bc4..12337efa 100644
--- a/muse/muse/marker/markerview.h
+++ b/muse/muse/marker/markerview.h
@@ -79,7 +79,8 @@ class MarkerView : public TopWin {
void addMarker();
void addMarker(const AL::Pos&);
void deleteMarker();
- void markerSelectionChanged(QTreeWidgetItem*);
+ void currentChanged(QTreeWidgetItem*);
+ void selectionChanged();
void nameChanged(const QString&);
void tickChanged(const Pos&);
void lockChanged(bool);
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp
index 50387659..a4efb2c0 100644
--- a/muse/muse/muse.cpp
+++ b/muse/muse/muse.cpp
@@ -246,8 +246,6 @@ bool MusE::seqStart()
fprintf(stderr, "MusE: creating watchdog thread failed: %s\n",
strerror(rv));
pthread_attr_destroy(attributes);
- }
- if (realTimePriority) {
//
// start audio prefetch threads with realtime
// priority
@@ -255,7 +253,7 @@ bool MusE::seqStart()
audioPrefetch->start(realTimePriority-5);
audioWriteback->start(realTimePriority-5);
}
- else {
+ else {
printf("MusE: Warning - starting threads without realtime priority since audio is not running realtime.\n");
//
// start audio prefetch threads as normal
@@ -281,7 +279,7 @@ bool MusE::seqStart()
void MusE::seqStop()
{
- audio->msgIdle(true);
+// audio->msgIdle(true);
song->setStop(true);
song->setStopPlay(false);
midiSeq->stop(true);