# HG changeset patch # User Chris Cannam # Date 1383584976 0 # Node ID 3437e0fad7aea8021030a547770bd5fc492e6984 # Parent 77fa3fdbfc7e2b9f96eac6524d48294fb47760c3 IMAF load code from Jesus Corral Garcia diff -r 77fa3fdbfc7e -r 3437e0fad7ae layer/Layer.h --- a/layer/Layer.h Thu May 16 13:11:13 2013 +0100 +++ b/layer/Layer.h Mon Nov 04 17:09:36 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 *) { } diff -r 77fa3fdbfc7e -r 3437e0fad7ae layer/TextLayer.cpp --- a/layer/TextLayer.cpp Thu May 16 13:11:13 2013 +0100 +++ b/layer/TextLayer.cpp Mon Nov 04 17:09:36 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(""); - } + label = tr(""); + } 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(""); + label = tr(""); } 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) { diff -r 77fa3fdbfc7e -r 3437e0fad7ae layer/TimeInstantLayer.cpp --- a/layer/TimeInstantLayer.cpp Thu May 16 13:11:13 2013 +0100 +++ b/layer/TimeInstantLayer.cpp Mon Nov 04 17:09:36 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); } diff -r 77fa3fdbfc7e -r 3437e0fad7ae layer/WaveformLayer.cpp --- a/layer/WaveformLayer.cpp Thu May 16 13:11:13 2013 +0100 +++ b/layer/WaveformLayer.cpp Mon Nov 04 17:09:36 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()); } diff -r 77fa3fdbfc7e -r 3437e0fad7ae view/Pane.cpp --- a/view/Pane.cpp Thu May 16 13:11:13 2013 +0100 +++ b/view/Pane.cpp Mon Nov 04 17:09:36 2013 +0000 @@ -1428,7 +1428,8 @@ int y1 = std::max(m_clickPos.y(), m_mousePos.y()); zoomToRegion(x0, y0, x1, y1); - } + + } } else if (mode == ViewManager::SelectMode) { @@ -1461,8 +1462,8 @@ Layer *layer = getSelectedLayer(); if (layer && layer->isLayerEditable()) { - layer->drawEnd(this, e); - update(); + layer->drawEnd(this, e); + update(); } } else if (mode == ViewManager::EraseMode) { @@ -1596,7 +1597,7 @@ Layer *layer = getSelectedLayer(); if (layer && layer->isLayerEditable()) { - layer->drawDrag(this, e); + layer->drawDrag(this, e); } } else if (mode == ViewManager::EraseMode) { diff -r 77fa3fdbfc7e -r 3437e0fad7ae widgets/ModelDataTableDialog.cpp --- a/widgets/ModelDataTableDialog.cpp Thu May 16 13:11:13 2013 +0100 +++ b/widgets/ModelDataTableDialog.cpp Mon Nov 04 17:09:36 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); diff -r 77fa3fdbfc7e -r 3437e0fad7ae widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Thu May 16 13:11:13 2013 +0100 +++ b/widgets/PropertyBox.cpp Mon Nov 04 17:09:36 2013 +0000 @@ -51,8 +51,12 @@ #include #include +#include "Fader.h" //#define DEBUG_PROPERTY_BOX 1 + QHBoxLayout *layout1 = new QHBoxLayout; + int tracks=0; +//#include "C:/Users/Paco/Desktop/SV mio/sonic-visualiser/main/imafdecoder.h" PropertyBox::PropertyBox(PropertyContainer *container) : m_container(container), m_showButton(0), @@ -113,6 +117,7 @@ #endif } + void PropertyBox::populateViewPlayFrame() { @@ -198,13 +203,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 +229,58 @@ playGainChanged(params->getPlayGain()); layout->setAlignment(gainDial, Qt::AlignVCenter); +//code added by Jesus + +QString property_container_name; // the name could be : Waveform, Time Instants, etc +property_container_name = layer->getPropertyContainerName();// obtain the name +boolean 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 +// end code added by Jesus + AudioDial *panDial = new AudioDial; layout->addWidget(panDial); panDial->setMeterColor(Qt::darkGreen);