vbAccelerator - Contents of code file: mIMAPIEnumDisplayNames.bas

This file is part of the download VB6 IMAPI Properties Demonstration, which is described in the article Image Mastering API (IMAPI) Library for VB.

Attribute VB_Name = "mIMAPIEnumDisplayNames"
Option Explicit

' TODO Not i18n

Public Function RecorderTypeName(ByVal eType As RECORDER_TYPES) As String
   If (eType = RECORDER_CDR) Then
      RecorderTypeName = "CDR"
   ElseIf (eType = RECORDER_CDRW) Then
      RecorderTypeName = "CDRW"
   Else
      RecorderTypeName = "Unknown Type"
   End If
End Function

Public Function RecorderStateName(ByVal eState As RECORDER_STATE) As String
   If (eState = RECORDER_OPENED) Then
      RecorderStateName = "Opened"
   ElseIf (eState = RECORDER_BURNING) Then
      RecorderStateName = "Burning"
   ElseIf (eState = RECORDER_DOING_NOTHING) Then
      RecorderStateName = "Idle"
   Else
      RecorderStateName = "Unknown"
   End If
End Function

Public Function MediaTypeName(ByVal eType As MEDIA_TYPES) As String
   If (eType = MEDIA_CD_EXTRA) Then
      MediaTypeName = "CD-Extra"
   ElseIf (eType = MEDIA_CD_I) Then
      MediaTypeName = "CD-I"
   ElseIf (eType = MEDIA_CD_OTHER) Then
      MediaTypeName = "Other CD Type"
   ElseIf (eType = MEDIA_CD_ROM_XA) Then
      MediaTypeName = "CD-ROM XA"
   ElseIf (eType = MEDIA_CDDA_CDROM) Then
      MediaTypeName = "CDDA CDROM"
   ElseIf (eType = MEDIA_SPECIAL) Then
      MediaTypeName = "Special"
   Else
      MediaTypeName = "Unknown"
   End If
End Function

Public Function MediaFlagNames(ByVal eFlags As MEDIA_FLAGS) As String
Dim sRet As String
   If (eFlags And MEDIA_BLANK) = MEDIA_BLANK Then
      sRet = AddToString(sRet, "Blank")
   End If
   If (eFlags And MEDIA_FORMAT_UNUSABLE_BY_IMAPI) =
    MEDIA_FORMAT_UNUSABLE_BY_IMAPI Then
      sRet = AddToString(sRet, "Unusable")
   End If
   If (eFlags And MEDIA_RW) = MEDIA_RW Then
      sRet = AddToString(sRet, "R/W")
   End If
   If (eFlags And MEDIA_WRITABLE) = MEDIA_WRITABLE Then
      sRet = AddToString(sRet, "Writable")
   End If
   MediaFlagNames = sRet
End Function

Private Function AddToString(ByVal sAddTo As String, ByVal sAdd As String) As
 String
   If (Len(sAddTo) > 0) Then
      sAddTo = sAddTo & ", "
   End If
   AddToString = sAddTo & sAdd
End Function