summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2008-01-21 18:47:33 +0000
committerWerner Schweer <ws.seh.de>2008-01-21 18:47:33 +0000
commit94a9f2b9f93394863cfa38af79ebfb40f11e06e5 (patch)
treed28e0483127d838239de862ae5b8cf6275c624b5
parentb5a5f4c5292489130d81dfc90262500d25b7364c (diff)
midi record debugging
-rw-r--r--muse/CMakeLists.txt18
-rw-r--r--muse/ChangeLog4
-rw-r--r--muse/muse/CMakeLists.txt2
-rw-r--r--muse/muse/audio.h3
-rw-r--r--muse/muse/audiotrack.cpp2
-rw-r--r--muse/muse/driver/alsamidi.cpp2
-rw-r--r--muse/muse/event.cpp10
-rw-r--r--muse/muse/event.h8
-rw-r--r--muse/muse/eventbase.h11
-rw-r--r--muse/muse/eventlist.cpp6
-rw-r--r--muse/muse/midieventbase.h3
-rw-r--r--muse/muse/midififo.cpp5
-rw-r--r--muse/muse/midififo.h3
-rw-r--r--muse/muse/midiinport.cpp31
-rw-r--r--muse/muse/midiinport.h8
-rw-r--r--muse/muse/miditrack.cpp42
-rw-r--r--muse/muse/seqmsg.cpp13
-rw-r--r--muse/muse/song.cpp25
-rw-r--r--muse/muse/song.h9
-rw-r--r--muse/muse/undo.cpp11
-rw-r--r--muse/muse/undo.h1
-rw-r--r--muse/muse/vst.cpp6
-rw-r--r--muse/muse/vst.h2
23 files changed, 130 insertions, 95 deletions
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt
index 5af6816e..f518b9d0 100644
--- a/muse/CMakeLists.txt
+++ b/muse/CMakeLists.txt
@@ -51,8 +51,8 @@ SET(MusE_INSTALL_NAME "muse-2.0")
include ( ${PROJECT_SOURCE_DIR}/cmake/UsePkgConfig1.cmake )
include ( ${PROJECT_SOURCE_DIR}/cmake/TargetDoc.cmake)
-option ( ENABLE_DSSI "enable Disposable Soft Synth Interface" ON)
-option ( ENABLE_VST "enable VST/win support" ON)
+option ( ENABLE_DSSI "enable Disposable Soft Synth Interface" OFF)
+option ( ENABLE_VST "enable VST/win support" OFF)
option ( ENABLE_FLUID "enable fluidsynth softsynth plugins" ON)
option ( ENABLE_ZYNADDSUBFX "enable zyaddsubfx softsynth plugin" OFF)
@@ -225,6 +225,14 @@ if ( ENABLE_DSSI )
endif (NOT DSSI_INCDIR)
endif ( ENABLE_DSSI )
+if (ENABLE_VST)
+ message("VST support enabled")
+ set (VST_SUPPORT TRUE)
+else (ENABLE_VST)
+ message("VST support disabled")
+ set (VST_SUPPORT FALSE)
+endif (ENABLE_VST)
+
##
## TODO
##
@@ -234,12 +242,6 @@ endif ( ENABLE_DSSI )
SET (USE_SSE true)
##
-## vst
-##
-## TODO
-##
-
-##
## check for fluidsynth
##
diff --git a/muse/ChangeLog b/muse/ChangeLog
index abb81c73..d109caae 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,7 @@
+21.1. (ws)
+ - fix: recorded midi events were echoed to midi output even if the "monitor"
+ switch was "off"
+ - speedups for midi recording; recorded events are shown in "realtime"
18.1. (ws)
- Remove font & style configuration. Fonts and other things are configured in
QT style sheets. The application style sheet is configurable. Default is
diff --git a/muse/muse/CMakeLists.txt b/muse/muse/CMakeLists.txt
index 7e861d96..a2279624 100644
--- a/muse/muse/CMakeLists.txt
+++ b/muse/muse/CMakeLists.txt
@@ -3,7 +3,7 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 2002-2008 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
diff --git a/muse/muse/audio.h b/muse/muse/audio.h
index 1d248f03..5d52ee0f 100644
--- a/muse/muse/audio.h
+++ b/muse/muse/audio.h
@@ -79,6 +79,7 @@ enum {
SEQM_REMOVE_PART,
SEQM_CHANGE_PART,
SEQM_ADD_EVENT,
+ SEQM_ADD_EVENTS,
SEQM_REMOVE_EVENT,
SEQM_CHANGE_EVENT,
SEQM_ADD_TEMPO,
@@ -128,6 +129,7 @@ struct AudioMsg : public ThreadMsg { // this should be an union
Part* spart;
Part* dpart;
Track* track;
+ QList<Event>* el;
const void *p1, *p2, *p3;
Event ev1, ev2;
@@ -242,6 +244,7 @@ class Audio {
void msgMoveTrack(Track*, Track*);
void msgAddEvent(const Event&, Part*, bool u = true);
+ void msgAddEvents(QList<Event>* el, Part* part);
void msgDeleteEvent(const Event&, Part*, bool u = true);
void msgChangeEvent(const Event&, const Event&, Part*, bool u = true);
diff --git a/muse/muse/audiotrack.cpp b/muse/muse/audiotrack.cpp
index 7ef63f1b..dc637bcd 100644
--- a/muse/muse/audiotrack.cpp
+++ b/muse/muse/audiotrack.cpp
@@ -399,7 +399,7 @@ void AudioTrack::record()
void AudioTrack::setChannels(int n)
{
if (n > MAX_CHANNELS) {
- fprintf(stderr, "too many channels!\n");
+ fprintf(stderr, "AudioTrack::setChannels(%d): too many channels!\n", n);
abort();
}
Track::setChannels(n);
diff --git a/muse/muse/driver/alsamidi.cpp b/muse/muse/driver/alsamidi.cpp
index 9b86ac12..f8133bd7 100644
--- a/muse/muse/driver/alsamidi.cpp
+++ b/muse/muse/driver/alsamidi.cpp
@@ -454,7 +454,7 @@ void AlsaMidi::read(MidiSeq* /*seq*/)
break;
}
}
-
+
case SND_SEQ_EVENT_KEYPRESS:
case SND_SEQ_EVENT_CHANPRESS:
case SND_SEQ_EVENT_NOTEON:
diff --git a/muse/muse/event.cpp b/muse/muse/event.cpp
index 525938b9..53d68c08 100644
--- a/muse/muse/event.cpp
+++ b/muse/muse/event.cpp
@@ -35,6 +35,7 @@ EventBase::EventBase(EventType t)
Pos::setType(_type == Wave ? AL::FRAMES : AL::TICKS);
refCount = 0;
_selected = false;
+ _recorded = false;
}
EventBase::EventBase(const EventBase& ev)
@@ -43,6 +44,7 @@ EventBase::EventBase(const EventBase& ev)
refCount = 0;
_selected = ev._selected;
_type = ev._type;
+ _recorded = ev._recorded;
}
//---------------------------------------------------------
@@ -142,9 +144,11 @@ bool Event::operator==(const Event& e) const {
int Event::getRefCount() const { return ev->getRefCount(); }
-bool Event::selected() const { return ev->_selected; }
-void Event::setSelected(bool val) { ev->_selected = val; }
-void Event::move(int offset) { ev->move(offset); }
+bool Event::selected() const { return ev->_selected; }
+void Event::setSelected(bool val) { ev->_selected = val; }
+bool Event::recorded() const { return ev->_recorded; }
+void Event::setRecorded(bool val) { ev->_recorded = val; }
+void Event::move(int offset) { ev->move(offset); }
void Event::read(QDomNode node) { ev->read(node); }
void Event::write(Xml& xml, const Pos& o) const { ev->write(xml, o); }
diff --git a/muse/muse/event.h b/muse/muse/event.h
index d58501a9..62b79756 100644
--- a/muse/muse/event.h
+++ b/muse/muse/event.h
@@ -57,6 +57,8 @@ class Event {
int getRefCount() const;
bool selected() const;
void setSelected(bool val);
+ bool recorded() const;
+ void setRecorded(bool val);
void move(int offset);
void read(QDomNode);
@@ -126,9 +128,9 @@ class EventList : public EL {
int cloneCount;
EventList() { cloneCount = 0; }
iEvent find(const Event&);
- iEvent add(Event& event);
- iEvent add(Event& event, unsigned tick);
- void move(Event& event, unsigned tick);
+ iEvent add(const Event& event);
+ iEvent add(const Event& event, unsigned tick);
+ void move(const Event& event, unsigned tick);
void dump() const;
void read(QDomNode, bool midi);
};
diff --git a/muse/muse/eventbase.h b/muse/muse/eventbase.h
index 7a2f438b..27d9e323 100644
--- a/muse/muse/eventbase.h
+++ b/muse/muse/eventbase.h
@@ -33,6 +33,7 @@ class EventBase : public AL::PosLen {
protected:
int refCount;
bool _selected;
+ bool _recorded;
public:
EventBase(EventType t);
@@ -41,11 +42,13 @@ class EventBase : public AL::PosLen {
virtual ~EventBase() {}
- int getRefCount() const { return refCount; }
- EventType type() const { return _type; }
- void setType(EventType t) { _type = t; }
+ int getRefCount() const { return refCount; }
+ EventType type() const { return _type; }
+ void setType(EventType t) { _type = t; }
bool selected() const { return _selected; }
- void setSelected(bool val) { _selected = val; }
+ void setSelected(bool val) { _selected = val; }
+ bool recorded() const { return _recorded; }
+ void setRecorded(bool val) { _recorded = val; }
void move(int offset);
diff --git a/muse/muse/eventlist.cpp b/muse/muse/eventlist.cpp
index e8289fc3..82d3b389 100644
--- a/muse/muse/eventlist.cpp
+++ b/muse/muse/eventlist.cpp
@@ -46,12 +46,12 @@ void EventList::read(QDomNode node, bool midi)
// add
//---------------------------------------------------------
-iEvent EventList::add(Event& event, unsigned tick)
+iEvent EventList::add(const Event& event, unsigned tick)
{
return std::multimap<unsigned, Event, std::less<unsigned> >::insert(std::pair<const unsigned, Event> (tick, event));
}
-iEvent EventList::add(Event& event)
+iEvent EventList::add(const Event& event)
{
return add(event, event.tick());
}
@@ -60,7 +60,7 @@ iEvent EventList::add(Event& event)
// move
//---------------------------------------------------------
-void EventList::move(Event& event, unsigned tick)
+void EventList::move(const Event& event, unsigned tick)
{
iEvent i = find(event);
erase(i);
diff --git a/muse/muse/midieventbase.h b/muse/muse/midieventbase.h
index da6af56b..64a8269c 100644
--- a/muse/muse/midieventbase.h
+++ b/muse/muse/midieventbase.h
@@ -28,8 +28,7 @@
//---------------------------------------------------------
class MidiEventBase : public EventBase {
- int a, b; // pitch, velo-on
- int c;
+ int a, b, c; // pitch, velo-on, velo-off
EvData edata;
virtual EventBase* clone() const { return new MidiEventBase(*this); }
diff --git a/muse/muse/midififo.cpp b/muse/muse/midififo.cpp
index dbf16942..cf244301 100644
--- a/muse/muse/midififo.cpp
+++ b/muse/muse/midififo.cpp
@@ -52,9 +52,10 @@ MidiEvent MidiFifo::get()
// peek
//---------------------------------------------------------
-MidiEvent MidiFifo::peek()
+const MidiEvent& MidiFifo::peek(int n)
{
- return fifo[rIndex];
+ int idx = (rIndex + n) % MIDI_FIFO_SIZE;
+ return fifo[idx];
}
//---------------------------------------------------------
diff --git a/muse/muse/midififo.h b/muse/muse/midififo.h
index d8b95bcc..2372f89e 100644
--- a/muse/muse/midififo.h
+++ b/muse/muse/midififo.h
@@ -40,10 +40,11 @@ class MidiFifo {
MidiFifo() { clear(); }
bool put(const MidiEvent& event); // returns true on fifo overflow
MidiEvent get();
- MidiEvent peek();
+ const MidiEvent& peek(int n = 0);
void remove();
bool isEmpty() const { return size == 0; }
void clear() { size = 0, wIndex = 0, rIndex = 0; }
+ int getSize() const { return size; }
};
//---------------------------------------------------------
diff --git a/muse/muse/midiinport.cpp b/muse/muse/midiinport.cpp
index 19365be6..81f88a1e 100644
--- a/muse/muse/midiinport.cpp
+++ b/muse/muse/midiinport.cpp
@@ -38,9 +38,6 @@ MidiInPort::MidiInPort()
: MidiTrackBase()
{
_channels = 1;
- recordRead = 0;
- recordWrite = 0;
- recordCount = 0;
for (int i = 0; i < MIDI_CHANNELS; ++i)
activity[i] = 0;
}
@@ -190,15 +187,8 @@ void MidiInPort::eventReceived(snd_seq_event_t* ev)
for (iMidiEvent i = ol.begin(); i != ol.end(); ++i) {
triggerActivity(i->channel());
song->putEvent(*i);
- if (recordCount == RECORD_FIFO_SIZE) {
+ if (recordFifo.put(*i))
printf("MusE: eventReceived(): fifo overflow\n");
- continue;
- }
- recordFifo[recordWrite] = *i;
- ++recordWrite;
- if (recordWrite == RECORD_FIFO_SIZE)
- recordWrite = 0;
- q_atomic_increment(&recordCount);
}
}
#endif
@@ -210,12 +200,8 @@ void MidiInPort::eventReceived(snd_seq_event_t* ev)
void MidiInPort::afterProcess()
{
- while (tmpRecordCount--) {
- ++recordRead;
- if (recordRead >= RECORD_FIFO_SIZE)
- recordRead = 0;
- q_atomic_decrement(&recordCount);
- }
+ while (tmpRecordCount--)
+ recordFifo.remove();
}
//---------------------------------------------------------
@@ -225,7 +211,7 @@ void MidiInPort::afterProcess()
void MidiInPort::beforeProcess()
{
- tmpRecordCount = recordCount;
+ tmpRecordCount = recordFifo.getSize();
}
//---------------------------------------------------------
@@ -238,13 +224,10 @@ void MidiInPort::beforeProcess()
void MidiInPort::getEvents(unsigned, unsigned, int ch, MidiEventList* dst)
{
- int tmpRecordRead = recordRead;
for (int i = 0; i < tmpRecordCount; ++i) {
- if (ch == -1 || recordFifo[tmpRecordRead].channel() == ch)
- dst->insert(recordFifo[tmpRecordRead]);
- ++tmpRecordRead;
- if (tmpRecordRead >= RECORD_FIFO_SIZE)
- tmpRecordRead = 0;
+ const MidiEvent& ev = recordFifo.peek(i);
+ if (ch == -1 || (ev.channel() == ch))
+ dst->insert(ev);
}
}
diff --git a/muse/muse/midiinport.h b/muse/muse/midiinport.h
index 2c718fb6..b50c9207 100644
--- a/muse/muse/midiinport.h
+++ b/muse/muse/midiinport.h
@@ -21,6 +21,7 @@
#ifndef __MIDIINPORT_H__
#define __MIDIINPORT_H__
+#include "midififo.h"
#include "miditrackbase.h"
#include "midievent.h"
@@ -33,9 +34,8 @@ static const int RECORD_FIFO_SIZE = 512;
class MidiInPort : public MidiTrackBase {
Q_OBJECT
- MidiEvent recordFifo[RECORD_FIFO_SIZE];
- int recordRead, recordWrite;
- volatile int recordCount;
+ MidiFifo recordFifo;
+
int tmpRecordCount;
int activity[MIDI_CHANNELS];
@@ -50,7 +50,7 @@ class MidiInPort : public MidiTrackBase {
virtual bool isMute() const { return _mute; }
virtual Part* newPart(Part*, bool) { return 0; }
-#ifndef __APPLE__
+#ifndef __APPLE__
void eventReceived(snd_seq_event_t*);
#endif
virtual void getEvents(unsigned from, unsigned to, int channel, MidiEventList* dst);
diff --git a/muse/muse/miditrack.cpp b/muse/muse/miditrack.cpp
index b86aa904..a14a2f75 100644
--- a/muse/muse/miditrack.cpp
+++ b/muse/muse/miditrack.cpp
@@ -225,6 +225,7 @@ void MidiTrack::recordBeat()
return;
}
}
+ QList<Event> el;
while (!recordFifo.isEmpty()) {
MidiEvent me(recordFifo.get());
@@ -266,10 +267,8 @@ void MidiTrack::recordBeat()
event.setLenTick(1);
event.setPitch(me.dataA());
event.setVelo(me.dataB());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
keyDown.push_front(event);
+ el.append(event);
}
else if (me.type() == ME_POLYAFTER) {
Event event(PAfter);
@@ -293,9 +292,7 @@ void MidiTrack::recordBeat()
datah = me.dataB();
event.setA(dataType | (rpnh << 8) | rpnl);
event.setB(datah);
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
break;
case CTRL_LDATA:
@@ -329,9 +326,7 @@ void MidiTrack::recordBeat()
default:
event.setA(me.dataA());
event.setB(me.dataB());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
break;
}
}
@@ -340,36 +335,36 @@ void MidiTrack::recordBeat()
event.setTick(time + ptick);
event.setA(CTRL_PROGRAM);
event.setB((hbank << 16) | (lbank << 8) | me.dataA());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
}
else if (me.type() == ME_PITCHBEND) {
Event event(Controller);
event.setTick(time + ptick);
event.setA(CTRL_PITCH);
event.setB(me.dataA());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
}
else if (me.type() == ME_SYSEX) {
Event event(Sysex);
event.setTick(time + ptick);
event.setData(me.data(), me.len());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
}
else if (me.type() == ME_AFTERTOUCH) {
Event event(CAfter);
event.setTick(time + ptick);
event.setA(me.dataA());
- audio->msgAddEvent(event, recordPart, false);
- ++recordedEvents;
- updateFlags |= SC_EVENT_INSERTED;
+ el.append(event);
}
}
+ if (!el.isEmpty()) {
+ for (int i = 0; i < el.size(); ++i)
+ el[i].setRecorded(true);
+ audio->msgAddEvents(&el, recordPart);
+ recordedEvents += el.size();
+ updateFlags |= SC_EVENT_INSERTED;
+ }
+
if (partCreated) {
recordPart->setLenTick(cpos - ptick);
updateFlags |= SC_PART_MODIFIED;
@@ -392,6 +387,9 @@ void MidiTrack::recordBeat()
void MidiTrack::stopRecording()
{
+ for (iEvent e = recordPart->events()->begin(); e != recordPart->events()->end(); ++e) {
+ e->second.setRecorded(false);
+ }
if (recordedEvents == 0 && partCreated) {
// TD: remove empty part?
}
@@ -500,6 +498,8 @@ void MidiTrack::processMidi(SeqTime* t)
for (; ie != iend; ++ie) {
Event ev = ie->second;
+ if (ev.recorded())
+ continue;
if (ev.type() == Meta) // ignore meta events
continue;
unsigned tick = ev.tick() + offset;
diff --git a/muse/muse/seqmsg.cpp b/muse/muse/seqmsg.cpp
index b330fe57..73f57a68 100644
--- a/muse/muse/seqmsg.cpp
+++ b/muse/muse/seqmsg.cpp
@@ -391,6 +391,19 @@ void Audio::msgAddEvent(const Event& event, Part* part, bool doUndoFlag)
}
//---------------------------------------------------------
+// msgAddEvents
+//---------------------------------------------------------
+
+void Audio::msgAddEvents(QList<Event>* el, Part* part)
+ {
+ AudioMsg msg;
+ msg.id = SEQM_ADD_EVENTS;
+ msg.el = el;
+ msg.p2 = part;
+ sendMessage(&msg, false);
+ }
+
+//---------------------------------------------------------
// msgDeleteEvent
//---------------------------------------------------------
diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp
index 1ede4c95..ea374b5c 100644
--- a/muse/muse/song.cpp
+++ b/muse/muse/song.cpp
@@ -109,11 +109,11 @@ void Song::setSig(const AL::TimeSignature& sig)
// return true if event was added
//---------------------------------------------------------
-bool Song::addEvent(Event& event, Part* part)
+bool Song::addEvent(const Event& event, Part* part)
{
if (event.type() == Controller) {
MidiTrack* track = (MidiTrack*)part->track();
- int tick = event.tick();
+ int tick = event.tick() + part->tick();
int cntrl = event.dataA();
CVal val;
val.i = event.dataB();
@@ -134,7 +134,7 @@ bool Song::addEvent(Event& event, Part* part)
// changeEvent
//---------------------------------------------------------
-void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part)
+void Song::changeEvent(const Event& oldEvent, const Event& newEvent, Part* part)
{
iEvent i = part->events()->find(oldEvent);
if (i == part->events()->end()) {
@@ -147,7 +147,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part)
if (newEvent.type() == Controller) {
MidiTrack* track = (MidiTrack*)part->track();
- int tick = newEvent.tick();
+ int tick = newEvent.tick() + part->tick();
int cntrl = newEvent.dataA();
CVal val;
val.i = newEvent.dataB();
@@ -159,13 +159,13 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part)
// deleteEvent
//---------------------------------------------------------
-void Song::deleteEvent(Event& event, Part* part)
+void Song::deleteEvent(const Event& event, Part* part)
{
#if 0 //TODO3
if (event.type() == Controller) {
MidiTrack* track = (MidiTrack*)part->track();
int ch = track->outChannel();
- int tick = event.tick();
+ int tick = event.tick() + part->tick();
int cntrl = event.dataA();
midiPorts[track->outPort()].deleteController(ch, tick, cntrl);
}
@@ -882,12 +882,21 @@ void Song::processMsg(AudioMsg* msg)
case SEQM_ADD_EVENT:
updateFlags = SC_EVENT_INSERTED;
if (addEvent(msg->ev1, (Part*)(msg->p2))) {
- Event ev;
- undoOp(UndoOp::AddEvent, ev, msg->ev1, (Part*)msg->p2);
+ undoOp(UndoOp::AddEvent, msg->ev1, (Part*)msg->p2);
}
else
updateFlags = 0;
break;
+
+ case SEQM_ADD_EVENTS:
+ updateFlags = SC_EVENT_INSERTED;
+ for (int i = 0; i < msg->el->size(); ++i) {
+ if (addEvent(msg->el->at(i), (Part*)(msg->p2))) {
+ undoOp(UndoOp::AddEvent, msg->el->at(i), (Part*)msg->p2);
+ }
+ }
+ break;
+
case SEQM_REMOVE_EVENT:
{
Event event = msg->ev1;
diff --git a/muse/muse/song.h b/muse/muse/song.h
index c15ce236..3ad574a0 100644
--- a/muse/muse/song.h
+++ b/muse/muse/song.h
@@ -270,9 +270,9 @@ class Song : public QObject {
// event manipulations
//-----------------------------------------
- bool addEvent(Event&, Part*);
- void changeEvent(Event&, Event&, Part*);
- void deleteEvent(Event&, Part*);
+ bool addEvent(const Event&, Part*);
+ void changeEvent(const Event&, const Event&, Part*);
+ void deleteEvent(const Event&, Part*);
void cmdChangeWave(QString original, QString tmpfile, unsigned sx, unsigned ex);
//-----------------------------------------
@@ -350,7 +350,8 @@ class Song : public QObject {
void undoOp(UndoOp::UndoType, int, Track*);
void undoOp(UndoOp::UndoType, int, int, int = 0);
void undoOp(UndoOp::UndoType, Part*);
- void undoOp(UndoOp::UndoType, Event& oevent, Event& nevent, Part*);
+ void undoOp(UndoOp::UndoType, const Event& oevent, const Event& nevent, Part*);
+ void undoOp(UndoOp::UndoType type, const Event& nev, Part* part);
void undoOp(UndoOp::UndoType, SigEvent* oevent, SigEvent* nevent);
void undoOp(UndoOp::UndoType, Part* oPart, Part* nPart);
void undoOp(UndoOp::UndoType, Track*, int, unsigned, CVal, CVal);
diff --git a/muse/muse/undo.cpp b/muse/muse/undo.cpp
index 403227ac..383f7d33 100644
--- a/muse/muse/undo.cpp
+++ b/muse/muse/undo.cpp
@@ -342,7 +342,7 @@ void Song::undoOp(UndoOp::UndoType type, Part* part)
addUndo(i);
}
-void Song::undoOp(UndoOp::UndoType type, Event& oev, Event& nev, Part* part)
+void Song::undoOp(UndoOp::UndoType type, const Event& oev, const Event& nev, Part* part)
{
UndoOp i;
i.type = type;
@@ -352,6 +352,15 @@ void Song::undoOp(UndoOp::UndoType type, Event& oev, Event& nev, Part* part)
addUndo(i);
}
+void Song::undoOp(UndoOp::UndoType type, const Event& nev, Part* part)
+ {
+ UndoOp i;
+ i.type = type;
+ i.nEvent = nev;
+ i.part = part;
+ addUndo(i);
+ }
+
void Song::undoOp(UndoOp::UndoType type, Part* oPart, Part* nPart)
{
UndoOp i;
diff --git a/muse/muse/undo.h b/muse/muse/undo.h
index ac9222c2..620199bb 100644
--- a/muse/muse/undo.h
+++ b/muse/muse/undo.h
@@ -30,6 +30,7 @@ class SigEvent;
class Part;
extern std::list<QString> temporaryWavFiles; //!< Used for storing all tmp-files, for cleanup on shutdown
+
//---------------------------------------------------------
// UndoOp
//---------------------------------------------------------
diff --git a/muse/muse/vst.cpp b/muse/muse/vst.cpp
index 91395444..eb0d044e 100644
--- a/muse/muse/vst.cpp
+++ b/muse/muse/vst.cpp
@@ -801,7 +801,7 @@ void VstSynthIF::write(Xml& xml) const
int params = _fst->numParameter();
for (int i = 0; i < params; ++i) {
float f = _fst->getParameter(i);
- xml.floatTag("param", f);
+ xml.tag("param", f);
}
}
@@ -811,7 +811,7 @@ void VstSynthIF::write(Xml& xml) const
void VstSynthIF::getData(MidiEventList* el, unsigned pos, int ports, unsigned n, float** buffer)
{
- int endPos = pos + n;
+ unsigned int endPos = pos + n;
iMidiEvent i = el->begin();
for (; i != el->end(); ++i) {
if (i->time() >= endPos)
@@ -1043,7 +1043,7 @@ void VstPluginIF::apply(unsigned nframes, float** src, float** dst)
// setParam
//---------------------------------------------------------
-void VstPluginIF::setParam(int i, float val)
+void VstPluginIF::setParam(int i, double val)
{
_fst->setParameter(i, val);
}
diff --git a/muse/muse/vst.h b/muse/muse/vst.h
index b22b231c..0ecea974 100644
--- a/muse/muse/vst.h
+++ b/muse/muse/vst.h
@@ -157,7 +157,7 @@ class VstPluginIF : public PluginIF {
virtual void activate() {}
virtual void deactivate() {}
virtual void cleanup() {}
- virtual void setParam(int i, float val);
+ virtual void setParam(int i, double val);
virtual float param(int i) const;
virtual const char* getParameterName(int k) const;
virtual const char* getParameterLabel(int) const;