Author Topic: TAG.DLL  (Read 7945 times)

24stitches

  • Posts: 6
TAG.DLL
« on: 28 Apr '09 - 11:07 »
First of all thanks to all the guys at www.un4seen.com for all the great work they have done and they are still doing over BASS. BASS has mde it much easier for me to develop a media player of my dreams.
I have a problem you  using the TAG VB module. I donít know how to FORMAT the string that must be passed to the TAG_Read and how to extract the return tag info. Please help me with and Example. Am a VB addict. Thanks.

When I call : TAG_READ(chan,TAGFILEINFO)
Now how do I set the string format for the variable TAGFILEINFO and how do I extract info that fmt returns.
Of course in the TAG read me there is the example format:  "%IFV1(%TRCK,%TRCK. )%IFV2(%ARTI,%ICAP(%ARTI),no artist) - %IFV2(%TITL,%ICAP(%TITL) -,no title -)%IFV1(%ALBM, %IUPC(%ALBM))%IFV1(%YEAR, %(%YEAR%))"  .but I donít know how to use it or use it to formt TAGFILEINFO. Please help me with a VB example.

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: TAG.DLL
« Reply #1 on: 28 Apr '09 - 14:10 »
You can use the VBStrFromAnsiPtr function to convert the TAG_Read return value to a VB string. For example, to get the title tag, you could do something like this...

Code: [Select]
Dim title As String
title = VBStrFromAnsiPtr(TAG_Read(handle, "%TITL"))

(: JOBnik! :)

  • Posts: 1065
Re: TAG.DLL
« Reply #2 on: 4 May '09 - 20:06 »
Hi ;D

If you still have troubles with this issue, please download this small VB example to understand it better :)
http://www.jobnik.org/files/Tags-vb.zip

DAMIAN

  • Guest
Re: TAG.DLL
« Reply #3 on: 24 Aug '14 - 04:09 »
First of all thanks to all the guys at www.un4seen.com for all the great work they have done and they are still doing over BASS. BASS has mde it much easier for me to develop a media player of my dreams.
I have a problem you  using the TAG VB module. I donít know how to FORMAT the string that must be passed to the TAG_Read and how to extract the return tag info. Please help me with and Example. Am a VB addict. Thanks.

When I call : TAG_READ(chan,TAGFILEINFO)
Now how do I set the string format for the variable TAGFILEINFO and how do I extract info that fmt returns.
Of course in the TAG read me there is the example format:  "%IFV1(%TRCK,%TRCK. )%IFV2(%ARTI,%ICAP(%ARTI),no artist) - %IFV2(%TITL,%ICAP(%TITL) -,no title -)%IFV1(%ALBM, %IUPC(%ALBM))%IFV1(%YEAR, %(%YEAR%))"  .but I donít know how to use it or use it to formt TAGFILEINFO. Please help me with a VB example.


subh

  • Posts: 177
Re: TAG.DLL
« Reply #4 on: 24 Aug '14 - 14:32 »
First of all thanks to all the guys at www.un4seen.com for all the great work they have done and they are still doing over BASS. BASS has mde it much easier for me to develop a media player of my dreams.
I have a problem you  using the TAG VB module. I donít know how to FORMAT the string that must be passed to the TAG_Read and how to extract the return tag info. Please help me with and Example. Am a VB addict. Thanks.

When I call : TAG_READ(chan,TAGFILEINFO)
Now how do I set the string format for the variable TAGFILEINFO and how do I extract info that fmt returns.
Of course in the TAG read me there is the example format:  "%IFV1(%TRCK,%TRCK. )%IFV2(%ARTI,%ICAP(%ARTI),no artist) - %IFV2(%TITL,%ICAP(%TITL) -,no title -)%IFV1(%ALBM, %IUPC(%ALBM))%IFV1(%YEAR, %(%YEAR%))"  .but I donít know how to use it or use it to formt TAGFILEINFO. Please help me with a VB example.


which code do you want? vb.net or vb6

subh

  • Posts: 177
Re: TAG.DLL
« Reply #5 on: 24 Aug '14 - 14:52 »
VB6 is here

'header

Code: [Select]
Public Declare Function TAGS_Read Lib "tags.dll" (ByVal handle As Long, ByVal fmt As String) As Long
Public Declare Function TAGS_GetLastErrorDesc Lib "tags.dll" () As Long
Public Declare Function TAGS_GetVersion Lib "tags.dll" () As Long

Private Sub Form_Initialize()
    ' change and set the current path, to prevent from VB not finding BASS.DLL
    ChDrive App.Path
    ChDir App.Path
   
    ' check the correct BASS was loaded
    If (HiWord(BASS_GetVersion) <> BASSVERSION) Then
        Call MsgBox("An incorrect version of BASS.DLL was loaded (2.4 is required)", vbCritical)
        End
    End If

    ' check the correct TAGS was loaded
    If (TAGS_GetVersion <> 15) Then       ' what Version you use
        Call MsgBox("An incorrect version of TAGS.DLL was loaded (15 is required)", vbCritical)
        End
    End If

    ' setup output - default device, 44100hz, stereo, 16 bits
    If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then
        Call Error_("Can't initialize device")
        End
    End If
End Sub

here is your code...

    ' update Title and Artist etc. textboxes
    txtTags(0).Text = VBStrFromAnsiPtr(TAGS_Read(chan, "%TITL"))
    txtTags(1).Text = VBStrFromAnsiPtr(TAGS_Read(chan, "%ARTI"))
    txtTags(2).Text = VBStrFromAnsiPtr(TAGS_Read(chan, "%ALBM"))

         "%TITL"  - song title
         "%ARTI"  - song artist
         "%ALBM"  - album name
         "%GNRE"  - song genre
         "%YEAR"  - song/album year
         "%CMNT"  - comment
         "%TRCK"  - track number
         "%COMP"  - composer
         "%COPY"  - copyright
         "%SUBT"  - subtitle
         "%AART"  - album artist

ok is it  :D
thanks

subh