Exemple #1
0
        private void FInfoZaMec_Load(object sender, EventArgs e)
        {
            try
            {
                //TO DO : UCITATI I FORMATIRATI INFORMACIJE O OBA TIMA I O STADIONU I UPISATI U RTB..
                //prvo za domacina
                AuxLib.PrikaziDomacinaRTB(RTBDomacinInfo, domacin.Ime);
                AuxLib.PrikaziGostaRTB(RTBGostInfo, gost.Ime);
                AuxLib.PrikaziStadionRTB(RTBStadionInfo, stadion.Ime);



                //-------------------------

                //ucitavanje slika iz gridFS-a
                this.PBDomacinZastava.Image = AuxLib.LoadImageFromGridFS(domacin.Ime + "zastava");
                this.PBGostZastava.Image    = AuxLib.LoadImageFromGridFS(gost.Ime + "zastava");
                this.PBStadionZastava.Image = AuxLib.LoadImageFromGridFS(stadion.Ime + "stadion");
                //--------------------------

                //ucitamo himnu iz baze kao byte array
                byte[] domacinPesma = AuxLib.LoadSoundFromGridFS(domacin.Ime + "himna");
                //napravis stream
                MemoryStream domacinStream = new MemoryStream(domacinPesma);
                //prekines ako ima neka pesma prethodno ( za svaki slucaj );
                DisposeWave();
                //pcm pd strima
                NAudio.Wave.WaveStream pcm = NAudio.Wave.WaveFormatConversionStream.CreatePcmStream(new NAudio.Wave.Mp3FileReader(domacinStream));
                stream = new NAudio.Wave.BlockAlignReductionStream(pcm);

                //init,hendler za drugu himnu i play
                output = new NAudio.Wave.DirectSoundOut();
                output.Init(stream);
                output.PlaybackStopped += output_PlaybackStopped;
                output.Play();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }