/[svn]/qsampler/trunk/src/qsamplerDevice.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerDevice.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3554 by capela, Mon Jul 1 10:53:41 2019 UTC revision 3555 by capela, Tue Aug 13 10:19:32 2019 UTC
# Line 49  DeviceParam::DeviceParam ( lscp_param_in Line 49  DeviceParam::DeviceParam ( lscp_param_in
49  void DeviceParam::setParam ( lscp_param_info_t *pParamInfo,  void DeviceParam::setParam ( lscp_param_info_t *pParamInfo,
50          const char *pszValue )          const char *pszValue )
51  {  {
52          if (pParamInfo == NULL)          if (pParamInfo == nullptr)
53                  return;                  return;
54    
55          // Info structure field members.          // Info structure field members.
# Line 131  Device::Device ( const Device& device ) Line 131  Device::Device ( const Device& device )
131  void Device::setDevice ( DeviceType deviceType, int iDeviceID )  void Device::setDevice ( DeviceType deviceType, int iDeviceID )
132  {  {
133          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
134          if (pMainForm == NULL)          if (pMainForm == nullptr)
135                  return;                  return;
136          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
137                  return;                  return;
138    
139          // Device id and type should be always set.          // Device id and type should be always set.
# Line 146  void Device::setDevice ( DeviceType devi Line 146  void Device::setDevice ( DeviceType devi
146          m_ports.clear();          m_ports.clear();
147    
148          // Retrieve device info, if any.          // Retrieve device info, if any.
149          lscp_device_info_t *pDeviceInfo = NULL;          lscp_device_info_t *pDeviceInfo = nullptr;
150          switch (deviceType) {          switch (deviceType) {
151          case Device::Audio:          case Device::Audio:
152                  m_sDeviceType = QObject::tr("Audio");                  m_sDeviceType = QObject::tr("Audio");
153                  if (m_iDeviceID >= 0 && (pDeviceInfo = ::lscp_get_audio_device_info(                  if (m_iDeviceID >= 0 && (pDeviceInfo = ::lscp_get_audio_device_info(
154                                  pMainForm->client(), m_iDeviceID)) == NULL)                                  pMainForm->client(), m_iDeviceID)) == nullptr)
155                          appendMessagesClient("lscp_get_audio_device_info");                          appendMessagesClient("lscp_get_audio_device_info");
156                  break;                  break;
157          case Device::Midi:          case Device::Midi:
158                  m_sDeviceType = QObject::tr("MIDI");                  m_sDeviceType = QObject::tr("MIDI");
159                  if (m_iDeviceID >= 0 && (pDeviceInfo = ::lscp_get_midi_device_info(                  if (m_iDeviceID >= 0 && (pDeviceInfo = ::lscp_get_midi_device_info(
160                                  pMainForm->client(), m_iDeviceID)) == NULL)                                  pMainForm->client(), m_iDeviceID)) == nullptr)
161                          appendMessagesClient("lscp_get_midi_device_info");                          appendMessagesClient("lscp_get_midi_device_info");
162                  break;                  break;
163          case Device::None:          case Device::None:
# Line 165  void Device::setDevice ( DeviceType devi Line 165  void Device::setDevice ( DeviceType devi
165                  break;                  break;
166          }          }
167          // If we're bogus, bail out...          // If we're bogus, bail out...
168          if (pDeviceInfo == NULL) {          if (pDeviceInfo == nullptr) {
169                  m_sDriverName.clear();                  m_sDriverName.clear();
170                  m_sDeviceName = QObject::tr("New %1 device").arg(m_sDeviceType);                  m_sDeviceName = QObject::tr("New %1 device").arg(m_sDeviceType);
171                  return;                  return;
# Line 179  void Device::setDevice ( DeviceType devi Line 179  void Device::setDevice ( DeviceType devi
179          // Grab device parameters...          // Grab device parameters...
180          for (int i = 0; pDeviceInfo->params && pDeviceInfo->params[i].key; i++) {          for (int i = 0; pDeviceInfo->params && pDeviceInfo->params[i].key; i++) {
181                  const QString sParam = pDeviceInfo->params[i].key;                  const QString sParam = pDeviceInfo->params[i].key;
182                  lscp_param_info_t *pParamInfo = NULL;                  lscp_param_info_t *pParamInfo = nullptr;
183                  switch (deviceType) {                  switch (deviceType) {
184                  case Device::Audio:                  case Device::Audio:
185                          if ((pParamInfo = ::lscp_get_audio_driver_param_info(                          if ((pParamInfo = ::lscp_get_audio_driver_param_info(
186                                          pMainForm->client(), m_sDriverName.toUtf8().constData(),                                          pMainForm->client(), m_sDriverName.toUtf8().constData(),
187                                          sParam.toUtf8().constData(), NULL)) == NULL)                                          sParam.toUtf8().constData(), nullptr)) == nullptr)
188                                  appendMessagesClient("lscp_get_audio_driver_param_info");                                  appendMessagesClient("lscp_get_audio_driver_param_info");
189                          break;                          break;
190                  case Device::Midi:                  case Device::Midi:
191                          if ((pParamInfo = ::lscp_get_midi_driver_param_info(                          if ((pParamInfo = ::lscp_get_midi_driver_param_info(
192                                          pMainForm->client(), m_sDriverName.toUtf8().constData(),                                          pMainForm->client(), m_sDriverName.toUtf8().constData(),
193                                          sParam.toUtf8().constData(), NULL)) == NULL)                                          sParam.toUtf8().constData(), nullptr)) == nullptr)
194                                  appendMessagesClient("lscp_get_midi_driver_param_info");                                  appendMessagesClient("lscp_get_midi_driver_param_info");
195                          break;                          break;
196                  case Device::None:                  case Device::None:
# Line 213  void Device::setDevice ( DeviceType devi Line 213  void Device::setDevice ( DeviceType devi
213  void Device::setDriver ( const QString& sDriverName )  void Device::setDriver ( const QString& sDriverName )
214  {  {
215          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
216          if (pMainForm == NULL)          if (pMainForm == nullptr)
217                  return;                  return;
218          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
219                  return;                  return;
220    
221          // Valid only for scratch devices.          // Valid only for scratch devices.
# Line 228  void Device::setDriver ( const QString& Line 228  void Device::setDriver ( const QString&
228          m_ports.clear();          m_ports.clear();
229    
230          // Retrieve driver info, if any.          // Retrieve driver info, if any.
231          lscp_driver_info_t *pDriverInfo = NULL;          lscp_driver_info_t *pDriverInfo = nullptr;
232          switch (m_deviceType) {          switch (m_deviceType) {
233          case Device::Audio:          case Device::Audio:
234                  if ((pDriverInfo = ::lscp_get_audio_driver_info(pMainForm->client(),                  if ((pDriverInfo = ::lscp_get_audio_driver_info(pMainForm->client(),
235                                  sDriverName.toUtf8().constData())) == NULL)                                  sDriverName.toUtf8().constData())) == nullptr)
236                          appendMessagesClient("lscp_get_audio_driver_info");                          appendMessagesClient("lscp_get_audio_driver_info");
237                  break;                  break;
238          case Device::Midi:          case Device::Midi:
239                  if ((pDriverInfo = ::lscp_get_midi_driver_info(pMainForm->client(),                  if ((pDriverInfo = ::lscp_get_midi_driver_info(pMainForm->client(),
240                                  sDriverName.toUtf8().constData())) == NULL)                                  sDriverName.toUtf8().constData())) == nullptr)
241                          appendMessagesClient("lscp_get_midi_driver_info");                          appendMessagesClient("lscp_get_midi_driver_info");
242                  break;                  break;
243          case Device::None:          case Device::None:
# Line 245  void Device::setDriver ( const QString& Line 245  void Device::setDriver ( const QString&
245          }          }
246    
247          // If we're bogus, bail out...          // If we're bogus, bail out...
248          if (pDriverInfo == NULL)          if (pDriverInfo == nullptr)
249                  return;                  return;
250    
251          // Remember device parameters...          // Remember device parameters...
# Line 254  void Device::setDriver ( const QString& Line 254  void Device::setDriver ( const QString&
254          // Grab driver parameters...          // Grab driver parameters...
255          for (int i = 0; pDriverInfo->parameters && pDriverInfo->parameters[i]; i++) {          for (int i = 0; pDriverInfo->parameters && pDriverInfo->parameters[i]; i++) {
256                  const QString sParam = pDriverInfo->parameters[i];                  const QString sParam = pDriverInfo->parameters[i];
257                  lscp_param_info_t *pParamInfo = NULL;                  lscp_param_info_t *pParamInfo = nullptr;
258                  switch (m_deviceType) {                  switch (m_deviceType) {
259                  case Device::Audio:                  case Device::Audio:
260                          if ((pParamInfo = ::lscp_get_audio_driver_param_info(                          if ((pParamInfo = ::lscp_get_audio_driver_param_info(
261                                          pMainForm->client(), sDriverName.toUtf8().constData(),                                          pMainForm->client(), sDriverName.toUtf8().constData(),
262                                          sParam.toUtf8().constData(), NULL)) == NULL)                                          sParam.toUtf8().constData(), nullptr)) == nullptr)
263                                  appendMessagesClient("lscp_get_audio_driver_param_info");                                  appendMessagesClient("lscp_get_audio_driver_param_info");
264                          break;                          break;
265                  case Device::Midi:                  case Device::Midi:
266                          if ((pParamInfo = ::lscp_get_midi_driver_param_info(                          if ((pParamInfo = ::lscp_get_midi_driver_param_info(
267                                          pMainForm->client(), sDriverName.toUtf8().constData(),                                          pMainForm->client(), sDriverName.toUtf8().constData(),
268                                          sParam.toUtf8().constData(), NULL)) == NULL)                                          sParam.toUtf8().constData(), nullptr)) == nullptr)
269                                  appendMessagesClient("lscp_get_midi_driver_param_info");                                  appendMessagesClient("lscp_get_midi_driver_param_info");
270                          break;                          break;
271                  case Device::None:                  case Device::None:
# Line 320  bool Device::setParam ( const QString& s Line 320  bool Device::setParam ( const QString& s
320          const QString& sValue )          const QString& sValue )
321  {  {
322          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
323          if (pMainForm == NULL)          if (pMainForm == nullptr)
324                  return false;                  return false;
325          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
326                  return false;                  return false;
327    
328          // Set proper device parameter.          // Set proper device parameter.
# Line 397  DevicePortList& Device::ports (void) Line 397  DevicePortList& Device::ports (void)
397  bool Device::createDevice (void)  bool Device::createDevice (void)
398  {  {
399          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
400          if (pMainForm == NULL)          if (pMainForm == nullptr)
401                  return false;                  return false;
402          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
403                  return false;                  return false;
404    
405          // we need temporary lists with the final strings, because i.e.          // we need temporary lists with the final strings, because i.e.
# Line 425  bool Device::createDevice (void) Line 425  bool Device::createDevice (void)
425                  pParams[iParam].value = (char *) finalVals[iParam].constData();                  pParams[iParam].value = (char *) finalVals[iParam].constData();
426          }          }
427          // Null terminated.          // Null terminated.
428          pParams[iParam].key   = NULL;          pParams[iParam].key   = nullptr;
429          pParams[iParam].value = NULL;          pParams[iParam].value = nullptr;
430    
431          // Now it depends on the device type...          // Now it depends on the device type...
432          switch (m_deviceType) {          switch (m_deviceType) {
# Line 465  bool Device::createDevice (void) Line 465  bool Device::createDevice (void)
465  bool Device::deleteDevice (void)  bool Device::deleteDevice (void)
466  {  {
467          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
468          if (pMainForm == NULL)          if (pMainForm == nullptr)
469                  return false;                  return false;
470          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
471                  return false;                  return false;
472    
473          // Now it depends on the device type...          // Now it depends on the device type...
# Line 567  int Device::refreshDepends ( const QStri Line 567  int Device::refreshDepends ( const QStri
567  int Device::refreshParam ( const QString& sParam )  int Device::refreshParam ( const QString& sParam )
568  {  {
569          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
570          if (pMainForm == NULL)          if (pMainForm == nullptr)
571                  return 0;                  return 0;
572          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
573                  return 0;                  return 0;
574    
575          // Check if we have dependencies...          // Check if we have dependencies...
# Line 600  int Device::refreshParam ( const QString Line 600  int Device::refreshParam ( const QString
600                  ++iDepend;                  ++iDepend;
601          }          }
602          // Null terminated.          // Null terminated.
603          pDepends[iDepend].key   = NULL;          pDepends[iDepend].key   = nullptr;
604          pDepends[iDepend].value = NULL;          pDepends[iDepend].value = nullptr;
605    
606          // FIXME: Some parameter dependencies (e.g.ALSA CARD)          // FIXME: Some parameter dependencies (e.g.ALSA CARD)
607          // are blocking for no reason, causing potential timeout-crashes.          // are blocking for no reason, causing potential timeout-crashes.
# Line 609  int Device::refreshParam ( const QString Line 609  int Device::refreshParam ( const QString
609          // carried out for scratch devices...          // carried out for scratch devices...
610    
611          // Retrieve some modern parameters...          // Retrieve some modern parameters...
612          lscp_param_info_t *pParamInfo = NULL;          lscp_param_info_t *pParamInfo = nullptr;
613          switch (m_deviceType) {          switch (m_deviceType) {
614          case Device::Audio:          case Device::Audio:
615                  if ((pParamInfo = ::lscp_get_audio_driver_param_info(                  if ((pParamInfo = ::lscp_get_audio_driver_param_info(
616                                  pMainForm->client(), m_sDriverName.toUtf8().constData(),                                  pMainForm->client(), m_sDriverName.toUtf8().constData(),
617                                  sParam.toUtf8().constData(), pDepends)) == NULL)                                  sParam.toUtf8().constData(), pDepends)) == nullptr)
618                          appendMessagesClient("lscp_get_audio_driver_param_info");                          appendMessagesClient("lscp_get_audio_driver_param_info");
619                  break;                  break;
620          case Device::Midi:          case Device::Midi:
621                  if ((pParamInfo = ::lscp_get_midi_driver_param_info(                  if ((pParamInfo = ::lscp_get_midi_driver_param_info(
622                                  pMainForm->client(), m_sDriverName.toUtf8().constData(),                                  pMainForm->client(), m_sDriverName.toUtf8().constData(),
623                                  sParam.toUtf8().constData(), pDepends)) == NULL)                                  sParam.toUtf8().constData(), pDepends)) == nullptr)
624                          appendMessagesClient("lscp_get_midi_driver_param_info");                          appendMessagesClient("lscp_get_midi_driver_param_info");
625                  break;                  break;
626          case Device::None:          case Device::None:
# Line 628  int Device::refreshParam ( const QString Line 628  int Device::refreshParam ( const QString
628          }          }
629          if (pParamInfo) {          if (pParamInfo) {
630                  param = DeviceParam(pParamInfo,                  param = DeviceParam(pParamInfo,
631                          param.value.isEmpty() ? NULL : param.value.toUtf8().constData());                          param.value.isEmpty() ? nullptr : param.value.toUtf8().constData());
632                  iRefresh++;                  iRefresh++;
633          }          }
634    
# Line 682  void Device::appendMessagesClient( const Line 682  void Device::appendMessagesClient( const
682  int *Device::getDevices ( lscp_client_t *pClient,  int *Device::getDevices ( lscp_client_t *pClient,
683          DeviceType deviceType )          DeviceType deviceType )
684  {  {
685          int *piDeviceIDs = NULL;          int *piDeviceIDs = nullptr;
686          switch (deviceType) {          switch (deviceType) {
687          case Device::Audio:          case Device::Audio:
688                  piDeviceIDs = ::lscp_list_audio_devices(pClient);                  piDeviceIDs = ::lscp_list_audio_devices(pClient);
# Line 714  QStringList Device::getDrivers ( lscp_cl Line 714  QStringList Device::getDrivers ( lscp_cl
714  {  {
715          QStringList drivers;          QStringList drivers;
716    
717          const char **ppszDrivers = NULL;          const char **ppszDrivers = nullptr;
718          switch (deviceType) {          switch (deviceType) {
719          case Device::Audio:          case Device::Audio:
720                  ppszDrivers = ::lscp_list_available_audio_drivers(pClient);                  ppszDrivers = ::lscp_list_available_audio_drivers(pClient);
# Line 754  DevicePort::~DevicePort (void) Line 754  DevicePort::~DevicePort (void)
754  void DevicePort::setDevicePort ( int iPortID )  void DevicePort::setDevicePort ( int iPortID )
755  {  {
756          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
757          if (pMainForm == NULL)          if (pMainForm == nullptr)
758                  return;                  return;
759          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
760                  return;                  return;
761    
762          // Device port id should be always set.          // Device port id should be always set.
# Line 766  void DevicePort::setDevicePort ( int iPo Line 766  void DevicePort::setDevicePort ( int iPo
766          m_params.clear();          m_params.clear();
767    
768          // Retrieve device port/channel info, if any.          // Retrieve device port/channel info, if any.
769          lscp_device_port_info_t *pPortInfo = NULL;          lscp_device_port_info_t *pPortInfo = nullptr;
770          switch (m_device.deviceType()) {          switch (m_device.deviceType()) {
771          case Device::Audio:          case Device::Audio:
772                  if ((pPortInfo = ::lscp_get_audio_channel_info(pMainForm->client(),                  if ((pPortInfo = ::lscp_get_audio_channel_info(pMainForm->client(),
773                                  m_device.deviceID(), m_iPortID)) == NULL)                                  m_device.deviceID(), m_iPortID)) == nullptr)
774                          m_device.appendMessagesClient("lscp_get_audio_channel_info");                          m_device.appendMessagesClient("lscp_get_audio_channel_info");
775                  break;                  break;
776          case Device::Midi:          case Device::Midi:
777                  if ((pPortInfo = ::lscp_get_midi_port_info(pMainForm->client(),                  if ((pPortInfo = ::lscp_get_midi_port_info(pMainForm->client(),
778                                  m_device.deviceID(), m_iPortID)) == NULL)                                  m_device.deviceID(), m_iPortID)) == nullptr)
779                          m_device.appendMessagesClient("lscp_get_midi_port_info");                          m_device.appendMessagesClient("lscp_get_midi_port_info");
780                  break;                  break;
781          case Device::None:          case Device::None:
# Line 783  void DevicePort::setDevicePort ( int iPo Line 783  void DevicePort::setDevicePort ( int iPo
783          }          }
784    
785          // If we're bogus, bail out...          // If we're bogus, bail out...
786          if (pPortInfo == NULL) {          if (pPortInfo == nullptr) {
787                  m_sPortName.clear();                  m_sPortName.clear();
788                  return;                  return;
789          }          }
# Line 795  void DevicePort::setDevicePort ( int iPo Line 795  void DevicePort::setDevicePort ( int iPo
795          m_params.clear();          m_params.clear();
796          for (int i = 0; pPortInfo->params && pPortInfo->params[i].key; i++) {          for (int i = 0; pPortInfo->params && pPortInfo->params[i].key; i++) {
797                  const QString sParam = pPortInfo->params[i].key;                  const QString sParam = pPortInfo->params[i].key;
798                  lscp_param_info_t *pParamInfo = NULL;                  lscp_param_info_t *pParamInfo = nullptr;
799                  switch (m_device.deviceType()) {                  switch (m_device.deviceType()) {
800                  case Device::Audio:                  case Device::Audio:
801                          if ((pParamInfo = ::lscp_get_audio_channel_param_info(                          if ((pParamInfo = ::lscp_get_audio_channel_param_info(
802                                          pMainForm->client(), m_device.deviceID(),                                          pMainForm->client(), m_device.deviceID(),
803                                          m_iPortID, sParam.toUtf8().constData())) == NULL)                                          m_iPortID, sParam.toUtf8().constData())) == nullptr)
804                                  m_device.appendMessagesClient("lscp_get_audio_channel_param_info");                                  m_device.appendMessagesClient("lscp_get_audio_channel_param_info");
805                          break;                          break;
806                  case Device::Midi:                  case Device::Midi:
807                          if ((pParamInfo = ::lscp_get_midi_port_param_info(                          if ((pParamInfo = ::lscp_get_midi_port_param_info(
808                                          pMainForm->client(), m_device.deviceID(),                                          pMainForm->client(), m_device.deviceID(),
809                                          m_iPortID, sParam.toUtf8().constData())) == NULL)                                          m_iPortID, sParam.toUtf8().constData())) == nullptr)
810                                  m_device.appendMessagesClient("lscp_get_midi_port_param_info");                                  m_device.appendMessagesClient("lscp_get_midi_port_param_info");
811                          break;                          break;
812                  case Device::None:                  case Device::None:
# Line 843  bool DevicePort::setParam ( const QStrin Line 843  bool DevicePort::setParam ( const QStrin
843          const QString& sValue )          const QString& sValue )
844  {  {
845          MainForm *pMainForm = MainForm::getInstance();          MainForm *pMainForm = MainForm::getInstance();
846          if (pMainForm == NULL)          if (pMainForm == nullptr)
847                  return false;                  return false;
848          if (pMainForm->client() == NULL)          if (pMainForm->client() == nullptr)
849                  return false;                  return false;
850    
851          // Set proper port/channel parameter.          // Set proper port/channel parameter.
# Line 964  Device& DeviceItem::device () Line 964  Device& DeviceItem::device ()
964  AbstractDeviceParamModel::AbstractDeviceParamModel ( QObject* pParent )  AbstractDeviceParamModel::AbstractDeviceParamModel ( QObject* pParent )
965          : QAbstractTableModel(pParent), m_bEditable(false)          : QAbstractTableModel(pParent), m_bEditable(false)
966  {  {
967          m_pParams = NULL;          m_pParams = nullptr;
968  }  }
969    
970    
# Line 1023  void AbstractDeviceParamModel::refresh ( Line 1023  void AbstractDeviceParamModel::refresh (
1023    
1024  void AbstractDeviceParamModel::clear (void)  void AbstractDeviceParamModel::clear (void)
1025  {  {
1026          m_pParams = NULL;          m_pParams = nullptr;
1027          // inform the outer world (QTableView) that our data changed          // inform the outer world (QTableView) that our data changed
1028  #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)  #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
1029          QAbstractTableModel::reset();          QAbstractTableModel::reset();
# Line 1041  void AbstractDeviceParamModel::clear (vo Line 1041  void AbstractDeviceParamModel::clear (vo
1041  DeviceParamModel::DeviceParamModel ( QObject *pParent )  DeviceParamModel::DeviceParamModel ( QObject *pParent )
1042          : AbstractDeviceParamModel(pParent)          : AbstractDeviceParamModel(pParent)
1043  {  {
1044          m_pDevice = NULL;          m_pDevice = nullptr;
1045  }  }
1046    
1047  QVariant DeviceParamModel::data (  QVariant DeviceParamModel::data (
# Line 1086  void DeviceParamModel::refresh ( Device* Line 1086  void DeviceParamModel::refresh ( Device*
1086  void DeviceParamModel::clear (void)  void DeviceParamModel::clear (void)
1087  {  {
1088          AbstractDeviceParamModel::clear();          AbstractDeviceParamModel::clear();
1089          m_pDevice = NULL;          m_pDevice = nullptr;
1090  }  }
1091    
1092    
# Line 1097  void DeviceParamModel::clear (void) Line 1097  void DeviceParamModel::clear (void)
1097  PortParamModel::PortParamModel ( QObject *pParent)  PortParamModel::PortParamModel ( QObject *pParent)
1098          : AbstractDeviceParamModel(pParent)          : AbstractDeviceParamModel(pParent)
1099  {  {
1100          m_pPort = NULL;          m_pPort = nullptr;
1101  }  }
1102    
1103  QVariant PortParamModel::data ( const QModelIndex &index, int role ) const  QVariant PortParamModel::data ( const QModelIndex &index, int role ) const
# Line 1141  void PortParamModel::refresh ( DevicePor Line 1141  void PortParamModel::refresh ( DevicePor
1141  void PortParamModel::clear (void)  void PortParamModel::clear (void)
1142  {  {
1143          AbstractDeviceParamModel::clear();          AbstractDeviceParamModel::clear();
1144          m_pPort = NULL;          m_pPort = nullptr;
1145  }  }
1146    
1147    
# Line 1159  QWidget* DeviceParamDelegate::createEdit Line 1159  QWidget* DeviceParamDelegate::createEdit
1159          const QStyleOptionViewItem& /* option */, const QModelIndex& index ) const          const QStyleOptionViewItem& /* option */, const QModelIndex& index ) const
1160  {  {
1161          if (!index.isValid())          if (!index.isValid())
1162                  return NULL;                  return nullptr;
1163    
1164          DeviceParameterRow r = index.model()->data(index,          DeviceParameterRow r = index.model()->data(index,
1165                  Qt::DisplayRole).value<DeviceParameterRow>();                  Qt::DisplayRole).value<DeviceParameterRow>();
# Line 1218  QWidget* DeviceParamDelegate::createEdit Line 1218  QWidget* DeviceParamDelegate::createEdit
1218                  case 2:                  case 2:
1219                          return new QLabel(r.param.description, pParent);                          return new QLabel(r.param.description, pParent);
1220                  default:                  default:
1221                          return NULL;                          return nullptr;
1222          }          }
1223  }  }
1224    

Legend:
Removed from v.3554  
changed lines
  Added in v.3555

  ViewVC Help
Powered by ViewVC