Page 14 of 25 FirstFirst ... 456789101112131415161718192021222324 ... LastLast
Results 131 to 140 of 241

Thread: An Open Source, Fast and Modular, C# Front End

  1. #131
    Newbie
    Join Date
    Jun 2008
    Posts
    51

    Question

    The code in OpenMobile in the file Core.cs is puzzling me as I attempt to create a plugin

    Code:
            /// <summary>
    
            /// Load each of the plugins into the plugin's array (pluginCollection)
    
            /// </summary>
    
            private static void loadEmUp()
    
            {
    
                foreach (string file in Directory.GetFiles(Path.Combine(Application.StartupPath,"Plugins")))
    
                {
    
                    if (file.EndsWith(".dll") == true)
    
                    {
    
                        Assembly pluginAssembly = Assembly.LoadFrom(file);
    
                        foreach (Type pluginType in pluginAssembly.GetTypes())
    
                        {
    
                            if (pluginType.IsPublic) //Only look at public types
    
                            {
    
                                if (!pluginType.IsAbstract)  //Only look at non-abstract types
    
                                {
    
                                    //Gets a type object of the interface we need the plugins to match
    
                                    Type typeInterface = pluginType.GetInterface("OpenMobile.Plugin.IHighLevel", true);
    
    
    
                                    //Make sure the interface we want to use actually exists
    
                                    if (typeInterface != null)
    
                                    {
    
                                        IHighLevel availablePlugin = (IHighLevel)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
    
                                        pluginCollection.Add(availablePlugin);
    
                                        break;
    
                                    }
    does this mean we have to create a dll for any plugin we make? If so, how do I go about doing that? or what resources would I want to look at to do it.



    EDIT: There does need to be a dll of the file, but it is created, apparently when the plugin code is built. The reason I was having issues was that the output of my project I created for the plugin was not the same place the program was looking for dll's.

    I also ran into another issue. My project was set as using the .NET 2.0 Framework instead of 3.5. This was causing issues with adding the OMFramework to my list of references since it's 3.5 and there is some feature in MonoDevelop that prohibits 2.0 projects form referencing 3.0 and 3.5 projects.

  2. #132
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Well the code is still in the alpha phase so we haven't quite finalized the plugins yet. I'm working on the documentation to make it really easy to understand but for now I would recommend checking out the developers wiki:
    http://sourceforge.net/apps/mediawik...evelopers_Wiki

    particularly the sections on the Plugins and the Plugin Host.

    You could also take a look at the plugins directory on the subversion server for some examples. The Main Menu and ControlExample are high level plugins while OMPlayer is a great example of a low level plugin.

  3. #133
    Newbie thejavabuddha's Avatar
    Join Date
    Jul 2009
    Posts
    44
    Just bumping this so I can keep track.

    Bump

  4. #134
    Newbie
    Join Date
    Jun 2008
    Posts
    51
    So I'm trying to code a Keyboard plugin. My problem is that the only time the keyboard class should be run is when it's called by something else. For example "song title = getStringFromKeyboard()".

    getStringFromKeyboard is a method in "Keyboard" and should wait for the user to finish before it returns the string, a button click. How do I get the method to wait for that button event to be fired.

    Any thoughts?

  5. #135
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Well first i'll start by saying that an on screen keyboard is planned for the next release. That said what your trying to do isn't that hard.

    You need to make the getStringFromKeyboard function a blocking call. There are a few ways to do that but since in this case you are waiting for user input it might be best to just use a doEvents loop. Use an inputFinished bool and while (inputFinished==false) Environment.DoEvent(). Then the onClick of something like the enter or done button sets inputFinished to true allowing the function to return the string.

    Its pretty early so if I missed the question or that didn't make sense just let me know and i'll answer after i've had my cup of coffee.

  6. #136
    Maximum Bitrate ws6vert's Avatar
    Join Date
    Sep 2008
    Location
    Baton Rouge
    Posts
    523
    Just want to say great work with everything so far. There has been alot of headway made for this project and it is looking very good!

  7. #137
    Newbie
    Join Date
    Jun 2008
    Posts
    51
    Quote Originally Posted by justchat_1 View Post
    Well first i'll start by saying that an on screen keyboard is planned for the next release. That said what your trying to do isn't that hard.

    You need to make the getStringFromKeyboard function a blocking call. There are a few ways to do that but since in this case you are waiting for user input it might be best to just use a doEvents loop. Use an inputFinished bool and while (inputFinished==false) Environment.DoEvent(). Then the onClick of something like the enter or done button sets inputFinished to true allowing the function to return the string.

    Its pretty early so if I missed the question or that didn't make sense just let me know and i'll answer after i've had my cup of coffee.
    I thought about doing something like that, but it seemed like bad programming practice, though maybe since it's both of ours first thought it might be a good one. I'm trying out using a "waitOne" and "set". I forget the object name you use to call them, but it's in System.Thread(ing?). You call waitOne and the thread waits until the object gets triggered. I triggered it when the event I want to happen happens. It seems it was intended to be used when one thread wants to use some resource that another also wants to use, or along those lines. I think it might be usable in this instance.

    I'm interested in how the keyboard is going to be implemented in the next release, it'll give em a better insight in how the plugins work within the framework. Thanks for the help!

  8. #138
    Variable Bitrate UnusuallyGenius's Avatar
    Join Date
    Mar 2009
    Location
    Grand Rapids, Mi
    Posts
    306
    Justchat_1, how are we doing. havent heard anything in awhile
    - Project: Unified Car Control
    - Original OpenMobile Interface Designer

  9. #139
    Raw Wave
    Auto Apps:loading...
    justchat_1's Avatar
    Join Date
    Jul 2008
    Location
    Boston, Ma or NY,NY
    Posts
    2,359
    Quote Originally Posted by UnusuallyGenius View Post
    Justchat_1, how are we doing. havent heard anything in awhile
    Been on vacation in Europe - should be getting back mid next week and will continue work. Sorry for the slow updates - schedules been crazy and wifis been tough to steal.

    Did you ever send those images we discussed? - email hasn't been liking the whole hacked internet situation so they may just be waiting when I get back.

  10. #140
    Variable Bitrate UnusuallyGenius's Avatar
    Join Date
    Mar 2009
    Location
    Grand Rapids, Mi
    Posts
    306
    Quote Originally Posted by justchat_1 View Post
    Been on vacation in Europe - should be getting back mid next week and will continue work. Sorry for the slow updates - schedules been crazy and wifis been tough to steal.

    Did you ever send those images we discussed? - email hasn't been liking the whole hacked internet situation so they may just be waiting when I get back.
    i have been busy as of late, thats why i asked, forgot where we left off.
    i will get on them, and they will be waiting
    enjoy the rest of your vacation
    - Project: Unified Car Control
    - Original OpenMobile Interface Designer

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •