changeset 309:71050ffd0141 tonioni

sampleId -> clipId
author Chris Cannam
date Tue, 07 Jan 2014 15:52:47 +0000
parents 289d65722123
children 8c59cc68eabd
files audioio/AudioGenerator.cpp audioio/AudioGenerator.h framework/SVFileReader.cpp
diffstat 3 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Tue Jan 07 15:50:04 2014 +0000
+++ b/audioio/AudioGenerator.cpp	Tue Jan 07 15:52:47 2014 +0000
@@ -51,9 +51,9 @@
     initialiseSampleDir();
 
     connect(PlayParameterRepository::getInstance(),
-            SIGNAL(playSampleIdChanged(const Playable *, QString)),
+            SIGNAL(playClipIdChanged(const Playable *, QString)),
             this,
-            SLOT(playSampleIdChanged(const Playable *, QString)));
+            SLOT(playClipIdChanged(const Playable *, QString)));
 }
 
 AudioGenerator::~AudioGenerator()
@@ -129,11 +129,11 @@
 }
 
 void
-AudioGenerator::playSampleIdChanged(const Playable *playable, QString)
+AudioGenerator::playClipIdChanged(const Playable *playable, QString)
 {
     const Model *model = dynamic_cast<const Model *>(playable);
     if (!model) {
-        cerr << "WARNING: AudioGenerator::playSampleIdChanged: playable "
+        cerr << "WARNING: AudioGenerator::playClipIdChanged: playable "
                   << playable << " is not a supported model type"
                   << endl;
         return;
@@ -157,7 +157,7 @@
 
     const Model *model = dynamic_cast<const Model *>(playable);
     if (!model) {
-        cerr << "WARNING: AudioGenerator::playSampleIdChanged: playable "
+        cerr << "WARNING: AudioGenerator::playClipIdChanged: playable "
                   << playable << " is not a supported model type"
                   << endl;
         return;
@@ -185,7 +185,7 @@
 ClipMixer *
 AudioGenerator::makeClipMixerFor(const Model *model)
 {
-    QString sampleId;
+    QString clipId;
 
     const Playable *playable = model;
     if (!playable || !playable->canPlay()) return 0;
@@ -193,12 +193,12 @@
     PlayParameters *parameters =
 	PlayParameterRepository::getInstance()->getPlayParameters(playable);
     if (parameters) {
-        sampleId = parameters->getPlaySampleId();
+        clipId = parameters->getPlayClipId();
     }
 
-    std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): sample id = " << sampleId << std::endl;
+    std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): sample id = " << clipId << std::endl;
 
-    if (sampleId == "") {
+    if (clipId == "") {
         SVDEBUG << "AudioGenerator::makeClipMixerFor(" << model << "): no sample, skipping" << endl;
         return 0;
     }
@@ -209,14 +209,14 @@
 
     float clipF0 = Pitch::getFrequencyForPitch(60, 0, 440.0f); // required
 
-    QString clipPath = QString("%1/%2.wav").arg(m_sampleDir).arg(sampleId);
+    QString clipPath = QString("%1/%2.wav").arg(m_sampleDir).arg(clipId);
 
     if (!mixer->loadClipData(clipPath, clipF0)) {
         delete mixer;
         return 0;
     }
 
-    std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): loaded clip " << sampleId << std::endl;
+    std::cerr << "AudioGenerator::makeClipMixerFor(" << model << "): loaded clip " << clipId << std::endl;
 
     return mixer;
 }
--- a/audioio/AudioGenerator.h	Tue Jan 07 15:50:04 2014 +0000
+++ b/audioio/AudioGenerator.h	Tue Jan 07 15:52:47 2014 +0000
@@ -93,7 +93,7 @@
     virtual void clearSoloModelSet();
 
 protected slots:
-    void playSampleIdChanged(const Playable *, QString);
+    void playClipIdChanged(const Playable *, QString);
 
 protected:
     size_t m_sourceSampleRate;
--- a/framework/SVFileReader.cpp	Tue Jan 07 15:50:04 2014 +0000
+++ b/framework/SVFileReader.cpp	Tue Jan 07 15:52:47 2014 +0000
@@ -1271,8 +1271,8 @@
         float gain = attributes.value("gain").toFloat(&ok);
         if (ok) parameters->setPlayGain(gain);
         
-        QString sampleId = attributes.value("sampleId");
-        if (sampleId != "") parameters->setPlaySampleId(sampleId);
+        QString clipId = attributes.value("clipId");
+        if (clipId != "") parameters->setPlayClipId(clipId);
         
         m_currentPlayParameters = parameters;
 
@@ -1332,8 +1332,8 @@
 
     QString ident = attributes.value("identifier");
     if (ident == "sample_player") {
-        QString sampleId = attributes.value("program");
-        if (sampleId != "") m_currentPlayParameters->setPlaySampleId(sampleId);
+        QString clipId = attributes.value("program");
+        if (clipId != "") m_currentPlayParameters->setPlayClipId(clipId);
     }
 
     return true;