Mercurial > hg > easaier-soundaccess
changeset 191:be6d31baecb9
compilation under linux - kunbuntu V7.10 (without video support)
line wrap: on
line diff
--- a/base/Profiler.h Tue Nov 27 13:26:04 2007 +0000 +++ b/base/Profiler.h Wed Nov 28 13:03:45 2007 +0000 @@ -23,12 +23,12 @@ #ifndef _PROFILER_H_ #define _PROFILER_H_ -#include "system/System.h" - #include <ctime> //#include <sys/time.h> #include <map> +#include "system/System.h" + #include "RealTime.h" //#define NO_TIMING 1
--- a/data/data.pro Tue Nov 27 13:26:04 2007 +0000 +++ b/data/data.pro Wed Nov 28 13:03:45 2007 +0000 @@ -1,15 +1,15 @@ TEMPLATE = lib -SV_UNIT_PACKAGES = fftw3f sndfile oggz fishsound +SV_UNIT_PACKAGES = fftw3f sndfile oggz fishsound mad jack load(../sv.prf) CONFIG += sv staticlib qt thread warn_on stl rtti exceptions -QT += network +QT += network xml TARGET = svdata DEPENDPATH += fft fileio model .. -INCLUDEPATH += . fft model fileio .. +INCLUDEPATH += . fft model fileio .. ../sv OBJECTS_DIR = tmp_obj MOC_DIR = tmp_moc @@ -63,7 +63,8 @@ model/AudioSourceInfoModel.h \ model/QueryModel.h \ model/IntervalModel.h \ - model/LayerItemModel.h + model/LayerItemModel.h \ + model/SDLWidget.h SOURCES += fft/FFTapi.cpp \ fft/FFTDataServer.cpp \ fft/FFTFileCache.cpp \ @@ -104,4 +105,5 @@ model/AudioSourceInfoModel.cpp \ model/QueryModel.cpp \ model/IntervalModel.cpp \ - model/LayerItemModel.cpp + model/LayerItemModel.cpp \ + model/SDLWidget.cpp
--- a/data/fft/FFTFileCache.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fft/FFTFileCache.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -13,16 +13,18 @@ COPYING included with this distribution for more information. */ -#include "FFTFileCache.h" - -#include "fileio/MatrixFile.h" - -#include "base/Profiler.h" - #include <iostream> #include <QMutexLocker> +#include "fileio/MatrixFile.h" +#include "base/Profiler.h" + +#include "FFTFileCache.h" + + + + // The underlying matrix has height (m_height * 2 + 1). In each // column we store magnitude at [0], [2] etc and phase at [1], [3] // etc, and then store the normalization factor (maximum magnitude) at
--- a/data/fft/FFTMemoryCache.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fft/FFTMemoryCache.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -13,10 +13,12 @@ COPYING included with this distribution for more information. */ -#include "FFTMemoryCache.h" +#include <iostream> +#include <vector> + #include "system/System.h" -#include <iostream> +#include "FFTMemoryCache.h" FFTMemoryCache::FFTMemoryCache() : m_width(0),
--- a/data/fileio/AudioFileReaderFactory.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/AudioFileReaderFactory.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -19,7 +19,9 @@ #include "OggVorbisFileReader.h" #include "MP3FileReader.h" //Ivan Damnjanovic 09-10/2007 added Video reader and control header +#ifdef HAVE_FFMPEG #include "VideoFileReader.h" +#endif // #include <QString> #include <QFileInfo>
--- a/data/fileio/VideoFileReader.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/VideoFileReader.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -10,69 +10,71 @@ published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. -*/ - -#ifdef HAVE_FFMPEG - - -//#include "system/System.h" - -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <cassert> - -#include <iostream> - -#include <QApplication> -#include <QFileInfo> -#include <QProgressDialog> - -#include "VideoFileReader.h" - +*/ + +#ifdef HAVE_FFMPEG + + +//#include "system/System.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <cassert> + +#include <iostream> + +#include <QApplication> +#include <QFileInfo> +#include <QProgressDialog> + +#include <avformat.h> + +#include "VideoFileReader.h" + #ifdef WIN32 #include <Windows.h> -#endif -long long countFreq; -int Videow=320; -int Videoh=240; -float zoomFivan=1; -VideoFileReader::VideoFileReader(QString path, bool showProgress, CacheMode mode) : - CodedAudioFileReader(mode), - m_path(path) -{ - m_frameCount = 0; - m_channelCount = 0; - m_sampleRate = 0; - m_fileSize = 0; - m_bitrateNum = 0; - m_bitrateDenom = 0; - m_cancelled = false; - m_zoomfactor = 1; - - struct stat stat; - if (::stat(path.toLocal8Bit().data(), &stat) == -1 || stat.st_size == 0) { - m_error = QString("File %1 does not exist.").arg(path); - return; - } +#endif +long long countFreq; +int Videow=320; +int Videoh=240; +float zoomFivan=1; +VideoFileReader::VideoFileReader(QString path, bool showProgress, CacheMode mode) : + CodedAudioFileReader(mode), + m_path(path) +{ + m_frameCount = 0; + m_channelCount = 0; + m_sampleRate = 0; + m_fileSize = 0; + m_bitrateNum = 0; + m_bitrateDenom = 0; + m_cancelled = false; + m_zoomfactor = 1; + + struct stat stat; + if (::stat(path.toLocal8Bit().data(), &stat) == -1 || stat.st_size == 0) { + m_error = QString("File %1 does not exist.").arg(path); + return; + } // standard SDL initialization stuff if(SDL_Init(SDL_INIT_VIDEO|SDL_DOUBLEBUF|SDL_INIT_AUDIO) < 0) { m_error = QString("Failed to open file %1 for reading.").arg(SDL_GetError()); return; - } - m_fileSize = stat.st_size; - - + } + m_fileSize = stat.st_size; + + // open file from arg[1] film = SDL_ffmpegOpen(path.toLocal8Bit().data()); if (path.endsWith("mpg")) film->delay=1; if (path.endsWith("divx")) film->delay=1; if(!film) - { - m_error = QString("Failed to open file %1 for reading.").arg(path); - return; - } + { + m_error = QString("Failed to open file %1 for reading.").arg(path); + return; + } // print some info on detected stream to output film->skipAudio=0; film->skipVideo=0; @@ -84,26 +86,26 @@ film->skipVideo=1; for(s = 0; s<film->AStreams; s++) str = SDL_ffmpegGetAudioStream(film, s); - - SDL_ffmpegSelectAudioStream(film, 0); - - - if (showProgress) { - m_progress = new QProgressDialog - (QObject::tr("Decoding %1...").arg(QFileInfo(path).fileName()), - QObject::tr("Stop"), 0, 100); - m_progress->hide(); - } - + + SDL_ffmpegSelectAudioStream(film, 0); + + + if (showProgress) { + m_progress = new QProgressDialog + (QObject::tr("Decoding %1...").arg(QFileInfo(path).fileName()), + QObject::tr("Stop"), 0, 100); + m_progress->hide(); + } + m_sampleRate=str->sampleRate; int channels=str->channels; m_channelCount=channels; SDL_ffmpegPause(film, 0); SDL_ffmpegStartDecoding(film); - if (!decodeAudio(film)) { - m_error = QString("Failed to decode audio from file %1 for reading.").arg(path); - return; + if (!decodeAudio(film)) { + m_error = QString("Failed to decode audio from file %1 for reading.").arg(path); + return; } film->skipAudio=1; //SDL_ffmpegSeek(film, 0); @@ -112,28 +114,28 @@ film->skipVideo=0; film->videoThread=SDL_CreateThread(videoPlayCall,this); - - - - - - if (showProgress) { - delete m_progress; - m_progress = 0; - } - - //delete[] filebuffer; -} - - -VideoFileReader::~VideoFileReader() -{ - film->videoThreadActive = 0; - if(film->videoThread) SDL_WaitThread(film->videoThread, 0); -} -bool -VideoFileReader::decodeAudio(SDL_ffmpegFile* file) -{ + + + + + + if (showProgress) { + delete m_progress; + m_progress = 0; + } + + //delete[] filebuffer; +} + + +VideoFileReader::~VideoFileReader() +{ + film->videoThreadActive = 0; + if(film->videoThread) SDL_WaitThread(film->videoThread, 0); +} +bool +VideoFileReader::decodeAudio(SDL_ffmpegFile* file) +{ int64_t duration=((AVFormatContext *)file->_ffmpeg)->duration; @@ -141,27 +143,27 @@ m_cancelled=false; int audio_ends=0; while((elapsed < duration)&&!m_cancelled ) { - - elapsed = double(m_frameCount)*1000000 /(m_channelCount*m_sampleRate); - double percent = (elapsed * 100) / duration; - int progress = int(percent); - if (progress < 1) progress = 1; - if (progress > 99) progress = 99; - if (progress > m_progress->value()) { - m_progress->setValue(progress); - m_progress->show(); - m_progress->raise(); - qApp->processEvents(); - if (m_progress->wasCanceled()) { - m_cancelled = true; - } - } - + + elapsed = double(m_frameCount)*1000000 /(m_channelCount*m_sampleRate); + double percent = (elapsed * 100) / duration; + int progress = int(percent); + if (progress < 1) progress = 1; + if (progress > 99) progress = 99; + if (progress > m_progress->value()) { + m_progress->setValue(progress); + m_progress->show(); + m_progress->raise(); + qApp->processEvents(); + if (m_progress->wasCanceled()) { + m_cancelled = true; + } + } + // we tell SDL_ffmpegGetAudio how many bytes we need, the function then // fills this pointer with the amount of bytes it could actually give int gotLength = 100000; - if (!isDecodeCacheInitialised()) { - initialiseDecodeCache(); + if (!isDecodeCacheInitialised()) { + initialiseDecodeCache(); } // we try to get some data from our file // important! this call is paired with SDL_ffmpegReleaseAudio @@ -186,11 +188,11 @@ } m_frameCount/=m_channelCount; if (isDecodeCacheInitialised()) finishDecodeCache(); - return true; -} -bool -VideoFileReader::videoInit(SDL_ffmpegFile* file) -{ + return true; +} +bool +VideoFileReader::videoInit(SDL_ffmpegFile* file) +{ int w,h; // we get the size from our active video stream, if no active video stream // exists, width and height are set to default values (320x240) @@ -216,15 +218,15 @@ if(!screen) { fprintf(stderr, "Couldn't open video: %s\n", SDL_GetError()); return false; - } - return true; -} - + } + return true; +} + int VideoFileReader::videoPlayCall(void *t) { return ((VideoFileReader *)t)->videoPlay(); -} - +} + void VideoFileReader::processEvents() { SDL_Event event; @@ -278,19 +280,19 @@ break; } } -} - -int -VideoFileReader::videoPlay() -{ +} + +int +VideoFileReader::videoPlay() +{ film->videoThreadActive = 1; MainWindow * MWins=MainWindow::instance(); if (!videoInit(film)) { - m_error = QString("Failed to failed to initalized video file for reading."); - return 0; + m_error = QString("Failed to failed to initalized video file for reading."); + return 0; } //const SDL_VideoInfo * vid=SDL_GetVideoInfo(); film->audioTime =0; @@ -364,19 +366,19 @@ // we wish not to kill our poor cpu, so we give it some timeoff // SDL_Delay(1); - } + } // after all is said and done, we should call this - SDL_ffmpegFree(film); - return 0; -} - -void -VideoFileReader::getSupportedExtensions(std::set<QString> &extensions) -{ - extensions.insert("mpg"); - extensions.insert("avi"); - extensions.insert("divx"); - extensions.insert("mov"); -} - -#endif + SDL_ffmpegFree(film); + return 0; +} + +void +VideoFileReader::getSupportedExtensions(std::set<QString> &extensions) +{ + extensions.insert("mpg"); + extensions.insert("avi"); + extensions.insert("divx"); + extensions.insert("mov"); +} + +#endif
--- a/data/fileio/VideoFileReader.h Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/VideoFileReader.h Wed Nov 28 13:03:45 2007 +0000 @@ -10,63 +10,64 @@ published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. -*/ - -#ifndef _VIDEO_FILE_READER_H_ -#define _VIDEO_FILE_READER_H_ - -#ifdef HAVE_FFMPEG +*/ + +#ifndef _VIDEO_FILE_READER_H_ +#define _VIDEO_FILE_READER_H_ + +#include <set> + +#ifdef HAVE_FFMPEG #ifdef __cplusplus extern "C" { -#endif -#include "SDL_ffmpeg.h" - +#endif /*__cplusplus*/ +#include "videoio/SDL_ffmpeg.h" + #ifdef __cplusplus } -#endif -#include "../../sv/main/MainWindow.h" -#include "CodedAudioFileReader.h" -//#include "base/AudioCallbackPlaySource.h" - - -#include <set> -//class AudioCallbackPlaySource; -class QProgressDialog; - -class VideoFileReader : public CodedAudioFileReader -{ -public: - VideoFileReader(QString path, bool showProgress, CacheMode cacheMode); - virtual ~VideoFileReader(); - - virtual QString getError() const { return m_error; } - - static void getSupportedExtensions(std::set<QString> &extensions); - void VideoFileReader::processEvents(); - -protected: - QString m_path; - QString m_error; - size_t m_fileSize; - double m_bitrateNum; - size_t m_bitrateDenom; - SDL_Surface *screen; - SDL_ffmpegFile* film; - QProgressDialog *m_progress; +#endif /*__cplusplus*/ + +#include "../../sv/main/MainWindow.h" +#include "CodedAudioFileReader.h" +//#include "base/AudioCallbackPlaySource.h" + +//class AudioCallbackPlaySource; +class QProgressDialog; + +class VideoFileReader : public CodedAudioFileReader +{ +public: + VideoFileReader(QString path, bool showProgress, CacheMode cacheMode); + virtual ~VideoFileReader(); + + virtual QString getError() const { return m_error; } + + static void getSupportedExtensions(std::set<QString> &extensions); + void processEvents(); + +protected: + QString m_path; + QString m_error; + size_t m_fileSize; + double m_bitrateNum; + size_t m_bitrateDenom; + SDL_Surface *screen; + SDL_ffmpegFile* film; + QProgressDialog *m_progress; bool m_cancelled; int m_width; int m_height; float m_zoomfactor; - - - bool decodeAudio(SDL_ffmpegFile* file); - bool videoInit(SDL_ffmpegFile* file); - int videoPlay(); - static int videoPlayCall(void*); -}; - -#endif - -#endif \ No newline at end of file + + + bool decodeAudio(SDL_ffmpegFile* file); + bool videoInit(SDL_ffmpegFile* file); + int videoPlay(); + static int videoPlayCall(void*); +}; + +#endif /*HAVE_FFMPEG*/ + +#endif /*_VIDEO_FILE_READER_H_*/ \ No newline at end of file
--- a/data/fileio/VideoFileReaderFactory.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/VideoFileReaderFactory.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -13,13 +13,17 @@ COPYING included with this distribution for more information. */ -#include "VideoFileReaderFactory.h" +#ifdef HAVE_FFMPEG + +#include <iostream> +#include <set> + +#include <QString> +#include <QFileInfo> #include "VideoFileReader.h" -#include <QString> -#include <QFileInfo> -#include <iostream> +#include "VideoFileReaderFactory.h" QString VideoFileReaderFactory::getKnownExtensions() @@ -112,3 +116,4 @@ return 0; } */ +#endif
--- a/data/fileio/VideoFileReaderFactory.h Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/VideoFileReaderFactory.h Wed Nov 28 13:03:45 2007 +0000 @@ -16,6 +16,8 @@ #ifndef _VIDEO_FILE_READER_FACTORY_H_ #define _VIDEO_FILE_READER_FACTORY_H_ +#ifdef HAVE_FFMPEG + #include <QString> class VideoFileReader; @@ -43,3 +45,5 @@ #endif +#endif +
--- a/data/fileio/WavFileWriter.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/data/fileio/WavFileWriter.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -101,7 +101,7 @@ for (size_t f = f0; f < f1; f += bs) { - size_t n = min(bs, f1 - f); + size_t n = MIN(bs, f1 - f); for (int c = 0; c < int(m_channels); ++c) { source->getValues(c, f, f + n, ub);
--- a/layer/Colour3DPlotLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/Colour3DPlotLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -324,7 +324,7 @@ } } if (another) { - tw = max(tw, paint.fontMetrics().width(sampleText)); + tw = MAX(tw, paint.fontMetrics().width(sampleText)); } return tw + 13 + getColourScaleWidth(paint); @@ -734,7 +734,7 @@ if (sy == sy1i) prop *= sy1 - sy; mag += prop * m_cache->pixelIndex(scx, sy); - max = max(max, m_cache->pixelIndex(scx, sy)); + max = MAX(max, m_cache->pixelIndex(scx, sy)); div += prop; } }
--- a/layer/SliceLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/SliceLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -437,10 +437,10 @@ SliceLayer::getVerticalScaleWidth(View *, QPainter &paint) const { if (m_energyScale == LinearScale) { - return max(paint.fontMetrics().width("0.0") + 13, + return MAX(paint.fontMetrics().width("0.0") + 13, paint.fontMetrics().width("x10-10")); } else { - return max(paint.fontMetrics().width(tr("0dB")), + return MAX(paint.fontMetrics().width(tr("0dB")), paint.fontMetrics().width(tr("-Inf"))) + 13; } }
--- a/layer/SpectrogramLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/SpectrogramLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -13,6 +13,13 @@ COPYING included with this distribution for more information. */ +#include <iostream> + +#include <cassert> +#include <cmath> + +#include "system/System.h" + #include "SpectrogramLayer.h" #include "view/View.h" @@ -32,11 +39,6 @@ #include <QApplication> #include <QMessageBox> -#include <iostream> - -#include <cassert> -#include <cmath> - //#define DEBUG_SPECTROGRAM_REPAINT 1 SpectrogramLayer::SpectrogramLayer(Configuration config) : @@ -2014,8 +2016,8 @@ /*float ymag[h]; float ydiv[h]; float yval[maxbin + 1]; //!!! cache this?*/ - float *ymag = (float*) malloc(h*sizeof(float)); - float *ydiv = (float*) malloc(h*sizeof(float)); + float *ymag = (float*) malloc(h*sizeof(float)); + float *ydiv = (float*) malloc(h*sizeof(float)); float *yval = (float*) malloc((maxbin + 1)*sizeof(float)); size_t increment = getWindowIncrement(); @@ -2811,7 +2813,7 @@ paint.drawLine(cw + 7, h - vy, w - pkw - 1, h - vy); if (h - vy - textHeight >= -2) { - int tx = w - 3 - paint.fontMetrics().width(text) - max(tickw, pkw); + int tx = w - 3 - paint.fontMetrics().width(text) - MAX(tickw, pkw); paint.drawText(tx, h - vy + toff, text); } @@ -3034,26 +3036,26 @@ return Layer::toXmlString(indent, extraAttributes + " " + s); } -QString -SpectrogramLayer::toEasaierXmlString(QString indent, QString extraAttributes) const -{ - QString s; - - s += QString("channel=\"%1\" " - "windowSize=\"%2\" " - "windowType=\"%3\" " - "windowHopLevel=\"%4\" " - "gain=\"%5\" " - "threshold=\"%6\" ") - .arg(m_channel) - .arg(m_windowSize) - .arg(m_windowType) - .arg(m_windowHopLevel) - .arg(m_gain) - .arg(m_threshold); - - - +QString +SpectrogramLayer::toEasaierXmlString(QString indent, QString extraAttributes) const +{ + QString s; + + s += QString("channel=\"%1\" " + "windowSize=\"%2\" " + "windowType=\"%3\" " + "windowHopLevel=\"%4\" " + "gain=\"%5\" " + "threshold=\"%6\" ") + .arg(m_channel) + .arg(m_windowSize) + .arg(m_windowType) + .arg(m_windowHopLevel) + .arg(m_gain) + .arg(m_threshold); + + + s += QString("minFrequency=\"%1\" " "maxFrequency=\"%2\" " "colourScale=\"%3\" " @@ -3071,9 +3073,9 @@ .arg(m_frequencyScale) .arg(m_binDisplay) .arg(m_normalizeColumns ? "true" : "false") - .arg(m_normalizeVisibleArea ? "true" : "false"); - - return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); + .arg(m_normalizeVisibleArea ? "true" : "false"); + + return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); } void
--- a/layer/SpectrumLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/SpectrumLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -271,7 +271,7 @@ QString hzstr; int minfreq = lrintf((minbin * m_sliceableModel->getSampleRate()) / m_windowSize); - int maxfreq = lrintf((max(maxbin, minbin+1) + int maxfreq = lrintf((MAX(maxbin, minbin+1) * m_sliceableModel->getSampleRate()) / m_windowSize);
--- a/layer/WaveformLayer.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/layer/WaveformLayer.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -735,7 +735,7 @@ if (maxIndex > index && maxIndex < otherChannelRanges->size()) { // let's not concern ourselves about the mean - range.min = min + range.min = MIN (range.min, -fabsf((*otherChannelRanges)[maxIndex].max)); } @@ -979,7 +979,7 @@ max = float(imax)/1000; } - int db = int(AudioLevel::multiplier_to_dB(max(fabsf(range.min), + int db = int(AudioLevel::multiplier_to_dB(MAX(fabsf(range.min), fabsf(range.max))) * 100); @@ -1039,7 +1039,7 @@ if (m_scale == LinearScale) { return paint.fontMetrics().width("0.0") + 13; } else { - return max(paint.fontMetrics().width(tr("0dB")), + return MAX(paint.fontMetrics().width(tr("0dB")), paint.fontMetrics().width(tr("-Inf"))) + 13; } } @@ -1192,31 +1192,31 @@ return Layer::toXmlString(indent, extraAttributes + " " + s); } -QString -WaveformLayer::toEasaierXmlString(QString indent, QString extraAttributes) const -{ - QString s; - - s += QString("gain=\"%1\" " - "colour=\"%2\" " - "showMeans=\"%3\" " - "greyscale=\"%4\" " - "channelMode=\"%5\" " - "channel=\"%6\" " - "scale=\"%7\" " - "aggressive=\"%8\" " - "autoNormalize=\"%9\"") - .arg(m_gain) - .arg(encodeColour(m_colour)) - .arg(m_showMeans) - .arg(m_greyscale) - .arg(m_channelMode) - .arg(m_channel) - .arg(m_scale) - .arg(m_aggressive) - .arg(m_autoNormalize); - - return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); +QString +WaveformLayer::toEasaierXmlString(QString indent, QString extraAttributes) const +{ + QString s; + + s += QString("gain=\"%1\" " + "colour=\"%2\" " + "showMeans=\"%3\" " + "greyscale=\"%4\" " + "channelMode=\"%5\" " + "channel=\"%6\" " + "scale=\"%7\" " + "aggressive=\"%8\" " + "autoNormalize=\"%9\"") + .arg(m_gain) + .arg(encodeColour(m_colour)) + .arg(m_showMeans) + .arg(m_greyscale) + .arg(m_channelMode) + .arg(m_channel) + .arg(m_scale) + .arg(m_aggressive) + .arg(m_autoNormalize); + + return Layer::toEasaierXmlString(indent, extraAttributes + " " + s); } void
--- a/plugin/DSSIPluginInstance.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/plugin/DSSIPluginInstance.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -255,7 +255,7 @@ #endif } - m_outputBufferCount = max(m_idealChannelCount, m_audioPortsOut.size()); + m_outputBufferCount = MAX(m_idealChannelCount, m_audioPortsOut.size()); } size_t
--- a/plugin/plugin.pro Tue Nov 27 13:26:04 2007 +0000 +++ b/plugin/plugin.pro Wed Nov 28 13:03:45 2007 +0000 @@ -1,6 +1,6 @@ TEMPLATE = lib -SV_UNIT_PACKAGES = vamp vamp-hostsdk lrdf raptor +SV_UNIT_PACKAGES = lrdf raptor load(../sv.prf) CONFIG += sv staticlib qt thread warn_on stl rtti exceptions
--- a/sound-access.pro Tue Nov 27 13:26:04 2007 +0000 +++ b/sound-access.pro Wed Nov 28 13:03:45 2007 +0000 @@ -1,8 +1,7 @@ TEMPLATE = subdirs -SUBDIRS = base data layer plugin view widgets system sv +SUBDIRS = system base data layer plugin view widgets sv TRANSLATIONS += i18n/sound-access_ru.ts \ i18n/sound-access_fr.ts -
--- a/sv.prf Tue Nov 27 13:26:04 2007 +0000 +++ b/sv.prf Wed Nov 28 13:03:45 2007 +0000 @@ -25,8 +25,8 @@ # pkg-config, edit the "If you don't have pkg-config" block below (see # comments). # -#PKGCONFIG_PACKAGES = vamp vamp-hostsdk oggz fishsound mad fftw3f sndfile samplerate lrdf raptor jack liblo -PKGCONFIG_PACKAGES = vamp vamp-hostsdk oggz fishsound fftw3f sndfile samplerate lrdf raptor liblo +PKGCONFIG_PACKAGES = vamp vamp-hostsdk oggz fishsound mad fftw3f sndfile samplerate lrdf raptor jack liblo sdl +#PKGCONFIG_PACKAGES = vamp-hostsdk oggz fishsound fftw3f sndfile samplerate lrdf raptor liblo sdl # No pkg-config test for the bzip2 library. This library is required. # If you don't have it, install it. @@ -38,14 +38,24 @@ # We support PortAudio v18 and v19; the default is v19. If you want to use # v18, see below. # -DEFINES += HAVE_PORTAUDIO -LIBS += -lportaudio +#DEFINES += HAVE_PORTAUDIO +#LIBS += -lportaudio # # If you want to use PortAudio v18, uncomment this line (as well as # HAVE_PORTAUDIO above): # #DEFINES += HAVE_PORTAUDIO_V18 +# No pkg-config test for ffmpeg. If you don't have it, comment these out. +#DEFINES += HAVE_FFMPEG +#LIBS += -lavcodec -lavutil -lavformat -lswscale +#INCLUDEPATH += /usr/include/ffmpeg + +DEFINES += HAVE_VAMP # Required -- for analysis plugins +DEFINES += HAVE_VAMP_HOSTSDK # Required -- for analysis plugins +INCLUDEPATH += $(EASAIER_UTILS_DIR)/vamp-sdk/vamp-plugin-sdk-v1.1b +LIBPATH += $(EASAIER_UTILS_DIR)/vamp-sdk/vamp-plugin-sdk-v1.1b/vamp-sdk +LIBS += -lvamp-hostsdk !system(pkg-config --atleast-pkgconfig-version=0) { @@ -54,15 +64,17 @@ # able to ignore all this provided the right symbols are defined # in PKGCONFIG_PACKAGES above. # - #DEFINES += HAVE_JACK # Optional -- an audio playback option + DEFINES += HAVE_JACK # Optional -- an audio playback option DEFINES += HAVE_OGGZ # Optional -- to import .ogg files DEFINES += HAVE_FISHSOUND # Optional -- to import .ogg files - #DEFINES += HAVE_MAD # Optional -- to import .mp3 files + DEFINES += HAVE_MAD # Optional -- to import .mp3 files DEFINES += HAVE_FFTW3F # Optional -- but SV will be slower without it + # # - #LIBS += -ljack + LIBS += -ljack LIBS += -loggz -lfishsound - #LIBS += -lmad + LIBS += -lmad + # These ones are mandatory. # If you don't have them, you'll have to find them. @@ -72,8 +84,8 @@ DEFINES += HAVE_SNDFILE # Required -- to import and export .wav files DEFINES += HAVE_SAMPLERATE # Required -- for resampling # - INCLUDEPATH += ../../vamp-plugin-sdk - LIBPATH += ../../vamp-plugin-sdk/vamp-sdk + #INCLUDEPATH += ../../../../utils/vamp-sdk/vamp-plugin-sdk-v1.1b + #LIBPATH += ../../../../utils/vamp-sdk/vamp-plugin-sdk-v1.1b/vamp-sdk # LIBS += -lvamp-hostsdk -lfftw3f -lsndfile -lsamplerate }
--- a/sv/audioio/AudioCallbackPlaySource.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/audioio/AudioCallbackPlaySource.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -922,7 +922,7 @@ orig = (orig / generatorBlockSize) * generatorBlockSize; if (orig == 0) return false; - size_t work = max(orig, space); + size_t work = MAX(orig, space); // We only allocate one buffer, but we use it in two halves. // We place the non-interleaved values in the second half of
--- a/sv/document/Document.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/document/Document.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -88,10 +88,10 @@ } } - if (m_audioSourceInfoModel) - { - delete m_audioSourceInfoModel; - m_audioSourceInfoModel = 0; + if (m_audioSourceInfoModel) + { + delete m_audioSourceInfoModel; + m_audioSourceInfoModel = 0; } emit modelAboutToBeDeleted(m_mainModel); @@ -281,7 +281,7 @@ continue; } - if ((m_models[model].source == oldMainModel) && (m_models[model].transform != "")) { + if ((m_models[model].source == oldMainModel) && (m_models[model].transform != "")) { //if (m_models[model].source == oldMainModel) { //correct the bug if a layer and model is load before the main model // std::cerr << "... it uses a model derived from the old main model, regenerating" << std::endl; @@ -337,10 +337,10 @@ oldMainModel = 0; } -void Document::setAudioSourceInfoModel(AudioSourceInfoModel *infoModel) -{ - m_audioSourceInfoModel = infoModel; - emit audioSourceInfoAdded(m_audioSourceInfoModel); +void Document::setAudioSourceInfoModel(AudioSourceInfoModel *infoModel) +{ + m_audioSourceInfoModel = infoModel; + emit audioSourceInfoAdded(m_audioSourceInfoModel); } void @@ -894,32 +894,33 @@ return s; } -QString -Document::toEasaierXmlString(QString indent, QString extraAttributes) const -{ - QString s; - - s += indent + QString("<data%1%2>\n") - .arg(extraAttributes == "" ? "" : " ").arg(extraAttributes); - - s += indent + indent + QString("<easaierResources>\n"); - - s += indent + indent + indent + QString("<audio value=\"%1\" >\n") - .arg(getAudioSourceInfoFileName()); - - s += indent + indent + indent + QString("</audio>\n"); - - s += indent + indent + QString("</easaierResources>\n"); - - s += indent + "</data>\n"; - - return s; +QString +Document::toEasaierXmlString(QString indent, QString extraAttributes) const +{ + QString s; + + s += indent + QString("<data%1%2>\n") + .arg(extraAttributes == "" ? "" : " ").arg(extraAttributes); + + s += indent + indent + QString("<easaierResources>\n"); + + s += indent + indent + indent + QString("<audio value=\"%1\" >\n") + .arg(getAudioSourceInfoFileName()); + + s += indent + indent + indent + QString("</audio>\n"); + + s += indent + indent + QString("</easaierResources>\n"); + + s += indent + "</data>\n"; + + return s; } Filter * Document::createFilter(RealTimeFilterFactory::FilterType type) { - if (!m_filterStack->allowOtherFilter(RealTimeFilterFactory::getFilterLabel(type))) + QString filterLabel(RealTimeFilterFactory::getFilterLabel(type)); + if (!m_filterStack->allowOtherFilter(filterLabel)) { QMessageBox::warning(MainWindow::instance(), tr("Filter already exists"), tr("This filter already exits. Only one type of filter %1 is allowed").arg(RealTimeFilterFactory::getFilterLabel(type)));
--- a/sv/filter/FilterStack.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/filter/FilterStack.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -29,13 +29,13 @@ { std::map<int, Filter *>::iterator iter; - for ( iter = m_filters.begin(); iter != m_filters.end(); iter++) - { - Filter * filter = iter->second; - if (name.contains(filter->objectName())) - { - return filter; - } + for ( iter = m_filters.begin(); iter != m_filters.end(); iter++) + { + Filter * filter = iter->second; + if (name.contains(filter->objectName())) + { + return filter; + } } return 0; } @@ -48,145 +48,146 @@ emit newFilterAdded(filter); } -void FilterStack::putInput(float **input, size_t samples) -{ - //only process the first filter, should pass in all filters !!! - std::map<int, Filter *>::iterator iter = m_filters.begin(); - - if (iter != m_filters.end()) - { - Filter * filter = iter->second; - if(filter->isFilterEnabled()){ - filter->putInput(input, samples); - } - } -} - -void FilterStack::getOutput(float **output, size_t samples) -{ - //only process the first filter, should pass in all filters !!! - std::map<int, Filter *>::iterator iter = m_filters.begin(); - - if (iter != m_filters.end()) - { - Filter * filter = iter->second; - if(filter->isFilterEnabled()){ - filter->getOutput(output, samples); - } - } -} - -QString FilterStack::getUniqueFilterName(QString candidate) -{ - for (int count = 1; ; ++count) { - - QString adjusted = - (count > 1 ? QString("%1 <%2>").arg(candidate).arg(count) : - candidate); - - bool duplicate = false; - - for (std::map<int, Filter *>::iterator i = m_filters.begin(); i != m_filters.end(); ++i) { - Filter * filter = i->second; - if (filter->objectName() == adjusted) { - duplicate = true; - break; - } - } - - if (!duplicate) return adjusted; - } -} - -void FilterStack::removeFilter(QString &name) -{ - std::map<int, Filter *>::iterator iter; - - for (iter = m_filters.begin(); iter != m_filters.end(); iter++) - { - Filter * filter = iter->second; - if (filter->objectName() == name) - { - delete filter; - m_filters.erase(iter); - emit filterRemoved(name); - filter = 0; - return; - } - } -} - -void FilterStack::removeAllFilters() -{ - while (!m_filters.empty()) - { - Filter * filter = m_filters.begin()->second; - removeFilter(filter->objectName()); - } - m_filters.clear(); - m_count = 0; -} - -size_t FilterStack::getRequiredInputSamples(size_t outputSamplesNeeded) -{ - size_t max = 0; - - std::map<int, Filter *>::iterator iter; - - for (iter = m_filters.begin(); iter != m_filters.end(); iter++) - { - Filter * filter = iter->second; - size_t required = filter->getRequiredInputSamples(outputSamplesNeeded); - if ( (required > max) && (filter->isFilterEnabled()) ) - { - max = required; - } - } - return max; -} - -size_t FilterStack::getRequiredSkipSamples() -{ - size_t skip = 1024; - - std::map<int, Filter *>::iterator iter; - - for (iter = m_filters.begin(); iter != m_filters.end(); iter++) - { - // find the time filter - Filter * filter = iter->second; - if (filter->objectName() == "Pitch-Time Stretching") - { - TimeStretchFilter * timefilter = (TimeStretchFilter *) filter; - if (filter->isFilterEnabled()) { - skip = timefilter->getRequiredSkipSamples(); - } - } - } - return skip; -} - -void FilterStack::setSourceChannelCount(size_t channel) -{ - m_sourceChannelCount = channel; - - std::map<int, Filter *>::iterator iter; - - for (iter = m_filters.begin(); iter != m_filters.end(); iter++) - { - Filter * filter = iter->second; - filter->setSourceChannelCount(m_sourceChannelCount); - } - -} - -bool FilterStack::allowOtherFilter(QString &labelType) -{ - Filter* filter = findFilter(labelType); - if ( (filter) && (!filter->allowMultiple()) ) - { - return false; - } - - return true; +void FilterStack::putInput(float **input, size_t samples) +{ + //only process the first filter, should pass in all filters !!! + std::map<int, Filter *>::iterator iter = m_filters.begin(); + + if (iter != m_filters.end()) + { + Filter * filter = iter->second; + if(filter->isFilterEnabled()){ + filter->putInput(input, samples); + } + } +} + +void FilterStack::getOutput(float **output, size_t samples) +{ + //only process the first filter, should pass in all filters !!! + std::map<int, Filter *>::iterator iter = m_filters.begin(); + + if (iter != m_filters.end()) + { + Filter * filter = iter->second; + if(filter->isFilterEnabled()){ + filter->getOutput(output, samples); + } + } +} + +QString FilterStack::getUniqueFilterName(QString candidate) +{ + for (int count = 1; ; ++count) { + + QString adjusted = + (count > 1 ? QString("%1 <%2>").arg(candidate).arg(count) : + candidate); + + bool duplicate = false; + + for (std::map<int, Filter *>::iterator i = m_filters.begin(); i != m_filters.end(); ++i) { + Filter * filter = i->second; + if (filter->objectName() == adjusted) { + duplicate = true; + break; + } + } + + if (!duplicate) return adjusted; + } +} + +void FilterStack::removeFilter(QString &name) +{ + std::map<int, Filter *>::iterator iter; + + for (iter = m_filters.begin(); iter != m_filters.end(); iter++) + { + Filter * filter = iter->second; + if (filter->objectName() == name) + { + delete filter; + m_filters.erase(iter); + emit filterRemoved(name); + filter = 0; + return; + } + } +} + +void FilterStack::removeAllFilters() +{ + while (!m_filters.empty()) + { + Filter * filter = m_filters.begin()->second; + QString filterName(filter->objectName()); + removeFilter(filterName); + } + m_filters.clear(); + m_count = 0; +} + +size_t FilterStack::getRequiredInputSamples(size_t outputSamplesNeeded) +{ + size_t max = 0; + + std::map<int, Filter *>::iterator iter; + + for (iter = m_filters.begin(); iter != m_filters.end(); iter++) + { + Filter * filter = iter->second; + size_t required = filter->getRequiredInputSamples(outputSamplesNeeded); + if ( (required > max) && (filter->isFilterEnabled()) ) + { + max = required; + } + } + return max; +} + +size_t FilterStack::getRequiredSkipSamples() +{ + size_t skip = 1024; + + std::map<int, Filter *>::iterator iter; + + for (iter = m_filters.begin(); iter != m_filters.end(); iter++) + { + // find the time filter + Filter * filter = iter->second; + if (filter->objectName() == "Pitch-Time Stretching") + { + TimeStretchFilter * timefilter = (TimeStretchFilter *) filter; + if (filter->isFilterEnabled()) { + skip = timefilter->getRequiredSkipSamples(); + } + } + } + return skip; +} + +void FilterStack::setSourceChannelCount(size_t channel) +{ + m_sourceChannelCount = channel; + + std::map<int, Filter *>::iterator iter; + + for (iter = m_filters.begin(); iter != m_filters.end(); iter++) + { + Filter * filter = iter->second; + filter->setSourceChannelCount(m_sourceChannelCount); + } + +} + +bool FilterStack::allowOtherFilter(QString &labelType) +{ + Filter* filter = findFilter(labelType); + if ( (filter) && (!filter->allowMultiple()) ) + { + return false; + } + + return true; } \ No newline at end of file
--- a/sv/main/EasaierSessionManager.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/main/EasaierSessionManager.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -17,15 +17,15 @@ #include <QMessageBox> #include <QTextStream> #include <iostream> -#include <QStatusBar> -#include <vector> - -#include <QApplication> -#include <Qt> -#include <QUrl> +#include <QStatusBar> +#include <vector> + +#include <QApplication> +#include <Qt> +#include <QUrl> #include "layer/Layer.h" -#include "base/TempDirectory.h" +#include "base/TempDirectory.h" #include "data/fileio/AudioSourceInfoReader.h" #include "data/fileio/ModelReader.h" #include "data/fileio/QueryConfigReader.h" @@ -118,9 +118,9 @@ m_audioSourceInfoModel = 0; while (!m_loadFile.empty()) - { - m_loadFile.begin()->second->close(); - delete m_loadFile.begin()->second; + { + m_loadFile.begin()->second->close(); + delete m_loadFile.begin()->second; m_loadFile.erase(m_loadFile.begin()); } @@ -152,19 +152,19 @@ QUrl url(queryAux); QString query = QString(url.toEncoded()); - QString directory = filename.left(filename.lastIndexOf("/")); - QString file = filename.right(filename.length() - filename.lastIndexOf("/")); - - if (directory.left(1) == "/") - { - directory.remove(0, 1); - } - - //create the subdirectory in local - QString localPath = TempDirectory::getInstance()->getSubDirectoryPath(directory); - localPath.append(file); - - LoadedFile* newFile = new LoadedFile(localPath); + QString directory = filename.left(filename.lastIndexOf("/")); + QString file = filename.right(filename.length() - filename.lastIndexOf("/")); + + if (directory.left(1) == "/") + { + directory.remove(0, 1); + } + + //create the subdirectory in local + QString localPath = TempDirectory::getInstance()->getSubDirectoryPath(directory); + localPath.append(file); + + LoadedFile* newFile = new LoadedFile(localPath); newFile->setFileType(type); newFile->setUri(filename); @@ -226,48 +226,48 @@ } //read and load (in m_document) the file according to its type - switch (type) { - - case LoadedFile::AUDIO_SOURCE_INFO : - { - m_audioSourceInfoModel = new AudioSourceInfoModel(); - AudioSourceInfoReader audioSourceInfoReader(m_audioSourceInfoModel); - read = audioSourceInfoReader.parse(filename); - if (read) - { - m_document->setAudioSourceInfoModel(m_audioSourceInfoModel); - loadRelatedModel(); - } - break; - } - case LoadedFile::MODEL : - { - QString modelName = m_audioSourceInfoModel->getKey(uri); - - read = addModelToLayers(modelName, filename); - - break; + switch (type) { + + case LoadedFile::AUDIO_SOURCE_INFO : + { + m_audioSourceInfoModel = new AudioSourceInfoModel(); + AudioSourceInfoReader audioSourceInfoReader(m_audioSourceInfoModel); + read = audioSourceInfoReader.parse(filename); + if (read) + { + m_document->setAudioSourceInfoModel(m_audioSourceInfoModel); + loadRelatedModel(); + } + break; } - case LoadedFile::METADATA : - { - ModelReader modelReader(m_document,0, m_currentPane); - read = modelReader.parse(filename); - - break; + case LoadedFile::MODEL : + { + QString modelName = m_audioSourceInfoModel->getKey(uri); + + read = addModelToLayers(modelName, filename); + + break; } - case LoadedFile::QUERY_CONFIG : - { - QueryConfigReader reader(m_queryModel); - bool ok = reader.parse(filename); - - if (ok) - emit queryModelLoaded(m_queryModel); - - read = ok; - break; + case LoadedFile::METADATA : + { + ModelReader modelReader(m_document,0, m_currentPane); + read = modelReader.parse(filename); + + break; } - case LoadedFile::QUERY_RESULTS : - { + case LoadedFile::QUERY_CONFIG : + { + QueryConfigReader reader(m_queryModel); + bool ok = reader.parse(filename); + + if (ok) + emit queryModelLoaded(m_queryModel); + + read = ok; + break; + } + case LoadedFile::QUERY_RESULTS : + { QueryResultsWidget* resultsWidget = MainWindow::instance()->getQueryResultsWidget(); resultsWidget->reset(); @@ -275,8 +275,8 @@ { SparqlResultsReader reader(resultsWidget); read = reader.parse(filename); - } - break; + } + break; } case LoadedFile::RELATED_MEDIA_LIST : { @@ -380,19 +380,23 @@ if (iterModel == addedModel.end()) { - QString extension = filename.right(filename.length()-filename.lastIndexOf(".")-1); - if (AudioFileReaderFactory::isKnownExtensions(extension)) - { - WaveFileModel *model = new WaveFileModel(filename); - m_document->setMainModel(model); - addedModel[modelName] = (Model* ) model; - ok = true; - } else if (VideoFileReaderFactory::isKnownExtensions(extension)) + QString extension = filename.right(filename.length()-filename.lastIndexOf(".")-1); + if (AudioFileReaderFactory::isKnownExtensions(extension)) + { + WaveFileModel *model = new WaveFileModel(filename); + m_document->setMainModel(model); + addedModel[modelName] = (Model* ) model; + ok = true; + } +#ifdef HAVE_FFMPEG + else if (VideoFileReaderFactory::isKnownExtensions(extension)) { ok = !(MainWindow::instance()->openVideoFile(filename, MainWindow::ReplaceMainModel)); - } else + } +#endif + else { - ModelReader modelReader(m_document, layer); + ModelReader modelReader(m_document, layer); ok = modelReader.parse(filename); } }
--- a/sv/main/MainWindow.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/main/MainWindow.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -3577,35 +3577,37 @@ m_playSource->hardwareBufferedTime=0; m_playSource->lastAudioTime=0; } -// Ivan Damnjanovic 16/10/2007 functions to access data needed for video player -unsigned long -MainWindow::Get_CurAudioTime() -{ - unsigned long pos; - unsigned long newAudioTime=m_viewManager->getPlaybackFrame()/(getMainModel()->getSampleRate()/1000); - if(!(m_playSource->lastAudioTime==newAudioTime)) - { - m_playSource->lastAudioTime=newAudioTime; +// Ivan Damnjanovic 16/10/2007 functions to access data needed for video player +#ifdef HAVE_FFMPEG +unsigned long +MainWindow::Get_CurAudioTime() +{ + unsigned long pos; + unsigned long newAudioTime=m_viewManager->getPlaybackFrame()/(getMainModel()->getSampleRate()/1000); + if(!(m_playSource->lastAudioTime==newAudioTime)) + { + m_playSource->lastAudioTime=newAudioTime; long long cntClick; QueryPerformanceCounter((LARGE_INTEGER *)(&cntClick)); - m_playSource->hardwareBufferedTime=cntClick; - pos=0; - } - else - { + m_playSource->hardwareBufferedTime=cntClick; + pos=0; + } + else + { long long timeTemp; QueryPerformanceCounter((LARGE_INTEGER *)(&timeTemp)); - pos=(timeTemp-m_playSource->hardwareBufferedTime)/(countFreq); - pos*=getPlaySpeedVal(); - } - return (newAudioTime+pos); -} -unsigned long long -MainWindow::Get_HardwareBufferTime() -{ - return (m_playSource->hardwareBufferedTime); -} + pos=(timeTemp-m_playSource->hardwareBufferedTime)/(countFreq); + pos*=getPlaySpeedVal(); + } + return (newAudioTime+pos); +} +#endif +unsigned long long +MainWindow::Get_HardwareBufferTime() +{ + return (m_playSource->hardwareBufferedTime); +} bool MainWindow::isAudioPlaying() { return (m_playSource->isPlaying());
--- a/sv/sv.pro Tue Nov 27 13:26:04 2007 +0000 +++ b/sv/sv.pro Wed Nov 28 13:03:45 2007 +0000 @@ -1,7 +1,7 @@ TEMPLATE = app -SV_UNIT_PACKAGES = vamp vamp-hostsdk fftw3f samplerate portaudio oggz fishsound lrdf raptor sndfile liblo +SV_UNIT_PACKAGES = vamp vamp-hostsdk fftw3f samplerate portaudio oggz fishsound lrdf raptor sndfile liblo sdl mad jack load(../sv.prf) CONFIG += sv qt thread warn_on stl rtti exceptions
--- a/system/System.h Tue Nov 27 13:26:04 2007 +0000 +++ b/system/System.h Wed Nov 28 13:03:45 2007 +0000 @@ -165,6 +165,9 @@ #else /* ! _WIN32 */ +#include <sys/time.h> +#include <stdint.h> + #include <sys/mman.h> #include <dlfcn.h>
--- a/view/Overview.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/view/Overview.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -213,8 +213,8 @@ if (newCentreFrame > 0) --newCentreFrame; } - if (max(m_centreFrame, newCentreFrame) - - min(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) { + if (MAX(m_centreFrame, newCentreFrame) - + MIN(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) { emit centreFrameChanged(newCentreFrame, true, PlaybackScrollContinuous); } }
--- a/view/ViewManager.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/view/ViewManager.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -372,7 +372,7 @@ if (m_playSource && m_playSource->isPlaying()) { unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); - unsigned long diff = max(f, playFrame) - min(f, playFrame); + unsigned long diff = MAX(f, playFrame) - MIN(f, playFrame); if (diff > 20000) { m_playbackFrame = f; m_playSource->play(f);
--- a/widgets/ListResultGeneralItemWidget.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/widgets/ListResultGeneralItemWidget.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -21,22 +21,22 @@ #include <iostream> ListResultGeneralItemWidget::ListResultGeneralItemWidget(QWidget *parent):QWidget(parent){ - vLayout1 = new QVBoxLayout(); - vLayout2 = new QVBoxLayout(); - hLayout1 = new QHBoxLayout(); - hLayout2 = new QHBoxLayout(); - hLayout3 = new QHBoxLayout(); - m_waitingWidget = new WaitingWidget(); - - m_labelRank = new QLabel(); - m_labelIcon = new QLabel(); - m_labelTitleArtist = new QLabel(); - label4 = new QLabel(""); // for the icons - label5 = new QLabel(""); // for the options - - m_buttonPrev = new QPushButton(); - m_buttonSimilar = new QPushButton(); - + vLayout1 = new QVBoxLayout(); + vLayout2 = new QVBoxLayout(); + hLayout1 = new QHBoxLayout(); + hLayout2 = new QHBoxLayout(); + hLayout3 = new QHBoxLayout(); + m_waitingWidget = new WaitingWidget(); + + m_labelRank = new QLabel(); + m_labelIcon = new QLabel(); + m_labelTitleArtist = new QLabel(); + label4 = new QLabel(""); // for the icons + label5 = new QLabel(""); // for the options + + m_buttonPrev = new QPushButton(); + m_buttonSimilar = new QPushButton(); + m_confidenceListWidget= new ConfidenceListWidget(); m_confidenceListWidget->setMaximumWidth(180); @@ -163,6 +163,8 @@ connect(m_labelTitleArtist, SIGNAL(linkActivated(QString)), this, SIGNAL(linkActivated(QString))); } +ListResultGeneralItemWidget::~ListResultGeneralItemWidget() +{} void ListResultGeneralItemWidget::setTitleAndAuthorName(QString author,QString title, QString uri){ QString aux = title;
--- a/widgets/ListResultGeneralItemWidget.h Tue Nov 27 13:26:04 2007 +0000 +++ b/widgets/ListResultGeneralItemWidget.h Wed Nov 28 13:03:45 2007 +0000 @@ -12,12 +12,12 @@ COPYING included with this distribution for more information. */ -#ifndef LIST_RESULT_GENERAL_ITEM_WIDGET_H -#define LIST_RESULT_GENERAL_ITEM_WIDGET_H - -#include "ConfidenceListWidget.h" -#include "WaitingWidget.h" -#include "CriteriaDialog.h" +#ifndef LIST_RESULT_GENERAL_ITEM_WIDGET_H +#define LIST_RESULT_GENERAL_ITEM_WIDGET_H + +#include "ConfidenceListWidget.h" +#include "WaitingWidget.h" +#include "CriteriaDialog.h" #include <QWidget> #include <QFrame> #include <QLabel> @@ -28,42 +28,44 @@ -class ListResultGeneralItemWidget : public QWidget{ - Q_OBJECT +class ListResultGeneralItemWidget : public QWidget +{ + Q_OBJECT public: - ListResultGeneralItemWidget(QWidget *parent=0); - void setTitleAndAuthorName(QString author,QString title, QString uri); - void setRank(int rank); - void setType(int type); - void addConfidence(int confidence, QString confidenceName); - -signals: - void linkActivated(const QString& link); - -private: - QVBoxLayout *vLayout1; - QVBoxLayout *vLayout2; - QHBoxLayout *hLayout1; - QHBoxLayout *hLayout2; - QHBoxLayout *hLayout3; - - QLabel *m_labelRank; - QLabel *m_labelIcon; - QLabel *m_labelTitleArtist; - QLabel *label4; - QLabel *label5; - - QPushButton *m_buttonPrev; - QPushButton *m_buttonSimilar; - - ConfidenceListWidget *m_confidenceListWidget; - WaitingWidget *m_waitingWidget; - CriteriaDialog *m_criteriaDialog; - -private slots: - void displayCriteria(); - + ListResultGeneralItemWidget(QWidget *parent=0); + virtual ~ListResultGeneralItemWidget(); + void setTitleAndAuthorName(QString author,QString title, QString uri); + void setRank(int rank); + void setType(int type); + void addConfidence(int confidence, QString confidenceName); + +signals: + void linkActivated(const QString& link); + +private: + QVBoxLayout *vLayout1; + QVBoxLayout *vLayout2; + QHBoxLayout *hLayout1; + QHBoxLayout *hLayout2; + QHBoxLayout *hLayout3; + + QLabel *m_labelRank; + QLabel *m_labelIcon; + QLabel *m_labelTitleArtist; + QLabel *label4; + QLabel *label5; + + QPushButton *m_buttonPrev; + QPushButton *m_buttonSimilar; + + ConfidenceListWidget *m_confidenceListWidget; + WaitingWidget *m_waitingWidget; + CriteriaDialog *m_criteriaDialog; + +private slots: + void displayCriteria(); + };
--- a/widgets/PropertyStack.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/widgets/PropertyStack.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -160,7 +160,8 @@ //} item->setToolTip(name); - item->setIcon(QString(":/icons/%1.png").arg(iconName)); + QString iconDir = ":/icons/" + iconName + ".png"; + item->setIcon(iconDir); item->setName(name); item->setPropertyBox(box); addItem(item);
--- a/widgets/RealTimeFilterPropertyStack.cpp Tue Nov 27 13:26:04 2007 +0000 +++ b/widgets/RealTimeFilterPropertyStack.cpp Wed Nov 28 13:03:45 2007 +0000 @@ -20,21 +20,23 @@ RealTimeFilterPropertyStack::~RealTimeFilterPropertyStack() {} -void RealTimeFilterPropertyStack::filterAdded(Filter * filter) -{ - PropertyBox *box = new PropertyBox(filter); - +void RealTimeFilterPropertyStack::filterAdded(Filter * filter) +{ + PropertyBox *box = new PropertyBox(filter); + ItemAudioFilterList *itAudio = new ItemAudioFilterList; - itAudio->setName(filter->objectName()); + QString name(filter->objectName()); + itAudio->setName(name); itAudio->setToolTip(filter->objectName()); - itAudio->setIcon(QString(":icons/easaier.png")); - itAudio->setPropertyBox(box); - - addItem(itAudio); - -} - -void RealTimeFilterPropertyStack::filterRemoved(QString name) -{ - removeItem(name); + QString iconName(":icons/easaier.png"); + itAudio->setIcon(iconName); + itAudio->setPropertyBox(box); + + addItem(itAudio); + +} + +void RealTimeFilterPropertyStack::filterRemoved(QString name) +{ + removeItem(name); } \ No newline at end of file
--- a/widgets/widgets.pro Tue Nov 27 13:26:04 2007 +0000 +++ b/widgets/widgets.pro Wed Nov 28 13:03:45 2007 +0000 @@ -4,12 +4,12 @@ load(../sv.prf) CONFIG += sv staticlib qt thread warn_on stl rtti exceptions -QT += xml +QT += network xml TARGET = svwidgets DEPENDPATH += . .. -INCLUDEPATH += . .. +INCLUDEPATH += . .. ../sv OBJECTS_DIR = tmp_obj MOC_DIR = tmp_moc @@ -52,13 +52,14 @@ ItemLayerList.h \ ItemContainer.h \ RealTimeFilterPropertyStack.h \ - ListResulGeneralItemWidget.h \ + ListResultGeneralItemWidget.h \ ConfidenceWidget.h \ ConfidenceListWidget.h \ WaitingWidget.h \ CriteriaDialog.h \ Slider.h \ RelatedMediaWidget.h \ + RadialLNFButton.h \ FlowLayout.h SOURCES += AudioDial.cpp \ Fader.cpp \ @@ -89,6 +90,7 @@ WidgetGallery.cpp \ ConnectionSettings.cpp \ ConnectionStatus.cpp \ + MultiPaneLayerContainer.cpp \ AudioFilterViewerWidget.cpp \ ItemAudioFilterList.cpp \ EasaierStyle.cpp \ @@ -97,12 +99,13 @@ ItemLayerList.cpp \ ItemContainer.cpp \ RealTimeFilterPropertyStack.cpp \ - ListResulGeneralItemWidget.cpp \ + ListResultGeneralItemWidget.cpp \ ConfidenceWidget.cpp \ ConfidenceListWidget.cpp \ WaitingWidget.cpp \ CriteriaDialog.cpp \ Slider.cpp \ RelatedMediaWidget.cpp \ + RadialLNFButton.cpp \ FlowLayout.cpp