[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-devel] Re: [Traverso-commit] traverso/src/common Utils.cpp
From: |
ben levitt |
Subject: |
[Traverso-devel] Re: [Traverso-commit] traverso/src/common Utils.cpp |
Date: |
Fri, 30 Nov 2007 11:51:36 -0800 |
As far as I know, cdrdao doesn't accept hours, so I think we'll have
to have a version of timeref_to_cd() for writing toc files.
Ben
On Nov 30, 2007 11:33 AM, Remon Sijrier <address@hidden> wrote:
> CVSROOT: /sources/traverso
> Module name: traverso
> Changes by: Remon Sijrier <r_sijrier> 07/11/30 19:33:51
>
> Modified files:
> src/common : Utils.cpp
>
> Log message:
> * updated cd_to_timeref() and timeref_to_cd() to use also hours in
> the format.
> @ Nicola: could this potentially break CD TOC creation ?
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/traverso/src/common/Utils.cpp?cvsroot=traverso&r1=1.4&r2=1.5
>
> Patches:
> Index: Utils.cpp
> ===================================================================
> RCS file: /sources/traverso/traverso/src/common/Utils.cpp,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -b -r1.4 -r1.5
> --- Utils.cpp 29 Oct 2007 11:18:03 -0000 1.4
> +++ Utils.cpp 30 Nov 2007 19:33:51 -0000 1.5
> @@ -48,9 +48,10 @@
> TimeRef out;
> QStringList lst = str.simplified().split(QRegExp("[;,.:]"),
> QString::SkipEmptyParts);
>
> - if (lst.size() >= 1) out += TimeRef(lst.at(0).toInt() *
> ONE_MINUTE_UNIVERSAL_SAMPLE_RATE);
> - if (lst.size() >= 2) out += TimeRef(lst.at(1).toInt() *
> UNIVERSAL_SAMPLE_RATE);
> - if (lst.size() >= 3) out += TimeRef(lst.at(2).toInt() *
> UNIVERSAL_SAMPLE_RATE / 75);
> + if (lst.size() >= 1) out += TimeRef(lst.at(0).toInt() *
> ONE_HOUR_UNIVERSAL_SAMPLE_RATE);
> + if (lst.size() >= 2) out += TimeRef(lst.at(1).toInt() *
> ONE_MINUTE_UNIVERSAL_SAMPLE_RATE);
> + if (lst.size() >= 3) out += TimeRef(lst.at(2).toInt() *
> UNIVERSAL_SAMPLE_RATE);
> + if (lst.size() >= 4) out += TimeRef(lst.at(3).toInt() *
> UNIVERSAL_SAMPLE_RATE / 75);
>
> return out;
> }
> @@ -174,20 +175,23 @@
> {
> QString spos;
> qint64 remainder;
> - int mins, secs, frames;
> + int hours, mins, secs, frames;
>
> qint64 universalframe = ref.universal_frame();
>
> - mins = universalframe / ( ONE_MINUTE_UNIVERSAL_SAMPLE_RATE );
> - remainder = universalframe - ( mins *
> ONE_MINUTE_UNIVERSAL_SAMPLE_RATE );
> - secs = remainder / UNIVERSAL_SAMPLE_RATE;
> + hours = int(universalframe / ONE_HOUR_UNIVERSAL_SAMPLE_RATE);
> + remainder = qint64(universalframe - (hours *
> ONE_HOUR_UNIVERSAL_SAMPLE_RATE));
> + mins = (int) (remainder / ( ONE_MINUTE_UNIVERSAL_SAMPLE_RATE ));
> + remainder -= mins * ONE_MINUTE_UNIVERSAL_SAMPLE_RATE;
> + secs = (int) (remainder / UNIVERSAL_SAMPLE_RATE);
> remainder -= secs * UNIVERSAL_SAMPLE_RATE;
> frames = remainder * 75 / UNIVERSAL_SAMPLE_RATE;
> - spos.sprintf ( " %02d:%02d:%02d", mins, secs, frames );
> + spos.sprintf("%02d:%02d:%02d,%02d", hours, mins, secs, frames );
>
> return spos;
> }
>
> +
> QString timeref_to_text(const TimeRef & ref, int scalefactor)
> {
> if (scalefactor >= 512*640) {
>
>
> _______________________________________________
> Traverso-commit mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/traverso-commit
>
- [Traverso-devel] Re: [Traverso-commit] traverso/src/common Utils.cpp,
ben levitt <=