326 |
void qsamplerMainForm::dropEvent ( QDropEvent* pDropEvent ) |
void qsamplerMainForm::dropEvent ( QDropEvent* pDropEvent ) |
327 |
{ |
{ |
328 |
QStringList files; |
QStringList files; |
329 |
if (decodeDragFiles(pDropEvent, files)) { |
|
330 |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { |
if (!decodeDragFiles(pDropEvent, files)) |
331 |
const QString& sPath = QUrl(*iter).path(); |
return; |
332 |
if (qsamplerChannel::isInstrumentFile(sPath)) { |
|
333 |
// Try to create a new channel from instrument file... |
for (QStringList::Iterator iter = files.begin(); iter != files.end(); iter++) { |
334 |
qsamplerChannel *pChannel = new qsamplerChannel(this); |
const QString& sPath = QUrl(*iter).path(); |
335 |
if (pChannel == NULL) |
if (qsamplerChannel::isInstrumentFile(sPath)) { |
336 |
return; |
// Try to create a new channel from instrument file... |
337 |
// Start setting the instrument filename... |
qsamplerChannel *pChannel = new qsamplerChannel(this); |
338 |
pChannel->setInstrument(sPath, 0); |
if (pChannel == NULL) |
339 |
// Before we show it up, may be we'll |
return; |
340 |
// better ask for some initial values? |
// Start setting the instrument filename... |
341 |
if (!pChannel->channelSetup(this)) { |
pChannel->setInstrument(sPath, 0); |
342 |
delete pChannel; |
// Before we show it up, may be we'll |
343 |
return; |
// better ask for some initial values? |
344 |
} |
if (!pChannel->channelSetup(this)) { |
345 |
// Make that an overall update. |
delete pChannel; |
346 |
m_iDirtyCount++; |
return; |
347 |
m_iChangeCount++; |
} |
348 |
stabilizeForm(); |
// Finally, give it to a new channel strip... |
349 |
} // Otherwise, load an usual session file (LSCP script)... |
if (!createChannelStrip(pChannel)) { |
350 |
else if (closeSession(true)) |
delete pChannel; |
351 |
loadSessionFile(sPath); |
return; |
352 |
} |
} |
353 |
} |
// Make that an overall update. |
354 |
|
m_iDirtyCount++; |
355 |
|
m_iChangeCount++; |
356 |
|
stabilizeForm(); |
357 |
|
} // Otherwise, load an usual session file (LSCP script)... |
358 |
|
else if (closeSession(true)) |
359 |
|
loadSessionFile(sPath); |
360 |
|
// Make it look responsive...:) |
361 |
|
QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
362 |
|
} |
363 |
} |
} |
364 |
|
|
365 |
|
|