# HG changeset patch # User Chris Cannam # Date 1461150388 -3600 # Node ID c02c51ae52388ddf7b51ab4d294094d4be601e15 # Parent 3691af49291c57a31883fd27190586737935b12b# Parent 282f4be8f0589a7b0744ba4ef7a838defc53ba4a Merge branches 3.0-integration and imaf_enc to 3.0-plus-imaf diff -r 3691af49291c -r c02c51ae5238 layer/TextLayer.cpp --- 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(""); - } + 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 = float(height); m_editingCommand->addPoint(m_editingPoint); + + } void diff -r 3691af49291c -r c02c51ae5238 layer/TimeInstantLayer.cpp --- 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); } diff -r 3691af49291c -r c02c51ae5238 layer/WaveformLayer.cpp --- 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()); } diff -r 3691af49291c -r c02c51ae5238 widgets/InteractiveFileFinder.cpp --- 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; diff -r 3691af49291c -r c02c51ae5238 widgets/ModelDataTableDialog.cpp --- 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); diff -r 3691af49291c -r c02c51ae5238 widgets/PropertyBox.cpp --- 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 #include +#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);