Exemplo n.º 1
0
        public SetlistDetails(Form xParent, Color ButtonBackColor, Color ButtonTextColor)
        {
            var setlist = xParent;

            InitializeComponent();

            Tools  = new NemoTools();
            Parser = new DTAParser();
            Stats  = new List <ListViewItem>();

            Left       = setlist.Left + ((setlist.Width - Width) / 2);
            Top        = setlist.Top + ((setlist.Height - Height) / 2);
            ControlBox = false;

            var formButtons = new List <Button> {
                btnExport, btnClose
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }
        }
Exemplo n.º 2
0
        public FileIndexer(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();
            Tools         = new NemoTools();
            Parser        = new DTAParser();
            Songs         = new List <SongIndex>();
            FilteredSongs = new List <SongIndex>();
            config        = Application.StartupPath + "\\bin\\config\\indexer.config";
            LoadConfig();
            var indexFolder = Application.StartupPath + "\\bin\\indexer\\";

            if (!Directory.Exists(indexFolder))
            {
                Directory.CreateDirectory(indexFolder);
            }
            Index = indexFolder + "index.c3";
            var formButtons = new List <Button> {
                btnBuild, btnClear, btnDelete, btnNew, btnClearSearch
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }
        }
Exemplo n.º 3
0
 public QuickDTAEditor(string input_con = "")
 {
     InitializeComponent();
     Tools  = new NemoTools();
     Parser = new DTAParser();
     toolTip1.SetToolTip(lstLog, "This is the application log. Right click to export");
     InitLog();
     con = input_con;
 }
Exemplo n.º 4
0
        public bool ExtractDecryptMogg(string CON_file, bool bypass, NemoTools tools, DTAParser parser)
        {
            Initialize();
            Tools  = tools;
            Parser = parser;
            Tools.ReleaseStreamHandle();
            if (!Parser.ExtractDTA(CON_file))
            {
                ErrorLog.Add("Couldn't extract songs.dta file from that CON file");
                return(false);
            }
            if (!Parser.ReadDTA(Parser.DTA) || !Parser.Songs.Any())
            {
                ErrorLog.Add("Couldn't read that songs.dta file");
                return(false);
            }
            if (Parser.Songs.Count > 1)
            {
                ErrorLog.Add("This feature does not support packs, only single songs\nUse the dePACK feature in C3 CON Tools' Quick Pack Editor to split this pack into single songs and try again");
                return(false);
            }
            var internal_name = Parser.Songs[0].InternalName;
            var xCON          = new STFSPackage(CON_file);

            if (!xCON.ParseSuccess)
            {
                ErrorLog.Add("Couldn't parse that CON file");
                xCON.CloseIO();
                return(false);
            }
            var xMogg = xCON.GetFile("songs/" + internal_name + "/" + internal_name + ".mogg");

            if (xMogg == null)
            {
                ErrorLog.Add("Couldn't find the mogg file inside that CON file");
                xCON.CloseIO();
                return(false);
            }
            var mData = xMogg.Extract();

            xCON.CloseIO();
            if (mData == null || mData.Length == 0)
            {
                ErrorLog.Add("Couldn't extract the mogg file from that CON file");
                return(false);
            }
            LoadLibraries();
            if (Tools.DecM(mData, bypass, false, DecryptMode.ToMemory))
            {
                return(true);
            }
            ErrorLog.Add("Mogg file is encrypted and I could not decrypt it, can't split it");
            return(false);
        }
Exemplo n.º 5
0
        public BatchProcess(MainForm form, List <string> files, bool reverse = false)
        {
            InitializeComponent();
            mMainForm = form;
            Tools     = new NemoTools();
            Parser    = new DTAParser();

            FilesToConvert = files;
            ProblemFiles   = new List <string>();
            SkippedFiles   = new List <string>();
            DoReverseBatch = reverse;
        }
Exemplo n.º 6
0
        public BatchExtractor(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();
            Tools               = new NemoTools();
            Parser              = new DTAParser();
            inputFiles          = new List <string>();
            mMenuBackground     = menuStrip1.BackColor;
            menuStrip1.Renderer = new DarkRenderer();
            var formButtons = new List <Button> {
                btnRefresh, btnFolder, btnBegin, btnSelect, btnDeselect, btnConverter
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }

            //load last used directory if saved and still exists
            Log("Welcome to Batch Extractor");
            Log("Drag and drop the CON /LIVE file(s) here");
            Log("Or click 'Change Input Folder' to select the files");

            config = Application.StartupPath + "\\bin\\config\\extractor.config";
            if (!File.Exists(config))
            {
                return;
            }
            var sr   = new StreamReader(config);
            var line = sr.ReadLine();

            sr.Dispose();
            if (string.IsNullOrWhiteSpace(line))
            {
                Tools.DeleteFile(config);
            }
            else if (line != "" && Directory.Exists(line))
            {
                Log("");
                Log("Loaded last directory used: " + line);
                txtFolder.Text = line;
            }
            else
            {
                Tools.DeleteFile(config);
            }
            if (string.IsNullOrWhiteSpace(txtFolder.Text))
            {
                Log("Ready to begin");
            }
        }
Exemplo n.º 7
0
 public AudioAnalyzer(string file)
 {
     InitializeComponent();
     InputFile           = file;
     InputFiles          = new List <string>();
     ChannelPanels       = new List <Panel>();
     ChannelLabels       = new List <Label>();
     Tools               = new NemoTools();
     Parser              = new DTAParser();
     PanelSize           = panelBackground.Size;
     mMenuBackground     = menuStrip1.BackColor;
     menuStrip1.Renderer = new DarkRenderer();
 }
Exemplo n.º 8
0
        public VideoPreparer(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();

            inputFiles = new List <string>();
            Tools      = new NemoTools();
            Parser     = new DTAParser();
            inputDir   = Application.StartupPath + "\\videoprep_input\\";

            groupBox1.AllowDrop = true;

            tempFolder = Application.StartupPath + "\\videoprep_temp\\";
            Tools.DeleteFolder(tempFolder, true);

            toolTip1.SetToolTip(btnBegin, "Click to begin process");
            toolTip1.SetToolTip(btnFolder, "Click to select the input folder");
            toolTip1.SetToolTip(btnRefresh, "Click to refresh if the contents of the folder have changed");
            toolTip1.SetToolTip(txtFolder, "This is the working directory");
            toolTip1.SetToolTip(txtTitle, "Enter a title for your pack (visible in the Xbox dashboard)");
            toolTip1.SetToolTip(lstLog, "This is the application log. Right click to export");

            nextFriday = DateTime.Today;
            while (nextFriday.DayOfWeek != DayOfWeek.Friday)
            {
                nextFriday = nextFriday.AddDays(1D);
            }

            var month = "0" + nextFriday.Month;

            month = month.Substring(month.Length - 2, 2);
            var day = "0" + nextFriday.Day;

            day      = day.Substring(day.Length - 2, 2);
            PackDate = month + "/" + day + "/" + nextFriday.Year.ToString(CultureInfo.InvariantCulture).Substring(2, 2);

            var formButtons = new List <Button> {
                btnFolder, btnRefresh, btnReset, btnView, btnBegin
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }

            if (!Directory.Exists(tempFolder))
            {
                Directory.CreateDirectory(tempFolder);
            }
        }
Exemplo n.º 9
0
        public RBAConverter(Color ButtonBackColor, Color ButtonTextColor, string inputfolder = "")
        {
            InitializeComponent();
            Tools          = new NemoTools();
            Parser         = new DTAParser();
            FilesToConvert = new List <string>();
            var formButtons = new List <Button> {
                btnRefresh, btnFolder, btnBegin
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }
            config        = Application.StartupPath + "\\bin\\config\\rbaconverter.config";
            StartupFolder = inputfolder;
        }
Exemplo n.º 10
0
        public PhaseShiftConverter(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();

            //initialize
            Song   = new PhaseShiftSong();
            Tools  = new NemoTools();
            Parser = new DTAParser();

            inputFiles = new List <string>();
            inputDir   = Application.StartupPath + "\\phaseshift\\";
            if (!Directory.Exists(inputDir))
            {
                Directory.CreateDirectory(inputDir);
            }

            var formButtons = new List <Button> {
                btnReset, btnRefresh, btnFolder, btnBegin
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }

            rar = Application.StartupPath + "\\bin\\rar.exe";
            if (!File.Exists(rar))
            {
                MessageBox.Show("Can't find rar.exe ... I won't be able to create RAR files for your songs without it",
                                "Missing Executable", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                chkRAR.Checked = false;
                chkRAR.Enabled = false;
            }

            toolTip1.SetToolTip(btnBegin, "Click to begin process");
            toolTip1.SetToolTip(btnFolder, "Click to select the input folder");
            toolTip1.SetToolTip(btnRefresh, "Click to refresh if the contents of the folder have changed");
            toolTip1.SetToolTip(txtFolder, "This is the working directory");
            toolTip1.SetToolTip(lstLog, "This is the application log. Right click to export");
        }
Exemplo n.º 11
0
        public CONExplorer(Color ButtonBackColor, Color ButtonTextColor, bool runningshortcut = false)
        {
            CheckForIllegalCrossThreadCalls = true;
            InitializeComponent();
            mMenuBackground            = contextMenuStrip1.BackColor;
            contextMenuStrip1.Renderer = new DarkRenderer();

            picContent.AllowDrop = true;
            picPackage.AllowDrop = true;
            btnDTA.AllowDrop     = true;
            btnMIDI.AllowDrop    = true;
            btnMOGG.AllowDrop    = true;
            btnPNG.AllowDrop     = true;

            Tools             = new NemoTools();
            Parser            = new DTAParser();
            isRunningShortcut = runningshortcut;

            var formButtons = new List <Button> {
                btnExtract, btnSave, btnVisualize
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }

            toolTip1.SetToolTip(picContent, "Click here to select the Content Image (visible in here)");
            toolTip1.SetToolTip(picPackage, "Click here to select the Package Image (visible in the Xbox dashboard)");
            toolTip1.SetToolTip(radioCON, "Click to save as CON when rebuilding");
            toolTip1.SetToolTip(radioLIVE, "Click to save as LIVE when rebuilding");
            toolTip1.SetToolTip(btnExtract, "Click to extract the whole CON file");
            toolTip1.SetToolTip(btnSave, "Click to sign and rebuild CON file");
            toolTip1.SetToolTip(txtTitle, "Package Title (optional)");
            toolTip1.SetToolTip(txtDescription, "Package Description (optional)");
            toolTip1.SetToolTip(btnVisualize, "Click to open in Visualizer");
        }
Exemplo n.º 12
0
        public ProUpgradeBundler(Color ButtonBackColor, Color ButtonTextColor)
        {
            InitializeComponent();

            Tools              = new NemoTools();
            Parser             = new DTAParser();
            SongInstruments    = new List <string>();
            UpgradeInstruments = new List <string>();
            UpgradeMidis       = new List <string>();
            upgradeID          = NA;
            songID             = NA;
            song_int_name      = NA;
            upgrade_int_name   = NA;

            var formButtons = new List <Button> {
                btnReset, btnBundle
            };

            foreach (var button in formButtons)
            {
                button.BackColor = ButtonBackColor;
                button.ForeColor = ButtonTextColor;
                button.FlatAppearance.MouseOverBackColor = button.BackColor == Color.Transparent ? Color.FromArgb(127, Color.AliceBlue.R, Color.AliceBlue.G, Color.AliceBlue.B) : Tools.LightenColor(button.BackColor);
            }

            var bundlerFolder = Application.StartupPath + "\\bundler\\";

            if (!Directory.Exists(bundlerFolder))
            {
                Directory.CreateDirectory(bundlerFolder);
            }
            temp_folder = bundlerFolder + "temp\\";
            if (!Directory.Exists(temp_folder))
            {
                Directory.CreateDirectory(temp_folder);
            }
        }
Exemplo n.º 13
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            var client = new FtpClient();
            //only for testing development of code with local ftp server
            //client.Credentials = new NetworkCredential();
            //client.Credentials.UserName = "******";

            var sb = new StringBuilder();

            if (!ConnectToFTP(client, true))
            {
                return;
            }

            //check if user wants to cancel at this point
            if (backgroundWorker1.CancellationPending || CancelProcess)
            {
                client.Disconnect();
                return;
            }

            var filepath = bigDTA;

            foreach (var folder in FoldersToSearch)
            {
                if (!client.IsConnected)
                {
                    Log("Disconnected from server, trying to reconnect");
                    if (!ConnectToFTP(client))
                    {
                        Log("Failed to reconnect, stopping");
                        return;
                    }
                }
                //check if user wants to cancel at this point
                if (backgroundWorker1.CancellationPending || CancelProcess)
                {
                    client.Disconnect();
                    return;
                }

                Log("Scanning folder " + folder + " for DTA files");
                IEnumerable <string> dtafiles;
                try
                {
                    dtafiles = getSongListings(client, "/dev_hdd0/game/" + folder + "/");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("There was an error trying to retrieve the songs.dta files from folder '" + folder + "'\n\nThe error says:\n\"" + ex.Message + "\"", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Log("Scanning error: " + ex.Message);
                    continue;
                }

                if (!dtafiles.Any())
                {
                    //check if user wants to cancel at this point
                    if (backgroundWorker1.CancellationPending || CancelProcess)
                    {
                        client.Disconnect();
                        return;
                    }
                    Log("No DTA files found in that folder ... skipping");
                    continue;
                }

                if (client.IsConnected)
                {
                    Log("Found " + dtafiles.Count() + " DTA " + (dtafiles.Count() == 1 ? "file" : "files") + " in that folder");
                    Log("Starting to read DTA files");
                    DTAFound += dtafiles.Count();
                }
                else
                {
                    dtafiles = new List <string>();
                }

                foreach (var file in dtafiles)
                {
                    //check if user wants to cancel at this point
                    if (backgroundWorker1.CancellationPending || CancelProcess)
                    {
                        client.Disconnect();
                        return;
                    }

                    var name   = file.Replace("/dev_hdd0/game/" + folder + "/USRDIR/", "");
                    var failed = false;
                    if (chkDetailed.Checked)
                    {
                        Log("Trying to read DTA file " + name);
                    }
                    Stream ftpStream = null;
                    for (var attempts = 0; attempts < numTries.Value; attempts++)
                    {
                        try
                        {
                            ftpStream = client.OpenRead(file);
                            failed    = false;
                            break;
                        }
                        catch
                        {
                            failed = true;

                            if (!client.IsConnected)
                            {
                                Log("Disconnected from server, trying to reconnect");
                                if (!ConnectToFTP(client))
                                {
                                    Log("Failed to reconnect, stopping");
                                    return;
                                }
                            }
                        }
                        Thread.Sleep((int)numWait.Value);
                    }

                    if (failed || ftpStream == null)
                    {
                        if (chkDetailed.Checked)
                        {
                            Log("Failed to read DTA file " + name);
                        }
                        continue;
                    }

                    if (chkDetailed.Checked)
                    {
                        Log("Read DTA file " + name + " successfully");
                    }
                    DTARead++;
                    using (var reader = new StreamReader(ftpStream, Encoding.UTF8))
                    {
                        var songinfo = reader.ReadToEnd();
                        sb.Append(songinfo);
                        sb.AppendLine();

                        if (!chkListing.Checked)
                        {
                            continue;
                        }
                        var tempDTA = Application.StartupPath + "\\bin\\temp.dta";
                        try
                        {
                            if (chkDetailed.Checked)
                            {
                                Log("Processing that DTA file and adding songs to DTA listing CSV");
                            }
                            var sw = new StreamWriter(tempDTA, false);
                            sw.Write(songinfo);
                            sw.Dispose();

                            var Parser = new DTAParser();
                            if (Parser.ReadDTA(File.ReadAllBytes(tempDTA)) && Parser.Songs.Any())
                            {
                                //by request of grubextrapolate to create a database of song/DTA location
                                sw = new StreamWriter(DTAList, true);
                                {
                                    foreach (var song in Parser.Songs)
                                    {
                                        sw.WriteLine("\"" + song.ShortName + "\",\"" + file + "\",\"" + song.SongId + "\",\"" + song.Artist.Replace("\"", "\"\"") + "\",\"" + song.Name.Replace("\"", "\"\"") + "\"");
                                    }
                                }
                                sw.Dispose();
                                if (chkDetailed.Checked)
                                {
                                    Log("Added " + Parser.Songs.Count + (Parser.Songs.Count == 1 ? " song" : " songs") +
                                        " to the DTA listing CSV");
                                }
                            }
                            Tools.DeleteFile(tempDTA);
                        }
                        catch (Exception)
                        {
                            if (chkDetailed.Checked)
                            {
                                Log("There was an error processing that DTA file ... skipping");
                            }
                            Tools.DeleteFile(tempDTA);
                        }
                    }
                }
            }

            //check if user wants to cancel at this point
            if (backgroundWorker1.CancellationPending || CancelProcess)
            {
                client.Disconnect();
                return;
            }

            if (DTARead > 0)
            {
                if (chkDetailed.Checked)
                {
                    Log("Writing all DTA files to " + Application.StartupPath + "\\bin\\" + Path.GetFileName(bigDTA));
                }
                try
                {
                    using (var outfile = new StreamWriter(filepath, false, Encoding.UTF8))
                    {
                        outfile.Write(sb.ToString());
                    }
                    if (chkDetailed.Checked)
                    {
                        Log("Wrote DTA file successfully");
                    }
                }
                catch (Exception ex)
                {
                    Log("Error: " + ex.Message);
                }
            }
            else
            {
                if (chkDetailed.Checked)
                {
                    Log("No DTA files were read ... nothing to write");
                }
            }
            client.Disconnect();
            Log("Done!");
            Log("Found " + DTAFound + " DTA " + (DTAFound == 1 ? "file" : "files"));
            Log("Successfully read " + DTARead + " DTA " + (DTARead == 1 ? "file" : "files"));
        }