[Faisabilité] Télécommande Vocale (1 Viewer)

P

pitie

Guest
Concernant le fait que ce soit les bruit liés au fait qu'il y aurait un film nan c pas possible.

j'avais utilisé ce plug il y a 2 ou 3 ans est deja ca marchais !
(ca a du bien evolué depuis)
 
G

guilhem

Guest
Originally posted by pitie@3 Apr 2006, 03:44
C'est un exe en arriere plan ?
car si c'est ca peut etre que F9 signifie qqch pour lui...

essai en mettant F8
<

<div align="right"><{POST_SNAPBACK}>
[/quote]

Je n'ai pas implémente d'action sur F9 mais peut être que pour les process plugin cela veut dire quelque chose, je ne sais pas.

<div class='quotetop'>CITATION</div>
Concernant le fait que ce soit les bruit liés au fait qu'il y aurait un film nan c pas possible.

j'avais utilisé ce plug il y a 2 ou 3 ans est deja ca marchais !
(ca a du bien evolué depuis)[/b]

Je ne suis pas sur que cela est forcément évolué
<
 
G

guilhem

Guest
Bon je viens de passer la soirée à chercher mais je ne trouve pas d'où peux venir ce bug.

Du coup je vous mets code, donc si quelqu'un a déjà fait un process plugin et voit la grosse boulette merci de me le dire

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using MediaPortal.GUI.Library;
using ACTIVELISTENPROJECTLib;

namespace TelecommandeVocale
{
    public class Main : ISetupForm, IPlugin
    {

        // ******************************************
        // ***   D2claration
        // ******************************************
        private const String CRLF = "\r\n";
        private DirectSRClass _vcrVoice = new DirectSRClass();
        private String _speechGrammer = "[Grammar]" + CRLF +
                                         "langid = 1033" + CRLF +
                                         "type=cfg" + CRLF +
                                         "[<Start>]" + CRLF +
                                         "<start>=tv down" + CRLF +
                                         "<start>=tv up" + CRLF +
                                         "<start>=tv left" + CRLF +
                                         "<start>=tv enter" + CRLF +
                                         "<start>=tv right" + CRLF +
                                         "<start>=tv back" + CRLF
                                           ;

        //
        // Constructeur
        public Main()
        {
        }


        // ******************************************
        // ***   Partie du formulaire du SETUP
        // ******************************************
        #region ISetupForm Members

        // Returns the name of the plugin which is shown in the plugin menu
        public string PluginName()
        {
            return "Telecommande Vocale";
        }

        // Returns the description of the plugin is shown in the plugin menu
        public string Description()
        {
            return "Télécommander MP à la voix";
        }

        // Returns the author of the plugin which is shown in the plugin menu
        public string Author()
        {
            return "Guilhem";
        }

        // show the setup dialog
        public void ShowPlugin()
        {
            MessageBox.Show("Non encore implementé");            
        }

        // Indicates whether plugin can be enabled/disabled
        public bool CanEnable()
        {
            return true;
        }

        // get ID of windowplugin belonging to this setup
        public int GetWindowId()
        {
            return 6780;
        }

        // Indicates if plugin is enabled by default;
        public bool DefaultEnabled()
        {
            return true;
        }



        // indicates if a plugin has its own setup screen
        public bool HasSetup()
        {
            return true;
        }

        /// <summary>
        /// If the plugin should have its own button on the main menu of Media Portal then it
        /// should return true to this method, otherwise if it should not be on home
        /// it should return false
        /// </summary>
        /// <param name="strButtonText">text the button should have</param>
        /// <param name="strButtonImage">image for the button, or empty for default</param>
        /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
        /// <param name="strPictureImage">subpicture for the button or empty for none</param>
        /// <returns>true  : plugin needs its own button on home
        ///          false : plugin does not need its own button on home</returns>
        public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
        {
            strButtonText = PluginName();
            strButtonImage = String.Empty;
            strButtonImageFocus = String.Empty;
            strPictureImage = String.Empty;
            return true;
        }
        #endregion


        // ******************************************
        // ***   Plugin process
        // ******************************************
        #region IPlugin Members

        public void Start()
        {
            
            _vcrVoice.GrammarFromString(_speechGrammer);
            _vcrVoice.Activate();

            _vcrVoice.PhraseFinish += new _DirectSREvents_PhraseFinishEventHandler(vcrVoice_PhraseFinish);
       
        }

        public void Stop()
        {
            _vcrVoice.Deactivate();
        }
        #endregion 

        // ******************************************
        // ***   TELECOMMANDE 
        // ******************************************
        


        /// <summary>
        /// Gestion de l'action
        /// </summary>
        /// <param name="flags"></param>
        /// <param name="beginhi"></param>
        /// <param name="beginlo"></param>
        /// <param name="endhi"></param>
        /// <param name="endlo"></param>
        /// <param name="Phrase"></param>
        /// <param name="parsed"></param>
        /// <param name="results"></param>
        public void vcrVoice_PhraseFinish(int flags, int beginhi, int beginlo, int endhi, int endlo, String Phrase, String parsed, int results)
        {
            
            switch (Phrase)
            {
                
                case "tv down":
                    SendKeys.Send("{DOWN}");
                    break;
                case "tv up":
                    SendKeys.Send("{UP}");
                    break;
                case "tv left":
                    SendKeys.Send("{LEFT}");
                    break;
                case "tv right":
                    SendKeys.Send("{RIGHT}");
                    break;
                case "tv enter":
                    SendKeys.Send("{ENTER}");
                    break;
                case "tv back":
                    SendKeys.Send("{ESC}");
                    break;
            }
           
        }
    }
}
Donc désolé de se long post mais si vous avez une idée cela m'arrangerait.
 
K

kimaidou

Guest
Hello !

Et bien je vois que les choses évoluent ! Merci guilhem d'avoir pris le temps de le faire.

Ce petit up est là pour que je me tienne au courant
<


A plus

Kimaidou, le bricolo Excel
<
 

Users who are viewing this thread

Top Bottom