Better menus, fix UTF-8 bug
This commit is contained in:
2019-05-08 01:22:55 -07:00
parent 3f53cf689e
commit 2aa841e7e0
12 changed files with 2135 additions and 1535 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,9 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.
## [0.1.5.3]
- Preferences window
## [0.1.6]
- Preferences, version, console menu items
- Fix UTF-8 character bug
## [0.1.5]
- Add version check

View File

@@ -164,6 +164,12 @@ Gw
<action selector="menuItemSelected:" target="207" id="x6l-Tq-pHp"/>
</connections>
</menuItem>
<menuItem title="Check for Updates..." id="C0p-oO-R2b">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="menuItemSelected:" target="207" id="iT2-Ph-VrL"/>
</connections>
</menuItem>
<menuItem title="Services" id="235">
<menu key="submenu" title="Services" systemMenu="services" id="234"/>
</menuItem>
@@ -483,6 +489,12 @@ Gw
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="24">
<items>
<menuItem title="Show Debug Console" id="lMd-a8-8Ow">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="menuItemSelected:" target="207" id="2Lz-zY-3KO"/>
</connections>
</menuItem>
<menuItem title="Zoom" keyEquivalent="z" id="197">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
@@ -708,5 +720,11 @@ Gw
</textFieldCell>
<point key="canvasLocation" x="608" y="270"/>
</textField>
<menuItem title="Check for Updates..." id="U6h-y5-bg3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="menuItemSelected:" target="207" id="RcS-Le-Wo9"/>
</connections>
</menuItem>
</objects>
</document>

Binary file not shown.

View File

@@ -9,14 +9,6 @@ $version = file_get_contents(__DIR__."/version.txt");
require (__DIR__."/functions.php");
// Check for translocation
if (!@touch(__DIR__."/test")) {
alert("Minat cannot run from the Downloads folder");
quitme();
die;
}
// Prefs
$prefs = __DIR__."/prefs.php";
@@ -29,6 +21,8 @@ if (!file_exists($prefs)) {
$p = unserialize(file_get_contents($prefs));
// Extra prefs
$p['phpbin'] = "/usr/bin/php";
$p['flacbin'] = __DIR__."/bin/flac";
$p['metaflacbin'] = __DIR__."/bin/metaflac";
@@ -44,33 +38,8 @@ if (!file_exists($prefs)) {
}
// Version check
if (strpos(__FILE__,".app")) {
$checkfile = __DIR__."/vcheck";
if (!file_exists($checkfile) | time()-@filemtime($checkfile) > 86400) {
$curr_version = file_get_contents("http://git.profiteroles.org/profiteroles/Minat/raw/branch/master/version.txt");
addline("Version check, me=".$version." latest=".$curr_version);
if ($curr_version > $version) {
if(askMulti("A new version of Minat is available", array("Skip","Download")) == 1) {
exec("open http://git.profiteroles.org/profiteroles/Minat");
quitme();
}
}
touch($checkfile);
}
}
if ($p['mode'] != 1) { $p['premature'] = 1; addline("MODE ".$p['mode']." NOT YET IMPLEMENTED."); }
// If SHIFT key is held down, open debug window
if(exec(__DIR__."/bin/keys") == 512) {
exec("open -n Console.app --args ".$p['logfile']);
}
// Make work dir
if (!is_dir($p['workdir'])) {
@@ -99,12 +68,39 @@ if(count($argv) == 0) {
die;
}
// Preferences
if ($argv[0] == "Preferences...") {
exec($p['phpbin']." ".__DIR__."/MinatPrefs.php");
addline("Launch preferences");
die;
}
// Version check
if ($argv[0] == "Check for Updates...") {
$curr_version = file_get_contents("http://git.profiteroles.org/profiteroles/Minat/raw/branch/master/version.txt");
addline("Version check, me=".$version." latest=".$curr_version);
if ($curr_version > $version) {
if(askMulti("Minat ".$curr_version." is available (you have ".$version.")", array("Cancel","Download")) == 1) {
exec("open http://git.profiteroles.org/profiteroles/Minat");
die;
}
} else {
alert($version." is the latest version","Up-to-date");
die;
}
}
// Console
if ($argv[0] == "Show Debug Console") {
exec("open -n Console.app --args ".$p['logfile']);
die;
}
$stamp = md5(serialize($argv))."_".time();
$workdir = $p['workdir'].$stamp."/";
$batchfile = $workdir.$stamp.".sh";
@@ -182,6 +178,9 @@ foreach ($argv as $target) {
$mimecmd = $p['metaflacbin']." --list --block-type=PICTURE ".escapeshellarg($files[0])." | head -10 | grep MIME | sed 's:.*/::'";
addline($mimecmd);
$mime = exec($mimecmd);
if ($mime == " MIME type:") {
$mime = "pic";
}
if (@$mime) {
@@ -248,7 +247,7 @@ foreach ($argv as $target) {
$dest = $destdir.basename($file,".flac").".mp3";
$lockfile = $workdir.md5($target).".".basename($file,".flac").".lock";
$cmd_flac = $p['flacbin']." -dcs -- ".escapeshellarg($file);
$cmd_lame = $p['lamebin']." -S ".$p['lameopts']." ".$tags." ".$covertags." - ".escapeshellarg($dest);
$cmd_lame = $p['lamebin']." -S ".$p['lameopts']." --id3v2-utf16 ".$tags." ".$covertags." - ".escapeshellarg($dest);
$cmd_lock = "touch ".escapeshellarg($lockfile);
$line[] = $cmd_flac." | ".$cmd_lame." ; ".$cmd_lock;

BIN
Parallel/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -9,6 +9,10 @@ if ($argv[3]) { $log = $argv[3]; } else { $log = "/dev/null"; }
echo "Starting ".$lines." threads...";
$locale="en_US.UTF-8";
setlocale(LC_ALL, $locale);
putenv("LC_ALL=".$locale);
exec(__DIR__."/parallel < ".escapeshellarg($argv[1])." >> ".$log." 2>&1 &");
echo "\nPROGRESS:0\n";

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ Support is planned for two other operations:
* Generate specs from audio files supported by sox
* Rename folders based on the tags of the audio files inside
* **⇩ [Download Minat 0.1.5](http://www.profiteroles.org/downloads/Minat_0.1.5.zip)**
* **⇩ [Download Minat 0.1.6](http://www.profiteroles.org/downloads/Minat_0.1.6.zip)**
## Screenshot

BIN
bin/keys → bin/.DS_Store vendored Executable file → Normal file

Binary file not shown.

0
test
View File

View File

@@ -1 +1 @@
0.1.5.3
0.1.6