public TransMapper(Model.Quran quran, Model.TranslatedQuran trans, SuraMeta suraMeta) { InitializeComponent(); this.quran = quran; this.trans = trans; this.suraMeta = suraMeta; this.suraName.Text = suraMeta.NameArabic; LoadAyas(); }
private void LoadSlices(SuraMeta suraMeta) { Model.Sura sura = null; using (var file = File.OpenRead(QuranConfig.Current.FilePath)) { using (CryptoStream cs = new CryptoStream(file, Crypto.AES.CreateDecryptor(), CryptoStreamMode.Read)) { sura = Serializer.Deserialize <Quran.Model.Quran>(cs).Suras[suraMeta.SuraNo - 1]; } } int index = 0; //if (suraMeta.SuraNo != 9 && suraMeta.SuraNo != 1) //{ // slices.Insert(index, new TempAudioSlice() { SliceID = suraMeta.SuraNo * 1000000 , Slice = "بِسۡمِ ٱللَّهِ ٱلرَّحۡمَٰنِ ٱلرَّحِيمِ", SliceIndex = index, Position = new TimeSpan(0) }); // ++index; //} foreach (var aya in sura.Ayas) { foreach (Slice slice in aya.Slices) { string text = slice.Text; TempAudioSlice tempAudioSlice = new TempAudioSlice(); tempAudioSlice.SliceID = slice.SliceID; tempAudioSlice.Slice = text; tempAudioSlice.SliceIndex = index; tempAudioSlice.Position = new TimeSpan(0); tempAudioSlice.HasMultiSlices = (aya.Slices.Length > 1); slices.Add(tempAudioSlice); ++index; } } listBox.ItemsSource = Slices; listBox.SelectedIndex = 0; }
private static void LoadSuras(XDocument xml, Meta meta) { List <SuraMeta> tempList = new List <SuraMeta>(); foreach (XElement node in xml.Root.Elements("suras").DescendantNodes()) { SuraMeta sura = new SuraMeta(); sura.SuraNo = Int32.Parse(node.Attribute("index").Value); sura.TotalAyas = Int32.Parse(node.Attribute("ayas").Value); sura.NameArabic = node.Attribute("name").Value; sura.NameEnglish = node.Attribute("ename").Value; sura.IsMeccan = (node.Attribute("type").Value == "Meccan"); sura.Order = Int32.Parse(node.Attribute("order").Value); sura.FullNameArabic = string.Format("{0} {1}", Utility.GetSuraNo(sura.SuraNo), sura.NameArabic); tempList.Add(sura); } meta.Suras = tempList.ToArray(); }
public AudioMapper(SuraMeta suraMeta, Qari qari) { InitializeComponent(); this.suraMeta = suraMeta; this.qari = qari; suraTextBlock.Text = suraMeta.SuraNo + " " + suraMeta.NameArabic; qariTextBlock.Text = qari.Name; DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(100); timer.Tick += timer_Tick; timer.Start(); LoadSlices(suraMeta); LoadAudioQuran(); }
public SliceMaker(SuraMeta suraMeta) { InitializeComponent(); this.suraMeta = suraMeta; this.suraName.Text = suraMeta.NameArabic; LoadQuran(); List <AyaViewModel> list = new List <AyaViewModel>(); foreach (var aya in CurrentSura.Ayas) { list.Add(new AyaViewModel() { AyaNo = aya.AyaNo, Text = aya.AyaNo.ToString().PadLeft(3, '0') + " " + aya.ToString() }); } lbAyas.ItemsSource = list; lbAyas.SelectedIndex = 0; }