├── deps ├── uchardect │ ├── uchardect │ │ └── AUTHORS │ ├── CharsetConvInf.cpp │ └── CharsetConv.h ├── MAC_SDK │ ├── Source │ │ ├── MACDll │ │ │ ├── stdafx.cpp │ │ │ ├── MACDll.aps │ │ │ ├── MACDll.rc │ │ │ ├── res │ │ │ │ ├── MAC.ico │ │ │ │ ├── Compression Level.bmp │ │ │ │ └── MACDll.rc2 │ │ │ ├── MACDllApp.h │ │ │ ├── stdafx.h │ │ │ ├── MACDllApp.cpp │ │ │ ├── WinampSettingsDlg.h │ │ │ ├── resource.h │ │ │ └── MACDll.def │ │ ├── Shared │ │ │ ├── StdString.h │ │ │ ├── WAVInfoDialog.h │ │ │ ├── APEInfoDialog.h │ │ │ ├── CharacterHelper.h │ │ │ ├── WindowsEnvironment.h │ │ │ ├── StdLibFileIO.h │ │ │ ├── WinFileIO.h │ │ │ ├── Timer.h │ │ │ ├── IO.h │ │ │ ├── NoWindows.h │ │ │ ├── CircleBuffer.h │ │ │ └── GlobalFunctions.h │ │ ├── Console │ │ │ ├── Resource Script.rc │ │ │ └── resource.h │ │ ├── DirectShow Filter │ │ │ ├── Script1.aps │ │ │ ├── license.txt │ │ │ ├── APE Decoder.def │ │ │ └── resource.h │ │ ├── Projects │ │ │ └── VS2017 │ │ │ │ ├── Workspace.v11.suo │ │ │ │ ├── MAC │ │ │ │ └── MAC.vcxproj.user │ │ │ │ ├── Console │ │ │ │ └── Console.vcxproj.user │ │ │ │ ├── MACDll │ │ │ │ └── MACDll.vcxproj.user │ │ │ │ └── MACLib │ │ │ │ └── MACLib.vcxproj.user │ │ └── MACLib │ │ │ ├── APELink.h │ │ │ ├── ScaledFirstOrderFilter.h │ │ │ ├── MACProgressHelper.h │ │ │ ├── Old │ │ │ ├── APEDecompressOld.h │ │ │ ├── APEDecompressCore.h │ │ │ └── UnBitArrayOld.h │ │ │ ├── Predictor.h │ │ │ ├── Prepare.h │ │ │ ├── UnBitArray.h │ │ │ ├── APECompressCore.h │ │ │ ├── APECompressCreate.h │ │ │ ├── BitArray.h │ │ │ ├── UnBitArrayBase.h │ │ │ └── NNFilter.h │ ├── Readme.txt │ ├── Shared │ │ ├── MACDll.dll │ │ ├── MACDll.lib │ │ ├── MACLib.lib │ │ ├── WindowsEnvironment.h │ │ ├── IO.h │ │ └── NoWindows.h │ └── 3rd Party │ │ └── TMonkey (Delphi) │ │ ├── APEtag │ │ ├── Main.dfm │ │ ├── Test.res │ │ ├── Test.dpr │ │ ├── Test.cfg │ │ ├── Info.txt │ │ └── Test.dof │ │ ├── ID3v1 │ │ ├── Main.dfm │ │ ├── Test.res │ │ ├── Test.dpr │ │ ├── Test.cfg │ │ ├── Info.txt │ │ └── Test.dof │ │ ├── ID3v2 │ │ ├── Main.dfm │ │ ├── Test.res │ │ ├── Test.dpr │ │ ├── Test.cfg │ │ └── Test.dof │ │ ├── Monkey │ │ ├── Main.dfm │ │ ├── Test.res │ │ ├── Test.dpr │ │ ├── Test.cfg │ │ └── Test.dof │ │ └── Readme.txt ├── ffmpeg-strip-wma │ ├── CREDITS │ ├── config.h │ ├── config.mak │ ├── config.mak.bak │ ├── os_support.h │ ├── allcodecs.c │ ├── avi.h │ ├── simple_idct.h │ ├── os_support.c │ ├── Makefile.orig │ └── Makefile ├── README.md └── alac │ ├── CONTRIBUTING.md │ ├── PULL_REQUEST_TEMPLATE.md │ ├── convert-utility │ └── ALACconvert.sln │ └── codec │ ├── EndianPortable.h │ ├── dplib.h │ └── ALACDecoder.h ├── misc ├── bpd ├── bcoverdump ├── getsrc ├── findsrc ├── mp3file │ ├── APETag.h │ └── ID3Tag.h ├── grabkey.cc └── PlaylistDump.cc ├── screenshot ├── qt.png ├── qt-conv.png ├── qt5-macos.png ├── ncurses-play.png └── ncurses-explorer.png ├── ports ├── freebsd │ ├── pkg-message │ ├── pkg-descr │ ├── distinfo │ └── pkg-plist └── homebrew │ └── mous.rb ├── apps ├── qt5 │ ├── resource │ │ ├── next.png │ │ ├── pause.png │ │ ├── play.png │ │ ├── stop.png │ │ └── previous.png │ ├── AllRes.qrc │ ├── MidClickTabBar.cpp │ ├── CustomHeadTabWidget.hpp │ ├── MidClickTabBar.hpp │ ├── FrmToolBar.h │ ├── CustomHeadTabWidget.cpp │ ├── DlgLoadingMedia.h │ ├── DlgListSelect.h │ ├── main.cpp │ ├── FrmToolBar.cpp │ ├── PlaylistClipboard.h │ ├── DlgConvertTask.h │ ├── AppEnv.h │ ├── DlgLoadingMedia.cpp │ ├── IPlaylistView.h │ ├── DlgConvertTask.ui │ ├── FrmProgressBar.h │ ├── DlgConvertOption.h │ ├── DlgListSelect.cpp │ ├── UiHelper.hpp │ ├── MainWindow.ui │ ├── mous-qt.pro │ ├── PlaylistActionHistory.h │ ├── FrmTagEditor.h │ ├── FoobarStyle.h │ ├── FrmProgressBar.ui │ └── DlgLoadingMedia.ui ├── ncurses │ ├── MainUi.h │ ├── HelpView.h │ ├── BaseView.h │ ├── AppEnv.h │ ├── Server.h │ ├── ServerContext.h │ ├── StatusView.h │ ├── Client.h │ ├── ExplorerView.h │ ├── Session.h │ ├── main.cc │ ├── PlaylistView.h │ └── ClientPlaylistHandler.h └── cli │ ├── cmd.h │ ├── ctx.h │ └── img.cc ├── plugins ├── format-probe │ ├── ProbeCaf.h │ ├── Plugin.cc │ ├── FormatProbe.cc │ └── ProbeMp4.h ├── coreaudio │ ├── README.md │ ├── cmus │ │ ├── debug.h │ │ ├── xmalloc.c │ │ └── mixer.h │ ├── Plugin.cc │ └── Output.cc ├── alac │ ├── Plugin.cc │ └── Encoder.cc ├── alsa │ └── Plugin.cc ├── flac │ └── Plugin.cc ├── lame │ └── Plugin.cc ├── mac │ └── Plugin.cc ├── sndio │ └── Plugin.cc ├── wma │ └── Plugin.cc ├── mpg123 │ └── Plugin.cc ├── oss │ └── Plugin.cc ├── wavpack │ └── Plugin.cc ├── fdk-aac │ └── decoder │ │ └── Plugin.cc ├── libcue │ └── Plugin.cc ├── lpcm │ ├── Plugin.cc │ └── Common.h ├── opus │ ├── Plugin.cc │ └── Encoder.cc ├── vorbis │ └── Plugin.cc ├── taglib │ ├── Plugin.cc │ └── CoverArt.h ├── faac │ ├── FaacPlugin.cpp │ └── FaacEncoder.h ├── faad │ └── FaadPlugin.cpp └── libao │ ├── AoPlugin.cpp │ ├── AoOutput.h │ └── AoOutput.cpp ├── sdk ├── util │ ├── CoverFormat.h │ ├── PluginHelper.h │ ├── MediaTag.h │ ├── AudioMode.h │ ├── MediaItem.h │ ├── ErrorCode.h │ └── PluginDef.h ├── charset │ ├── CharsetConvInf.h │ └── ICharsetConv.h ├── core │ ├── TagParserFactory.h │ ├── Converter.h │ ├── MediaLoader.h │ ├── Conversion.h │ └── Player.h ├── scx │ ├── Singleton.h │ ├── Env.h │ ├── Conv.h │ ├── FileHelper.h │ └── IconvHelper.h └── plugin │ ├── FormatProbeProto.h │ ├── SheetParserProto.h │ ├── OutputProto.h │ ├── FormatProbe.h │ ├── SheetParser.h │ ├── Output.h │ ├── EncoderProto.h │ ├── DecoderProto.h │ └── Encoder.h ├── .gitignore ├── .clang-format ├── .circleci └── config.yml ├── core ├── TagParserFactory.cc ├── Converter.cc ├── MediaLoader.cc ├── Conversion.cc └── TagParserFactoryImpl.h ├── TODO.md └── LICENSE /deps/uchardect/uchardect/AUTHORS: -------------------------------------------------------------------------------- 1 | BYVoid 2 | -------------------------------------------------------------------------------- /misc/bpd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | g++ -o pd -O2 PlaylistDump.cc -I ../sdk/ 3 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | 4 | -------------------------------------------------------------------------------- /screenshot/qt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/screenshot/qt.png -------------------------------------------------------------------------------- /ports/freebsd/pkg-message: -------------------------------------------------------------------------------- 1 | You can check mous-ncurses usage with 'H' after starting. 2 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Readme.txt -------------------------------------------------------------------------------- /screenshot/qt-conv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/screenshot/qt-conv.png -------------------------------------------------------------------------------- /screenshot/qt5-macos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/screenshot/qt5-macos.png -------------------------------------------------------------------------------- /apps/qt5/resource/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/apps/qt5/resource/next.png -------------------------------------------------------------------------------- /apps/qt5/resource/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/apps/qt5/resource/pause.png -------------------------------------------------------------------------------- /apps/qt5/resource/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/apps/qt5/resource/play.png -------------------------------------------------------------------------------- /apps/qt5/resource/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/apps/qt5/resource/stop.png -------------------------------------------------------------------------------- /screenshot/ncurses-play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/screenshot/ncurses-play.png -------------------------------------------------------------------------------- /apps/qt5/resource/previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/apps/qt5/resource/previous.png -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/MACDll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Shared/MACDll.dll -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/MACDll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Shared/MACDll.lib -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/MACLib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Shared/MACLib.lib -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/CREDITS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/ffmpeg-strip-wma/CREDITS -------------------------------------------------------------------------------- /screenshot/ncurses-explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/screenshot/ncurses-explorer.png -------------------------------------------------------------------------------- /ports/freebsd/pkg-descr: -------------------------------------------------------------------------------- 1 | Mous is a simpe yet powerful audio player. 2 | 3 | WWW: https://github.com/bsdelf/mous 4 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/MACDll.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/MACDll/MACDll.aps -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/MACDll.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/MACDll/MACDll.rc -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/res/MAC.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/MACDll/res/MAC.ico -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/StdString.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/Shared/StdString.h -------------------------------------------------------------------------------- /misc/bcoverdump: -------------------------------------------------------------------------------- 1 | clang++ -std=c++11 -stdlib=libc++ -g -o coverdump -O2 coverdump.cpp -ltag -I /usr/local/include/ -L /usr/local/lib 2 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Console/Resource Script.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/Console/Resource Script.rc -------------------------------------------------------------------------------- /plugins/format-probe/ProbeCaf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static const char* ProbeCaf(void* ptr, const char* path) { 4 | return nullptr; 5 | } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/DirectShow Filter/Script1.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/DirectShow Filter/Script1.aps -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/DirectShow Filter/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/DirectShow Filter/license.txt -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/res/Compression Level.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/MACDll/res/Compression Level.bmp -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Projects/VS2017/Workspace.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/Source/Projects/VS2017/Workspace.v11.suo -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Main.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Main.dfm -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Test.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Test.res -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Main.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Main.dfm -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Test.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Test.res -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Main.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Main.dfm -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Test.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Test.res -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Main.dfm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Main.dfm -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Test.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bsdelf/mous/HEAD/deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Test.res -------------------------------------------------------------------------------- /plugins/coreaudio/README.md: -------------------------------------------------------------------------------- 1 | # Core Audio Output 2 | 3 | Thanks to Wang-Yue's core audio wrapper. 4 | 5 | > Note: This work is based on CMUS's ef65f69b3e44a79956c138c83dd64ef41e27f206 6 | -------------------------------------------------------------------------------- /plugins/coreaudio/cmus/debug.h: -------------------------------------------------------------------------------- 1 | // Author: Yanhui Shen 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | #define d_print(...) printf(__VA_ARGS__) 8 | 9 | #define BUG_ON(...) 10 | -------------------------------------------------------------------------------- /plugins/alac/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "alac", 7 | "ALAC Codec", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/alsa/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Output, 6 | "alsa", 7 | "ALSA Output", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/flac/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "flac", 7 | "FLAC Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/lame/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Encoder, 6 | "lame", 7 | "Lame Encoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/mac/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "mac", 7 | "MAC Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/sndio/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Output, 6 | "sndio", 7 | "Sndio Output", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/wma/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "wma", 7 | "WMA Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/mpg123/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "mpg123", 7 | "MPG123 Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /ports/freebsd/distinfo: -------------------------------------------------------------------------------- 1 | TIMESTAMP = 1524993359 2 | SHA256 (bsdelf-mous-v2.0.1_GH0.tar.gz) = b8866049c225fab2033617908d3c3b353533bc20c274b1fa0d7c034ea1c15cef 3 | SIZE (bsdelf-mous-v2.0.1_GH0.tar.gz) = 2735960 4 | -------------------------------------------------------------------------------- /sdk/util/CoverFormat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace mous { 6 | 7 | enum class CoverFormat : uint32_t { 8 | None = 0, 9 | JPEG, 10 | PNG, 11 | }; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /misc/getsrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find \ 3 | ./sdk/util/ ./sdk/core/ ./sdk/plugin/ ./plugins/ ./core/ ./frontend/ncurses ./frontend/cli/ \ 4 | -name "*.[hc]" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.cc" 5 | 6 | -------------------------------------------------------------------------------- /plugins/oss/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Output, 6 | "oss", 7 | "Open Sound System Output", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/wavpack/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "wavpack", 7 | "WavPack Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/fdk-aac/decoder/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder, 6 | "fdk-aac", 7 | "FDK Decoder", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/libcue/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::SheetParser, 6 | "libcue", 7 | "Cue Sheet Parser", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/DirectShow Filter/APE Decoder.def: -------------------------------------------------------------------------------- 1 | LIBRARY APE.ax 2 | EXPORTS 3 | DllGetClassObject PRIVATE 4 | DllCanUnloadNow PRIVATE 5 | DllRegisterServer PRIVATE 6 | DllUnregisterServer PRIVATE 7 | -------------------------------------------------------------------------------- /deps/README.md: -------------------------------------------------------------------------------- 1 | # Bundled Dependencies 2 | 3 | - [alac](https://github.com/macosforge/alac): c38887c5c5e64a4b31108733bd79ca9b2496d987 4 | - [MAC SDK](https://www.monkeysaudio.com/developers.html): Monkey's Audio 4.33 SDK 5 | -------------------------------------------------------------------------------- /plugins/format-probe/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::FormatProbe, 6 | "format-probe", 7 | "Format Probe", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/lpcm/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder | PluginType::Encoder, 6 | "lpcm", 7 | "LPCM Codec", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.app 2 | *.dylib 3 | *.exe 4 | *.o 5 | *.out 6 | *.pro.user* 7 | *.qm 8 | *.session 9 | *.so 10 | *.swp 11 | .DS_Store 12 | .clang 13 | .clang_complete 14 | .qmake.stash 15 | Makefile 16 | build 17 | build* 18 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Projects/VS2017/MAC/MAC.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Projects/VS2017/Console/Console.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Projects/VS2017/MACDll/MACDll.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Projects/VS2017/MACLib/MACLib.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /plugins/opus/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder/* | PluginType::Encoder*/, 6 | "opus", 7 | "Ogg Opus Codec", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/vorbis/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Decoder/* | PluginType::Encoder*/, 6 | "vorbis", 7 | "Ogg Vorbis Codec", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Chromium 2 | IncludeBlocks: Preserve 3 | ColumnLimit: 0 4 | MaxEmptyLinesToKeep: 1 5 | AllowShortBlocksOnASingleLine: false 6 | AllowShortFunctionsOnASingleLine: false 7 | AllowShortCaseLabelsOnASingleLine: false 8 | -------------------------------------------------------------------------------- /plugins/taglib/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::TagParser, 6 | "taglib", 7 | "TagLib is for reading and editing the meta-data", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /plugins/coreaudio/Plugin.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace mous; 3 | 4 | MOUS_EXPORT_PLUGIN( 5 | PluginType::Output | PluginType::Decoder, 6 | "coreaudio", 7 | "Core Audio Codec & Output", 8 | 2 9 | ) 10 | -------------------------------------------------------------------------------- /apps/ncurses/MainUi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class MainUi { 6 | class Impl; 7 | 8 | public: 9 | MainUi(); 10 | ~MainUi(); 11 | 12 | int Exec(); 13 | 14 | private: 15 | std::unique_ptr impl; 16 | }; 17 | -------------------------------------------------------------------------------- /misc/findsrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find \ 3 | ./sdk/util/ ./sdk/core/ ./sdk/plugin/ ./plugins/ ./core/ ./frontend/cli/ ./frontend/qt/ ./frontend/ncurses/ \ 4 | -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.cc" \ 5 | | xargs wc | sort -k 4 6 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Readme.txt: -------------------------------------------------------------------------------- 1 | TMonkey Delphi Class for analyzing APE files 2 | 3 | Sumbitted by Jurgen Faul ( jfaul@gmx.de ) 4 | 5 | (note: this does not directly use the MAC SDK, so it is not guaranteed to work with future APE files) -------------------------------------------------------------------------------- /apps/cli/cmd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern int cmd_play(int, char**); 4 | extern int cmd_dec(int, char**); 5 | extern int cmd_img(int, char**); 6 | extern int cmd_info(int, char**); 7 | extern int cmd_plugin(int, char**); 8 | extern int cmd_help(int, char**); 9 | -------------------------------------------------------------------------------- /plugins/faac/FaacPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "FaacEncoder.h" 2 | #include 3 | 4 | static const PluginInfo info = { 5 | "faac", 6 | "FAAC Encoder", 7 | 1 8 | }; 9 | 10 | MOUS_DEF_PLUGIN(PluginType::Encoder, &info, FaacEncoder); 11 | -------------------------------------------------------------------------------- /plugins/faad/FaadPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "FaadDecoder.h" 2 | #include 3 | 4 | static const PluginInfo info = { 5 | "faad", 6 | "FAAD Decoder", 7 | 1 8 | }; 9 | 10 | MOUS_DEF_PLUGIN(PluginType::Decoder, &info, FaadDecoder); 11 | -------------------------------------------------------------------------------- /plugins/libao/AoPlugin.cpp: -------------------------------------------------------------------------------- 1 | #include "AoOutput.h" 2 | #include 3 | 4 | static const PluginInfo info = { 5 | "ao", 6 | "Portable Audio Output", 7 | 1 8 | }; 9 | 10 | MOUS_DEF_PLUGIN(PluginType::Output, &info, AoOutput); 11 | -------------------------------------------------------------------------------- /apps/qt5/AllRes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resource/next.png 4 | resource/pause.png 5 | resource/play.png 6 | resource/previous.png 7 | 8 | 9 | -------------------------------------------------------------------------------- /sdk/charset/CharsetConvInf.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | void* MousCreateCharsetConv(int bufSize); 7 | void MousReleaseICharsetConv(void* ptr); 8 | //TODO: complete c interfaces 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /misc/mp3file/APETag.h: -------------------------------------------------------------------------------- 1 | #ifndef APETag_h 2 | #define APETag_h 3 | 4 | #pragma pack(push) 5 | #pragma pack(1) 6 | 7 | struct APETagHead_t 8 | { 9 | char header[8]; 10 | int version; 11 | int size; 12 | int items; 13 | int flags; 14 | char reserved[8]; 15 | }; 16 | 17 | #pragma pack(pop) 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Test.dpr: -------------------------------------------------------------------------------- 1 | program Test; 2 | 3 | uses 4 | Forms, 5 | Main in 'Main.pas' {MainForm}, 6 | APEtag in 'APEtag.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.Title := 'APEtag Test'; 13 | Application.CreateForm(TMainForm, MainForm); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Test.dpr: -------------------------------------------------------------------------------- 1 | program Test; 2 | 3 | uses 4 | Forms, 5 | Main in 'Main.pas' {MainForm}, 6 | ID3v1 in 'ID3v1.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.Title := 'ID3v1 Test'; 13 | Application.CreateForm(TMainForm, MainForm); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Test.dpr: -------------------------------------------------------------------------------- 1 | program Test; 2 | 3 | uses 4 | Forms, 5 | Main in 'Main.pas' {MainForm}, 6 | ID3v2 in 'ID3v2.pas'; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.Title := 'ID3v2 Test'; 13 | Application.CreateForm(TMainForm, MainForm); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /deps/uchardect/CharsetConvInf.cpp: -------------------------------------------------------------------------------- 1 | #include "CharsetConv.h" 2 | using namespace mous; 3 | 4 | void* MousCreateCharsetConv(int bufSize) 5 | { 6 | return new CharsetConv(bufSize); 7 | } 8 | 9 | void MousReleaseICharsetConv(void* ptr) 10 | { 11 | if (ptr != NULL) { 12 | CharsetConv* conv = static_cast(ptr); 13 | delete conv; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apps/qt5/MidClickTabBar.cpp: -------------------------------------------------------------------------------- 1 | #include "MidClickTabBar.hpp" 2 | #include 3 | #include 4 | using namespace sqt; 5 | 6 | MidClickTabBar::MidClickTabBar(QWidget* parent) 7 | : QTabBar(parent) { 8 | } 9 | 10 | void MidClickTabBar::mouseReleaseEvent(QMouseEvent* event) { 11 | QTabBar::mouseReleaseEvent(event); 12 | 13 | if (event->button() == Qt::MiddleButton) 14 | emit SigMidClick(tabAt(event->pos())); 15 | } 16 | -------------------------------------------------------------------------------- /apps/qt5/CustomHeadTabWidget.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace sqt { 6 | 7 | class CustomHeadTabWidget : public QTabWidget { 8 | Q_OBJECT 9 | 10 | public: 11 | CustomHeadTabWidget(QWidget* parent = 0); 12 | void SetTabBar(QTabBar* tb); 13 | 14 | signals: 15 | void SigDoubleClick(); 16 | 17 | private: 18 | void mouseDoubleClickEvent(QMouseEvent* event); 19 | }; 20 | 21 | } // namespace sqt 22 | -------------------------------------------------------------------------------- /apps/qt5/MidClickTabBar.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MIDCLICKTABBAR_H 2 | #define MIDCLICKTABBAR_H 3 | 4 | #include 5 | 6 | namespace sqt { 7 | 8 | class MidClickTabBar : public QTabBar { 9 | Q_OBJECT 10 | 11 | public: 12 | MidClickTabBar(QWidget* parent = 0); 13 | 14 | signals: 15 | void SigMidClick(int id); 16 | 17 | private: 18 | virtual void mouseReleaseEvent(QMouseEvent* event); 19 | }; 20 | 21 | } // namespace sqt 22 | 23 | #endif // DCLICKTABBAR_H 24 | -------------------------------------------------------------------------------- /apps/qt5/FrmToolBar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Ui { 6 | class FrmToolBar; 7 | } 8 | 9 | class FrmToolBar : public QWidget { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit FrmToolBar(QWidget* parent = 0); 14 | ~FrmToolBar(); 15 | 16 | QToolButton* BtnPlay(); 17 | QToolButton* BtnNext(); 18 | QToolButton* BtnPrev(); 19 | 20 | QSlider* SliderVolume(); 21 | QSlider* SliderPlaying(); 22 | 23 | private: 24 | Ui::FrmToolBar* ui; 25 | }; 26 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Test.dpr: -------------------------------------------------------------------------------- 1 | program Test; 2 | 3 | uses 4 | Forms, 5 | Main in 'Main.pas' {MainForm}, 6 | Monkey in 'Monkey.pas', 7 | ID3v1 in '..\ID3v1\ID3v1.pas', 8 | ID3v2 in '..\ID3v2\ID3v2.pas', 9 | APEtag in '..\APEtag\APEtag.pas'; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | Application.Initialize; 15 | Application.Title := 'Monkey Test'; 16 | Application.CreateForm(TMainForm, MainForm); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/res/MACDll.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // MACDll.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/MACDllApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWinampSettingsDlg; 4 | 5 | class CMACDllApp : public CWinApp 6 | { 7 | public: 8 | 9 | CMACDllApp(); 10 | ~CMACDllApp(); 11 | 12 | CWinampSettingsDlg * GetWinampSettingsDlg(); 13 | 14 | virtual BOOL InitInstance(); 15 | 16 | protected: 17 | 18 | DECLARE_MESSAGE_MAP(); 19 | 20 | CSmartPtr m_spWinampSettingsDlg; 21 | }; 22 | 23 | extern CMACDllApp g_Application; -------------------------------------------------------------------------------- /sdk/util/PluginHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define MOUS_EXPORT_PLUGIN(type, name, desc, version) \ 6 | extern "C" { \ 7 | const PluginInfo* MousGetPluginInfo() { \ 8 | static const PluginInfo info{ \ 9 | type, name, desc, version}; \ 10 | return &info; \ 11 | } \ 12 | } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Console/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Resource Script.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/DirectShow Filter/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Script1.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 101 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /apps/ncurses/HelpView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "BaseView.h" 4 | #include "Ncurses.h" 5 | 6 | class HelpView : public BaseView { 7 | public: 8 | HelpView(); 9 | ~HelpView(); 10 | 11 | void MoveTo(int x, int y); 12 | void Resize(int w, int h); 13 | void Refresh(); 14 | 15 | bool InjectKey(int key); 16 | 17 | void Show(bool show); 18 | bool IsShown() const; 19 | 20 | private: 21 | void Cleanup(); 22 | 23 | private: 24 | ncurses::Window d; 25 | int m_LineBegin; 26 | int m_LineCount; 27 | }; 28 | -------------------------------------------------------------------------------- /plugins/taglib/CoverArt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | #include 8 | using namespace mous; 9 | 10 | CoverFormat DumpMp3Cover(const string& path, char** out, uint32_t* length); 11 | CoverFormat DumpMp4Cover(const string& path, char** out, uint32_t* length); 12 | 13 | bool StoreMp3Cover(const string& path, CoverFormat fmt, const char* buf, size_t len); 14 | bool StoreMp4Cover(const string& path, CoverFormat fmt, const char* buf, size_t len); 15 | -------------------------------------------------------------------------------- /apps/qt5/CustomHeadTabWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "CustomHeadTabWidget.hpp" 2 | using namespace sqt; 3 | 4 | CustomHeadTabWidget::CustomHeadTabWidget(QWidget* parent) 5 | : QTabWidget(parent) { 6 | setMouseTracking(true); 7 | } 8 | 9 | void CustomHeadTabWidget::SetTabBar(QTabBar* tb) { 10 | QTabWidget::setTabBar(tb); 11 | } 12 | 13 | void CustomHeadTabWidget::mouseDoubleClickEvent(QMouseEvent* event) { 14 | QTabWidget::mouseDoubleClickEvent(event); 15 | 16 | if (!tabBar()->underMouse()) 17 | emit SigDoubleClick(); 18 | } 19 | -------------------------------------------------------------------------------- /apps/qt5/DlgLoadingMedia.h: -------------------------------------------------------------------------------- 1 | #ifndef DLGLOADINGMEDIA_H 2 | #define DLGLOADINGMEDIA_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class DlgLoadingMedia; 8 | } 9 | 10 | class DlgLoadingMedia : public QDialog { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit DlgLoadingMedia(QWidget* parent = 0); 15 | ~DlgLoadingMedia(); 16 | 17 | public: 18 | void SetFileName(const QString& fileName); 19 | 20 | private: 21 | Ui::DlgLoadingMedia* ui; 22 | int m_ProgressCharIndex; 23 | }; 24 | 25 | #endif // DLGLOADINGMEDIA_H 26 | -------------------------------------------------------------------------------- /apps/qt5/DlgListSelect.h: -------------------------------------------------------------------------------- 1 | #ifndef DLGLISTSELECT_H 2 | #define DLGLISTSELECT_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class DlgListSelect; 8 | } 9 | 10 | class DlgListSelect : public QDialog { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit DlgListSelect(QWidget* parent = 0); 15 | ~DlgListSelect(); 16 | 17 | void SetItems(const QStringList& items); 18 | void SetSelectedIndex(int index); 19 | int GetSelectedIndex() const; 20 | 21 | private: 22 | Ui::DlgListSelect* ui; 23 | }; 24 | 25 | #endif // DLGLISTSELECT_H 26 | -------------------------------------------------------------------------------- /deps/alac/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | By submitting a request, you represent that you have the right to license 2 | your contribution to the community, and agree that your contributions are 3 | licensed under the [Apache License Version 2.0](LICENSE). 4 | 5 | For existing files modified by your request, you represent that you have 6 | retained any existing copyright notices and licensing terms. For each new 7 | file in your request, you represent that you have added to the file a 8 | copyright notice (including the year and the copyright owner's name) and 9 | ALAC's licensing terms. 10 | -------------------------------------------------------------------------------- /apps/ncurses/BaseView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BaseView { 4 | public: 5 | virtual ~BaseView() { 6 | } 7 | 8 | virtual void MoveTo(int x, int y) = 0; 9 | virtual void Resize(int w, int h) = 0; 10 | virtual void Refresh() = 0; 11 | virtual bool NeedRefresh() const { 12 | return false; 13 | } 14 | 15 | virtual bool InjectKey(int key) = 0; 16 | 17 | virtual void Show(bool show) = 0; 18 | virtual bool IsShown() const = 0; 19 | 20 | virtual void SetFocus(bool focus) { 21 | } 22 | virtual bool HasFocus() const { 23 | return false; 24 | } 25 | }; -------------------------------------------------------------------------------- /deps/alac/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | By submitting a request, you represent that you have the right to license 2 | your contribution to the community, and agree that your contributions are 3 | licensed under the [Apache License Version 2.0](LICENSE). 4 | 5 | For existing files modified by your request, you represent that you have 6 | retained any existing copyright notices and licensing terms. For each new 7 | file in your request, you represent that you have added to the file a 8 | copyright notice (including the year and the copyright owner's name) and 9 | ALAC's licensing terms. 10 | -------------------------------------------------------------------------------- /misc/mp3file/ID3Tag.h: -------------------------------------------------------------------------------- 1 | #ifndef ID3Tag_h 2 | #define ID3Tag_h 3 | 4 | #pragma pack(push) 5 | #pragma pack(1) 6 | 7 | struct ID3v2Head_t 8 | { 9 | char header[3]; 10 | char version[1]; 11 | char reversion[1]; 12 | char flag[1]; 13 | char size[4]; 14 | }; 15 | 16 | struct ID3v1Head_t 17 | { 18 | char header[3]; 19 | char title[30]; 20 | char artist[30]; 21 | char album[30]; 22 | char year[4]; 23 | char comment[28]; 24 | char reserve[1]; 25 | char track[1]; 26 | char genre[1]; 27 | }; 28 | 29 | #pragma pack(pop) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /apps/ncurses/AppEnv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | struct AppEnv { 7 | bool Init(); 8 | 9 | // environment 10 | std::string configDir; 11 | std::string pluginDir; 12 | 13 | std::string configFile; 14 | std::string pidFile; 15 | std::string contextFile; 16 | std::string playlistFile; 17 | 18 | // config content 19 | std::string serverIp; 20 | int serverPort; 21 | std::string ifNotUtf8; 22 | 23 | private: 24 | bool SaveDefault(); 25 | bool LoadContent(); 26 | }; 27 | 28 | typedef scx::Singleton GlobalAppEnv; 29 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Test.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi6\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi6\Projects\Bpl" 36 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Test.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi6\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi6\Projects\Bpl" 36 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Test.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi6\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi6\Projects\Bpl" 36 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Test.cfg: -------------------------------------------------------------------------------- 1 | -$A8 2 | -$B- 3 | -$C+ 4 | -$D+ 5 | -$E- 6 | -$F- 7 | -$G+ 8 | -$H+ 9 | -$I+ 10 | -$J- 11 | -$K- 12 | -$L+ 13 | -$M- 14 | -$N+ 15 | -$O+ 16 | -$P+ 17 | -$Q- 18 | -$R- 19 | -$S- 20 | -$T- 21 | -$U- 22 | -$V+ 23 | -$W- 24 | -$X+ 25 | -$YD 26 | -$Z1 27 | -cg 28 | -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 29 | -H+ 30 | -W+ 31 | -M 32 | -$M16384,1048576 33 | -K$00400000 34 | -LE"c:\program files\borland\delphi6\Projects\Bpl" 35 | -LN"c:\program files\borland\delphi6\Projects\Bpl" 36 | -------------------------------------------------------------------------------- /apps/ncurses/Server.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | #include 9 | using namespace scx; 10 | 11 | struct ServerContext; 12 | class Session; 13 | 14 | class Server { 15 | public: 16 | Server(); 17 | ~Server(); 18 | 19 | int Exec(); 20 | 21 | private: 22 | void StopService(); 23 | void OpenSession(TcpSocket&); 24 | void CloseSession(Session*); 25 | 26 | private: 27 | unique_ptr m_Context; 28 | TcpSocket m_Socket; 29 | int m_PipeFd[2]; 30 | set m_SessionSet; 31 | }; 32 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/WAVInfoDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | BOOL CALLBACK FileInfoDialogProcedureA(HWND hDlg, UINT message, intn wParam, intn lParam); 4 | 5 | class CWAVInfoDialog 6 | { 7 | public: 8 | 9 | CWAVInfoDialog(); 10 | ~CWAVInfoDialog(); 11 | 12 | long ShowWAVInfoDialog(const str_utfn * pFilename, HINSTANCE hInstance, const str_utfn * lpTemplateName, HWND hWndParent); 13 | 14 | private: 15 | 16 | static LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, intn wParam, intn lParam); 17 | long InitDialog(HWND hDlg); 18 | TCHAR m_cFileName[MAX_PATH]; 19 | }; 20 | -------------------------------------------------------------------------------- /apps/qt5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "AppEnv.h" 5 | #include "MainWindow.h" 6 | 7 | int main(int argc, char* argv[]) { 8 | auto env = GlobalAppEnv::Instance(); 9 | const auto ok = env->Init(); 10 | if (!ok) { 11 | qDebug() << "failed to initialize app env"; 12 | return 1; 13 | } 14 | 15 | QTranslator translator; 16 | translator.load(env->translationFile); 17 | QApplication app(argc, argv); 18 | app.installTranslator(&translator); 19 | MainWindow win; 20 | win.show(); 21 | const int ret = app.exec(); 22 | env->Save(); 23 | return ret; 24 | } 25 | -------------------------------------------------------------------------------- /plugins/lpcm/Common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #pragma pack(push, 1) 6 | 7 | struct WavHeader { 8 | // RIFF chunk 9 | char riff_id[4]; 10 | uint32_t length_after_riff; 11 | char riff_type[4]; 12 | 13 | // format chunk 14 | char format_id[4]; 15 | uint32_t format_chunk_length; 16 | uint16_t format_tag; 17 | uint16_t channels; 18 | uint32_t sample_rate; 19 | uint32_t avg_bytes_per_sec; 20 | uint16_t block_align; 21 | uint16_t bits_per_sample; 22 | 23 | // data chunk 24 | char data_id[4]; 25 | uint32_t data_chunk_length; 26 | }; 27 | 28 | #pragma pack(pop) -------------------------------------------------------------------------------- /sdk/core/TagParserFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace mous { 10 | 11 | class TagParserFactory { 12 | class Impl; 13 | 14 | public: 15 | TagParserFactory(); 16 | ~TagParserFactory(); 17 | 18 | void LoadTagParserPlugin(const std::shared_ptr& plugin); 19 | void UnloadPlugin(const std::string& path); 20 | void UnloadPlugin(); 21 | 22 | std::shared_ptr CreateParser(const std::string& fileName) const; 23 | 24 | private: 25 | std::unique_ptr impl; 26 | }; 27 | 28 | } // namespace mous 29 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/APEInfoDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | BOOL CALLBACK FileInfoDialogProcedureA(HWND hDlg, UINT message, intn wParam, intn lParam); 4 | 5 | class CAPEInfoDialog 6 | { 7 | public: 8 | 9 | CAPEInfoDialog(); 10 | ~CAPEInfoDialog(); 11 | 12 | int ShowAPEInfoDialog(const str_utfn * pFilename, HINSTANCE hInstance, const str_utfn * lpszTemplateName, HWND hWndParent); 13 | 14 | private: 15 | 16 | static LRESULT CALLBACK DialogProc(HWND hDlg, UINT message, intn wParam, intn lParam); 17 | int FillGenreComboBox(HWND hDlg, int nComboBoxID, char * pSelectedGenre); 18 | IAPEDecompress * m_pAPEDecompress; 19 | }; 20 | -------------------------------------------------------------------------------- /ports/freebsd/pkg-plist: -------------------------------------------------------------------------------- 1 | %%CLI%%bin/mous-cli 2 | %%NCURSES%%bin/mous-ncurses 3 | %%QT5%%bin/mous-qt 4 | lib/libMousCore.so 5 | %%LIBCUE%%lib/mous/libCueParser.so 6 | %%FDK_AAC%%lib/mous/libFdkDecoder.so 7 | %%FLAC%%lib/mous/libFlacDecoder.so 8 | %%LAME%%lib/mous/libLameEncoder.so 9 | %%MAC%%lib/mous/libMacDecoder.so 10 | %%VORBIS%%lib/mous/libVorbisDecoder.so 11 | %%VORBIS%%lib/mous/libVorbisEncoder.so 12 | %%MPG123%%lib/mous/libMpg123Decoder.so 13 | %%OSS%%lib/mous/libOssOutput.so 14 | %%SNDIO%%lib/mous/libSndioOutput.so 15 | %%TAGLIB%%lib/mous/libTagLibParser.so 16 | %%WAV%%lib/mous/libWavDecoder.so 17 | %%WAV%%lib/mous/libWavEncoder.so 18 | %%WAVPACK%%lib/mous/libWvDecoder.so 19 | -------------------------------------------------------------------------------- /sdk/util/MediaTag.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace mous { 7 | 8 | struct MediaTag { 9 | std::string title; 10 | std::string artist; 11 | std::string album; 12 | std::string comment; 13 | std::string genre; 14 | int32_t year = -1; 15 | int32_t track = -1; 16 | 17 | template 18 | void operator>>(buf_t& buf) const { 19 | buf << title << artist << album << comment << genre << year << track; 20 | } 21 | 22 | template 23 | void operator<<(buf_t& buf) { 24 | buf >> title >> artist >> album >> comment >> genre >> year >> track; 25 | } 26 | }; 27 | 28 | } // namespace mous 29 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // environment 4 | #include "WindowsEnvironment.h" 5 | 6 | // defines for reducing size 7 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 8 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 9 | 10 | // MFC 11 | #include // MFC core and standard components 12 | #include // MFC extensions 13 | 14 | // Monkey's Audio 15 | #include "All.h" 16 | #include "MACLib.h" 17 | using namespace APE; 18 | 19 | // resources 20 | #include "resource.h" 21 | -------------------------------------------------------------------------------- /sdk/scx/Singleton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace scx { 7 | 8 | template 9 | class Singleton { 10 | public: 11 | static std::shared_ptr Instance() { 12 | std::call_once(flag_, [] { instance_ = std::make_shared(); }); 13 | return instance_; 14 | } 15 | 16 | static void Cleanup() { 17 | instance_.reset(); 18 | } 19 | 20 | private: 21 | static std::once_flag flag_; 22 | static std::shared_ptr instance_; 23 | }; 24 | 25 | template 26 | std::once_flag Singleton::flag_; 27 | 28 | template 29 | std::shared_ptr Singleton::instance_ = nullptr; 30 | } // namespace scx 31 | -------------------------------------------------------------------------------- /apps/qt5/FrmToolBar.cpp: -------------------------------------------------------------------------------- 1 | #include "FrmToolBar.h" 2 | #include "ui_FrmToolBar.h" 3 | 4 | FrmToolBar::FrmToolBar(QWidget* parent) 5 | : QWidget(parent), 6 | ui(new Ui::FrmToolBar) { 7 | ui->setupUi(this); 8 | } 9 | 10 | FrmToolBar::~FrmToolBar() { 11 | delete ui; 12 | } 13 | 14 | QToolButton* FrmToolBar::BtnPlay() { 15 | return ui->btnPlay; 16 | } 17 | 18 | QToolButton* FrmToolBar::BtnPrev() { 19 | return ui->btnPrev; 20 | } 21 | 22 | QToolButton* FrmToolBar::BtnNext() { 23 | return ui->btnNext; 24 | } 25 | 26 | QSlider* FrmToolBar::SliderVolume() { 27 | return ui->sliderVolume; 28 | } 29 | 30 | QSlider* FrmToolBar::SliderPlaying() { 31 | return ui->sliderPlaying; 32 | } 33 | -------------------------------------------------------------------------------- /sdk/util/AudioMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace mous { 6 | 7 | enum class AudioMode : uint32_t { 8 | None, 9 | Mono, 10 | Stereo, 11 | JointStero, 12 | DualChannel 13 | }; 14 | 15 | inline const char* ToString(AudioMode mode) { 16 | switch (mode) { 17 | case AudioMode::None: 18 | return "None"; 19 | 20 | case AudioMode::Mono: 21 | return "Mono"; 22 | 23 | case AudioMode::Stereo: 24 | return "Stereo"; 25 | 26 | case AudioMode::JointStero: 27 | return "JointStero"; 28 | 29 | case AudioMode::DualChannel: 30 | return "DualChannel"; 31 | } 32 | 33 | return ""; 34 | } 35 | 36 | } // namespace mous 37 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/APELink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IO.h" 4 | #include "APEInfo.h" 5 | 6 | namespace APE 7 | { 8 | 9 | class CAPELink 10 | { 11 | public: 12 | CAPELink(const str_utfn * pFilename); 13 | CAPELink(const char * pData, const str_utfn * pFilename); 14 | ~CAPELink(); 15 | 16 | bool GetIsLinkFile(); 17 | int GetStartBlock(); 18 | int GetFinishBlock(); 19 | const wchar_t * GetImageFilename(); 20 | 21 | protected: 22 | bool m_bIsLinkFile; 23 | int m_nStartBlock; 24 | int m_nFinishBlock; 25 | str_utfn m_cImageFilename[MAX_PATH]; 26 | 27 | void ParseData(const char * pData, const str_utfn * pFilename); 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /plugins/libao/AoOutput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | using namespace mous; 8 | 9 | class AoOutput: public IOutput 10 | { 11 | public: 12 | AoOutput(); 13 | virtual ~AoOutput(); 14 | 15 | virtual ErrorCode Open(); 16 | virtual void Close(); 17 | 18 | virtual ErrorCode Setup(int32_t& channels, int32_t& sampleRate, int32_t& bitsPerSample); 19 | virtual ErrorCode Write(const char* buf, uint32_t len); 20 | 21 | virtual int VolumeLevel() const; 22 | virtual void SetVolumeLevel(int level); 23 | 24 | private: 25 | int m_Driver; 26 | ao_device* m_Device; 27 | ao_sample_format m_Format; 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/MACDllApp.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MACDllApp.h" 3 | #include "WinampSettingsDlg.h" 4 | 5 | CMACDllApp g_Application; 6 | 7 | BEGIN_MESSAGE_MAP(CMACDllApp, CWinApp) 8 | END_MESSAGE_MAP() 9 | 10 | CMACDllApp::CMACDllApp() 11 | { 12 | } 13 | 14 | CMACDllApp::~CMACDllApp() 15 | { 16 | m_spWinampSettingsDlg.Delete(); 17 | } 18 | 19 | BOOL CMACDllApp::InitInstance() 20 | { 21 | CWinApp::InitInstance(); 22 | return TRUE; 23 | } 24 | 25 | CWinampSettingsDlg * CMACDllApp::GetWinampSettingsDlg() 26 | { 27 | if (m_spWinampSettingsDlg == NULL) 28 | m_spWinampSettingsDlg.Assign(new CWinampSettingsDlg); 29 | 30 | return m_spWinampSettingsDlg; 31 | } 32 | -------------------------------------------------------------------------------- /sdk/scx/Env.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace scx { 9 | 10 | struct Env { 11 | static bool Has(const std::string& name) { 12 | return ::getenv(name.c_str()) != nullptr; 13 | } 14 | 15 | static std::string Get(const std::string& name) { 16 | const char* p = ::getenv(name.c_str()); 17 | return (p != nullptr) ? p : ""; 18 | } 19 | 20 | static bool Set(const std::string& name, const std::string& value, bool overwrite = true) { 21 | return ::setenv(name.c_str(), value.c_str(), overwrite) == 0; 22 | } 23 | 24 | static bool Unset(const std::string& name) { 25 | return ::unsetenv(name.c_str()) == 0; 26 | } 27 | }; 28 | } // namespace scx 29 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/config.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated by configure - do not modify */ 2 | #define ARCH_X86 1 3 | #define TUNECPU generic 4 | #undef HAVE_MMX 5 | #define __CPU__ 586 6 | #define HAVE_BUILTIN_VECTOR 1 7 | #define HAVE_LOCALTIME_R 1 8 | #define HAVE_LRINTF 1 9 | #undef HAVE_VHOOK 10 | #undef CONFIG_ENCODERS 11 | #define CONFIG_DECODERS 1 12 | #undef CONFIG_MPEGAUDIO_HP 13 | #undef CONFIG_VIDEO4LINUX 14 | #undef CONFIG_DV1394 15 | #define CONFIG_HAVE_DLOPEN 1 16 | #define CONFIG_HAVE_DLFCN 1 17 | #undef CONFIG_AUDIO_OSS 18 | #undef CONFIG_NETWORK 19 | #undef CONFIG_ZLIB 20 | #define HAVE_MALLOC_H 1 21 | #define HAVE_MEMALIGN 1 22 | #define SIMPLE_IDCT 1 23 | #undef CONFIG_FFSERVER 24 | #define CONFIG_RISKY 1 25 | #define restrict __restrict__ 26 | -------------------------------------------------------------------------------- /sdk/plugin/FormatProbeProto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Interface.h" 9 | 10 | static void* Create(); 11 | static void Destroy(void* ptr); 12 | static const char* Probe(void* ptr, const char* path); 13 | static const mous::BaseOption** GetOptions(void* ptr); 14 | static const char** GetSuffixes(void* ptr); 15 | 16 | static mous::FormatProbeInterface format_probe_interface{ 17 | Create, 18 | Destroy, 19 | Probe, 20 | GetOptions, 21 | GetSuffixes}; 22 | 23 | extern "C" { 24 | const mous::FormatProbeInterface* MousGetFormatProbeInterface() { 25 | return &format_probe_interface; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /apps/qt5/PlaylistClipboard.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYLISTCLIPBOARD_H 2 | #define PLAYLISTCLIPBOARD_H 3 | 4 | #include 5 | 6 | template 7 | class PlaylistClipboard { 8 | public: 9 | bool Empty() const { 10 | return m_Empty; 11 | } 12 | 13 | const std::deque& Content() const { 14 | return m_Content; 15 | } 16 | 17 | void SetContent(const std::deque& content) { 18 | m_Content = content; 19 | m_Empty = false; 20 | } 21 | 22 | void SetContent(std::deque&& content) { 23 | m_Content = std::move(content); 24 | m_Empty = false; 25 | } 26 | 27 | void Clear() { 28 | m_Empty = true; 29 | } 30 | 31 | private: 32 | bool m_Empty = true; 33 | std::deque m_Content; 34 | }; 35 | 36 | #endif // PLAYLISTCLIPBOARD_H 37 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/ScaledFirstOrderFilter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | template class CScaledFirstOrderFilter 7 | { 8 | public: 9 | 10 | __forceinline void Flush() 11 | { 12 | m_nLastValue = 0; 13 | } 14 | 15 | __forceinline int Compress(const int nInput) 16 | { 17 | int nResult = nInput - ((m_nLastValue * MULTIPLY) >> SHIFT); 18 | m_nLastValue = nInput; 19 | return nResult; 20 | } 21 | 22 | __forceinline int Decompress(const int nInput) 23 | { 24 | m_nLastValue = nInput + ((m_nLastValue * MULTIPLY) >> SHIFT); 25 | return m_nLastValue; 26 | } 27 | 28 | protected: 29 | int m_nLastValue; 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /apps/qt5/DlgConvertTask.h: -------------------------------------------------------------------------------- 1 | #ifndef DLGCONVERTTASK_H 2 | #define DLGCONVERTTASK_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "FrmProgressBar.h" 8 | 9 | namespace Ui { 10 | class DlgConvertTask; 11 | } 12 | 13 | namespace mous { 14 | class ConvTask; 15 | } 16 | 17 | class DlgConvertTask : public QDialog { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit DlgConvertTask(QWidget* parent = 0); 22 | ~DlgConvertTask(); 23 | 24 | void AddTask(std::shared_ptr&& conversion, const QString& output); 25 | 26 | private slots: 27 | void SlotUpdateProgress(); 28 | void SlotCancelTask(void* key); 29 | 30 | private: 31 | Ui::DlgConvertTask* ui; 32 | QTimer m_ProgressTimer; 33 | }; 34 | 35 | #endif // DLGCONVERTTASK_H 36 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: debian:stretch 6 | steps: 7 | - checkout 8 | - run: apt-get update 9 | - run: apt-get install -y build-essential cmake libncurses-dev libasound2-dev 10 | - run: > 11 | mkdir -p build && 12 | cd build && 13 | cmake ../ 14 | -DWITH_APP_NCURSES=ON 15 | -DWITH_APP_QT5=OFF 16 | -DWITH_PLUGIN_COREAUDIO=OFF 17 | -DWITH_PLUGIN_TAGLIB=OFF 18 | -DWITH_PLUGIN_LIBCUE=OFF 19 | -DWITH_PLUGIN_FAAC=OFF 20 | -DWITH_PLUGIN_FDK_AAC=OFF 21 | -DWITH_PLUGIN_FLAC=OFF 22 | -DWITH_PLUGIN_LAME=OFF 23 | -DWITH_PLUGIN_MPG123=OFF 24 | -DWITH_PLUGIN_WAVPACK=OFF && 25 | make 26 | -------------------------------------------------------------------------------- /apps/qt5/AppEnv.h: -------------------------------------------------------------------------------- 1 | #ifndef APPENV_H 2 | #define APPENV_H 3 | 4 | #include 5 | #include 6 | 7 | struct AppEnv { 8 | public: 9 | bool Init(); 10 | void Save(); 11 | 12 | public: 13 | // path 14 | QString configDir; 15 | QString pluginDir; 16 | QString resourceDir; 17 | 18 | QString configFile; 19 | QString translationFile; 20 | 21 | // config 22 | QString ifNotUtf8; 23 | 24 | // ui && status 25 | QByteArray windowGeometry; 26 | QByteArray windowState; 27 | QByteArray tagEditorSplitterState; 28 | int tabCount; 29 | int tabIndex; 30 | int volume; 31 | 32 | private: 33 | void InitFilePath(); 34 | bool LoadConfig(); 35 | bool CheckDefaultConfig(); 36 | }; 37 | 38 | using GlobalAppEnv = scx::Singleton; 39 | 40 | #endif // APPENV_H 41 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/CharacterHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | /******************************************************************************************* 7 | Character set conversion helpers 8 | *******************************************************************************************/ 9 | class CAPECharacterHelper 10 | { 11 | public: 12 | static str_ansi * GetANSIFromUTF8(const str_utf8 * pUTF8); 13 | static str_ansi * GetANSIFromUTF16(const str_utfn * pUTF16); 14 | static str_utfn * GetUTF16FromANSI(const str_ansi * pANSI); 15 | static str_utfn * GetUTF16FromUTF8(const str_utf8 * pUTF8); 16 | static str_utf8 * GetUTF8FromANSI(const str_ansi * pANSI); 17 | static str_utf8 * GetUTF8FromUTF16(const str_utfn * pUTF16); 18 | }; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /core/TagParserFactory.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "TagParserFactoryImpl.h" 3 | 4 | namespace mous { 5 | 6 | TagParserFactory::TagParserFactory() 7 | : impl(std::make_unique()) { 8 | } 9 | 10 | TagParserFactory::~TagParserFactory() { 11 | } 12 | 13 | void TagParserFactory::LoadTagParserPlugin(const std::shared_ptr& plugin) { 14 | return impl->LoadTagParserPlugin(plugin); 15 | } 16 | 17 | void TagParserFactory::UnloadPlugin(const std::string& path) { 18 | return impl->UnloadPlugin(path); 19 | } 20 | 21 | void TagParserFactory::UnloadPlugin() { 22 | return impl->UnloadPlugin(); 23 | } 24 | 25 | std::shared_ptr TagParserFactory::CreateParser(const std::string& fileName) const { 26 | return impl->CreateParser(fileName); 27 | } 28 | 29 | } // namespace mous 30 | -------------------------------------------------------------------------------- /sdk/core/Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace mous { 12 | 13 | class Converter { 14 | class Impl; 15 | 16 | public: 17 | Converter(); 18 | ~Converter(); 19 | 20 | void LoadDecoderPlugin(const std::shared_ptr& plugin); 21 | void LoadEncoderPlugin(const std::shared_ptr& plugin); 22 | void UnloadPlugin(const std::string& path); 23 | void UnloadPlugin(); 24 | 25 | std::vector EncoderNames() const; 26 | std::shared_ptr CreateConversion(const MediaItem& item, const std::string& encoder) const; 27 | 28 | private: 29 | std::unique_ptr impl; 30 | }; 31 | 32 | } // namespace mous 33 | -------------------------------------------------------------------------------- /sdk/core/MediaLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace mous { 13 | 14 | class MediaLoader { 15 | class Impl; 16 | 17 | public: 18 | MediaLoader(); 19 | ~MediaLoader(); 20 | 21 | void LoadSheetParserPlugin(const std::shared_ptr& plugin); 22 | void LoadTagParserPlugin(const std::shared_ptr& plugin); 23 | void UnloadPlugin(const std::string& path); 24 | void UnloadPlugin(); 25 | 26 | std::vector SupportedSuffixes() const; 27 | ErrorCode LoadMedia(const std::string& path, std::deque& list) const; 28 | 29 | private: 30 | std::unique_ptr impl; 31 | }; 32 | 33 | } // namespace mous 34 | -------------------------------------------------------------------------------- /sdk/util/MediaItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace mous { 6 | 7 | struct MediaItem { 8 | MediaItem() = default; 9 | 10 | MediaItem(const std::string& url) 11 | : url(url) { 12 | } 13 | 14 | std::string url; 15 | int32_t duration = -1; 16 | 17 | // for wav/ape/flac/... with cue 18 | bool hasRange = false; 19 | uint64_t msBeg = 0; 20 | uint64_t msEnd = 0; 21 | 22 | MediaTag tag; 23 | 24 | void* userData = nullptr; 25 | 26 | template 27 | void operator>>(buf_t& buf) const { 28 | buf << url << duration << hasRange << msBeg << msEnd; 29 | tag >> buf; 30 | } 31 | 32 | template 33 | void operator<<(buf_t& buf) { 34 | buf >> url >> duration >> hasRange >> msBeg >> msEnd; 35 | tag << buf; 36 | } 37 | }; 38 | 39 | } // namespace mous 40 | -------------------------------------------------------------------------------- /sdk/plugin/SheetParserProto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "Interface.h" 8 | 9 | static void* Create(); 10 | static void Destroy(void* ptr); 11 | static void DumpFile(void* ptr, const char* path, std::deque* list); 12 | static void DumpStream(void* ptr, const char* stream, std::deque* list); 13 | static const mous::BaseOption** GetOptions(void* ptr); 14 | static const char** GetSuffixes(void* ptr); 15 | 16 | static const mous::SheetParserInterface sheet_parser_interface{ 17 | Create, 18 | Destroy, 19 | DumpFile, 20 | DumpStream, 21 | GetOptions, 22 | GetSuffixes}; 23 | 24 | extern "C" { 25 | const mous::SheetParserInterface* MousGetSheetParserInterface() { 26 | return &sheet_parser_interface; 27 | } 28 | } -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/config.mak: -------------------------------------------------------------------------------- 1 | # Automatically generated by configure - do not modify 2 | prefix=/usr 3 | bindir=/usr/bin 4 | mandir=/usr/share/man 5 | MAKE=make 6 | CC=cc 7 | AR=ar 8 | RANLIB=ranlib 9 | STRIP=strip 10 | OPTFLAGS=-Wall -O3 -fPIC 11 | SHCFLAGS=-Wall -O3 -fPIC 12 | LDFLAGS=-Wl,--warn-common -rdynamic 13 | FFSLDFLAGS=-Wl,-E 14 | SHFLAGS=-shared 15 | LIBPREF=lib 16 | LIBSUF=.a 17 | SLIBPREF=lib 18 | SLIBSUF=.so 19 | EXESUF= 20 | TARGET_OS=Linux 21 | TARGET_ARCH_X86=yes 22 | TARGET_MMX=no 23 | TARGET_BUILTIN_VECTOR=yes 24 | HAVE_FREETYPE2=no 25 | CONFIG_SDL=no 26 | BUILD_VHOOK=no 27 | EXTRALIBS=-lm -ldl 28 | VERSION=0.4.8 29 | CONFIG_ENCODERS=no 30 | CONFIG_DECODERS=yes 31 | CONFIG_VIDEO4LINUX=no 32 | CONFIG_DV1394=no 33 | CONFIG_AUDIO_OSS=no 34 | CONFIG_NETWORK=no 35 | CONFIG_ZLIB=no 36 | CONFIG_FFSERVER=no 37 | CONFIG_FFPLAY=no 38 | CONFIG_RISKY=yes 39 | SRC_PATH=/projects/ffmpeg_1 40 | -------------------------------------------------------------------------------- /sdk/core/Conversion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace mous { 12 | 13 | class Conversion { 14 | class Impl; 15 | 16 | public: 17 | Conversion(const MediaItem& item, const std::shared_ptr& decoderPlugin, const std::shared_ptr& encoderPlugin); 18 | ~Conversion(); 19 | 20 | std::vector DecoderOptions() const; 21 | std::vector EncoderOptions() const; 22 | std::string EncoderFileSuffix() const; 23 | 24 | void Run(const std::string& output); 25 | void Cancel(); 26 | 27 | // [0, 1]: progress, < 0: failed 28 | double Progress() const; 29 | 30 | bool IsFinished() const; 31 | 32 | private: 33 | std::unique_ptr impl; 34 | }; 35 | 36 | } // namespace mous 37 | -------------------------------------------------------------------------------- /apps/cli/ctx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | using namespace mous; 13 | 14 | struct Context { 15 | using PluginVector = std::vector>; 16 | 17 | Context(); 18 | ~Context(); 19 | 20 | MediaLoader mediaLoader; 21 | TagParserFactory tagParserFactory; 22 | Converter converter; 23 | 24 | Player player; 25 | std::mutex playerMutex; 26 | bool playerQuit; 27 | Playlist playlist; 28 | 29 | PluginVector decoderPlugins; 30 | PluginVector encoderPlugins; 31 | PluginVector outputPlugins; 32 | PluginVector tagParserPlugins; 33 | PluginVector sheetParserPlugins; 34 | }; 35 | 36 | extern std::unique_ptr ctx; 37 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/config.mak.bak: -------------------------------------------------------------------------------- 1 | # Automatically generated by configure - do not modify 2 | prefix=/usr 3 | bindir=/usr/bin 4 | mandir=/usr/share/man 5 | MAKE=make 6 | CC=gcc 7 | AR=ar 8 | RANLIB=ranlib 9 | STRIP=strip 10 | OPTFLAGS=-Wall -O3 -fPIC 11 | SHCFLAGS=-Wall -O3 -fPIC 12 | LDFLAGS=-Wl,--warn-common -rdynamic 13 | FFSLDFLAGS=-Wl,-E 14 | SHFLAGS=-shared 15 | LIBPREF=lib 16 | LIBSUF=.a 17 | SLIBPREF=lib 18 | SLIBSUF=.so 19 | EXESUF= 20 | TARGET_OS=Linux 21 | TARGET_ARCH_X86=yes 22 | TARGET_MMX=no 23 | TARGET_BUILTIN_VECTOR=yes 24 | HAVE_FREETYPE2=no 25 | CONFIG_SDL=no 26 | BUILD_VHOOK=no 27 | EXTRALIBS=-lm -ldl 28 | VERSION=0.4.8 29 | CONFIG_ENCODERS=no 30 | CONFIG_DECODERS=yes 31 | CONFIG_VIDEO4LINUX=no 32 | CONFIG_DV1394=no 33 | CONFIG_AUDIO_OSS=no 34 | CONFIG_NETWORK=no 35 | CONFIG_ZLIB=no 36 | CONFIG_FFSERVER=no 37 | CONFIG_FFPLAY=no 38 | CONFIG_RISKY=yes 39 | SRC_PATH=/projects/ffmpeg_1 40 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/MACProgressHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | #define KILL_FLAG_CONTINUE 0 7 | #define KILL_FLAG_PAUSE -1 8 | #define KILL_FLAG_STOP 1 9 | 10 | class IAPEProgressCallback; 11 | 12 | class CMACProgressHelper 13 | { 14 | public: 15 | 16 | CMACProgressHelper(unsigned int nTotalSteps, IAPEProgressCallback * pProgressCallback); 17 | virtual ~CMACProgressHelper(); 18 | 19 | void UpdateProgress(unsigned int nCurrentStep = -1, bool bForceUpdate = false); 20 | void UpdateProgressComplete() { UpdateProgress(m_nTotalSteps, true); } 21 | 22 | int ProcessKillFlag(bool bSleep = true); 23 | 24 | private: 25 | IAPEProgressCallback * m_pProgressCallback; 26 | unsigned int m_nTotalSteps; 27 | unsigned int m_nCurrentStep; 28 | int m_nLastCallbackFiredPercentageDone; 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /apps/qt5/DlgLoadingMedia.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgLoadingMedia.h" 2 | #include "ui_DlgLoadingMedia.h" 3 | 4 | const char PROGRESS_CHARS[] = "-\\|/-\\|/"; 5 | //const char* PROGRESS_CHARS[] = { ".", "..", "...", "...." }; 6 | 7 | DlgLoadingMedia::DlgLoadingMedia(QWidget* parent) 8 | : QDialog(parent), 9 | ui(new Ui::DlgLoadingMedia), 10 | m_ProgressCharIndex(0) { 11 | ui->setupUi(this); 12 | 13 | setWindowFlags((Qt::CustomizeWindowHint | Qt::Tool | Qt::WindowTitleHint) & ~Qt::WindowMaximizeButtonHint & ~Qt::WindowCloseButtonHint); 14 | setFixedSize(width(), height()); 15 | } 16 | 17 | DlgLoadingMedia::~DlgLoadingMedia() { 18 | delete ui; 19 | } 20 | 21 | void DlgLoadingMedia::SetFileName(const QString& fileName) { 22 | ui->labelFileName->setText(fileName); 23 | ui->labelHintChar->setText(QChar(PROGRESS_CHARS[m_ProgressCharIndex])); 24 | m_ProgressCharIndex = (m_ProgressCharIndex + 1) % (sizeof(PROGRESS_CHARS) - 1); 25 | } 26 | -------------------------------------------------------------------------------- /apps/qt5/IPlaylistView.h: -------------------------------------------------------------------------------- 1 | #ifndef IPLAYLISTVIEW_H 2 | #define IPLAYLISTVIEW_H 3 | 4 | namespace mous { 5 | struct MediaItem; 6 | class MediaLoader; 7 | } // namespace mous 8 | 9 | #include "PlaylistClipboard.h" 10 | 11 | class IPlaylistView { 12 | public: 13 | virtual ~IPlaylistView() { 14 | } 15 | 16 | virtual void SetMediaLoader(const mous::MediaLoader* loader) = 0; 17 | virtual void SetClipboard(PlaylistClipboard* clipboard) = 0; 18 | 19 | virtual const mous::MediaItem* PrevItem() const = 0; 20 | virtual const mous::MediaItem* NextItem() const = 0; 21 | virtual int ItemCount() const = 0; 22 | virtual const char* PlayMode() const = 0; 23 | virtual void SetPlayMode(int mode) = 0; 24 | virtual void Save(const char* filename) const = 0; 25 | virtual void Load(const char* filename) = 0; 26 | 27 | virtual void OnMediaItemUpdated(const mous::MediaItem& item) = 0; 28 | }; 29 | 30 | #endif // IPLAYLISTVIEW_H 31 | -------------------------------------------------------------------------------- /sdk/plugin/OutputProto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "Interface.h" 6 | 7 | static void* Create(); 8 | static void Destroy(void* ptr); 9 | static mous::ErrorCode Open(void* ptr); 10 | static void Close(void* ptr); 11 | static mous::ErrorCode Setup(void* ptr, int32_t* channels, int32_t* sample_rate, int32_t* bits_per_sample); 12 | static mous::ErrorCode Write(void* ptr, const char* data, uint32_t length); 13 | static int GetVolume(void* ptr); 14 | static void SetVolume(void* ptr, int avg); 15 | static const mous::BaseOption** GetOptions(void* ptr); 16 | 17 | static const mous::OutputInterface output_interface{ 18 | Create, 19 | Destroy, 20 | Open, 21 | Close, 22 | Setup, 23 | Write, 24 | GetVolume, 25 | SetVolume, 26 | GetOptions}; 27 | 28 | extern "C" { 29 | const mous::OutputInterface* MousGetOutputInterface() { 30 | return &output_interface; 31 | } 32 | } -------------------------------------------------------------------------------- /apps/qt5/DlgConvertTask.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgConvertTask 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 2 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Auto Close This Dialog Once Finished. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/os_support.h: -------------------------------------------------------------------------------- 1 | #ifndef _OS_SUPPORT_H 2 | #define _OS_SUPPORT_H 3 | 4 | /** 5 | * @file os_support.h 6 | * miscellaneous OS support macros and functions. 7 | * 8 | * - usleep() (Win32, BeOS, OS/2) 9 | * - floatf() (OS/2) 10 | * - strcasecmp() (OS/2) 11 | */ 12 | 13 | #ifdef __MINGW32__ 14 | # undef DATADIR /* clashes with /usr/include/w32api/objidl.h */ 15 | __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds); 16 | // # include 17 | # define usleep(t) Sleep((t) / 1000) 18 | #endif 19 | 20 | #ifdef __BEOS__ 21 | # ifndef usleep 22 | # include 23 | # define usleep(t) snooze((bigtime_t)(t)) 24 | # endif 25 | #endif 26 | 27 | #if defined(CONFIG_OS2) 28 | #include 29 | static inline int usleep(unsigned int t) { return _sleep2(t / 1000); } 30 | static inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1,s2); } 31 | #endif 32 | 33 | #endif /* _OS_SUPPORT_H */ 34 | -------------------------------------------------------------------------------- /sdk/charset/ICharsetConv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "CharsetConvInf.h" 5 | 6 | namespace mous { 7 | 8 | class ICharsetConv { 9 | public: 10 | virtual ~ICharsetConv() { 11 | } 12 | 13 | virtual std::string Probe(const char* buf, size_t len) = 0; 14 | 15 | /* Auto detect the given buf, convert to utf8. */ 16 | virtual bool AutoConv(const char* buf, size_t len, std::string& content) = 0; 17 | 18 | /* Auto detect the given buf, convert to the encoding you want. */ 19 | virtual bool AutoConvTo(const std::string& wanted, 20 | const char* buf, 21 | size_t len, 22 | std::string& content) = 0; 23 | 24 | /* If converted return true, otherwise return false(failed/unnecessary). */ 25 | virtual bool ConvFromTo(const std::string& from, const std::string& wanted, const char* buf, size_t len, std::string& content) = 0; 26 | }; 27 | 28 | } // namespace mous 29 | -------------------------------------------------------------------------------- /apps/qt5/FrmProgressBar.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMPROGRESSBAR_H 2 | #define FRMPROGRESSBAR_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class FrmProgressBar; 8 | } 9 | 10 | class FrmProgressBar : public QWidget { 11 | Q_OBJECT 12 | 13 | public: 14 | explicit FrmProgressBar(QWidget* parent = 0); 15 | ~FrmProgressBar(); 16 | 17 | void SetKey(void* key); 18 | 19 | void SetProgress(int progress); 20 | void SetFileName(const QString& fileName); 21 | 22 | signals: 23 | void SigCanceled(void* key); 24 | 25 | private slots: 26 | void SlotBtnCancel(); 27 | 28 | private: 29 | void UpdatePassedTime(); 30 | 31 | private: 32 | Ui::FrmProgressBar* ui; 33 | void* key; 34 | 35 | struct SpeedRecord { 36 | qint64 time[2]; 37 | int progress[2]; 38 | 39 | SpeedRecord() { 40 | progress[0] = time[0] = -1; 41 | progress[1] = time[1] = -1; 42 | } 43 | }; 44 | 45 | SpeedRecord m_SpeedRecord; 46 | }; 47 | 48 | #endif // FRMPROGRESSBAR_H 49 | -------------------------------------------------------------------------------- /ports/homebrew/mous.rb: -------------------------------------------------------------------------------- 1 | class Mous < Formula 2 | desc "Simple yet powerful audio player for FreeBSD/Linux/macOS" 3 | homepage "https://github.com/bsdelf/mous" 4 | url "https://github.com/bsdelf/mous/archive/v2.0.1.tar.gz" 5 | sha256 "b8866049c225fab2033617908d3c3b353533bc20c274b1fa0d7c034ea1c15cef" 6 | 7 | head "https://github.com/bsdelf/mous.git" 8 | 9 | depends_on "cmake" => :build 10 | depends_on "taglib" => :recommended 11 | depends_on "libcue" => :recommended 12 | depends_on "fdk-aac" => :recommended 13 | depends_on "mpg123" => :recommended 14 | depends_on "flac" => :recommended 15 | depends_on "libogg" => :recommended 16 | depends_on "wavpack" => :recommended 17 | depends_on "qt" => :optional 18 | 19 | def install 20 | mkdir "build" do 21 | system "cmake", "..", *std_cmake_args 22 | system "make", "install" 23 | end 24 | end 25 | 26 | test do 27 | assert_predicate lib/"libMousCore.dylib", :exist? 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /sdk/plugin/FormatProbe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "Interface.h" 11 | #include "InterfaceWrapper.h" 12 | 13 | namespace mous { 14 | 15 | class FormatProbe { 16 | COPY_INTERFACE_WRAPPER_COMMON(FormatProbe, FormatProbeInterface, "MousGetFormatProbeInterface"); 17 | 18 | public: 19 | std::string Probe(const std::string& path) const { 20 | const char* format = m_interface->probe(m_data, path.c_str()); 21 | return {format ? format : ""}; 22 | } 23 | 24 | std::vector FileSuffix() const { 25 | std::vector suffixes; 26 | const char** p = m_interface->get_suffixes(m_data); 27 | if (p) { 28 | for (; *p; ++p) { 29 | suffixes.emplace_back(*p); 30 | } 31 | } 32 | return suffixes; 33 | } 34 | }; 35 | 36 | } // namespace mous 37 | -------------------------------------------------------------------------------- /deps/alac/convert-utility/ALACconvert.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alacConvert", "alacConvert.vcproj", "{B9B08911-AF77-447E-A4DD-692AFFA0E346}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B9B08911-AF77-447E-A4DD-692AFFA0E346}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {B9B08911-AF77-447E-A4DD-692AFFA0E346}.Debug|Win32.Build.0 = Debug|Win32 14 | {B9B08911-AF77-447E-A4DD-692AFFA0E346}.Release|Win32.ActiveCfg = Release|Win32 15 | {B9B08911-AF77-447E-A4DD-692AFFA0E346}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /core/Converter.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ConverterImpl.h" 3 | 4 | namespace mous { 5 | 6 | Converter::Converter() 7 | : impl(std::make_unique()) { 8 | } 9 | 10 | Converter::~Converter() { 11 | } 12 | 13 | void Converter::LoadDecoderPlugin(const std::shared_ptr& plugin) { 14 | return impl->LoadDecoderPlugin(plugin); 15 | } 16 | 17 | void Converter::LoadEncoderPlugin(const std::shared_ptr& plugin) { 18 | return impl->LoadEncoderPlugin(plugin); 19 | } 20 | 21 | void Converter::UnloadPlugin(const std::string& path) { 22 | return impl->UnloadPlugin(path); 23 | } 24 | 25 | void Converter::UnloadPlugin() { 26 | return impl->UnloadPlugin(); 27 | } 28 | 29 | std::vector Converter::EncoderNames() const { 30 | return impl->EncoderNames(); 31 | } 32 | 33 | std::shared_ptr Converter::CreateConversion(const MediaItem& item, const std::string& encoder) const { 34 | return impl->CreateConversion(item, encoder); 35 | } 36 | 37 | } // namespace mous 38 | -------------------------------------------------------------------------------- /core/MediaLoader.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "MediaLoaderImpl.h" 5 | 6 | namespace mous { 7 | 8 | MediaLoader::MediaLoader() 9 | : impl(std::make_unique()) { 10 | } 11 | 12 | MediaLoader::~MediaLoader() { 13 | } 14 | 15 | void MediaLoader::LoadSheetParserPlugin(const std::shared_ptr& plugin) { 16 | return impl->LoadSheetParserPlugin(plugin); 17 | } 18 | 19 | void MediaLoader::LoadTagParserPlugin(const std::shared_ptr& plugin) { 20 | return impl->LoadTagParserPlugin(plugin); 21 | } 22 | 23 | void MediaLoader::UnloadPlugin(const std::string& path) { 24 | return impl->UnloadPlugin(path); 25 | } 26 | 27 | void MediaLoader::UnloadPlugin() { 28 | return impl->UnloadPlugin(); 29 | } 30 | 31 | std::vector MediaLoader::SupportedSuffixes() const { 32 | return impl->SupportedSuffixes(); 33 | } 34 | 35 | ErrorCode MediaLoader::LoadMedia(const std::string& path, std::deque& list) const { 36 | return impl->LoadMedia(path, list); 37 | } 38 | 39 | } // namespace mous 40 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/WindowsEnvironment.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /***************************************************************************************** 4 | Windows version 5 | *****************************************************************************************/ 6 | #ifndef WINVER 7 | #define WINVER 0x0501 8 | #define _WIN32_WINNT 0x0501 9 | #define _WIN32_WINDOWS 0x0501 10 | #define _WIN32_IE 0x0501 11 | #endif 12 | 13 | /***************************************************************************************** 14 | Unicode 15 | *****************************************************************************************/ 16 | #ifndef UNICODE 17 | #define UNICODE 18 | #endif 19 | #ifndef _UNICODE 20 | #define _UNICODE 21 | #endif 22 | 23 | /***************************************************************************************** 24 | Visual Studio defines 25 | *****************************************************************************************/ 26 | #define _CRT_NON_CONFORMING_SWPRINTFS 27 | #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS -------------------------------------------------------------------------------- /apps/qt5/DlgConvertOption.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace Ui { 8 | class DlgConvertOption; 9 | } 10 | 11 | namespace mous { 12 | struct BaseOption; 13 | struct GroupedOption; 14 | } // namespace mous 15 | 16 | class DlgConvertOption : public QDialog { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit DlgConvertOption(QWidget* parent = 0); 21 | ~DlgConvertOption(); 22 | 23 | QString Dir() const; 24 | void SetDir(const QString& dir); 25 | QString FileName() const; 26 | void SetFileName(const QString& name); 27 | 28 | void BindWidgetAndOption(const std::vector& opts); 29 | 30 | private: 31 | void BuildWidgetAndOption(QBoxLayout* layout, const mous::BaseOption* option); 32 | 33 | private slots: 34 | void SlotGroupChanged(int index); 35 | void SlotIntValChanged(int val); 36 | 37 | private: 38 | Ui::DlgConvertOption* ui; 39 | QHash > m_ComboxWidgetHash; 40 | QHash m_WidgetOptionHash; 41 | }; 42 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/WinampSettingsDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | #include "afxcmn.h" 5 | 6 | class CWinampSettingsDlg : public CDialog 7 | { 8 | DECLARE_DYNAMIC(CWinampSettingsDlg) 9 | 10 | public: 11 | 12 | CWinampSettingsDlg(CWnd * pParent = NULL); 13 | virtual ~CWinampSettingsDlg(); 14 | 15 | BOOL Show(HWND hwndParent); 16 | 17 | virtual BOOL OnInitDialog(); 18 | enum { IDD = IDD_WINAMP_SETTINGS }; 19 | 20 | BOOL m_bIgnoreBitstreamErrors; 21 | BOOL m_bSuppressSilence; 22 | BOOL m_bScaleOutput; 23 | CString m_strFileDisplayMethod; 24 | int m_nThreadPriority; 25 | 26 | protected: 27 | 28 | virtual void DoDataExchange(CDataExchange * pDX); 29 | virtual void OnOK(); 30 | DECLARE_MESSAGE_MAP() 31 | 32 | CSliderCtrl m_ctrlThreadPrioritySlider; 33 | HWND m_hwndParent; 34 | 35 | CString m_strSettingsFilename; 36 | BOOL LoadSettings(); 37 | BOOL SaveSettings(); 38 | int GetSliderFromThreadPriority(); 39 | int GetThreadPriorityFromSlider(); 40 | }; 41 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/WindowsEnvironment.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /***************************************************************************************** 4 | Windows version 5 | *****************************************************************************************/ 6 | #ifndef WINVER 7 | #define WINVER 0x0501 8 | #define _WIN32_WINNT 0x0501 9 | #define _WIN32_WINDOWS 0x0501 10 | #define _WIN32_IE 0x0501 11 | #endif 12 | 13 | /***************************************************************************************** 14 | Unicode 15 | *****************************************************************************************/ 16 | #ifndef UNICODE 17 | #define UNICODE 18 | #endif 19 | #ifndef _UNICODE 20 | #define _UNICODE 21 | #endif 22 | 23 | /***************************************************************************************** 24 | Visual Studio defines 25 | *****************************************************************************************/ 26 | #define _CRT_NON_CONFORMING_SWPRINTFS 27 | #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS -------------------------------------------------------------------------------- /sdk/plugin/SheetParser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Interface.h" 9 | #include "InterfaceWrapper.h" 10 | 11 | namespace mous { 12 | 13 | struct MediaItem; 14 | 15 | class SheetParser { 16 | COPY_INTERFACE_WRAPPER_COMMON(SheetParser, SheetParserInterface, "MousGetSheetParserInterface"); 17 | 18 | public: 19 | void DumpFile(const std::string& path, std::deque& list) const { 20 | return m_interface->dump_file(m_data, path.c_str(), &list); 21 | } 22 | 23 | void DumpStream(const std::string& stream, std::deque& list) const { 24 | return m_interface->dump_stream(m_data, stream.c_str(), &list); 25 | } 26 | 27 | std::vector FileSuffix() const { 28 | std::vector suffixes; 29 | const char** p = m_interface->get_suffixes(m_data); 30 | if (p) { 31 | for (; *p; ++p) { 32 | suffixes.emplace_back(*p); 33 | } 34 | } 35 | return suffixes; 36 | } 37 | }; 38 | 39 | } // namespace mous 40 | -------------------------------------------------------------------------------- /deps/uchardect/CharsetConv.h: -------------------------------------------------------------------------------- 1 | #ifndef MOUS_CHARSETCONV_H 2 | #define MOUS_CHARSETCONV_H 3 | 4 | #include 5 | #include 6 | 7 | namespace mous { 8 | 9 | class nsDetectorWrapper; 10 | 11 | class CharsetConv: public ICharsetConv 12 | { 13 | public: 14 | CharsetConv(int buflen = 1024); 15 | ~CharsetConv(); 16 | 17 | public: 18 | std::string Probe(const char* buf, size_t len); 19 | 20 | /* Auto detect the given buf, convert to utf8. */ 21 | bool AutoConv(const char* buf, size_t len, std::string& content); 22 | 23 | /* Auto detect the given buf, convert to the encoding you want. */ 24 | bool AutoConvTo(const std::string& wanted, 25 | const char* buf, size_t len, std::string& content); 26 | 27 | /* If converted return true, otherwise return false(failed/unnecessary). */ 28 | bool ConvFromTo(const std::string& from, const std::string& wanted, 29 | const char* buf, size_t len, std::string& content); 30 | 31 | private: 32 | nsDetectorWrapper* mDetector; 33 | char* const mBuffer; 34 | size_t mBufferLen; 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sdk/plugin/Output.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "Interface.h" 11 | #include "InterfaceWrapper.h" 12 | 13 | namespace mous { 14 | 15 | class Output { 16 | COPY_INTERFACE_WRAPPER_COMMON(Output, OutputInterface, "MousGetOutputInterface"); 17 | 18 | public: 19 | ErrorCode Open() { 20 | return m_interface->open(m_data); 21 | } 22 | 23 | void Close() { 24 | return m_interface->close(m_data); 25 | } 26 | 27 | ErrorCode Setup(int32_t& channels, int32_t& sample_rate, int32_t& bits_per_sample) { 28 | return m_interface->setup(m_data, &channels, &sample_rate, &bits_per_sample); 29 | } 30 | 31 | ErrorCode Write(const char* data, uint32_t length) { 32 | return m_interface->write(m_data, data, length); 33 | } 34 | 35 | int GetVolume() const { 36 | return m_interface->get_volume(m_data); 37 | } 38 | 39 | void SetVolume(int level) { 40 | return m_interface->set_volume(m_data, level); 41 | } 42 | }; 43 | 44 | } // namespace mous 45 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | Bugs: 2 | 3 | - ncurses 前端在进入权限不足的目录时崩溃 4 | - qt 前端保存的图片在 sony walkman 中不支持,tag 规范 5 | - qt 前端暂停后编辑 tag ,继续播放卡死 6 | - qt 前端格式转换对话框打开时,切歌崩溃 7 | 8 | Architecture: 9 | 10 | - Log system 11 | - Plugin ABI compatible issue 12 | - Profile the performance and overhead of inter-thread communication based on mailbox 13 | - Implement filter plugin interface 14 | - Implement player statistics plugin interface 15 | - Support unit test 16 | 17 | Features: 18 | 19 | - m3u, m3u8 playlist 20 | - PulseAudio output 21 | - libresample, libsamplerate 22 | - libsndfile 23 | - TTA codec 24 | - Raw AAC 25 | - 音效插件 26 | - 音量均衡插件 27 | - 播放统计插件 28 | - APE/FLAC 内嵌 CUE 29 | - 支持除了 FrontCover 之外的封面,flac,ape 等格式的封面 30 | - 更好的播放列表序列化格式? 31 | 32 | Qt: 33 | 34 | - 涉及 player, playlist 的操作需要 mutex 保护 35 | - 播放列表排序,改变列顺序,添加删除列 36 | - 更多设置选项 37 | - 音效 38 | - 频谱,可视化 39 | - 媒体管理? 40 | - 歌词? 41 | 42 | ncurses client side: 43 | 44 | - 文件查找,播放列表复制粘贴 45 | - 支持配置快捷键和色彩? 46 | 47 | ncurses server side: 48 | 49 | - Introduce the concept of protocol parser 50 | - Use asynchronous I/O + worker instead of multi-threaded model 51 | - Tag each packet with UUID and match ack with command id 52 | -------------------------------------------------------------------------------- /core/Conversion.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ConversionImpl.h" 3 | 4 | namespace mous { 5 | 6 | Conversion::Conversion(const MediaItem& item, 7 | const std::shared_ptr& decoderPlugin, 8 | const std::shared_ptr& encoderPlugin) 9 | : impl(std::make_unique(item, decoderPlugin, encoderPlugin)) { 10 | } 11 | 12 | Conversion::~Conversion() { 13 | } 14 | 15 | std::vector Conversion::DecoderOptions() const { 16 | return impl->DecoderOptions(); 17 | } 18 | 19 | std::vector Conversion::EncoderOptions() const { 20 | return impl->EncoderOptions(); 21 | } 22 | 23 | std::string Conversion::EncoderFileSuffix() const { 24 | return impl->EncoderFileSuffix(); 25 | } 26 | 27 | void Conversion::Run(const std::string& output) { 28 | return impl->Run(output); 29 | } 30 | 31 | void Conversion::Cancel() { 32 | return impl->Cancel(); 33 | } 34 | 35 | double Conversion::Progress() const { 36 | return impl->Progress(); 37 | } 38 | 39 | bool Conversion::IsFinished() const { 40 | return impl->IsFinished(); 41 | } 42 | 43 | } // namespace mous 44 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/Old/APEDecompressOld.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../APEDecompress.h" 4 | #include "UnMAC.h" 5 | 6 | namespace APE 7 | { 8 | 9 | class CAPEDecompressOld : public IAPEDecompress 10 | { 11 | public: 12 | CAPEDecompressOld(int * pErrorCode, CAPEInfo * pAPEInfo, int nStartBlock = -1, int nFinishBlock = -1); 13 | ~CAPEDecompressOld(); 14 | 15 | int GetData(char * pBuffer, intn nBlocks, intn * pBlocksRetrieved); 16 | int Seek(intn nBlockOffset); 17 | 18 | intn GetInfo(APE_DECOMPRESS_FIELDS Field, intn nParam1 = 0, intn nParam2 = 0); 19 | 20 | protected: 21 | // buffer 22 | CSmartPtr m_spBuffer; 23 | intn m_nBufferTail; 24 | 25 | // file info 26 | intn m_nBlockAlign; 27 | intn m_nCurrentFrame; 28 | 29 | // start / finish information 30 | intn m_nStartBlock; 31 | intn m_nFinishBlock; 32 | intn m_nCurrentBlock; 33 | bool m_bIsRanged; 34 | 35 | // decoding tools 36 | CUnMAC m_UnMAC; 37 | CSmartPtr m_spAPEInfo; 38 | 39 | bool m_bDecompressorInitialized; 40 | int InitializeDecompressor(); 41 | }; 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /plugins/opus/Encoder.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | using namespace mous; 5 | 6 | namespace { 7 | struct Self { 8 | }; 9 | } 10 | 11 | static void* Create() { 12 | return new Self(); 13 | } 14 | 15 | static void Destroy(void* ptr) { 16 | delete SELF; 17 | } 18 | 19 | void SetChannels(void* ptr, int32_t channels) { 20 | } 21 | 22 | static void SetSampleRate(void* ptr, int32_t sampleRate) { 23 | } 24 | 25 | static void SetBitsPerSample(void* ptr, int32_t bitsPerSample) { 26 | } 27 | 28 | static void SetMediaTag(void* ptr, const MediaTag* tag){ 29 | } 30 | 31 | static ErrorCode OpenOutput(void* ptr, const char* path) 32 | { 33 | return ErrorCode::Ok; 34 | } 35 | 36 | static void CloseOutput(void* ptr) 37 | { 38 | } 39 | 40 | static ErrorCode Encode(void* ptr, const char* data, uint32_t length) { 41 | return ErrorCode::EncoderFailedToEncode; 42 | } 43 | 44 | static ErrorCode Flush(void* ptr) { 45 | return ErrorCode::EncoderFailedToFlush; 46 | } 47 | 48 | static const BaseOption** GetOptions(void* ptr) { 49 | (void) ptr; 50 | return nullptr; 51 | } 52 | 53 | static const char* GetSuffix(void* ptr) { 54 | return "opus"; 55 | } 56 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/Old/APEDecompressCore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | class CAPEDecompressCore 7 | { 8 | public: 9 | CAPEDecompressCore(CIO * pIO, IAPEDecompress * pAPEDecompress); 10 | ~CAPEDecompressCore(); 11 | 12 | void GenerateDecodedArrays(intn nBlocks, intn nSpecialCodes, intn nFrameIndex, intn nCPULoadBalancingFactor); 13 | void GenerateDecodedArray(int *Input_Array, uint32 Number_of_Elements, intn Frame_Index, CAntiPredictor *pAntiPredictor, intn CPULoadBalancingFactor = 0); 14 | 15 | int * GetDataX() { return m_pDataX; } 16 | int * GetDataY() { return m_pDataY; } 17 | 18 | CUnBitArrayBase * GetUnBitArrray() { return m_pUnBitArray; } 19 | 20 | int * m_pTempData; 21 | int * m_pDataX; 22 | int * m_pDataY; 23 | 24 | CAntiPredictor * m_pAntiPredictorX; 25 | CAntiPredictor * m_pAntiPredictorY; 26 | 27 | CUnBitArrayBase * m_pUnBitArray; 28 | BIT_ARRAY_STATE m_BitArrayStateX; 29 | BIT_ARRAY_STATE m_BitArrayStateY; 30 | 31 | IAPEDecompress * m_pAPEDecompress; 32 | 33 | bool m_bMMXAvailable; 34 | int m_nBlocksProcessed; 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/Predictor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | /************************************************************************************************* 7 | IPredictorCompress - the interface for compressing (predicting) data 8 | *************************************************************************************************/ 9 | class IPredictorCompress 10 | { 11 | public: 12 | IPredictorCompress(intn nCompressionLevel) {} 13 | virtual ~IPredictorCompress() {} 14 | 15 | virtual int CompressValue(int nA, int nB = 0) = 0; 16 | virtual int Flush() = 0; 17 | }; 18 | 19 | /************************************************************************************************* 20 | IPredictorDecompress - the interface for decompressing (un-predicting) data 21 | *************************************************************************************************/ 22 | class IPredictorDecompress 23 | { 24 | public: 25 | IPredictorDecompress(intn nCompressionLevel, intn nVersion) {} 26 | virtual ~IPredictorDecompress() {} 27 | 28 | virtual int DecompressValue(int nA, int nB = 0) = 0; 29 | virtual int Flush() = 0; 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sdk/util/ErrorCode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace mous { 6 | 7 | enum class ErrorCode : uint32_t { 8 | Ok = 0, 9 | 10 | FileNotFound, 11 | 12 | PluginFailedToOpen, 13 | PluginBadFormat, 14 | 15 | DecoderFailedToOpen, 16 | DecoderFailedToInit, 17 | DecoderFailedToRead, 18 | DecoderOutOfRange, 19 | 20 | EncoderFailedToOpen, 21 | EncoderFailedToInit, 22 | EncoderFailedToEncode, 23 | EncoderFailedToFlush, 24 | 25 | OutputFailedToOpen, 26 | OutputFailedToSetup, 27 | OutputFailedToWrite, 28 | OutputBadChannels, 29 | OutputBadSampleRate, 30 | OutputBadBitsPerSample, 31 | OutputIsNotSupported, 32 | 33 | PlayerNoDecoder, 34 | PlayerNoOutput, 35 | 36 | TagPraserFailedToWrite, 37 | 38 | MediaLoaderFailedToLoad, 39 | 40 | PlaylistEmpty, 41 | PlaylistHitBegin, 42 | PlaylistHitEnd 43 | }; 44 | 45 | /* 46 | const char* const ErrorMsg[] = { 47 | "OK.", 48 | 49 | "Decoder failed to initialize!", 50 | "Decoder failed to open file!" 51 | 52 | "Bad format!", 53 | "Format is not supported!", 54 | 55 | "Output is not supported!", 56 | 57 | "File not found!", 58 | "Out of range!" 59 | }; 60 | */ 61 | 62 | } // namespace mous 63 | -------------------------------------------------------------------------------- /apps/ncurses/ServerContext.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | #include 8 | using namespace scx; 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | using namespace mous; 15 | 16 | struct ServerContext { 17 | mutex mtx; 18 | 19 | MediaLoader loader; 20 | Player player; 21 | 22 | typedef Playlist playlist_t; 23 | vector playlists; 24 | 25 | PlaylistMode playMode; 26 | 27 | int usedPlaylist; 28 | int selectedPlaylist; 29 | vector selectedItem; 30 | 31 | Signal sigPlayNextItem; 32 | 33 | public: 34 | ServerContext(); 35 | ~ServerContext(); 36 | 37 | bool Init(); 38 | void Cleanup(); 39 | 40 | void Dump(); 41 | void Restore(); 42 | 43 | void NextPlayMode(); 44 | 45 | bool PlayAt(int iList, int iItem); 46 | bool PlayNext(char direct); 47 | void PausePlayer(); 48 | const MediaItem* ItemInPlaying() const; 49 | 50 | private: 51 | void SetPlayMode(PlaylistMode mode); 52 | 53 | void ClosePlayer(); 54 | bool PlayItem(const MediaItem& item); 55 | 56 | void SlotFinished(); 57 | }; 58 | -------------------------------------------------------------------------------- /apps/ncurses/StatusView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | using namespace mous; 7 | 8 | #include "BaseView.h" 9 | #include "ClientPlayerHandler.h" 10 | #include "Ncurses.h" 11 | 12 | class StatusView : public BaseView { 13 | public: 14 | StatusView(); 15 | ~StatusView(); 16 | 17 | void Refresh(); 18 | bool NeedRefresh() const; 19 | 20 | void MoveTo(int x, int y); 21 | void Resize(int w, int h); 22 | 23 | bool InjectKey(int key); 24 | 25 | void Show(bool show); 26 | bool IsShown() const; 27 | 28 | public: 29 | int MinHeight() const; 30 | 31 | void SetPlayerHandler(ClientPlayerHandler* handler); 32 | 33 | private: 34 | void SlotPause(); 35 | void SlotSeek(); 36 | void SlotVolume(int); 37 | void SlotPlayNext(bool); 38 | void SlotPlayMode(const std::string&); 39 | void SlotStatus(const ClientPlayerHandler::PlayerStatus&); 40 | 41 | private: 42 | ncurses::Window d; 43 | 44 | ClientPlayerHandler* m_PlayerHandler = nullptr; 45 | 46 | mutable std::mutex m_RefreshMutex; 47 | bool m_WaitReply = false; 48 | int m_NeedRefresh = 0; 49 | int m_Volume = 0; 50 | std::string m_PlayMode; 51 | ClientPlayerHandler::PlayerStatus m_PlayerStatus; 52 | }; 53 | -------------------------------------------------------------------------------- /plugins/alac/Encoder.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | #include 6 | using namespace mous; 7 | 8 | namespace { 9 | struct Self { 10 | }; 11 | } 12 | 13 | static void* Create() { 14 | auto self = new Self; 15 | return self; 16 | } 17 | 18 | static void Destroy(void* ptr) { 19 | delete SELF; 20 | } 21 | 22 | void SetChannels(void* ptr, int32_t channels) { 23 | } 24 | 25 | void SetSampleRate(void* ptr, int32_t sample_rate) { 26 | } 27 | 28 | static void SetBitsPerSample(void* ptr, int32_t bits_per_sample) { 29 | } 30 | 31 | static void SetMediaTag(void* ptr, const MediaTag* tag) { 32 | 33 | } 34 | 35 | static ErrorCode OpenOutput(void* ptr, const char* path) { 36 | return ErrorCode::Ok; 37 | } 38 | 39 | static void CloseOutput(void* ptr) { 40 | 41 | } 42 | 43 | static ErrorCode Encode(void* ptr, const char* data, uint32_t length) { 44 | return ErrorCode::Ok; 45 | } 46 | 47 | static ErrorCode Flush(void* ptr) { 48 | return ErrorCode::Ok; 49 | } 50 | 51 | static const BaseOption** GetOptions(void* ptr) { 52 | (void) ptr; 53 | return nullptr; 54 | } 55 | 56 | static const char* GetSuffix(void* ptr) { 57 | return "caf"; 58 | } 59 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Info.txt: -------------------------------------------------------------------------------- 1 | ID3v1.pas 2 | Tested with Borland Delphi 3,4,5,6 3 | 4 | { *************************************************************************** } 5 | { } 6 | { Audio Tools Library (Freeware) } 7 | { Class TID3v1 - for manipulating with ID3v1 tags } 8 | { } 9 | { Copyright (c) 2001,2002 by Jurgen Faul } 10 | { E-mail: jfaul@gmx.de } 11 | { http://jfaul.de/atl } 12 | { } 13 | { Version 1.0 (25 July 2001) } 14 | { - Reading & writing support for ID3v1.x tags } 15 | { - Tag info: title, artist, album, track, year, genre, comment } 16 | { } 17 | { *************************************************************************** } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/Old/UnBitArrayOld.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../UnBitArrayBase.h" 4 | 5 | namespace APE 6 | { 7 | 8 | class IAPEDecompress; 9 | 10 | // decodes 0000 up to and including 3890 11 | class CUnBitArrayOld : public CUnBitArrayBase 12 | { 13 | public: 14 | // construction/destruction 15 | CUnBitArrayOld(IAPEDecompress * pAPEDecompress, intn nVersion, intn nFurthestReadByte); 16 | ~CUnBitArrayOld(); 17 | 18 | // functions 19 | void GenerateArray(int * pOutputArray, int nElements, intn nBytesRequired = -1); 20 | unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0); 21 | 22 | private: 23 | // helpers 24 | void GenerateArrayOld(int * pOutputArray, uint32 NumberOfElements, int MinimumBitArrayBytes); 25 | void GenerateArrayRice(int * pOutputArray, uint32 NumberOfElements, int MinimumBitArrayBytes); 26 | uint32 DecodeValueRiceUnsigned(uint32 k); 27 | 28 | // data 29 | uint32 k; 30 | uint32 K_Sum; 31 | uint32 m_nRefillBitThreshold; 32 | 33 | // functions 34 | __forceinline int DecodeValueNew(bool bCapOverflow); 35 | uint32 GetBitsRemaining(); 36 | __forceinline uint32 Get_K(uint32 x); 37 | }; 38 | 39 | } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/StdLibFileIO.h: -------------------------------------------------------------------------------- 1 | #ifdef IO_USE_STD_LIB_FILE_IO 2 | 3 | #pragma once 4 | 5 | #include "IO.h" 6 | 7 | namespace APE 8 | { 9 | 10 | class CStdLibFileIO : public CIO 11 | { 12 | public: 13 | // construction / destruction 14 | CStdLibFileIO(); 15 | ~CStdLibFileIO(); 16 | 17 | // open / close 18 | int Open(const wchar_t * pName, bool bOpenReadOnly = false); 19 | int Close(); 20 | 21 | // read / write 22 | int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead); 23 | int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten); 24 | 25 | // seek 26 | int Seek(intn nDistance, unsigned int nMoveMode); 27 | 28 | // other functions 29 | int SetEOF(); 30 | 31 | // creation / destruction 32 | int Create(const wchar_t * pName); 33 | int Delete(); 34 | 35 | // attributes 36 | int GetPosition(); 37 | unsigned int GetSize(); 38 | int GetName(wchar_t * pBuffer); 39 | int GetHandle(); 40 | 41 | private: 42 | 43 | wchar_t m_cFileName[MAX_PATH]; 44 | bool m_bReadOnly; 45 | FILE * m_pFile; 46 | }; 47 | 48 | } 49 | 50 | #endif // #ifdef IO_USE_STD_LIB_FILE_IO 51 | -------------------------------------------------------------------------------- /apps/qt5/DlgListSelect.cpp: -------------------------------------------------------------------------------- 1 | #include "DlgListSelect.h" 2 | #include "ui_DlgListSelect.h" 3 | 4 | DlgListSelect::DlgListSelect(QWidget* parent) 5 | : QDialog(parent), 6 | ui(new Ui::DlgListSelect) { 7 | ui->setupUi(this); 8 | ui->listWidget->setAlternatingRowColors(true); 9 | 10 | connect(ui->btnOk, SIGNAL(clicked()), this, SLOT(accept())); 11 | connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject())); 12 | connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(accept())); 13 | 14 | setWindowFlags((Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::Tool) & ~Qt::WindowMaximizeButtonHint); 15 | setFixedSize(width(), height()); 16 | } 17 | 18 | DlgListSelect::~DlgListSelect() { 19 | delete ui; 20 | } 21 | 22 | void DlgListSelect::SetItems(const QStringList& items) { 23 | for (int i = 0; i < items.size(); ++i) { 24 | QListWidgetItem* widgetItem = new QListWidgetItem(items.at(i)); 25 | widgetItem->setSizeHint(QSize(-1, 22)); 26 | ui->listWidget->addItem(widgetItem); 27 | } 28 | } 29 | 30 | void DlgListSelect::SetSelectedIndex(int index) { 31 | ui->listWidget->setCurrentRow(index); 32 | } 33 | 34 | int DlgListSelect::GetSelectedIndex() const { 35 | return ui->listWidget->currentIndex().row(); 36 | } 37 | -------------------------------------------------------------------------------- /sdk/plugin/EncoderProto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Interface.h" 9 | 10 | static void* Create(); 11 | static void Destroy(void* ptr); 12 | static void SetChannels(void* ptr, int32_t channels); 13 | static void SetSampleRate(void* ptr, int32_t sample_rate); 14 | static void SetBitsPerSample(void* ptr, int32_t bits_per_sample); 15 | static void SetMediaTag(void* ptr, const mous::MediaTag* tag); 16 | static mous::ErrorCode OpenOutput(void* ptr, const char* path); 17 | static void CloseOutput(void* ptr); 18 | static mous::ErrorCode Encode(void* ptr, const char* data, uint32_t length); 19 | static mous::ErrorCode Flush(void* ptr); 20 | static const mous::BaseOption** GetOptions(void* ptr); 21 | static const char* GetSuffix(void* ptr); 22 | 23 | static mous::EncoderInterface encoder_interface{ 24 | Create, 25 | Destroy, 26 | SetChannels, 27 | SetSampleRate, 28 | SetBitsPerSample, 29 | SetMediaTag, 30 | OpenOutput, 31 | CloseOutput, 32 | Encode, 33 | Flush, 34 | GetOptions, 35 | GetSuffix}; 36 | 37 | extern "C" { 38 | const mous::EncoderInterface* MousGetEncoderInterface() { 39 | return &encoder_interface; 40 | } 41 | } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/WinFileIO.h: -------------------------------------------------------------------------------- 1 | #ifdef IO_USE_WIN_FILE_IO 2 | 3 | #ifndef _winfileio_h_ 4 | #define _winfileio_h_ 5 | 6 | #include "IO.h" 7 | 8 | namespace APE 9 | { 10 | 11 | class CWinFileIO : public CIO 12 | { 13 | public: 14 | // construction / destruction 15 | CWinFileIO(); 16 | ~CWinFileIO(); 17 | 18 | // open / close 19 | int Open(const wchar_t * pName, bool bOpenReadOnly = false); 20 | int Close(); 21 | 22 | // read / write 23 | int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead); 24 | int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten); 25 | 26 | // seek 27 | int Seek(intn nDistance, unsigned int nMoveMode); 28 | 29 | // other functions 30 | int SetEOF(); 31 | 32 | // creation / destruction 33 | int Create(const wchar_t * pName); 34 | int Delete(); 35 | 36 | // attributes 37 | int GetPosition(); 38 | unsigned int GetSize(); 39 | int GetName(wchar_t * pBuffer); 40 | 41 | private: 42 | 43 | HANDLE m_hFile; 44 | wchar_t m_cFileName[MAX_PATH]; 45 | bool m_bReadOnly; 46 | }; 47 | 48 | } 49 | 50 | #endif //_winfileio_h_ 51 | 52 | #endif //IO_USE_WIN_FILE_IO -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/IO.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | #ifndef FILE_BEGIN 7 | #define FILE_BEGIN 0 8 | #endif 9 | 10 | #ifndef FILE_CURRENT 11 | #define FILE_CURRENT 1 12 | #endif 13 | 14 | #ifndef FILE_END 15 | #define FILE_END 2 16 | #endif 17 | 18 | class CIO 19 | { 20 | public: 21 | // construction / destruction 22 | CIO() { } 23 | virtual ~CIO() { }; 24 | 25 | // open / close 26 | virtual int Open(const wchar_t * pName, bool bOpenReadOnly = false) = 0; 27 | virtual int Close() = 0; 28 | 29 | // read / write 30 | virtual int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead) = 0; 31 | virtual int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten) = 0; 32 | 33 | // seek 34 | virtual int Seek(intn nDistance, unsigned int nMoveMode) = 0; 35 | 36 | // creation / destruction 37 | virtual int Create(const wchar_t * pName) = 0; 38 | virtual int Delete() = 0; 39 | 40 | // other functions 41 | virtual int SetEOF() = 0; 42 | 43 | // attributes 44 | virtual int GetPosition() = 0; 45 | virtual unsigned int GetSize() = 0; 46 | virtual int GetName(wchar_t * pBuffer) = 0; 47 | }; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/Timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef WIN32 4 | 5 | namespace APE 6 | { 7 | 8 | /******************************************************************************************************************************* 9 | CTimer 10 | *******************************************************************************************************************************/ 11 | class CTimer 12 | { 13 | public: 14 | CTimer() 15 | { 16 | QueryPerformanceFrequency(&m_Frequency); 17 | QueryPerformanceCounter(&m_Timer); 18 | } 19 | 20 | void Reset() 21 | { 22 | QueryPerformanceCounter(&m_Timer); 23 | } 24 | 25 | double GetElapsedMS(bool bReset = false) 26 | { 27 | double dElapsedMS = 0; 28 | 29 | // get now time 30 | LARGE_INTEGER Now; 31 | QueryPerformanceCounter(&Now); 32 | 33 | // get elapsed units 34 | int64 nElapsedUnits = Now.QuadPart - m_Timer.QuadPart; 35 | 36 | // get elapsed milliseconds 37 | if (m_Frequency.QuadPart > 0) 38 | { 39 | dElapsedMS = double(nElapsedUnits) * double(1000) / double(m_Frequency.QuadPart); 40 | } 41 | 42 | // reset 43 | if (bReset) 44 | Reset(); 45 | 46 | return dElapsedMS; 47 | } 48 | 49 | private: 50 | 51 | LARGE_INTEGER m_Timer; 52 | LARGE_INTEGER m_Frequency; 53 | }; 54 | 55 | } 56 | 57 | #endif -------------------------------------------------------------------------------- /apps/cli/img.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | using namespace scx; 6 | 7 | #include "cmd.h" 8 | #include "ctx.h" 9 | 10 | int cmd_img(int argc, char** argv) { 11 | for (int i = 1; i < argc; ++i) { 12 | FileInfo info(argv[i]); 13 | if (!info.Exists() || (info.Type() == FileType::Directory)) { 14 | printf("invaild file: %s\n", argv[i]); 15 | continue; 16 | } 17 | 18 | auto parser = ctx->tagParserFactory.CreateParser(argv[i]); 19 | if (!parser) { 20 | printf("no parser!\n"); 21 | continue; 22 | } 23 | 24 | std::vector buf; 25 | parser->Open(argv[i]); 26 | parser->DumpCoverArt(buf); 27 | printf("cover art size: %zu\n", buf.size()); 28 | if (!buf.empty()) { 29 | const char* file = (info.BaseName() + ".pic").c_str(); 30 | printf("save to: %s\n", file); 31 | 32 | FileInfo info(file); 33 | if (info.Exists()) { 34 | printf("file already exist! overwrite? [n/y] "); 35 | char ch; 36 | scanf("%c", &ch); 37 | if (ch == 'y') { 38 | return 0; 39 | } 40 | } 41 | 42 | std::ofstream outfile(file); 43 | outfile.write(buf.data(), buf.size()); 44 | outfile.close(); 45 | } 46 | parser->Close(); 47 | } 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /apps/qt5/UiHelper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace sqt { 6 | 7 | static inline void SetActionSeparator(QList list) { 8 | for (int i = 0; i < list.size(); ++i) { 9 | QAction* action = list[i]; 10 | if (action->text().isEmpty()) 11 | action->setSeparator(true); 12 | } 13 | } 14 | 15 | static inline void AdjustAllStackPages(QStackedWidget* stack, QSizePolicy plicy) { 16 | for (int i = 0; i < stack->count(); ++i) { 17 | stack->widget(i)->setSizePolicy(plicy); 18 | } 19 | } 20 | 21 | static inline void SwitchStackPage(QStackedWidget* stack, int index) { 22 | const int pageCount = stack->count(); 23 | if (pageCount != 0) { 24 | QSizePolicy policyMin(QSizePolicy::Ignored, QSizePolicy::Ignored); 25 | QSizePolicy policyMax(QSizePolicy::Expanding, QSizePolicy::Expanding); 26 | 27 | // minimal previous page 28 | if (stack->currentIndex() != index) { 29 | stack->currentWidget()->setSizePolicy(policyMin); 30 | } else { 31 | // minimal all page 32 | AdjustAllStackPages(stack, policyMin); 33 | } 34 | // show and maximal new page 35 | stack->setCurrentIndex(index); 36 | stack->currentWidget()->setSizePolicy(policyMax); 37 | stack->adjustSize(); 38 | } 39 | } 40 | 41 | } // namespace sqt 42 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/IO.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | #ifndef FILE_BEGIN 7 | #define FILE_BEGIN 0 8 | #endif 9 | 10 | #ifndef FILE_CURRENT 11 | #define FILE_CURRENT 1 12 | #endif 13 | 14 | #ifndef FILE_END 15 | #define FILE_END 2 16 | #endif 17 | 18 | class CIO 19 | { 20 | public: 21 | // construction / destruction 22 | CIO() { } 23 | virtual ~CIO() { }; 24 | 25 | // open / close 26 | virtual int Open(const wchar_t * pName, bool bOpenReadOnly = false) = 0; 27 | virtual int Close() = 0; 28 | 29 | // read / write 30 | virtual int Read(void * pBuffer, unsigned int nBytesToRead, unsigned int * pBytesRead) = 0; 31 | virtual int Write(const void * pBuffer, unsigned int nBytesToWrite, unsigned int * pBytesWritten) = 0; 32 | 33 | // seek 34 | virtual int Seek(intn nDistance, unsigned int nMoveMode) = 0; 35 | 36 | // creation / destruction 37 | virtual int Create(const wchar_t * pName) = 0; 38 | virtual int Delete() = 0; 39 | 40 | // other functions 41 | virtual int SetEOF() = 0; 42 | 43 | // attributes 44 | virtual int GetPosition() = 0; 45 | virtual unsigned int GetSize() = 0; 46 | virtual int GetName(wchar_t * pBuffer) = 0; 47 | }; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Info.txt: -------------------------------------------------------------------------------- 1 | APEtag.pas 2 | Tested with Borland Delphi 3,4,5,6 3 | 4 | { *************************************************************************** } 5 | { } 6 | { Audio Tools Library (Freeware) } 7 | { Class TAPEtag - for manipulating with APE tags } 8 | { } 9 | { Copyright (c) 2001,2002 by Jurgen Faul } 10 | { E-mail: jfaul@gmx.de } 11 | { http://jfaul.de/atl } 12 | { } 13 | { Version 1.0 (21 April 2002) } 14 | { - Reading & writing support for APE 1.0 tags } 15 | { - Reading support for APE 2.0 tags (UTF-8 decoding) } 16 | { - Tag info: title, artist, album, track, year, genre, comment, copyright } 17 | { } 18 | { *************************************************************************** } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/Prepare.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | #define SPECIAL_FRAME_MONO_SILENCE 1 7 | #define SPECIAL_FRAME_LEFT_SILENCE 1 8 | #define SPECIAL_FRAME_RIGHT_SILENCE 2 9 | #define SPECIAL_FRAME_PSEUDO_STEREO 4 10 | 11 | /***************************************************************************** 12 | Manage the preparation stage of compression and decompression 13 | 14 | Tasks: 15 | 16 | 1) convert data to 32-bit 17 | 2) convert L,R to X,Y 18 | 3) calculate the CRC 19 | 4) do simple analysis 20 | 5) check for the peak value 21 | *****************************************************************************/ 22 | 23 | class IPredictorDecompress; 24 | 25 | class CPrepare 26 | { 27 | public: 28 | int Prepare(const unsigned char * pRawData, int nBytes, const WAVEFORMATEX * pWaveFormatEx, int * pOutputX, int * pOutputY, unsigned int * pCRC, int * pSpecialCodes, intn * pPeakLevel); 29 | void Unprepare(int X, int Y, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pOutput, unsigned int * pCRC); 30 | #ifdef APE_BACKWARDS_COMPATIBILITY 31 | int UnprepareOld(int * pInputX, int *pInputY, intn nBlocks, const WAVEFORMATEX * pWaveFormatEx, unsigned char * pRawData, unsigned int * pCRC, int * pSpecialCodes, intn nFileVersion); 32 | #endif 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by MACDll.rc 4 | // 5 | #define IDD_WAV_INFO 101 6 | #define IDD_APE_INFO 103 7 | #define IDB_BITMAP1 104 8 | #define IDB_COMPRESSION_LEVEL 104 9 | #define IDI_MONKEY_LEFT 105 10 | #define IDI_MONKEY_RIGHT 106 11 | #define IDD_WINAMP_SETTINGS 107 12 | #define IDD_COMPRESSION 108 13 | #define IDC_R1 1000 14 | #define IDC_R3 1001 15 | #define IDC_R2 1002 16 | #define IDC_R4 1003 17 | #define CANCEL_BUTTON 1011 18 | #define THREAD_PRIORITY_SLIDER 1014 19 | #define FILE_DISPLAY_METHOD_EDIT 1028 20 | #define SCALE_OUTPUT_CHECK 1031 21 | #define IGNORE_BITSTREAM_ERRORS_CHECK 1034 22 | #define SUPPRESS_SILENCE_CHECK 1035 23 | 24 | // Next default values for new objects 25 | // 26 | #ifdef APSTUDIO_INVOKED 27 | #ifndef APSTUDIO_READONLY_SYMBOLS 28 | #define _APS_NEXT_RESOURCE_VALUE 149 29 | #define _APS_NEXT_COMMAND_VALUE 40002 30 | #define _APS_NEXT_CONTROL_VALUE 1000 31 | #define _APS_NEXT_SYMED_VALUE 101 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2012 - 2017, Yanhui Shen 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Shared/NoWindows.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(PLATFORM_WINDOWS) 4 | 5 | // we treat bool as a global type, so don't declare it in the namespace 6 | #ifdef PLATFORM_APPLE 7 | typedef signed char BOOL; // this is the way it's defined in Obj-C 8 | #else 9 | typedef unsigned char BOOL; // this is the way it's defined in X11 10 | #endif 11 | 12 | namespace APE 13 | { 14 | 15 | #define __forceinline inline 16 | #define __stdcall 17 | 18 | #define NEAR 19 | #define FAR 20 | 21 | typedef unsigned long DWORD; 22 | typedef unsigned char BYTE; 23 | typedef unsigned short WORD; 24 | typedef float FLOAT; 25 | typedef void * HANDLE; 26 | typedef unsigned int UINT; 27 | //typedef unsigned int intn; 28 | //typedef long intn; 29 | typedef const char * LPCSTR; 30 | typedef char * LPSTR; 31 | typedef long LRESULT; 32 | 33 | #define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES); 34 | 35 | #define CALLBACK 36 | 37 | #define _T(x) L ## x 38 | 39 | #define _strnicmp strncasecmp 40 | #define _wtoi(x) wcstol(x, NULL, 10) 41 | #define _tcscat wcscat 42 | #define _totlower towlower 43 | #define _totupper towupper 44 | 45 | #define MAX_PATH 4096 46 | 47 | #include 48 | #include 49 | 50 | } 51 | 52 | #endif // #ifndef _WIN32 53 | -------------------------------------------------------------------------------- /core/TagParserFactoryImpl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace mous { 7 | 8 | class TagParserFactory::Impl { 9 | public: 10 | ~Impl() { 11 | UnloadPlugin(); 12 | } 13 | 14 | void LoadTagParserPlugin(const std::shared_ptr& plugin) { 15 | auto parser = std::make_shared(plugin); 16 | if (!parser || !*parser) { 17 | return; 18 | } 19 | const auto& suffixList = parser->FileSuffix(); 20 | for (const std::string& suffix : suffixList) { 21 | auto iter = parsers_.find(suffix); 22 | if (iter == parsers_.end()) { 23 | parsers_.emplace(suffix, parser); 24 | } 25 | } 26 | } 27 | 28 | void UnloadPlugin(const std::string&) { 29 | // TODO 30 | } 31 | 32 | void UnloadPlugin() { 33 | parsers_.clear(); 34 | } 35 | 36 | std::shared_ptr CreateParser(const std::string& fileName) const { 37 | const std::string& suffix = scx::FileHelper::FileSuffix(fileName); 38 | auto iter = parsers_.find(suffix); 39 | if (iter == parsers_.end()) { 40 | iter = parsers_.find("*"); 41 | if (iter == parsers_.end()) { 42 | return {}; 43 | } 44 | } 45 | return std::make_shared(iter->second->GetPlugin()); 46 | } 47 | 48 | private: 49 | std::map> parsers_; 50 | }; 51 | 52 | } // namespace mous 53 | -------------------------------------------------------------------------------- /misc/grabkey.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | #include 5 | #include 6 | 7 | /* 8 | * http://tronche.com/gui/x/xlib/input/XGrabKey.html 9 | * http://wiki.debian.org/Keyboard/MultimediaKeys 10 | * http://subforge.org/projects/subtle/wiki/Grabs 11 | * https://bugreports.qt-project.org/secure/attachment/23178/example1.cpp 12 | */ 13 | 14 | void GrabKeys(Display* display) 15 | { 16 | int i; 17 | int min, max; 18 | int screen; 19 | unsigned int modifier = 0; 20 | screen = DefaultScreen(display); 21 | 22 | KeyCode key; 23 | key = XKeysymToKeycode(display, XStringToKeysym("XF86AudioPlay")); 24 | XGrabKey(display, key, modifier, RootWindow(display, screen), 25 | True, GrabModeAsync, GrabModeAsync); 26 | 27 | XEvent event; 28 | while (true) { 29 | XNextEvent(display, &event); 30 | if (event.type == KeyPress && event.xkey.keycode == key) { 31 | cout << "!!" << endl; 32 | } 33 | } 34 | 35 | XAllowEvents(display, AsyncKeyboard, CurrentTime); 36 | XUngrabKey(display, key, AnyModifier, RootWindow(display, screen)); 37 | XSync(display, False); 38 | } 39 | 40 | int main() 41 | { 42 | Display* display = XOpenDisplay(NULL); 43 | if (display == NULL) 44 | return 1; 45 | 46 | GrabKeys(display); 47 | 48 | return XCloseDisplay(display); 49 | } 50 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/NoWindows.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if !defined(PLATFORM_WINDOWS) 4 | 5 | // we treat bool as a global type, so don't declare it in the namespace 6 | #ifdef PLATFORM_APPLE 7 | typedef signed char BOOL; // this is the way it's defined in Obj-C 8 | #else 9 | typedef unsigned char BOOL; // this is the way it's defined in X11 10 | #endif 11 | 12 | namespace APE 13 | { 14 | 15 | #define __forceinline inline 16 | #define __stdcall 17 | 18 | #define NEAR 19 | #define FAR 20 | 21 | typedef unsigned long DWORD; 22 | typedef unsigned char BYTE; 23 | typedef unsigned short WORD; 24 | typedef float FLOAT; 25 | typedef void * HANDLE; 26 | typedef unsigned int UINT; 27 | //typedef unsigned int intn; 28 | //typedef long intn; 29 | typedef const char * LPCSTR; 30 | typedef char * LPSTR; 31 | typedef long LRESULT; 32 | 33 | #define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES); 34 | 35 | #define CALLBACK 36 | 37 | #define _T(x) L ## x 38 | 39 | #define _strnicmp strncasecmp 40 | #define _wtoi(x) wcstol(x, NULL, 10) 41 | #define _tcscat wcscat 42 | #define _totlower towlower 43 | #define _totupper towupper 44 | 45 | #define MAX_PATH 4096 46 | 47 | #include 48 | #include 49 | 50 | } 51 | 52 | #endif // #ifndef _WIN32 53 | -------------------------------------------------------------------------------- /plugins/coreaudio/cmus/xmalloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-2013 Various Authors 3 | * Copyright 2004-2005 Timo Hirvonen 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * 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 "xmalloc.h" 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | extern char *program_name; 27 | 28 | void malloc_fail(void) 29 | { 30 | fprintf(stderr, "%s: could not allocate memory: %s\n", program_name, strerror(errno)); 31 | exit(42); 32 | } 33 | 34 | #ifndef HAVE_STRNDUP 35 | char *xstrndup(const char *str, size_t n) 36 | { 37 | size_t len; 38 | char *s; 39 | 40 | for (len = 0; len < n && str[len]; len++) 41 | ; 42 | s = xmalloc(len + 1); 43 | memcpy(s, str, len); 44 | s[len] = 0; 45 | return s; 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /apps/ncurses/Client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | #include 10 | #include 11 | using namespace scx; 12 | 13 | #include "ClientPlayerHandler.h" 14 | #include "ClientPlaylistHandler.h" 15 | 16 | class Client { 17 | public: 18 | Client(); 19 | ~Client(); 20 | 21 | bool Run(); 22 | void Stop(); 23 | 24 | void SetConnectMaxRetry(int max); 25 | void SetConnectRetryInterval(int ms); 26 | 27 | void StopService(); 28 | 29 | ClientPlayerHandler& PlayerHandler(); 30 | ClientPlaylistHandler& PlaylistHandler(); 31 | 32 | Signal& SigTryConnect(); 33 | Signal& SigConnected(); 34 | 35 | Signal&)>& SigSuffixes() { 36 | return m_SigSuffixes; 37 | } 38 | 39 | private: 40 | char* GetPayloadBuffer(char, int); 41 | inline void SendOut(); 42 | 43 | private: 44 | thread m_RecvThread; 45 | 46 | int m_ConnectMaxRetry = 25; 47 | int m_ConnectRetryInterval = 200; 48 | bool m_ConnectStopRetry = false; 49 | 50 | TcpSocket m_Socket; 51 | mutex m_SendOutBufMutex; 52 | vector m_SendOutBuf; 53 | 54 | ClientPlayerHandler m_PlayerHandler; 55 | ClientPlaylistHandler m_PlaylistHandler; 56 | 57 | Signal m_SigTryConnect; 58 | Signal m_SigConnected; 59 | Signal&)> m_SigSuffixes; 60 | }; 61 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/UnBitArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "UnBitArrayBase.h" 4 | 5 | namespace APE 6 | { 7 | 8 | class IAPEDecompress; 9 | 10 | struct RANGE_CODER_STRUCT_DECOMPRESS 11 | { 12 | unsigned int low; // low end of interval 13 | unsigned int range; // length of interval 14 | unsigned int buffer; // buffer for input/output 15 | }; 16 | 17 | class CUnBitArray : public CUnBitArrayBase 18 | { 19 | public: 20 | // construction/destruction 21 | CUnBitArray(APE::CIO * pIO, intn nVersion, intn nFurthestReadByte); 22 | ~CUnBitArray(); 23 | 24 | unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0); 25 | 26 | void GenerateArray(int * pOutputArray, int nElements, intn nBytesRequired = -1); 27 | 28 | int DecodeValueRange(UNBIT_ARRAY_STATE & BitArrayState); 29 | 30 | void FlushState(UNBIT_ARRAY_STATE & BitArrayState); 31 | void FlushBitArray(); 32 | void Finalize(); 33 | 34 | private: 35 | void GenerateArrayRange(int * pOutputArray, int nElements); 36 | 37 | // data 38 | int m_nFlushCounter; 39 | int m_nFinalizeCounter; 40 | RANGE_CODER_STRUCT_DECOMPRESS m_RangeCoderInfo; 41 | 42 | // functions 43 | inline uint32 DecodeByte(); 44 | inline int RangeDecodeFast(int nShift); 45 | inline int RangeDecodeFastWithUpdate(int nShift); 46 | }; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/APECompressCore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "APECompress.h" 4 | #include "BitArray.h" 5 | 6 | namespace APE 7 | { 8 | 9 | class CPrepare; 10 | class IPredictorCompress; 11 | 12 | /************************************************************************************************* 13 | CAPECompressCore - manages the core of compression and bitstream output 14 | *************************************************************************************************/ 15 | class CAPECompressCore 16 | { 17 | public: 18 | CAPECompressCore(CIO * pIO, const WAVEFORMATEX * pwfeInput, intn nMaxFrameBlocks, intn nCompressionLevel); 19 | ~CAPECompressCore(); 20 | 21 | int EncodeFrame(const void * pInputData, intn nInputBytes); 22 | 23 | CBitArray * GetBitArray() { return m_spBitArray.GetPtr(); } 24 | intn GetPeakLevel() { return m_nPeakLevel; } 25 | 26 | private: 27 | int Prepare(const void * pInputData, int nInputBytes, int * pSpecialCodes); 28 | 29 | CSmartPtr m_spBitArray; 30 | CSmartPtr m_spPredictorX; 31 | CSmartPtr m_spPredictorY; 32 | BIT_ARRAY_STATE m_BitArrayStateX; 33 | BIT_ARRAY_STATE m_BitArrayStateY; 34 | CSmartPtr m_spDataX; 35 | CSmartPtr m_spDataY; 36 | CSmartPtr m_spTempData; 37 | CSmartPtr m_spPrepare; 38 | WAVEFORMATEX m_wfeInput; 39 | intn m_nPeakLevel; 40 | }; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /apps/ncurses/ExplorerView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "BaseView.h" 11 | #include "Ncurses.h" 12 | 13 | class ExplorerView : public BaseView { 14 | public: 15 | ExplorerView(); 16 | ~ExplorerView(); 17 | 18 | void Refresh(); 19 | void MoveTo(int x, int y); 20 | void Resize(int w, int h); 21 | 22 | bool InjectKey(int key); 23 | 24 | void Show(bool show); 25 | bool IsShown() const; 26 | 27 | void SetFocus(bool focus); 28 | bool HasFocus() const; 29 | 30 | public: 31 | scx::Signal SigTmpOpen; 32 | scx::Signal SigUserOpen; 33 | 34 | void AddSuffixes(const std::vector&); 35 | 36 | private: 37 | void BuildFileItems(); 38 | void CdUp(); 39 | void CdIn(); 40 | void ScrollUp(); 41 | void ScrollDown(); 42 | 43 | private: 44 | struct FileItem { 45 | std::string name; 46 | bool isDir; 47 | off_t size; 48 | mutable bool cacheOk; 49 | mutable std::string nameCache; 50 | mutable std::string sizeCache; 51 | }; 52 | 53 | private: 54 | ncurses::Window d; 55 | bool m_Focused = false; 56 | std::string m_Path; 57 | std::string m_PathCache; 58 | bool m_HideDot = true; 59 | bool m_HideUnknown = false; 60 | std::deque m_BeginStack; 61 | std::deque m_SelectionStack; 62 | std::vector m_FileItems; 63 | std::set m_Suffixes; 64 | }; 65 | -------------------------------------------------------------------------------- /plugins/coreaudio/cmus/mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-2013 Various Authors 3 | * Copyright 2004 Timo Hirvonen 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * 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 CMUS_MIXER_H 20 | #define CMUS_MIXER_H 21 | 22 | #ifndef __GNUC__ 23 | #include 24 | #endif 25 | 26 | #define NR_MIXER_FDS 4 27 | 28 | struct mixer_plugin_ops { 29 | int (*init)(void); 30 | int (*exit)(void); 31 | int (*open)(int *volume_max); 32 | int (*close)(void); 33 | int (*get_fds)(int *fds); 34 | int (*set_volume)(int l, int r); 35 | int (*get_volume)(int *l, int *r); 36 | }; 37 | 38 | struct mixer_plugin_opt { 39 | const char *name; 40 | int (*set)(const char *val); 41 | int (*get)(char **val); 42 | }; 43 | 44 | /* symbols exported by plugin */ 45 | extern const struct mixer_plugin_ops op_mixer_ops; 46 | extern const struct mixer_plugin_opt op_mixer_options[]; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/APECompressCreate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "APECompress.h" 4 | 5 | namespace APE 6 | { 7 | class CAPECompressCore; 8 | 9 | class CAPECompressCreate 10 | { 11 | public: 12 | CAPECompressCreate(); 13 | ~CAPECompressCreate(); 14 | 15 | int InitializeFile(CIO * pIO, const WAVEFORMATEX * pwfeInput, intn nMaxFrames, intn nCompressionLevel, const void * pHeaderData, intn nHeaderBytes); 16 | int FinalizeFile(CIO * pIO, int nNumberOfFrames, int nFinalFrameBlocks, const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes, int nPeakLevel); 17 | 18 | int SetSeekByte(int nFrame, int nByteOffset); 19 | 20 | int Start(CIO * pioOutput, const WAVEFORMATEX * pwfeInput, unsigned int nMaxAudioBytes, intn nCompressionLevel = COMPRESSION_LEVEL_NORMAL, const void * pHeaderData = NULL, intn nHeaderBytes = CREATE_WAV_HEADER_ON_DECOMPRESSION); 21 | 22 | intn GetFullFrameBytes(); 23 | int EncodeFrame(const void * pInputData, intn nInputBytes); 24 | 25 | int Finish(const void * pTerminatingData, int nTerminatingBytes, int nWAVTerminatingBytes); 26 | 27 | private: 28 | CSmartPtr m_spSeekTable; 29 | intn m_nMaxFrames; 30 | 31 | CSmartPtr m_spIO; 32 | CSmartPtr m_spAPECompressCore; 33 | 34 | WAVEFORMATEX m_wfeInput; 35 | intn m_nCompressionLevel; 36 | intn m_nSamplesPerFrame; 37 | intn m_nFrameIndex; 38 | intn m_nLastFrameBlocks; 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/allcodecs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Utils for libavcodec 3 | * Copyright (c) 2002 Fabrice Bellard. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library 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 GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /** 21 | * @file allcodecs.c 22 | * Utils for libavcodec. 23 | */ 24 | 25 | #include "avcodec.h" 26 | 27 | /* If you do not call this function, then you can select exactly which 28 | formats you want to support */ 29 | 30 | /** 31 | * simple call to register all the codecs. 32 | */ 33 | void avcodec_register_all(void) 34 | { 35 | static int inited = 0; 36 | 37 | if (inited != 0) 38 | return; 39 | inited = 1; 40 | 41 | /* decoders */ 42 | #ifdef CONFIG_DECODERS 43 | #ifdef CONFIG_RISKY 44 | register_avcodec(&wmav1_decoder); 45 | register_avcodec(&wmav2_decoder); 46 | #endif 47 | #endif 48 | } 49 | 50 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/avi.h: -------------------------------------------------------------------------------- 1 | #ifndef FFMPEG_AVI_H 2 | #define FFMPEG_AVI_H 3 | 4 | #include "avcodec.h" 5 | 6 | #define AVIF_HASINDEX 0x00000010 // Index at end of file? 7 | #define AVIF_MUSTUSEINDEX 0x00000020 8 | #define AVIF_ISINTERLEAVED 0x00000100 9 | #define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames? 10 | #define AVIF_WASCAPTUREFILE 0x00010000 11 | #define AVIF_COPYRIGHTED 0x00020000 12 | 13 | #define AVI_MAX_RIFF_SIZE 0x40000000LL 14 | #define AVI_MASTER_INDEX_SIZE 256 15 | 16 | /* index flags */ 17 | #define AVIIF_INDEX 0x10 18 | 19 | offset_t start_tag(ByteIOContext *pb, const char *tag); 20 | void end_tag(ByteIOContext *pb, offset_t start); 21 | 22 | typedef struct CodecTag { 23 | int id; 24 | unsigned int tag; 25 | unsigned int invalid_asf : 1; 26 | } CodecTag; 27 | 28 | void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf); 29 | int put_wav_header(ByteIOContext *pb, AVCodecContext *enc); 30 | int wav_codec_get_id(unsigned int tag, int bps); 31 | void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size); 32 | 33 | extern const CodecTag codec_bmp_tags[]; 34 | extern const CodecTag codec_wav_tags[]; 35 | 36 | unsigned int codec_get_tag(const CodecTag *tags, int id); 37 | enum CodecID codec_get_id(const CodecTag *tags, unsigned int tag); 38 | unsigned int codec_get_bmp_tag(int id); 39 | unsigned int codec_get_wav_tag(int id); 40 | enum CodecID codec_get_bmp_id(unsigned int tag); 41 | enum CodecID codec_get_wav_id(unsigned int tag); 42 | 43 | #endif /* FFMPEG_AVI_H */ 44 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/CircleBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | class CCircleBuffer 7 | { 8 | public: 9 | // construction / destruction 10 | CCircleBuffer(); 11 | virtual ~CCircleBuffer(); 12 | 13 | // create the buffer 14 | void CreateBuffer(intn nBytes, intn nMaxDirectWriteBytes); 15 | 16 | // query 17 | intn MaxAdd(); 18 | intn MaxGet(); 19 | 20 | // direct writing 21 | __forceinline unsigned char * GetDirectWritePointer() 22 | { 23 | // return a pointer to the tail -- note that it will always be safe to write 24 | // at least m_nMaxDirectWriteBytes since we use an end cap region 25 | return &m_pBuffer[m_nTail]; 26 | } 27 | 28 | __forceinline void UpdateAfterDirectWrite(intn nBytes) 29 | { 30 | // update the tail 31 | m_nTail += nBytes; 32 | 33 | // if the tail enters the "end cap" area, set the end cap and loop around 34 | if (m_nTail >= (m_nTotal - m_nMaxDirectWriteBytes)) 35 | { 36 | m_nEndCap = m_nTail; 37 | m_nTail = 0; 38 | } 39 | } 40 | 41 | // get data 42 | intn Get(unsigned char * pBuffer, intn nBytes); 43 | 44 | // remove / empty 45 | void Empty(); 46 | intn RemoveHead(intn nBytes); 47 | intn RemoveTail(intn nBytes); 48 | 49 | private: 50 | intn m_nTotal; 51 | intn m_nMaxDirectWriteBytes; 52 | intn m_nEndCap; 53 | intn m_nHead; 54 | intn m_nTail; 55 | unsigned char * m_pBuffer; 56 | }; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /apps/qt5/MainWindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 700 10 | 500 11 | 12 | 13 | 14 | Mous 15 | 16 | 17 | 18 | 19 | 2 20 | 21 | 22 | 23 | 24 | QLayout::SetDefaultConstraint 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 40 | toolBar 41 | 42 | 43 | TopToolBarArea 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/simple_idct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple IDCT 3 | * 4 | * Copyright (c) 2001 Michael Niedermayer 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | */ 20 | 21 | /** 22 | * @file simple_idct.h 23 | * simple idct header. 24 | */ 25 | 26 | void simple_idct_put(uint8_t *dest, int line_size, DCTELEM *block); 27 | void simple_idct_add(uint8_t *dest, int line_size, DCTELEM *block); 28 | void ff_simple_idct_mmx(int16_t *block); 29 | void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); 30 | void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); 31 | void simple_idct(DCTELEM *block); 32 | 33 | void simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block); 34 | 35 | void simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block); 36 | void simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block); 37 | -------------------------------------------------------------------------------- /sdk/scx/Conv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace scx { 10 | 11 | template 12 | constexpr auto ToUnderlying(E e) { 13 | return static_cast::type>(e); 14 | } 15 | 16 | template 17 | inline num_t 18 | StrToNum(const std::string& str, std::ios_base& (*base)(std::ios_base&) = std::dec) { 19 | std::stringstream stream; 20 | stream << str; 21 | num_t num; 22 | stream >> base >> num; 23 | return num; 24 | } 25 | 26 | template 27 | inline std::string 28 | NumToStr(const num_t& num, std::streamsize precision = 0, std::ios_base& (*base)(std::ios_base&) = std::dec) { 29 | std::stringstream stream; 30 | stream.setf(std::ios::fixed, std::ios::floatfield); 31 | stream.precision(precision); 32 | stream << base << num; 33 | return stream.str(); 34 | } 35 | 36 | inline std::string 37 | ToLower(const std::string& str) { 38 | std::string lower; 39 | lower.resize(str.size()); 40 | std::transform(str.begin(), str.end(), lower.begin(), (int (*)(int))tolower); 41 | return lower; 42 | } 43 | 44 | inline std::string 45 | ToUpper(const std::string& str) { 46 | std::string upper; 47 | upper.resize(str.size()); 48 | std::transform(str.begin(), str.end(), upper.begin(), (int (*)(int))toupper); 49 | return upper; 50 | } 51 | 52 | /* 53 | inline bool IsLower(const string& str) 54 | { 55 | return true; 56 | } 57 | 58 | inline bool IsUpper(const string& str) 59 | { 60 | return true; 61 | } 62 | */ 63 | }; // namespace scx 64 | -------------------------------------------------------------------------------- /plugins/format-probe/FormatProbe.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace scx; 8 | #include 9 | using namespace mous; 10 | #ifdef ENABLE_CAF 11 | #include "ProbeCaf.h" 12 | #endif 13 | #ifdef ENABLE_MP4 14 | #include "ProbeMp4.h" 15 | #endif 16 | 17 | using ProbeFunc = const char* (*)(void* ptr, const char* path); 18 | 19 | namespace { 20 | struct Self { 21 | const std::map probes { 22 | #ifdef ENABLE_CAF 23 | { "caf", ProbeCaf }, 24 | #endif 25 | #ifdef ENABLE_MP4 26 | { "alac", ProbeMp4 }, 27 | { "m4a", ProbeMp4 }, 28 | { "mp4", ProbeMp4 }, 29 | #endif 30 | }; 31 | }; 32 | } 33 | 34 | static void* Create(void) { 35 | return new Self; 36 | } 37 | 38 | static void Destroy(void* ptr) { 39 | delete SELF; 40 | } 41 | 42 | static const char* Probe(void* ptr, const char* path) { 43 | const auto& suffix = ToLower(FileHelper::FileSuffix(path)); 44 | const auto iter = SELF->probes.find(suffix); 45 | return iter != SELF->probes.end() ? iter->second(ptr, path) : nullptr; 46 | } 47 | 48 | static const BaseOption** GetOptions(void* ptr) { 49 | (void) ptr; 50 | return nullptr; 51 | } 52 | 53 | const char** GetSuffixes(void* ptr) { 54 | (void) ptr; 55 | static const char* suffixes[] { 56 | "alac", 57 | #ifdef ENABLE_CAF 58 | "caf", 59 | #endif 60 | #ifdef ENABLE_MP4 61 | "m4a", 62 | "mp4", 63 | #endif 64 | nullptr 65 | }; 66 | return suffixes; 67 | } -------------------------------------------------------------------------------- /sdk/plugin/DecoderProto.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Interface.h" 9 | 10 | static void* Create(); 11 | static void Destroy(void* ptr); 12 | static mous::ErrorCode Open(void* ptr, const char* url); 13 | static void Close(void* ptr); 14 | static mous::ErrorCode DecodeUnit(void* ptr, char* data, uint32_t* used, uint32_t* unit_count); 15 | static mous::ErrorCode SetUnitIndex(void* ptr, uint64_t index); 16 | static uint32_t GetMaxBytesPerUnit(void* ptr); 17 | static uint64_t GetUnitIndex(void* ptr); 18 | static uint64_t GetUnitCount(void* ptr); 19 | static mous::AudioMode GetAudioMode(void* ptr); 20 | static int32_t GetChannels(void* ptr); 21 | static int32_t GetBitsPerSample(void* ptr); 22 | static int32_t GetSampleRate(void* ptr); 23 | static int32_t GetBitRate(void* ptr); 24 | static uint64_t GetDuration(void* ptr); 25 | static const mous::BaseOption** GetOptions(void* ptr); 26 | static const char** GetSuffixes(void* ptr); 27 | static const char** GetEncodings(void* ptr); 28 | 29 | static mous::DecoderInterface decoder_interface{ 30 | Create, 31 | Destroy, 32 | Open, 33 | Close, 34 | DecodeUnit, 35 | SetUnitIndex, 36 | GetMaxBytesPerUnit, 37 | GetUnitIndex, 38 | GetUnitCount, 39 | GetAudioMode, 40 | GetChannels, 41 | GetBitsPerSample, 42 | GetSampleRate, 43 | GetBitRate, 44 | GetDuration, 45 | GetOptions, 46 | GetSuffixes, 47 | GetEncodings}; 48 | 49 | extern "C" { 50 | const mous::DecoderInterface* MousGetDecoderInterface() { 51 | return &decoder_interface; 52 | } 53 | } -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/BitArray.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "IO.h" 4 | #include "MD5.h" 5 | 6 | namespace APE 7 | { 8 | 9 | //#define BUILD_RANGE_TABLE 10 | 11 | struct RANGE_CODER_STRUCT_COMPRESS 12 | { 13 | unsigned int low; // low end of interval 14 | unsigned int range; // length of interval 15 | unsigned int help; // bytes_to_follow resp. intermediate value 16 | unsigned char buffer; // buffer for input / output 17 | }; 18 | 19 | struct BIT_ARRAY_STATE 20 | { 21 | uint32 nKSum; 22 | }; 23 | 24 | class CBitArray 25 | { 26 | public: 27 | // construction / destruction 28 | CBitArray(APE::CIO *pIO); 29 | ~CBitArray(); 30 | 31 | // encoding 32 | int EncodeUnsignedLong(unsigned int n); 33 | int EncodeValue(int nEncode, BIT_ARRAY_STATE & BitArrayState); 34 | int EncodeBits(unsigned int nValue, int nBits); 35 | 36 | // output (saving) 37 | int OutputBitArray(bool bFinalize = false); 38 | 39 | // other functions 40 | void Finalize(); 41 | void AdvanceToByteBoundary(); 42 | inline uint32 GetCurrentBitIndex() { return m_nCurrentBitIndex; } 43 | void FlushState(BIT_ARRAY_STATE & BitArrayState); 44 | void FlushBitArray(); 45 | __forceinline CMD5Helper & GetMD5Helper() { return m_MD5; } 46 | 47 | private: 48 | // data members 49 | uint32 * m_pBitArray; 50 | CIO * m_pIO; 51 | uint32 m_nCurrentBitIndex; 52 | RANGE_CODER_STRUCT_COMPRESS m_RangeCoderInfo; 53 | CMD5Helper m_MD5; 54 | 55 | #ifdef BUILD_RANGE_TABLE 56 | void OutputRangeTable(); 57 | #endif 58 | }; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /deps/alac/codec/EndianPortable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ 19 | */ 20 | 21 | // 22 | // EndianPortable.h 23 | // 24 | // Copyright 2011 Apple Inc. All rights reserved. 25 | // 26 | 27 | #ifndef _EndianPortable_h 28 | #define _EndianPortable_h 29 | 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | uint16_t Swap16NtoB(uint16_t inUInt16); 37 | uint16_t Swap16BtoN(uint16_t inUInt16); 38 | 39 | uint32_t Swap32NtoB(uint32_t inUInt32); 40 | uint32_t Swap32BtoN(uint32_t inUInt32); 41 | 42 | uint64_t Swap64BtoN(uint64_t inUInt64); 43 | uint64_t Swap64NtoB(uint64_t inUInt64); 44 | 45 | float SwapFloat32BtoN(float in); 46 | float SwapFloat32NtoB(float in); 47 | 48 | double SwapFloat64BtoN(double in); 49 | double SwapFloat64NtoB(double in); 50 | 51 | void Swap16(uint16_t * inUInt16); 52 | void Swap24(uint8_t * inUInt24); 53 | void Swap32(uint32_t * inUInt32); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /plugins/format-probe/ProbeMp4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace { 6 | struct MP4File { 7 | explicit MP4File(const char* path) { 8 | handle = MP4Read(path); 9 | } 10 | ~MP4File() { 11 | if (handle) { 12 | MP4Close(handle); 13 | handle = nullptr; 14 | } 15 | } 16 | operator bool() const { 17 | return handle; 18 | } 19 | MP4FileHandle handle = nullptr; 20 | }; 21 | } 22 | 23 | static const char* ProbeMp4(void* ptr, const char* path) { 24 | MP4File file(path); 25 | if (!file) { 26 | return nullptr; 27 | } 28 | MP4TrackId trackid = MP4_INVALID_TRACK_ID; 29 | auto ntrack = MP4GetNumberOfTracks(file.handle); 30 | for (decltype(ntrack) itrack = 0; itrack < ntrack; ++itrack) { 31 | trackid = MP4FindTrackId(file.handle, itrack); 32 | if (trackid != MP4_INVALID_TRACK_ID) { 33 | const auto type = MP4GetTrackType(file.handle, trackid); 34 | if (MP4_IS_AUDIO_TRACK_TYPE(type)) { 35 | break; 36 | }; 37 | } 38 | } 39 | if (trackid == MP4_INVALID_TRACK_ID) { 40 | return nullptr; 41 | } 42 | const char* media_data_name = MP4GetTrackMediaDataName(file.handle, trackid); 43 | if (strcasecmp(media_data_name, "mp4a") == 0) { 44 | const auto type = MP4GetTrackEsdsObjectTypeId(file.handle, trackid); 45 | if (type == MP4_MPEG4_AUDIO_TYPE) { 46 | return "aac"; 47 | } 48 | } 49 | if (strcasecmp(media_data_name, "alac") == 0) { 50 | return "alac"; 51 | } 52 | return nullptr; 53 | } -------------------------------------------------------------------------------- /apps/ncurses/Session.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | using namespace scx; 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | using namespace std; 12 | 13 | #include "ServerContext.h" 14 | 15 | class Session { 16 | public: 17 | typedef unsigned long ptr_t; 18 | 19 | public: 20 | explicit Session(ServerContext* data); 21 | ~Session(); 22 | 23 | bool Run(const TcpSocket& socket, int notifyFd); 24 | void Stop(); 25 | 26 | private: 27 | void HandleApp(char*, int); 28 | void HandlePlayer(char*, int); 29 | void HandlePlaylist(char*, int); 30 | 31 | void NotifySupportedSuffixes(); 32 | 33 | void PlayerPause(BufObj&); 34 | void PlayerSeek(BufObj&); 35 | void PlayerVolume(BufObj&); 36 | void PlayerPlayMode(BufObj&); 37 | void PlayerPlayNext(BufObj&); 38 | void PlayerSync(BufObj&); 39 | 40 | void PlaylistSwitch(BufObj&); 41 | void PlaylistSelect(BufObj&); 42 | void PlaylistPlay(BufObj&); 43 | void PlaylistAppend(BufObj&); 44 | void PlaylistRemove(BufObj&); 45 | void PlaylistMove(BufObj&); 46 | void PlaylistClear(BufObj&); 47 | void PlaylistSync(BufObj&); 48 | 49 | void SlotPlayNextItem(const MediaItem&); 50 | 51 | char* GetPayloadBuffer(char, int); 52 | void SendOut(); 53 | 54 | void TryConvertToUtf8(string& str) const; 55 | void SendMediaItemsByChunk(char, const deque&); 56 | void SendMediaItemInfo(const MediaItem&); 57 | 58 | private: 59 | ServerContext* m_Context; 60 | 61 | thread m_RecvThread; 62 | TcpSocket m_Socket; 63 | int m_NotifyFd; 64 | bool m_GotReqStopService; 65 | vector m_SendOutBuf; 66 | 67 | string m_IfNotUtf8; 68 | }; 69 | -------------------------------------------------------------------------------- /sdk/scx/FileHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace scx { 10 | 11 | namespace FileHelper { 12 | 13 | inline size_t 14 | FileSize(const char* path) { 15 | struct stat statbuf; 16 | stat(path, &statbuf); 17 | return statbuf.st_size; 18 | } 19 | 20 | inline bool 21 | CreateFile(const char* path, uint64_t size) { 22 | using namespace std; 23 | ofstream stream(path, ios::out); 24 | stream.seekp(size - 1, ios::beg); 25 | stream.put('\0'); 26 | stream.close(); 27 | return (FileSize(path) == size) ? true : false; 28 | } 29 | 30 | inline std::string 31 | FileSuffix(const std::string& name, char ch = '.') { 32 | size_t pos = name.find_last_of(ch); 33 | return name.substr(pos + 1, name.size()); 34 | } 35 | 36 | inline std::string 37 | FileDir(const std::string& path) { 38 | using namespace std; 39 | size_t pos = path.find_last_of('/'); 40 | if (pos == string::npos) { 41 | return "./"; 42 | } else if (pos == path.size() - 1) { 43 | return path.substr(0, path.size()); 44 | } else { 45 | return path.substr(0, pos + 1); 46 | } 47 | } 48 | 49 | inline std::string 50 | ReadAll(const char* filename, bool asBin = false) { 51 | using namespace std; 52 | 53 | ifstream instream; 54 | if (asBin) { 55 | instream.open(filename, fstream::in | fstream::binary); 56 | } else { 57 | instream.open(filename, fstream::in); 58 | } 59 | 60 | stringstream stream; 61 | if (instream.is_open()) { 62 | stream << instream.rdbuf(); 63 | } 64 | 65 | instream.close(); 66 | 67 | return stream.str(); 68 | } 69 | } // namespace FileHelper 70 | } // namespace scx 71 | -------------------------------------------------------------------------------- /apps/ncurses/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include "AppEnv.h" 12 | #include "MainUi.h" 13 | #include "Server.h" 14 | 15 | using namespace std; 16 | 17 | pid_t FetchPid() { 18 | pid_t pid = 0; 19 | const auto env = GlobalAppEnv::Instance(); 20 | fstream stream; 21 | stream.open(env->pidFile.c_str(), ios::in); 22 | if (stream) { 23 | stream >> pid; 24 | } 25 | stream.close(); 26 | return pid; 27 | } 28 | 29 | void StorePid() { 30 | const auto env = GlobalAppEnv::Instance(); 31 | fstream stream; 32 | stream.open(env->pidFile.c_str(), ios::out); 33 | stream << ::getpid(); 34 | stream.close(); 35 | } 36 | 37 | void ClearPid() { 38 | const auto env = GlobalAppEnv::Instance(); 39 | ::unlink(env->pidFile.c_str()); 40 | } 41 | 42 | void Daemonize() { 43 | const int destfd = ::open("/dev/null", O_RDWR); 44 | if (destfd < 0) { 45 | ::exit(EXIT_FAILURE); 46 | } 47 | ::dup2(destfd, STDIN_FILENO); 48 | ::dup2(destfd, STDOUT_FILENO); 49 | ::dup2(destfd, STDERR_FILENO); 50 | } 51 | 52 | int main(int argc, char** argv) { 53 | std::locale::global(std::locale("")); 54 | 55 | if (!GlobalAppEnv::Instance()->Init()) { 56 | return EXIT_FAILURE; 57 | } 58 | 59 | pid_t pid = FetchPid(); 60 | if (pid == 0 || (::kill(pid, 0) != 0 && errno == ESRCH)) { 61 | pid = ::fork(); 62 | } 63 | 64 | if (pid == 0) { 65 | Daemonize(); 66 | StorePid(); 67 | Server server; 68 | int ret = server.Exec(); 69 | ClearPid(); 70 | return ret; 71 | } else if (pid > 0) { 72 | MainUi ui; 73 | return ui.Exec(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACDll/MACDll.def: -------------------------------------------------------------------------------- 1 | LIBRARY MACDll 2 | 3 | EXPORTS 4 | 5 | ; basic functions 6 | CompressFile 7 | DecompressFile 8 | ConvertFile 9 | VerifyFile 10 | CompressFileW 11 | DecompressFileW 12 | ConvertFileW 13 | VerifyFileW 14 | CompressFileW2 15 | DecompressFileW2 16 | ConvertFileW2 17 | VerifyFileW2 18 | 19 | ; interface wrappers 20 | c_APEDecompress_Create 21 | c_APEDecompress_CreateW 22 | c_APEDecompress_Destroy 23 | c_APEDecompress_GetData 24 | c_APEDecompress_Seek 25 | c_APEDecompress_GetInfo 26 | 27 | c_APECompress_Create 28 | c_APECompress_Destroy 29 | c_APECompress_Start 30 | c_APECompress_StartW 31 | c_APECompress_AddData 32 | c_APECompress_GetBufferBytesAvailable 33 | c_APECompress_LockBuffer 34 | c_APECompress_UnlockBuffer 35 | c_APECompress_Finish 36 | c_APECompress_Kill 37 | 38 | ; helpers / miscellaneous 39 | GetVersionNumber 40 | GetInterfaceCompatibility 41 | ShowFileInfoDialog 42 | RemoveTag 43 | TagFileSimple 44 | GetID3Tag 45 | FillWaveHeader 46 | FillWaveFormatEx 47 | 48 | ; Winamp 49 | winampGetInModule2 50 | winampGetExtendedFileInfo 51 | 52 | ; CoolEdit 53 | QueryCoolFilter 54 | OpenFilterOutput 55 | CloseFilterOutput 56 | WriteFilterOutput 57 | OpenFilterInput 58 | CloseFilterInput 59 | ReadFilterInput 60 | FilterUnderstandsFormat 61 | FilterGetOptions 62 | FilterOptions 63 | FilterGetFileSize 64 | FilterOptionsString 65 | DIALOGMsgProc 66 | FilterGetFirstSpecialData 67 | FilterGetNextSpecialData 68 | FilterWriteSpecialData 69 | -------------------------------------------------------------------------------- /sdk/plugin/Encoder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "Interface.h" 11 | #include "InterfaceWrapper.h" 12 | 13 | namespace mous { 14 | 15 | class Encoder { 16 | COPY_INTERFACE_WRAPPER_COMMON(Encoder, EncoderInterface, "MousGetEncoderInterface"); 17 | 18 | public: 19 | // these methods will be called before OpenOutput() 20 | void SetChannels(int32_t channels) { 21 | return m_interface->set_channels(m_data, channels); 22 | } 23 | 24 | void SetSampleRate(int32_t sample_rate) { 25 | return m_interface->set_sample_rate(m_data, sample_rate); 26 | } 27 | 28 | void SetBitsPerSample(int32_t bits_per_sample) { 29 | return m_interface->set_bits_per_sample(m_data, bits_per_sample); 30 | } 31 | 32 | // called before OpenOutput() 33 | // you can write tag after open but before close 34 | void SetMediaTag(const MediaTag* tag) { 35 | return m_interface->set_media_tag(m_data, tag); 36 | } 37 | 38 | ErrorCode OpenOutput(const std::string& path) { 39 | return m_interface->open_output(m_data, path.c_str()); 40 | } 41 | 42 | void CloseOutput() { 43 | return m_interface->close_output(m_data); 44 | } 45 | 46 | ErrorCode Encode(const char* data, uint32_t length) { 47 | return m_interface->encode(m_data, data, length); 48 | } 49 | 50 | ErrorCode Flush() { 51 | return m_interface->flush(m_data); 52 | } 53 | 54 | std::string FileSuffix() const { 55 | const auto suffix = m_interface->get_suffix(m_data); 56 | if (!suffix) { 57 | return {}; 58 | } 59 | return {suffix}; 60 | } 61 | }; 62 | 63 | } // namespace mous 64 | -------------------------------------------------------------------------------- /apps/qt5/mous-qt.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2012-02-20T22:12:47 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += widgets 8 | CONFIG += c++14 9 | 10 | TARGET = mous-qt 11 | TEMPLATE = app 12 | 13 | INCLUDEPATH += ../../sdk 14 | LIBS += -liconv -L /Users/bsdelf/myapp/lib/ -lMousCore 15 | 16 | macx { 17 | #QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden 18 | #QMAKE_CXXFLAGS_DEBUG += -fvisibility=hidden 19 | #LIBS += -framework 20 | CONFIG += x86_64 21 | QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 22 | } 23 | 24 | 25 | SOURCES += main.cpp\ 26 | MainWindow.cpp \ 27 | CustomHeadTabWidget.cpp \ 28 | MidClickTabBar.cpp \ 29 | DlgListSelect.cpp \ 30 | DlgLoadingMedia.cpp \ 31 | FrmProgressBar.cpp \ 32 | DlgConvertTask.cpp \ 33 | DlgConvertOption.cpp \ 34 | FrmToolBar.cpp \ 35 | FrmTagEditor.cpp \ 36 | SimplePlaylistView.cpp \ 37 | AppEnv.cpp 38 | 39 | HEADERS += MainWindow.h \ 40 | CustomHeadTabWidget.hpp \ 41 | MidClickTabBar.hpp \ 42 | UiHelper.hpp \ 43 | DlgListSelect.h \ 44 | DlgLoadingMedia.h \ 45 | FrmProgressBar.h \ 46 | DlgConvertTask.h \ 47 | DlgConvertOption.h \ 48 | FrmToolBar.h \ 49 | FrmTagEditor.h \ 50 | IPlaylistView.h \ 51 | SimplePlaylistView.h \ 52 | PlaylistActionHistory.h \ 53 | PlaylistClipboard.h \ 54 | FoobarStyle.h \ 55 | AppEnv.h 56 | 57 | FORMS += MainWindow.ui \ 58 | DlgListSelect.ui \ 59 | DlgLoadingMedia.ui \ 60 | FrmProgressBar.ui \ 61 | DlgConvertTask.ui \ 62 | DlgConvertOption.ui \ 63 | FrmToolBar.ui \ 64 | FrmTagEditor.ui 65 | 66 | TRANSLATIONS = mous-qt_zh_CN.ts 67 | 68 | RESOURCES += \ 69 | AllRes.qrc 70 | -------------------------------------------------------------------------------- /sdk/util/PluginDef.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | /** 7 | * Plugin common definitions. 8 | */ 9 | namespace mous { 10 | 11 | enum class PluginType : uint32_t { 12 | None = 0, 13 | Decoder = 1u, 14 | Encoder = 1u << 1, 15 | Output = 1u << 2, 16 | SheetParser = 1u << 3, 17 | TagParser = 1u << 4, 18 | FormatProbe = 1u << 5 19 | }; 20 | 21 | inline const char* ToString(PluginType type) { 22 | switch (type) { 23 | case PluginType::None: 24 | return "None"; 25 | case PluginType::Decoder: 26 | return "Decoder"; 27 | case PluginType::Encoder: 28 | return "Encoder"; 29 | case PluginType::Output: 30 | return "Output"; 31 | case PluginType::SheetParser: 32 | return "SheetParser"; 33 | case PluginType::TagParser: 34 | return "TagParser"; 35 | case PluginType::FormatProbe: 36 | return "FormatProbe"; 37 | default: 38 | return "Unknown"; 39 | } 40 | return ""; 41 | } 42 | 43 | inline auto operator&(PluginType lhs, PluginType rhs) { 44 | return static_cast(scx::ToUnderlying(lhs) & scx::ToUnderlying(rhs)); 45 | } 46 | 47 | inline auto operator|(PluginType lhs, PluginType rhs) { 48 | return static_cast(scx::ToUnderlying(lhs) | scx::ToUnderlying(rhs)); 49 | } 50 | 51 | inline auto& operator|=(PluginType& lhs, PluginType rhs) { 52 | lhs = static_cast(scx::ToUnderlying(lhs) | scx::ToUnderlying(rhs)); 53 | return lhs; 54 | } 55 | 56 | struct PluginInfo { 57 | PluginType type; 58 | const char* name; 59 | const char* desc; 60 | const uint32_t version; 61 | }; 62 | 63 | const char* const StrGetPluginType = "MousGetPluginType"; 64 | const char* const StrGetPluginInfo = "MousGetPluginInfo"; 65 | 66 | } // namespace mous 67 | -------------------------------------------------------------------------------- /apps/ncurses/PlaylistView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | #include 8 | using namespace scx; 9 | 10 | #include 11 | using namespace mous; 12 | 13 | #include "BaseView.h" 14 | #include "ClientPlaylistHandler.h" 15 | #include "Ncurses.h" 16 | 17 | class PlaylistView : public BaseView { 18 | public: 19 | PlaylistView(); 20 | ~PlaylistView(); 21 | 22 | void Refresh(); 23 | bool NeedRefresh() const; 24 | 25 | void MoveTo(int x, int y); 26 | void Resize(int w, int h); 27 | 28 | bool InjectKey(int key); 29 | 30 | void Show(bool show); 31 | bool IsShown() const; 32 | 33 | void SetFocus(bool focus); 34 | bool HasFocus() const; 35 | 36 | public: 37 | int Index() const; 38 | void SetIndex(int i); 39 | 40 | void SetPlaylistHandle(ClientPlaylistHandler* handler); 41 | 42 | private: 43 | void ScrollUp(); 44 | void ScrollDown(); 45 | 46 | private: 47 | void ReqSelect(); 48 | void ReqPlay(int); 49 | void ReqRemove(int); 50 | void ReqMove(int, char); 51 | void ReqClear(); 52 | 53 | void SlotSelect(int, int); 54 | void SlotPlay(int, bool); 55 | void SlotAppend(int, deque&); 56 | void SlotRemove(int, int); 57 | void SlotMove(int, int, char); 58 | void SlotClear(int); 59 | 60 | public: 61 | Signal SigSwitchPlaylist; 62 | 63 | private: 64 | ncurses::Window d; 65 | 66 | int m_NeedRefresh = 0; 67 | mutable mutex m_NeedRefreshMutex; 68 | 69 | bool m_Focused = false; 70 | int m_Index = -1; 71 | int m_ItemBegin = 0; 72 | int m_ItemSelected = 0; 73 | std::string m_Title = "Playlist"; 74 | deque m_List; 75 | bool m_WaitReply = false; 76 | 77 | ClientPlaylistHandler* m_PlaylistHandler = nullptr; 78 | }; 79 | -------------------------------------------------------------------------------- /apps/qt5/PlaylistActionHistory.h: -------------------------------------------------------------------------------- 1 | #ifndef PLAYLISTACTIONHISTORY_H 2 | #define PLAYLISTACTIONHISTORY_H 3 | 4 | #include 5 | #include 6 | 7 | template 8 | class PlaylistActionHistory { 9 | public: 10 | enum ActionType { 11 | Move, 12 | Insert, 13 | Remove 14 | }; 15 | 16 | using ActionItemList = std::deque>; 17 | 18 | struct Action { 19 | ActionType type; 20 | ActionItemList srcItemList; 21 | int insertPos; 22 | int moveVisualPos; 23 | int moveInsertPos; 24 | }; 25 | 26 | public: 27 | int MaxHistory() const { 28 | return m_MaxHistory; 29 | } 30 | 31 | void SetMaxHistory(int n) { 32 | m_MaxHistory = n; 33 | } 34 | 35 | void PushUndoAction(const Action& action) { 36 | m_UndoStack.push_back(action); 37 | 38 | int uselessCount = m_UndoStack.size() - m_MaxHistory; 39 | for (; uselessCount >= 0; --uselessCount) { 40 | m_UndoStack.pop_front(); 41 | } 42 | 43 | m_RedoStack.clear(); 44 | } 45 | 46 | bool HasUndoAction() { 47 | return !m_UndoStack.empty(); 48 | } 49 | 50 | Action PopUndoAction() { 51 | Action action = m_UndoStack.back(); 52 | m_UndoStack.pop_back(); 53 | m_RedoStack.push_back(action); 54 | return action; 55 | } 56 | 57 | bool HasRedoAction() { 58 | return !m_RedoStack.empty(); 59 | } 60 | 61 | Action TakeRedoAction() { 62 | Action action = m_RedoStack.back(); 63 | m_RedoStack.pop_back(); 64 | m_UndoStack.push_back(action); 65 | return action; 66 | } 67 | 68 | void ClearHistory() { 69 | m_UndoStack.clear(); 70 | m_RedoStack.clear(); 71 | } 72 | 73 | public: 74 | int m_MaxHistory = 10; 75 | std::deque m_UndoStack; 76 | std::deque m_RedoStack; 77 | }; 78 | 79 | #endif // PLAYLISTACTIONHISTORY_H 80 | -------------------------------------------------------------------------------- /apps/qt5/FrmTagEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | using namespace mous; 9 | 10 | #include 11 | using namespace std; 12 | 13 | namespace Ui { 14 | class FrmTagEditor; 15 | } 16 | 17 | class FrmTagEditor : public QWidget { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit FrmTagEditor(QWidget* parent = 0); 22 | ~FrmTagEditor(); 23 | 24 | void SaveUiStatus(); 25 | void RestoreUiStatus(); 26 | 27 | void SetPlayer(mous::Player* player); 28 | void SetTagParserFactory(const mous::TagParserFactory* factory); 29 | void WaitForLoadFinished(); 30 | void LoadMediaItem(const mous::MediaItem& item); 31 | 32 | signals: 33 | void SigMediaItemChanged(const MediaItem& item); 34 | 35 | private: 36 | void DoLoadFileTag(const std::string& fileName); 37 | void ShowBottomBtns(bool show); 38 | void UpdateTag(); 39 | void UpdateCoverArt(); 40 | 41 | private: 42 | void resizeEvent(QResizeEvent* event); 43 | 44 | private slots: 45 | void SlotBtnSave(); 46 | void SlotBtnCancel(); 47 | void SlotSplitterMoved(int pos, int index); 48 | void SlotCellChanged(int row, int column); 49 | void SlotHideLabelFailed(); 50 | 51 | void SlotSaveImageAs(); 52 | void SlotChangeCoverArt(); 53 | 54 | private: 55 | Ui::FrmTagEditor* ui; 56 | 57 | mous::Player* m_Player; 58 | const mous::TagParserFactory* m_ParserFactory; 59 | std::shared_ptr m_CurrentParser; 60 | mous::MediaItem m_CurrentItem; 61 | 62 | QPixmap m_CurrentImage; 63 | QLabel* m_LabelImage; 64 | CoverFormat m_CurrentImgFmt; 65 | vector m_CurrentImgData; 66 | QString m_OldImagePath; 67 | 68 | QSemaphore m_SemLoadFinished; 69 | 70 | QSet > m_UnsavedFields; 71 | 72 | QTimer m_DelayTimer; 73 | }; 74 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/os_support.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Various utilities for ffmpeg system 3 | * Copyright (c) 2000, 2001, 2002 Fabrice Bellard 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library 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 GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | #include "avformat.h" 20 | #ifdef CONFIG_WIN32 21 | #include 22 | #include 23 | #elif defined(CONFIG_OS2) 24 | #include 25 | #include 26 | #else 27 | #include 28 | #include 29 | #include 30 | #endif 31 | #include 32 | 33 | int64_t av_gettime(void) 34 | { 35 | #ifdef CONFIG_WIN32 36 | struct _timeb tb; 37 | _ftime(&tb); 38 | return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000); 39 | #else 40 | struct timeval tv; 41 | gettimeofday(&tv,NULL); 42 | return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; 43 | #endif 44 | } 45 | 46 | #if !defined(HAVE_LOCALTIME_R) 47 | struct tm *localtime_r(const time_t *t, struct tm *tp) 48 | { 49 | struct tm *l; 50 | 51 | l = localtime(t); 52 | if (!l) 53 | return 0; 54 | *tp = *l; 55 | return tp; 56 | } 57 | #endif /* !defined(HAVE_LOCALTIME_R) */ 58 | -------------------------------------------------------------------------------- /sdk/core/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace mous { 16 | 17 | enum class PlayerStatus : uint8_t { 18 | Closed, 19 | Playing, 20 | Paused, 21 | Stopped 22 | }; 23 | 24 | class Player { 25 | class Impl; 26 | 27 | public: 28 | Player(); 29 | ~Player(); 30 | 31 | public: 32 | PlayerStatus Status() const; 33 | 34 | void LoadFormatProbePlugin(const std::shared_ptr& plugin); 35 | void LoadDecoderPlugin(const std::shared_ptr& plugin); 36 | void LoadOutputPlugin(const std::shared_ptr& plugin); 37 | void UnloadPlugin(const std::string& path); 38 | void UnloadPlugin(); 39 | 40 | std::vector SupportedSuffixes() const; 41 | 42 | int BufferCount() const; 43 | void SetBufferCount(int count); 44 | 45 | int Volume() const; 46 | void SetVolume(int level); 47 | 48 | ErrorCode Open(const std::string& path); 49 | void Close(); 50 | std::string FileName() const; 51 | 52 | void Play(); 53 | void Play(uint64_t msBegin, uint64_t msEnd); 54 | void Pause(); 55 | void Resume(); 56 | void SeekTime(uint64_t msPos); 57 | void SeekPercent(double percent); 58 | 59 | void PauseDecoder(); 60 | void ResumeDecoder(); 61 | 62 | int32_t BitRate() const; 63 | int32_t SamleRate() const; 64 | uint64_t Duration() const; 65 | uint64_t RangeBegin() const; 66 | uint64_t RangeEnd() const; 67 | uint64_t RangeDuration() const; 68 | uint64_t OffsetMs() const; 69 | uint64_t CurrentMs() const; 70 | enum AudioMode AudioMode() const; 71 | 72 | public: 73 | scx::Signal* SigFinished(); 74 | 75 | private: 76 | std::unique_ptr impl; 77 | }; 78 | 79 | } // namespace mous 80 | -------------------------------------------------------------------------------- /deps/alac/codec/dplib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ 19 | */ 20 | 21 | /* 22 | File: dplib.h 23 | 24 | Contains: Dynamic Predictor routines 25 | 26 | Copyright: Copyright (C) 2001-2011 Apple, Inc. 27 | */ 28 | 29 | #ifndef __DPLIB_H__ 30 | #define __DPLIB_H__ 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | // defines 39 | 40 | #define DENSHIFT_MAX 15 41 | #define DENSHIFT_DEFAULT 9 42 | #define AINIT 38 43 | #define BINIT (-29) 44 | #define CINIT (-2) 45 | #define NUMCOEPAIRS 16 46 | 47 | // prototypes 48 | 49 | void init_coefs( int16_t * coefs, uint32_t denshift, int32_t numPairs ); 50 | void copy_coefs( int16_t * srcCoefs, int16_t * dstCoefs, int32_t numPairs ); 51 | 52 | // NOTE: these routines read at least "numactive" samples so the i/o buffers must be at least that big 53 | 54 | void pc_block( int32_t * in, int32_t * pc, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ); 55 | void unpc_block( int32_t * pc, int32_t * out, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* __DPLIB_H__ */ 62 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/Shared/GlobalFunctions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | /************************************************************************************* 7 | Definitions 8 | *************************************************************************************/ 9 | class CIO; 10 | 11 | /************************************************************************************* 12 | Read / Write from an IO source and return failure if the number of bytes specified 13 | isn't read or written 14 | *************************************************************************************/ 15 | int ReadSafe(CIO * pIO, void * pBuffer, int nBytes); 16 | intn WriteSafe(CIO * pIO, void * pBuffer, intn nBytes); 17 | 18 | /************************************************************************************* 19 | Checks for the existence of a file 20 | *************************************************************************************/ 21 | bool FileExists(wchar_t * pFilename); 22 | 23 | /************************************************************************************* 24 | Allocate aligned memory 25 | *************************************************************************************/ 26 | void * AllocateAligned(intn nBytes, intn nAlignment); 27 | void FreeAligned(void * pMemory); 28 | 29 | /************************************************************************************* 30 | Test for CPU features 31 | *************************************************************************************/ 32 | bool GetMMXAvailable(); 33 | bool GetSSEAvailable(); 34 | 35 | /************************************************************************************* 36 | String helpers 37 | *************************************************************************************/ 38 | bool StringIsEqual(const str_utfn * pString1, const str_utfn * pString2, bool bCaseSensitive, int nCharacters = -1); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /apps/ncurses/ClientPlaylistHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | #include 8 | using namespace scx; 9 | 10 | #include 11 | using namespace mous; 12 | 13 | class ClientPlaylistHandler { 14 | friend class Client; 15 | 16 | private: 17 | ClientPlaylistHandler(); 18 | ~ClientPlaylistHandler(); 19 | 20 | void Handle(char* buf, int len); 21 | 22 | public: 23 | // request 24 | void Switch(int playlist); 25 | void Select(int playlist, int pos); 26 | 27 | void Play(int playlist, int pos); 28 | 29 | void Append(int playlist, const string& path); 30 | void Remove(int playlist, int pos); 31 | void Move(int playlist, int pos, char direct); 32 | void Clear(int playlist); 33 | void Sync(int playlist); 34 | 35 | void MoveItem(int playlist, int oldPos, int newPos); 36 | 37 | // server reply 38 | Signal& SigSwitch() { 39 | return m_SigSwitch; 40 | } 41 | 42 | Signal& SigSelect() { 43 | return m_SigSelect; 44 | } 45 | 46 | Signal& SigPlay() { 47 | return m_SigPlay; 48 | } 49 | 50 | Signal&)>& SigAppend() { 51 | return m_SigAppend; 52 | } 53 | 54 | Signal& SigRemove() { 55 | return m_SigRemove; 56 | } 57 | 58 | Signal& SigMove() { 59 | return m_SigMove; 60 | } 61 | 62 | Signal& SigClear() { 63 | return m_SigClear; 64 | } 65 | 66 | private: 67 | function fnGetPayloadBuffer; 68 | function fnSendOut; 69 | 70 | Signal m_SigSwitch; 71 | Signal m_SigSelect; 72 | Signal m_SigPlay; 73 | Signal&)> m_SigAppend; 74 | Signal m_SigRemove; 75 | Signal m_SigMove; 76 | Signal m_SigClear; 77 | }; 78 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/UnBitArrayBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace APE 4 | { 5 | 6 | class IAPEDecompress; 7 | class CIO; 8 | 9 | struct UNBIT_ARRAY_STATE 10 | { 11 | uint32 k; 12 | uint32 nKSum; 13 | }; 14 | 15 | enum DECODE_VALUE_METHOD 16 | { 17 | DECODE_VALUE_METHOD_UNSIGNED_INT, 18 | DECODE_VALUE_METHOD_UNSIGNED_RICE, 19 | DECODE_VALUE_METHOD_X_BITS 20 | }; 21 | 22 | class CUnBitArrayBase 23 | { 24 | public: 25 | // construction / destruction 26 | CUnBitArrayBase(intn nFurthestReadByte); 27 | virtual ~CUnBitArrayBase(); 28 | 29 | // functions 30 | virtual int FillBitArray(); 31 | virtual int FillAndResetBitArray(intn nFileLocation = -1, intn nNewBitIndex = 0); 32 | 33 | virtual void GenerateArray(int * pOutputArray, int nElements, intn nBytesRequired = -1) {} 34 | virtual unsigned int DecodeValue(DECODE_VALUE_METHOD DecodeMethod, int nParam1 = 0, int nParam2 = 0) { return 0; } 35 | 36 | virtual void AdvanceToByteBoundary(); 37 | virtual bool EnsureBitsAvailable(uint32 nBits, bool bThrowExceptionOnFailure); 38 | 39 | virtual int DecodeValueRange(UNBIT_ARRAY_STATE & BitArrayState) { return 0; } 40 | virtual void FlushState(UNBIT_ARRAY_STATE & BitArrayState) { } 41 | virtual void FlushBitArray() { } 42 | virtual void Finalize() { } 43 | 44 | protected: 45 | virtual int CreateHelper(CIO * pIO, intn nBytes, intn nVersion); 46 | virtual uint32 DecodeValueXBits(uint32 nBits); 47 | 48 | uint32 m_nElements; 49 | uint32 m_nBytes; 50 | uint32 m_nBits; 51 | uint32 m_nGoodBytes; 52 | 53 | intn m_nVersion; 54 | CIO * m_pIO; 55 | intn m_nFurthestReadByte; 56 | 57 | uint32 m_nCurrentBitIndex; 58 | uint32 * m_pBitArray; 59 | }; 60 | 61 | CUnBitArrayBase * CreateUnBitArray(IAPEDecompress * pAPEDecompress, intn nVersion); 62 | 63 | } 64 | -------------------------------------------------------------------------------- /deps/MAC_SDK/Source/MACLib/NNFilter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef ENABLE_SSE_ASSEMBLY 4 | #include // SSE 2 5 | #endif 6 | 7 | namespace APE 8 | { 9 | 10 | #include "RollBuffer.h" 11 | #define NN_WINDOW_ELEMENTS 512 12 | 13 | class CNNFilter 14 | { 15 | public: 16 | CNNFilter(intn nOrder, intn nShift, intn nVersion); 17 | ~CNNFilter(); 18 | 19 | int Compress(int nInput); 20 | int Decompress(int nInput); 21 | void Flush(); 22 | 23 | private: 24 | intn m_nOrder; 25 | intn m_nShift; 26 | intn m_nVersion; 27 | intn m_nRunningAverage; 28 | APE::CRollBuffer m_rbInput; 29 | APE::CRollBuffer m_rbDeltaM; 30 | short * m_paryM; 31 | #ifdef ENABLE_SSE_ASSEMBLY 32 | bool m_bSSEAvailable; 33 | #endif 34 | 35 | __forceinline short GetSaturatedShortFromInt(int nValue) const 36 | { 37 | return short((nValue == short(nValue)) ? nValue : (nValue >> 31) ^ 0x7FFF); 38 | } 39 | 40 | __forceinline void Adapt(short * pM, short * pAdapt, int nDirection, intn nOrder); 41 | __forceinline intn CalculateDotProduct(short * pA, short * pB, intn nOrder); 42 | 43 | #ifdef ENABLE_SSE_ASSEMBLY 44 | __forceinline void AdaptSSE(short * pM, short * pAdapt, int nDirection, intn nOrder); 45 | __forceinline intn CalculateDotProductSSE(short * pA, short * pB, intn nOrder); 46 | #endif 47 | 48 | #if !defined(_MSC_VER) && defined(ENABLE_SSE_ASSEMBLY) 49 | typedef union __attribute__ ((aligned (16))) __oword { 50 | __m128i m128i; 51 | int8_t m128i_i8[16]; 52 | int16_t m128i_i16[8]; 53 | int32_t m128i_i32[4]; 54 | int64_t m128i_i64[2]; 55 | uint8_t m128i_u8[16]; 56 | uint16_t m128i_u16[8]; 57 | uint32_t m128i_u32[4]; 58 | uint64_t m128i_u64[2]; 59 | } __oword; 60 | #endif 61 | }; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /plugins/coreaudio/Output.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | using namespace mous; 5 | 6 | extern "C" { 7 | #include "cmus/op.h" 8 | #include "cmus/mixer.h" 9 | } 10 | 11 | const char* program_name = "CoreAudioOutput"; 12 | 13 | namespace { 14 | struct Self { 15 | bool closed = true; 16 | }; 17 | } 18 | 19 | static void* Create() { 20 | op_pcm_ops.init(); 21 | op_mixer_ops.init(); 22 | return new Self; 23 | } 24 | 25 | static void Destroy(void* ptr) { 26 | Close(ptr); 27 | op_pcm_ops.exit(); 28 | op_mixer_ops.exit(); 29 | delete SELF; 30 | } 31 | 32 | static ErrorCode Open(void* ptr) { 33 | int maxVol = 0; 34 | op_mixer_ops.open(&maxVol); 35 | SELF->closed = false; 36 | return ErrorCode::Ok; 37 | } 38 | 39 | static void Close(void* ptr) { 40 | if (!SELF->closed) { 41 | op_mixer_ops.close(); 42 | SELF->closed = true; 43 | } 44 | } 45 | 46 | static ErrorCode Setup(void* ptr, int32_t* channels, int32_t* sample_rate, int32_t* bits_per_sample) { 47 | (void) ptr; 48 | op_pcm_ops.drop(); 49 | op_pcm_ops.close(); 50 | const sample_format_t sf = sf_bits(*bits_per_sample) | sf_rate(*sample_rate) | sf_channels(*channels) | sf_signed(1); 51 | op_pcm_ops.open(sf, nullptr); 52 | return ErrorCode::Ok; 53 | } 54 | 55 | static ErrorCode Write(void* ptr, const char* data, uint32_t length) { 56 | (void) ptr; 57 | op_pcm_ops.write(data, static_cast(length)); 58 | op_pcm_wait(length); 59 | return ErrorCode::Ok; 60 | } 61 | 62 | static int GetVolume(void* ptr) { 63 | (void) ptr; 64 | int l, r; 65 | op_mixer_ops.get_volume(&l, &r); 66 | return (l + r) / 2; 67 | } 68 | 69 | static void SetVolume(void* ptr, int avg) { 70 | (void) ptr; 71 | op_mixer_ops.set_volume(avg, avg); 72 | } 73 | 74 | static const BaseOption** GetOptions(void* ptr) { 75 | (void) ptr; 76 | return nullptr; 77 | } 78 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/Makefile.orig: -------------------------------------------------------------------------------- 1 | # 2 | # libavcodec Makefile 3 | # (c) 2000-2003 Fabrice Bellard 4 | # (c) 2004 McMCC 5 | # 6 | include config.mak 7 | 8 | # NOTE: -I.. is needed to include config.h 9 | CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE 10 | 11 | OBJS= common.o utils.o mem.o allcodecs.o futils.o cutils.o os_support.o allformats.o parser.o \ 12 | avio.o aviobuf.o file.o simple_idct.o dsputil.o fft.o mdct.o asf.o 13 | 14 | # codecs which are patented in some non free countries like the us 15 | ifeq ($(CONFIG_RISKY),yes) 16 | OBJS+= wmadec.o 17 | endif 18 | 19 | ifeq ($(TARGET_GPROF),yes) 20 | CFLAGS+=-p 21 | LDFLAGS+=-p 22 | endif 23 | 24 | SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) 25 | OBJS := $(OBJS) $(ASM_OBJS) 26 | 27 | LIB= $(LIBPREF)ffwma$(LIBSUF) 28 | ifeq ($(BUILD_SHARED),yes) 29 | SLIB= $(SLIBPREF)ffwma$(SLIBSUF) 30 | endif 31 | 32 | all: $(LIB) $(SLIB) 33 | 34 | $(LIB): $(OBJS) 35 | rm -f $@ 36 | $(AR) rc $@ $(OBJS) 37 | $(RANLIB) $@ 38 | 39 | $(SLIB): $(OBJS) 40 | $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) 41 | 42 | dsputil.o: dsputil.c dsputil.h 43 | 44 | %.o: %.c 45 | $(CC) $(CFLAGS) -c -o $@ $< 46 | 47 | %.o: %.S 48 | $(CC) $(CFLAGS) -c -o $@ $< 49 | 50 | depend: $(SRCS) 51 | $(CC) -MM $(CFLAGS) $^ 1>.depend 52 | 53 | dep: depend 54 | 55 | clean: 56 | rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so 57 | 58 | distclean: clean 59 | rm -f Makefile.bak .depend 60 | 61 | ifeq ($(BUILD_SHARED),yes) 62 | install: all install-headers 63 | install -d $(prefix)/lib 64 | install -s -m 755 $(SLIB) $(prefix)/lib/libffwma-$(VERSION).so 65 | ln -sf libffwma-$(VERSION).so $(prefix)/lib/libffwma.so 66 | ldconfig || true 67 | else 68 | install: 69 | endif 70 | 71 | installlib: all install-headers 72 | install -m 644 $(LIB) $(prefix)/lib 73 | 74 | install-headers: 75 | mkdir -p "$(prefix)/include/ffwma" 76 | install -m 644 *.h "$(prefix)/include/ffwma" 77 | 78 | -------------------------------------------------------------------------------- /apps/qt5/FoobarStyle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class FoobarStyle : public QProxyStyle { 6 | public: 7 | FoobarStyle(QStyle* baseStyle = 0) 8 | : QProxyStyle(baseStyle) { 9 | } 10 | 11 | void drawPrimitive(PrimitiveElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const { 12 | if (element == QStyle::PE_IndicatorItemViewItemDrop) { 13 | qDebug() << option->rect; 14 | int y = 0; 15 | if (!option->rect.isNull()) { 16 | y = option->rect.y(); 17 | } else { 18 | const QAbstractItemView* view = qobject_cast(widget); 19 | if (!view) { 20 | return; 21 | } 22 | int rows = view->model()->rowCount(); 23 | QModelIndex last = view->model()->index(rows - 1, 0); 24 | QRect lastRect = view->visualRect(last); 25 | y = lastRect.bottom(); 26 | } 27 | 28 | if (!option->rect.isNull()) { 29 | m_BelowIndicator.setX(widget->rect().width() / 2); 30 | m_BelowIndicator.setY(y + option->rect.height() / 2); 31 | } else { 32 | m_BelowIndicator.setX(-1); 33 | m_BelowIndicator.setY(-1); 34 | } 35 | 36 | painter->setRenderHint(QPainter::Antialiasing, true); 37 | QColor c(Qt::black); 38 | QPen pen(c); 39 | pen.setWidth(2); 40 | QBrush brush(c); 41 | painter->setPen(pen); 42 | painter->setBrush(brush); 43 | 44 | QPoint a(0, y); 45 | QPoint b(widget->rect().width(), y); 46 | painter->drawLine(a, b); 47 | 48 | painter->drawPoint(m_BelowIndicator); 49 | 50 | } else { 51 | m_BelowIndicator.setX(-1); 52 | m_BelowIndicator.setY(-1); 53 | 54 | QProxyStyle::drawPrimitive(element, option, painter, widget); 55 | } 56 | } 57 | 58 | QPoint BelowIndicator() const { 59 | return m_BelowIndicator; 60 | } 61 | 62 | private: 63 | mutable QPoint m_BelowIndicator; 64 | }; 65 | -------------------------------------------------------------------------------- /deps/alac/codec/ALACDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Apple Inc. All rights reserved. 3 | * 4 | * @APPLE_APACHE_LICENSE_HEADER_START@ 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * @APPLE_APACHE_LICENSE_HEADER_END@ 19 | */ 20 | 21 | /* 22 | File: ALACDecoder.h 23 | */ 24 | 25 | #ifndef _ALACDECODER_H 26 | #define _ALACDECODER_H 27 | 28 | #if PRAGMA_ONCE 29 | #pragma once 30 | #endif 31 | 32 | #include 33 | 34 | #include "ALACAudioTypes.h" 35 | 36 | struct BitBuffer; 37 | 38 | class ALACDecoder 39 | { 40 | public: 41 | ALACDecoder(); 42 | ~ALACDecoder(); 43 | 44 | int32_t Init( void * inMagicCookie, uint32_t inMagicCookieSize ); 45 | int32_t Decode( struct BitBuffer * bits, uint8_t * sampleBuffer, uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples ); 46 | 47 | public: 48 | // decoding parameters (public for use in the analyzer) 49 | ALACSpecificConfig mConfig; 50 | 51 | protected: 52 | int32_t FillElement( struct BitBuffer * bits ); 53 | int32_t DataStreamElement( struct BitBuffer * bits ); 54 | 55 | uint16_t mActiveElements; 56 | 57 | // decoding buffers 58 | int32_t * mMixBufferU; 59 | int32_t * mMixBufferV; 60 | int32_t * mPredictor; 61 | uint16_t * mShiftBuffer; // note: this points to mPredictor's memory but different 62 | // variable for clarity and type difference 63 | }; 64 | 65 | #endif /* _ALACDECODER_H */ 66 | -------------------------------------------------------------------------------- /deps/ffmpeg-strip-wma/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # libavcodec Makefile 3 | # (c) 2000-2003 Fabrice Bellard 4 | # (c) 2004 McMCC 5 | # 6 | include config.mak 7 | 8 | # NOTE: -I.. is needed to include config.h 9 | CFLAGS+=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -fno-strict-aliasing -I/usr/local/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE 10 | 11 | OBJS= common.o utils.o mem.o allcodecs.o futils.o cutils.o os_support.o allformats.o parser.o \ 12 | avio.o aviobuf.o file.o simple_idct.o dsputil.o fft.o mdct.o asf.o 13 | 14 | # codecs which are patented in some non free countries like the us 15 | ifeq ($(CONFIG_RISKY),yes) 16 | OBJS+= wmadec.o 17 | endif 18 | 19 | ifeq ($(TARGET_GPROF),yes) 20 | CFLAGS+=-p 21 | LDFLAGS+=-p 22 | endif 23 | 24 | SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) 25 | OBJS := $(OBJS) $(ASM_OBJS) 26 | 27 | LIB= $(LIBPREF)ffwma$(LIBSUF) 28 | ifeq ($(BUILD_SHARED),yes) 29 | SLIB= $(SLIBPREF)ffwma$(SLIBSUF) 30 | endif 31 | 32 | all: $(LIB) $(SLIB) 33 | 34 | $(LIB): $(OBJS) 35 | rm -f $@ 36 | $(AR) rc $@ $(OBJS) 37 | $(RANLIB) $@ 38 | 39 | $(SLIB): $(OBJS) 40 | $(CC) $(SHFLAGS) -o $@ $(OBJS) $(EXTRALIBS) 41 | 42 | dsputil.o: dsputil.c dsputil.h 43 | 44 | %.o: %.c 45 | $(CC) $(CFLAGS) -c -o $@ $< 46 | 47 | %.o: %.S 48 | $(CC) $(CFLAGS) -c -o $@ $< 49 | 50 | depend: $(SRCS) 51 | $(CC) -MM $(CFLAGS) $^ 1>.depend 52 | 53 | dep: depend 54 | 55 | clean: 56 | rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so 57 | 58 | distclean: clean 59 | rm -f Makefile.bak .depend 60 | 61 | ifeq ($(BUILD_SHARED),yes) 62 | install: all install-headers 63 | install -d $(prefix)/lib 64 | install -s -m 755 $(SLIB) $(prefix)/lib/libffwma-$(VERSION).so 65 | ln -sf libffwma-$(VERSION).so $(prefix)/lib/libffwma.so 66 | ldconfig || true 67 | else 68 | install: 69 | endif 70 | 71 | installlib: all install-headers 72 | install -m 644 $(LIB) $(prefix)/lib 73 | 74 | install-headers: 75 | mkdir -p "$(prefix)/include/ffwma" 76 | install -m 644 *.h "$(prefix)/include/ffwma" 77 | 78 | -------------------------------------------------------------------------------- /plugins/faac/FaacEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef FAACENCODER_H 2 | #define FAACENCODER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace std; 9 | using namespace mous; 10 | 11 | class FaacEncoder: public IEncoder 12 | { 13 | public: 14 | FaacEncoder(); 15 | virtual ~FaacEncoder(); 16 | 17 | virtual const char* FileSuffix() const; 18 | 19 | virtual ErrorCode OpenOutput(const std::string& path); 20 | virtual void CloseOutput(); 21 | 22 | virtual ErrorCode Encode(char* buf, uint32_t len); 23 | virtual ErrorCode Flush(); 24 | 25 | virtual void SetChannels(int32_t channels); 26 | virtual void SetSampleRate(int32_t sampleRate); 27 | virtual void SetBitsPerSample(int32_t bitsPerSample); 28 | 29 | virtual void SetMediaTag(const MediaTag* tag); 30 | virtual std::vector Options() const; 31 | 32 | private: 33 | //size_t WavReadFloat32(); 34 | void WriteToolVersion(); 35 | void UpdateMediaTag(); 36 | 37 | private: 38 | RangedIntOption m_OptQuality; 39 | RangedIntOption m_OptBitRate; 40 | GroupedOption m_OptVbrOrAbr; 41 | 42 | BooleanOption m_OptTns; 43 | BooleanOption m_OptMidSide; 44 | BooleanOption m_OptOptimize; 45 | 46 | string m_FileName; 47 | 48 | MP4FileHandle m_Mp4File; 49 | MP4TrackId m_Mp4Track; 50 | uint64_t m_TotalSamples; 51 | uint64_t m_EncodedSamples; 52 | unsigned int m_FrameSize; 53 | unsigned int m_DelaySamples; 54 | 55 | faacEncHandle m_EncHandle; 56 | unsigned long m_SampleRate; 57 | unsigned int m_Channels; 58 | unsigned long m_InputSamples; 59 | unsigned long m_MaxOutputBytes; 60 | 61 | int32_t m_BitsPerSample; 62 | 63 | char* m_InputBuffer; 64 | int m_InputBufferSize; 65 | int m_InputBufferUsed; 66 | char* m_OutputBuffer; 67 | int m_OutputBufferSize; 68 | int m_OutputBufferUsed; 69 | 70 | const MediaTag* m_MediaTag; 71 | 72 | //float* m_FloatBuffer; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /misc/PlaylistDump.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace mous; 4 | 5 | #include "scx/BufObj.h" 6 | #include "scx/Conv.h" 7 | using namespace scx; 8 | 9 | #include 10 | #include 11 | using namespace std; 12 | 13 | const char* const FILE_NAME = "list.dat"; 14 | const int COUNT = 10; 15 | 16 | void PrintList(const Playlist& list) 17 | { 18 | for (int i = 0; i < list.Count(); ++i) { 19 | const MediaItem& item = list[i]; 20 | cout << i << "|" << item.url << "|" << item.duration << "|"; 21 | cout << item.tag.title << "|" << item.tag.artist << "|" << item.tag.album << "|" << item.tag.year << endl; 22 | } 23 | } 24 | 25 | int main() 26 | { 27 | PlaylistSerializer serializer; 28 | 29 | cout << "=== Write dat ===" << endl; 30 | { 31 | Playlist list; 32 | 33 | for (int i = 0; i < COUNT; ++i) { 34 | MediaItem item; 35 | item.url = "url" + NumToStr(i); 36 | item.duration = 100*i; 37 | item.hasRange = false; 38 | item.msBeg = 0; 39 | item.msEnd = 0; 40 | item.tag.title = "title" + NumToStr(i); 41 | item.tag.artist = "artist" + NumToStr(i); 42 | item.tag.album = "album" + NumToStr(i); 43 | item.tag.comment = "comment" + NumToStr(i); 44 | item.tag.genre = "genre" + NumToStr(i); 45 | item.tag.year = 1990+i; 46 | item.tag.track = i; 47 | list.Append(item); 48 | } 49 | 50 | PrintList(list); 51 | 52 | serializer.Store(list, FILE_NAME); 53 | 54 | vector outbuf; 55 | serializer.Store(list, outbuf); 56 | cout << COUNT << " items, write bytes:" << outbuf.size() << endl; 57 | } 58 | 59 | cout << "=== Read dat ===" << endl; 60 | { 61 | Playlist list2; 62 | serializer.Load(list2, FILE_NAME); 63 | PrintList(list2); 64 | } 65 | 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /plugins/libao/AoOutput.cpp: -------------------------------------------------------------------------------- 1 | #include "AoOutput.h" 2 | #include 3 | #include 4 | 5 | AoOutput::AoOutput(): 6 | m_Driver(-1), 7 | m_Device(nullptr) 8 | { 9 | ao_initialize(); 10 | 11 | m_Driver = ao_default_driver_id(); 12 | 13 | int channels = 2; 14 | int rate = 44100; 15 | int bits = 16; 16 | Setup(channels, rate, bits); 17 | 18 | { 19 | int count; 20 | ao_info** info = ao_driver_info_list(&count); 21 | cout << " driver count:" << count << endl; 22 | for (int i = 0; i < count; ++i) { 23 | cout << " " << i << " " << info[i]->name << endl; 24 | for (int j = 0; j < info[i]->option_count; ++j) { 25 | cout << " " << j << " " << info[i]->options[j] << endl; 26 | } 27 | } 28 | } 29 | } 30 | 31 | AoOutput::~AoOutput() 32 | { 33 | Close(); 34 | 35 | ao_shutdown(); 36 | } 37 | 38 | EmErrorCode AoOutput::Open() 39 | { 40 | Close(); 41 | 42 | m_Device = ao_open_live(m_Driver, &m_Format, nullptr); 43 | return m_Device ? ErrorCode::Ok : ErrorCode::OutputFailedToOpen; 44 | } 45 | 46 | void AoOutput::Close() 47 | { 48 | if (m_Device) { 49 | ao_close(m_Device); 50 | m_Device = nullptr; 51 | } 52 | } 53 | 54 | EmErrorCode AoOutput::Setup(int32_t& channels, int32_t& sampleRate, int32_t& bitsPerSample) 55 | { 56 | memset(&m_Format, 0, sizeof(m_Format)); 57 | m_Format.channels = channels; 58 | m_Format.bits = bitsPerSample; 59 | m_Format.rate = sampleRate; 60 | m_Format.byte_format = AO_FMT_LITTLE; 61 | return Open() == ErrorCode::Ok ? ErrorCode::Ok : ErrorCode::OutputFailedToSetup; 62 | } 63 | 64 | EmErrorCode AoOutput::Write(const char* buf, uint32_t len) 65 | { 66 | int ret = ao_play(m_Device, const_cast(buf), (uint_32)len); 67 | return ret == 0 ? ErrorCode::Ok : ErrorCode::OutputFailedToWrite; 68 | } 69 | 70 | int AoOutput::VolumeLevel() const 71 | { 72 | return 0; 73 | } 74 | 75 | void AoOutput::SetVolumeLevel(int level) 76 | { 77 | } 78 | -------------------------------------------------------------------------------- /apps/qt5/FrmProgressBar.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | FrmProgressBar 4 | 5 | 6 | 7 | 0 8 | 0 9 | 443 10 | 57 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 26 | 27 | FileName 28 | 29 | 30 | 31 | 32 | 33 | 34 | 0 35 | 36 | 37 | %p% 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -- : -- 49 | 50 | 51 | Qt::AlignCenter 52 | 53 | 54 | 55 | 56 | 57 | 58 | Cancel 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v1/Test.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=6.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | [Linker] 34 | MapFile=0 35 | OutputObjs=0 36 | ConsoleApp=1 37 | DebugInfo=0 38 | RemoteSymbols=0 39 | MinStackSize=16384 40 | MaxStackSize=1048576 41 | ImageBase=4194304 42 | ExeDescription= 43 | [Directories] 44 | OutputDir= 45 | UnitOutputDir= 46 | PackageDLLOutputDir= 47 | PackageDCPOutputDir= 48 | SearchPath= 49 | Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k 50 | Conditionals= 51 | DebugSourceDirs= 52 | UsePackages=0 53 | [Parameters] 54 | RunParams= 55 | HostApplication= 56 | Launcher= 57 | UseLauncher=0 58 | DebugCWD= 59 | [Language] 60 | ActiveLang= 61 | ProjectLang= 62 | RootDir= 63 | [Version Info] 64 | IncludeVerInfo=0 65 | AutoIncBuild=0 66 | MajorVer=1 67 | MinorVer=0 68 | Release=0 69 | Build=0 70 | Debug=0 71 | PreRelease=0 72 | Special=0 73 | Private=0 74 | DLL=0 75 | Locale=1031 76 | CodePage=1252 77 | [Version Info Keys] 78 | CompanyName= 79 | FileDescription= 80 | FileVersion=1.0.0.0 81 | InternalName= 82 | LegalCopyright= 83 | LegalTrademarks= 84 | OriginalFilename= 85 | ProductName= 86 | ProductVersion=1.0.0.0 87 | Comments= 88 | [HistoryLists\hlUnitAliases] 89 | Count=1 90 | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 91 | [HistoryLists\hlUnitOutputDirectory] 92 | Count=1 93 | Item0=DCU 94 | [HistoryLists\hlOutputDirectorry] 95 | Count=1 96 | Item0=Data 97 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/ID3v2/Test.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=6.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | [Linker] 34 | MapFile=0 35 | OutputObjs=0 36 | ConsoleApp=1 37 | DebugInfo=0 38 | RemoteSymbols=0 39 | MinStackSize=16384 40 | MaxStackSize=1048576 41 | ImageBase=4194304 42 | ExeDescription= 43 | [Directories] 44 | OutputDir= 45 | UnitOutputDir= 46 | PackageDLLOutputDir= 47 | PackageDCPOutputDir= 48 | SearchPath= 49 | Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k 50 | Conditionals= 51 | DebugSourceDirs= 52 | UsePackages=0 53 | [Parameters] 54 | RunParams= 55 | HostApplication= 56 | Launcher= 57 | UseLauncher=0 58 | DebugCWD= 59 | [Language] 60 | ActiveLang= 61 | ProjectLang= 62 | RootDir= 63 | [Version Info] 64 | IncludeVerInfo=0 65 | AutoIncBuild=0 66 | MajorVer=1 67 | MinorVer=0 68 | Release=0 69 | Build=0 70 | Debug=0 71 | PreRelease=0 72 | Special=0 73 | Private=0 74 | DLL=0 75 | Locale=1031 76 | CodePage=1252 77 | [Version Info Keys] 78 | CompanyName= 79 | FileDescription= 80 | FileVersion=1.0.0.0 81 | InternalName= 82 | LegalCopyright= 83 | LegalTrademarks= 84 | OriginalFilename= 85 | ProductName= 86 | ProductVersion=1.0.0.0 87 | Comments= 88 | [HistoryLists\hlUnitAliases] 89 | Count=1 90 | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 91 | [HistoryLists\hlUnitOutputDirectory] 92 | Count=1 93 | Item0=DCU 94 | [HistoryLists\hlOutputDirectorry] 95 | Count=1 96 | Item0=Data 97 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/APEtag/Test.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=6.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | [Linker] 34 | MapFile=0 35 | OutputObjs=0 36 | ConsoleApp=1 37 | DebugInfo=0 38 | RemoteSymbols=0 39 | MinStackSize=16384 40 | MaxStackSize=1048576 41 | ImageBase=4194304 42 | ExeDescription= 43 | [Directories] 44 | OutputDir= 45 | UnitOutputDir= 46 | PackageDLLOutputDir= 47 | PackageDCPOutputDir= 48 | SearchPath= 49 | Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k 50 | Conditionals= 51 | DebugSourceDirs= 52 | UsePackages=0 53 | [Parameters] 54 | RunParams= 55 | HostApplication= 56 | Launcher= 57 | UseLauncher=0 58 | DebugCWD= 59 | [Language] 60 | ActiveLang= 61 | ProjectLang= 62 | RootDir= 63 | [Version Info] 64 | IncludeVerInfo=0 65 | AutoIncBuild=0 66 | MajorVer=1 67 | MinorVer=0 68 | Release=0 69 | Build=0 70 | Debug=0 71 | PreRelease=0 72 | Special=0 73 | Private=0 74 | DLL=0 75 | Locale=1031 76 | CodePage=1252 77 | [Version Info Keys] 78 | CompanyName= 79 | FileDescription= 80 | FileVersion=1.0.0.0 81 | InternalName= 82 | LegalCopyright= 83 | LegalTrademarks= 84 | OriginalFilename= 85 | ProductName= 86 | ProductVersion=1.0.0.0 87 | Comments= 88 | [HistoryLists\hlUnitAliases] 89 | Count=1 90 | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 91 | [HistoryLists\hlUnitOutputDirectory] 92 | Count=1 93 | Item0=DCU 94 | [HistoryLists\hlOutputDirectorry] 95 | Count=1 96 | Item0=Data 97 | -------------------------------------------------------------------------------- /deps/MAC_SDK/3rd Party/TMonkey (Delphi)/Monkey/Test.dof: -------------------------------------------------------------------------------- 1 | [FileVersion] 2 | Version=6.0 3 | [Compiler] 4 | A=8 5 | B=0 6 | C=1 7 | D=1 8 | E=0 9 | F=0 10 | G=1 11 | H=1 12 | I=1 13 | J=0 14 | K=0 15 | L=1 16 | M=0 17 | N=1 18 | O=1 19 | P=1 20 | Q=0 21 | R=0 22 | S=0 23 | T=0 24 | U=0 25 | V=1 26 | W=0 27 | X=1 28 | Y=1 29 | Z=1 30 | ShowHints=1 31 | ShowWarnings=1 32 | UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 33 | [Linker] 34 | MapFile=0 35 | OutputObjs=0 36 | ConsoleApp=1 37 | DebugInfo=0 38 | RemoteSymbols=0 39 | MinStackSize=16384 40 | MaxStackSize=1048576 41 | ImageBase=4194304 42 | ExeDescription= 43 | [Directories] 44 | OutputDir= 45 | UnitOutputDir= 46 | PackageDLLOutputDir= 47 | PackageDCPOutputDir= 48 | SearchPath= 49 | Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k 50 | Conditionals= 51 | DebugSourceDirs= 52 | UsePackages=0 53 | [Parameters] 54 | RunParams= 55 | HostApplication= 56 | Launcher= 57 | UseLauncher=0 58 | DebugCWD= 59 | [Language] 60 | ActiveLang= 61 | ProjectLang= 62 | RootDir= 63 | [Version Info] 64 | IncludeVerInfo=0 65 | AutoIncBuild=0 66 | MajorVer=1 67 | MinorVer=0 68 | Release=0 69 | Build=0 70 | Debug=0 71 | PreRelease=0 72 | Special=0 73 | Private=0 74 | DLL=0 75 | Locale=1031 76 | CodePage=1252 77 | [Version Info Keys] 78 | CompanyName= 79 | FileDescription= 80 | FileVersion=1.0.0.0 81 | InternalName= 82 | LegalCopyright= 83 | LegalTrademarks= 84 | OriginalFilename= 85 | ProductName= 86 | ProductVersion=1.0.0.0 87 | Comments= 88 | [HistoryLists\hlUnitAliases] 89 | Count=1 90 | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; 91 | [HistoryLists\hlUnitOutputDirectory] 92 | Count=1 93 | Item0=DCU 94 | [HistoryLists\hlOutputDirectorry] 95 | Count=1 96 | Item0=Data 97 | -------------------------------------------------------------------------------- /apps/qt5/DlgLoadingMedia.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DlgLoadingMedia 4 | 5 | 6 | 7 | 0 8 | 0 9 | 282 10 | 42 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 100.000000000000000 18 | 19 | 20 | 21 | 22 | 23 | 24 | 0 25 | 0 26 | 27 | 28 | 29 | 30 | Monospace 31 | 32 | 33 | 34 | hint 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::Horizontal 42 | 43 | 44 | QSizePolicy::Fixed 45 | 46 | 47 | 48 | 10 49 | 20 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 0 60 | 61 | 62 | 63 | foo 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /sdk/scx/IconvHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace scx { 9 | 10 | namespace IconvHelper { 11 | 12 | inline bool 13 | ConvFromTo(const std::string& srcEncoding, 14 | const std::string& destEncoding, 15 | const char* srcBuf, 16 | size_t srcLen, 17 | std::string& dest, 18 | std::vector& workBuf) { 19 | if (srcEncoding.empty() || destEncoding.empty() || srcEncoding == destEncoding) 20 | return false; 21 | 22 | using iconv_fn = size_t (*)(iconv_t, const char**, size_t*, char**, size_t*); 23 | const iconv_fn do_iconv = (iconv_fn)iconv; 24 | 25 | bool ok = true; 26 | const char* inBuf = srcBuf; 27 | size_t inLeft = srcLen; 28 | 29 | char* outBuf; 30 | size_t outLeft; 31 | if (srcLen > workBuf.size()) { 32 | workBuf.resize(srcLen * 3 + 4); 33 | } 34 | outBuf = workBuf.data(); 35 | outLeft = workBuf.size(); 36 | 37 | do { 38 | iconv_t cd = iconv_open(destEncoding.c_str(), srcEncoding.c_str()); 39 | if (cd == (iconv_t)-1) { 40 | ok = false; 41 | break; 42 | } 43 | 44 | errno = 0; 45 | size_t nbytes = do_iconv(cd, &inBuf, &inLeft, &outBuf, &outLeft); 46 | if (nbytes != (size_t)-1) { 47 | break; 48 | } else if (errno != E2BIG) { 49 | ok = false; 50 | break; 51 | } 52 | inBuf = srcBuf; 53 | inLeft = srcLen; 54 | 55 | workBuf.resize(workBuf.size() * 2); 56 | outBuf = workBuf.data(); 57 | outLeft = workBuf.size(); 58 | 59 | iconv_close(cd); 60 | } while (true); 61 | 62 | if (ok) { 63 | dest.assign(workBuf.data(), workBuf.size() - outLeft); 64 | } 65 | 66 | return ok; 67 | } 68 | 69 | inline bool 70 | ConvFromTo(const std::string& srcEncoding, const std::string& destEncoding, const char* srcBuf, size_t srcLen, std::string& dest) { 71 | std::vector workBuf; 72 | return ConvFromTo(srcEncoding, destEncoding, srcBuf, srcLen, dest, workBuf); 73 | } 74 | } // namespace IconvHelper 75 | } // namespace scx 76 | --------------------------------------------------------------------------------