[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/traverso/widgets InfoWidgets.cpp
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/traverso/widgets InfoWidgets.cpp |
Date: |
Mon, 29 Oct 2007 08:42:14 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/10/29 08:42:14
Modified files:
src/traverso/widgets: InfoWidgets.cpp
Log message:
* Fix timeleft indication (not exactly sure why it didn't work, but I
think it was due overflowing the range of nframes_t)
* Make an estimation of the recording time left when recording format
is wavpack (~ twice the recording time compared to wav files)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/InfoWidgets.cpp?cvsroot=traverso&r1=1.44&r2=1.45
Patches:
Index: InfoWidgets.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/InfoWidgets.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- InfoWidgets.cpp 26 Sep 2007 20:46:34 -0000 1.44
+++ InfoWidgets.cpp 29 Oct 2007 08:42:14 -0000 1.45
@@ -325,7 +325,22 @@
}
uint rate = audiodevice().get_sample_rate();
- TimeRef time(qint64((space * 1048576) / (sizeof(float) *
recChannelCount)), rate);
+ qint64 availabletime = (UNIVERSAL_SAMPLE_RATE / rate) *
qint64(space * 1048576);
+ availabletime /= qint64(sizeof(float) * recChannelCount);
+
+ QString recordFormat = config().get_property("Recording",
"FileFormat", "wav").toString();
+ // I think a compression ratio of 40 % with wavpack is a safe
estimation
+ // and 50% with skipwvx...
+ if (recordFormat == "wavpack") {
+ QString skipwvx = config().get_property("Recording",
"WavpackSkipWVX", "false").toString();
+ if (skipwvx == "true") {
+ availabletime = qint64(availabletime / 0.5);
+ } else {
+ availabletime = qint64(availabletime / 0.6);
+ }
+ }
+
+ TimeRef time(availabletime);
text = timeref_to_hms(time);
if (text < "00:30:00") {
QPalette pal;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src/traverso/widgets InfoWidgets.cpp,
Remon Sijrier <=