[rhythmbox] transfer-target: add encoding settings
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] transfer-target: add encoding settings
- Date: Thu, 30 Jul 2015 11:40:26 +0000 (UTC)
commit 5a0819157d02ada4c94b33a90aeb70a89203ae52
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed Jul 29 22:53:12 2015 +1000
transfer-target: add encoding settings
This will just be passed through to the transfer batch.
plugins/generic-player/rb-generic-player-source.c | 12 ++++++++++--
plugins/ipod/rb-ipod-source.c | 13 +++++++++++--
plugins/mtpdevice/rb-mtp-source.c | 14 ++++++++++++--
sources/rb-transfer-target.c | 3 ++-
sources/rb-transfer-target.h | 2 +-
5 files changed, 36 insertions(+), 8 deletions(-)
---
diff --git a/plugins/generic-player/rb-generic-player-source.c
b/plugins/generic-player/rb-generic-player-source.c
index e6e3603..dc2d7e1 100644
--- a/plugins/generic-player/rb-generic-player-source.c
+++ b/plugins/generic-player/rb-generic-player-source.c
@@ -517,6 +517,7 @@ import_complete_cb (RhythmDBImportJob *job, int total, RBGenericPlayerSource *so
{
RBGenericPlayerSourceClass *klass = RB_GENERIC_PLAYER_SOURCE_GET_CLASS (source);
RBGenericPlayerSourcePrivate *priv = GET_PRIVATE (source);
+ GSettings *settings;
RBShell *shell;
if (priv->ejecting) {
@@ -531,7 +532,9 @@ import_complete_cb (RhythmDBImportJob *job, int total, RBGenericPlayerSource *so
g_object_set (source, "load-status", RB_SOURCE_LOAD_STATUS_LOADED, NULL);
- rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), NULL, FALSE);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, NULL, FALSE);
+ g_object_unref (settings);
}
g_object_unref (priv->import_job);
@@ -883,9 +886,14 @@ static RBTrackTransferBatch *
impl_paste (RBSource *source, GList *entries)
{
gboolean defer;
+ GSettings *settings;
+ RBTrackTransferBatch *batch;
defer = (ensure_loaded (RB_GENERIC_PLAYER_SOURCE (source)) == FALSE);
- return rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), entries, defer);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ batch = rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, entries, defer);
+ g_object_unref (settings);
+ return batch;
}
static gboolean
diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c
index a8a1a4a..e6be715 100644
--- a/plugins/ipod/rb-ipod-source.c
+++ b/plugins/ipod/rb-ipod-source.c
@@ -1236,6 +1236,7 @@ load_ipod_db_idle_cb (RBiPodSource *source)
{
RhythmDB *db;
GList *it;
+ GSettings *settings;
RBiPodSourcePrivate *priv = IPOD_SOURCE_GET_PRIVATE (source);
db = get_db_for_source (source);
@@ -1258,7 +1259,9 @@ load_ipod_db_idle_cb (RBiPodSource *source)
g_object_set (source, "load-status", RB_SOURCE_LOAD_STATUS_LOADED, NULL);
- rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), NULL, FALSE);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, NULL, FALSE);
+ g_object_unref (settings);
priv->load_idle_id = 0;
return FALSE;
@@ -1372,10 +1375,16 @@ impl_delete_entries (RBMediaPlayerSource *source, GList *entries, RBMediaPlayerS
static RBTrackTransferBatch *
impl_paste (RBSource *source, GList *entries)
{
+ RBTrackTransferBatch *batch;
+ GSettings *settings;
gboolean defer;
defer = (ensure_loaded (RB_IPOD_SOURCE (source)) == FALSE);
- return rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), entries, defer);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ batch = rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, entries, defer);
+ g_object_unref (settings);
+
+ return batch;
}
static void
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index 119b729..2e5b3bf 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -982,8 +982,12 @@ mtp_device_open_cb (LIBMTP_mtpdevice_t *device, RBMtpSource *source)
static gboolean
device_loaded_idle (RBMtpSource *source)
{
+ GSettings *settings;
+
g_object_set (source, "load-status", RB_SOURCE_LOAD_STATUS_LOADED, NULL);
- rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), NULL, FALSE);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, NULL, FALSE);
+ g_object_unref (settings);
return FALSE;
}
@@ -1078,8 +1082,14 @@ static RBTrackTransferBatch *
impl_paste (RBSource *source, GList *entries)
{
gboolean defer;
+ RBTrackTransferBatch *batch;
+ GSettings *settings;
+
defer = (ensure_loaded (RB_MTP_SOURCE (source)) == FALSE);
- return rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), entries, defer);
+ g_object_get (source, "encoding-settings", &settings, NULL);
+ batch = rb_transfer_target_transfer (RB_TRANSFER_TARGET (source), settings, entries, defer);
+ g_object_unref (settings);
+ return batch;
}
static RhythmDB *
diff --git a/sources/rb-transfer-target.c b/sources/rb-transfer-target.c
index 4f37837..17eeb99 100644
--- a/sources/rb-transfer-target.c
+++ b/sources/rb-transfer-target.c
@@ -375,6 +375,7 @@ track_done_cb (RBTrackTransferBatch *batch,
/**
* rb_transfer_target_transfer:
* @target: an #RBTransferTarget
+ * @settings: #GSettings instance holding encoding settings
* @entries: (element-type RB.RhythmDBEntry): a #GList of entries to transfer
* @defer: if %TRUE, don't start the transfer until
*
@@ -386,7 +387,7 @@ track_done_cb (RBTrackTransferBatch *batch,
* Return value: (transfer full): an #RBTrackTransferBatch, or NULL
*/
RBTrackTransferBatch *
-rb_transfer_target_transfer (RBTransferTarget *target, GList *entries, gboolean defer)
+rb_transfer_target_transfer (RBTransferTarget *target, GSettings *settings, GList *entries, gboolean defer)
{
RBTrackTransferQueue *xferq;
RBTaskList *tasklist;
diff --git a/sources/rb-transfer-target.h b/sources/rb-transfer-target.h
index 44ed100..15f2adc 100644
--- a/sources/rb-transfer-target.h
+++ b/sources/rb-transfer-target.h
@@ -86,7 +86,7 @@ gboolean rb_transfer_target_check_category (RBTransferTarget *target,
gboolean rb_transfer_target_check_duplicate (RBTransferTarget *target,
RhythmDBEntry *entry);
-RBTrackTransferBatch *rb_transfer_target_transfer (RBTransferTarget *target, GList *entries, gboolean
defer);
+RBTrackTransferBatch *rb_transfer_target_transfer (RBTransferTarget *target, GSettings *settings, GList
*entries, gboolean defer);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]