Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 55181 | Differences between
and this patch

Collapse All | Expand All

(-)rhythmbox-0.8.3/corba/Rhythmbox.idl (-8 / +4 lines)
Lines 39-54 Link Here
39
39
40
		long getPlayingTime ();         /* returns -1 if not playing */
40
		long getPlayingTime ();         /* returns -1 if not playing */
41
		void setPlayingTime (in long seconds);
41
		void setPlayingTime (in long seconds);
42
43
		void setRating (in long rating);
42
	        
44
	        
43
		/* Available properties:
45
		/* Available properties:
44
		 * (repeat and shuffle should be pretty easy to make read-write
46
		 * repeat:     boolean, read-write, notification
45
		 *  instead of using the generic bonobo wrapper for gobject
47
		 * shuffle:    boolean, read-write, notification
46
		 *  properties in rb-shell.c, one needs to write custom
47
		 *  get/set functions for repeat/shuffle (as is currently
48
		 *  done for song
49
		 * 
50
		 * repeat:     boolean, read-only, notification
51
		 * shuffle:    boolean, read-only, notification
52
		 * play-order: string,  read-only, notification
48
		 * play-order: string,  read-only, notification
53
		 * playing:    boolean, read-only, notification
49
		 * playing:    boolean, read-only, notification
54
		 * song:       SongInfo, read-only, notification
50
		 * song:       SongInfo, read-only, notification
(-)rhythmbox-0.8.3/shell/rb-shell.c (-1 / +67 lines)
Lines 127-132 Link Here
127
static void rb_shell_corba_set_playing_time (PortableServer_Servant _servant,
127
static void rb_shell_corba_set_playing_time (PortableServer_Servant _servant,
128
						   CORBA_long time, CORBA_Environment *ev);
128
						   CORBA_long time, CORBA_Environment *ev);
129
129
130
static void rb_shell_corba_set_rating (PortableServer_Servant _servant,
131
					CORBA_long rating, CORBA_Environment *ev);
130
static Bonobo_PropertyBag rb_shell_corba_get_player_properties (PortableServer_Servant _servant, CORBA_Environment *ev);
132
static Bonobo_PropertyBag rb_shell_corba_get_player_properties (PortableServer_Servant _servant, CORBA_Environment *ev);
131
133
132
static gboolean rb_shell_window_state_cb (GtkWidget *widget,
134
static gboolean rb_shell_window_state_cb (GtkWidget *widget,
Lines 439-444 Link Here
439
	epv->next = rb_shell_corba_next;
441
	epv->next = rb_shell_corba_next;
440
	epv->getPlayingTime = rb_shell_corba_get_playing_time;
442
	epv->getPlayingTime = rb_shell_corba_get_playing_time;
441
	epv->setPlayingTime = rb_shell_corba_set_playing_time;
443
	epv->setPlayingTime = rb_shell_corba_set_playing_time;
444
	epv->setRating = rb_shell_corba_set_rating;
442
	epv->getPlayerProperties = rb_shell_corba_get_player_properties;
445
	epv->getPlayerProperties = rb_shell_corba_get_player_properties;
443
446
444
	g_object_class_install_property (object_class,
447
	g_object_class_install_property (object_class,
Lines 881-886 Link Here
881
	PROP_VISIBILITY,
884
	PROP_VISIBILITY,
882
	PROP_SONG,
885
	PROP_SONG,
883
	PROP_SHUFFLE,
886
	PROP_SHUFFLE,
887
	PROP_REPEAT,
884
};
888
};
885
889
886
890
Lines 964-969 Link Here
964
		break;
968
		break;
965
	}
969
	}
966
970
971
	case PROP_REPEAT:
972
	{
973
		gboolean shuffle, repeat;
974
		rb_shell_player_get_playback_state (player,
975
						    &shuffle, &repeat);
976
		BONOBO_ARG_SET_BOOLEAN (arg, repeat);
977
		break;
978
	}
979
967
	case PROP_SONG: {
980
	case PROP_SONG: {
968
		GNOME_Rhythmbox_SongInfo *ret_val;
981
		GNOME_Rhythmbox_SongInfo *ret_val;
969
		
982
		
Lines 1020-1025 Link Here
1020
		break;
1033
		break;
1021
	}
1034
	}
1022
1035
1036
	case PROP_REPEAT:
1037
	{
1038
		gboolean repeat;
1039
		gboolean shuffle;
1040
1041
1042
		rb_shell_player_get_playback_state (player, &shuffle,
1043
						    &repeat);
1044
		repeat = BONOBO_ARG_GET_BOOLEAN (arg);
1045
1046
		rb_shell_player_set_playback_state (player,
1047
						    shuffle,
1048
						    repeat);
1049
		break;
1050
	}
1051
1023
	default:
1052
	default:
1024
		bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
1053
		bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
1025
		break;
1054
		break;
Lines 1064-1070 Link Here
1064
		/* Manually install the other properties */
1093
		/* Manually install the other properties */
1065
		bonobo_property_bag_add (shell->priv->pb, "shuffle", 
1094
		bonobo_property_bag_add (shell->priv->pb, "shuffle", 
1066
					 PROP_SHUFFLE, BONOBO_ARG_BOOLEAN, NULL, 
1095
					 PROP_SHUFFLE, BONOBO_ARG_BOOLEAN, NULL, 
1067
					 _("Whether shuffle is enabled"), 0);
1096
					 _("Whether shuffle is enabled"), 
1097
					 (Bonobo_PROPERTY_READABLE | Bonobo_PROPERTY_WRITEABLE));
1098
1099
		bonobo_property_bag_add (shell->priv->pb, "repeat", 
1100
					 PROP_REPEAT, BONOBO_ARG_BOOLEAN, NULL, 
1101
					 _("Whether repeat is enabled"), 
1102
					 (Bonobo_PROPERTY_READABLE | Bonobo_PROPERTY_WRITEABLE));
1068
1103
1069
		bonobo_property_bag_add (shell->priv->pb, "song", 
1104
		bonobo_property_bag_add (shell->priv->pb, "song", 
1070
					 PROP_SONG, TC_GNOME_Rhythmbox_SongInfo, NULL, 
1105
					 PROP_SONG, TC_GNOME_Rhythmbox_SongInfo, NULL, 
Lines 1145-1150 Link Here
1145
1182
1146
1183
1147
static void
1184
static void
1185
rb_shell_corba_set_rating (PortableServer_Servant _servant,
1186
				 CORBA_long rating, CORBA_Environment *ev)
1187
{
1188
	RBShell *shell = RB_SHELL (bonobo_object (_servant));
1189
	RhythmDBEntry *entry;
1190
	RhythmDB *db = shell->priv->db;
1191
	RBEntryView *view;
1192
	RBSource *playing_source;
1193
	GValue value = {0, };
1194
1195
	rb_debug ("got set rating");
1196
1197
	g_value_init (&value, G_TYPE_DOUBLE);
1198
	g_value_set_double (&value, rating);
1199
1200
	playing_source = rb_shell_player_get_playing_source (shell->priv->player_shell);
1201
	if (playing_source != NULL) {
1202
	    view = rb_source_get_entry_view (playing_source);
1203
	    g_object_get (G_OBJECT (view), "playing_entry", &entry, NULL);
1204
	    if (entry != NULL) {
1205
			rhythmdb_write_lock (db);
1206
			rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_RATING, &value);
1207
			rhythmdb_write_unlock (db);
1208
	    }
1209
	}
1210
1211
	g_value_unset (&value);
1212
}
1213
1214
1215
static void
1148
rb_shell_property_changed_generic_cb (GObject *object,
1216
rb_shell_property_changed_generic_cb (GObject *object,
1149
				      GParamSpec *pspec, 
1217
				      GParamSpec *pspec, 
1150
				      RBShell *shell)
1218
				      RBShell *shell)

Return to bug 55181