diff --git a/BUILDING.MD b/BUILDING.MD
index 954d3f0..38ae20d 100644
--- a/BUILDING.MD
+++ b/BUILDING.MD
@@ -1,3 +1,4 @@
+
# Building cdcrush dot NET
@@ -9,20 +10,42 @@ https://www.visualstudio.com/downloads/
### Running Requirements
-These tools are needed to run cdcrush:
+These tools are needed to **run** cdcrush:
- **FreeArc**, an open source archiver. **Included** in the project files.\
Project Site : https://sourceforge.net/projects/freearc
- **Ecmtools**, open source CD tools. **Included** in the project files. \
Project Site : https://github.com/kidoz/ecm
-- **FFmpeg**, open source video/audio codecs. **NOT INCLUDED** \
+- **FFmpeg**, open source video/audio codecs. :warning: **NOT INCLUDED** \
Project Site : https://www.ffmpeg.org
### Building `release`
-Create a subfolder named `tools` and put all the external executables there `[Arc.exe , ecm.exe , unecm.exe, ffmpeg.exe ]`
+Create a subfolder named `tools` and put all the external executables there `[Arc.exe , ecm.exe , unecm.exe, ffmpeg.exe ]` *ffmpeg is optional*
+
### Building `debug`
The tool executables are fetched from the root repo folder `/tools/`. All the tools are provided in the repo except `FFmpeg` which you need to download and place it on your system/user path.
+
+
+
+### `cdinfos.dll`
+
+
+This file was build using **HAXE**, compiled code from [**cdcrush nodejs**](https://github.com/johndimi/cdcrush) version.
+Basically it's 2 classes, `CDInfo` and `CDTrack` compiled into a DLL so that I can have a single codebase for the CueParse for both cdcursh versions
+
+You can find the [source code for there files here.](https://github.com/johndimi/cdcrush/tree/master/src/cd)
+
+> :warning: You don't really have to build it yourself, you can just grab `cdinfos.dll` that is inside the project folder.
+
+#### To compile the cdinfos DLL with HAXE run this command:
+```haxe
+haxe -cp src/cd -D dll -D no-root -cs cdinfos cd.CDInfos cd.CDTrack
+```
+
+- `src/cd` must point to the nodejs version folder where the CD classes are
+- It will create a directory `cdinfos/` and in there you can find the .dll file
+
diff --git a/CHANGELOG.MD b/CHANGELOG.MD
index fa90870..01b5698 100644
--- a/CHANGELOG.MD
+++ b/CHANGELOG.MD
@@ -1,5 +1,13 @@
## CHANGELOG
+### V1.4
+- New CD Parser class
+ - Fixed times bug when converting multifile CD images to a single .bin
+ - built with **HAXE** and is included as a DLL file
+ - is the exact same class used in the **nodejs** version of cdcrush *(same codebase)*
+- Fixed bug, when setting a custom TEMP folder, it now sets and restores it correctly.
+- When **crushing** and the output archive already exists, it doesn't overwrite it, instead it renames the new archive by adding a `_` to the end of the file.
+
### V1.3
- Added LOG window. You can now see a realtime log by pressing the "LOG" button on the bottom right of the window
- Upgraded version to 1.3, because many new features were added since 1.2
@@ -28,4 +36,4 @@
- Calculate and display the **MD5** of the first data track, useful to quickly identify the validity of the CD
- Ability to add an image cover to a CD archive. The image will then be displayed when restoring a CD.
- MultiThreaded. Background FFmpeg and ECM operations can execute in parallel. *(Custom amount of threads in the options tab)*
- - Temporary files will be deleted upon user program exit.
\ No newline at end of file
+ - Temporary files will be deleted upon user program exit.
diff --git a/README.MD b/README.MD
index 37f9aa1..cf9d3c5 100644
--- a/README.MD
+++ b/README.MD
@@ -1,10 +1,12 @@
+
# CDCRUSH dot NET
**Name**: cdcrush, *Highy compress cd-image games*\
**Author:** John Dimi, *twitter*: [@jondmt](https://twitter.com/jondmt)\
**Project Page and Sources:** [https://github.com/johndimi/cdcrush.net](https://github.com/johndimi/cdcrush.net)\
**Language:** C# .NET 4.5, **Licence:** MIT\
-**Version:** 1.3 **Platform:** Windows
+**Version:** 1.3 **Platform:** Windows\
+**Sister Project** : [cdcrush nodejs](https://www.npmjs.com/package/cdcrush)
## Download
@@ -129,9 +131,15 @@ See [`CHANGELOG.MD`](CHANGELOG.MD)
**A** : FFmpeg.exe is a small beast ( *around 36 megabytes*) and in some cases users already have it on their pc. So I am publishing a version with and a version without it.
-## Npm Version
+## NodeJS Version
+
+This project is a continuation of [**cdcrush nodeJS**](https://www.npmjs.com/package/cdcrush).
+
+**NEW APRIL 2018** :: I updated the **nodejs** version of **cdcrush** and it's compatible with the **.net** version. Meaning that archives created with **.net** can be opened with **.nodejs** and vice versa.
+
+> :stars: **nodejs** version support **batches** , so you can restore/compress multiple CD with one command.
-This project is a continuation of [**cdcrush npm**](https://www.npmjs.com/package/cdcrush). You can check it out if you want, but **note** :warning: that the NPM version is old and **NOT RECOMMENDED TO USE** until I update it.
+You can checkout **nodejs** version over at NPM : https://www.npmjs.com/package/cdcrush
## About
diff --git a/cdcrush/Properties/AssemblyInfo.cs b/cdcrush/Properties/AssemblyInfo.cs
index dab9cc3..3b6f21e 100644
--- a/cdcrush/Properties/AssemblyInfo.cs
+++ b/cdcrush/Properties/AssemblyInfo.cs
@@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.3.0")]
-[assembly: AssemblyFileVersion("1.2.3.0")]
+[assembly: AssemblyVersion("1.4.0.0")]
+[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/cdcrush/cdcrush.csproj b/cdcrush/cdcrush.csproj
index 7ec7aef..7fc0e8b 100644
--- a/cdcrush/cdcrush.csproj
+++ b/cdcrush/cdcrush.csproj
@@ -25,7 +25,7 @@
falsetrue0
- 1.2.0.0
+ 1.4.0.0falsetrue
@@ -62,6 +62,10 @@
icon.ico
+
+ False
+ .\cdinfos.dll
+ ..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll
@@ -125,7 +129,6 @@
-
diff --git a/cdcrush/cdinfos.dll b/cdcrush/cdinfos.dll
new file mode 100644
index 0000000..06c92eb
Binary files /dev/null and b/cdcrush/cdinfos.dll differ
diff --git a/cdcrush/forms/FormChecksums.cs b/cdcrush/forms/FormChecksums.cs
index 6b63ae3..43ff2c3 100644
--- a/cdcrush/forms/FormChecksums.cs
+++ b/cdcrush/forms/FormChecksums.cs
@@ -9,12 +9,12 @@ namespace cdcrush.forms
public partial class FormChecksums: Form
{
// --
- CueReader cd;
+ cd.CDInfos cd;
static public bool ISOPEN = false;
// --
- public FormChecksums(CueReader _cd)
+ public FormChecksums(cd.CDInfos _cd)
{
cd = _cd;
InitializeComponent();
diff --git a/cdcrush/forms/FormMain.cs b/cdcrush/forms/FormMain.cs
index b0066a0..e8b9b77 100644
--- a/cdcrush/forms/FormMain.cs
+++ b/cdcrush/forms/FormMain.cs
@@ -33,7 +33,7 @@ public partial class FormMain : Form
// Send whole form LOCK status from components
internal static Action sendLock;
// Request to open CD INFO popup
- internal static Action showCdInfo;
+ internal static Action showCdInfo;
// VARS ::
// ---------------
@@ -181,7 +181,7 @@ void loadAndSetupSettings()
// --
// Show a popup with some CD infos like checksums
- public void form_showCdInfo(CueReader cd)
+ public void form_showCdInfo(cd.CDInfos cd)
{
if(FormChecksums.ISOPEN) return;
var f = new FormChecksums(cd);
@@ -386,7 +386,7 @@ private void btn_selectTemp_Click(object sender, EventArgs e)
if(CDCRUSH.setTempFolder(path))
{
info_tempFolder.Text = CDCRUSH.TEMP_FOLDER;
- Properties.Settings.Default.tempFolder = CDCRUSH.TEMP_FOLDER; // A valid folder
+ Properties.Settings.Default.tempFolder = path; // A valid folder
}
}
}// -----------------------------------------
diff --git a/cdcrush/forms/PanelCompress.cs b/cdcrush/forms/PanelCompress.cs
index 866a429..2432073 100644
--- a/cdcrush/forms/PanelCompress.cs
+++ b/cdcrush/forms/PanelCompress.cs
@@ -13,7 +13,7 @@ public partial class PanelCompress : UserControl
string preparedCover;
string loadedCuePath;
// This holds the info of the CD that was just compressed. Set AFTER crushing
- CueReader postCdInfo;
+ cd.CDInfos postCdInfo;
// Hold the number of tracks of the quickloadedCD
int numberOfTracks;
@@ -27,7 +27,7 @@ public PanelCompress()
private void PanelCompress_Load(object sender, EventArgs e)
{
// -- Some Tooltips
- ToolTip tt = new ToolTip();
+ ToolTip tt = new ToolTip();
tt.SetToolTip(chk_encodedCue, "Encodes audio tracks and creates a .CUE file that handles data and encoded audio tracks. Doesn't create a final archive. This format can be used in some emulators.");
tt.SetToolTip(pictureBox1,"You can optionally set an image cover for this CD and it will be stored in the archive.");
@@ -208,7 +208,7 @@ public void handle_dropped_file(string file)
else if (ext == ".jpg")
form_set_cover(file);
else {
- FormMain.sendMessage("Unsupported file extension. Drop a .CUE file",3);
+ FormMain.sendMessage("Unsupported file extension. Drop a .CUE file, or .JPG for a cover",3);
}
}// -----------------------------------------
@@ -220,7 +220,7 @@ private void btn_CRUSH_Click(object sender, EventArgs e)
Tuple audioQ = Tuple.Create(combo_audio_c.SelectedIndex,combo_audio_q.SelectedIndex);
// Since I can fire 2 jobs from here, have a common callback
- Action jobCallback = (complete, newSize, cd) => {
+ Action jobCallback = (complete, newSize, cd) => {
FormTools.invoke(this, () =>{
form_lockSection("all", false);
diff --git a/cdcrush/forms/PanelRestore.cs b/cdcrush/forms/PanelRestore.cs
index 9d50273..f86abaf 100644
--- a/cdcrush/forms/PanelRestore.cs
+++ b/cdcrush/forms/PanelRestore.cs
@@ -18,7 +18,7 @@ public partial class PanelRestore : UserControl
// CD Info of the CD prepared to be restored
// Primarily used to getting the checksum data
- CueReader loadedCDInfo;
+ cd.CDInfos loadedCDInfo;
// -----------------------------------------
@@ -93,7 +93,7 @@ void form_setCdInfo(dynamic cdInfo = null)
loadedCDInfo = cdInfo.cd;
btn_chksm.Enabled = true;
- int numberOfTracks = loadedCDInfo.tracks.Count;
+ int numberOfTracks = loadedCDInfo.tracks.length;
info_cdtitle.Text = loadedCDInfo.CD_TITLE;
info_size0.Text = String.Format("{0}MB", FormTools.bytesToMB(cdInfo.sizeArc));
@@ -205,7 +205,7 @@ private void btn_RESTORE_Click(object sender, EventArgs e)
FormMain.sendMessage("", 1);
// Send the nuber of tracks for proper progress reporting
- CDCRUSH.HACK_CD_TRACKS = loadedCDInfo.tracks.Count;
+ CDCRUSH.HACK_CD_TRACKS = loadedCDInfo.tracks.length;
// Start the job
// Note, Progress updates are automatically being handled by the main FORM
diff --git a/cdcrush/lib/CueReader.cs b/cdcrush/lib/CueReader.cs
index 68abca0..a0d94c8 100644
--- a/cdcrush/lib/CueReader.cs
+++ b/cdcrush/lib/CueReader.cs
@@ -1,4 +1,19 @@
-using System;
+/**
+ * CueReader.cs
+ * CD .cue file parser and saver
+ * -----------------------
+ * Author : John Dimi
+ *
+ * ATTENTION:
+ * ----------
+ * This class is DEPRECATED! AND NOT USED
+ * In favor of the CDINFO DLL object which was generated from HAXE code.
+ * The reason is to have a single codebase for both this C# version
+ * and the nodejs version of CDCRUSH.
+ *
+ * ================================================= */
+
+using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
@@ -9,9 +24,7 @@
namespace cdcrush.lib
{
-/**
- * CueReader is the main class to read and operate CUE files
- */
+
public class CueReader
{
// :: STATICS
diff --git a/cdcrush/prog/CDCRUSH.cs b/cdcrush/prog/CDCRUSH.cs
index 7211410..7632a12 100644
--- a/cdcrush/prog/CDCRUSH.cs
+++ b/cdcrush/prog/CDCRUSH.cs
@@ -18,7 +18,7 @@ public static class CDCRUSH
// -- Program Infos
public const string AUTHORNAME = "John Dimi";
public const string PROGRAM_NAME = "cdcrush";
- public const string PROGRAM_VERSION = "1.3";
+ public const string PROGRAM_VERSION = "1.4";
public const string PROGRAM_SHORT_DESC = "Highy compress cd-image games";
public const string LINK_DONATE = "https://www.paypal.me/johndimi";
public const string LINK_SOURCE = "https://github.com/johndimi/cdcrush.net";
@@ -79,7 +79,7 @@ public static class CDCRUSH
// Hacky way of pushing number of expected tracks on the jobs.
// MUST BE SET RIGHT BEFORE CREATING AJOB.
// Until I implement progress reporting in a better way, this works fine.
- public static int HACK_CD_TRACKS=0;
+ public static int HACK_CD_TRACKS = 0;
// -----------------------------------------
// :: AUDIO QUALITY ::
@@ -220,7 +220,7 @@ public static string getAudioQualityString(Tuple A)
/// Completed (completeStatus,final Size)
///
public static bool startJob_ConvertCue(string _Input, string _Output, Tuple _Audio,
- string _Title, Action onComplete)
+ string _Title, Action onComplete)
{
if (LOCKED) { ERROR="Engine is working"; return false; }
if (!FFMPEG_OK) { ERROR="FFmpeg is not set"; return false; }
@@ -261,7 +261,7 @@ public static bool startJob_ConvertCue(string _Input, string _Output, TupleCompleted (completeStatus,CrushedSize)
///
public static bool startJob_CrushCD(string _Input, string _Output, Tuple _Audio,
- string _Cover, string _Title, int compressionLevel, Action onComplete)
+ string _Cover, string _Title, int compressionLevel, Action onComplete)
{
if (LOCKED) { ERROR="Engine is working"; return false; }
if (!FFMPEG_OK) { ERROR="FFmpeg is not set"; return false; }
@@ -361,20 +361,20 @@ public static object loadQuickCUE(string cueFile)
if (!check_file_(cueFile,".cue")) return false;
// Load the CUE file and try to parse it
- var cd = new CueReader();
-
- if(!cd.load(cueFile))
- {
- ERROR = cd.ERROR; return null;
+ var cd = new cd.CDInfos();
+ try {
+ cd.cueLoad(cueFile);
+ }catch(haxe.lang.HaxeException e) {
+ ERROR = e.Message; return null;
}
-
- LOG.log("= QuickLoaded `{0}' - [OK]",cueFile);
+
+ LOG.log("= QuickLoaded `{0}' - [OK]", cueFile);
var info = new
{
title = cd.CD_TITLE,
size1 = cd.CD_TOTAL_SIZE,
- tracks = cd.tracks.Count
+ tracks = cd.tracks.length
};
return info;
@@ -419,9 +419,11 @@ public static bool loadQuickInfo(string arcFile, Action