1 |
// qsamplerInstrumentList.cpp |
// qsamplerInstrumentList.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2015, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2003-2019, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
Copyright (C) 2007, Christian Schoenebeck |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
112 |
QModelIndex InstrumentListModel::index ( |
QModelIndex InstrumentListModel::index ( |
113 |
int row, int col, const QModelIndex& /*parent*/ ) const |
int row, int col, const QModelIndex& /*parent*/ ) const |
114 |
{ |
{ |
115 |
const Instrument *pInstr = NULL; |
const Instrument *pInstr = nullptr; |
116 |
|
|
117 |
if (m_iMidiMap == LSCP_MIDI_MAP_ALL) { |
if (m_iMidiMap == LSCP_MIDI_MAP_ALL) { |
118 |
int nrows = 0; |
int nrows = 0; |
216 |
list.insert(i, pInstr); |
list.insert(i, pInstr); |
217 |
} else { |
} else { |
218 |
delete pInstr; |
delete pInstr; |
219 |
pInstr = NULL; |
pInstr = nullptr; |
220 |
} |
} |
221 |
|
|
222 |
return pInstr; |
return pInstr; |
264 |
void InstrumentListModel::refresh (void) |
void InstrumentListModel::refresh (void) |
265 |
{ |
{ |
266 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
267 |
if (pMainForm == NULL) |
if (pMainForm == nullptr) |
268 |
return; |
return; |
269 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == nullptr) |
270 |
return; |
return; |
271 |
|
|
272 |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
287 |
|
|
288 |
QApplication::restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
289 |
|
|
290 |
if (pInstrs == NULL && ::lscp_client_get_errno(pMainForm->client())) { |
if (pInstrs == nullptr && ::lscp_client_get_errno(pMainForm->client())) { |
291 |
pMainForm->appendMessagesClient("lscp_list_midi_instruments"); |
pMainForm->appendMessagesClient("lscp_list_midi_instruments"); |
292 |
pMainForm->appendMessagesError( |
pMainForm->appendMessagesError( |
293 |
tr("Could not get current list of MIDI instrument mappings.\n\nSorry.")); |
tr("Could not get current list of MIDI instrument mappings.\n\nSorry.")); |