summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-01-17 16:20:51 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-01-17 16:20:51 +0000
commit5b205da5d042feb64161e24b61c50271c31d2292 (patch)
tree7450c5e72f331747cbfcab7fce2681f91ca1dd91 /muse2/muse
parentdfc1ba699f837700a005a218da56e17016965f4d (diff)
fixed panic button and init crash
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/arranger.cpp1
-rw-r--r--muse2/muse/midi.cpp6
-rw-r--r--muse2/muse/midiport.cpp27
-rw-r--r--muse2/muse/midiport.h2
-rw-r--r--muse2/muse/widgets/projectcreateimpl.cpp2
5 files changed, 26 insertions, 12 deletions
diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp
index 834b9613..38583d48 100644
--- a/muse2/muse/arranger/arranger.cpp
+++ b/muse2/muse/arranger/arranger.cpp
@@ -933,6 +933,7 @@ void Arranger::clear()
delete w;
trackInfo->addWidget(0, 2);
selected = 0;
+ midiTrackInfo->setTrack(0);
}
void Arranger::wheelEvent(QWheelEvent* ev)
diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp
index e339f29b..87e9ff32 100644
--- a/muse2/muse/midi.cpp
+++ b/muse2/muse/midi.cpp
@@ -636,8 +636,10 @@ void Audio::panic()
if (port == 0) // ??
continue;
for (int chan = 0; chan < MIDI_CHANNELS; ++chan) {
- port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_ALL_SOUNDS_OFF, 0));
- port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_RESET_ALL_CTRL, 0));
+ if (debugMsg)
+ printf("send all sound of to midi port %d channel %d\n", i, chan);
+ port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_ALL_SOUNDS_OFF, 0), true);
+ port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_RESET_ALL_CTRL, 0), true);
}
}
}
diff --git a/muse2/muse/midiport.cpp b/muse2/muse/midiport.cpp
index 16cfd429..66da871a 100644
--- a/muse2/muse/midiport.cpp
+++ b/muse2/muse/midiport.cpp
@@ -664,7 +664,7 @@ int MidiPort::limitValToInstrCtlRange(int ctl, int val)
// return true, if event cannot be delivered
//---------------------------------------------------------
-bool MidiPort::sendEvent(const MidiPlayEvent& ev)
+bool MidiPort::sendEvent(const MidiPlayEvent& ev, bool forceSend)
{
if (ev.type() == ME_CONTROLLER) {
@@ -708,8 +708,12 @@ bool MidiPort::sendEvent(const MidiPlayEvent& ev)
// return false;
// }
// printf("set HW Ctrl State ch:%d 0x%x 0x%x\n", ev.channel(), ev.dataA(), ev.dataB());
- if(!setHwCtrlState(ev.channel(), da, db))
- return false;
+ if(!setHwCtrlState(ev.channel(), da, db)) {
+ if (debugMsg)
+ printf("setHwCtrlState failed\n");
+ if (!forceSend)
+ return false;
+ }
}
else
if (ev.type() == ME_PITCHBEND)
@@ -719,19 +723,26 @@ bool MidiPort::sendEvent(const MidiPlayEvent& ev)
//if (hwCtrlState(ev.channel(), CTRL_PITCH) == ev.dataA())
// return false;
- if(!setHwCtrlState(ev.channel(), CTRL_PITCH, da))
- return false;
+ if(!setHwCtrlState(ev.channel(), CTRL_PITCH, da)) {
+ if (!forceSend)
+ return false;
+ }
}
else
if (ev.type() == ME_PROGRAM)
{
- if(!setHwCtrlState(ev.channel(), CTRL_PROGRAM, ev.dataA()))
+ if(!setHwCtrlState(ev.channel(), CTRL_PROGRAM, ev.dataA())) {
+ if (!forceSend)
return false;
+ }
}
- if (!_device)
- return true;
+ if (!_device) {
+ if (debugMsg)
+ printf("no device for this midi port\n");
+ return true;
+ }
return _device->putEvent(ev);
}
diff --git a/muse2/muse/midiport.h b/muse2/muse/midiport.h
index 7ee83cc9..0fa33a11 100644
--- a/muse2/muse/midiport.h
+++ b/muse2/muse/midiport.h
@@ -116,7 +116,7 @@ class MidiPort {
void sendMMCStop(int devid = -1);
void sendMMCDeferredPlay(int devid = -1);
- bool sendEvent(const MidiPlayEvent&);
+ bool sendEvent(const MidiPlayEvent&, bool forceSend = false );
AutomationType automationType(int channel) { return _automationType[channel]; }
void setAutomationType(int channel, AutomationType t) {
_automationType[channel] = t;
diff --git a/muse2/muse/widgets/projectcreateimpl.cpp b/muse2/muse/widgets/projectcreateimpl.cpp
index c7aa0fdb..d455c917 100644
--- a/muse2/muse/widgets/projectcreateimpl.cpp
+++ b/muse2/muse/widgets/projectcreateimpl.cpp
@@ -49,7 +49,7 @@ void ProjectCreateImpl::updateDirectoryPath()
} else {
if (!projectNameEdit->text().isEmpty())
name = projectNameEdit->text() + ".med";
- storageDirEdit->setText(directoryPath + projectNameEdit->text() + name);
+ storageDirEdit->setText(directoryPath +"/" + name);
}
}