Re: LibZPlay wrapper (updated)
Posted: Tue Jul 23, 2013 1:24 pm
Dirty but working... Well, I'll use that.
thanks :D
thanks :D
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
EnableExplicit
XIncludeFile "libzplay.pbi"
Define hZPlay, File.s, Text.s
Define ID3.TID3infoexW
File = OpenFileRequester("Please select a ogg-file", "*.mp3", "mp3|*.mp3", 0)
If File
hZPlay = CreateZPlay()
If hZPlay
If zplay_OpenFile(hZPlay, File, #sfAutodetect)
If zplay_LoadFileID3exW(hZPlay, File,#sfAutodetect, #id3Version2, @ID3,#False)
zplay_Play(hZPlay)
Text = "Title: " + id3\Title + #LF$
Text + "from album: " + id3\Album + #LF$
Text + "from year: " + id3\Year + #LF$ + #LF$
Text + "Press okay to stop music"
MessageRequester("Test libzplay", Text)
EndIf
EndIf
zplay_Close(hZPlay)
zplay_DestroyZPlay(hZPlay)
EndIf
EndIf
Code: Select all
zplay_LoadFileID3ExW(hZPlay,pchFileName.p-Unicode, nFormat, nId3Version, *pId3Info.TID3InfoW, fDecodeEmbededPicture)
Code: Select all
zplay_LoadFileID3ExW(hZPlay,pchFileName.p-Unicode, nFormat, nId3Version, *pId3Info.TID3InfoExW, fDecodeEmbededPicture)
Code: Select all
typedef struct {
wchar_t *Title;
wchar_t *Artist;
wchar_t *Album;
wchar_t *Year;
wchar_t *Comment;
wchar_t *TrackNum;
wchar_t *Genre;
wchar_t *AlbumArtist;
wchar_t *Composer;
wchar_t *OriginalArtist;
wchar_t *Copyright;
wchar_t *URL;
wchar_t *Encoder;
wchar_t *Publisher;
unsigned int BPM;
TID3PictureW Picture;
char reserved[128];
} TID3InfoExW;
Code: Select all
Structure TID3InfoExW
Title.s
Artist.s
Album.s
Year.s
Comment.s
TrackNum.s
Genre.s
AlbumArtist.s
Composer.s
OriginalArtist.s
Copyright.s
URL.s
Encoder.s
Publisher.s
BPM.l
Picture.TID3PictureW
reserved.u[128]
EndStructure