Exemple #1
0
 public static QuranAyah GetLastAyahToPlay(QuranAyah startAyah, AudioDownloadAmount mode)
 {
     switch (mode)
     {
         case AudioDownloadAmount.Page:
             return GetLastAyahToPlayForPage(startAyah);
         case AudioDownloadAmount.Surah:
             return GetLastAyahToPlayForSura(startAyah);
         case AudioDownloadAmount.Juz:
             return GetLastAyahToPlayForJuz(startAyah);
         default:
             return GetLastAyahToPlayForPage(startAyah);
     }
 }
Exemple #2
0
        public AudioRequest(int reciterId, QuranAyah verse, AudioDownloadAmount audioDownloadAmount)
        {
            if (verse == null)
                throw new ArgumentNullException("verse");

            if (verse == null || verse.Surah < 1 || verse.Surah > 114)
                throw new ArgumentException("verse");

            this.Reciter = AudioUtils.GetReciterById(reciterId);
            this.AudioDownloadAmount = audioDownloadAmount;
            this.FromAyah = verse;
            this.CurrentAyah = verse;
            this.ToAyah = AudioUtils.GetLastAyahToPlay(verse, audioDownloadAmount);
            this.RepeatInfo = new RepeatInfo();
        }
Exemple #3
0
        public static QuranAyah GetLastAyahToPlay(QuranAyah startAyah, AudioDownloadAmount mode)
        {
            switch (mode)
            {
            case AudioDownloadAmount.Page:
                return(GetLastAyahToPlayForPage(startAyah));

            case AudioDownloadAmount.Surah:
                return(GetLastAyahToPlayForSura(startAyah));

            case AudioDownloadAmount.Juz:
                return(GetLastAyahToPlayForJuz(startAyah));

            default:
                return(GetLastAyahToPlayForPage(startAyah));
            }
        }
        public AudioRequest(int reciterId, QuranAyah verse, RepeatInfo repeat, int currentRepeatIteration, AudioDownloadAmount audioDownloadAmount)
        {
            if (verse == null)
                throw new ArgumentNullException("verse");

            if (verse == null || verse.Surah < 1 || verse.Surah > 114)
                throw new ArgumentException("verse");

            this.Reciter = AudioUtils.GetReciterById(reciterId);
            this.AudioDownloadAmount = audioDownloadAmount;
            this.FromAyah = verse;
            this.CurrentAyah = verse;
            this.ToAyah = AudioUtils.GetLastAyahToPlay(verse, audioDownloadAmount);

            if (repeat != null)
            {
                this.RepeatInfo = repeat;
            }
            else
            {
                this.RepeatInfo = new RepeatInfo();
            }

            this.repeatManager = new RepeatManager(this.RepeatInfo, verse, currentRepeatIteration);
        }