int AudioOutputDeviceCoreAudio::ParameterDevice::GetDeviceIndex() {
     String s = ValueAsString();
     if(s.empty()) return -1;
     int n = s.find(' ');
     s = s.substr(0, n);
     return ToInt(s) - 1;
 }
Ejemplo n.º 2
0
void NumericControl::ValueUpdated( Slider& sender, int v )
{
   int i0, i1;
   sender.GetRange( i0, i1 );
   double d = i1 - i0;
   double newValue = Round( m_lowerBound + (m_upperBound - m_lowerBound)*((v - i0)/d),
                            m_real ? Max( 0, TruncInt( Log( d ) ) ) : 0 );
   if ( newValue != m_value )
   {
      m_value = newValue;
      edit.SetText( ValueAsString() );

      if ( !m_handlers.IsNull() )
         if ( m_handlers->onValueUpdated != nullptr )
            (m_handlers->onValueUpdatedReceiver->*m_handlers->onValueUpdated)( *this, m_value );
   }
}
Ejemplo n.º 3
0
void NumericControl::__ValueUpdated( Slider& sender, int v )
{
   int i0, i1;
   sender.GetRange( i0, i1 );
   double d = i1 - i0;
   double newValue = Round( lowerBound + (upperBound - lowerBound)*((v - i0)/d),
                            isReal ? Max( 0, TruncI( Log( d ) ) ) : 0 );

   if ( newValue != value )
   {
      value = newValue;

      edit.SetText( ValueAsString() );

      if ( onValueUpdated != 0 )
         (onValueUpdatedReceiver->*onValueUpdated)( *this, value );
   }
}
 MidiInputDeviceAlsa::MidiInputPortAlsa::ParameterName::ParameterName(MidiInputPort* pPort) throw (Exception) : MidiInputPort::ParameterName(pPort, "Port " + ToString(pPort->GetPortNumber())) {
     OnSetValue(ValueAsString()); // initialize port name
 }
Ejemplo n.º 5
0
 String DeviceCreationParameterString::Value() {
     return "\'" + ValueAsString() + "\'";
 }
Ejemplo n.º 6
0
 String DeviceRuntimeParameterString::Value() {
     return "\'" + ValueAsString() + "\'";
 }
Ejemplo n.º 7
0
void NumericEdit::UpdateControls()
{
   edit.SetText( ValueAsString() );
}
Ejemplo n.º 8
0
int NumericEdit::MinEditWidth() const
{
   int n = int( Max( ValueAsString( m_lowerBound ).Length(), ValueAsString( m_upperBound ).Length() ) );
   return edit.Font().Width( String( '0', n+1 ) ) + LogicalPixelsToPhysical( 1+2+2+1 );
}
Ejemplo n.º 9
0
CString ImageProperty::AsString() const throw()
{
   return ValueAsString(m_value);
}
Ejemplo n.º 10
0
    void LogMissingRequiredTag(const DicomMap& summary)
    {
      std::string s, t;

      if (summary.HasTag(DICOM_TAG_PATIENT_ID))
      {
        if (t.size() > 0)
          t += ", ";
        t += "PatientID=" + ValueAsString(summary, DICOM_TAG_PATIENT_ID);
      }
      else
      {
        if (s.size() > 0)
          s += ", ";
        s += "PatientID";
      }

      if (summary.HasTag(DICOM_TAG_STUDY_INSTANCE_UID))
      {
        if (t.size() > 0)
          t += ", ";
        t += "StudyInstanceUID=" + ValueAsString(summary, DICOM_TAG_STUDY_INSTANCE_UID);
      }
      else
      {
        if (s.size() > 0)
          s += ", ";
        s += "StudyInstanceUID";
      }

      if (summary.HasTag(DICOM_TAG_SERIES_INSTANCE_UID))
      {
        if (t.size() > 0)
          t += ", ";
        t += "SeriesInstanceUID=" + ValueAsString(summary, DICOM_TAG_SERIES_INSTANCE_UID);
      }
      else
      {
        if (s.size() > 0)
          s += ", ";
        s += "SeriesInstanceUID";
      }

      if (summary.HasTag(DICOM_TAG_SOP_INSTANCE_UID))
      {
        if (t.size() > 0)
          t += ", ";
        t += "SOPInstanceUID=" + ValueAsString(summary, DICOM_TAG_SOP_INSTANCE_UID);
      }
      else
      {
        if (s.size() > 0)
          s += ", ";
        s += "SOPInstanceUID";
      }

      if (t.size() == 0)
      {
        LOG(ERROR) << "Store has failed because all the required tags (" << s << ") are missing (is it a DICOMDIR file?)";
      }
      else
      {
        LOG(ERROR) << "Store has failed because required tags (" << s << ") are missing for the following instance: " << t;
      }
    }
Ejemplo n.º 11
0
int NumericEdit::MinEditWidth() const
{
   int n = int( Max( ValueAsString( lowerBound ).Length(), ValueAsString( upperBound ).Length() ) );
   return edit.Font().Width( String( '0', n+1 ) ) + 1+2+2+1;
}
	MidiInputDeviceCoreMidi::MidiInputPortCoreMidi::ParameterName::ParameterName(MidiInputPort* pPort) throw (LinuxSamplerException) : MidiInputPort::ParameterName(pPort, "Port " + ToString(pPort->GetPortNumber())) {
        OnSetValue(ValueAsString()); // initialize port name
    }