コード例 #1
0
        public Form1()
        {
            InitializeComponent();
            listSongs_Main = songDAO.loadAllSongs();



            listSongs_Search = new List <SongDTO>();
            string fol_Dir = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));

            string[] tokens = fol_Dir.Split(new[] { "\\Music" }, StringSplitOptions.None);
            SONG_PATH                 = tokens[0] + "\\Music\\MusicFol\\";
            SONG_IMAGE_PATH           = tokens[0] + "\\Music\\SongImageFol\\";
            ALBUM_IMAGE_PATH          = tokens[0] + "\\Music\\AlbumImageFol\\";
            ARTIST_IMAGE_PATH         = tokens[0] + "\\Music\\ArtisImageFol\\";
            PLAYLIST_IMAGE_PATH       = tokens[0] + "\\Music\\PlaylistImageFol\\";
            LASTEST_OPEN_DETAILS_PATH = tokens[0] + "\\Music\\latestDetails.txt";
            GrammarControl grammarControl = new GrammarControl();

            recognitionEngine.SetInputToDefaultAudioDevice();
            loadGrammar(grammarControl.getSimpleGrammar());
            fisrt = false;
            defaultPlaybackDevice.Volume = 20;
            soundControl.Value           = 20;
            listSongs_Search             = listSongs_Main;
            loadSongLabel();
            setUpScrollBar();

            Mp3FileReader mp3Reader = new Mp3FileReader(SONG_PATH + listSongs_Main[songIndex].LinkOpen);

            player.Init(mp3Reader);
            player.Pause();
        }
コード例 #2
0
        private void btLyric_Click(object sender, EventArgs e)
        {
            keyControl       = 3;
            SidePanel.Height = btLyric.Height;
            SidePanel.Top    = btLyric.Top;
            panelDisplay.Controls.Clear();
            panelDisplay.Controls.Clear();
            Label labela = new Label();

            labela.Text      = "Results";
            labela.ForeColor = System.Drawing.Color.White;
            labela.Font      = new Font("Century Gothic", 25);
            labela.Width     = 300;
            labela.Height    = 60;
            labela.Left      = 40;
            labela.Top       = 10;
            panelDisplay.Controls.Add(labela);
            isRecordCommand = false;
            isRecordLyrics  = true;
            GrammarControl grammarControl = new GrammarControl();

            loadGrammar(grammarControl.searchLyricsGrammar());
            fisrt = false;
        }