[gmpi] Re: Prototype Plugin Code

  • From: "Ron Kuper" <RonKuper@xxxxxxxxxxxx>
  • To: <gmpi@xxxxxxxxxxxxx>
  • Date: Tue, 15 Feb 2005 10:48:21 -0500

>>>
   CreateInstance() function now simply returns a pointer to the plugin.

  It's still checked for errors, except by the factory.
<<<

I'd like CreateInstance to return an error code, like "out of memory",
or "too many instances already created" or "out of DSP resource" or
"trial period has expired" etc etc. 

-----Original Message-----
From: gmpi-bounce@xxxxxxxxxxxxx [mailto:gmpi-bounce@xxxxxxxxxxxxx] On
Behalf Of Jeff McClintock
Sent: Monday, February 14, 2005 10:06 PM
To: gmpi@xxxxxxxxxxxxx
Subject: [gmpi] Re: Prototype Plugin Code

After staring at that, I had to simplify it further ( a compulsion of 
mine ).
   CreateInstance() function now simply returns a pointer to the plugin.

  It's still checked for errors, except by the factory.

----------header-----------------
#include "plugin.h"

class Prototype_Plugin : public GMPI_Plugin
{
public:
        /* create function */
        static GMPI_Plugin * GMPI_STDCALL CreateInstance(void);

        /* test function */
        virtual GMPI_RESULT GMPI_STDCALL Placeholder1( int32_t);
};


----------------cpp--------------
#include "test_plugin.h"
#include "factory.h"

/* Plugin unique ID */
/* IID vs URI undecided. For now using GUID */

static const GMPI_GUID IID_GMPI_Prototype_DSP =
{ 0x5cc85cad, 0xdc0c, 0x42c2, { 0x80, 0xfd, 0xdc, 0x3a, 0xdb, 0xc7, 0x6,

0x41 } };

/* register plugin ID and creation function with factory */
namespace
{
        GMPI_RESULT r = Factory()->RegisterPlugin(
&IID_GMPI_Prototype_DSP, 
Prototype_Plugin::CreateInstance );
}

/* instantiate a new plugin. Return NULL for failure */
GMPI_Plugin *Prototype_Plugin::CreateInstance(void)
{
     return new Prototype_Plugin();
}

GMPI_RESULT Prototype_Plugin::Placeholder1( int32_t)
{
        return GMPI_SUCCESS;
}




----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your
own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe


----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: