Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MAREO 2.0 Development (Read 63525 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MAREO 2.0 Development

Reply #25
I want to use MAREO to do the following:

1. Encode using MAC.EXE
2. Add EAC CUE file text as APEv2 tag "CUESHEET" to APE file
3. Create PAR2 files for APE file

However, my plan appears to fall down as TAG won't let me use the contents of a text/cue file as the value of a field.

Could MAREO let you pass results from EXEs to a variable, to be passed on to the next EXE? OR could MAREO just directly pass the contents of a text file as a paremeter?

e.g.:
Code: [Select]
; using an external app to load text into a MAREO variable
@myVariable@ = FILELOADER.EXE "CDImage.mac.cue"
... -t "CUESHEET=@myVariable@"

OR
Code: [Select]
; using a MAREO public method call to load text into a MAREO variable
@myVariable@ = LoadTextFile "CDImage.mac.cue"
... -t "CUESHEET=@myVariable@"

OR
Code: [Select]
; pointing to the contents of an external text file using the MAREO tag "externaltextfile"
... -t "CUESHEET=@externalfile=CDImage.mac.cue@"
I'm on a horse.

MAREO 2.0 Development

Reply #26
Quote
Could MAREO let you pass results from EXEs to a variable, to be passed on to the next EXE? OR could MAREO just directly pass the contents of a text file as a paremeter?


what do you mean by "results from EXEs"?

MAREO 2.0 Development

Reply #27
Quote
what do you mean by "results from EXEs"?

I guess I mean the stdout output, if I have my terminolgy right.

E.g.:

FILELOADER.EXE would load the (cue/text) file passed in the command line, and then write it to stdout.

Therefore:

Code: [Select]
@myVariable@ = FILELOADER.EXE "CDImage.mac.cue"

... would result in @myVariable@ containing the string of text contained in "CDImage.mac.cue".

I guess you may be confused by my post as it is my intention to use MAREO to run any EXE, and not necessarily an encoder.  Is this possible?  I basically want to use MAREO as a batch processor, to perform various related actions, but not multiple encodings, as I believe it was intended for.  I was hoping to call MAC.EXE, TAG.EXE and then PAR2.EXE - one encoder and two accompanying apps.

Personally, I think the nicest way to implement this would be to use the "externalfile" tag.  So that users can use:

Code: [Select]
@externalfile="CDImage.mac.cue"@

When MAREO parses the INI file it looks for any @externalfile@ tags, and loads the relevant file in place of the tag.

Any of these would help me out - but, more importantly, I would expect it to extend the possibilities of MAREO a great deal - for uses I can't yet imagine.

Anyway, as things stand it looks like I will be using MAREO in some way - so please let me take the opportunity to thank you for developing it.
I'm on a horse.

MAREO 2.0 Development

Reply #28
so you want mareo to read an external TXT file, after being generated by an "encoder" run, and load the value to a "variable" that can then be used by the subsequent (mareo) "encoder" runs?

edit: spell

MAREO 2.0 Development

Reply #29
Quote
I guess you may be confused by my post as it is my intention to use MAREO to run any EXE, and not necessarily an encoder.  Is this possible?  I basically want to use MAREO as a batch processor, to perform various related actions, but not multiple encodings, as I believe it was intended for.[a href="index.php?act=findpost&pid=234099"][{POST_SNAPBACK}][/a]

Have you considered Perl or WSH, depending on your platform?

-- Rick

----
[span style='font-size:8pt;line-height:100%']Moderation: removed long off-topic signature.[/span]
------- Rick -------
--------------------

 

MAREO 2.0 Development

Reply #30
now that mareo is the one at google rank i'm selling it to the highest bider  ....

no really ... thie weekend i would be releasing mareo 2.0 beta 1 ... i hoppe everybody is ready to test


multithreath won't be included at first

MAREO 2.0 Development

Reply #31
Quote
so you want mareo to read an external TXT file, after being generated by an "encoder" run, and load the value to a "variable" that can then be used by the subsequent (mareo) "encoder" runs?

Yes - although the external text file (not necessarily a .TXT) would not necessarily have been created as part of the mareo process - it may be:

  # a review that someone wants to add in a "REVIEWS" field
  # a detailed description of the enocoding process for a "COMMENTS" field
  # a recipe for mushroom soup that is relevant to an audio commentary

Although I think this would be very useful for cuesheets there must be hundreds of other possibilities - including some dynamically generated text files, like the EAC log file, or an encoder log file.

If you went with the variable idea (and not the @externaltextfile@ tag) then you could either:

1. set up a limited number of variables for users to use, e.g.: @variable1@, @variable2@, and @variable3@
2. as above but unlimited - so users can use @variable1@ -> @variableN@ - as long as it is prefixed with "variable"
3. let them define an unlimited amount of their own variable names - so when mareo encounters a value between two @ that it doesn't recognise, e.g.: "@myCueVar@",  it assumes that it is a user-defined variable.

Quote
Have you considered Perl or WSH, depending on your platform?

I have yes - and I will do if necessary (WSH, or a VB/VB.NET app) - but if kwanbis thinks this would be a useful addition to mareo then there's no need.  Easier for me - but in a utilitarian respect, better for every mareo user.

It may be worth pointing out my other thread on this topic.  I have used the opportunity of this thread to try to fulfil my needs - but if I don't get any joy from kwanbis or anyone else then I will set about writing my own.  The first problem I need to solve is how to pass CRLFs in a DOS command string!  As you might guess, it will be a slow process for me...
I'm on a horse.

MAREO 2.0 Development

Reply #32
i still don't quite get it .. if you can describe an example here please, i would be able to help ....

EDIT: reading your linked post ... but a simple example is allways good

MAREO 2.0 Development

Reply #33
You basically got it here:
Quote
so you want mareo to read an external TXT file, after being generated by an "encoder" run, and load the value to a "variable" that can then be used by the subsequent (mareo) "encoder" runs?

I want mareo to be able to load an external text file into a variable.  That variable can then be used within any subsequent action lines - so when the action line is parsed the variable will be replaced by the text it contains.

In my first post I basically suggested three methods of loading a text file - but let's save some confusion and go with option (2.): Using an internal mareo function/method to load the text into the variable.

Let's say the path to MAREO is "C:\DOS\mareo.exe".
I have a file in the same folder ("C:\DOS") called "myfile.txt".
"myfile.txt" contains one line of text, "Hello World!".

If we do:
Code: [Select]
@variable1@ = LoadExternalText("@ownpath@\myfile.txt")

First, the line parses to:
Code: [Select]
@variable1@ = LoadExternalText("C:\DOS\myfile.txt")

... then the LoadExternalText function executes, and returns the text from the file "C:\DOS\myfile.txt" - "Hello World!".

@variable1@ now contains the text "Hello World!"

If we then do:
Code: [Select]
ape NONE NONE "@ownpath@\tag.exe" -t "COMMENT=@variable1@"

... the line will be parsed to become:
Code: [Select]
ape NONE NONE "C:\DOS\tag.exe" -t "COMMENT=Hello World!"



A real-world example using method (2.) would be:

Code: [Select]
; load text from file using mareo's internal 'LoadExternalText' function, and store it in @variable1@
@variable1@ = LoadExternalText("@ownpath@\CDImage.ape.cue")
; TAG.EXE Action Line using @variable1@
ape NONE NONE "@ownpath@\tag.exe" -t "CUESHEET=@variable1@"


I don't really think I can explain it any better.
I'm on a horse.

MAREO 2.0 Development

Reply #34
that is what i thougt ... problem is ...if you pass a file with more than one line, what should i do? should i only load the first line to the variable?

MAREO 2.0 Development

Reply #35
Quote
that is what i thougt ... problem is ...if you pass a file with more than one line, what should i do? should i only load the first line to the variable?
[a href="index.php?act=findpost&pid=234628"][{POST_SNAPBACK}][/a]

or strip linebreaks first, maybe

MAREO 2.0 Development

Reply #36
Quote
that is what i thougt ... problem is ...if you pass a file with more than one line, what should i do? should i only load the first line to the variable?
[a href="index.php?act=findpost&pid=234628"][{POST_SNAPBACK}][/a]
No, otherwise it wouldn't work for cuesheets - or a lot of other files.  You will need to read the whole file.

Can you pass a parameter with line breaks to a command line application?  I've been searching the Internet and can't see how.  I've tried all sorts, including "\r\n", "^", "$_" - all with no joy.

If you can't pass a parameter that contains line breaks then there's not much point in implementing it...
I'm on a horse.

MAREO 2.0 Development

Reply #37
exactly ... that is why i'm asking ... AFAIK you can't pass lines to apps ... unless the app knows how to handle them ... like using some spetial separator or something ... but maybe the app you want does allows you to do so ... that is why i'm asking

MAREO 2.0 Development

Reply #38
Damn, that's scuppered it.

Ok, very sorry to have wasted your time kwanbis.

I look forward to seeing mareo version 2.
I'm on a horse.

MAREO 2.0 Development

Reply #39
Quote
exactly ... that is why i'm asking ... AFAIK you can't pass lines to apps ... unless the app knows how to handle them ... like using some spetial separator or something ... but maybe the app you want does allows you to do so ... that is why i'm asking [a href="index.php?act=findpost&pid=234683"][{POST_SNAPBACK}][/a]

The key there is "unless the app knows how to handle them," so unless the app in question knows how to handle stdin -- which would imply handling linebreaks -- you're out of luck.

I remember this used to be a big problem with 'make.'  If the command line options got to be too big for a DOS command line (128 chars?) they would get cut off.  One solution was to write the output to a text file and then pass the name of that text file to make with an @-sign appended to the front.  I don't know whether that was a DOS thing, or a specific make-program thing...

-- Rick

----
[span style='font-size:8pt;line-height:100%']Moderation: removed long off-topic signature.[/span]
------- Rick -------
--------------------

MAREO 2.0 Development

Reply #40
Quote
exactly ... that is why i'm asking ... AFAIK you can't pass lines to apps ... unless the app knows how to handle them ... like using some spetial separator or something ... but maybe the app you want does allows you to do so ... that is why i'm asking [a href="index.php?act=findpost&pid=234683"][{POST_SNAPBACK}][/a]
I just tried it, and with a simple test application I had no trouble passing a newline on the commandline programmatically. So it would be possible to read a file and pass it on the commandline along with the newlines.
I'm currently trying to create a more elaborate example.

MAREO 2.0 Development

Reply #41
I created a relatively small example program in C that takes two arguments, a program to be executed and a file containing the commandline parameters (in reverse order, so first the commandline parameters file and then the program). The format of the commandline parameters file is very simple, each line is treated as a single argument, \n is replaced with CRLF (it would be better to replace it with just LF and also provide \r if needed).
The executable can be downloaded from:
http://home.hccnet.nl/th.v.d.gronde/runner.exe
The source:
http://home.hccnet.nl/th.v.d.gronde/runner.c

It's by no means meant to be a usefull program, it's just meant as an illustration that it is in fact possible to pass newlines in a parameter. The Windows 32KB limit still applies though (the total length of the parameters, including separating spaces, can't exceed 32KB), as far as I know at least, I haven't tested it.

To test it I ran the following (from the Visual Studio IDE):
Code: [Select]
runner d:\temp\cmdline.txt "C:\Program Files\Tagger\tag"

The cmdline.txt file was as follows:
Code: [Select]
--comment
Line1\nLine2
D:\Audio2\001_008 - Good Times, Bad Times - 2004-02-13 11.13.40.ogg

This worked (afterwards tag would properly show the multiline comment when asked to display the tag of the file), except that for some reason tag complained about not finding a certain file, I have no idea why it did that.

I also have a small program available that will simply print out the arguments it received for testing purposes:
http://home.hccnet.nl/th.v.d.gronde/runned.c
A compiled version is available from:
http://home.hccnet.nl/th.v.d.gronde/runned.exe

EDIT: One thing I forgot to mention is that I surround each argument by double quotes (") so it won't separate the arguments at spaces, as for some reason it would still do that even though I pass the arguments as an array of strings (apparently it concatenates them and then parses them like a normal commandline). They are not needed for the newlines btw.

MAREO 2.0 Development

Reply #42
Hi kwanbis,

Any news on the release of MAREO 2.0?  If it's not finished, is there a beta we can play with yet?

MAREO 2.0 Development

Reply #43
well ... beta 1 s progrssing fine ... (i'm implmenting all the sugestions, and trying to fix all previous problems) ... its almost done, but some real life problems forbid me from releasing ... i'm also studing some multithreaded code to implement in 2.0 final ... i would try to finish it this week

MAREO 2.0 Development

Reply #44
ok then ... here it is ... "RC1" ... i havent even updated the docs ... pay attention to the new ini file:

EXT: the string that identifies the encoded files extension (ogg, mp3, mpc). You can use NONE to run pre-processing apps (like wavegain).

PATH: here you can set a different path where MAREO would put the encoded file of the specific encoder. It must be a fully qualified Path Name. Also, instead of spaces, use the _. It is ignored for the first encoder Action Line, cause EAC and CDex like to rename the files themselves.

ENCODER: the encoder location and file name.

PARAMETERS: this is the real command that MAREO would execute, after replacing all the LITERALS with the correspongin values.

EXT = mp3
PATH = NONE
ENCODER = c:\EAC\lame.exe
PARAMETERS = --alt-preset standard -Z --ta "@artist@" --tl "@cdname@" --tt "@songname@" --tn "@track@" --ty "@year@" --tg "@genre@" --tc "EAC+LAME -alt-pre-standard-Z" "@source@" "@dest@"

MAREO home page

MAREO 2.0 Development

Reply #45
the fisrt parametter thath should be passed with EAC/CDex to mareo is the ini file like in "mareo.ini xxxxxx"

MAREO 2.0 Development

Reply #46
Thanks Kwanbis for RC1.  Unfortunately I am having trouble getting this to work with an encoder line that doesn't actually do anything other than renamed as discussed earlier in the thread:

Quote
Quote
This is a bit messy.  So would it be possible to enhance MAREO so it can take NONE as the CommandToRunWithParameters (ie. the fourth item in an action line)?

you bet
[a href="index.php?act=findpost&pid=215658"][{POST_SNAPBACK}][/a]

In my new ini file I have the following lines:
Code: [Select]
EXT = ofc
PATH = NONE
ENCODER = NONE
PARAMETERS = NONE

This follows a line where the wav file is encoded using OptimFrog DualStream with the --correction option which creates both an ofs and ofc file where the filename is EAC's temporary name.  EAC will rename the ofs file itself, but I want MAREO to rename the ofc file to the true filename.

I find that the above generates the error "EXECUTING: NONE NONE.... *ERROR*!".

If I try changing the lines to
Code: [Select]
EXT = ofc
PATH = NONE
ENCODER =
PARAMETERS =
or removing the ENCODER and PARAMETER lines completely then MAREO completely ignores this second encoder step.

I would be very grateful if you would tell me what I am doing wrong.

MAREO 2.0 Development

Reply #47
In addition to the above, there is a second problem which is that the rename fails because for some reason I can't understand it is appending -2 to the TMP Dest.  For example:

Code: [Select]
*** PROCESSING ENCODER ORDER # 1 ***
.....
TMP Dest Full Name = .....\Rtmp58-!).ofs
.....
*** PROCESSING ENCODER ORDER # 2 ***
.....
TMP Dest Full Name = .....\Rtmp58-!)-2.ofc


But the ofc file is actually generated by "encoder order 1" and is therefore named Rtmp58-!).ofc.  There is not such file as Rtmp58-!)-2.ofc.

Where is this "-2" coming from?

Thanks for your help.

MAREO 2.0 Development

Reply #48
Is there any way to get the final file name in mareo (excluding extension)?

I was wondering whether you could use:

Code: [Select]
EXT = NONE
PATH = NONE
ENCODER = CMD.EXE
PARAMETERS = /C REN "@pathonly@/@nameonly@.*" "<finalname>.*"

This would would rename any file with the temporary name (@nameonly@) to <finalname>, irrespective of file extension (i.e.: it could be implemented for WavPack users also).

If there were a mareo variable for the final name then this could work - if you are running Win2K, NT or XP.


Alternatively, and I guess this is what you are more after, it should be easy enough for mareo to run a command at the end to rename any temporary files to the final name.

[edit]Added final sentence, as I seem to have missed the point a little...[/edit]
I'm on a horse.

MAREO 2.0 Development

Reply #49
Quote
This follows a line where the wav file is encoded using OptimFrog DualStream with the --correction option which creates both an ofs and ofc file where the filename is EAC's temporary name.  EAC will rename the ofs file itself, but I want MAREO to rename the ofc file to the true filename.

I find that the above generates the error "EXECUTING: NONE NONE.... *ERROR*!".


Quote
In addition to the above, there is a second problem which is that the rename fails because for some reason I can't understand it is appending -2 to the TMP Dest.[/code]


Quote
Alternatively, and I guess this is what you are more after, it should be easy enough for mareo to run a command at the end to rename any temporary files to the final name.


ok ... now it looks like it is working ... i have simulated optimfrog (i created the temporal .ofc file before calling mareo) and it looks to be working ok ...

here is my ini text (note that i'm really using LAME to make the files, but should be the same):
EXT = mp3
PATH = NONE
ENCODER = c:\EAC\lame.exe
PARAMETERS = --alt-preset standard -Z --ta "@artist@" --tl "@cdname@" --tt "@songname@" --tn "@track@" --ty "@year@" --tg "@genre@" --tc "EAC+LAME -alt-pre-standard-Z" "@source@" "@dest@"
;
EXT = ofc
PATH = c:\EAC\kk
ENCODER = NONE
PARAMETERS = NONE

i just uploaded MAREO RC2 then ... still no updated docs 

EDIT: just downloaded OptimFROG_DualStream_Win32_4509 and i tried with a real INI setting:

EXT = ofs
PATH = NONE
ENCODER = ofs.exe
PARAMETERS = --correction @source@
;
EXT = ofc
PATH = NONE
ENCODER = NONE
PARAMETERS = NONE

IT WORKS!