summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/muse/audio.cpp24
-rw-r--r--muse/muse/audioprefetch.cpp5
-rw-r--r--muse/muse/cobject.h2
-rw-r--r--muse/muse/fifo.cpp113
-rw-r--r--muse/muse/fifo.h55
-rw-r--r--muse/muse/master/masteredit.cpp6
-rw-r--r--muse/muse/midiedit/drumedit.cpp8
-rw-r--r--muse/muse/midiedit/ecanvas.cpp6
-rw-r--r--muse/muse/midiedit/ecanvas.h3
-rw-r--r--muse/muse/midiedit/pianoroll.cpp8
-rw-r--r--muse/muse/muse.cpp2
-rw-r--r--muse/muse/preferences.cpp4
-rw-r--r--muse/muse/route.cpp2
-rw-r--r--muse/muse/songfile.cpp2
-rw-r--r--muse/muse/waveedit/waveedit.cpp26
-rw-r--r--muse/muse/waveedit/waveedit.h7
-rw-r--r--muse/muse/waveedit/waveview.cpp79
-rw-r--r--muse/muse/waveedit/waveview.h7
-rw-r--r--muse/muse/widgets/bigtime.cpp4
19 files changed, 182 insertions, 181 deletions
diff --git a/muse/muse/audio.cpp b/muse/muse/audio.cpp
index c42a91e8..42cd3255 100644
--- a/muse/muse/audio.cpp
+++ b/muse/muse/audio.cpp
@@ -479,24 +479,24 @@ void Audio::process(unsigned frames)
bool msg = true;
do {
unsigned fifoPos = fifo->readPos();
- if (fifoPos != framePos) {
+ if (fifoPos == framePos) {
+ _curReadIndex = fifo->readIndex();
+ break;
+ }
+ else {
if (msg) {
printf("Muse::Audio: wrong prefetch data 0x%x, expected 0x%x\n",
fifoPos, framePos);
msg = false;
}
- if (fifoPos > framePos)
+ if (fifoPos > framePos) {
+ // discard whole prefetch buffer
+ seek(_pos + frames);
break;
- fifo->get(); // discard buffer
+ }
+ fifo->pop(); // discard buffer
}
- else {
- _curReadIndex = fifo->ridx;
- break;
- }
} while (fifo->count());
- if (_curReadIndex == -1) {
- seek(_pos + frames);
- }
}
}
for (iWaveTrack i = wl->begin(); i != wl->end(); ++i) {
@@ -534,8 +534,8 @@ void Audio::process(unsigned frames)
// consume prefetch buffer
//
if (_curReadIndex != -1) {
- audioPrefetch->getFifo()->get();
- audioPrefetch->msgTick();
+ audioPrefetch->getFifo()->pop();
+ audioPrefetch->msgTick(); // wakeup prefetch thread
}
}
if (recording && (_bounce == 0 || _bounce == 1))
diff --git a/muse/muse/audioprefetch.cpp b/muse/muse/audioprefetch.cpp
index e498169e..f9853f6a 100644
--- a/muse/muse/audioprefetch.cpp
+++ b/muse/muse/audioprefetch.cpp
@@ -90,7 +90,6 @@ void AudioPrefetch::processMsg1(const void* m)
const PrefetchMsg* msg = (PrefetchMsg*)m;
switch(msg->id) {
case PREFETCH_TICK:
-// printf("!");fflush(stdout);
prefetch(false);
seekPos = ~0; // invalidate cached last seek position
break;
@@ -175,11 +174,11 @@ void AudioPrefetch::prefetch(bool seekFlag)
WaveTrack* track = *it;
if (!seekFlag && ((audio->isRecording() && track->recordFlag()) || !audio->isPlaying()))
continue;
- int ch = track->channels();
+ // int ch = track->channels();
track->fetchData(writePos, segmentSize, widx);
}
writePos += segmentSize;
- fifo.put();
+ fifo.push();
}
}
diff --git a/muse/muse/cobject.h b/muse/muse/cobject.h
index 89e725e6..0dcbdf9d 100644
--- a/muse/muse/cobject.h
+++ b/muse/muse/cobject.h
@@ -33,7 +33,7 @@ using AL::Xml;
class TopWin : public QMainWindow
{
Q_OBJECT
- Q_PROPERTY(bool muse)
+ Q_PROPERTY(bool muse) // hack: start MusE property list
Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
public:
diff --git a/muse/muse/fifo.cpp b/muse/muse/fifo.cpp
index fbad5544..5c42a4f8 100644
--- a/muse/muse/fifo.cpp
+++ b/muse/muse/fifo.cpp
@@ -22,6 +22,37 @@
#include "globals.h"
//---------------------------------------------------------
+// clear
+//---------------------------------------------------------
+
+void FifoBase::clear()
+ {
+ ridx = 0;
+ widx = 0;
+ counter = 0;
+ }
+
+//---------------------------------------------------------
+// push
+//---------------------------------------------------------
+
+void FifoBase::push()
+ {
+ widx = (widx + 1) % FIFO_BUFFER;
+ q_atomic_increment(&counter);
+ }
+
+//---------------------------------------------------------
+// pop
+//---------------------------------------------------------
+
+void FifoBase::pop()
+ {
+ ridx = (ridx + 1) % FIFO_BUFFER;
+ q_atomic_decrement(&counter);
+ }
+
+//---------------------------------------------------------
// Fifo
//---------------------------------------------------------
@@ -42,17 +73,6 @@ Fifo::~Fifo()
}
//---------------------------------------------------------
-// clear
-//---------------------------------------------------------
-
-void Fifo::clear()
- {
- ridx = 0;
- widx = 0;
- counter = 0;
- }
-
-//---------------------------------------------------------
// put
// return true if fifo full
//---------------------------------------------------------
@@ -76,7 +96,7 @@ bool Fifo::put(int segs, unsigned long samples, float** src, unsigned pos)
b->pos = pos;
for (int i = 0; i < segs; ++i)
memcpy(b->buffer + i * samples, src[i], samples * sizeof(float));
- add();
+ push();
return false;
}
@@ -104,12 +124,12 @@ bool Fifo::get(int segs, unsigned long samples, float** dst, unsigned pos)
// if (errMsg)
printf("Fifo %p::get(0x%x) n=%d, discard wrong prefetch block(s) 0x%x\n",
this, pos, counter, b->pos);
- remove();
+ pop();
errMsg = false;
}
for (int i = 0; i < segs; ++i)
dst[i] = b->buffer + samples * (i % b->segs);
- remove();
+ pop();
return false;
}
@@ -128,21 +148,11 @@ bool Fifo::get(int segs, unsigned long samples, float** dst)
b = buffer[ridx];
for (int i = 0; i < segs; ++i)
dst[i] = b->buffer + samples * (i % b->segs);
- remove();
+ pop();
return false;
}
//---------------------------------------------------------
-// remove
-//---------------------------------------------------------
-
-void Fifo::remove()
- {
- ridx = (ridx + 1) % nbuffer;
- q_atomic_decrement(&counter);
- }
-
-//---------------------------------------------------------
// getWriteBuffer
// return true, if no more buffer available
// (overflow)
@@ -168,56 +178,3 @@ bool Fifo::getWriteBuffer(int segs, unsigned long samples, float** buf, unsigned
return false;
}
-//---------------------------------------------------------
-// add
-//---------------------------------------------------------
-
-void Fifo::add()
- {
- widx = (widx + 1) % nbuffer;
- q_atomic_increment(&counter);
- }
-
-//---------------------------------------------------------
-// Fifo1
-//---------------------------------------------------------
-
-Fifo1::Fifo1()
- {
- clear();
- }
-
-Fifo1::~Fifo1()
- {
- }
-
-//---------------------------------------------------------
-// clear
-//---------------------------------------------------------
-
-void Fifo1::clear()
- {
- ridx = 0;
- widx = 0;
- counter = 0;
- }
-
-//---------------------------------------------------------
-// put
-//---------------------------------------------------------
-
-void Fifo1::put()
- {
- widx = (widx + 1) % FIFO_BUFFER;
- q_atomic_increment(&counter);
- }
-
-//---------------------------------------------------------
-// get
-//---------------------------------------------------------
-
-void Fifo1::get()
- {
- ridx = (ridx + 1) % FIFO_BUFFER;
- q_atomic_decrement(&counter);
- }
diff --git a/muse/muse/fifo.h b/muse/muse/fifo.h
index ed6d27e5..e719d813 100644
--- a/muse/muse/fifo.h
+++ b/muse/muse/fifo.h
@@ -44,49 +44,64 @@ struct FifoBuffer {
}
};
-class Fifo {
- int nbuffer;
- int ridx; // read index; only touched by reader
- int widx; // write index; only touched by writer
- volatile int counter; // buffer count; writer increments, reader decrements
+//---------------------------------------------------------
+// FifoBase
+// - works only for one reader/writer
+// - reader writes ridx
+// - writer writes widx
+// - reader decrements counter
+// - writer increments counter
+// - counter increment/decrement must be atomic
+//---------------------------------------------------------
+
+class FifoBase {
+
+ protected:
+ int ridx; // read index
+ int widx; // write index
+ volatile int counter; // objects in fifo
+
+ public:
+ FifoBase() { clear(); }
+ virtual ~FifoBase() {}
+ void clear();
+ virtual void push(); // put object on fifo
+ virtual void pop(); // remove object from fifo
+ int count() const { return counter; }
+ int readIndex() const { return ridx; }
+ };
+
+//---------------------------------------------------------
+// Fifo
+//---------------------------------------------------------
+
+class Fifo : public FifoBase {
+ int nbuffer; // max buffer size (fifo-size)
FifoBuffer** buffer;
public:
Fifo();
~Fifo();
- void clear();
bool put(int, unsigned long, float** buffer, unsigned pos);
bool getWriteBuffer(int, unsigned long, float** buffer, unsigned pos);
- void add();
bool get(int, unsigned long, float** buffer, unsigned pos);
bool get(int, unsigned long, float** buffer);
- void remove();
- int count() const { return counter; }
};
-
//---------------------------------------------------------
// Fifo1
//---------------------------------------------------------
-class Fifo1 {
+class Fifo1 : public FifoBase {
public:
unsigned positions[FIFO_BUFFER];
- int ridx; // read index; only touched by reader
- int widx; // write index; only touched by writer
- volatile int counter; // buffer count; writer increments, reader decrements
- Fifo1();
- ~Fifo1();
- void clear();
+ Fifo1() : FifoBase() {}
int setWritePos(unsigned pos) {
positions[widx] = pos;
return widx;
}
- int count() const { return counter; }
unsigned readPos() const { return positions[ridx]; }
- void put();
- void get();
};
#endif
diff --git a/muse/muse/master/masteredit.cpp b/muse/muse/master/masteredit.cpp
index 97873a2b..a86e0426 100644
--- a/muse/muse/master/masteredit.cpp
+++ b/muse/muse/master/masteredit.cpp
@@ -58,10 +58,10 @@ MasterEdit::MasterEdit()
PointerTool | PencilTool | RubberTool);
addToolBar(tools2);
- QToolBar* enableMaster = addToolBar(tr("EnableMaster"));
- enableMasterAction = enableMaster->addAction(tr("Enable"));
+ QToolBar* enableMaster = addToolBar(tr("EnableTempomap"));
+ enableMasterAction = enableMaster->addAction(tr("Tempomap"));
enableMasterAction->setCheckable(true);
- enableMasterAction->setToolTip(tr("Enable usage of master track"));
+ enableMasterAction->setToolTip(tr("Enable use of tempo map"));
enableMasterAction->setChecked(song->masterFlag());
connect(enableMasterAction, SIGNAL(triggered(bool)), song, SLOT(setMasterFlag(bool)));
diff --git a/muse/muse/midiedit/drumedit.cpp b/muse/muse/midiedit/drumedit.cpp
index 1f5de7aa..344af693 100644
--- a/muse/muse/midiedit/drumedit.cpp
+++ b/muse/muse/midiedit/drumedit.cpp
@@ -147,10 +147,10 @@ DrumEdit::DrumEdit(PartList* pl, bool init)
setWindowTitle(canvas()->getCaption());
- int st, e;
- canvas()->range(&st, &e);
- e += AL::sigmap.ticksMeasure(e); // show one more measure
- canvas()->setTimeRange(st, e);
+ Pos p1(0, AL::TICKS), p2(0, AL::TICKS);
+ canvas()->range(p1, p2);
+ p2 += AL::sigmap.ticksMeasure(p2.tick()); // show one more measure
+ canvas()->setTimeRange(p1, p2);
// connect toolbar
connect(canvas(), SIGNAL(cursorPos(const AL::Pos&,bool)), toolbar, SLOT(setTime(const AL::Pos&,bool)));
diff --git a/muse/muse/midiedit/ecanvas.cpp b/muse/muse/midiedit/ecanvas.cpp
index 4c15e308..757856fe 100644
--- a/muse/muse/midiedit/ecanvas.cpp
+++ b/muse/muse/midiedit/ecanvas.cpp
@@ -63,10 +63,10 @@ EventCanvas::EventCanvas(MidiEditor* pr, TimeCanvasType type)
// range
//---------------------------------------------------------
-void EventCanvas::range(int* s, int* e) const
+void EventCanvas::range(AL::Pos& s, AL::Pos& e) const
{
- *s = startTick;
- *e = endTick;
+ s.setTick(startTick);
+ e.setTick(endTick);
}
//---------------------------------------------------------
diff --git a/muse/muse/midiedit/ecanvas.h b/muse/muse/midiedit/ecanvas.h
index ab328785..6602ee05 100644
--- a/muse/muse/midiedit/ecanvas.h
+++ b/muse/muse/midiedit/ecanvas.h
@@ -21,6 +21,7 @@
#ifndef __ECANVAS_H__
#define __ECANVAS_H__
+#include "al/pos.h"
#include "awl/tcanvas.h"
#include "widgets/noteinfo.h"
#include "citem.h"
@@ -150,7 +151,7 @@ class EventCanvas : public TimeCanvas {
MidiTrack* track() const;
Part* part() const { return curPart; }
QString getCaption() const;
- void range(int* s, int* e) const;
+ void range(AL::Pos& s, AL::Pos& e) const;
void selectFirst();
virtual void modifySelected(NoteInfo::ValType, int) {}
virtual void keyPress(QKeyEvent*);
diff --git a/muse/muse/midiedit/pianoroll.cpp b/muse/muse/midiedit/pianoroll.cpp
index f5d1aa42..f0ba5c32 100644
--- a/muse/muse/midiedit/pianoroll.cpp
+++ b/muse/muse/midiedit/pianoroll.cpp
@@ -229,10 +229,10 @@ PianoRoll::PianoRoll(PartList* pl, bool init)
info->setEnabled(false);
setWindowTitle(canvas()->getCaption());
- int s1, e;
- canvas()->range(&s1, &e);
- e += AL::sigmap.ticksMeasure(e); // show one more measure
- canvas()->setTimeRange(s1, e);
+ Pos p1(0, AL::TICKS), p2(0, AL::TICKS);
+ canvas()->range(p1, p2);
+ p2 += AL::sigmap.ticksMeasure(p2.tick()); // show one more measure
+ canvas()->setTimeRange(p1, p2);
// connect to toolbar
connect(canvas(), SIGNAL(pitchChanged(int)), toolbar, SLOT(setPitch(int)));
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp
index d2b153ad..67832ac9 100644
--- a/muse/muse/muse.cpp
+++ b/muse/muse/muse.cpp
@@ -1596,7 +1596,7 @@ void MusE::startWaveEditor()
void MusE::startWaveEditor(PartList* pl)
{
- WaveEdit* waveEditor = new WaveEdit(pl);
+ WaveEdit* waveEditor = new WaveEdit(pl, false);
waveEditor->show();
connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged()));
}
diff --git a/muse/muse/preferences.cpp b/muse/muse/preferences.cpp
index 59ab5173..c509d609 100644
--- a/muse/muse/preferences.cpp
+++ b/muse/muse/preferences.cpp
@@ -371,6 +371,10 @@ PreferencesDialog::PreferencesDialog(Arranger* a, QWidget* parent)
drumEditorWidth->setValue(DrumEdit::initWidth);
drumEditorHeight->setValue(DrumEdit::initHeight);
+ waveEditorWidth->setValue(WaveEdit::initWidth);
+ waveEditorHeight->setValue(WaveEdit::initHeight);
+
+
connect(recordStop, SIGNAL(clicked(bool)), SLOT(recordStopToggled(bool)));
connect(recordRecord, SIGNAL(clicked(bool)), SLOT(recordRecordToggled(bool)));
connect(recordGotoLeftMark, SIGNAL(clicked(bool)), SLOT(recordGotoLeftMarkToggled(bool)));
diff --git a/muse/muse/route.cpp b/muse/muse/route.cpp
index 40479bc3..118b75d3 100644
--- a/muse/muse/route.cpp
+++ b/muse/muse/route.cpp
@@ -412,7 +412,7 @@ void Song::readRoute(QDomNode node)
stype = Route::SYNTIPORT;
else {
printf("Song::readRoute(): unknown type <%s>\n", dt.toLatin1().data());
- dtype = Route::TRACK;
+ stype = Route::TRACK;
}
if (dt == "TRACK")
diff --git a/muse/muse/songfile.cpp b/muse/muse/songfile.cpp
index e45616b3..efd30fcb 100644
--- a/muse/muse/songfile.cpp
+++ b/muse/muse/songfile.cpp
@@ -106,7 +106,7 @@ void MusE::readToplevels(QDomNode node)
markerView->read(node);
}
else if (tag == "WaveEdit") {
- WaveEdit* waveEditor = new WaveEdit(pl);
+ WaveEdit* waveEditor = new WaveEdit(pl, true);
waveEditor->show();
connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged()));
waveEditor->read(node);
diff --git a/muse/muse/waveedit/waveedit.cpp b/muse/muse/waveedit/waveedit.cpp
index 8e94a134..295f0814 100644
--- a/muse/muse/waveedit/waveedit.cpp
+++ b/muse/muse/waveedit/waveedit.cpp
@@ -17,14 +17,14 @@
#include "part.h"
#include "muse.h"
-int WaveEdit::_widthInit = 600;
-int WaveEdit::_heightInit = 400;
+int WaveEdit::initWidth = WaveEdit::INIT_WIDTH;
+int WaveEdit::initHeight = WaveEdit::INIT_HEIGHT;
//---------------------------------------------------------
// WaveEdit
//---------------------------------------------------------
-WaveEdit::WaveEdit(PartList* pl)
+WaveEdit::WaveEdit(PartList* pl, bool init)
: Editor()
{
_parts = pl;
@@ -109,13 +109,15 @@ WaveEdit::WaveEdit(PartList* pl)
// Rest
//---------------------------------------------------
- if (!parts()->empty()) { // Roughly match total size of part
- Part* firstPart = parts()->begin()->second;
+// if (!parts()->empty()) { // Roughly match total size of part
+// Part* firstPart = parts()->begin()->second;
// xscale = 0 - firstPart->lenFrame()/_widthInit;
- }
+// }
view = new WaveView(this);
view->setRaster(0);
+ view->setFollow(INIT_FOLLOW);
+
connect(song, SIGNAL(posChanged(int,const AL::Pos&,bool)), view, SLOT(setLocatorPos(int,const AL::Pos&,bool)));
view->setLocatorPos(0, song->cpos(), true);
view->setLocatorPos(1, song->lpos(), false);
@@ -124,10 +126,22 @@ WaveEdit::WaveEdit(PartList* pl)
connect(view, SIGNAL(posChanged(int,const AL::Pos&)), song, SLOT(setPos(int,const AL::Pos&)));
setCentralWidget(view);
+ view->setCornerWidget(new QSizeGrip(view));
setWindowTitle(view->getCaption());
+ Pos p1(0, AL::FRAMES), p2(0, AL::FRAMES);
+ view->range(p1, p2);
+ p2 += AL::sigmap.ticksMeasure(p2.tick()); // show one more measure
+ view->setTimeRange(p1, p2);
+
configChanged();
// initSettings();
+
+ if (init)
+ ; // initFromPart();
+ else {
+ resize(initWidth, initHeight);
+ }
}
//---------------------------------------------------------
diff --git a/muse/muse/waveedit/waveedit.h b/muse/muse/waveedit/waveedit.h
index 010bc95a..11c93cd8 100644
--- a/muse/muse/waveedit/waveedit.h
+++ b/muse/muse/waveedit/waveedit.h
@@ -51,7 +51,7 @@ class WaveEdit : public Editor {
void configChanged();
public:
- WaveEdit(PartList*);
+ WaveEdit(PartList*, bool);
~WaveEdit();
PartList* parts() const { return _parts; }
@@ -59,7 +59,12 @@ class WaveEdit : public Editor {
CMD_GAIN_FREE, CMD_GAIN_200, CMD_GAIN_150, CMD_GAIN_75, CMD_GAIN_50, CMD_GAIN_25,
CMD_EDIT_EXTERNAL,
CMD_SELECT_ALL, CMD_SELECT_NONE };
+ static int initWidth, initHeight;
+ static const int INIT_WIDTH = 650;
+ static const int INIT_HEIGHT = 450;
};
+static const bool INIT_FOLLOW = false;
+
#endif
diff --git a/muse/muse/waveedit/waveview.cpp b/muse/muse/waveedit/waveview.cpp
index 863a34dd..38d9f052 100644
--- a/muse/muse/waveedit/waveview.cpp
+++ b/muse/muse/waveedit/waveview.cpp
@@ -25,23 +25,24 @@
WaveView::WaveView(WaveEdit* pr)
: TimeCanvas(TIME_CANVAS)
{
- curPart = 0;
selectionStart = 0;
selectionStop = 0;
- lastGainvalue = 100;
- editor = pr;
+ lastGainvalue = 100;
+ editor = pr;
if (editor->parts()->empty()) {
curPart = 0;
- curPartId = -1;
}
else {
curPart = editor->parts()->begin()->second;
}
+ songChanged(SC_TRACK_INSERTED);
+#if 0
int start = curPart->frame();
int end = start + curPart->lenFrame();
setTimeRange(start, end);
+#endif
}
//---------------------------------------------------------
@@ -50,7 +51,7 @@ WaveView::WaveView(WaveEdit* pr)
void WaveView::paint(QPainter&, QRect)
{
- printf("paint\n");
+// printf("paint\n");
}
//---------------------------------------------------------
@@ -209,44 +210,37 @@ QString WaveView::getCaption() const
void WaveView::songChanged(int flags)
{
-#if 0
- if (flags & SC_SELECTION) {
- startSample = MAXINT;
- endSample = 0;
- curPart = 0;
+ if (flags & ~SC_SELECTION) {
+ startFrame = MAXINT;
+ endFrame = 0;
for (iPart p = editor->parts()->begin(); p != editor->parts()->end(); ++p) {
Part* part = p->second;
- if (part->sn() == curPartId)
- curPart = part;
- int ssample = part->frame();
- int esample = ssample + part->lenFrame();
- if (ssample < startSample) {
- startSample = ssample;
- //printf("startSample = %d\n", startSample);
- }
- if (esample > endSample) {
- endSample = esample;
- //printf("endSample = %d\n", endSample);
- }
+ int sframe = part->frame();
+ int eframe = sframe + part->lenFrame();
+ if (sframe < startFrame)
+ startFrame = sframe;
+ if (eframe > endFrame)
+ endFrame = eframe;
}
}
- if (flags & SC_CLIP_MODIFIED) {
- update(); // Boring, but the only thing possible to do
- }
- if (flags & SC_TEMPO) {
+// if (flags & SC_CLIP_MODIFIED) {
+// update(); // Boring, but the only thing possible to do
+// }
+/* if (flags & SC_TEMPO) {
setPos(0, song->cpos(), false);
setPos(1, song->lpos(), false);
setPos(2, song->rpos(), false);
}
- update();
-#endif
+*/
+ setPart(*curPart, curPart->end());
+ widget()->update();
}
//---------------------------------------------------------
// viewMousePressEvent
//---------------------------------------------------------
-void WaveView::viewMousePressEvent(QMouseEvent* event)
+void WaveView::viewMousePressEvent(QMouseEvent* /*event*/)
{
#if 0
button = event->button();
@@ -295,7 +289,7 @@ void WaveView::viewMouseReleaseEvent(QMouseEvent*)
// viewMouseMoveEvent
//---------------------------------------------------------
-void WaveView::viewMouseMoveEvent(QMouseEvent* event)
+void WaveView::viewMouseMoveEvent(QMouseEvent* /*event*/)
{
#if 0
unsigned x = event->x();
@@ -334,7 +328,7 @@ void WaveView::viewMouseMoveEvent(QMouseEvent* event)
// cmd
//---------------------------------------------------------
-void WaveView::cmd(int n)
+void WaveView::cmd(int /*n*/)
{
#if 0
int modifyoperation = -1;
@@ -440,7 +434,7 @@ void WaveView::cmd(int n)
// getSelection
//---------------------------------------------------------
-WaveSelectionList WaveView::getSelection(unsigned startpos, unsigned stoppos)
+WaveSelectionList WaveView::getSelection(unsigned /*startpos*/, unsigned /*stoppos*/)
{
WaveSelectionList selection;
#if 0
@@ -489,7 +483,7 @@ WaveSelectionList WaveView::getSelection(unsigned startpos, unsigned stoppos)
// modifySelection
//---------------------------------------------------------
-void WaveView::modifySelection(int operation, unsigned startpos, unsigned stoppos, double paramA)
+void WaveView::modifySelection(int /*operation*/, unsigned /*startpos*/, unsigned /*stoppos*/, double /*paramA*/)
{
#if 0
song->startUndo();
@@ -593,7 +587,7 @@ void WaveView::modifySelection(int operation, unsigned startpos, unsigned stoppo
// muteSelection
//---------------------------------------------------------
-void WaveView::muteSelection(unsigned channels, float** data, unsigned length)
+void WaveView::muteSelection(unsigned /*channels*/, float** /*data*/, unsigned /*length*/)
{
#if 0
// Set everything to 0!
@@ -609,7 +603,7 @@ void WaveView::muteSelection(unsigned channels, float** data, unsigned length)
// normalizeSelection
//---------------------------------------------------------
-void WaveView::normalizeSelection(unsigned channels, float** data, unsigned length)
+void WaveView::normalizeSelection(unsigned /*channels*/, float** /*data*/, unsigned /*length*/)
{
#if 0
float loudest = 0.0;
@@ -635,7 +629,7 @@ void WaveView::normalizeSelection(unsigned channels, float** data, unsigned leng
// fadeInSelection
//---------------------------------------------------------
-void WaveView::fadeInSelection(unsigned channels, float** data, unsigned length)
+void WaveView::fadeInSelection(unsigned /*channels*/, float** /*data*/, unsigned /*length*/)
{
#if 0
for (unsigned i=0; i<channels; i++) {
@@ -651,7 +645,7 @@ void WaveView::fadeInSelection(unsigned channels, float** data, unsigned length)
// fadeOutSelection
//---------------------------------------------------------
-void WaveView::fadeOutSelection(unsigned channels, float** data, unsigned length)
+void WaveView::fadeOutSelection(unsigned /*channels*/, float** /*data*/, unsigned /*length*/)
{
#if 0
for (unsigned i=0; i<channels; i++) {
@@ -797,3 +791,14 @@ bool WaveView::getUniqueTmpfileName(QString& newFilename)
printf("Could not find a suitable tmpfilename (more than 10000 tmpfiles in tmpdir - clean up!\n");
return false;
}
+
+//---------------------------------------------------------
+// range
+//---------------------------------------------------------
+
+void WaveView::range(AL::Pos& s, AL::Pos& e) const
+ {
+ s.setFrame(startFrame);
+ e.setFrame(endFrame);
+ }
+
diff --git a/muse/muse/waveedit/waveview.h b/muse/muse/waveedit/waveview.h
index dc3e5016..bf63dffb 100644
--- a/muse/muse/waveedit/waveview.h
+++ b/muse/muse/waveedit/waveview.h
@@ -8,6 +8,7 @@
#ifndef WAVE_VIEW_H
#define WAVE_VIEW_H
+#include "al/pos.h"
#include "wave.h"
#include "awl/tcanvas.h"
@@ -38,11 +39,10 @@ typedef std::list<WaveEventSelection>::iterator iWaveSelection;
class WaveView : public TimeCanvas {
WaveEdit* editor;
- int startSample;
- int endSample;
+ int startFrame;
+ int endFrame;
Part* curPart;
- int curPartId;
enum { NORMAL, DRAG } mode;
enum { MUTE = 0, NORMALIZE, FADE_IN, FADE_OUT, REVERSE, GAIN, EDIT_EXTERNAL }; //!< Modify operations
@@ -83,6 +83,7 @@ class WaveView : public TimeCanvas {
WaveView(WaveEdit*);
QString getCaption() const;
void cmd(int n);
+ void range(AL::Pos&, AL::Pos&) const;
};
#endif
diff --git a/muse/muse/widgets/bigtime.cpp b/muse/muse/widgets/bigtime.cpp
index d7458dbc..3d1c7b21 100644
--- a/muse/muse/widgets/bigtime.cpp
+++ b/muse/muse/widgets/bigtime.cpp
@@ -18,12 +18,12 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
-#include "al/al.h"
#include "globals.h"
#include "bigtime.h"
#include "song.h"
-// #include "app.h"
#include "gconfig.h"
+
+#include "al/al.h"
#include "al/sig.h"
#include "al/tempo.h"