diff --git a/MANUAL.md b/MANUAL.md index f3fdacb..6af9aca 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -5,7 +5,6 @@ Chipmachine is a fullscreen, graphical music player for various (retro) formats. It uses instant incremental search to locate songs in it's song database -- meaning you don't need to download or add music files yourself. -Initially, it searches the *Modland* colletion and downloads songs from *ftp.modland.com*. ## QUICKSTART @@ -26,23 +25,24 @@ Initially, it searches the *Modland* colletion and downloads songs from *ftp.mod * **F6** = Next song * **F8** = Clear play queue -## ADDING NEW SONG COLLECTIONS - -Song collections are configured in `lua/db.lua`. The High Voltage Sid Collection is preconfigured, just unpack the `C64Music` directory into the chipmachine directory and start chipmachine to index it. At this point you may also want to add *exlude_formats* to the Modland section, to exclude all SIDS from there and avoid duplicate songs in the database. - ## CHIPMACHINE FILES Chipmachine reads and write several files in it's directory that can be good to know about. -* `music.db` - This is the sqlite3 database with all the songs. It is generated from the configured sources -if it does not exist. -* `index.dat` - This is the index used for incremental search. It is calculated on startup if it does not exist. -* `data/` - This directory contains several files that Chipmachine requires to run, like BIOS files for music emulators, -and song information data like `songlengths.dat` and `STIL.txt`. -* `_files/` - This is a local cache of files fetched from the Internet. If this directory becomes too large you -can clear all o rsome of the files in it. -* `lua/init.lua` - This is a settings file that defines the layout of the screen. You can try playing around with it. -It is automatically reloaded if changed while chipmachine is running. +* `music.db` - This is the sqlite3 database with all the songs. It is generated from the + configured sources if it does not exist. +* `index.dat` - This is the index used for incremental search. It is calculated on startup + if it does not exist. +* `data/` - This directory contains several files that Chipmachine requires to run, like + BIOS files for music emulators, and song information data like `songlengths.dat` and +`STIL.txt`. +* `_webfiles/` - This is a local cache of files fetched from the Internet. If this directory + becomes too large you can clear all or some of the files in it. +* `lua/screen.lua` - This is a settings file that defines the layout of the screen. You can + try playing around with it. It is automatically reloaded if changed while chipmachine +is running. * `lua/db.lua` - This file defines the music sources for the database. -If you make changes to `db.lua` you probably want to delete both `music.db` and `index.dat` +If you make changes to `db.lua` you probably want to delete both `music.db` and +`index.dat`, or increase the version number. + diff --git a/README.md b/README.md index 70a42bc..43f14fe 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ chipmachine ### Linux/Debian ``` -$ sudo apt-get install cmake git g++ zlib1g-dev libao-dev libgl1-mesa-dev libasound2-dev libglfw3-dev libcurl4-gnutls-dev libglew-dev libmpg123-dev +$ sudo apt-get install cmake git g++ zlib1g-dev libao-dev libgl1-mesa-dev libasound2-dev libglfw3-dev libcurl4-gnutls-dev libglew-dev libmpg123-dev ninja-build ``` ### Mac OSX @@ -26,7 +26,7 @@ $ sudo apt-get install cmake git g++ zlib1g-dev libao-dev libgl1-mesa-dev libaso * Download, build and install _libmpg123_ (http://sourceforge.net/projects/mpg123/files/) ``` -$ brew install git cmake ninja freetype glew glfw3 sdl +$ brew install git cmake ninja freetype glew glfw3 ``` ### Windows @@ -39,7 +39,7 @@ $ pacman -S mingw32/mingw-w64-i686-cmake msys/git mingw32/mingw-w64-i686-gcc min ### Raspberry PI -... +* Very similar to Debian above ## Building diff --git a/build.py b/build.py index b46e454..118baf2 100755 --- a/build.py +++ b/build.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os.path import subprocess @@ -82,5 +82,6 @@ def is_exe(fpath): exe = os.path.join(outputDir, 'Chipmachine.app/Contents/MacOS/chipmachine') else : exe = os.path.join(outputDir, 'chipmachine') + print exe os.system(exe + ' -d') diff --git a/lua/db.lua b/lua/db.lua index 2306d2a..3e0c5db 100644 --- a/lua/db.lua +++ b/lua/db.lua @@ -4,7 +4,7 @@ -- local_dir : If exists, will be checked first for files before downloading. Also used to create song list -- If song_list or or source can not be found, database will not be added -VERSION = 4; +VERSION = 5; DB = { { diff --git a/src/MusicDatabase.cpp b/src/MusicDatabase.cpp index e684fcd..df1b6a5 100644 --- a/src/MusicDatabase.cpp +++ b/src/MusicDatabase.cpp @@ -224,7 +224,7 @@ void MusicDatabase::initDatabase(const std::string &workDir, unordered_map secondary = {"smpl", "sam", "ins", "smp", "pdx"}; + static const std::set secondary = {"smpl", "sam", "ins", "smp", "pdx", "nt", "as"}; static const unordered_set hasSubFormats = {"Ad Lib", "Video Game Music"}; diff --git a/src/MusicPlayer.cpp b/src/MusicPlayer.cpp index 9ed3a53..b0bec5c 100644 --- a/src/MusicPlayer.cpp +++ b/src/MusicPlayer.cpp @@ -322,12 +322,13 @@ shared_ptr MusicPlayer::fromFile(const string &fileName) { shared_ptr player; string name = fileName; utils::makeLower(name); + for(auto &plugin : plugins) { if(plugin->canHandle(name)) { LOGD("Playing with %s\n", plugin->name()); player = shared_ptr(plugin->fromFile(fileName)); - //if(!player) - // continue; + if(!player) + continue; break; } } diff --git a/src/MusicPlayerList.cpp b/src/MusicPlayerList.cpp index cbc88c7..3fdf789 100644 --- a/src/MusicPlayerList.cpp +++ b/src/MusicPlayerList.cpp @@ -348,16 +348,21 @@ void MusicPlayerList::playCurrent() { return; } + bool isStarTrekker = (currentInfo.path.find("Startrekker") != string::npos); + // Known music formats with 2 files static const std::unordered_map fmt_2files = { {"mdat", "smpl"}, // TFMX {"sng", "ins"}, // Richard Joseph {"jpn", "smp"}, // Jason Page PREFIX {"dum", "ins"}, // Rob Hubbard 2 + {"adsc", "adsc.as"} // Audio Sculpture }; string ext2; if(fmt_2files.count(ext) > 0) ext2 = fmt_2files.at(ext); + if(isStarTrekker) + ext2 = "mod.nt"; if(ext2 != "") { files++; auto smpl_file = currentInfo.path.substr(0, currentInfo.path.find_last_of('.') + 1) + ext2;