# HG changeset patch # User Chris Cannam # Date 1404318708 -3600 # Node ID d8bde801ebd40d722df379eee3b40729d3b78380 # Parent 1162c93e76880751100f7bf42969fa9b5176e13c# Parent 6a84102c006a2bf76774e3f66a8c03a1351e97db Merge from default branch diff -r 1162c93e7688 -r d8bde801ebd4 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Wed Jun 18 17:33:00 2014 +0100 +++ b/framework/MainWindowBase.cpp Wed Jul 02 17:31:48 2014 +0100 @@ -154,7 +154,8 @@ m_labeller(0), m_lastPlayStatusSec(0), m_initialDarkBackground(false), - m_defaultFfwdRwdStep(2, 0) + m_defaultFfwdRwdStep(2, 0), + m_statusLabel(0) { Profiler profiler("MainWindowBase::MainWindowBase"); @@ -1120,7 +1121,7 @@ } MainWindowBase::FileOpenStatus -MainWindowBase::open(QString fileOrUrl, AudioFileOpenMode mode) +MainWindowBase::openPath(QString fileOrUrl, AudioFileOpenMode mode) { ProgressDialog dialog(tr("Opening file or URL..."), true, 2000, this); connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); @@ -1151,7 +1152,6 @@ RDFImporter::RDFDocumentType rdfType = RDFImporter::identifyDocumentType (QUrl::fromLocalFile(source.getLocalFilename()).toString()); -// cerr << "RDF type: " << (int)rdfType << endl; if (rdfType == RDFImporter::AudioRefAndAnnotations || rdfType == RDFImporter::AudioRef) { rdfSession = true; @@ -1204,13 +1204,13 @@ MainWindowBase::openAudio(FileSource source, AudioFileOpenMode mode, QString templateName) { -// SVDEBUG << "MainWindowBase::openAudio(" << source.getLocation() << ")" << endl; + SVDEBUG << "MainWindowBase::openAudio(" << source.getLocation() << ")" << endl; if (templateName == "") { templateName = getDefaultSessionTemplate(); } - cerr << "template is: \"" << templateName << "\"" << endl; +// cerr << "template is: \"" << templateName << "\"" << endl; if (!source.isAvailable()) return FileOpenFailed; source.waitForData(); @@ -1672,7 +1672,7 @@ } MainWindowBase::FileOpenStatus -MainWindowBase::openSessionFile(QString fileOrUrl) +MainWindowBase::openSessionPath(QString fileOrUrl) { ProgressDialog dialog(tr("Opening session..."), true, 2000, this); connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash())); @@ -2451,6 +2451,22 @@ } } +QLabel * +MainWindowBase::getStatusLabel() const +{ + if (!m_statusLabel) { + m_statusLabel = new QLabel(); + statusBar()->addWidget(m_statusLabel, 1); + } + + QList frames = statusBar()->findChildren(); + foreach (QFrame *f, frames) { + f->setFrameStyle(QFrame::NoFrame); + } + + return m_statusLabel; +} + void MainWindowBase::toggleStatusBar() { @@ -2749,7 +2765,7 @@ updateVisibleRangeDisplay(m_paneStack->getCurrentPane()); } else { m_myStatusMessage = ""; - statusBar()->showMessage(""); + getStatusLabel()->setText(""); } } @@ -3056,7 +3072,7 @@ m_myStatusMessage = tr("Playing: %1 of %2 (%3 remaining)") .arg(nowStr).arg(thenStr).arg(remainingStr); - statusBar()->showMessage(m_myStatusMessage); + getStatusLabel()->setText(m_myStatusMessage); } void @@ -3273,11 +3289,16 @@ void MainWindowBase::contextHelpChanged(const QString &s) { + QLabel *lab = getStatusLabel(); + if (s == "" && m_myStatusMessage != "") { - statusBar()->showMessage(m_myStatusMessage); + if (lab->text() != m_myStatusMessage) { + lab->setText(m_myStatusMessage); + } return; } - statusBar()->showMessage(s); + + lab->setText(s); } void diff -r 1162c93e7688 -r d8bde801ebd4 framework/MainWindowBase.h --- a/framework/MainWindowBase.h Wed Jun 18 17:33:00 2014 +0100 +++ b/framework/MainWindowBase.h Wed Jul 02 17:31:48 2014 +0100 @@ -93,16 +93,15 @@ FileOpenWrongMode // attempted to open layer when no main model present }; - virtual FileOpenStatus open(QString fileOrUrl, AudioFileOpenMode = AskUser); virtual FileOpenStatus open(FileSource source, AudioFileOpenMode = AskUser); - + virtual FileOpenStatus openPath(QString fileOrUrl, AudioFileOpenMode = AskUser); virtual FileOpenStatus openAudio(FileSource source, AudioFileOpenMode = AskUser, QString templateName = ""); virtual FileOpenStatus openPlaylist(FileSource source, AudioFileOpenMode = AskUser); virtual FileOpenStatus openLayer(FileSource source); virtual FileOpenStatus openImage(FileSource source); - virtual FileOpenStatus openSessionFile(QString fileOrUrl); virtual FileOpenStatus openSession(FileSource source); + virtual FileOpenStatus openSessionPath(QString fileOrUrl); virtual FileOpenStatus openSessionTemplate(QString templateName); virtual FileOpenStatus openSessionTemplate(FileSource source); @@ -338,6 +337,9 @@ RealTime m_defaultFfwdRwdStep; + mutable QLabel *m_statusLabel; + QLabel *getStatusLabel() const; + WaveFileModel *getMainModel(); const WaveFileModel *getMainModel() const; void createDocument(); diff -r 1162c93e7688 -r d8bde801ebd4 framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Wed Jun 18 17:33:00 2014 +0100 +++ b/framework/SVFileReader.cpp Wed Jul 02 17:31:48 2014 +0100 @@ -767,7 +767,8 @@ view->setFollowGlobalPan(followPan); view->setFollowGlobalZoom(followZoom); view->setPlaybackFollow(tracking == "scroll" ? PlaybackScrollContinuous : - tracking == "page" ? PlaybackScrollPage + tracking == "page" ? PlaybackScrollPageWithCentre : + tracking == "daw" ? PlaybackScrollPage : PlaybackIgnore); // Then set these values