summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-06-19 09:35:40 +0000
committerWerner Schweer <ws.seh.de>2006-06-19 09:35:40 +0000
commita86e9a7ff7ce31a2f02991ad89bcf1fa6d4e26bf (patch)
treebf0734ed4634fc49a42b1edcc5e37b56965432b4
parent6d00f554ad0c293a2e1b3233db8cdb935e221632 (diff)
fix drawing of cutted wave part
-rw-r--r--muse/ChangeLog2
-rw-r--r--muse/muse/arranger/canvas.cpp7
-rw-r--r--muse/muse/waveevent.cpp11
-rw-r--r--muse/muse/waveevent.h1
4 files changed, 10 insertions, 11 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 5183d6b6..b84a9cab 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,5 @@
+19.6. (ws)
+ * fix drawing of cutted wave part
14.6. (ws)
* fix build of libawlplugin.so; works for "release" build
12.6. (ws)
diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp
index dc71ff66..b54cdfc2 100644
--- a/muse/muse/arranger/canvas.cpp
+++ b/muse/muse/arranger/canvas.cpp
@@ -90,7 +90,8 @@ void PartCanvas::drawWavePart(QPainter& p, Part* wp, int y0, int th, int from, i
int samples = event.lenFrame();
int xScale = (samples + w/2)/w;
- int frame = pos.frame() - wp->frame() - e->second.pos().frame();
+ int frame = pos.frame() - wp->frame()
+ - event.pos().frame() + event.spos();
if (h < 20) {
//
@@ -547,7 +548,7 @@ void PartCanvas::mousePress(QMouseEvent* me)
QRect r1,r2;
QPoint pos2;
- int xpos, y, len, h;
+ int xpos = 0, y = 0, len = 0, h = 0;
if (hit == HIT_PART) {
h = track->arrangerTrack.tw->height();
@@ -1033,7 +1034,7 @@ void PartCanvas::drop(QDropEvent* event)
}
else {
PartCanvas* cw = (PartCanvas*)event->source();
- int tick = AL::sigmap.raster(mapxDev(pos.x() - cw->dragOffset()), raster());
+ unsigned tick = AL::sigmap.raster(mapxDev(pos.x() - cw->dragOffset()), raster());
if (srcPart->tick() != tick || srcTrack != track) {
Qt::KeyboardModifiers keyState = event->keyboardModifiers();
diff --git a/muse/muse/waveevent.cpp b/muse/muse/waveevent.cpp
index a15418cc..2d54cc99 100644
--- a/muse/muse/waveevent.cpp
+++ b/muse/muse/waveevent.cpp
@@ -31,7 +31,6 @@
WaveEventBase::WaveEventBase(EventType t)
: EventBase(t)
{
- ipos = -1;
deleted = false;
}
@@ -108,17 +107,15 @@ void WaveEventBase::write(Xml& xml, const Pos& offset) const
xml.etag("event");
}
+//---------------------------------------------------------
+// read
+//---------------------------------------------------------
+
void WaveEventBase::read(unsigned offset, float** buffer, int channel, int n)
{
if (f.isNull())
return;
-/* if (ipos != -1 && ipos != (offset + _spos))
- printf("Wave seek %d-%d = %d\n",
- offset + _spos, ipos, offset + _spos - ipos);
- */
f.seek(offset + _spos, 0);
f.read(channel, buffer, n);
-
-// ipos = offset + _spos + n;
}
diff --git a/muse/muse/waveevent.h b/muse/muse/waveevent.h
index 161effd0..e0c681fd 100644
--- a/muse/muse/waveevent.h
+++ b/muse/muse/waveevent.h
@@ -31,7 +31,6 @@ class WaveEventBase : public EventBase {
QString _name;
SndFileR f;
int _spos; // start sample position in WaveFile
- int ipos;
bool deleted;
virtual EventBase* clone() { return new WaveEventBase(*this); }