AutoHotkey Community

It is currently May 27th, 2012, 3:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: March 8th, 2010, 6:04 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
This is a wrapper for AudioGenie3.dll (Beta 2.0.0.2) by Stefan Töngi (www.audiogenie.de). See this AHK forum post for more details on AudioGenie.

You need the AudioGenie3.dll (Beta 2.0.0.2) => http://www.audiogenie.de/en/download.htm

and this code => http://www.autohotkey.net/~toralf/AG3/AG3.ahk

All functions start with "AG3", except three functions which are general:
Code:
ATOU( ByRef Unicode, Ansi ) ; converts Ansi to Unicode (by SKAN)
UTOA( pUnicode )            ; converts Unicode to Ansi (by SKAN)
AscToHex(S){                ; converts ASCII to Hex (by Laszlo)


This is a Demo script. Place some mp3 files in the same directory or specify a path to some mp3 files
Code:
#NoEnv
#SingleInstance Force
SetBatchLines, -1
OnExit, Exit

;specify all ID3 text or URL frameIDs you are interested in (APIC will be added at the end automatically)
ListOfFrames = TALB,TIT1,TIT2,TIT3,TPE1,TPE2,TPE3,TPE4,TPOS,TRCK,TYER,COMM
Language = Eng                ;set language (DEU or ENG)
; FilePath := "X:\Artist A-Z\0-9\"   ;specify path to some mp3 files

#Include AG3.ahk          ;include AudioGenie3 wrapper
AG3_Init()                ;start AudioGenie3 und GDI+
AG3_LogFile("AG3.log")    ;set log file

;get list of files and add it to listbox
Loop, %FilePath%*.mp3               
  ListFileNames .= A_LoopFileName . "|"
Gui, 1:Add, ListBox, w200 r32 vLsbFileName gLsbFileName , %ListFileNames%

;create for each frameID a text field with description in specified language
;Plus a text field for the picture type
Loop, Parse, ListOfFrames, `,     
  {
    Option := A_Index = 1 ? "ym" : ""
    Gui, 1:Add, Text, %Option% vTxtFrame%A_LoopField%, % AG3_FrameIDName(A_LoopField, Language)
  }
Gui, 1:Add, Text, vTxtFrameAPIC, % AG3_PictureTypeName(3, Language)

;create for each frameID an ReadOnly edit control on GUI for the content of the FrameID
;Plus a picture control for the first picture
Loop, Parse, ListOfFrames, `,
  {
    Option := A_Index = 1 ? "ym" : ""
    Gui, 1:Add, Edit, %Option% w200 r1 vEdtFrame%A_LoopField% ReadOnly ,
  }
SS_BITMAP = 0xE
Gui, 1:Add, Picture, w100 h100 %SS_BITMAP% vPctAPIC HwndhPctAPIC,

Gui, 1:Show, AutoSize Restore, AudioGenie3 Wrapper Demo         ;show GUI
Return

;user selected a file in listbox
LsbFileName:
  Gui, 1:Submit,NoHide             ;get file name
  AG3_Open(FilePath LsbFileName)   ;open it with AudioGenie3
 
  Loop, Parse, ListOfFrames, `,    ;get content of all FrameIDs
    GuiControl, 1:, EdtFrame%A_LoopField%, % AG3_ID3TFrame(A_LoopField)
  If AG3_GetID3PictureCount(){     ;check if picture available
    AG3_ShowID3Picture(hPctAPIC, 1)   ;show picture and adjust picture type name
    GuiControl, 1:, TxtFrameAPIC, % AG3_PictureTypeName(AG3_GetID3PictureType(1), Language)
  }Else{
    AG3_ShowID3Picture(hPctAPIC)      ;remove any shown picture from control
    GuiControl, 1:Move, PctAPIC, W100 H100   ;resize control
    GuiControl, 1:, TxtFrameAPIC, % AG3_PictureTypeName(3, Language)  ;reset text info
  }
Return

Esc::
GuiClose:
Exit:
  AG3_Stop()    ;stop AudiGenie3 und GDI+
  ExitApp
Return


Screenshot of demo script
Image

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: wrapper
PostPosted: March 9th, 2010, 6:41 pm 
Thank you for this wrapper,
that´s exactly what I needed :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2010, 10:52 pm 
Offline

Joined: November 2nd, 2009, 7:03 am
Posts: 101
thanks for the effort you put into this -- good stuff!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2010, 1:38 pm 
Offline

Joined: September 13th, 2009, 2:34 pm
Posts: 30
Toralf, great work! This one doesn't work for me though.. It lists the MP3's but when I select one the ID3 tags aren't filled in on the left side?

Not really an issue as I was only interested in getting the Album and Artist values of the files so I can create some sort of ' auto sort mp3's according to Album and Artist ' but I don't see how I can get that information..

I saw a mention of AG3_Album([String]) but I don't know how to use it?

What I want to do is create a folder for the artist if it doesn't exist, create an album folder inside that if it doesn't exist and then copy over all the relevant files for that album.. Of course you don't need to help me with that but if you could give me some pointers as to how I can get the Artist and Album info that'be great!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2010, 10:49 pm 
is there a simple example
to select a mp3 file and audiogenie wright the duration in a text file?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2011, 8:42 am 
Offline

Joined: November 28th, 2005, 11:24 am
Posts: 89
Warning for users of window7

This wrapper requires the 32bit version of AHK.

If you run the Unicode version (which you can check with the command MsgBox % A_IsUnicode ? "Unicode" : "ANSI") then you need to download AHK_Basic.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2011, 8:28 am 
Offline

Joined: November 3rd, 2006, 11:45 pm
Posts: 61
Location: Miami
Hi everyone...
I've been trying for days to locate through Google the version of AudioGenie3.dll (v2.0.0.2) which seems to be the only one that has wrappers and examples created for it, but I cant seem to find it. The link provided does not work. I'm particularly interested because of the cover art that can be displayed for mp3's. I found AudioGenie3 but since it seems to be a different built it doesn't seem to work. Would anyone happen to have a copy of the 2.0.0.2 version mentioned, so as to try it out???


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2011, 1:25 pm 
Offline

Joined: November 28th, 2005, 11:24 am
Posts: 89
Send me a private message with your email address if you still need it.

However the current version of the AudioGenie3 should work fine as long as you:
- use the 32bit version of AHK
- make sure the dll is named the same way as in the script example


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Stigg, xXDarknessXx and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group