Пример #1
0
        private void basedOnTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OverlayMouthMovements moves             = new OverlayMouthMovements();
            WaveFormat            currentWaveFormat = recorder.GetWaveFormat();

            moves.SetWaveFormat(currentWaveFormat);
            moves.ShowDialog();
            if (moves.DialogResult == DialogResult.OK)
            {
                long position = recorder.getSelectionStart();
                if (position < 0)
                {
                    position = 0;
                }

                // shift all simulator views past that insert over by that amount
                int i;
                //find the start of the insert
                for (i = 0; (i < robotStates.Count) && (robotStates[i].position < position); i++)
                {
                    ;
                }
                // add new states for each viseme
                int           j;
                List <Viseme> visemes = moves.GetVisemes();
                for (j = 0; j < visemes.Count(); j++)
                {
                    RobotState ss = conductor.CreateStateFromViseme(visemes[j].viseme);
                    ss.position = position + visemes[j].position;
                    robotStates.Insert(i++, ss);
                }

                conductor.SetStates(ref robotStates);
            }
        }
Пример #2
0
        private void basedOnTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OverlayMouthMovements moves = new OverlayMouthMovements();
            WaveFormat currentWaveFormat = recorder.GetWaveFormat();
            moves.SetWaveFormat(currentWaveFormat);
            moves.ShowDialog();
            if (moves.DialogResult == DialogResult.OK)
            {
                long position = recorder.getSelectionStart();
                if (position < 0) position = 0;

                // shift all simulator views past that insert over by that amount
                int i;
                //find the start of the insert
                for (i = 0; (i < robotStates.Count) && (robotStates[i].position < position); i++) ;
                // add new states for each viseme
                int j;
                List<Viseme> visemes = moves.GetVisemes();
                for (j = 0; j < visemes.Count(); j++)
                {
                    RobotState ss = conductor.CreateStateFromViseme(visemes[j].viseme);
                    ss.position = position + visemes[j].position;
                    robotStates.Insert(i++, ss);
                }

                conductor.SetStates(ref robotStates);
            }
        }