Exemplo n.º 1
0
 public frmTerminal(MediaFileList afilelist, string anexecutable)
     : this()
 {
     this.executable = anexecutable;
     if (afilelist != null) {
         mediafilelist = afilelist;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mediafilesTestRunToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MediaFileList newlist = new MediaFileList();

            foreach (ListViewItem n in listViewFiles.SelectedItems) {
                string filename = Path.Combine(n.SubItems[Functions.SUBCOL_PATH].Text, n.SubItems[Functions.SUBCOL_FILENAME].Text);
                Preset preset = presetdata.FindPreset(n.SubItems[Functions.SUBCOL_PRESETNAME].Text);

                if (preset != null) {
                    newlist.AddMediaFile(filename, preset, n.Index);
                }
            }

            frmTerminal nterm = new frmTerminal(newlist,
                Config.Settings.FFMPEGFilePath);
            nterm.Show();
            nterm.StartProcessing();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fold these in generic...
        /// Note: Complete presets are stored in the MediaFileList, in case these need to be
        /// restored on a third party-computer. "Take your Queue to where-ever you want"
        /// </summary>
        /// <param name="afilename"></param>
        /// <param name="filelist"></param>
        /// <returns></returns>
        public static bool SerializeMediaFileList(string afilename, MediaFileList filelist)
        {
            bool res = false;

            XmlSerializer nser = new XmlSerializer(typeof(MediaFileList));
            TextWriter ntext = new StreamWriter(afilename);
            try {
                nser.Serialize(ntext, filelist);
                ntext.Flush();
                res = true;
            } catch {
                res = false;
            } finally {
                ntext.Dispose();
            }

            return res;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Loads a pre-existing mediafile/queue into the mediafile object.
        /// </summary>
        /// <param name="afilename"></param>
        public void LoadMediaFileList(string afilename)
        {
            if (File.Exists(afilename)) {
                try {

                    this.mediafilelist = Functions.DeserializeMediaFileList(afilename);

                    // Add new presets, where necessary...
                    if (mediafilelist != null) {
                        foreach (MediaFile f in mediafilelist.Items) {
                            Preset internalpreset = f.Preset;

                            if (this.presetdata.FindPresetIndex(internalpreset) == -1) {
                                this.presetdata.AddPreset(internalpreset);
                            }
                        }
                    }
                } catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
            }
        }