1 |
// qsamplerInstrumentForm.cpp |
// qsamplerInstrumentForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2003-2010, 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 |
57 |
m_ui.setupUi(this); |
m_ui.setupUi(this); |
58 |
|
|
59 |
// Initialize locals. |
// Initialize locals. |
60 |
m_pInstrument = NULL; |
m_pInstrument = nullptr; |
61 |
|
|
62 |
m_iDirtySetup = 0; |
m_iDirtySetup = 0; |
63 |
m_iDirtyCount = 0; |
m_iDirtyCount = 0; |
120 |
m_iDirtyCount = 0; |
m_iDirtyCount = 0; |
121 |
m_iDirtyName = 0; |
m_iDirtyName = 0; |
122 |
|
|
123 |
if (m_pInstrument == NULL) |
if (m_pInstrument == nullptr) |
124 |
return; |
return; |
125 |
|
|
126 |
// Check if we're up and connected. |
// Check if we're up and connected. |
127 |
MainForm* pMainForm = MainForm::getInstance(); |
MainForm* pMainForm = MainForm::getInstance(); |
128 |
if (pMainForm == NULL) |
if (pMainForm == nullptr) |
129 |
return; |
return; |
130 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == nullptr) |
131 |
return; |
return; |
132 |
|
|
133 |
Options *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
134 |
if (pOptions == NULL) |
if (pOptions == nullptr) |
135 |
return; |
return; |
136 |
|
|
137 |
// It can be a brand new channel, remember? |
// It can be a brand new channel, remember? |
249 |
void InstrumentForm::openInstrumentFile (void) |
void InstrumentForm::openInstrumentFile (void) |
250 |
{ |
{ |
251 |
MainForm* pMainForm = MainForm::getInstance(); |
MainForm* pMainForm = MainForm::getInstance(); |
252 |
if (pMainForm == NULL) |
if (pMainForm == nullptr) |
253 |
return; |
return; |
254 |
|
|
255 |
Options *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
256 |
if (pOptions == NULL) |
if (pOptions == nullptr) |
257 |
return; |
return; |
258 |
|
|
259 |
// FIXME: the instrument file filters should be restricted, |
// FIXME: the instrument file filters should be restricted, |
286 |
void InstrumentForm::updateInstrumentName (void) |
void InstrumentForm::updateInstrumentName (void) |
287 |
{ |
{ |
288 |
MainForm* pMainForm = MainForm::getInstance(); |
MainForm* pMainForm = MainForm::getInstance(); |
289 |
if (pMainForm == NULL) |
if (pMainForm == nullptr) |
290 |
return; |
return; |
291 |
|
|
292 |
Options *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
293 |
if (pOptions == NULL) |
if (pOptions == nullptr) |
294 |
return; |
return; |
295 |
|
|
296 |
// TODO: this better idea would be to use libgig |
// TODO: this better idea would be to use libgig |
324 |
// Accept settings (OK button slot). |
// Accept settings (OK button slot). |
325 |
void InstrumentForm::accept (void) |
void InstrumentForm::accept (void) |
326 |
{ |
{ |
327 |
if (m_pInstrument == NULL) |
if (m_pInstrument == nullptr) |
328 |
return; |
return; |
329 |
|
|
330 |
MainForm* pMainForm = MainForm::getInstance(); |
MainForm* pMainForm = MainForm::getInstance(); |
331 |
if (pMainForm == NULL) |
if (pMainForm == nullptr) |
332 |
return; |
return; |
333 |
if (pMainForm->client() == NULL) |
if (pMainForm->client() == nullptr) |
334 |
return; |
return; |
335 |
|
|
336 |
Options *pOptions = pMainForm->options(); |
Options *pOptions = pMainForm->options(); |
337 |
if (pOptions == NULL) |
if (pOptions == nullptr) |
338 |
return; |
return; |
339 |
|
|
340 |
if (m_iDirtyCount > 0) { |
if (m_iDirtyCount > 0) { |