mIRC Home    About    Download    Register    News    Help

Print Thread
#35268 10/07/03 02:34 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
is it possible to put into a dialog the position of an mp3, but it actually count, when i do it it just comes up with 0:00 and that is it

Last edited by andymps; 10/07/03 02:36 AM.

Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#35269 10/07/03 02:38 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
$gmt($calc($insound.pos / 1000),nn:ss)

If the mp3 should be greater than 1 hour, you will want:
$gmt($calc($insound.pos / 1000),H:nn:ss)

This is a hacky use of $gmt, as it's really suppose to display the time of day at Greenwich Mean Time... but happens to work nicely when you want to format hours:minutes:seconds.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#35270 10/07/03 02:40 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
thnx smile


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#35271 10/07/03 02:43 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
ok that displays it but i want it to actually count with the position, is it possible
?


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#35272 10/07/03 02:58 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
You would need some sort of an event to fire that will frequently update this information. I'm guessing then you want to set up a /timer that updates the display every second.

Example:
/.timerMP3DISP 0 1 Titlebar MP3( $+ $gmt($calc($insound.pos / 1000),nn:ss) $+ )

This is an example of a Timer named MP3DISP that updates the Titlebar of miRC every 1 second, an infinite number of times.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#35273 10/07/03 03:03 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
ok the sooo would this work
Code:
  /.timermpos 0 1 did -a Mp3_dialog 8 $gmt($calc($insong.pos / 1000),nn:ss)


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#35274 10/07/03 03:09 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Give it a whirl. smile

Actually, I would put the code inside an Alias, and even add checking to make sure the Dialog exists before issuing a /did.

But yes, that ought to do the trick.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#35275 10/07/03 03:15 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
hmmm, i did that and it is stopped on 0:00


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#35276 10/07/03 05:40 AM
Joined: Apr 2003
Posts: 6
C
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
C
Joined: Apr 2003
Posts: 6
Code:
alias updatesong {
  if (%updatesong == 1) {
    set %song.pos $gmt($round($calc($insong.pos / 1000),0),n:ss)
    .timer 1 1 did -i <dialogname> <id> 1 %song.pos
    .timer 1 1 /updatesong
  }
  else { halt }
}


just make sure you put

on *:DIALOG:<dialogname>:init:0:{
set %updatesong 1
/updatesong
}

It works for me

Coca-Bear

#35277 10/07/03 07:03 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
alias posupdate {
did -a <name> <id> $asctime($calc($inmp3.pos / 1000),n:ss)
}
then in you on dialog event: /timer $calc($inmp3.length / 1000) 1 /posupdate


new username: tidy_trax

Link Copied to Clipboard