/* This file is part of AHD Subtitles Maker Professional
   A program can create and edit subtitles

   Copyright © Ala I Hadid 2009 - 2012

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AHD.SM
{
    public partial class sc_PlayBack : ASMSettingsControl
    {
        public sc_PlayBack()
        {
            InitializeComponent();
            checkBox_MediaSeekOnSelect.Checked = Program.Settings.MediaSeekOnSelect;
            numericUpDown_AdvanceTime.Value = (int)(Program.Settings.AdvanceTime * 1000);
            numericUpDown_NewSubtitleDuration.Value = Program.Settings.NewSubtitleDuration;
            numericUpDown_ShiftTime.Value = Program.Settings.ShiftTime;
            numericUpDown_playerTimer.Value = Program.Settings.PlayerTimer;
        }
        public override void SaveSettings()
        {
            Program.Settings.MediaSeekOnSelect = checkBox_MediaSeekOnSelect.Checked;
            Program.Settings.AdvanceTime = ((double)numericUpDown_AdvanceTime.Value / 1000);
            Program.Settings.NewSubtitleDuration = (int)numericUpDown_NewSubtitleDuration.Value;
            Program.Settings.ShiftTime = (int)numericUpDown_ShiftTime.Value;
            Program.Settings.PlayerTimer = (int)numericUpDown_playerTimer.Value;
            base.SaveSettings();
        }
        public override string ToString()
        {
            return Program.ResourceManager.GetString("Title_PlayBack");
        }
        public override void DefaultSettings()
        {
            checkBox_MediaSeekOnSelect.Checked = true;
            numericUpDown_AdvanceTime.Value = 500;
            numericUpDown_NewSubtitleDuration.Value = 2;
            numericUpDown_ShiftTime.Value = 100;
            numericUpDown_playerTimer.Value = 10;
        }
    }
}
