changeset 1051:c02c51ae5238 3.0-plus-imaf

Merge branches 3.0-integration and imaf_enc to 3.0-plus-imaf
author Chris Cannam
date Wed, 20 Apr 2016 12:06:28 +0100
parents 3691af49291c (current diff) 282f4be8f058 (diff)
children
files layer/Layer.h layer/TextLayer.cpp layer/TimeInstantLayer.cpp layer/WaveformLayer.cpp view/Pane.cpp widgets/InteractiveFileFinder.cpp widgets/ModelDataTableDialog.cpp widgets/PropertyBox.cpp
diffstat 6 files changed, 92 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/layer/TextLayer.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/layer/TextLayer.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -127,13 +127,13 @@
 
 	const TextModel::Point &p(*i);
 
-	int px = v->getXForFrame(p.frame);
-	int py = getYForHeight(v, p.height);
+    int px = v->getXForFrame(p.frame);
+    int py = getYForHeight(v, p.height);
 
 	QString label = p.label;
 	if (label == "") {
-	    label = tr("<no text>");
-	}
+        label = tr("<no text>");
+    }
 
 	QRect rect = metrics.boundingRect
 	    (QRect(0, 0, 150, 200),
@@ -205,7 +205,7 @@
     QString text;
 
     if (points.begin()->label == "") {
-	text = QString(tr("Time:\t%1\nHeight:\t%2\nLabel:\t%3"))
+    text = QString(tr("Time:\t%1\nHeight:\t%2\nLabel:\t%3"))
 	    .arg(rt.toText(true).c_str())
 	    .arg(points.begin()->height)
 	    .arg(points.begin()->label);
@@ -370,7 +370,7 @@
 
 	QString label = p.label;
 	if (label == "") {
-	    label = tr("<no text>");
+        label = tr("<no text>");
 	}
 
 	QRect boxRect = paint.fontMetrics().boundingRect
@@ -453,6 +453,8 @@
     m_editingPoint.frame = frame;
     m_editingPoint.height = float(height);
     m_editingCommand->addPoint(m_editingPoint);
+
+
 }
 
 void
--- a/layer/TimeInstantLayer.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/layer/TimeInstantLayer.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -236,10 +236,10 @@
     QString text;
 
     if (points.begin()->label == "") {
-	text = QString(tr("Time:\t%1\nNo label"))
+    text = QString(tr("Time:\t%1\nNo label"))
 	    .arg(rt.toText(true).c_str());
     } else {
-	text = QString(tr("Time:\t%1\nLabel:\t%2"))
+    text = QString(tr("Time:\t%1\nLabel:\t%2"))
 	    .arg(rt.toText(true).c_str())
 	    .arg(points.begin()->label);
     }
--- a/layer/WaveformLayer.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/layer/WaveformLayer.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -978,11 +978,11 @@
     RealTime rt1 = RealTime::frame2RealTime(f1, m_model->getSampleRate());
 
     if (f1 != f0 + 1 && (rt0.sec != rt1.sec || rt0.msec() != rt1.msec())) {
-	text += tr("Time:\t%1 - %2")
+    text += tr("Time:\t%1 - %2")
 	    .arg(rt0.toText(true).c_str())
 	    .arg(rt1.toText(true).c_str());
     } else {
-	text += tr("Time:\t%1")
+    text += tr("Time:\t%1")
 	    .arg(rt0.toText(true).c_str());
     }
 
--- a/widgets/InteractiveFileFinder.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/widgets/InteractiveFileFinder.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -140,6 +140,12 @@
         filter = tr("Comma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nText files (*.txt)\nAll files (*.*)");
         break;
 
+    case IMAFile:
+        settingsKeyStub = "imaf";
+        title = "Select an IMAF file";
+        filter = tr("IMAF files (*.ima)\nAll files (*.*)");
+        break;
+
     case AnyFile:
         settingsKeyStub = "last";
         filter = tr("All supported files (*.sv %1 %2 %3)\n%4 session files (*.%5)\nAudio files (%1)\nLayer files (%2)\nRDF files (%3)\nAll files (*.*)")
@@ -289,6 +295,10 @@
         filter = tr("Comma-separated data files (*.csv)\nText files (*.txt)\nAll files (*.*)");
         break;
 
+    case IMAFile:
+        cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: IMAFile cannot be used here" << endl;
+        abort();
+
     case AnyFile:
         cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: AnyFile cannot be used here" << endl;
         abort();
@@ -455,6 +465,10 @@
         settingsKeyStub = "layer";
         break;
 
+    case IMAFile:
+        settingsKeyStub = "imaf";
+        break;
+
     case AnyFile:
         settingsKeyStub = "last";
         break;
--- a/widgets/ModelDataTableDialog.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/widgets/ModelDataTableDialog.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -51,7 +51,6 @@
     toolbar = addToolBar(tr("Play Mode Toolbar"));
     
     IconLoader il;
-
     QAction *action = new QAction(il.load("playfollow"), tr("Track Playback"), this);
     action->setStatusTip(tr("Toggle tracking of playback position"));
     action->setCheckable(true);
--- a/widgets/PropertyBox.cpp	Fri Mar 18 14:25:05 2016 +0000
+++ b/widgets/PropertyBox.cpp	Wed Apr 20 12:06:28 2016 +0100
@@ -48,8 +48,13 @@
 #include <iostream>
 #include <cmath>
 
+#include "Fader.h"
 //#define DEBUG_PROPERTY_BOX 1
 
+ QHBoxLayout *layout1 = new QHBoxLayout;
+ int tracks=0;
+ extern bool isIMAF;
+//#include "C:/Users/Paco/Desktop/SV mio/sonic-visualiser/main/imafdecoder.h"
 PropertyBox::PropertyBox(PropertyContainer *container) :
     m_container(container),
     m_showButton(0),
@@ -118,6 +123,7 @@
 #endif
 }
 
+
 void
 PropertyBox::populateViewPlayFrame()
 {
@@ -204,13 +210,13 @@
         }
 
 	AudioDial *gainDial = new AudioDial;
-	layout->addWidget(gainDial);
+    layout->addWidget(gainDial);
 	gainDial->setMeterColor(Qt::darkRed);
 	gainDial->setMinimum(-50);
 	gainDial->setMaximum(50);
 	gainDial->setPageStep(1);
-	gainDial->setFixedWidth(24);
-	gainDial->setFixedHeight(24);
+    gainDial->setFixedWidth(24);
+    gainDial->setFixedHeight(24);
 	gainDial->setNotchesVisible(false);
 	gainDial->setDefaultValue(0);
         gainDial->setObjectName(tr("Playback Gain"));
@@ -230,6 +236,63 @@
         playGainChanged(params->getPlayGain());
 	layout->setAlignment(gainDial, Qt::AlignVCenter);
 
+
+/*
+//code added by Jesus
+
+if (isIMAF){
+QString property_container_name; // the name could be : Waveform, Time Instants, etc
+property_container_name = layer->getPropertyContainerName();// obtain the name
+bool isWaveform;
+
+isWaveform = property_container_name.contains("Waveform", Qt::CaseInsensitive);//if QString contains "Waveform"
+
+if (isWaveform == true){
+   tracks++;
+
+  AudioDial *gainDial1 = new AudioDial;
+  gainDial1->setMeterColor(Qt::darkRed);
+  gainDial1->setMinimum(-63);
+  gainDial1->setMaximum(10);
+  gainDial1->setPageStep(1);
+  gainDial1->setFixedWidth(60);
+  gainDial1->setFixedHeight(60);
+  gainDial1->setNotchesVisible(false);
+  gainDial1->setDefaultValue(0);
+  gainDial1->setObjectName(tr("Playback Gain"));
+  gainDial1->setRangeMapper(new LinearRangeMapper
+                               (-50, 50, -25, 25, tr("dB")));
+      gainDial1->setShowToolTip(true);
+  connect(gainDial1, SIGNAL(valueChanged(int)),
+      this, SLOT(playGainDialChanged(int)));
+  connect(params, SIGNAL(playGainChanged(float)),
+      this, SLOT(playGainChanged(float)));
+  connect(this, SIGNAL(changePlayGainDial(int)),
+      gainDial1, SLOT(setValue(int)));
+      connect(gainDial1, SIGNAL(mouseEntered()),
+              this, SLOT(mouseEnteredWidget()));
+      connect(gainDial1, SIGNAL(mouseLeft()),
+              this, SLOT(mouseLeftWidget()));
+      playGainChanged(params->getPlayGain());
+  layout1->setAlignment(gainDial1, Qt::AlignVCenter);
+
+  QWidget *window = new QWidget;
+
+
+//          QLabel *showLabel1 = new QLabel(tr("Track"));
+//          layout1->addWidget(showLabel1);
+//          layout1->setAlignment(showLabel1, Qt::AlignVCenter);
+
+             layout1->addWidget(gainDial1);
+             if (tracks==3){
+                 window->setLayout(layout1);
+                 window ->showNormal();
+             }
+} // end if isWaveform
+} // end if isIMAF
+// end code added by Jesus
+*/
+
 	AudioDial *panDial = new AudioDial;
 	layout->addWidget(panDial);
 	panDial->setMeterColor(Qt::darkGreen);