diff options
Diffstat (limited to 'muse2/muse/exportmidi.cpp')
-rw-r--r-- | muse2/muse/exportmidi.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp index cd57c22f..332ad026 100644 --- a/muse2/muse/exportmidi.cpp +++ b/muse2/muse/exportmidi.cpp @@ -128,6 +128,8 @@ static void addController(MPEventList* l, int tick, int port, int channel, int a } } +namespace MusEApp { + //--------------------------------------------------------- // exportMidi //--------------------------------------------------------- @@ -137,7 +139,7 @@ void MusE::exportMidi() MFile file(QString("midis"), QString(".mid")); //FILE* fp = file.open("w", midi_file_pattern, this, false, true, - FILE* fp = file.open("w", midi_file_save_pattern, this, false, true, + FILE* fp = file.open("w", MusEGlobal::midi_file_save_pattern, this, false, true, tr("MusE: Export Midi")); if (fp == 0) return; @@ -182,7 +184,7 @@ void MusE::exportMidi() //--------------------------------------------------- // Write Copyright // - QByteArray ba = config.copyright.toLatin1(); + QByteArray ba = MusEConfig::config.copyright.toLatin1(); const char* copyright = ba.constData(); if (copyright && *copyright) { int len = strlen(copyright); @@ -247,7 +249,7 @@ void MusE::exportMidi() for (AL::ciSigEvent e = sl->begin(); e != sl->end(); ++e) { ///SigEvent* event = e->second; AL::SigEvent* event = e->second; - int sz = (config.exp2ByteTimeSigs ? 2 : 4); // export 2 byte timesigs instead of 4 ? + int sz = (MusEConfig::config.exp2ByteTimeSigs ? 2 : 4); // export 2 byte timesigs instead of 4 ? unsigned char data[sz]; data[0] = event->sig.z; switch(event->sig.n) { @@ -264,7 +266,7 @@ void MusE::exportMidi() } // By T356. In muse the metronome pulse is fixed at 24 (once per quarter-note). // The number of 32nd notes per 24 MIDI clock signals (per quarter-note) is 8. - if(!config.exp2ByteTimeSigs) + if(!MusEConfig::config.exp2ByteTimeSigs) { data[2] = 24; data[3] = 8; @@ -359,7 +361,7 @@ void MusE::exportMidi() len = 1; l->add(MidiPlayEvent(tick, port, channel, ME_NOTEON, pitch, velo)); - if(config.expOptimNoteOffs) // Save space by replacing note offs with note on velocity 0 + if(MusEConfig::config.expOptimNoteOffs) // Save space by replacing note offs with note on velocity 0 l->add(MidiPlayEvent(tick+len, port, channel, ME_NOTEON, pitch, 0)); else l->add(MidiPlayEvent(tick+len, port, channel, ME_NOTEOFF, pitch, velo)); @@ -395,9 +397,10 @@ void MusE::exportMidi() } } } - mf.setDivision(config.midiDivision); + mf.setDivision(MusEConfig::config.midiDivision); mf.setMType(song->mtype()); mf.setTrackList(mtl, ntracks); mf.write(); } +} // namespace MusEApp |