[PATCH 02/15] core: Add constructors to GrlMediaSourceFooSpec



Add grl_media_source_foo_spec_new() functions.
---
 src/grl-media-source.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/grl-media-source.h |   12 ++++++++
 2 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index 5d1369f..6f1663c 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -1181,6 +1181,72 @@ metadata_full_resolution_ctl_cb (GrlMediaSource *source,
 
 /* ================ API ================ */
 
+GrlMediaSourceBrowseSpec *
+grl_media_source_browse_spec_new ()
+{
+  GrlMediaSourceBrowseSpec *bs;
+
+  bs = g_new0 (GrlMediaSourceBrowseSpec, 1);
+  bs->ref_count = 1;
+
+  return bs;
+}
+
+GrlMediaSourceSearchSpec *
+grl_media_source_search_spec_new ()
+{
+  GrlMediaSourceSearchSpec *ss;
+
+  ss = g_new0 (GrlMediaSourceSearchSpec, 1);
+  ss->ref_count = 1;
+
+  return ss;
+}
+
+GrlMediaSourceQuerySpec *
+grl_media_source_query_spec_new ()
+{
+  GrlMediaSourceQuerySpec *qs;
+
+  qs = g_new0 (GrlMediaSourceQuerySpec, 1);
+  qs->ref_count = 1;
+
+  return qs;
+}
+
+GrlMediaSourceMetadataSpec *
+grl_media_source_metadata_spec_new ()
+{
+  GrlMediaSourceMetadataSpec *ms;
+
+  ms = g_new0 (GrlMediaSourceMetadataSpec, 1);
+  ms->ref_count = 1;
+
+  return ms;
+}
+
+GrlMediaSourceStoreSpec *
+grl_media_source_store_spec_new ()
+{
+  GrlMediaSourceStoreSpec *ss;
+
+  ss = g_new0 (GrlMediaSourceStoreSpec, 1);
+  ss->ref_count = 1;
+
+  return ss;
+}
+
+GrlMediaSourceRemoveSpec *
+grl_media_source_remove_spec_new ()
+{
+  GrlMediaSourceRemoveSpec *rs;
+
+  rs = g_new0 (GrlMediaSourceRemoveSpec, 1);
+  rs->ref_count = 1;
+
+  return rs;
+}
+
 /**
  * grl_media_source_browse:
  * @source: a media source
diff --git a/src/grl-media-source.h b/src/grl-media-source.h
index 6bbfe2d..45f6ba5 100644
--- a/src/grl-media-source.h
+++ b/src/grl-media-source.h
@@ -340,6 +340,18 @@ G_BEGIN_DECLS
 
 GType grl_media_source_get_type (void);
 
+GrlMediaSourceBrowseSpec *grl_media_source_browse_spec_new (void);
+
+GrlMediaSourceSearchSpec *grl_media_source_search_spec_new (void);
+
+GrlMediaSourceQuerySpec *grl_media_source_query_spec_new (void);
+
+GrlMediaSourceMetadataSpec *grl_media_source_metadata_spec_new (void);
+
+GrlMediaSourceStoreSpec *grl_media_source_store_spec_new (void);
+
+GrlMediaSourceRemoveSpec *grl_media_source_remove_spec_new (void);
+
 guint grl_media_source_browse (GrlMediaSource *source,
                                GrlMedia *container,
                                const GList *keys,
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]