changeset 678:26c5f7fd4807 imaf_enc

Merge from the default branch
author Chris Cannam
date Mon, 04 Nov 2013 17:12:32 +0000
parents 5e5ab4e8d64b (diff) d8bd193ad17d (current diff)
children 97ea68f62c1f
files layer/WaveformLayer.cpp view/Pane.cpp
diffstat 7 files changed, 81 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Layer.h	Mon Nov 04 15:48:05 2013 +0000
+++ b/layer/Layer.h	Mon Nov 04 17:12:32 2013 +0000
@@ -220,7 +220,6 @@
     virtual void drawStart(View *, QMouseEvent *) { }
     virtual void drawDrag(View *, QMouseEvent *) { }
     virtual void drawEnd(View *, QMouseEvent *) { }
-
     virtual void eraseStart(View *, QMouseEvent *) { }
     virtual void eraseDrag(View *, QMouseEvent *) { }
     virtual void eraseEnd(View *, QMouseEvent *) { }
--- a/layer/TextLayer.cpp	Mon Nov 04 15:48:05 2013 +0000
+++ b/layer/TextLayer.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -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 = height;
     m_editingCommand->addPoint(m_editingPoint);
+
+
 }
 
 void
@@ -463,7 +465,7 @@
 
     bool ok = false;
     QString label = QInputDialog::getText(v, tr("Enter label"),
-					  tr("Please enter a new label:"),
+                      tr("Please enter a new label:"),
 					  QLineEdit::Normal, "", &ok);
 
     if (ok) {
--- a/layer/TimeInstantLayer.cpp	Mon Nov 04 15:48:05 2013 +0000
+++ b/layer/TimeInstantLayer.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -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	Mon Nov 04 15:48:05 2013 +0000
+++ b/layer/WaveformLayer.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -950,11 +950,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/view/Pane.cpp	Mon Nov 04 15:48:05 2013 +0000
+++ b/view/Pane.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -1427,7 +1427,8 @@
 	    int y1 = std::max(m_clickPos.y(), m_mousePos.y());
 
             zoomToRegion(x0, y0, x1, y1);
-	}
+
+    }
 
     } else if (mode == ViewManager::SelectMode) {
 
@@ -1460,8 +1461,8 @@
 
 	Layer *layer = getSelectedLayer();
 	if (layer && layer->isLayerEditable()) {
-	    layer->drawEnd(this, e);
-	    update();
+        layer->drawEnd(this, e);
+        update();
 	}
 
     } else if (mode == ViewManager::EraseMode) {
@@ -1595,7 +1596,7 @@
 
 	Layer *layer = getSelectedLayer();
 	if (layer && layer->isLayerEditable()) {
-	    layer->drawDrag(this, e);
+        layer->drawDrag(this, e);
 	}
 
     } else if (mode == ViewManager::EraseMode) {
--- a/widgets/ModelDataTableDialog.cpp	Mon Nov 04 15:48:05 2013 +0000
+++ b/widgets/ModelDataTableDialog.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -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	Mon Nov 04 15:48:05 2013 +0000
+++ b/widgets/PropertyBox.cpp	Mon Nov 04 17:12:32 2013 +0000
@@ -51,8 +51,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),
@@ -113,6 +118,7 @@
 #endif
 }
 
+
 void
 PropertyBox::populateViewPlayFrame()
 {
@@ -198,13 +204,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"));
@@ -224,6 +230,60 @@
         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);