893 |
appendMessagesClient("lscp_list_midi_instrument_maps"); |
appendMessagesClient("lscp_list_midi_instrument_maps"); |
894 |
iErrors++; |
iErrors++; |
895 |
} |
} |
896 |
#endif // CONFIG_MIDI_INSTRUMENT |
#endif // CONFIG_MIDI_INSTRUMENT |
897 |
|
|
898 |
// Sampler channel mapping. |
// Sampler channel mapping. |
899 |
QWidgetList wlist = m_pWorkspace->windowList(); |
QWidgetList wlist = m_pWorkspace->windowList(); |
1055 |
return; |
return; |
1056 |
|
|
1057 |
// Just do the reset, after closing down current session... |
// Just do the reset, after closing down current session... |
1058 |
if (closeSession(true) && ::lscp_reset_sampler(m_pClient) != LSCP_OK) { |
if (closeSession(true)) { |
1059 |
appendMessagesClient("lscp_reset_sampler"); |
#ifdef CONFIG_MIDI_INSTRUMENT |
1060 |
appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); |
// Reset all MIDI instrument mapping, if any. |
1061 |
return; |
int *piMaps = ::lscp_list_midi_instrument_maps(m_pClient); |
1062 |
|
for (int iMap = 0; piMaps && piMaps[iMap] >= 0; ++iMap) { |
1063 |
|
int iMidiMap = piMaps[iMap]; |
1064 |
|
if (::lscp_clear_midi_instruments(m_pClient, iMidiMap) != LSCP_OK) |
1065 |
|
appendMessagesClient("lscp_clear_midi_instruments"); |
1066 |
|
if (::lscp_remove_midi_instrument_map(m_pClient, iMidiMap) != LSCP_OK) |
1067 |
|
appendMessagesClient("lscp_remove_midi_instrument_map"); |
1068 |
|
} |
1069 |
|
// Check for errors... |
1070 |
|
if (piMaps == NULL && ::lscp_client_get_errno(m_pClient)) |
1071 |
|
appendMessagesClient("lscp_list_midi_instrument_maps"); |
1072 |
|
#endif // CONFIG_MIDI_INSTRUMENT |
1073 |
|
// actually do the sampler reset... |
1074 |
|
if (::lscp_reset_sampler(m_pClient) != LSCP_OK) { |
1075 |
|
appendMessagesClient("lscp_reset_sampler"); |
1076 |
|
appendMessagesError(tr("Could not reset sampler instance.\n\nSorry.")); |
1077 |
|
return; |
1078 |
|
} |
1079 |
} |
} |
1080 |
|
|
1081 |
// Log this. |
// Log this. |