media-explorer/media-explorer — Issue #192: Playing Album next track
Author: michaelwood
Created: 2011-11-25 18:27:56+00:00
State: open

When playing an album the next track should start playing automatically, something like:

```diff
diff --git a/mex/mex-media-controls.c b/mex/mex-media-controls.c
index 51f874c..a100581 100644
--- a/mex/mex-media-controls.c
+++ b/mex/mex-media-controls.c
@@ -1076,12 +1076,17 @@ mex_media_controls_set_content (MexMediaControls *self,
if (context)
{
MexModel *orig_model;
+ MexContentMetadata sort_group_key;

orig_model = mex_model_get_model (context);
g_object_set (G_OBJECT (priv->proxy_model), "model", orig_model, NULL);

mex_view_model_set_start_content (priv->proxy_model, priv->content);
mex_view_model_set_loop (priv->proxy_model, TRUE);
+ sort_group_key = mex_view_model_get_group_by (priv->proxy_model);
+
+ if (sort_group_key == MEX_CONTENT_METADATA_ALBUM)
+ priv->is_queue_model;

/* Work out if the context was a queue FIXME unreliable */
/* From coloumn context = MexViewModel MexAggregateModel MexQueueModel */
diff --git a/mex/mex-view-model.c b/mex/mex-view-model.c
index 958057c..96ae07f 100644
--- a/mex/mex-view-model.c
+++ b/mex/mex-view-model.c
@@ -931,6 +931,14 @@ mex_view_model_set_group_by (MexViewModel *model,
mex_view_model_refresh_external_items (model);
}

+MexContentMetadata
+mex_view_model_get_group_by (MexViewModel *model)
+{
+ MexViewModelPrivate *priv = MEX_VIEW_MODEL (model)->priv;
+
+ return priv->group_by_key;
+}
+
void
mex_view_model_set_order_by (MexViewModel *model,
MexContentMetadata metadata_key,
diff --git a/mex/mex-view-model.h b/mex/mex-view-model.h
index f222ce7..e19154e 100644
michael@dorado:~/dev/mex/source/media-explorer/mex$ git diff
diff --git a/mex/mex-media-controls.c b/mex/mex-media-controls.c
index 51f874c..a100581 100644
--- a/mex/mex-media-controls.c
+++ b/mex/mex-media-controls.c
@@ -1076,12 +1076,17 @@ mex_media_controls_set_content (MexMediaControls *self,
if (context)
{
MexModel *orig_model;
+ MexContentMetadata sort_group_key;

orig_model = mex_model_get_model (context);
g_object_set (G_OBJECT (priv->proxy_model), "model", orig_model, NULL);

mex_view_model_set_start_content (priv->proxy_model, priv->content);
mex_view_model_set_loop (priv->proxy_model, TRUE);
+ sort_group_key = mex_view_model_get_group_by (priv->proxy_model);
+
+ if (sort_group_key == MEX_CONTENT_METADATA_ALBUM)
+ priv->is_queue_model;

/* Work out if the context was a queue FIXME unreliable */
/* From coloumn context = MexViewModel MexAggregateModel MexQueueModel */
diff --git a/mex/mex-view-model.c b/mex/mex-view-model.c
index 958057c..96ae07f 100644
--- a/mex/mex-view-model.c
+++ b/mex/mex-view-model.c
@@ -931,6 +931,14 @@ mex_view_model_set_group_by (MexViewModel *model,
mex_view_model_refresh_external_items (model);
}

+MexContentMetadata
+mex_view_model_get_group_by (MexViewModel *model)
+{
+ MexViewModelPrivate *priv = MEX_VIEW_MODEL (model)->priv;
+
+ return priv->group_by_key;
+}
+
void
mex_view_model_set_order_by (MexViewModel *model,
MexContentMetadata metadata_key,
diff --git a/mex/mex-view-model.h b/mex/mex-view-model.h
index f222ce7..e19154e 100644
--- a/mex/mex-view-model.h
+++ b/mex/mex-view-model.h
@@ -82,6 +82,7 @@ void mex_view_model_set_order_by (MexViewModel *model,
MexContentMetadata metadata_key,
gboolean descending);

+MexContentMetadata mex_view_model_get_group_by (MexViewModel *model);

G_END_DECLS
```

Might work, can't work on it due to #187