On Tue, Apr 26, 2016 at 3:29 PM, Fred Gleason <[email protected]>
wrote:

> On Apr 26, 2016, at 11:48 AM, drew Roberts <[email protected]> wrote:
>
> I suggest we add a similar option:
>
> --to-existing-cart=<cartnum>
>
> When using the suggested option, we could allow for anything in the GROUP
> part of the command as it would be ignored and the current group that the
> existing cart was in would be unchanged. The command would / should fail if
> the specified cart did not in fact exist.
>
>
> Not sure I’m following this.  So basically, we’d ignore the value of the
> GROUP argument and just import to the specified cart regardless of group
> membership?
>

Well, since it is an existing cart, it is already in a group. The import is
either to add a new cut to the cart or, if used with the --delete-cuts
option, to replace the current cut. So yes, you want it to end up in the
group it was already in.

This will allow you to import to multiple groups at once.

This would have been very useful to me yesterday when I was trying to
convert from a pcm library to an mpeg library on a PI3 machine I was
testing Rivendell on.

Copy all the wav files from /var/snd on the PI's memory card/disk to a
directory on an external USB drive.
Change the library from PCM16 to MPEG Layer 2 in rdadmin->Manage
Hosts->edit host->RDLibrary


Run the following little python script after setting things up properly:

-------------------------------------------------------------------
#!/usr/bin/python
# rivreimport.py
# dR Rivendell utilities collection
# this script is written to aid in converting a Riv box from PCM storege to
MPEG storage
# Copyright 2016, drew Roberts

import os
import errno
import ConfigParser
from shutil import copyfile
from glob import glob
import subprocess


# To start, Copy (Don't Move) the riv pcm wav files from /var/snd to
another location
# in this case, it is on an external drive mounted in /media
#extsndpath = '/media/pi/ROSHARE/pi3/wavsndtestafew/'
extsndpath = '/media/pi/ROSHARE/pi3/wavsnd/'


for wavfile in glob(extsndpath+"*.wav"):
print wavfile
mywavfilename = os.path.basename(wavfile)
print mywavfilename
mybreakdn1 = mywavfilename.split("_")
print mybreakdn1
mycart = mybreakdn1[0]
print mycart
mybreakdn2 = mybreakdn1[1].split(".")
print mybreakdn2
mycut = mybreakdn2[0]
print mycut
if mycut != "001":
print "-------------------------------------------------------------------"
# run this first with the actual importing commented out to find and move
multiple cut carts.
else:
print "this is where we try the rdimport."
myarg0="rdimport"
myarg1="--verbose"
myarg2="--normalization-level=-11"
myarg3="--delete-cuts"
myarg4='--to-cart="'+mycart+'"'
myarg5="MUSIC"
myarg6=wavfile
#echo "rdimport --verbose --normalization-level=-11 --to-cart=mycart
wavfile"
subprocess.call(["echo", myarg0, myarg1, myarg2, myarg3,
myarg4,myarg5,myarg6])
#myresult = subprocess.call(["rdimport", myarg1, myarg2, myarg3, myarg4])
# this try to directly call rdimport was failing with a bad group message
so I wrote a file,
# and converted it to a bash script by adding #!/bin/bash at the top, chmod
+x ing and
# then running it
#print myresult
print "=========="
with open("rdimpfiles.txt", "a") as local_file1:
local_file1.write("rdimport --verbose --normalization-level=-11
--delete-cuts "+myarg4+" MUSIC "+myarg6+"\n")

# python script ends here
-------------------------------------------------------------------
Because I had specified the GROUP above to make it work, it only imported
my MUSIC category and failed on the sweepers, stingers, and other misc
stuff. Not a really big deal for testing purposes as it seems that the
system can still play the old PCM16 files just fine after the job completed.

I forgot to say it, but it would have been really nice to have been able to
have handled my multi-cut carts if there was a --to-existing-cut option as
well as I could have modded the python to specify the cut as well.


> Cheers!
>
>
> |----------------------------------------------------------------------|
> | Frederick F. Gleason, Jr. |              Chief Developer             |
> |                           |              Paravel Systems             |
> |----------------------------------------------------------------------|
> |          A room without books is like a body without a soul.         |
> |                                         -- Cicero                    |
> |----------------------------------------------------------------------|
>

all the best,

drew

-- 
Bahamain Or Nuttin - http://www.bahamianornuttin.com
<http://www.bahamianornuttin.com/>
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to