├── .gitignore
├── README.md
├── c#
├── VGSC.sln
└── VGSC
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Converter.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── VGSC.csproj
│ └── packages.config
└── haxe
└── src
├── Main.hx
└── VGMStream.hx
/.gitignore:
--------------------------------------------------------------------------------
1 | # Haxe
2 | bin/
3 | n/
4 | releases/
5 | Run.bat
6 | *.hxproj
7 | *.hxml
8 |
9 | # C#
10 | ## Ignore Visual Studio temporary files, build results, and
11 | ## files generated by popular Visual Studio add-ons.
12 | ##
13 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
14 |
15 | # User-specific files
16 | *.suo
17 | *.user
18 | *.userosscache
19 | *.sln.docstates
20 |
21 | # User-specific files (MonoDevelop/Xamarin Studio)
22 | *.userprefs
23 |
24 | # Build results
25 | [Dd]ebug/
26 | [Dd]ebugPublic/
27 | [Rr]elease/
28 | [Rr]eleases/
29 | x64/
30 | x86/
31 | bld/
32 | [Bb]in/
33 | [Oo]bj/
34 | [Ll]og/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUNIT
49 | *.VisualState.xml
50 | TestResult.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 | **/Properties/launchSettings.json
65 |
66 | # StyleCop
67 | StyleCopReport.xml
68 |
69 | # Files built by Visual Studio
70 | *_i.c
71 | *_p.c
72 | *_i.h
73 | *.ilk
74 | *.meta
75 | *.obj
76 | *.pch
77 | *.pdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *.log
88 | *.vspscc
89 | *.vssscc
90 | .builds
91 | *.pidb
92 | *.svclog
93 | *.scc
94 |
95 | # Chutzpah Test files
96 | _Chutzpah*
97 |
98 | # Visual C++ cache files
99 | ipch/
100 | *.aps
101 | *.ncb
102 | *.opendb
103 | *.opensdf
104 | *.sdf
105 | *.cachefile
106 | *.VC.db
107 | *.VC.VC.opendb
108 |
109 | # Visual Studio profiler
110 | *.psess
111 | *.vsp
112 | *.vspx
113 | *.sap
114 |
115 | # Visual Studio Trace Files
116 | *.e2e
117 |
118 | # TFS 2012 Local Workspace
119 | $tf/
120 |
121 | # Guidance Automation Toolkit
122 | *.gpState
123 |
124 | # ReSharper is a .NET coding add-in
125 | _ReSharper*/
126 | *.[Rr]e[Ss]harper
127 | *.DotSettings.user
128 |
129 | # JustCode is a .NET coding add-in
130 | .JustCode
131 |
132 | # TeamCity is a build add-in
133 | _TeamCity*
134 |
135 | # DotCover is a Code Coverage Tool
136 | *.dotCover
137 |
138 | # AxoCover is a Code Coverage Tool
139 | .axoCover/*
140 | !.axoCover/settings.json
141 |
142 | # Visual Studio code coverage results
143 | *.coverage
144 | *.coveragexml
145 |
146 | # NCrunch
147 | _NCrunch_*
148 | .*crunch*.local.xml
149 | nCrunchTemp_*
150 |
151 | # MightyMoose
152 | *.mm.*
153 | AutoTest.Net/
154 |
155 | # Web workbench (sass)
156 | .sass-cache/
157 |
158 | # Installshield output folder
159 | [Ee]xpress/
160 |
161 | # DocProject is a documentation generator add-in
162 | DocProject/buildhelp/
163 | DocProject/Help/*.HxT
164 | DocProject/Help/*.HxC
165 | DocProject/Help/*.hhc
166 | DocProject/Help/*.hhk
167 | DocProject/Help/*.hhp
168 | DocProject/Help/Html2
169 | DocProject/Help/html
170 |
171 | # Click-Once directory
172 | publish/
173 |
174 | # Publish Web Output
175 | *.[Pp]ublish.xml
176 | *.azurePubxml
177 | # Note: Comment the next line if you want to checkin your web deploy settings,
178 | # but database connection strings (with potential passwords) will be unencrypted
179 | *.pubxml
180 | *.publishproj
181 |
182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
183 | # checkin your Azure Web App publish settings, but sensitive information contained
184 | # in these scripts will be unencrypted
185 | PublishScripts/
186 |
187 | # NuGet Packages
188 | *.nupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 |
214 | # Visual Studio cache files
215 | # files ending in .cache can be ignored
216 | *.[Cc]ache
217 | # but keep track of directories ending in .cache
218 | !*.[Cc]ache/
219 |
220 | # Others
221 | ClientBin/
222 | ~$*
223 | *~
224 | *.dbmdl
225 | *.dbproj.schemaview
226 | *.jfm
227 | *.pfx
228 | *.publishsettings
229 | orleans.codegen.cs
230 |
231 | # Including strong name files can present a security risk
232 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
233 | #*.snk
234 |
235 | # Since there are multiple workflows, uncomment next line to ignore bower_components
236 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
237 | #bower_components/
238 |
239 | # RIA/Silverlight projects
240 | Generated_Code/
241 |
242 | # Backup & report files from converting an old project file
243 | # to a newer Visual Studio version. Backup files are not needed,
244 | # because we have git ;-)
245 | _UpgradeReport_Files/
246 | Backup*/
247 | UpgradeLog*.XML
248 | UpgradeLog*.htm
249 | ServiceFabricBackup/
250 |
251 | # SQL Server files
252 | *.mdf
253 | *.ldf
254 | *.ndf
255 |
256 | # Business Intelligence projects
257 | *.rdl.data
258 | *.bim.layout
259 | *.bim_*.settings
260 | *.rptproj.rsuser
261 |
262 | # Microsoft Fakes
263 | FakesAssemblies/
264 |
265 | # GhostDoc plugin setting file
266 | *.GhostDoc.xml
267 |
268 | # Node.js Tools for Visual Studio
269 | .ntvs_analysis.dat
270 | node_modules/
271 |
272 | # Visual Studio 6 build log
273 | *.plg
274 |
275 | # Visual Studio 6 workspace options file
276 | *.opt
277 |
278 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
279 | *.vbw
280 |
281 | # Visual Studio LightSwitch build output
282 | **/*.HTMLClient/GeneratedArtifacts
283 | **/*.DesktopClient/GeneratedArtifacts
284 | **/*.DesktopClient/ModelManifest.xml
285 | **/*.Server/GeneratedArtifacts
286 | **/*.Server/ModelManifest.xml
287 | _Pvt_Extensions
288 |
289 | # Paket dependency manager
290 | .paket/paket.exe
291 | paket-files/
292 |
293 | # FAKE - F# Make
294 | .fake/
295 |
296 | # JetBrains Rider
297 | .idea/
298 | *.sln.iml
299 |
300 | # CodeRush
301 | .cr/
302 |
303 | # Python Tools for Visual Studio (PTVS)
304 | __pycache__/
305 | *.pyc
306 |
307 | # Cake - Uncomment if you are using it
308 | # tools/**
309 | # !tools/packages.config
310 |
311 | # Tabs Studio
312 | *.tss
313 |
314 | # Telerik's JustMock configuration file
315 | *.jmconfig
316 |
317 | # BizTalk build output
318 | *.btp.cs
319 | *.btm.cs
320 | *.odx.cs
321 | *.xsd.cs
322 |
323 | # OpenCover UI analysis results
324 | OpenCover/
325 |
326 | # Azure Stream Analytics local run output
327 | ASALocalRun/
328 |
329 | # MSBuild Binary and Structured Log
330 | *.binlog
331 |
332 | # NVidia Nsight GPU debugger configuration file
333 | *.nvuser
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Video Game Sound Converter
2 |
3 | Video Game Sound Converter (a.k.a. VGSC) is a wrapper for vgmstream, a program that can convert various video game sound formats to WAV. It was made to allow multiple file conversion and make it overall easier use. Credit for the actual conversion goes to hcs, who created vgmstream: [Website](https://www.hcs64.com/), [vgmstream repository](https://github.com/kode54/vgmstream)
4 |
5 | ## Different versions
6 |
7 | This repository contains 2 different versions of the program; one made in Haxe, the other in C#. The latest and recommended version is the C# one, which has a GUI and additional option support (coming soon). The Haxe version is an older version that has been used in the past, but I am keeping the source available both for myself and anybody interested. However that version is not expected to be updated anymore.
8 |
9 | ## Future features
10 |
11 | * Allow optional vgmstream arguments
--------------------------------------------------------------------------------
/c#/VGSC.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VGSC", "VGSC\VGSC.csproj", "{DCDDC8B1-8959-4E2F-AD17-4434C77018F2}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCDDC8B1-8959-4E2F-AD17-4434C77018F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {DCDDC8B1-8959-4E2F-AD17-4434C77018F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {DCDDC8B1-8959-4E2F-AD17-4434C77018F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {DCDDC8B1-8959-4E2F-AD17-4434C77018F2}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/c#/VGSC/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/c#/VGSC/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/c#/VGSC/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace VGSC
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/c#/VGSC/Converter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.IO;
7 | using System.Diagnostics;
8 |
9 | namespace VGSC
10 | {
11 | class Converter
12 | {
13 | private readonly string exePath = "vgmstream/vgmstream.exe";
14 | private Process process;
15 | private Action doneCallback;
16 |
17 | public Converter(Action doneCallback)
18 | {
19 | this.doneCallback = doneCallback;
20 |
21 | process = new Process();
22 | process.StartInfo.FileName = exePath;
23 | process.StartInfo.CreateNoWindow = true;
24 | process.StartInfo.RedirectStandardOutput = true;
25 | process.StartInfo.RedirectStandardError = true;
26 | process.StartInfo.UseShellExecute = false;
27 | process.EnableRaisingEvents = true;
28 | process.Exited += ConvertEnd;
29 | }
30 |
31 | public void Convert(string inPath, string outDir,
32 | double loopCount = -1, double fadeTime = -1,
33 | double fadeDelay = -1, bool ignoreLooping = false)
34 | {
35 | string outPath = Path.Combine(outDir, Path.GetFileNameWithoutExtension(inPath));
36 | outPath = Path.ChangeExtension(outPath, "wav");
37 | List args = new List();
38 |
39 |
40 | if (loopCount >= 0)
41 | args.Add("-l " + loopCount);
42 | if (fadeTime >= 0)
43 | args.Add("-f " + fadeTime);
44 | if (fadeDelay >= 0)
45 | args.Add("-d " + fadeDelay);
46 | if (ignoreLooping)
47 | args.Add("-i");
48 |
49 | args.Add(string.Format("-o \"{0}\"", outPath));
50 | args.Add(string.Format("\"{0}\"", inPath));
51 |
52 | string argString = String.Join(" ", args.ToArray());
53 | process.StartInfo.Arguments = argString;
54 | process.Start();
55 | }
56 |
57 | private void ConvertEnd(object sender, EventArgs e)
58 | {
59 | string output = process.StandardOutput.ReadToEnd();
60 | string error = process.StandardError.ReadToEnd();
61 |
62 | bool success = !error.StartsWith("failed");
63 |
64 | doneCallback(success);
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/c#/VGSC/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/c#/VGSC/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.Windows;
4 | using Microsoft.Win32;
5 | using Microsoft.WindowsAPICodePack.Dialogs;
6 | using System.Diagnostics;
7 | using System.IO;
8 | using System.ComponentModel;
9 |
10 | namespace VGSC
11 | {
12 | ///
13 | /// Interaction logic for MainWindow.xaml
14 | ///
15 | public partial class MainWindow : Window
16 | {
17 | public ObservableCollection ItemList { get; set; }
18 |
19 | private string[] filePaths;
20 | private string outDir;
21 |
22 | private int fileIndex;
23 |
24 | private Converter converter;
25 |
26 | public MainWindow()
27 | {
28 | ItemList = new ObservableCollection();
29 | converter = new Converter(ConvertDone);
30 |
31 | InitializeComponent();
32 | }
33 |
34 | private void OpenBtn_Click(object sender, RoutedEventArgs e)
35 | {
36 | OpenFileDialog dialog = new OpenFileDialog();
37 | dialog.Multiselect = true;
38 | dialog.Title = "Select files to open";
39 | bool? result = dialog.ShowDialog();
40 |
41 | if (result.HasValue && result.Value)
42 | {
43 | filePaths = dialog.FileNames;
44 |
45 | ItemList.Clear();
46 |
47 | foreach (string s in dialog.SafeFileNames)
48 | {
49 | ItemList.Add(new ConversionItem { Name = s, Status = "Unconverted" });
50 | }
51 | }
52 |
53 | ConvertBtn.IsEnabled = ItemList.Count > 0;
54 | }
55 |
56 | private void ConvertBtn_Click(object sender, RoutedEventArgs e)
57 | {
58 | CommonOpenFileDialog dialog = new CommonOpenFileDialog();
59 | dialog.IsFolderPicker = true;
60 | dialog.Title = "Select folder to put converted files into";
61 | CommonFileDialogResult result = dialog.ShowDialog();
62 |
63 | if (result == CommonFileDialogResult.Ok)
64 | {
65 | outDir = dialog.FileName;
66 | ConvertFiles();
67 | }
68 | }
69 |
70 | private void ConvertFiles()
71 | {
72 | fileIndex = 0;
73 | ConvertStart();
74 | }
75 |
76 | private void ConvertStart()
77 | {
78 | if (fileIndex >= filePaths.Length)
79 | return;
80 |
81 | ItemList[fileIndex].Status = "Converting";
82 |
83 | string inPath = filePaths[fileIndex];
84 | converter.Convert(inPath, outDir);
85 | }
86 |
87 | private void ConvertDone(bool success)
88 | {
89 | ItemList[fileIndex].Status = success ? "Success" : "Failed";
90 |
91 | fileIndex++;
92 | ConvertStart();
93 | }
94 | }
95 |
96 | public class ConversionItem : INotifyPropertyChanged
97 | {
98 | public event PropertyChangedEventHandler PropertyChanged;
99 |
100 | private string m_name;
101 | private string m_status;
102 |
103 | public string Name
104 | {
105 | get { return m_name; }
106 | set
107 | {
108 | m_name = value;
109 | OnPropertyChanged("Name");
110 | }
111 | }
112 |
113 | public string Status
114 | {
115 | get { return m_status; }
116 | set
117 | {
118 | m_status = value;
119 | OnPropertyChanged("Status");
120 | }
121 | }
122 |
123 | protected void OnPropertyChanged(string name)
124 | {
125 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
126 | }
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/c#/VGSC/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("VGSC")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("VGSC")]
15 | [assembly: AssemblyCopyright("Copyright © 2017")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/c#/VGSC/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace VGSC.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VGSC.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/c#/VGSC/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/c#/VGSC/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace VGSC.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/c#/VGSC/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/c#/VGSC/VGSC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DCDDC8B1-8959-4E2F-AD17-4434C77018F2}
8 | WinExe
9 | Properties
10 | VGSC
11 | VGSC
12 | v4.5.2
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | true
17 | false
18 | F:\Development\VGSC\PublishOutput\
19 | true
20 | Disk
21 | false
22 | Foreground
23 | 7
24 | Days
25 | false
26 | false
27 | true
28 | 1
29 | 1.0.0.%2a
30 | false
31 | true
32 | true
33 |
34 |
35 | AnyCPU
36 | true
37 | full
38 | false
39 | bin\Debug\
40 | DEBUG;TRACE
41 | prompt
42 | 4
43 |
44 |
45 | AnyCPU
46 | pdbonly
47 | true
48 | bin\Release\
49 | TRACE
50 | prompt
51 | 4
52 |
53 |
54 | D8ABF20A88C4DF21F9129A7CA7803EF5E54D9129
55 |
56 |
57 | VGSC_TemporaryKey.pfx
58 |
59 |
60 | true
61 |
62 |
63 | true
64 |
65 |
66 |
67 | ..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll
68 |
69 |
70 | ..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | 4.0
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | MSBuild:Compile
90 | Designer
91 |
92 |
93 | MSBuild:Compile
94 | Designer
95 |
96 |
97 | App.xaml
98 | Code
99 |
100 |
101 |
102 | MainWindow.xaml
103 | Code
104 |
105 |
106 |
107 |
108 | Code
109 |
110 |
111 | True
112 | True
113 | Resources.resx
114 |
115 |
116 | True
117 | Settings.settings
118 | True
119 |
120 |
121 | ResXFileCodeGenerator
122 | Resources.Designer.cs
123 |
124 |
125 |
126 | SettingsSingleFileGenerator
127 | Settings.Designer.cs
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | False
138 | Microsoft .NET Framework 4.5.2 %28x86 and x64%29
139 | true
140 |
141 |
142 | False
143 | .NET Framework 3.5 SP1
144 | false
145 |
146 |
147 |
148 |
155 |
--------------------------------------------------------------------------------
/c#/VGSC/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/haxe/src/Main.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import easyconsole.Begin;
4 | import easyconsole.End;
5 | import haxe.io.Path;
6 | import sys.FileSystem;
7 | import systools.Dialogs;
8 |
9 | /**
10 | * Main class. Initialises program, takes input.
11 | */
12 | class Main
13 | {
14 | static private inline var TITLE:String = "==========\nVGSC v2.1 - by puggsoy (puggsoy.wordpress.com)\nUses vgmstream r1040 - by hcs (www.hcs64.com)\n==========\n";
15 | static private inline var USAGE:String = "Command line usage: VGSC inDir outDir\n inDir: Path to directory containing files to convert\n outDir: Path to directory where converted files will be saved";
16 |
17 | static private var _args:Array;
18 |
19 | /**
20 | * Entry point. Initialise stuff, parse arguments.
21 | */
22 | static function main()
23 | {
24 | Begin.init();
25 | Begin.usage = USAGE;
26 | Begin.functions = [selectFiles, null, parseArgs]; //0 arguments, show UI. Needs 2 otherwise.
27 | Begin.parseArgs();
28 | }
29 |
30 | /**
31 | * Called when no arguments are passed in. Gives selection windows for input files and output directory.
32 | */
33 | static private function selectFiles()
34 | {
35 | Sys.println(TITLE);
36 | Sys.println(USAGE + "\n");
37 | Sys.println("Select the files you wish to convert");
38 |
39 | var allFilter:FILEFILTERS = { count:1, descriptions:["All Files"], extensions:["*"] };
40 | var files:Array = Dialogs.openFile("Choose files", "Choose files", allFilter);
41 |
42 | if (files == null)
43 | {
44 | End.anyKeyExit(2, "No files selected!");
45 | return;
46 | }
47 |
48 | Sys.println("Select the folder you want the converted files to be saved in");
49 |
50 | var outDir:String = Dialogs.folder("Choose folder", "Choose folder");
51 |
52 | if (outDir == null)
53 | {
54 | End.anyKeyExit(2, "No folder selected!");
55 | return;
56 | }
57 |
58 | convert(files, outDir);
59 | }
60 |
61 | /**
62 | * Called when 2 or more arguments are passed in. Parses first argument as input directory, second as output directory. Both must exist.
63 | */
64 | static private function parseArgs()
65 | {
66 | Sys.println(TITLE);
67 |
68 | var inDir:String = new Path(Begin.args[0]).toString();
69 |
70 | if (!FileSystem.exists(inDir) || !FileSystem.isDirectory(inDir))
71 | {
72 | End.anyKeyExit(3, "First argument must be an existing directory!");
73 | return;
74 | }
75 |
76 | inDir = FileSystem.fullPath(inDir);
77 | Sys.println('Input folder: $inDir');
78 |
79 | var inFiles:Array = FileSystem.readDirectory(inDir);
80 |
81 | if (inFiles.length == 0)
82 | {
83 | End.anyKeyExit(3, "Input folder must contain files!");
84 | return;
85 | }
86 |
87 | for (i in 0...inFiles.length)
88 | {
89 | inFiles[i] = inDir + "\\" + inFiles[i];
90 | }
91 |
92 | var outDir:String = new Path(Begin.args[1]).toString();
93 |
94 | if (!FileSystem.exists(outDir) || !FileSystem.isDirectory(outDir))
95 | {
96 | End.anyKeyExit(3, "Second argument must be an existing directory");
97 | return;
98 | }
99 |
100 | outDir = FileSystem.fullPath(outDir);
101 | Sys.println('Output folder: $outDir');
102 |
103 | convert(inFiles, outDir);
104 | }
105 |
106 | /**
107 | * Converts the files using VGMStream.
108 | * @param fileList List of input files.
109 | * @param outDir Output directory.
110 | */
111 | static private function convert(fileList:Array, outDir:String)
112 | {
113 | VGMStream.exePath = "vgmstream/vgmstream.exe";
114 |
115 | for (file in fileList)
116 | {
117 | VGMStream.convert(file, outDir);
118 | }
119 |
120 | Sys.println("");
121 | End.anyKeyExit(0, "Done");
122 | }
123 | }
--------------------------------------------------------------------------------
/haxe/src/VGMStream.hx:
--------------------------------------------------------------------------------
1 | package ;
2 |
3 | import format.wav.Data.WAVE;
4 | import format.wav.Reader;
5 | import haxe.io.Path;
6 | import sys.io.Process;
7 | import systools.win.Tools;
8 |
9 | /**
10 | * Class that interacts with vgmstream.
11 | */
12 | class VGMStream
13 | {
14 | /**
15 | * The relative path to the vgmstream .exe. Must be set before calling convert.
16 | */
17 | static public var exePath(default, default):String;
18 |
19 | /**
20 | * Converts a file. Can either convert it to an external file directly, or get the file data directly as a WAVE object (from the format library).
21 | * @param path Absolute path of the file to convert.
22 | * @param outDir The directory to save the converted file in. If this is null, it will return the file data as a WAVE.
23 | * @return The file data WAVE. If outDir != null (file is saved externally) then this returns null.
24 | */
25 | static public function convert(path:String, outDir:String = null):WAVE
26 | {
27 | if (exePath == null)
28 | {
29 | Sys.println("Must set path to vgmstream exe!");
30 | return null;
31 | }
32 |
33 | var inFile:String = "\"" + path + "\"";
34 |
35 | if (outDir == null) //Get file data as a WAVE
36 | {
37 | var process:Process = new Process(exePath, ["-p", "-i", inFile]);
38 |
39 | var inWav:WAVE = new Reader(process.stdout).read();
40 |
41 | process.close();
42 |
43 | return inWav;
44 | }
45 |
46 | //Otherwise let vgmstream save it
47 | var fileName:String = new Path(path).file;
48 | var outFile:String = "\"" + new Path(outDir).toString() + "\\" + fileName + ".wav\"";
49 |
50 | Sys.println("----------");
51 | var result:Int = Tools.createProcess(exePath, '-i -o $outFile $inFile', Sys.getCwd(), false, true);
52 |
53 | return null;
54 | }
55 | }
--------------------------------------------------------------------------------