IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

> user defined variables
rmg
post Aug 9 2005, 15:21
Post #1


Member


Group: Full Members
Posts: 10
Joined: 2-August 05
Member No.: 2006
Mp3tag Version: 2.32a



Hi

I'm trying to do smth like an avergage bitrate over a catalog. I tried looping all the mp3s and adding their bitrates to one variable, but if I want to display the result after the loop, the variable is empty? sad.gif How to accomplish this task?
How to globalize the variable?

Next, I want to display certain information if the bitrate is VBR and other info if it's CBR. The question is, how to check if it's CBR or VBR?

Thanks in advance
rmg
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 7)
dano
post Aug 9 2005, 15:40
Post #2


Moderator


Group: Moderators
Posts: 5691
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



1.
My html_dano_01_ex_mp3tag config has an average bitrate calculation.
http://forums.mp3tag.de/index.php?showtopic=1563

2.
%_vbr%


--------------------
Go to the top of the page
 
+Quote Post
rmg
post Aug 9 2005, 16:05
Post #3


Member


Group: Full Members
Posts: 10
Joined: 2-August 05
Member No.: 2006
Mp3tag Version: 2.32a



Oh, thx for the average bitrate calculator. It works.

%_vbr% prints CBR or VBR for mp3, but how to make a conditional sentence for checking it. Like $if(%_vbr%==CBR,then,else)<-this one doesn't work.
Go to the top of the page
 
+Quote Post
dano
post Aug 9 2005, 16:14
Post #4


Moderator


Group: Moderators
Posts: 5691
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



$if($eql(%_vbr%,CBR),then,else) I think.
See the help file for more information.


--------------------
Go to the top of the page
 
+Quote Post
rmg
post Aug 9 2005, 19:07
Post #5


Member


Group: Full Members
Posts: 10
Joined: 2-August 05
Member No.: 2006
Mp3tag Version: 2.32a



Ok, now I can check the CBR/VBR status, but a new problem occured sad.gif

I loop through the mp3 file sizes and measure their length. What I'd want to do is to get the longest length in a variable, but somehow it doesn't seem to work.

The code I use:
$loop(%_filename_ext%)$iflonger(%_file_size%,$get(length),$puts(length,$len(%_file_size%)),)$loopend()get(length)

The results are 7,7,7,7,7,7,7,8,7,7, but the variable somehow remembers the 7 and not the 8, at least when I try to use it outside the loop. Please tell me what am I missing here?

This post has been edited by rmg: Aug 9 2005, 19:08
Go to the top of the page
 
+Quote Post
dano
post Aug 9 2005, 21:41
Post #6


Moderator


Group: Moderators
Posts: 5691
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



Try:
$loop(%_filename_ext%)$puts(length,$iflonger(%_file_size%,$get(length),$len(%_file_size%),$get(length)))$loopend()
$get(length)

This should be ok.

This post has been edited by dano: Aug 9 2005, 22:15


--------------------
Go to the top of the page
 
+Quote Post
rmg
post Aug 10 2005, 12:37
Post #7


Member


Group: Full Members
Posts: 10
Joined: 2-August 05
Member No.: 2006
Mp3tag Version: 2.32a



QUOTE (dano @ Aug 9 2005, 23:41)
Try:
$loop(%_filename_ext%)$puts(length,$iflonger(%_file_size%,$get(length),$len(%_file_size%),$get(length)))$loopend()
$get(length)

This should be ok.
*


Thanks, this piece of code works.
But still, what is the big difference between these two codes?
Go to the top of the page
 
+Quote Post
dano
post Aug 10 2005, 13:26
Post #8


Moderator


Group: Moderators
Posts: 5691
Joined: 4-September 03
From: Germany
Member No.: 201
Mp3tag Version: 2.65a



QUOTE
But still, what is the big difference between these two codes?

I leave that to Florian to explain tongue.gif
It has some thing to do with the order of the code evaluation but I can't really explain it.


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2014 - 03:22