summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-12-13 00:18:21 +0000
committerTim E. Real <termtech@rogers.com>2012-12-13 00:18:21 +0000
commit469316ca9c63006cda58b4b25bd5f6b1f7d67f4b (patch)
treeda35720b36c94a81a3f72b5cb358d596e304788e /muse2/muse
parent079a13764229873cc395c808a0333674b790edbf (diff)
Fixed some vst controls stuck.
Added vst master timebase (sequencers should work now). Not quite finished. Fixed weird QString bug causing some patch names to appear with garbage characters.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/dssihost.cpp2
-rw-r--r--muse2/muse/dssihost.h2
-rw-r--r--muse2/muse/instruments/minstrument.cpp4
-rw-r--r--muse2/muse/instruments/minstrument.h2
-rw-r--r--muse2/muse/synth.cpp8
-rw-r--r--muse2/muse/synth.h13
-rw-r--r--muse2/muse/ticksynth.cpp2
-rw-r--r--muse2/muse/vst.h2
-rw-r--r--muse2/muse/vst_native.cpp10
-rw-r--r--muse2/muse/vst_native.h2
-rw-r--r--muse2/muse/widgets/mtrackinfo.cpp9
11 files changed, 17 insertions, 39 deletions
diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp
index 8e49b368..4391dfd9 100644
--- a/muse2/muse/dssihost.cpp
+++ b/muse2/muse/dssihost.cpp
@@ -2163,7 +2163,7 @@ void DssiSynthIF::doSelectProgram(LADSPA_Handle handle, int bank, int prog)
// getPatchName
//---------------------------------------------------------
-const char* DssiSynthIF::getPatchName(int /*chan*/, int prog, bool /*drum*/)
+QString DssiSynthIF::getPatchName(int /*chan*/, int prog, bool /*drum*/) const
{
unsigned program = prog & 0x7f;
int lbank = (prog >> 8) & 0xff;
diff --git a/muse2/muse/dssihost.h b/muse2/muse/dssihost.h
index 99626c92..27ef05a3 100644
--- a/muse2/muse/dssihost.h
+++ b/muse2/muse/dssihost.h
@@ -173,7 +173,7 @@ class DssiSynthIF : public SynthIF
virtual void deactivate3();
- virtual const char* getPatchName(int, int, bool);
+ virtual QString getPatchName(int, int, bool) const;
virtual void populatePatchPopup(MusEGui::PopupMenu*, int, bool);
virtual void write(int level, Xml& xml) const;
diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp
index b7a2c7bf..c119f0bc 100644
--- a/muse2/muse/instruments/minstrument.cpp
+++ b/muse2/muse/instruments/minstrument.cpp
@@ -1093,7 +1093,7 @@ void MidiInstrument::populatePatchPopup(MusEGui::PopupMenu* menu, int /*chan*/,
// getPatchName
//---------------------------------------------------------
-const char* MidiInstrument::getPatchName(int /*channel*/, int prog, bool drum) const
+QString MidiInstrument::getPatchName(int /*channel*/, int prog, bool drum) const
{
int pr = prog & 0xff;
if(prog == CTRL_VAL_UNKNOWN || pr == 0xff)
@@ -1115,7 +1115,7 @@ const char* MidiInstrument::getPatchName(int /*channel*/, int prog, bool drum) c
&& (hbank == mp->hbank || !hb || mp->hbank == -1)
&& (lbank == mp->lbank || !lb || mp->lbank == -1))
- return mp->name.toLatin1().constData();
+ return mp->name;
}
}
return "<unknown>";
diff --git a/muse2/muse/instruments/minstrument.h b/muse2/muse/instruments/minstrument.h
index 665c2437..5a520e67 100644
--- a/muse2/muse/instruments/minstrument.h
+++ b/muse2/muse/instruments/minstrument.h
@@ -238,7 +238,7 @@ class MidiInstrument {
virtual void writeToGui(const MidiPlayEvent&) {}
virtual void reset(int);
- virtual const char* getPatchName(int,int,bool) const;
+ virtual QString getPatchName(int,int,bool) const;
virtual void populatePatchPopup(MusEGui::PopupMenu*, int, bool);
void read(Xml&);
void write(int level, Xml&);
diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp
index 92c0a27d..e16e87d6 100644
--- a/muse2/muse/synth.cpp
+++ b/muse2/muse/synth.cpp
@@ -919,14 +919,10 @@ void SynthI::read(Xml& xml)
// getPatchName
//---------------------------------------------------------
-const char* MessSynthIF::getPatchName(int channel, int prog, bool drum)
+QString MessSynthIF::getPatchName(int channel, int prog, bool drum) const
{
if (_mess)
- {
- const char* s = _mess->getPatchName(channel, prog, drum);
- if(s)
- return s;
- }
+ return _mess->getPatchName(channel, prog, drum);
return "";
}
diff --git a/muse2/muse/synth.h b/muse2/muse/synth.h
index 62c461c4..6b42c1f5 100644
--- a/muse2/muse/synth.h
+++ b/muse2/muse/synth.h
@@ -154,7 +154,7 @@ class SynthIF : public PluginIBase {
virtual int totalOutChannels() const = 0;
virtual int totalInChannels() const = 0;
virtual void deactivate3() = 0;
- virtual const char* getPatchName(int, int, bool) = 0;
+ virtual QString getPatchName(int, int, bool) const = 0;
virtual void populatePatchPopup(MusEGui::PopupMenu*, int, bool) = 0;
virtual void write(int level, Xml& xml) const = 0;
virtual float getParameter(unsigned long idx) const = 0;
@@ -270,13 +270,8 @@ class SynthI : public AudioTrack, public MidiDevice,
Synth* synth() const { return synthesizer; }
virtual bool isSynti() const { return true; }
- virtual const char* getPatchName(int ch, int prog, bool dr) const {
- // REMOVE Tim.
- const char* s = _sif->getPatchName(ch, prog, dr);
- //fprintf(stderr, "SynthI::getPatchName patch name:%s\n", s); // REMOVE Tim.
- return s;
-
- ///return _sif->getPatchName(ch, prog, dr);
+ virtual QString getPatchName(int ch, int prog, bool dr) const {
+ return _sif->getPatchName(ch, prog, dr);
}
virtual void populatePatchPopup(MusEGui::PopupMenu* m, int i, bool d) {
@@ -363,7 +358,7 @@ class MessSynthIF : public SynthIF {
virtual int totalOutChannels() const;
virtual int totalInChannels() const;
virtual void deactivate3();
- virtual const char* getPatchName(int, int, bool);
+ virtual QString getPatchName(int, int, bool) const;
virtual void populatePatchPopup(MusEGui::PopupMenu*, int, bool);
virtual void write(int level, Xml& xml) const;
virtual float getParameter(unsigned long) const { return 0.0; }
diff --git a/muse2/muse/ticksynth.cpp b/muse2/muse/ticksynth.cpp
index f03414fc..a70d0174 100644
--- a/muse2/muse/ticksynth.cpp
+++ b/muse2/muse/ticksynth.cpp
@@ -100,7 +100,7 @@ class MetronomeSynthIF : public SynthIF
virtual int totalOutChannels() const { return 1; }
virtual int totalInChannels() const { return 0; }
virtual void deactivate3() {}
- virtual const char* getPatchName(int, int, bool) { return ""; }
+ virtual QString getPatchName(int, int, bool) const { return ""; }
virtual void populatePatchPopup(MusEGui::PopupMenu*, int, bool) {};
virtual void write(int, Xml&) const {}
virtual float getParameter(unsigned long) const { return 0.0; }
diff --git a/muse2/muse/vst.h b/muse2/muse/vst.h
index 7e693863..1143d56e 100644
--- a/muse2/muse/vst.h
+++ b/muse2/muse/vst.h
@@ -93,7 +93,7 @@ class VstSynthIF : public SynthIF
virtual int totalOutChannels() const;
virtual int totalInChannels() const;
virtual void deactivate3();
- virtual const char* getPatchName(int, int, bool) { return ""; }
+ virtual QString getPatchName(int, int, bool) const { return ""; }
virtual void populatePatchPopup(PopupMenu*, int, bool) {};
virtual void write(int level, Xml& xml) const;
virtual float getParameter(unsigned long idx) const;
diff --git a/muse2/muse/vst_native.cpp b/muse2/muse/vst_native.cpp
index 6de5f8f4..b6208d5b 100644
--- a/muse2/muse/vst_native.cpp
+++ b/muse2/muse/vst_native.cpp
@@ -1414,8 +1414,6 @@ void VstNativeSynthIF::queryPrograms()
}
//#endif
- //fprintf(stderr, " VstNativeSynthIF::queryPrograms(): patch name:%s\n", buf); // REMOVE Tim.
-
int bankH = (prog >> 14) & 0x7f;
int bankL = (prog >> 7) & 0x7f;
int patch = prog & 0x7f;
@@ -1520,7 +1518,7 @@ void VstNativeSynthIF::doSelectProgram(int bankH, int bankL, int prog)
// getPatchName
//---------------------------------------------------------
-const char* VstNativeSynthIF::getPatchName(int /*chan*/, int prog, bool /*drum*/)
+QString VstNativeSynthIF::getPatchName(int /*chan*/, int prog, bool /*drum*/) const
{
unsigned long program = prog & 0x7f;
unsigned long lbank = (prog >> 8) & 0xff;
@@ -1536,12 +1534,8 @@ const char* VstNativeSynthIF::getPatchName(int /*chan*/, int prog, bool /*drum*/
{
for(std::vector<VST_Program>::const_iterator i = programs.begin(); i != programs.end(); ++i)
{
- //fprintf(stderr, " VstNativeSynthIF::patch name:%s\n", i->name.toLatin1().constData()); // REMOVE Tim.
if(i->program == p)
- {
- //fprintf(stderr, " found patch name:%s\n", i->name.toLatin1().constData()); // REMOVE Tim.
- return i->name.toLatin1().constData();
- }
+ return i->name;
}
}
return "?";
diff --git a/muse2/muse/vst_native.h b/muse2/muse/vst_native.h
index 5b8f1328..4bbe1411 100644
--- a/muse2/muse/vst_native.h
+++ b/muse2/muse/vst_native.h
@@ -208,7 +208,7 @@ class VstNativeSynthIF : public SynthIF
virtual int totalOutChannels() const;
virtual int totalInChannels() const;
virtual void deactivate3();
- virtual const char* getPatchName(int chan, int prog, bool drum);
+ virtual QString getPatchName(int chan, int prog, bool drum) const;
virtual void populatePatchPopup(MusEGui::PopupMenu* menu, int chan, bool drum);
virtual void write(int level, Xml& xml) const;
virtual float getParameter(unsigned long idx) const;
diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp
index 203a81e7..09d45577 100644
--- a/muse2/muse/widgets/mtrackinfo.cpp
+++ b/muse2/muse/widgets/mtrackinfo.cpp
@@ -415,16 +415,13 @@ void MidiTrackInfo::heartBeat()
{
MusECore::MidiInstrument* instr = mp->instrument();
const QString name = instr->getPatchName(outChannel, nprogram, track->isDrumTrack());
- //const char* name = instr->getPatchName(outChannel, nprogram, track->isDrumTrack());
if(name.isEmpty())
- //if(name == NULL)
{
const QString n("???");
if(iPatch->text() != n)
iPatch->setText(n);
}
else if(iPatch->text() != name)
- //else if(strcmp(iPatch->text().constData(), QChar name))
iPatch->setText(name);
}
}
@@ -458,12 +455,8 @@ void MidiTrackInfo::heartBeat()
//else
//{
MusECore::MidiInstrument* instr = mp->instrument();
- //const QString name = instr->getPatchName(outChannel, program, track->isDrumTrack());
- const char* chr_name = instr->getPatchName(outChannel, program, track->isDrumTrack());
- const QString name(chr_name);
- //fprintf(stderr, "patch name qstring:%s charstr:%s\n", name.toLatin1().constData(), chr_name); // REMOVE Tim.
+ const QString name = instr->getPatchName(outChannel, program, track->isDrumTrack());
if(iPatch->text() != name)
- //if(!strcmp(iPatch->text().toLatin1().constData(), name))
iPatch->setText(name);
int hb = ((program >> 16) & 0xff) + 1;