![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
RBHistory; RBHistoryClass; RBHistory* rb_history_new (gboolean truncate_on_play, GFunc destroyer, gpointer destroy_userdata); void rb_history_set_destroy_notify (RBHistory *hist, GFunc destroyer, gpointer destroy_userdata); void rb_history_set_truncate_on_play (RBHistory *hist, gboolean truncate_on_play); void rb_history_set_maximum_size (RBHistory *hist, guint maximum_size); guint rb_history_length (RBHistory *hist); RhythmDBEntry* rb_history_first (RBHistory *hist); RhythmDBEntry* rb_history_previous (RBHistory *hist); RhythmDBEntry* rb_history_current (RBHistory *hist); RhythmDBEntry* rb_history_next (RBHistory *hist); RhythmDBEntry* rb_history_last (RBHistory *hist); void rb_history_go_first (RBHistory *hist); void rb_history_go_previous (RBHistory *hist); void rb_history_go_next (RBHistory *hist); void rb_history_go_last (RBHistory *hist); void rb_history_set_playing (RBHistory *hist, RhythmDBEntry *entry); void rb_history_append (RBHistory *hist, RhythmDBEntry *entry); gint rb_history_get_current_index (RBHistory *hist); void rb_history_insert_at_index (RBHistory *hist, RhythmDBEntry *entry, guint index); void rb_history_remove_entry (RBHistory *hist, RhythmDBEntry *entry); void rb_history_clear (RBHistory *hist); GPtrArray* rb_history_dump (RBHistory *hist); gboolean rb_history_contains_entry (RBHistory *hist, RhythmDBEntry *entry);
"maximum-size" guint : Read / Write "truncate-on-play" gboolean : Read / Write / Construct
RBHistory is a GSequence that maintains a "current" pointer and can delete an arbitrary element in amortized O(log(N)) time. It can call a deletion callback when it removes one of its entries.
All operations take amortized O(log(N)) (worst-case O(N)) time unless noted otherwise.
RBHistory* rb_history_new (gboolean truncate_on_play, GFunc destroyer, gpointer destroy_userdata);
|
Whether rb_history_set_playing() should truncate the history
|
|
function to call when removing an entry from the history |
|
data to pass to destroyer
|
Returns : |
a new RBHistory |
void rb_history_set_destroy_notify (RBHistory *hist, GFunc destroyer, gpointer destroy_userdata);
Sets a new function to call when removing entries from the history.
|
a RBHistory |
|
function to call when removing an entry from the history |
|
data to pass to destroyer
|
void rb_history_set_truncate_on_play (RBHistory *hist, gboolean truncate_on_play);
Sets the 'truncate-on-play' property.
|
a RBHistory |
|
Whether rb_history_set_playing() should truncate the history
|
void rb_history_set_maximum_size (RBHistory *hist, guint maximum_size);
Sets the maximum-size property
|
a RBHistory |
|
new maximum size of the history (or 0 for no limit) |
guint rb_history_length (RBHistory *hist);
|
a RBHistory |
Returns : |
the number of entries in the history |
RhythmDBEntry* rb_history_first (RBHistory *hist);
|
a RBHistory |
Returns : |
the first entry in the history |
RhythmDBEntry* rb_history_previous (RBHistory *hist);
|
a RBHistory |
Returns : |
the RhythmDBEntry before the current position |
RhythmDBEntry* rb_history_current (RBHistory *hist);
|
a RBHistory |
Returns : |
the current RhythmDBEntry, or NULL if there is no current position |
RhythmDBEntry* rb_history_next (RBHistory *hist);
|
a RBHistory |
Returns : |
the RhythmDBEntry after the current position |
RhythmDBEntry* rb_history_last (RBHistory *hist);
|
a RBHistory |
Returns : |
the last RhythmDBEntry in the history |
void rb_history_go_first (RBHistory *hist);
Moves the current position to the first entry in the history
|
a RBHistory |
void rb_history_go_previous (RBHistory *hist);
Moves the current position to the previous entry. If the current position is already at the start of the history, nothing happens.
|
a RBHistory |
void rb_history_go_next (RBHistory *hist);
Moves the current position to the next entry. If the current position is already at the end of the history, nothing happens.
|
a RBHistory |
void rb_history_go_last (RBHistory *hist);
Moves the current position to the last entry in the history
|
a RBHistory |
void rb_history_set_playing (RBHistory *hist, RhythmDBEntry *entry);
Updates the current position to point to the specified entry. If the truncate-on-play property is set, this will remove all entries after that.
|
a RBHistory |
|
the new playing RhythmDBEntry |
void rb_history_append (RBHistory *hist, RhythmDBEntry *entry);
Adds a new entry to the end of the history list. If a size limit is set, an entry may be removed from the start to keep the history list within the limit.
|
a RBHistory |
|
a RhythmDBEntry to append |
gint rb_history_get_current_index (RBHistory *hist);
Gets the index of the current entry. This is guaranteed to be < the history's size, so if the history is empty, it returns -1.
|
a RBHistory |
Returns : |
index of the current entry |
void rb_history_insert_at_index (RBHistory *hist, RhythmDBEntry *entry, guint index);
Inserts entry
at index
within the history list. 0<=index
<=size
|
a RBHistory |
|
a RhythmDBEntry to insert |
|
position at which to insert entry
|
void rb_history_remove_entry (RBHistory *hist, RhythmDBEntry *entry);
Removes the specified entry from the history list.
|
a RBHistory |
|
the RhythmDBEntry to remove |
void rb_history_clear (RBHistory *hist);
Empties the history list.
|
a RBHistory |
GPtrArray* rb_history_dump (RBHistory *hist);
Constructs a copy of the whole history in order. Caller must free the result. The caller does not own any references on the entries in the returned array. Takes O(Nlog(N)) time.
|
a RBHistory |
Returns : |
a copy of the history list |
gboolean rb_history_contains_entry (RBHistory *hist, RhythmDBEntry *entry);
|
a RBHistory |
|
a RhythmDBEntry to check for |
Returns : |
TRUE if the entry is present in the history list. |
"maximum-size"
property"maximum-size" guint : Read / Write
Maximum number of entries to store in the history. If 0, no limit is applied.
Default value: 0
"truncate-on-play"
property"truncate-on-play" gboolean : Read / Write / Construct
If set, rb_history_set_playing()
truncates the rest of the history
Default value: FALSE