├── .gitignore ├── .gitmodules ├── LICENSE ├── QTau.pro ├── README.md ├── credits.txt ├── editor ├── Controller.cpp ├── Controller.h ├── Events.h ├── NoteEvents.h ├── PluginInterfaces.h ├── Session.cpp ├── Session.h ├── Utils.cpp ├── Utils.h ├── audio │ ├── Codec.cpp │ ├── Codec.h │ ├── Mixer.cpp │ ├── Mixer.h │ ├── Player.cpp │ ├── Player.h │ ├── Resampler.cpp │ ├── Resampler.h │ ├── Source.cpp │ ├── Source.h │ └── codecs │ │ ├── AIFF.cpp │ │ ├── AIFF.h │ │ ├── Flac.cpp │ │ ├── Flac.h │ │ ├── Ogg.cpp │ │ ├── Ogg.h │ │ ├── Wav.cpp │ │ └── Wav.h ├── editor.pro ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── midiimportdialog.h ├── res │ ├── appicon_ouka_alice.ico │ ├── appicon_ouka_alice.png │ ├── b_blank.png │ ├── b_cross.png │ ├── b_envelope.png │ ├── b_folder.png │ ├── b_gear.png │ ├── b_info.png │ ├── b_info2.png │ ├── b_lock.png │ ├── b_manual.png │ ├── b_megaphone.png │ ├── b_mic.png │ ├── b_notes.png │ ├── b_pause.png │ ├── b_pencil.png │ ├── b_play.png │ ├── b_play_prev.png │ ├── b_plug.png │ ├── b_power.png │ ├── b_puzzle.png │ ├── b_redo.png │ ├── b_repeat.png │ ├── b_ruler.png │ ├── b_save.png │ ├── b_save_music.png │ ├── b_stop.png │ ├── b_undo.png │ ├── b_unlock.png │ ├── documentation_en.txt │ ├── documentation_en.txt~ │ ├── qtau.qrc │ ├── qtau_win.rc │ ├── speaker-mute.png │ └── speaker.png └── ui │ ├── Config.h │ ├── dynDrawer.cpp │ ├── dynDrawer.h │ ├── mainwindow.ui │ ├── meter.cpp │ ├── meter.h │ ├── noteEditor.cpp │ ├── noteEditor.h │ ├── noteEditorHandlers.cpp │ ├── noteEditorHandlers.h │ ├── piano.cpp │ ├── piano.h │ ├── waveform.cpp │ └── waveform.h ├── todo.txt └── tools ├── ffft ├── Array.h ├── Array.hpp ├── DynArray.h ├── DynArray.hpp ├── FFTReal.h ├── FFTReal.hpp ├── FFTRealFixLen.h ├── FFTRealFixLen.hpp ├── FFTRealFixLenParam.h ├── FFTRealPassDirect.h ├── FFTRealPassDirect.hpp ├── FFTRealPassInverse.h ├── FFTRealPassInverse.hpp ├── FFTRealSelect.h ├── FFTRealSelect.hpp ├── FFTRealUseTrigo.h ├── FFTRealUseTrigo.hpp ├── OscSinCos.h ├── OscSinCos.hpp ├── def.h ├── license.txt ├── readme.txt └── test │ ├── TestAccuracy.h │ ├── TestAccuracy.hpp │ ├── TestHelperFixLen.h │ ├── TestHelperFixLen.hpp │ ├── TestHelperNormal.h │ ├── TestHelperNormal.hpp │ ├── TestSpeed.h │ ├── TestSpeed.hpp │ ├── TestWhiteNoiseGen.h │ ├── TestWhiteNoiseGen.hpp │ ├── conf.h │ ├── fnc.h │ ├── fnc.hpp │ ├── main.cpp │ └── stopwatch │ ├── ClockCycleCounter.cpp │ ├── ClockCycleCounter.h │ ├── ClockCycleCounter.hpp │ ├── Int64.h │ ├── StopWatch.cpp │ ├── StopWatch.h │ ├── StopWatch.hpp │ ├── def.h │ ├── fnc.h │ └── fnc.hpp ├── flac-1.3.0 ├── AUTHORS ├── COPYING.Xiph ├── README ├── include │ ├── FLAC │ │ ├── all.h │ │ ├── assert.h │ │ ├── callback.h │ │ ├── config.h │ │ ├── export.h │ │ ├── format.h │ │ ├── metadata.h │ │ ├── ordinals.h │ │ ├── stream_decoder.h │ │ └── stream_encoder.h │ └── share │ │ ├── alloc.h │ │ ├── compat.h │ │ ├── endswap.h │ │ ├── macros.h │ │ ├── private.h │ │ ├── safe_str.h │ │ └── win_utf8_io.h └── src │ ├── libFLAC │ ├── bitmath.c │ ├── bitreader.c │ ├── bitwriter.c │ ├── cpu.c │ ├── crc.c │ ├── fixed.c │ ├── flac.pc.in │ ├── float.c │ ├── format.c │ ├── include │ │ ├── private │ │ │ ├── all.h │ │ │ ├── bitmath.h │ │ │ ├── bitreader.h │ │ │ ├── bitwriter.h │ │ │ ├── cpu.h │ │ │ ├── crc.h │ │ │ ├── fixed.h │ │ │ ├── float.h │ │ │ ├── format.h │ │ │ ├── lpc.h │ │ │ ├── macros.h │ │ │ ├── md5.h │ │ │ ├── memory.h │ │ │ ├── metadata.h │ │ │ ├── ogg_decoder_aspect.h │ │ │ ├── ogg_encoder_aspect.h │ │ │ ├── ogg_helper.h │ │ │ ├── ogg_mapping.h │ │ │ ├── stream_encoder_framing.h │ │ │ └── window.h │ │ └── protected │ │ │ ├── all.h │ │ │ ├── stream_decoder.h │ │ │ └── stream_encoder.h │ ├── lpc.c │ ├── md5.c │ ├── memory.c │ ├── metadata_iterators.c │ ├── metadata_object.c │ ├── ogg_decoder_aspect.c │ ├── ogg_encoder_aspect.c │ ├── ogg_helper.c │ ├── ogg_mapping.c │ ├── stream_decoder.c │ ├── stream_encoder.c │ ├── stream_encoder_framing.c │ └── window.c │ └── share │ └── win_utf8_io │ └── win_utf8_io.c ├── libogg-1.3.1 ├── AUTHORS ├── CHANGES ├── COPYING ├── README ├── include │ ├── config.h~ │ └── ogg │ │ ├── config.h │ │ ├── config_types.h │ │ ├── ogg.h │ │ └── os_types.h ├── missing └── src │ ├── bitwise.c │ └── framing.c └── utauloid ├── oto.cpp ├── oto.h ├── ust.cpp └── ust.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dylib 4 | *.dll 5 | *.a 6 | *.lib 7 | *.pro.user 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/lesynth"] 2 | path = tools/lesynth 3 | url = https://github.com/qtau-devgroup/lesynth.git 4 | [submodule "tools/stand"] 5 | path = tools/stand 6 | url = https://github.com/qtau-devgroup/stand.git 7 | [submodule "tools/libvsq"] 8 | path = tools/libvsq 9 | url = https://github.com/qtau-devgroup/libvsq.git 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2013 HAL@shurabaP 2 | Copyright (c) 2013 digited 3 | 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or 7 | without modification, are permitted provided that the following 8 | conditions are met: 9 | 10 | - Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | - Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | - Neither the name of the HAL@shurabaP nor the names of its 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 25 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 27 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /QTau.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # http://github.com/qtau-devgroup 3 | #------------------------------------------------- 4 | 5 | TEMPLATE = subdirs 6 | 7 | CONFIG += ordered 8 | 9 | SUBDIRS += \ 10 | tools/lesynth \ 11 | tools/stand \ 12 | editor 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | QTau editor 2 | ====== 3 | 4 | Note editor inspired by Vocaloid, UTAU and Cadencii, uses Qt. 5 | * License: BSD 6 | * Dependencies: Qt 5 7 | * OS: any supported by Qt 8 | 9 | Linked projects: [Rocaloid](http://github.com/Sleepwalking/Rocaloid "Rocaloid Engine"), [lauloid](http://gitorious.org/lauloid "lauloid") 10 | 11 | Discussion: issues here, twitter [here](http://twitter.com/shurabaP "ShurabaP") or [here](http://twitter.com/vocatuber "digited"), [utaforum thread](http://utaforum.net/thread-resampler-development-for-qtau "utaforum.net") or #qtau at irc.rizon.net 12 | -------------------------------------------------------------------------------- /credits.txt: -------------------------------------------------------------------------------- 1 | http://github.com/qtau-devgroup/editor 2 | QTau is distributed under terms of BSD license 3 | see LICENSE 4 | 5 | ffft by Laurent de Soras http://ldesoras.free.fr/ 6 | licensed under strictest terms of WTFPL 7 | 8 | flac and ogg libs from http://www.xiph.org/downloads/ 9 | both licensed under BSD 10 | 11 | Application icon pixelart: Ouka Alice by sn0w75 12 | http://twitter.com/sn0w75 13 | 14 | Icon set "Super Mono Sticker" by Double-J designs 15 | http://www.doublejdesign.co.uk/2010/07/super-mono-icons/ 16 | licensed under Creative Commons Attribution 3.0 17 | 18 | Qt is LGPL obviously. 19 | 20 | -------------------------------------------------------------------------------- /editor/Controller.h: -------------------------------------------------------------------------------- 1 | /* Controller.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef CONTROLLER_H 4 | #define CONTROLLER_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class MainWindow; 12 | class qtauSynth; 13 | class qtmmPlayer; 14 | class qtauAudioSource; 15 | class qtauSession; 16 | class ISynth; 17 | 18 | 19 | // main class of QTau that ties everything together 20 | class qtauController : public QObject 21 | { 22 | Q_OBJECT 23 | QThread audioThread; 24 | 25 | public: 26 | explicit qtauController(QObject *parent = 0); 27 | ~qtauController(); 28 | 29 | bool run(); // app startup & setup, window creation 30 | 31 | signals: 32 | void setEffect(qtauAudioSource *e, bool replace, bool smoothly, bool copy); 33 | void setTrack (qtauAudioSource *t, bool replace, bool smoothly, bool copy); 34 | 35 | void playStart(); 36 | void playPause(); 37 | void playStop(); 38 | 39 | void playerSetVolume(int level); 40 | 41 | public slots: 42 | void onAppMessage(const QString& msg); 43 | 44 | void onLoadUST(QString fileName); 45 | void onSaveUST(QString fileName, bool rewrite); 46 | 47 | void onLoadAudio(QString fileName); 48 | void onSaveAudio(QString fileName, bool rewrite); 49 | 50 | void onAudioPlaybackEnded(); 51 | void onAudioPlaybackTick(qint64 mcsecElapsed); 52 | 53 | void onRequestSynthesis(); 54 | void onRequestStartPlayback(); 55 | void onRequestPausePlayback(); 56 | void onRequestStopPlayback(); 57 | void onRequestResetPlayback(); 58 | void onRequestRepeatPlayback(); 59 | 60 | void onVolumeChanged(int); 61 | 62 | void pianoKeyPressed(int); 63 | void pianoKeyReleased(int); 64 | 65 | protected: 66 | qtmmPlayer *player; 67 | MainWindow *mw; 68 | 69 | QMap sessions; 70 | qtauSession *activeSession; 71 | 72 | typedef enum { 73 | Playing = 0, 74 | Paused, 75 | Stopped, 76 | Repeating 77 | } EPlayerState; 78 | 79 | typedef struct _PlayState { 80 | EPlayerState state; 81 | qtauAudioSource *audio; 82 | qtauSession *session; 83 | 84 | _PlayState() : state(Stopped), audio(nullptr), session(nullptr) {} 85 | } SPlayState; 86 | 87 | SPlayState playState; 88 | 89 | bool setupTranslations(); 90 | bool setupPlugins(); 91 | bool setupVoicebanks(); 92 | 93 | void initSynth(ISynth *s); 94 | QMap synths; 95 | 96 | QDir pluginsDir; 97 | 98 | void newEmptySession(); 99 | }; 100 | 101 | #endif // CONTROLLER_H 102 | -------------------------------------------------------------------------------- /editor/PluginInterfaces.h: -------------------------------------------------------------------------------- 1 | /* PluginInterfaces.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef PLUGININTERFACES_H 4 | #define PLUGININTERFACES_H 5 | 6 | #include 7 | #include "Utils.h" 8 | #include "utauloid/ust.h" 9 | 10 | class qtauAudioSource; 11 | 12 | typedef struct SynthConfig { 13 | vsLog *log = nullptr; 14 | // TODO: some other settings 15 | 16 | SynthConfig(vsLog &l) : log(&l) {} 17 | } SSynthConfig; 18 | 19 | class ISynth 20 | { 21 | public: 22 | virtual ~ISynth() {} 23 | 24 | virtual QString name() = 0; 25 | virtual QString description() = 0; 26 | virtual QString version() = 0; 27 | 28 | virtual void setup(SSynthConfig &cfg) = 0; 29 | virtual bool setVoicebank(const QString&) = 0; 30 | 31 | virtual bool setVocals(const ust&) = 0; 32 | virtual bool setVocals(const QStringList&) = 0; 33 | 34 | virtual bool synthesize(qtauAudioSource&) = 0; 35 | virtual bool synthesize(const QString&) = 0; 36 | 37 | virtual bool isVbReady() = 0; 38 | virtual bool isVocalsReady() = 0; 39 | 40 | // if synth can stream data as it's being created 41 | virtual bool supportsStreaming() = 0; 42 | }; 43 | 44 | #define c_isynth_comname "org.qtau.awesomesauce.ISynth" 45 | 46 | Q_DECLARE_INTERFACE(ISynth, c_isynth_comname) 47 | 48 | #endif // PLUGININTERFACES_H 49 | -------------------------------------------------------------------------------- /editor/Utils.cpp: -------------------------------------------------------------------------------- 1 | /* Utils.cpp from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #include "Utils.h" 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | 10 | Q_GLOBAL_STATIC(vsLog, vslog_instance) 11 | 12 | vsLog* vsLog::instance() 13 | { 14 | return vslog_instance(); 15 | } 16 | 17 | void vsLog::r() 18 | { 19 | vslog_instance()->enableHistory(false); 20 | auto &hst = vslog_instance()->history; 21 | 22 | for (auto &stored: hst) 23 | { 24 | if (stored.second.isEmpty()) vslog_instance()->reemit("", ELog::none); 25 | else vslog_instance()->reemit(stored.second, stored.first); 26 | } 27 | 28 | hst.clear(); 29 | } 30 | 31 | void vsLog::reemit(const QString &msg, ELog type) { emit message(msg, type); } 32 | 33 | void vsLog::addMessage(const QString &msg, ELog type) 34 | { 35 | QString m = msg; 36 | 37 | if (type == ELog::none) 38 | m = " "; 39 | else 40 | { 41 | qDebug() << m; 42 | 43 | m.prepend("\t"); 44 | QString time = QTime::currentTime().toString(); 45 | 46 | if (time.compare(lastTime)) 47 | { 48 | m.prepend(time); 49 | lastTime = time; 50 | } 51 | } 52 | 53 | emit message(m, type); 54 | 55 | if (saving) 56 | history.append(QPair(type, m)); 57 | } 58 | -------------------------------------------------------------------------------- /editor/audio/Codec.cpp: -------------------------------------------------------------------------------- 1 | /* Codec.cpp from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #include "audio/Codec.h" 4 | #include "Utils.h" 5 | 6 | 7 | qtauAudioCodec::qtauAudioCodec(QIODevice &d, QObject *parent) : 8 | qtauAudioSource(parent) 9 | { 10 | dev = &d; 11 | } 12 | 13 | //--------------------------------------------------- 14 | 15 | qtauCodecRegistry::~qtauCodecRegistry() 16 | { 17 | foreach (qtauAudioCodecFactory *f, codecsByMime.values()) 18 | delete f; 19 | } 20 | 21 | qtauCodecRegistry* qtauCodecRegistry::instance() 22 | { 23 | static qtauCodecRegistry *singleRegistry = 0; 24 | 25 | if (!singleRegistry) 26 | singleRegistry = new qtauCodecRegistry(); 27 | 28 | return singleRegistry; 29 | } 30 | 31 | qtauAudioCodec* qtauCodecRegistry::getCodecByMime(const QString &mime, QIODevice &d, QObject *parent ) 32 | { 33 | qtauAudioCodec *result = 0; 34 | 35 | if (!mime.isEmpty() && codecsByMime.contains(mime)) 36 | result = codecsByMime[mime]->make(d, parent); 37 | 38 | return result; 39 | } 40 | 41 | qtauAudioCodec* qtauCodecRegistry::getCodecByExt(const QString &ext, QIODevice &d, QObject *parent) 42 | { 43 | qtauAudioCodec *result = 0; 44 | 45 | if (!ext.isEmpty() && codecsByExt.contains(ext)) 46 | result = codecsByExt[ext]->make(d, parent); 47 | 48 | return result; 49 | } 50 | 51 | bool qtauCodecRegistry::addCodec(qtauAudioCodecFactory *factory, bool replace) 52 | { 53 | bool result = false; 54 | 55 | if (!factory) 56 | vsLog::e("Trying to register a codec without a factory"); 57 | else if (!factory->mime().isEmpty()) 58 | { 59 | QString mime = factory->mime(); 60 | bool alreadyRegistered = codecsByMime.contains(mime); 61 | 62 | if (!alreadyRegistered || replace) 63 | { 64 | if (alreadyRegistered) 65 | { 66 | vsLog::i(QString("Replacing codec for %1: %2").arg(mime).arg(factory->desc())); 67 | delete codecsByMime[mime]; 68 | } 69 | else vsLog::i(QString("Adding codec for %1: %2").arg(mime).arg(factory->desc())); 70 | 71 | codecsByMime[mime] = factory; 72 | codecsByExt[factory->ext()] = factory; 73 | result = true; 74 | } 75 | else vsLog::e(QString("Codec for %1 is already registered, won't replace").arg(mime)); 76 | } 77 | else vsLog::e("Trying to register codec without MIME type!"); 78 | 79 | return result; 80 | } 81 | 82 | QList qtauCodecRegistry::listCodecs(const QString &preferred) 83 | { 84 | QList result; 85 | 86 | if (!codecsByExt.isEmpty()) 87 | for (auto &c :codecsByExt) 88 | { 89 | QString dialogStr = QString("%1 - %2 (*.%3)").arg(c->ext()).arg(c->desc()).arg(c->ext()); 90 | 91 | if (c->ext() == preferred) result.prepend(dialogStr); 92 | else result.append (dialogStr); 93 | } 94 | 95 | return result; 96 | } 97 | -------------------------------------------------------------------------------- /editor/audio/Codec.h: -------------------------------------------------------------------------------- 1 | /* Codec.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_AUDIO_FILE_H 4 | #define QTAU_AUDIO_FILE_H 5 | 6 | #include "audio/Source.h" 7 | #include 8 | 9 | // codec is intermediate between buffered PCM data and some source of encoded audio 10 | class qtauAudioCodec : public qtauAudioSource 11 | { 12 | Q_OBJECT 13 | friend class qtauAudioCodecFactory; 14 | 15 | protected: 16 | QIODevice *dev; 17 | qtauAudioCodec(QIODevice &d, QObject *parent = 0); 18 | 19 | }; 20 | 21 | class qtauAudioCodecFactory 22 | { 23 | public: 24 | virtual qtauAudioCodec* make(QIODevice &d, QObject *parent = 0) = 0; 25 | virtual ~qtauAudioCodecFactory() {} 26 | 27 | const QString& ext () const { return _ext; } 28 | const QString& mime() const { return _mime; } 29 | const QString& desc() const { return _desc; } 30 | 31 | protected: 32 | QString _ext; 33 | QString _mime; 34 | QString _desc; 35 | 36 | }; 37 | 38 | 39 | 40 | class qtauCodecRegistry 41 | { 42 | public: 43 | ~qtauCodecRegistry(); 44 | 45 | static qtauCodecRegistry* instance(); 46 | 47 | inline bool hasCodecForMime(const QString &mime) const { return (mime.isEmpty()) ? false : codecsByMime.contains(mime); } 48 | inline bool hasCodecForExt (const QString &ext) const { return (ext.isEmpty()) ? false : codecsByExt .contains(ext); } 49 | 50 | // returns new codec if factory is registered for this mime/ext, else returns 0 51 | qtauAudioCodec* getCodecByMime(const QString &mime, QIODevice &d, QObject *parent = 0); 52 | qtauAudioCodec* getCodecByExt (const QString &ext, QIODevice &d, QObject *parent = 0); 53 | 54 | bool addCodec(qtauAudioCodecFactory *factory, bool replace = false); 55 | 56 | // utility for load/save dialogs, returns strings in format "description (*.ext)" 57 | QList listCodecs(const QString &preferred = ""); 58 | 59 | protected: 60 | qtauCodecRegistry() {} 61 | Q_DISABLE_COPY(qtauCodecRegistry) 62 | 63 | QMap codecsByMime; // mime is primary when adding/replacing codecs 64 | QMap codecsByExt; 65 | 66 | }; 67 | 68 | 69 | inline bool isAudioMimeSupported(const QString &mime) 70 | { 71 | return qtauCodecRegistry::instance()->hasCodecForMime(mime); 72 | } 73 | 74 | inline bool isAudioExtSupported(const QString &ext) 75 | { 76 | return qtauCodecRegistry::instance()->hasCodecForExt(ext); 77 | } 78 | 79 | inline qtauAudioCodec* codecForMime(const QString &mime, QIODevice &d, QObject *parent = 0) 80 | { 81 | return qtauCodecRegistry::instance()->getCodecByMime(mime, d, parent); 82 | } 83 | 84 | inline qtauAudioCodec* codecForExt(const QString &ext, QIODevice &d, QObject *parent = 0) 85 | { 86 | return qtauCodecRegistry::instance()->getCodecByExt(ext, d, parent); 87 | } 88 | 89 | #endif // QTAU_AUDIO_FILE_H 90 | -------------------------------------------------------------------------------- /editor/audio/Mixer.h: -------------------------------------------------------------------------------- 1 | /* Mixer.h from QTau http://github.com/qtau-devgroup/editor by digited and HAL@ShurabaP, BSD license */ 2 | 3 | #ifndef QTAU_AUDIO_MIXER_H 4 | #define QTAU_AUDIO_MIXER_H 5 | 6 | #include "audio/Source.h" 7 | 8 | /* Audio Mixer is aimed to be used for mix-on-demand, always ready to accept a new source to be mixed in. 9 | * Mixer does NOT manage memory of audio sources - they were created somewhere and must be deleted there too 10 | * To mix audio data: use constructor with list of audio sources, do readAll() */ 11 | class qtauSoundMixer : public qtauAudioSource 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit qtauSoundMixer(QObject *parent = 0); 17 | explicit qtauSoundMixer(QList &tracks, QObject *parent = 0); 18 | 19 | void addTrack (qtauAudioSource *t, bool replace = false, bool smoothly = true); 20 | void addEffect(qtauAudioSource *e, bool replace = false, bool smoothly = true); 21 | 22 | //--- QIODevice interface functions --------- 23 | bool isSequential() const override { return true; } // always sequential 24 | qint64 pos() const override { return 0; } // don't have one. 25 | bool seek(qint64) override { return false; } // nope. 26 | bool reset() override { return false; } // what? NO. 27 | bool atEnd() const override { return tracks.isEmpty() && effects.isEmpty(); } 28 | qint64 size() const override { return bytesAvailable(); } 29 | qint64 bytesToWrite() const override { return 0; } // unwritable, use addTrack/addEffect 30 | 31 | qint64 bytesAvailable() const override; 32 | //------------------------------------------- 33 | 34 | void clear() { clearTracks(); clearEffects(); } 35 | void clearTracks() { tracks.clear(); emit allTracksEnded(); } 36 | void clearEffects() { effects.clear(); emit allEffectsEnded(); } 37 | 38 | signals: 39 | void allTracksEnded(); 40 | void allEffectsEnded(); 41 | 42 | void trackEnded(qtauAudioSource*); 43 | void effectEnded(qtauAudioSource*); 44 | 45 | protected: 46 | QList tracks; // keeps its own copy of audio data because original may be chaged, in another thread even 47 | QList effects; 48 | 49 | bool replacingEffectsSmoothly; 50 | bool replacingTracksSmoothly; 51 | 52 | qint64 readData(char *data, qint64 maxlen) override; 53 | qint64 writeData(const char *, qint64) override { return 0; } // unwritable, use addTrack/addEffect 54 | 55 | }; 56 | 57 | #endif // QTAU_AUDIO_MIXER_H 58 | -------------------------------------------------------------------------------- /editor/audio/Player.h: -------------------------------------------------------------------------------- 1 | /* Player.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_AUDIO_PLAYER_H 4 | #define QTAU_AUDIO_PLAYER_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class QAudioOutput; 11 | class qtauAudioSource; 12 | class qtauSoundMixer; 13 | 14 | class QTimer; 15 | 16 | 17 | // player is designed to work in a separate thread to avoid audio glitches on playback 18 | // stores copies of audio sources, uses mixer to combine their data, adds zeros if asked for more data than mixer has 19 | class qtmmPlayer : public QIODevice 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | qtmmPlayer(); 25 | ~qtmmPlayer(); 26 | 27 | bool isSequential() const override { return true; } 28 | qint64 pos() const override { return 0; } 29 | bool seek(qint64) override { return false; } 30 | bool atEnd() const override { return bytesAvailable() == 0; } 31 | bool reset() override { return false; } 32 | qint64 bytesAvailable() const override { return size(); } 33 | qint64 size() const override; 34 | 35 | signals: 36 | void playbackEnded(); 37 | void tick(qint64 mcsec); 38 | 39 | public slots: // all slots should be called indirectly with connect + emit because player is in separate thread 40 | void addEffect(qtauAudioSource *e, bool replace = false, bool smoothly = true, bool copy = true); 41 | void addTrack (qtauAudioSource *t, bool replace = false, bool smoothly = true, bool copy = true); 42 | 43 | void play(); 44 | void pause(); 45 | void stop(); 46 | 47 | void setVolume(int level); // 0..100 48 | 49 | void threadedInit(); // should be called after instance is moved to a separate thread 50 | 51 | private slots: 52 | void onQtmmStateChanged(QAudio::State); 53 | void onTick(); 54 | 55 | void onEffectEnded(qtauAudioSource* e); 56 | void onTrackEnded(qtauAudioSource* t); 57 | 58 | void onAllEffectsEnded(); 59 | void onAllTracksEnded(); 60 | 61 | protected: 62 | qint64 readData(char *data, qint64 maxlen) override; 63 | qint64 writeData(const char *, qint64) override { return 0; } 64 | 65 | QList tracks; // copies are stored here to ensure playback if originals will change 66 | QList effects; // tracks and effects are read in a separate thread 67 | 68 | QAudioOutput *audioOutput; 69 | qtauSoundMixer *mixer; 70 | QTimer *stopTimer; 71 | 72 | int volume; 73 | 74 | }; 75 | 76 | #endif // QTAU_AUDIO_PLAYER_H 77 | -------------------------------------------------------------------------------- /editor/audio/Resampler.h: -------------------------------------------------------------------------------- 1 | /* Resampler.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef RESAMPLER_H 4 | #define RESAMPLER_H 5 | 6 | #include 7 | #include 8 | 9 | 10 | class qtauResampler : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit qtauResampler(const QByteArray &srcData, const QAudioFormat &srcFmt, const QAudioFormat &dstFmt, QObject *parent = 0); 16 | 17 | QByteArray encode(); 18 | 19 | protected: 20 | enum class EResampFormat : char { 21 | none, 22 | U8toS16, // to S16 23 | F32toS16, 24 | U8toF32, // to F32 25 | S16toF32, 26 | S16toU8, // to U8 27 | F32toU8 28 | }; 29 | 30 | enum class EResampBSwap : char { 31 | none, 32 | Swap8, 33 | Swap16, 34 | Swap32 35 | }; 36 | 37 | EResampFormat sampleChange; 38 | EResampBSwap byteorderChange; 39 | QByteArray srcD; 40 | 41 | }; 42 | 43 | #endif // RESAMPLER_H 44 | -------------------------------------------------------------------------------- /editor/audio/Source.h: -------------------------------------------------------------------------------- 1 | /* Source.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_AUDIO_SOURCE_H 4 | #define QTAU_AUDIO_SOURCE_H 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class vsLog; 11 | 12 | 13 | typedef struct WavegenSetup { 14 | qint64 lengthMS; 15 | float frequencyHz; 16 | int sampleRate; 17 | bool stereo; 18 | 19 | WavegenSetup(qint64 len, float freq, int sr, bool st = false) : 20 | lengthMS(len), frequencyHz(freq), sampleRate(sr), stereo(st) {} 21 | } SWavegenSetup; 22 | 23 | 24 | class qtauAudioSource : public QBuffer 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit qtauAudioSource(QObject *parent = 0); 30 | explicit qtauAudioSource(const QByteArray& data, const QAudioFormat &f, QObject *parent = 0); 31 | 32 | // generates tonal periodic wave 33 | explicit qtauAudioSource(const SWavegenSetup &s, QObject *parent = 0); 34 | ~qtauAudioSource(); 35 | 36 | QAudioBuffer getAudioBuffer() { return QAudioBuffer(this->buffer(), fmt); } 37 | QAudioFormat getAudioFormat() { return fmt; } 38 | 39 | // use if rewriting buffer data completely 40 | void setAudioFormat(const QAudioFormat &f) { fmt = f; } 41 | 42 | // should read all contents of file/socket and decode it to PCM in buf 43 | virtual bool cacheAll() { return true; } 44 | 45 | // should save all buffered pcm data to iodevice in appropriate format 46 | virtual bool saveToDevice() { return false; } 47 | 48 | protected: 49 | QAudioFormat fmt; // format of that raw PCM data 50 | 51 | }; 52 | 53 | 54 | #endif // QTAU_AUDIO_SOURCE_H 55 | -------------------------------------------------------------------------------- /editor/audio/codecs/AIFF.h: -------------------------------------------------------------------------------- 1 | /* AIFF.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_CODEC_AIFF_H 4 | #define QTAU_CODEC_AIFF_H 5 | 6 | #include "audio/Codec.h" 7 | 8 | class QDataStream; 9 | 10 | 11 | class qtauAIFFCodec : public qtauAudioCodec 12 | { 13 | Q_OBJECT 14 | friend class qtauAIFFCodecFactory; 15 | 16 | public: 17 | bool cacheAll() override; 18 | bool saveToDevice() override; 19 | 20 | protected: 21 | qtauAIFFCodec(QIODevice &d, QObject *parent = 0); 22 | 23 | bool findCommonChunk(QDataStream &reader); 24 | bool findSoundChunk(QDataStream &reader); 25 | 26 | quint64 _data_chunk_location; // bytes 27 | int _data_chunk_length; // in frames 28 | 29 | }; 30 | 31 | class qtauAIFFCodecFactory : public qtauAudioCodecFactory 32 | { 33 | public: 34 | qtauAIFFCodecFactory() 35 | { 36 | _ext = "aiff"; 37 | _mime = "audio/aiff"; 38 | _desc = "Apple lossless audio"; 39 | } 40 | 41 | qtauAudioCodec* make(QIODevice &d, QObject *parent = 0) override 42 | { 43 | return new qtauAIFFCodec(d, parent); 44 | } 45 | }; 46 | 47 | #endif // QTAU_CODEC_AIFF_H 48 | -------------------------------------------------------------------------------- /editor/audio/codecs/Flac.cpp: -------------------------------------------------------------------------------- 1 | /* Flac.cpp from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #include "audio/codecs/Flac.h" 4 | #include "Utils.h" 5 | 6 | qtauFlacCodec::qtauFlacCodec(QIODevice &d, QObject *parent) : 7 | qtauAudioCodec(d, parent) 8 | { 9 | if (!d.isOpen()) 10 | vsLog::e("Flac codec got a closed io device!"); 11 | } 12 | 13 | bool qtauFlacCodec::cacheAll() { return false; } 14 | bool qtauFlacCodec::saveToDevice() { return false; } 15 | -------------------------------------------------------------------------------- /editor/audio/codecs/Flac.h: -------------------------------------------------------------------------------- 1 | /* Flac.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_CODEC_FLAC_H 4 | #define QTAU_CODEC_FLAC_H 5 | 6 | #include "audio/Codec.h" 7 | 8 | class qtauFlacCodec : public qtauAudioCodec 9 | { 10 | Q_OBJECT 11 | friend class qtauFlacCodecFactory; 12 | 13 | public: 14 | bool cacheAll() override; 15 | bool saveToDevice() override; 16 | 17 | protected: 18 | qtauFlacCodec(QIODevice &d, QObject *parent = 0); 19 | 20 | }; 21 | 22 | class qtauFlacCodecFactory : public qtauAudioCodecFactory 23 | { 24 | public: 25 | qtauFlacCodecFactory() 26 | { 27 | _ext = "flac"; 28 | _mime = "audio/flac"; 29 | _desc = "Free Lossless Audio Codec"; 30 | } 31 | 32 | qtauAudioCodec* make(QIODevice &d, QObject *parent = 0) override 33 | { 34 | return new qtauFlacCodec(d, parent); 35 | } 36 | }; 37 | 38 | #endif // QTAU_CODEC_FLAC_H 39 | -------------------------------------------------------------------------------- /editor/audio/codecs/Ogg.cpp: -------------------------------------------------------------------------------- 1 | /* Ogg.cpp from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #include "audio/codecs/Ogg.h" 4 | #include "Utils.h" 5 | 6 | qtauOggCodec::qtauOggCodec(QIODevice &d, QObject *parent) : 7 | qtauAudioCodec(d, parent) 8 | { 9 | if (!d.isOpen()) 10 | vsLog::e("Ogg codec got a closed io device!"); 11 | } 12 | 13 | bool qtauOggCodec::cacheAll() { return false; } 14 | bool qtauOggCodec::saveToDevice() { return false; } 15 | -------------------------------------------------------------------------------- /editor/audio/codecs/Ogg.h: -------------------------------------------------------------------------------- 1 | /* Ogg.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_CODEC_OGG_H 4 | #define QTAU_CODEC_OGG_H 5 | 6 | #include "audio/Codec.h" 7 | 8 | class qtauOggCodec : public qtauAudioCodec 9 | { 10 | Q_OBJECT 11 | friend class qtauOggCodecFactory; 12 | 13 | public: 14 | bool cacheAll() override; 15 | bool saveToDevice() override; 16 | 17 | protected: 18 | qtauOggCodec(QIODevice &d, QObject *parent = 0); 19 | 20 | }; 21 | 22 | class qtauOggCodecFactory : public qtauAudioCodecFactory 23 | { 24 | public: 25 | qtauOggCodecFactory() 26 | { 27 | _ext = "ogg"; 28 | _mime = "audio/ogg"; 29 | _desc = "Ogg Vorbis lossy audio"; 30 | } 31 | 32 | qtauAudioCodec* make(QIODevice &d, QObject *parent = 0) override 33 | { 34 | return new qtauOggCodec(d, parent); 35 | } 36 | }; 37 | 38 | #endif // QTAU_CODEC_OGG_H 39 | -------------------------------------------------------------------------------- /editor/audio/codecs/Wav.h: -------------------------------------------------------------------------------- 1 | /* Wav.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef QTAU_CODEC_WAV_H 4 | #define QTAU_CODEC_WAV_H 5 | 6 | #include "audio/Codec.h" 7 | 8 | class QDataStream; 9 | 10 | class qtauWavCodec : public qtauAudioCodec 11 | { 12 | Q_OBJECT 13 | friend class qtauWavCodecFactory; 14 | 15 | public: 16 | bool cacheAll() override; 17 | bool saveToDevice() override; 18 | 19 | protected: 20 | qtauWavCodec(QIODevice &d, QObject *parent = 0); 21 | 22 | bool findFormatChunk(QDataStream &reader); 23 | bool findDataChunk(QDataStream &reader); 24 | 25 | quint64 _data_chunk_location; // bytes 26 | int _data_chunk_length; // in frames 27 | 28 | }; 29 | 30 | class qtauWavCodecFactory : public qtauAudioCodecFactory 31 | { 32 | public: 33 | qtauWavCodecFactory() 34 | { 35 | _ext = "wav"; 36 | _mime = "audio/wav"; 37 | _desc = "Microsoft lossless audio"; 38 | } 39 | 40 | qtauAudioCodec* make(QIODevice &d, QObject *parent = 0) override 41 | { 42 | return new qtauWavCodec(d, parent); 43 | } 44 | }; 45 | 46 | #endif // QTAU_CODEC_WAV_H 47 | -------------------------------------------------------------------------------- /editor/main.cpp: -------------------------------------------------------------------------------- 1 | /* main.cpp from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #include 4 | #include "Controller.h" 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication app(argc, argv); 10 | app.setWindowIcon(QIcon(":/images/appicon_ouka_alice.png")); 11 | 12 | qtauController c; 13 | c.run(); // create UI that can immediately call back, thus requires already created & inited controller 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /editor/midiimportdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef MIDIIMPORTDIALOG_H 2 | #define MIDIIMPORTDIALOG_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace Ui { 9 | class MidiImportDialog; 10 | } 11 | 12 | class MidiImportDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | smf_t* smf; 16 | 17 | public: 18 | explicit MidiImportDialog(QWidget *parent,QString filename); 19 | ~MidiImportDialog(); 20 | 21 | private slots: 22 | void on_buttonBox_accepted(); 23 | 24 | signals: 25 | void midiImported(); 26 | 27 | 28 | private: 29 | Ui::MidiImportDialog *ui; 30 | }; 31 | 32 | #endif // MIDIIMPORTDIALOG_H 33 | -------------------------------------------------------------------------------- /editor/res/appicon_ouka_alice.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/appicon_ouka_alice.ico -------------------------------------------------------------------------------- /editor/res/appicon_ouka_alice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/appicon_ouka_alice.png -------------------------------------------------------------------------------- /editor/res/b_blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_blank.png -------------------------------------------------------------------------------- /editor/res/b_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_cross.png -------------------------------------------------------------------------------- /editor/res/b_envelope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_envelope.png -------------------------------------------------------------------------------- /editor/res/b_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_folder.png -------------------------------------------------------------------------------- /editor/res/b_gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_gear.png -------------------------------------------------------------------------------- /editor/res/b_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_info.png -------------------------------------------------------------------------------- /editor/res/b_info2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_info2.png -------------------------------------------------------------------------------- /editor/res/b_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_lock.png -------------------------------------------------------------------------------- /editor/res/b_manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_manual.png -------------------------------------------------------------------------------- /editor/res/b_megaphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_megaphone.png -------------------------------------------------------------------------------- /editor/res/b_mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_mic.png -------------------------------------------------------------------------------- /editor/res/b_notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_notes.png -------------------------------------------------------------------------------- /editor/res/b_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_pause.png -------------------------------------------------------------------------------- /editor/res/b_pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_pencil.png -------------------------------------------------------------------------------- /editor/res/b_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_play.png -------------------------------------------------------------------------------- /editor/res/b_play_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_play_prev.png -------------------------------------------------------------------------------- /editor/res/b_plug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_plug.png -------------------------------------------------------------------------------- /editor/res/b_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_power.png -------------------------------------------------------------------------------- /editor/res/b_puzzle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_puzzle.png -------------------------------------------------------------------------------- /editor/res/b_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_redo.png -------------------------------------------------------------------------------- /editor/res/b_repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_repeat.png -------------------------------------------------------------------------------- /editor/res/b_ruler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_ruler.png -------------------------------------------------------------------------------- /editor/res/b_save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_save.png -------------------------------------------------------------------------------- /editor/res/b_save_music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_save_music.png -------------------------------------------------------------------------------- /editor/res/b_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_stop.png -------------------------------------------------------------------------------- /editor/res/b_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_undo.png -------------------------------------------------------------------------------- /editor/res/b_unlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/b_unlock.png -------------------------------------------------------------------------------- /editor/res/documentation_en.txt: -------------------------------------------------------------------------------- 1 | Controls: 2 | Note editor: 3 | delete -> delete selected notes 4 | tab -> edit next note 5 | 6 | ctrl + e -> toggle edit mode on/off 7 | ctrl + g -> toggle grid snap for adding/moving notes 8 | ctrl + z -> undo previous action 9 | ctrl + y -> redo previously undid action 10 | 11 | shift + mouse wheel -> horizontal scroll 12 | ctrl + mouse wheel -> zoom in/out 13 | 14 | hold right mouse button -> scroll editor with mouse (in non-edit mode) 15 | doubleclick with left mouse button -> edit note phoneme/lyrics (in edit mode) 16 | 17 | ctrl + s -> save 18 | ctrl + shift + s -> save as 19 | 20 | Voice dynamics buttons: 21 | left mouse button click -> select active (foreground) graph to display 22 | right mouse button click -> select (or disable) passive (background) graph to display 23 | -------------------------------------------------------------------------------- /editor/res/documentation_en.txt~: -------------------------------------------------------------------------------- 1 | Controls: 2 | Note editor: 3 | delete -> delete selected notes 4 | 5 | ctrl + e -> goggle edit mode on/off 6 | ctrl + g -> toggle grid snap for adding/moving notes 7 | ctrl + z -> undo previous action 8 | ctrl + y -> redo previously undid action 9 | 10 | shift + mouse wheel -> horizontal scroll 11 | ctrl + mouse wheel -> zoom in/out 12 | 13 | hold right mouse button -> scroll editor with mouse (in non-edit mode) 14 | doubleclick with left mouse button -> edit note phoneme/lyrics (in edit mode) 15 | 16 | ctrl + s -> save 17 | ctrl + shift + s -> save as 18 | 19 | Voice dynamics buttons: 20 | left mouse button click -> select active (foreground) graph to display 21 | right mouse button click -> select (or disable) passive (background) graph to display 22 | -------------------------------------------------------------------------------- /editor/res/qtau.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | appicon_ouka_alice.png 4 | b_gear.png 5 | b_info.png 6 | b_info2.png 7 | b_lock.png 8 | b_pause.png 9 | b_pencil.png 10 | b_play.png 11 | b_redo.png 12 | b_ruler.png 13 | b_save.png 14 | b_stop.png 15 | b_undo.png 16 | b_unlock.png 17 | b_play_prev.png 18 | b_repeat.png 19 | b_mic.png 20 | b_envelope.png 21 | b_manual.png 22 | b_notes.png 23 | b_plug.png 24 | b_blank.png 25 | b_folder.png 26 | b_cross.png 27 | b_power.png 28 | speaker.png 29 | speaker-mute.png 30 | b_save_music.png 31 | 32 | 33 | documentation_en.txt 34 | 35 | 36 | -------------------------------------------------------------------------------- /editor/res/qtau_win.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "appicon_ouka_alice.ico" -------------------------------------------------------------------------------- /editor/res/speaker-mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/speaker-mute.png -------------------------------------------------------------------------------- /editor/res/speaker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qtau-devgroup/editor/06d6efce856ba369db340a2d834e003fe5a99fa0/editor/res/speaker.png -------------------------------------------------------------------------------- /editor/ui/Config.h: -------------------------------------------------------------------------------- 1 | #ifndef QTAUCONFIG_H 2 | #define QTAUCONFIG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | // default config for custom ui widgets 13 | const unsigned int cdef_color_black_key_bg = 0xff666666; 14 | const unsigned int cdef_color_black_noteline_bg = 0xffb8b8b8; // aarrggbb 15 | const unsigned int cdef_color_inner_line = 0xffbcbcbc; 16 | const unsigned int cdef_color_outer_line = 0xff0095c6; 17 | 18 | const unsigned int cdef_color_note_border = 0xff000000; 19 | const unsigned int cdef_color_note_bg = 0xffffffff; 20 | const unsigned int cdef_color_note_sel = 0xff0095c6; 21 | const unsigned int cdef_color_note_sel_bg = 0xffe3eeff; 22 | 23 | const unsigned int cdef_color_selrect = 0xff00857d; 24 | const unsigned int cdef_color_selrect_bg = 0x2200857d; 25 | 26 | const unsigned int cdef_color_snap_line = 0xaa3effab; 27 | 28 | const unsigned int cdef_color_piano_lbl_wh = 0xff000000; // colors for white and black key lablels 29 | const unsigned int cdef_color_piano_lbl_wh_on = 0xff00857d; 30 | const unsigned int cdef_color_piano_lbl_bl = 0xffffffff; 31 | const unsigned int cdef_color_piano_lbl_bl_on = 0xffeafffe; 32 | 33 | const unsigned int cdef_color_logtab_err = 0xffff0000; 34 | 35 | const QString cdef_color_dynbtn_off = "#b7b7b7"; // CSS color 36 | const QString cdef_color_dynbtn_bg = "#77ded8"; // background graph button color 37 | const QString cdef_color_dynbtn_on = "#00857d"; // foreground graph button color 38 | const QString cdef_color_dynbtn_on_bg = "#eafffe"; 39 | 40 | const QPoint c_slideclick_limit = QPoint(3, 3); 41 | 42 | 43 | // editor config 44 | namespace qne { 45 | typedef struct _editorNote { 46 | quint64 id; 47 | int keyNumber; 48 | int pulseLength; 49 | int pulseOffset; 50 | QString txt; 51 | 52 | bool cached; 53 | bool selected; 54 | 55 | QRect r; // rectangle in pixels 56 | QPoint dragSt; // used to store start topleft pos in pixels at start of dragging 57 | // settings 58 | // effects 59 | 60 | _editorNote() : id(0), keyNumber(0), pulseLength(0), pulseOffset(0), txt("TEXT_HERE"), 61 | cached(false), selected(false), r(0,0,0,0) {} 62 | } editorNote; 63 | 64 | typedef struct _editorNotes { 65 | QMap idMap; 66 | QVector > grid; 67 | QVector selected; 68 | } editorNotes; 69 | 70 | typedef struct _editorState { 71 | QRect viewport; 72 | 73 | bool rmbScrollEnabled; 74 | bool editingEnabled; 75 | bool gridSnapEnabled; 76 | 77 | QRect selectionRect; 78 | int snapLine; 79 | 80 | _editorState() : rmbScrollEnabled(true), editingEnabled(false), gridSnapEnabled(true), snapLine(-1) {} 81 | } editorState; 82 | } 83 | 84 | 85 | #endif // QTAUCONFIG_H 86 | -------------------------------------------------------------------------------- /editor/ui/dynDrawer.h: -------------------------------------------------------------------------------- 1 | /* dynDrawer.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef DYNDRAWER_H 4 | #define DYNDRAWER_H 5 | 6 | #include "Utils.h" 7 | 8 | #include 9 | 10 | class QPixmap; 11 | 12 | 13 | class qtauDynLabel : public QLabel 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit qtauDynLabel(const QString& txt = "", QWidget *parent = 0); 19 | ~qtauDynLabel(); 20 | 21 | typedef enum { 22 | off = 0, 23 | front, 24 | back 25 | } EState; 26 | 27 | EState state(); 28 | void setState(EState s); 29 | 30 | signals: 31 | void leftClicked(); 32 | void rightClicked(); 33 | 34 | protected: 35 | void mousePressEvent(QMouseEvent * event); 36 | 37 | EState _state; 38 | 39 | }; 40 | 41 | //---------------------------------------------- 42 | 43 | class qtauDynDrawer : public QWidget 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | qtauDynDrawer(QWidget *parent = 0); 49 | ~qtauDynDrawer(); 50 | 51 | void setOffset(int off); 52 | void configure(const SNoteSetup &newSetup); 53 | 54 | signals: 55 | void scrolled(int delta); 56 | void zoomed (int delta); 57 | 58 | public slots: 59 | // 60 | 61 | protected: 62 | void paintEvent (QPaintEvent *event); 63 | void resizeEvent (QResizeEvent *event); 64 | 65 | void mouseDoubleClickEvent(QMouseEvent *event); 66 | void mouseMoveEvent (QMouseEvent *event); 67 | void mousePressEvent (QMouseEvent *event); 68 | void mouseReleaseEvent (QMouseEvent *event); 69 | void wheelEvent (QWheelEvent *event); 70 | 71 | int offset; 72 | 73 | SNoteSetup ns; 74 | 75 | QPixmap *bgCache; 76 | void updateCache(); 77 | 78 | }; 79 | 80 | #endif // DYNDRAWER_H 81 | -------------------------------------------------------------------------------- /editor/ui/meter.h: -------------------------------------------------------------------------------- 1 | /* meter.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef METER_H 4 | #define METER_H 5 | 6 | #include "Utils.h" 7 | #include 8 | 9 | class QPixmap; 10 | 11 | 12 | class qtauMeterBar : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | qtauMeterBar(QWidget *parent = 0); 18 | ~qtauMeterBar(); 19 | 20 | void setOffset(int off); 21 | void configure(const SNoteSetup &newSetup); 22 | 23 | signals: 24 | void scrolled(int delta); 25 | void zoomed (int delta); 26 | 27 | public slots: 28 | // 29 | 30 | protected: 31 | void paintEvent (QPaintEvent *event); 32 | void resizeEvent (QResizeEvent *event); 33 | 34 | void mouseDoubleClickEvent(QMouseEvent *event); 35 | void mouseMoveEvent (QMouseEvent *event); 36 | void mousePressEvent (QMouseEvent *event); 37 | void mouseReleaseEvent (QMouseEvent *event); 38 | void wheelEvent (QWheelEvent *event); 39 | 40 | int offset; 41 | SNoteSetup ns; 42 | 43 | QPixmap *bgCache; 44 | QPixmap *labelCache; 45 | 46 | void updateCache(); 47 | 48 | }; 49 | 50 | #endif // METER_H 51 | -------------------------------------------------------------------------------- /editor/ui/noteEditor.h: -------------------------------------------------------------------------------- 1 | /* noteEditor.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef NOTEEDITOR_H 4 | #define NOTEEDITOR_H 5 | 6 | #include "Utils.h" 7 | #include "ui/Config.h" 8 | #include 9 | #include 10 | 11 | class qtauEvent_NoteAddition; 12 | class qtauEvent_NoteMove; 13 | class qtauEvent_NoteResize; 14 | class qtauEvent_NoteText; 15 | class qtauEvent_NoteEffect; 16 | 17 | class QPixmap; 18 | class QLineEdit; 19 | 20 | class qtauEvent; 21 | class qtauEdController; 22 | 23 | 24 | class qtauNoteEditor : public QWidget 25 | { 26 | Q_OBJECT 27 | friend class qtauEdController; 28 | 29 | public: 30 | qtauNoteEditor(QWidget *parent = 0); 31 | ~qtauNoteEditor(); 32 | 33 | void configure(const SNoteSetup &newSetup); 34 | void deleteSelected(); 35 | 36 | void setVOffset(int voff); 37 | void setHOffset(int hoff); 38 | QPoint scrollTo (const QRect &r); 39 | 40 | void setRMBScrollEnabled(bool e) { state.rmbScrollEnabled = e; } 41 | void setEditingEnabled (bool e) { state.editingEnabled = e; } 42 | void setGridSnapEnabled (bool e) { state.gridSnapEnabled = e; } 43 | 44 | signals: 45 | void editorEvent(qtauEvent *e); 46 | 47 | void hscrolled(int delta); 48 | void vscrolled(int delta); 49 | void zoomed (int delta); 50 | 51 | void heightChanged(int newHeight); 52 | void widthChanged (int newWidth ); 53 | 54 | void rmbScrolled(QPoint posDelta, QPoint origOffset); 55 | void requestsOffset(QPoint offset); 56 | 57 | // what happens in editor and is sent to session 58 | void noteAdd (qtauEvent_NoteAddition *event); 59 | void noteResize(qtauEvent_NoteResize *event); 60 | void noteMove (qtauEvent_NoteMove *event); 61 | void noteText (qtauEvent_NoteText *event); 62 | void noteEffect(qtauEvent_NoteEffect *event); 63 | 64 | void urisDropped(QList uris); 65 | 66 | public slots: 67 | void onEvent(qtauEvent *e); 68 | void lazyUpdate(); // use this instead of update() - Qt is drawing much faster than display updates 69 | 70 | protected: 71 | void paintEvent (QPaintEvent *event); 72 | void resizeEvent (QResizeEvent *event); 73 | 74 | void mouseDoubleClickEvent(QMouseEvent *event); 75 | void mouseMoveEvent (QMouseEvent *event); 76 | void mousePressEvent (QMouseEvent *event); 77 | void mouseReleaseEvent (QMouseEvent *event); 78 | void wheelEvent (QWheelEvent *event); 79 | 80 | SNoteSetup setup; 81 | qne::editorState state; 82 | qne::editorNotes notes; 83 | 84 | QPixmap *labelCache; 85 | QPixmap *bgCache; 86 | 87 | void recalcNoteRects(); 88 | void updateBGCache(); 89 | 90 | int lastUpdate; 91 | bool delayingUpdate; 92 | bool updateCalled; 93 | 94 | qtauEdController *ctrl; 95 | qtauEdController *lastCtrl; // they keep getting input after changing somehow :/ 96 | 97 | void changeController(qtauEdController *c); 98 | void rmbScrollHappened(const QPoint &delta, const QPoint &origOff); 99 | void eventHappened(qtauEvent *e); 100 | 101 | }; 102 | 103 | 104 | #endif // NOTEEDITOR_H 105 | -------------------------------------------------------------------------------- /editor/ui/waveform.h: -------------------------------------------------------------------------------- 1 | /* waveform.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef WAVEFORM_H 4 | #define WAVEFORM_H 5 | 6 | #include "Utils.h" 7 | #include 8 | 9 | class QPixmap; 10 | class qtauAudioSource; 11 | 12 | class qtauWaveform : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit qtauWaveform(QWidget *parent = 0); 17 | ~qtauWaveform(); 18 | 19 | void setOffset(int off); 20 | void configure(int tempo, int noteWidth); 21 | void setAudio(qtauAudioSource *pcm); // setting 0 means just remove current and show nothing 22 | 23 | signals: 24 | void scrolled(int delta); 25 | void zoomed (int delta); 26 | 27 | public slots: 28 | // 29 | 30 | protected: 31 | void paintEvent (QPaintEvent *event); 32 | void resizeEvent (QResizeEvent *event); 33 | 34 | void mouseDoubleClickEvent(QMouseEvent *event); 35 | void mouseMoveEvent (QMouseEvent *event); 36 | void mousePressEvent (QMouseEvent *event); 37 | void mouseReleaseEvent (QMouseEvent *event); 38 | void wheelEvent (QWheelEvent *event); 39 | 40 | int offset; 41 | qtauAudioSource *wave; 42 | 43 | QPixmap *bgCache; 44 | void updateCache(); 45 | void calcSetup(); // calculate how many samples can fit into geometry.width 46 | 47 | int bpm; 48 | int beatWidth; // in pixels 49 | 50 | float framesVisible; 51 | }; 52 | 53 | #endif // WAVEFORM_H 54 | -------------------------------------------------------------------------------- /todo.txt: -------------------------------------------------------------------------------- 1 | - flac and ogg io 2 | - scaling on load of huge .ust/audio 3 | - paged waveform, joined wave panel 4 | - saving mixdown 5 | - progress of playback 6 | - ui for plugins, selection of synth 7 | - threaded synth 8 | -------------------------------------------------------------------------------- /tools/ffft/Array.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | Array.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_Array_HEADER_INCLUDED) 19 | #define ffft_Array_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | 35 | 36 | 37 | template 38 | class Array 39 | { 40 | 41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 42 | 43 | public: 44 | 45 | typedef T DataType; 46 | 47 | Array (); 48 | 49 | inline const DataType & 50 | operator [] (long pos) const; 51 | inline DataType & 52 | operator [] (long pos); 53 | 54 | static inline long 55 | size (); 56 | 57 | 58 | 59 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 60 | 61 | protected: 62 | 63 | 64 | 65 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 66 | 67 | private: 68 | 69 | DataType _data_arr [LEN]; 70 | 71 | 72 | 73 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 74 | 75 | private: 76 | 77 | Array (const Array &other); 78 | Array & operator = (const Array &other); 79 | bool operator == (const Array &other); 80 | bool operator != (const Array &other); 81 | 82 | }; // class Array 83 | 84 | 85 | 86 | } // namespace ffft 87 | 88 | 89 | 90 | #include "ffft/Array.hpp" 91 | 92 | 93 | 94 | #endif // ffft_Array_HEADER_INCLUDED 95 | 96 | 97 | 98 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 99 | -------------------------------------------------------------------------------- /tools/ffft/Array.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | Array.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_Array_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of Array code header. 20 | #endif 21 | #define ffft_Array_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_Array_CODEHEADER_INCLUDED) 24 | #define ffft_Array_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | 37 | 38 | 39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 40 | 41 | 42 | 43 | template 44 | Array ::Array () 45 | { 46 | // Nothing 47 | } 48 | 49 | 50 | 51 | template 52 | const typename Array ::DataType & Array ::operator [] (long pos) const 53 | { 54 | assert (pos >= 0); 55 | assert (pos < LEN); 56 | 57 | return (_data_arr [pos]); 58 | } 59 | 60 | 61 | 62 | template 63 | typename Array ::DataType & Array ::operator [] (long pos) 64 | { 65 | assert (pos >= 0); 66 | assert (pos < LEN); 67 | 68 | return (_data_arr [pos]); 69 | } 70 | 71 | 72 | 73 | template 74 | long Array ::size () 75 | { 76 | return (LEN); 77 | } 78 | 79 | 80 | 81 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 82 | 83 | 84 | 85 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 86 | 87 | 88 | 89 | } // namespace ffft 90 | 91 | 92 | 93 | #endif // ffft_Array_CODEHEADER_INCLUDED 94 | 95 | #undef ffft_Array_CURRENT_CODEHEADER 96 | 97 | 98 | 99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 100 | -------------------------------------------------------------------------------- /tools/ffft/DynArray.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | DynArray.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_DynArray_HEADER_INCLUDED) 19 | #define ffft_DynArray_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | 35 | 36 | 37 | template 38 | class DynArray 39 | { 40 | 41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 42 | 43 | public: 44 | 45 | typedef T DataType; 46 | 47 | DynArray (); 48 | explicit DynArray (long size); 49 | ~DynArray (); 50 | 51 | inline long size () const; 52 | inline void resize (long size); 53 | 54 | inline const DataType & 55 | operator [] (long pos) const; 56 | inline DataType & 57 | operator [] (long pos); 58 | 59 | 60 | 61 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 62 | 63 | protected: 64 | 65 | 66 | 67 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 68 | 69 | private: 70 | 71 | DataType * _data_ptr; 72 | long _len; 73 | 74 | 75 | 76 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 77 | 78 | private: 79 | 80 | DynArray (const DynArray &other); 81 | DynArray & operator = (const DynArray &other); 82 | bool operator == (const DynArray &other); 83 | bool operator != (const DynArray &other); 84 | 85 | }; // class DynArray 86 | 87 | 88 | 89 | } // namespace ffft 90 | 91 | 92 | 93 | #include "ffft/DynArray.hpp" 94 | 95 | 96 | 97 | #endif // ffft_DynArray_HEADER_INCLUDED 98 | 99 | 100 | 101 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 102 | -------------------------------------------------------------------------------- /tools/ffft/DynArray.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | DynArray.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_DynArray_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of DynArray code header. 20 | #endif 21 | #define ffft_DynArray_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_DynArray_CODEHEADER_INCLUDED) 24 | #define ffft_DynArray_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | 37 | 38 | 39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 40 | 41 | 42 | 43 | template 44 | DynArray ::DynArray () 45 | : _data_ptr (0) 46 | , _len (0) 47 | { 48 | // Nothing 49 | } 50 | 51 | 52 | 53 | template 54 | DynArray ::DynArray (long size) 55 | : _data_ptr (0) 56 | , _len (0) 57 | { 58 | assert (size >= 0); 59 | if (size > 0) 60 | { 61 | _data_ptr = new DataType [size]; 62 | _len = size; 63 | } 64 | } 65 | 66 | 67 | 68 | template 69 | DynArray ::~DynArray () 70 | { 71 | delete [] _data_ptr; 72 | _data_ptr = 0; 73 | _len = 0; 74 | } 75 | 76 | 77 | 78 | template 79 | long DynArray ::size () const 80 | { 81 | return (_len); 82 | } 83 | 84 | 85 | 86 | template 87 | void DynArray ::resize (long size) 88 | { 89 | assert (size >= 0); 90 | if (size > 0) 91 | { 92 | DataType * old_data_ptr = _data_ptr; 93 | DataType * tmp_data_ptr = new DataType [size]; 94 | 95 | _data_ptr = tmp_data_ptr; 96 | _len = size; 97 | 98 | delete [] old_data_ptr; 99 | } 100 | } 101 | 102 | 103 | 104 | template 105 | const typename DynArray ::DataType & DynArray ::operator [] (long pos) const 106 | { 107 | assert (pos >= 0); 108 | assert (pos < _len); 109 | 110 | return (_data_ptr [pos]); 111 | } 112 | 113 | 114 | 115 | template 116 | typename DynArray ::DataType & DynArray ::operator [] (long pos) 117 | { 118 | assert (pos >= 0); 119 | assert (pos < _len); 120 | 121 | return (_data_ptr [pos]); 122 | } 123 | 124 | 125 | 126 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 127 | 128 | 129 | 130 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 131 | 132 | 133 | 134 | } // namespace ffft 135 | 136 | 137 | 138 | #endif // ffft_DynArray_CODEHEADER_INCLUDED 139 | 140 | #undef ffft_DynArray_CURRENT_CODEHEADER 141 | 142 | 143 | 144 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 145 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealFixLenParam.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealFixLenParam.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_FFTRealFixLenParam_HEADER_INCLUDED) 19 | #define ffft_FFTRealFixLenParam_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | 35 | 36 | 37 | class FFTRealFixLenParam 38 | { 39 | 40 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 41 | 42 | public: 43 | 44 | // Over this bit depth, we use direct calculation for sin/cos 45 | enum { TRIGO_BD_LIMIT = 12 }; 46 | 47 | typedef float DataType; 48 | 49 | 50 | 51 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 52 | 53 | protected: 54 | 55 | 56 | 57 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | 59 | private: 60 | 61 | 62 | 63 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | 65 | private: 66 | 67 | FFTRealFixLenParam (); 68 | FFTRealFixLenParam (const FFTRealFixLenParam &other); 69 | FFTRealFixLenParam & 70 | operator = (const FFTRealFixLenParam &other); 71 | bool operator == (const FFTRealFixLenParam &other); 72 | bool operator != (const FFTRealFixLenParam &other); 73 | 74 | }; // class FFTRealFixLenParam 75 | 76 | 77 | 78 | } // namespace ffft 79 | 80 | 81 | 82 | //#include "ffft/FFTRealFixLenParam.hpp" 83 | 84 | 85 | 86 | #endif // ffft_FFTRealFixLenParam_HEADER_INCLUDED 87 | 88 | 89 | 90 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 91 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealPassDirect.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealPassDirect.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_FFTRealPassDirect_HEADER_INCLUDED) 19 | #define ffft_FFTRealPassDirect_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/def.h" 31 | #include "ffft/FFTRealFixLenParam.h" 32 | #include "ffft/OscSinCos.h" 33 | 34 | 35 | 36 | namespace ffft 37 | { 38 | 39 | 40 | 41 | template 42 | class FFTRealPassDirect 43 | { 44 | 45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 46 | 47 | public: 48 | 49 | typedef FFTRealFixLenParam::DataType DataType; 50 | typedef OscSinCos OscType; 51 | 52 | ffft_FORCEINLINE static void 53 | process (long len, DataType dest_ptr [], DataType src_ptr [], const DataType x_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []); 54 | 55 | 56 | 57 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | 59 | protected: 60 | 61 | 62 | 63 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | 65 | private: 66 | 67 | 68 | 69 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 70 | 71 | private: 72 | 73 | FFTRealPassDirect (); 74 | FFTRealPassDirect (const FFTRealPassDirect &other); 75 | FFTRealPassDirect & 76 | operator = (const FFTRealPassDirect &other); 77 | bool operator == (const FFTRealPassDirect &other); 78 | bool operator != (const FFTRealPassDirect &other); 79 | 80 | }; // class FFTRealPassDirect 81 | 82 | 83 | 84 | } // namespace ffft 85 | 86 | 87 | 88 | #include "ffft/FFTRealPassDirect.hpp" 89 | 90 | 91 | 92 | #endif // ffft_FFTRealPassDirect_HEADER_INCLUDED 93 | 94 | 95 | 96 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 97 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealPassInverse.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealPassInverse.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_FFTRealPassInverse_HEADER_INCLUDED) 19 | #define ffft_FFTRealPassInverse_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/def.h" 31 | #include "ffft/FFTRealFixLenParam.h" 32 | #include "ffft/OscSinCos.h" 33 | 34 | 35 | 36 | 37 | namespace ffft 38 | { 39 | 40 | 41 | 42 | template 43 | class FFTRealPassInverse 44 | { 45 | 46 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 47 | 48 | public: 49 | 50 | typedef FFTRealFixLenParam::DataType DataType; 51 | typedef OscSinCos OscType; 52 | 53 | ffft_FORCEINLINE static void 54 | process (long len, DataType dest_ptr [], DataType src_ptr [], const DataType f_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []); 55 | ffft_FORCEINLINE static void 56 | process_rec (long len, DataType dest_ptr [], DataType src_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []); 57 | ffft_FORCEINLINE static void 58 | process_internal (long len, DataType dest_ptr [], const DataType src_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []); 59 | 60 | 61 | 62 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 63 | 64 | protected: 65 | 66 | 67 | 68 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 69 | 70 | private: 71 | 72 | 73 | 74 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 75 | 76 | private: 77 | 78 | FFTRealPassInverse (); 79 | FFTRealPassInverse (const FFTRealPassInverse &other); 80 | FFTRealPassInverse & 81 | operator = (const FFTRealPassInverse &other); 82 | bool operator == (const FFTRealPassInverse &other); 83 | bool operator != (const FFTRealPassInverse &other); 84 | 85 | }; // class FFTRealPassInverse 86 | 87 | 88 | 89 | } // namespace ffft 90 | 91 | 92 | 93 | #include "ffft/FFTRealPassInverse.hpp" 94 | 95 | 96 | 97 | #endif // ffft_FFTRealPassInverse_HEADER_INCLUDED 98 | 99 | 100 | 101 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 102 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealSelect.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealSelect.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_FFTRealSelect_HEADER_INCLUDED) 19 | #define ffft_FFTRealSelect_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #endif 24 | 25 | 26 | 27 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 28 | 29 | #include "ffft/def.h" 30 | 31 | 32 | 33 | namespace ffft 34 | { 35 | 36 | 37 | 38 | template 39 | class FFTRealSelect 40 | { 41 | 42 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 43 | 44 | public: 45 | 46 | ffft_FORCEINLINE static float * 47 | sel_bin (float *e_ptr, float *o_ptr); 48 | 49 | 50 | 51 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 52 | 53 | private: 54 | 55 | FFTRealSelect (); 56 | ~FFTRealSelect (); 57 | FFTRealSelect (const FFTRealSelect &other); 58 | FFTRealSelect& operator = (const FFTRealSelect &other); 59 | bool operator == (const FFTRealSelect &other); 60 | bool operator != (const FFTRealSelect &other); 61 | 62 | }; // class FFTRealSelect 63 | 64 | 65 | 66 | } // namespace ffft 67 | 68 | 69 | 70 | #include "ffft/FFTRealSelect.hpp" 71 | 72 | 73 | 74 | #endif // ffft_FFTRealSelect_HEADER_INCLUDED 75 | 76 | 77 | 78 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 79 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealSelect.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealSelect.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_FFTRealSelect_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of FFTRealSelect code header. 20 | #endif 21 | #define ffft_FFTRealSelect_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_FFTRealSelect_CODEHEADER_INCLUDED) 24 | #define ffft_FFTRealSelect_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | namespace ffft 29 | { 30 | 31 | 32 | 33 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 34 | 35 | 36 | 37 | template 38 | float * FFTRealSelect

::sel_bin (float *e_ptr, float *o_ptr) 39 | { 40 | return (o_ptr); 41 | } 42 | 43 | 44 | 45 | template <> 46 | inline float * FFTRealSelect <0>::sel_bin (float *e_ptr, float *) 47 | { 48 | return (e_ptr); 49 | } 50 | 51 | 52 | 53 | } // namespace ffft 54 | 55 | 56 | 57 | #endif // ffft_FFTRealSelect_CODEHEADER_INCLUDED 58 | 59 | #undef ffft_FFTRealSelect_CURRENT_CODEHEADER 60 | 61 | 62 | 63 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealUseTrigo.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealUseTrigo.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_FFTRealUseTrigo_HEADER_INCLUDED) 19 | #define ffft_FFTRealUseTrigo_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/def.h" 31 | #include "ffft/FFTRealFixLenParam.h" 32 | #include "ffft/OscSinCos.h" 33 | 34 | 35 | 36 | namespace ffft 37 | { 38 | 39 | 40 | 41 | template 42 | class FFTRealUseTrigo 43 | { 44 | 45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 46 | 47 | public: 48 | 49 | typedef FFTRealFixLenParam::DataType DataType; 50 | typedef OscSinCos OscType; 51 | 52 | ffft_FORCEINLINE static void 53 | prepare (OscType &osc); 54 | ffft_FORCEINLINE static void 55 | iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s); 56 | 57 | 58 | 59 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 60 | 61 | protected: 62 | 63 | 64 | 65 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 66 | 67 | private: 68 | 69 | 70 | 71 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 72 | 73 | private: 74 | 75 | FFTRealUseTrigo (); 76 | ~FFTRealUseTrigo (); 77 | FFTRealUseTrigo (const FFTRealUseTrigo &other); 78 | FFTRealUseTrigo & 79 | operator = (const FFTRealUseTrigo &other); 80 | bool operator == (const FFTRealUseTrigo &other); 81 | bool operator != (const FFTRealUseTrigo &other); 82 | 83 | }; // class FFTRealUseTrigo 84 | 85 | 86 | 87 | } // namespace ffft 88 | 89 | 90 | 91 | #include "ffft/FFTRealUseTrigo.hpp" 92 | 93 | 94 | 95 | #endif // ffft_FFTRealUseTrigo_HEADER_INCLUDED 96 | 97 | 98 | 99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 100 | -------------------------------------------------------------------------------- /tools/ffft/FFTRealUseTrigo.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealUseTrigo.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_FFTRealUseTrigo_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of FFTRealUseTrigo code header. 20 | #endif 21 | #define ffft_FFTRealUseTrigo_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED) 24 | #define ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/OscSinCos.h" 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | 37 | 38 | 39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 40 | 41 | 42 | 43 | template 44 | void FFTRealUseTrigo ::prepare (OscType &osc) 45 | { 46 | osc.clear_buffers (); 47 | } 48 | 49 | template <> 50 | inline void FFTRealUseTrigo <0>::prepare (OscType &) 51 | { 52 | // Nothing 53 | } 54 | 55 | 56 | 57 | template 58 | void FFTRealUseTrigo ::iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s) 59 | { 60 | osc.step (); 61 | c = osc.get_cos (); 62 | s = osc.get_sin (); 63 | } 64 | 65 | template <> 66 | inline void FFTRealUseTrigo <0>::iterate (OscType &, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s) 67 | { 68 | c = cos_ptr [index_c]; 69 | s = cos_ptr [index_s]; 70 | } 71 | 72 | 73 | 74 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 75 | 76 | 77 | 78 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 79 | 80 | 81 | 82 | } // namespace ffft 83 | 84 | 85 | 86 | #endif // ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED 87 | 88 | #undef ffft_FFTRealUseTrigo_CURRENT_CODEHEADER 89 | 90 | 91 | 92 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 93 | -------------------------------------------------------------------------------- /tools/ffft/OscSinCos.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | OscSinCos.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_OscSinCos_HEADER_INCLUDED) 19 | #define ffft_OscSinCos_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/def.h" 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | 37 | 38 | 39 | template 40 | class OscSinCos 41 | { 42 | 43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 44 | 45 | public: 46 | 47 | typedef T DataType; 48 | 49 | OscSinCos (); 50 | 51 | ffft_FORCEINLINE void 52 | set_step (double angle_rad); 53 | 54 | ffft_FORCEINLINE DataType 55 | get_cos () const; 56 | ffft_FORCEINLINE DataType 57 | get_sin () const; 58 | ffft_FORCEINLINE void 59 | step (); 60 | ffft_FORCEINLINE void 61 | clear_buffers (); 62 | 63 | 64 | 65 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 66 | 67 | protected: 68 | 69 | 70 | 71 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 72 | 73 | private: 74 | 75 | DataType _pos_cos; // Current phase expressed with sin and cos. [-1 ; 1] 76 | DataType _pos_sin; // - 77 | DataType _step_cos; // Phase increment per step, [-1 ; 1] 78 | DataType _step_sin; // - 79 | 80 | 81 | 82 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 83 | 84 | private: 85 | 86 | OscSinCos (const OscSinCos &other); 87 | OscSinCos & operator = (const OscSinCos &other); 88 | bool operator == (const OscSinCos &other); 89 | bool operator != (const OscSinCos &other); 90 | 91 | }; // class OscSinCos 92 | 93 | 94 | 95 | } // namespace ffft 96 | 97 | 98 | 99 | #include "ffft/OscSinCos.hpp" 100 | 101 | 102 | 103 | #endif // ffft_OscSinCos_HEADER_INCLUDED 104 | 105 | 106 | 107 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 108 | -------------------------------------------------------------------------------- /tools/ffft/OscSinCos.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | OscSinCos.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_OscSinCos_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of OscSinCos code header. 20 | #endif 21 | #define ffft_OscSinCos_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_OscSinCos_CODEHEADER_INCLUDED) 24 | #define ffft_OscSinCos_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include 31 | 32 | namespace std { } 33 | 34 | 35 | 36 | namespace ffft 37 | { 38 | 39 | 40 | 41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 42 | 43 | 44 | 45 | template 46 | OscSinCos ::OscSinCos () 47 | : _pos_cos (1) 48 | , _pos_sin (0) 49 | , _step_cos (1) 50 | , _step_sin (0) 51 | { 52 | // Nothing 53 | } 54 | 55 | 56 | 57 | template 58 | void OscSinCos ::set_step (double angle_rad) 59 | { 60 | using namespace std; 61 | 62 | _step_cos = static_cast (cos (angle_rad)); 63 | _step_sin = static_cast (sin (angle_rad)); 64 | } 65 | 66 | 67 | 68 | template 69 | typename OscSinCos ::DataType OscSinCos ::get_cos () const 70 | { 71 | return (_pos_cos); 72 | } 73 | 74 | 75 | 76 | template 77 | typename OscSinCos ::DataType OscSinCos ::get_sin () const 78 | { 79 | return (_pos_sin); 80 | } 81 | 82 | 83 | 84 | template 85 | void OscSinCos ::step () 86 | { 87 | const DataType old_cos = _pos_cos; 88 | const DataType old_sin = _pos_sin; 89 | 90 | _pos_cos = old_cos * _step_cos - old_sin * _step_sin; 91 | _pos_sin = old_cos * _step_sin + old_sin * _step_cos; 92 | } 93 | 94 | 95 | 96 | template 97 | void OscSinCos ::clear_buffers () 98 | { 99 | _pos_cos = static_cast (1); 100 | _pos_sin = static_cast (0); 101 | } 102 | 103 | 104 | 105 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 106 | 107 | 108 | 109 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 110 | 111 | 112 | 113 | } // namespace ffft 114 | 115 | 116 | 117 | #endif // ffft_OscSinCos_CODEHEADER_INCLUDED 118 | 119 | #undef ffft_OscSinCos_CURRENT_CODEHEADER 120 | 121 | 122 | 123 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 124 | -------------------------------------------------------------------------------- /tools/ffft/def.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | def.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_def_HEADER_INCLUDED) 19 | #define ffft_def_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | 35 | 36 | 37 | const double PI = 3.1415926535897932384626433832795; 38 | const double SQRT2 = 1.41421356237309514547462185873883; 39 | 40 | #if defined (_MSC_VER) 41 | 42 | #define ffft_FORCEINLINE __forceinline 43 | 44 | #else 45 | 46 | #define ffft_FORCEINLINE inline 47 | 48 | #endif 49 | 50 | 51 | 52 | } // namespace ffft 53 | 54 | 55 | 56 | #endif // ffft_def_HEADER_INCLUDED 57 | 58 | 59 | 60 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 61 | -------------------------------------------------------------------------------- /tools/ffft/license.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /tools/ffft/test/TestAccuracy.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestAccuracy.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_TestAccuracy_HEADER_INCLUDED) 19 | #define ffft_test_TestAccuracy_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | namespace test 35 | { 36 | 37 | 38 | 39 | template 40 | class TestAccuracy 41 | { 42 | 43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 44 | 45 | public: 46 | 47 | typedef typename FO::DataType DataType; 48 | typedef long double BigFloat; // To get maximum accuracy during intermediate calculations 49 | 50 | static int perform_test_single_object (FO &fft); 51 | static int perform_test_d (FO &fft, const char *class_name_0); 52 | static int perform_test_i (FO &fft, const char *class_name_0); 53 | static int perform_test_di (FO &fft, const char *class_name_0); 54 | 55 | 56 | 57 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | 59 | protected: 60 | 61 | 62 | 63 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | 65 | private: 66 | 67 | enum { NBR_ACC_TESTS = 10 * 1000 * 1000 }; 68 | enum { MAX_NBR_TESTS = 10000 }; 69 | 70 | static void compute_tf (DataType s [], const DataType x [], long length); 71 | static void compute_itf (DataType x [], const DataType s [], long length); 72 | static int compare_vect_display (const DataType x_ptr [], const DataType y_ptr [], long len, BigFloat &max_err_rel); 73 | static BigFloat 74 | compute_power (const DataType x_ptr [], long len); 75 | static BigFloat 76 | compute_power (const DataType x_ptr [], const DataType y_ptr [], long len); 77 | static void compare_vect (const DataType x_ptr [], const DataType y_ptr [], BigFloat &power, long &max_err_pos, long len); 78 | 79 | 80 | 81 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 82 | 83 | private: 84 | 85 | TestAccuracy (); 86 | TestAccuracy (const TestAccuracy &other); 87 | TestAccuracy & operator = (const TestAccuracy &other); 88 | bool operator == (const TestAccuracy &other); 89 | bool operator != (const TestAccuracy &other); 90 | 91 | }; // class TestAccuracy 92 | 93 | 94 | 95 | } // namespace test 96 | } // namespace ffft 97 | 98 | 99 | 100 | #include "ffft/test/TestAccuracy.hpp" 101 | 102 | 103 | 104 | #endif // ffft_test_TestAccuracy_HEADER_INCLUDED 105 | 106 | 107 | 108 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 109 | -------------------------------------------------------------------------------- /tools/ffft/test/TestHelperFixLen.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestHelperFixLen.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_TestHelperFixLen_HEADER_INCLUDED) 19 | #define ffft_test_TestHelperFixLen_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/FFTRealFixLen.h" 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | namespace test 37 | { 38 | 39 | 40 | 41 | template 42 | class TestHelperFixLen 43 | { 44 | 45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 46 | 47 | public: 48 | 49 | typedef FFTRealFixLen FftType; 50 | 51 | static void perform_test_accuracy (int &ret_val); 52 | static void perform_test_speed (int &ret_val); 53 | 54 | 55 | 56 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 57 | 58 | protected: 59 | 60 | 61 | 62 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 63 | 64 | private: 65 | 66 | 67 | 68 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 69 | 70 | private: 71 | 72 | TestHelperFixLen (); 73 | TestHelperFixLen (const TestHelperFixLen &other); 74 | TestHelperFixLen & 75 | operator = (const TestHelperFixLen &other); 76 | bool operator == (const TestHelperFixLen &other); 77 | bool operator != (const TestHelperFixLen &other); 78 | 79 | }; // class TestHelperFixLen 80 | 81 | 82 | 83 | } // namespace test 84 | } // namespace ffft 85 | 86 | 87 | 88 | #include "ffft/test/TestHelperFixLen.hpp" 89 | 90 | 91 | 92 | #endif // ffft_test_TestHelperFixLen_HEADER_INCLUDED 93 | 94 | 95 | 96 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 97 | -------------------------------------------------------------------------------- /tools/ffft/test/TestHelperFixLen.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestHelperFixLen.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_test_TestHelperFixLen_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of TestHelperFixLen code header. 20 | #endif 21 | #define ffft_test_TestHelperFixLen_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_test_TestHelperFixLen_CODEHEADER_INCLUDED) 24 | #define ffft_test_TestHelperFixLen_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/test/conf.h" 31 | 32 | #include "ffft/test/TestAccuracy.h" 33 | #if defined (ffft_test_SPEED_TEST_ENABLED) 34 | #include "ffft/test/TestSpeed.h" 35 | #endif 36 | 37 | 38 | 39 | namespace ffft 40 | { 41 | namespace test 42 | { 43 | 44 | 45 | 46 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 47 | 48 | 49 | 50 | template 51 | void TestHelperFixLen ::perform_test_accuracy (int &ret_val) 52 | { 53 | if (ret_val == 0) 54 | { 55 | FftType fft; 56 | ret_val = TestAccuracy ::perform_test_single_object (fft); 57 | } 58 | } 59 | 60 | 61 | 62 | template 63 | void TestHelperFixLen ::perform_test_speed (int &ret_val) 64 | { 65 | #if defined (ffft_test_SPEED_TEST_ENABLED) 66 | 67 | if (ret_val == 0) 68 | { 69 | FftType fft; 70 | ret_val = TestSpeed ::perform_test_single_object (fft); 71 | } 72 | 73 | #endif 74 | } 75 | 76 | 77 | 78 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 79 | 80 | 81 | 82 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 83 | 84 | 85 | 86 | } // namespace test 87 | } // namespace ffft 88 | 89 | 90 | 91 | #endif // ffft_test_TestHelperFixLen_CODEHEADER_INCLUDED 92 | 93 | #undef ffft_test_TestHelperFixLen_CURRENT_CODEHEADER 94 | 95 | 96 | 97 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 98 | -------------------------------------------------------------------------------- /tools/ffft/test/TestHelperNormal.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestHelperNormal.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_TestHelperNormal_HEADER_INCLUDED) 19 | #define ffft_test_TestHelperNormal_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/FFTReal.h" 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | namespace test 37 | { 38 | 39 | 40 | 41 | template 42 | class TestHelperNormal 43 | { 44 | 45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 46 | 47 | public: 48 | 49 | typedef DT DataType; 50 | typedef FFTReal FftType; 51 | 52 | static void perform_test_accuracy (int &ret_val); 53 | static void perform_test_speed (int &ret_val); 54 | 55 | 56 | 57 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | 59 | protected: 60 | 61 | 62 | 63 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | 65 | private: 66 | 67 | 68 | 69 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 70 | 71 | private: 72 | 73 | TestHelperNormal (); 74 | TestHelperNormal (const TestHelperNormal &other); 75 | TestHelperNormal & 76 | operator = (const TestHelperNormal &other); 77 | bool operator == (const TestHelperNormal &other); 78 | bool operator != (const TestHelperNormal &other); 79 | 80 | }; // class TestHelperNormal 81 | 82 | 83 | 84 | } // namespace test 85 | } // namespace ffft 86 | 87 | 88 | 89 | #include "ffft/test/TestHelperNormal.hpp" 90 | 91 | 92 | 93 | #endif // ffft_test_TestHelperNormal_HEADER_INCLUDED 94 | 95 | 96 | 97 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 98 | -------------------------------------------------------------------------------- /tools/ffft/test/TestHelperNormal.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestHelperNormal.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_test_TestHelperNormal_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of TestHelperNormal code header. 20 | #endif 21 | #define ffft_test_TestHelperNormal_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_test_TestHelperNormal_CODEHEADER_INCLUDED) 24 | #define ffft_test_TestHelperNormal_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include "ffft/test/conf.h" 31 | 32 | #include "ffft/test/TestAccuracy.h" 33 | #if defined (ffft_test_SPEED_TEST_ENABLED) 34 | #include "ffft/test/TestSpeed.h" 35 | #endif 36 | 37 | 38 | 39 | namespace ffft 40 | { 41 | namespace test 42 | { 43 | 44 | 45 | 46 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 47 | 48 | 49 | 50 | template 51 | void TestHelperNormal

::perform_test_accuracy (int &ret_val) 52 | { 53 | const int len_arr [] = { 1, 2, 3, 4, 7, 8, 10, 12 }; 54 | const int nbr_len = sizeof (len_arr) / sizeof (len_arr [0]); 55 | for (int k = 0; k < nbr_len && ret_val == 0; ++k) 56 | { 57 | const long len = 1L << (len_arr [k]); 58 | FftType fft (len); 59 | ret_val = TestAccuracy ::perform_test_single_object (fft); 60 | } 61 | } 62 | 63 | 64 | 65 | template 66 | void TestHelperNormal
::perform_test_speed (int &ret_val) 67 | { 68 | #if defined (ffft_test_SPEED_TEST_ENABLED) 69 | 70 | const int len_arr [] = { 1, 2, 3, 4, 7, 8, 10, 12, 14, 16, 18, 20, 22 }; 71 | const int nbr_len = sizeof (len_arr) / sizeof (len_arr [0]); 72 | for (int k = 0; k < nbr_len && ret_val == 0; ++k) 73 | { 74 | const long len = 1L << (len_arr [k]); 75 | FftType fft (len); 76 | ret_val = TestSpeed ::perform_test_single_object (fft); 77 | } 78 | 79 | #endif 80 | } 81 | 82 | 83 | 84 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 85 | 86 | 87 | 88 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 89 | 90 | 91 | 92 | } // namespace test 93 | } // namespace ffft 94 | 95 | 96 | 97 | #endif // ffft_test_TestHelperNormal_CODEHEADER_INCLUDED 98 | 99 | #undef ffft_test_TestHelperNormal_CURRENT_CODEHEADER 100 | 101 | 102 | 103 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 104 | -------------------------------------------------------------------------------- /tools/ffft/test/TestSpeed.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestSpeed.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_TestSpeed_HEADER_INCLUDED) 19 | #define ffft_test_TestSpeed_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | namespace test 35 | { 36 | 37 | 38 | 39 | template 40 | class TestSpeed 41 | { 42 | 43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 44 | 45 | public: 46 | 47 | typedef typename FO::DataType DataType; 48 | 49 | static int perform_test_single_object (FO &fft); 50 | static int perform_test_d (FO &fft, const char *class_name_0); 51 | static int perform_test_i (FO &fft, const char *class_name_0); 52 | static int perform_test_di (FO &fft, const char *class_name_0); 53 | 54 | 55 | 56 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 57 | 58 | protected: 59 | 60 | 61 | 62 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 63 | 64 | private: 65 | 66 | enum { NBR_SPD_TESTS = 10 * 1000 * 1000 }; 67 | enum { MAX_NBR_TESTS = 10000 }; 68 | 69 | 70 | 71 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 72 | 73 | private: 74 | 75 | TestSpeed (); 76 | ~TestSpeed (); 77 | TestSpeed (const TestSpeed &other); 78 | TestSpeed & operator = (const TestSpeed &other); 79 | bool operator == (const TestSpeed &other); 80 | bool operator != (const TestSpeed &other); 81 | 82 | }; // class TestSpeed 83 | 84 | 85 | 86 | } // namespace test 87 | } // namespace ffft 88 | 89 | 90 | 91 | #include "ffft/test/TestSpeed.hpp" 92 | 93 | 94 | 95 | #endif // ffft_test_TestSpeed_HEADER_INCLUDED 96 | 97 | 98 | 99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 100 | -------------------------------------------------------------------------------- /tools/ffft/test/TestWhiteNoiseGen.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestWhiteNoiseGen.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_TestWhiteNoiseGen_HEADER_INCLUDED) 19 | #define ffft_test_TestWhiteNoiseGen_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | namespace test 35 | { 36 | 37 | 38 | 39 | template 40 | class TestWhiteNoiseGen 41 | { 42 | 43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 44 | 45 | public: 46 | 47 | typedef DT DataType; 48 | 49 | TestWhiteNoiseGen (); 50 | virtual ~TestWhiteNoiseGen () {} 51 | 52 | void generate (DataType data_ptr [], long len); 53 | 54 | 55 | 56 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 57 | 58 | protected: 59 | 60 | 61 | 62 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 63 | 64 | private: 65 | 66 | typedef unsigned long StateType; 67 | 68 | StateType _rand_state; 69 | 70 | 71 | 72 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 73 | 74 | private: 75 | 76 | TestWhiteNoiseGen (const TestWhiteNoiseGen &other); 77 | TestWhiteNoiseGen & 78 | operator = (const TestWhiteNoiseGen &other); 79 | bool operator == (const TestWhiteNoiseGen &other); 80 | bool operator != (const TestWhiteNoiseGen &other); 81 | 82 | }; // class TestWhiteNoiseGen 83 | 84 | 85 | 86 | } // namespace test 87 | } // namespace ffft 88 | 89 | 90 | 91 | #include "ffft/test/TestWhiteNoiseGen.hpp" 92 | 93 | 94 | 95 | #endif // ffft_test_TestWhiteNoiseGen_HEADER_INCLUDED 96 | 97 | 98 | 99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 100 | -------------------------------------------------------------------------------- /tools/ffft/test/TestWhiteNoiseGen.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | TestWhiteNoiseGen.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_test_TestWhiteNoiseGen_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of TestWhiteNoiseGen code header. 20 | #endif 21 | #define ffft_test_TestWhiteNoiseGen_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_test_TestWhiteNoiseGen_CODEHEADER_INCLUDED) 24 | #define ffft_test_TestWhiteNoiseGen_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include 31 | 32 | 33 | 34 | namespace ffft 35 | { 36 | namespace test 37 | { 38 | 39 | 40 | 41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 42 | 43 | 44 | 45 | template 46 | TestWhiteNoiseGen
::TestWhiteNoiseGen () 47 | : _rand_state (0) 48 | { 49 | _rand_state = StateType (reinterpret_cast (this)); 50 | } 51 | 52 | 53 | 54 | template 55 | void TestWhiteNoiseGen
::generate (DataType data_ptr [], long len) 56 | { 57 | assert (data_ptr != 0); 58 | assert (len > 0); 59 | 60 | const DataType one = static_cast (1); 61 | const DataType mul = one / static_cast (0x80000000UL); 62 | 63 | long pos = 0; 64 | do 65 | { 66 | const DataType x = static_cast (_rand_state & 0xFFFFFFFFUL); 67 | data_ptr [pos] = x * mul - one; 68 | 69 | _rand_state = _rand_state * 1234567UL + 890123UL; 70 | 71 | ++ pos; 72 | } 73 | while (pos < len); 74 | } 75 | 76 | 77 | 78 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 79 | 80 | 81 | 82 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 83 | 84 | 85 | 86 | } // namespace test 87 | } // namespace ffft 88 | 89 | 90 | 91 | #endif // ffft_test_TestWhiteNoiseGen_CODEHEADER_INCLUDED 92 | 93 | #undef ffft_test_TestWhiteNoiseGen_CURRENT_CODEHEADER 94 | 95 | 96 | 97 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 98 | -------------------------------------------------------------------------------- /tools/ffft/test/conf.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | conf.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_conf_HEADER_INCLUDED) 19 | #define ffft_test_conf_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | namespace ffft 29 | { 30 | namespace test 31 | { 32 | 33 | 34 | 35 | // #undef this label to avoid speed test compilation. 36 | #define ffft_test_SPEED_TEST_ENABLED 37 | 38 | 39 | 40 | } // namespace test 41 | } // namespace ffft 42 | 43 | 44 | 45 | #endif // ffft_test_conf_HEADER_INCLUDED 46 | 47 | 48 | 49 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 50 | -------------------------------------------------------------------------------- /tools/ffft/test/fnc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | fnc.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (ffft_test_fnc_HEADER_INCLUDED) 19 | #define ffft_test_fnc_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | namespace test 35 | { 36 | 37 | 38 | 39 | template 40 | inline T limit (const T &x, const T &inf, const T &sup); 41 | 42 | 43 | 44 | } // namespace test 45 | } // namespace ffft 46 | 47 | 48 | 49 | #include "ffft/test/fnc.hpp" 50 | 51 | 52 | 53 | #endif // ffft_test_fnc_HEADER_INCLUDED 54 | 55 | 56 | 57 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | -------------------------------------------------------------------------------- /tools/ffft/test/fnc.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | fnc.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (ffft_test_fnc_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of fnc code header. 20 | #endif 21 | #define ffft_test_fnc_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_test_fnc_CODEHEADER_INCLUDED) 24 | #define ffft_test_fnc_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace ffft 33 | { 34 | namespace test 35 | { 36 | 37 | 38 | 39 | template 40 | T limit (const T &x, const T &inf, const T &sup) 41 | { 42 | assert (! (sup < inf)); 43 | 44 | return ((x < inf) ? inf : ((sup < x) ? sup : x)); 45 | } 46 | 47 | 48 | 49 | } // namespace test 50 | } // namespace ffft 51 | 52 | 53 | 54 | #endif // ffft_test_fnc_CODEHEADER_INCLUDED 55 | 56 | #undef ffft_test_fnc_CURRENT_CODEHEADER 57 | 58 | 59 | 60 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 61 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/ClockCycleCounter.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | ClockCycleCounter.h 4 | By Laurent de Soras 5 | 6 | Instrumentation class, for accurate time interval measurement. You may have 7 | to modify the implementation to adapt it to your system and/or compiler. 8 | 9 | --- Legal stuff --- 10 | 11 | This program is free software. It comes without any warranty, to 12 | the extent permitted by applicable law. You can redistribute it 13 | and/or modify it under the terms of the Do What The Fuck You Want 14 | To Public License, Version 2, as published by Sam Hocevar. See 15 | http://sam.zoy.org/wtfpl/COPYING for more details. 16 | 17 | *Tab=3***********************************************************************/ 18 | 19 | 20 | 21 | #if ! defined (stopwatch_ClockCycleCounter_HEADER_INCLUDED) 22 | #define stopwatch_ClockCycleCounter_HEADER_INCLUDED 23 | 24 | #if defined (_MSC_VER) 25 | #pragma once 26 | #pragma warning (4 : 4250) // "Inherits via dominance." 27 | #endif 28 | 29 | 30 | 31 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 32 | 33 | #include "def.h" 34 | #include "Int64.h" 35 | 36 | 37 | 38 | namespace stopwatch 39 | { 40 | 41 | 42 | 43 | class ClockCycleCounter 44 | { 45 | 46 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 47 | 48 | public: 49 | 50 | ClockCycleCounter (); 51 | 52 | stopwatch_FORCEINLINE void 53 | start (); 54 | stopwatch_FORCEINLINE void 55 | stop_lap (); 56 | Int64 get_time_total () const; 57 | Int64 get_time_best_lap () const; 58 | 59 | 60 | 61 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 62 | 63 | protected: 64 | 65 | 66 | 67 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 68 | 69 | private: 70 | 71 | void compute_clk_mul (); 72 | void compute_measure_time_total (); 73 | void compute_measure_time_lap (); 74 | 75 | static void spend_time (); 76 | static stopwatch_FORCEINLINE Int64 77 | read_clock_counter (); 78 | 79 | Int64 _start_time; 80 | Int64 _state; 81 | Int64 _best_score; 82 | 83 | static Int64 _measure_time_total; 84 | static Int64 _measure_time_lap; 85 | static int _clk_mul; 86 | static bool _init_flag; 87 | 88 | 89 | 90 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 91 | 92 | private: 93 | 94 | ClockCycleCounter (const ClockCycleCounter &other); 95 | ClockCycleCounter & 96 | operator = (const ClockCycleCounter &other); 97 | bool operator == (const ClockCycleCounter &other); 98 | bool operator != (const ClockCycleCounter &other); 99 | 100 | }; // class ClockCycleCounter 101 | 102 | 103 | 104 | } // namespace stopwatch 105 | 106 | 107 | 108 | #include "ClockCycleCounter.hpp" 109 | 110 | 111 | 112 | #endif // stopwatch_ClockCycleCounter_HEADER_INCLUDED 113 | 114 | 115 | 116 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 117 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/Int64.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | Int64.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (stopwatch_Int64_HEADER_INCLUDED) 19 | #define stopwatch_Int64_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace stopwatch 33 | { 34 | 35 | 36 | #if defined (_MSC_VER) 37 | 38 | typedef __int64 Int64; 39 | 40 | #elif defined (__MWERKS__) || defined (__GNUC__) 41 | 42 | typedef long long Int64; 43 | 44 | #elif defined (__BEOS__) 45 | 46 | typedef int64 Int64; 47 | 48 | #else 49 | 50 | #error No 64-bit integer type defined for this compiler ! 51 | 52 | #endif 53 | 54 | 55 | } // namespace stopwatch 56 | 57 | 58 | 59 | #endif // stopwatch_Int64_HEADER_INCLUDED 60 | 61 | 62 | 63 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 64 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/StopWatch.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | StopWatch.cpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (_MSC_VER) 19 | #pragma warning (1 : 4130) // "'operator' : logical operation on address of string constant" 20 | #pragma warning (1 : 4223) // "nonstandard extension used : non-lvalue array converted to pointer" 21 | #pragma warning (1 : 4705) // "statement has no effect" 22 | #pragma warning (1 : 4706) // "assignment within conditional expression" 23 | #pragma warning (4 : 4786) // "identifier was truncated to '255' characters in the debug information" 24 | #pragma warning (4 : 4800) // "forcing value to bool 'true' or 'false' (performance warning)" 25 | #pragma warning (4 : 4355) // "'this' : used in base member initializer list" 26 | #endif 27 | 28 | 29 | 30 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 31 | 32 | #include "StopWatch.h" 33 | 34 | #include 35 | 36 | 37 | 38 | namespace stopwatch 39 | { 40 | 41 | 42 | 43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 44 | 45 | 46 | 47 | StopWatch::StopWatch () 48 | : _ccc () 49 | , _nbr_laps (0) 50 | { 51 | // Nothing 52 | } 53 | 54 | 55 | 56 | double StopWatch::get_time_total (Int64 nbr_op) const 57 | { 58 | assert (_nbr_laps > 0); 59 | assert (nbr_op > 0); 60 | 61 | return ( 62 | static_cast (_ccc.get_time_total ()) 63 | / (static_cast (nbr_op) * static_cast (_nbr_laps)) 64 | ); 65 | } 66 | 67 | 68 | 69 | double StopWatch::get_time_best_lap (Int64 nbr_op) const 70 | { 71 | assert (nbr_op > 0); 72 | 73 | return ( 74 | static_cast (_ccc.get_time_best_lap ()) 75 | / static_cast (nbr_op) 76 | ); 77 | } 78 | 79 | 80 | 81 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 82 | 83 | 84 | 85 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 86 | 87 | 88 | 89 | } // namespace stopwatch 90 | 91 | 92 | 93 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 94 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/StopWatch.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | StopWatch.h 4 | By Laurent de Soras 5 | 6 | Utility class based on ClockCycleCounter to measure the unit time of a 7 | repeated operation. 8 | 9 | --- Legal stuff --- 10 | 11 | This program is free software. It comes without any warranty, to 12 | the extent permitted by applicable law. You can redistribute it 13 | and/or modify it under the terms of the Do What The Fuck You Want 14 | To Public License, Version 2, as published by Sam Hocevar. See 15 | http://sam.zoy.org/wtfpl/COPYING for more details. 16 | 17 | *Tab=3***********************************************************************/ 18 | 19 | 20 | 21 | #if ! defined (stopwatch_StopWatch_HEADER_INCLUDED) 22 | #define stopwatch_StopWatch_HEADER_INCLUDED 23 | 24 | #if defined (_MSC_VER) 25 | #pragma once 26 | #pragma warning (4 : 4250) // "Inherits via dominance." 27 | #endif 28 | 29 | 30 | 31 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 32 | 33 | #include "ClockCycleCounter.h" 34 | 35 | 36 | 37 | namespace stopwatch 38 | { 39 | 40 | 41 | 42 | class StopWatch 43 | { 44 | 45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 46 | 47 | public: 48 | 49 | StopWatch (); 50 | 51 | stopwatch_FORCEINLINE void 52 | start (); 53 | stopwatch_FORCEINLINE void 54 | stop_lap (); 55 | 56 | double get_time_total (Int64 nbr_op) const; 57 | double get_time_best_lap (Int64 nbr_op) const; 58 | 59 | 60 | 61 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 62 | 63 | protected: 64 | 65 | 66 | 67 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 68 | 69 | private: 70 | 71 | ClockCycleCounter 72 | _ccc; 73 | Int64 _nbr_laps; 74 | 75 | 76 | 77 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 78 | 79 | private: 80 | 81 | StopWatch (const StopWatch &other); 82 | StopWatch & operator = (const StopWatch &other); 83 | bool operator == (const StopWatch &other); 84 | bool operator != (const StopWatch &other); 85 | 86 | }; // class StopWatch 87 | 88 | 89 | 90 | } // namespace stopwatch 91 | 92 | 93 | 94 | #include "StopWatch.hpp" 95 | 96 | 97 | 98 | #endif // stopwatch_StopWatch_HEADER_INCLUDED 99 | 100 | 101 | 102 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 103 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/StopWatch.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | StopWatch.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (stopwatch_StopWatch_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of StopWatch code header. 20 | #endif 21 | #define stopwatch_StopWatch_CURRENT_CODEHEADER 22 | 23 | #if ! defined (stopwatch_StopWatch_CODEHEADER_INCLUDED) 24 | #define stopwatch_StopWatch_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace stopwatch 33 | { 34 | 35 | 36 | 37 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 38 | 39 | 40 | 41 | void StopWatch::start () 42 | { 43 | _nbr_laps = 0; 44 | _ccc.start (); 45 | } 46 | 47 | 48 | 49 | void StopWatch::stop_lap () 50 | { 51 | _ccc.stop_lap (); 52 | ++ _nbr_laps; 53 | } 54 | 55 | 56 | 57 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | 59 | 60 | 61 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 62 | 63 | 64 | 65 | } // namespace stopwatch 66 | 67 | 68 | 69 | #endif // stopwatch_StopWatch_CODEHEADER_INCLUDED 70 | 71 | #undef stopwatch_StopWatch_CURRENT_CODEHEADER 72 | 73 | 74 | 75 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 76 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/def.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | def.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (stopwatch_def_HEADER_INCLUDED) 19 | #define stopwatch_def_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace stopwatch 33 | { 34 | 35 | 36 | 37 | #if defined (_MSC_VER) 38 | 39 | #define stopwatch_FORCEINLINE __forceinline 40 | 41 | #else 42 | 43 | #define stopwatch_FORCEINLINE inline 44 | 45 | #endif 46 | 47 | 48 | 49 | } // namespace stopwatch 50 | 51 | 52 | 53 | #endif // stopwatch_def_HEADER_INCLUDED 54 | 55 | 56 | 57 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 58 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/fnc.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | fnc.h 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if ! defined (stopwatch_fnc_HEADER_INCLUDED) 19 | #define stopwatch_fnc_HEADER_INCLUDED 20 | 21 | #if defined (_MSC_VER) 22 | #pragma once 23 | #pragma warning (4 : 4250) // "Inherits via dominance." 24 | #endif 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | 31 | 32 | namespace stopwatch 33 | { 34 | 35 | 36 | 37 | template 38 | inline T min (T a, T b); 39 | 40 | template 41 | inline T max (T a, T b); 42 | 43 | inline int round_int (double x); 44 | 45 | 46 | 47 | } // namespace rsp 48 | 49 | 50 | 51 | #include "fnc.hpp" 52 | 53 | 54 | 55 | #endif // stopwatch_fnc_HEADER_INCLUDED 56 | 57 | 58 | 59 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 60 | -------------------------------------------------------------------------------- /tools/ffft/test/stopwatch/fnc.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | fnc.hpp 4 | By Laurent de Soras 5 | 6 | --- Legal stuff --- 7 | 8 | This program is free software. It comes without any warranty, to 9 | the extent permitted by applicable law. You can redistribute it 10 | and/or modify it under the terms of the Do What The Fuck You Want 11 | To Public License, Version 2, as published by Sam Hocevar. See 12 | http://sam.zoy.org/wtfpl/COPYING for more details. 13 | 14 | *Tab=3***********************************************************************/ 15 | 16 | 17 | 18 | #if defined (stopwatch_fnc_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of fnc code header. 20 | #endif 21 | #define stopwatch_fnc_CURRENT_CODEHEADER 22 | 23 | #if ! defined (stopwatch_fnc_CODEHEADER_INCLUDED) 24 | #define stopwatch_fnc_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 29 | 30 | #include 31 | #include 32 | 33 | namespace std {} 34 | 35 | 36 | 37 | namespace stopwatch 38 | { 39 | 40 | 41 | 42 | template 43 | inline T min (T a, T b) 44 | { 45 | return ((a < b) ? a : b); 46 | } 47 | 48 | 49 | 50 | template 51 | inline T max (T a, T b) 52 | { 53 | return ((b < a) ? a : b); 54 | } 55 | 56 | 57 | 58 | int round_int (double x) 59 | { 60 | using namespace std; 61 | 62 | return (static_cast (floor (x + 0.5))); 63 | } 64 | 65 | 66 | 67 | } // namespace stopwatch 68 | 69 | 70 | 71 | #endif // stopwatch_fnc_CODEHEADER_INCLUDED 72 | 73 | #undef stopwatch_fnc_CURRENT_CODEHEADER 74 | 75 | 76 | 77 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 78 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/AUTHORS: -------------------------------------------------------------------------------- 1 | /* FLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * This file is part the FLAC project. FLAC is comprised of several 6 | * components distributed under different licenses. The codec libraries 7 | * are distributed under Xiph.Org's BSD-like license (see the file 8 | * COPYING.Xiph in this distribution). All other programs, libraries, and 9 | * plugins are distributed under the GPL (see COPYING.GPL). The documentation 10 | * is distributed under the Gnu FDL (see COPYING.FDL). Each file in the 11 | * FLAC distribution contains at the top the terms under which it may be 12 | * distributed. 13 | * 14 | * Since this particular file is relevant to all components of FLAC, 15 | * it may be distributed under the Xiph.Org license, which is the least 16 | * restrictive of those mentioned above. See the file COPYING.Xiph in this 17 | * distribution. 18 | */ 19 | 20 | 21 | FLAC (http://flac.sourceforge.net/) is an Open Source lossless audio 22 | codec developed by Josh Coalson . 23 | 24 | Other major contributors and their contributions: 25 | "Andrey Astafiev" 26 | * Russian translation of the HTML documentation 27 | 28 | "Miroslav Lichvar" 29 | * IA-32 assembly versions of several libFLAC routines 30 | 31 | "Brady Patterson" 32 | * AIFF file support, PPC assembly versions of libFLAC routines 33 | 34 | "Daisuke Shimamura" 35 | * i18n support in the XMMS plugin 36 | 37 | "X-Fixer" 38 | * Configuration system, tag editing, and file info in the Winamp2 plugin 39 | 40 | "Matt Zimmerman" 41 | * Libtool/autoconf/automake make system, flac man page 42 | 43 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/COPYING.Xiph: -------------------------------------------------------------------------------- 1 | Copyright (C) 2000-2009 Josh Coalson 2 | Copyright (C) 2011-2013 Xiph.Org Foundation 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 8 | - Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | - Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | - Neither the name of the Xiph.org Foundation nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/FLAC/assert.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__ASSERT_H 34 | #define FLAC__ASSERT_H 35 | 36 | /* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ 37 | #ifdef DEBUG 38 | #include 39 | #define FLAC__ASSERT(x) assert(x) 40 | #define FLAC__ASSERT_DECLARATION(x) x 41 | #else 42 | #define FLAC__ASSERT(x) 43 | #define FLAC__ASSERT_DECLARATION(x) 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/FLAC/config.h: -------------------------------------------------------------------------------- 1 | #define VERSION "1.3.0" 2 | #define PACKAGE "flac" 3 | #define PACKAGE_BUGREPORT "flac-dev@xiph.org" 4 | #define PACKAGE_NAME "flac" 5 | #define PACKAGE_STRING "flac 1.3.0" 6 | #define PACKAGE_TARNAME "flac" 7 | #define PACKAGE_URL "https://www.xiph.org/flac/" 8 | #define PACKAGE_VERSION "1.3.0" 9 | 10 | // OS defines -------------------------- 11 | // 32bit/64bit dependent defines - should be 8 for 64bit and 4 for 32bit systems 12 | #define SIZEOF_OFF_T 8 13 | #define SIZEOF_VOIDP 8 14 | 15 | #define WORDS_BIGENDIAN 0 16 | #define CPU_IS_BIG_ENDIAN 0 17 | #define CPU_IS_LITTLE_ENDIAN 1 18 | //-------------------------------------- 19 | 20 | #define STDC_HEADERS 1 21 | 22 | #ifndef _GNU_SOURCE 23 | # define _GNU_SOURCE 1 24 | #endif 25 | 26 | #define FLAC__HAS_OGG 1 27 | #define FLAC__SSE_OS 1 28 | #define FLAC__USE_3DNOW 1 29 | #define FLAC__USE_ALTIVEC 1 30 | #define GWINSZ_IN_SYS_IOCTL 1 31 | #define HAVE_BSWAP32 1 32 | #define HAVE_BYTESWAP_H 1 33 | #define HAVE_CXX_VARARRAYS 1 34 | #define HAVE_C_VARARRAYS 1 35 | #define HAVE_DLFCN_H 1 36 | #define HAVE_FSEEKO 1 37 | #define HAVE_GETOPT_LONG 1 38 | #define HAVE_ICONV 1 39 | #define HAVE_INTTYPES_H 1 40 | #define HAVE_LANGINFO_CODESET 1 41 | #define HAVE_LROUND 1 42 | #define HAVE_MEMORY_H 1 43 | #define HAVE_SOCKLEN_T 1 44 | #define HAVE_STDINT_H 1 45 | #define HAVE_STDLIB_H 1 46 | #define HAVE_STRINGS_H 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_SYS_PARAM_H 1 49 | #define HAVE_SYS_STAT_H 1 50 | #define HAVE_SYS_TYPES_H 1 51 | #define HAVE_TERMIOS_H 1 52 | #define HAVE_TYPEOF 1 53 | #define HAVE_UNISTD_H 1 54 | #define ICONV_CONST 55 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/FLAC/ordinals.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__ORDINALS_H 34 | #define FLAC__ORDINALS_H 35 | 36 | #if defined(_MSC_VER) && _MSC_VER < 1600 37 | 38 | /* Microsoft Visual Studio earlier than the 2010 version did not provide 39 | * the 1999 ISO C Standard header file . 40 | */ 41 | 42 | typedef __int8 FLAC__int8; 43 | typedef unsigned __int8 FLAC__uint8; 44 | 45 | typedef __int16 FLAC__int16; 46 | typedef __int32 FLAC__int32; 47 | typedef __int64 FLAC__int64; 48 | typedef unsigned __int16 FLAC__uint16; 49 | typedef unsigned __int32 FLAC__uint32; 50 | typedef unsigned __int64 FLAC__uint64; 51 | 52 | #else 53 | 54 | /* For MSVC 2010 and everything else which provides . */ 55 | 56 | #include 57 | 58 | typedef int8_t FLAC__int8; 59 | typedef uint8_t FLAC__uint8; 60 | 61 | typedef int16_t FLAC__int16; 62 | typedef int32_t FLAC__int32; 63 | typedef int64_t FLAC__int64; 64 | typedef uint16_t FLAC__uint16; 65 | typedef uint32_t FLAC__uint32; 66 | typedef uint64_t FLAC__uint64; 67 | 68 | #endif 69 | 70 | typedef int FLAC__bool; 71 | 72 | typedef FLAC__uint8 FLAC__byte; 73 | 74 | 75 | #ifdef true 76 | #undef true 77 | #endif 78 | #ifdef false 79 | #undef false 80 | #endif 81 | #ifndef __cplusplus 82 | #define true 1 83 | #define false 0 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/share/endswap.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2012 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | /* It is assumed that this header will be included after "config.h". */ 33 | 34 | #if HAVE_BSWAP32 /* GCC and Clang */ 35 | 36 | #define ENDSWAP_32(x) (__builtin_bswap32 (x)) 37 | 38 | #elif defined _MSC_VER /* Windows. Apparently in . */ 39 | 40 | #define ENDSWAP_32(x) (_byteswap_ulong (x)) 41 | 42 | #elif defined HAVE_BYTESWAP_H /* Linux */ 43 | 44 | #include 45 | 46 | #define ENDSWAP_32(x) (bswap_32 (x)) 47 | 48 | #else 49 | 50 | #define ENDSWAP_32(x) ((((x) >> 24) & 0xFF) + (((x) >> 8) & 0xFF00) + (((x) & 0xFF00) << 8) + (((x) & 0xFF) << 24)) 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/share/macros.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #include 33 | 34 | /* FLAC_CHECK_RETURN : Check the return value of of the provided function and 35 | * print and error message if it fails (ie returns a value < 0). 36 | */ 37 | 38 | #define FLAC_CHECK_RETURN(x) \ 39 | { if ((x) < 0) \ 40 | printf ("%s : %s\n", #x, strerror (errno)) ; \ 41 | } 42 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/share/private.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef FLAC__SHARE__PRIVATE_H 33 | #define FLAC__SHARE__PRIVATE_H 34 | 35 | /* 36 | * Unpublished debug routines from libFLAC> This should not be used from any 37 | * client code other than code shipped with the FLAC sources. 38 | */ 39 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 40 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 41 | FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); 42 | FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value); 43 | FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder); 44 | 45 | #endif /* FLAC__SHARE__PRIVATE_H */ 46 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/share/safe_str.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | /* Safe string handling functions to replace things like strcpy, strncpy, 33 | * strcat, strncat etc. 34 | * All of these functions guarantee a correctly NUL terminated string but 35 | * the string may be truncated if the destination buffer was too short. 36 | */ 37 | 38 | #ifndef FLAC__SHARE_SAFE_STR_H 39 | #define FLAC__SHARE_SAFE_STR_H 40 | 41 | static inline char * 42 | safe_strncat(char *dest, const char *src, size_t dest_size) 43 | { 44 | char * ret; 45 | 46 | if (dest_size < 1) 47 | return dest; 48 | 49 | ret = strncat(dest, src, dest_size - strlen (dest)); 50 | dest [dest_size - 1] = 0; 51 | 52 | return ret; 53 | } 54 | 55 | static inline char * 56 | safe_strncpy(char *dest, const char *src, size_t dest_size) 57 | { 58 | char * ret; 59 | 60 | if (dest_size < 1) 61 | return dest; 62 | 63 | ret = strncpy(dest, src, dest_size); 64 | dest [dest_size - 1] = 0; 65 | 66 | return ret; 67 | } 68 | 69 | #endif /* FLAC__SHARE_SAFE_STR_H */ 70 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/include/share/win_utf8_io.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2013 Xiph.Org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifdef _WIN32 33 | 34 | #ifndef flac__win_utf8_io_h 35 | #define flac__win_utf8_io_h 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | int get_utf8_argv(int *argc, char ***argv); 47 | 48 | int printf_utf8(const char *format, ...); 49 | int fprintf_utf8(FILE *stream, const char *format, ...); 50 | int vfprintf_utf8(FILE *stream, const char *format, va_list argptr); 51 | 52 | FILE *fopen_utf8(const char *filename, const char *mode); 53 | int stat_utf8(const char *path, struct stat *buffer); 54 | int _stat64_utf8(const char *path, struct __stat64 *buffer); 55 | int chmod_utf8(const char *filename, int pmode); 56 | int utime_utf8(const char *filename, struct utimbuf *times); 57 | int unlink_utf8(const char *filename); 58 | int rename_utf8(const char *oldname, const char *newname); 59 | size_t strlen_utf8(const char *str); 60 | int win_get_console_width(void); 61 | int print_console(FILE *stream, const wchar_t *text, uint32_t len); 62 | HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile); 63 | 64 | #ifdef __cplusplus 65 | } /* extern "C" */ 66 | #endif 67 | 68 | #endif 69 | #endif 70 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/bitmath.c: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "FLAC/config.h" 34 | 35 | #include "private/bitmath.h" 36 | #include "FLAC/assert.h" 37 | 38 | /* An example of what FLAC__bitmath_silog2() computes: 39 | * 40 | * silog2(-10) = 5 41 | * silog2(- 9) = 5 42 | * silog2(- 8) = 4 43 | * silog2(- 7) = 4 44 | * silog2(- 6) = 4 45 | * silog2(- 5) = 4 46 | * silog2(- 4) = 3 47 | * silog2(- 3) = 3 48 | * silog2(- 2) = 2 49 | * silog2(- 1) = 2 50 | * silog2( 0) = 0 51 | * silog2( 1) = 2 52 | * silog2( 2) = 3 53 | * silog2( 3) = 3 54 | * silog2( 4) = 4 55 | * silog2( 5) = 4 56 | * silog2( 6) = 4 57 | * silog2( 7) = 4 58 | * silog2( 8) = 5 59 | * silog2( 9) = 5 60 | * silog2( 10) = 5 61 | */ 62 | unsigned FLAC__bitmath_silog2(int v) 63 | { 64 | while(1) { 65 | if(v == 0) { 66 | return 0; 67 | } 68 | else if(v > 0) { 69 | unsigned l = 0; 70 | while(v) { 71 | l++; 72 | v >>= 1; 73 | } 74 | return l+1; 75 | } 76 | else if(v == -1) { 77 | return 2; 78 | } 79 | else { 80 | v++; 81 | v = -v; 82 | } 83 | } 84 | } 85 | 86 | unsigned FLAC__bitmath_silog2_wide(FLAC__int64 v) 87 | { 88 | while(1) { 89 | if(v == 0) { 90 | return 0; 91 | } 92 | else if(v > 0) { 93 | unsigned l = 0; 94 | while(v) { 95 | l++; 96 | v >>= 1; 97 | } 98 | return l+1; 99 | } 100 | else if(v == -1) { 101 | return 2; 102 | } 103 | else { 104 | v++; 105 | v = -v; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/flac.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: FLAC 7 | Description: Free Lossless Audio Codec Library 8 | Version: @VERSION@ 9 | Requires.private: @OGG_PACKAGE@ 10 | Libs: -L${libdir} -lFLAC 11 | Libs.private: -lm 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/all.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__ALL_H 34 | #define FLAC__PRIVATE__ALL_H 35 | 36 | #include "bitmath.h" 37 | #include "bitreader.h" 38 | #include "bitwriter.h" 39 | #include "cpu.h" 40 | #include "crc.h" 41 | #include "fixed.h" 42 | #include "float.h" 43 | #include "format.h" 44 | #include "lpc.h" 45 | #include "md5.h" 46 | #include "memory.h" 47 | #include "metadata.h" 48 | #include "stream_encoder_framing.h" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/cpu.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__CPU_H 34 | #define FLAC__PRIVATE__CPU_H 35 | 36 | #include "FLAC/ordinals.h" 37 | #include "FLAC/config.h" 38 | 39 | typedef enum { 40 | FLAC__CPUINFO_TYPE_IA32, 41 | FLAC__CPUINFO_TYPE_PPC, 42 | FLAC__CPUINFO_TYPE_UNKNOWN 43 | } FLAC__CPUInfo_Type; 44 | 45 | typedef struct { 46 | FLAC__bool cpuid; 47 | FLAC__bool bswap; 48 | FLAC__bool cmov; 49 | FLAC__bool mmx; 50 | FLAC__bool fxsr; 51 | FLAC__bool sse; 52 | FLAC__bool sse2; 53 | FLAC__bool sse3; 54 | FLAC__bool ssse3; 55 | FLAC__bool _3dnow; 56 | FLAC__bool ext3dnow; 57 | FLAC__bool extmmx; 58 | } FLAC__CPUInfo_IA32; 59 | 60 | typedef struct { 61 | FLAC__bool altivec; 62 | FLAC__bool ppc64; 63 | } FLAC__CPUInfo_PPC; 64 | 65 | typedef struct { 66 | FLAC__bool use_asm; 67 | FLAC__CPUInfo_Type type; 68 | union { 69 | FLAC__CPUInfo_IA32 ia32; 70 | FLAC__CPUInfo_PPC ppc; 71 | } data; 72 | } FLAC__CPUInfo; 73 | 74 | void FLAC__cpu_info(FLAC__CPUInfo *info); 75 | 76 | #ifndef FLAC__NO_ASM 77 | #ifdef FLAC__CPU_IA32 78 | #ifdef FLAC__HAS_NASM 79 | FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32(void); 80 | void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx); 81 | FLAC__uint32 FLAC__cpu_info_extended_amd_asm_ia32(void); 82 | #endif 83 | #endif 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/crc.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__CRC_H 34 | #define FLAC__PRIVATE__CRC_H 35 | 36 | #include "FLAC/ordinals.h" 37 | 38 | /* 8 bit CRC generator, MSB shifted first 39 | ** polynomial = x^8 + x^2 + x^1 + x^0 40 | ** init = 0 41 | */ 42 | extern FLAC__byte const FLAC__crc8_table[256]; 43 | #define FLAC__CRC8_UPDATE(data, crc) (crc) = FLAC__crc8_table[(crc) ^ (data)]; 44 | void FLAC__crc8_update(const FLAC__byte data, FLAC__uint8 *crc); 45 | void FLAC__crc8_update_block(const FLAC__byte *data, unsigned len, FLAC__uint8 *crc); 46 | FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len); 47 | 48 | /* 16 bit CRC generator, MSB shifted first 49 | ** polynomial = x^16 + x^15 + x^2 + x^0 50 | ** init = 0 51 | */ 52 | extern unsigned const FLAC__crc16_table[256]; 53 | 54 | #define FLAC__CRC16_UPDATE(data, crc) (((((crc)<<8) & 0xffff) ^ FLAC__crc16_table[((crc)>>8) ^ (data)])) 55 | /* this alternate may be faster on some systems/compilers */ 56 | #if 0 57 | #define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) ^ FLAC__crc16_table[((crc)>>8) ^ (data)]) & 0xffff) 58 | #endif 59 | 60 | unsigned FLAC__crc16(const FLAC__byte *data, unsigned len); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/format.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__FORMAT_H 34 | #define FLAC__PRIVATE__FORMAT_H 35 | 36 | #include "FLAC/format.h" 37 | 38 | unsigned FLAC__format_get_max_rice_partition_order(unsigned blocksize, unsigned predictor_order); 39 | unsigned FLAC__format_get_max_rice_partition_order_from_blocksize(unsigned blocksize); 40 | unsigned FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(unsigned limit, unsigned blocksize, unsigned predictor_order); 41 | void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); 42 | void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); 43 | FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, unsigned max_partition_order); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/macros.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2012 Xiph.org Foundation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * - Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * - Neither the name of the Xiph.org Foundation nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef FLAC__PRIVATE__MACROS_H 33 | #define FLAC__PRIVATE__MACROS_H 34 | 35 | #if defined(__GNUC__) && (__GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 36 | 37 | #define flac_max(a,b) \ 38 | ({ __typeof__ (a) _a = (a); \ 39 | __typeof__ (b) _b = (b); \ 40 | _a > _b ? _a : _b; }) 41 | 42 | #define MIN_PASTE(A,B) A##B 43 | #define MIN_IMPL(A,B,L) ({ \ 44 | __typeof__(A) MIN_PASTE(__a,L) = (A); \ 45 | __typeof__(B) MIN_PASTE(__b,L) = (B); \ 46 | MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); \ 47 | }) 48 | 49 | #define flac_min(A,B) MIN_IMPL(A,B,__COUNTER__) 50 | 51 | /* Whatever other unix that has sys/param.h */ 52 | #elif defined(HAVE_SYS_PARAM_H) 53 | #include 54 | #define flac_max(a,b) MAX(a,b) 55 | #define flac_min(a,b) MIN(a,b) 56 | 57 | /* Windows VS has them in stdlib.h.. XXX:Untested */ 58 | #elif defined(_MSC_VER) 59 | #include 60 | #define flac_max(a,b) __max(a,b) 61 | #define flac_min(a,b) __min(a,b) 62 | #endif 63 | 64 | #ifndef MIN 65 | #define MIN(x,y) ((x) <= (y) ? (x) : (y)) 66 | #endif 67 | 68 | #ifndef MAX 69 | #define MAX(x,y) ((x) >= (y) ? (x) : (y)) 70 | #endif 71 | 72 | #if !defined(__cplusplus) && defined(_MSC_VER) 73 | #ifndef inline 74 | #define inline __inline 75 | #endif 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef FLAC__PRIVATE__MD5_H 2 | #define FLAC__PRIVATE__MD5_H 3 | 4 | /* 5 | * This is the header file for the MD5 message-digest algorithm. 6 | * The algorithm is due to Ron Rivest. This code was 7 | * written by Colin Plumb in 1993, no copyright is claimed. 8 | * This code is in the public domain; do with it what you wish. 9 | * 10 | * Equivalent code is available from RSA Data Security, Inc. 11 | * This code has been tested against that, and is equivalent, 12 | * except that you don't need to include two pages of legalese 13 | * with every copy. 14 | * 15 | * To compute the message digest of a chunk of bytes, declare an 16 | * MD5Context structure, pass it to MD5Init, call MD5Update as 17 | * needed on buffers full of bytes, and then call MD5Final, which 18 | * will fill a supplied 16-byte array with the digest. 19 | * 20 | * Changed so as no longer to depend on Colin Plumb's `usual.h' 21 | * header definitions; now uses stuff from dpkg's config.h 22 | * - Ian Jackson . 23 | * Still in the public domain. 24 | * 25 | * Josh Coalson: made some changes to integrate with libFLAC. 26 | * Still in the public domain, with no warranty. 27 | */ 28 | 29 | #include "FLAC/ordinals.h" 30 | 31 | typedef struct { 32 | FLAC__uint32 in[16]; 33 | FLAC__uint32 buf[4]; 34 | FLAC__uint32 bytes[2]; 35 | FLAC__byte *internal_buf; 36 | size_t capacity; 37 | } FLAC__MD5Context; 38 | 39 | void FLAC__MD5Init(FLAC__MD5Context *context); 40 | void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context); 41 | 42 | FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/memory.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__MEMORY_H 34 | #define FLAC__PRIVATE__MEMORY_H 35 | 36 | #include "FLAC/config.h" 37 | 38 | #include /* for size_t */ 39 | 40 | #include "private/float.h" 41 | #include "FLAC/ordinals.h" /* for FLAC__bool */ 42 | 43 | /* Returns the unaligned address returned by malloc. 44 | * Use free() on this address to deallocate. 45 | */ 46 | void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address); 47 | FLAC__bool FLAC__memory_alloc_aligned_int32_array(size_t elements, FLAC__int32 **unaligned_pointer, FLAC__int32 **aligned_pointer); 48 | FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32 **unaligned_pointer, FLAC__uint32 **aligned_pointer); 49 | FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer); 50 | FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, unsigned **unaligned_pointer, unsigned **aligned_pointer); 51 | #ifndef FLAC__INTEGER_ONLY_LIBRARY 52 | FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer); 53 | #endif 54 | void *safe_malloc_mul_2op_p(size_t size1, size_t size2); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/metadata.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2002-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__METADATA_H 34 | #define FLAC__PRIVATE__METADATA_H 35 | 36 | #include "FLAC/metadata.h" 37 | 38 | /* WATCHOUT: all malloc()ed data in the block is free()ed; this may not 39 | * be a consistent state (e.g. PICTURE) or equivalent to the initial 40 | * state after FLAC__metadata_object_new() 41 | */ 42 | void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object); 43 | 44 | void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/ogg_encoder_aspect.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2002-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__OGG_ENCODER_ASPECT_H 34 | #define FLAC__PRIVATE__OGG_ENCODER_ASPECT_H 35 | 36 | #include 37 | 38 | #include "FLAC/ordinals.h" 39 | #include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoderWriteStatus */ 40 | 41 | typedef struct FLAC__OggEncoderAspect { 42 | /* these are storage for values that can be set through the API */ 43 | long serial_number; 44 | unsigned num_metadata; 45 | 46 | /* these are for internal state related to Ogg encoding */ 47 | ogg_stream_state stream_state; 48 | ogg_page page; 49 | FLAC__bool seen_magic; /* true if we've seen the fLaC magic in the write callback yet */ 50 | FLAC__bool is_first_packet; 51 | FLAC__uint64 samples_written; 52 | } FLAC__OggEncoderAspect; 53 | 54 | void FLAC__ogg_encoder_aspect_set_serial_number(FLAC__OggEncoderAspect *aspect, long value); 55 | FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, unsigned value); 56 | void FLAC__ogg_encoder_aspect_set_defaults(FLAC__OggEncoderAspect *aspect); 57 | FLAC__bool FLAC__ogg_encoder_aspect_init(FLAC__OggEncoderAspect *aspect); 58 | void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect); 59 | 60 | typedef FLAC__StreamEncoderWriteStatus (*FLAC__OggEncoderAspectWriteCallbackProxy)(const void *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); 61 | 62 | FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data); 63 | #endif 64 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/ogg_helper.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__OGG_HELPER_H 34 | #define FLAC__PRIVATE__OGG_HELPER_H 35 | 36 | #include 37 | #include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoder */ 38 | 39 | void simple_ogg_page__init(ogg_page *page); 40 | void simple_ogg_page__clear(ogg_page *page); 41 | FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data); 42 | FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/ogg_mapping.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__OGG_MAPPING_H 34 | #define FLAC__PRIVATE__OGG_MAPPING_H 35 | 36 | #include "FLAC/ordinals.h" 37 | 38 | /** The length of the packet type field in bytes. */ 39 | #define FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH (1u) 40 | 41 | extern const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN; /* = 8 bits */ 42 | 43 | extern const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; /* = 0x7f */ 44 | 45 | /** The length of the 'FLAC' magic in bytes. */ 46 | #define FLAC__OGG_MAPPING_MAGIC_LENGTH (4u) 47 | 48 | extern const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC; /* = "FLAC" */ 49 | 50 | extern const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN; /* = 8 bits */ 51 | extern const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN; /* = 8 bits */ 52 | 53 | /** The length of the Ogg FLAC mapping major version number in bytes. */ 54 | #define FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH (1u) 55 | 56 | /** The length of the Ogg FLAC mapping minor version number in bytes. */ 57 | #define FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH (1u) 58 | 59 | extern const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN; /* = 16 bits */ 60 | 61 | /** The length of the #-of-header-packets number bytes. */ 62 | #define FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH (2u) 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/stream_encoder_framing.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H 34 | #define FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H 35 | 36 | #include "FLAC/format.h" 37 | #include "bitwriter.h" 38 | 39 | FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw); 40 | FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw); 41 | FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 42 | FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 43 | FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 44 | FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe, unsigned samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/private/window.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2006-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PRIVATE__WINDOW_H 34 | #define FLAC__PRIVATE__WINDOW_H 35 | 36 | #include "FLAC/config.h" 37 | 38 | #include "private/float.h" 39 | #include "FLAC/format.h" 40 | 41 | #ifndef FLAC__INTEGER_ONLY_LIBRARY 42 | 43 | /* 44 | * FLAC__window_*() 45 | * -------------------------------------------------------------------- 46 | * Calculates window coefficients according to different apodization 47 | * functions. 48 | * 49 | * OUT window[0,L-1] 50 | * IN L (number of points in window) 51 | */ 52 | void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L); 53 | void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L); 54 | void FLAC__window_blackman(FLAC__real *window, const FLAC__int32 L); 55 | void FLAC__window_blackman_harris_4term_92db_sidelobe(FLAC__real *window, const FLAC__int32 L); 56 | void FLAC__window_connes(FLAC__real *window, const FLAC__int32 L); 57 | void FLAC__window_flattop(FLAC__real *window, const FLAC__int32 L); 58 | void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__real stddev); /* 0.0 < stddev <= 0.5 */ 59 | void FLAC__window_hamming(FLAC__real *window, const FLAC__int32 L); 60 | void FLAC__window_hann(FLAC__real *window, const FLAC__int32 L); 61 | void FLAC__window_kaiser_bessel(FLAC__real *window, const FLAC__int32 L); 62 | void FLAC__window_nuttall(FLAC__real *window, const FLAC__int32 L); 63 | void FLAC__window_rectangle(FLAC__real *window, const FLAC__int32 L); 64 | void FLAC__window_triangle(FLAC__real *window, const FLAC__int32 L); 65 | void FLAC__window_tukey(FLAC__real *window, const FLAC__int32 L, const FLAC__real p); 66 | void FLAC__window_welch(FLAC__real *window, const FLAC__int32 L); 67 | 68 | #endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/protected/all.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2001-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PROTECTED__ALL_H 34 | #define FLAC__PROTECTED__ALL_H 35 | 36 | #include "stream_decoder.h" 37 | #include "stream_encoder.h" 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/include/protected/stream_decoder.h: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec library 2 | * Copyright (C) 2000-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef FLAC__PROTECTED__STREAM_DECODER_H 34 | #define FLAC__PROTECTED__STREAM_DECODER_H 35 | 36 | #include "FLAC/stream_decoder.h" 37 | #if FLAC__HAS_OGG 38 | #include "private/ogg_decoder_aspect.h" 39 | #endif 40 | 41 | typedef struct FLAC__StreamDecoderProtected { 42 | FLAC__StreamDecoderState state; 43 | unsigned channels; 44 | FLAC__ChannelAssignment channel_assignment; 45 | unsigned bits_per_sample; 46 | unsigned sample_rate; /* in Hz */ 47 | unsigned blocksize; /* in samples (per channel) */ 48 | FLAC__bool md5_checking; /* if true, generate MD5 signature of decoded data and compare against signature in the STREAMINFO metadata block */ 49 | #if FLAC__HAS_OGG 50 | FLAC__OggDecoderAspect ogg_decoder_aspect; 51 | #endif 52 | } FLAC__StreamDecoderProtected; 53 | 54 | /* 55 | * return the number of input bytes consumed 56 | */ 57 | unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /tools/flac-1.3.0/src/libFLAC/ogg_mapping.c: -------------------------------------------------------------------------------- 1 | /* libFLAC - Free Lossless Audio Codec 2 | * Copyright (C) 2004-2009 Josh Coalson 3 | * Copyright (C) 2011-2013 Xiph.Org Foundation 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * - Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * - Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * - Neither the name of the Xiph.org Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "FLAC/config.h" 34 | 35 | #include "private/ogg_mapping.h" 36 | 37 | const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN = 8; /* bits */ 38 | 39 | const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE = 0x7f; 40 | 41 | const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC = (const FLAC__byte * const)"FLAC"; 42 | 43 | const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN = 8; /* bits */ 44 | const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN = 8; /* bits */ 45 | 46 | const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN = 16; /* bits */ 47 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/AUTHORS: -------------------------------------------------------------------------------- 1 | Monty 2 | Greg Maxwell 3 | Ralph Giles 4 | Cristian Adam 5 | Tim Terriberry 6 | 7 | and the rest of the Xiph.Org Foundation. 8 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/CHANGES: -------------------------------------------------------------------------------- 1 | Version 1.3.1 (2013 May 12) 2 | 3 | * Guard against very large packets. 4 | * Respect the configure --docdir override. 5 | * Documentation fixes. 6 | * More Windows build fixes. 7 | 8 | Version 1.3.0 (2011 August 4) 9 | 10 | * Add ogg_stream_flush_fill() call 11 | This produces longer packets on flush, similar to 12 | what ogg_stream_pageout_fill() does for single pages. 13 | * Windows build fixes 14 | 15 | Version 1.2.2 (2010 December 07) 16 | 17 | * Build fix (types correction) for Mac OS X 18 | * Update win32 project files to Visual Studio 2008 19 | * ogg_stream_pageout_fill documentation fix 20 | 21 | Version 1.2.1 (2010 November 01) 22 | 23 | * Various build updates (see SVN) 24 | * Add ogg_stream_pageout_fill() to API to allow applications 25 | greater explicit flexibility in page sizing. 26 | * Documentation updates including multiplexing description, 27 | terminology and API (incl. ogg_packet_clear(), 28 | ogg_stream_pageout_fill()) 29 | * Correct possible buffer overwrite in stream encoding on 32 bit 30 | when a single packet exceed 250MB. 31 | * Correct read-buffer overrun [without side effects] under 32 | similar circumstances. 33 | * Update unit testing to work properly with new page spill 34 | heuristic. 35 | 36 | Version 1.2.0 (2010 March 25) 37 | 38 | * Alter default flushing behavior to span less often and use larger page 39 | sizes when packet sizes are large. 40 | * Build fixes for additional compilers 41 | * Documentation updates 42 | 43 | Version 1.1.4 (2009 June 24) 44 | 45 | * New async error reporting mechanism. Calls made after a fatal error are 46 | now safely handled in the event an error code is ignored 47 | * Added allocation checks useful to some embedded applications 48 | * fix possible read past end of buffer when reading 0 bits 49 | * Updates to API documentation 50 | * Build fixes 51 | 52 | Version 1.1.3 (2005 November 27) 53 | 54 | * Correct a bug in the granulepos field of pages where no packet ends 55 | * New VS2003 and XCode builds, minor fixes to other builds 56 | * documentation fixes and cleanup 57 | 58 | Version 1.1.2 (2004 September 23) 59 | 60 | * fix a bug with multipage packet assembly after seek 61 | 62 | Version 1.1.1 (2004 September 12) 63 | 64 | * various bugfixes 65 | * important bugfix for 64-bit platforms 66 | * various portability fixes 67 | * autotools cleanup from Thomas Vander Stichele 68 | * Symbian OS build support from Colin Ward at CSIRO 69 | * new multiplexed Ogg stream documentation 70 | 71 | Version 1.1 (2003 November 17) 72 | 73 | * big-endian bitpacker routines for Theora 74 | * various portability fixes 75 | * improved API documenation 76 | * RFC 3533 documentation of the format by Silvia Pfeiffer at CSIRO 77 | * RFC 3534 documentation of the application/ogg mime-type by Linus Walleij 78 | 79 | Version 1.0 (2002 July 19) 80 | 81 | * First stable release 82 | * little-endian bitpacker routines for Vorbis 83 | * basic Ogg bitstream sync and coding support 84 | 85 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002, Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/README: -------------------------------------------------------------------------------- 1 | ******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2011 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | = WHAT'S HERE = 14 | 15 | This source distribution includes libogg and nothing else. Other modules 16 | (eg, the modules libvorbis, vorbis-tools for the Vorbis music codec, 17 | libtheora for the Theora video codec) contain the codec libraries for 18 | use with Ogg bitstreams. 19 | 20 | Directory: 21 | 22 | ./src The source for libogg, a BSD-license inplementation of 23 | the public domain Ogg bitstream format 24 | 25 | ./include Library API headers 26 | 27 | ./doc Ogg specification and libogg API documents 28 | 29 | ./win32 Win32 projects and build automation 30 | 31 | ./macosx Mac OS X project and build files 32 | 33 | = WHAT IS OGG? = 34 | 35 | Ogg project codecs use the Ogg bitstream format to arrange the raw, 36 | compressed bitstream into a more robust, useful form. For example, 37 | the Ogg bitstream makes seeking, time stamping and error recovery 38 | possible, as well as mixing several sepearate, concurrent media 39 | streams into a single physical bitstream. 40 | 41 | = CONTACT = 42 | 43 | The Ogg homepage is located at 'https://www.xiph.org/ogg/'. 44 | Up to date technical documents, contact information, source code and 45 | pre-built utilities may be found there. 46 | 47 | BUILDING FROM TARBALL DISTRIBUTIONS: 48 | 49 | ./configure 50 | make 51 | 52 | and optionally (as root): 53 | make install 54 | 55 | This will install the Ogg libraries (static and shared) into 56 | /usr/local/lib, includes into /usr/local/include and API 57 | documentation into /usr/local/share/doc. 58 | 59 | BUILDING FROM REPOSITORY SOURCE: 60 | 61 | A standard svn build should consist of nothing more than: 62 | 63 | ./autogen.sh 64 | make 65 | 66 | and as root if desired : 67 | 68 | make install 69 | 70 | BUILDING ON WIN32: 71 | 72 | Use the project file in the win32 directory. It should compile out of the box. 73 | 74 | CROSS COMPILING FROM LINUX TO WIN32: 75 | 76 | It is also possible to cross compile from Linux to windows using the MinGW 77 | cross tools and even to run the test suite under Wine, the Linux/*nix 78 | windows emulator. 79 | 80 | On Debian and Ubuntu systems, these cross compiler tools can be installed 81 | by doing: 82 | 83 | sudo apt-get mingw32 mingw32-binutils mingw32-runtime wine 84 | 85 | Once these tools are installed its possible to compile and test by 86 | executing the following commands, or something similar depending on 87 | your system: 88 | 89 | ./configure --host=i586-mingw32msvc --target=i586-mingw32msvc \ 90 | --build=i586-linux 91 | make 92 | make check 93 | 94 | (Build instructions for Ogg codecs such as vorbis are similar and may 95 | be found in those source modules' README files) 96 | 97 | $Id: README 18096 2011-09-22 23:32:51Z giles $ 98 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/include/config.h~: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_DLFCN_H 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_INTTYPES_H 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_MEMORY_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_STDINT_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_STDLIB_H 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_STRINGS_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STRING_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_SYS_STAT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_SYS_TYPES_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_UNISTD_H 1 33 | 34 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 35 | */ 36 | #define LT_OBJDIR ".libs/" 37 | 38 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 39 | /* #undef NO_MINUS_C_MINUS_O */ 40 | 41 | /* Name of package */ 42 | #define PACKAGE "libogg" 43 | 44 | /* Define to the address where bug reports for this package should be sent. */ 45 | #define PACKAGE_BUGREPORT "ogg-dev@xiph.org" 46 | 47 | /* Define to the full name of this package. */ 48 | #define PACKAGE_NAME "libogg" 49 | 50 | /* Define to the full name and version of this package. */ 51 | #define PACKAGE_STRING "libogg 1.3.1" 52 | 53 | /* Define to the one symbol short name of this package. */ 54 | #define PACKAGE_TARNAME "libogg" 55 | 56 | /* Define to the home page for this package. */ 57 | #define PACKAGE_URL "" 58 | 59 | /* Define to the version of this package. */ 60 | #define PACKAGE_VERSION "1.3.1" 61 | 62 | /* The size of `int', as computed by sizeof. */ 63 | #define SIZEOF_INT 4 64 | 65 | /* The size of `int16_t', as computed by sizeof. */ 66 | #define SIZEOF_INT16_T 2 67 | 68 | /* The size of `int32_t', as computed by sizeof. */ 69 | #define SIZEOF_INT32_T 4 70 | 71 | /* The size of `int64_t', as computed by sizeof. */ 72 | #define SIZEOF_INT64_T 8 73 | 74 | /* The size of `long', as computed by sizeof. */ 75 | #define SIZEOF_LONG 8 76 | 77 | /* The size of `long long', as computed by sizeof. */ 78 | #define SIZEOF_LONG_LONG 8 79 | 80 | /* The size of `short', as computed by sizeof. */ 81 | #define SIZEOF_SHORT 2 82 | 83 | /* The size of `uint16_t', as computed by sizeof. */ 84 | #define SIZEOF_UINT16_T 2 85 | 86 | /* The size of `uint32_t', as computed by sizeof. */ 87 | #define SIZEOF_UINT32_T 4 88 | 89 | /* The size of `u_int16_t', as computed by sizeof. */ 90 | #define SIZEOF_U_INT16_T 2 91 | 92 | /* The size of `u_int32_t', as computed by sizeof. */ 93 | #define SIZEOF_U_INT32_T 4 94 | 95 | /* Define to 1 if you have the ANSI C header files. */ 96 | #define STDC_HEADERS 1 97 | 98 | /* Version number of package */ 99 | #define VERSION "1.3.1" 100 | 101 | /* Define to empty if `const' does not conform to ANSI C. */ 102 | /* #undef const */ 103 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/include/ogg/config.h: -------------------------------------------------------------------------------- 1 | #define VERSION "1.3.1" 2 | 3 | #define PACKAGE "libogg" 4 | #define PACKAGE_BUGREPORT "ogg-dev@xiph.org" 5 | #define PACKAGE_NAME "libogg" 6 | #define PACKAGE_STRING "libogg 1.3.1" 7 | #define PACKAGE_TARNAME "libogg" 8 | #define PACKAGE_URL "" 9 | #define PACKAGE_VERSION "1.3.1" 10 | 11 | #define HAVE_DLFCN_H 1 12 | #define HAVE_INTTYPES_H 1 13 | #define HAVE_MEMORY_H 1 14 | #define HAVE_STDINT_H 1 15 | #define HAVE_STDLIB_H 1 16 | #define HAVE_STRINGS_H 1 17 | #define HAVE_STRING_H 1 18 | #define HAVE_SYS_STAT_H 1 19 | #define HAVE_SYS_TYPES_H 1 20 | #define HAVE_UNISTD_H 1 21 | 22 | #define STDC_HEADERS 1 23 | 24 | #define SIZEOF_INT 4 25 | #define SIZEOF_INT16_T 2 26 | #define SIZEOF_INT32_T 4 27 | #define SIZEOF_INT64_T 8 28 | #define SIZEOF_LONG 8 29 | #define SIZEOF_LONG_LONG 8 30 | #define SIZEOF_SHORT 2 31 | #define SIZEOF_UINT16_T 2 32 | #define SIZEOF_UINT32_T 4 33 | #define SIZEOF_U_INT16_T 2 34 | #define SIZEOF_U_INT32_T 4 35 | 36 | -------------------------------------------------------------------------------- /tools/libogg-1.3.1/include/ogg/config_types.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | typedef int16_t ogg_int16_t; 6 | typedef uint16_t ogg_uint16_t; 7 | typedef int32_t ogg_int32_t; 8 | typedef uint32_t ogg_uint32_t; 9 | typedef int64_t ogg_int64_t; 10 | 11 | -------------------------------------------------------------------------------- /tools/utauloid/oto.cpp: -------------------------------------------------------------------------------- 1 | #include "utauloid/oto.h" 2 | #include 3 | #include 4 | 5 | /* 6 | pink part to be stretched 7 | blue part end and beginning 8 | 9 | offset (left blank) 10 | consonant (fixed part) lengh 11 | cutoff (right blank) 12 | 13 | pre utterance,overlap TODO 14 | red line -> previous option, sound start 15 | green line -> overlap (vowels,n's,m's) 16 | */ 17 | 18 | QOtoMap otoFromStrings(QStringList otoStrings) 19 | { 20 | QOtoMap result; 21 | 22 | QRegExp newlineRgxp ("[\r\n]+"); 23 | QRegExp delimitersRgxp("[=,]+"); 24 | 25 | foreach (QString s, otoStrings) 26 | { 27 | Oto o; 28 | 29 | s.remove (newlineRgxp); 30 | s.replace(delimitersRgxp, " "); 31 | 32 | QStringList splitted = s.split(' '); 33 | 34 | if (splitted.count() >= 8) 35 | { 36 | o.fileName = splitted.at(0); 37 | o.en = splitted.at(1); 38 | o.nonEn = splitted.at(2); 39 | o.offset = splitted.at(3).toFloat(); 40 | o.consonant = splitted.at(4).toFloat(); 41 | o.cutoff = splitted.at(5).toFloat(); 42 | o.pre_utterance = splitted.at(6).toFloat(); 43 | o.overlap = splitted.at(7).toFloat(); 44 | 45 | result[QString("%1_%2_%3").arg(o.fileName).arg(o.en).arg(o.nonEn)] = o; 46 | } 47 | else 48 | qDebug() << "Oto parsing: insufficient parsed element number, skipping" << s; 49 | } 50 | 51 | return result; 52 | } 53 | 54 | QStringList otoToStrings(QOtoMap /*om*/) 55 | { 56 | QStringList result; 57 | 58 | // TODO: 59 | 60 | return result; 61 | } 62 | 63 | QByteArray otoToBytes(QOtoMap /*om*/) 64 | { 65 | QByteArray result; 66 | 67 | // TODO: 68 | 69 | return result; 70 | } 71 | -------------------------------------------------------------------------------- /tools/utauloid/oto.h: -------------------------------------------------------------------------------- 1 | #ifndef OTO_H 2 | #define OTO_H 3 | 4 | #include 5 | #include 6 | 7 | // UTAU oto.ini phoneme description structure 8 | typedef struct 9 | { 10 | QString fileName; 11 | QString en; // latin phoneme name 12 | QString nonEn; // localized phoneme name, Japanese usually 13 | 14 | float offset; 15 | float consonant; 16 | float cutoff; 17 | float pre_utterance; 18 | float overlap; 19 | float samples; 20 | 21 | void *userdata; 22 | } Oto; 23 | 24 | typedef QMap QOtoMap; 25 | 26 | QOtoMap otoFromStrings(QStringList otoStrings); 27 | 28 | QStringList otoToStrings(QOtoMap om); 29 | QByteArray otoToBytes (QOtoMap om); 30 | 31 | 32 | #endif // OTO_H 33 | -------------------------------------------------------------------------------- /tools/utauloid/ust.h: -------------------------------------------------------------------------------- 1 | /* ust.h from QTau http://github.com/qtau-devgroup/editor by digited, BSD license */ 2 | 3 | #ifndef UST_H 4 | #define UST_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | typedef struct _ust_note 12 | { 13 | quint64 id; 14 | QString lyric; 15 | int pulseOffset; 16 | int pulseLength; 17 | int keyNumber; 18 | int velocity; 19 | 20 | QStringList userData; // unsupported info 21 | 22 | _ust_note() { clear(); } 23 | 24 | _ust_note(quint64 i, const QString &txt, int pOff, int pLen, int kNum) : 25 | id(i), lyric(txt), pulseOffset(pOff), pulseLength(pLen), keyNumber(kNum) {} 26 | 27 | _ust_note(const _ust_note &other) 28 | { 29 | id = other.id; 30 | lyric = other.lyric; 31 | pulseOffset = other.pulseOffset; 32 | pulseLength = other.pulseLength; 33 | keyNumber = other.keyNumber; 34 | velocity = other.velocity; 35 | userData = other.userData; 36 | } 37 | 38 | void clear() 39 | { 40 | id = 0; 41 | pulseOffset = 0; 42 | pulseLength = 0; 43 | keyNumber = 0; 44 | velocity = 0; 45 | 46 | lyric.clear(); 47 | userData.clear(); 48 | } 49 | } ust_note; 50 | 51 | 52 | typedef struct 53 | { 54 | int tempo; 55 | float gfactor; 56 | QVector notes; 57 | 58 | QStringList userData; 59 | 60 | void removeID(quint64 id) 61 | { 62 | for (int i = 0; i < notes.size(); ++i) 63 | if (notes.at(i).id == id) 64 | { 65 | notes.remove(i); 66 | break; 67 | } 68 | } 69 | 70 | void clear() 71 | { 72 | tempo = -1; 73 | gfactor = -1; 74 | notes.resize(0); 75 | userData.clear(); 76 | } 77 | } ust; 78 | 79 | 80 | ust ustFromStrings(const QStringList &sl); 81 | 82 | QStringList ustToStrings(const ust &u); 83 | QByteArray ustToBytes(const ust &u); 84 | 85 | #endif // UST_H 86 | --------------------------------------------------------------------------------