On Aug 27, 2012, at 7:17 PM, "Wayne Merricks" <[email protected]> 
wrote:

> Hi,
> 
> I'm not great with C and QT but I've managed to bodge something together for 
> Riv 2.1.5.  This should work with at least 2.1.4 (and probably earlier) as 
> rdimport.cpp and .h are the same as far as I can tell.
> 
> I've added two flags to rdimport:
> 
> --start-datetime
>  Set the cut start date time, ISODate Format
>  yyyy-MM-ddTHH:mm:ss
> 
> --end-datetime
>  Set the cut end date time, ISODate Format
>  yyyy-MM-ddTHH:mm:ss
> 
> QT3 is a bit rubbish with the dateformat so you're kind of stuck with the ISO 
> format.  The T is important as it separates the Date and Time components.  I 
> tried the usual yyyyMMddHHmmss but QT3 doesn't have a clue about how to parse 
> it.

Sometimes, you just have to use the low level functions of C/Unix.  Something 
like the following would work if arg is a "char *" string value.

int y, M, d, H, m, s;
// create an empty structure to write to
struct tm t = {0};

int cnt =  sscanf( arg, "%04d%02d%02d%02d%02d%02d", &y, &M, &d, &H, &m, &s );
switch( cnt ) {
        case 6:
                t.tm_sec = s;
                // fall through
        case 5:
                t.tm_min = m;
                // fall through
        case 4:
                t.tm_year = y;
                t.tm_mon = M -1;
                t.tm_mday = d;
                t.tm_hour = h;
                time_t = mktime( &t );
                break;
        default:
                fprintf(stderr, "invalid number of components: %d, expected 
4-6", cnt );
                exit(2);
}

I didn't see an attachment with your changes, only winmail.dat.

Gregg

> I've attached the two patch files.  Please note someone needs to check this 
> as I'm not sure I've checked all the obvious exception conditions.
> 
> I tested it with:
> 
> rdimport --start-datetime=2012-08-30T18:30:31 
> --end-datetime=2012-08-31T19:31:32 MUSIC test.wav
> 
> And can confirm the cuts have the appropriate times.
> 
> Hope this helps,
> 
> Wayne
> 
> -----Original Message-----QT
> From: [email protected] on behalf of Robert 
> Jeffares
> Sent: Sun 26/08/2012 23:48
> To: User discussion about the Rivendell Radio Automation System
> Subject: [RDD] setting the start date time and end datetime in rdimport
> 
> Is it possible to amend or add 
> 
> --create-startdate-offset=<days>
> 
> --create-enddate-offset=<days>
> 
> so that we can put in a starttime and more essentially an end time
> 
> format yymmddhhmm works to allow spread over days
> 
> this only needs to be in the command line version.
> 
> Have looked at the cartchunk option but it's going no where for us.
> 
> Robert Jeffares
> Big Valley Radio
> The Wireless Station
> Pacific News Network
> 
> _______________________________________________
> Rivendell-dev mailing list
> [email protected]
> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
> 
> 
> 
> #######################
> Scanned by MailMarshal
> #######################
> 
> ############
> 
> Attention: 
> 
> The information contained in this message is confidential and intended 
> for the addressee(s) only. If you have received this message in error 
> or there are any problems, please notify the originator immediately.
> The unauthorised use, disclosure, copying or alteration of this message
> is strictly forbidden. Christian Vision or any of its subsidiaries will
> not be liable for direct, special, indirect or consequential damages 
> arising from alteration of the contents of this message by a third party
> or as a result of any virus being passed on. Please note that we reserve
> the right to monitor and read any e-mails sent or received by the 
> company under the Telecommunications (Lawful Business Practice) 
> (Interception of Communications) Regulation 2000. Christian Vision is 
> registered in England as a limited company 2842414 and as a charity 
> 1031031  
> 
> ############
> <winmail.dat>_______________________________________________
> Rivendell-dev mailing list
> [email protected]
> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev

_______________________________________________
Rivendell-dev mailing list
[email protected]
http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev

Reply via email to