Ejemplo n.º 1
0
/**
 * rb_source_reset_filters:
 * @source: a #RBSource
 *
 * Clears all filters (browser selections, etc.) in this source.
 */
void
rb_source_reset_filters (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	klass->impl_reset_filters (source);
}
Ejemplo n.º 2
0
/**
 * rb_source_paste:
 * @source: a #RBSource
 * @entries: a list of #RhythmDBEntry objects to paste in
 *
 * Adds a list of entries previously cut or copied from another
 * source.
 */
void
rb_source_paste (RBSource *source, GList *entries)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	klass->impl_paste (source, entries);
}
Ejemplo n.º 3
0
/**
 * rb_source_try_playlist:
 * @source: a #RBSource
 *
 * Determines whether playback URIs for entries in the source should
 * be parsed as playlists rather than just played.
 *
 * Return value: TRUE to attempt playlist parsing
 */
gboolean
rb_source_try_playlist (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_try_playlist (source);
}
Ejemplo n.º 4
0
/**
 * rb_source_show_popup:
 * @source: a #RBSource
 *
 * Called when the user performs an action (such as right-clicking)
 * that should result in a popup menu being displayed for the source.
 *
 * Return value: TRUE if the source managed to display a popup
 */
gboolean
rb_source_show_popup (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_show_popup (source);
}
Ejemplo n.º 5
0
/**
 * rb_source_add_to_queue:
 * @source: a #RBSource
 * @queue: the #RBSource for the play queue
 *
 * Adds the currently selected entries to the end of the
 * play queue.
 */
void
rb_source_add_to_queue (RBSource *source,
			RBSource *queue)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	klass->impl_add_to_queue (source, queue);
}
Ejemplo n.º 6
0
/**
 * rb_source_paste:
 * @source: a #RBSource
 * @entries: (element-type RB.RhythmDBEntry): a list of #RhythmDBEntry objects to paste in
 *
 * Adds a list of entries previously cut or copied from another
 * source.  If the entries are not of the type used by the source,
 * the entries will be copied and possibly converted into an acceptable format.
 * This can be used for transfers to and from devices and network shares.
 *
 * If the transfer is performed using an #RBTrackTransferBatch, the batch object
 * is returned so the caller can monitor the transfer progress.  The caller does not
 * own a reference on the batch object.
 *
 * Return value: (transfer none): the #RBTrackTransferBatch used to perform the transfer (if any)
 */
RBTrackTransferBatch *
rb_source_paste (RBSource *source, GList *entries)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_paste (source, entries);
}
Ejemplo n.º 7
0
/**
 * rb_source_move_to_trash:
 * @source: a #RBSource
 *
 * Trashes the files backing the currently selected set of entries.
 * In general, this should use #rhythmdb_entry_move_to_trash to
 * perform the actual trash operation.
 */
void
rb_source_move_to_trash (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	klass->impl_move_to_trash (source);
}
Ejemplo n.º 8
0
/**
 * rb_source_delete:
 * @source: a #RBSource
 *
 * Deletes the currently selected entries from the source.
 */
void
rb_source_delete (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	klass->impl_delete (source);
}
Ejemplo n.º 9
0
/**
 * rb_source_get_browser_key:
 * @source: a #RBSource
 *
 * Return value: the GConf key that determines browser visibility
 * for this source (allocated)
 */
char *
rb_source_get_browser_key (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_get_browser_key (source);
}
Ejemplo n.º 10
0
/**
 * rb_source_get_entry_view:
 * @source: a #RBSource
 *
 * Returns the entry view widget for the source.
 *
 * Return value: (transfer none): the #RBEntryView instance for the source
 */
RBEntryView *
rb_source_get_entry_view (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_get_entry_view (source);
}
Ejemplo n.º 11
0
/**
 * rb_source_get_property_views:
 * @source: a #RBSource
 *
 * Returns a list containing the #RBPropertyView instances for the
 * source, if any.
 *
 * Return value: (element-type RB.PropertyView) (transfer container): list of property views
 */
GList *
rb_source_get_property_views (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_get_property_views (source);
}
Ejemplo n.º 12
0
/**
 * rb_source_get_search_actions:
 * @source: a #RBSource
 *
 * Returns a list of UI action names. Buttons for these
 * actions will be added to the search bar.  The source
 * must identify the selected search action when constructing
 * a database query for searching
 *
 * Return value: list of search actions
 */
GList *
rb_source_get_search_actions (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_get_search_actions (source);
}
Ejemplo n.º 13
0
/**
 * rb_source_copy:
 * @source: a #RBSource
 *
 * Copies the selected entries to the clipboard.
 *
 * Return value: (element-type RB.RhythmDBEntry) (transfer full): a list containing
 * the currently selected entries from the source.
 */
GList *
rb_source_copy (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_copy (source);
}
Ejemplo n.º 14
0
/**
 * rb_source_handle_eos:
 * @source: a #RBSource
 *
 * Determines how EOS events should be handled when playing entries
 * from the source.
 *
 * Return value: EOS event handling type
 */
RBSourceEOFType
rb_source_handle_eos (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_handle_eos (source);
}
Ejemplo n.º 15
0
/**
 * rb_source_can_paste:
 * @source: a #RBSource
 *
 * Determines whether the source supports paste operations.
 *
 * Return value: TRUE if the pasting is supported
 */
gboolean
rb_source_can_paste (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	return klass->impl_can_paste (source);
}
Ejemplo n.º 16
0
/**
 * rb_source_add_uri:
 * @source: a #RBSource
 * @uri: a URI to add
 * @title: theoretically, the title of the entity the URI points to
 * @genre: theoretically, the genre of the entity the URI points to
 *
 * Adds an entry corresponding to the URI to the source.  The
 * @title and @genre parameters are not really used.
 *
 * Return value: TRUE if the URI was successfully added to the source
 */
gboolean
rb_source_add_uri (RBSource *source, const char *uri, const char *title, const char *genre)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	if (klass->impl_add_uri)
		return klass->impl_add_uri (source, uri, title, genre);
	return FALSE;
}
Ejemplo n.º 17
0
/**
 * rb_source_want_uri:
 * @source: a #RBSource
 * @uri: a URI for the source to consider
 *
 * Returns an indication of how much the source wants to handle
 * the specified URI.  100 is the highest usual value, and should
 * only be used when the URI can only be associated with this source.
 * 0 should be used when the URI does not match the source at all.
 *
 * Return value: value from 0 to 100 indicating how much the
 *  source wants this URI.
 */
guint
rb_source_want_uri (RBSource *source, const char *uri)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	if (klass->impl_want_uri)
		return klass->impl_want_uri (source, uri);
	return 0;
}
Ejemplo n.º 18
0
/**
 * rb_source_song_properties:
 * @source: a #RBSource
 *
 * Displays a properties window for the currently selected entries.
 */
void
rb_source_song_properties (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	g_assert (klass->impl_song_properties);
	klass->impl_song_properties (source);
}
Ejemplo n.º 19
0
/**
 * rb_source_uri_is_source:
 * @source: a #RBSource
 * @uri: a URI for the source to consider
 *
 * Checks if the URI matches the source itself.  A source
 * should return TRUE here if the URI points to the device that
 * the source represents, for example.
 *
 * Return value: TRUE if the URI identifies the source itself.
 */
gboolean
rb_source_uri_is_source (RBSource *source, const char *uri)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	if (klass->impl_uri_is_source)
		return klass->impl_uri_is_source (source, uri);
	return FALSE;
}
Ejemplo n.º 20
0
/**
 * rb_source_browser_toggled:
 * @source: a #RBSource
 * @enabled: TRUE if the browser should be visible
 *
 * Called when the visibility of the browser changes.
 */
void
rb_source_browser_toggled (RBSource *source,
			   gboolean enabled)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	if (klass->impl_browser_toggled != NULL)
		klass->impl_browser_toggled (source, enabled);
}
Ejemplo n.º 21
0
/**
 * rb_source_delete_thyself:
 * @source: a #RBSource
 *
 * This is called when the source should delete itself.
 * The 'deleted' signal will be emitted, which removes the source
 * from the source list.  This will not actually dispose of the
 * source object, so reference counting must still be handled
 * correctly.
 */
void
rb_source_delete_thyself (RBSource *source)
{
	RBSourceClass *klass;

	g_return_if_fail (source != NULL);
	klass = RB_SOURCE_GET_CLASS (source);
	klass->impl_delete_thyself (source);
	g_signal_emit (G_OBJECT (source), rb_source_signals[DELETED], 0);
}
Ejemplo n.º 22
0
/**
 * rb_source_get_status:
 * @source: a #RBSource
 * @text: holds the returned status text (allocated)
 * @progress_text: holds the returned text for the progress bar (allocated)
 * @progress: holds the progress value
 *
 * Retrieves the details to display in the status bar for the source.
 * If the progress value returned is less than zero, the progress bar
 * will pulse.  If the progress value is greater than or equal to 1,
 * the progress bar will be hidden.
 **/
void
rb_source_get_status (RBSource *source,
		      char **text,
		      char **progress_text,
		      float *progress)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	klass->impl_get_status (source, text, progress_text, progress);
}
Ejemplo n.º 23
0
/**
 * rb_source_can_move_to_trash:
 * @source: a #RBSource
 *
 * Determines whether the source allows the user to trash
 * the files backing a selected set of entries.
 *
 * Return value: TRUE if trashing is supported
 */
gboolean
rb_source_can_move_to_trash (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	if (is_party_mode (source)) {
		return FALSE;
	} else {
		return klass->impl_can_move_to_trash (source);
	}
}
Ejemplo n.º 24
0
/**
 * rb_source_receive_drag:
 * @source: a #RBSource
 * @data: the selection data
 *
 * This is called when the user drags something to the source.
 * Depending on the drag data type, the data might be a list of
 * #RhythmDBEntry objects, a list of URIs, or a list of album
 * or artist or genre names.
 *
 * Return value: TRUE if the source accepted the drag data
 */
gboolean
rb_source_receive_drag (RBSource *source,
			GtkSelectionData *data)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	if (klass->impl_receive_drag)
		return klass->impl_receive_drag (source, data);
	else
		return FALSE;
}
Ejemplo n.º 25
0
/**
 * rb_source_can_rename:
 * @source: a #RBSource.
 *
 * Return value: TRUE if this source can be renamed
 */
gboolean
rb_source_can_rename (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	RBSourcePrivate *priv = RB_SOURCE_GET_PRIVATE (source);

	if (rb_shell_get_party_mode (priv->shell)) {
		return FALSE;
	}

	return klass->impl_can_rename (source);
}
Ejemplo n.º 26
0
/**
 * rb_source_search:
 * @source: a #RBSource
 * @text: new search text
 *
 * Updates the source with new search text.  The source
 * should recreate the database query that feeds into the
 * browser (if any).
 */
void
rb_source_search (RBSource *source,
		  RBSourceSearch *search,
		  const char *cur_text,
		  const char *new_text)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	/* several sources don't have a search ability */
	if (klass->impl_search != NULL)
		klass->impl_search (source, search, cur_text, new_text);
}
Ejemplo n.º 27
0
/**
 * rb_source_get_config_widget:
 * @source: a #RBSource
 * @prefs: the #RBShellPreferences object
 *
 * Source implementations can use this to return an optional
 * configuration widget. The widget will be displayed in a 
 * page in the preferences dialog.
 *
 * Return value: configuration widget
 */
GtkWidget *
rb_source_get_config_widget (RBSource *source,
			     RBShellPreferences *prefs)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);

	if (klass->impl_get_config_widget) {
		return klass->impl_get_config_widget (source, prefs);
	} else {
		return NULL;
	}
}
Ejemplo n.º 28
0
/**
 * rb_source_search:
 * @source: a #RBSource
 * @search: (allow-none): the active #RBSourceSearch instance
 * @cur_text: (allow-none): the current search text
 * @new_text: the new search text
 *
 * Updates the source with new search text.  The source
 * should recreate the database query that feeds into the
 * browser (if any).
 */
void
rb_source_search (RBSource *source,
		  RBSourceSearch *search,
		  const char *cur_text,
		  const char *new_text)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	g_assert (new_text != NULL);

	if (klass->impl_search != NULL)
		klass->impl_search (source, search, cur_text, new_text);
}
Ejemplo n.º 29
0
/**
 * rb_source_add_uri:
 * @source: a #RBSource
 * @uri: a URI to add
 * @title: theoretically, the title of the entity the URI points to
 * @genre: theoretically, the genre of the entity the URI points to
 * @callback: a callback function to call when complete
 * @data: data to pass to the callback
 * @destroy_data: function to call to destroy the callback data
 *
 * Adds an entry corresponding to the URI to the source.  The
 * @title and @genre parameters are not really used.
 */
void
rb_source_add_uri (RBSource *source,
		   const char *uri,
		   const char *title,
		   const char *genre,
		   RBSourceAddCallback callback,
		   gpointer data,
		   GDestroyNotify destroy_data)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	if (klass->impl_add_uri)
		klass->impl_add_uri (source, uri, title, genre, callback, data, destroy_data);
}
Ejemplo n.º 30
0
/**
 * rb_source_get_delete_action:
 * @source: a #RBSource
 *
 * Returns the name of the UI action to use for 'delete'.
 * This allows the source to customise the visible action name
 * and description to better describe what deletion actually does.
 *
 * Return value: allocated string holding UI action name
 */
char *
rb_source_get_delete_action (RBSource *source)
{
	RBSourceClass *klass = RB_SOURCE_GET_CLASS (source);
	return klass->impl_get_delete_action (source);
}