qtractor: move to git/neonx-branch to get all the patches submitted
Hope they find their way to master... Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
This commit is contained in:
@@ -1,362 +0,0 @@
|
||||
From 2dfcb12439328353cac5846e81872b8484c2403e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
|
||||
Date: Tue, 3 Oct 2017 21:39:19 +0200
|
||||
Subject: [PATCH 1/2] Add ARM NEON acceleration
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
* More or less a 1/1 copy of SSE implementation. Where possible make use of
|
||||
multiply/accumulate (vmla)
|
||||
* Runtime NEON detection is not easy to implement. The only implementations I
|
||||
found did not work properly e.g [1]. So let's trust the compiler.
|
||||
* On RaspberryPi3 test arrangement with 8 Midi-Tracks / 4 LV2-Plugins the idle
|
||||
load is reduced from 30% -> 29%.
|
||||
|
||||
[1] http://git.openembedded.org/meta-openembedded/commit/meta-oe?id=cae9cafb9c536fd5ea40d1457c0ee1fcd6a6aa43
|
||||
|
||||
Upstream-Status: Submitted [2]
|
||||
|
||||
[2] https://github.com/rncbc/qtractor/pull/81
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
|
||||
---
|
||||
src/qtractorAudioEngine.cpp | 40 ++++++++++++++++
|
||||
src/qtractorAudioMonitor.cpp | 95 ++++++++++++++++++++++++++++++++++--
|
||||
src/qtractorInsertPlugin.cpp | 111 +++++++++++++++++++++++++++++++++++++++----
|
||||
3 files changed, 234 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/qtractorAudioEngine.cpp b/src/qtractorAudioEngine.cpp
|
||||
index 55dd2c7..e79e272 100644
|
||||
--- a/src/qtractorAudioEngine.cpp
|
||||
+++ b/src/qtractorAudioEngine.cpp
|
||||
@@ -118,6 +118,38 @@ static inline void sse_buffer_add (
|
||||
|
||||
#endif
|
||||
|
||||
+#if defined(__ARM_NEON__)
|
||||
+#include "arm_neon.h"
|
||||
+
|
||||
+// NEON enabled mix-down processor version.
|
||||
+static inline void neon_buffer_add (
|
||||
+ float **ppBuffer, float **ppFrames, unsigned int iFrames,
|
||||
+ unsigned short iBuffers, unsigned short iChannels, unsigned int iOffset )
|
||||
+{
|
||||
+ unsigned short j = 0;
|
||||
+
|
||||
+ for (unsigned short i = 0; i < iChannels; ++i) {
|
||||
+ float *pBuffer = ppBuffer[j] + iOffset;
|
||||
+ float *pFrames = ppFrames[i] + iOffset;
|
||||
+ unsigned int nframes = iFrames;
|
||||
+ for (; (long(pBuffer) & 15) && (nframes > 0); --nframes)
|
||||
+ *pBuffer++ += *pFrames++;
|
||||
+ for (; nframes >= 4; nframes -= 4) {
|
||||
+ vst1q_f32(pBuffer,
|
||||
+ vaddq_f32(
|
||||
+ vld1q_f32(pBuffer),
|
||||
+ vld1q_f32(pFrames)));
|
||||
+ pFrames += 4;
|
||||
+ pBuffer += 4;
|
||||
+ }
|
||||
+ for (; nframes > 0; --nframes)
|
||||
+ *pBuffer++ += *pFrames++;
|
||||
+ if (++j >= iBuffers)
|
||||
+ j = 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
|
||||
// Standard mix-down processor version.
|
||||
static inline void std_buffer_add (
|
||||
@@ -162,6 +194,10 @@ public:
|
||||
m_pfnBufferAdd = sse_buffer_add;
|
||||
else
|
||||
#endif
|
||||
+#if defined(__ARM_NEON__)
|
||||
+ m_pfnBufferAdd = neon_buffer_add;
|
||||
+ if(false)
|
||||
+#endif
|
||||
m_pfnBufferAdd = std_buffer_add;
|
||||
}
|
||||
|
||||
@@ -2133,6 +2169,10 @@ qtractorAudioBus::qtractorAudioBus (
|
||||
m_pfnBufferAdd = sse_buffer_add;
|
||||
else
|
||||
#endif
|
||||
+#if defined(__ARM_NEON__)
|
||||
+ m_pfnBufferAdd = neon_buffer_add;
|
||||
+ if(false)
|
||||
+#endif
|
||||
m_pfnBufferAdd = std_buffer_add;
|
||||
}
|
||||
|
||||
diff --git a/src/qtractorAudioMonitor.cpp b/src/qtractorAudioMonitor.cpp
|
||||
index e9a0fd1..19f212b 100644
|
||||
--- a/src/qtractorAudioMonitor.cpp
|
||||
+++ b/src/qtractorAudioMonitor.cpp
|
||||
@@ -53,7 +53,6 @@ static inline bool sse_enabled (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
-
|
||||
// SSE enabled processor versions.
|
||||
static inline void sse_process (
|
||||
float *pFrames, unsigned int iFrames, float fGain, float *pfValue )
|
||||
@@ -122,6 +121,89 @@ static inline void sse_process_meter (
|
||||
#endif
|
||||
|
||||
|
||||
+#if defined(__ARM_NEON__)
|
||||
+#include "arm_neon.h"
|
||||
+
|
||||
+// NEON enabled processor versions.
|
||||
+static inline void neon_process (
|
||||
+ float *pFrames, unsigned int iFrames, float fGain, float *pfValue )
|
||||
+{
|
||||
+ float32x4_t v0 = vld1q_dup_f32(&fGain);
|
||||
+ float32x4_t v1 = vld1q_dup_f32(pfValue);
|
||||
+ float32x4_t v2;
|
||||
+
|
||||
+ for (; (long(pFrames) & 15) && (iFrames > 0); --iFrames)
|
||||
+ *pFrames++ *= fGain;
|
||||
+
|
||||
+ for (; iFrames >= 4; iFrames -= 4) {
|
||||
+ v2 = vmulq_f32(vld1q_f32(pFrames), v0);
|
||||
+ v1 = vmaxq_f32(v2, v1);
|
||||
+ vst1q_f32(pFrames, v2);
|
||||
+ pFrames += 4;
|
||||
+ }
|
||||
+
|
||||
+ for (; iFrames > 0; --iFrames)
|
||||
+ *pFrames++ *= fGain;
|
||||
+
|
||||
+ vst1q_lane_f32(pfValue, v1, 0); // CHEAT: take 1st of 4 possible values.
|
||||
+}
|
||||
+
|
||||
+static inline void neon_process_ramp ( float *pFrames, unsigned int iFrames,
|
||||
+ float fGainIter, float fGainLast, float *pfValue )
|
||||
+{
|
||||
+ const float fGainStepSingle = (fGainLast - fGainIter) / float(iFrames);
|
||||
+
|
||||
+ for (; (long(pFrames) & 15) && (iFrames > 0); --iFrames) {
|
||||
+ *pFrames++ *= fGainIter;
|
||||
+ fGainIter += fGainStepSingle;
|
||||
+ }
|
||||
+
|
||||
+ float __attribute__ ((aligned (16))) fInitGainIter[4] = {
|
||||
+ fGainIter,
|
||||
+ fGainIter + fGainStepSingle,
|
||||
+ fGainIter + 2.0 * fGainStepSingle,
|
||||
+ fGainIter + 3.0 * fGainStepSingle };
|
||||
+
|
||||
+ const float fGainStep = 4.0f * fGainStepSingle;
|
||||
+ float32x4_t vGainIter = vld1q_f32(fInitGainIter);
|
||||
+ float32x4_t vGainStep = vld1q_dup_f32(&fGainStep);
|
||||
+ float32x4_t v1 = vld1q_dup_f32(pfValue);
|
||||
+ float32x4_t v2;
|
||||
+
|
||||
+ for (; iFrames >= 4; iFrames -= 4) {
|
||||
+ v2 = vmulq_f32(vld1q_f32(pFrames), vGainIter);
|
||||
+ v1 = vmaxq_f32(v2, v1);
|
||||
+ vst1q_f32(pFrames, v2);
|
||||
+ vGainIter += vGainStep;
|
||||
+ pFrames += 4;
|
||||
+ }
|
||||
+
|
||||
+ for (; iFrames > 0; --iFrames) {
|
||||
+ *pFrames++ *= fGainIter;
|
||||
+ fGainIter += fGainStepSingle;
|
||||
+ }
|
||||
+
|
||||
+ vst1q_lane_f32(pfValue, v1, 3); // CHEAT: take 4th of 4 possible values.
|
||||
+}
|
||||
+
|
||||
+static inline void neon_process_meter (
|
||||
+ float *pFrames, unsigned int iFrames, float *pfValue )
|
||||
+{
|
||||
+ float32x4_t v1 = vld1q_dup_f32(pfValue);
|
||||
+
|
||||
+ for (; (long(pFrames) & 15) && (iFrames > 0); --iFrames)
|
||||
+ ++pFrames;
|
||||
+
|
||||
+ for (; iFrames >= 4; iFrames -= 4) {
|
||||
+ v1 = vmaxq_f32(vld1q_f32(pFrames), v1);
|
||||
+ pFrames += 4;
|
||||
+ }
|
||||
+
|
||||
+ vst1q_lane_f32(pfValue, v1, 0); // CHEAT: take 1st of 4 possible values.
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
// Standard processor versions.
|
||||
static inline void std_process (
|
||||
float *pFrames, unsigned int iFrames, float fGain, float *pfValue )
|
||||
@@ -173,14 +255,19 @@ qtractorAudioMonitor::qtractorAudioMonitor ( unsigned short iChannels,
|
||||
m_pfnProcess = sse_process;
|
||||
m_pfnProcessRamp = sse_process_ramp;
|
||||
m_pfnProcessMeter = sse_process_meter;
|
||||
- } else {
|
||||
+ } else
|
||||
#endif
|
||||
+#if defined(__ARM_NEON__)
|
||||
+ m_pfnProcess = neon_process;
|
||||
+ m_pfnProcessRamp = neon_process_ramp;
|
||||
+ m_pfnProcessMeter = neon_process_meter;
|
||||
+ if(false)
|
||||
+#endif
|
||||
+ {
|
||||
m_pfnProcess = std_process;
|
||||
m_pfnProcessRamp = std_process_ramp;
|
||||
m_pfnProcessMeter = std_process_meter;
|
||||
-#if defined(__SSE__)
|
||||
}
|
||||
-#endif
|
||||
|
||||
setChannels(iChannels);
|
||||
}
|
||||
diff --git a/src/qtractorInsertPlugin.cpp b/src/qtractorInsertPlugin.cpp
|
||||
index 40e21e3..a5f909c 100644
|
||||
--- a/src/qtractorInsertPlugin.cpp
|
||||
+++ b/src/qtractorInsertPlugin.cpp
|
||||
@@ -155,6 +155,94 @@ static inline void sse_process_add (
|
||||
|
||||
#endif
|
||||
|
||||
+#if defined(__ARM_NEON__)
|
||||
+#include "arm_neon.h"
|
||||
+
|
||||
+// NEON enabled processor versions.
|
||||
+static inline void neon_process_gain (
|
||||
+ float **ppFrames, unsigned int iFrames,
|
||||
+ unsigned short iChannels, float fGain )
|
||||
+{
|
||||
+ float32x4_t vGain = vdupq_n_f32(fGain);
|
||||
+
|
||||
+ for (unsigned short i = 0; i < iChannels; ++i) {
|
||||
+ float *pFrames = ppFrames[i];
|
||||
+ unsigned int nframes = iFrames;
|
||||
+ for (; (long(pFrames) & 15) && (nframes > 0); --nframes)
|
||||
+ *pFrames++ *= fGain;
|
||||
+ for (; nframes >= 4; nframes -= 4) {
|
||||
+ vst1q_f32(pFrames,
|
||||
+ vmulq_f32(
|
||||
+ vld1q_f32(pFrames), vGain
|
||||
+ )
|
||||
+ );
|
||||
+ pFrames += 4;
|
||||
+ }
|
||||
+ for (; nframes > 0; --nframes)
|
||||
+ *pFrames++ *= fGain;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static inline void neon_process_dry_wet (
|
||||
+ float **ppBuffer, float **ppFrames, unsigned int iFrames,
|
||||
+ unsigned short iChannels, float fDry, float fWet )
|
||||
+{
|
||||
+ float32x4_t vDry = vdupq_n_f32(fDry);
|
||||
+ float32x4_t vWet = vdupq_n_f32(fWet);
|
||||
+
|
||||
+ for (unsigned short i = 0; i < iChannels; ++i) {
|
||||
+ float *pBuffer = ppBuffer[i];
|
||||
+ float *pFrames = ppFrames[i];
|
||||
+ unsigned int nframes = iFrames;
|
||||
+ for (; (long(pBuffer) & 15) && (nframes > 0); --nframes) {
|
||||
+ *pBuffer *= fWet;
|
||||
+ *pBuffer++ += fDry * *pFrames++;
|
||||
+ }
|
||||
+ for (; nframes >= 4; nframes -= 4) {
|
||||
+ float32x4_t vBuffer = vld1q_f32(pBuffer);
|
||||
+ vBuffer = vmulq_f32(vBuffer, vWet);
|
||||
+ float32x4_t vFrames = vld1q_f32(pFrames);
|
||||
+ // Vr[i] := Va[i] + Vb[i] * Vc[i]
|
||||
+ vBuffer = vmlaq_f32(vBuffer, vDry, vFrames);
|
||||
+ vst1q_f32(pBuffer, vBuffer);
|
||||
+ pFrames += 4;
|
||||
+ pBuffer += 4;
|
||||
+ }
|
||||
+ for (; nframes > 0; --nframes) {
|
||||
+ *pBuffer *= fWet;
|
||||
+ *pBuffer++ += fDry * *pFrames++;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static inline void neon_process_add (
|
||||
+ float **ppBuffer, float **ppFrames, unsigned int iFrames,
|
||||
+ unsigned short iChannels, float fGain )
|
||||
+{
|
||||
+ float32x4_t vGain = vdupq_n_f32(fGain);
|
||||
+
|
||||
+ for (unsigned short i = 0; i < iChannels; ++i) {
|
||||
+ float *pBuffer = ppBuffer[i];
|
||||
+ float *pFrames = ppFrames[i];
|
||||
+ unsigned int nframes = iFrames;
|
||||
+ for (; (long(pBuffer) & 15) && (nframes > 0); --nframes)
|
||||
+ *pBuffer++ += fGain * *pFrames++;
|
||||
+ for (; nframes >= 4; nframes -= 4) {
|
||||
+ float32x4_t vBuffer = vld1q_f32(pBuffer);
|
||||
+ float32x4_t vFrames = vld1q_f32(pFrames);
|
||||
+ //Vr[i] := Va[i] + Vb[i] * Vc[i]
|
||||
+ vBuffer = vmlaq_f32(vBuffer, vGain, vFrames);
|
||||
+ vst1q_f32(pBuffer, vBuffer);
|
||||
+ pFrames += 4;
|
||||
+ pBuffer += 4;
|
||||
+ }
|
||||
+ for (; nframes > 0; --nframes)
|
||||
+ *pBuffer++ += fGain * *pFrames++;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
|
||||
// Standard processor versions.
|
||||
static inline void std_process_gain (
|
||||
@@ -367,13 +455,17 @@ qtractorAudioInsertPlugin::qtractorAudioInsertPlugin (
|
||||
if (sse_enabled()) {
|
||||
m_pfnProcessGain = sse_process_gain;
|
||||
m_pfnProcessDryWet = sse_process_dry_wet;
|
||||
- } else {
|
||||
+ } else
|
||||
#endif
|
||||
- m_pfnProcessGain = std_process_gain;
|
||||
- m_pfnProcessDryWet = std_process_dry_wet;
|
||||
-#if defined(__SSE__)
|
||||
- }
|
||||
+#if defined(__ARM_NEON__)
|
||||
+ m_pfnProcessGain = neon_process_gain;
|
||||
+ m_pfnProcessDryWet = neon_process_dry_wet;
|
||||
+ if(false)
|
||||
#endif
|
||||
+ {
|
||||
+ m_pfnProcessGain = std_process_gain;
|
||||
+ m_pfnProcessDryWet = std_process_dry_wet;
|
||||
+ }
|
||||
|
||||
// Create and attach the custom parameters...
|
||||
m_pSendGainParam = new qtractorInsertPluginParam(this, 0);
|
||||
@@ -1120,12 +1212,15 @@ qtractorAudioAuxSendPlugin::qtractorAudioAuxSendPlugin (
|
||||
#if defined(__SSE__)
|
||||
if (sse_enabled()) {
|
||||
m_pfnProcessAdd = sse_process_add;
|
||||
- } else {
|
||||
+ } else
|
||||
+#endif
|
||||
+#if defined(__ARM_NEON__)
|
||||
+ m_pfnProcessAdd = neon_process_add;
|
||||
+ if(false)
|
||||
#endif
|
||||
+ {
|
||||
m_pfnProcessAdd = std_process_add;
|
||||
-#if defined(__SSE__)
|
||||
}
|
||||
-#endif
|
||||
|
||||
// Create and attach the custom parameters...
|
||||
m_pSendGainParam = new qtractorInsertPluginParam(this, 0);
|
||||
--
|
||||
2.9.5
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
From fff172e17a9b718403948fac449c877cdeb046b8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
|
||||
Date: Wed, 18 Oct 2017 23:39:57 +0200
|
||||
Subject: [PATCH] MIDI import: give tracks more informational names
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Name is created by the following sequence - if name is not empty stop:
|
||||
|
||||
* If supplied, set track name found in MIDI file
|
||||
* Try General MIDI names
|
||||
* Set name of clip imported (usually shortened MIDI file name)
|
||||
|
||||
Upstream-Status: Submitted [1]
|
||||
|
||||
https://github.com/rncbc/qtractor/pull/86
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
|
||||
---
|
||||
src/qtractorMainForm.cpp | 2 +-
|
||||
src/qtractorMidiClip.cpp | 11 +++
|
||||
src/qtractorMidiClip.h | 6 ++
|
||||
src/qtractorTracks.cpp | 181 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
src/qtractorTracks.h | 6 +-
|
||||
5 files changed, 200 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/qtractorMainForm.cpp b/src/qtractorMainForm.cpp
|
||||
index 0fbb649..b3c0f76 100644
|
||||
--- a/src/qtractorMainForm.cpp
|
||||
+++ b/src/qtractorMainForm.cpp
|
||||
@@ -3787,7 +3787,7 @@ void qtractorMainForm::trackImportMidi (void)
|
||||
const unsigned long iClipStart = m_pSession->editHead();
|
||||
qtractorTrack *pTrack = m_pTracks->currentTrack();
|
||||
m_pTracks->addMidiTracks(
|
||||
- m_pFiles->midiListView()->openFileNames(), iClipStart, pTrack);
|
||||
+ m_pFiles->midiListView()->openFileNames(), iClipStart, pTrack, true);
|
||||
m_pTracks->trackView()->ensureVisibleFrame(iClipStart);
|
||||
}
|
||||
}
|
||||
diff --git a/src/qtractorMidiClip.cpp b/src/qtractorMidiClip.cpp
|
||||
index 5928846..8af1d73 100644
|
||||
--- a/src/qtractorMidiClip.cpp
|
||||
+++ b/src/qtractorMidiClip.cpp
|
||||
@@ -346,6 +346,7 @@ bool qtractorMidiClip::openMidiFile (
|
||||
// Set local properties...
|
||||
setFilename(sFilename);
|
||||
setDirty(false);
|
||||
+ m_sTrackNameRead.clear();
|
||||
|
||||
// Register file path...
|
||||
pSession->files()->addClipItem(qtractorFileList::Midi, this, bWrite);
|
||||
@@ -476,6 +477,10 @@ bool qtractorMidiClip::openMidiFile (
|
||||
// We should have events, otherwise this clip is of no use...
|
||||
//if (m_pSeq->events().count() < 1)
|
||||
// return false;
|
||||
+
|
||||
+ // If MIDI file sets track name: keep it
|
||||
+ m_sTrackNameRead = pSeq->name();
|
||||
+
|
||||
// And initial clip name...
|
||||
pSeq->setName(shortClipName(QFileInfo(m_pFile->filename()).baseName()));
|
||||
}
|
||||
@@ -514,6 +519,12 @@ bool qtractorMidiClip::openMidiFile (
|
||||
}
|
||||
|
||||
|
||||
+QString qtractorMidiClip::getTrackName (void)
|
||||
+{
|
||||
+ return m_sTrackNameRead;
|
||||
+}
|
||||
+
|
||||
+
|
||||
// Private cleanup.
|
||||
void qtractorMidiClip::closeMidiFile (void)
|
||||
{
|
||||
diff --git a/src/qtractorMidiClip.h b/src/qtractorMidiClip.h
|
||||
index f47528f..f45d1cc 100644
|
||||
--- a/src/qtractorMidiClip.h
|
||||
+++ b/src/qtractorMidiClip.h
|
||||
@@ -60,6 +60,9 @@ public:
|
||||
bool openMidiFile(const QString& sFilename, int iTrackChannel = 0,
|
||||
int iMode = qtractorMidiFile::Read);
|
||||
|
||||
+ // Track name a read MIDI file has set
|
||||
+ QString getTrackName();
|
||||
+
|
||||
// MIDI file properties accessors.
|
||||
void setTrackChannel(unsigned short iTrackChannel)
|
||||
{ m_iTrackChannel = iTrackChannel; }
|
||||
@@ -306,6 +309,9 @@ private:
|
||||
QPoint m_posEditor;
|
||||
QSize m_sizeEditor;
|
||||
|
||||
+ // Track name read from MIDI
|
||||
+ QString m_sTrackNameRead;
|
||||
+
|
||||
// Default MIDI file format (for capture/record)
|
||||
static unsigned short g_iDefaultFormat;
|
||||
};
|
||||
diff --git a/src/qtractorTracks.cpp b/src/qtractorTracks.cpp
|
||||
index 9b9c4c4..7cac92e 100644
|
||||
--- a/src/qtractorTracks.cpp
|
||||
+++ b/src/qtractorTracks.cpp
|
||||
@@ -2803,7 +2803,7 @@ bool qtractorTracks::addAudioTracks ( const QStringList& files,
|
||||
|
||||
// Import MIDI files into new tracks...
|
||||
bool qtractorTracks::addMidiTracks ( const QStringList& files,
|
||||
- unsigned long iClipStart, qtractorTrack *pAfterTrack )
|
||||
+ unsigned long iClipStart, qtractorTrack *pAfterTrack, bool bEnhancedTrackNames )
|
||||
{
|
||||
// Have we some?
|
||||
if (files.isEmpty())
|
||||
@@ -2877,10 +2877,27 @@ bool qtractorTracks::addMidiTracks ( const QStringList& files,
|
||||
}
|
||||
// Time to check whether there is actual data on track...
|
||||
if (pMidiClip->clipLength() > 0) {
|
||||
+ int iChannel = pMidiClip->channel();
|
||||
+ // create track name
|
||||
+ QString sTrackName;
|
||||
+ if (bEnhancedTrackNames) {
|
||||
+ // try track name from MIDI import
|
||||
+ sTrackName = pMidiClip->getTrackName();
|
||||
+ // no track name set try GM names
|
||||
+ if (sTrackName.isEmpty()) {
|
||||
+ QString sGMName = getGMName(iChannel, pMidiClip->prog());
|
||||
+ if (!sGMName.isEmpty())
|
||||
+ sTrackName = sGMName;
|
||||
+ }
|
||||
+ }
|
||||
+ // default: shortened clip name
|
||||
+ if (sTrackName.isEmpty())
|
||||
+ sTrackName = pSession->uniqueTrackName(pMidiClip->clipName());
|
||||
+
|
||||
// Add the new track to composite command...
|
||||
- pTrack->setTrackName(
|
||||
- pSession->uniqueTrackName(pMidiClip->clipName()));
|
||||
- pTrack->setMidiChannel(pMidiClip->channel());
|
||||
+ pTrack->setTrackName(sTrackName);
|
||||
+ pTrack->setMidiChannel(iChannel);
|
||||
+
|
||||
pImportTrackCommand->addTrack(pTrack);
|
||||
++iUpdate;
|
||||
// Don't forget to add this one to local repository.
|
||||
@@ -2984,6 +3001,162 @@ bool qtractorTracks::addMidiTrackChannel ( const QString& sPath,
|
||||
}
|
||||
|
||||
|
||||
+// MIDI specific: Get a GM name for channel/prog
|
||||
+QString qtractorTracks::getGMName( int iChannel, int iProg )
|
||||
+{
|
||||
+ QString sName;
|
||||
+ // static GM prog names
|
||||
+ // no need to use numbers for multiple insstuments with same name
|
||||
+ static const QStringList instrumentNamesGM = (
|
||||
+ QStringList()
|
||||
+ // 0-31
|
||||
+ << QObject::tr("Acoustic Grand Piano")
|
||||
+ << QObject::tr("Bright Acoustic Piano")
|
||||
+ << QObject::tr("Electric Grand Piano")
|
||||
+ << QObject::tr("Honky-tonk Piano")
|
||||
+ << QObject::tr("Electric Piano")
|
||||
+ << QObject::tr("Electric Piano")
|
||||
+ << QObject::tr("Harpsichord")
|
||||
+ << QObject::tr("Clavi")
|
||||
+ << QObject::tr("Celesta")
|
||||
+ << QObject::tr("Glockenspiel")
|
||||
+ << QObject::tr("Music Box")
|
||||
+ << QObject::tr("Vibraphone")
|
||||
+ << QObject::tr("Marimba")
|
||||
+ << QObject::tr("Xylophone")
|
||||
+ << QObject::tr("Tubular Bells")
|
||||
+ << QObject::tr("Dulcimer")
|
||||
+ << QObject::tr("Organ")
|
||||
+ << QObject::tr("Organ")
|
||||
+ << QObject::tr("Rock Organ")
|
||||
+ << QObject::tr("Church Organ")
|
||||
+ << QObject::tr("Reed Organ")
|
||||
+ << QObject::tr("Accordion")
|
||||
+ << QObject::tr("Harmonica")
|
||||
+ << QObject::tr("Tango Accordion")
|
||||
+ << QObject::tr("Nylon Guitar")
|
||||
+ << QObject::tr("Steel Guitar")
|
||||
+ << QObject::tr("Jazz E-Guitar")
|
||||
+ << QObject::tr("Clean E-Guitar")
|
||||
+ << QObject::tr("Muted E-Guitar")
|
||||
+ << QObject::tr("Overdrive Guitar")
|
||||
+ << QObject::tr("Distorted Guitar")
|
||||
+ << QObject::tr("Harmonic Guitar")
|
||||
+ // 32-63
|
||||
+ << QObject::tr("Acoustic Bass")
|
||||
+ << QObject::tr("Fingered E-Bass")
|
||||
+ << QObject::tr("Picked E-Bass")
|
||||
+ << QObject::tr("Fretless Bass")
|
||||
+ << QObject::tr("Slap Bass")
|
||||
+ << QObject::tr("Slap Bass")
|
||||
+ << QObject::tr("Synth Bass")
|
||||
+ << QObject::tr("Synth Bass")
|
||||
+ << QObject::tr("Violin")
|
||||
+ << QObject::tr("Viola")
|
||||
+ << QObject::tr("Cello")
|
||||
+ << QObject::tr("Contrabass")
|
||||
+ << QObject::tr("Tremolo")
|
||||
+ << QObject::tr("Pizicato")
|
||||
+ << QObject::tr("Harp")
|
||||
+ << QObject::tr("Timpani")
|
||||
+ << QObject::tr("Strings")
|
||||
+ << QObject::tr("Strings")
|
||||
+ << QObject::tr("Synth Strings")
|
||||
+ << QObject::tr("Synth Strings")
|
||||
+ << QObject::tr("Choir Aah")
|
||||
+ << QObject::tr("Voice Ooh")
|
||||
+ << QObject::tr("Synth Voice")
|
||||
+ << QObject::tr("Hit Orchestra")
|
||||
+ << QObject::tr("Trumpet")
|
||||
+ << QObject::tr("Trombone")
|
||||
+ << QObject::tr("Tuba")
|
||||
+ << QObject::tr("Trumpet Muted")
|
||||
+ << QObject::tr("French Horn")
|
||||
+ << QObject::tr("Brass")
|
||||
+ << QObject::tr("Synth Brass")
|
||||
+ << QObject::tr("SynthBrass")
|
||||
+ // 64-95
|
||||
+ << QObject::tr("Soprano Sax")
|
||||
+ << QObject::tr("Alto Sax")
|
||||
+ << QObject::tr("Tenor Sax")
|
||||
+ << QObject::tr("Baritone Sax")
|
||||
+ << QObject::tr("Oboe")
|
||||
+ << QObject::tr("Horn")
|
||||
+ << QObject::tr("Bassoon")
|
||||
+ << QObject::tr("Clarinet")
|
||||
+ << QObject::tr("Piccolo")
|
||||
+ << QObject::tr("Flute")
|
||||
+ << QObject::tr("Recorder")
|
||||
+ << QObject::tr("Pan Flute")
|
||||
+ << QObject::tr("Smashing Bottle")
|
||||
+ << QObject::tr("Shakuhachi")
|
||||
+ << QObject::tr("Whistle")
|
||||
+ << QObject::tr("Ocarina")
|
||||
+ << QObject::tr("Square Lead")
|
||||
+ << QObject::tr("Saw Lead")
|
||||
+ << QObject::tr("Callilope Lead")
|
||||
+ << QObject::tr("Chiffer Lead")
|
||||
+ << QObject::tr("Charang Lead")
|
||||
+ << QObject::tr("Voice Lead")
|
||||
+ << QObject::tr("5th Lead")
|
||||
+ << QObject::tr("Lead And Bass")
|
||||
+ << QObject::tr("New Age Pad")
|
||||
+ << QObject::tr("Warm Pad")
|
||||
+ << QObject::tr("Polysynth Pad")
|
||||
+ << QObject::tr("Choir Pad")
|
||||
+ << QObject::tr("Bowed Pad")
|
||||
+ << QObject::tr("Metallic Pad")
|
||||
+ << QObject::tr("Halo Pad")
|
||||
+ << QObject::tr("Sweep Pad")
|
||||
+ // 96-127
|
||||
+ << QObject::tr("Rain")
|
||||
+ << QObject::tr("Soundtrack")
|
||||
+ << QObject::tr("Crystal")
|
||||
+ << QObject::tr("Atmosphere")
|
||||
+ << QObject::tr("Brightness")
|
||||
+ << QObject::tr("Goblins")
|
||||
+ << QObject::tr("Echoes")
|
||||
+ << QObject::tr("Sci-Fi")
|
||||
+ << QObject::tr("Sitar")
|
||||
+ << QObject::tr("Banjo")
|
||||
+ << QObject::tr("Shamisen")
|
||||
+ << QObject::tr("Koto")
|
||||
+ << QObject::tr("Kalimba")
|
||||
+ << QObject::tr("Bagpipe")
|
||||
+ << QObject::tr("Fiddle")
|
||||
+ << QObject::tr("Shanai")
|
||||
+ << QObject::tr("Tinkle Bell")
|
||||
+ << QObject::tr("Agogo")
|
||||
+ << QObject::tr("Steel Drums")
|
||||
+ << QObject::tr("Wood Block")
|
||||
+ << QObject::tr("Taiko Drum")
|
||||
+ << QObject::tr("Melodic Drum")
|
||||
+ << QObject::tr("Synth Drum")
|
||||
+ << QObject::tr("Reverse Cymbal")
|
||||
+ << QObject::tr("Fretless Noise")
|
||||
+ << QObject::tr("Breath Noise")
|
||||
+ << QObject::tr("Seashore")
|
||||
+ << QObject::tr("Birds")
|
||||
+ << QObject::tr("Oldschool Telephone")
|
||||
+ << QObject::tr("Helicopter")
|
||||
+ << QObject::tr("Applause")
|
||||
+ << QObject::tr("Gun Shot")
|
||||
+ );
|
||||
+
|
||||
+ int iNameCount = instrumentNamesGM.size();
|
||||
+ Q_ASSERT(iNameCount == 128);
|
||||
+
|
||||
+ // Drums (channel 10 - we keep data zero based)
|
||||
+ if (iChannel == 9)
|
||||
+ sName = QObject::tr("Drums");
|
||||
+ // Instruments program name
|
||||
+ else if (iProg >= 0 && iProg < iNameCount)
|
||||
+ sName = instrumentNamesGM[iProg];
|
||||
+
|
||||
+ return sName;
|
||||
+}
|
||||
+
|
||||
+
|
||||
// Track-list active maintenance update.
|
||||
void qtractorTracks::updateTrack ( qtractorTrack *pTrack )
|
||||
{
|
||||
diff --git a/src/qtractorTracks.h b/src/qtractorTracks.h
|
||||
index 2d9fa48..c45b12a 100644
|
||||
--- a/src/qtractorTracks.h
|
||||
+++ b/src/qtractorTracks.h
|
||||
@@ -71,10 +71,14 @@ public:
|
||||
bool addAudioTracks(const QStringList& files,
|
||||
unsigned long iClipStart, qtractorTrack *pAfterTrack = NULL);
|
||||
bool addMidiTracks(const QStringList& files,
|
||||
- unsigned long iClipStart, qtractorTrack *pAfterTrack = NULL);
|
||||
+ unsigned long iClipStart, qtractorTrack *pAfterTrack = NULL,
|
||||
+ bool bEnhancedTrackNames = false);
|
||||
bool addMidiTrackChannel(const QString& sPath, int iTrackChannel,
|
||||
unsigned long iClipStart, qtractorTrack *pAfterTrack = NULL);
|
||||
|
||||
+ // MIDI specific: GM instrument names
|
||||
+ static QString getGMName(int iChannel, int iProg);
|
||||
+
|
||||
// Track-list active maintenance update.
|
||||
void updateTrack(qtractorTrack *pTrack = NULL);
|
||||
|
||||
--
|
||||
2.9.5
|
||||
|
||||
@@ -1,502 +0,0 @@
|
||||
From aec6a4ef5594cbf0078305c0f9a7366a52dd76eb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
|
||||
Date: Mon, 9 Oct 2017 22:05:49 +0200
|
||||
Subject: [PATCH 1/2] workaround native file dialogs hang up by setting parent
|
||||
to NULL
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Honestly not all locations were tested but for fedora 25 and Raspberrry PI
|
||||
it fixed:
|
||||
|
||||
* Save session choose path
|
||||
* Save session choose file
|
||||
* Open session choose file
|
||||
|
||||
It should be noted that dialogs now get an own entry in the taskbar.
|
||||
|
||||
Upstream-Status: Applied [1]
|
||||
|
||||
[1] https://github.com/rncbc/qtractor/pull/83
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
|
||||
---
|
||||
src/qtractorAudioListView.cpp | 4 ++--
|
||||
src/qtractorClipForm.cpp | 4 ++--
|
||||
src/qtractorExportForm.cpp | 4 ++--
|
||||
src/qtractorInstrumentForm.cpp | 8 ++++----
|
||||
src/qtractorMainForm.cpp | 8 ++++----
|
||||
src/qtractorMidiControlForm.cpp | 8 ++++----
|
||||
src/qtractorMidiEditorForm.cpp | 4 ++--
|
||||
src/qtractorMidiListView.cpp | 4 ++--
|
||||
src/qtractorMidiSysexForm.cpp | 16 ++++++++--------
|
||||
src/qtractorOptionsForm.cpp | 20 ++++++++++----------
|
||||
src/qtractorPluginForm.cpp | 12 ++++++------
|
||||
src/qtractorSessionForm.cpp | 4 ++--
|
||||
src/qtractorTrackForm.cpp | 4 ++--
|
||||
src/qtractorTracks.cpp | 8 ++++----
|
||||
src/qtractorVstPlugin.cpp | 6 +++---
|
||||
15 files changed, 57 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/src/qtractorAudioListView.cpp b/src/qtractorAudioListView.cpp
|
||||
index a041864..f46b659 100644
|
||||
--- a/src/qtractorAudioListView.cpp
|
||||
+++ b/src/qtractorAudioListView.cpp
|
||||
@@ -146,11 +146,11 @@ QStringList qtractorAudioListView::getOpenFileNames (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(this,
|
||||
+ files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, recentDir(), qtractorAudioFileFactory::filters(), NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, recentDir(), qtractorAudioFileFactory::filters());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorClipForm.cpp b/src/qtractorClipForm.cpp
|
||||
index a399556..4ead492 100644
|
||||
--- a/src/qtractorClipForm.cpp
|
||||
+++ b/src/qtractorClipForm.cpp
|
||||
@@ -703,10 +703,10 @@ void qtractorClipForm::browseFilename (void)
|
||||
if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.FilenameComboBox->currentText(), sFilter, NULL, options);
|
||||
#else
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.FilenameComboBox->currentText(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorExportForm.cpp b/src/qtractorExportForm.cpp
|
||||
index 5cb748d..fe9ea15 100644
|
||||
--- a/src/qtractorExportForm.cpp
|
||||
+++ b/src/qtractorExportForm.cpp
|
||||
@@ -407,10 +407,10 @@ void qtractorExportForm::browseExportPath (void)
|
||||
if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sExportPath = QFileDialog::getSaveFileName(this,
|
||||
+ sExportPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sExportPath, sFilter, NULL, options);
|
||||
#else
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sExportPath, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorInstrumentForm.cpp b/src/qtractorInstrumentForm.cpp
|
||||
index 5cc3cc6..c69c800 100644
|
||||
--- a/src/qtractorInstrumentForm.cpp
|
||||
+++ b/src/qtractorInstrumentForm.cpp
|
||||
@@ -228,11 +228,11 @@ void qtractorInstrumentForm::importSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(this,
|
||||
+ files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -388,11 +388,11 @@ void qtractorInstrumentForm::exportSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sPath = QFileDialog::getSaveFileName(this,
|
||||
+ sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorMainForm.cpp b/src/qtractorMainForm.cpp
|
||||
index a4c1cdd..9c9147c 100644
|
||||
--- a/src/qtractorMainForm.cpp
|
||||
+++ b/src/qtractorMainForm.cpp
|
||||
@@ -1950,11 +1950,11 @@ bool qtractorMainForm::openSession (void)
|
||||
if (m_pOptions->bDontUseNativeDialogs)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_pOptions->sSessionDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file session/template dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_pOptions->sSessionDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -2043,11 +2043,11 @@ bool qtractorMainForm::saveSession ( bool bPrompt )
|
||||
// Try to rename as if a backup is about...
|
||||
sFilename = sessionBackupPath(sFilename);
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getSaveFileName(this,
|
||||
+ sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file session/template dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter);
|
||||
// Set proper save-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorMidiControlForm.cpp b/src/qtractorMidiControlForm.cpp
|
||||
index da6b58c..b848eba 100644
|
||||
--- a/src/qtractorMidiControlForm.cpp
|
||||
+++ b/src/qtractorMidiControlForm.cpp
|
||||
@@ -237,11 +237,11 @@ void qtractorMidiControlForm::importSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(this,
|
||||
+ files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiControlDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiControlDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -450,11 +450,11 @@ void qtractorMidiControlForm::exportSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sPath = QFileDialog::getSaveFileName(this,
|
||||
+ sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sPath, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this, sTitle, sPath, sFilter);
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sPath, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorMidiEditorForm.cpp b/src/qtractorMidiEditorForm.cpp
|
||||
index 8a57cac..d30837b 100644
|
||||
--- a/src/qtractorMidiEditorForm.cpp
|
||||
+++ b/src/qtractorMidiEditorForm.cpp
|
||||
@@ -1043,11 +1043,11 @@ bool qtractorMidiEditorForm::saveClipFile ( bool bPrompt )
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filenames to open...
|
||||
- sFilename = QFileDialog::getSaveFileName(this,
|
||||
+ sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorMidiListView.cpp b/src/qtractorMidiListView.cpp
|
||||
index d8e9a7e..10727cd 100644
|
||||
--- a/src/qtractorMidiListView.cpp
|
||||
+++ b/src/qtractorMidiListView.cpp
|
||||
@@ -188,11 +188,11 @@ QStringList qtractorMidiListView::getOpenFileNames (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filenames to open...
|
||||
- files = QFileDialog::getOpenFileNames(this,
|
||||
+ files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, recentDir(), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, recentDir(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorMidiSysexForm.cpp b/src/qtractorMidiSysexForm.cpp
|
||||
index 0fc203e..92bc2b1 100644
|
||||
--- a/src/qtractorMidiSysexForm.cpp
|
||||
+++ b/src/qtractorMidiSysexForm.cpp
|
||||
@@ -224,11 +224,11 @@ void qtractorMidiSysexForm::importSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(this,
|
||||
+ files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -302,11 +302,11 @@ void qtractorMidiSysexForm::exportSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1// QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sPath = QFileDialog::getSaveFileName(this,
|
||||
+ sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -443,11 +443,11 @@ void qtractorMidiSysexForm::openSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -515,11 +515,11 @@ void qtractorMidiSysexForm::saveSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getSaveFileName(this,
|
||||
+ sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this, sTitle, sFilename, sFilter);
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorOptionsForm.cpp b/src/qtractorOptionsForm.cpp
|
||||
index 796b465..237b5a8 100644
|
||||
--- a/src/qtractorOptionsForm.cpp
|
||||
+++ b/src/qtractorOptionsForm.cpp
|
||||
@@ -1170,11 +1170,11 @@ void qtractorOptionsForm::choosePluginPath (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the directory...
|
||||
- sPluginPath = QFileDialog::getExistingDirectory(this,
|
||||
+ sPluginPath = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.PluginPathComboBox->currentText(), options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.PluginPathComboBox->currentText());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -1407,11 +1407,11 @@ void qtractorOptionsForm::chooseLv2PresetDir (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1// QT_VERSION < 0x040400
|
||||
// Ask for the directory...
|
||||
- sLv2PresetDir = QFileDialog::getExistingDirectory(this,
|
||||
+ sLv2PresetDir = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sLv2PresetDir, options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sLv2PresetDir);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -1473,11 +1473,11 @@ void qtractorOptionsForm::chooseMessagesLogPath (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sFilename = QFileDialog::getSaveFileName(this,
|
||||
+ sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.MessagesLogPathComboBox->currentText(), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.MessagesLogPathComboBox->currentText(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -1513,11 +1513,11 @@ void qtractorOptionsForm::chooseSessionTemplatePath (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.SessionTemplatePathComboBox->currentText(), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.SessionTemplatePathComboBox->currentText(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -1668,11 +1668,11 @@ QString qtractorOptionsForm::getOpenAudioFileName (
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sAudioFile = QFileDialog::getOpenFileName(this,
|
||||
+ sAudioFile = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, qtractorAudioFileFactory::filters(), NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, qtractorAudioFileFactory::filters());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorPluginForm.cpp b/src/qtractorPluginForm.cpp
|
||||
index 39cba3c..a465f68 100644
|
||||
--- a/src/qtractorPluginForm.cpp
|
||||
+++ b/src/qtractorPluginForm.cpp
|
||||
@@ -562,11 +562,11 @@ void qtractorPluginForm::openPresetSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sPresetDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, pOptions->sPresetDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -654,11 +654,11 @@ void qtractorPluginForm::savePresetSlot (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getSaveFileName(this,
|
||||
+ sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -1515,11 +1515,11 @@ void qtractorPluginPropertyWidget::buttonClicked (void)
|
||||
if (pOptions->bDontUseNativeDialogs)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, QString(), NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(this, sTitle, sFilename);
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
||||
diff --git a/src/qtractorSessionForm.cpp b/src/qtractorSessionForm.cpp
|
||||
index 5b38f38..a5672b9 100644
|
||||
--- a/src/qtractorSessionForm.cpp
|
||||
+++ b/src/qtractorSessionForm.cpp
|
||||
@@ -292,11 +292,11 @@ void qtractorSessionForm::browseSessionDir (void)
|
||||
if (pOptions->bDontUseNativeDialogs)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- QString sSessionDir = QFileDialog::getExistingDirectory(this, // Parent.
|
||||
+ QString sSessionDir = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.SessionDirComboBox->currentText(), options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(this,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, m_ui.SessionDirComboBox->currentText());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorTrackForm.cpp b/src/qtractorTrackForm.cpp
|
||||
index ad70b39..0574ca9 100644
|
||||
--- a/src/qtractorTrackForm.cpp
|
||||
+++ b/src/qtractorTrackForm.cpp
|
||||
@@ -1168,11 +1168,11 @@ void qtractorTrackForm::trackIconClicked (void)
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sFilename = QFileDialog::getOpenFileName(this,
|
||||
+ sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(this, sTitle, sFilename, sFilter);
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorTracks.cpp b/src/qtractorTracks.cpp
|
||||
index 0bf7e56..ef6014d 100644
|
||||
--- a/src/qtractorTracks.cpp
|
||||
+++ b/src/qtractorTracks.cpp
|
||||
@@ -1190,11 +1190,11 @@ bool qtractorTracks::mergeExportAudioClips ( qtractorClipCommand *pClipCommand )
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- QString sFilename = QFileDialog::getSaveFileName(this, sTitle,
|
||||
+ QString sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this, sTitle,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -1457,11 +1457,11 @@ bool qtractorTracks::mergeExportMidiClips ( qtractorClipCommand *pClipCommand )
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- QString sFilename = QFileDialog::getSaveFileName(this, sTitle,
|
||||
+ QString sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(this, sTitle,
|
||||
+ QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorVstPlugin.cpp b/src/qtractorVstPlugin.cpp
|
||||
index eef9e80..6df04ae 100644
|
||||
--- a/src/qtractorVstPlugin.cpp
|
||||
+++ b/src/qtractorVstPlugin.cpp
|
||||
@@ -1507,10 +1507,10 @@ static VstIntPtr qtractorVstPlugin_openFileSelector (
|
||||
const QFileDialog::Options options = QFileDialog::DontUseNativeDialog;
|
||||
if (pvfs->command == kVstFileLoad) {
|
||||
sFilename = QFileDialog::getOpenFileName(
|
||||
- pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
+ NULL, sTitle, sDirectory, sFilter, NULL, options);
|
||||
} else {
|
||||
sFilename = QFileDialog::getSaveFileName(
|
||||
- pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
+ options & QFileDialog::DontUseNativeDialog ? pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
}
|
||||
if (!sFilename.isEmpty()) {
|
||||
if (pvfs->returnPath == NULL) {
|
||||
@@ -1530,7 +1530,7 @@ static VstIntPtr qtractorVstPlugin_openFileSelector (
|
||||
= QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog;
|
||||
const QString& sDirectory
|
||||
= QFileDialog::getExistingDirectory(
|
||||
- pParentWidget, sTitle, pvfs->initialPath, options);
|
||||
+ options & QFileDialog::DontUseNativeDialog ? pParentWidget, sTitle, pvfs->initialPath, options);
|
||||
if (!sDirectory.isEmpty()) {
|
||||
if (pvfs->returnPath == NULL) {
|
||||
pvfs->returnPath = new char [sDirectory.length() + 1];
|
||||
--
|
||||
2.9.5
|
||||
|
||||
@@ -1,777 +0,0 @@
|
||||
From da208c05b0feef747a640afd87f56f2416bed338 Mon Sep 17 00:00:00 2001
|
||||
From: rncbc <rncbc@rncbc.org>
|
||||
Date: Wed, 11 Oct 2017 09:51:18 +0100
|
||||
Subject: [PATCH 2/2] =?UTF-8?q?-=20[neonx]=20workaround=20native=20file=20?=
|
||||
=?UTF-8?q?dialogs=20hang=20up=20by=20setting=20parent=20to=20NULL=20=20?=
|
||||
=?UTF-8?q?=20(by=20Andreas=20M=C3=BCller,=20thanks).?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
---
|
||||
src/qtractorAudioListView.cpp | 9 +++++---
|
||||
src/qtractorClipForm.cpp | 9 +++++---
|
||||
src/qtractorExportForm.cpp | 9 +++++---
|
||||
src/qtractorInstrumentForm.cpp | 14 +++++++----
|
||||
src/qtractorMainForm.cpp | 18 ++++++++++-----
|
||||
src/qtractorMidiControlForm.cpp | 18 ++++++++++-----
|
||||
src/qtractorMidiEditorForm.cpp | 10 ++++----
|
||||
src/qtractorMidiListView.cpp | 7 ++++--
|
||||
src/qtractorMidiSysexForm.cpp | 36 +++++++++++++++++++----------
|
||||
src/qtractorOptionsForm.cpp | 51 ++++++++++++++++++++++++++++-------------
|
||||
src/qtractorPluginForm.cpp | 27 ++++++++++++++--------
|
||||
src/qtractorSessionForm.cpp | 9 +++++---
|
||||
src/qtractorTrackForm.cpp | 25 ++++++++++++++------
|
||||
src/qtractorTracks.cpp | 18 ++++++++++-----
|
||||
src/qtractorVstPlugin.cpp | 6 ++---
|
||||
15 files changed, 179 insertions(+), 87 deletions(-)
|
||||
|
||||
diff --git a/src/qtractorAudioListView.cpp b/src/qtractorAudioListView.cpp
|
||||
index f46b659..ed970a2 100644
|
||||
--- a/src/qtractorAudioListView.cpp
|
||||
+++ b/src/qtractorAudioListView.cpp
|
||||
@@ -140,17 +140,20 @@ QStringList qtractorAudioListView::getOpenFileNames (void)
|
||||
const QString& sTitle
|
||||
= tr("Open Audio Files") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ files = QFileDialog::getOpenFileNames(pParentWidget,
|
||||
sTitle, recentDir(), qtractorAudioFileFactory::filters(), NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, recentDir(), qtractorAudioFileFactory::filters());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorClipForm.cpp b/src/qtractorClipForm.cpp
|
||||
index 4ead492..9825607 100644
|
||||
--- a/src/qtractorClipForm.cpp
|
||||
+++ b/src/qtractorClipForm.cpp
|
||||
@@ -698,15 +698,18 @@ void qtractorClipForm::browseFilename (void)
|
||||
const QString& sTitle
|
||||
= tr("%1 Clip File").arg(sType) + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, m_ui.FilenameComboBox->currentText(), sFilter, NULL, options);
|
||||
#else
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, m_ui.FilenameComboBox->currentText(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorExportForm.cpp b/src/qtractorExportForm.cpp
|
||||
index fe9ea15..832fae4 100644
|
||||
--- a/src/qtractorExportForm.cpp
|
||||
+++ b/src/qtractorExportForm.cpp
|
||||
@@ -402,15 +402,18 @@ void qtractorExportForm::browseExportPath (void)
|
||||
const QString& sFilter
|
||||
= tr("%1 files (*.%1)").arg(m_sExportExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sExportPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sExportPath = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sExportPath, sFilter, NULL, options);
|
||||
#else
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, sExportPath, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorInstrumentForm.cpp b/src/qtractorInstrumentForm.cpp
|
||||
index c69c800..018b538 100644
|
||||
--- a/src/qtractorInstrumentForm.cpp
|
||||
+++ b/src/qtractorInstrumentForm.cpp
|
||||
@@ -223,16 +223,19 @@ void qtractorInstrumentForm::importSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("Instrument files (*.%1 *.sf2 *.midnam)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ files = QFileDialog::getOpenFileNames(pParentWidget,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sInstrumentDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -383,9 +386,12 @@ void qtractorInstrumentForm::exportSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("Instrument files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
diff --git a/src/qtractorMainForm.cpp b/src/qtractorMainForm.cpp
|
||||
index 9c9147c..5de9990 100644
|
||||
--- a/src/qtractorMainForm.cpp
|
||||
+++ b/src/qtractorMainForm.cpp
|
||||
@@ -1946,15 +1946,18 @@ bool qtractorMainForm::openSession (void)
|
||||
const QString& sFilter
|
||||
= filters.join(";;");
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, m_pOptions->sSessionDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file session/template dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, m_pOptions->sSessionDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -2037,17 +2040,20 @@ bool qtractorMainForm::saveSession ( bool bPrompt )
|
||||
= tr("Save Session") + " - " QTRACTOR_TITLE;
|
||||
const QString& sFilter
|
||||
= filters.join(";;");
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
// Try to rename as if a backup is about...
|
||||
sFilename = sessionBackupPath(sFilename);
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file session/template dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, sFilename, sFilter);
|
||||
// Set proper save-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorMidiControlForm.cpp b/src/qtractorMidiControlForm.cpp
|
||||
index b848eba..cd80e7a 100644
|
||||
--- a/src/qtractorMidiControlForm.cpp
|
||||
+++ b/src/qtractorMidiControlForm.cpp
|
||||
@@ -232,16 +232,19 @@ void qtractorMidiControlForm::importSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("Controller files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ files = QFileDialog::getOpenFileNames(pParentWidget,
|
||||
sTitle, pOptions->sMidiControlDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sMidiControlDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -445,16 +448,19 @@ void qtractorMidiControlForm::exportSlot (void)
|
||||
}
|
||||
else sPath = pOptions->midiControlFiles.last();
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sPath = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sPath, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sPath, sFilter);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sPath, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorMidiEditorForm.cpp b/src/qtractorMidiEditorForm.cpp
|
||||
index d30837b..f802c87 100644
|
||||
--- a/src/qtractorMidiEditorForm.cpp
|
||||
+++ b/src/qtractorMidiEditorForm.cpp
|
||||
@@ -1037,18 +1037,20 @@ bool qtractorMidiEditorForm::saveClipFile ( bool bPrompt )
|
||||
= tr("Save MIDI Clip") + " - " QTRACTOR_TITLE;
|
||||
const QString& sFilter
|
||||
= tr("MIDI files (*.%1 *.smf *.midi)").arg(sExt);
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filenames to open...
|
||||
- sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
- sTitle, sFilename, sFilter);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorMidiListView.cpp b/src/qtractorMidiListView.cpp
|
||||
index 10727cd..7a269d2 100644
|
||||
--- a/src/qtractorMidiListView.cpp
|
||||
+++ b/src/qtractorMidiListView.cpp
|
||||
@@ -182,13 +182,16 @@ QStringList qtractorMidiListView::getOpenFileNames (void)
|
||||
const QString& sFilter
|
||||
= tr("MIDI files (*.%1 *.smf *.midi)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filenames to open...
|
||||
- files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ files = QFileDialog::getOpenFileNames(pParentWidget,
|
||||
sTitle, recentDir(), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
diff --git a/src/qtractorMidiSysexForm.cpp b/src/qtractorMidiSysexForm.cpp
|
||||
index 92bc2b1..e966772 100644
|
||||
--- a/src/qtractorMidiSysexForm.cpp
|
||||
+++ b/src/qtractorMidiSysexForm.cpp
|
||||
@@ -219,16 +219,19 @@ void qtractorMidiSysexForm::importSlot (void)
|
||||
const QString& sFilter
|
||||
= filters.join(";;");
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- files = QFileDialog::getOpenFileNames(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ files = QFileDialog::getOpenFileNames(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -297,16 +300,19 @@ void qtractorMidiSysexForm::exportSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("SysEx files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1// QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sPath = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sPath = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-files dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -438,16 +444,19 @@ void qtractorMidiSysexForm::openSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("SysEx files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sMidiSysexDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -510,16 +519,19 @@ void qtractorMidiSysexForm::saveSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("Sysex files (*.%1)").arg(sExt);
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename, sFilter);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
diff --git a/src/qtractorOptionsForm.cpp b/src/qtractorOptionsForm.cpp
|
||||
index 237b5a8..99072a1 100644
|
||||
--- a/src/qtractorOptionsForm.cpp
|
||||
+++ b/src/qtractorOptionsForm.cpp
|
||||
@@ -1055,12 +1055,16 @@ void qtractorOptionsForm::chooseAudioMeterColor (void)
|
||||
const QString& sTitle
|
||||
= tr("Audio Meter Color") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QColorDialog::ColorDialogOptions options = 0;
|
||||
- if (m_pOptions && m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions && m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QColorDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
|
||||
const QColor& color = QColorDialog::getColor(
|
||||
- QColor(m_ui.AudioMeterColorLineEdit->text()), this, sTitle, options);
|
||||
+ QColor(m_ui.AudioMeterColorLineEdit->text()),
|
||||
+ pParentWidget, sTitle, options);
|
||||
|
||||
if (color.isValid())
|
||||
m_ui.AudioMeterColorLineEdit->setText(color.name());
|
||||
@@ -1073,12 +1077,16 @@ void qtractorOptionsForm::chooseMidiMeterColor (void)
|
||||
const QString& sTitle
|
||||
= tr("MIDI Meter Color") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QColorDialog::ColorDialogOptions options = 0;
|
||||
- if (m_pOptions && m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions && m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QColorDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
|
||||
const QColor& color = QColorDialog::getColor(
|
||||
- QColor(m_ui.MidiMeterColorLineEdit->text()), this, sTitle, options);
|
||||
+ QColor(m_ui.MidiMeterColorLineEdit->text()),
|
||||
+ pParentWidget, sTitle, options);
|
||||
|
||||
if (color.isValid())
|
||||
m_ui.MidiMeterColorLineEdit->setText(color.name());
|
||||
@@ -1165,16 +1173,19 @@ void qtractorOptionsForm::choosePluginPath (void)
|
||||
const QString& sTitle
|
||||
= tr("Plug-in Directory") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the directory...
|
||||
- sPluginPath = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sPluginPath = QFileDialog::getExistingDirectory(pParentWidget,
|
||||
sTitle, m_ui.PluginPathComboBox->currentText(), options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, m_ui.PluginPathComboBox->currentText());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -1402,17 +1413,19 @@ void qtractorOptionsForm::chooseLv2PresetDir (void)
|
||||
const QString& sTitle
|
||||
= tr("LV2 Presets Directory") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1// QT_VERSION < 0x040400
|
||||
// Ask for the directory...
|
||||
- sLv2PresetDir = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sLv2PresetDir = QFileDialog::getExistingDirectory(pParentWidget,
|
||||
sTitle, sLv2PresetDir, options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
- sTitle, sLv2PresetDir);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sLv2PresetDir);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::DirectoryOnly);
|
||||
@@ -1441,13 +1454,16 @@ void qtractorOptionsForm::chooseMessagesFont (void)
|
||||
const QString& sTitle
|
||||
= tr("Messages Font") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFontDialog::FontDialogOptions options = 0;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFontDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
|
||||
bool bOk = false;
|
||||
const QFont font = QFontDialog::getFont(&bOk,
|
||||
- m_ui.MessagesFontTextLabel->font(), this, sTitle, options);
|
||||
+ m_ui.MessagesFontTextLabel->font(), pParentWidget, sTitle, options);
|
||||
if (bOk) {
|
||||
m_ui.MessagesFontTextLabel->setFont(font);
|
||||
m_ui.MessagesFontTextLabel->setText(
|
||||
@@ -1468,16 +1484,19 @@ void qtractorOptionsForm::chooseMessagesLogPath (void)
|
||||
const QString& sFilter
|
||||
= tr("Log files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (m_pOptions->bDontUseNativeDialogs)
|
||||
+ if (m_pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, m_ui.MessagesLogPathComboBox->currentText(), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, m_ui.MessagesLogPathComboBox->currentText(), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorPluginForm.cpp b/src/qtractorPluginForm.cpp
|
||||
index a465f68..71b74a9 100644
|
||||
--- a/src/qtractorPluginForm.cpp
|
||||
+++ b/src/qtractorPluginForm.cpp
|
||||
@@ -557,16 +557,19 @@ void qtractorPluginForm::openPresetSlot (void)
|
||||
const QString& sFilter
|
||||
= tr("Preset files (*.%1)").arg(filters.join(" *."));
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, pOptions->sPresetDir, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, pOptions->sPresetDir, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
@@ -649,16 +652,19 @@ void qtractorPluginForm::savePresetSlot (void)
|
||||
= tr("Save Preset") + " - " QTRACTOR_TITLE;
|
||||
const QString& sFilter
|
||||
= tr("Preset files (*.%1)").arg(filters.join(" *."));
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getSaveFileName(pParentWidget,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -1511,15 +1517,18 @@ void qtractorPluginPropertyWidget::buttonClicked (void)
|
||||
const QString& sTitle
|
||||
= tr("Open File") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, sFilename, QString(), NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sFilename);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
||||
diff --git a/src/qtractorSessionForm.cpp b/src/qtractorSessionForm.cpp
|
||||
index a5672b9..0ba0fe7 100644
|
||||
--- a/src/qtractorSessionForm.cpp
|
||||
+++ b/src/qtractorSessionForm.cpp
|
||||
@@ -288,15 +288,18 @@ void qtractorSessionForm::browseSessionDir (void)
|
||||
const QString& sTitle
|
||||
= tr("Session Directory") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = QFileDialog::ShowDirsOnly;
|
||||
- if (pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
- QString sSessionDir = QFileDialog::getExistingDirectory(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QString sSessionDir = QFileDialog::getExistingDirectory(pParentWidget,
|
||||
sTitle, m_ui.SessionDirComboBox->currentText(), options);
|
||||
#else
|
||||
// Construct open-directory dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ QFileDialog fileDialog(pParentWidget,
|
||||
sTitle, m_ui.SessionDirComboBox->currentText());
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
diff --git a/src/qtractorTrackForm.cpp b/src/qtractorTrackForm.cpp
|
||||
index 0574ca9..6a98566 100644
|
||||
--- a/src/qtractorTrackForm.cpp
|
||||
+++ b/src/qtractorTrackForm.cpp
|
||||
@@ -1162,17 +1162,20 @@ void qtractorTrackForm::trackIconClicked (void)
|
||||
const QString& sFilter
|
||||
= filters.join(";;");
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to open...
|
||||
- sFilename = QFileDialog::getOpenFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL,
|
||||
+ sFilename = QFileDialog::getOpenFileName(pParentWidget,
|
||||
sTitle, sFilename, sFilter, NULL, options);
|
||||
#else
|
||||
// Construct open-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle, sFilename, sFilter);
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle, sFilename, sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::AnyFile);
|
||||
@@ -1435,13 +1438,17 @@ void qtractorTrackForm::selectForegroundColor (void)
|
||||
const QString& sTitle
|
||||
= tr("Foreground Color") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QColorDialog::ColorDialogOptions options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QColorDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
|
||||
const QColor& color = QColorDialog::getColor(
|
||||
- colorItem(m_ui.ForegroundColorComboBox), this, sTitle, options);
|
||||
+ colorItem(m_ui.ForegroundColorComboBox),
|
||||
+ pParentWidget, sTitle, options);
|
||||
|
||||
if (color.isValid()) {
|
||||
m_props.foreground = color;
|
||||
@@ -1457,13 +1464,17 @@ void qtractorTrackForm::selectBackgroundColor (void)
|
||||
const QString& sTitle
|
||||
= tr("Background Color") + " - " QTRACTOR_TITLE;
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QColorDialog::ColorDialogOptions options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QColorDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
|
||||
const QColor& color = QColorDialog::getColor(
|
||||
- colorItem(m_ui.BackgroundColorComboBox), this, sTitle, options);
|
||||
+ colorItem(m_ui.BackgroundColorComboBox),
|
||||
+ pParentWidget, sTitle, options);
|
||||
|
||||
if (color.isValid()) {
|
||||
m_props.background = color;
|
||||
diff --git a/src/qtractorTracks.cpp b/src/qtractorTracks.cpp
|
||||
index ef6014d..9b9c4c4 100644
|
||||
--- a/src/qtractorTracks.cpp
|
||||
+++ b/src/qtractorTracks.cpp
|
||||
@@ -1184,17 +1184,20 @@ bool qtractorTracks::mergeExportAudioClips ( qtractorClipCommand *pClipCommand )
|
||||
const QString& sFilter
|
||||
= tr("Audio files (*.%1)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- QString sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
+ QString sFilename = QFileDialog::getSaveFileName(pParentWidget, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
@@ -1451,17 +1454,20 @@ bool qtractorTracks::mergeExportMidiClips ( qtractorClipCommand *pClipCommand )
|
||||
const QString& sFilter
|
||||
= tr("MIDI files (*.%1 *.smf *.midi)").arg(sExt);
|
||||
|
||||
+ QWidget *pParentWidget = NULL;
|
||||
QFileDialog::Options options = 0;
|
||||
qtractorOptions *pOptions = qtractorOptions::getInstance();
|
||||
- if (pOptions && pOptions->bDontUseNativeDialogs)
|
||||
+ if (pOptions && pOptions->bDontUseNativeDialogs) {
|
||||
options |= QFileDialog::DontUseNativeDialog;
|
||||
+ pParentWidget = this;
|
||||
+ }
|
||||
#if 1//QT_VERSION < 0x040400
|
||||
// Ask for the filename to save...
|
||||
- QString sFilename = QFileDialog::getSaveFileName(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
+ QString sFilename = QFileDialog::getSaveFileName(pParentWidget, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter, NULL, options);
|
||||
#else
|
||||
// Construct save-file dialog...
|
||||
- QFileDialog fileDialog(options & QFileDialog::DontUseNativeDialog ? this : NULL, sTitle,
|
||||
+ QFileDialog fileDialog(pParentWidget, sTitle,
|
||||
pSession->createFilePath(pTrack->trackName(), sExt), sFilter);
|
||||
// Set proper open-file modes...
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
diff --git a/src/qtractorVstPlugin.cpp b/src/qtractorVstPlugin.cpp
|
||||
index 6df04ae..eef9e80 100644
|
||||
--- a/src/qtractorVstPlugin.cpp
|
||||
+++ b/src/qtractorVstPlugin.cpp
|
||||
@@ -1507,10 +1507,10 @@ static VstIntPtr qtractorVstPlugin_openFileSelector (
|
||||
const QFileDialog::Options options = QFileDialog::DontUseNativeDialog;
|
||||
if (pvfs->command == kVstFileLoad) {
|
||||
sFilename = QFileDialog::getOpenFileName(
|
||||
- NULL, sTitle, sDirectory, sFilter, NULL, options);
|
||||
+ pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
} else {
|
||||
sFilename = QFileDialog::getSaveFileName(
|
||||
- options & QFileDialog::DontUseNativeDialog ? pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
+ pParentWidget, sTitle, sDirectory, sFilter, NULL, options);
|
||||
}
|
||||
if (!sFilename.isEmpty()) {
|
||||
if (pvfs->returnPath == NULL) {
|
||||
@@ -1530,7 +1530,7 @@ static VstIntPtr qtractorVstPlugin_openFileSelector (
|
||||
= QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog;
|
||||
const QString& sDirectory
|
||||
= QFileDialog::getExistingDirectory(
|
||||
- options & QFileDialog::DontUseNativeDialog ? pParentWidget, sTitle, pvfs->initialPath, options);
|
||||
+ pParentWidget, sTitle, pvfs->initialPath, options);
|
||||
if (!sDirectory.isEmpty()) {
|
||||
if (pvfs->returnPath == NULL) {
|
||||
pvfs->returnPath = new char [sDirectory.length() + 1];
|
||||
--
|
||||
2.9.5
|
||||
|
||||
@@ -18,17 +18,16 @@ DEPENDS += " \
|
||||
inherit qmake5_base autotools-brokensep pkgconfig gtk-icon-cache
|
||||
|
||||
SRC_URI = " \
|
||||
${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
|
||||
git://github.com/rncbc/qtractor.git;branch=neonx \
|
||||
file://0001-find-native-qt-build-tools-by-configure-options-auto.patch \
|
||||
file://0002-do-nor-try-run-for-float-sse-detection.patch \
|
||||
file://0003-do-nor-try-run-for-suil-libs-detection.patch \
|
||||
file://0004-Add-ARM-NEON-acceleration.patch \
|
||||
file://0005-Add-ARM-NEON-acceleration-for-time-stretch-not-yet-t.patch \
|
||||
file://0006-workaround-native-file-dialogs-hang-up-by-setting-pa.patch \
|
||||
file://0007-neonx-workaround-native-file-dialogs-hang-up-by-sett.patch \
|
||||
file://0004-Add-ARM-NEON-acceleration-for-time-stretch-not-yet-t.patch \
|
||||
file://0005-MIDI-import-give-tracks-more-informational-names.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "7a2ea586eed8b8d8c7ebfdc876b33841"
|
||||
SRC_URI[sha256sum] = "3ace8b4fdf623e5e6ccecd7047de73f72bcfdd10b01f187079832092ac936b9d"
|
||||
SRCREV = "4af19b298679e4d80ee2496ecf0175526f894919"
|
||||
PV = "0.8.4+git${SRCPV}"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
--with-qmake=${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}/qmake \
|
||||
|
||||
Reference in New Issue
Block a user