[release] iTunes Info DLL for mIRC scripts

Since mIRC scripts can't read the new CurrentTrack.txt file because it's Unicode now, I've created this little DLL to get information about the current track from iTunes.

The DLL should be placed in the same folder with the script.

You use it in the script the following way:

$dll(mIRC_iTunes.dll, GetInfo, *INFOSTRING*)

The value of that will be the string pointed by *INFOSTRING* formatted with the requested data, if it is available.

the *INFOSTRING* is a string without quotes, which uses the following formatting tags

:

!Playlist - The play list that the track is in

!Album

!Artist

!Name

!Genre

!Grouping

!Composer

!DiscCount

!DiscNumber

!Position - The player's position within the currently playing track (valid only for the main window title)

!Duration

!TimeLeft - The time left for the track to play (valid only for the main window title)

!PlayCount

!Rating

!TrackCount

!TrackNumber

!Year

!BitRate

!SampleRate

!Kind - The file type of the track.

Download it here

#289130

works GREAT!

Thanks ever so much ^_^

#289161

That sounds nice.. alas I don't use mIRC... just a thought though, can this DLL be used by some other app.. I mean to get info of iTunes... ?

#289164

Most programs will read the CurrentTrack.txt fine. The problem I was having is because mIRC doesnt support unicode. You should be able to pull off info from the text file very easily into other programs.

Below is my full mIRC script to work with this plugin. Feel free to modify or whatever

; ##############################################

; # Matt Sims' iTunes Now Playing Script v.0.4 #

; # My first attempt at a proper mIRC script #

; # Works with the iTunes Multi-Plugin #

; # Needs the mIRC_iTunes.dll to work #

; # Copyright Matt Sims (c) 2005 #

; # www.mattsims.com mattsims@evilmerc.com #

; ##############################################





; You use it in the script the following way:

; $dll(mIRC_iTunes.dll, GetInfo, *INFOSTRING*)

; The value of that will be the string pointed by *INFOSTRING* formatted with the requested data, if it is available.

; the *INFOSTRING* is a string without quotes, which uses the following formatting tags

; !Playlist - The play list that the track is in

; !Album

; !Artist

; !Name - Song name

; !Genre

; !Grouping

; !Composer

; !DiscCount

; !DiscNumber

; !Position - The player's position within the currently playing track

; !Duration

; !TimeLeft - The time left for the track to play

; !PlayCount

; !Rating

; !TrackCount

; !TrackNumber

; !Year

; !BitRate

; !SampleRate

; !Kind - The file type of the track.



; ##############################################



; BEGIN Now playing alias



alias np {



%details = ( $+ !Album $+ , !Genre $+ , !Year $+ , !BitRate $+ kbps, !TimeLeft $+ )



if (%np.extended == on) {

/say $dll(mIRC_iTunes.dll, GetInfo, [Now Playing] !Artist - !Name %details)

}

else {

/say $dll(mIRC_iTunes.dll, GetInfo, [Now Playing] !Artist - !Name)

}



}



; END Now playing alias



; ##############################################



; BEGIN Right Click menu controls



menu status,channel,query,nicklist,menu,chat {

.-

.iTunes Now playing:/np

.iTunes Controls

.Play/Pause:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,PlayPause,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}

.< Previous:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,PreviousTrack,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}

.> Next:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,NextTrack,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}

.Advanced Controls

..Open iTunes:run itunes



..Close iTunes:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,Quit,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}

..iTunes Control Panel:/dialog -mdieo iPanel iPanel



.Contact Matt Sims:run http://www.mattsims.com/page.php?page=contact

}



; END Right Click menu controls



; ##############################################



; BEGIN Control Panel



dialog iPanel {

title "iTunes Control Panel"

size -1 -1 184 40

option pixels



button "< prev", 1, 0 0 40 20, push

button "play/pause", 2, 40 0 70 20, push

button "stop", 3, 110 0 30 20, push

button "next >", 4, 140 0 44 20, push

button details in output: %np.extended, 5, 0 20 184 20, push

}



on *:DIALOG:iPanel:SCLICK:1:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,PreviousTrack,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}



on *:DIALOG:iPanel:SCLICK:2:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,PlayPause,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}



}



on *:DIALOG:iPanel:SCLICK:3:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,Stop,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}



on *:DIALOG:iPanel:SCLICK:4:{

if (!$com(itunes)) {

/comopen itunes iTunes.Application

}

%com.result = $com(itunes,NextTrack,3)

if (%com.result==0) {

echo -a Error: Make sure iTunes is open.

}

}





on *:DIALOG:iPanel:SCLICK:5:{

if (%np.extended == on) {

%np.extended = off

/did -r iPanel 5

/did -a iPanel 5 details in output: %np.extended

}

else {

%np.extended = on

/did -r iPanel 5

/did -a iPanel 5 details in output: %np.extended

}

}



on *:DIALOG:iPanel:close:*:{

if ($com(itunes)) {

/comclose itunes

}

}



; END Control Panel



; ################# END SCRIPT #################

#289171

That sounds nice.. alas I don't use mIRC... just a thought though, can this DLL be used by some other app.. I mean to get info of iTunes... ?

You can use it in any C/C++ app and probably VB, but why, when you can directly access iTunes through COM.

#289199

when you can directly access iTunes through COM.

Ooops... sorry !!!

Now why didn't I thought of it?? hmmm... I think I need to think like programmer than graphics artist while posting things like this.... :D

#289299