PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Common/Utilities/MediaNFOAudio.vb

#
Visual Basic | 34 lines | 28 code | 6 blank | 0 comment | 0 complexity | b01636f485ac3032f50d6e6120d09ea5 MD5 | raw file
 1
 2Public Structure str_MediaNFOAudio
 3    Dim language As String
 4    Dim codec As String
 5    Dim channels As String
 6    Dim bitrate As String
 7    Sub New(SetDefaults As Boolean) 'When called with new keyword & boolean constant SetDefault (either T or F), initialises all values to defaults to avoid having some variables left as 'nothing'
 8        language = ""
 9        codec = ""
10        channels = ""
11        bitrate = ""
12    End Sub
13
14    Shared Widening Operator CType(ByVal Input As Nfo.AudioDetails) As str_MediaNFOAudio
15        Dim Temp As New str_MediaNFOAudio(True)
16        Temp.codec = Input.Codec
17        Temp.bitrate = Input.Bitrate
18        Temp.language = Input.Language
19        Temp.channels = Input.Channels
20
21        Return Temp
22    End Operator
23
24    Shared Widening Operator CType(ByVal Input As str_MediaNFOAudio) As Nfo.AudioDetails
25        Dim Temp As New Nfo.AudioDetails
26
27        Temp.Codec.Value = Input.codec
28        Temp.Bitrate.Value = Input.bitrate
29        Temp.Channels.Value = Input.channels
30        Temp.Language.Value = Input.language
31
32        Return Temp
33    End Operator
34End Structure