Back to index

unity  6.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions
unity::dash::NoPreview Class Reference

#include <Preview.h>

Inheritance diagram for unity::dash::NoPreview:
Inheritance graph
[legend]
Collaboration diagram for unity::dash::NoPreview:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::shared_ptr< PreviewPtr
typedef std::map< std::string,
unity::glib::Variant
Properties

Public Member Functions

 NoPreview ()

Static Public Member Functions

static Preview::Ptr PreviewForProperties (std::string const &renderer_name, Properties &properties)

Public Attributes

std::string renderer_name

Protected Member Functions

unsigned int PropertyToUnsignedInt (Properties &properties, const char *key)
std::string PropertyToString (Properties &properties, const char *key)
std::vector< std::string > PropertyToStringVector (Properties &properties, const char *key)
float PropertyToFloat (Properties &properties, const char *key)

Detailed Description

Definition at line 57 of file Preview.h.


Member Typedef Documentation

typedef std::map<std::string, unity::glib::Variant> unity::dash::Preview::Properties [inherited]

Definition at line 42 of file Preview.h.

typedef std::shared_ptr<Preview> unity::dash::Preview::Ptr [inherited]

Constructor & Destructor Documentation

Definition at line 98 of file Preview.cpp.

{
  renderer_name = "preview-none";
}

Member Function Documentation

Preview::Ptr unity::dash::Preview::PreviewForProperties ( std::string const &  renderer_name,
Properties properties 
) [static, inherited]

Definition at line 31 of file Preview.cpp.

{
  if (renderer_name_ == "preview-application")
  {
    return Preview::Ptr(new ApplicationPreview(properties));
  }
  else if (renderer_name_ == "preview-generic")
  {
    return Preview::Ptr(new GenericPreview(properties));
  }
  else if (renderer_name_ == "preview-track")
  {
    return Preview::Ptr(new TrackPreview(properties));
  }
  else if (renderer_name_ == "preview-album")
  {
    return Preview::Ptr(new AlbumPreview(properties));
  }
  else
  {
    return Preview::Ptr(new NoPreview());
  }
}

Here is the caller graph for this function:

float unity::dash::Preview::PropertyToFloat ( Properties properties,
const char *  key 
) [protected, inherited]

Definition at line 90 of file Preview.cpp.

{
  if (properties.find(key) == properties.end())
    return 0.0f;

  return (float)g_variant_get_double(properties[key]);
}
std::string unity::dash::Preview::PropertyToString ( Properties properties,
const char *  key 
) [protected, inherited]

Definition at line 64 of file Preview.cpp.

{
  if (properties.find(key) == properties.end())
   return "";
  return g_variant_get_string(properties[key], NULL);
}
std::vector< std::string > unity::dash::Preview::PropertyToStringVector ( Properties properties,
const char *  key 
) [protected, inherited]

Definition at line 71 of file Preview.cpp.

{
  GVariantIter* iter = NULL;
  char* value = NULL;
  std::vector<std::string> property;

  if (properties.find(key) == properties.end())
    return property;

  g_variant_get(properties[key], "as", &iter);

  while (g_variant_iter_loop(iter, "s", &value))
    property.push_back(value);

  g_variant_iter_free(iter);

  return property;
}
unsigned int unity::dash::Preview::PropertyToUnsignedInt ( Properties properties,
const char *  key 
) [protected, inherited]

Definition at line 59 of file Preview.cpp.

{
  return g_variant_get_uint32(properties[key]);
}

Member Data Documentation

std::string unity::dash::Preview::renderer_name [inherited]

Definition at line 48 of file Preview.h.


The documentation for this class was generated from the following files: