Add new comment

When importing a standard MIDI file, the clip name is first set from the Mtrk TRACKNAME. But later it is unconditionally overwritten with the SMF filename basename.
This one line patch changes the behavior so if the clip name is already set (presumably from Mtrk TRACKNAME), then it is not changed to filename.

diff --git a/src/qtractorMidiClip.cpp b/src/qtractorMidiClip.cpp
index e2b3a78..077bbd4 100644
--- a/src/qtractorMidiClip.cpp
+++ b/src/qtractorMidiClip.cpp
@@ -475,11 +475,12 @@ bool qtractorMidiClip::openMidiFile (
                }
                // We should have events, otherwise this clip is of no use...
                //if (m_pSeq->events().count() < 1)
                //      return false;
                // And initial clip name...
-               pSeq->setName(shortClipName(QFileInfo(m_pFile->filename()).baseName()));
+               if (pSeq->name().isEmpty()) // if not already set from SMF TRACKNAME meta-event
+                       pSeq->setName(shortClipName(QFileInfo(m_pFile->filename()).baseName()));
        }
 
        // Actual track-channel is set by now...
        setTrackChannel(iTrackChannel);
 
The content of this field is kept private and will not be shown publicly.

Markdown

  • Parses markdown and converts it to HTML.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt height width> <strike> <pre> <p> <br>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <b> <i> <pre> <img src alt height width> <strike>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
File attachments
Unlimited number of files can be uploaded to this field.
2 MB limit.
Allowed types: jpg jpeg gif png txt doc docx xls xlsx pdf ppt pps odt ods odp zip gz bz2 xz patch diff wav ogg flac ogv mp4 qtz.
CAPTCHA
Enter the characters shown in the image.