# HG changeset patch # User Chris Cannam # Date 1173287222 0 # Node ID 21b9b25bff484f4cbe5561994d4c300ccf041070 # Parent d7eeffbb8aaff8634499551521ade14ff7a25ff4 * More useful status bar text -- show the current play time and the extents of the visible area * Add update-i18n.sh to update the i18n/ts and qm files -- I can't get qmake to do the right thing now that the project file has been split up into several project files * Fix missing Q_OBJECTs, etc, reported by lupdate * Update Russian translation from AlexandrE diff -r d7eeffbb8aaf -r 21b9b25bff48 base/PropertyContainer.cpp --- a/base/PropertyContainer.cpp Mon Mar 05 15:32:55 2007 +0000 +++ b/base/PropertyContainer.cpp Wed Mar 07 17:07:02 2007 +0000 @@ -255,6 +255,6 @@ QString PropertyContainer::SetPropertyCommand::getName() const { - return m_pc->tr("Set %1 Property").arg(m_pn); + return tr("Set %1 Property").arg(m_pn); } diff -r d7eeffbb8aaf -r 21b9b25bff48 base/RealTime.cpp --- a/base/RealTime.cpp Mon Mar 05 15:32:55 2007 +0000 +++ b/base/RealTime.cpp Wed Mar 07 17:07:02 2007 +0000 @@ -125,7 +125,7 @@ std::string RealTime::toText(bool fixedDp) const { - if (*this < RealTime::zeroTime) return "-" + (-*this).toText(); + if (*this < RealTime::zeroTime) return "-" + (-*this).toText(fixedDp); std::stringstream out; @@ -173,6 +173,41 @@ return s; } +std::string +RealTime::toSecText() const +{ + if (*this < RealTime::zeroTime) return "-" + (-*this).toSecText(); + + std::stringstream out; + + if (sec >= 3600) { + out << (sec / 3600) << ":"; + } + + if (sec >= 60) { + out << (sec % 3600) / 60 << ":"; + } + + if (sec >= 10) { + out << ((sec % 60) / 10); + } + + out << (sec % 10); + + if (sec < 60) { + out << "s"; + } + + +#if (__GNUC__ < 3) + out << std::ends; +#endif + + std::string s = out.str(); + + return s; +} + RealTime RealTime::operator*(int m) const { diff -r d7eeffbb8aaf -r 21b9b25bff48 base/RealTime.h --- a/base/RealTime.h Mon Mar 05 15:32:55 2007 +0000 +++ b/base/RealTime.h Wed Mar 07 17:07:02 2007 +0000 @@ -111,6 +111,11 @@ // std::string toText(bool fixedDp = false) const; + // Return a user-readable string to the nearest second in a form + // like "6s" (for less than a minute) or "2:21" (for more). + // + std::string toSecText() const; + // Convenience functions for handling sample frames // static long realTime2Frame(const RealTime &r, unsigned int sampleRate); diff -r d7eeffbb8aaf -r 21b9b25bff48 data/fileio/MIDIFileReader.h --- a/data/fileio/MIDIFileReader.h Mon Mar 05 15:32:55 2007 +0000 +++ b/data/fileio/MIDIFileReader.h Wed Mar 07 17:07:02 2007 +0000 @@ -35,6 +35,8 @@ class MIDIFileReader : public DataFileReader, public QObject { + Q_OBJECT + public: MIDIFileReader(QString path, size_t mainModelSampleRate); virtual ~MIDIFileReader(); diff -r d7eeffbb8aaf -r 21b9b25bff48 data/model/FFTModel.h --- a/data/model/FFTModel.h Mon Mar 05 15:32:55 2007 +0000 +++ b/data/model/FFTModel.h Wed Mar 07 17:07:02 2007 +0000 @@ -21,6 +21,8 @@ class FFTModel : public DenseThreeDimensionalModel { + Q_OBJECT + public: FFTModel(const DenseTimeValueModel *model, int channel, diff -r d7eeffbb8aaf -r 21b9b25bff48 data/model/SparseModel.h --- a/data/model/SparseModel.h Mon Mar 05 15:32:55 2007 +0000 +++ b/data/model/SparseModel.h Wed Mar 07 17:07:02 2007 +0000 @@ -35,6 +35,8 @@ template class SparseModel : public Model { + Q_OBJECT + public: SparseModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true);