├── .gitignore ├── .travis.yml ├── 3rdparty ├── 3rdparty.pro ├── cld2 │ ├── README.md │ ├── cld2.pro │ ├── internal │ │ ├── cld2_generated_cjk_compatible.cc │ │ ├── cld2_generated_deltaoctachrome.cc │ │ ├── cld2_generated_distinctoctachrome.cc │ │ ├── cld2_generated_quadchrome_2.cc │ │ ├── cld2tablesummary.h │ │ ├── cld_generated_cjk_delta_bi_4.cc │ │ ├── cld_generated_cjk_uni_prop_80.cc │ │ ├── cld_generated_score_quad_octa_2.cc │ │ ├── cldutil.cc │ │ ├── cldutil.h │ │ ├── cldutil_shared.cc │ │ ├── cldutil_shared.h │ │ ├── compact_lang_det.cc │ │ ├── compact_lang_det_hint_code.cc │ │ ├── compact_lang_det_hint_code.h │ │ ├── compact_lang_det_impl.cc │ │ ├── compact_lang_det_impl.h │ │ ├── debug.cc │ │ ├── debug.h │ │ ├── fixunicodevalue.cc │ │ ├── fixunicodevalue.h │ │ ├── generated_distinct_bi_0.cc │ │ ├── generated_entities.cc │ │ ├── generated_language.cc │ │ ├── generated_language.h │ │ ├── generated_ulscript.cc │ │ ├── generated_ulscript.h │ │ ├── getonescriptspan.cc │ │ ├── getonescriptspan.h │ │ ├── integral_types.h │ │ ├── lang_script.cc │ │ ├── lang_script.h │ │ ├── langspan.h │ │ ├── offsetmap.cc │ │ ├── offsetmap.h │ │ ├── port.h │ │ ├── scoreonescriptspan.cc │ │ ├── scoreonescriptspan.h │ │ ├── stringpiece.h │ │ ├── tote.cc │ │ ├── tote.h │ │ ├── utf8acceptinterchange.h │ │ ├── utf8prop_lettermarkscriptnum.h │ │ ├── utf8repl_lettermarklower.h │ │ ├── utf8scannot_lettermarkspecial.h │ │ ├── utf8statetable.cc │ │ └── utf8statetable.h │ └── public │ │ ├── compact_lang_det.h │ │ └── encodings.h ├── libsonivox │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── doc │ │ ├── EASLibrary3_5.pdf │ │ ├── EAS_API_Reference.pdf │ │ └── EAS_Library_Integration_Guide.pdf │ ├── include │ │ ├── eas.h │ │ ├── eas_build.h │ │ ├── eas_chorus.h │ │ ├── eas_debugmsgs.h │ │ ├── eas_host.h │ │ ├── eas_report.h │ │ ├── eas_reverb.h │ │ └── eas_types.h │ ├── libsonivox.pro │ ├── src │ │ ├── dls.h │ │ ├── dls2.h │ │ ├── eas_audioconst.h │ │ ├── eas_chorus.c │ │ ├── eas_chorusdata.h │ │ ├── eas_config.c │ │ ├── eas_config.h │ │ ├── eas_ctype.h │ │ ├── eas_data.c │ │ ├── eas_data.h │ │ ├── eas_dlssynth.c │ │ ├── eas_dlssynth.h │ │ ├── eas_effects.h │ │ ├── eas_flog.c │ │ ├── eas_hostmm.c │ │ ├── eas_ima_tables.c │ │ ├── eas_imaadpcm.c │ │ ├── eas_imelody.c │ │ ├── eas_imelodydata.c │ │ ├── eas_imelodydata.h │ │ ├── eas_math.c │ │ ├── eas_math.h │ │ ├── eas_mdls.c │ │ ├── eas_mdls.h │ │ ├── eas_midi.c │ │ ├── eas_midi.h │ │ ├── eas_midictrl.h │ │ ├── eas_mididata.c │ │ ├── eas_miditypes.h │ │ ├── eas_mixbuf.c │ │ ├── eas_mixer.c │ │ ├── eas_mixer.h │ │ ├── eas_ota.c │ │ ├── eas_otadata.c │ │ ├── eas_otadata.h │ │ ├── eas_pan.c │ │ ├── eas_pan.h │ │ ├── eas_parser.h │ │ ├── eas_pcm.c │ │ ├── eas_pcm.h │ │ ├── eas_pcmdata.c │ │ ├── eas_pcmdata.h │ │ ├── eas_public.c │ │ ├── eas_report.c │ │ ├── eas_reverb.c │ │ ├── eas_reverbdata.h │ │ ├── eas_rtttl.c │ │ ├── eas_rtttldata.c │ │ ├── eas_rtttldata.h │ │ ├── eas_smf.c │ │ ├── eas_smf.h │ │ ├── eas_smfdata.c │ │ ├── eas_smfdata.h │ │ ├── eas_sndlib.h │ │ ├── eas_synth.h │ │ ├── eas_synth_protos.h │ │ ├── eas_synthcfg.h │ │ ├── eas_tcdata.c │ │ ├── eas_tcdata.h │ │ ├── eas_tonecontrol.c │ │ ├── eas_vm_protos.h │ │ ├── eas_voicemgt.c │ │ ├── eas_wavefile.c │ │ ├── eas_wavefile.h │ │ ├── eas_wavefiledata.c │ │ ├── eas_wt_IPC_frame.h │ │ ├── eas_wtengine.c │ │ ├── eas_wtengine.h │ │ ├── eas_wtsynth.c │ │ ├── eas_wtsynth.h │ │ ├── eas_xmf.c │ │ ├── eas_xmf.h │ │ ├── eas_xmfdata.c │ │ ├── eas_xmfdata.h │ │ ├── src.pro │ │ ├── wt_22khz.c │ │ └── wt_44khz.c │ └── testapp │ │ ├── Makefile │ │ ├── test_app.c │ │ └── testapp.pro ├── sqlite3 │ ├── sqlite3.c │ ├── sqlite3.h │ └── sqlite3.pro └── uchardet │ ├── AUTHORS │ ├── Big5Freq.tab │ ├── CMakeLists.txt │ ├── COPYING │ ├── CharDistribution.cpp │ ├── CharDistribution.h │ ├── EUCKRFreq.tab │ ├── EUCTWFreq.tab │ ├── GB2312Freq.tab │ ├── JISFreq.tab │ ├── JpCntx.cpp │ ├── JpCntx.h │ ├── LangModels │ ├── LangArabicModel.cpp │ ├── LangBulgarianModel.cpp │ ├── LangEsperantoModel.cpp │ ├── LangFrenchModel.cpp │ ├── LangGermanModel.cpp │ ├── LangGreekModel.cpp │ ├── LangHebrewModel.cpp │ ├── LangHungarianModel.cpp │ ├── LangRussianModel.cpp │ ├── LangSpanishModel.cpp │ ├── LangThaiModel.cpp │ └── LangTurkishModel.cpp │ ├── README.md │ ├── nsBig5Prober.cpp │ ├── nsBig5Prober.h │ ├── nsCharSetProber.cpp │ ├── nsCharSetProber.h │ ├── nsCodingStateMachine.h │ ├── nsEUCJPProber.cpp │ ├── nsEUCJPProber.h │ ├── nsEUCKRProber.cpp │ ├── nsEUCKRProber.h │ ├── nsEUCTWProber.cpp │ ├── nsEUCTWProber.h │ ├── nsEscCharsetProber.cpp │ ├── nsEscCharsetProber.h │ ├── nsEscSM.cpp │ ├── nsGB2312Prober.cpp │ ├── nsGB2312Prober.h │ ├── nsHebrewProber.cpp │ ├── nsHebrewProber.h │ ├── nsLatin1Prober.cpp │ ├── nsLatin1Prober.h │ ├── nsMBCSGroupProber.cpp │ ├── nsMBCSGroupProber.h │ ├── nsMBCSSM.cpp │ ├── nsPkgInt.h │ ├── nsSBCSGroupProber.cpp │ ├── nsSBCSGroupProber.h │ ├── nsSBCharSetProber.cpp │ ├── nsSBCharSetProber.h │ ├── nsSJISProber.cpp │ ├── nsSJISProber.h │ ├── nsUTF8Prober.cpp │ ├── nsUTF8Prober.h │ ├── nsUniversalDetector.cpp │ ├── nsUniversalDetector.h │ ├── nscore.h │ ├── prmem.h │ ├── symbols.cmake │ ├── uchardet.cpp │ ├── uchardet.h │ └── uchardet.pro ├── FAQ.md ├── LICENSE ├── README.md ├── build-rpm.sh ├── build_appimage.sh ├── create_collection_index.py ├── i18n ├── spivak_en_US.ts ├── spivak_nl_NL.ts └── spivak_sk.ts ├── json.api ├── libkaraokelyrics ├── libkaraokelyrics.pro ├── lyricsloader.cpp ├── lyricsloader.h ├── lyricsparser.cpp ├── lyricsparser.h ├── lyricsparser_kfn.cpp ├── lyricsparser_kfn.h ├── lyricsparser_kok.cpp ├── lyricsparser_kok.h ├── lyricsparser_lrc.cpp ├── lyricsparser_lrc.h ├── lyricsparser_lyric.cpp ├── lyricsparser_lyric.h ├── lyricsparser_midi.cpp ├── lyricsparser_midi.h ├── lyricsparser_powerkaraoke.h ├── lyricsparser_texts.cpp └── lyricsparser_texts.h ├── packaging ├── license.txt ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png ├── spivak.desktop ├── spivak.exe.manifest ├── spivak.png └── spivak.spec ├── spivak.pro └── src ├── actionhandler.cpp ├── actionhandler.h ├── actionhandler_lirc.cpp ├── actionhandler_lirc.h ├── actionhandler_webserver.cpp ├── actionhandler_webserver.h ├── actionhandler_webserver_socket.cpp ├── actionhandler_webserver_socket.h ├── aes.h ├── background.cpp ├── background.h ├── background ├── image1.jpeg ├── image2.jpeg ├── image3.jpeg ├── image4.jpeg └── image5.jpeg ├── backgroundcolor.cpp ├── backgroundcolor.h ├── backgroundimage.cpp ├── backgroundimage.h ├── backgroundvideo.cpp ├── backgroundvideo.h ├── cdg.h ├── collectionentry.cpp ├── collectionentry.h ├── collectionprovider.cpp ├── collectionprovider.h ├── collectionproviderfs.cpp ├── collectionproviderfs.h ├── collectionproviderhttp.cpp ├── collectionproviderhttp.h ├── colorbutton.cpp ├── colorbutton.h ├── config.h.in ├── crashhandler.cpp ├── currentstate.cpp ├── currentstate.h ├── database.cpp ├── database.h ├── database_songinfo.cpp ├── database_songinfo.h ├── database_statement.cpp ├── database_statement.h ├── dialog_about.ui ├── eventor.cpp ├── eventor.h ├── html ├── background.jpg ├── css │ ├── font-awesome.css │ ├── karaoke.css │ ├── login.css │ └── w3.css ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 ├── index.html ├── karaoke.js ├── login.html └── md5.js ├── images ├── application.ico ├── dryicons_forward.png ├── dryicons_pause.png ├── dryicons_play.png ├── dryicons_rewind.png ├── dryicons_stop.png ├── icon_open_file.png └── welcomewizard.jpg ├── karaokepainter.cpp ├── karaokepainter.h ├── karaokeplayable.cpp ├── karaokeplayable.h ├── karaokeplayable_file.cpp ├── karaokeplayable_file.h ├── karaokeplayable_kfn.cpp ├── karaokeplayable_kfn.h ├── karaokeplayable_zip.cpp ├── karaokeplayable_zip.h ├── karaokesong.cpp ├── karaokesong.h ├── karaokewidget.cpp ├── karaokewidget.h ├── labelshowhelp.cpp ├── labelshowhelp.h ├── languagedetector.cpp ├── languagedetector.h ├── logger.cpp ├── logger.h ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── mediaplayer.cpp ├── mediaplayer.h ├── mediaplayerinitializer.cpp ├── mediaplayerinitializer.h ├── messageboxautoclose.cpp ├── messageboxautoclose.h ├── midistripper.cpp ├── midistripper.h ├── midisyntheser.cpp ├── midisyntheser.h ├── multimediatestwidget.cpp ├── multimediatestwidget.h ├── multimediatestwidget.ui ├── musiccollectionmanager.cpp ├── musiccollectionmanager.h ├── notification.cpp ├── notification.h ├── playerbutton.cpp ├── playerbutton.h ├── playerlyrics.cpp ├── playerlyrics.h ├── playerlyricscdg.cpp ├── playerlyricscdg.h ├── playerlyricstext.cpp ├── playerlyricstext.h ├── playerlyrictext_line.cpp ├── playerlyrictext_line.h ├── playerrenderer.cpp ├── playerrenderer.h ├── playerwidget.cpp ├── playerwidget.h ├── playerwidget.ui ├── queuekaraokewidget.cpp ├── queuekaraokewidget.h ├── queuekaraokewidget.ui ├── queuekaraokewidget_addeditdialog.cpp ├── queuekaraokewidget_addeditdialog.h ├── queuekaraokewidget_addeditdialog.ui ├── queuemusicwidget.cpp ├── queuemusicwidget.h ├── queuemusicwidget.ui ├── queuetableviewmodels.cpp ├── queuetableviewmodels.h ├── registrationdialog.ui ├── resources.qrc ├── settings.cpp ├── settings.h ├── settingsdialog.cpp ├── settingsdialog.h ├── settingsdialog.ui ├── songdatabasescanner.cpp ├── songdatabasescanner.h ├── songqueue.cpp ├── songqueue.h ├── songqueueitem.cpp ├── songqueueitem.h ├── songqueueitemretriever.cpp ├── songqueueitemretriever.h ├── sounds ├── test.m4a ├── test.mid ├── test.mp3 ├── test.ogg ├── test.wav └── test.wma ├── src.pro ├── util.cpp ├── util.h ├── version.h ├── welcome_wizard.cpp ├── welcome_wizard.h └── welcome_wizard.ui /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | depth: 3 3 | 4 | matrix: 5 | include: 6 | - os: linux 7 | dist: trusty 8 | sudo: true 9 | compiler: gcc 10 | env: 11 | - QT_REPO="ppa:beineri/opt-qt562-trusty" 12 | - QT_VERSION="qt56" 13 | - os: linux 14 | dist: trusty 15 | sudo: true 16 | compiler: gcc 17 | env: 18 | - QT_REPO="ppa:beineri/opt-qt571-trusty" 19 | - QT_VERSION="qt57" 20 | - os: linux 21 | dist: trusty 22 | sudo: true 23 | compiler: gcc 24 | env: 25 | - QT_REPO="ppa:beineri/opt-qt58-trusty" 26 | - QT_VERSION="qt58" 27 | - os: linux 28 | dist: trusty 29 | sudo: true 30 | compiler: gcc 31 | env: 32 | - QT_REPO="ppa:beineri/opt-qt592-trusty" 33 | - QT_VERSION="qt59" 34 | 35 | before_install: 36 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then 37 | sudo add-apt-repository "$QT_REPO" -y; 38 | sudo apt-get update -qq; 39 | sudo apt-get install -qq ${QT_VERSION}base ${QT_VERSION}translations ${QT_VERSION}tools; 40 | sudo apt-get install -qq libsqlite3-dev libzip-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libuchardet-dev libgl1-mesa-dev; 41 | git clone https://github.com/datasift/libcld2; pushd libcld2 && make && sudo make install; popd; 42 | fi 43 | 44 | install: 45 | - find /opt -name "qt*-env.sh"; 46 | - source /opt/${QT_VERSION}/bin/${QT_VERSION}-env.sh; 47 | - export QTHOME=/opt/$QT_VERSION; 48 | 49 | script: 50 | - qmake -r 51 | - make 52 | -------------------------------------------------------------------------------- /3rdparty/3rdparty.pro: -------------------------------------------------------------------------------- 1 | SUBDIRS += cld2 libsonivox uchardet sqlite3 2 | TEMPLATE = subdirs 3 | -------------------------------------------------------------------------------- /3rdparty/cld2/cld2.pro: -------------------------------------------------------------------------------- 1 | TARGET = cld2 2 | CONFIG = warn_on staticlib 3 | TEMPLATE = lib 4 | SOURCES += internal/cldutil.cc \ 5 | internal/cldutil_shared.cc \ 6 | internal/compact_lang_det.cc \ 7 | internal/compact_lang_det_hint_code.cc \ 8 | internal/compact_lang_det_impl.cc \ 9 | internal/debug.cc \ 10 | internal/fixunicodevalue.cc \ 11 | internal/generated_entities.cc \ 12 | internal/generated_language.cc \ 13 | internal/generated_ulscript.cc \ 14 | internal/getonescriptspan.cc \ 15 | internal/lang_script.cc \ 16 | internal/offsetmap.cc \ 17 | internal/scoreonescriptspan.cc \ 18 | internal/tote.cc \ 19 | internal/utf8statetable.cc \ 20 | internal/cld_generated_cjk_uni_prop_80.cc \ 21 | internal/cld2_generated_cjk_compatible.cc \ 22 | internal/cld_generated_cjk_delta_bi_4.cc \ 23 | internal/generated_distinct_bi_0.cc \ 24 | internal/cld2_generated_quadchrome_2.cc \ 25 | internal/cld2_generated_deltaoctachrome.cc \ 26 | internal/cld2_generated_distinctoctachrome.cc \ 27 | internal/cld_generated_score_quad_octa_2.cc 28 | 29 | HEADERS += \ 30 | internal/cld2tablesummary.h \ 31 | internal/cldutil.h \ 32 | internal/cldutil_shared.h \ 33 | internal/compact_lang_det_impl.h \ 34 | internal/compact_lang_det_hint_code.h \ 35 | internal/debug.h \ 36 | internal/fixunicodevalue.h \ 37 | internal/generated_language.h \ 38 | internal/generated_ulscript.h \ 39 | internal/getonescriptspan.h \ 40 | internal/integral_types.h \ 41 | internal/lang_script.h \ 42 | internal/langspan.h \ 43 | internal/offsetmap.h \ 44 | internal/port.h \ 45 | internal/stringpiece.h \ 46 | internal/tote.h \ 47 | internal/utf8acceptinterchange.h \ 48 | internal/utf8repl_lettermarklower.h \ 49 | internal/utf8prop_lettermarkscriptnum.h \ 50 | internal/utf8scannot_lettermarkspecial.h \ 51 | internal/utf8statetable.h \ 52 | public/compact_lang_det.h \ 53 | public/encodings.h 54 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/cld2tablesummary.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // Author: dsites@google.com (Dick Sites) 17 | // 18 | 19 | 20 | #ifndef I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_ 21 | #define I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_ 22 | 23 | #include "integral_types.h" 24 | 25 | namespace CLD2 { 26 | 27 | // Hash bucket for four-way associative lookup, indirect probabilities 28 | // 16 bytes per bucket, 4-byte entries 29 | typedef struct { 30 | uint32 keyvalue[4]; // Upper part of word is hash, lower is indirect prob 31 | } IndirectProbBucket4; 32 | 33 | 34 | // Expanded version December 2012. 35 | // Moves cutoff for 6-language vs. 3-language indirects 36 | // Has list of recognized lang-script combinations 37 | typedef struct { 38 | const IndirectProbBucket4* kCLDTable; 39 | // Each bucket has four entries, part 40 | // key and part indirect subscript 41 | const uint32* kCLDTableInd; // Each entry is three packed lang/prob 42 | uint32 kCLDTableSizeOne; // Indirect subscripts >= this: 2 entries 43 | uint32 kCLDTableSize; // Bucket count 44 | uint32 kCLDTableKeyMask; // Mask hash key 45 | uint32 kCLDTableBuildDate; // yyyymmdd 46 | const char* kRecognizedLangScripts; // Character string of lang-Scripts 47 | // recognized: "en-Latn az-Arab ..." 48 | // Single space delimiter, Random order 49 | } CLD2TableSummary; 50 | 51 | } // End namespace CLD2 52 | 53 | #endif // I18N_ENCODINGS_CLD2_INTERNAL_CLD2TABLESUMMARY_H_ 54 | 55 | 56 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/debug.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // Author: dsites@google.com (Dick Sites) 17 | // 18 | // Produces debugging output for CLD2. See debug_empty.h for suppressing this. 19 | 20 | 21 | #ifndef I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ 22 | #define I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ 23 | 24 | #include 25 | #include "scoreonescriptspan.h" 26 | 27 | namespace CLD2 { 28 | 29 | // For showing one chunk 30 | void CLD2_Debug(const char* text, 31 | int lo_offset, 32 | int hi_offset, 33 | bool more_to_come, bool score_cjk, 34 | const ScoringHitBuffer* hitbuffer, 35 | const ScoringContext* scoringcontext, 36 | const ChunkSpan* cspan, 37 | const ChunkSummary* chunksummary); 38 | 39 | // For showing all chunks 40 | void CLD2_Debug2(const char* text, 41 | bool more_to_come, bool score_cjk, 42 | const ScoringHitBuffer* hitbuffer, 43 | const ScoringContext* scoringcontext, 44 | const SummaryBuffer* summarybuffer); 45 | 46 | std::string GetPlainEscapedText(const std::string& txt); 47 | std::string GetHtmlEscapedText(const std::string& txt); 48 | std::string GetColorHtmlEscapedText(Language lang, const std::string& txt); 49 | std::string GetLangColorHtmlEscapedText(Language lang, const std::string& txt); 50 | 51 | void DumpResultChunkVector(FILE* f, const char* src, 52 | ResultChunkVector* resultchunkvector); 53 | 54 | 55 | } // End namespace CLD2 56 | 57 | #endif // I18N_ENCODINGS_CLD2_INTERNAL_DEBUG_H_ 58 | 59 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/fixunicodevalue.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // Routine that maps a Unicode code point to an interchange-valid one 17 | // 18 | 19 | #include "fixunicodevalue.h" 20 | #include "integral_types.h" 21 | 22 | namespace CLD2 { 23 | 24 | // Guarantees that the resulting output value is interchange valid 25 | // 00-FF; map to spaces or MS CP1252 26 | // D800-DFFF; surrogates 27 | // FDD0-FDEF; non-characters 28 | // xxFFFE-xxFFFF; non-characters 29 | char32 FixUnicodeValue(char32 uv) { 30 | uint32 uuv = static_cast(uv); 31 | if (uuv < 0x0100) { 32 | return kMapFullMicrosoft1252OrSpace[uuv]; 33 | } 34 | if (uuv < 0xD800) { 35 | return uv; 36 | } 37 | if ((uuv & ~0x0F) == 0xFDD0) { // non-characters 38 | return 0xFFFD; 39 | } 40 | if ((uuv & ~0x0F) == 0xFDE0) { // non-characters 41 | return 0xFFFD; 42 | } 43 | if ((uuv & 0x00FFFE) == 0xFFFE) { // non-characters 44 | return 0xFFFD; 45 | } 46 | if ((0xE000 <= uuv) && (uuv <= 0x10FFFF)) { 47 | return uv; 48 | } 49 | // surrogates and negative and > 0x10FFFF all land here 50 | return 0xFFFD; 51 | } 52 | 53 | } // End namespace CLD2 54 | 55 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/generated_distinct_bi_0.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // Degenerate CLD2 scoring lookup table, for use as placeholder 17 | // 18 | #include "cld2tablesummary.h" 19 | 20 | namespace CLD2 { 21 | 22 | static const uint32 kDistinctBiTableBuildDate = 20130101; // yyyymmdd 23 | static const uint32 kDistinctBiTableSize = 1; // Total Bucket count 24 | static const uint32 kDistinctBiTableKeyMask = 0xffffffff; // Mask hash key 25 | static const char* const kDistinctBiTableRecognizedLangScripts = ""; 26 | 27 | // Empty table 28 | static const IndirectProbBucket4 kDistinctBiTable[kDistinctBiTableSize] = { 29 | // key[4], words[4] in UTF-8 30 | // value[4] 31 | { {0x00000000,0x00000000,0x00000000,0x00000000}}, // [000] 32 | }; 33 | 34 | static const uint32 kDistinctBiTableSizeOne = 1; // One-langprob count 35 | extern const uint32 kDistinctBiTableIndSize = 1; // Largest subscript 36 | static const uint32 kDistinctBiTableInd[kDistinctBiTableIndSize] = { 37 | // [0000] 38 | 0x00000000, }; 39 | 40 | extern const CLD2TableSummary kDistinctBiTable_obj = { 41 | kDistinctBiTable, 42 | kDistinctBiTableInd, 43 | kDistinctBiTableSizeOne, 44 | kDistinctBiTableSize, 45 | kDistinctBiTableKeyMask, 46 | kDistinctBiTableBuildDate, 47 | kDistinctBiTableRecognizedLangScripts, 48 | }; 49 | 50 | } // End namespace CLD2 51 | 52 | // End of generated tables 53 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/integral_types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Cheap version 16 | namespace CLD2 { 17 | 18 | typedef unsigned char uint8; 19 | typedef unsigned short uint16; 20 | typedef unsigned int uint32; 21 | typedef unsigned long long int uint64; 22 | 23 | typedef signed char int8; 24 | typedef signed short int16; 25 | typedef signed int int32; 26 | typedef signed long long int int64; 27 | 28 | typedef int32 char32; 29 | 30 | } // End namespace CLD2 31 | 32 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/langspan.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // Author: dsites@google.com (Dick Sites) 17 | // 18 | 19 | 20 | #ifndef I18N_ENCODINGS_CLD2_INTERNAL_LANGSPAN_H_ 21 | #define I18N_ENCODINGS_CLD2_INTERNAL_LANGSPAN_H_ 22 | 23 | #include "generated_language.h" 24 | #include "generated_ulscript.h" 25 | 26 | namespace CLD2 { 27 | 28 | typedef struct { 29 | char* text; // Pointer to the span, somewhere 30 | int text_bytes; // Number of bytes of text in the span 31 | int offset; // Offset of start of span in original input buffer 32 | ULScript ulscript; // Unicode Letters Script of this span 33 | Language lang; // Language identified for this span 34 | bool truncated; // true if buffer filled up before a 35 | // different script or EOF was found 36 | } LangSpan; 37 | 38 | } // namespace CLD2 39 | #endif // I18N_ENCODINGS_CLD2_INTERNAL_LANGSPAN_H_ 40 | 41 | -------------------------------------------------------------------------------- /3rdparty/cld2/internal/stringpiece.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // 16 | // A StringPiece points to part or all of a string, double-quoted string 17 | // literal, or other string-like object. A StringPiece does *not* own the 18 | // string to which it points. A StringPiece is not null-terminated. [subset] 19 | // 20 | 21 | #ifndef STRINGS_STRINGPIECE_H_ 22 | #define STRINGS_STRINGPIECE_H_ 23 | 24 | #include 25 | #include 26 | 27 | 28 | typedef int stringpiece_ssize_type; 29 | 30 | class StringPiece { 31 | private: 32 | const char* ptr_; 33 | stringpiece_ssize_type length_; 34 | 35 | public: 36 | // We provide non-explicit singleton constructors so users can pass 37 | // in a "const char*" or a "string" wherever a "StringPiece" is 38 | // expected. 39 | StringPiece() : ptr_(NULL), length_(0) {} 40 | 41 | StringPiece(const char* str) // NOLINT(runtime/explicit) 42 | : ptr_(str), length_(0) { 43 | if (str != NULL) { 44 | length_ = strlen(str); 45 | } 46 | } 47 | 48 | StringPiece(const std::string& str) // NOLINT(runtime/explicit) 49 | : ptr_(str.data()), length_(0) { 50 | length_ = str.size(); 51 | } 52 | 53 | StringPiece(const char* offset, stringpiece_ssize_type len) 54 | : ptr_(offset), length_(len) { 55 | } 56 | 57 | void remove_prefix(stringpiece_ssize_type n) { 58 | ptr_ += n; 59 | length_ -= n; 60 | } 61 | 62 | void remove_suffix(stringpiece_ssize_type n) { 63 | length_ -= n; 64 | } 65 | 66 | // data() may return a pointer to a buffer with embedded NULs, and the 67 | // returned buffer may or may not be null terminated. Therefore it is 68 | // typically a mistake to pass data() to a routine that expects a NUL 69 | // terminated string. 70 | const char* data() const { return ptr_; } 71 | stringpiece_ssize_type size() const { return length_; } 72 | stringpiece_ssize_type length() const { return length_; } 73 | bool empty() const { return length_ == 0; } 74 | }; 75 | 76 | class StringPiece; 77 | 78 | #endif // STRINGS_STRINGPIECE_H__ 79 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2006 Sonic Network Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/README.md: -------------------------------------------------------------------------------- 1 | # libsonivox 2 | 3 | This is the original Sonivox MIDI rendering (software synthesis) library 4 | used by Android. It is licensed under Apache license. 5 | 6 | Its main advantages are small size and built-in wavetable, meaning you 7 | can get a MIDI player under 300kb - without external dependencies and 8 | without needing patches or an external soundfont! 9 | 10 | The library is committed as-is from Android 6.0 source tree with a few 11 | minor changes made by George Yunaev (gyunaev@ulduzsoft.com): 12 | 13 | * The library is merged together from several different places; 14 | * Created Makefile and CMakefile; 15 | * Added test application (heavily based on original eas_main.c and eas_wave.c patched for compatibility) 16 | * Fixed 64-bit platform compatibility 17 | 18 | License: Apache 19 | 20 | PLATFORMS: 21 | 22 | * Linux x86 and x64, but should work on any little-endian platform 23 | * Windows: x86 and x64 24 | * OSX: x86, x64 25 | 26 | BUILD FROM SOURCE: 27 | 28 | Requirements: 29 | * git 30 | * make or qmake (it does not use Qt though) 31 | * GCC or clang / Xcode / VisualStudio / MinGW or MinGW-w64 32 | 33 | Original location in Android source tree: external/sonivox/ 34 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/doc/EASLibrary3_5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/3rdparty/libsonivox/doc/EASLibrary3_5.pdf -------------------------------------------------------------------------------- /3rdparty/libsonivox/doc/EAS_API_Reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/3rdparty/libsonivox/doc/EAS_API_Reference.pdf -------------------------------------------------------------------------------- /3rdparty/libsonivox/doc/EAS_Library_Integration_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/3rdparty/libsonivox/doc/EAS_Library_Integration_Guide.pdf -------------------------------------------------------------------------------- /3rdparty/libsonivox/include/eas_build.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * host_src\eas_build.h 5 | * 6 | * Contents and purpose: 7 | * This file contains the build configuration for this 8 | * build. The buildGUIDStr is a GUID created during 9 | * the build process and is guaranteed to be unique 10 | * for each build. 11 | * 12 | * Copyright Sonic Network Inc. 2006 13 | 14 | * Licensed under the Apache License, Version 2.0 (the "License"); 15 | * you may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | * This file was autogenerated by buildid.exe 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _GUID_1feda229b9a845e996f473c0a80e7220_ 31 | #define _GUID_1feda229b9a845e996f473c0a80e7220_ 32 | 33 | #define _BUILD_VERSION_ "1feda229-b9a8-45e9-96f4-73c0a80e7220" 34 | #define _BUILD_TIME_ 0x4743badd 35 | 36 | #endif /* _GUID_1feda229b9a845e996f473c0a80e7220_ */ 37 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/include/eas_chorus.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_chorus.h 5 | * 6 | * Contents and purpose: 7 | * Contains parameter enumerations for the Chorus effect 8 | * 9 | * 10 | * Copyright Sonic Network Inc. 2006 11 | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | *---------------------------------------------------------------------------- 25 | * Revision Control: 26 | * $Revision: 309 $ 27 | * $Date: 2006-09-12 18:52:45 -0700 (Tue, 12 Sep 2006) $ 28 | *---------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef EAS_CHORUS_H 32 | #define EAS_CHORUS_H 33 | 34 | /* enumerated parameter settings for Chorus effect */ 35 | typedef enum 36 | { 37 | EAS_PARAM_CHORUS_BYPASS, 38 | EAS_PARAM_CHORUS_PRESET, 39 | EAS_PARAM_CHORUS_RATE, 40 | EAS_PARAM_CHORUS_DEPTH, 41 | EAS_PARAM_CHORUS_LEVEL 42 | } E_CHORUS_PARAMS; 43 | 44 | typedef enum 45 | { 46 | EAS_PARAM_CHORUS_PRESET1, 47 | EAS_PARAM_CHORUS_PRESET2, 48 | EAS_PARAM_CHORUS_PRESET3, 49 | EAS_PARAM_CHORUS_PRESET4 50 | } E_CHORUS_PRESETS; 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/include/eas_report.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_report.h 5 | * 6 | * Contents and purpose: 7 | * This file contains the debug message handling routines for the EAS library. 8 | * These routines should be modified as needed for your system. 9 | * 10 | * DO NOT MODIFY THIS FILE! 11 | * 12 | * Copyright 2005 Sonic Network Inc. 13 | 14 | * Licensed under the Apache License, Version 2.0 (the "License"); 15 | * you may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | *---------------------------------------------------------------------------- 27 | * Revision Control: 28 | * $Revision: 82 $ 29 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 30 | *---------------------------------------------------------------------------- 31 | */ 32 | 33 | /* sentinel */ 34 | #ifndef _EAS_REPORT_H 35 | #define _EAS_REPORT_H 36 | 37 | #define _EAS_SEVERITY_NOFILTER 0 38 | #define _EAS_SEVERITY_FATAL 1 39 | #define _EAS_SEVERITY_ERROR 2 40 | #define _EAS_SEVERITY_WARNING 3 41 | #define _EAS_SEVERITY_INFO 4 42 | #define _EAS_SEVERITY_DETAIL 5 43 | 44 | /* for C++ linkage */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | #ifndef _NO_DEBUG_PREPROCESSOR 50 | 51 | /* structure for included debug message header files */ 52 | typedef struct 53 | { 54 | unsigned long m_nHashCode; 55 | int m_nSerialNum; 56 | char *m_pDebugMsg; 57 | } S_DEBUG_MESSAGES; 58 | 59 | /* debug message handling prototypes */ 60 | extern void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...); 61 | 62 | #else 63 | 64 | /* these prototypes are used if the debug preprocessor is not used */ 65 | extern void EAS_Report (int severity, const char* fmt, ...); 66 | extern void EAS_ReportX (int severity, const char* fmt, ...); 67 | 68 | #endif 69 | 70 | extern void EAS_SetDebugLevel (int severity); 71 | extern void EAS_SetDebugFile (void *file, int flushAfterWrite); 72 | 73 | #ifdef __cplusplus 74 | } /* end extern "C" */ 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/include/eas_reverb.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_reverb.h 5 | * 6 | * Contents and purpose: 7 | * Contains parameter enumerations for the Reverb effect 8 | * 9 | * 10 | * Copyright Sonic Network Inc. 2006 11 | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | *---------------------------------------------------------------------------- 25 | * Revision Control: 26 | * $Revision: 300 $ 27 | * $Date: 2006-09-11 17:37:20 -0700 (Mon, 11 Sep 2006) $ 28 | *---------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef _EAS_REVERB_H 32 | #define _EAS_REVERB_H 33 | 34 | 35 | /* enumerated parameter settings for Reverb effect */ 36 | typedef enum 37 | { 38 | EAS_PARAM_REVERB_BYPASS, 39 | EAS_PARAM_REVERB_PRESET, 40 | EAS_PARAM_REVERB_WET, 41 | EAS_PARAM_REVERB_DRY 42 | } E_REVERB_PARAMS; 43 | 44 | 45 | typedef enum 46 | { 47 | EAS_PARAM_REVERB_LARGE_HALL, 48 | EAS_PARAM_REVERB_HALL, 49 | EAS_PARAM_REVERB_CHAMBER, 50 | EAS_PARAM_REVERB_ROOM, 51 | } E_REVERB_PRESETS; 52 | 53 | 54 | #endif /* _REVERB_H */ 55 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/libsonivox.pro: -------------------------------------------------------------------------------- 1 | SUBDIRS += src 2 | TEMPLATE = subdirs 3 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_ctype.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_ctype.h 5 | * 6 | * Contents and purpose: 7 | * This is a replacement for the CRT ctype.h functions. These 8 | * functions are currently ASCII only, but eventually, we will want 9 | * to support wide-characters for localization. 10 | * 11 | * Copyright (c) 2005 Sonic Network Inc. 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 429 $ 28 | * $Date: 2006-10-19 23:50:15 -0700 (Thu, 19 Oct 2006) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #ifndef _EAS_CTYPE_H 33 | #define _EAS_CTYPE_H 34 | 35 | EAS_INLINE EAS_I8 IsDigit (EAS_I8 c) { return ((c >= '0') && (c <= '9')); } 36 | EAS_INLINE EAS_I8 IsSpace (EAS_I8 c) { return (((c >= 9) && (c <= 13)) || (c == ' ')); } 37 | EAS_INLINE EAS_I8 ToUpper (EAS_I8 c) { if ((c >= 'a') && (c <= 'z')) return c & ~0x20; else return c; } 38 | EAS_INLINE EAS_I8 ToLower (EAS_I8 c) { if ((c >= 'A') && (c <= 'Z')) return c |= 0x20; else return c; } 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_data.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_data.c 5 | * 6 | * Contents and purpose: 7 | * Contains a data allocation for synthesizer 8 | * 9 | * Copyright Sonic Network Inc. 2004 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 547 $ 26 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | // includes 31 | #include "eas_data.h" 32 | 33 | // globals 34 | S_EAS_DATA eas_Data; 35 | S_VOICE_MGR eas_Synth; 36 | S_SYNTH eas_MIDI; 37 | 38 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_dlssynth.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_dlssynth.h 5 | * 6 | * Contents and purpose: 7 | * Implements the Mobile DLS synthesizer. 8 | * 9 | * Copyright Sonic Network Inc. 2006 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 143 $ 26 | * $Date: 2006-07-17 14:09:35 -0700 (Mon, 17 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_DLSSYNTH_H 31 | #define _EAS_DLSSYNTH_H 32 | 33 | /* prototypes */ 34 | void DLS_MuteVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum); 35 | void DLS_ReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum); 36 | void DLS_SustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, EAS_I32 voiceNum); 37 | EAS_RESULT DLS_StartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_U16 regionIndex); 38 | EAS_BOOL DLS_UpdateVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_I32 *pMixBuffer, EAS_I32 numSamples); 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_effects.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_effects.h 5 | * 6 | * Contents and purpose: 7 | * Defines a generic effects interface. 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_EFFECTS_H 31 | #define _EAS_EFFECTS_H 32 | 33 | #include "eas_types.h" 34 | 35 | typedef struct 36 | { 37 | EAS_RESULT (*pfInit)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData); 38 | void (*pfProcess)(EAS_VOID_PTR pInstData, EAS_PCM *in, EAS_PCM *out, EAS_I32 numSamples); 39 | EAS_RESULT (*pfShutdown)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData); 40 | EAS_RESULT (*pFGetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue); 41 | EAS_RESULT (*pFSetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value); 42 | } S_EFFECTS_INTERFACE; 43 | 44 | typedef struct 45 | { 46 | EAS_RESULT (*pfInit)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData); 47 | void (*pfProcess)(EAS_VOID_PTR pInstData, EAS_I32 *in, EAS_I32 *out, EAS_I32 numSamples); 48 | EAS_RESULT (*pfShutdown)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData); 49 | EAS_RESULT (*pFGetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue); 50 | EAS_RESULT (*pFSetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value); 51 | } S_EFFECTS32_INTERFACE; 52 | 53 | /* mixer instance data */ 54 | typedef struct 55 | { 56 | S_EFFECTS_INTERFACE *effect; 57 | EAS_VOID_PTR effectData; 58 | } S_EFFECTS_MODULE; 59 | 60 | #endif /* end _EAS_EFFECTS_H */ 61 | 62 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_ima_tables.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_ima_tables.c 5 | * 6 | * Contents and purpose: 7 | * Contains the constant tables for IMA encode/decode 8 | * 9 | * Copyright (c) 2005 Sonic Network Inc. 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 760 $ 26 | * $Date: 2007-07-17 23:09:36 -0700 (Tue, 17 Jul 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #include "eas_types.h" 31 | 32 | /*---------------------------------------------------------------------------- 33 | * ADPCM decode tables 34 | *---------------------------------------------------------------------------- 35 | */ 36 | const EAS_I16 imaIndexTable[16] = 37 | { 38 | -1, -1, -1, -1, 2, 4, 6, 8, 39 | -1, -1, -1, -1, 2, 4, 6, 8 40 | }; 41 | 42 | const EAS_I16 imaStepSizeTable[89] = 43 | { 44 | 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 45 | 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 46 | 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 47 | 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 48 | 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 49 | 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 50 | 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 51 | 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 52 | 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 53 | }; 54 | 55 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_imelodydata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_imelodydata.c 5 | * 6 | * Contents and purpose: 7 | * SMF File Parser 8 | * 9 | * This file contains data definitions for the SMF parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 547 $ 28 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #include "eas_types.h" 33 | #include "eas_imelodydata.h" 34 | 35 | /*---------------------------------------------------------------------------- 36 | * 37 | * eas_iMelodyData 38 | * 39 | * Static memory allocation for iMelody parser 40 | *---------------------------------------------------------------------------- 41 | */ 42 | S_IMELODY_DATA eas_iMelodyData; 43 | 44 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_midi.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_midi.h 5 | * 6 | * Contents and purpose: 7 | * Prototypes for MIDI stream parsing functions 8 | * 9 | * 10 | * Copyright Sonic Network Inc. 2005 11 | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | *---------------------------------------------------------------------------- 25 | * Revision Control: 26 | * $Revision: 82 $ 27 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 28 | *---------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef _EAS_MIDI_H 32 | #define _EAS_MIDI_H 33 | 34 | /*---------------------------------------------------------------------------- 35 | * EAS_InitMIDIStream() 36 | *---------------------------------------------------------------------------- 37 | * Purpose: 38 | * Initializes the MIDI stream state for parsing. 39 | * 40 | * Inputs: 41 | * 42 | * Outputs: 43 | * returns EAS_RESULT (EAS_SUCCESS is OK) 44 | * 45 | * Side Effects: 46 | * 47 | *---------------------------------------------------------------------------- 48 | */ 49 | void EAS_InitMIDIStream (S_MIDI_STREAM *pMIDIStream); 50 | 51 | /*---------------------------------------------------------------------------- 52 | * EAS_ParseMIDIStream() 53 | *---------------------------------------------------------------------------- 54 | * Purpose: 55 | * Parses a MIDI input stream character by character. Characters are pushed (rather than pulled) 56 | * so the interface works equally well for both file and stream I/O. 57 | * 58 | * Inputs: 59 | * c - character from MIDI stream 60 | * 61 | * Outputs: 62 | * returns EAS_RESULT (EAS_SUCCESS is OK) 63 | * 64 | * Side Effects: 65 | * 66 | *---------------------------------------------------------------------------- 67 | */ 68 | EAS_RESULT EAS_ParseMIDIStream (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_U8 c, EAS_INT parserMode); 69 | 70 | #endif /* #define _EAS_MIDI_H */ 71 | 72 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_midictrl.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_midictrl.h 5 | * 6 | * Contents and purpose: 7 | * MIDI controller definitions 8 | * 9 | * This header only contains declarations that are specific 10 | * to this implementation. 11 | * 12 | * Copyright Sonic Network Inc. 2005 13 | 14 | * Licensed under the Apache License, Version 2.0 (the "License"); 15 | * you may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | *---------------------------------------------------------------------------- 27 | * Revision Control: 28 | * $Revision: 82 $ 29 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 30 | *---------------------------------------------------------------------------- 31 | */ 32 | 33 | #ifndef _EAS_MIDICTRL_H 34 | #define _EAS_MIDICTRL_H 35 | 36 | /* define controller types */ 37 | /* 38 | Note that these controller types are specified in base 10 (decimal) 39 | and not in hexadecimal. The above midi messages are specified 40 | in hexadecimal. 41 | */ 42 | #define MIDI_CONTROLLER_BANK_SELECT 0 43 | #define MIDI_CONTROLLER_BANK_SELECT_MSB 0 44 | #define MIDI_CONTROLLER_MOD_WHEEL 1 45 | #define MIDI_CONTROLLER_ENTER_DATA_MSB 6 46 | #define MIDI_CONTROLLER_VOLUME 7 47 | #define MIDI_CONTROLLER_PAN 10 48 | #define MIDI_CONTROLLER_EXPRESSION 11 49 | #define MIDI_CONTROLLER_BANK_SELECT_LSB 32 50 | #define MIDI_CONTROLLER_ENTER_DATA_LSB 38 /* 0x26 */ 51 | #define MIDI_CONTROLLER_SUSTAIN_PEDAL 64 52 | #define MIDI_CONTROLLER_SELECT_NRPN_LSB 98 53 | #define MIDI_CONTROLLER_SELECT_NRPN_MSB 99 54 | #define MIDI_CONTROLLER_SELECT_RPN_LSB 100 /* 0x64 */ 55 | #define MIDI_CONTROLLER_SELECT_RPN_MSB 101 /* 0x65 */ 56 | #define MIDI_CONTROLLER_ALL_SOUND_OFF 120 57 | #define MIDI_CONTROLLER_RESET_CONTROLLERS 121 58 | #define MIDI_CONTROLLER_ALL_NOTES_OFF 123 59 | #define MIDI_CONTROLLER_OMNI_OFF 124 60 | #define MIDI_CONTROLLER_OMNI_ON 125 61 | #define MIDI_CONTROLLER_MONO_ON_POLY_OFF 126 62 | #define MIDI_CONTROLLER_POLY_ON_MONO_OFF 127 63 | 64 | #endif /* #ifndef _EAS_MIDICTRL_H */ 65 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_mididata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_mididata.c 5 | * 6 | * Contents and purpose: 7 | * Data module for MIDI stream interface 8 | * 9 | * 10 | * Copyright Sonic Network Inc. 2005 11 | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | *---------------------------------------------------------------------------- 25 | * Revision Control: 26 | * $Revision: 547 $ 27 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 28 | *---------------------------------------------------------------------------- 29 | */ 30 | 31 | #include "eas_miditypes.h" 32 | 33 | S_INTERACTIVE_MIDI eas_MIDIData; 34 | 35 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_mixbuf.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_mixbuf.c 5 | * 6 | * Contents and purpose: 7 | * Contains a data allocation for synthesizer 8 | * 9 | * Copyright Sonic Network Inc. 2004 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | // includes 31 | #include "eas_data.h" 32 | #include "eas_mixer.h" 33 | 34 | // globals 35 | EAS_I32 eas_MixBuffer[BUFFER_SIZE_IN_MONO_SAMPLES * NUM_OUTPUT_CHANNELS]; 36 | 37 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_otadata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_otadata..c 5 | * 6 | * Contents and purpose: 7 | * OTA Stream Parser data module for static memory model 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 547 $ 26 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #include "eas_types.h" 31 | #include "eas_otadata.h" 32 | 33 | /*---------------------------------------------------------------------------- 34 | * 35 | * eas_OTAData 36 | * 37 | * Static memory allocation for OTA parser 38 | *---------------------------------------------------------------------------- 39 | */ 40 | S_OTA_DATA eas_OTAData; 41 | 42 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_pan.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_pan.h 5 | * 6 | * Contents and purpose: 7 | * Calculates left and right gain multipliers based on a pan value from -63 to +63 8 | * 9 | * NOTES: 10 | * The _CMX_PARSER and _MFI_PARSER preprocessor symbols determine 11 | * whether the parser works for those particular file formats. 12 | * 13 | * Copyright Sonic Network Inc. 2005 14 | 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | * 21 | * Unless required by applicable law or agreed to in writing, software 22 | * distributed under the License is distributed on an "AS IS" BASIS, 23 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | * See the License for the specific language governing permissions and 25 | * limitations under the License. 26 | * 27 | *---------------------------------------------------------------------------- 28 | * Revision Control: 29 | * $Revision: 82 $ 30 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 31 | *---------------------------------------------------------------------------- 32 | */ 33 | 34 | #ifndef EAS_PAN_H 35 | #define _EAS_PAN_H 36 | 37 | #include "eas_types.h" 38 | 39 | /*---------------------------------------------------------------------------- 40 | * EAS_CalcPanControl() 41 | *---------------------------------------------------------------------------- 42 | * Purpose: 43 | * Assign the left and right gain values corresponding to the given pan value. 44 | * 45 | * This routine uses sin/cos approximations for an equal power curve: 46 | * 47 | * sin(x) = (2-4*c)*x^2 + c + x 48 | * cos(x) = (2-4*c)*x^2 + c - x 49 | * 50 | * where c = 1/sqrt(2) 51 | * using the a0 + x*(a1 + x*a2) approach 52 | * 53 | * Inputs: 54 | * pan - pan value (-63 to + 63) 55 | * 56 | * Outputs: 57 | * pGainLeft linear gain multiplier for left channel (15-bit fraction) 58 | * pGainRight linear gain multiplier for left channel (15-bit fraction) 59 | * 60 | * Side Effects: 61 | *---------------------------------------------------------------------------- 62 | */ 63 | void EAS_CalcPanControl (EAS_INT pan, EAS_I16 *pGainLeft, EAS_I16 *pGainRight); 64 | 65 | #endif 66 | 67 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_pcmdata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_pcmdata.c 5 | * 6 | * Contents and purpose: 7 | * Contains the static data for the PCM engine. 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 547 $ 26 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #include "eas_data.h" 31 | 32 | /* static data allocation */ 33 | S_PCM_STATE eas_PCMData[MAX_PCM_STREAMS]; 34 | 35 | 36 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_rtttldata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_rtttldata.c 5 | * 6 | * Contents and purpose: 7 | * RTTTL File Parser data module for static memory models 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 547 $ 26 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #include "eas_types.h" 31 | #include "eas_rtttldata.h" 32 | 33 | /*---------------------------------------------------------------------------- 34 | * 35 | * eas_RTTTLData 36 | * 37 | * Static memory allocation for RTTTL parser 38 | *---------------------------------------------------------------------------- 39 | */ 40 | S_RTTTL_DATA eas_RTTTLData; 41 | 42 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_rtttldata.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_rtttldata.h 5 | * 6 | * Contents and purpose: 7 | * SMF File Parser 8 | * 9 | * This file contains data declarations for the RTTTL parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 82 $ 28 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #ifndef EAS_RTTTLDATA_H 33 | #define EAS_RTTTLDATA_H 34 | 35 | #include "eas_data.h" 36 | 37 | 38 | /* maximum line size as specified in iMelody V1.2 spec */ 39 | #define MAX_LINE_SIZE 75 40 | 41 | /*---------------------------------------------------------------------------- 42 | * 43 | * S_RTTTL_DATA 44 | * 45 | * This structure contains the state data for the iMelody parser 46 | *---------------------------------------------------------------------------- 47 | */ 48 | 49 | typedef struct 50 | { 51 | EAS_FILE_HANDLE fileHandle; /* file handle */ 52 | S_SYNTH *pSynth; /* synthesizer handle */ 53 | S_METADATA_CB metadata; /* metadata callback */ 54 | EAS_I32 fileOffset; /* offset to start of data */ 55 | EAS_I32 time; /* current time in 256ths of a msec */ 56 | EAS_I32 tick; /* length of 32nd note in 256th of a msec */ 57 | EAS_I32 restTicks; /* ticks to rest after current note */ 58 | EAS_I32 repeatOffset; /* file offset to start of repeat section */ 59 | EAS_U8 repeatCount; /* repeat counter */ 60 | EAS_I8 dataByte; /* storage for characters that are "put back" */ 61 | EAS_U8 state; /* current state EAS_STATE_XXXX */ 62 | EAS_I8 style; /* from STYLE */ 63 | EAS_U8 note; /* MIDI note number */ 64 | EAS_U8 octave; /* decault octave prefix */ 65 | EAS_I8 duration; /* default note duration */ 66 | } S_RTTTL_DATA; 67 | 68 | #endif 69 | 70 | 71 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_smf.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_smf.h 5 | * 6 | * Contents and purpose: 7 | * SMF Type 0 and 1 File Parser 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_SMF_H 31 | #define _EAS_SMF_H 32 | 33 | /* prototypes for private interface to SMF parser */ 34 | EAS_RESULT SMF_CheckFileType (S_EAS_DATA *pEASData, EAS_FILE_HANDLE fileHandle, EAS_VOID_PTR *ppHandle, EAS_I32 offset); 35 | EAS_RESULT SMF_Prepare (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData); 36 | EAS_RESULT SMF_Time (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_U32 *pTime); 37 | EAS_RESULT SMF_Event (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_INT parserMode); 38 | EAS_RESULT SMF_State (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_STATE *pState); 39 | EAS_RESULT SMF_Close (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData); 40 | EAS_RESULT SMF_Reset (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData); 41 | EAS_RESULT SMF_Pause (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData); 42 | EAS_RESULT SMF_Resume (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData); 43 | EAS_RESULT SMF_SetData (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value); 44 | EAS_RESULT SMF_GetData (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue); 45 | EAS_RESULT SMF_ParseHeader (EAS_HW_DATA_HANDLE hwInstData, S_SMF_DATA *pSMFData); 46 | 47 | #endif /* end _EAS_SMF_H */ 48 | 49 | 50 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_smfdata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_smfdata.c 5 | * 6 | * Contents and purpose: 7 | * SMF File Parser 8 | * 9 | * This file contains data definitions for the SMF parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 778 $ 28 | * $Date: 2007-07-23 16:45:17 -0700 (Mon, 23 Jul 2007) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #include "eas_miditypes.h" 33 | #include "eas_smfdata.h" 34 | 35 | /*---------------------------------------------------------------------------- 36 | * 37 | * S_SMF_STREAM 38 | * 39 | * Static memory allocation for SMF parser 40 | *---------------------------------------------------------------------------- 41 | */ 42 | static S_SMF_STREAM eas_SMFStreams[MAX_SMF_STREAMS]; 43 | 44 | /*---------------------------------------------------------------------------- 45 | * 46 | * eas_SMFData 47 | * 48 | * Static memory allocation for SMF parser 49 | *---------------------------------------------------------------------------- 50 | */ 51 | S_SMF_DATA eas_SMFData = 52 | { 53 | eas_SMFStreams, /* pointer to individual streams in file */ 54 | 0, /* pointer to next stream with event */ 55 | 0, /* pointer to synth */ 56 | 0, /* file handle */ 57 | { 0, 0, 0, 0}, /* metadata callback */ 58 | 0, /* file offset */ 59 | 0, /* current time in milliseconds/256 */ 60 | 0, /* actual number of streams */ 61 | 0, /* current MIDI tick to msec conversion */ 62 | 0, /* ticks per quarter note */ 63 | 0, /* current state EAS_STATE_XXXX */ 64 | 0 /* flags */ 65 | }; 66 | 67 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_smfdata.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_smfdata.h 5 | * 6 | * Contents and purpose: 7 | * SMF File Parser 8 | * 9 | * This file contains data definitions for the SMF parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 686 $ 28 | * $Date: 2007-05-03 14:10:54 -0700 (Thu, 03 May 2007) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #ifndef _EAS_SMF_DATA_H 33 | #define _EAS_SMF_DATA_H 34 | 35 | #ifndef MAX_SMF_STREAMS 36 | #define MAX_SMF_STREAMS 128 37 | #endif 38 | 39 | /* offsets in to the SMF file */ 40 | #define SMF_OFS_HEADER_SIZE 4 41 | #define SMF_OFS_FILE_TYPE 8 42 | #define SMF_OFS_NUM_TRACKS 10 43 | 44 | /* size of chunk info (chunk ID + chunk size) */ 45 | #define SMF_CHUNK_INFO_SIZE 8 46 | 47 | /* 'MTrk' track chunk ID */ 48 | #define SMF_CHUNK_TYPE_TRACK 0x4d54726bL 49 | 50 | /* some useful meta-events */ 51 | #define SMF_META_TEXT 0x01 52 | #define SMF_META_COPYRIGHT 0x02 53 | #define SMF_META_SEQTRK_NAME 0x03 54 | #define SMF_META_LYRIC 0x05 55 | #define SMF_META_END_OF_TRACK 0x2f 56 | #define SMF_META_TEMPO 0x51 57 | #define SMF_META_TIME_SIGNATURE 0x58 58 | 59 | /* default timebase (120BPM) */ 60 | #define SMF_DEFAULT_TIMEBASE 500000L 61 | 62 | /* value for pSMFStream->ticks to signify end of track */ 63 | #define SMF_END_OF_TRACK 0xffffffff 64 | 65 | #endif 66 | 67 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_synth_protos.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_synth_protos.h 5 | * 6 | * Contents and purpose: 7 | * Declarations, interfaces, and prototypes for synth. 8 | * 9 | * Copyright Sonic Network Inc. 2004 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_SYNTH_PROTOS_H 31 | #define _EAS_SYNTH_PROTOS_H 32 | 33 | /* includes */ 34 | #include "eas_data.h" 35 | #include "eas_sndlib.h" 36 | 37 | #ifdef _SPLIT_ARCHITECTURE 38 | typedef struct s_frame_interface_tag 39 | { 40 | EAS_BOOL (* EAS_CONST pfStartFrame)(EAS_FRAME_BUFFER_HANDLE pFrameBuffer); 41 | EAS_BOOL (* EAS_CONST pfEndFrame)(EAS_FRAME_BUFFER_HANDLE pFrameBuffer, EAS_I32 *pMixBuffer, EAS_I16 masterGain); 42 | } S_FRAME_INTERFACE; 43 | #endif 44 | 45 | /* generic synthesizer interface */ 46 | typedef struct 47 | { 48 | EAS_RESULT (* EAS_CONST pfInitialize)(S_VOICE_MGR *pVoiceMgr); 49 | EAS_RESULT (* EAS_CONST pfStartVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_U16 regionIndex); 50 | EAS_BOOL (* EAS_CONST pfUpdateVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_I32 *pMixBuffer, EAS_I32 numSamples); 51 | void (* EAS_CONST pfReleaseVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum); 52 | void (* EAS_CONST pfMuteVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum); 53 | void (* EAS_CONST pfSustainPedal)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, EAS_I32 voiceNum); 54 | void (* EAS_CONST pfUpdateChannel)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel); 55 | } S_SYNTH_INTERFACE; 56 | 57 | #endif 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_synthcfg.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_synthcfg.h 5 | * 6 | * Contents and purpose: 7 | * Defines for various synth configurations 8 | * 9 | * Copyright Sonic Network Inc. 2004, 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 664 $ 26 | * $Date: 2007-04-25 13:11:22 -0700 (Wed, 25 Apr 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_SYNTHCFG_H 31 | #define _EAS_SYNTHCFG_H 32 | 33 | #if defined(EAS_WT_SYNTH) 34 | #define _WT_SYNTH 35 | 36 | /* FM on MCU */ 37 | #elif defined(EAS_FM_SYNTH) 38 | #define _FM_SYNTH 39 | 40 | /* wavetable drums and FM melodic on MCU */ 41 | #elif defined(EAS_HYBRID_SYNTH) 42 | #define _WT_SYNTH 43 | #define _FM_SYNTH 44 | #define _SECONDARY_SYNTH 45 | #define _HYBRID_SYNTH 46 | 47 | /* wavetable drums on MCU, wavetable melodic on DSP */ 48 | #elif defined(EAS_SPLIT_WT_SYNTH) 49 | #define _WT_SYNTH 50 | #define _SPLIT_ARCHITECTURE 51 | 52 | /* wavetable drums on MCU, FM melodic on DSP */ 53 | #elif defined(EAS_SPLIT_HYBRID_SYNTH) 54 | #define _WT_SYNTH 55 | #define _FM_SYNTH 56 | #define _SECONDARY_SYNTH 57 | #define _SPLIT_ARCHITECTURE 58 | #define _HYBRID_SYNTH 59 | 60 | /* FM synth on DSP */ 61 | #elif defined(EAS_SPLIT_FM_SYNTH) 62 | #define _FM_SYNTH 63 | #define _SPLIT_ARCHITECTURE 64 | 65 | #else 66 | #error "Unrecognized architecture option" 67 | #endif 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_tcdata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_tcdata.c 5 | * 6 | * Contents and purpose: 7 | * ToneControl Parser data 8 | * 9 | * This file contains static data for the ToneControl parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 547 $ 28 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #include "eas_types.h" 33 | #include "eas_tcdata.h" 34 | 35 | /*---------------------------------------------------------------------------- 36 | * 37 | * eas_iMelodyData 38 | * 39 | * Static memory allocation for iMelody parser 40 | *---------------------------------------------------------------------------- 41 | */ 42 | S_TC_DATA eas_TCData; 43 | 44 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_tcdata.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_tcdata.h 5 | * 6 | * Contents and purpose: 7 | * SMF File Parser 8 | * 9 | * This file contains data declarations for the ToneControl parser. 10 | * 11 | * Copyright Sonic Network Inc. 2006 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 82 $ 28 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #ifndef EAS_TFDATA_H 33 | #define EAS_TCDATA_H 34 | 35 | #include "eas_data.h" 36 | 37 | /*---------------------------------------------------------------------------- 38 | * 39 | * S_TC_DATA 40 | * 41 | * This structure contains the state data for the ToneControl parser 42 | *---------------------------------------------------------------------------- 43 | */ 44 | typedef struct 45 | { 46 | EAS_FILE_HANDLE fileHandle; /* file handle */ 47 | S_SYNTH *pSynth; /* synthesizer handle */ 48 | EAS_I32 fileOffset; /* offset to start of data */ 49 | EAS_I32 time; /* current time in 256ths of a msec */ 50 | EAS_I32 tick; /* tick based on current tempo and resolution */ 51 | EAS_I32 length; /* length of current note */ 52 | EAS_I32 restorePos; /* return to here after block */ 53 | EAS_U8 state; /* current state EAS_STATE_XXXX */ 54 | EAS_U8 volume; /* volume */ 55 | EAS_I8 note; /* current note */ 56 | EAS_I8 repeatCount; /* note repeat counter */ 57 | EAS_I8 tempo; /* tempo from file (bpm = tempo * 4) */ 58 | EAS_I8 resolution; /* resolution from file */ 59 | EAS_I8 dataByte; /* storage for characters that are "put back" */ 60 | EAS_BOOL8 byteAvail; /* char in "put back" buffer */ 61 | } S_TC_DATA; 62 | 63 | #endif 64 | 65 | 66 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_wavefile.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_wavefile.h 5 | * 6 | * Contents and purpose: 7 | * Static data block for wave file parser. 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 439 $ 26 | * $Date: 2006-10-26 11:53:18 -0700 (Thu, 26 Oct 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_WAVEFILE_H 31 | #define _EAS_WAVEFILE_H 32 | 33 | #include "eas_data.h" 34 | #include "eas_pcm.h" 35 | 36 | /*---------------------------------------------------------------------------- 37 | * 38 | * S_WAVE_STATE 39 | * 40 | * This structure contains the WAVE file parser state information 41 | *---------------------------------------------------------------------------- 42 | */ 43 | typedef struct s_wave_state_tag 44 | { 45 | EAS_FILE_HANDLE fileHandle; 46 | EAS_PCM_HANDLE streamHandle; 47 | S_METADATA_CB metadata; 48 | EAS_U32 time; 49 | EAS_I32 fileOffset; 50 | EAS_I32 audioOffset; 51 | EAS_I32 mediaLength; 52 | EAS_U32 audioSize; 53 | EAS_U32 flags; 54 | EAS_I16 fileType; 55 | #ifdef MMAPI_SUPPORT 56 | EAS_VOID_PTR fmtChunk; 57 | #endif 58 | EAS_I32 infoChunkPos; 59 | EAS_I32 infoChunkSize; 60 | } S_WAVE_STATE; 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_wavefiledata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_wavefiledata.c 5 | * 6 | * Contents and purpose: 7 | * Static data block for wave file parser. 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 547 $ 26 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #include "eas_wavefile.h" 31 | 32 | S_WAVE_STATE eas_WaveData; 33 | 34 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_wtsynth.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_wtsynth.h 5 | * 6 | * Contents and purpose: 7 | * This file defines the interface for synthesizer engine 8 | * 9 | * Copyright Sonic Network Inc. 2004 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_WTSYNTH_H 31 | #define _EAS_WTSYNTH_H 32 | 33 | #include "eas_sndlib.h" 34 | #include "eas_wtengine.h" 35 | 36 | /* adjust the filter cutoff frequency to the sample rate */ 37 | #if defined (_SAMPLE_RATE_8000) 38 | #define FILTER_CUTOFF_FREQ_ADJUST 0 39 | #elif defined (_SAMPLE_RATE_16000) 40 | #define FILTER_CUTOFF_FREQ_ADJUST 1200 41 | #elif defined (_SAMPLE_RATE_20000) 42 | #define FILTER_CUTOFF_FREQ_ADJUST 1586 43 | #elif defined (_SAMPLE_RATE_22050) 44 | #define FILTER_CUTOFF_FREQ_ADJUST 1756 45 | #elif defined (_SAMPLE_RATE_24000) 46 | #define FILTER_CUTOFF_FREQ_ADJUST 1902 47 | #elif defined (_SAMPLE_RATE_32000) 48 | #define FILTER_CUTOFF_FREQ_ADJUST 2400 49 | #elif defined (_SAMPLE_RATE_44100) 50 | #define FILTER_CUTOFF_FREQ_ADJUST 2956 51 | #elif defined (_SAMPLE_RATE_48000) 52 | #define FILTER_CUTOFF_FREQ_ADJUST 3102 53 | #else 54 | #error "_SAMPLE_RATE_XXXXX must be defined to valid rate" 55 | #endif 56 | 57 | /* function prototypes */ 58 | void WT_UpdateLFO (S_LFO_CONTROL *pLFO, EAS_I16 phaseInc); 59 | 60 | #if defined(_FILTER_ENABLED) || defined(DLS_SYNTHESIZER) 61 | void WT_SetFilterCoeffs (S_WT_INT_FRAME *pIntFrame, EAS_I32 cutoff, EAS_I32 resonance); 62 | #endif 63 | 64 | #endif 65 | 66 | 67 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_xmf.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_xmf.h 5 | * 6 | * Contents and purpose: 7 | * XMF Type 0 and 1 File Parser 8 | * 9 | * Copyright Sonic Network Inc. 2005 10 | 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | * 23 | *---------------------------------------------------------------------------- 24 | * Revision Control: 25 | * $Revision: 82 $ 26 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 27 | *---------------------------------------------------------------------------- 28 | */ 29 | 30 | #ifndef _EAS_XMF_H 31 | #define _EAS_XMF_H 32 | 33 | #ifndef MAX_XMF_STREAMS 34 | #define MAX_XMF_STREAMS 16 35 | #endif 36 | 37 | /* offsets in to the XMF file */ 38 | #define XMF_OFS_HEADER_SIZE 4 39 | #define XMF_OFS_FILE_TYPE 8 40 | #define XMF_OFS_NUM_TRACKS 10 41 | 42 | /* size of chunk info (chunk ID + chunk size) */ 43 | #define XMF_CHUNK_INFO_SIZE 8 44 | 45 | /* 'MTrk' track chunk ID */ 46 | #define XMF_CHUNK_TYPE_TRACK 0x4d54726bL 47 | 48 | /* some useful meta-events */ 49 | #define XMF_META_END_OF_TRACK 0x2f 50 | #define XMF_META_TEMPO 0x51 51 | 52 | /* default timebase (120BPM) */ 53 | #define XMF_DEFAULT_TIMEBASE 500000L 54 | 55 | /* value for pXMFStream->ticks to signify end of track */ 56 | #define XMF_END_OF_TRACK 0xffffffff 57 | 58 | #endif /* end _EAS_XMF_H */ 59 | 60 | 61 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_xmfdata.c: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_xmfdata.c 5 | * 6 | * Contents and purpose: 7 | * XMF File Parser 8 | * 9 | * This file contains data definitions for the XMF parser. 10 | * 11 | * Copyright Sonic Network Inc. 2005 12 | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | *---------------------------------------------------------------------------- 26 | * Revision Control: 27 | * $Revision: 547 $ 28 | * $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $ 29 | *---------------------------------------------------------------------------- 30 | */ 31 | 32 | #include "eas_miditypes.h" 33 | #include "eas_xmf.h" 34 | #include "eas_xmfdata.h" 35 | 36 | /*---------------------------------------------------------------------------- 37 | * 38 | * eas_XMFData 39 | * 40 | * Static memory allocation for XMF parser 41 | *---------------------------------------------------------------------------- 42 | */ 43 | S_XMF_DATA eas_XMFData; 44 | 45 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/eas_xmfdata.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------- 2 | * 3 | * File: 4 | * eas_xmfdata.h 5 | * 6 | * Contents and purpose: 7 | * Contains declarations for the XMF file parser. 8 | * 9 | * 10 | * Copyright Sonic Network Inc. 2005 11 | 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | *---------------------------------------------------------------------------- 25 | * Revision Control: 26 | * $Revision: 82 $ 27 | * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $ 28 | *---------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef _EAS_XMFDATA_H 32 | #define _EAS_XMFDATA_H 33 | 34 | #include "eas_data.h" 35 | 36 | /*---------------------------------------------------------------------------- 37 | * 38 | * S_XMF_DATA 39 | * 40 | * This structure contains the instance data required to parse an XMF file. 41 | * 42 | *---------------------------------------------------------------------------- 43 | */ 44 | 45 | typedef struct 46 | { 47 | EAS_FILE_HANDLE fileHandle; 48 | EAS_I32 fileOffset; 49 | EAS_VOID_PTR pSMFData; 50 | EAS_I32 midiOffset; 51 | EAS_I32 dlsOffset; 52 | S_DLS *pDLS; 53 | } S_XMF_DATA; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/src/src.pro: -------------------------------------------------------------------------------- 1 | TARGET = sonivox 2 | CONFIG += warn_on staticlib 3 | TEMPLATE = lib 4 | 5 | DEFINES = NUM_OUTPUT_CHANNELS=2 _SAMPLE_RATE_44100 MAX_SYNTH_VOICES=64 EAS_WT_SYNTH \ 6 | _8_BIT_SAMPLES _FILTER_ENABLED _WAVE_PARSER MAX_SMF_STREAMS=32 _REVERB_ENABLED \ 7 | _CHORUS_ENABLED DLS_SYNTHESIZER MMAPI_SUPPORT UNIFIED_DEBUG_MESSAGES \ 8 | _IMELODY_PARSER _RTTTL_PARSER _OTA_PARSER _XMF_PARSER 9 | 10 | SOURCES += eas_mididata.c eas_pan.c eas_wavefiledata.c \ 11 | eas_reverb.c eas_mdls.c eas_mixbuf.c eas_tcdata.c eas_chorus.c eas_pcmdata.c \ 12 | eas_math.c eas_tonecontrol.c eas_voicemgt.c eas_public.c eas_dlssynth.c eas_midi.c \ 13 | eas_flog.c eas_wtengine.c eas_imaadpcm.c eas_wtsynth.c eas_pcm.c eas_mixer.c \ 14 | eas_wavefile.c eas_ima_tables.c eas_data.c eas_config.c eas_report.c eas_hostmm.c \ 15 | eas_smf.c eas_smfdata.c eas_imelody.c eas_imelodydata.c eas_ota.c eas_otadata.c \ 16 | eas_rtttl.c eas_rtttldata.c eas_xmf.c eas_xmfdata.c 17 | 18 | INCLUDEPATH += ../include 19 | unix: QMAKE_CFLAGS += -Wno-unused 20 | -------------------------------------------------------------------------------- /3rdparty/libsonivox/testapp/testapp.pro: -------------------------------------------------------------------------------- 1 | TARGET = testapp 2 | CONFIG += warn_on 3 | CONFIG -= QT 4 | TEMPLATE = app 5 | INCLUDEPATH += ../include 6 | LIBS += -L../src -lsonivox 7 | SOURCES += test_app.c 8 | -------------------------------------------------------------------------------- /3rdparty/sqlite3/sqlite3.pro: -------------------------------------------------------------------------------- 1 | TARGET = sqlite3 2 | CONFIG = warn_on staticlib 3 | TEMPLATE = lib 4 | DEFINES += SQLITE_OMIT_LOAD_EXTENSION 5 | SOURCES += sqlite3.c 6 | -------------------------------------------------------------------------------- /3rdparty/uchardet/AUTHORS: -------------------------------------------------------------------------------- 1 | == Original Authors == 2 | 3 | The original code is Mozilla Universal charset detector code. 4 | The initial developer of the Original Code is Netscape Communications Corporation. 5 | The initial developer of the C wrapper is BYVoid. 6 | 7 | == Maintainers == 8 | 9 | BYVoid 10 | Jehan 11 | 12 | == Contributors == 13 | 14 | You can obtain the full list of contributors to uchardet with the 15 | following git command in the source repository: 16 | $ git shortlog -s 17 | -------------------------------------------------------------------------------- /3rdparty/uchardet/nsEscCharsetProber.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is mozilla.org code. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 1998 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | #ifndef nsEscCharSetProber_h__ 39 | #define nsEscCharSetProber_h__ 40 | 41 | #include "nsCharSetProber.h" 42 | #include "nsCodingStateMachine.h" 43 | 44 | #define NUM_OF_ESC_CHARSETS 4 45 | 46 | class nsEscCharSetProber: public nsCharSetProber { 47 | public: 48 | nsEscCharSetProber(PRUint32 aLanguageFilter); 49 | virtual ~nsEscCharSetProber(void); 50 | nsProbingState HandleData(const char* aBuf, PRUint32 aLen); 51 | const char* GetCharSetName() {return mDetectedCharset;} 52 | nsProbingState GetState(void) {return mState;} 53 | void Reset(void); 54 | float GetConfidence(void){return (float)0.99;} 55 | void SetOpion() {} 56 | 57 | protected: 58 | void GetDistribution(PRUint32 aCharLen, const char* aStr); 59 | 60 | nsCodingStateMachine* mCodingSM[NUM_OF_ESC_CHARSETS] ; 61 | PRUint32 mActiveSM; 62 | nsProbingState mState; 63 | const char * mDetectedCharset; 64 | }; 65 | 66 | #endif /* nsEscCharSetProber_h__ */ 67 | 68 | -------------------------------------------------------------------------------- /3rdparty/uchardet/nsLatin1Prober.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Mozilla Universal charset detector code. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 2001 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Shy Shalom 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | #ifndef nsLatin1Prober_h__ 40 | #define nsLatin1Prober_h__ 41 | 42 | #include "nsCharSetProber.h" 43 | 44 | #define FREQ_CAT_NUM 4 45 | 46 | class nsLatin1Prober: public nsCharSetProber { 47 | public: 48 | nsLatin1Prober(void){Reset();} 49 | virtual ~nsLatin1Prober(void){} 50 | nsProbingState HandleData(const char* aBuf, PRUint32 aLen); 51 | const char* GetCharSetName() {return "WINDOWS-1252";} 52 | nsProbingState GetState(void) {return mState;} 53 | void Reset(void); 54 | float GetConfidence(void); 55 | void SetOpion() {} 56 | 57 | #ifdef DEBUG_chardet 58 | virtual void DumpStatus(); 59 | #endif 60 | 61 | protected: 62 | 63 | nsProbingState mState; 64 | char mLastCharClass; 65 | PRUint32 mFreqCounter[FREQ_CAT_NUM]; 66 | }; 67 | 68 | 69 | #endif /* nsLatin1Prober_h__ */ 70 | 71 | -------------------------------------------------------------------------------- /3rdparty/uchardet/nsSBCSGroupProber.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is Mozilla Universal charset detector code. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 2001 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * Shy Shalom 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | #ifndef nsSBCSGroupProber_h__ 40 | #define nsSBCSGroupProber_h__ 41 | 42 | 43 | #define NUM_OF_SBCS_PROBERS 30 44 | 45 | class nsCharSetProber; 46 | class nsSBCSGroupProber: public nsCharSetProber { 47 | public: 48 | nsSBCSGroupProber(); 49 | virtual ~nsSBCSGroupProber(); 50 | nsProbingState HandleData(const char* aBuf, PRUint32 aLen); 51 | const char* GetCharSetName(); 52 | nsProbingState GetState(void) {return mState;} 53 | void Reset(void); 54 | float GetConfidence(void); 55 | void SetOpion() {} 56 | 57 | #ifdef DEBUG_chardet 58 | void DumpStatus(); 59 | #endif 60 | 61 | protected: 62 | nsProbingState mState; 63 | nsCharSetProber* mProbers[NUM_OF_SBCS_PROBERS]; 64 | PRBool mIsActive[NUM_OF_SBCS_PROBERS]; 65 | PRInt32 mBestGuess; 66 | PRUint32 mActiveNum; 67 | }; 68 | 69 | #endif /* nsSBCSGroupProber_h__ */ 70 | 71 | -------------------------------------------------------------------------------- /3rdparty/uchardet/nsUTF8Prober.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* ***** BEGIN LICENSE BLOCK ***** 3 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 | * 5 | * The contents of this file are subject to the Mozilla Public License Version 6 | * 1.1 (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * http://www.mozilla.org/MPL/ 9 | * 10 | * Software distributed under the License is distributed on an "AS IS" basis, 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 12 | * for the specific language governing rights and limitations under the 13 | * License. 14 | * 15 | * The Original Code is mozilla.org code. 16 | * 17 | * The Initial Developer of the Original Code is 18 | * Netscape Communications Corporation. 19 | * Portions created by the Initial Developer are Copyright (C) 1998 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | 38 | #ifndef nsUTF8Prober_h__ 39 | #define nsUTF8Prober_h__ 40 | 41 | #include "nsCharSetProber.h" 42 | #include "nsCodingStateMachine.h" 43 | 44 | class nsUTF8Prober: public nsCharSetProber { 45 | public: 46 | nsUTF8Prober(){mNumOfMBChar = 0; 47 | mCodingSM = new nsCodingStateMachine(&UTF8SMModel); 48 | Reset(); } 49 | virtual ~nsUTF8Prober(){delete mCodingSM;} 50 | nsProbingState HandleData(const char* aBuf, PRUint32 aLen); 51 | const char* GetCharSetName() {return "UTF-8";} 52 | nsProbingState GetState(void) {return mState;} 53 | void Reset(void); 54 | float GetConfidence(void); 55 | void SetOpion() {} 56 | 57 | protected: 58 | nsCodingStateMachine* mCodingSM; 59 | nsProbingState mState; 60 | PRUint32 mNumOfMBChar; 61 | }; 62 | 63 | #endif /* nsUTF8Prober_h__ */ 64 | 65 | -------------------------------------------------------------------------------- /3rdparty/uchardet/nscore.h: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Mozilla Universal charset detector code. 15 | * 16 | * The Initial Developer of the Original Code is 17 | * Netscape Communications Corporation. 18 | * Portions created by the Initial Developer are Copyright (C) 2001 19 | * the Initial Developer. All Rights Reserved. 20 | * 21 | * Contributor(s): 22 | * Kohei TAKETA 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | #ifndef nsDummyCore_h__ 38 | #define nsDummyCore_h__ 39 | 40 | typedef bool PRBool; 41 | typedef int PRInt32; 42 | typedef unsigned int PRUint32; 43 | typedef short PRInt16; 44 | typedef unsigned short PRUint16; 45 | typedef signed char PRInt8; 46 | typedef unsigned char PRUint8; 47 | 48 | #define PR_FALSE false 49 | #define PR_TRUE true 50 | #define nsnull 0 51 | 52 | 53 | enum nsresult 54 | { 55 | NS_OK, 56 | NS_ERROR_OUT_OF_MEMORY 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /3rdparty/uchardet/prmem.h: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Mozilla Universal charset detector code. 15 | * 16 | * The Initial Developer of the Original Code is 17 | * Netscape Communications Corporation. 18 | * Portions created by the Initial Developer are Copyright (C) 2001 19 | * the Initial Developer. All Rights Reserved. 20 | * 21 | * Contributor(s): 22 | * Kohei TAKETA 23 | * 24 | * Alternatively, the contents of this file may be used under the terms of 25 | * either the GNU General Public License Version 2 or later (the "GPL"), or 26 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 27 | * in which case the provisions of the GPL or the LGPL are applicable instead 28 | * of those above. If you wish to allow use of your version of this file only 29 | * under the terms of either the GPL or the LGPL, and not to allow others to 30 | * use your version of this file under the terms of the MPL, indicate your 31 | * decision by deleting the provisions above and replace them with the notice 32 | * and other provisions required by the GPL or the LGPL. If you do not delete 33 | * the provisions above, a recipient may use your version of this file under 34 | * the terms of any one of the MPL, the GPL or the LGPL. 35 | * 36 | * ***** END LICENSE BLOCK ***** */ 37 | #ifndef nsDummyPrmem_h__ 38 | #define nsDummyPrmem_h__ 39 | 40 | #include 41 | 42 | inline void* PR_Malloc(size_t len) 43 | { 44 | return malloc(len); 45 | } 46 | 47 | #define PR_FREEIF(p) if (p) free(p) 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /3rdparty/uchardet/symbols.cmake: -------------------------------------------------------------------------------- 1 | set( 2 | UCHARDET_SYMBOLS 3 | uchardet_new 4 | uchardet_delete 5 | uchardet_handle_data 6 | uchardet_data_end 7 | uchardet_reset 8 | uchardet_get_charset 9 | ) 10 | 11 | set (LINK_FLAGS "") 12 | 13 | if (APPLE) 14 | 15 | # Create a symbols_list file for the darwin linker 16 | string(REPLACE ";" "\n_" _symbols "${UCHARDET_SYMBOLS}") 17 | set(_symbols_list "${CMAKE_CURRENT_BINARY_DIR}/symbols.list") 18 | file(WRITE ${_symbols_list} "_${_symbols}\n") 19 | set(LINK_FLAGS 20 | "${LINK_FLAGS} -Wl,-exported_symbols_list,'${_symbols_list}'") 21 | 22 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL GNU) 23 | # Create a version script for GNU ld. 24 | set(_symbols "{ global: ${UCHARDET_SYMBOLS}; local: *; };") 25 | set(_version_script "${CMAKE_CURRENT_BINARY_DIR}/version.script") 26 | file(WRITE ${_version_script} "${_symbols}\n") 27 | 28 | set(LINK_FLAGS "${LINK_FLAGS} -Wl,--version-script,'${_version_script}'") 29 | 30 | endif (APPLE) 31 | 32 | set_target_properties( 33 | ${UCHARDET_TARGET} 34 | PROPERTIES 35 | LINK_FLAGS 36 | "${LINK_FLAGS}" 37 | ) 38 | -------------------------------------------------------------------------------- /3rdparty/uchardet/uchardet.pro: -------------------------------------------------------------------------------- 1 | # This library is retrieved from https://github.com/BYVoid/uchardet 2 | # Licensed under LGPL license 3 | SOURCES += CharDistribution.cpp JpCntx.cpp LangModels/LangArabicModel.cpp LangModels/LangBulgarianModel.cpp LangModels/LangRussianModel.cpp \ 4 | LangModels/LangEsperantoModel.cpp LangModels/LangFrenchModel.cpp LangModels/LangGermanModel.cpp LangModels/LangGreekModel.cpp LangModels/LangHungarianModel.cpp \ 5 | LangModels/LangHebrewModel.cpp LangModels/LangSpanishModel.cpp LangModels/LangThaiModel.cpp LangModels/LangTurkishModel.cpp nsHebrewProber.cpp nsCharSetProber.cpp \ 6 | nsBig5Prober.cpp nsEUCJPProber.cpp nsEUCKRProber.cpp nsEUCTWProber.cpp nsEscCharsetProber.cpp nsEscSM.cpp nsGB2312Prober.cpp nsMBCSGroupProber.cpp nsMBCSSM.cpp \ 7 | nsSBCSGroupProber.cpp nsSBCharSetProber.cpp nsSJISProber.cpp nsUTF8Prober.cpp nsLatin1Prober.cpp nsUniversalDetector.cpp uchardet.cpp 8 | TARGET = uchardet 9 | CONFIG += warn_on qt staticlib 10 | TEMPLATE = lib 11 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | ## Player crashes when playing any audio or video file 2 | 3 | And typically gst-play-1.0 crashes too, and the backtrace shows the crash is somewhere in GStreamer, mentions libproxy.so.1 and is in libkdecore.so.5 4 | 5 | This means your system has installed libproxy both from KDE4 and KDE5. GStreamer loads libproxy by name, and the first libproxy loaded is from KDE4, while your system is running KDE5. The KDE4 libproxy loads the libkdecore from KDE5 and crashes. 6 | 7 | To solve this, uninstall the libproxy for KDE4, such as libproxy-config-kde4 package. 8 | 9 | ## Player does not play some music or video files, notably MP3 10 | 11 | ### You're using Linux 12 | 13 | On Linux Spivak uses the GStreamer packaged with your operating system. So the files not being played means your GStreamer installation is crippled, and the components necessary for playing those files are removed for patent or other purposes. This is a typical case with OpenSuSE. 14 | 15 | This is typically corrected through adding additional package repositories and reinstalling or upgrading GStreamer and/or dependent libraries. Please see the community forums for your Linux installation which you can easily find by searching for *your-distribution-name mp3". For OpenSuSE please see http://opensuse-community.org/ 16 | 17 | Once you update your GStreamer installation, please do not forget to clean the GStreamer cache by removing the ~/.cache/gstreamer* directory before you try again. 18 | 19 | Please also try to play the target file with gst-play-1.0 tool which is part of GStreamer package. If this tool does not play your file, Spivak will not play it too. 20 | 21 | ### You are using Windows or Mac OS X 22 | 23 | On those platforms the player uses pre-packaged GStreamer with the limited set of libraries to lower the overall installation size. You can add support for more formats by installing the regular GStreamer package for your operating system. Please download them from https://gstreamer.freedesktop.org/download/ 24 | 25 | 26 | ## Background video does not play right 27 | 28 | If background video (and foreground video for Karaoke video files) plays too fast or too slow, this might be caused by an issue in an older GStreamer VAAPI. Please try to uninstall the VAAPI drivers or gstreamer-plugins-vaapi package and try again. 29 | 30 | -------------------------------------------------------------------------------- /build-rpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RPMBUILDROOT="${PWD}/rpmbuild" 4 | 5 | FILE_VERSION="src/version.h" 6 | 7 | # Get current version 8 | VERSION_MAJOR=`sed -n 's/^\#define\s\+APP_VERSION_MAJOR\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` 9 | VERSION_MINOR=`sed -n 's/^\#define\s\+APP_VERSION_MINOR\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` 10 | VERSION="$VERSION_MAJOR.$VERSION_MINOR" 11 | 12 | for d in BUILD BUILDROOT RPMS SOURCES SPECS SRPMS; do 13 | mkdir -p $RPMBUILDROOT/$d || exit 1 14 | done 15 | 16 | # export the source into SOURCES 17 | mkdir $RPMBUILDROOT/SOURCES/spivak-$VERSION || exit 1 18 | git archive master | tar -x -C $RPMBUILDROOT/SOURCES/spivak-$VERSION 19 | (cd $RPMBUILDROOT/SOURCES && tar zcf spivak-$VERSION.tar.gz spivak-$VERSION) 20 | rm -rf $RPMBUILDROOT/SOURCES/spivak-$VERSION 21 | 22 | rpmbuild --define "_topdir $RPMBUILDROOT" -bb packaging/spivak.spec 23 | -------------------------------------------------------------------------------- /build_appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Exit on error 4 | set -e 5 | 6 | FILE_VERSION="spivak/src/version.h" 7 | 8 | # Checkout the player if we don't have it here 9 | if [ ! -f "spivak.pro" ]; then 10 | [ -d spivak ] && rm -rf spivak 11 | git clone --depth 1 https://github.com/gyunaev/spivak.git 12 | cd spivak 13 | fi 14 | 15 | source /opt/qt55/bin/qt55-env.sh || true 16 | 17 | qmake -r "CONGIF+=release" 18 | make 19 | cd .. 20 | 21 | # Get current version 22 | VERSION_MAJOR=`sed -n 's/^\#define\s\+APP_VERSION_MAJOR\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` 23 | VERSION_MINOR=`sed -n 's/^\#define\s\+APP_VERSION_MINOR\s\+\([0-9]\+\)/\1/p' $FILE_VERSION` 24 | CURRENTVER="$VERSION_MAJOR.$VERSION_MINOR" 25 | 26 | # Create the AppImage 27 | APPDIR="spivak.AppDir" 28 | 29 | [ -d $APPDIR ] && rm -rf "$APPDIR" 30 | mkdir "$APPDIR" 31 | cd "$APPDIR" 32 | 33 | mkdir -p usr/lib64/spivak/plugins usr/bin usr/lib 34 | 35 | # Copy the Spivak executable and plugins there 36 | strip --strip-all "../spivak/src/spivak" -o "usr/bin/spivak" 37 | 38 | # Copy the application icon and desktop file into current dir (appimage expects them here) 39 | cp ../spivak/packaging/spivak.desktop . 40 | cp ../spivak/packaging/icon.png spivak.png 41 | 42 | # Copy prebuilt libcld2 43 | cp -a /usr/lib64/libcld2.so* usr/lib/ 44 | 45 | # Unset this as it breaks linuxdeployqt 46 | unset LD_LIBRARY_PATH 47 | 48 | 49 | # 50 | # Currently we only build AppImage without GStreamer plugins 51 | # 52 | 53 | # Copy the other libraries 54 | ~/tools/linuxdeployqt-continuous-x86_64.AppImage ../spivak.AppDir/spivak.desktop -bundle-non-qt-libs 55 | 56 | # Remove unused files 57 | rm -rf usr/share/doc 58 | rm usr/lib/libgmodule-2.0.so.0 59 | rm usr/lib/libgstapp-1.0.so.0 60 | rm usr/lib/libgstbase-1.0.so.0 61 | rm usr/lib/libgstreamer-1.0.so.0 62 | 63 | # Create appimage 64 | (~/tools/appimagetool-x86_64.AppImage . ../Spivak-Host-GStreamer-x86_64.AppImage) 65 | -------------------------------------------------------------------------------- /libkaraokelyrics/libkaraokelyrics.pro: -------------------------------------------------------------------------------- 1 | HEADERS += \ 2 | lyricsparser_kfn.h \ 3 | lyricsparser_lrc.h \ 4 | lyricsparser_midi.h \ 5 | lyricsloader.h \ 6 | lyricsparser.h \ 7 | lyricsparser_texts.h \ 8 | lyricsparser_kok.h \ 9 | lyricsparser_lyric.h 10 | SOURCES += \ 11 | lyricsparser_kfn.cpp \ 12 | lyricsparser_lrc.cpp \ 13 | lyricsparser_midi.cpp \ 14 | lyricsloader.cpp \ 15 | lyricsparser.cpp \ 16 | lyricsparser_texts.cpp \ 17 | lyricsparser_kok.cpp \ 18 | lyricsparser_lyric.cpp 19 | TARGET = karaokelyrics 20 | CONFIG += warn_on qt staticlib 21 | TEMPLATE = lib 22 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_kfn.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_KFN_H 20 | #define LYRICSPARSER_KFN_H 21 | 22 | #include "lyricsparser.h" 23 | 24 | // For KaraFun this class parses the song.ini file 25 | class LyricsParser_KFN : public LyricsParser 26 | { 27 | public: 28 | LyricsParser_KFN( LyricsLoaderCallback *callback ); 29 | 30 | // Parses the lyrics, filling up the output container. Throws an error 31 | // if there are any issues during parsing, otherwise fills up output. 32 | void parse(QIODevice * file, LyricsLoader::Container &output, LyricsLoader::Properties& properties ); 33 | }; 34 | 35 | #endif // LYRICSPARSER_KFN_H 36 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_kok.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "lyricsparser_kok.h" 20 | 21 | LyricsParser_KOK::LyricsParser_KOK(LyricsLoaderCallback *callback ) 22 | : LyricsParser( callback ) 23 | { 24 | } 25 | 26 | void LyricsParser_KOK::parse(QIODevice *file, LyricsLoader::Container &output, LyricsLoader::Properties &properties) 27 | { 28 | QByteArray data = load( file ); 29 | 30 | // This format has no special markers, so we can feed it as-is - just replace the marks (this is why we copied it) 31 | QByteArray encdetectdata = data; 32 | 33 | auto codec = std::make_unique( detectEncoding( encdetectdata.replace( ';', ' ' ), properties ) ); 34 | 35 | // J'ai ;7,9050634;tra;8,0651993;vail;8,2144914;lé;8,3789922; 36 | Q_FOREACH ( QString line, QString( (*codec)->decode( data ) ).split( '\n' ) ) 37 | { 38 | if ( line.isEmpty() ) 39 | continue; 40 | 41 | QStringList entries = line.split( ";" ); 42 | 43 | // Must be even 44 | if ( (entries.size() % 2) != 0 ) 45 | throw("Invalid number of entries"); 46 | 47 | for ( int i = 0; i < entries.size() / 2; i++ ) 48 | { 49 | QString text = entries[2 * i]; 50 | QString timing = entries[2 * i + 1].replace( ",", "." ); 51 | 52 | int timevalue = (int) ( timing.toFloat() * 1000 ); 53 | if ( i == entries.size() / 2 - 1 ) 54 | text.append( '\n' ); 55 | 56 | output.push_back( Lyric( timevalue, text ) ); 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_kok.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_KOK_H 20 | #define LYRICSPARSER_KOK_H 21 | 22 | #include "lyricsparser.h" 23 | 24 | class LyricsParser_KOK : public LyricsParser 25 | { 26 | public: 27 | LyricsParser_KOK( LyricsLoaderCallback *callback ); 28 | 29 | // Parses the lyrics, filling up the output container. Throws an error 30 | // if there are any issues during parsing, otherwise fills up output. 31 | void parse( QIODevice * file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 32 | }; 33 | 34 | #endif // LYRICSPARSER_KOK_H 35 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_lrc.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_LRC_H 20 | #define LYRICSPARSER_LRC_H 21 | 22 | #include "lyricsparser.h" 23 | 24 | class LyricsParser_LRC : public LyricsParser 25 | { 26 | public: 27 | LyricsParser_LRC( LyricsLoaderCallback *callback ); 28 | 29 | // Parses the lyrics, filling up the output container. Throws an error 30 | // if there are any issues during parsing, otherwise fills up output. 31 | void parse( QIODevice * file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 32 | 33 | private: 34 | int offset; 35 | 36 | private: 37 | qint64 parseLRCTime( const QString& str ); 38 | }; 39 | 40 | #endif // LYRICSPARSER_LRC_H 41 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_lyric.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_LYRIC_H 20 | #define LYRICSPARSER_LYRIC_H 21 | 22 | #include "lyricsparser.h" 23 | 24 | // 25 | // Parser for Encore! Lyric format. 26 | // 27 | // Dedicated to Encore karaoke player author Igor Marinin, who has managed 28 | // to rip off every single Karaoke fun I know. 29 | // 30 | class LyricsParser_Lyric : public LyricsParser 31 | { 32 | public: 33 | LyricsParser_Lyric( LyricsLoaderCallback *callback ); 34 | 35 | // Parses the lyrics, filling up the output container. Throws an error 36 | // if there are any issues during parsing, otherwise fills up output. 37 | void parse( QIODevice * file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 38 | }; 39 | 40 | #endif // LYRICSPARSER_LYRIC_H 41 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_midi.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_MIDI_H 20 | #define LYRICSPARSER_MIDI_H 21 | 22 | #include "lyricsparser.h" 23 | 24 | class LyricsParser_MIDI : public LyricsParser 25 | { 26 | public: 27 | LyricsParser_MIDI( LyricsLoaderCallback *callback ); 28 | 29 | // Parses the lyrics, filling up the output container. Throws an error 30 | // if there are any issues during parsing, otherwise fills up output. 31 | void parse( QIODevice * file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 32 | 33 | private: 34 | // Byteorder-safe readers 35 | unsigned char readByte(); 36 | unsigned short readWord(); 37 | unsigned int readDword(); 38 | int readVarLen(); 39 | void readData( void * buf, unsigned int length ); 40 | 41 | unsigned int currentPos() const; 42 | void setPos( unsigned int offset ); 43 | 44 | QByteArray m_mididata; 45 | int m_currentOffset; 46 | }; 47 | 48 | #endif // LYRICSPARSER_MIDI_H 49 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_powerkaraoke.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRICSPARSER_POWERKARAOKE_H 2 | #define LYRICSPARSER_POWERKARAOKE_H 3 | 4 | #include "lyricsparser.h" 5 | 6 | class LyricsParser_PowerKaraoke : public LyricsParser 7 | { 8 | public: 9 | LyricsParser_PowerKaraoke(); 10 | 11 | // Parses the lyrics, filling up the output container. Throws an error 12 | // if there are any issues during parsing, otherwise fills up output. 13 | void parse(QIODevice *file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 14 | }; 15 | 16 | #endif // LYRICSPARSER_POWERKARAOKE_H 17 | -------------------------------------------------------------------------------- /libkaraokelyrics/lyricsparser_texts.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LYRICSPARSER_ULTRASTAR_H 20 | #define LYRICSPARSER_ULTRASTAR_H 21 | 22 | #include 23 | #include "lyricsparser.h" 24 | 25 | // This class parses both Ultrastar and PowerKaraoke lyrics 26 | class LyricsParser_Texts : public LyricsParser 27 | { 28 | public: 29 | LyricsParser_Texts( LyricsLoaderCallback *callback ); 30 | 31 | // Parses the lyrics, filling up the output container. Throws an error 32 | // if there are any issues during parsing, otherwise fills up output. 33 | void parse( QIODevice * file, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 34 | 35 | static bool isUltrastarLyrics( QIODevice * file, QString * mp3file ); 36 | 37 | private: 38 | void parseUStar( const QByteArray& text, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 39 | void parsePowerKaraoke( const QByteArray& text, LyricsLoader::Container& output, LyricsLoader::Properties& properties ); 40 | }; 41 | 42 | #endif // LYRICSPARSER_ULTRASTAR_H 43 | -------------------------------------------------------------------------------- /packaging/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/packaging/screenshot1.png -------------------------------------------------------------------------------- /packaging/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/packaging/screenshot2.png -------------------------------------------------------------------------------- /packaging/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/packaging/screenshot3.png -------------------------------------------------------------------------------- /packaging/spivak.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Spivak 3 | Categories=Qt;AudioVideo; 4 | Terminal=false 5 | Type=Application 6 | Exec=spivak 7 | Icon=spivak 8 | GenericName=Spivak Karaoke Player 9 | Comment=Portable free Karaoke Player 10 | MimeType=application/x-kfn; 11 | -------------------------------------------------------------------------------- /packaging/spivak.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | Windows Forms Common Control manifest 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packaging/spivak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/packaging/spivak.png -------------------------------------------------------------------------------- /packaging/spivak.spec: -------------------------------------------------------------------------------- 1 | Summary: Free and feature-rich Karaoke player 2 | Name: spivak 3 | Version: 2.0 4 | Release: 5 5 | License: GPLv3+ 6 | Group: Applications/Multimedia 7 | Packager: gyunaev@ulduzsoft.com 8 | URL: http://www.ulduzsoft.com/spivak 9 | Source0: %{name}-%{version}.tar.gz 10 | 11 | Requires: libzip 12 | Requires: qt6-gui 13 | Requires: qt6-core 14 | Requires: qt6-imageformat 15 | Requires: qt6-widgets 16 | Requires: qt6-base-common 17 | Requires: qt6-concurrent 18 | Requires: qt6-network 19 | Requires: qt6-base 20 | Requires: gstreamer-1.0 21 | Requires: gstreamer-app-1.0 22 | 23 | BuildRequires: pkgconfig 24 | BuildRequires: pkgconfig(gstreamer-1.0) 25 | BuildRequires: pkgconfig(gstreamer-app-1.0) 26 | 27 | BuildRequires: qt6-tools-linguist 28 | BuildRequires: qt6-gui-devel 29 | BuildRequires: qt6-core-devel 30 | BuildRequires: qt6-widgets-devel 31 | BuildRequires: qt6-base-common-devel 32 | BuildRequires: qt6-tools-linguist 33 | BuildRequires: qt6-concurrent-devel 34 | BuildRequires: qt6-network-devel 35 | BuildRequires: qt6-base-devel 36 | BuildRequires: libzip-devel 37 | 38 | %description 39 | Spivak is a free, cross-platform (Linux/Windows/OS X) Karaoke player 40 | based on GStreamer and Qt5. It supports a wide range of Karaoke formats, 41 | with the goal of playing all more or less widespread Karaoke formats on 42 | all popular platforms. It also has strong support for foreign languages, 43 | so playing Karaoke in Japanese, Russian or Hindu is fully supported. 44 | 45 | Author: 46 | ------- 47 | George Yunaev 48 | 49 | 50 | %files 51 | %defattr(-,root,root) 52 | /usr/bin/spivak 53 | %defattr(-,root,root) 54 | %{_datadir}/applications/spivak.desktop 55 | %defattr(-,root,root) 56 | %dir %{_datadir}/icons/hicolor/ 57 | %dir %{_datadir}/icons/hicolor/64x64/ 58 | %dir %{_datadir}/icons/hicolor/64x64/apps/ 59 | %{_datadir}/icons/hicolor/64x64/apps/spivak.png 60 | 61 | %prep 62 | %setup 63 | 64 | %build 65 | qmake6 66 | %make_build 67 | 68 | 69 | %install 70 | make install INSTALL_ROOT="%buildroot" 71 | -------------------------------------------------------------------------------- /spivak.pro: -------------------------------------------------------------------------------- 1 | !greaterThan(QT_MAJOR_VERSION, 4) { 2 | error(Spivak will not build with Qt4) 3 | } 4 | !greaterThan(QT_MAJOR_VERSION, 5) { 5 | warning(Spivak generally requires Qt6 but Qt $$[QT_VERSION] was detected. Your build may fail. Make sure you invoke proper qmake i.e. qmake6 instead of qmake) 6 | } 7 | 8 | SUBDIRS += 3rdparty libkaraokelyrics src 9 | TEMPLATE = subdirs 10 | libkaraokelyrics.depends = 3rdparty 11 | src.depends = libkaraokelyrics 12 | TRANSLATIONS = i18n/spivak_en_US.ts i18n/spivak_sk.ts 13 | 14 | INSTALLS += desktopfile icon 15 | 16 | icon.path = /$(DESTDIR)/usr/share/icons/hicolor/64x64/apps 17 | icon.files = packaging/spivak.png 18 | 19 | desktopfile.path = /$(DESTDIR)/usr/share/applications 20 | desktopfile.files = packaging/spivak.desktop 21 | -------------------------------------------------------------------------------- /src/actionhandler_lirc.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef EVENTCONTROLLER_LIRC_H 20 | #define EVENTCONTROLLER_LIRC_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "actionhandler.h" 28 | 29 | class ActionHandler_LIRC : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit ActionHandler_LIRC(QObject *parent = 0); 35 | 36 | signals: 37 | void lircEvent( int event ); 38 | 39 | private slots: 40 | void connected(); 41 | void disconnected(); 42 | void error(QLocalSocket::LocalSocketError); 43 | void readyRead(); 44 | 45 | private: 46 | void readMap(); 47 | void lircConnect(); 48 | 49 | #ifdef Q_OS_WIN 50 | QTcpSocket m_socket; 51 | #else 52 | QLocalSocket m_socket; 53 | #endif 54 | 55 | // Buffers the partially-read data 56 | QByteArray m_buffer; 57 | 58 | // Translation map 59 | QMap< QByteArray, int > m_eventMap; 60 | }; 61 | 62 | #endif // EVENTCONTROLLER_LIRC_H 63 | -------------------------------------------------------------------------------- /src/actionhandler_webserver.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef WEBSERVER_H 20 | #define WEBSERVER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "songqueue.h" 27 | 28 | class QTcpServer; 29 | class QNetworkSession; 30 | 31 | 32 | // A built-in web server running in a dedicated thread (so it doesn't block our main thread) 33 | class ActionHandler_WebServer : public QThread 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | ActionHandler_WebServer( QObject * parent ); 39 | 40 | QString webURL() const; 41 | 42 | private slots: 43 | void dnsLookupFinished(QHostInfo hinfo); 44 | void newHTTPconnection(); 45 | void sessionOpened(); 46 | void karaokeStarted(SongQueueItem song ); 47 | 48 | private: 49 | void run(); 50 | 51 | unsigned short m_listenPort; 52 | 53 | QNetworkSession * m_networkSession; 54 | QTcpServer * m_httpServer; 55 | SongQueueItem m_currentSong; 56 | }; 57 | 58 | #endif // WEBSERVER_H 59 | -------------------------------------------------------------------------------- /src/background.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "settings.h" 20 | #include "background.h" 21 | #include "backgroundcolor.h" 22 | #include "backgroundvideo.h" 23 | #include "backgroundimage.h" 24 | 25 | 26 | Background::Background() 27 | { 28 | } 29 | 30 | Background::~Background() 31 | { 32 | } 33 | 34 | void Background::start() 35 | { 36 | } 37 | 38 | void Background::pause(bool ) 39 | { 40 | } 41 | 42 | void Background::stop() 43 | { 44 | } 45 | 46 | 47 | Background * Background::create() 48 | { 49 | switch ( pSettings->playerBackgroundType ) 50 | { 51 | case Settings::BACKGROUND_TYPE_NONE: 52 | return new BackgroundNone(); 53 | 54 | case Settings::BACKGROUND_TYPE_IMAGE: 55 | return new BackgroundImage(); 56 | 57 | case Settings::BACKGROUND_TYPE_VIDEO: 58 | return new BackgroundVideo(); 59 | 60 | case Settings::BACKGROUND_TYPE_COLOR: 61 | return new BackgroundColor(); 62 | } 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /src/background/image1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/background/image1.jpeg -------------------------------------------------------------------------------- /src/background/image2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/background/image2.jpeg -------------------------------------------------------------------------------- /src/background/image3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/background/image3.jpeg -------------------------------------------------------------------------------- /src/background/image4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/background/image4.jpeg -------------------------------------------------------------------------------- /src/background/image5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/background/image5.jpeg -------------------------------------------------------------------------------- /src/backgroundcolor.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "backgroundcolor.h" 20 | #include "settings.h" 21 | #include "karaokepainter.h" 22 | 23 | BackgroundColor::BackgroundColor() 24 | : Background() 25 | { 26 | } 27 | 28 | bool BackgroundColor::initFromSettings() 29 | { 30 | m_color = pSettings->playerBackgroundColor; 31 | return m_color.isValid(); 32 | } 33 | 34 | bool BackgroundColor::initFromFile(QIODevice *, const QString &) 35 | { 36 | // Unused in real apps 37 | return false; 38 | } 39 | 40 | qint64 BackgroundColor::draw(KaraokePainter &p) 41 | { 42 | p.fillRect( p.rect(), m_color ); 43 | return -1; 44 | } 45 | -------------------------------------------------------------------------------- /src/backgroundcolor.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef BACKGROUNDCOLOR_H 20 | #define BACKGROUNDCOLOR_H 21 | 22 | #include 23 | 24 | #include "background.h" 25 | 26 | class BackgroundColor : public Background 27 | { 28 | public: 29 | BackgroundColor(); 30 | 31 | // Background could be initialized either from the settings (by callign initFromSettings() or from 32 | // a specific file/QIODevice - for example for KFN files (the file name needs to be passed to know which type 33 | // of file is being loaded). If the background cannot be initialized, it must return an error. 34 | virtual bool initFromSettings(); 35 | virtual bool initFromFile( QIODevice * file, const QString& filename ); 36 | 37 | // Draws the background on the image; the prior content of the image is undefined. If false is returned, 38 | // it is considered an error, and the whole playing process is aborted - use wisely 39 | qint64 draw( KaraokePainter& p ); 40 | 41 | private: 42 | QColor m_color; 43 | }; 44 | 45 | #endif // PLAYERBACKGROUNDCOLOR_H 46 | -------------------------------------------------------------------------------- /src/backgroundvideo.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef BACKGROUNDVIDEO_H 20 | #define BACKGROUNDVIDEO_H 21 | 22 | #include "mediaplayer.h" 23 | #include "background.h" 24 | 25 | 26 | class BackgroundVideo : public QObject, public Background 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | BackgroundVideo(); 32 | virtual ~BackgroundVideo(); 33 | 34 | // Background could be initialized either from the settings (by callign initFromSettings() or from 35 | // a specific file/QIODevice - for example for KFN files (the file name needs to be passed to know which type 36 | // of file is being loaded). If the background cannot be initialized, it must return an error. 37 | virtual bool initFromSettings(); 38 | virtual bool initFromFile( QIODevice * file, const QString& filename ); 39 | 40 | // Draws the background on the image; the prior content of the image is undefined. If false is returned, 41 | // it is considered an error, and the whole playing process is aborted - use wisely 42 | virtual qint64 draw( KaraokePainter& p ); 43 | 44 | // Current state notifications, may be reimplemented. Default implementation does nothing. 45 | virtual void start(); 46 | virtual void pause( bool pausing ); 47 | virtual void stop(); 48 | 49 | private slots: 50 | void finished(); 51 | void errorplaying(); 52 | 53 | private: 54 | MediaPlayer * m_player; 55 | }; 56 | 57 | #endif // BACKGROUNDVIDEO_H 58 | -------------------------------------------------------------------------------- /src/collectionentry.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "collectionentry.h" 4 | 5 | CollectionEntry::CollectionEntry() 6 | { 7 | id = 0; 8 | priority = 0; 9 | type = CollectionProvider::TYPE_FILESYSTEM; 10 | detectLanguage = false; 11 | scanZips = false; 12 | lastScanned = -1; 13 | ignoreSSLerrors = false; 14 | } 15 | 16 | QJsonObject CollectionEntry::toJson() const 17 | { 18 | QJsonObject out; 19 | 20 | out[ "id" ] = id; 21 | out[ "priority" ] = priority; 22 | out[ "type" ] = type == CollectionProvider::TYPE_FILESYSTEM ? "fs" : "http"; 23 | out[ "root" ] = rootPath; 24 | out[ "name" ] = name; 25 | 26 | if ( !authuser.isEmpty() && !authpass.isEmpty() ) 27 | { 28 | out[ "authuser" ] = authuser; 29 | out[ "authpass" ] = authpass; 30 | } 31 | 32 | 33 | out[ "ignoreSSLerrors" ] = ignoreSSLerrors; 34 | out[ "detectLanguage" ] = detectLanguage; 35 | out[ "scanZips" ] = scanZips; 36 | out[ "artistTitleSeparator" ] = artistTitleSeparator; 37 | 38 | if ( !defaultLanguage.isEmpty() ) 39 | out[ "defaultLanguage" ] = defaultLanguage; 40 | 41 | if ( lastScanned != -1 ) 42 | out[ "lastScanned" ] = QString::number( (long long) lastScanned ); 43 | 44 | return out; 45 | } 46 | 47 | void CollectionEntry::fromJson(const QJsonObject &data) 48 | { 49 | id = data.value( "id" ).toInt( 0 ); 50 | name = data.value( "name" ).toString(); 51 | priority = data.value( "priority" ).toInt( 0 ); 52 | type = data.value( "type" ).toString( "fs" ) == "fs" ? CollectionProvider::TYPE_FILESYSTEM : CollectionProvider::TYPE_HTTP; 53 | rootPath = data.value( "root" ).toString(); 54 | authuser = data.value( "authuser" ).toString(); 55 | authpass = data.value( "authpass" ).toString(); 56 | detectLanguage = data.value( "detectLanguage" ).toBool( false ); 57 | scanZips = data.value( "scanZips" ).toBool( false ); 58 | artistTitleSeparator = data.value( "artistTitleSeparator" ).toString(); 59 | defaultLanguage = data.value( "defaultLanguage" ).toString(); 60 | lastScanned = data.value( "lastScanned" ).toString("-1").toLongLong(); 61 | ignoreSSLerrors = data.value( "ignoreSSLerrors" ).toBool( false ); 62 | } 63 | -------------------------------------------------------------------------------- /src/collectionentry.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONENTRY_H 2 | #define COLLECTIONENTRY_H 3 | 4 | #include 5 | #include "collectionprovider.h" 6 | 7 | class CollectionEntry 8 | { 9 | public: 10 | CollectionEntry(); 11 | 12 | // Collection ID. Fixed. Data in sqlite (songs.collectionid value) 13 | int id; 14 | 15 | // Collection priority index (how early should it be used). 0 - earliest 16 | int priority; 17 | 18 | // Collection type 19 | CollectionProvider::Type type; 20 | 21 | // Collection human-readable name 22 | QString name; 23 | 24 | // Collection root (either path to the directory or root URL) 25 | QString rootPath; 26 | 27 | // Authentication information (if needed) 28 | QString authuser; 29 | QString authpass; 30 | 31 | // For HTTP collection, whether to ignore SSL errors 32 | bool ignoreSSLerrors; 33 | 34 | // Detect lyrics language (if false, language is not detected) 35 | bool detectLanguage; 36 | 37 | // Default language (if detection fails or is impossible such as for CD+G or video files) 38 | // If empty, no language is set 39 | QString defaultLanguage; 40 | 41 | // If true, ZIP archives are considered to be Karaoke files and would be scanned. 42 | // Otherwise they would be ignored. 43 | bool scanZips; 44 | 45 | // Collection artist and title separator (to detect artist/title from filenames) 46 | QString artistTitleSeparator; 47 | 48 | // Last time full scan was performed on this collection. -1 - never 49 | time_t lastScanned; 50 | 51 | public: 52 | // Convert this collection to/from JSON 53 | QJsonObject toJson() const; 54 | void fromJson( const QJsonObject & json ); 55 | }; 56 | 57 | #endif // COLLECTIONENTRY_H 58 | -------------------------------------------------------------------------------- /src/collectionprovider.cpp: -------------------------------------------------------------------------------- 1 | #include "settings.h" 2 | #include "collectionprovider.h" 3 | #include "collectionproviderfs.h" 4 | #include "collectionproviderhttp.h" 5 | 6 | CollectionProvider::CollectionProvider(int id, QObject *parent) 7 | : QObject( parent ) 8 | { 9 | collectionID = id; 10 | } 11 | 12 | CollectionProvider::~CollectionProvider() 13 | { 14 | } 15 | 16 | CollectionProvider *CollectionProvider::createProviderForType(CollectionProvider::Type type, QObject *parent) 17 | { 18 | switch ( type ) 19 | { 20 | case TYPE_FILESYSTEM: 21 | return new CollectionProviderFS( -1, parent ); 22 | 23 | case TYPE_HTTP: 24 | return new CollectionProviderHTTP( -1, parent ); 25 | 26 | default: 27 | return 0; 28 | } 29 | } 30 | 31 | CollectionProvider *CollectionProvider::createProviderForID(int id, QObject *parent) 32 | { 33 | if ( !pSettings->collections.contains(id) ) 34 | return 0; 35 | 36 | switch ( pSettings->collections[id].type ) 37 | { 38 | case TYPE_FILESYSTEM: 39 | return new CollectionProviderFS( id, parent ); 40 | 41 | case TYPE_HTTP: 42 | return new CollectionProviderHTTP( id, parent ); 43 | 44 | default: 45 | return 0; 46 | } 47 | 48 | } 49 | 50 | void CollectionProvider::download(int id, const QString &url, QIODevice *local) 51 | { 52 | QList urls; 53 | QList files; 54 | 55 | urls << url; 56 | files << local; 57 | 58 | retrieveMultiple( id, urls, files ); 59 | } 60 | 61 | void CollectionProvider::downloadAll(int id, const QList &urls, QList locals) 62 | { 63 | retrieveMultiple( id, urls, locals ); 64 | } 65 | -------------------------------------------------------------------------------- /src/collectionproviderfs.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "collectionproviderfs.h" 4 | 5 | CollectionProviderFS::CollectionProviderFS(int id, QObject *parent) 6 | : CollectionProvider(id, parent) 7 | { 8 | } 9 | 10 | bool CollectionProviderFS::isLocalProvider() const 11 | { 12 | return true; 13 | } 14 | 15 | CollectionProvider::Type CollectionProviderFS::type() const 16 | { 17 | return TYPE_FILESYSTEM; 18 | } 19 | 20 | void CollectionProviderFS::retrieveMultiple(int id, const QList &urls, QList files) 21 | { 22 | // This would definitely be invalid usage 23 | if ( files.size() != urls.size() ) 24 | abort(); 25 | 26 | for ( int i = 0; i < urls.size(); i++ ) 27 | { 28 | QFile f( urls[i] ); 29 | 30 | if ( !f.open( QIODevice::ReadOnly) ) 31 | { 32 | emit finished( id, f.errorString() ); 33 | return; 34 | } 35 | 36 | // Not the best way for RAM usage, but we're dealing with small files here 37 | if ( files[i]->write( f.readAll() ) == -1 ) 38 | { 39 | emit finished( id, files[i]->errorString() ); 40 | return; 41 | } 42 | 43 | files[i]->close(); 44 | } 45 | 46 | emit finished( id, QString() ); 47 | } 48 | -------------------------------------------------------------------------------- /src/collectionproviderfs.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONPROVIDERFS_H 2 | #define COLLECTIONPROVIDERFS_H 3 | 4 | #include "collectionprovider.h" 5 | 6 | // This provider implements basic file system access 7 | class CollectionProviderFS : public CollectionProvider 8 | { 9 | public: 10 | CollectionProviderFS( int id, QObject * parent ); 11 | 12 | // Returns true if this provider is based on file system, and the file operations 13 | // are supported directly. 14 | virtual bool isLocalProvider() const; 15 | 16 | // Returns the provider type 17 | virtual Type type() const; 18 | 19 | protected: 20 | // Implemented in subclasses. Should download one or more files syncrhonously, 21 | // and return when everything is downloaded. With non-zero ID should also 22 | // call progress and finished callbacks (no callbacks with zero ID) 23 | virtual void retrieveMultiple( int id, const QList& urls, QList files ); 24 | }; 25 | 26 | #endif // COLLECTIONPROVIDERFS_H 27 | -------------------------------------------------------------------------------- /src/collectionproviderhttp.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONPROVIDERHTTP_H 2 | #define COLLECTIONPROVIDERHTTP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "collectionprovider.h" 12 | 13 | class CollectionProviderHTTP : public CollectionProvider 14 | { 15 | //Q_OBJECT 16 | 17 | public: 18 | CollectionProviderHTTP(int id, QObject * parent); 19 | 20 | // Returns true if this provider is based on file system, and the file operations 21 | // are supported directly. 22 | virtual bool isLocalProvider() const; 23 | 24 | // Returns the provider type 25 | virtual Type type() const; 26 | 27 | protected: 28 | // Implemented in subclasses. Should download one or more files syncrhonously, 29 | // and return when everything is downloaded. With non-zero ID should also 30 | // call progress and finished callbacks (no callbacks with zero ID) 31 | virtual void retrieveMultiple( int id, const QList& urls, QList files ); 32 | 33 | private slots: 34 | void httpFinished(); 35 | void httpReadyRead(); 36 | void httpProgress( qint64 bytesReceived, qint64 bytesTotal ); 37 | void httpAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); 38 | void httpsslErrors(QNetworkReply *reply, const QList &errors); 39 | 40 | private: 41 | void cleanup(); 42 | 43 | class RequestData 44 | { 45 | public: 46 | QNetworkReply * reply; 47 | QIODevice * file; 48 | QString url; 49 | qint64 bytesReceived; 50 | qint64 bytesTotal; 51 | bool finished; 52 | }; 53 | 54 | int m_id; 55 | QNetworkAccessManager m_qnam; 56 | QMap< QNetworkReply *, RequestData > m_state; 57 | bool m_credentialsSent; 58 | }; 59 | 60 | #endif // COLLECTIONPROVIDERHTTP_H 61 | -------------------------------------------------------------------------------- /src/colorbutton.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef COLORBUTTON_H 20 | #define COLORBUTTON_H 21 | 22 | #include 23 | 24 | // A button which changes its background to currently selected color, 25 | // and lets the user to select a color on click. 26 | class ColorButton : public QPushButton 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | ColorButton( QWidget * parent ); 32 | 33 | void setColor( const QColor& color ); 34 | void allowSetAlpha( bool allow ); 35 | QColor color() const; 36 | 37 | protected: 38 | void paintEvent( QPaintEvent * event ); 39 | 40 | private slots: 41 | void btnClicked(); 42 | 43 | private: 44 | QColor m_selectedColor; 45 | bool m_allowSetAlpha; 46 | }; 47 | 48 | #endif // COLORBUTTON_H 49 | -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | // the configured options and settings for vanka 2 | #define VERSION_MAJOR @VERSION_MAJOR@ 3 | #define VERSION_MINOR @VERSION_MINOR@ 4 | -------------------------------------------------------------------------------- /src/database_songinfo.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "database_songinfo.h" 20 | 21 | Database_SongInfo::Database_SongInfo() 22 | { 23 | id = 0; 24 | playedTimes = 0; 25 | lastPlayed = 0; 26 | lyricDelay = 0; 27 | added = 0; 28 | rating = 0; 29 | collectionid = 0; 30 | flags = 0; 31 | } 32 | -------------------------------------------------------------------------------- /src/database_songinfo.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef DATABASE_SONGINFO_H 20 | #define DATABASE_SONGINFO_H 21 | 22 | #include 23 | 24 | class Database_SongInfo 25 | { 26 | public: 27 | Database_SongInfo(); 28 | 29 | int id; 30 | int collectionid; 31 | qint32 flags; 32 | QString artist; 33 | QString title; 34 | QString filePath; 35 | QString type; 36 | int playedTimes; 37 | time_t lastPlayed; 38 | int lyricDelay; 39 | time_t added; 40 | int rating; 41 | QString language; 42 | QString password; 43 | }; 44 | 45 | #endif // DATABASE_SONGINFO_H 46 | -------------------------------------------------------------------------------- /src/database_statement.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef DATABASE_STATEMENT_H 20 | #define DATABASE_STATEMENT_H 21 | 22 | #include 23 | #include 24 | 25 | #include "database_songinfo.h" 26 | 27 | struct sqlite3; 28 | struct sqlite3_stmt; 29 | 30 | // A SQLite statement wrapper ensuring finalize() is called at the end, and parsing important fields 31 | class Database_Statement 32 | { 33 | public: 34 | Database_Statement(); 35 | ~Database_Statement(); 36 | 37 | bool prepare( sqlite3 * db, const QString& sql, const QStringList& args = QStringList() ); 38 | 39 | // Field access 40 | qint64 columnInt64( int column ); 41 | int columnInt( int column ); 42 | QString columnText( int column ); 43 | 44 | // Single step 45 | int step(); 46 | 47 | // Those two functions prepare and retrieve songs, and must be in sync regarding the column order 48 | bool prepareSongQuery( sqlite3 * db, const QString& wheresql, const QStringList& args = QStringList() ); 49 | Database_SongInfo getRowSongInfo(); 50 | 51 | public: 52 | sqlite3_stmt * stmt; 53 | 54 | // Stores UTF-8 strings of args as sqlite needs them to live until the statement is executed 55 | QList m_args; 56 | }; 57 | 58 | #endif // DATABASE_STATEMENT_H 59 | -------------------------------------------------------------------------------- /src/eventor.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "eventor.h" 20 | 21 | Eventor * pEventor; 22 | 23 | Eventor::Eventor(QObject *parent) : QObject(parent) 24 | { 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/html/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/background.jpg -------------------------------------------------------------------------------- /src/html/css/login.css: -------------------------------------------------------------------------------- 1 | body,h1 2 | { 3 | font-family: "Roboto", sans-serif; 4 | } 5 | 6 | body, html 7 | { 8 | height: 100%; 9 | } 10 | 11 | .bgimg 12 | { 13 | background-image: url('../background.jpg'); 14 | min-height: 100%; 15 | background-position: center; 16 | background-size: cover; 17 | } 18 | 19 | #entercode 20 | { 21 | display: none; 22 | } 23 | 24 | /* https://codepen.io/anon/pen/YyRJVW */ 25 | .invalid 26 | { 27 | outline-color: red; 28 | background-color: #ff5500; 29 | animation: shake .5s linear; 30 | } 31 | 32 | @keyframes shake 33 | { 34 | 8%, 41% { 35 | transform: translateX(-10px); 36 | } 37 | 25%, 58% { 38 | transform: translateX(10px); 39 | } 40 | 75% { 41 | transform: translateX(-5px); 42 | } 43 | 92% { 44 | transform: translateX(5px); 45 | } 46 | 0%, 100% { 47 | transform: translateX(0); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/html/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/html/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/html/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/html/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/html/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/html/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/html/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Welcome to Spivak Karaoke Player! 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Welcome to Spivak Karaoke Player!
13 |
14 |

HELLO STRANGER!

15 |
16 |
17 |

Please introduce yourself:

18 |

19 |
20 |
21 |

Please enter the access code:

22 |

23 |
24 |
25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/images/application.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/application.ico -------------------------------------------------------------------------------- /src/images/dryicons_forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/dryicons_forward.png -------------------------------------------------------------------------------- /src/images/dryicons_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/dryicons_pause.png -------------------------------------------------------------------------------- /src/images/dryicons_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/dryicons_play.png -------------------------------------------------------------------------------- /src/images/dryicons_rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/dryicons_rewind.png -------------------------------------------------------------------------------- /src/images/dryicons_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/dryicons_stop.png -------------------------------------------------------------------------------- /src/images/icon_open_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/icon_open_file.png -------------------------------------------------------------------------------- /src/images/welcomewizard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/images/welcomewizard.jpg -------------------------------------------------------------------------------- /src/karaokeplayable_file.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef KARAOKEPLAYABLE_FILE_H 20 | #define KARAOKEPLAYABLE_FILE_H 21 | 22 | #include 23 | 24 | #include "karaokeplayable.h" 25 | 26 | // Playable karaoke object as local, on-disk file 27 | class KaraokePlayable_File : public KaraokePlayable 28 | { 29 | public: 30 | KaraokePlayable_File(const QString &baseFile, QStringDecoder *filenameDecoder ); 31 | 32 | bool init(); 33 | 34 | // Should return true if the file is a compound object (i.e. ZIP), i.e. enumerate returns files IN the object, not NEXT to it 35 | bool isCompound() const; 36 | 37 | // Returns a list of files in the archive/next to the file (same directory) EXCLUDING the base object; 38 | // Should return an empty array in case of error 39 | QStringList enumerate(); 40 | 41 | // Should return full absolute path if the object is on file system. Otherwise an empty string; DO NOT EXTRACT here. 42 | // Should return the path even if it is not valid/file does not exist. 43 | // Basically for base "base/file/foo" and "baz" object should return "base/file/baz" 44 | QString absolutePath( const QString& object ); 45 | 46 | // Should extract the object into the out QIODevice; returns true if succeed, false on error. THis will only be called if 47 | // absolutePath() returned an empty string. 48 | bool extract( const QString& object, QIODevice *out ); 49 | }; 50 | 51 | #endif // KARAOKEPLAYABLE_FILE_H 52 | -------------------------------------------------------------------------------- /src/labelshowhelp.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include 20 | 21 | #include "labelshowhelp.h" 22 | 23 | LabelShowHelp::LabelShowHelp( QWidget *parent ) 24 | : QLabel(parent) 25 | { 26 | connect( this, SIGNAL(linkActivated(QString)), this, SLOT(clicked()) ); 27 | } 28 | 29 | void LabelShowHelp::clicked() 30 | { 31 | // Link is clicked - do we have a buddy? 32 | QString text = buddy()->whatsThis(); 33 | 34 | QWhatsThis::showText ( ((QWidget*)parent())->mapToGlobal( buddy()->pos() ), text, this ); 35 | } 36 | -------------------------------------------------------------------------------- /src/labelshowhelp.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LABELSHOWHELP_H 20 | #define LABELSHOWHELP_H 21 | 22 | #include 23 | 24 | class LabelShowHelp : public QLabel 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit LabelShowHelp(QWidget *parent = 0); 30 | 31 | signals: 32 | 33 | public slots: 34 | void clicked(); 35 | }; 36 | 37 | #endif // LABELSHOWHELP_H 38 | -------------------------------------------------------------------------------- /src/languagedetector.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LANGUAGEDETECTOR_H 20 | #define LANGUAGEDETECTOR_H 21 | 22 | #include 23 | 24 | // Interface for libcld.so - it is 4Mb library, no need to keep it loaded all the time, 25 | // as it is only used during scanning (and even there it is not really necessary) 26 | // Separating this allows to load libcld.so only when neeeded on platforms with limited resources 27 | class LanguageDetector 28 | { 29 | public: 30 | // Returns the object if language detector is available, otherwise returns null 31 | static LanguageDetector * create(); 32 | 33 | // Takes care about the language ID conversion too 34 | QString detectLanguage( const QByteArray& data ); 35 | 36 | // This returns all languages 37 | QStringList languages(); 38 | 39 | private: 40 | LanguageDetector(); 41 | }; 42 | 43 | #endif // LANGUAGEDETECTOR_H 44 | -------------------------------------------------------------------------------- /src/logger.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef LOGGER_H 20 | #define LOGGER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | class Logger 27 | { 28 | public: 29 | static bool init(); 30 | 31 | static void debug( const QString& str ); 32 | static void debug( const char * fmt, ... ); 33 | 34 | static void error( const QString& str ); 35 | static void error( const char * fmt, ... ); 36 | 37 | private: 38 | explicit Logger(); 39 | void add(const char *type, const char * str ); 40 | 41 | QFile m_logfile; 42 | QMutex m_logMutex; 43 | }; 44 | 45 | #endif // LOGGER_H 46 | -------------------------------------------------------------------------------- /src/mediaplayerinitializer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "mediaplayerinitializer.h" 11 | #include "mediaplayer.h" 12 | #include "settings.h" 13 | #include "logger.h" 14 | 15 | 16 | MediaPlayerInitializer::MediaPlayerInitializer() 17 | : QThread( 0 ), mPlayer(0) 18 | { 19 | moveToThread( this ); 20 | 21 | #ifdef WIN32 22 | qputenv( "GST_PLUGIN_PATH", "gstplugins" ); 23 | #endif 24 | } 25 | 26 | MediaPlayerInitializer::~MediaPlayerInitializer() 27 | { 28 | delete mPlayer; 29 | } 30 | 31 | void MediaPlayerInitializer::audioLoaded() 32 | { 33 | // If we are here, the audio is loaded, play it - this is important 34 | // because GStreamer might fail at this stage, after loading successfully. 35 | mPlayer->play(); 36 | } 37 | 38 | void MediaPlayerInitializer::audioFinished() 39 | { 40 | // If we are here, everything works fine and we're done 41 | emit audioInitializationFinished( "" ); 42 | } 43 | 44 | void MediaPlayerInitializer::audioError(QString text) 45 | { 46 | // Error 47 | emit audioInitializationFinished( text ); 48 | } 49 | 50 | void MediaPlayerInitializer::run() 51 | { 52 | // Create and connect the player 53 | mPlayer = new MediaPlayer(); 54 | 55 | connect( mPlayer, SIGNAL( error( QString )), this, SLOT(audioError(QString)) ); 56 | connect( mPlayer, SIGNAL( loaded() ), this, SLOT(audioLoaded()) ); 57 | connect( mPlayer, SIGNAL( finished() ), this, SLOT(audioFinished()) ); 58 | 59 | // Load the media file here - this would initialize the player and thus take a while. 60 | // This is why we are doing it in a separate thread so we don't block the UI 61 | // Load the file from resources 62 | QFile f ( ":/sounds/test.mp3" ); 63 | 64 | if ( f.open( QIODevice::ReadOnly ) ) 65 | { 66 | // Load it into a buffer so we can use loadMedia with QIODevice 67 | QBuffer * buf = new QBuffer( this ); 68 | buf->setData( f.readAll() ); 69 | buf->open( QIODevice::ReadOnly ); 70 | 71 | // Load the data into player (and initialize everything) 72 | mPlayer->loadMedia( buf, MediaPlayer::LoadAudioStream ); 73 | } 74 | else 75 | { 76 | QTimer::singleShot( 0, this, [this]()->void{ audioError( tr("Failed to open test file") ); } ); 77 | } 78 | 79 | // Run the thread loop so we can deliver signals and slots 80 | exec(); 81 | } 82 | -------------------------------------------------------------------------------- /src/mediaplayerinitializer.h: -------------------------------------------------------------------------------- 1 | #ifndef MEDIAPLAYERINITIALIZER_H 2 | #define MEDIAPLAYERINITIALIZER_H 3 | 4 | #include 5 | 6 | class MediaPlayer; 7 | class QBuffer; 8 | 9 | // 10 | // The role of this class is to initialize the audio system at startup in a separate thread 11 | // (this may be expensive operation requiring loading of dozen shared libraries), as well as 12 | // testing whether the MediaPlayer_GStreamer playback is working , by trying to load and play a 13 | // silent test file. 14 | // 15 | class MediaPlayerInitializer : public QThread 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | MediaPlayerInitializer(); 21 | ~MediaPlayerInitializer(); 22 | 23 | signals: 24 | // Emitted when audio init and test is finished. Successful if errorMsg is empty. 25 | void audioInitializationFinished( QString errorMsg ); 26 | 27 | private slots: 28 | // The media file has loaded 29 | void audioLoaded(); 30 | 31 | // The media file has finished naturally 32 | void audioFinished(); 33 | 34 | // The media file cannot be loaded, or finished with an error 35 | void audioError( QString text ); 36 | 37 | protected: 38 | // the actual thread body 39 | void run() override; 40 | 41 | private: 42 | // Finds the path to installed GStreamer library 43 | void findGStreamerPath(); 44 | 45 | // Checks if the provided path is valid GStreamer path 46 | // Sets PATH and returns true if it is. 47 | bool checkGStreamerPath(const QString& path); 48 | 49 | MediaPlayer * mPlayer; 50 | }; 51 | 52 | #endif // MEDIAPLAYERINITIALIZER_H 53 | -------------------------------------------------------------------------------- /src/messageboxautoclose.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "logger.h" 5 | #include "messageboxautoclose.h" 6 | #include "settings.h" 7 | 8 | MessageBoxAutoClose::MessageBoxAutoClose( QWidget * parent ) 9 | : QMessageBox( parent ) 10 | { 11 | 12 | } 13 | 14 | void MessageBoxAutoClose::critical(const QString &title, const QString &message) 15 | { 16 | // Create a message box 17 | MessageBoxAutoClose * m = new MessageBoxAutoClose( 0 ); 18 | m->setIcon( QMessageBox::Critical ); 19 | 20 | m->setText( message ); 21 | m->setWindowTitle( title ); 22 | m->setStandardButtons( QMessageBox::Close ); 23 | 24 | // Delete the dialog object once it is closed 25 | connect( m->button( QMessageBox::Close ), SIGNAL( clicked(bool)), m, SLOT(deleteLater()) ); 26 | connect( m, SIGNAL(accepted()), m, SLOT(deleteLater()) ); 27 | connect( m, SIGNAL(rejected()), m, SLOT(deleteLater()) ); 28 | 29 | // Update the remaining time for autoclose and show it 30 | m->m_remainingSec = pSettings->dialogAutoCloseTimer; 31 | m->updatetime(); 32 | 33 | // Show the dialog and wait until it returns 34 | m->exec(); 35 | } 36 | 37 | void MessageBoxAutoClose::updatetime() 38 | { 39 | if ( m_remainingSec <= 0 ) 40 | { 41 | reject(); 42 | return; 43 | } 44 | 45 | // Update the remaining text 46 | QAbstractButton * btn = button( QMessageBox::Close ); 47 | btn->setText( tr("Close (%1)") .arg( m_remainingSec )); 48 | m_remainingSec--; 49 | 50 | QTimer::singleShot( 1000, this, SLOT( updatetime()) ); 51 | } 52 | -------------------------------------------------------------------------------- /src/messageboxautoclose.h: -------------------------------------------------------------------------------- 1 | #ifndef MESSAGEBOXAUTOCLOSE_H 2 | #define MESSAGEBOXAUTOCLOSE_H 3 | 4 | #include 5 | #include 6 | 7 | class MessageBoxAutoClose : public QMessageBox 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | MessageBoxAutoClose( QWidget * parent = 0 ); 13 | 14 | static void critical( const QString& title, 15 | const QString& message ); 16 | 17 | public slots: 18 | void updatetime(); 19 | 20 | private: 21 | unsigned int m_remainingSec; 22 | }; 23 | 24 | #endif // MESSAGEBOXAUTOCLOSE_H 25 | -------------------------------------------------------------------------------- /src/midistripper.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef MIDISTRIPPER_H 20 | #define MIDISTRIPPER_H 21 | 22 | #include 23 | 24 | // This class strips the MIDI file from the things which commonly confuse or outright corrupt 25 | // software MIDI synthesers: 26 | // 1. SysEx events 27 | // 2. RIFF header on a MIDI file 28 | class MIDIStripper 29 | { 30 | public: 31 | static QByteArray stripMIDI( const QString& filename ); 32 | 33 | private: 34 | MIDIStripper(); 35 | void process( const QString& filename ); 36 | 37 | // Byteorder-safe readers which also remember the retrieved data and throw exceptions 38 | quint8 readByte(); 39 | quint16 readWord(); 40 | quint32 readDword(); 41 | int readVarLen(); 42 | 43 | // This consumes the data, 'reading' it (and storing it in a chunk) 44 | void consumeData( unsigned int length ); 45 | 46 | // Dword storage 47 | void storeBEdword( char * addr, quint32 value ); 48 | 49 | // Input stream for read... ops above 50 | QFile m_input; 51 | 52 | // Output MIDI stream 53 | QByteArray m_outMidi; 54 | 55 | // Keeps all the data read in current chunk 56 | QByteArray m_chunk; 57 | 58 | // Keeps the current track data (for ease and lenght calculation) 59 | QByteArray m_track; 60 | }; 61 | 62 | #endif // MIDISTRIPPER_H 63 | -------------------------------------------------------------------------------- /src/multimediatestwidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef MULTIMEDIATESTWIDGET_H 20 | #define MULTIMEDIATESTWIDGET_H 21 | 22 | #include 23 | #include 24 | 25 | #include "mediaplayer.h" 26 | 27 | namespace Ui { 28 | class MultimediaTestWidget; 29 | } 30 | 31 | class MultimediaTestWidget : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit MultimediaTestWidget(QWidget *parent); 37 | ~MultimediaTestWidget(); 38 | 39 | private slots: 40 | // Player slots 41 | void error( QString error ); 42 | void loaded(); 43 | 44 | void startTest(); 45 | 46 | // Tests whether we can play WAV 47 | void testNext(); 48 | 49 | private: 50 | void show(); 51 | void append( const QString& text, bool newparagraph = true ); 52 | bool playerLoadResourceFile( const QString& filename ); 53 | 54 | Ui::MultimediaTestWidget *ui; 55 | 56 | // Here we use just QMediaPlayer to get deeper access to debugging facilities 57 | MediaPlayer * m_player; 58 | 59 | // Files to test play, and current testing 60 | QStringList m_testExtensions; 61 | unsigned int m_currentTesting; 62 | 63 | // Extension splayable 64 | QStringList m_playableFormats; 65 | 66 | // Suppress further errors 67 | bool m_suppressErrors; 68 | }; 69 | 70 | #endif // MULTIMEDIATESTWIDGET_H 71 | -------------------------------------------------------------------------------- /src/multimediatestwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MultimediaTestWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 478 10 | 426 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Automatic audio playback test 21 | 22 | 23 | 24 | 25 | 26 | 27 | 0 28 | 1 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/playerbutton.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef PLAYERBUTTON_H 20 | #define PLAYERBUTTON_H 21 | 22 | #include 23 | #include 24 | 25 | // Creates Amarok-like buttons 26 | class PlayerButton : public QPushButton 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | PlayerButton( QWidget *parent = 0 ); 32 | void setPixmap( const QPixmap& icon ); 33 | 34 | protected: 35 | void paintEvent( QPaintEvent *event ); 36 | QSize minimumSizeHint() const; 37 | QSize sizeHint() const; 38 | QSizePolicy sizePolicy () const; 39 | void enterEvent(QEnterEvent *e); 40 | void leaveEvent(QEvent * e); 41 | 42 | private: 43 | QPoint getAlignedCoords( const QPixmap& pix ); 44 | 45 | bool m_inButton; 46 | QPixmap m_iconNormal; 47 | QPixmap m_iconRaised; 48 | QPixmap m_iconDown; 49 | 50 | // Where to draw icons so they're centered 51 | QPoint m_pointNormal; 52 | QPoint m_pointDown; 53 | }; 54 | 55 | #endif // PLAYERBUTTON_H 56 | -------------------------------------------------------------------------------- /src/playerlyrics.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "playerlyrics.h" 20 | #include "settings.h" 21 | #include "karaokepainter.h" 22 | #include "currentstate.h" 23 | 24 | PlayerLyrics::PlayerLyrics() 25 | { 26 | m_timeDelay = pSettings->playerMusicLyricDelay; 27 | } 28 | 29 | PlayerLyrics::~PlayerLyrics() 30 | { 31 | } 32 | 33 | bool PlayerLyrics::draw(KaraokePainter &p) 34 | { 35 | qint64 time = qMax( 0, pCurrentState->playerPosition + m_timeDelay ); 36 | 37 | if ( !render( p, time ) ) 38 | return false; 39 | 40 | m_lastRenderedTime = pCurrentState->playerPosition; 41 | return true; 42 | } 43 | 44 | void PlayerLyrics::setDelay(int delayms) 45 | { 46 | m_timeDelay = delayms; 47 | pCurrentState->playerLyricsDelay = delayms; 48 | } 49 | 50 | int PlayerLyrics::delay() const 51 | { 52 | return m_timeDelay; 53 | } 54 | 55 | LyricsLoader::Properties PlayerLyrics::properties() const 56 | { 57 | return m_properties; 58 | } 59 | -------------------------------------------------------------------------------- /src/playerrenderer.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef PLAYERRENDERER_H 20 | #define PLAYERRENDERER_H 21 | 22 | #include 23 | #include 24 | 25 | class KaraokeWidget; 26 | class Notifications; 27 | class KaraokeSong; 28 | 29 | // This thread renders everything - lyrics, video, notifications. This way we can switch to GLWidget 30 | // and keep this class as-is (almost) 31 | // 32 | class PlayerRenderer : public QThread 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit PlayerRenderer( Notifications * notification, QImage * render, KaraokeWidget *parent ); 38 | ~PlayerRenderer(); 39 | 40 | void stop(); 41 | 42 | private: 43 | void run(); 44 | 45 | private: 46 | // Keeps renderer running (until exit) 47 | QAtomicInt m_continue; 48 | 49 | QImage * m_renderImage; 50 | 51 | Notifications* m_notification; 52 | 53 | KaraokeWidget * m_widget; 54 | }; 55 | 56 | #endif // PLAYERRENDERER_H 57 | -------------------------------------------------------------------------------- /src/queuekaraokewidget_addeditdialog.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef QUEUEKARAOKEWIDGET_ADDEDITDIALOG_H 20 | #define QUEUEKARAOKEWIDGET_ADDEDITDIALOG_H 21 | 22 | #include 23 | 24 | #include "songqueue.h" 25 | #include "queuetableviewmodels.h" 26 | 27 | 28 | namespace Ui { 29 | class QueueKaraokeWidget_AddEditDialog; 30 | } 31 | 32 | 33 | class QueueKaraokeWidget_AddEditDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit QueueKaraokeWidget_AddEditDialog( const QStringList& singers, QWidget *parent = 0 ); 39 | ~QueueKaraokeWidget_AddEditDialog(); 40 | 41 | void setCurrentParams( const SongQueueItem& song ); 42 | SongQueueItem params() const; 43 | 44 | 45 | private slots: 46 | void showSearch(); 47 | void buttonSearch(); 48 | void buttonAddFile(); 49 | void searchEntryDoubleClicked(QModelIndex item); 50 | void accept(); 51 | 52 | private: 53 | Ui::QueueKaraokeWidget_AddEditDialog * ui; 54 | 55 | SongQueueItem m_params; 56 | 57 | TableModelSearch * m_modelSearch; 58 | }; 59 | 60 | #endif // QUEUEKARAOKEWIDGET_ADDEDITDIALOG_H 61 | -------------------------------------------------------------------------------- /src/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/dryicons_play.png 4 | images/dryicons_pause.png 5 | images/dryicons_forward.png 6 | images/dryicons_rewind.png 7 | images/dryicons_stop.png 8 | images/icon_open_file.png 9 | sounds/test.mp3 10 | sounds/test.wav 11 | sounds/test.mid 12 | images/welcomewizard.jpg 13 | background/image5.jpeg 14 | background/image1.jpeg 15 | background/image2.jpeg 16 | background/image3.jpeg 17 | background/image4.jpeg 18 | sounds/test.m4a 19 | sounds/test.ogg 20 | sounds/test.wma 21 | images/application.ico 22 | html/index.html 23 | html/background.jpg 24 | html/karaoke.js 25 | html/md5.js 26 | html/login.html 27 | html/css/font-awesome.css 28 | html/css/karaoke.css 29 | html/css/w3.css 30 | html/css/login.css 31 | html/fonts/fontawesome-webfont.eot 32 | html/fonts/fontawesome-webfont.svg 33 | html/fonts/fontawesome-webfont.ttf 34 | html/fonts/fontawesome-webfont.woff 35 | html/fonts/fontawesome-webfont.woff2 36 | html/fonts/FontAwesome.otf 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/songqueueitem.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2018 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include "songqueueitem.h" 20 | 21 | SongQueueItem::SongQueueItem() 22 | { 23 | id = 0; 24 | songid = 0; 25 | readiness = 0; 26 | state = STATE_READY; 27 | } 28 | 29 | SongQueueItem::~SongQueueItem() 30 | { 31 | } 32 | 33 | QString SongQueueItem::stateText() const 34 | { 35 | switch ( state ) 36 | { 37 | case STATE_NOT_READY: 38 | return QObject::tr("waiting to be downloaded"); 39 | 40 | case STATE_GETTING_READY: 41 | return QObject::tr("downloading %1%").arg( readiness ); 42 | 43 | case STATE_READY: 44 | return QObject::tr("ready"); 45 | 46 | case STATE_PLAYING: 47 | return QObject::tr("playing"); 48 | 49 | default: 50 | return "unknown"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/songqueueitemretriever.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2018 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "util.h" 25 | #include "songqueueitemretriever.h" 26 | 27 | SongQueueItemRetriever::SongQueueItemRetriever() 28 | : QObject(0) 29 | { 30 | provider = 0; 31 | collectionindex = 0; 32 | collectiontype = CollectionProvider::TYPE_INVALID; 33 | } 34 | 35 | SongQueueItemRetriever::~SongQueueItemRetriever() 36 | { 37 | Q_FOREACH ( QIODevice * f, outputs ) 38 | { 39 | delete f; 40 | } 41 | 42 | if ( provider ) 43 | provider->deleteLater(); 44 | } 45 | 46 | QString SongQueueItemRetriever::cachedFileName(const QString &source) const 47 | { 48 | // We use the first source base name for the cache 49 | QString basename = QCryptographicHash::hash( sources.front().toUtf8(), QCryptographicHash::Md5 ).toHex(); 50 | 51 | // Get the file extension 52 | QString ext = Util::fileExtension( source ); 53 | 54 | return QStandardPaths::writableLocation( QStandardPaths::CacheLocation ) 55 | + QDir::separator() 56 | + basename + "." + ext; 57 | } 58 | -------------------------------------------------------------------------------- /src/songqueueitemretriever.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2018 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef SONGQUEUEITEMRETRIEVER_H 20 | #define SONGQUEUEITEMRETRIEVER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "collectionprovider.h" 27 | 28 | // 29 | // This class is instantiated each time a retriever for the SongQueueItem 30 | // is needed. It is not part of SongQueueItem because those items are frequently 31 | // copied (i.e. when moved in the queue), while this object must remain. 32 | class SongQueueItemRetriever : public QObject 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | SongQueueItemRetriever(); 38 | ~SongQueueItemRetriever(); 39 | 40 | // Returns a list of QFiles with the cached representation of all song files 41 | QString cachedFileName(const QString &source) const; 42 | 43 | // Collection index (index could be -1 meaning generic collection). 44 | // In this case collectiontype should be set, which is otherwise ignored. 45 | int collectionindex; 46 | CollectionProvider::Type collectiontype; 47 | 48 | // Collection provider instance (only created during the actual retrieval) 49 | CollectionProvider * provider; 50 | 51 | // File where we write the output object 52 | QList outputs; 53 | 54 | // Song sources which are to be retrieved, 55 | // and file names into which are they to be saved 56 | QStringList sources; 57 | QStringList outfiles; 58 | 59 | private: 60 | Q_DISABLE_COPY(SongQueueItemRetriever) 61 | }; 62 | 63 | #endif // SONGQUEUEITEMRETRIEVER_H 64 | -------------------------------------------------------------------------------- /src/sounds/test.m4a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.m4a -------------------------------------------------------------------------------- /src/sounds/test.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.mid -------------------------------------------------------------------------------- /src/sounds/test.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.mp3 -------------------------------------------------------------------------------- /src/sounds/test.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.ogg -------------------------------------------------------------------------------- /src/sounds/test.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.wav -------------------------------------------------------------------------------- /src/sounds/test.wma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gyunaev/spivak/1b121d4ff6701c4fb2d951d08007153413094fc7/src/sounds/test.wma -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef VERSION_H 20 | #define VERSION_H 21 | 22 | #define APP_VERSION_MAJOR 2 23 | #define APP_VERSION_MINOR 2 24 | 25 | #endif // VERSION_H 26 | -------------------------------------------------------------------------------- /src/welcome_wizard.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Spivak Karaoke PLayer - a free, cross-platform desktop karaoke player * 3 | * Copyright (C) 2015-2016 George Yunaev, support@ulduzsoft.com * 4 | * * 5 | * This program is free software: you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation, either version 3 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program. If not, see . * 17 | **************************************************************************/ 18 | 19 | #ifndef WELCOME_WIZARD_H 20 | #define WELCOME_WIZARD_H 21 | 22 | #include 23 | 24 | namespace Ui { 25 | class WelcomeWizard; 26 | } 27 | 28 | class WelcomeWizard : public QWizard 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit WelcomeWizard(QWidget *parent = 0); 34 | ~WelcomeWizard(); 35 | 36 | virtual void accept(); 37 | virtual void reject(); 38 | 39 | private: 40 | Ui::WelcomeWizard *ui; 41 | }; 42 | 43 | #endif // WELCOME_WIZARD_H 44 | --------------------------------------------------------------------------------