Revision: 4457
          http://pd-gem.svn.sourceforge.net/pd-gem/?rev=4457&view=rev
Author:   zmoelnig
Date:     2011-08-15 12:30:07 +0000 (Mon, 15 Aug 2011)

Log Message:
-----------
adjust to new simplified API

Modified Paths:
--------------
    trunk/Gem/src/plugins/filmBase.cpp
    trunk/Gem/src/plugins/filmBase.h

Modified: trunk/Gem/src/plugins/filmBase.cpp
===================================================================
--- trunk/Gem/src/plugins/filmBase.cpp  2011-08-15 12:29:36 UTC (rev 4456)
+++ trunk/Gem/src/plugins/filmBase.cpp  2011-08-15 12:30:07 UTC (rev 4457)
@@ -17,6 +17,8 @@
 #include "filmBase.h"
 #include <stdlib.h>
 
+#include "Gem/Properties.h"
+
 /////////////////////////////////////////////////////////
 //
 // film
@@ -83,14 +85,6 @@
 void filmBase :: close(void)
 {}
 
-/////////////////////////////////////////////////////////
-// do we have a film loaded ?
-//
-/////////////////////////////////////////////////////////
-bool filmBase :: haveFilm()
-{
-  return false;
-}
 #if 0
 /////////////////////////////////////////////////////////
 // render
@@ -105,7 +99,57 @@
   return &m_image;
 }
 #endif
+
+
 ///////////////////////////////
+// Properties
+bool filmBase::enumProperties(gem::Properties&readable,
+                             gem::Properties&writeable) {
+  readable.clear();
+  writeable.clear();
+  return false;
+}
+
+void filmBase::setProperties(gem::Properties&props) {
+  double d;
+  if(props.get("auto", d)) {
+    m_auto=d;
+  }
+  if(props.get("colorspace", d)) {
+    m_wantedFormat=(GLenum)d;
+  }
+}
+
+void filmBase::getProperties(gem::Properties&props) {
+  std::vector<std::string> keys=props.keys();
+  gem::any value;
+  double d;
+
+  unsigned int i=0;
+  for(i=0; i<keys.size(); i++) {
+    std::string key=keys[i];
+    props.erase(key);
+    if("fps"==key) {
+      d=m_fps;
+      value=d; props.set(key, value);
+    }
+    if("frames"==key) {
+      d=m_numFrames;
+      value=d; props.set(key, value);
+    }
+    if("width"==key) {
+      d=m_image.image.xsize;
+      value=d; props.set(key, value);
+    }
+    if("height"==key) {
+      d=m_image.image.ysize;
+      value=d; props.set(key, value);
+    }
+  }
+}
+
+
+///////////////////////////////
 // get the frames-per-second
 double filmBase :: getFPS() {
   // we don't know, so we return "-1"

Modified: trunk/Gem/src/plugins/filmBase.h
===================================================================
--- trunk/Gem/src/plugins/filmBase.h    2011-08-15 12:29:36 UTC (rev 4456)
+++ trunk/Gem/src/plugins/filmBase.h    2011-08-15 12:30:07 UTC (rev 4457)
@@ -66,26 +66,46 @@
 
   void close(void);
 
+  
+  /**
+   * list all properties the currently opened film supports
+   * if no film is opened, this returns generic backend properties 
+   * which can be different from media specific properties
+   * after calling, "readable" will hold a list of all properties that can be 
read
+   * and "writeable" will hold a list of all properties that can be set
+   * if the enumeration fails, this returns <code>false</code>
+   */
+
+  virtual bool enumProperties(gem::Properties&readable,
+                             gem::Properties&writeable);
+
+  /**
+   * properties implemented in here:
+   * - "auto"
+   * - "colorspace"
+   */
+  virtual void setProperties(gem::Properties&props);
+
+  /**
+   * properties implemented in here:
+   * - "width"
+   * - "height"
+   * - "frames"
+   * - "fps"
+   */
+  virtual void getProperties(gem::Properties&props);
+
+
+
+
   //////////
   // set the wanted color-space
   /* could be used for switching the colourspace on the fly 
    * normally the colour-space of a film could be set when opening a movie
    */
   virtual void requestColor(GLenum format){m_wantedFormat=format;}
-  //////////
-  // get the actual color-space
-  /* what colour-space is in use ?
-   * returns 0 for none
-   */    
-  virtual int getColor(void) {return 0;}
 
   //////////
-  // do we have a film loaded ?
-  /* returns TRUE if it is possible to read frames without any more open()
-   */
-  virtual bool haveFilm(void);
-
-  //////////
   // get the number of frames
   /* the number of frames can depend on the track
    * so this will return the framenum of the current track


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
pd-gem-CVS mailing list
pd-gem-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pd-gem-cvs

Reply via email to