Example #1
0
        public Form_Franker()
        {
            InitializeComponent();

            logicShit  = new LogicShit(recordingControls.RecMan);
            LastFolder = Path.GetDirectoryName(Application.ExecutablePath);

            txtArea.ReadOnly   = true;
            txtArea.BackColor  = Color.White;
            txtArea.AllowDrop  = true;
            txtArea.DragEnter += file_DragEnter;
            txtArea.DragDrop  += file_DragDrop;

            // recording controls
            recordingControls.setForm(this);
            recordingControls.RecStarted += () => {
            };
            recordingControls.RecStopped += () => {
                UpdateXmlString();
                //TODO: use a button?
                saveTheShit();
            };
            recordingControls.PopulateDevices();

            // misc window events
            this.FormClosing += (sender, e) => {
                recordingControls.RecMan.StopRecording();
                recordingControls.RecMan.DisposeOfLastRecording();
            };

            // keyboard input
            this.KeyPreview = true;
            this.KeyDown   += (sender, e) => { keyDowwwwwwwwn(e.KeyCode); };
            webBrowserControl.WebBrowserShortcutsEnabled = false;
            webBrowserControl.PreviewKeyDown            += (sender, e) => { keyDowwwwwwwwn(e.KeyCode); };

            // logic shit callbacks
            logicShit.CurSegmentUpdated += () => {
                segmentProgressView.CurSegment = logicShit.CurSegment;
                recordingControls.ForceFocusDiversion(); // done more so to repaint the bg gray if PrematureAdvancement was previously triggered
            };
            logicShit.CurParagraphUpdated  += () => { UpdateXmlString(); };
            logicShit.PrematureAdvancement += () => { this.BackColor = Color.DarkRed; };

            lblReverse.Text        = Settings.Default.FlipLanguages ? "Languages reversed!" : "";
            lblReverse.BorderStyle = BorderStyle.FixedSingle;

#if (DEBUG_FNAMES)
            //setMp3AndXml(@"C:\Users\mtemkine\Desktop\snd\privet.wav");
            setMp3AndXml(@"C:\Users\mtemkine\Music\abooks\librivox\pinocchio\avventurepinocchio_01_collodi.mp3");
            //webBrowserControl.Url = new Uri(@"file:///C:/Users/mtemkine/Documents/mikhailshit/books/Pars_vite_et_reviens_tard_-_VargasFred.pdf");
            //webBrowserControl.Url = new Uri(@"file:///C:/Users/mtemkine/Documents/mikhailshit/books/Уйди скорей и не спеши обратно (fb2)   Либрусек.htm");
#endif
        }
Example #2
0
        public Form_Franker() {
            InitializeComponent();

            logicShit = new LogicShit(recordingControls.RecMan);
            LastFolder = Path.GetDirectoryName(Application.ExecutablePath);

            txtArea.ReadOnly = true;
            txtArea.BackColor = Color.White;
            txtArea.AllowDrop = true;
            txtArea.DragEnter += file_DragEnter;
            txtArea.DragDrop += file_DragDrop;

            // recording controls
            recordingControls.setForm(this);
            recordingControls.RecStarted += () => {
            };
            recordingControls.RecStopped += () => {
                UpdateXmlString();
                //TODO: use a button?
                saveTheShit();
            };
            recordingControls.PopulateDevices();

            // misc window events
            this.FormClosing += (sender, e) => {
                recordingControls.RecMan.StopRecording();
                recordingControls.RecMan.DisposeOfLastRecording();
            };

            // keyboard input
            this.KeyPreview = true;
            this.KeyDown += (sender, e) => { keyDowwwwwwwwn(e.KeyCode); };
            webBrowserControl.WebBrowserShortcutsEnabled = false;
            webBrowserControl.PreviewKeyDown += (sender, e) => { keyDowwwwwwwwn(e.KeyCode); };

            // logic shit callbacks
            logicShit.CurSegmentUpdated += () => {
                segmentProgressView.CurSegment = logicShit.CurSegment;
                recordingControls.ForceFocusDiversion(); // done more so to repaint the bg gray if PrematureAdvancement was previously triggered
            };
            logicShit.CurParagraphUpdated += () => { UpdateXmlString(); };
            logicShit.PrematureAdvancement += () => { this.BackColor = Color.DarkRed; };

            lblReverse.Text = Settings.Default.FlipLanguages ? "Languages reversed!" : "";
            lblReverse.BorderStyle = BorderStyle.FixedSingle;

#if (DEBUG_FNAMES)
            //setMp3AndXml(@"C:\Users\mtemkine\Desktop\snd\privet.wav");
            setMp3AndXml(@"C:\Users\mtemkine\Music\abooks\librivox\pinocchio\avventurepinocchio_01_collodi.mp3");
            //webBrowserControl.Url = new Uri(@"file:///C:/Users/mtemkine/Documents/mikhailshit/books/Pars_vite_et_reviens_tard_-_VargasFred.pdf");
            //webBrowserControl.Url = new Uri(@"file:///C:/Users/mtemkine/Documents/mikhailshit/books/Уйди скорей и не спеши обратно (fb2)   Либрусек.htm");
#endif
        }