Mercurial > hg > svapp
changeset 380:d8bde801ebd4 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Wed, 02 Jul 2014 17:31:48 +0100 |
parents | 1162c93e7688 (current diff) 6a84102c006a (diff) |
children | 71090a49d487 681447b07142 |
files | |
diffstat | 3 files changed, 38 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- 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<QFrame *> frames = statusBar()->findChildren<QFrame *>(); + 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
--- 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();
--- 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