From dos4gw Tue Oct 24 00:46:44 2000
Return-Path: <gnometoaster-admin@lists.kando.hu>
X-Flags: 0000
Delivered-To: GMX delivery to a.eckleder@gmx.de
Received: (qmail 17233 invoked by uid 0); 23 Oct 2000 22:29:23 -0000
Received: from bflitemail6.bigfoot.com (HELO bigfoot.com) (208.156.39.208)
  by mx06.rz2.gmx.net with SMTP; 23 Oct 2000 22:29:23 -0000
Received: from oberon.jozsef.kando.hu ([193.224.40.5])
	by BFLITEMAIL1.bigfoot.com (LiteMail v2.42(BFLITEMAIL1)) with SMTP id 23Oct2000_BFLITEMAIL1_38803_54103537;
	Mon, 23 Oct 2000 18:32:36 -0400 EST
Received: from localhost ([127.0.0.1] helo=oberon.jozsef.kando.hu)
	by oberon.jozsef.kando.hu with esmtp (Exim 3.12 #1 (Debian))
	id 13nq5I-0000Ad-00; Tue, 24 Oct 2000 00:28:49 +0200
Received: from a8cd0.pppool.de
	([213.6.140.208] helo=hex.home.net ident=root)
	by oberon.jozsef.kando.hu with esmtp (Exim 3.12 #1 (Debian))
	for gnometoaster@lists.kando.hu
	id 13nq5C-0000AI-00; Tue, 24 Oct 2000 00:28:42 +0200
Received: by inn-salzach.de
	via sendmail from stdin
	id <m13nqG2-001j5eC@hex.home.net> (Debian Smail3.2.0.102)
	for gnometoaster@lists.kando.hu; Tue, 24 Oct 2000 00:39:54 +0200 (CEST) 
Date: Tue, 24 Oct 2000 00:39:54 +0200
From: Andreas Eckleder <A.Eckleder@bigfoot.com>
To: gnometoaster@lists.kando.hu
Subject: Re: [Gnometoaster] Adding a new file type?
Message-ID: <20001024003954.A418@inn-salzach.de>
References: <20001023121249.A7424@tela.bklyn.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0i
In-Reply-To: <20001023121249.A7424@tela.bklyn.org>; from cae@home.com on Mon, Oct 23, 2000 at 12:12:49PM -0400
Reply-To: gnometoaster@lists.kando.hu
Sender: gnometoaster-admin@lists.kando.hu
Errors-To: gnometoaster-admin@lists.kando.hu
X-Mailman-Version: 1.1
Precedence: bulk
List-Id: Gnometoaster development and announcements <gnometoaster.lists.kando.hu>
X-BeenThere: gnometoaster@lists.kando.hu
Status: RO
X-Status: A
Content-Length: 4403
Lines: 89

On Mon, Oct 23, 2000 at 12:12:49PM -0400, Caleb Epstein wrote:

> 	Basically, the length of the file can only be divined by
> 	extracting it and reading the WAVE header (there is no fixed
> 	WAV -> SHN compression ratio).  Is it possible to get gtoaster
> 	to read the WAV header from the output stream of the
> 	extraction command?  Or should I look into writing the C code
> 	for $shn_len which will do this in the gtoaster application
> 	itself?
Unfortunately, I haven't had time to document Gnometoaster's filesystem
registry much.
1) I figure that your shorten decoder delivers it's uncompressed stream in
.wav format ? This will create a slight click noise at the beginning of a
track as the wav header will be written to the cd. Try to convince your
shorten player to output raw data (just as it would be sent to the soundcard).
2) about filesizes: you can use an external program for that
(i could imagine there'd be some program capable of computing the playing 
time of a shorten file and output it to stdout some or the other way).
To do so, enter the call to the program with the placeholder $filename 
where the filename to be examined would normally go into the 
"Detect tracksize with" column of your shorten entry in gnometoaster's
filetype registry. You can then use the next column to describe what to do
with the "tracksize detector"'s output.
you can get a number within the output of your tool with the getpos(<y>,<x>)
which will get the x-th *value* (counting from 0) in line y (from 0).
This means that if your tool would output the following:

Sample Shorten Tracklength generator (c) 2000 by veryInsaneProgrammers
   - This is GPL software. See LICENSE for further details -
Processing file: /home/dos4gw/something.shn
Calculated tracklength is: 02:34

you could calculate the playing time in seconds with
getpos(3,1)*60+getpos(3,2)
and consequently the tracklength in bytes (which is the required 
value for GnomeToaster)
(getpos(3,1)*60+getpos(3,2))*44100*4

All you'd hence have to do is to enter the aforementioned function
into the field described above and Gnometoaster would now know how to
calculate the tracksize of your file.

Sometimes, output of a ts calculation tool will not be as clear as in the
example above. Especially if the output contains the filename and
the playing time within the same line, the getpos(<y>,<x>) function
may not be able to find the right number (e.g. if your filename itself
contains a number).In this case you can use the (more complicated) regexp
function provided by Gnometoaster.
In the example above, you'd use it instead of the getpos() functions.
the regexp() function takes a string in double-quotes as it's argument.
The first "result" of your regexp will be returned as the result of the
function. Note that regexp("string") will return as string itself so you
have to pass the result of regexp("string") to the strval() function
which will then convert the string to a number like
strval(regexp("An important number: ([0..9]*)")).

I hope this clears things up a bit. As you can see, you'll most probably
be able to implement your filetype handler without having to
make modifications to the Gnometoaster source code
(which will of course still be an option).
Please don't ask why I implemented this sort of an extensive function
parser for a *cd recording application*. It was just coming
naturally and has been improved continuosly ever since it was introduced.

One last remark about a *very* quick and dirty solution:
If you're not that keen on on-the-fly writing, you can come around all 
those tracksize calculation hassles by simply turning the "PC" (or precaching
flag) on for that particular filetype. Gnometoaster will then always 
precache this file before writing it to the cd. As soon as a file has been
precached, Gnometoaster knows about the final size of the resulting track no
matter what the detection routine said about it.
> 	BTW, I'm using the latest CVS version, 20001021, thanks to
> 	Wichert for keeping the debian directory up to date, and
Has there been a new package release ? This would be great news!
> 	thanks to the developers of gtoaster for such a fantastic
> 	application.
I'm doing what I can .-)

Andy


-- 
Chicken Little was right.


_______________________________________________
Gnometoaster mailing list
Gnometoaster@lists.kando.hu
http://lists.kando.hu/mailman/listinfo/gnometoaster

