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: simple request -> copy original file to dir (Read 5877 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

simple request -> copy original file to dir

This seems a fairly easy request to be filled, and i think it might be handy for a lot of people..

What I do, is load a WHOLE bunch of new music into fb2k and then let it play randomly through it while i work and everytime i find a song i really like i use the diskwriter to just write a wav to one specific dir.. then once in a while i check that dir and burn a new audio cd

now, this is handy, but i would actually prefer being able to do this with the original file.. i have a lot of files in rar's and can't be arsed to look through all those files to extract that specific one i want.. if i could just have a copy option which does all that for me without changing the format that would be great.. then i can still do proper mp3gaining, etc on the mp3 itself.. and if necessary convert it to wav later..

either an extra diskwriter feature which does a direct copy or an extra right-click option, copy to dir... would be very handy..

what do you think?
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #1
Quote
what do you think?
I think it would be a very useful plugin, but I guess that's because I requested the exact same thing a while ago...

It sounds very simple, but nobody with the required programming skills seems to be interested. I hope someone will pick up on it this time though 

simple request -> copy original file to dir

Reply #2
The renamer has been able to do this for some time (about a year i think).

simple request -> copy original file to dir

Reply #3
Quote
The renamer has been able to do this for some time (about a year i think).

Are you talking about move or copy? If you are talking about the latter, could you please elaborate? 

simple request -> copy original file to dir

Reply #4
I think Mike was talking about move, but in the present case i guess foobar doesn't repack the archive to substract the moved file.

Edit: tested within a rar archive, foobar simply refuses to move the file ("Error renaming file").

simple request -> copy original file to dir

Reply #5
Sorry assumed it worked in rars.  As it stands the renamer can only move, not copy.  I thought you wanted a way to remove a file from one place and put it somewhere else.

Any reason your current methiod is working then?  If you're burning CD audio then you need to decode to wav anyway.  Whats the point of copying MP3s (or am i still confused?)

Anyway what i generally do is copy songs to a playlist, then once i have a large enough playlist i have foobar burn them for me so that everything is replaygained.

simple request -> copy original file to dir

Reply #6
while i am waiting for this feature to be implemented  , i am using the solution described here:

http://www.hydrogenaudio.org/forums/index....ndpost&p=149280

what i do, i use the send to pl pluggin with a hotkey.  send a bunch of file to a pl, use the copy command, run the batch file.  afa the replay gain, i use Mp3Gain on the copied files.

what i think would be best would be to have 'Explorer' on the context menu.  under that option would be everything that you have set up on your puter for that file type: copy, cut paste, delete, send to, etc.  it would be as if you right clicked the file in explorer.

simple request -> copy original file to dir

Reply #7
well i only burn all those audio cd's because i want my favourite music in my discman the whole time, but i would also just like having 1 dir with all my favourite songs on my hdd.. if i have to convert every song to wav it would eat up quite a lot of extra space since the file is about 10x as big than the original mp3..

and i do NOT want to move the files out of the rar's.. it is vital that they stay in there so that the hash of the files stays the same..

@juglesh, yes that seems to be a slight better way of doing it, but it's still a big hassle.. it should just be implemented into the menu.. maybe i can find a diskwriter plugin which does it..
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #8
nope no diskwriter plugin which does this either...



and this way of copying only works if the files are not in a rar files.. it might work with zip files though.. but i don't have any of those...
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #9
I'm still confused.  Why can't you just create a playlist and burn that with foobar, Nero or whatever?

simple request -> copy original file to dir

Reply #10
because it is not my wish to burn the files...

i wish to share them with friends...

i just gave an example of what i use the diskwriter for now, because that also works in a way that i can put all my new favourite songs into one dir, but the files are of course huge because they have been decompressed.. this is fine for making cd's but not if you want to leave them on your harddrive for months

so i just want an option which takes the file and copies it to a directory i have specified... that is all...  if the diskwriter can take the mp3 out of a rar file, re/decompress it and then put it in a dir, this should be dead-easy to do without any changes to the original file... just extract to dir... easy..

if i knew C i would code it myself... I really, really need this functionality..

this is also a great way for making playlists for say DJ-ing software, or your streaming-server... so you have all your favourite songs in one dir.... to me this all makes perfect sense...
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #11
* bump *

sorry, but i still think this topic needs some more attention...

it's sooooo simple.. why can't anyone just quickly code it?
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #12
Try this sequence for the "copy command" title formatting, copy the selected files with the context manu command, paste the contents into a .bat file and execute.
You can edit the destination folder name, if you wish.

Code: [Select]
$puts(destination,'C:\temp3')
$ansi(
'@'
'if not exist' '"'$get(destination)'" '
'md' '"'$get(destination)'"'
$crlf()
'@'
'copy' '"'%_path%'"' '"'$get(destination)\'"'
)


Somehow this does not work with some accented characters ($ansi should have fixed this, no?) or compressed files, sorry...Ideas?

[edit]And I don't think this copying stuff would be possible with the diskwriter component, as I see in the code, it gets the already decoded audio chunks, though I'm not sure about this[/edit]

[span style='font-size:8pt;line-height:100%']Yeah, and if this blows up your computer, it's your fault [/span]
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #13
thanks for the piece of code, but i already have something like that, which, just like your version, does not work out of archives... and this is the only filetype i'm playing out of... all my albums are rarred to save up on amount of files on my harddrive due to various reasons...

hmmm... and i understand what you mean by that the diskwriter might not be able to do it.. if it decodes first then yes we have a problem...

might it be possible to use the unpack:// command from foobar in that copy script you just pasted?? that might actually make it work for archives too then..

actually if someone can point me to the file(s) i would have to edit to make this functionality i would be happy to mess around with it myself to try and get it to work...... if noone else wants to try i'll keep on trying myself.. how hard can c++ be.. already checked the SDK and it's pretty straightforward if you ask me..
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #14
Maybe you can accomplish this by some $if's in the "copy command" part, and some command line unpackers in path.
So as you can "guess" if the file is compressed, and if it is than decompress instead of copying.

I'm not sure about using unpack://, maybe someone more qualified can help you. 
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #15
yeah i was thinking about using the simple DOS rar.exe to make something, but it's going to be one complicated little script..

Any chance you could maybe help me with that?
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #16
I am working on it right now
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #17
i've done this so far:

Code: [Select]
$if(
$strchr('"'%_path%'"',|),
$puts(pos,$strchr('"'%_path%'"',|))
$puts(pos,$sub($get(pos),2))
$puts(rar,1))
$if($get(rar),
$puts(path,$cut(%_path%,$get(pos)))
$puts(command,rar -e $get(path) %_filename_ext%))
$get(command)


which outputs the following for a file:

rar -e D:\mp3\Fischerspooner.#1.rar 07 - Invisible.mp3

this is not quite correct however... it doesn't want to seem to grab the filename properly.. "07 - Invisible.mp3" gives errors because of the spaces..
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #18
whoops with the new rar you are only supposed to use it the following way, this works:

Code: [Select]
rar e "FILENAME.RAR" "TRACKNAME.mp3"


Strange that they dropped the - infront of the switch... oh well...

but i'm getting some CRC errors on unpacking some files... strange..
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #19
You need InfoZip's Unzip and Unrar for my script.

Code: [Select]
//here you can set the destination directory
/do not put spaces here
$puts(destination,'C:\temp3')
//here you can choose the extracting program to use
//works well, if parameter ordering is "source - files - destination"
//you have to give the extraction switch in too if theres is one
$puts(extractor,'unrar x')
//$puts(extractor,'unzip32')

$ansi(
'@'
'if not exist' '"'$get(destination)'" '
'md' '"'$get(destination)'"'
$crlf()
'@'
$if($strchr(%_path%,|),
$get(extractor) '"'$left(%_path%,$sub($strchr(%_path%,|),1))'"' '"'$right(%_path%,$sub($len(%_path%),$strchr(%_path%,|)))'"'
$if($strcmp($get(extractor),'unzip32'),' -d ',) $get(destination)
,
'copy' '"'%_path%'"' '"'$get(destination)\'"'
)
)


This script does not check the file types, you can put that part of yours in it. And you have to put " " around filenames with spaces, or maybe ' ' is enough. Unzip somehow does not like this kind of stuff in the output directory, so there you can' use spaces with my script. If you wish, merge our scripts, I did not use too much of $puts()
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #20
w00t w00t!

thanks a bunch man!!
i'll keep on trying to expand this, if i figure out anything nice i will post the new script again...
but i'm in the zone now, this rocks..

see, only 2 puny brains were needed and 30 minutes of time...
but i still think they should implement it into the Context Menu (right-click)

Btw, I figured out my CRC errors were occuring because I was using an old version of rar.exe... Just updated winrar and am using Unrar.exe now, which works just fine

Oh and the output from your script is not correct yet, but that does not matter..
That should be easy enough for me to fix...
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #21
well, i've been trying to do some stuff... but it doesn't want to work..
the if() commands are a bit odd in foobar if you ask me...
i would like to rewrite the script a bit, in the following manner:

(using general php type syntax.. lol)
Code: [Select]
if(| is found){
 $position=place of |;
 $extension=the 3 characters infront of |;
 $file=filename_with_extension
 if($extension=='rar'){
   $archiver = 'unrar';
 }
 if($extension=='zip'){
   $archiver = 'unzip';
 }
 if($extension=='ace'){
   $archiver = 'unace'; //don't know if it exists, but should;)
 }
 extract $file to $dir; //generating the command is no problem...

} else {
 //since it's not an archive do a direct copy
 copy filename to dir;
}


I basically just need to figure out how these IF's work..
And is there such a thing as an ELSE? 

Anyway, we'll get there... 

[edit]
i also forgot to mention that some rar files have directories in them as well..
so we would have to test for another slash after the | otherwise it still doesn't work
[/edit]
[..:: West Coast Electro Sound of Holland ::..]

simple request -> copy original file to dir

Reply #22
OK, this shouldn't be too difficult. Right now I have to go to the University, but later today I will look into this. First I will tidy up the code and find a way to handle directories in archives.

$if() syntax:
Code: [Select]
$if(a,b,c) == if a then b else c
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #23
OK, I think I finished tweaking the "code". I don't think I will mess around with it more, as I really don't need it, and it's easy to expand - to add "ace" support, maybe. And yes, this code may contain errors, so don't complain on me if something goes wrong
I also inserted some C-style comments for the $if-s, so they would be easier to understand for you. For me, they are rather disturbing, though

Code: [Select]
//here you can set the destination directory
$puts(destination,'"C:\temp mp3"')

//Should this script overwrite without prompting?
$puts(overwrite,'no')

$puts(source,$left(%_path%,$sub($strchr(%_path%,|),1)))
$puts(filename,'"'$right(%_path%,$sub($len(%_path%),$strchr(%_path%,|)))'"')
$puts(type,$right($get(source),3))

//works well, if parameter ordering is "source - files - destination"
//you have to give the extraction switch in too if theres is one

$if($strcmp($get(type),'rar'),
//if type=='rar' {
$puts(extractor,'unrar x')
//if overwrite=='yes'{
$if($strcmp($get(overwrite),'yes'),$puts(extractor,$get(extractor)' -y'),),
//}
$if($strcmp($get(type),'zip'),
//} else if type=='zip' {
$puts(extractor,'unzip32')
//if overwrite=='yes' {
$if($strcmp($get(overwrite),'yes'),$puts(extractor,$get(extractor)' -o'),),
//}
//} else {
$puts(extractor,'copy')
//if overwrite=='yes' {
$if($strcmp($get(overwrite),'yes'),$puts(extractor,$get(extractor)' /Y'),
//} else {
$puts(extractor,$get(extractor)' /-Y'))
//}
//}
)
)

//to have " " around the source's name
$puts(source,'"'$get(source)'"')

$ansi(
'@'
'if not exist' $get(destination)
' md' $get(destination)
$crlf()
'@'
$if($strchr(%_path%,|),
$get(extractor) $get(source) $get(filename)
$if($strcmp($get(type),'zip'),'-d',) $get(destination)
,
$get(extractor) '"'%_path%'"' $get(destination)
)
)


Still not the context-menu plugin you wished for, but I'm not so familiar with the sdk
architecture, so I won't be messing with that. Maybe the renamer plugin could be
modified to something like this, maybe like writing the files to the specified directory
and to their original directory too, but that's quite ugly. And I definitely won't
do that, maybe if you could convince more qualified plugin writers like Case, kode54 or foosion...
Life is Real...
(But not in audio :) )

simple request -> copy original file to dir

Reply #24
wow, nice work!! i really appreciate the comments

and now i understand that if() statement a lot better as well...
ok, i should have been able to figure that out myself, but the vacation is still in my head...

if there are any faults in it i will fix them and post them..

i also tried contacting one of the main coders before, but to no avail...
seems they are not interrested in this functionality

[edit]
this is working PERFECTLY!!...
i can't thank you enough...
[/edit]
[..:: West Coast Electro Sound of Holland ::..]